refresh 6

This commit is contained in:
n64 2020-02-03 00:51:26 -05:00
parent 9273f38df1
commit 9a801cb96d
236 changed files with 17101 additions and 4820 deletions

View file

@ -1,3 +1,12 @@
Refresh #6
1.) Make tools work on MinGW (#804)
2.) Document mario_misc (#628)
3.) add patch_libmalloc.py script to work around compiler crashes (#811)
4.) Label the coffins file. (#829)
5.) Convert enhancements into patches (#827)
6.) Document Tweester.inc.c (#840)
7.) EU OK and cleanup EU (#782)
Refresh #5 Refresh #5
1.) mem_error_screen.inc.c updated for C (#775) 1.) mem_error_screen.inc.c updated for C (#775)
2.) updated patch_libultra_math to work directly on libultra.a (#781) 2.) updated patch_libultra_math to work directly on libultra.a (#781)

23
Jenkinsfile vendored
View file

@ -17,14 +17,33 @@ pipeline {
sh './extract_assets.py jp us eu' sh './extract_assets.py jp us eu'
} }
} }
stage('Build U Source') {
steps {
sh 'make -j4 VERSION=us'
}
}
stage('Build E Source') {
steps {
sh 'make -j4 VERSION=eu'
}
}
stage('Build J Source') { stage('Build J Source') {
steps { steps {
sh 'make -j4 VERSION=jp' sh 'make -j4 VERSION=jp'
} }
} }
stage('Build U Source') { stage('Test Enhancements') {
steps { steps {
sh 'make -j4 VERSION=us' sh '''
set -e
for f in enhancements/*.patch
do
git clean -fd .
git checkout -- .
echo 'y' | tools/apply_patch.sh "$f"
make -j4 VERSION=us COMPARE=0
done
'''
} }
} }
} }

View file

@ -37,7 +37,6 @@ ifeq ($(VERSION),us)
TARGET := sm64.us TARGET := sm64.us
else else
ifeq ($(VERSION),eu) ifeq ($(VERSION),eu)
$(warning Building EU is experimental and is prone to breaking. Try at your own risk.)
VERSION_CFLAGS := -DVERSION_EU VERSION_CFLAGS := -DVERSION_EU
VERSION_ASFLAGS := --defsym VERSION_EU=1 VERSION_ASFLAGS := --defsym VERSION_EU=1
GRUCODE_CFLAGS := -DF3D_NEW GRUCODE_CFLAGS := -DF3D_NEW
@ -193,7 +192,7 @@ GODDARD_O_FILES := $(foreach file,$(GODDARD_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
DEP_FILES := $(O_FILES:.o=.d) $(ULTRA_O_FILES:.o=.d) $(GODDARD_O_FILES:.o=.d) $(BUILD_DIR)/$(LD_SCRIPT).d DEP_FILES := $(O_FILES:.o=.d) $(ULTRA_O_FILES:.o=.d) $(GODDARD_O_FILES:.o=.d) $(BUILD_DIR)/$(LD_SCRIPT).d
# Files with GLOBAL_ASM blocks # Files with GLOBAL_ASM blocks
GLOBAL_ASM_C_FILES != grep -rl 'GLOBAL_ASM(' $(wildcard src/audio/*.c) $(wildcard src/game/*.c) GLOBAL_ASM_C_FILES != grep -rl 'GLOBAL_ASM(' $(wildcard src/**/*.c)
GLOBAL_ASM_O_FILES = $(foreach file,$(GLOBAL_ASM_C_FILES),$(BUILD_DIR)/$(file:.c=.o)) GLOBAL_ASM_O_FILES = $(foreach file,$(GLOBAL_ASM_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
GLOBAL_ASM_DEP = $(BUILD_DIR)/src/audio/non_matching_dep GLOBAL_ASM_DEP = $(BUILD_DIR)/src/audio/non_matching_dep
@ -316,10 +315,14 @@ $(BUILD_DIR)/include/text_menu_strings.h: include/text_menu_strings.h.in
ifeq ($(VERSION),eu) ifeq ($(VERSION),eu)
TEXT_DIRS := text/de text/us text/fr TEXT_DIRS := text/de text/us text/fr
# EU encoded text inserted into individual segment 0x19 files # EU encoded text inserted into individual segment 0x19 files,
# and course data also duplicated in leveldata.c
$(BUILD_DIR)/bin/eu/translation_en.o: $(BUILD_DIR)/text/us/define_text.inc.c $(BUILD_DIR)/bin/eu/translation_en.o: $(BUILD_DIR)/text/us/define_text.inc.c
$(BUILD_DIR)/bin/eu/translation_de.o: $(BUILD_DIR)/text/de/define_text.inc.c $(BUILD_DIR)/bin/eu/translation_de.o: $(BUILD_DIR)/text/de/define_text.inc.c
$(BUILD_DIR)/bin/eu/translation_fr.o: $(BUILD_DIR)/text/fr/define_text.inc.c $(BUILD_DIR)/bin/eu/translation_fr.o: $(BUILD_DIR)/text/fr/define_text.inc.c
$(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 else
TEXT_DIRS := text/$(VERSION) TEXT_DIRS := text/$(VERSION)
@ -328,6 +331,10 @@ TEXT_DIRS := text/$(VERSION)
$(BUILD_DIR)/bin/segment2.o: $(BUILD_DIR)/text/$(VERSION)/define_text.inc.c $(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 $(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) $< -o $@ -I text/$*/
$(TEXTCONV) charmap.txt $@ $@ $(TEXTCONV) charmap.txt $@ $@
@ -443,6 +450,9 @@ $(BUILD_DIR)/assets/demo_data.c: assets/demo_data.json $(wildcard assets/demos/*
# Source code # Source code
$(BUILD_DIR)/levels/%/leveldata.o: OPT_FLAGS := -g
$(BUILD_DIR)/actors/%.o: OPT_FLAGS := -g
$(BUILD_DIR)/bin/%.o: OPT_FLAGS := -g
$(BUILD_DIR)/src/goddard/%.o: OPT_FLAGS := -g $(BUILD_DIR)/src/goddard/%.o: OPT_FLAGS := -g
$(BUILD_DIR)/src/goddard/%.o: MIPSISET := -mips1 $(BUILD_DIR)/src/goddard/%.o: MIPSISET := -mips1
$(BUILD_DIR)/src/audio/%.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0 $(BUILD_DIR)/src/audio/%.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0
@ -460,6 +470,13 @@ ifeq ($(VERSION),eu)
$(BUILD_DIR)/lib/src/_Litob.o: OPT_FLAGS := -O3 $(BUILD_DIR)/lib/src/_Litob.o: OPT_FLAGS := -O3
$(BUILD_DIR)/lib/src/_Ldtob.o: OPT_FLAGS := -O3 $(BUILD_DIR)/lib/src/_Ldtob.o: OPT_FLAGS := -O3
$(BUILD_DIR)/lib/src/_Printf.o: OPT_FLAGS := -O3 $(BUILD_DIR)/lib/src/_Printf.o: OPT_FLAGS := -O3
$(BUILD_DIR)/lib/src/sprintf.o: OPT_FLAGS := -O3
# enable loop unrolling except for external.c (external.c might also have used
# unrolling, but it makes one loop harder to match)
$(BUILD_DIR)/src/audio/%.o: OPT_FLAGS := -O2
$(BUILD_DIR)/src/audio/load.o: OPT_FLAGS := -O2
$(BUILD_DIR)/src/audio/external.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0
endif endif
ifeq ($(NON_MATCHING),0) ifeq ($(NON_MATCHING),0)

View file

@ -77,9 +77,9 @@ extern const Gfx pokey_seg5_dl_05012808[];
extern const Gfx pokey_seg5_dl_05013078[]; extern const Gfx pokey_seg5_dl_05013078[];
extern const Gfx pokey_seg5_dl_050130B0[]; extern const Gfx pokey_seg5_dl_050130B0[];
// tornado // tweester
extern const Gfx tornado_seg5_dl_05014450[]; extern const Gfx tornado_seg5_dl_05014450[];
extern const Gfx tornado_seg5_dl_050145C0[]; extern const Gfx tornado_seg5_dl_050145C0[];
extern const GeoLayout tornado_seg5_geo_05014630[]; extern const GeoLayout tweester_geo[];
#endif #endif

View file

@ -2,7 +2,7 @@
// 0x170002E0 // 0x170002E0
const GeoLayout mario_geo_face_and_wings[] = { const GeoLayout mario_geo_face_and_wings[] = {
GEO_ASM(0, Geo18_802773A4), GEO_ASM(0, geo_mario_head_rotation),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off), GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off),
@ -32,7 +32,7 @@ const GeoLayout mario_geo_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_80277824), GEO_ASM(0, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_ALPHA, mario_cap_wings), // left GEO_DISPLAY_LIST(LAYER_ALPHA, mario_cap_wings), // left
@ -40,7 +40,7 @@ const GeoLayout mario_geo_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_80277824), GEO_ASM(1, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_ALPHA, mario_cap_wings), // right GEO_DISPLAY_LIST(LAYER_ALPHA, mario_cap_wings), // right
@ -56,7 +56,7 @@ const GeoLayout mario_geo_left_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_802775CC), GEO_ASM(1, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_left_hand_closed), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_left_hand_closed),
@ -76,7 +76,7 @@ const GeoLayout mario_geo_right_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802775CC), GEO_ASM(0, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_right_hand_closed), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_right_hand_closed),
@ -106,7 +106,7 @@ const GeoLayout mario_geo_body[] = {
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_butt), // starts sharing solid color with mario_torso (blue) GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_butt), // starts sharing solid color with mario_torso (blue)
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802B1BB0), GEO_ASM(0, Geo18_802B1BB0),
GEO_ASM(0, Geo18_80277294), GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, mario_torso), GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, mario_torso),
@ -155,7 +155,7 @@ const GeoLayout mario_geo_body[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 67, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 67, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802775CC), GEO_ASM(2, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_right_foot), // stops sharing because foot has its solid color (brown) GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_right_foot), // stops sharing because foot has its solid color (brown)
@ -175,7 +175,7 @@ const GeoLayout mario_geo_medium_poly_left_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_802775CC), GEO_ASM(1, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_medium_poly_left_hand_closed), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_medium_poly_left_hand_closed),
@ -195,7 +195,7 @@ const GeoLayout mario_geo_medium_poly_right_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802775CC), GEO_ASM(0, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_medium_poly_right_hand_closed), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_medium_poly_right_hand_closed),
@ -223,7 +223,7 @@ const GeoLayout mario_geo_medium_poly_body[] = {
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_medium_poly_butt), // starts sharing solid color with mario_torso (blue) GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_medium_poly_butt), // starts sharing solid color with mario_torso (blue)
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802B1BB0), GEO_ASM(0, Geo18_802B1BB0),
GEO_ASM(0, Geo18_80277294), GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, mario_medium_poly_torso), GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, mario_medium_poly_torso),
@ -272,7 +272,7 @@ const GeoLayout mario_geo_medium_poly_body[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 67, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 67, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802775CC), GEO_ASM(2, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_medium_poly_right_foot), // stops sharing because foot has its solid color (brown) GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_medium_poly_right_foot), // stops sharing because foot has its solid color (brown)
@ -288,7 +288,7 @@ const GeoLayout mario_geo_medium_poly_body[] = {
// 0x170009D4 // 0x170009D4
const GeoLayout mario_geo_low_poly_face_and_wings[] = { const GeoLayout mario_geo_low_poly_face_and_wings[] = {
GEO_ASM(0, Geo18_802773A4), GEO_ASM(0, geo_mario_head_rotation),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off), GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off),
@ -318,7 +318,7 @@ const GeoLayout mario_geo_low_poly_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_80277824), GEO_ASM(0, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_ALPHA, mario_cap_wings), // left GEO_DISPLAY_LIST(LAYER_ALPHA, mario_cap_wings), // left
@ -326,7 +326,7 @@ const GeoLayout mario_geo_low_poly_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_80277824), GEO_ASM(1, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_ALPHA, mario_cap_wings), // right GEO_DISPLAY_LIST(LAYER_ALPHA, mario_cap_wings), // right
@ -342,7 +342,7 @@ const GeoLayout mario_geo_low_poly_left_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_802775CC), GEO_ASM(1, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_low_poly_left_hand_closed), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_low_poly_left_hand_closed),
@ -362,7 +362,7 @@ const GeoLayout mario_geo_low_poly_right_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802775CC), GEO_ASM(0, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_low_poly_right_hand_closed), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_low_poly_right_hand_closed),
@ -390,7 +390,7 @@ const GeoLayout mario_geo_low_poly_body[] = {
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_low_poly_butt), // starts sharing solid color with mario_torso (blue) GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_low_poly_butt), // starts sharing solid color with mario_torso (blue)
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802B1BB0), GEO_ASM(0, Geo18_802B1BB0),
GEO_ASM(0, Geo18_80277294), GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, mario_low_poly_torso), GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, mario_low_poly_torso),
@ -439,7 +439,7 @@ const GeoLayout mario_geo_low_poly_body[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 67, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 67, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802775CC), GEO_ASM(2, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_low_poly_right_foot), // stops sharing because foot has its solid color (brown) GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_low_poly_right_foot), // stops sharing because foot has its solid color (brown)
@ -457,7 +457,7 @@ const GeoLayout mario_geo_low_poly_body[] = {
// 0x17000DEC // 0x17000DEC
const GeoLayout mario_vanish_geo_face_and_wings[] = { const GeoLayout mario_vanish_geo_face_and_wings[] = {
GEO_ASM(0, Geo18_802773A4), GEO_ASM(0, geo_mario_head_rotation),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off), GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off),
@ -487,7 +487,7 @@ const GeoLayout mario_vanish_geo_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_80277824), GEO_ASM(0, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_cap_wings_transparent), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_cap_wings_transparent),
@ -495,7 +495,7 @@ const GeoLayout mario_vanish_geo_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_80277824), GEO_ASM(1, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_cap_wings_transparent), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_cap_wings_transparent),
@ -511,7 +511,7 @@ const GeoLayout mario_vanish_geo_left_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_802775CC), GEO_ASM(1, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_left_hand_closed), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_left_hand_closed),
@ -531,7 +531,7 @@ const GeoLayout mario_vanish_geo_right_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802775CC), GEO_ASM(0, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_right_hand_closed), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_right_hand_closed),
@ -561,7 +561,7 @@ const GeoLayout mario_vanish_geo_body[] = {
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_butt), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_butt),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802B1BB0), GEO_ASM(0, Geo18_802B1BB0),
GEO_ASM(0, Geo18_80277294), GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 68, 0, 0, mario_torso), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 68, 0, 0, mario_torso),
@ -610,7 +610,7 @@ const GeoLayout mario_vanish_geo_body[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 67, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 67, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802775CC), GEO_ASM(2, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_right_foot), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_right_foot),
@ -630,7 +630,7 @@ const GeoLayout mario_vanish_geo_medium_poly_left_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_802775CC), GEO_ASM(1, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_medium_poly_left_hand_closed), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_medium_poly_left_hand_closed),
@ -650,7 +650,7 @@ const GeoLayout mario_vanish_geo_medium_poly_right_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802775CC), GEO_ASM(0, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_medium_poly_right_hand_closed), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_medium_poly_right_hand_closed),
@ -678,7 +678,7 @@ const GeoLayout mario_vanish_geo_medium_poly_body[] = {
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_medium_poly_butt), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_medium_poly_butt),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802B1BB0), GEO_ASM(0, Geo18_802B1BB0),
GEO_ASM(0, Geo18_80277294), GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 68, 0, 0, mario_medium_poly_torso), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 68, 0, 0, mario_medium_poly_torso),
@ -727,7 +727,7 @@ const GeoLayout mario_vanish_geo_medium_poly_body[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 67, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 67, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802775CC), GEO_ASM(2, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_medium_poly_right_foot), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_medium_poly_right_foot),
@ -743,7 +743,7 @@ const GeoLayout mario_vanish_geo_medium_poly_body[] = {
// 0x170014E0 // 0x170014E0
const GeoLayout mario_vanish_geo_low_poly_face_and_wings[] = { const GeoLayout mario_vanish_geo_low_poly_face_and_wings[] = {
GEO_ASM(0, Geo18_802773A4), GEO_ASM(0, geo_mario_head_rotation),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off), GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off),
@ -773,7 +773,7 @@ const GeoLayout mario_vanish_geo_low_poly_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_80277824), GEO_ASM(0, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_cap_wings_transparent), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_cap_wings_transparent),
@ -781,7 +781,7 @@ const GeoLayout mario_vanish_geo_low_poly_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_80277824), GEO_ASM(1, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_cap_wings_transparent), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_cap_wings_transparent),
@ -797,7 +797,7 @@ const GeoLayout mario_vanish_geo_low_poly_left_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_802775CC), GEO_ASM(1, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_low_poly_left_hand_closed), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_low_poly_left_hand_closed),
@ -817,7 +817,7 @@ const GeoLayout mario_vanish_geo_low_poly_right_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802775CC), GEO_ASM(0, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_low_poly_right_hand_closed), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_low_poly_right_hand_closed),
@ -845,7 +845,7 @@ const GeoLayout mario_vanish_geo_low_poly_body[] = {
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_low_poly_butt), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_low_poly_butt),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802B1BB0), GEO_ASM(0, Geo18_802B1BB0),
GEO_ASM(0, Geo18_80277294), GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 68, 0, 0, mario_low_poly_torso), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 68, 0, 0, mario_low_poly_torso),
@ -894,7 +894,7 @@ const GeoLayout mario_vanish_geo_low_poly_body[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 67, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 67, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802775CC), GEO_ASM(2, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_low_poly_right_foot), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_low_poly_right_foot),
@ -912,7 +912,7 @@ const GeoLayout mario_vanish_geo_low_poly_body[] = {
// 0x170018F8 // 0x170018F8
const GeoLayout mario_metal_geo_face_and_wings[] = { const GeoLayout mario_metal_geo_face_and_wings[] = {
GEO_ASM(0, Geo18_802773A4), GEO_ASM(0, geo_mario_head_rotation),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off), GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off),
@ -922,7 +922,7 @@ const GeoLayout mario_metal_geo_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_80277824), GEO_ASM(0, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_ALPHA, mario_metal_cap_wings), // left GEO_DISPLAY_LIST(LAYER_ALPHA, mario_metal_cap_wings), // left
@ -930,7 +930,7 @@ const GeoLayout mario_metal_geo_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_80277824), GEO_ASM(1, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_ALPHA, mario_metal_cap_wings), // right GEO_DISPLAY_LIST(LAYER_ALPHA, mario_metal_cap_wings), // right
@ -946,7 +946,7 @@ const GeoLayout mario_metal_geo_left_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_802775CC), GEO_ASM(1, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_left_hand_closed_shared_dl), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_left_hand_closed_shared_dl),
@ -966,7 +966,7 @@ const GeoLayout mario_metal_geo_right_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802775CC), GEO_ASM(0, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_metal_right_hand_closed), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_metal_right_hand_closed),
@ -996,7 +996,7 @@ const GeoLayout mario_metal_geo_body[] = {
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_metal_butt), // starts sharing metal texture with the dls below GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_metal_butt), // starts sharing metal texture with the dls below
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802B1BB0), GEO_ASM(0, Geo18_802B1BB0),
GEO_ASM(0, Geo18_80277294), GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, mario_metal_torso_shared_dl), GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, mario_metal_torso_shared_dl),
@ -1045,7 +1045,7 @@ const GeoLayout mario_metal_geo_body[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 67, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 67, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802775CC), GEO_ASM(2, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_metal_right_foot), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_metal_right_foot),
@ -1065,7 +1065,7 @@ const GeoLayout mario_metal_geo_medium_poly_left_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_802775CC), GEO_ASM(1, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_medium_poly_left_hand_closed_shared_dl), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_medium_poly_left_hand_closed_shared_dl),
@ -1085,7 +1085,7 @@ const GeoLayout mario_metal_geo_medium_poly_right_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802775CC), GEO_ASM(0, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_metal_medium_poly_right_hand_closed), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_metal_medium_poly_right_hand_closed),
@ -1113,7 +1113,7 @@ const GeoLayout mario_metal_geo_medium_poly_body[] = {
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_metal_medium_poly_butt), GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_metal_medium_poly_butt),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802B1BB0), GEO_ASM(0, Geo18_802B1BB0),
GEO_ASM(0, Geo18_80277294), GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, mario_metal_medium_poly_torso), GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, mario_metal_medium_poly_torso),
@ -1162,7 +1162,7 @@ const GeoLayout mario_metal_geo_medium_poly_body[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 67, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 67, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802775CC), GEO_ASM(2, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_metal_medium_poly_right_foot), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_metal_medium_poly_right_foot),
@ -1178,7 +1178,7 @@ const GeoLayout mario_metal_geo_medium_poly_body[] = {
// 0x17001F5C // 0x17001F5C
const GeoLayout mario_metal_geo_low_poly_face_and_wings[] = { const GeoLayout mario_metal_geo_low_poly_face_and_wings[] = {
GEO_ASM(0, Geo18_802773A4), GEO_ASM(0, geo_mario_head_rotation),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off), GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off),
@ -1188,7 +1188,7 @@ const GeoLayout mario_metal_geo_low_poly_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_80277824), GEO_ASM(0, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_ALPHA, mario_metal_cap_wings), GEO_DISPLAY_LIST(LAYER_ALPHA, mario_metal_cap_wings),
@ -1196,7 +1196,7 @@ const GeoLayout mario_metal_geo_low_poly_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_80277824), GEO_ASM(1, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_ALPHA, mario_metal_cap_wings), GEO_DISPLAY_LIST(LAYER_ALPHA, mario_metal_cap_wings),
@ -1212,7 +1212,7 @@ const GeoLayout mario_metal_geo_low_poly_left_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_802775CC), GEO_ASM(1, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_low_poly_left_hand_closed_shared_dl), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_low_poly_left_hand_closed_shared_dl),
@ -1232,7 +1232,7 @@ const GeoLayout mario_metal_geo_low_poly_right_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802775CC), GEO_ASM(0, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_metal_low_poly_right_hand_closed), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_metal_low_poly_right_hand_closed),
@ -1260,7 +1260,7 @@ const GeoLayout mario_metal_geo_low_poly_body[] = {
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_metal_low_poly_butt), GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_metal_low_poly_butt),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802B1BB0), GEO_ASM(0, Geo18_802B1BB0),
GEO_ASM(0, Geo18_80277294), GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, mario_metal_low_poly_torso), GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, mario_metal_low_poly_torso),
@ -1309,7 +1309,7 @@ const GeoLayout mario_metal_geo_low_poly_body[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 67, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_OPAQUE, 67, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802775CC), GEO_ASM(2, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_metal_low_poly_right_foot), GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_metal_low_poly_right_foot),
@ -1327,7 +1327,7 @@ const GeoLayout mario_metal_geo_low_poly_body[] = {
// 0x170022E4 // 0x170022E4
const GeoLayout mario_metal_vanish_geo_face_and_wings[] = { const GeoLayout mario_metal_vanish_geo_face_and_wings[] = {
GEO_ASM(0, Geo18_802773A4), GEO_ASM(0, geo_mario_head_rotation),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off), GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off),
@ -1337,7 +1337,7 @@ const GeoLayout mario_metal_vanish_geo_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_80277824), GEO_ASM(0, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_cap_wings_transparent), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_cap_wings_transparent),
@ -1345,7 +1345,7 @@ const GeoLayout mario_metal_vanish_geo_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_80277824), GEO_ASM(1, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_cap_wings_transparent), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_cap_wings_transparent),
@ -1361,7 +1361,7 @@ const GeoLayout mario_metal_vanish_geo_left_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_802775CC), GEO_ASM(1, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_left_hand_closed_shared_dl), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_left_hand_closed_shared_dl),
@ -1381,7 +1381,7 @@ const GeoLayout mario_metal_vanish_geo_right_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802775CC), GEO_ASM(0, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_right_hand_closed), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_right_hand_closed),
@ -1411,7 +1411,7 @@ const GeoLayout mario_metal_vanish_geo_body[] = {
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_metal_butt), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_metal_butt),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802B1BB0), GEO_ASM(0, Geo18_802B1BB0),
GEO_ASM(0, Geo18_80277294), GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 68, 0, 0, mario_metal_torso_shared_dl), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 68, 0, 0, mario_metal_torso_shared_dl),
@ -1460,7 +1460,7 @@ const GeoLayout mario_metal_vanish_geo_body[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 67, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 67, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802775CC), GEO_ASM(2, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_right_foot), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_right_foot),
@ -1480,7 +1480,7 @@ const GeoLayout mario_metal_vanish_geo_medium_poly_left_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_802775CC), GEO_ASM(1, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_medium_poly_left_hand_closed_shared_dl), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_medium_poly_left_hand_closed_shared_dl),
@ -1500,7 +1500,7 @@ const GeoLayout mario_metal_vanish_geo_medium_poly_right_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802775CC), GEO_ASM(0, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_medium_poly_right_hand_closed), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_medium_poly_right_hand_closed),
@ -1528,7 +1528,7 @@ const GeoLayout mario_metal_vanish_geo_medium_poly_body[] = {
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_metal_medium_poly_butt), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_metal_medium_poly_butt),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802B1BB0), GEO_ASM(0, Geo18_802B1BB0),
GEO_ASM(0, Geo18_80277294), GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 68, 0, 0, mario_metal_medium_poly_torso), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 68, 0, 0, mario_metal_medium_poly_torso),
@ -1580,7 +1580,7 @@ const GeoLayout mario_metal_vanish_geo_medium_poly_body[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 67, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 67, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802775CC), GEO_ASM(2, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_medium_poly_right_foot), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_medium_poly_right_foot),
@ -1596,7 +1596,7 @@ const GeoLayout mario_metal_vanish_geo_medium_poly_body[] = {
// 0x17002958 // 0x17002958
const GeoLayout mario_metal_vanish_geo_low_poly_face_and_wings[] = { const GeoLayout mario_metal_vanish_geo_low_poly_face_and_wings[] = {
GEO_ASM(0, Geo18_802773A4), GEO_ASM(0, geo_mario_head_rotation),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off), GEO_SWITCH_CASE(0, geo_switch_mario_cap_on_off),
@ -1606,7 +1606,7 @@ const GeoLayout mario_metal_vanish_geo_low_poly_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, -126, 22, -40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_80277824), GEO_ASM(0, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_cap_wings_transparent), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_cap_wings_transparent),
@ -1614,7 +1614,7 @@ const GeoLayout mario_metal_vanish_geo_low_poly_face_and_wings[] = {
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135), GEO_TRANSLATE_ROTATE(0, 142, -51, 126, -22, 40, -135),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_80277824), GEO_ASM(1, geo_mario_rotate_wing_cap_wings),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_cap_wings_transparent), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_cap_wings_transparent),
@ -1630,7 +1630,7 @@ const GeoLayout mario_metal_vanish_geo_low_poly_left_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(1, Geo18_802775CC), GEO_ASM(1, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_low_poly_left_hand_closed_shared_dl), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_low_poly_left_hand_closed_shared_dl),
@ -1650,7 +1650,7 @@ const GeoLayout mario_metal_vanish_geo_low_poly_right_hand[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 60, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802775CC), GEO_ASM(0, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_low_poly_right_hand_closed), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_low_poly_right_hand_closed),
@ -1678,7 +1678,7 @@ const GeoLayout mario_metal_vanish_geo_low_poly_body[] = {
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_metal_low_poly_butt), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_metal_low_poly_butt),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, Geo18_802B1BB0), GEO_ASM(0, Geo18_802B1BB0),
GEO_ASM(0, Geo18_80277294), GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0), GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 68, 0, 0, mario_metal_low_poly_torso), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 68, 0, 0, mario_metal_low_poly_torso),
@ -1727,7 +1727,7 @@ const GeoLayout mario_metal_vanish_geo_low_poly_body[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 67, 0, 0, NULL), GEO_ANIMATED_PART(LAYER_TRANSPARENT, 67, 0, 0, NULL),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802775CC), GEO_ASM(2, geo_mario_hand_foot_scaler),
GEO_SCALE(0x00, 65536), GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_low_poly_right_foot), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mario_metal_low_poly_right_foot),
@ -1812,7 +1812,7 @@ const GeoLayout mario_geo[] = {
GEO_SCALE(0x00, 16384), GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(0, geo_mirror_mario_backface_culling), GEO_ASM(0, geo_mirror_mario_backface_culling),
GEO_ASM(0, Geo18_802770A4), GEO_ASM(0, geo_mirror_mario_set_alpha),
GEO_SWITCH_CASE(0, geo_switch_mario_stand_run), GEO_SWITCH_CASE(0, geo_switch_mario_stand_run),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_BRANCH(1, mario_geo_load_body), GEO_BRANCH(1, mario_geo_load_body),

View file

@ -1,5 +1,5 @@
// 0x05014630 // 0x05014630
const GeoLayout tornado_seg5_geo_05014630[] = { const GeoLayout tweester_geo[] = {
GEO_CULLING_RADIUS(5000), GEO_CULLING_RADIUS(5000),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, tornado_seg5_dl_050145C0), GEO_DISPLAY_LIST(LAYER_TRANSPARENT, tornado_seg5_dl_050145C0),

View file

@ -0,0 +1,269 @@
glabel alloc_bank_or_seq
/* 0A1B94 802E2394 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 0A1B98 802E2398 AFB20020 */ sw $s2, 0x20($sp)
/* 0A1B9C 802E239C 00C09025 */ move $s2, $a2
/* 0A1BA0 802E23A0 AFB1001C */ sw $s1, 0x1c($sp)
/* 0A1BA4 802E23A4 AFB00018 */ sw $s0, 0x18($sp)
/* 0A1BA8 802E23A8 00A08025 */ move $s0, $a1
/* 0A1BAC 802E23AC 00808825 */ move $s1, $a0
/* 0A1BB0 802E23B0 2406000C */ li $a2, 12
/* 0A1BB4 802E23B4 AFBF0024 */ sw $ra, 0x24($sp)
/* 0A1BB8 802E23B8 8FA90068 */ lw $t1, 0x68($sp)
/* 0A1BBC 802E23BC 24080001 */ li $t0, 1
.L80200850:
/* 0A1BC0 802E23C0 14E000AD */ bnez $a3, .L80200B08
/* 0A1BC4 802E23C4 3C0E8022 */ lui $t6, %hi(gSeqLoadedPool) # $t6, 0x8022
/* 0A1BC8 802E23C8 25CE2670 */ addiu $t6, %lo(gSeqLoadedPool) # addiu $t6, $t6, 0x2670
/* 0A1BCC 802E23CC 162E0006 */ bne $s1, $t6, .L80200878
/* 0A1BD0 802E23D0 26300194 */ addiu $s0, $s1, 0x194
/* 0A1BD4 802E23D4 3C058022 */ lui $a1, %hi(gSeqLoadStatus) # $a1, 0x8022
/* 0A1BD8 802E23D8 24A52C58 */ addiu $a1, %lo(gSeqLoadStatus) # addiu $a1, $a1, 0x2c58
/* 0A1BDC 802E23DC AFA5003C */ sw $a1, 0x3c($sp)
/* 0A1BE0 802E23E0 10000009 */ b .L80200898
/* 0A1BE4 802E23E4 A3A0003B */ sb $zero, 0x3b($sp)
.L80200878:
/* 0A1BE8 802E23E8 3C0F8022 */ lui $t7, %hi(gBankLoadedPool) # $t7, 0x8022
/* 0A1BEC 802E23EC 25EF2840 */ addiu $t7, %lo(gBankLoadedPool) # addiu $t7, $t7, 0x2840
/* 0A1BF0 802E23F0 162F0005 */ bne $s1, $t7, .L80200898
/* 0A1BF4 802E23F4 3C058022 */ lui $a1, %hi(gBankLoadStatus) # $a1, 0x8022
/* 0A1BF8 802E23F8 24A52C18 */ addiu $a1, %lo(gBankLoadStatus) # addiu $a1, $a1, 0x2c18
/* 0A1BFC 802E23FC 240A0001 */ li $t2, 1
/* 0A1C00 802E2400 A3AA003B */ sb $t2, 0x3b($sp)
/* 0A1C04 802E2404 AFA5003C */ sw $a1, 0x3c($sp)
.L80200898:
/* 0A1C08 802E2408 8E02001C */ lw $v0, 0x1c($s0)
/* 0A1C0C 802E240C 2407FFFF */ li $a3, -1
/* 0A1C10 802E2410 8FA5003C */ lw $a1, 0x3c($sp)
/* 0A1C14 802E2414 14E20003 */ bne $a3, $v0, .L802008B4
/* 0A1C18 802E2418 93AA003B */ lbu $t2, 0x3b($sp)
/* 0A1C1C 802E241C 10000003 */ b .L802008BC
/* 0A1C20 802E2420 00001825 */ move $v1, $zero
.L802008B4:
/* 0A1C24 802E2424 0045C021 */ addu $t8, $v0, $a1
/* 0A1C28 802E2428 93030000 */ lbu $v1, ($t8)
.L802008BC:
/* 0A1C2C 802E242C 8E020028 */ lw $v0, 0x28($s0)
/* 0A1C30 802E2430 14E20003 */ bne $a3, $v0, .L802008D0
/* 0A1C34 802E2434 0045C821 */ addu $t9, $v0, $a1
/* 0A1C38 802E2438 10000002 */ b .L802008D4
/* 0A1C3C 802E243C 00002025 */ move $a0, $zero
.L802008D0:
/* 0A1C40 802E2440 93240000 */ lbu $a0, ($t9)
.L802008D4:
/* 0A1C44 802E2444 14600003 */ bnez $v1, .L802008E4
/* 0A1C48 802E2448 00601025 */ move $v0, $v1
/* 0A1C4C 802E244C 1000001D */ b .L80200954
/* 0A1C50 802E2450 AE000000 */ sw $zero, ($s0)
.L802008E4:
/* 0A1C54 802E2454 14800004 */ bnez $a0, .L802008F8
/* 0A1C58 802E2458 00801825 */ move $v1, $a0
/* 0A1C5C 802E245C 240B0001 */ li $t3, 1
/* 0A1C60 802E2460 10000018 */ b .L80200954
/* 0A1C64 802E2464 AE0B0000 */ sw $t3, ($s0)
.L802008F8:
/* 0A1C68 802E2468 24040003 */ li $a0, 3
/* 0A1C6C 802E246C 14820003 */ bne $a0, $v0, .L8020090C
/* 0A1C70 802E2470 00000000 */ nop
/* 0A1C74 802E2474 50830014 */ beql $a0, $v1, .L80200958
/* 0A1C78 802E2478 8E0E0000 */ lw $t6, ($s0)
.L8020090C:
/* 0A1C7C 802E247C 14820003 */ bne $a0, $v0, .L8020091C
/* 0A1C80 802E2480 00000000 */ nop
/* 0A1C84 802E2484 1000000F */ b .L80200954
/* 0A1C88 802E2488 AE000000 */ sw $zero, ($s0)
.L8020091C:
/* 0A1C8C 802E248C 14830003 */ bne $a0, $v1, .L8020092C
/* 0A1C90 802E2490 240C0001 */ li $t4, 1
/* 0A1C94 802E2494 1000000B */ b .L80200954
/* 0A1C98 802E2498 AE0C0000 */ sw $t4, ($s0)
.L8020092C:
/* 0A1C9C 802E249C 11020003 */ beq $t0, $v0, .L8020093C
/* 0A1CA0 802E24A0 00000000 */ nop
/* 0A1CA4 802E24A4 10000007 */ b .L80200954
/* 0A1CA8 802E24A8 AE000000 */ sw $zero, ($s0)
.L8020093C:
/* 0A1CAC 802E24AC 11030003 */ beq $t0, $v1, .L8020094C
/* 0A1CB0 802E24B0 240D0001 */ li $t5, 1
/* 0A1CB4 802E24B4 10000003 */ b .L80200954
/* 0A1CB8 802E24B8 AE0D0000 */ sw $t5, ($s0)
.L8020094C:
/* 0A1CBC 802E24BC 10000099 */ b .L80200BB4
/* 0A1CC0 802E24C0 00001025 */ move $v0, $zero
.L80200954:
/* 0A1CC4 802E24C4 8E0E0000 */ lw $t6, ($s0)
.L80200958:
/* 0A1CC8 802E24C8 01C60019 */ multu $t6, $a2
/* 0A1CCC 802E24CC 00007812 */ mflo $t7
/* 0A1CD0 802E24D0 020FC021 */ addu $t8, $s0, $t7
/* 0A1CD4 802E24D4 8F02001C */ lw $v0, 0x1c($t8)
/* 0A1CD8 802E24D8 10E20010 */ beq $a3, $v0, .L802009AC
/* 0A1CDC 802E24DC 00A2C821 */ addu $t9, $a1, $v0
/* 0A1CE0 802E24E0 150A000E */ bne $t0, $t2, .L802009AC
/* 0A1CE4 802E24E4 A3200000 */ sb $zero, ($t9)
/* 0A1CE8 802E24E8 8E0B0000 */ lw $t3, ($s0)
/* 0A1CEC 802E24EC 01660019 */ multu $t3, $a2
/* 0A1CF0 802E24F0 00006012 */ mflo $t4
/* 0A1CF4 802E24F4 020C6821 */ addu $t5, $s0, $t4
/* 0A1CF8 802E24F8 8DA4001C */ lw $a0, 0x1c($t5)
/* 0A1CFC 802E24FC A3AA003B */ sb $t2, 0x3b($sp)
/* 0A1D00 802E2500 AFA90068 */ sw $t1, 0x68($sp)
/* 0A1D04 802E2504 0C0B87A3 */ jal discard_bank
/* 0A1D08 802E2508 AFA5003C */ sw $a1, 0x3c($sp)
/* 0A1D0C 802E250C 8FA5003C */ lw $a1, 0x3c($sp)
/* 0A1D10 802E2510 24080001 */ li $t0, 1
/* 0A1D14 802E2514 8FA90068 */ lw $t1, 0x68($sp)
/* 0A1D18 802E2518 93AA003B */ lbu $t2, 0x3b($sp)
.L802009AC:
/* 0A1D1C 802E251C 8E040000 */ lw $a0, ($s0)
/* 0A1D20 802E2520 24010001 */ li $at, 1
/* 0A1D24 802E2524 26230198 */ addiu $v1, $s1, 0x198
/* 0A1D28 802E2528 50800006 */ beql $a0, $zero, .L802009D4
/* 0A1D2C 802E252C 8C6E0000 */ lw $t6, ($v1)
/* 0A1D30 802E2530 1081002B */ beq $a0, $at, .L80200A70
/* 0A1D34 802E2534 26230198 */ addiu $v1, $s1, 0x198
/* 0A1D38 802E2538 1000007A */ b .L80200BB4
/* 0A1D3C 802E253C 00001025 */ move $v0, $zero
/* 0A1D40 802E2540 8C6E0000 */ lw $t6, ($v1)
.L802009D4:
/* 0A1D44 802E2544 AE09001C */ sw $t1, 0x1c($s0)
/* 0A1D48 802E2548 AE120018 */ sw $s2, 0x18($s0)
/* 0A1D4C 802E254C AE0E0014 */ sw $t6, 0x14($s0)
/* 0A1D50 802E2550 8C6F0000 */ lw $t7, ($v1)
/* 0A1D54 802E2554 01F21021 */ addu $v0, $t7, $s2
/* 0A1D58 802E2558 AC620004 */ sw $v0, 4($v1)
/* 0A1D5C 802E255C 8E180020 */ lw $t8, 0x20($s0)
/* 0A1D60 802E2560 0302082B */ sltu $at, $t8, $v0
/* 0A1D64 802E2564 50200019 */ beql $at, $zero, .L80200A5C
/* 0A1D68 802E2568 8E030014 */ lw $v1, 0x14($s0)
/* 0A1D6C 802E256C 8E190028 */ lw $t9, 0x28($s0)
/* 0A1D70 802E2570 00B95821 */ addu $t3, $a1, $t9
/* 0A1D74 802E2574 11400005 */ beqz $t2, .L80200A1C
/* 0A1D78 802E2578 A1600000 */ sb $zero, ($t3)
/* 0A1D7C 802E257C 51480009 */ beql $t2, $t0, .L80200A34
/* 0A1D80 802E2580 8E040028 */ lw $a0, 0x28($s0)
/* 0A1D84 802E2584 1000000B */ b .L80200A44
/* 0A1D88 802E2588 240CFFFF */ li $t4, -1
.L80200A1C:
/* 0A1D8C 802E258C 8E040028 */ lw $a0, 0x28($s0)
/* 0A1D90 802E2590 0C0B87DC */ jal discard_sequence
/* 0A1D94 802E2594 AFA3002C */ sw $v1, 0x2c($sp)
/* 0A1D98 802E2598 10000005 */ b .L80200A40
/* 0A1D9C 802E259C 8FA3002C */ lw $v1, 0x2c($sp)
/* 0A1DA0 802E25A0 8E040028 */ lw $a0, 0x28($s0)
.L80200A34:
/* 0A1DA4 802E25A4 0C0B87A3 */ jal discard_bank
/* 0A1DA8 802E25A8 AFA3002C */ sw $v1, 0x2c($sp)
/* 0A1DAC 802E25AC 8FA3002C */ lw $v1, 0x2c($sp)
.L80200A40:
/* 0A1DB0 802E25B0 240CFFFF */ li $t4, -1
.L80200A44:
/* 0A1DB4 802E25B4 AE0C0028 */ sw $t4, 0x28($s0)
/* 0A1DB8 802E25B8 8C6E0008 */ lw $t6, 8($v1)
/* 0A1DBC 802E25BC 8C6D0000 */ lw $t5, ($v1)
/* 0A1DC0 802E25C0 01AE7821 */ addu $t7, $t5, $t6
/* 0A1DC4 802E25C4 AE0F0020 */ sw $t7, 0x20($s0)
/* 0A1DC8 802E25C8 8E030014 */ lw $v1, 0x14($s0)
.L80200A5C:
/* 0A1DCC 802E25CC 8E180000 */ lw $t8, ($s0)
/* 0A1DD0 802E25D0 00601025 */ move $v0, $v1
/* 0A1DD4 802E25D4 3B190001 */ xori $t9, $t8, 1
/* 0A1DD8 802E25D8 10000052 */ b .L80200BB4
/* 0A1DDC 802E25DC AE190000 */ sw $t9, ($s0)
.L80200A70:
/* 0A1DE0 802E25E0 8C6B0000 */ lw $t3, ($v1)
/* 0A1DE4 802E25E4 8C6C0008 */ lw $t4, 8($v1)
/* 0A1DE8 802E25E8 AE090028 */ sw $t1, 0x28($s0)
/* 0A1DEC 802E25EC AE120024 */ sw $s2, 0x24($s0)
/* 0A1DF0 802E25F0 016C6821 */ addu $t5, $t3, $t4
/* 0A1DF4 802E25F4 01B27023 */ subu $t6, $t5, $s2
/* 0A1DF8 802E25F8 25C2FFF0 */ addiu $v0, $t6, -0x10
/* 0A1DFC 802E25FC AE020020 */ sw $v0, 0x20($s0)
/* 0A1E00 802E2600 8C780004 */ lw $t8, 4($v1)
/* 0A1E04 802E2604 0058082B */ sltu $at, $v0, $t8
/* 0A1E08 802E2608 10200017 */ beqz $at, .L80200AF8
/* 0A1E0C 802E260C 00000000 */ nop
/* 0A1E10 802E2610 8E19001C */ lw $t9, 0x1c($s0)
/* 0A1E14 802E2614 00B95821 */ addu $t3, $a1, $t9
/* 0A1E18 802E2618 11400005 */ beqz $t2, .L80200AC0
/* 0A1E1C 802E261C A1600000 */ sb $zero, ($t3)
/* 0A1E20 802E2620 51480009 */ beql $t2, $t0, .L80200AD8
/* 0A1E24 802E2624 8E04001C */ lw $a0, 0x1c($s0)
/* 0A1E28 802E2628 1000000B */ b .L80200AE8
/* 0A1E2C 802E262C 240CFFFF */ li $t4, -1
.L80200AC0:
/* 0A1E30 802E2630 8E04001C */ lw $a0, 0x1c($s0)
/* 0A1E34 802E2634 0C0B87DC */ jal discard_sequence
/* 0A1E38 802E2638 AFA3002C */ sw $v1, 0x2c($sp)
/* 0A1E3C 802E263C 10000005 */ b .L80200AE4
/* 0A1E40 802E2640 8FA3002C */ lw $v1, 0x2c($sp)
/* 0A1E44 802E2644 8E04001C */ lw $a0, 0x1c($s0)
.L80200AD8:
/* 0A1E48 802E2648 0C0B87A3 */ jal discard_bank
/* 0A1E4C 802E264C AFA3002C */ sw $v1, 0x2c($sp)
/* 0A1E50 802E2650 8FA3002C */ lw $v1, 0x2c($sp)
.L80200AE4:
/* 0A1E54 802E2654 240CFFFF */ li $t4, -1
.L80200AE8:
/* 0A1E58 802E2658 AE0C001C */ sw $t4, 0x1c($s0)
/* 0A1E5C 802E265C 8C6D0000 */ lw $t5, ($v1)
/* 0A1E60 802E2660 AC6D0004 */ sw $t5, 4($v1)
/* 0A1E64 802E2664 8E020020 */ lw $v0, 0x20($s0)
.L80200AF8:
/* 0A1E68 802E2668 1000FFD8 */ b .L80200A5C
/* 0A1E6C 802E266C 00401825 */ move $v1, $v0
/* 0A1E70 802E2670 1000002C */ b .L80200BB4
/* 0A1E74 802E2674 00001025 */ move $v0, $zero
.L80200B08:
/* 0A1E78 802E2678 02120019 */ multu $s0, $s2
/* 0A1E7C 802E267C 26240004 */ addiu $a0, $s1, 4
/* 0A1E80 802E2680 AFA70064 */ sw $a3, 0x64($sp)
/* 0A1E84 802E2684 AFA90068 */ sw $t1, 0x68($sp)
/* 0A1E88 802E2688 00002812 */ mflo $a1
/* 0A1E8C 802E268C 0C0B87F8 */ jal soundAlloc
/* 0A1E90 802E2690 00000000 */ nop
/* 0A1E94 802E2694 8E2E0000 */ lw $t6, ($s1)
/* 0A1E98 802E2698 2406000C */ li $a2, 12
/* 0A1E9C 802E269C 8FA70064 */ lw $a3, 0x64($sp)
/* 0A1EA0 802E26A0 01C60019 */ multu $t6, $a2
/* 0A1EA4 802E26A4 8FA90068 */ lw $t1, 0x68($sp)
/* 0A1EA8 802E26A8 24080001 */ li $t0, 1
/* 0A1EAC 802E26AC 24010002 */ li $at, 2
/* 0A1EB0 802E26B0 00007812 */ mflo $t7
/* 0A1EB4 802E26B4 022FC021 */ addu $t8, $s1, $t7
/* 0A1EB8 802E26B8 14400009 */ bnez $v0, .L80200B70
/* 0A1EBC 802E26BC AF020014 */ sw $v0, 0x14($t8)
/* 0A1EC0 802E26C0 10E80005 */ beq $a3, $t0, .L80200B68
/* 0A1EC4 802E26C4 00000000 */ nop
/* 0A1EC8 802E26C8 54E10006 */ bnel $a3, $at, .L80200B74
/* 0A1ECC 802E26CC 8E390000 */ lw $t9, ($s1)
/* 0A1ED0 802E26D0 1000FF3B */ b .L80200850
/* 0A1ED4 802E26D4 00003825 */ move $a3, $zero
.L80200B68:
/* 0A1ED8 802E26D8 10000012 */ b .L80200BB4
/* 0A1EDC 802E26DC 00001025 */ move $v0, $zero
.L80200B70:
/* 0A1EE0 802E26E0 8E390000 */ lw $t9, ($s1)
.L80200B74:
/* 0A1EE4 802E26E4 03260019 */ multu $t9, $a2
/* 0A1EE8 802E26E8 00005812 */ mflo $t3
/* 0A1EEC 802E26EC 022B6021 */ addu $t4, $s1, $t3
/* 0A1EF0 802E26F0 AD89001C */ sw $t1, 0x1c($t4)
/* 0A1EF4 802E26F4 8E2D0000 */ lw $t5, ($s1)
/* 0A1EF8 802E26F8 01A60019 */ multu $t5, $a2
/* 0A1EFC 802E26FC 00007012 */ mflo $t6
/* 0A1F00 802E2700 022E7821 */ addu $t7, $s1, $t6
/* 0A1F04 802E2704 ADF20018 */ sw $s2, 0x18($t7)
/* 0A1F08 802E2708 8E230000 */ lw $v1, ($s1)
/* 0A1F0C 802E270C 00660019 */ multu $v1, $a2
/* 0A1F10 802E2710 246B0001 */ addiu $t3, $v1, 1
/* 0A1F14 802E2714 0000C012 */ mflo $t8
/* 0A1F18 802E2718 0238C821 */ addu $t9, $s1, $t8
/* 0A1F1C 802E271C 8F220014 */ lw $v0, 0x14($t9)
/* 0A1F20 802E2720 AE2B0000 */ sw $t3, ($s1)
.L80200BB4:
/* 0A1F24 802E2724 8FBF0024 */ lw $ra, 0x24($sp)
/* 0A1F28 802E2728 8FB00018 */ lw $s0, 0x18($sp)
/* 0A1F2C 802E272C 8FB1001C */ lw $s1, 0x1c($sp)
/* 0A1F30 802E2730 8FB20020 */ lw $s2, 0x20($sp)
/* 0A1F34 802E2734 03E00008 */ jr $ra
/* 0A1F38 802E2738 27BD0058 */ addiu $sp, $sp, 0x58

View file

@ -0,0 +1,88 @@
glabel func_eu_802e00d8
/* 09F8D8 802E00D8 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 09F8DC 802E00DC AFA50034 */ sw $a1, 0x34($sp)
/* 09F8E0 802E00E0 87B80036 */ lh $t8, 0x36($sp)
/* 09F8E4 802E00E4 3C088022 */ lui $t0, %hi(gSynthesisReverbs) # $t0, 0x8022
/* 09F8E8 802E00E8 2508C1B0 */ addiu $t0, %lo(gSynthesisReverbs) # addiu $t0, $t0, -0x3e50
/* 09F8EC 802E00EC 0018C940 */ sll $t9, $t8, 5
/* 09F8F0 802E00F0 0338C821 */ addu $t9, $t9, $t8
/* 09F8F4 802E00F4 0019C8C0 */ sll $t9, $t9, 3
/* 09F8F8 802E00F8 03281021 */ addu $v0, $t9, $t0
/* 09F8FC 802E00FC 90490003 */ lbu $t1, 3($v0)
/* 09F900 802E0100 00067400 */ sll $t6, $a2, 0x10
/* 09F904 802E0104 000E7C03 */ sra $t7, $t6, 0x10
/* 09F908 802E0108 00095080 */ sll $t2, $t1, 2
/* 09F90C 802E010C 01495023 */ subu $t2, $t2, $t1
/* 09F910 802E0110 000A50C0 */ sll $t2, $t2, 3
/* 09F914 802E0114 000F3880 */ sll $a3, $t7, 2
/* 09F918 802E0118 01495021 */ addu $t2, $t2, $t1
/* 09F91C 802E011C 904C0001 */ lbu $t4, 1($v0)
/* 09F920 802E0120 000A5080 */ sll $t2, $t2, 2
/* 09F924 802E0124 00EF3821 */ addu $a3, $a3, $t7
/* 09F928 802E0128 00073880 */ sll $a3, $a3, 2
/* 09F92C 802E012C 004A5821 */ addu $t3, $v0, $t2
/* 09F930 802E0130 AFB00020 */ sw $s0, 0x20($sp)
/* 09F934 802E0134 01671821 */ addu $v1, $t3, $a3
/* 09F938 802E0138 00808025 */ move $s0, $a0
/* 09F93C 802E013C AFBF0024 */ sw $ra, 0x24($sp)
/* 09F940 802E0140 AFA60038 */ sw $a2, 0x38($sp)
/* 09F944 802E0144 11800033 */ beqz $t4, .L80200BC4
/* 09F948 802E0148 24630030 */ addiu $v1, $v1, 0x30
/* 09F94C 802E014C 904D0004 */ lbu $t5, 4($v0)
/* 09F950 802E0150 24010001 */ li $at, 1
/* 09F954 802E0154 3C190800 */ lui $t9, 0x800
/* 09F958 802E0158 15A10018 */ bne $t5, $at, .L80200B6C
/* 09F95C 802E015C 3C080740 */ lui $t0, (0x07400280 >> 16) # lui $t0, 0x740
/* 09F960 802E0160 87AE0036 */ lh $t6, 0x36($sp)
/* 09F964 802E0164 9466000E */ lhu $a2, 0xe($v1)
/* 09F968 802E0168 84670010 */ lh $a3, 0x10($v1)
/* 09F96C 802E016C AFA3002C */ sw $v1, 0x2c($sp)
/* 09F970 802E0170 24050740 */ li $a1, 1856
/* 09F974 802E0174 0C0B7E65 */ jal synthesis_save_reverb_ring_buffer
/* 09F978 802E0178 AFAE0010 */ sw $t6, 0x10($sp)
/* 09F97C 802E017C 8FA3002C */ lw $v1, 0x2c($sp)
/* 09F980 802E0180 00408025 */ move $s0, $v0
/* 09F984 802E0184 00402025 */ move $a0, $v0
/* 09F988 802E0188 84670012 */ lh $a3, 0x12($v1)
/* 09F98C 802E018C 87B80036 */ lh $t8, 0x36($sp)
/* 09F990 802E0190 50E00021 */ beql $a3, $zero, .L80200BC8
/* 09F994 802E0194 8FBF0024 */ lw $ra, 0x24($sp)
/* 09F998 802E0198 84650010 */ lh $a1, 0x10($v1)
/* 09F99C 802E019C AFB80010 */ sw $t8, 0x10($sp)
/* 09F9A0 802E01A0 00003025 */ move $a2, $zero
/* 09F9A4 802E01A4 24A50740 */ addiu $a1, $a1, 0x740
/* 09F9A8 802E01A8 30AFFFFF */ andi $t7, $a1, 0xffff
/* 09F9AC 802E01AC 0C0B7E65 */ jal synthesis_save_reverb_ring_buffer
/* 09F9B0 802E01B0 01E02825 */ move $a1, $t7
/* 09F9B4 802E01B4 10000017 */ b .L80200BC4
/* 09F9B8 802E01B8 00408025 */ move $s0, $v0
.L80200B6C:
/* 09F9BC 802E01BC 02001825 */ move $v1, $s0
/* 09F9C0 802E01C0 26100008 */ addiu $s0, $s0, 8
/* 09F9C4 802E01C4 35080280 */ ori $t0, (0x07400280 & 0xFFFF) # ori $t0, $t0, 0x280
/* 09F9C8 802E01C8 AC680004 */ sw $t0, 4($v1)
/* 09F9CC 802E01CC AC790000 */ sw $t9, ($v1)
/* 09F9D0 802E01D0 02002025 */ move $a0, $s0
/* 09F9D4 802E01D4 3C090600 */ lui $t1, 0x600
/* 09F9D8 802E01D8 AC890000 */ sw $t1, ($a0)
/* 09F9DC 802E01DC 904A0003 */ lbu $t2, 3($v0)
/* 09F9E0 802E01E0 3C018000 */ lui $at, 0x8000
/* 09F9E4 802E01E4 26100008 */ addiu $s0, $s0, 8
/* 09F9E8 802E01E8 000A5880 */ sll $t3, $t2, 2
/* 09F9EC 802E01EC 016A5823 */ subu $t3, $t3, $t2
/* 09F9F0 802E01F0 000B58C0 */ sll $t3, $t3, 3
/* 09F9F4 802E01F4 016A5821 */ addu $t3, $t3, $t2
/* 09F9F8 802E01F8 000B5880 */ sll $t3, $t3, 2
/* 09F9FC 802E01FC 004B6021 */ addu $t4, $v0, $t3
/* 09FA00 802E0200 01876821 */ addu $t5, $t4, $a3
/* 09FA04 802E0204 8DAE0034 */ lw $t6, 0x34($t5)
/* 09FA08 802E0208 01C17821 */ addu $t7, $t6, $at
/* 09FA0C 802E020C AC8F0004 */ sw $t7, 4($a0)
/* 09FA10 802E0210 A0400000 */ sb $zero, ($v0)
.L80200BC4:
/* 09FA14 802E0214 8FBF0024 */ lw $ra, 0x24($sp)
.L80200BC8:
/* 09FA18 802E0218 02001025 */ move $v0, $s0
/* 09FA1C 802E021C 8FB00020 */ lw $s0, 0x20($sp)
/* 09FA20 802E0220 03E00008 */ jr $ra
/* 09FA24 802E0224 27BD0030 */ addiu $sp, $sp, 0x30

View file

@ -0,0 +1,263 @@
glabel note_apply_headset_pan_effects
/* 0A0F98 802E1798 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 0A0F9C 802E179C 8FAE003C */ lw $t6, 0x3c($sp)
/* 0A0FA0 802E17A0 AFB00004 */ sw $s0, 4($sp)
/* 0A0FA4 802E17A4 24020001 */ li $v0, 1
/* 0A0FA8 802E17A8 11C20006 */ beq $t6, $v0, .L80202174
/* 0A0FAC 802E17AC 00C08025 */ move $s0, $a2
/* 0A0FB0 802E17B0 24010002 */ li $at, 2
/* 0A0FB4 802E17B4 11C10009 */ beq $t6, $at, .L8020218C
/* 0A0FB8 802E17B8 240A0600 */ li $t2, 1536
/* 0A0FBC 802E17BC 100000E8 */ b .L80202510
/* 0A0FC0 802E17C0 00801025 */ move $v0, $a0
.L80202174:
/* 0A0FC4 802E17C4 90A60003 */ lbu $a2, 3($a1)
/* 0A0FC8 802E17C8 92080002 */ lbu $t0, 2($s0)
/* 0A0FCC 802E17CC 240A04C0 */ li $t2, 1216
/* 0A0FD0 802E17D0 A2000003 */ sb $zero, 3($s0)
/* 0A0FD4 802E17D4 10000008 */ b .L802021A8
/* 0A0FD8 802E17D8 A2060002 */ sb $a2, 2($s0)
.L8020218C:
/* 0A0FDC 802E17DC 90A60004 */ lbu $a2, 4($a1)
/* 0A0FE0 802E17E0 92080003 */ lbu $t0, 3($s0)
/* 0A0FE4 802E17E4 A2000002 */ sb $zero, 2($s0)
/* 0A0FE8 802E17E8 10000003 */ b .L802021A8
/* 0A0FEC 802E17EC A2060003 */ sb $a2, 3($s0)
/* 0A0FF0 802E17F0 100000DB */ b .L80202510
/* 0A0FF4 802E17F4 00801025 */ move $v0, $a0
.L802021A8:
/* 0A0FF8 802E17F8 8FAF0038 */ lw $t7, 0x38($sp)
/* 0A0FFC 802E17FC 30E5FFFF */ andi $a1, $a3, 0xffff
/* 0A1000 802E1800 3C180A00 */ lui $t8, 0xa00
/* 0A1004 802E1804 51E200A5 */ beql $t7, $v0, .L8020244C
/* 0A1008 802E1808 00801825 */ move $v1, $a0
/* 0A100C 802E180C 15000047 */ bnez $t0, .L802022DC
/* 0A1010 802E1810 01002825 */ move $a1, $t0
/* 0A1014 802E1814 00801825 */ move $v1, $a0
/* 0A1018 802E1818 3C020A00 */ lui $v0, (0x0A000200 >> 16) # lui $v0, 0xa00
/* 0A101C 802E181C 24840008 */ addiu $a0, $a0, 8
/* 0A1020 802E1820 24180008 */ li $t8, 8
/* 0A1024 802E1824 34420200 */ ori $v0, (0x0A000200 & 0xFFFF) # ori $v0, $v0, 0x200
/* 0A1028 802E1828 AC780004 */ sw $t8, 4($v1)
/* 0A102C 802E182C 00805825 */ move $t3, $a0
/* 0A1030 802E1830 3C190200 */ lui $t9, (0x02000008 >> 16) # lui $t9, 0x200
/* 0A1034 802E1834 AC620000 */ sw $v0, ($v1)
/* 0A1038 802E1838 37390008 */ ori $t9, (0x02000008 & 0xFFFF) # ori $t9, $t9, 8
/* 0A103C 802E183C 24840008 */ addiu $a0, $a0, 8
/* 0A1040 802E1840 AD790000 */ sw $t9, ($t3)
/* 0A1044 802E1844 240E0008 */ li $t6, 8
/* 0A1048 802E1848 00806025 */ move $t4, $a0
/* 0A104C 802E184C AD6E0004 */ sw $t6, 4($t3)
/* 0A1050 802E1850 24840008 */ addiu $a0, $a0, 8
/* 0A1054 802E1854 3C0F0010 */ lui $t7, (0x00100010 >> 16) # lui $t7, 0x10
/* 0A1058 802E1858 35EF0010 */ ori $t7, (0x00100010 & 0xFFFF) # ori $t7, $t7, 0x10
/* 0A105C 802E185C 00806825 */ move $t5, $a0
/* 0A1060 802E1860 AD8F0004 */ sw $t7, 4($t4)
/* 0A1064 802E1864 AD820000 */ sw $v0, ($t4)
/* 0A1068 802E1868 24190020 */ li $t9, 32
/* 0A106C 802E186C 3C180800 */ lui $t8, 0x800
/* 0A1070 802E1870 ADB80000 */ sw $t8, ($t5)
/* 0A1074 802E1874 ADB90004 */ sw $t9, 4($t5)
/* 0A1078 802E1878 24840008 */ addiu $a0, $a0, 8
/* 0A107C 802E187C AFA4000C */ sw $a0, 0xc($sp)
/* 0A1080 802E1880 8FAF000C */ lw $t7, 0xc($sp)
/* 0A1084 802E1884 3C0E0600 */ lui $t6, 0x600
/* 0A1088 802E1888 3C098000 */ lui $t1, (0x80000090 >> 16) # lui $t1, 0x8000
/* 0A108C 802E188C ADEE0000 */ sw $t6, ($t7)
/* 0A1090 802E1890 8E18000C */ lw $t8, 0xc($s0)
/* 0A1094 802E1894 35290090 */ ori $t1, (0x80000090 & 0xFFFF) # ori $t1, $t1, 0x90
/* 0A1098 802E1898 00E67021 */ addu $t6, $a3, $a2
/* 0A109C 802E189C 0309C821 */ addu $t9, $t8, $t1
/* 0A10A0 802E18A0 0007C3C0 */ sll $t8, $a3, 0xf
/* 0A10A4 802E18A4 01C51823 */ subu $v1, $t6, $a1
/* 0A10A8 802E18A8 ADF90004 */ sw $t9, 4($t7)
/* 0A10AC 802E18AC 24790008 */ addiu $t9, $v1, 8
/* 0A10B0 802E18B0 0319001A */ div $zero, $t8, $t9
/* 0A10B4 802E18B4 24840008 */ addiu $a0, $a0, 8
/* 0A10B8 802E18B8 17200002 */ bnez $t9, .L80202274
/* 0A10BC 802E18BC 00000000 */ nop
/* 0A10C0 802E18C0 0007000D */ break 7
.L80202274:
/* 0A10C4 802E18C4 2401FFFF */ li $at, -1
/* 0A10C8 802E18C8 17210004 */ bne $t9, $at, .L8020228C
/* 0A10CC 802E18CC 3C018000 */ lui $at, 0x8000
/* 0A10D0 802E18D0 17010002 */ bne $t8, $at, .L8020228C
/* 0A10D4 802E18D4 00000000 */ nop
/* 0A10D8 802E18D8 0006000D */ break 6
.L8020228C:
/* 0A10DC 802E18DC 00005812 */ mflo $t3
/* 0A10E0 802E18E0 00806025 */ move $t4, $a0
/* 0A10E4 802E18E4 316FFFFF */ andi $t7, $t3, 0xffff
/* 0A10E8 802E18E8 3C0E0800 */ lui $t6, (0x08000208 >> 16) # lui $t6, 0x800
/* 0A10EC 802E18EC 35CE0208 */ ori $t6, (0x08000208 & 0xFFFF) # ori $t6, $t6, 0x208
/* 0A10F0 802E18F0 24840008 */ addiu $a0, $a0, 8
/* 0A10F4 802E18F4 3062FFFF */ andi $v0, $v1, 0xffff
/* 0A10F8 802E18F8 31F8FFFF */ andi $t8, $t7, 0xffff
/* 0A10FC 802E18FC 3C010500 */ lui $at, 0x500
/* 0A1100 802E1900 AD820004 */ sw $v0, 4($t4)
/* 0A1104 802E1904 AD8E0000 */ sw $t6, ($t4)
/* 0A1108 802E1908 0301C825 */ or $t9, $t8, $at
/* 0A110C 802E190C 00806825 */ move $t5, $a0
/* 0A1110 802E1910 01E05825 */ move $t3, $t7
/* 0A1114 802E1914 ADB90000 */ sw $t9, ($t5)
/* 0A1118 802E1918 8E0F000C */ lw $t7, 0xc($s0)
/* 0A111C 802E191C 24840008 */ addiu $a0, $a0, 8
/* 0A1120 802E1920 01E97021 */ addu $t6, $t7, $t1
/* 0A1124 802E1924 10000038 */ b .L802023B8
/* 0A1128 802E1928 ADAE0004 */ sw $t6, 4($t5)
.L802022DC:
/* 0A112C 802E192C 14C00014 */ bnez $a2, .L80202330
/* 0A1130 802E1930 00C01025 */ move $v0, $a2
/* 0A1134 802E1934 00E5C823 */ subu $t9, $a3, $a1
/* 0A1138 802E1938 272FFFFC */ addiu $t7, $t9, -4
/* 0A113C 802E193C 0007C3C0 */ sll $t8, $a3, 0xf
/* 0A1140 802E1940 030F001A */ div $zero, $t8, $t7
/* 0A1144 802E1944 00005812 */ mflo $t3
/* 0A1148 802E1948 316EFFFF */ andi $t6, $t3, 0xffff
/* 0A114C 802E194C 15E00002 */ bnez $t7, .L80202308
/* 0A1150 802E1950 00000000 */ nop
/* 0A1154 802E1954 0007000D */ break 7
.L80202308:
/* 0A1158 802E1958 2401FFFF */ li $at, -1
/* 0A115C 802E195C 15E10004 */ bne $t7, $at, .L80202320
/* 0A1160 802E1960 3C018000 */ lui $at, 0x8000
/* 0A1164 802E1964 17010002 */ bne $t8, $at, .L80202320
/* 0A1168 802E1968 00000000 */ nop
/* 0A116C 802E196C 0006000D */ break 6
.L80202320:
/* 0A1170 802E1970 00E2C821 */ addu $t9, $a3, $v0
/* 0A1174 802E1974 03251823 */ subu $v1, $t9, $a1
/* 0A1178 802E1978 10000011 */ b .L80202370
/* 0A117C 802E197C 01C05825 */ move $t3, $t6
.L80202330:
/* 0A1180 802E1980 00E2C021 */ addu $t8, $a3, $v0
/* 0A1184 802E1984 03051823 */ subu $v1, $t8, $a1
/* 0A1188 802E1988 00077BC0 */ sll $t7, $a3, 0xf
/* 0A118C 802E198C 01E3001A */ div $zero, $t7, $v1
/* 0A1190 802E1990 00005812 */ mflo $t3
/* 0A1194 802E1994 316EFFFF */ andi $t6, $t3, 0xffff
/* 0A1198 802E1998 01C05825 */ move $t3, $t6
/* 0A119C 802E199C 14600002 */ bnez $v1, .L80202358
/* 0A11A0 802E19A0 00000000 */ nop
/* 0A11A4 802E19A4 0007000D */ break 7
.L80202358:
/* 0A11A8 802E19A8 2401FFFF */ li $at, -1
/* 0A11AC 802E19AC 14610004 */ bne $v1, $at, .L80202370
/* 0A11B0 802E19B0 3C018000 */ lui $at, 0x8000
/* 0A11B4 802E19B4 15E10002 */ bne $t7, $at, .L80202370
/* 0A11B8 802E19B8 00000000 */ nop
/* 0A11BC 802E19BC 0006000D */ break 6
.L80202370:
/* 0A11C0 802E19C0 00806025 */ move $t4, $a0
/* 0A11C4 802E19C4 3C190800 */ lui $t9, (0x08000200 >> 16) # lui $t9, 0x800
/* 0A11C8 802E19C8 37390200 */ ori $t9, (0x08000200 & 0xFFFF) # ori $t9, $t9, 0x200
/* 0A11CC 802E19CC 24840008 */ addiu $a0, $a0, 8
/* 0A11D0 802E19D0 3062FFFF */ andi $v0, $v1, 0xffff
/* 0A11D4 802E19D4 3178FFFF */ andi $t8, $t3, 0xffff
/* 0A11D8 802E19D8 3C010500 */ lui $at, 0x500
/* 0A11DC 802E19DC AD820004 */ sw $v0, 4($t4)
/* 0A11E0 802E19E0 AD990000 */ sw $t9, ($t4)
/* 0A11E4 802E19E4 03017825 */ or $t7, $t8, $at
/* 0A11E8 802E19E8 00806825 */ move $t5, $a0
/* 0A11EC 802E19EC ADAF0000 */ sw $t7, ($t5)
/* 0A11F0 802E19F0 8E0E000C */ lw $t6, 0xc($s0)
/* 0A11F4 802E19F4 3C098000 */ lui $t1, %hi(0x80000004) # $t1, 0x8000
/* 0A11F8 802E19F8 35290090 */ ori $t1, (0x80000090 & 0xFFFF) # ori $t1, $t1, 0x90
/* 0A11FC 802E19FC 01C9C821 */ addu $t9, $t6, $t1
/* 0A1200 802E1A00 ADB90004 */ sw $t9, 4($t5)
/* 0A1204 802E1A04 24840008 */ addiu $a0, $a0, 8
.L802023B8:
/* 0A1208 802E1A08 10A0001B */ beqz $a1, .L80202428
/* 0A120C 802E1A0C 00801825 */ move $v1, $a0
/* 0A1210 802E1A10 00801825 */ move $v1, $a0
/* 0A1214 802E1A14 3C180800 */ lui $t8, (0x08000200 >> 16) # lui $t8, 0x800
/* 0A1218 802E1A18 37180200 */ ori $t8, (0x08000200 & 0xFFFF) # ori $t8, $t8, 0x200
/* 0A121C 802E1A1C 24840008 */ addiu $a0, $a0, 8
/* 0A1220 802E1A20 310FFFFF */ andi $t7, $t0, 0xffff
/* 0A1224 802E1A24 AC6F0004 */ sw $t7, 4($v1)
/* 0A1228 802E1A28 AC780000 */ sw $t8, ($v1)
/* 0A122C 802E1A2C 00804825 */ move $t1, $a0
/* 0A1230 802E1A30 3C0E0400 */ lui $t6, 0x400
/* 0A1234 802E1A34 AD2E0000 */ sw $t6, ($t1)
/* 0A1238 802E1A38 8E19000C */ lw $t9, 0xc($s0)
/* 0A123C 802E1A3C 3C018000 */ lui $at, (0x800000B0 >> 16) # lui $at, 0x8000
/* 0A1240 802E1A40 342100B0 */ ori $at, (0x800000B0 & 0xFFFF) # ori $at, $at, 0xb0
/* 0A1244 802E1A44 0321C021 */ addu $t8, $t9, $at
/* 0A1248 802E1A48 AD380004 */ sw $t8, %lo(0x80000004)($t1)
/* 0A124C 802E1A4C 24840008 */ addiu $a0, $a0, 8
/* 0A1250 802E1A50 00805825 */ move $t3, $a0
/* 0A1254 802E1A54 24B90200 */ addiu $t9, $a1, 0x200
/* 0A1258 802E1A58 3C0F0A00 */ lui $t7, 0xa00
/* 0A125C 802E1A5C AD6F0000 */ sw $t7, ($t3)
/* 0A1260 802E1A60 0019C400 */ sll $t8, $t9, 0x10
/* 0A1264 802E1A64 03027825 */ or $t7, $t8, $v0
/* 0A1268 802E1A68 AD6F0004 */ sw $t7, 4($t3)
/* 0A126C 802E1A6C 24840008 */ addiu $a0, $a0, 8
/* 0A1270 802E1A70 1000001C */ b .L80202494
/* 0A1274 802E1A74 30E5FFFF */ andi $a1, $a3, 0xffff
.L80202428:
/* 0A1278 802E1A78 3C010200 */ lui $at, 0x200
/* 0A127C 802E1A7C 0041C825 */ or $t9, $v0, $at
/* 0A1280 802E1A80 3C0E0A00 */ lui $t6, 0xa00
/* 0A1284 802E1A84 AC6E0000 */ sw $t6, ($v1)
/* 0A1288 802E1A88 AC790004 */ sw $t9, 4($v1)
/* 0A128C 802E1A8C 24840008 */ addiu $a0, $a0, 8
/* 0A1290 802E1A90 10000014 */ b .L80202494
/* 0A1294 802E1A94 30E5FFFF */ andi $a1, $a3, 0xffff
/* 0A1298 802E1A98 00801825 */ move $v1, $a0
.L8020244C:
/* 0A129C 802E1A9C 3C020A00 */ lui $v0, %hi(0x0A000004) # $v0, 0xa00
/* 0A12A0 802E1AA0 24840008 */ addiu $a0, $a0, 8
/* 0A12A4 802E1AA4 34420200 */ ori $v0, (0x0A000200 & 0xFFFF) # ori $v0, $v0, 0x200
/* 0A12A8 802E1AA8 00804025 */ move $t0, $a0
/* 0A12AC 802E1AAC AC620000 */ sw $v0, ($v1)
/* 0A12B0 802E1AB0 AC650004 */ sw $a1, 4($v1)
/* 0A12B4 802E1AB4 24CE0200 */ addiu $t6, $a2, 0x200
/* 0A12B8 802E1AB8 000ECC00 */ sll $t9, $t6, 0x10
/* 0A12BC 802E1ABC AD180000 */ sw $t8, ($t0)
/* 0A12C0 802E1AC0 24840008 */ addiu $a0, $a0, 8
/* 0A12C4 802E1AC4 0325C025 */ or $t8, $t9, $a1
/* 0A12C8 802E1AC8 00804825 */ move $t1, $a0
/* 0A12CC 802E1ACC AD180004 */ sw $t8, 4($t0)
/* 0A12D0 802E1AD0 3C0F0200 */ lui $t7, (0x02000200 >> 16) # lui $t7, 0x200
/* 0A12D4 802E1AD4 35EF0200 */ ori $t7, (0x02000200 & 0xFFFF) # ori $t7, $t7, 0x200
/* 0A12D8 802E1AD8 AD2F0000 */ sw $t7, ($t1)
/* 0A12DC 802E1ADC AD260004 */ sw $a2, %lo(0x80000004)($t1)
/* 0A12E0 802E1AE0 24840008 */ addiu $a0, $a0, 8
.L80202494:
/* 0A12E4 802E1AE4 10C00012 */ beqz $a2, .L802024E0
/* 0A12E8 802E1AE8 00801025 */ move $v0, $a0
/* 0A12EC 802E1AEC 3C0E0800 */ lui $t6, 0x800
/* 0A12F0 802E1AF0 AC4E0000 */ sw $t6, ($v0)
/* 0A12F4 802E1AF4 24F80200 */ addiu $t8, $a3, 0x200
/* 0A12F8 802E1AF8 00187C00 */ sll $t7, $t8, 0x10
/* 0A12FC 802E1AFC 30CEFFFF */ andi $t6, $a2, 0xffff
/* 0A1300 802E1B00 01EEC825 */ or $t9, $t7, $t6
/* 0A1304 802E1B04 24840008 */ addiu $a0, $a0, 8
/* 0A1308 802E1B08 AC590004 */ sw $t9, %lo(0x0A000004)($v0)
/* 0A130C 802E1B0C 00801825 */ move $v1, $a0
/* 0A1310 802E1B10 3C180600 */ lui $t8, 0x600
/* 0A1314 802E1B14 AC780000 */ sw $t8, ($v1)
/* 0A1318 802E1B18 8E0F000C */ lw $t7, 0xc($s0)
/* 0A131C 802E1B1C 3C018000 */ lui $at, (0x800000B0 >> 16) # lui $at, 0x8000
/* 0A1320 802E1B20 342100B0 */ ori $at, (0x800000B0 & 0xFFFF) # ori $at, $at, 0xb0
/* 0A1324 802E1B24 01E17021 */ addu $t6, $t7, $at
/* 0A1328 802E1B28 AC6E0004 */ sw $t6, 4($v1)
/* 0A132C 802E1B2C 24840008 */ addiu $a0, $a0, 8
.L802024E0:
/* 0A1330 802E1B30 24860008 */ addiu $a2, $a0, 8
/* 0A1334 802E1B34 3C190800 */ lui $t9, 0x800
/* 0A1338 802E1B38 AC990000 */ sw $t9, ($a0)
/* 0A133C 802E1B3C AC850004 */ sw $a1, 4($a0)
/* 0A1340 802E1B40 3C180C00 */ lui $t8, (0x0C007FFF >> 16) # lui $t8, 0xc00
/* 0A1344 802E1B44 314FFFFF */ andi $t7, $t2, 0xffff
/* 0A1348 802E1B48 3C010200 */ lui $at, 0x200
/* 0A134C 802E1B4C 01E17025 */ or $t6, $t7, $at
/* 0A1350 802E1B50 37187FFF */ ori $t8, (0x0C007FFF & 0xFFFF) # ori $t8, $t8, 0x7fff
/* 0A1354 802E1B54 ACD80000 */ sw $t8, ($a2)
/* 0A1358 802E1B58 ACCE0004 */ sw $t6, 4($a2)
/* 0A135C 802E1B5C 24C20008 */ addiu $v0, $a2, 8
.L80202510:
/* 0A1360 802E1B60 8FB00004 */ lw $s0, 4($sp)
/* 0A1364 802E1B64 03E00008 */ jr $ra
/* 0A1368 802E1B68 27BD0028 */ addiu $sp, $sp, 0x28

View file

@ -0,0 +1,179 @@
glabel prepare_reverb_ring_buffer
/* 09EE50 802DF650 00067140 */ sll $t6, $a2, 5
/* 09EE54 802DF654 01C67021 */ addu $t6, $t6, $a2
/* 09EE58 802DF658 3C0F8022 */ lui $t7, %hi(gSynthesisReverbs) # $t7, 0x8022
/* 09EE5C 802DF65C 25EFC1B0 */ addiu $t7, %lo(gSynthesisReverbs) # addiu $t7, $t7, -0x3e50
/* 09EE60 802DF660 000E70C0 */ sll $t6, $t6, 3
/* 09EE64 802DF664 01CF3821 */ addu $a3, $t6, $t7
/* 09EE68 802DF668 90F80004 */ lbu $t8, 4($a3)
/* 09EE6C 802DF66C 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 09EE70 802DF670 24010001 */ li $at, 1
/* 09EE74 802DF674 AFBF0014 */ sw $ra, 0x14($sp)
/* 09EE78 802DF678 AFA40040 */ sw $a0, 0x40($sp)
/* 09EE7C 802DF67C 13010062 */ beq $t8, $at, .L802001B8
/* 09EE80 802DF680 AFA50044 */ sw $a1, 0x44($sp)
/* 09EE84 802DF684 90F90002 */ lbu $t9, 2($a3)
/* 09EE88 802DF688 00056080 */ sll $t4, $a1, 2
/* 09EE8C 802DF68C 01856021 */ addu $t4, $t4, $a1
/* 09EE90 802DF690 5720005E */ bnezl $t9, .L802001BC
/* 09EE94 802DF694 90E90004 */ lbu $t1, 4($a3)
/* 09EE98 802DF698 90E80003 */ lbu $t0, 3($a3)
/* 09EE9C 802DF69C 000C6080 */ sll $t4, $t4, 2
/* 09EEA0 802DF6A0 24050280 */ li $a1, 640
/* 09EEA4 802DF6A4 00084880 */ sll $t1, $t0, 2
/* 09EEA8 802DF6A8 01284823 */ subu $t1, $t1, $t0
/* 09EEAC 802DF6AC 000948C0 */ sll $t1, $t1, 3
/* 09EEB0 802DF6B0 01284821 */ addu $t1, $t1, $t0
/* 09EEB4 802DF6B4 00094880 */ sll $t1, $t1, 2
/* 09EEB8 802DF6B8 00E95021 */ addu $t2, $a3, $t1
/* 09EEBC 802DF6BC 014C3021 */ addu $a2, $t2, $t4
/* 09EEC0 802DF6C0 24C60030 */ addiu $a2, $a2, 0x30
/* 09EEC4 802DF6C4 8CC40004 */ lw $a0, 4($a2)
/* 09EEC8 802DF6C8 AFA70018 */ sw $a3, 0x18($sp)
/* 09EECC 802DF6CC 0C0BC448 */ jal osInvalDCache
/* 09EED0 802DF6D0 AFA6003C */ sw $a2, 0x3c($sp)
/* 09EED4 802DF6D4 8FA6003C */ lw $a2, 0x3c($sp)
/* 09EED8 802DF6D8 8FA70018 */ lw $a3, 0x18($sp)
/* 09EEDC 802DF6DC 00002825 */ move $a1, $zero
/* 09EEE0 802DF6E0 84CD0010 */ lh $t5, 0x10($a2)
/* 09EEE4 802DF6E4 00002025 */ move $a0, $zero
/* 09EEE8 802DF6E8 05A10003 */ bgez $t5, .L802000A8
/* 09EEEC 802DF6EC 000D7043 */ sra $t6, $t5, 1
/* 09EEF0 802DF6F0 25A10001 */ addiu $at, $t5, 1
/* 09EEF4 802DF6F4 00017043 */ sra $t6, $at, 1
.L802000A8:
/* 09EEF8 802DF6F8 59C00023 */ blezl $t6, .L80200138
/* 09EEFC 802DF6FC 84CE0012 */ lh $t6, 0x12($a2)
/* 09EF00 802DF700 00001025 */ move $v0, $zero
/* 09EF04 802DF704 8CCF0004 */ lw $t7, 4($a2)
.L802000B8:
/* 09EF08 802DF708 8CC9000C */ lw $t1, 0xc($a2)
/* 09EF0C 802DF70C 8CE80018 */ lw $t0, 0x18($a3)
/* 09EF10 802DF710 00051840 */ sll $v1, $a1, 1
/* 09EF14 802DF714 01E3C021 */ addu $t8, $t7, $v1
/* 09EF18 802DF718 87190000 */ lh $t9, ($t8)
/* 09EF1C 802DF71C 00095840 */ sll $t3, $t1, 1
/* 09EF20 802DF720 010B5021 */ addu $t2, $t0, $t3
/* 09EF24 802DF724 01426021 */ addu $t4, $t2, $v0
/* 09EF28 802DF728 A5990000 */ sh $t9, ($t4)
/* 09EF2C 802DF72C 8CCD0008 */ lw $t5, 8($a2)
/* 09EF30 802DF730 8CC9000C */ lw $t1, 0xc($a2)
/* 09EF34 802DF734 8CF8001C */ lw $t8, 0x1c($a3)
/* 09EF38 802DF738 01A37021 */ addu $t6, $t5, $v1
/* 09EF3C 802DF73C 85CF0000 */ lh $t7, ($t6)
/* 09EF40 802DF740 00094040 */ sll $t0, $t1, 1
/* 09EF44 802DF744 03085821 */ addu $t3, $t8, $t0
/* 09EF48 802DF748 01625021 */ addu $t2, $t3, $v0
/* 09EF4C 802DF74C A54F0000 */ sh $t7, ($t2)
/* 09EF50 802DF750 84CC0010 */ lh $t4, 0x10($a2)
/* 09EF54 802DF754 90F90004 */ lbu $t9, 4($a3)
/* 09EF58 802DF758 24840001 */ addiu $a0, $a0, 1
/* 09EF5C 802DF75C 24420002 */ addiu $v0, $v0, 2
/* 09EF60 802DF760 00B92821 */ addu $a1, $a1, $t9
/* 09EF64 802DF764 05810003 */ bgez $t4, .L80200124
/* 09EF68 802DF768 000C6843 */ sra $t5, $t4, 1
/* 09EF6C 802DF76C 25810001 */ addiu $at, $t4, 1
/* 09EF70 802DF770 00016843 */ sra $t5, $at, 1
.L80200124:
/* 09EF74 802DF774 008D082A */ slt $at, $a0, $t5
/* 09EF78 802DF778 5420FFE3 */ bnezl $at, .L802000B8
/* 09EF7C 802DF77C 8CCF0004 */ lw $t7, 4($a2)
/* 09EF80 802DF780 00002025 */ move $a0, $zero
/* 09EF84 802DF784 84CE0012 */ lh $t6, 0x12($a2)
.L80200138:
/* 09EF88 802DF788 05C10003 */ bgez $t6, .L80200148
/* 09EF8C 802DF78C 000E4843 */ sra $t1, $t6, 1
/* 09EF90 802DF790 25C10001 */ addiu $at, $t6, 1
/* 09EF94 802DF794 00014843 */ sra $t1, $at, 1
.L80200148:
/* 09EF98 802DF798 5920001C */ blezl $t1, .L802001BC
/* 09EF9C 802DF79C 90E90004 */ lbu $t1, 4($a3)
/* 09EFA0 802DF7A0 00001025 */ move $v0, $zero
/* 09EFA4 802DF7A4 8CD80004 */ lw $t8, 4($a2)
.L80200158:
/* 09EFA8 802DF7A8 00051840 */ sll $v1, $a1, 1
/* 09EFAC 802DF7AC 8CEF0018 */ lw $t7, 0x18($a3)
/* 09EFB0 802DF7B0 03034021 */ addu $t0, $t8, $v1
/* 09EFB4 802DF7B4 850B0000 */ lh $t3, ($t0)
/* 09EFB8 802DF7B8 01E25021 */ addu $t2, $t7, $v0
/* 09EFBC 802DF7BC 24840001 */ addiu $a0, $a0, 1
/* 09EFC0 802DF7C0 A54B0000 */ sh $t3, ($t2)
/* 09EFC4 802DF7C4 8CD90008 */ lw $t9, 8($a2)
/* 09EFC8 802DF7C8 8CEE001C */ lw $t6, 0x1c($a3)
/* 09EFCC 802DF7CC 03236021 */ addu $t4, $t9, $v1
/* 09EFD0 802DF7D0 858D0000 */ lh $t5, ($t4)
/* 09EFD4 802DF7D4 01C24821 */ addu $t1, $t6, $v0
/* 09EFD8 802DF7D8 24420002 */ addiu $v0, $v0, 2
/* 09EFDC 802DF7DC A52D0000 */ sh $t5, ($t1)
/* 09EFE0 802DF7E0 84C80012 */ lh $t0, 0x12($a2)
/* 09EFE4 802DF7E4 90F80004 */ lbu $t8, 4($a3)
/* 09EFE8 802DF7E8 00B82821 */ addu $a1, $a1, $t8
/* 09EFEC 802DF7EC 05010003 */ bgez $t0, .L802001AC
/* 09EFF0 802DF7F0 00087843 */ sra $t7, $t0, 1
/* 09EFF4 802DF7F4 25010001 */ addiu $at, $t0, 1
/* 09EFF8 802DF7F8 00017843 */ sra $t7, $at, 1
.L802001AC:
/* 09EFFC 802DF7FC 008F082A */ slt $at, $a0, $t7
/* 09F000 802DF800 5420FFE9 */ bnezl $at, .L80200158
/* 09F004 802DF804 8CD80004 */ lw $t8, 4($a2)
.L802001B8:
/* 09F008 802DF808 90E90004 */ lbu $t1, 4($a3)
.L802001BC:
/* 09F00C 802DF80C 8FAD0040 */ lw $t5, 0x40($sp)
/* 09F010 802DF810 90EB0003 */ lbu $t3, 3($a3)
/* 09F014 802DF814 8FAC0044 */ lw $t4, 0x44($sp)
/* 09F018 802DF818 01A9001A */ div $zero, $t5, $t1
/* 09F01C 802DF81C 000B5080 */ sll $t2, $t3, 2
/* 09F020 802DF820 8CF8000C */ lw $t8, 0xc($a3)
/* 09F024 802DF824 014B5023 */ subu $t2, $t2, $t3
/* 09F028 802DF828 8CEF0014 */ lw $t7, 0x14($a3)
/* 09F02C 802DF82C 000A50C0 */ sll $t2, $t2, 3
/* 09F030 802DF830 00001012 */ mflo $v0
/* 09F034 802DF834 014B5021 */ addu $t2, $t2, $t3
/* 09F038 802DF838 000C7080 */ sll $t6, $t4, 2
/* 09F03C 802DF83C 000A5080 */ sll $t2, $t2, 2
/* 09F040 802DF840 01CC7021 */ addu $t6, $t6, $t4
/* 09F044 802DF844 03024021 */ addu $t0, $t8, $v0
/* 09F048 802DF848 000E7080 */ sll $t6, $t6, 2
/* 09F04C 802DF84C 00EAC821 */ addu $t9, $a3, $t2
/* 09F050 802DF850 010F1823 */ subu $v1, $t0, $t7
/* 09F054 802DF854 032E3021 */ addu $a2, $t9, $t6
/* 09F058 802DF858 24C60030 */ addiu $a2, $a2, 0x30
/* 09F05C 802DF85C 15200002 */ bnez $t1, .L80200218
/* 09F060 802DF860 00000000 */ nop
/* 09F064 802DF864 0007000D */ break 7
.L80200218:
/* 09F068 802DF868 2401FFFF */ li $at, -1
/* 09F06C 802DF86C 15210004 */ bne $t1, $at, .L80200230
/* 09F070 802DF870 3C018000 */ lui $at, 0x8000
/* 09F074 802DF874 15A10002 */ bne $t5, $at, .L80200230
/* 09F078 802DF878 00000000 */ nop
/* 09F07C 802DF87C 0006000D */ break 6
.L80200230:
/* 09F080 802DF880 00437023 */ subu $t6, $v0, $v1
/* 09F084 802DF884 0461000A */ bgez $v1, .L80200260
/* 09F088 802DF888 00034840 */ sll $t1, $v1, 1
/* 09F08C 802DF88C 00025840 */ sll $t3, $v0, 1
/* 09F090 802DF890 A4CB0010 */ sh $t3, 0x10($a2)
/* 09F094 802DF894 A4C00012 */ sh $zero, 0x12($a2)
/* 09F098 802DF898 8CEA000C */ lw $t2, 0xc($a3)
/* 09F09C 802DF89C ACCA000C */ sw $t2, 0xc($a2)
/* 09F0A0 802DF8A0 8CEC000C */ lw $t4, 0xc($a3)
/* 09F0A4 802DF8A4 0182C821 */ addu $t9, $t4, $v0
/* 09F0A8 802DF8A8 10000007 */ b .L80200278
/* 09F0AC 802DF8AC ACF9000C */ sw $t9, 0xc($a3)
.L80200260:
/* 09F0B0 802DF8B0 000E6840 */ sll $t5, $t6, 1
/* 09F0B4 802DF8B4 A4CD0010 */ sh $t5, 0x10($a2)
/* 09F0B8 802DF8B8 A4C90012 */ sh $t1, 0x12($a2)
/* 09F0BC 802DF8BC 8CF8000C */ lw $t8, 0xc($a3)
/* 09F0C0 802DF8C0 ACD8000C */ sw $t8, 0xc($a2)
/* 09F0C4 802DF8C4 ACE3000C */ sw $v1, 0xc($a3)
.L80200278:
/* 09F0C8 802DF8C8 A4C20000 */ sh $v0, ($a2)
/* 09F0CC 802DF8CC 8FA80040 */ lw $t0, 0x40($sp)
/* 09F0D0 802DF8D0 A4C80002 */ sh $t0, 2($a2)
/* 09F0D4 802DF8D4 8FBF0014 */ lw $ra, 0x14($sp)
/* 09F0D8 802DF8D8 27BD0040 */ addiu $sp, $sp, 0x40
/* 09F0DC 802DF8DC 03E00008 */ jr $ra
/* 09F0E0 802DF8E0 00000000 */ nop

View file

@ -0,0 +1,781 @@
.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 func_eu_802e4fb8
/* 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 func_eu_802e4e5c
/* 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 func_eu_802e4e5c
/* 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

View file

@ -0,0 +1,56 @@
glabel sequence_channel_enable
/* 0A6BE8 802E73E8 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 0A6BEC 802E73EC 30AE00FF */ andi $t6, $a1, 0xff
/* 0A6BF0 802E73F0 000E7880 */ sll $t7, $t6, 2
/* 0A6BF4 802E73F4 AFBF0024 */ sw $ra, 0x24($sp)
/* 0A6BF8 802E73F8 AFB30020 */ sw $s3, 0x20($sp)
/* 0A6BFC 802E73FC AFB2001C */ sw $s2, 0x1c($sp)
/* 0A6C00 802E7400 AFB10018 */ sw $s1, 0x18($sp)
/* 0A6C04 802E7404 AFB00014 */ sw $s0, 0x14($sp)
/* 0A6C08 802E7408 AFA5002C */ sw $a1, 0x2c($sp)
/* 0A6C0C 802E740C 008FC021 */ addu $t8, $a0, $t7
/* 0A6C10 802E7410 8F120030 */ lw $s2, 0x30($t8)
/* 0A6C14 802E7414 3C198023 */ lui $t9, %hi(gSequenceChannelNone) # $t9, 0x8023
/* 0A6C18 802E7418 27398748 */ addiu $t9, %lo(gSequenceChannelNone) # addiu $t9, $t9, -0x78b8
/* 0A6C1C 802E741C 1659000A */ bne $s2, $t9, .L80201458
/* 0A6C20 802E7420 00008025 */ move $s0, $zero
/* 0A6C24 802E7424 3C098022 */ lui $t1, %hi(gSequencePlayers) # $t1, 0x8022
/* 0A6C28 802E7428 25293D68 */ addiu $t1, %lo(gSequencePlayers) # addiu $t1, $t1, 0x3d68
/* 0A6C2C 802E742C 10890019 */ beq $a0, $t1, .L802014A4
/* 0A6C30 802E7430 3C0A8022 */ lui $t2, %hi(gSequencePlayers + 0x148) # $t2, 0x8022
/* 0A6C34 802E7434 254A3EB0 */ addiu $t2, %lo(gSequencePlayers + 0x148) # addiu $t2, $t2, 0x3eb0
/* 0A6C38 802E7438 548A0017 */ bnel $a0, $t2, .L802014A8
/* 0A6C3C 802E743C 8FBF0024 */ lw $ra, 0x24($sp)
/* 0A6C40 802E7440 10000015 */ b .L802014A8
/* 0A6C44 802E7444 8FBF0024 */ lw $ra, 0x24($sp)
.L80201458:
/* 0A6C48 802E7448 924C0000 */ lbu $t4, ($s2)
/* 0A6C4C 802E744C A2400078 */ sb $zero, 0x78($s2)
/* 0A6C50 802E7450 AE460060 */ sw $a2, 0x60($s2)
/* 0A6C54 802E7454 358E0080 */ ori $t6, $t4, 0x80
/* 0A6C58 802E7458 A24E0000 */ sb $t6, ($s2)
/* 0A6C5C 802E745C 31CF00BF */ andi $t7, $t6, 0xbf
/* 0A6C60 802E7460 A24F0000 */ sb $t7, ($s2)
/* 0A6C64 802E7464 A640001A */ sh $zero, 0x1a($s2)
/* 0A6C68 802E7468 02408825 */ move $s1, $s2
/* 0A6C6C 802E746C 24130004 */ li $s3, 4
.L80201480:
/* 0A6C70 802E7470 8E380048 */ lw $t8, 0x48($s1)
/* 0A6C74 802E7474 02402025 */ move $a0, $s2
/* 0A6C78 802E7478 53000004 */ beql $t8, $zero, .L8020149C
/* 0A6C7C 802E747C 26100001 */ addiu $s0, $s0, 1
/* 0A6C80 802E7480 0C0B9C2D */ jal seq_channel_layer_free
/* 0A6C84 802E7484 02002825 */ move $a1, $s0
/* 0A6C88 802E7488 26100001 */ addiu $s0, $s0, 1
.L8020149C:
/* 0A6C8C 802E748C 1613FFF8 */ bne $s0, $s3, .L80201480
/* 0A6C90 802E7490 26310004 */ addiu $s1, $s1, 4
.L802014A4:
/* 0A6C94 802E7494 8FBF0024 */ lw $ra, 0x24($sp)
.L802014A8:
/* 0A6C98 802E7498 8FB00014 */ lw $s0, 0x14($sp)
/* 0A6C9C 802E749C 8FB10018 */ lw $s1, 0x18($sp)
/* 0A6CA0 802E74A0 8FB2001C */ lw $s2, 0x1c($sp)
/* 0A6CA4 802E74A4 8FB30020 */ lw $s3, 0x20($sp)
/* 0A6CA8 802E74A8 03E00008 */ jr $ra
/* 0A6CAC 802E74AC 27BD0028 */ addiu $sp, $sp, 0x28

View file

@ -0,0 +1,929 @@
.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

View file

@ -0,0 +1,698 @@
.late_rodata
.late_rodata_alignment 4
glabel jtbl_EU_80306AD4
.word L_EU_802E9530
.word L_EU_802E9520, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9510
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9500
.word L_EU_802E94D4, L_EU_802E94D4
.word L_EU_802E94C4, L_EU_802E94B4
.word L_EU_802E9488, L_EU_802E946C
.word L_EU_802E9450, L_EU_802E9024
.word L_EU_802E9424, L_EU_802E9310
.word L_EU_802E938C, L_EU_802E928C
.word L_EU_802E928C, L_EU_802E926C
.word L_EU_802E9268, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9258
.word L_EU_802E9230, L_EU_802E91E8
.word L_EU_802E91E8, L_EU_802E91E8
.word L_EU_802E9190, L_EU_802E9024
.word L_EU_802E9148, L_EU_802E9110
.word L_EU_802E9190, L_EU_802E9190
.word L_EU_802E9190, L_EU_802E90CC
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024
glabel jtbl_EU_80306BB4
.word L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E95C0
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E95CC
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E95D4
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E95DC
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.word L_EU_802E9024, L_EU_802E9024
.text
glabel sequence_player_process_sequence
/* 0A85E4 802E8DE4 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 0A85E8 802E8DE8 AFBF002C */ sw $ra, 0x2c($sp)
/* 0A85EC 802E8DEC AFB30028 */ sw $s3, 0x28($sp)
/* 0A85F0 802E8DF0 AFB20024 */ sw $s2, 0x24($sp)
/* 0A85F4 802E8DF4 AFB10020 */ sw $s1, 0x20($sp)
/* 0A85F8 802E8DF8 AFB0001C */ sw $s0, 0x1c($sp)
/* 0A85FC 802E8DFC 8C820000 */ lw $v0, ($a0)
/* 0A8600 802E8E00 00808825 */ move $s1, $a0
/* 0A8604 802E8E04 24010001 */ li $at, 1
/* 0A8608 802E8E08 000277C2 */ srl $t6, $v0, 0x1f
/* 0A860C 802E8E0C 11C00212 */ beqz $t6, .L080201458
/* 0A8610 802E8E10 00027900 */ sll $t7, $v0, 4
/* 0A8614 802E8E14 000FC7C2 */ srl $t8, $t7, 0x1f
/* 0A8618 802E8E18 17010039 */ bne $t8, $at, .L080200D00
/* 0A861C 802E8E1C 000268C0 */ sll $t5, $v0, 3
/* 0A8620 802E8E20 24900108 */ addiu $s0, $a0, 0x108
/* 0A8624 802E8E24 02002025 */ move $a0, $s0
/* 0A8628 802E8E28 00002825 */ move $a1, $zero
/* 0A862C 802E8E2C 0C0BBDE0 */ jal osRecvMesg
/* 0A8630 802E8E30 00003025 */ move $a2, $zero
/* 0A8634 802E8E34 2401FFFF */ li $at, -1
/* 0A8638 802E8E38 50410208 */ beql $v0, $at, .L08020145C
/* 0A863C 802E8E3C 8FBF002C */ lw $ra, 0x2c($sp)
/* 0A8640 802E8E40 8E390144 */ lw $t9, 0x144($s1)
/* 0A8644 802E8E44 3C128023 */ lui $s2, %hi(gCtlEntries) # $s2, 0x8023
/* 0A8648 802E8E48 265297D8 */ addiu $s2, %lo(gCtlEntries) # addiu $s2, $s2, -0x6828
/* 0A864C 802E8E4C 57200024 */ bnezl $t9, .L080200CE0
/* 0A8650 802E8E50 262C0124 */ addiu $t4, $s1, 0x124
/* 0A8654 802E8E54 92220006 */ lbu $v0, 6($s1)
/* 0A8658 802E8E58 2413000C */ li $s3, 12
/* 0A865C 802E8E5C 92280000 */ lbu $t0, ($s1)
/* 0A8660 802E8E60 00530019 */ multu $v0, $s3
/* 0A8664 802E8E64 3C0C8023 */ lui $t4, %hi(gAlTbl) # $t4, 0x8023
/* 0A8668 802E8E68 3109FFF7 */ andi $t1, $t0, 0xfff7
/* 0A866C 802E8E6C A2290000 */ sb $t1, ($s1)
/* 0A8670 802E8E70 8E4A0000 */ lw $t2, ($s2)
/* 0A8674 802E8E74 8D8C97CC */ lw $t4, %lo(gAlTbl)($t4)
/* 0A8678 802E8E78 000268C0 */ sll $t5, $v0, 3
/* 0A867C 802E8E7C 018D7021 */ addu $t6, $t4, $t5
/* 0A8680 802E8E80 8DC50004 */ lw $a1, 4($t6)
/* 0A8684 802E8E84 00005812 */ mflo $t3
/* 0A8688 802E8E88 014B8021 */ addu $s0, $t2, $t3
/* 0A868C 802E8E8C 8E040004 */ lw $a0, 4($s0)
/* 0A8690 802E8E90 92060001 */ lbu $a2, 1($s0)
/* 0A8694 802E8E94 92070002 */ lbu $a3, 2($s0)
/* 0A8698 802E8E98 0C0B8F0E */ jal patch_audio_bank
/* 0A869C 802E8E9C 2484FFFC */ addiu $a0, $a0, -4
/* 0A86A0 802E8EA0 92380006 */ lbu $t8, 6($s1)
/* 0A86A4 802E8EA4 8E4F0000 */ lw $t7, ($s2)
/* 0A86A8 802E8EA8 3C038022 */ lui $v1, %hi(gBankLoadStatus) # $v1, 0x8022
/* 0A86AC 802E8EAC 03130019 */ multu $t8, $s3
/* 0A86B0 802E8EB0 24632C18 */ addiu $v1, %lo(gBankLoadStatus) # addiu $v1, $v1, 0x2c18
/* 0A86B4 802E8EB4 24040002 */ li $a0, 2
/* 0A86B8 802E8EB8 0000C812 */ mflo $t9
/* 0A86BC 802E8EBC 01F98021 */ addu $s0, $t7, $t9
/* 0A86C0 802E8EC0 8E080004 */ lw $t0, 4($s0)
/* 0A86C4 802E8EC4 8D09FFFC */ lw $t1, -4($t0)
/* 0A86C8 802E8EC8 AE090008 */ sw $t1, 8($s0)
/* 0A86CC 802E8ECC 922A0006 */ lbu $t2, 6($s1)
/* 0A86D0 802E8ED0 006A5821 */ addu $t3, $v1, $t2
/* 0A86D4 802E8ED4 100001E0 */ b .L080201458
/* 0A86D8 802E8ED8 A1640000 */ sb $a0, ($t3)
/* 0A86DC 802E8EDC 262C0124 */ addiu $t4, $s1, 0x124
.L080200CE0:
/* 0A86E0 802E8EE0 AFAC0010 */ sw $t4, 0x10($sp)
/* 0A86E4 802E8EE4 26240140 */ addiu $a0, $s1, 0x140
/* 0A86E8 802E8EE8 2625013C */ addiu $a1, $s1, 0x13c
/* 0A86EC 802E8EEC 26260144 */ addiu $a2, $s1, 0x144
/* 0A86F0 802E8EF0 0C0B8CEA */ jal audio_dma_partial_copy_async
/* 0A86F4 802E8EF4 02003825 */ move $a3, $s0
/* 0A86F8 802E8EF8 100001D8 */ b .L08020145C
/* 0A86FC 802E8EFC 8FBF002C */ lw $ra, 0x2c($sp)
.L080200D00:
/* 0A8700 802E8F00 000D77C2 */ srl $t6, $t5, 0x1f
/* 0A8704 802E8F04 24010001 */ li $at, 1
/* 0A8708 802E8F08 15C1000E */ bne $t6, $at, .L080200D44
/* 0A870C 802E8F0C 262400D4 */ addiu $a0, $s1, 0xd4
/* 0A8710 802E8F10 00002825 */ move $a1, $zero
/* 0A8714 802E8F14 0C0BBDE0 */ jal osRecvMesg
/* 0A8718 802E8F18 00003025 */ move $a2, $zero
/* 0A871C 802E8F1C 2401FFFF */ li $at, -1
/* 0A8720 802E8F20 104101CD */ beq $v0, $at, .L080201458
/* 0A8724 802E8F24 24040002 */ li $a0, 2
/* 0A8728 802E8F28 92380000 */ lbu $t8, ($s1)
/* 0A872C 802E8F2C 92390004 */ lbu $t9, 4($s1)
/* 0A8730 802E8F30 3C018022 */ lui $at, %hi(gSeqLoadStatus)
/* 0A8734 802E8F34 330FFFEF */ andi $t7, $t8, 0xffef
/* 0A8738 802E8F38 A22F0000 */ sb $t7, ($s1)
/* 0A873C 802E8F3C 00390821 */ addu $at, $at, $t9
/* 0A8740 802E8F40 A0242C58 */ sb $a0, %lo(gSeqLoadStatus)($at)
.L080200D44:
/* 0A8744 802E8F44 92280004 */ lbu $t0, 4($s1)
/* 0A8748 802E8F48 3C098022 */ lui $t1, %hi(gSeqLoadStatus) # $t1, 0x8022
/* 0A874C 802E8F4C 25292C58 */ addiu $t1, %lo(gSeqLoadStatus) # addiu $t1, $t1, 0x2c58
/* 0A8750 802E8F50 01091021 */ addu $v0, $t0, $t1
/* 0A8754 802E8F54 904A0000 */ lbu $t2, ($v0)
/* 0A8758 802E8F58 24040002 */ li $a0, 2
/* 0A875C 802E8F5C 294B0002 */ slti $t3, $t2, 2
/* 0A8760 802E8F60 15600009 */ bnez $t3, .L080200D88
/* 0A8764 802E8F64 00000000 */ nop
/* 0A8768 802E8F68 922C0005 */ lbu $t4, 5($s1)
/* 0A876C 802E8F6C 3C038022 */ lui $v1, %hi(gBankLoadStatus) # $v1, 0x8022
/* 0A8770 802E8F70 24632C18 */ addiu $v1, %lo(gBankLoadStatus) # addiu $v1, $v1, 0x2c18
/* 0A8774 802E8F74 006C6821 */ addu $t5, $v1, $t4
/* 0A8778 802E8F78 91AE0000 */ lbu $t6, ($t5)
/* 0A877C 802E8F7C 29D80002 */ slti $t8, $t6, 2
/* 0A8780 802E8F80 53000006 */ beql $t8, $zero, .L080200D9C
/* 0A8784 802E8F84 A0440000 */ sb $a0, ($v0)
.L080200D88:
/* 0A8788 802E8F88 0C0B9D2C */ jal sequence_player_disable
/* 0A878C 802E8F8C 02202025 */ move $a0, $s1
/* 0A8790 802E8F90 100001B2 */ b .L08020145C
/* 0A8794 802E8F94 8FBF002C */ lw $ra, 0x2c($sp)
/* 0A8798 802E8F98 A0440000 */ sb $a0, ($v0)
.L080200D9C:
/* 0A879C 802E8F9C 922F0005 */ lbu $t7, 5($s1)
/* 0A87A0 802E8FA0 006FC821 */ addu $t9, $v1, $t7
/* 0A87A4 802E8FA4 A3240000 */ sb $a0, ($t9)
/* 0A87A8 802E8FA8 8E280000 */ lw $t0, ($s1)
/* 0A87AC 802E8FAC 00085080 */ sll $t2, $t0, 2
/* 0A87B0 802E8FB0 05430006 */ bgezl $t2, .L080200DCC
/* 0A87B4 802E8FB4 962D000A */ lhu $t5, 0xa($s1)
/* 0A87B8 802E8FB8 922B0003 */ lbu $t3, 3($s1)
/* 0A87BC 802E8FBC 316C0080 */ andi $t4, $t3, 0x80
/* 0A87C0 802E8FC0 558001A6 */ bnezl $t4, .L08020145C
/* 0A87C4 802E8FC4 8FBF002C */ lw $ra, 0x2c($sp)
/* 0A87C8 802E8FC8 962D000A */ lhu $t5, 0xa($s1)
.L080200DCC:
/* 0A87CC 802E8FCC 962E0008 */ lhu $t6, 8($s1)
/* 0A87D0 802E8FD0 3C038023 */ lui $v1, %hi(gTempoInternalToExternal) # $v1, 0x8023
/* 0A87D4 802E8FD4 01AEC021 */ addu $t8, $t5, $t6
/* 0A87D8 802E8FD8 A638000A */ sh $t8, 0xa($s1)
/* 0A87DC 802E8FDC 8463980C */ lh $v1, %lo(gTempoInternalToExternal)($v1)
/* 0A87E0 802E8FE0 3302FFFF */ andi $v0, $t8, 0xffff
/* 0A87E4 802E8FE4 0043082A */ slt $at, $v0, $v1
/* 0A87E8 802E8FE8 5420019C */ bnezl $at, .L08020145C
/* 0A87EC 802E8FEC 8FBF002C */ lw $ra, 0x2c($sp)
/* 0A87F0 802E8FF0 9624000E */ lhu $a0, 0xe($s1)
/* 0A87F4 802E8FF4 0043C823 */ subu $t9, $v0, $v1
/* 0A87F8 802E8FF8 A639000A */ sh $t9, 0xa($s1)
/* 0A87FC 802E8FFC 28810002 */ slti $at, $a0, 2
/* 0A8800 802E9000 14200003 */ bnez $at, .L080200E10
/* 0A8804 802E9004 2488FFFF */ addiu $t0, $a0, -1
/* 0A8808 802E9008 10000180 */ b .L08020140C
/* 0A880C 802E900C A628000E */ sh $t0, 0xe($s1)
.L080200E10:
/* 0A8810 802E9010 922A0000 */ lbu $t2, ($s1)
/* 0A8814 802E9014 26300070 */ addiu $s0, $s1, 0x70
/* 0A8818 802E9018 354B0004 */ ori $t3, $t2, 4
/* 0A881C 802E901C A22B0000 */ sb $t3, ($s1)
/* 0A8820 802E9020 8FB30058 */ lw $s3, 0x58($sp)
glabel L_EU_802E9024
.L_EU_802E9024:
/* 0A8824 802E9024 0C0B9DA0 */ jal m64_read_u8
/* 0A8828 802E9028 02002025 */ move $a0, $s0
/* 0A882C 802E902C 240100FF */ li $at, 255
/* 0A8830 802E9030 1441000E */ bne $v0, $at, .L080200E6C
/* 0A8834 802E9034 305200FF */ andi $s2, $v0, 0xff
/* 0A8838 802E9038 92040018 */ lbu $a0, 0x18($s0)
/* 0A883C 802E903C 14800005 */ bnez $a0, .L080200E54
/* 0A8840 802E9040 2483FFFF */ addiu $v1, $a0, -1
/* 0A8844 802E9044 0C0B9D2C */ jal sequence_player_disable
/* 0A8848 802E9048 02202025 */ move $a0, $s1
/* 0A884C 802E904C 1000016F */ b .L08020140C
/* 0A8850 802E9050 00000000 */ nop
.L080200E54:
/* 0A8854 802E9054 306C00FF */ andi $t4, $v1, 0xff
/* 0A8858 802E9058 000C6880 */ sll $t5, $t4, 2
/* 0A885C 802E905C 020D7021 */ addu $t6, $s0, $t5
/* 0A8860 802E9060 A20C0018 */ sb $t4, 0x18($s0)
/* 0A8864 802E9064 8DD80004 */ lw $t8, 4($t6)
/* 0A8868 802E9068 AE180000 */ sw $t8, ($s0)
.L080200E6C:
/* 0A886C 802E906C 304300FF */ andi $v1, $v0, 0xff
/* 0A8870 802E9070 240100FD */ li $at, 253
/* 0A8874 802E9074 14610005 */ bne $v1, $at, .L080200E8C
/* 0A8878 802E9078 306200F0 */ andi $v0, $v1, 0xf0
/* 0A887C 802E907C 0C0B9DB1 */ jal m64_read_compressed_u16
/* 0A8880 802E9080 02002025 */ move $a0, $s0
/* 0A8884 802E9084 10000161 */ b .L08020140C
/* 0A8888 802E9088 A622000E */ sh $v0, 0xe($s1)
.L080200E8C:
/* 0A888C 802E908C 240100FE */ li $at, 254
/* 0A8890 802E9090 14610004 */ bne $v1, $at, .L080200EA4
/* 0A8894 802E9094 2479FF38 */ addiu $t9, $v1, -0xc8
/* 0A8898 802E9098 240F0001 */ li $t7, 1
/* 0A889C 802E909C 1000015B */ b .L08020140C
/* 0A88A0 802E90A0 A62F000E */ sh $t7, 0xe($s1)
.L080200EA4:
/* 0A88A4 802E90A4 286100C0 */ slti $at, $v1, 0xc0
/* 0A88A8 802E90A8 14200125 */ bnez $at, .L080201340
/* 0A88AC 802E90AC 2F210038 */ sltiu $at, $t9, 0x38
/* 0A88B0 802E90B0 1020FFDC */ beqz $at, .L_EU_802E9024
/* 0A88B4 802E90B4 0019C880 */ sll $t9, $t9, 2
/* 0A88B8 802E90B8 3C018030 */ lui $at, %hi(jtbl_EU_80306AD4)
/* 0A88BC 802E90BC 00390821 */ addu $at, $at, $t9
/* 0A88C0 802E90C0 8C396AD4 */ lw $t9, %lo(jtbl_EU_80306AD4)($at)
/* 0A88C4 802E90C4 03200008 */ jr $t9
/* 0A88C8 802E90C8 00000000 */ nop
glabel L_EU_802E90CC
/* 0A88CC 802E90CC 0C0B9DA5 */ jal m64_read_s16
/* 0A88D0 802E90D0 02002025 */ move $a0, $s0
/* 0A88D4 802E90D4 92090018 */ lbu $t1, 0x18($s0)
/* 0A88D8 802E90D8 8E080000 */ lw $t0, ($s0)
/* 0A88DC 802E90DC 3058FFFF */ andi $t8, $v0, 0xffff
/* 0A88E0 802E90E0 00095080 */ sll $t2, $t1, 2
/* 0A88E4 802E90E4 020A5821 */ addu $t3, $s0, $t2
/* 0A88E8 802E90E8 AD680004 */ sw $t0, 4($t3)
/* 0A88EC 802E90EC 920C0018 */ lbu $t4, 0x18($s0)
/* 0A88F0 802E90F0 258D0001 */ addiu $t5, $t4, 1
/* 0A88F4 802E90F4 A20D0018 */ sb $t5, 0x18($s0)
/* 0A88F8 802E90F8 8E2E0014 */ lw $t6, 0x14($s1)
/* 0A88FC 802E90FC 01D87821 */ addu $t7, $t6, $t8
/* 0A8900 802E9100 1000FFC8 */ b .L_EU_802E9024
/* 0A8904 802E9104 AE0F0000 */ sw $t7, ($s0)
/* 0A8908 802E9108 1000FFC6 */ b .L_EU_802E9024
/* 0A890C 802E910C 00000000 */ nop
glabel L_EU_802E9110
/* 0A8910 802E9110 0C0B9DA0 */ jal m64_read_u8
/* 0A8914 802E9114 02002025 */ move $a0, $s0
/* 0A8918 802E9118 92190018 */ lbu $t9, 0x18($s0)
/* 0A891C 802E911C 02194821 */ addu $t1, $s0, $t9
/* 0A8920 802E9120 A1220014 */ sb $v0, 0x14($t1)
/* 0A8924 802E9124 92080018 */ lbu $t0, 0x18($s0)
/* 0A8928 802E9128 8E0A0000 */ lw $t2, ($s0)
/* 0A892C 802E912C 00085880 */ sll $t3, $t0, 2
/* 0A8930 802E9130 020B6021 */ addu $t4, $s0, $t3
/* 0A8934 802E9134 AD8A0004 */ sw $t2, 4($t4)
/* 0A8938 802E9138 920D0018 */ lbu $t5, 0x18($s0)
/* 0A893C 802E913C 25AE0001 */ addiu $t6, $t5, 1
/* 0A8940 802E9140 1000FFB8 */ b .L_EU_802E9024
/* 0A8944 802E9144 A20E0018 */ sb $t6, 0x18($s0)
glabel L_EU_802E9148
/* 0A8948 802E9148 92180018 */ lbu $t8, 0x18($s0)
/* 0A894C 802E914C 02181021 */ addu $v0, $s0, $t8
/* 0A8950 802E9150 904F0013 */ lbu $t7, 0x13($v0)
/* 0A8954 802E9154 25F9FFFF */ addiu $t9, $t7, -1
/* 0A8958 802E9158 A0590013 */ sb $t9, 0x13($v0)
/* 0A895C 802E915C 92040018 */ lbu $a0, 0x18($s0)
/* 0A8960 802E9160 02044821 */ addu $t1, $s0, $a0
/* 0A8964 802E9164 91280013 */ lbu $t0, 0x13($t1)
/* 0A8968 802E9168 00801825 */ move $v1, $a0
/* 0A896C 802E916C 00035880 */ sll $t3, $v1, 2
/* 0A8970 802E9170 11000005 */ beqz $t0, .L080200F88
/* 0A8974 802E9174 248DFFFF */ addiu $t5, $a0, -1
/* 0A8978 802E9178 020B5021 */ addu $t2, $s0, $t3
/* 0A897C 802E917C 8D4C0000 */ lw $t4, ($t2)
/* 0A8980 802E9180 1000FFA8 */ b .L_EU_802E9024
/* 0A8984 802E9184 AE0C0000 */ sw $t4, ($s0)
.L080200F88:
/* 0A8988 802E9188 1000FFA6 */ b .L_EU_802E9024
/* 0A898C 802E918C A20D0018 */ sb $t5, 0x18($s0)
glabel L_EU_802E9190
/* 0A8990 802E9190 0C0B9DA5 */ jal m64_read_s16
/* 0A8994 802E9194 02002025 */ move $a0, $s0
/* 0A8998 802E9198 240100FA */ li $at, 250
/* 0A899C 802E919C 16410003 */ bne $s2, $at, .L080200FAC
/* 0A89A0 802E91A0 02401825 */ move $v1, $s2
/* 0A89A4 802E91A4 1660FF9F */ bnez $s3, .L_EU_802E9024
/* 0A89A8 802E91A8 00000000 */ nop
.L080200FAC:
/* 0A89AC 802E91AC 240100F9 */ li $at, 249
/* 0A89B0 802E91B0 54610004 */ bnel $v1, $at, .L080200FC4
/* 0A89B4 802E91B4 240100F5 */ li $at, 245
/* 0A89B8 802E91B8 0661FF9A */ bgez $s3, .L_EU_802E9024
/* 0A89BC 802E91BC 00000000 */ nop
/* 0A89C0 802E91C0 240100F5 */ li $at, 245
.L080200FC4:
/* 0A89C4 802E91C4 54610004 */ bnel $v1, $at, .L080200FD8
/* 0A89C8 802E91C8 8E2E0014 */ lw $t6, 0x14($s1)
/* 0A89CC 802E91CC 0660FF95 */ bltz $s3, .L_EU_802E9024
/* 0A89D0 802E91D0 00000000 */ nop
/* 0A89D4 802E91D4 8E2E0014 */ lw $t6, 0x14($s1)
.L080200FD8:
/* 0A89D8 802E91D8 3058FFFF */ andi $t8, $v0, 0xffff
/* 0A89DC 802E91DC 01D87821 */ addu $t7, $t6, $t8
/* 0A89E0 802E91E0 1000FF90 */ b .L_EU_802E9024
/* 0A89E4 802E91E4 AE0F0000 */ sw $t7, ($s0)
glabel L_EU_802E91E8
/* 0A89E8 802E91E8 0C0B9DA0 */ jal m64_read_u8
/* 0A89EC 802E91EC 02002025 */ move $a0, $s0
/* 0A89F0 802E91F0 240100F3 */ li $at, 243
/* 0A89F4 802E91F4 16410003 */ bne $s2, $at, .L080201004
/* 0A89F8 802E91F8 02401825 */ move $v1, $s2
/* 0A89FC 802E91FC 1660FF89 */ bnez $s3, .L_EU_802E9024
/* 0A8A00 802E9200 00000000 */ nop
.L080201004:
/* 0A8A04 802E9204 240100F2 */ li $at, 242
/* 0A8A08 802E9208 54610004 */ bnel $v1, $at, .L08020101C
/* 0A8A0C 802E920C 8E190000 */ lw $t9, ($s0)
/* 0A8A10 802E9210 0661FF84 */ bgez $s3, .L_EU_802E9024
/* 0A8A14 802E9214 00000000 */ nop
/* 0A8A18 802E9218 8E190000 */ lw $t9, ($s0)
.L08020101C:
/* 0A8A1C 802E921C 00024E00 */ sll $t1, $v0, 0x18
/* 0A8A20 802E9220 00094603 */ sra $t0, $t1, 0x18
/* 0A8A24 802E9224 03285821 */ addu $t3, $t9, $t0
/* 0A8A28 802E9228 1000FF7E */ b .L_EU_802E9024
/* 0A8A2C 802E922C AE0B0000 */ sw $t3, ($s0)
glabel L_EU_802E9230
/* 0A8A30 802E9230 26240094 */ addiu $a0, $s1, 0x94
/* 0A8A34 802E9234 0C0B9671 */ jal note_pool_clear
/* 0A8A38 802E9238 AFA40038 */ sw $a0, 0x38($sp)
/* 0A8A3C 802E923C 0C0B9DA0 */ jal m64_read_u8
/* 0A8A40 802E9240 02002025 */ move $a0, $s0
/* 0A8A44 802E9244 8FA40038 */ lw $a0, 0x38($sp)
/* 0A8A48 802E9248 0C0B96C9 */ jal note_pool_fill
/* 0A8A4C 802E924C 00402825 */ move $a1, $v0
/* 0A8A50 802E9250 1000FF74 */ b .L_EU_802E9024
/* 0A8A54 802E9254 00000000 */ nop
glabel L_EU_802E9258
/* 0A8A58 802E9258 0C0B9671 */ jal note_pool_clear
/* 0A8A5C 802E925C 26240094 */ addiu $a0, $s1, 0x94
/* 0A8A60 802E9260 1000FF70 */ b .L_EU_802E9024
/* 0A8A64 802E9264 00000000 */ nop
glabel L_EU_802E9268
/* 0A8A68 802E9268 A620000C */ sh $zero, 0xc($s1)
glabel L_EU_802E926C
/* 0A8A6C 802E926C 0C0B9DA0 */ jal m64_read_u8
/* 0A8A70 802E9270 02002025 */ move $a0, $s0
/* 0A8A74 802E9274 862A000C */ lh $t2, 0xc($s1)
/* 0A8A78 802E9278 00026600 */ sll $t4, $v0, 0x18
/* 0A8A7C 802E927C 000C6E03 */ sra $t5, $t4, 0x18
/* 0A8A80 802E9280 014D7021 */ addu $t6, $t2, $t5
/* 0A8A84 802E9284 1000FF67 */ b .L_EU_802E9024
/* 0A8A88 802E9288 A62E000C */ sh $t6, 0xc($s1)
glabel L_EU_802E928C
/* 0A8A8C 802E928C 0C0B9DA0 */ jal m64_read_u8
/* 0A8A90 802E9290 02002025 */ move $a0, $s0
/* 0A8A94 802E9294 240100DD */ li $at, 221
/* 0A8A98 802E9298 16410007 */ bne $s2, $at, .L0802010B8
/* 0A8A9C 802E929C 3C038023 */ lui $v1, %hi(gTempoInternalToExternal) # $v1, 0x8023
/* 0A8AA0 802E92A0 305800FF */ andi $t8, $v0, 0xff
/* 0A8AA4 802E92A4 00187880 */ sll $t7, $t8, 2
/* 0A8AA8 802E92A8 01F87823 */ subu $t7, $t7, $t8
/* 0A8AAC 802E92AC 000F7900 */ sll $t7, $t7, 4
/* 0A8AB0 802E92B0 10000009 */ b .L0802010D8
/* 0A8AB4 802E92B4 A62F0008 */ sh $t7, 8($s1)
.L0802010B8:
/* 0A8AB8 802E92B8 0002CE00 */ sll $t9, $v0, 0x18
/* 0A8ABC 802E92BC 00194603 */ sra $t0, $t9, 0x18
/* 0A8AC0 802E92C0 96290008 */ lhu $t1, 8($s1)
/* 0A8AC4 802E92C4 00085880 */ sll $t3, $t0, 2
/* 0A8AC8 802E92C8 01685823 */ subu $t3, $t3, $t0
/* 0A8ACC 802E92CC 000B5900 */ sll $t3, $t3, 4
/* 0A8AD0 802E92D0 012B6021 */ addu $t4, $t1, $t3
/* 0A8AD4 802E92D4 A62C0008 */ sh $t4, 8($s1)
.L0802010D8:
/* 0A8AD8 802E92D8 8463980C */ lh $v1, %lo(gTempoInternalToExternal)($v1)
/* 0A8ADC 802E92DC 96220008 */ lhu $v0, 8($s1)
/* 0A8AE0 802E92E0 240E0001 */ li $t6, 1
/* 0A8AE4 802E92E4 0062082A */ slt $at, $v1, $v0
/* 0A8AE8 802E92E8 50200004 */ beql $at, $zero, .L0802010FC
/* 0A8AEC 802E92EC 00025400 */ sll $t2, $v0, 0x10
/* 0A8AF0 802E92F0 A6230008 */ sh $v1, 8($s1)
/* 0A8AF4 802E92F4 3062FFFF */ andi $v0, $v1, 0xffff
/* 0A8AF8 802E92F8 00025400 */ sll $t2, $v0, 0x10
.L0802010FC:
/* 0A8AFC 802E92FC 000A6C03 */ sra $t5, $t2, 0x10
/* 0A8B00 802E9300 1DA0FF48 */ bgtz $t5, .L_EU_802E9024
/* 0A8B04 802E9304 00000000 */ nop
/* 0A8B08 802E9308 1000FF46 */ b .L_EU_802E9024
/* 0A8B0C 802E930C A62E0008 */ sh $t6, 8($s1)
glabel L_EU_802E9310
/* 0A8B10 802E9310 0C0B9DA0 */ jal m64_read_u8
/* 0A8B14 802E9314 02002025 */ move $a0, $s0
/* 0A8B18 802E9318 305200FF */ andi $s2, $v0, 0xff
/* 0A8B1C 802E931C 0C0B9DA5 */ jal m64_read_s16
/* 0A8B20 802E9320 02002025 */ move $a0, $s0
/* 0A8B24 802E9324 12400008 */ beqz $s2, .L080201148
/* 0A8B28 802E9328 02401825 */ move $v1, $s2
/* 0A8B2C 802E932C 24010001 */ li $at, 1
/* 0A8B30 802E9330 10610005 */ beq $v1, $at, .L080201148
/* 0A8B34 802E9334 24010002 */ li $at, 2
/* 0A8B38 802E9338 1061000A */ beq $v1, $at, .L080201164
/* 0A8B3C 802E933C 304FFFFF */ andi $t7, $v0, 0xffff
/* 0A8B40 802E9340 1000FF38 */ b .L_EU_802E9024
/* 0A8B44 802E9344 00000000 */ nop
.L080201148:
/* 0A8B48 802E9348 92380001 */ lbu $t8, 1($s1)
/* 0A8B4C 802E934C 24010002 */ li $at, 2
/* 0A8B50 802E9350 1301FF34 */ beq $t8, $at, .L_EU_802E9024
/* 0A8B54 802E9354 00000000 */ nop
/* 0A8B58 802E9358 A6220012 */ sh $v0, 0x12($s1)
/* 0A8B5C 802E935C 1000FF31 */ b .L_EU_802E9024
/* 0A8B60 802E9360 A2320001 */ sb $s2, 1($s1)
.L080201164:
/* 0A8B64 802E9364 448F5000 */ mtc1 $t7, $f10
/* 0A8B68 802E9368 44802000 */ mtc1 $zero, $f4
/* 0A8B6C 802E936C C6260018 */ lwc1 $f6, 0x18($s1)
/* 0A8B70 802E9370 46805420 */ cvt.s.w $f16, $f10
/* 0A8B74 802E9374 A6220010 */ sh $v0, 0x10($s1)
/* 0A8B78 802E9378 A2320001 */ sb $s2, 1($s1)
/* 0A8B7C 802E937C 46062201 */ sub.s $f8, $f4, $f6
/* 0A8B80 802E9380 46104483 */ div.s $f18, $f8, $f16
/* 0A8B84 802E9384 1000FF27 */ b .L_EU_802E9024
/* 0A8B88 802E9388 E632001C */ swc1 $f18, 0x1c($s1)
glabel L_EU_802E938C
/* 0A8B8C 802E938C 0C0B9DA0 */ jal m64_read_u8
/* 0A8B90 802E9390 02002025 */ move $a0, $s0
/* 0A8B94 802E9394 92230001 */ lbu $v1, 1($s1)
/* 0A8B98 802E9398 24010001 */ li $at, 1
/* 0A8B9C 802E939C 5060000B */ beql $v1, $zero, .L0802011CC
/* 0A8BA0 802E93A0 96230012 */ lhu $v1, 0x12($s1)
/* 0A8BA4 802E93A4 10610005 */ beq $v1, $at, .L0802011BC
/* 0A8BA8 802E93A8 24010002 */ li $at, 2
/* 0A8BAC 802E93AC 1061FF1D */ beq $v1, $at, .L_EU_802E9024
/* 0A8BB0 802E93B0 00000000 */ nop
/* 0A8BB4 802E93B4 1000FF1B */ b .L_EU_802E9024
/* 0A8BB8 802E93B8 00000000 */ nop
.L0802011BC:
/* 0A8BBC 802E93BC 44802000 */ mtc1 $zero, $f4
/* 0A8BC0 802E93C0 A2200001 */ sb $zero, 1($s1)
/* 0A8BC4 802E93C4 E6240018 */ swc1 $f4, 0x18($s1)
/* 0A8BC8 802E93C8 96230012 */ lhu $v1, 0x12($s1)
.L0802011CC:
/* 0A8BCC 802E93CC 1060000E */ beqz $v1, .L080201208
/* 0A8BD0 802E93D0 A6230010 */ sh $v1, 0x10($s1)
/* 0A8BD4 802E93D4 44823000 */ mtc1 $v0, $f6
/* 0A8BD8 802E93D8 3C0142FE */ li $at, 0x42FE0000 # 127.000000
/* 0A8BDC 802E93DC 44814000 */ mtc1 $at, $f8
/* 0A8BE0 802E93E0 468032A0 */ cvt.s.w $f10, $f6
/* 0A8BE4 802E93E4 3079FFFF */ andi $t9, $v1, 0xffff
/* 0A8BE8 802E93E8 44993000 */ mtc1 $t9, $f6
/* 0A8BEC 802E93EC C6320018 */ lwc1 $f18, 0x18($s1)
/* 0A8BF0 802E93F0 46085403 */ div.s $f16, $f10, $f8
/* 0A8BF4 802E93F4 468032A0 */ cvt.s.w $f10, $f6
/* 0A8BF8 802E93F8 46128101 */ sub.s $f4, $f16, $f18
/* 0A8BFC 802E93FC 460A2203 */ div.s $f8, $f4, $f10
/* 0A8C00 802E9400 1000FF08 */ b .L_EU_802E9024
/* 0A8C04 802E9404 E628001C */ swc1 $f8, 0x1c($s1)
.L080201208:
/* 0A8C08 802E9408 44828000 */ mtc1 $v0, $f16
/* 0A8C0C 802E940C 3C0142FE */ li $at, 0x42FE0000 # 127.000000
/* 0A8C10 802E9410 44813000 */ mtc1 $at, $f6
/* 0A8C14 802E9414 468084A0 */ cvt.s.w $f18, $f16
/* 0A8C18 802E9418 46069103 */ div.s $f4, $f18, $f6
/* 0A8C1C 802E941C 1000FF01 */ b .L_EU_802E9024
/* 0A8C20 802E9420 E6240018 */ swc1 $f4, 0x18($s1)
glabel L_EU_802E9424
/* 0A8C24 802E9424 0C0B9DA0 */ jal m64_read_u8
/* 0A8C28 802E9428 02002025 */ move $a0, $s0
/* 0A8C2C 802E942C 00024600 */ sll $t0, $v0, 0x18
/* 0A8C30 802E9430 00084E03 */ sra $t1, $t0, 0x18
/* 0A8C34 802E9434 44895000 */ mtc1 $t1, $f10
/* 0A8C38 802E9438 3C0142FE */ li $at, 0x42FE0000 # 127.000000
/* 0A8C3C 802E943C 44818000 */ mtc1 $at, $f16
/* 0A8C40 802E9440 46805220 */ cvt.s.w $f8, $f10
/* 0A8C44 802E9444 46104483 */ div.s $f18, $f8, $f16
/* 0A8C48 802E9448 1000FEF6 */ b .L_EU_802E9024
/* 0A8C4C 802E944C E6320028 */ swc1 $f18, 0x28($s1)
glabel L_EU_802E9450
/* 0A8C50 802E9450 0C0B9DA5 */ jal m64_read_s16
/* 0A8C54 802E9454 02002025 */ move $a0, $s0
/* 0A8C58 802E9458 02202025 */ move $a0, $s1
/* 0A8C5C 802E945C 0C0B9C7B */ jal sequence_player_init_channels
/* 0A8C60 802E9460 3045FFFF */ andi $a1, $v0, 0xffff
/* 0A8C64 802E9464 1000FEEF */ b .L_EU_802E9024
/* 0A8C68 802E9468 00000000 */ nop
glabel L_EU_802E946C
/* 0A8C6C 802E946C 0C0B9DA5 */ jal m64_read_s16
/* 0A8C70 802E9470 02002025 */ move $a0, $s0
/* 0A8C74 802E9474 02202025 */ move $a0, $s1
/* 0A8C78 802E9478 0C0B9CC6 */ jal sequence_player_disable_channels
/* 0A8C7C 802E947C 3045FFFF */ andi $a1, $v0, 0xffff
/* 0A8C80 802E9480 1000FEE8 */ b .L_EU_802E9024
/* 0A8C84 802E9484 00000000 */ nop
glabel L_EU_802E9488
/* 0A8C88 802E9488 0C0B9DA0 */ jal m64_read_u8
/* 0A8C8C 802E948C 02002025 */ move $a0, $s0
/* 0A8C90 802E9490 00025E00 */ sll $t3, $v0, 0x18
/* 0A8C94 802E9494 000B6603 */ sra $t4, $t3, 0x18
/* 0A8C98 802E9498 448C3000 */ mtc1 $t4, $f6
/* 0A8C9C 802E949C 3C0142FE */ li $at, 0x42FE0000 # 127.000000
/* 0A8CA0 802E94A0 44815000 */ mtc1 $at, $f10
/* 0A8CA4 802E94A4 46803120 */ cvt.s.w $f4, $f6
/* 0A8CA8 802E94A8 460A2203 */ div.s $f8, $f4, $f10
/* 0A8CAC 802E94AC 1000FEDD */ b .L_EU_802E9024
/* 0A8CB0 802E94B0 E6280024 */ swc1 $f8, 0x24($s1)
glabel L_EU_802E94B4
/* 0A8CB4 802E94B4 922D0000 */ lbu $t5, ($s1)
/* 0A8CB8 802E94B8 35AE0020 */ ori $t6, $t5, 0x20
/* 0A8CBC 802E94BC 1000FED9 */ b .L_EU_802E9024
/* 0A8CC0 802E94C0 A22E0000 */ sb $t6, ($s1)
glabel L_EU_802E94C4
/* 0A8CC4 802E94C4 0C0B9DA0 */ jal m64_read_u8
/* 0A8CC8 802E94C8 02002025 */ move $a0, $s0
/* 0A8CCC 802E94CC 1000FED5 */ b .L_EU_802E9024
/* 0A8CD0 802E94D0 A2220003 */ sb $v0, 3($s1)
glabel L_EU_802E94D4
/* 0A8CD4 802E94D4 0C0B9DA5 */ jal m64_read_s16
/* 0A8CD8 802E94D8 02002025 */ move $a0, $s0
/* 0A8CDC 802E94DC 8E380014 */ lw $t8, 0x14($s1)
/* 0A8CE0 802E94E0 304FFFFF */ andi $t7, $v0, 0xffff
/* 0A8CE4 802E94E4 240100D2 */ li $at, 210
/* 0A8CE8 802E94E8 16410003 */ bne $s2, $at, .L0802012F8
/* 0A8CEC 802E94EC 030F1821 */ addu $v1, $t8, $t7
/* 0A8CF0 802E94F0 1000FECC */ b .L_EU_802E9024
/* 0A8CF4 802E94F4 AE23008C */ sw $v1, 0x8c($s1)
.L0802012F8:
/* 0A8CF8 802E94F8 1000FECA */ b .L_EU_802E9024
/* 0A8CFC 802E94FC AE230090 */ sw $v1, 0x90($s1)
glabel L_EU_802E9500
/* 0A8D00 802E9500 0C0B9DA0 */ jal m64_read_u8
/* 0A8D04 802E9504 02002025 */ move $a0, $s0
/* 0A8D08 802E9508 1000FEC6 */ b .L_EU_802E9024
/* 0A8D0C 802E950C A2220002 */ sb $v0, 2($s1)
glabel L_EU_802E9510
/* 0A8D10 802E9510 0C0B9DA0 */ jal m64_read_u8
/* 0A8D14 802E9514 02002025 */ move $a0, $s0
/* 0A8D18 802E9518 1000FEC2 */ b .L_EU_802E9024
/* 0A8D1C 802E951C 00409825 */ move $s3, $v0
glabel L_EU_802E9520
/* 0A8D20 802E9520 0C0B9DA0 */ jal m64_read_u8
/* 0A8D24 802E9524 02002025 */ move $a0, $s0
/* 0A8D28 802E9528 1000FEBE */ b .L_EU_802E9024
/* 0A8D2C 802E952C 02629824 */ and $s3, $s3, $v0
glabel L_EU_802E9530
/* 0A8D30 802E9530 0C0B9DA0 */ jal m64_read_u8
/* 0A8D34 802E9534 02002025 */ move $a0, $s0
/* 0A8D38 802E9538 1000FEBA */ b .L_EU_802E9024
/* 0A8D3C 802E953C 02629823 */ subu $s3, $s3, $v0
.L080201340:
/* 0A8D40 802E9540 28410011 */ slti $at, $v0, 0x11
/* 0A8D44 802E9544 14200010 */ bnez $at, .L080201388
/* 0A8D48 802E9548 28410021 */ slti $at, $v0, 0x21
/* 0A8D4C 802E954C 14200009 */ bnez $at, .L080201374
/* 0A8D50 802E9550 2459FFC0 */ addiu $t9, $v0, -0x40
/* 0A8D54 802E9554 2F210061 */ sltiu $at, $t9, 0x61
/* 0A8D58 802E9558 1020FEB2 */ beqz $at, .L_EU_802E9024
/* 0A8D5C 802E955C 0019C880 */ sll $t9, $t9, 2
/* 0A8D60 802E9560 3C018030 */ lui $at, %hi(jtbl_EU_80306BB4)
/* 0A8D64 802E9564 00390821 */ addu $at, $at, $t9
/* 0A8D68 802E9568 8C396BB4 */ lw $t9, %lo(jtbl_EU_80306BB4)($at)
/* 0A8D6C 802E956C 03200008 */ jr $t9
/* 0A8D70 802E9570 00000000 */ nop
.L080201374:
/* 0A8D74 802E9574 24010020 */ li $at, 32
/* 0A8D78 802E9578 1041FEAA */ beq $v0, $at, .L_EU_802E9024
/* 0A8D7C 802E957C 00000000 */ nop
/* 0A8D80 802E9580 1000FEA8 */ b .L_EU_802E9024
/* 0A8D84 802E9584 00000000 */ nop
.L080201388:
/* 0A8D88 802E9588 10400006 */ beqz $v0, .L0802013A4
/* 0A8D8C 802E958C 3069000F */ andi $t1, $v1, 0xf
/* 0A8D90 802E9590 24010010 */ li $at, 16
/* 0A8D94 802E9594 1041FEA3 */ beq $v0, $at, .L_EU_802E9024
/* 0A8D98 802E9598 00000000 */ nop
/* 0A8D9C 802E959C 1000FEA1 */ b .L_EU_802E9024
/* 0A8DA0 802E95A0 00000000 */ nop
.L0802013A4:
/* 0A8DA4 802E95A4 00095880 */ sll $t3, $t1, 2
/* 0A8DA8 802E95A8 022B6021 */ addu $t4, $s1, $t3
/* 0A8DAC 802E95AC 8D8A0030 */ lw $t2, 0x30($t4)
/* 0A8DB0 802E95B0 8D530000 */ lw $s3, ($t2)
/* 0A8DB4 802E95B4 00136840 */ sll $t5, $s3, 1
/* 0A8DB8 802E95B8 1000FE9A */ b .L_EU_802E9024
/* 0A8DBC 802E95BC 000D9FC2 */ srl $s3, $t5, 0x1f
glabel L_EU_802E95C0
/* 0A8DC0 802E95C0 82380007 */ lb $t8, 7($s1)
/* 0A8DC4 802E95C4 1000FE97 */ b .L_EU_802E9024
/* 0A8DC8 802E95C8 02789823 */ subu $s3, $s3, $t8
glabel L_EU_802E95CC
/* 0A8DCC 802E95CC 1000FE95 */ b .L_EU_802E9024
/* 0A8DD0 802E95D0 A2330007 */ sb $s3, 7($s1)
glabel L_EU_802E95D4
/* 0A8DD4 802E95D4 1000FE93 */ b .L_EU_802E9024
/* 0A8DD8 802E95D8 82330007 */ lb $s3, 7($s1)
glabel L_EU_802E95DC
/* 0A8DDC 802E95DC 0C0B9DA5 */ jal m64_read_s16
/* 0A8DE0 802E95E0 02002025 */ move $a0, $s0
/* 0A8DE4 802E95E4 8E390014 */ lw $t9, 0x14($s1)
/* 0A8DE8 802E95E8 02402825 */ move $a1, $s2
/* 0A8DEC 802E95EC 30AF000F */ andi $t7, $a1, 0xf
/* 0A8DF0 802E95F0 3048FFFF */ andi $t0, $v0, 0xffff
/* 0A8DF4 802E95F4 01E02825 */ move $a1, $t7
/* 0A8DF8 802E95F8 02202025 */ move $a0, $s1
/* 0A8DFC 802E95FC 0C0B9CFA */ jal sequence_channel_enable
/* 0A8E00 802E9600 03283021 */ addu $a2, $t9, $t0
/* 0A8E04 802E9604 1000FE87 */ b .L_EU_802E9024
/* 0A8E08 802E9608 00000000 */ nop
.L08020140C:
/* 0A8E0C 802E960C 3C108023 */ lui $s0, %hi(gSequenceChannelNone) # $s0, 0x8023
/* 0A8E10 802E9610 02201825 */ move $v1, $s1
/* 0A8E14 802E9614 24110040 */ li $s1, 64
/* 0A8E18 802E9618 26108748 */ addiu $s0, %lo(gSequenceChannelNone) # addiu $s0, $s0, -0x78b8
/* 0A8E1C 802E961C 00001025 */ move $v0, $zero
.L080201420:
/* 0A8E20 802E9620 8C640030 */ lw $a0, 0x30($v1)
/* 0A8E24 802E9624 24010001 */ li $at, 1
/* 0A8E28 802E9628 02044826 */ xor $t1, $s0, $a0
/* 0A8E2C 802E962C 0009482B */ sltu $t1, $zero, $t1
/* 0A8E30 802E9630 55210007 */ bnel $t1, $at, .L080201450
/* 0A8E34 802E9634 24420004 */ addiu $v0, $v0, 4
/* 0A8E38 802E9638 AFA20034 */ sw $v0, 0x34($sp)
/* 0A8E3C 802E963C 0C0BA0AE */ jal sequence_channel_process_script
/* 0A8E40 802E9640 AFA30030 */ sw $v1, 0x30($sp)
/* 0A8E44 802E9644 8FA20034 */ lw $v0, 0x34($sp)
/* 0A8E48 802E9648 8FA30030 */ lw $v1, 0x30($sp)
/* 0A8E4C 802E964C 24420004 */ addiu $v0, $v0, 4
.L080201450:
/* 0A8E50 802E9650 1451FFF3 */ bne $v0, $s1, .L080201420
/* 0A8E54 802E9654 24630004 */ addiu $v1, $v1, 4
.L080201458:
/* 0A8E58 802E9658 8FBF002C */ lw $ra, 0x2c($sp)
.L08020145C:
/* 0A8E5C 802E965C 8FB0001C */ lw $s0, 0x1c($sp)
/* 0A8E60 802E9660 8FB10020 */ lw $s1, 0x20($sp)
/* 0A8E64 802E9664 8FB20024 */ lw $s2, 0x24($sp)
/* 0A8E68 802E9668 8FB30028 */ lw $s3, 0x28($sp)
/* 0A8E6C 802E966C 03E00008 */ jr $ra
/* 0A8E70 802E9670 27BD0060 */ addiu $sp, $sp, 0x60

View file

@ -0,0 +1,331 @@
glabel synthesis_do_one_audio_update
/* 09FA28 802E0228 27BDFF40 */ addiu $sp, $sp, -0xc0
/* 09FA2C 802E022C 3C0A8022 */ lui $t2, %hi(gNumSynthesisReverbs) # $t2, 0x8022
/* 09FA30 802E0230 254AC5E3 */ addiu $t2, %lo(gNumSynthesisReverbs) # addiu $t2, $t2, -0x3a1d
/* 09FA34 802E0234 81480000 */ lb $t0, ($t2)
/* 09FA38 802E0238 AFBE0040 */ sw $fp, 0x40($sp)
/* 09FA3C 802E023C AFB40030 */ sw $s4, 0x30($sp)
/* 09FA40 802E0240 AFB20028 */ sw $s2, 0x28($sp)
/* 09FA44 802E0244 00C0A025 */ move $s4, $a2
/* 09FA48 802E0248 00E0F025 */ move $fp, $a3
/* 09FA4C 802E024C AFBF0044 */ sw $ra, 0x44($sp)
/* 09FA50 802E0250 AFB7003C */ sw $s7, 0x3c($sp)
/* 09FA54 802E0254 AFB60038 */ sw $s6, 0x38($sp)
/* 09FA58 802E0258 AFB50034 */ sw $s5, 0x34($sp)
/* 09FA5C 802E025C AFB3002C */ sw $s3, 0x2c($sp)
/* 09FA60 802E0260 AFB10024 */ sw $s1, 0x24($sp)
/* 09FA64 802E0264 AFB00020 */ sw $s0, 0x20($sp)
/* 09FA68 802E0268 AFA400C0 */ sw $a0, 0xc0($sp)
/* 09FA6C 802E026C AFA500C4 */ sw $a1, 0xc4($sp)
/* 09FA70 802E0270 1500001D */ bnez $t0, .L80200C98
/* 09FA74 802E0274 00009025 */ move $s2, $zero
/* 09FA78 802E0278 3C048023 */ lui $a0, %hi(gMaxSimultaneousNotes) # $a0, 0x8023
/* 09FA7C 802E027C 8C849808 */ lw $a0, %lo(gMaxSimultaneousNotes)($a0)
/* 09FA80 802E0280 00008825 */ move $s1, $zero
/* 09FA84 802E0284 18800016 */ blez $a0, .L80200C90
/* 09FA88 802E0288 00000000 */ nop
/* 09FA8C 802E028C 00870019 */ multu $a0, $a3
/* 09FA90 802E0290 3C0E8022 */ lui $t6, %hi(gNoteSubsEu) # $t6, 0x8022
/* 09FA94 802E0294 8DCEC5E4 */ lw $t6, %lo(gNoteSubsEu)($t6)
/* 09FA98 802E0298 27A50084 */ addiu $a1, $sp, 0x84
/* 09FA9C 802E029C 00007812 */ mflo $t7
/* 09FAA0 802E02A0 000FC100 */ sll $t8, $t7, 4
/* 09FAA4 802E02A4 01D81021 */ addu $v0, $t6, $t8
.L80200C58:
/* 09FAA8 802E02A8 8C590000 */ lw $t9, ($v0)
/* 09FAAC 802E02AC 00B26021 */ addu $t4, $a1, $s2
/* 09FAB0 802E02B0 00195FC2 */ srl $t3, $t9, 0x1f
/* 09FAB4 802E02B4 51600006 */ beql $t3, $zero, .L80200C80
/* 09FAB8 802E02B8 26310001 */ addiu $s1, $s1, 1
/* 09FABC 802E02BC 26520001 */ addiu $s2, $s2, 1
/* 09FAC0 802E02C0 00126C00 */ sll $t5, $s2, 0x10
/* 09FAC4 802E02C4 000D9403 */ sra $s2, $t5, 0x10
/* 09FAC8 802E02C8 A1910000 */ sb $s1, ($t4)
/* 09FACC 802E02CC 26310001 */ addiu $s1, $s1, 1
.L80200C80:
/* 09FAD0 802E02D0 0224082A */ slt $at, $s1, $a0
/* 09FAD4 802E02D4 1420FFF4 */ bnez $at, .L80200C58
/* 09FAD8 802E02D8 24420010 */ addiu $v0, $v0, 0x10
/* 09FADC 802E02DC 00008825 */ move $s1, $zero
.L80200C90:
/* 09FAE0 802E02E0 10000049 */ b .L80200DB8
/* 09FAE4 802E02E4 00009825 */ move $s3, $zero
.L80200C98:
/* 09FAE8 802E02E8 19000026 */ blez $t0, .L80200D34
/* 09FAEC 802E02EC 00009825 */ move $s3, $zero
/* 09FAF0 802E02F0 3C048023 */ lui $a0, %hi(gMaxSimultaneousNotes) # $a0, 0x8023
/* 09FAF4 802E02F4 8C849808 */ lw $a0, %lo(gMaxSimultaneousNotes)($a0)
/* 09FAF8 802E02F8 27A50084 */ addiu $a1, $sp, 0x84
.L80200CAC:
/* 09FAFC 802E02FC 1880001A */ blez $a0, .L80200D18
/* 09FB00 802E0300 00008825 */ move $s1, $zero
/* 09FB04 802E0304 009E0019 */ multu $a0, $fp
/* 09FB08 802E0308 3C098022 */ lui $t1, %hi(gNoteSubsEu) # $t1, 0x8022
/* 09FB0C 802E030C 8D29C5E4 */ lw $t1, %lo(gNoteSubsEu)($t1)
/* 09FB10 802E0310 00001812 */ mflo $v1
/* 09FB14 802E0314 00000000 */ nop
/* 09FB18 802E0318 00000000 */ nop
.L80200CCC:
/* 09FB1C 802E031C 00037100 */ sll $t6, $v1, 4
/* 09FB20 802E0320 01C91021 */ addu $v0, $t6, $t1
/* 09FB24 802E0324 8C580000 */ lw $t8, ($v0)
/* 09FB28 802E0328 0018CFC2 */ srl $t9, $t8, 0x1f
/* 09FB2C 802E032C 5320000B */ beql $t9, $zero, .L80200D0C
/* 09FB30 802E0330 26310001 */ addiu $s1, $s1, 1
/* 09FB34 802E0334 904B0001 */ lbu $t3, 1($v0)
/* 09FB38 802E0338 00B26821 */ addu $t5, $a1, $s2
/* 09FB3C 802E033C 000B6142 */ srl $t4, $t3, 5
/* 09FB40 802E0340 566C0006 */ bnel $s3, $t4, .L80200D0C
/* 09FB44 802E0344 26310001 */ addiu $s1, $s1, 1
/* 09FB48 802E0348 26520001 */ addiu $s2, $s2, 1
/* 09FB4C 802E034C 00127C00 */ sll $t7, $s2, 0x10
/* 09FB50 802E0350 000F9403 */ sra $s2, $t7, 0x10
/* 09FB54 802E0354 A1B10000 */ sb $s1, ($t5)
/* 09FB58 802E0358 26310001 */ addiu $s1, $s1, 1
.L80200D0C:
/* 09FB5C 802E035C 0224082A */ slt $at, $s1, $a0
/* 09FB60 802E0360 1420FFEE */ bnez $at, .L80200CCC
/* 09FB64 802E0364 24630001 */ addiu $v1, $v1, 1
.L80200D18:
/* 09FB68 802E0368 26730001 */ addiu $s3, $s3, 1
/* 09FB6C 802E036C 0013C400 */ sll $t8, $s3, 0x10
/* 09FB70 802E0370 00189C03 */ sra $s3, $t8, 0x10
/* 09FB74 802E0374 0268082A */ slt $at, $s3, $t0
/* 09FB78 802E0378 1420FFE0 */ bnez $at, .L80200CAC
/* 09FB7C 802E037C 00000000 */ nop
/* 09FB80 802E0380 00009825 */ move $s3, $zero
.L80200D34:
/* 09FB84 802E0384 3C048023 */ lui $a0, %hi(gMaxSimultaneousNotes) # $a0, 0x8023
/* 09FB88 802E0388 8C849808 */ lw $a0, %lo(gMaxSimultaneousNotes)($a0)
/* 09FB8C 802E038C 27A50084 */ addiu $a1, $sp, 0x84
/* 09FB90 802E0390 00008825 */ move $s1, $zero
/* 09FB94 802E0394 5880001D */ blezl $a0, .L80200DBC
/* 09FB98 802E0398 02801025 */ move $v0, $s4
/* 09FB9C 802E039C 009E0019 */ multu $a0, $fp
/* 09FBA0 802E03A0 3C098022 */ lui $t1, %hi(gNoteSubsEu) # $t1, 0x8022
/* 09FBA4 802E03A4 8D29C5E4 */ lw $t1, %lo(gNoteSubsEu)($t1)
/* 09FBA8 802E03A8 00001812 */ mflo $v1
/* 09FBAC 802E03AC 00000000 */ nop
/* 09FBB0 802E03B0 00000000 */ nop
.L80200D64:
/* 09FBB4 802E03B4 00035900 */ sll $t3, $v1, 4
/* 09FBB8 802E03B8 01691021 */ addu $v0, $t3, $t1
/* 09FBBC 802E03BC 8C4C0000 */ lw $t4, ($v0)
/* 09FBC0 802E03C0 000C6FC2 */ srl $t5, $t4, 0x1f
/* 09FBC4 802E03C4 51A0000C */ beql $t5, $zero, .L80200DA8
/* 09FBC8 802E03C8 26310001 */ addiu $s1, $s1, 1
/* 09FBCC 802E03CC 904F0001 */ lbu $t7, 1($v0)
/* 09FBD0 802E03D0 00B2C021 */ addu $t8, $a1, $s2
/* 09FBD4 802E03D4 000F7142 */ srl $t6, $t7, 5
/* 09FBD8 802E03D8 01C8082A */ slt $at, $t6, $t0
/* 09FBDC 802E03DC 54200006 */ bnezl $at, .L80200DA8
/* 09FBE0 802E03E0 26310001 */ addiu $s1, $s1, 1
/* 09FBE4 802E03E4 26520001 */ addiu $s2, $s2, 1
/* 09FBE8 802E03E8 0012CC00 */ sll $t9, $s2, 0x10
/* 09FBEC 802E03EC 00199403 */ sra $s2, $t9, 0x10
/* 09FBF0 802E03F0 A3110000 */ sb $s1, ($t8)
/* 09FBF4 802E03F4 26310001 */ addiu $s1, $s1, 1
.L80200DA8:
/* 09FBF8 802E03F8 0224082A */ slt $at, $s1, $a0
/* 09FBFC 802E03FC 1420FFED */ bnez $at, .L80200D64
/* 09FC00 802E0400 24630001 */ addiu $v1, $v1, 1
/* 09FC04 802E0404 00008825 */ move $s1, $zero
.L80200DB8:
/* 09FC08 802E0408 02801025 */ move $v0, $s4
.L80200DBC:
/* 09FC0C 802E040C 3C0C0200 */ lui $t4, (0x020004C0 >> 16) # lui $t4, 0x200
/* 09FC10 802E0410 358C04C0 */ ori $t4, (0x020004C0 & 0xFFFF) # ori $t4, $t4, 0x4c0
/* 09FC14 802E0414 240D0280 */ li $t5, 640
/* 09FC18 802E0418 AC4D0004 */ sw $t5, 4($v0)
/* 09FC1C 802E041C AC4C0000 */ sw $t4, ($v0)
/* 09FC20 802E0420 814F0000 */ lb $t7, ($t2)
/* 09FC24 802E0424 3C178022 */ lui $s7, %hi(gNotes) # $s7, 0x8022
/* 09FC28 802E0428 26940008 */ addiu $s4, $s4, 8
/* 09FC2C 802E042C 19E00053 */ blez $t7, .L80200F2C
/* 09FC30 802E0430 26F73D60 */ addiu $s7, %lo(gNotes) # addiu $s7, $s7, 0x3d60
/* 09FC34 802E0434 3C158022 */ lui $s5, %hi(gNoteSubsEu) # $s5, 0x8022
/* 09FC38 802E0438 26B5C5E4 */ addiu $s5, %lo(gNoteSubsEu) # addiu $s5, $s5, -0x3a1c
/* 09FC3C 802E043C 241600C0 */ li $s6, 192
/* 09FC40 802E0440 00137140 */ sll $t6, $s3, 5
.L80200DF4:
/* 09FC44 802E0444 01D37021 */ addu $t6, $t6, $s3
/* 09FC48 802E0448 3C188022 */ lui $t8, %hi(gSynthesisReverbs) # $t8, 0x8022
/* 09FC4C 802E044C 2718C1B0 */ addiu $t8, %lo(gSynthesisReverbs) # addiu $t8, $t8, -0x3e50
/* 09FC50 802E0450 000E70C0 */ sll $t6, $t6, 3
/* 09FC54 802E0454 01D8C821 */ addu $t9, $t6, $t8
/* 09FC58 802E0458 AFB90060 */ sw $t9, 0x60($sp)
/* 09FC5C 802E045C 932B0001 */ lbu $t3, 1($t9)
/* 09FC60 802E0460 3C018022 */ lui $at, %hi(gUseReverb) # $at, 0x8022
/* 09FC64 802E0464 02802025 */ move $a0, $s4
/* 09FC68 802E0468 000B6600 */ sll $t4, $t3, 0x18
/* 09FC6C 802E046C 000C6E03 */ sra $t5, $t4, 0x18
/* 09FC70 802E0470 11A0000A */ beqz $t5, .L80200E4C
/* 09FC74 802E0474 A02BC5E2 */ sb $t3, %lo(gUseReverb)($at)
/* 09FC78 802E0478 00133400 */ sll $a2, $s3, 0x10
/* 09FC7C 802E047C 001E3C00 */ sll $a3, $fp, 0x10
/* 09FC80 802E0480 00077403 */ sra $t6, $a3, 0x10
/* 09FC84 802E0484 00067C03 */ sra $t7, $a2, 0x10
/* 09FC88 802E0488 01E03025 */ move $a2, $t7
/* 09FC8C 802E048C 01C03825 */ move $a3, $t6
/* 09FC90 802E0490 0C0B7F60 */ jal synthesis_resample_and_mix_reverb
/* 09FC94 802E0494 8FA500C4 */ lw $a1, 0xc4($sp)
/* 09FC98 802E0498 0040A025 */ move $s4, $v0
.L80200E4C:
/* 09FC9C 802E049C 0232082A */ slt $at, $s1, $s2
/* 09FCA0 802E04A0 10200022 */ beqz $at, .L80200EDC
/* 09FCA4 802E04A4 27B80084 */ addiu $t8, $sp, 0x84
/* 09FCA8 802E04A8 02388021 */ addu $s0, $s1, $t8
.L80200E5C:
/* 09FCAC 802E04AC 3C198023 */ lui $t9, %hi(gMaxSimultaneousNotes) # $t9, 0x8023
/* 09FCB0 802E04B0 8F399808 */ lw $t9, %lo(gMaxSimultaneousNotes)($t9)
/* 09FCB4 802E04B4 92030000 */ lbu $v1, ($s0)
/* 09FCB8 802E04B8 8EA90000 */ lw $t1, ($s5)
/* 09FCBC 802E04BC 03D90019 */ multu $fp, $t9
/* 09FCC0 802E04C0 00035900 */ sll $t3, $v1, 4
/* 09FCC4 802E04C4 012B6021 */ addu $t4, $t1, $t3
/* 09FCC8 802E04C8 00001012 */ mflo $v0
/* 09FCCC 802E04CC 00026900 */ sll $t5, $v0, 4
/* 09FCD0 802E04D0 018D7821 */ addu $t7, $t4, $t5
/* 09FCD4 802E04D4 91EE0001 */ lbu $t6, 1($t7)
/* 09FCD8 802E04D8 000EC142 */ srl $t8, $t6, 5
/* 09FCDC 802E04DC 56780014 */ bnel $s3, $t8, .L80200EE0
/* 09FCE0 802E04E0 8FAE0060 */ lw $t6, 0x60($sp)
/* 09FCE4 802E04E4 00760019 */ multu $v1, $s6
/* 09FCE8 802E04E8 8EEB0000 */ lw $t3, ($s7)
/* 09FCEC 802E04EC 8FAF00C4 */ lw $t7, 0xc4($sp)
/* 09FCF0 802E04F0 00626021 */ addu $t4, $v1, $v0
/* 09FCF4 802E04F4 000C6900 */ sll $t5, $t4, 4
/* 09FCF8 802E04F8 01A92821 */ addu $a1, $t5, $t1
/* 09FCFC 802E04FC 8FA700C0 */ lw $a3, 0xc0($sp)
/* 09FD00 802E0500 AFB40014 */ sw $s4, 0x14($sp)
/* 09FD04 802E0504 AFAF0010 */ sw $t7, 0x10($sp)
/* 09FD08 802E0508 0000C812 */ mflo $t9
/* 09FD0C 802E050C 032B2021 */ addu $a0, $t9, $t3
/* 09FD10 802E0510 0C0B81BC */ jal synthesis_process_note
/* 09FD14 802E0514 24860010 */ addiu $a2, $a0, 0x10
/* 09FD18 802E0518 26310001 */ addiu $s1, $s1, 1
/* 09FD1C 802E051C 0232082A */ slt $at, $s1, $s2
/* 09FD20 802E0520 0040A025 */ move $s4, $v0
/* 09FD24 802E0524 1420FFE1 */ bnez $at, .L80200E5C
/* 09FD28 802E0528 26100001 */ addiu $s0, $s0, 1
.L80200EDC:
/* 09FD2C 802E052C 8FAE0060 */ lw $t6, 0x60($sp)
.L80200EE0:
/* 09FD30 802E0530 00132C00 */ sll $a1, $s3, 0x10
/* 09FD34 802E0534 0005CC03 */ sra $t9, $a1, 0x10
/* 09FD38 802E0538 91D80001 */ lbu $t8, 1($t6)
/* 09FD3C 802E053C 03202825 */ move $a1, $t9
/* 09FD40 802E0540 02802025 */ move $a0, $s4
/* 09FD44 802E0544 13000005 */ beqz $t8, .L80200F0C
/* 09FD48 802E0548 001E3400 */ sll $a2, $fp, 0x10
/* 09FD4C 802E054C 00065C03 */ sra $t3, $a2, 0x10
/* 09FD50 802E0550 0C0B8036 */ jal func_eu_802e00d8
/* 09FD54 802E0554 01603025 */ move $a2, $t3
/* 09FD58 802E0558 0040A025 */ move $s4, $v0
.L80200F0C:
/* 09FD5C 802E055C 3C0F8022 */ lui $t7, %hi(gNumSynthesisReverbs) # $t7, 0x8022
/* 09FD60 802E0560 81EFC5E3 */ lb $t7, %lo(gNumSynthesisReverbs)($t7)
/* 09FD64 802E0564 26730001 */ addiu $s3, $s3, 1
/* 09FD68 802E0568 00136400 */ sll $t4, $s3, 0x10
/* 09FD6C 802E056C 000C9C03 */ sra $s3, $t4, 0x10
/* 09FD70 802E0570 026F082A */ slt $at, $s3, $t7
/* 09FD74 802E0574 5420FFB3 */ bnezl $at, .L80200DF4
/* 09FD78 802E0578 00137140 */ sll $t6, $s3, 5
.L80200F2C:
/* 09FD7C 802E057C 3C158022 */ lui $s5, %hi(gNoteSubsEu) # $s5, 0x8022
/* 09FD80 802E0580 3C178022 */ lui $s7, %hi(gNotes) # $s7, 0x8022
/* 09FD84 802E0584 0232082A */ slt $at, $s1, $s2
/* 09FD88 802E0588 26F73D60 */ addiu $s7, %lo(gNotes) # addiu $s7, $s7, 0x3d60
/* 09FD8C 802E058C 26B5C5E4 */ addiu $s5, %lo(gNoteSubsEu) # addiu $s5, $s5, -0x3a1c
/* 09FD90 802E0590 1020002E */ beqz $at, .L80200FFC
/* 09FD94 802E0594 241600C0 */ li $s6, 192
/* 09FD98 802E0598 27AE0084 */ addiu $t6, $sp, 0x84
/* 09FD9C 802E059C 022E8021 */ addu $s0, $s1, $t6
/* 09FDA0 802E05A0 24130001 */ li $s3, 1
.L80200F54:
/* 09FDA4 802E05A4 3C188023 */ lui $t8, %hi(gMaxSimultaneousNotes) # $t8, 0x8023
/* 09FDA8 802E05A8 8F189808 */ lw $t8, %lo(gMaxSimultaneousNotes)($t8)
/* 09FDAC 802E05AC 92030000 */ lbu $v1, ($s0)
/* 09FDB0 802E05B0 8EA90000 */ lw $t1, ($s5)
/* 09FDB4 802E05B4 03D80019 */ multu $fp, $t8
/* 09FDB8 802E05B8 0003C900 */ sll $t9, $v1, 4
/* 09FDBC 802E05BC 01395821 */ addu $t3, $t1, $t9
/* 09FDC0 802E05C0 3C0F8022 */ lui $t7, %hi(gBankLoadStatus)
/* 09FDC4 802E05C4 3C011000 */ lui $at, 0x1000
/* 09FDC8 802E05C8 00001012 */ mflo $v0
/* 09FDCC 802E05CC 00026100 */ sll $t4, $v0, 4
/* 09FDD0 802E05D0 016C6821 */ addu $t5, $t3, $t4
/* 09FDD4 802E05D4 91A40002 */ lbu $a0, 2($t5)
/* 09FDD8 802E05D8 01E47821 */ addu $t7, $t7, $a0
/* 09FDDC 802E05DC 91EF2C18 */ lbu $t7, %lo(gBankLoadStatus)($t7)
/* 09FDE0 802E05E0 29EE0002 */ slti $t6, $t7, 2
/* 09FDE4 802E05E4 39CE0001 */ xori $t6, $t6, 1
/* 09FDE8 802E05E8 166E0010 */ bne $s3, $t6, .L80200FDC
/* 09FDEC 802E05EC 00117A00 */ sll $t7, $s1, 8
/* 09FDF0 802E05F0 00760019 */ multu $v1, $s6
/* 09FDF4 802E05F4 8EF90000 */ lw $t9, ($s7)
/* 09FDF8 802E05F8 8FAD00C4 */ lw $t5, 0xc4($sp)
/* 09FDFC 802E05FC 00625821 */ addu $t3, $v1, $v0
/* 09FE00 802E0600 000B6100 */ sll $t4, $t3, 4
/* 09FE04 802E0604 01892821 */ addu $a1, $t4, $t1
/* 09FE08 802E0608 8FA700C0 */ lw $a3, 0xc0($sp)
/* 09FE0C 802E060C AFB40014 */ sw $s4, 0x14($sp)
/* 09FE10 802E0610 AFAD0010 */ sw $t5, 0x10($sp)
/* 09FE14 802E0614 0000C012 */ mflo $t8
/* 09FE18 802E0618 03192021 */ addu $a0, $t8, $t9
/* 09FE1C 802E061C 0C0B81BC */ jal synthesis_process_note
/* 09FE20 802E0620 24860010 */ addiu $a2, $a0, 0x10
/* 09FE24 802E0624 10000005 */ b .L80200FEC
/* 09FE28 802E0628 0040A025 */ move $s4, $v0
.L80200FDC:
/* 09FE2C 802E062C 008F7021 */ addu $t6, $a0, $t7
/* 09FE30 802E0630 01C1C021 */ addu $t8, $t6, $at
/* 09FE34 802E0634 3C018023 */ lui $at, %hi(gAudioErrorFlags) # $at, 0x8023
/* 09FE38 802E0638 AC3898F0 */ sw $t8, %lo(gAudioErrorFlags)($at)
.L80200FEC:
/* 09FE3C 802E063C 26310001 */ addiu $s1, $s1, 1
/* 09FE40 802E0640 0232082A */ slt $at, $s1, $s2
/* 09FE44 802E0644 1420FFD7 */ bnez $at, .L80200F54
/* 09FE48 802E0648 26100001 */ addiu $s0, $s0, 1
.L80200FFC:
/* 09FE4C 802E064C 3C080800 */ lui $t0, 0x800
/* 09FE50 802E0650 02802025 */ move $a0, $s4
/* 09FE54 802E0654 AC880000 */ sw $t0, ($a0)
/* 09FE58 802E0658 8FA300C4 */ lw $v1, 0xc4($sp)
/* 09FE5C 802E065C 26940008 */ addiu $s4, $s4, 8
/* 09FE60 802E0660 02802825 */ move $a1, $s4
/* 09FE64 802E0664 0003C840 */ sll $t9, $v1, 1
/* 09FE68 802E0668 332BFFFF */ andi $t3, $t9, 0xffff
/* 09FE6C 802E066C AC8B0004 */ sw $t3, 4($a0)
/* 09FE70 802E0670 26940008 */ addiu $s4, $s4, 8
/* 09FE74 802E0674 3C0D04C0 */ lui $t5, (0x04C00600 >> 16) # lui $t5, 0x4c0
/* 09FE78 802E0678 35AD0600 */ ori $t5, (0x04C00600 & 0xFFFF) # ori $t5, $t5, 0x600
/* 09FE7C 802E067C 3C0C0D00 */ lui $t4, 0xd00
/* 09FE80 802E0680 02803025 */ move $a2, $s4
/* 09FE84 802E0684 ACAC0000 */ sw $t4, ($a1)
/* 09FE88 802E0688 ACAD0004 */ sw $t5, 4($a1)
/* 09FE8C 802E068C 00197840 */ sll $t7, $t9, 1
/* 09FE90 802E0690 31EEFFFF */ andi $t6, $t7, 0xffff
/* 09FE94 802E0694 26940008 */ addiu $s4, $s4, 8
/* 09FE98 802E0698 ACCE0004 */ sw $t6, 4($a2)
/* 09FE9C 802E069C ACC80000 */ sw $t0, ($a2)
/* 09FEA0 802E06A0 02803825 */ move $a3, $s4
/* 09FEA4 802E06A4 3C180600 */ lui $t8, 0x600
/* 09FEA8 802E06A8 ACF80000 */ sw $t8, ($a3)
/* 09FEAC 802E06AC 8FB900C0 */ lw $t9, 0xc0($sp)
/* 09FEB0 802E06B0 3C018000 */ lui $at, 0x8000
/* 09FEB4 802E06B4 26820008 */ addiu $v0, $s4, 8
/* 09FEB8 802E06B8 03215821 */ addu $t3, $t9, $at
/* 09FEBC 802E06BC ACEB0004 */ sw $t3, 4($a3)
/* 09FEC0 802E06C0 8FBF0044 */ lw $ra, 0x44($sp)
/* 09FEC4 802E06C4 8FBE0040 */ lw $fp, 0x40($sp)
/* 09FEC8 802E06C8 8FB7003C */ lw $s7, 0x3c($sp)
/* 09FECC 802E06CC 8FB60038 */ lw $s6, 0x38($sp)
/* 09FED0 802E06D0 8FB50034 */ lw $s5, 0x34($sp)
/* 09FED4 802E06D4 8FB40030 */ lw $s4, 0x30($sp)
/* 09FED8 802E06D8 8FB3002C */ lw $s3, 0x2c($sp)
/* 09FEDC 802E06DC 8FB20028 */ lw $s2, 0x28($sp)
/* 09FEE0 802E06E0 8FB10024 */ lw $s1, 0x24($sp)
/* 09FEE4 802E06E4 8FB00020 */ lw $s0, 0x20($sp)
/* 09FEE8 802E06E8 03E00008 */ jr $ra
/* 09FEEC 802E06EC 27BD00C0 */ addiu $sp, $sp, 0xc0

View file

@ -0,0 +1,178 @@
glabel synthesis_execute
/* 09F2FC 802DFAFC 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 09F300 802DFB00 AFB60030 */ sw $s6, 0x30($sp)
/* 09F304 802DFB04 3C168023 */ lui $s6, %hi(gAudioBufferParameters) # $s6, 0x8023
/* 09F308 802DFB08 26D697E0 */ addiu $s6, %lo(gAudioBufferParameters) # addiu $s6, $s6, -0x6820
/* 09F30C 802DFB0C AFB40028 */ sw $s4, 0x28($sp)
/* 09F310 802DFB10 86D4000C */ lh $s4, 0xc($s6)
/* 09F314 802DFB14 AFB70034 */ sw $s7, 0x34($sp)
/* 09F318 802DFB18 AFB1001C */ sw $s1, 0x1c($sp)
/* 09F31C 802DFB1C 00C08825 */ move $s1, $a2
/* 09F320 802DFB20 00E0B825 */ move $s7, $a3
/* 09F324 802DFB24 AFBF003C */ sw $ra, 0x3c($sp)
/* 09F328 802DFB28 AFBE0038 */ sw $fp, 0x38($sp)
/* 09F32C 802DFB2C AFB5002C */ sw $s5, 0x2c($sp)
/* 09F330 802DFB30 AFB30024 */ sw $s3, 0x24($sp)
/* 09F334 802DFB34 AFB20020 */ sw $s2, 0x20($sp)
/* 09F338 802DFB38 AFB00018 */ sw $s0, 0x18($sp)
/* 09F33C 802DFB3C AFA40060 */ sw $a0, 0x60($sp)
/* 09F340 802DFB40 1A800009 */ blez $s4, .L80200518
/* 09F344 802DFB44 AFA50064 */ sw $a1, 0x64($sp)
.L802004F8:
/* 09F348 802DFB48 2690FFFF */ addiu $s0, $s4, -1
/* 09F34C 802DFB4C 0C0BA59D */ jal process_sequences
/* 09F350 802DFB50 02002025 */ move $a0, $s0
/* 09F354 802DFB54 86CE000C */ lh $t6, 0xc($s6)
/* 09F358 802DFB58 0C0B7E91 */ jal synthesis_load_note_subs_eu
/* 09F35C 802DFB5C 01D42023 */ subu $a0, $t6, $s4
/* 09F360 802DFB60 1E00FFF9 */ bgtz $s0, .L802004F8
/* 09F364 802DFB64 0200A025 */ move $s4, $s0
.L80200518:
/* 09F368 802DFB68 8FAF0060 */ lw $t7, 0x60($sp)
/* 09F36C 802DFB6C 3C190700 */ lui $t9, 0x700
/* 09F370 802DFB70 0220F025 */ move $fp, $s1
/* 09F374 802DFB74 25F80008 */ addiu $t8, $t7, 8
/* 09F378 802DFB78 AFB80048 */ sw $t8, 0x48($sp)
/* 09F37C 802DFB7C ADE00004 */ sw $zero, 4($t7)
/* 09F380 802DFB80 ADF90000 */ sw $t9, ($t7)
/* 09F384 802DFB84 86D4000C */ lh $s4, 0xc($s6)
/* 09F388 802DFB88 8FB50040 */ lw $s5, 0x40($sp)
/* 09F38C 802DFB8C 01E01025 */ move $v0, $t7
/* 09F390 802DFB90 1A800056 */ blez $s4, .L8020069C
.L80200544:
/* 09F394 802DFB94 24010001 */ li $at, 1
/* 09F398 802DFB98 86D2000C */ lh $s2, 0xc($s6)
/* 09F39C 802DFB9C 1681000B */ bne $s4, $at, .L8020057C
/* 09F3A0 802DFBA0 00008825 */ move $s1, $zero
/* 09F3A4 802DFBA4 3C098022 */ lui $t1, %hi(gLeftVolRampings) # $t1, 0x8022
/* 09F3A8 802DFBA8 3C0B8022 */ lui $t3, %hi(gRightVolRampings) # $t3, 0x8022
/* 09F3AC 802DFBAC 256BF5E8 */ addiu $t3, %lo(gRightVolRampings) # addiu $t3, $t3, -0xa18
/* 09F3B0 802DFBB0 2529C5E8 */ addiu $t1, %lo(gLeftVolRampings) # addiu $t1, $t1, -0x3a18
/* 09F3B4 802DFBB4 00154300 */ sll $t0, $s5, 0xc
/* 09F3B8 802DFBB8 00155300 */ sll $t2, $s5, 0xc
/* 09F3BC 802DFBBC 014B2021 */ addu $a0, $t2, $t3
/* 09F3C0 802DFBC0 01091821 */ addu $v1, $t0, $t1
/* 09F3C4 802DFBC4 10000026 */ b .L80200610
/* 09F3C8 802DFBC8 02E09825 */ move $s3, $s7
.L8020057C:
/* 09F3CC 802DFBCC 02F4001A */ div $zero, $s7, $s4
/* 09F3D0 802DFBD0 16800002 */ bnez $s4, .L8020058C
/* 09F3D4 802DFBD4 00000000 */ nop
/* 09F3D8 802DFBD8 0007000D */ break 7
.L8020058C:
/* 09F3DC 802DFBDC 2401FFFF */ li $at, -1
/* 09F3E0 802DFBE0 16810004 */ bne $s4, $at, .L802005A4
/* 09F3E4 802DFBE4 3C018000 */ lui $at, 0x8000
/* 09F3E8 802DFBE8 16E10002 */ bne $s7, $at, .L802005A4
/* 09F3EC 802DFBEC 00000000 */ nop
/* 09F3F0 802DFBF0 0006000D */ break 6
.L802005A4:
/* 09F3F4 802DFBF4 86C50010 */ lh $a1, 0x10($s6)
/* 09F3F8 802DFBF8 00001012 */ mflo $v0
/* 09F3FC 802DFBFC 24150002 */ li $s5, 2
/* 09F400 802DFC00 0045082A */ slt $at, $v0, $a1
/* 09F404 802DFC04 14200006 */ bnez $at, .L802005D0
/* 09F408 802DFC08 00A09825 */ move $s3, $a1
/* 09F40C 802DFC0C 3C038022 */ lui $v1, %hi(gLeftVolRampings + 0x2000) # $v1, 0x8022
/* 09F410 802DFC10 3C048022 */ lui $a0, %hi(gRightVolRampings + 0x2000) # $a0, 0x8022
/* 09F414 802DFC14 248415E8 */ addiu $a0, %lo(gRightVolRampings + 0x2000) # addiu $a0, $a0, 0x15e8
/* 09F418 802DFC18 10000011 */ b .L80200610
/* 09F41C 802DFC1C 2463E5E8 */ addiu $v1, %lo(gLeftVolRampings + 0x2000) # addiu $v1, $v1, -0x1a18
.L802005D0:
/* 09F420 802DFC20 86C50012 */ lh $a1, 0x12($s6)
/* 09F424 802DFC24 3C038022 */ lui $v1, %hi(gLeftVolRampings + 0x1000) # $v1, 0x8022
/* 09F428 802DFC28 2463D5E8 */ addiu $v1, %lo(gLeftVolRampings + 0x1000) # addiu $v1, $v1, -0x2a18
/* 09F42C 802DFC2C 00A2082A */ slt $at, $a1, $v0
/* 09F430 802DFC30 14200008 */ bnez $at, .L80200604
/* 09F434 802DFC34 24150001 */ li $s5, 1
/* 09F438 802DFC38 3C038022 */ lui $v1, %hi(gLeftVolRampings) # $v1, 0x8022
/* 09F43C 802DFC3C 3C048022 */ lui $a0, %hi(gRightVolRampings) # $a0, 0x8022
/* 09F440 802DFC40 2484F5E8 */ addiu $a0, %lo(gRightVolRampings) # addiu $a0, $a0, -0xa18
/* 09F444 802DFC44 2463C5E8 */ addiu $v1, %lo(gLeftVolRampings) # addiu $v1, $v1, -0x3a18
/* 09F448 802DFC48 00A09825 */ move $s3, $a1
/* 09F44C 802DFC4C 10000004 */ b .L80200610
/* 09F450 802DFC50 0000A825 */ move $s5, $zero
.L80200604:
/* 09F454 802DFC54 3C048022 */ lui $a0, %hi(gRightVolRampings + 0x1000) # $a0, 0x8022
/* 09F458 802DFC58 248405E8 */ addiu $a0, %lo(gRightVolRampings + 0x1000) # addiu $a0, $a0, 0x5e8
/* 09F45C 802DFC5C 86D3000E */ lh $s3, 0xe($s6)
.L80200610:
/* 09F460 802DFC60 3C028022 */ lui $v0, %hi(gNumSynthesisReverbs) # $v0, 0x8022
/* 09F464 802DFC64 8042C5E3 */ lb $v0, %lo(gNumSynthesisReverbs)($v0)
/* 09F468 802DFC68 3C018022 */ lui $at, %hi(gCurrentLeftVolRamping) # $at, 0x8022
/* 09F46C 802DFC6C AC2325E8 */ sw $v1, %lo(gCurrentLeftVolRamping)($at)
/* 09F470 802DFC70 3C018022 */ lui $at, %hi(gCurrentRightVolRamping) # $at, 0x8022
/* 09F474 802DFC74 18400011 */ blez $v0, .L8020066C
/* 09F478 802DFC78 AC2425EC */ sw $a0, %lo(gCurrentRightVolRamping)($at)
/* 09F47C 802DFC7C 3C108022 */ lui $s0, %hi(gSynthesisReverbs) # $s0, 0x8022
/* 09F480 802DFC80 2610C1B0 */ addiu $s0, %lo(gSynthesisReverbs) # addiu $s0, $s0, -0x3e50
.L80200634:
/* 09F484 802DFC84 920C0001 */ lbu $t4, 1($s0)
/* 09F488 802DFC88 02602025 */ move $a0, $s3
/* 09F48C 802DFC8C 02542823 */ subu $a1, $s2, $s4
/* 09F490 802DFC90 51800007 */ beql $t4, $zero, .L80200660
/* 09F494 802DFC94 26310001 */ addiu $s1, $s1, 1
/* 09F498 802DFC98 0C0B7D94 */ jal prepare_reverb_ring_buffer
/* 09F49C 802DFC9C 02203025 */ move $a2, $s1
/* 09F4A0 802DFCA0 3C028022 */ lui $v0, %hi(gNumSynthesisReverbs) # $v0, 0x8022
/* 09F4A4 802DFCA4 8042C5E3 */ lb $v0, %lo(gNumSynthesisReverbs)($v0)
/* 09F4A8 802DFCA8 86D2000C */ lh $s2, 0xc($s6)
/* 09F4AC 802DFCAC 26310001 */ addiu $s1, $s1, 1
.L80200660:
/* 09F4B0 802DFCB0 0222082A */ slt $at, $s1, $v0
/* 09F4B4 802DFCB4 1420FFF3 */ bnez $at, .L80200634
/* 09F4B8 802DFCB8 26100108 */ addiu $s0, $s0, 0x108
.L8020066C:
/* 09F4BC 802DFCBC 03C02025 */ move $a0, $fp
/* 09F4C0 802DFCC0 02602825 */ move $a1, $s3
/* 09F4C4 802DFCC4 8FA60048 */ lw $a2, 0x48($sp)
/* 09F4C8 802DFCC8 0C0B808A */ jal synthesis_do_one_audio_update
/* 09F4CC 802DFCCC 02543823 */ subu $a3, $s2, $s4
/* 09F4D0 802DFCD0 2694FFFF */ addiu $s4, $s4, -1
/* 09F4D4 802DFCD4 00136880 */ sll $t5, $s3, 2
/* 09F4D8 802DFCD8 AFA20048 */ sw $v0, 0x48($sp)
/* 09F4DC 802DFCDC 02F3B823 */ subu $s7, $s7, $s3
/* 09F4E0 802DFCE0 1E80FFAC */ bgtz $s4, .L80200544
/* 09F4E4 802DFCE4 03CDF021 */ addu $fp, $fp, $t5
/* 09F4E8 802DFCE8 AFB50040 */ sw $s5, 0x40($sp)
.L8020069C:
/* 09F4EC 802DFCEC 3C028022 */ lui $v0, %hi(gNumSynthesisReverbs) # $v0, 0x8022
/* 09F4F0 802DFCF0 8042C5E3 */ lb $v0, %lo(gNumSynthesisReverbs)($v0)
/* 09F4F4 802DFCF4 3C0E8022 */ lui $t6, %hi(gSynthesisReverbs)
/* 09F4F8 802DFCF8 25D0C1B0 */ addiu $s0, $t6, %lo(gSynthesisReverbs)
/* 09F4FC 802DFCFC 1840000E */ blez $v0, .L802006E8
/* 09F500 802DFD00 00027940 */ sll $t7, $v0, 5
/* 09F504 802DFD04 01E27821 */ addu $t7, $t7, $v0
/* 09F508 802DFD08 000F78C0 */ sll $t7, $t7, 3
/* 09F50C 802DFD0C 01F01821 */ addu $v1, $t7, $s0
.L802006C0:
/* 09F510 802DFD10 92020002 */ lbu $v0, 2($s0)
/* 09F514 802DFD14 10400002 */ beqz $v0, .L802006D0
/* 09F518 802DFD18 2458FFFF */ addiu $t8, $v0, -1
/* 09F51C 802DFD1C A2180002 */ sb $t8, 2($s0)
.L802006D0:
/* 09F520 802DFD20 92190003 */ lbu $t9, 3($s0)
/* 09F524 802DFD24 26100108 */ addiu $s0, $s0, 0x108
/* 09F528 802DFD28 0203082B */ sltu $at, $s0, $v1
/* 09F52C 802DFD2C 3B280001 */ xori $t0, $t9, 1
/* 09F530 802DFD30 1420FFF7 */ bnez $at, .L802006C0
/* 09F534 802DFD34 A208FEFB */ sb $t0, -0x105($s0)
.L802006E8:
/* 09F538 802DFD38 8FA20048 */ lw $v0, 0x48($sp)
/* 09F53C 802DFD3C 8FAA0060 */ lw $t2, 0x60($sp)
/* 09F540 802DFD40 8FAD0064 */ lw $t5, 0x64($sp)
/* 09F544 802DFD44 004A5823 */ subu $t3, $v0, $t2
/* 09F548 802DFD48 000B60C3 */ sra $t4, $t3, 3
/* 09F54C 802DFD4C ADAC0000 */ sw $t4, ($t5)
/* 09F550 802DFD50 8FBF003C */ lw $ra, 0x3c($sp)
/* 09F554 802DFD54 8FBE0038 */ lw $fp, 0x38($sp)
/* 09F558 802DFD58 8FB70034 */ lw $s7, 0x34($sp)
/* 09F55C 802DFD5C 8FB60030 */ lw $s6, 0x30($sp)
/* 09F560 802DFD60 8FB5002C */ lw $s5, 0x2c($sp)
/* 09F564 802DFD64 8FB40028 */ lw $s4, 0x28($sp)
/* 09F568 802DFD68 8FB30024 */ lw $s3, 0x24($sp)
/* 09F56C 802DFD6C 8FB20020 */ lw $s2, 0x20($sp)
/* 09F570 802DFD70 8FB1001C */ lw $s1, 0x1c($sp)
/* 09F574 802DFD74 8FB00018 */ lw $s0, 0x18($sp)
/* 09F578 802DFD78 03E00008 */ jr $ra
/* 09F57C 802DFD7C 27BD0060 */ addiu $sp, $sp, 0x60

View file

@ -0,0 +1,657 @@
glabel synthesis_process_note
/* 09FEF0 802E06F0 27BDFEB8 */ addiu $sp, $sp, -0x148
/* 09FEF4 802E06F4 AFBF004C */ sw $ra, 0x4c($sp)
/* 09FEF8 802E06F8 AFBE0048 */ sw $fp, 0x48($sp)
/* 09FEFC 802E06FC AFB70044 */ sw $s7, 0x44($sp)
/* 09FF00 802E0700 AFB60040 */ sw $s6, 0x40($sp)
/* 09FF04 802E0704 AFB5003C */ sw $s5, 0x3c($sp)
/* 09FF08 802E0708 AFB40038 */ sw $s4, 0x38($sp)
/* 09FF0C 802E070C AFB30034 */ sw $s3, 0x34($sp)
/* 09FF10 802E0710 AFB20030 */ sw $s2, 0x30($sp)
/* 09FF14 802E0714 AFB1002C */ sw $s1, 0x2c($sp)
/* 09FF18 802E0718 AFB00028 */ sw $s0, 0x28($sp)
/* 09FF1C 802E071C AFA40148 */ sw $a0, 0x148($sp)
/* 09FF20 802E0720 AFA70154 */ sw $a3, 0x154($sp)
/* 09FF24 802E0724 AFA00130 */ sw $zero, 0x130($sp)
/* 09FF28 802E0728 8C8F00B0 */ lw $t7, 0xb0($a0)
/* 09FF2C 802E072C 00A08825 */ move $s1, $a1
/* 09FF30 802E0730 00C0B825 */ move $s7, $a2
/* 09FF34 802E0734 000FC7C2 */ srl $t8, $t7, 0x1f
/* 09FF38 802E0738 57000004 */ bnezl $t8, .L802010FC
/* 09FF3C 802E073C 8E390000 */ lw $t9, ($s1)
/* 09FF40 802E0740 1000023E */ b .L802019EC
/* 09FF44 802E0744 8FA2015C */ lw $v0, 0x15c($sp)
/* 09FF48 802E0748 8E390000 */ lw $t9, ($s1)
.L802010FC:
/* 09FF4C 802E074C 24130001 */ li $s3, 1
/* 09FF50 802E0750 00001825 */ move $v1, $zero
/* 09FF54 802E0754 00197040 */ sll $t6, $t9, 1
/* 09FF58 802E0758 000E7FC2 */ srl $t7, $t6, 0x1f
/* 09FF5C 802E075C 166F0009 */ bne $s3, $t7, .L80201134
/* 09FF60 802E0760 02202825 */ move $a1, $s1
/* 09FF64 802E0764 02601825 */ move $v1, $s3
/* 09FF68 802E0768 A2E00000 */ sb $zero, ($s7)
/* 09FF6C 802E076C AEE00008 */ sw $zero, 8($s7)
/* 09FF70 802E0770 A6E00004 */ sh $zero, 4($s7)
/* 09FF74 802E0774 A6F30010 */ sh $s3, 0x10($s7)
/* 09FF78 802E0778 A6F30012 */ sh $s3, 0x12($s7)
/* 09FF7C 802E077C A2E00002 */ sb $zero, 2($s7)
/* 09FF80 802E0780 A2E00003 */ sb $zero, 3($s7)
.L80201134:
/* 09FF84 802E0784 9638000A */ lhu $t8, 0xa($s1)
/* 09FF88 802E0788 02E03025 */ move $a2, $s7
/* 09FF8C 802E078C A7B8011A */ sh $t8, 0x11a($sp)
/* 09FF90 802E0790 96390000 */ lhu $t9, ($s1)
/* 09FF94 802E0794 3318FFFF */ andi $t8, $t8, 0xffff
/* 09FF98 802E0798 332E0001 */ andi $t6, $t9, 1
/* 09FF9C 802E079C 8FB90158 */ lw $t9, 0x158($sp)
/* 09FFA0 802E07A0 25CF0001 */ addiu $t7, $t6, 1
/* 09FFA4 802E07A4 AFAF00BC */ sw $t7, 0xbc($sp)
/* 09FFA8 802E07A8 03190019 */ multu $t8, $t9
/* 09FFAC 802E07AC 96F80004 */ lhu $t8, 4($s7)
/* 09FFB0 802E07B0 00007012 */ mflo $t6
/* 09FFB4 802E07B4 000E7840 */ sll $t7, $t6, 1
/* 09FFB8 802E07B8 01F81021 */ addu $v0, $t7, $t8
/* 09FFBC 802E07BC A6E20004 */ sh $v0, 4($s7)
/* 09FFC0 802E07C0 8E270000 */ lw $a3, ($s1)
/* 09FFC4 802E07C4 8FA4015C */ lw $a0, 0x15c($sp)
/* 09FFC8 802E07C8 00028402 */ srl $s0, $v0, 0x10
/* 09FFCC 802E07CC 00077B80 */ sll $t7, $a3, 0xe
/* 09FFD0 802E07D0 05E3000D */ bgezl $t7, .L802011B8
/* 09FFD4 802E07D4 8E2F000C */ lw $t7, 0xc($s1)
/* 09FFD8 802E07D8 0C0B841B */ jal load_wave_samples
/* 09FFDC 802E07DC 02003825 */ move $a3, $s0
/* 09FFE0 802E07E0 8EE60008 */ lw $a2, 8($s7)
/* 09FFE4 802E07E4 0006C040 */ sll $t8, $a2, 1
/* 09FFE8 802E07E8 27190180 */ addiu $t9, $t8, 0x180
/* 09FFEC 802E07EC A7B900AA */ sh $t9, 0xaa($sp)
/* 09FFF0 802E07F0 00D07021 */ addu $t6, $a2, $s0
/* 09FFF4 802E07F4 AEEE0008 */ sw $t6, 8($s7)
/* 09FFF8 802E07F8 8E270000 */ lw $a3, ($s1)
/* 09FFFC 802E07FC 100001D4 */ b .L80201900
/* 0A0000 802E0800 AFA2015C */ sw $v0, 0x15c($sp)
/* 0A0004 802E0804 8E2F000C */ lw $t7, 0xc($s1)
.L802011B8:
/* 0A0008 802E0808 241F0009 */ li $ra, 9
/* 0A000C 802E080C 3C0D8000 */ lui $t5, 0x8000
/* 0A0010 802E0810 8DF80000 */ lw $t8, ($t7)
/* 0A0014 802E0814 AFB80138 */ sw $t8, 0x138($sp)
/* 0A0018 802E0818 8F0E0008 */ lw $t6, 8($t8)
/* 0A001C 802E081C AFAE0134 */ sw $t6, 0x134($sp)
/* 0A0020 802E0820 8DCF0004 */ lw $t7, 4($t6)
/* 0A0024 802E0824 8FAE00BC */ lw $t6, 0xbc($sp)
/* 0A0028 802E0828 AFAF00E4 */ sw $t7, 0xe4($sp)
/* 0A002C 802E082C 8F180004 */ lw $t8, 4($t8)
/* 0A0030 802E0830 AFA000AC */ sw $zero, 0xac($sp)
/* 0A0034 802E0834 AFA000B8 */ sw $zero, 0xb8($sp)
/* 0A0038 802E0838 19C001C5 */ blez $t6, .L80201900
/* 0A003C 802E083C AFB800F4 */ sw $t8, 0xf4($sp)
/* 0A0040 802E0840 00027C02 */ srl $t7, $v0, 0x10
/* 0A0044 802E0844 AFAF0050 */ sw $t7, 0x50($sp)
/* 0A0048 802E0848 AFA3011C */ sw $v1, 0x11c($sp)
/* 0A004C 802E084C AFB1014C */ sw $s1, 0x14c($sp)
/* 0A0050 802E0850 8FB2015C */ lw $s2, 0x15c($sp)
.L80201204:
/* 0A0054 802E0854 8FB90138 */ lw $t9, 0x138($sp)
/* 0A0058 802E0858 8FB800BC */ lw $t8, 0xbc($sp)
/* 0A005C 802E085C 24010001 */ li $at, 1
/* 0A0060 802E0860 8F24000C */ lw $a0, 0xc($t9)
/* 0A0064 802E0864 0000F025 */ move $fp, $zero
/* 0A0068 802E0868 0000A025 */ move $s4, $zero
/* 0A006C 802E086C 17010003 */ bne $t8, $at, .L8020122C
/* 0A0070 802E0870 24850008 */ addiu $a1, $a0, 8
/* 0A0074 802E0874 1000000B */ b .L80201254
/* 0A0078 802E0878 8FAC0050 */ lw $t4, 0x50($sp)
.L8020122C:
/* 0A007C 802E087C 8FAE0050 */ lw $t6, 0x50($sp)
/* 0A0080 802E0880 8FB800B8 */ lw $t8, 0xb8($sp)
/* 0A0084 802E0884 8FAC0050 */ lw $t4, 0x50($sp)
/* 0A0088 802E0888 31CF0001 */ andi $t7, $t6, 1
/* 0A008C 802E088C 11E00005 */ beqz $t7, .L80201254
/* 0A0090 802E0890 2401FFFE */ li $at, -2
/* 0A0094 802E0894 01C1C824 */ and $t9, $t6, $at
/* 0A0098 802E0898 00187840 */ sll $t7, $t8, 1
/* 0A009C 802E089C 10000001 */ b .L80201254
/* 0A00A0 802E08A0 032F6021 */ addu $t4, $t9, $t7
.L80201254:
/* 0A00A4 802E08A4 8FAE0130 */ lw $t6, 0x130($sp)
/* 0A00A8 802E08A8 51C5001A */ beql $t6, $a1, .L802012C4
/* 0A00AC 802E08AC 0007C2C0 */ sll $t8, $a3, 0xb
/* 0A00B0 802E08B0 AFA50130 */ sw $a1, 0x130($sp)
/* 0A00B4 802E08B4 8C980000 */ lw $t8, ($a0)
/* 0A00B8 802E08B8 8C8F0004 */ lw $t7, 4($a0)
/* 0A00BC 802E08BC 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff
/* 0A00C0 802E08C0 0018C900 */ sll $t9, $t8, 4
/* 0A00C4 802E08C4 032F0019 */ multu $t9, $t7
/* 0A00C8 802E08C8 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff
/* 0A00CC 802E08CC 8FA6014C */ lw $a2, 0x14c($sp)
/* 0A00D0 802E08D0 02401025 */ move $v0, $s2
/* 0A00D4 802E08D4 26520008 */ addiu $s2, $s2, 8
/* 0A00D8 802E08D8 00001812 */ mflo $v1
/* 0A00DC 802E08DC 00617024 */ and $t6, $v1, $at
/* 0A00E0 802E08E0 3C010B00 */ lui $at, 0xb00
/* 0A00E4 802E08E4 01C1C025 */ or $t8, $t6, $at
/* 0A00E8 802E08E8 AC580000 */ sw $t8, ($v0)
/* 0A00EC 802E08EC 8CD90000 */ lw $t9, ($a2)
/* 0A00F0 802E08F0 00197AC0 */ sll $t7, $t9, 0xb
/* 0A00F4 802E08F4 8FB90130 */ lw $t9, 0x130($sp)
/* 0A00F8 802E08F8 000F7742 */ srl $t6, $t7, 0x1d
/* 0A00FC 802E08FC 000EC040 */ sll $t8, $t6, 1
/* 0A0100 802E0900 03197821 */ addu $t7, $t8, $t9
/* 0A0104 802E0904 01ED7021 */ addu $t6, $t7, $t5
/* 0A0108 802E0908 AC4E0004 */ sw $t6, 4($v0)
/* 0A010C 802E090C 8CC70000 */ lw $a3, ($a2)
/* 0A0110 802E0910 0007C2C0 */ sll $t8, $a3, 0xb
.L802012C4:
/* 0A0114 802E0914 0018CF42 */ srl $t9, $t8, 0x1d
/* 0A0118 802E0918 13200003 */ beqz $t9, .L802012D8
/* 0A011C 802E091C 3C0F8030 */ lui $t7, %hi(euUnknownData_80301950) # $t7, 0x8030
/* 0A0120 802E0920 25EF1970 */ addiu $t7, %lo(euUnknownData_80301950) # addiu $t7, $t7, 0x1970
/* 0A0124 802E0924 AFAF0130 */ sw $t7, 0x130($sp)
.L802012D8:
/* 0A0128 802E0928 51800108 */ beql $t4, $zero, .L802016FC
/* 0A012C 802E092C 8FA400BC */ lw $a0, 0xbc($sp)
/* 0A0130 802E0930 8EE60008 */ lw $a2, 8($s7)
.L802012E4:
/* 0A0134 802E0934 8FAE00E4 */ lw $t6, 0xe4($sp)
/* 0A0138 802E0938 019E2023 */ subu $a0, $t4, $fp
/* 0A013C 802E093C 30D3000F */ andi $s3, $a2, 0xf
/* 0A0140 802E0940 00004825 */ move $t1, $zero
/* 0A0144 802E0944 00005025 */ move $t2, $zero
/* 0A0148 802E0948 00805825 */ move $t3, $a0
/* 0A014C 802E094C 16600005 */ bnez $s3, .L80201314
/* 0A0150 802E0950 01C61823 */ subu $v1, $t6, $a2
/* 0A0154 802E0954 92F80000 */ lbu $t8, ($s7)
/* 0A0158 802E0958 57000003 */ bnezl $t8, .L80201318
/* 0A015C 802E095C 24190010 */ li $t9, 16
/* 0A0160 802E0960 24130010 */ li $s3, 16
.L80201314:
/* 0A0164 802E0964 24190010 */ li $t9, 16
.L80201318:
/* 0A0168 802E0968 03332823 */ subu $a1, $t9, $s3
/* 0A016C 802E096C 0083082A */ slt $at, $a0, $v1
/* 0A0170 802E0970 1020000C */ beqz $at, .L80201354
/* 0A0174 802E0974 00A0A825 */ move $s5, $a1
/* 0A0178 802E0978 00851023 */ subu $v0, $a0, $a1
/* 0A017C 802E097C 2442000F */ addiu $v0, $v0, 0xf
/* 0A0180 802E0980 04410003 */ bgez $v0, .L80201340
/* 0A0184 802E0984 00027903 */ sra $t7, $v0, 4
/* 0A0188 802E0988 2441000F */ addiu $at, $v0, 0xf
/* 0A018C 802E098C 00017903 */ sra $t7, $at, 4
.L80201340:
/* 0A0190 802E0990 000F8900 */ sll $s1, $t7, 4
/* 0A0194 802E0994 00B17021 */ addu $t6, $a1, $s1
/* 0A0198 802E0998 01E04025 */ move $t0, $t7
/* 0A019C 802E099C 10000013 */ b .L8020139C
/* 0A01A0 802E09A0 01C4B023 */ subu $s6, $t6, $a0
.L80201354:
/* 0A01A4 802E09A4 00658823 */ subu $s1, $v1, $a1
/* 0A01A8 802E09A8 1E200003 */ bgtz $s1, .L80201368
/* 0A01AC 802E09AC 0000B025 */ move $s6, $zero
/* 0A01B0 802E09B0 00008825 */ move $s1, $zero
/* 0A01B4 802E09B4 0060A825 */ move $s5, $v1
.L80201368:
/* 0A01B8 802E09B8 8FB90134 */ lw $t9, 0x134($sp)
/* 0A01BC 802E09BC 2628000F */ addiu $t0, $s1, 0xf
/* 0A01C0 802E09C0 05010003 */ bgez $t0, .L80201380
/* 0A01C4 802E09C4 0008C103 */ sra $t8, $t0, 4
/* 0A01C8 802E09C8 2501000F */ addiu $at, $t0, 0xf
/* 0A01CC 802E09CC 0001C103 */ sra $t8, $at, 4
.L80201380:
/* 0A01D0 802E09D0 8F2F0008 */ lw $t7, 8($t9)
/* 0A01D4 802E09D4 03004025 */ move $t0, $t8
/* 0A01D8 802E09D8 51E00004 */ beql $t7, $zero, .L8020139C
/* 0A01DC 802E09DC 24090001 */ li $t1, 1
/* 0A01E0 802E09E0 10000002 */ b .L8020139C
/* 0A01E4 802E09E4 240A0001 */ li $t2, 1
/* 0A01E8 802E09E8 24090001 */ li $t1, 1
.L8020139C:
/* 0A01EC 802E09EC 1100003C */ beqz $t0, .L80201490
/* 0A01F0 802E09F0 8FB80138 */ lw $t8, 0x138($sp)
/* 0A01F4 802E09F4 00D31023 */ subu $v0, $a2, $s3
/* 0A01F8 802E09F8 24420010 */ addiu $v0, $v0, 0x10
/* 0A01FC 802E09FC 93190001 */ lbu $t9, 1($t8)
/* 0A0200 802E0A00 04410003 */ bgez $v0, .L802013C0
/* 0A0204 802E0A04 00027103 */ sra $t6, $v0, 4
/* 0A0208 802E0A08 2441000F */ addiu $at, $v0, 0xf
/* 0A020C 802E0A0C 00017103 */ sra $t6, $at, 4
.L802013C0:
/* 0A0210 802E0A10 24010081 */ li $at, 129
/* 0A0214 802E0A14 17210009 */ bne $t9, $at, .L802013EC
/* 0A0218 802E0A18 01C01025 */ move $v0, $t6
/* 0A021C 802E0A1C 01DF0019 */ multu $t6, $ra
/* 0A0220 802E0A20 8FAE00F4 */ lw $t6, 0xf4($sp)
/* 0A0224 802E0A24 000880C0 */ sll $s0, $t0, 3
/* 0A0228 802E0A28 02088021 */ addu $s0, $s0, $t0
/* 0A022C 802E0A2C 00007812 */ mflo $t7
/* 0A0230 802E0A30 01EE2821 */ addu $a1, $t7, $t6
/* 0A0234 802E0A34 10000019 */ b .L8020144C
/* 0A0238 802E0A38 30A8000F */ andi $t0, $a1, 0xf
.L802013EC:
/* 0A023C 802E0A3C 005F0019 */ multu $v0, $ra
/* 0A0240 802E0A40 8FB900F4 */ lw $t9, 0xf4($sp)
/* 0A0244 802E0A44 8FA6011C */ lw $a2, 0x11c($sp)
/* 0A0248 802E0A48 26E70001 */ addiu $a3, $s7, 1
/* 0A024C 802E0A4C AFA90124 */ sw $t1, 0x124($sp)
/* 0A0250 802E0A50 AFAA0120 */ sw $t2, 0x120($sp)
/* 0A0254 802E0A54 AFAB00E0 */ sw $t3, 0xe0($sp)
/* 0A0258 802E0A58 AFAC00EC */ sw $t4, 0xec($sp)
/* 0A025C 802E0A5C 0000C012 */ mflo $t8
/* 0A0260 802E0A60 03192021 */ addu $a0, $t8, $t9
/* 0A0264 802E0A64 00000000 */ nop
/* 0A0268 802E0A68 011F0019 */ multu $t0, $ra
/* 0A026C 802E0A6C 00008012 */ mflo $s0
/* 0A0270 802E0A70 02002825 */ move $a1, $s0
/* 0A0274 802E0A74 0C0B8D57 */ jal dma_sample_data
/* 0A0278 802E0A78 00000000 */ nop
/* 0A027C 802E0A7C 8FA90124 */ lw $t1, 0x124($sp)
/* 0A0280 802E0A80 8FAA0120 */ lw $t2, 0x120($sp)
/* 0A0284 802E0A84 8FAB00E0 */ lw $t3, 0xe0($sp)
/* 0A0288 802E0A88 8FAC00EC */ lw $t4, 0xec($sp)
/* 0A028C 802E0A8C 3C0D8000 */ lui $t5, 0x8000
/* 0A0290 802E0A90 241F0009 */ li $ra, 9
/* 0A0294 802E0A94 00402825 */ move $a1, $v0
/* 0A0298 802E0A98 30A8000F */ andi $t0, $a1, 0xf
.L8020144C:
/* 0A029C 802E0A9C 02401825 */ move $v1, $s2
/* 0A02A0 802E0AA0 3C0F0800 */ lui $t7, (0x080003F0 >> 16) # lui $t7, 0x800
/* 0A02A4 802E0AA4 35EF03F0 */ ori $t7, (0x080003F0 & 0xFFFF) # ori $t7, $t7, 0x3f0
/* 0A02A8 802E0AA8 02087021 */ addu $t6, $s0, $t0
/* 0A02AC 802E0AAC 31D8FFFF */ andi $t8, $t6, 0xffff
/* 0A02B0 802E0AB0 AC6F0000 */ sw $t7, ($v1)
/* 0A02B4 802E0AB4 26520008 */ addiu $s2, $s2, 8
/* 0A02B8 802E0AB8 AC780004 */ sw $t8, 4($v1)
/* 0A02BC 802E0ABC 02402025 */ move $a0, $s2
/* 0A02C0 802E0AC0 00A87823 */ subu $t7, $a1, $t0
/* 0A02C4 802E0AC4 01ED7021 */ addu $t6, $t7, $t5
/* 0A02C8 802E0AC8 3C190400 */ lui $t9, 0x400
/* 0A02CC 802E0ACC AC990000 */ sw $t9, ($a0)
/* 0A02D0 802E0AD0 AC8E0004 */ sw $t6, 4($a0)
/* 0A02D4 802E0AD4 92E60000 */ lbu $a2, ($s7)
/* 0A02D8 802E0AD8 10000004 */ b .L8020149C
/* 0A02DC 802E0ADC 26520008 */ addiu $s2, $s2, 8
.L80201490:
/* 0A02E0 802E0AE0 00008825 */ move $s1, $zero
/* 0A02E4 802E0AE4 00004025 */ move $t0, $zero
/* 0A02E8 802E0AE8 92E60000 */ lbu $a2, ($s7)
.L8020149C:
/* 0A02EC 802E0AEC 10C0000D */ beqz $a2, .L802014D4
/* 0A02F0 802E0AF0 02401025 */ move $v0, $s2
/* 0A02F4 802E0AF4 3C180F00 */ lui $t8, 0xf00
/* 0A02F8 802E0AF8 AC580000 */ sw $t8, ($v0)
/* 0A02FC 802E0AFC 8FB90138 */ lw $t9, 0x138($sp)
/* 0A0300 802E0B00 3C018000 */ lui $at, (0x80000010 >> 16) # lui $at, 0x8000
/* 0A0304 802E0B04 34210010 */ ori $at, (0x80000010 & 0xFFFF) # ori $at, $at, 0x10
/* 0A0308 802E0B08 8F2F0008 */ lw $t7, 8($t9)
/* 0A030C 802E0B0C 24180002 */ li $t8, 2
/* 0A0310 802E0B10 26520008 */ addiu $s2, $s2, 8
/* 0A0314 802E0B14 01E17021 */ addu $t6, $t7, $at
/* 0A0318 802E0B18 AC4E0004 */ sw $t6, 4($v0)
/* 0A031C 802E0B1C AFB8011C */ sw $t8, 0x11c($sp)
/* 0A0320 802E0B20 A2E00000 */ sb $zero, ($s7)
.L802014D4:
/* 0A0324 802E0B24 17C0001D */ bnez $fp, .L8020154C
/* 0A0328 802E0B28 02401825 */ move $v1, $s2
/* 0A032C 802E0B2C 251903F0 */ addiu $t9, $t0, 0x3f0
/* 0A0330 802E0B30 332FFFFF */ andi $t7, $t9, 0xffff
/* 0A0334 802E0B34 3C010800 */ lui $at, 0x800
/* 0A0338 802E0B38 01E17025 */ or $t6, $t7, $at
/* 0A033C 802E0B3C 00113040 */ sll $a2, $s1, 1
/* 0A0340 802E0B40 30D8FFFF */ andi $t8, $a2, 0xffff
/* 0A0344 802E0B44 3C010180 */ lui $at, 0x180
/* 0A0348 802E0B48 02401025 */ move $v0, $s2
/* 0A034C 802E0B4C 0301C825 */ or $t9, $t8, $at
/* 0A0350 802E0B50 AC590004 */ sw $t9, 4($v0)
/* 0A0354 802E0B54 AC4E0000 */ sw $t6, ($v0)
/* 0A0358 802E0B58 8FAF011C */ lw $t7, 0x11c($sp)
/* 0A035C 802E0B5C 26520008 */ addiu $s2, $s2, 8
/* 0A0360 802E0B60 3C010100 */ lui $at, 0x100
/* 0A0364 802E0B64 31EE00FF */ andi $t6, $t7, 0xff
/* 0A0368 802E0B68 000EC400 */ sll $t8, $t6, 0x10
/* 0A036C 802E0B6C 0301C825 */ or $t9, $t8, $at
/* 0A0370 802E0B70 02401825 */ move $v1, $s2
/* 0A0374 802E0B74 AC790000 */ sw $t9, ($v1)
/* 0A0378 802E0B78 8EEF000C */ lw $t7, 0xc($s7)
/* 0A037C 802E0B7C 0235C821 */ addu $t9, $s1, $s5
/* 0A0380 802E0B80 0013C040 */ sll $t8, $s3, 1
/* 0A0384 802E0B84 01ED7021 */ addu $t6, $t7, $t5
/* 0A0388 802E0B88 AC6E0004 */ sw $t6, 4($v1)
/* 0A038C 802E0B8C 26520008 */ addiu $s2, $s2, 8
/* 0A0390 802E0B90 AFB80104 */ sw $t8, 0x104($sp)
/* 0A0394 802E0B94 1000002F */ b .L80201604
/* 0A0398 802E0B98 03363823 */ subu $a3, $t9, $s6
.L8020154C:
/* 0A039C 802E0B9C 250F03F0 */ addiu $t7, $t0, 0x3f0
/* 0A03A0 802E0BA0 31EEFFFF */ andi $t6, $t7, 0xffff
/* 0A03A4 802E0BA4 3C010800 */ lui $at, 0x800
/* 0A03A8 802E0BA8 01C1C025 */ or $t8, $t6, $at
/* 0A03AC 802E0BAC 2401FFE0 */ li $at, -32
/* 0A03B0 802E0BB0 2682001F */ addiu $v0, $s4, 0x1f
/* 0A03B4 802E0BB4 0041C824 */ and $t9, $v0, $at
/* 0A03B8 802E0BB8 272E0180 */ addiu $t6, $t9, 0x180
/* 0A03BC 802E0BBC 03201025 */ move $v0, $t9
/* 0A03C0 802E0BC0 AC780000 */ sw $t8, ($v1)
/* 0A03C4 802E0BC4 00113040 */ sll $a2, $s1, 1
/* 0A03C8 802E0BC8 30D9FFFF */ andi $t9, $a2, 0xffff
/* 0A03CC 802E0BCC 000EC400 */ sll $t8, $t6, 0x10
/* 0A03D0 802E0BD0 03197825 */ or $t7, $t8, $t9
/* 0A03D4 802E0BD4 AC6F0004 */ sw $t7, 4($v1)
/* 0A03D8 802E0BD8 8FAE011C */ lw $t6, 0x11c($sp)
/* 0A03DC 802E0BDC 26520008 */ addiu $s2, $s2, 8
/* 0A03E0 802E0BE0 3C010100 */ lui $at, 0x100
/* 0A03E4 802E0BE4 31D800FF */ andi $t8, $t6, 0xff
/* 0A03E8 802E0BE8 0018CC00 */ sll $t9, $t8, 0x10
/* 0A03EC 802E0BEC 03217825 */ or $t7, $t9, $at
/* 0A03F0 802E0BF0 02402025 */ move $a0, $s2
/* 0A03F4 802E0BF4 AC8F0000 */ sw $t7, ($a0)
/* 0A03F8 802E0BF8 8EEE000C */ lw $t6, 0xc($s7)
/* 0A03FC 802E0BFC 0013C840 */ sll $t9, $s3, 1
/* 0A0400 802E0C00 00597821 */ addu $t7, $v0, $t9
/* 0A0404 802E0C04 01CDC021 */ addu $t8, $t6, $t5
/* 0A0408 802E0C08 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff
/* 0A040C 802E0C0C AC980004 */ sw $t8, 4($a0)
/* 0A0410 802E0C10 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff
/* 0A0414 802E0C14 25EE0180 */ addiu $t6, $t7, 0x180
/* 0A0418 802E0C18 01C1C024 */ and $t8, $t6, $at
/* 0A041C 802E0C1C 3C010A00 */ lui $at, 0xa00
/* 0A0420 802E0C20 26520008 */ addiu $s2, $s2, 8
/* 0A0424 802E0C24 0301C825 */ or $t9, $t8, $at
/* 0A0428 802E0C28 02357821 */ addu $t7, $s1, $s5
/* 0A042C 802E0C2C 01F63823 */ subu $a3, $t7, $s6
/* 0A0430 802E0C30 02402825 */ move $a1, $s2
/* 0A0434 802E0C34 ACB90000 */ sw $t9, ($a1)
/* 0A0438 802E0C38 00077840 */ sll $t7, $a3, 1
/* 0A043C 802E0C3C 26980180 */ addiu $t8, $s4, 0x180
/* 0A0440 802E0C40 0018CC00 */ sll $t9, $t8, 0x10
/* 0A0444 802E0C44 31EEFFFF */ andi $t6, $t7, 0xffff
/* 0A0448 802E0C48 032EC025 */ or $t8, $t9, $t6
/* 0A044C 802E0C4C ACB80004 */ sw $t8, 4($a1)
/* 0A0450 802E0C50 26520008 */ addiu $s2, $s2, 8
.L80201604:
/* 0A0454 802E0C54 8FAF011C */ lw $t7, 0x11c($sp)
/* 0A0458 802E0C58 24010001 */ li $at, 1
/* 0A045C 802E0C5C 03C7F021 */ addu $fp, $fp, $a3
/* 0A0460 802E0C60 11E10005 */ beq $t7, $at, .L80201628
/* 0A0464 802E0C64 39E20002 */ xori $v0, $t7, 2
/* 0A0468 802E0C68 10400007 */ beqz $v0, .L80201638
/* 0A046C 802E0C6C AFA0011C */ sw $zero, 0x11c($sp)
/* 0A0470 802E0C70 10000008 */ b .L80201644
/* 0A0474 802E0C74 00077040 */ sll $t6, $a3, 1
.L80201628:
/* 0A0478 802E0C78 AFA00104 */ sw $zero, 0x104($sp)
/* 0A047C 802E0C7C 00D4A021 */ addu $s4, $a2, $s4
/* 0A0480 802E0C80 1000000B */ b .L80201660
/* 0A0484 802E0C84 AFA0011C */ sw $zero, 0x11c($sp)
.L80201638:
/* 0A0488 802E0C88 0007C840 */ sll $t9, $a3, 1
/* 0A048C 802E0C8C 10000008 */ b .L80201660
/* 0A0490 802E0C90 0334A021 */ addu $s4, $t9, $s4
.L80201644:
/* 0A0494 802E0C94 52800004 */ beql $s4, $zero, .L80201658
/* 0A0498 802E0C98 0267A021 */ addu $s4, $s3, $a3
/* 0A049C 802E0C9C 10000004 */ b .L80201660
/* 0A04A0 802E0CA0 01D4A021 */ addu $s4, $t6, $s4
/* 0A04A4 802E0CA4 0267A021 */ addu $s4, $s3, $a3
.L80201658:
/* 0A04A8 802E0CA8 0014C040 */ sll $t8, $s4, 1
/* 0A04AC 802E0CAC 0300A025 */ move $s4, $t8
.L80201660:
/* 0A04B0 802E0CB0 11200019 */ beqz $t1, .L802016C8
/* 0A04B4 802E0CB4 24190001 */ li $t9, 1
/* 0A04B8 802E0CB8 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff
/* 0A04BC 802E0CBC 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff
/* 0A04C0 802E0CC0 268F0180 */ addiu $t7, $s4, 0x180
/* 0A04C4 802E0CC4 01E1C824 */ and $t9, $t7, $at
/* 0A04C8 802E0CC8 8FA3014C */ lw $v1, 0x14c($sp)
/* 0A04CC 802E0CCC 8FA60148 */ lw $a2, 0x148($sp)
/* 0A04D0 802E0CD0 3C010200 */ lui $at, 0x200
/* 0A04D4 802E0CD4 02401025 */ move $v0, $s2
/* 0A04D8 802E0CD8 019EC023 */ subu $t8, $t4, $fp
/* 0A04DC 802E0CDC 00187840 */ sll $t7, $t8, 1
/* 0A04E0 802E0CE0 03217025 */ or $t6, $t9, $at
/* 0A04E4 802E0CE4 AC4E0000 */ sw $t6, ($v0)
/* 0A04E8 802E0CE8 AC4F0004 */ sw $t7, 4($v0)
/* 0A04EC 802E0CEC 906E0000 */ lbu $t6, ($v1)
/* 0A04F0 802E0CF0 26520008 */ addiu $s2, $s2, 8
/* 0A04F4 802E0CF4 35D80020 */ ori $t8, $t6, 0x20
/* 0A04F8 802E0CF8 A0780000 */ sb $t8, ($v1)
/* 0A04FC 802E0CFC 90D900B0 */ lbu $t9, 0xb0($a2)
/* 0A0500 802E0D00 372E0020 */ ori $t6, $t9, 0x20
/* 0A0504 802E0D04 A0CE00B0 */ sb $t6, 0xb0($a2)
/* 0A0508 802E0D08 90D800B0 */ lbu $t8, 0xb0($a2)
/* 0A050C 802E0D0C 330FFF7F */ andi $t7, $t8, 0xff7f
/* 0A0510 802E0D10 1000000D */ b .L802016F8
/* 0A0514 802E0D14 A0CF00B0 */ sb $t7, 0xb0($a2)
.L802016C8:
/* 0A0518 802E0D18 51400007 */ beql $t2, $zero, .L802016E8
/* 0A051C 802E0D1C 8EEF0008 */ lw $t7, 8($s7)
/* 0A0520 802E0D20 A2F90000 */ sb $t9, ($s7)
/* 0A0524 802E0D24 8FAE0134 */ lw $t6, 0x134($sp)
/* 0A0528 802E0D28 8DD80000 */ lw $t8, ($t6)
/* 0A052C 802E0D2C 10000004 */ b .L802016F0
/* 0A0530 802E0D30 AEF80008 */ sw $t8, 8($s7)
/* 0A0534 802E0D34 8EEF0008 */ lw $t7, 8($s7)
.L802016E8:
/* 0A0538 802E0D38 01EBC821 */ addu $t9, $t7, $t3
/* 0A053C 802E0D3C AEF90008 */ sw $t9, 8($s7)
.L802016F0:
/* 0A0540 802E0D40 57CCFEFC */ bnel $fp, $t4, .L802012E4
/* 0A0544 802E0D44 8EE60008 */ lw $a2, 8($s7)
.L802016F8:
/* 0A0548 802E0D48 8FA400BC */ lw $a0, 0xbc($sp)
.L802016FC:
/* 0A054C 802E0D4C 24010001 */ li $at, 1
/* 0A0550 802E0D50 8FA3014C */ lw $v1, 0x14c($sp)
/* 0A0554 802E0D54 10810009 */ beq $a0, $at, .L8020172C
/* 0A0558 802E0D58 8FB80104 */ lw $t8, 0x104($sp)
/* 0A055C 802E0D5C 24010002 */ li $at, 2
/* 0A0560 802E0D60 1081000D */ beq $a0, $at, .L80201748
/* 0A0564 802E0D64 8FAE00B8 */ lw $t6, 0xb8($sp)
/* 0A0568 802E0D68 8C670000 */ lw $a3, ($v1)
/* 0A056C 802E0D6C 00072880 */ sll $a1, $a3, 2
/* 0A0570 802E0D70 000577C2 */ srl $t6, $a1, 0x1f
/* 0A0574 802E0D74 1000006A */ b .L802018D0
/* 0A0578 802E0D78 01C02825 */ move $a1, $t6
.L8020172C:
/* 0A057C 802E0D7C 270F0180 */ addiu $t7, $t8, 0x180
/* 0A0580 802E0D80 A7AF00AA */ sh $t7, 0xaa($sp)
/* 0A0584 802E0D84 8C670000 */ lw $a3, ($v1)
/* 0A0588 802E0D88 00072880 */ sll $a1, $a3, 2
/* 0A058C 802E0D8C 0005CFC2 */ srl $t9, $a1, 0x1f
/* 0A0590 802E0D90 10000063 */ b .L802018D0
/* 0A0594 802E0D94 03202825 */ move $a1, $t9
.L80201748:
/* 0A0598 802E0D98 11C00009 */ beqz $t6, .L80201770
/* 0A059C 802E0D9C 8FA6014C */ lw $a2, 0x14c($sp)
/* 0A05A0 802E0DA0 24010001 */ li $at, 1
/* 0A05A4 802E0DA4 11C10036 */ beq $t6, $at, .L80201830
/* 0A05A8 802E0DA8 02401025 */ move $v0, $s2
/* 0A05AC 802E0DAC 8C670000 */ lw $a3, ($v1)
/* 0A05B0 802E0DB0 00072880 */ sll $a1, $a3, 2
/* 0A05B4 802E0DB4 0005C7C2 */ srl $t8, $a1, 0x1f
/* 0A05B8 802E0DB8 10000059 */ b .L802018D0
/* 0A05BC 802E0DBC 03002825 */ move $a1, $t8
.L80201770:
/* 0A05C0 802E0DC0 8FAF0104 */ lw $t7, 0x104($sp)
/* 0A05C4 802E0DC4 3C010800 */ lui $at, 0x800
/* 0A05C8 802E0DC8 02401025 */ move $v0, $s2
/* 0A05CC 802E0DCC 25F90180 */ addiu $t9, $t7, 0x180
/* 0A05D0 802E0DD0 332EFFFF */ andi $t6, $t9, 0xffff
/* 0A05D4 802E0DD4 01C1C025 */ or $t8, $t6, $at
/* 0A05D8 802E0DD8 25840004 */ addiu $a0, $t4, 4
/* 0A05DC 802E0DDC 308FFFFF */ andi $t7, $a0, 0xffff
/* 0A05E0 802E0DE0 3C010020 */ lui $at, 0x20
/* 0A05E4 802E0DE4 01E1C825 */ or $t9, $t7, $at
/* 0A05E8 802E0DE8 26520008 */ addiu $s2, $s2, 8
/* 0A05EC 802E0DEC 3C0E0501 */ lui $t6, (0x0501FF60 >> 16) # lui $t6, 0x501
/* 0A05F0 802E0DF0 AC590004 */ sw $t9, 4($v0)
/* 0A05F4 802E0DF4 AC580000 */ sw $t8, ($v0)
/* 0A05F8 802E0DF8 35CEFF60 */ ori $t6, (0x0501FF60 & 0xFFFF) # ori $t6, $t6, 0xff60
/* 0A05FC 802E0DFC 02401825 */ move $v1, $s2
/* 0A0600 802E0E00 AC6E0000 */ sw $t6, ($v1)
/* 0A0604 802E0E04 8EF8000C */ lw $t8, 0xc($s7)
/* 0A0608 802E0E08 3C018000 */ lui $at, (0x800000F0 >> 16) # lui $at, 0x8000
/* 0A060C 802E0E0C 342100F0 */ ori $at, (0x800000F0 & 0xFFFF) # ori $at, $at, 0xf0
/* 0A0610 802E0E10 03017821 */ addu $t7, $t8, $at
/* 0A0614 802E0E14 AC6F0004 */ sw $t7, 4($v1)
/* 0A0618 802E0E18 24190024 */ li $t9, 36
/* 0A061C 802E0E1C AFA400AC */ sw $a0, 0xac($sp)
/* 0A0620 802E0E20 A7B900AA */ sh $t9, 0xaa($sp)
/* 0A0624 802E0E24 8CC70000 */ lw $a3, ($a2)
/* 0A0628 802E0E28 26520008 */ addiu $s2, $s2, 8
/* 0A062C 802E0E2C 02401025 */ move $v0, $s2
/* 0A0630 802E0E30 00072880 */ sll $a1, $a3, 2
/* 0A0634 802E0E34 000577C2 */ srl $t6, $a1, 0x1f
/* 0A0638 802E0E38 11C0000F */ beqz $t6, .L80201828
/* 0A063C 802E0E3C 01C02825 */ move $a1, $t6
/* 0A0640 802E0E40 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff
/* 0A0644 802E0E44 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff
/* 0A0648 802E0E48 24980020 */ addiu $t8, $a0, 0x20
/* 0A064C 802E0E4C 03017824 */ and $t7, $t8, $at
/* 0A0650 802E0E50 3C010200 */ lui $at, 0x200
/* 0A0654 802E0E54 01E1C825 */ or $t9, $t7, $at
/* 0A0658 802E0E58 258E0010 */ addiu $t6, $t4, 0x10
/* 0A065C 802E0E5C AC4E0004 */ sw $t6, 4($v0)
/* 0A0660 802E0E60 AC590000 */ sw $t9, ($v0)
/* 0A0664 802E0E64 8CC70000 */ lw $a3, ($a2)
/* 0A0668 802E0E68 26520008 */ addiu $s2, $s2, 8
/* 0A066C 802E0E6C 00072880 */ sll $a1, $a3, 2
/* 0A0670 802E0E70 0005C7C2 */ srl $t8, $a1, 0x1f
/* 0A0674 802E0E74 03002825 */ move $a1, $t8
.L80201828:
/* 0A0678 802E0E78 10000029 */ b .L802018D0
/* 0A067C 802E0E7C 8FA400BC */ lw $a0, 0xbc($sp)
.L80201830:
/* 0A0680 802E0E80 8FAF0104 */ lw $t7, 0x104($sp)
/* 0A0684 802E0E84 3C010800 */ lui $at, 0x800
/* 0A0688 802E0E88 26520008 */ addiu $s2, $s2, 8
/* 0A068C 802E0E8C 25F90180 */ addiu $t9, $t7, 0x180
/* 0A0690 802E0E90 332EFFFF */ andi $t6, $t9, 0xffff
/* 0A0694 802E0E94 01C1C025 */ or $t8, $t6, $at
/* 0A0698 802E0E98 258F0008 */ addiu $t7, $t4, 8
/* 0A069C 802E0E9C 31F9FFFF */ andi $t9, $t7, 0xffff
/* 0A06A0 802E0EA0 AC580000 */ sw $t8, ($v0)
/* 0A06A4 802E0EA4 3C010160 */ lui $at, 0x160
/* 0A06A8 802E0EA8 03217025 */ or $t6, $t9, $at
/* 0A06AC 802E0EAC 3C180501 */ lui $t8, (0x0501FF60 >> 16) # lui $t8, 0x501
/* 0A06B0 802E0EB0 AC4E0004 */ sw $t6, 4($v0)
/* 0A06B4 802E0EB4 3718FF60 */ ori $t8, (0x0501FF60 & 0xFFFF) # ori $t8, $t8, 0xff60
/* 0A06B8 802E0EB8 02401825 */ move $v1, $s2
/* 0A06BC 802E0EBC AC780000 */ sw $t8, ($v1)
/* 0A06C0 802E0EC0 8EEF000C */ lw $t7, 0xc($s7)
/* 0A06C4 802E0EC4 3C018000 */ lui $at, (0x800000F0 >> 16) # lui $at, 0x8000
/* 0A06C8 802E0EC8 342100F0 */ ori $at, (0x800000F0 & 0xFFFF) # ori $at, $at, 0xf0
/* 0A06CC 802E0ECC 26520008 */ addiu $s2, $s2, 8
/* 0A06D0 802E0ED0 3C0E0A00 */ lui $t6, (0x0A000164 >> 16) # lui $t6, 0xa00
/* 0A06D4 802E0ED4 01E1C821 */ addu $t9, $t7, $at
/* 0A06D8 802E0ED8 AC790004 */ sw $t9, 4($v1)
/* 0A06DC 802E0EDC 35CE0164 */ ori $t6, (0x0A000164 & 0xFFFF) # ori $t6, $t6, 0x164
/* 0A06E0 802E0EE0 02402025 */ move $a0, $s2
/* 0A06E4 802E0EE4 AC8E0000 */ sw $t6, ($a0)
/* 0A06E8 802E0EE8 8FB800AC */ lw $t8, 0xac($sp)
/* 0A06EC 802E0EEC 26520008 */ addiu $s2, $s2, 8
/* 0A06F0 802E0EF0 27190020 */ addiu $t9, $t8, 0x20
/* 0A06F4 802E0EF4 25980004 */ addiu $t8, $t4, 4
/* 0A06F8 802E0EF8 330FFFFF */ andi $t7, $t8, 0xffff
/* 0A06FC 802E0EFC 00197400 */ sll $t6, $t9, 0x10
/* 0A0700 802E0F00 01CFC825 */ or $t9, $t6, $t7
/* 0A0704 802E0F04 AC990004 */ sw $t9, 4($a0)
/* 0A0708 802E0F08 8FB8014C */ lw $t8, 0x14c($sp)
/* 0A070C 802E0F0C 8FA400BC */ lw $a0, 0xbc($sp)
/* 0A0710 802E0F10 8F070000 */ lw $a3, ($t8)
/* 0A0714 802E0F14 00072880 */ sll $a1, $a3, 2
/* 0A0718 802E0F18 000577C2 */ srl $t6, $a1, 0x1f
/* 0A071C 802E0F1C 01C02825 */ move $a1, $t6
.L802018D0:
/* 0A0720 802E0F20 10A00005 */ beqz $a1, .L802018E8
/* 0A0724 802E0F24 8FA200B8 */ lw $v0, 0xb8($sp)
/* 0A0728 802E0F28 AFB2015C */ sw $s2, 0x15c($sp)
/* 0A072C 802E0F2C 24130001 */ li $s3, 1
/* 0A0730 802E0F30 10000007 */ b .L80201900
/* 0A0734 802E0F34 8FB1014C */ lw $s1, 0x14c($sp)
.L802018E8:
/* 0A0738 802E0F38 24420001 */ addiu $v0, $v0, 1
/* 0A073C 802E0F3C 1444FE45 */ bne $v0, $a0, .L80201204
/* 0A0740 802E0F40 AFA200B8 */ sw $v0, 0xb8($sp)
/* 0A0744 802E0F44 AFB2015C */ sw $s2, 0x15c($sp)
/* 0A0748 802E0F48 24130001 */ li $s3, 1
/* 0A074C 802E0F4C 8FB1014C */ lw $s1, 0x14c($sp)
.L80201900:
/* 0A0750 802E0F50 00077840 */ sll $t7, $a3, 1
/* 0A0754 802E0F54 000FCFC2 */ srl $t9, $t7, 0x1f
/* 0A0758 802E0F58 8FB2015C */ lw $s2, 0x15c($sp)
/* 0A075C 802E0F5C 16790005 */ bne $s3, $t9, .L80201924
/* 0A0760 802E0F60 00001825 */ move $v1, $zero
/* 0A0764 802E0F64 92380000 */ lbu $t8, ($s1)
/* 0A0768 802E0F68 24030001 */ li $v1, 1
/* 0A076C 802E0F6C 330EFFBF */ andi $t6, $t8, 0xffbf
/* 0A0770 802E0F70 A22E0000 */ sb $t6, ($s1)
.L80201924:
/* 0A0774 802E0F74 8FB30158 */ lw $s3, 0x158($sp)
/* 0A0778 802E0F78 97B900AA */ lhu $t9, 0xaa($sp)
/* 0A077C 802E0F7C 02402025 */ move $a0, $s2
/* 0A0780 802E0F80 00133040 */ sll $a2, $s3, 1
/* 0A0784 802E0F84 00C09825 */ move $s3, $a2
/* 0A0788 802E0F88 02E02825 */ move $a1, $s7
/* 0A078C 802E0F8C 97A7011A */ lhu $a3, 0x11a($sp)
/* 0A0790 802E0F90 AFA30014 */ sw $v1, 0x14($sp)
/* 0A0794 802E0F94 AFA3011C */ sw $v1, 0x11c($sp)
/* 0A0798 802E0F98 0C0B8449 */ jal final_resample
/* 0A079C 802E0F9C AFB90010 */ sw $t9, 0x10($sp)
/* 0A07A0 802E0FA0 92380003 */ lbu $t8, 3($s1)
/* 0A07A4 802E0FA4 00409025 */ move $s2, $v0
/* 0A07A8 802E0FA8 8FB4011C */ lw $s4, 0x11c($sp)
/* 0A07AC 802E0FAC 17000004 */ bnez $t8, .L80201970
/* 0A07B0 802E0FB0 02402025 */ move $a0, $s2
/* 0A07B4 802E0FB4 92EE0002 */ lbu $t6, 2($s7)
/* 0A07B8 802E0FB8 51C00004 */ beql $t6, $zero, .L8020197C
/* 0A07BC 802E0FBC 922F0004 */ lbu $t7, 4($s1)
.L80201970:
/* 0A07C0 802E0FC0 1000000A */ b .L8020199C
/* 0A07C4 802E0FC4 24100001 */ li $s0, 1
/* 0A07C8 802E0FC8 922F0004 */ lbu $t7, 4($s1)
.L8020197C:
/* 0A07CC 802E0FCC 15E00005 */ bnez $t7, .L80201994
/* 0A07D0 802E0FD0 00000000 */ nop
/* 0A07D4 802E0FD4 92F90003 */ lbu $t9, 3($s7)
/* 0A07D8 802E0FD8 00008025 */ move $s0, $zero
/* 0A07DC 802E0FDC 13200003 */ beqz $t9, .L8020199C
/* 0A07E0 802E0FE0 00000000 */ nop
.L80201994:
/* 0A07E4 802E0FE4 10000001 */ b .L8020199C
/* 0A07E8 802E0FE8 24100002 */ li $s0, 2
.L8020199C:
/* 0A07EC 802E0FEC 02202825 */ move $a1, $s1
/* 0A07F0 802E0FF0 02E03025 */ move $a2, $s7
/* 0A07F4 802E0FF4 8FA70158 */ lw $a3, 0x158($sp)
/* 0A07F8 802E0FF8 AFA00010 */ sw $zero, 0x10($sp)
/* 0A07FC 802E0FFC AFB00014 */ sw $s0, 0x14($sp)
/* 0A0800 802E1000 0C0B8460 */ jal process_envelope
/* 0A0804 802E1004 AFB40018 */ sw $s4, 0x18($sp)
/* 0A0808 802E1008 92380000 */ lbu $t8, ($s1)
/* 0A080C 802E100C 00409025 */ move $s2, $v0
/* 0A0810 802E1010 00402025 */ move $a0, $v0
/* 0A0814 802E1014 330E0001 */ andi $t6, $t8, 1
/* 0A0818 802E1018 11C00007 */ beqz $t6, .L802019E8
/* 0A081C 802E101C 02202825 */ move $a1, $s1
/* 0A0820 802E1020 02E03025 */ move $a2, $s7
/* 0A0824 802E1024 02603825 */ move $a3, $s3
/* 0A0828 802E1028 AFB40010 */ sw $s4, 0x10($sp)
/* 0A082C 802E102C 0C0B85E6 */ jal note_apply_headset_pan_effects
/* 0A0830 802E1030 AFB00014 */ sw $s0, 0x14($sp)
/* 0A0834 802E1034 00409025 */ move $s2, $v0
.L802019E8:
/* 0A0838 802E1038 02401025 */ move $v0, $s2
.L802019EC:
/* 0A083C 802E103C 8FBF004C */ lw $ra, 0x4c($sp)
/* 0A0840 802E1040 8FB00028 */ lw $s0, 0x28($sp)
/* 0A0844 802E1044 8FB1002C */ lw $s1, 0x2c($sp)
/* 0A0848 802E1048 8FB20030 */ lw $s2, 0x30($sp)
/* 0A084C 802E104C 8FB30034 */ lw $s3, 0x34($sp)
/* 0A0850 802E1050 8FB40038 */ lw $s4, 0x38($sp)
/* 0A0854 802E1054 8FB5003C */ lw $s5, 0x3c($sp)
/* 0A0858 802E1058 8FB60040 */ lw $s6, 0x40($sp)
/* 0A085C 802E105C 8FB70044 */ lw $s7, 0x44($sp)
/* 0A0860 802E1060 8FBE0048 */ lw $fp, 0x48($sp)
/* 0A0864 802E1064 03E00008 */ jr $ra
/* 0A0868 802E1068 27BD0148 */ addiu $sp, $sp, 0x148

View file

@ -0,0 +1,220 @@
glabel synthesis_resample_and_mix_reverb
/* 09F580 802DFD80 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 09F584 802DFD84 AFB10020 */ sw $s1, 0x20($sp)
/* 09F588 802DFD88 00068C00 */ sll $s1, $a2, 0x10
/* 09F58C 802DFD8C 00117403 */ sra $t6, $s1, 0x10
/* 09F590 802DFD90 000EC940 */ sll $t9, $t6, 5
/* 09F594 802DFD94 032EC821 */ addu $t9, $t9, $t6
/* 09F598 802DFD98 3C0D8022 */ lui $t5, %hi(gSynthesisReverbs) # $t5, 0x8022
/* 09F59C 802DFD9C 25ADC1B0 */ addiu $t5, %lo(gSynthesisReverbs) # addiu $t5, $t5, -0x3e50
/* 09F5A0 802DFDA0 0019C8C0 */ sll $t9, $t9, 3
/* 09F5A4 802DFDA4 01C08825 */ move $s1, $t6
/* 09F5A8 802DFDA8 032D1821 */ addu $v1, $t9, $t5
/* 09F5AC 802DFDAC 906E0003 */ lbu $t6, 3($v1)
/* 09F5B0 802DFDB0 AFA7006C */ sw $a3, 0x6c($sp)
/* 09F5B4 802DFDB4 00077C00 */ sll $t7, $a3, 0x10
/* 09F5B8 802DFDB8 000F3C03 */ sra $a3, $t7, 0x10
/* 09F5BC 802DFDBC 000E7880 */ sll $t7, $t6, 2
/* 09F5C0 802DFDC0 01EE7823 */ subu $t7, $t7, $t6
/* 09F5C4 802DFDC4 000F78C0 */ sll $t7, $t7, 3
/* 09F5C8 802DFDC8 01EE7821 */ addu $t7, $t7, $t6
/* 09F5CC 802DFDCC AFBF0024 */ sw $ra, 0x24($sp)
/* 09F5D0 802DFDD0 AFB0001C */ sw $s0, 0x1c($sp)
/* 09F5D4 802DFDD4 AFA50064 */ sw $a1, 0x64($sp)
/* 09F5D8 802DFDD8 AFA60068 */ sw $a2, 0x68($sp)
/* 09F5DC 802DFDDC 3C0D0200 */ lui $t5, (0x02000740 >> 16) # lui $t5, 0x200
/* 09F5E0 802DFDE0 000F7880 */ sll $t7, $t7, 2
/* 09F5E4 802DFDE4 35AD0740 */ ori $t5, (0x02000740 & 0xFFFF) # ori $t5, $t5, 0x740
/* 09F5E8 802DFDE8 240E0280 */ li $t6, 640
/* 09F5EC 802DFDEC 006FC021 */ addu $t8, $v1, $t7
/* 09F5F0 802DFDF0 0007C880 */ sll $t9, $a3, 2
/* 09F5F4 802DFDF4 AC8E0004 */ sw $t6, 4($a0)
/* 09F5F8 802DFDF8 AC8D0000 */ sw $t5, ($a0)
/* 09F5FC 802DFDFC 906F0004 */ lbu $t7, 4($v1)
/* 09F600 802DFE00 0327C821 */ addu $t9, $t9, $a3
/* 09F604 802DFE04 0019C880 */ sll $t9, $t9, 2
/* 09F608 802DFE08 03194021 */ addu $t0, $t8, $t9
/* 09F60C 802DFE0C 24010001 */ li $at, 1
/* 09F610 802DFE10 25080030 */ addiu $t0, $t0, 0x30
/* 09F614 802DFE14 15E10033 */ bne $t7, $at, .L80200894
/* 09F618 802DFE18 24900008 */ addiu $s0, $a0, 8
/* 09F61C 802DFE1C 9506000E */ lhu $a2, 0xe($t0)
/* 09F620 802DFE20 85070010 */ lh $a3, 0x10($t0)
/* 09F624 802DFE24 AFA8005C */ sw $t0, 0x5c($sp)
/* 09F628 802DFE28 AFA30028 */ sw $v1, 0x28($sp)
/* 09F62C 802DFE2C AFB10010 */ sw $s1, 0x10($sp)
/* 09F630 802DFE30 02002025 */ move $a0, $s0
/* 09F634 802DFE34 0C0B7E39 */ jal synthesis_load_reverb_ring_buffer
/* 09F638 802DFE38 24050740 */ li $a1, 1856
/* 09F63C 802DFE3C 8FA8005C */ lw $t0, 0x5c($sp)
/* 09F640 802DFE40 00408025 */ move $s0, $v0
/* 09F644 802DFE44 8FA30028 */ lw $v1, 0x28($sp)
/* 09F648 802DFE48 85070012 */ lh $a3, 0x12($t0)
/* 09F64C 802DFE4C 02002025 */ move $a0, $s0
/* 09F650 802DFE50 00003025 */ move $a2, $zero
/* 09F654 802DFE54 50E0000A */ beql $a3, $zero, .L80200830
/* 09F658 802DFE58 3C0A0800 */ lui $t2, 0x800
/* 09F65C 802DFE5C 85050010 */ lh $a1, 0x10($t0)
/* 09F660 802DFE60 AFA30028 */ sw $v1, 0x28($sp)
/* 09F664 802DFE64 AFB10010 */ sw $s1, 0x10($sp)
/* 09F668 802DFE68 24A50740 */ addiu $a1, $a1, 0x740
/* 09F66C 802DFE6C 30B8FFFF */ andi $t8, $a1, 0xffff
/* 09F670 802DFE70 0C0B7E39 */ jal synthesis_load_reverb_ring_buffer
/* 09F674 802DFE74 03002825 */ move $a1, $t8
/* 09F678 802DFE78 8FA30028 */ lw $v1, 0x28($sp)
/* 09F67C 802DFE7C 3C0A0800 */ lui $t2, 0x800
.L80200830:
/* 09F680 802DFE80 24500008 */ addiu $s0, $v0, 8
/* 09F684 802DFE84 24190280 */ li $t9, 640
/* 09F688 802DFE88 AC590004 */ sw $t9, 4($v0)
/* 09F68C 802DFE8C AC4A0000 */ sw $t2, ($v0)
/* 09F690 802DFE90 02002825 */ move $a1, $s0
/* 09F694 802DFE94 3C0D0C00 */ lui $t5, (0x0C007FFF >> 16) # lui $t5, 0xc00
/* 09F698 802DFE98 3C0E0740 */ lui $t6, (0x074004C0 >> 16) # lui $t6, 0x740
/* 09F69C 802DFE9C 35CE04C0 */ ori $t6, (0x074004C0 & 0xFFFF) # ori $t6, $t6, 0x4c0
/* 09F6A0 802DFEA0 35AD7FFF */ ori $t5, (0x0C007FFF & 0xFFFF) # ori $t5, $t5, 0x7fff
/* 09F6A4 802DFEA4 ACAD0000 */ sw $t5, ($a1)
/* 09F6A8 802DFEA8 ACAE0004 */ sw $t6, 4($a1)
/* 09F6AC 802DFEAC 946F0008 */ lhu $t7, 8($v1)
/* 09F6B0 802DFEB0 34018000 */ li $at, 32768
/* 09F6B4 802DFEB4 26100008 */ addiu $s0, $s0, 8
/* 09F6B8 802DFEB8 01E1C021 */ addu $t8, $t7, $at
/* 09F6BC 802DFEBC 3319FFFF */ andi $t9, $t8, 0xffff
/* 09F6C0 802DFEC0 3C010C00 */ lui $at, 0xc00
/* 09F6C4 802DFEC4 02003025 */ move $a2, $s0
/* 09F6C8 802DFEC8 3C0E0740 */ lui $t6, (0x07400740 >> 16) # lui $t6, 0x740
/* 09F6CC 802DFECC 35CE0740 */ ori $t6, (0x07400740 & 0xFFFF) # ori $t6, $t6, 0x740
/* 09F6D0 802DFED0 03216825 */ or $t5, $t9, $at
/* 09F6D4 802DFED4 ACCD0000 */ sw $t5, ($a2)
/* 09F6D8 802DFED8 ACCE0004 */ sw $t6, 4($a2)
/* 09F6DC 802DFEDC 10000078 */ b .L80200A70
/* 09F6E0 802DFEE0 26100008 */ addiu $s0, $s0, 8
.L80200894:
/* 09F6E4 802DFEE4 8D02000C */ lw $v0, 0xc($t0)
/* 09F6E8 802DFEE8 850D0010 */ lh $t5, 0x10($t0)
/* 09F6EC 802DFEEC 2401FFF0 */ li $at, -16
/* 09F6F0 802DFEF0 304F0007 */ andi $t7, $v0, 7
/* 09F6F4 802DFEF4 000FC440 */ sll $t8, $t7, 0x11
/* 09F6F8 802DFEF8 0018CC03 */ sra $t9, $t8, 0x10
/* 09F6FC 802DFEFC 032D5021 */ addu $t2, $t9, $t5
/* 09F700 802DFF00 254A000F */ addiu $t2, $t2, 0xf
/* 09F704 802DFF04 03204825 */ move $t1, $t9
/* 09F708 802DFF08 314EFFF0 */ andi $t6, $t2, 0xfff0
/* 09F70C 802DFF0C 000E7C00 */ sll $t7, $t6, 0x10
/* 09F710 802DFF10 000FC403 */ sra $t8, $t7, 0x10
/* 09F714 802DFF14 03005025 */ move $t2, $t8
/* 09F718 802DFF18 A7AA0058 */ sh $t2, 0x58($sp)
/* 09F71C 802DFF1C A7A9005A */ sh $t1, 0x5a($sp)
/* 09F720 802DFF20 AFA8005C */ sw $t0, 0x5c($sp)
/* 09F724 802DFF24 AFA30028 */ sw $v1, 0x28($sp)
/* 09F728 802DFF28 AFB10010 */ sw $s1, 0x10($sp)
/* 09F72C 802DFF2C 02002025 */ move $a0, $s0
/* 09F730 802DFF30 24050020 */ li $a1, 32
/* 09F734 802DFF34 05210003 */ bgez $t1, .L802008F4
/* 09F738 802DFF38 0009C843 */ sra $t9, $t1, 1
/* 09F73C 802DFF3C 25210001 */ addiu $at, $t1, 1
/* 09F740 802DFF40 0001C843 */ sra $t9, $at, 1
.L802008F4:
/* 09F744 802DFF44 00593023 */ subu $a2, $v0, $t9
/* 09F748 802DFF48 30CDFFFF */ andi $t5, $a2, 0xffff
/* 09F74C 802DFF4C 01A03025 */ move $a2, $t5
/* 09F750 802DFF50 0C0B7E39 */ jal synthesis_load_reverb_ring_buffer
/* 09F754 802DFF54 24070140 */ li $a3, 320
/* 09F758 802DFF58 8FA8005C */ lw $t0, 0x5c($sp)
/* 09F75C 802DFF5C 00408025 */ move $s0, $v0
/* 09F760 802DFF60 8FA30028 */ lw $v1, 0x28($sp)
/* 09F764 802DFF64 850E0012 */ lh $t6, 0x12($t0)
/* 09F768 802DFF68 87A9005A */ lh $t1, 0x5a($sp)
/* 09F76C 802DFF6C 87AA0058 */ lh $t2, 0x58($sp)
/* 09F770 802DFF70 11C0000D */ beqz $t6, .L80200958
/* 09F774 802DFF74 02002025 */ move $a0, $s0
/* 09F778 802DFF78 25450020 */ addiu $a1, $t2, 0x20
/* 09F77C 802DFF7C 30AFFFFF */ andi $t7, $a1, 0xffff
/* 09F780 802DFF80 24180140 */ li $t8, 320
/* 09F784 802DFF84 030A3823 */ subu $a3, $t8, $t2
/* 09F788 802DFF88 01E02825 */ move $a1, $t7
/* 09F78C 802DFF8C 00003025 */ move $a2, $zero
/* 09F790 802DFF90 AFB10010 */ sw $s1, 0x10($sp)
/* 09F794 802DFF94 AFA30028 */ sw $v1, 0x28($sp)
/* 09F798 802DFF98 0C0B7E39 */ jal synthesis_load_reverb_ring_buffer
/* 09F79C 802DFF9C A7A9005A */ sh $t1, 0x5a($sp)
/* 09F7A0 802DFFA0 8FA30028 */ lw $v1, 0x28($sp)
/* 09F7A4 802DFFA4 87A9005A */ lh $t1, 0x5a($sp)
.L80200958:
/* 09F7A8 802DFFA8 25390020 */ addiu $t9, $t1, 0x20
/* 09F7AC 802DFFAC 3C0A0800 */ lui $t2, 0x800
/* 09F7B0 802DFFB0 332DFFFF */ andi $t5, $t9, 0xffff
/* 09F7B4 802DFFB4 01AA7025 */ or $t6, $t5, $t2
/* 09F7B8 802DFFB8 AC4E0000 */ sw $t6, ($v0)
/* 09F7BC 802DFFBC 8FA50064 */ lw $a1, 0x64($sp)
/* 09F7C0 802DFFC0 3C010740 */ lui $at, 0x740
/* 09F7C4 802DFFC4 3C0B0500 */ lui $t3, 0x500
/* 09F7C8 802DFFC8 00057840 */ sll $t7, $a1, 1
/* 09F7CC 802DFFCC 31E5FFFF */ andi $a1, $t7, 0xffff
/* 09F7D0 802DFFD0 00A1C825 */ or $t9, $a1, $at
/* 09F7D4 802DFFD4 AC590004 */ sw $t9, 4($v0)
/* 09F7D8 802DFFD8 90790000 */ lbu $t9, ($v1)
/* 09F7DC 802DFFDC 946E000A */ lhu $t6, 0xa($v1)
/* 09F7E0 802DFFE0 24500008 */ addiu $s0, $v0, 8
/* 09F7E4 802DFFE4 00196C00 */ sll $t5, $t9, 0x10
/* 09F7E8 802DFFE8 01CB7825 */ or $t7, $t6, $t3
/* 09F7EC 802DFFEC 01ED7025 */ or $t6, $t7, $t5
/* 09F7F0 802DFFF0 02003025 */ move $a2, $s0
/* 09F7F4 802DFFF4 ACCE0000 */ sw $t6, ($a2)
/* 09F7F8 802DFFF8 8C780020 */ lw $t8, 0x20($v1)
/* 09F7FC 802DFFFC 3C0C8000 */ lui $t4, 0x8000
/* 09F800 802E0000 26100008 */ addiu $s0, $s0, 8
/* 09F804 802E0004 252F0160 */ addiu $t7, $t1, 0x160
/* 09F808 802E0008 030CC821 */ addu $t9, $t8, $t4
/* 09F80C 802E000C ACD90004 */ sw $t9, 4($a2)
/* 09F810 802E0010 31EDFFFF */ andi $t5, $t7, 0xffff
/* 09F814 802E0014 02003825 */ move $a3, $s0
/* 09F818 802E0018 3C010880 */ lui $at, 0x880
/* 09F81C 802E001C 00A1C025 */ or $t8, $a1, $at
/* 09F820 802E0020 01AA7025 */ or $t6, $t5, $t2
/* 09F824 802E0024 ACEE0000 */ sw $t6, ($a3)
/* 09F828 802E0028 ACF80004 */ sw $t8, 4($a3)
/* 09F82C 802E002C 90780000 */ lbu $t8, ($v1)
/* 09F830 802E0030 946F000A */ lhu $t7, 0xa($v1)
/* 09F834 802E0034 26100008 */ addiu $s0, $s0, 8
/* 09F838 802E0038 0018CC00 */ sll $t9, $t8, 0x10
/* 09F83C 802E003C 01EB6825 */ or $t5, $t7, $t3
/* 09F840 802E0040 01B97825 */ or $t7, $t5, $t9
/* 09F844 802E0044 02004025 */ move $t0, $s0
/* 09F848 802E0048 AD0F0000 */ sw $t7, ($t0)
/* 09F84C 802E004C 8C6E0024 */ lw $t6, 0x24($v1)
/* 09F850 802E0050 26100008 */ addiu $s0, $s0, 8
/* 09F854 802E0054 02001025 */ move $v0, $s0
/* 09F858 802E0058 01CCC021 */ addu $t8, $t6, $t4
/* 09F85C 802E005C AD180004 */ sw $t8, 4($t0)
/* 09F860 802E0060 26100008 */ addiu $s0, $s0, 8
/* 09F864 802E0064 240D0280 */ li $t5, 640
/* 09F868 802E0068 AC4D0004 */ sw $t5, 4($v0)
/* 09F86C 802E006C AC4A0000 */ sw $t2, ($v0)
/* 09F870 802E0070 02002025 */ move $a0, $s0
/* 09F874 802E0074 3C0F0740 */ lui $t7, (0x074004C0 >> 16) # lui $t7, 0x740
/* 09F878 802E0078 3C190C00 */ lui $t9, (0x0C007FFF >> 16) # lui $t9, 0xc00
/* 09F87C 802E007C 37397FFF */ ori $t9, (0x0C007FFF & 0xFFFF) # ori $t9, $t9, 0x7fff
/* 09F880 802E0080 35EF04C0 */ ori $t7, (0x074004C0 & 0xFFFF) # ori $t7, $t7, 0x4c0
/* 09F884 802E0084 AC8F0004 */ sw $t7, 4($a0)
/* 09F888 802E0088 AC990000 */ sw $t9, ($a0)
/* 09F88C 802E008C 946E0008 */ lhu $t6, 8($v1)
/* 09F890 802E0090 34018000 */ li $at, 32768
/* 09F894 802E0094 26100008 */ addiu $s0, $s0, 8
/* 09F898 802E0098 01C1C021 */ addu $t8, $t6, $at
/* 09F89C 802E009C 02002825 */ move $a1, $s0
/* 09F8A0 802E00A0 330DFFFF */ andi $t5, $t8, 0xffff
/* 09F8A4 802E00A4 3C010C00 */ lui $at, 0xc00
/* 09F8A8 802E00A8 3C0F0740 */ lui $t7, (0x07400740 >> 16) # lui $t7, 0x740
/* 09F8AC 802E00AC 35EF0740 */ ori $t7, (0x07400740 & 0xFFFF) # ori $t7, $t7, 0x740
/* 09F8B0 802E00B0 01A1C825 */ or $t9, $t5, $at
/* 09F8B4 802E00B4 ACB90000 */ sw $t9, ($a1)
/* 09F8B8 802E00B8 ACAF0004 */ sw $t7, 4($a1)
/* 09F8BC 802E00BC 26100008 */ addiu $s0, $s0, 8
.L80200A70:
/* 09F8C0 802E00C0 8FBF0024 */ lw $ra, 0x24($sp)
/* 09F8C4 802E00C4 02001025 */ move $v0, $s0
/* 09F8C8 802E00C8 8FB0001C */ lw $s0, 0x1c($sp)
/* 09F8CC 802E00CC 8FB10020 */ lw $s1, 0x20($sp)
/* 09F8D0 802E00D0 03E00008 */ jr $ra
/* 09F8D4 802E00D4 27BD0060 */ addiu $sp, $sp, 0x60

View file

@ -0,0 +1,55 @@
glabel func_802aeeb0
/* 0AEEB0 80200000 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0AEEB4 80200004 AFBF0014 */ sw $ra, 0x14($sp)
/* 0AEEB8 80200008 0C0BD400 */ jal __osDisableInt
/* 0AEEBC 8020000C AFA40020 */ sw $a0, 0x20($sp)
/* 0AEEC0 80200010 3C0F8030 */ lui $t7, %hi(D_80334914) # $t7, 0x8030
/* 0AEEC4 80200014 8DEF2EE4 */ lw $t7, %lo(D_80334914)($t7)
/* 0AEEC8 80200018 8FAE0020 */ lw $t6, 0x20($sp)
/* 0AEECC 8020001C AFA2001C */ sw $v0, 0x1c($sp)
/* 0AEED0 80200020 3C188030 */ lui $t8, %hi(D_80334914) # $t8, 0x8030
/* 0AEED4 80200024 ADEE0004 */ sw $t6, 4($t7)
/* 0AEED8 80200028 8F182EE4 */ lw $t8, %lo(D_80334914)($t8)
/* 0AEEDC 8020002C 97190000 */ lhu $t9, ($t8)
/* 0AEEE0 80200030 37280010 */ ori $t0, $t9, 0x10
/* 0AEEE4 80200034 A7080000 */ sh $t0, ($t8)
/* 0AEEE8 80200038 0C0BD408 */ jal __osRestoreInt
/* 0AEEEC 8020003C 8FA4001C */ lw $a0, 0x1c($sp)
/* 0AEEF0 80200040 8FBF0014 */ lw $ra, 0x14($sp)
/* 0AEEF4 80200044 27BD0020 */ addiu $sp, $sp, 0x20
/* 0AEEF8 80200048 03E00008 */ jr $ra
/* 0AEEFC 8020004C 00000000 */ nop
glabel func_802aef00
/* 0AEF00 80200050 3C028030 */ lui $v0, %hi(D_8033489C)
/* 0AEF04 80200054 03E00008 */ jr $ra
/* 0AEF08 80200058 8C422EFC */ lw $v0, %lo(D_8033489C)($v0)
glabel func_802aef0c
/* 0AEF0C 8020005C 00000000 */ nop
/* 0AEF10 80200060 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 0AEF14 80200064 AFBF001C */ sw $ra, 0x1c($sp)
/* 0AEF18 80200068 AFA40028 */ sw $a0, 0x28($sp)
/* 0AEF1C 8020006C AFA5002C */ sw $a1, 0x2c($sp)
/* 0AEF20 80200070 AFA60030 */ sw $a2, 0x30($sp)
/* 0AEF24 80200074 0C0BD400 */ jal __osDisableInt
/* 0AEF28 80200078 AFB00018 */ sw $s0, 0x18($sp)
/* 0AEF2C 8020007C 8FAE0028 */ lw $t6, 0x28($sp)
/* 0AEF30 80200080 3C188033 */ lui $t8, %hi(D_80363830) # $t8, 0x8033
/* 0AEF34 80200084 8FA8002C */ lw $t0, 0x2c($sp)
/* 0AEF38 80200088 271836D0 */ addiu $t8, %lo(D_80363830) # addiu $t8, $t8, 0x36d0
/* 0AEF3C 8020008C 000E78C0 */ sll $t7, $t6, 3
/* 0AEF40 80200090 01F8C821 */ addu $t9, $t7, $t8
/* 0AEF44 80200094 AFB90020 */ sw $t9, 0x20($sp)
/* 0AEF48 80200098 AF280000 */ sw $t0, ($t9)
/* 0AEF4C 8020009C 8FAA0020 */ lw $t2, 0x20($sp)
/* 0AEF50 802000A0 8FA90030 */ lw $t1, 0x30($sp)
/* 0AEF54 802000A4 00408025 */ move $s0, $v0
/* 0AEF58 802000A8 02002025 */ move $a0, $s0
/* 0AEF5C 802000AC 0C0BD408 */ jal __osRestoreInt
/* 0AEF60 802000B0 AD490004 */ sw $t1, 4($t2)
/* 0AEF64 802000B4 8FBF001C */ lw $ra, 0x1c($sp)
/* 0AEF68 802000B8 8FB00018 */ lw $s0, 0x18($sp)
/* 0AEF6C 802000BC 27BD0028 */ addiu $sp, $sp, 0x28
/* 0AEF70 802000C0 03E00008 */ jr $ra

View file

@ -0,0 +1,87 @@
glabel func_802aef80
/* 0AEF80 80200000 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 0AEF84 80200004 AFBF001C */ sw $ra, 0x1c($sp)
/* 0AEF88 80200008 AFA40028 */ sw $a0, 0x28($sp)
/* 0AEF8C 8020000C AFA5002C */ sw $a1, 0x2c($sp)
/* 0AEF90 80200010 AFA60030 */ sw $a2, 0x30($sp)
/* 0AEF94 80200014 AFB10018 */ sw $s1, 0x18($sp)
/* 0AEF98 80200018 0C0BD400 */ jal __osDisableInt
/* 0AEF9C 8020001C AFB00014 */ sw $s0, 0x14($sp)
/* 0AEFA0 80200020 8FAE0028 */ lw $t6, 0x28($sp)
/* 0AEFA4 80200024 00408025 */ move $s0, $v0
/* 0AEFA8 80200028 8DCF0008 */ lw $t7, 8($t6)
/* 0AEFAC 8020002C 15E00012 */ bnez $t7, .L80200078
/* 0AEFB0 80200030 00000000 */ nop
.L80200034:
/* 0AEFB4 80200034 8FB80030 */ lw $t8, 0x30($sp)
/* 0AEFB8 80200038 17000005 */ bnez $t8, .L80200050
/* 0AEFBC 8020003C 00000000 */ nop
/* 0AEFC0 80200040 0C0BD408 */ jal __osRestoreInt
/* 0AEFC4 80200044 02002025 */ move $a0, $s0
/* 0AEFC8 80200048 10000036 */ b .L80200124
/* 0AEFCC 8020004C 2402FFFF */ li $v0, -1
.L80200050:
/* 0AEFD0 80200050 3C088030 */ lui $t0, %hi(D_803348A0) # $t0, 0x8030
/* 0AEFD4 80200054 8D082F00 */ lw $t0, %lo(D_803348A0)($t0)
/* 0AEFD8 80200058 24190008 */ li $t9, 8
/* 0AEFDC 8020005C A5190010 */ sh $t9, 0x10($t0)
/* 0AEFE0 80200060 0C0BCFC3 */ jal __osEnqueueAndYield
/* 0AEFE4 80200064 8FA40028 */ lw $a0, 0x28($sp)
/* 0AEFE8 80200068 8FA90028 */ lw $t1, 0x28($sp)
/* 0AEFEC 8020006C 8D2A0008 */ lw $t2, 8($t1)
/* 0AEFF0 80200070 1140FFF0 */ beqz $t2, .L80200034
/* 0AEFF4 80200074 00000000 */ nop
.L80200078:
/* 0AEFF8 80200078 8FAB002C */ lw $t3, 0x2c($sp)
/* 0AEFFC 8020007C 11600008 */ beqz $t3, .L802000A0
/* 0AF000 80200080 00000000 */ nop
/* 0AF004 80200084 8FAC0028 */ lw $t4, 0x28($sp)
/* 0AF008 80200088 8D8E000C */ lw $t6, 0xc($t4)
/* 0AF00C 8020008C 8D8D0014 */ lw $t5, 0x14($t4)
/* 0AF010 80200090 000E7880 */ sll $t7, $t6, 2
/* 0AF014 80200094 01AFC021 */ addu $t8, $t5, $t7
/* 0AF018 80200098 8F190000 */ lw $t9, ($t8)
/* 0AF01C 8020009C AD790000 */ sw $t9, ($t3)
.L802000A0:
/* 0AF020 802000A0 8FA80028 */ lw $t0, 0x28($sp)
/* 0AF024 802000A4 8D09000C */ lw $t1, 0xc($t0)
/* 0AF028 802000A8 8D0C0010 */ lw $t4, 0x10($t0)
/* 0AF02C 802000AC 252A0001 */ addiu $t2, $t1, 1
/* 0AF030 802000B0 014C001A */ div $zero, $t2, $t4
/* 0AF034 802000B4 00007010 */ mfhi $t6
/* 0AF038 802000B8 AD0E000C */ sw $t6, 0xc($t0)
/* 0AF03C 802000BC 8FAD0028 */ lw $t5, 0x28($sp)
/* 0AF040 802000C0 15800002 */ bnez $t4, .L802000CC
/* 0AF044 802000C4 00000000 */ nop
/* 0AF048 802000C8 0007000D */ break 7
.L802000CC:
/* 0AF04C 802000CC 2401FFFF */ li $at, -1
/* 0AF050 802000D0 15810004 */ bne $t4, $at, .L802000E4
/* 0AF054 802000D4 3C018000 */ lui $at, 0x8000
/* 0AF058 802000D8 15410002 */ bne $t2, $at, .L802000E4
/* 0AF05C 802000DC 00000000 */ nop
/* 0AF060 802000E0 0006000D */ break 6
.L802000E4:
/* 0AF064 802000E4 8DAF0008 */ lw $t7, 8($t5)
/* 0AF068 802000E8 25F8FFFF */ addiu $t8, $t7, -1
/* 0AF06C 802000EC ADB80008 */ sw $t8, 8($t5)
/* 0AF070 802000F0 8FB90028 */ lw $t9, 0x28($sp)
/* 0AF074 802000F4 8F2B0004 */ lw $t3, 4($t9)
/* 0AF078 802000F8 8D690000 */ lw $t1, ($t3)
/* 0AF07C 802000FC 11200006 */ beqz $t1, .L80200118
/* 0AF080 80200100 00000000 */ nop
/* 0AF084 80200104 0C0BD015 */ jal __osPopThread
/* 0AF088 80200108 27240004 */ addiu $a0, $t9, 4
/* 0AF08C 8020010C 00408825 */ move $s1, $v0
/* 0AF090 80200110 0C0BBEA0 */ jal osStartThread
/* 0AF094 80200114 02202025 */ move $a0, $s1
.L80200118:
/* 0AF098 80200118 0C0BD408 */ jal __osRestoreInt
/* 0AF09C 8020011C 02002025 */ move $a0, $s0
/* 0AF0A0 80200120 00001025 */ move $v0, $zero
.L80200124:
/* 0AF0A4 80200124 8FBF001C */ lw $ra, 0x1c($sp)
/* 0AF0A8 80200128 8FB00014 */ lw $s0, 0x14($sp)
/* 0AF0AC 8020012C 8FB10018 */ lw $s1, 0x18($sp)
/* 0AF0B0 80200130 03E00008 */ jr $ra
/* 0AF0B4 80200134 27BD0028 */ addiu $sp, $sp, 0x28

View file

@ -0,0 +1,86 @@
glabel play_sequence
/* 0AB0E8 80200000 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 0AB0EC 80200004 AFA50034 */ sw $a1, 0x34($sp)
/* 0AB0F0 80200008 308700FF */ andi $a3, $a0, 0xff
/* 0AB0F4 8020000C 30AE00FF */ andi $t6, $a1, 0xff
/* 0AB0F8 80200010 01C02825 */ move $a1, $t6
/* 0AB0FC 80200014 AFBF0014 */ sw $ra, 0x14($sp)
/* 0AB100 80200018 AFA40030 */ sw $a0, 0x30($sp)
/* 0AB104 8020001C AFA60038 */ sw $a2, 0x38($sp)
/* 0AB108 80200020 14E0000C */ bnez $a3, .L480200054
/* 0AB10C 80200024 00E04025 */ move $t0, $a3
/* 0AB110 80200028 31CF007F */ andi $t7, $t6, 0x7f
/* 0AB114 8020002C 3C018030 */ lui $at, %hi(sPlayer0CurSeqId) # $at, 0x8030
/* 0AB118 80200030 A02F04CC */ sb $t7, %lo(sPlayer0CurSeqId)($at)
/* 0AB11C 80200034 240200FF */ li $v0, 255
/* 0AB120 80200038 3C018030 */ lui $at, %hi(sBackgroundMusicForDynamics) # $at, 0x8030
/* 0AB124 8020003C A02202E0 */ sb $v0, %lo(sBackgroundMusicForDynamics)($at)
/* 0AB128 80200040 3C018030 */ lui $at, %hi(sCurrentMusicDynamic) # $at, 0x8030
/* 0AB12C 80200044 A02202DC */ sb $v0, %lo(sCurrentMusicDynamic)($at)
/* 0AB130 80200048 3C018030 */ lui $at, %hi(sMusicDynamicDelay) # $at, 0x8030
/* 0AB134 8020004C 24180002 */ li $t8, 2
/* 0AB138 80200050 A03804D0 */ sb $t8, %lo(sMusicDynamicDelay)($at)
.L480200054:
/* 0AB13C 80200054 3C0A8033 */ lui $t2, %hi(D_80360928) # $t2, 0x8033
/* 0AB140 80200058 254AFF40 */ addiu $t2, %lo(D_80360928) # addiu $t2, $t2, -0xc0
/* 0AB144 8020005C 0007CA00 */ sll $t9, $a3, 8
/* 0AB148 80200060 032A1821 */ addu $v1, $t9, $t2
/* 0AB14C 80200064 00001025 */ move $v0, $zero
/* 0AB150 80200068 00A03025 */ move $a2, $a1
/* 0AB154 8020006C 30A9007F */ andi $t1, $a1, 0x7f
.L480200070:
/* 0AB158 80200070 00025900 */ sll $t3, $v0, 4
/* 0AB15C 80200074 24420001 */ addiu $v0, $v0, 1
/* 0AB160 80200078 304D00FF */ andi $t5, $v0, 0xff
/* 0AB164 8020007C 29A10010 */ slti $at, $t5, 0x10
/* 0AB168 80200080 006B6021 */ addu $t4, $v1, $t3
/* 0AB16C 80200084 01A01025 */ move $v0, $t5
/* 0AB170 80200088 1420FFF9 */ bnez $at, .L480200070
/* 0AB174 8020008C A580000C */ sh $zero, 0xc($t4)
/* 0AB178 80200090 30E200FF */ andi $v0, $a3, 0xff
/* 0AB17C 80200094 00027400 */ sll $t6, $v0, 0x10
/* 0AB180 80200098 30C50080 */ andi $a1, $a2, 0x80
/* 0AB184 8020009C 00057E00 */ sll $t7, $a1, 0x18
/* 0AB188 802000A0 3C014600 */ lui $at, 0x4600
/* 0AB18C 802000A4 01C12025 */ or $a0, $t6, $at
/* 0AB190 802000A8 000F2E03 */ sra $a1, $t7, 0x18
/* 0AB194 802000AC 01C01025 */ move $v0, $t6
/* 0AB198 802000B0 AFAE001C */ sw $t6, 0x1c($sp)
/* 0AB19C 802000B4 AFA80028 */ sw $t0, 0x28($sp)
/* 0AB1A0 802000B8 0C0BB7DC */ jal func_802ad770
/* 0AB1A4 802000BC AFA90020 */ sw $t1, 0x20($sp)
/* 0AB1A8 802000C0 8FA90020 */ lw $t1, 0x20($sp)
/* 0AB1AC 802000C4 8FA2001C */ lw $v0, 0x1c($sp)
/* 0AB1B0 802000C8 3C018200 */ lui $at, 0x8200
/* 0AB1B4 802000CC 312A00FF */ andi $t2, $t1, 0xff
/* 0AB1B8 802000D0 000A5A00 */ sll $t3, $t2, 8
/* 0AB1BC 802000D4 0041C825 */ or $t9, $v0, $at
/* 0AB1C0 802000D8 032B2025 */ or $a0, $t9, $t3
/* 0AB1C4 802000DC 0C0BB7D3 */ jal func_802ad74c
/* 0AB1C8 802000E0 97A5003A */ lhu $a1, 0x3a($sp)
/* 0AB1CC 802000E4 8FA80028 */ lw $t0, 0x28($sp)
/* 0AB1D0 802000E8 55000013 */ bnezl $t0, .L480200138
/* 0AB1D4 802000EC 8FBF0014 */ lw $ra, 0x14($sp)
/* 0AB1D8 802000F0 0C0BB0F2 */ jal func_803200E4
/* 0AB1DC 802000F4 00002025 */ move $a0, $zero
/* 0AB1E0 802000F8 240100FF */ li $at, 255
/* 0AB1E4 802000FC 5041000E */ beql $v0, $at, .L480200138
/* 0AB1E8 80200100 8FBF0014 */ lw $ra, 0x14($sp)
/* 0AB1EC 80200104 44822000 */ mtc1 $v0, $f4
/* 0AB1F0 80200108 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0AB1F4 8020010C 04410004 */ bgez $v0, .L480200120
/* 0AB1F8 80200110 468021A0 */ cvt.s.w $f6, $f4
/* 0AB1FC 80200114 44814000 */ mtc1 $at, $f8
/* 0AB200 80200118 00000000 */ nop
/* 0AB204 8020011C 46083180 */ add.s $f6, $f6, $f8
.L480200120:
/* 0AB208 80200120 3C0142FE */ li $at, 0x42FE0000 # 127.000000
/* 0AB20C 80200124 44815000 */ mtc1 $at, $f10
/* 0AB210 80200128 3C018022 */ lui $at, %hi(gSequencePlayers + 0x28) # $at, 0x8022
/* 0AB214 8020012C 460A3403 */ div.s $f16, $f6, $f10
/* 0AB218 80200130 E4303D90 */ swc1 $f16, %lo(gSequencePlayers + 0x28)($at)
/* 0AB21C 80200134 8FBF0014 */ lw $ra, 0x14($sp)
.L480200138:
/* 0AB220 80200138 27BD0030 */ addiu $sp, $sp, 0x30
/* 0AB224 8020013C 03E00008 */ jr $ra
/* 0AB228 80200140 00000000 */ nop

View file

@ -0,0 +1,36 @@
glabel player_performed_grab_escape_action
/* 0D8190 80200000 3C028030 */ lui $v0, %hi(gPlayer1Controller) # $v0, 0x8030
/* 0D8194 80200004 8C429794 */ lw $v0, %lo(gPlayer1Controller)($v0)
/* 0D8198 80200008 3C0141F0 */ li $at, 0x41F00000 # 30.000000
/* 0D819C 8020000C 44812000 */ mtc1 $at, $f4
/* 0D81A0 80200010 C440000C */ lwc1 $f0, 0xc($v0)
/* 0D81A4 80200014 00001825 */ move $v1, $zero
/* 0D81A8 80200018 3C018039 */ lui $at, %hi(sGrabReleaseState) # $at, 0x8039
/* 0D81AC 8020001C 4604003C */ c.lt.s $f0, $f4
/* 0D81B0 80200020 3C0E8039 */ lui $t6, %hi(sGrabReleaseState) # $t6, 0x8039
/* 0D81B4 80200024 45000002 */ bc1f .L81_80200030
/* 0D81B8 80200028 00000000 */ nop
/* 0D81BC 8020002C AC209C70 */ sw $zero, %lo(sGrabReleaseState)($at)
.L81_80200030:
/* 0D81C0 80200030 8DCE9C70 */ lw $t6, %lo(sGrabReleaseState)($t6)
/* 0D81C4 80200034 3C014220 */ li $at, 0x42200000 # 40.000000
/* 0D81C8 80200038 55C0000B */ bnezl $t6, .L81_80200068
/* 0D81CC 8020003C 94580012 */ lhu $t8, 0x12($v0)
/* 0D81D0 80200040 44813000 */ mtc1 $at, $f6
/* 0D81D4 80200044 3C018039 */ lui $at, %hi(sGrabReleaseState) # $at, 0x8039
/* 0D81D8 80200048 240F0001 */ li $t7, 1
/* 0D81DC 8020004C 4600303C */ c.lt.s $f6, $f0
/* 0D81E0 80200050 00000000 */ nop
/* 0D81E4 80200054 45020004 */ bc1fl .L81_80200068
/* 0D81E8 80200058 94580012 */ lhu $t8, 0x12($v0)
/* 0D81EC 8020005C AC2F9C70 */ sw $t7, %lo(sGrabReleaseState)($at)
/* 0D81F0 80200060 24030001 */ li $v1, 1
/* 0D81F4 80200064 94580012 */ lhu $t8, 0x12($v0)
.L81_80200068:
/* 0D81F8 80200068 33198000 */ andi $t9, $t8, 0x8000
/* 0D81FC 8020006C 13200002 */ beqz $t9, .L81_80200078
/* 0D8200 80200070 00000000 */ nop
/* 0D8204 80200074 24030001 */ li $v1, 1
.L81_80200078:
/* 0D8208 80200078 03E00008 */ jr $ra
/* 0D820C 8020007C 00601025 */ move $v0, $v1

View file

@ -1,156 +0,0 @@
glabel patch_audio_bank
/* 0D284C 8031784C 27ADFFF0 */ addiu $t5, $sp, -0x10
/* 0D2850 80317850 ADA60018 */ sw $a2, 0x18($t5)
/* 0D2854 80317854 8C820000 */ lw $v0, ($a0)
/* 0D2858 80317858 01A0E825 */ move $sp, $t5
/* 0D285C 8031785C 50400030 */ beql $v0, $zero, .L80317920
/* 0D2860 80317860 8DB80018 */ lw $t8, 0x18($t5)
/* 0D2864 80317864 10E0002D */ beqz $a3, .L8031791C
/* 0D2868 80317868 00447021 */ addu $t6, $v0, $a0
/* 0D286C 8031786C 10E0002B */ beqz $a3, .L8031791C
/* 0D2870 80317870 AC8E0000 */ sw $t6, ($a0)
/* 0D2874 80317874 10E00029 */ beqz $a3, .L8031791C
/* 0D2878 80317878 00001825 */ move $v1, $zero
/* 0D287C 8031787C 00004025 */ move $t0, $zero
/* 0D2880 80317880 24020001 */ li $v0, 1
.L80317884:
/* 0D2884 80317884 8C8F0000 */ lw $t7, ($a0)
/* 0D2888 80317888 24630001 */ addiu $v1, $v1, 1
/* 0D288C 8031788C 01E84821 */ addu $t1, $t7, $t0
/* 0D2890 80317890 8D260000 */ lw $a2, ($t1)
/* 0D2894 80317894 10C0001F */ beqz $a2, .L80317914
/* 0D2898 80317898 00C43021 */ addu $a2, $a2, $a0
/* 0D289C 8031789C AD260000 */ sw $a2, ($t1)
/* 0D28A0 803178A0 90D80002 */ lbu $t8, 2($a2)
/* 0D28A4 803178A4 00C05025 */ move $t2, $a2
/* 0D28A8 803178A8 1700001A */ bnez $t8, .L80317914
/* 0D28AC 803178AC 00000000 */ nop
/* 0D28B0 803178B0 8CD90004 */ lw $t9, 4($a2)
/* 0D28B4 803178B4 24C90004 */ addiu $t1, $a2, 4
/* 0D28B8 803178B8 53200013 */ beql $t9, $zero, .L80317908
/* 0D28BC 803178BC 8CC6000C */ lw $a2, 0xc($a2)
/* 0D28C0 803178C0 8D2E0000 */ lw $t6, ($t1)
/* 0D28C4 803178C4 01C45821 */ addu $t3, $t6, $a0
/* 0D28C8 803178C8 AD2B0000 */ sw $t3, ($t1)
/* 0D28CC 803178CC 916F0001 */ lbu $t7, 1($t3)
/* 0D28D0 803178D0 01606025 */ move $t4, $t3
/* 0D28D4 803178D4 55E0000C */ bnezl $t7, .L80317908
/* 0D28D8 803178D8 8CC6000C */ lw $a2, 0xc($a2)
/* 0D28DC 803178DC 8D780004 */ lw $t8, 4($t3)
/* 0D28E0 803178E0 8D990008 */ lw $t9, 8($t4)
/* 0D28E4 803178E4 8D8E000C */ lw $t6, 0xc($t4)
/* 0D28E8 803178E8 03055821 */ addu $t3, $t8, $a1
/* 0D28EC 803178EC AD8B0004 */ sw $t3, 4($t4)
/* 0D28F0 803178F0 03245821 */ addu $t3, $t9, $a0
/* 0D28F4 803178F4 AD8B0008 */ sw $t3, 8($t4)
/* 0D28F8 803178F8 01C45821 */ addu $t3, $t6, $a0
/* 0D28FC 803178FC AD8B000C */ sw $t3, 0xc($t4)
/* 0D2900 80317900 A1820001 */ sb $v0, 1($t4)
/* 0D2904 80317904 8CC6000C */ lw $a2, 0xc($a2)
.L80317908:
/* 0D2908 80317908 A1420002 */ sb $v0, 2($t2)
/* 0D290C 8031790C 00867821 */ addu $t7, $a0, $a2
/* 0D2910 80317910 AD4F000C */ sw $t7, 0xc($t2)
.L80317914:
/* 0D2914 80317914 1467FFDB */ bne $v1, $a3, .L80317884
/* 0D2918 80317918 25080004 */ addiu $t0, $t0, 4
.L8031791C:
/* 0D291C 8031791C 8DB80018 */ lw $t8, 0x18($t5)
.L80317920:
/* 0D2920 80317920 24020001 */ li $v0, 1
/* 0D2924 80317924 2F190001 */ sltiu $t9, $t8, 1
/* 0D2928 80317928 3B390001 */ xori $t9, $t9, 1
/* 0D292C 8031792C 13200054 */ beqz $t9, .L80317A80
/* 0D2930 80317930 00000000 */ nop
/* 0D2934 80317934 13200052 */ beqz $t9, .L80317A80
/* 0D2938 80317938 24830004 */ addiu $v1, $a0, 4
/* 0D293C 8031793C 00187080 */ sll $t6, $t8, 2
/* 0D2940 80317940 01C45021 */ addu $t2, $t6, $a0
/* 0D2944 80317944 254A0004 */ addiu $t2, $t2, 4
/* 0D2948 80317948 8C660000 */ lw $a2, ($v1)
.L8031794C:
/* 0D294C 8031794C 10C00049 */ beqz $a2, .L80317A74
/* 0D2950 80317950 00C47821 */ addu $t7, $a2, $a0
/* 0D2954 80317954 AC6F0000 */ sw $t7, ($v1)
/* 0D2958 80317958 91F90000 */ lbu $t9, ($t7)
/* 0D295C 8031795C 01E03825 */ move $a3, $t7
/* 0D2960 80317960 57200045 */ bnezl $t9, .L80317A78
/* 0D2964 80317964 24630004 */ addiu $v1, $v1, 4
/* 0D2968 80317968 8DF80008 */ lw $t8, 8($t7)
/* 0D296C 8031796C 25E60008 */ addiu $a2, $t7, 8
/* 0D2970 80317970 53000013 */ beql $t8, $zero, .L803179C0
/* 0D2974 80317974 8CEF0010 */ lw $t7, 0x10($a3)
/* 0D2978 80317978 8CCE0000 */ lw $t6, ($a2)
/* 0D297C 8031797C 01C44021 */ addu $t0, $t6, $a0
/* 0D2980 80317980 ACC80000 */ sw $t0, ($a2)
/* 0D2984 80317984 910F0001 */ lbu $t7, 1($t0)
/* 0D2988 80317988 01004825 */ move $t1, $t0
/* 0D298C 8031798C 55E0000C */ bnezl $t7, .L803179C0
/* 0D2990 80317990 8CEF0010 */ lw $t7, 0x10($a3)
/* 0D2994 80317994 8D190004 */ lw $t9, 4($t0)
/* 0D2998 80317998 8D380008 */ lw $t8, 8($t1)
/* 0D299C 8031799C 8D2E000C */ lw $t6, 0xc($t1)
/* 0D29A0 803179A0 03254021 */ addu $t0, $t9, $a1
/* 0D29A4 803179A4 AD280004 */ sw $t0, 4($t1)
/* 0D29A8 803179A8 03044021 */ addu $t0, $t8, $a0
/* 0D29AC 803179AC AD280008 */ sw $t0, 8($t1)
/* 0D29B0 803179B0 01C44021 */ addu $t0, $t6, $a0
/* 0D29B4 803179B4 AD28000C */ sw $t0, 0xc($t1)
/* 0D29B8 803179B8 A1220001 */ sb $v0, 1($t1)
/* 0D29BC 803179BC 8CEF0010 */ lw $t7, 0x10($a3)
.L803179C0:
/* 0D29C0 803179C0 24E60010 */ addiu $a2, $a3, 0x10
/* 0D29C4 803179C4 51E00013 */ beql $t7, $zero, .L80317A14
/* 0D29C8 803179C8 8CF80018 */ lw $t8, 0x18($a3)
/* 0D29CC 803179CC 8CD90000 */ lw $t9, ($a2)
/* 0D29D0 803179D0 03244021 */ addu $t0, $t9, $a0
/* 0D29D4 803179D4 ACC80000 */ sw $t0, ($a2)
/* 0D29D8 803179D8 91180001 */ lbu $t8, 1($t0)
/* 0D29DC 803179DC 01004825 */ move $t1, $t0
/* 0D29E0 803179E0 5700000C */ bnezl $t8, .L80317A14
/* 0D29E4 803179E4 8CF80018 */ lw $t8, 0x18($a3)
/* 0D29E8 803179E8 8D0E0004 */ lw $t6, 4($t0)
/* 0D29EC 803179EC 8D2F0008 */ lw $t7, 8($t1)
/* 0D29F0 803179F0 8D39000C */ lw $t9, 0xc($t1)
/* 0D29F4 803179F4 01C54021 */ addu $t0, $t6, $a1
/* 0D29F8 803179F8 AD280004 */ sw $t0, 4($t1)
/* 0D29FC 803179FC 01E44021 */ addu $t0, $t7, $a0
/* 0D2A00 80317A00 AD280008 */ sw $t0, 8($t1)
/* 0D2A04 80317A04 03244021 */ addu $t0, $t9, $a0
/* 0D2A08 80317A08 AD28000C */ sw $t0, 0xc($t1)
/* 0D2A0C 80317A0C A1220001 */ sb $v0, 1($t1)
/* 0D2A10 80317A10 8CF80018 */ lw $t8, 0x18($a3)
.L80317A14:
/* 0D2A14 80317A14 24E60018 */ addiu $a2, $a3, 0x18
/* 0D2A18 80317A18 53000013 */ beql $t8, $zero, .L80317A68
/* 0D2A1C 80317A1C 8CE60004 */ lw $a2, 4($a3)
/* 0D2A20 80317A20 8CCE0000 */ lw $t6, ($a2)
/* 0D2A24 80317A24 01C44021 */ addu $t0, $t6, $a0
/* 0D2A28 80317A28 ACC80000 */ sw $t0, ($a2)
/* 0D2A2C 80317A2C 910F0001 */ lbu $t7, 1($t0)
/* 0D2A30 80317A30 01004825 */ move $t1, $t0
/* 0D2A34 80317A34 55E0000C */ bnezl $t7, .L80317A68
/* 0D2A38 80317A38 8CE60004 */ lw $a2, 4($a3)
/* 0D2A3C 80317A3C 8D190004 */ lw $t9, 4($t0)
/* 0D2A40 80317A40 8D380008 */ lw $t8, 8($t1)
/* 0D2A44 80317A44 8D2E000C */ lw $t6, 0xc($t1)
/* 0D2A48 80317A48 03254021 */ addu $t0, $t9, $a1
/* 0D2A4C 80317A4C AD280004 */ sw $t0, 4($t1)
/* 0D2A50 80317A50 03044021 */ addu $t0, $t8, $a0
/* 0D2A54 80317A54 AD280008 */ sw $t0, 8($t1)
/* 0D2A58 80317A58 01C44021 */ addu $t0, $t6, $a0
/* 0D2A5C 80317A5C AD28000C */ sw $t0, 0xc($t1)
/* 0D2A60 80317A60 A1220001 */ sb $v0, 1($t1)
/* 0D2A64 80317A64 8CE60004 */ lw $a2, 4($a3)
.L80317A68:
/* 0D2A68 80317A68 A0E20000 */ sb $v0, ($a3)
/* 0D2A6C 80317A6C 00867821 */ addu $t7, $a0, $a2
/* 0D2A70 80317A70 ACEF0004 */ sw $t7, 4($a3)
.L80317A74:
/* 0D2A74 80317A74 24630004 */ addiu $v1, $v1, 4
.L80317A78:
/* 0D2A78 80317A78 5543FFB4 */ bnel $t2, $v1, .L8031794C
/* 0D2A7C 80317A7C 8C660000 */ lw $a2, ($v1)
.L80317A80:
/* 0D2A80 80317A80 03E00008 */ jr $ra
/* 0D2A84 80317A84 25BD0010 */ addiu $sp, $t5, 0x10

View file

@ -2842,7 +2842,7 @@ const BehaviorScript bhvInitializeChangingWaterLevel[] = {
END_LOOP(), END_LOOP(),
}; };
const BehaviorScript bhvTornadoSandParticle[] = { const BehaviorScript bhvTweesterSandParticle[] = {
BEGIN(OBJ_LIST_UNIMPORTANT), BEGIN(OBJ_LIST_UNIMPORTANT),
OR_INT(oFlags, (OBJ_FLAG_MOVE_XZ_USING_FVEL | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)), OR_INT(oFlags, (OBJ_FLAG_MOVE_XZ_USING_FVEL | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
BILLBOARD(), BILLBOARD(),
@ -2851,7 +2851,7 @@ const BehaviorScript bhvTornadoSandParticle[] = {
END_LOOP(), END_LOOP(),
}; };
const BehaviorScript bhvTornado[] = { const BehaviorScript bhvTweester[] = {
BEGIN(OBJ_LIST_POLELIKE), BEGIN(OBJ_LIST_POLELIKE),
OR_INT(oFlags, (OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO | OBJ_FLAG_ACTIVE_FROM_AFAR | OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)), OR_INT(oFlags, (OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO | OBJ_FLAG_ACTIVE_FROM_AFAR | OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
SET_OBJ_PHYSICS(/*Wall hitbox radius*/ 30, /*Gravity*/ -400, /*Bounciness*/ 0, /*Drag*/ 0, /*Friction*/ 0, /*Buoyancy*/ 200, /*Unused*/ 0, 0), SET_OBJ_PHYSICS(/*Wall hitbox radius*/ 30, /*Gravity*/ -400, /*Bounciness*/ 0, /*Drag*/ 0, /*Friction*/ 0, /*Buoyancy*/ 200, /*Unused*/ 0, 0),
@ -5869,12 +5869,12 @@ const BehaviorScript bhvPenguinRaceShortcutCheck[] = {
END_LOOP(), END_LOOP(),
}; };
const BehaviorScript bhvCoffinManager[] = { const BehaviorScript bhvCoffinSpawner[] = {
BEGIN(OBJ_LIST_SURFACE), BEGIN(OBJ_LIST_SURFACE),
OR_INT(oFlags, (OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)), OR_INT(oFlags, (OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
CALL_NATIVE(bhv_init_room), CALL_NATIVE(bhv_init_room),
BEGIN_LOOP(), BEGIN_LOOP(),
CALL_NATIVE(bhv_coffin_manager_loop), CALL_NATIVE(bhv_coffin_spawner_loop),
END_LOOP(), END_LOOP(),
}; };

View file

@ -1,3 +1,53 @@
# IMPORTANT NOTICE ABOUT THIS FOLDER # Super Mario 64 Enhancements
Everything in this folder is non-canon to the source code in the rest of the repository. As such, it is not to be considered when looking for more information on Super Mario 64's functionality. This directory contains unofficial patches to the source code that provide various features
and enhancements.
To apply a patch, run `tools/apply_patch.sh [patch]` where `[patch]` is the name of the
.patch file you wish to apply. This will perform all of the patch's changes
to the source code.
Likewise, to undo the changes from a patch you applied, run
`tools/revert_patch.sh` with the name of the .patch file you wish to undo.
To create your own enhancement patch, switch to the `master` Git
branch, make your changes to the code (but do not commit), then run `tools/create_patch.sh`. Your changes will be stored in the .patch file you specify.
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.
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.
Place the `enhancements/RecordDemo.js` file in the `/Scripts/` folder in the Project64 directory.
In the Scripts window, double click on "RecordDemo" on the list on the left side.
When this is done, it should turn green which lets you know that it has started.
When your demo has been recorded, it will be dumped to the newly created `/SM64_DEMOS/` folder within the Project64 directory.

View file

@ -1,29 +0,0 @@
#ifndef _CRASH_H_
#define _CRASH_H_
#include <types.h>
#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_ */

View file

@ -1,292 +0,0 @@
/* SM64 Crash Handler */
/* See Readme in crash.inc.s for details. */
#include <sm64.h>
#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;
}
}

View file

@ -1,158 +0,0 @@
# SM64 Crash Handler
# See Readme below.
.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

529
enhancements/crash.patch Normal file
View file

@ -0,0 +1,529 @@
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 <sm64.h>
+
+#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 <types.h>
+
+#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_ */

View file

@ -1,23 +0,0 @@
#ifndef _DEBUG_DRAW_CUBE_H
#define _DEBUG_DRAW_CUBE_H
/**
* @file debug_box.h
* Draws debug boxes, see debug_box.inc.c for details
*/
#include "types.h"
/**
* The max amount of debug boxes before debug_box() just returns.
* You can set this to something higher like 1000, but things like text will stop rendering.
*/
#define MAX_DEBUG_BOXES 100
void debug_box(Vec3f center, Vec3f bounds);
void debug_box_rot(Vec3f center, Vec3f bounds, s16 yaw);
void debug_box_pos(Vec3f pMin, Vec3f pMax);
void debug_box_pos_rot(Vec3f pMin, Vec3f pMax, s16 yaw);
#endif /* _DEBUG_DRAW_CUBE_H */

View file

@ -1,248 +0,0 @@
#include <ultra64.h>
#include "sm64.h"
#include "game/game.h"
#include "game/geo_misc.h"
#include "engine/math_util.h"
#include "debug_box.h"
/**
* @file debug_box.inc.c
* Draws 3D boxes for debugging purposes.
*
* How to use:
*
* In area.c, add this to the list of includes:
*
* #include "enhancements/debug_box.inc.c"
*
* Then in render_game() in the same file, add a call to render_debug_boxes():
*
* void render_game(void) {
* if (gCurrentArea != NULL && !gWarpTransition.pauseRendering) {
* geo_process_root(...);
*
* render_debug_boxes(); // add here
*
* gSPViewport(...);
* gDPSetScissor(...);
* //...
*
* Now just call debug_box() 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.
*/
/**
* Internal struct containing box info
*/
struct DebugBox {
Vec3s center;
Vec3s bounds;
s16 yaw;
};
struct DebugBox *sBoxes[MAX_DEBUG_BOXES];
s16 sNumBoxes = 0;
extern Mat4 gMatStack[32]; //XXX: Hack
/**
* The debug boxes' transparency
*/
#define DBG_BOX_ALPHA 0x7F
/**
* The debug boxes' color
*/
#define DBG_BOX_COL 0xFF, 0x00, 0x00, DBG_BOX_ALPHA
/**
* Sets up the RCP for drawing the boxes
*/
static const Gfx dl_debug_box_begin[] = {
gsDPPipeSync(),
#if DBG_BOX_ALPHA < 0xFF
gsDPSetRenderMode(G_RM_ZB_XLU_SURF, G_RM_NOOP2),
#else
gsDPSetRenderMode(G_RM_ZB_OPA_SURF, G_RM_NOOP2),
#endif
gsSPClearGeometryMode(G_LIGHTING | G_CULL_BACK),
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPTexture(0, 0, 0, 0, G_OFF),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsSPEndDisplayList(),
};
/**
* Actually draws the box
*/
static const Gfx dl_debug_draw_box[] = {
gsSP2Triangles( 0, 1, 2, 0x0, 2, 1, 3, 0x0),
gsSP2Triangles( 2, 3, 6, 0x0, 6, 3, 7, 0x0),
gsSP2Triangles( 4, 0, 2, 0x0, 2, 6, 4, 0x0),
gsSP2Triangles( 1, 5, 3, 0x0, 3, 5, 7, 0x0),
gsSP2Triangles( 1, 0, 4, 0x0, 1, 4, 5, 0x0),
gsSP2Triangles( 5, 4, 6, 0x0, 5, 6, 7, 0x0),
gsSPEndDisplayList(),
};
/**
* Adds a box to the list to be rendered this frame.
*
* If there are already MAX_DEBUG_BOXES boxes, does nothing.
*/
static void append_debug_box(Vec3f center, Vec3f bounds, s16 yaw)
{
if (sNumBoxes >= MAX_DEBUG_BOXES ||
(sBoxes[sNumBoxes] = mem_pool_alloc(gEffectsMemoryPool, sizeof(struct DebugBox))) == NULL) {
return;
}
vec3f_to_vec3s(sBoxes[sNumBoxes]->center, center);
vec3f_to_vec3s(sBoxes[sNumBoxes]->bounds, bounds);
sBoxes[sNumBoxes]->yaw = yaw;
++sNumBoxes;
}
/**
* Draws a debug box from (center - bounds) to (center + bounds)
* To draw a rotated box, use debug_box_rot()
*
* @see debug_box_rot()
*/
void debug_box(Vec3f center, Vec3f bounds)
{
append_debug_box(center, bounds, 0);
}
/**
* Draws a debug box from (center - bounds) to (center + bounds), rotating it by `yaw`
*/
void debug_box_rot(Vec3f center, Vec3f bounds, s16 yaw)
{
append_debug_box(center, bounds, yaw);
}
/**
* Draws a debug box from pMin to pMax
* To draw a rotated box this way, use debug_box_pos_rot()
*
* @see debug_box_pos_rot()
*/
void debug_box_pos(Vec3f pMin, Vec3f pMax)
{
debug_box_pos_rot(pMin, pMax, 0);
}
/**
* Draws a debug box from pMin to pMax, rotating it in the xz-plane by `yaw`
*/
void debug_box_pos_rot(Vec3f pMin, Vec3f pMax, s16 yaw)
{
Vec3f center, bounds;
bounds[0] = pMax[0] - pMin[0] / 2.0f;
bounds[1] = pMax[1] - pMin[1] / 2.0f;
bounds[2] = pMax[2] - pMin[2] / 2.0f;
center[0] = pMin[0] + bounds[0];
center[1] = pMin[1] + bounds[1];
center[2] = pMin[2] + bounds[2];
append_debug_box(center, bounds, yaw);
}
static void render_box(struct DebugBox *box)
{
Vtx *verts = alloc_display_list(8 * sizeof(Vtx));
Mtx *translate;
Mtx *rotate;
Mtx *translateback;
s32 x0 = box->center[0],
y0 = box->center[1],
z0 = box->center[2];
s32 xb = box->bounds[0],
yb = box->bounds[1],
zb = box->bounds[2];
if (verts != NULL) {
if (box->yaw != 0) {
// Translate to the origin, rotate, then translate back, effectively rotating the box about
// its center
translate = alloc_display_list(sizeof(Mtx));
rotate = alloc_display_list(sizeof(Mtx));
translateback = alloc_display_list(sizeof(Mtx));
guTranslate(translate, box->center[0], box->center[1], box->center[2]);
guRotate(rotate, box->yaw / (float)0x10000 * 360.0f, 0, 1.0f, 0);
guTranslate(translateback, -box->center[0], -box->center[1], -box->center[2]);
gSPMatrix(gDisplayListHead++, translate, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH);
gSPMatrix(gDisplayListHead++, rotate, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH);
gSPMatrix(gDisplayListHead++, translateback, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH);
}
#define DBG_BOX_VTX(i, x, y, z) make_vertex(verts, i, x, y, z, 0, 0, DBG_BOX_COL)
DBG_BOX_VTX(0, x0 - xb, y0 + yb, z0 - zb);
DBG_BOX_VTX(1, x0 + xb, y0 + yb, z0 - zb);
DBG_BOX_VTX(2, x0 - xb, y0 - yb, z0 - zb);
DBG_BOX_VTX(3, x0 + xb, y0 - yb, z0 - zb);
DBG_BOX_VTX(4, x0 - xb, y0 + yb, z0 + zb);
DBG_BOX_VTX(5, x0 + xb, y0 + yb, z0 + zb);
DBG_BOX_VTX(6, x0 - xb, y0 - yb, z0 + zb);
DBG_BOX_VTX(7, x0 + xb, y0 - yb, z0 + zb);
#undef DBG_BOX_VTX
gSPVertex(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(verts), 8, 0);
gSPDisplayList(gDisplayListHead++, dl_debug_draw_box);
if (box->yaw != 0) {
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
}
}
}
void render_debug_boxes()
{
s32 i;
Mtx *mtx;
if (sNumBoxes == 0) {
return;
}
mtx = alloc_display_list(sizeof(Mtx));
if (mtx == NULL) {
for (i = 0; i < sNumBoxes; ++i) {
mem_pool_free(gEffectsMemoryPool, sBoxes[i]);
}
sNumBoxes = 0;
return;
}
//XXX: This is hacky. Ths camera's look-at matrix is stored in gMatStack[1], so this is a simple way
// of using it without reconstructing the matrix.
mtxf_to_mtx(mtx, gMatStack[1]);
gSPMatrix(gDisplayListHead++, mtx, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gSPDisplayList(gDisplayListHead++, dl_debug_box_begin);
for (i = 0; i < sNumBoxes; ++i) {
render_box(sBoxes[i]);
mem_pool_free(gEffectsMemoryPool, sBoxes[i]);
}
sNumBoxes = 0;
}

View file

@ -0,0 +1,302 @@
diff --git a/src/game/area.c b/src/game/area.c
index 240605d8..88c1a314 100644
--- a/src/game/area.c
+++ b/src/game/area.c
@@ -19,6 +19,7 @@
#include "level_update.h"
#include "engine/geo_layout.h"
#include "save_file.h"
+#include "debug_box.h"
struct SpawnInfo gPlayerSpawnInfos[1];
struct GraphNode *D_8033A160[0x100];
@@ -352,6 +353,8 @@ void render_game(void) {
if (gCurrentArea != NULL && !gWarpTransition.pauseRendering) {
geo_process_root(gCurrentArea->unk04, D_8032CE74, D_8032CE78, gFBSetColor);
+ render_debug_boxes();
+
gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_8032CF00));
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, SCREEN_WIDTH,
diff --git a/src/game/debug_box.c b/src/game/debug_box.c
new file mode 100644
index 00000000..0ee87ec7
--- /dev/null
+++ b/src/game/debug_box.c
@@ -0,0 +1,244 @@
+#include <ultra64.h>
+
+#include "sm64.h"
+#include "game/game.h"
+#include "game/geo_misc.h"
+#include "engine/math_util.h"
+
+#include "debug_box.h"
+
+/**
+ * @file debug_box.c
+ * Draws 3D boxes for debugging purposes.
+ *
+ * How to use:
+ *
+ * In render_game() in area.c, add a call to render_debug_boxes():
+ *
+ * void render_game(void) {
+ * if (gCurrentArea != NULL && !gWarpTransition.pauseRendering) {
+ * geo_process_root(...);
+ *
+ * render_debug_boxes(); // add here
+ *
+ * gSPViewport(...);
+ * gDPSetScissor(...);
+ * //...
+ *
+ * Now just call debug_box() 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.
+ */
+
+/**
+ * Internal struct containing box info
+ */
+struct DebugBox {
+ Vec3s center;
+ Vec3s bounds;
+ s16 yaw;
+};
+
+struct DebugBox *sBoxes[MAX_DEBUG_BOXES];
+s16 sNumBoxes = 0;
+
+extern Mat4 gMatStack[32]; //XXX: Hack
+
+/**
+ * The debug boxes' transparency
+ */
+#define DBG_BOX_ALPHA 0x7F
+/**
+ * The debug boxes' color
+ */
+#define DBG_BOX_COL 0xFF, 0x00, 0x00, DBG_BOX_ALPHA
+
+/**
+ * Sets up the RCP for drawing the boxes
+ */
+static const Gfx dl_debug_box_begin[] = {
+ gsDPPipeSync(),
+#if DBG_BOX_ALPHA < 0xFF
+ gsDPSetRenderMode(G_RM_ZB_XLU_SURF, G_RM_NOOP2),
+#else
+ gsDPSetRenderMode(G_RM_ZB_OPA_SURF, G_RM_NOOP2),
+#endif
+ gsSPClearGeometryMode(G_LIGHTING | G_CULL_BACK),
+ gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
+ gsSPTexture(0, 0, 0, 0, G_OFF),
+ gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
+ gsSPEndDisplayList(),
+};
+
+/**
+ * Actually draws the box
+ */
+static const Gfx dl_debug_draw_box[] = {
+ gsSP2Triangles( 0, 1, 2, 0x0, 2, 1, 3, 0x0),
+ gsSP2Triangles( 2, 3, 6, 0x0, 6, 3, 7, 0x0),
+
+ gsSP2Triangles( 4, 0, 2, 0x0, 2, 6, 4, 0x0),
+ gsSP2Triangles( 1, 5, 3, 0x0, 3, 5, 7, 0x0),
+
+ gsSP2Triangles( 1, 0, 4, 0x0, 1, 4, 5, 0x0),
+ gsSP2Triangles( 5, 4, 6, 0x0, 5, 6, 7, 0x0),
+
+ gsSPEndDisplayList(),
+};
+
+/**
+ * Adds a box to the list to be rendered this frame.
+ *
+ * If there are already MAX_DEBUG_BOXES boxes, does nothing.
+ */
+static void append_debug_box(Vec3f center, Vec3f bounds, s16 yaw)
+{
+ if (sNumBoxes >= MAX_DEBUG_BOXES ||
+ (sBoxes[sNumBoxes] = mem_pool_alloc(gEffectsMemoryPool, sizeof(struct DebugBox))) == NULL) {
+ return;
+ }
+
+ vec3f_to_vec3s(sBoxes[sNumBoxes]->center, center);
+ vec3f_to_vec3s(sBoxes[sNumBoxes]->bounds, bounds);
+
+ sBoxes[sNumBoxes]->yaw = yaw;
+
+ ++sNumBoxes;
+}
+
+/**
+ * Draws a debug box from (center - bounds) to (center + bounds)
+ * To draw a rotated box, use debug_box_rot()
+ *
+ * @see debug_box_rot()
+ */
+void debug_box(Vec3f center, Vec3f bounds)
+{
+ append_debug_box(center, bounds, 0);
+}
+
+/**
+ * Draws a debug box from (center - bounds) to (center + bounds), rotating it by `yaw`
+ */
+void debug_box_rot(Vec3f center, Vec3f bounds, s16 yaw)
+{
+ append_debug_box(center, bounds, yaw);
+}
+
+/**
+ * Draws a debug box from pMin to pMax
+ * To draw a rotated box this way, use debug_box_pos_rot()
+ *
+ * @see debug_box_pos_rot()
+ */
+void debug_box_pos(Vec3f pMin, Vec3f pMax)
+{
+ debug_box_pos_rot(pMin, pMax, 0);
+}
+
+/**
+ * Draws a debug box from pMin to pMax, rotating it in the xz-plane by `yaw`
+ */
+void debug_box_pos_rot(Vec3f pMin, Vec3f pMax, s16 yaw)
+{
+ Vec3f center, bounds;
+
+ bounds[0] = pMax[0] - pMin[0] / 2.0f;
+ bounds[1] = pMax[1] - pMin[1] / 2.0f;
+ bounds[2] = pMax[2] - pMin[2] / 2.0f;
+
+ center[0] = pMin[0] + bounds[0];
+ center[1] = pMin[1] + bounds[1];
+ center[2] = pMin[2] + bounds[2];
+
+ append_debug_box(center, bounds, yaw);
+}
+
+static void render_box(struct DebugBox *box)
+{
+ Vtx *verts = alloc_display_list(8 * sizeof(Vtx));
+ Mtx *translate;
+ Mtx *rotate;
+ Mtx *translateback;
+ s32 x0 = box->center[0],
+ y0 = box->center[1],
+ z0 = box->center[2];
+
+ s32 xb = box->bounds[0],
+ yb = box->bounds[1],
+ zb = box->bounds[2];
+
+ if (verts != NULL) {
+ if (box->yaw != 0) {
+ // Translate to the origin, rotate, then translate back, effectively rotating the box about
+ // its center
+ translate = alloc_display_list(sizeof(Mtx));
+ rotate = alloc_display_list(sizeof(Mtx));
+ translateback = alloc_display_list(sizeof(Mtx));
+
+ guTranslate(translate, box->center[0], box->center[1], box->center[2]);
+ guRotate(rotate, box->yaw / (float)0x10000 * 360.0f, 0, 1.0f, 0);
+ guTranslate(translateback, -box->center[0], -box->center[1], -box->center[2]);
+
+ gSPMatrix(gDisplayListHead++, translate, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH);
+ gSPMatrix(gDisplayListHead++, rotate, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH);
+ gSPMatrix(gDisplayListHead++, translateback, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH);
+ }
+
+#define DBG_BOX_VTX(i, x, y, z) make_vertex(verts, i, x, y, z, 0, 0, DBG_BOX_COL)
+ DBG_BOX_VTX(0, x0 - xb, y0 + yb, z0 - zb);
+ DBG_BOX_VTX(1, x0 + xb, y0 + yb, z0 - zb);
+ DBG_BOX_VTX(2, x0 - xb, y0 - yb, z0 - zb);
+ DBG_BOX_VTX(3, x0 + xb, y0 - yb, z0 - zb);
+ DBG_BOX_VTX(4, x0 - xb, y0 + yb, z0 + zb);
+ DBG_BOX_VTX(5, x0 + xb, y0 + yb, z0 + zb);
+ DBG_BOX_VTX(6, x0 - xb, y0 - yb, z0 + zb);
+ DBG_BOX_VTX(7, x0 + xb, y0 - yb, z0 + zb);
+#undef DBG_BOX_VTX
+
+ gSPVertex(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(verts), 8, 0);
+
+ gSPDisplayList(gDisplayListHead++, dl_debug_draw_box);
+
+ if (box->yaw != 0) {
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+ }
+ }
+}
+
+void render_debug_boxes(void)
+{
+ s32 i;
+ Mtx *mtx;
+
+ if (sNumBoxes == 0) {
+ return;
+ }
+
+ mtx = alloc_display_list(sizeof(Mtx));
+ if (mtx == NULL) {
+ for (i = 0; i < sNumBoxes; ++i) {
+ mem_pool_free(gEffectsMemoryPool, sBoxes[i]);
+ }
+ sNumBoxes = 0;
+ return;
+ }
+
+ //XXX: This is hacky. Ths camera's look-at matrix is stored in gMatStack[1], so this is a simple way
+ // of using it without reconstructing the matrix.
+ mtxf_to_mtx(mtx, gMatStack[1]);
+ gSPMatrix(gDisplayListHead++, mtx, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
+ gSPDisplayList(gDisplayListHead++, dl_debug_box_begin);
+
+ for (i = 0; i < sNumBoxes; ++i) {
+ render_box(sBoxes[i]);
+ mem_pool_free(gEffectsMemoryPool, sBoxes[i]);
+ }
+
+ sNumBoxes = 0;
+}
diff --git a/src/game/debug_box.h b/src/game/debug_box.h
new file mode 100644
index 00000000..cdb3dc9d
--- /dev/null
+++ b/src/game/debug_box.h
@@ -0,0 +1,25 @@
+#ifndef _DEBUG_DRAW_CUBE_H
+#define _DEBUG_DRAW_CUBE_H
+
+/**
+ * @file debug_box.h
+ * Draws debug boxes, see debug_box.inc.c for details
+ */
+
+#include "types.h"
+
+/**
+ * The max amount of debug boxes before debug_box() just returns.
+ * You can set this to something higher like 1000, but things like text will stop rendering.
+ */
+#define MAX_DEBUG_BOXES 100
+
+void debug_box(Vec3f center, Vec3f bounds);
+void debug_box_rot(Vec3f center, Vec3f bounds, s16 yaw);
+
+void debug_box_pos(Vec3f pMin, Vec3f pMax);
+void debug_box_pos_rot(Vec3f pMin, Vec3f pMax, s16 yaw);
+
+void render_debug_boxes(void);
+
+#endif /* _DEBUG_DRAW_CUBE_H */

View file

@ -1,172 +0,0 @@
/*
* This file demonstrates how to manipulate display list data from C. *
* To use it, #include "../../enhancements/dyn_light.inc.c" and hook it on to a function that is called
* once per frame.
*/
#ifndef _DYNLIGHTS_H
#define _DYNLIGHTS_H
#include "../src/game/area.h" /* Get level info */
#include "../src/game/level_update.h" /* gMarioState */
#include "../src/game/memory.h"
#include "../src/game/print.h"
/*
* Common values for shading, which are manipulated with the SHADE_* defines
* in combination with the set_mario_shade_light function.
*/
/* Shading levels for Mario */
#define SHADE_100 1
#define SHADE_75 0.75
#define SHADE_50 0.50
#define SHADE_25 0.25
/* Mario light values */
#define VAL1 0x7F
#define VAL2 0x39
#define VAL3 0X0E
#define VAL4 0x07
#define VAL5 0x3C
#define VAL6 0x60
#define VAL7 0x03
/* Custom structs used for setting light values. */
typedef struct /* Normal shade lights */
{
unsigned char byte[7];
} Light2;
typedef struct /* Ambient lights */
{
unsigned char byte[15];
} Light3;
/* ! GLABEL THESE: actors/mario/model.s ! */
extern Light2 *mario_amb_light_group1;
extern Light2 *mario_amb_light_group2;
extern Light2 *mario_amb_light_group3;
extern Light2 *mario_amb_light_group4;
extern Light2 *mario_amb_light_group6;
/* OPTIONAL: Add level lights here--just like Mario they have to be glabel'd. */
/* Used to set mario's shading to one of the four predetermined modes. */
void set_mario_shade_light(f32 mode) {
Light2 *ptr;
ptr = segmented_to_virtual(&mario_amb_light_group1);
ptr->byte[2] = VAL1 * mode;
ptr->byte[6] = VAL1 * mode;
ptr = segmented_to_virtual(&mario_amb_light_group2);
ptr->byte[0] = VAL1 * mode;
ptr->byte[4] = VAL1 * mode;
ptr = segmented_to_virtual(&mario_amb_light_group3);
ptr->byte[0] = VAL1 * mode;
ptr->byte[1] = VAL1 * mode;
ptr->byte[2] = VAL1 * mode;
ptr->byte[4] = VAL1 * mode;
ptr->byte[5] = VAL1 * mode;
ptr->byte[6] = VAL1 * mode;
ptr = segmented_to_virtual(&mario_amb_light_group4);
ptr->byte[0] = VAL2 * mode;
ptr->byte[1] = VAL3 * mode;
ptr->byte[2] = VAL4 * mode;
ptr->byte[4] = VAL2 * mode;
ptr->byte[5] = VAL3 * mode;
ptr->byte[6] = VAL4 * mode;
ptr = segmented_to_virtual(&mario_amb_light_group6);
ptr->byte[0] = VAL2 * mode;
ptr->byte[1] = VAL7 * mode;
ptr->byte[4] = VAL2 * mode;
ptr->byte[5] = VAL7 * mode;
}
/* Creates a point light with its origin at x, y, and z. */
void point_light(s16 x, s16 y, s16 z, s16 size, f32 shade, s16 size1, f32 shade1) {
/* Outer region */
if (gMarioState->pos[0] >= (x - size1) && gMarioState->pos[0] <= x + size1
&& gMarioState->pos[1] >= (y - size1) && gMarioState->pos[1] <= y + size1
&& gMarioState->pos[2] >= (z - size1) && gMarioState->pos[2] <= z + size1) {
set_mario_shade_light(shade1);
}
/* Inner region */
if (gMarioState->pos[0] >= (x - size) && gMarioState->pos[0] <= x + size
&& gMarioState->pos[1] >= (y - size) && gMarioState->pos[1] <= y + size
&& gMarioState->pos[2] >= (z - size) && gMarioState->pos[2] <= z + size) {
set_mario_shade_light(shade);
}
}
/*
* Sets up the automatic shading for levels and sets up point lights.
* BBH is already done for you.
*/
void set_level_shading(void) {
#ifdef DEBUG
print_text_fmt_int(40, 80, "AREA: %d", gCurrAreaIndex);
print_text_fmt_int(40, 60, "X: %d", gMarioState->pos[0]);
print_text_fmt_int(40, 40, "Y: %d", gMarioState->pos[1]);
print_text_fmt_int(40, 20, "Z: %d", gMarioState->pos[2]);
#endif
switch (gCurrLevelNum) {
case LEVEL_BBH:
set_mario_shade_light(SHADE_25);
point_light(200, 0, 2300, 200, SHADE_100, 400, SHADE_50);
point_light(1000, 0, 2300, 200, SHADE_100, 400, SHADE_50);
point_light(200, 0, 1500, 150, SHADE_75, 200, SHADE_50);
point_light(200, 0, 700, 150, SHADE_75, 200, SHADE_50);
point_light(450, 0, 300, 150, SHADE_75, 200, SHADE_50);
point_light(1550, 0, 300, 150, SHADE_75, 200, SHADE_50);
point_light(1800, 0, 1500, 150, SHADE_75, 200, SHADE_50);
point_light(1500, 0, 1750, 100, SHADE_50, 150, SHADE_25); /* Window moonlight */
break;
case LEVEL_HMC:
set_mario_shade_light(SHADE_25);
break;
case LEVEL_CASTLE:
set_mario_shade_light(SHADE_75);
if (gCurrAreaIndex == 3) {
set_mario_shade_light(SHADE_50);
}
break;
case LEVEL_SSL:
set_mario_shade_light(SHADE_100);
if (gCurrAreaIndex == 2 || gCurrAreaIndex == 3) { /* Both pyramid areas */
set_mario_shade_light(SHADE_25);
}
break;
case LEVEL_JRB:
case LEVEL_DDD:
case LEVEL_SA:
set_mario_shade_light(SHADE_50);
break;
case LEVEL_CCM:
case LEVEL_SL:
case LEVEL_PSS:
set_mario_shade_light(SHADE_75);
if (gCurrAreaIndex == 2) {
set_mario_shade_light(SHADE_50);
}
break;
default:
set_mario_shade_light(SHADE_100);
break;
}
}
#endif

View file

@ -1,59 +0,0 @@
/*
* Framerate counter
*
* Calculates the game's current framerate by using osGetTime() and
* prints it out on the lower left side of the screen.
*
* HOW TO USE:
*
* Add this include statement to the top of game.c
*
* #include "../../enhancements/fps.inc.c"
*
* Then, at the end of the while(1) loop in the function thread5_game_loop()
* add the function call render_fps()
*
* That's it! Build the rom file and press L when the game boots up
* to toggle the FPS counter.
*/
// SDK states that 1 cycle takes about 21.33 nanoseconds
#define SECONDS_PER_CYCLE 0.00000002133f
#define FPS_COUNTER_X_POS 24
#define FPS_COUNTER_Y_POS 190
OSTime gLastOSTime = 0;
float gFrameTime = 0.0f;
u16 gFrames = 0;
u16 gFPS = 0;
u8 gRenderFPS = FALSE;
void calculate_frameTime_from_OSTime(OSTime diff) {
gFrameTime += diff * SECONDS_PER_CYCLE;
gFrames++;
}
void render_fps(void) {
// Toggle rendering framerate with the L button.
if (gPlayer1Controller->buttonPressed & L_TRIG) {
gRenderFPS ^= 1;
}
if (gRenderFPS) {
OSTime newTime = osGetTime();
calculate_frameTime_from_OSTime(newTime - gLastOSTime);
// If frame time is longer or equal to a second, update FPS counter.
if (gFrameTime >= 1.0f) {
gFPS = gFrames;
gFrames = 0;
gFrameTime -= 1.0f;
}
print_text_fmt_int(FPS_COUNTER_X_POS, FPS_COUNTER_Y_POS, "FPS %d", gFPS);
gLastOSTime = newTime;
}
}

60
enhancements/fps.patch Normal file
View file

@ -0,0 +1,60 @@
diff --git a/src/game/game.c b/src/game/game.c
index ad800839..4a37549b 100644
--- a/src/game/game.c
+++ b/src/game/game.c
@@ -52,6 +52,47 @@ struct DemoInput *gCurrDemoInput = NULL; // demo input sequence
u16 gDemoInputListID = 0;
struct DemoInput gRecordedDemoInput = { 0 }; // possibly removed in EU. TODO: Check
+// SDK states that 1 cycle takes about 21.33 nanoseconds
+#define SECONDS_PER_CYCLE 0.00000002133f
+
+#define FPS_COUNTER_X_POS 24
+#define FPS_COUNTER_Y_POS 190
+
+static OSTime gLastOSTime = 0;
+static float gFrameTime = 0.0f;
+static u16 gFrames = 0;
+static u16 gFPS = 0;
+static u8 gRenderFPS = FALSE;
+
+static void calculate_frameTime_from_OSTime(OSTime diff) {
+ gFrameTime += diff * SECONDS_PER_CYCLE;
+ gFrames++;
+}
+
+static void render_fps(void) {
+ // Toggle rendering framerate with the L button.
+ if (gPlayer1Controller->buttonPressed & L_TRIG) {
+ gRenderFPS ^= 1;
+ }
+
+ if (gRenderFPS) {
+ OSTime newTime = osGetTime();
+
+ calculate_frameTime_from_OSTime(newTime - gLastOSTime);
+
+ // If frame time is longer or equal to a second, update FPS counter.
+ if (gFrameTime >= 1.0f) {
+ gFPS = gFrames;
+ gFrames = 0;
+ gFrameTime -= 1.0f;
+ }
+
+ print_text_fmt_int(FPS_COUNTER_X_POS, FPS_COUNTER_Y_POS, "FPS %d", gFPS);
+
+ gLastOSTime = newTime;
+ }
+}
+
// 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) {
@@ -334,5 +375,7 @@ void thread5_game_loop(UNUSED void *arg) {
// amount of free space remaining.
print_text_fmt_int(180, 20, "BUF %d", gGfxPoolEnd - (u8 *) gDisplayListHead);
}
+
+ render_fps();
}
}

View file

@ -0,0 +1,312 @@
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 <PR/console_type.h>
+
+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 <PR/console_type.h>
// 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 <PR/console_type.h>
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 <PR/console_type.h>
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 <macros.h>
+#include <PR/console_type.h>
#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

View file

@ -1,46 +0,0 @@
# iQue Player Support Enhancement
This enhancement allows the same ROM to work on both the N64 and the iQue Player.
## Instructions
### Fix video corruption
In `lib/src/__osViSwapContext.c`, change the line
```c
HW_REG(VI_CONTROL_REG, u32) = s1->features;
```
to
```c
HW_REG(VI_CONTROL_REG, u32) = s1->features & ~(1 << 13);
```
This has no effect on the N64, but prevents video corruption on iQue. Games will be unplayable on iQue unless you do this modification.
### Add console detection
Copy `enhancements/ique_support/skGetId.s` into `lib/asm/`.
Copy `enhancements/ique_support/consoleType.c` into `lib/src/`.
Copy `enhancements/ique_support/console_type.h` into `include/PR/`.
Add the line `#include <PR/console_type.h>` to the bottom of the block of `#include`s in `include/ultra64.h`.
Add the line `gConsoleType = get_console_type();` as the first line of code in `osInitialize()` in `lib/src/osInitialize.c` (i.e. right before the line `D_80365CD0 = TRUE;`)
### Patch libultra EEPROM functions
Console detection needs to be added for this modification.
In `lib/src/osEepromRead.c`, `lib/src/osEepromWrite.c`, and `lib/src/osEepromProbe.c`:
Add
```c
if (gConsoleType == CONSOLE_N64) {
```
directly after the `__osSiGetAccess` call.
Add
```c
} else if (gConsoleType == CONSOLE_IQUE) {
#include "../../enhancements/ique_support/FILENAME.inc.c"
}
```
directly before the `__osSiRelAccess` call; replace `FILENAME` with the filename, i.e. if `lib/src/osEepromRead.c` put `#include "../../enhancements/ique_support/osEepromRead.inc.c"`.

View file

@ -1,11 +0,0 @@
#include "libultra_internal.h"
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;
}

View file

@ -1,7 +0,0 @@
enum ConsoleType {
CONSOLE_N64,
CONSOLE_IQUE
};
extern enum ConsoleType gConsoleType;
extern enum ConsoleType get_console_type(void);

View file

@ -1,9 +0,0 @@
s32 __osBbEepromSize = * (s32*) 0x80000360;
if (__osBbEepromSize == 0x200) {
status = 1;
}
if (__osBbEepromSize == 0x800) {
status = 2;
}

View file

@ -1,8 +0,0 @@
u8 *__osBbEepromAddress = * (u8**) 0x8000035C;
s32 i;
for (i = 0; i < 8; i++) {
buffer[i] = __osBbEepromAddress[(address << 3) + i];
}
sp34 = 0;

View file

@ -1,8 +0,0 @@
u8 *__osBbEepromAddress = * (u8**) 0x8000035C;
s32 i;
for (i = 0; i < 8; i++) {
__osBbEepromAddress[(address << 3) + i] = buffer[i];
}
sp34 = 0;

View file

@ -1,18 +0,0 @@
# 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

View file

@ -1,193 +0,0 @@
/* clang-format off */
/*
* mem_error_screen.inc.c
*
* This enhancement should be used for ROM hacks that require the expansion pak.
*
* ----- Setup -----
*
* Make sure that USE_EXT_RAM is defined in include/segments.h
#define USE_EXT_RAM
*
* There are 7 files you will need to edit:
* src/game/main.c
* src/engine/level_script.h
* include/text_strings.h.in
* levels/entry.c
* levels/intro/script.c
* levels/intro/geo.c
* levels/intro/header.h
*
* First, in main.c, you will need to add this line below the includes:
#include "../enhancements/mem_error_screen.inc.c"
*
* In the function AllocPool(), add these lines above main_pool_init():
// Detect memory size
if(does_pool_end_lie_out_of_bounds(end))
{
end = (void *)SEG_POOL_END_4MB;
}
*
* Then in thread3_main(), replace the create_thread for thread 5 with this if/else statement:
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);
}
*
* In src/engine/level_script.h, add this line below 'extern u8 level_script_entry[];'
extern u8 level_script_entry_error_screen[];
*
* In include/text_strings.h.in, add these 3 lines at the top. You can also add more strings if you want.
#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")
*
* In levels/entry.c, simply append the following to the file:
const LevelScript level_script_entry_error_screen[] {
INIT_LEVEL(),
SLEEP(2),
BLACKOUT(FALSE),
SET_REG(0),
EXECUTE(0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_error_screen),
JUMP(level_script_entry_error_screen),
};
*
* In levels/intro/script.c, add the following to the top of the file:
const LevelScript level_intro_entry_error_screen[] {
INIT_LEVEL(),
FIXED_LOAD(_goddardSegmentStart, _goddardSegmentRomStart, _goddardSegmentRomEnd),
LOAD_MIO0(0x07, _intro_segment_7SegmentRomStart, _intro_segment_7SegmentRomEnd),
ALLOC_LEVEL_POOL(),
AREA(1, intro_geo_error_screen),
END_AREA(),
FREE_LEVEL_POOL(),
LOAD_AREA(1),
SLEEP(32767),
EXIT_AND_EXECUTE(0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_error_screen),
};
*
* Add the following to the top of levels/intro/geo.c:
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(),
};
* Finally, add the following to the bottom of levels/intro/header.h:
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);
*/
/* clang-format on */
// Ensure that USE_EXT_RAM is defined.
#ifndef USE_EXT_RAM
#error You have to define USE_EXT_RAM in 'include/segments.h'
#endif
#include <types.h>
#include <text_strings.h>
#include "../src/game/display.h"
#include "../src/game/print.h"
#include "../src/game/ingame_menu.h"
#include "../src/game/segment2.h"
#include "../src/engine/level_script.h"
// 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);
func_80247ED8();
while (1) {
func_80247FAC();
addr = level_script_execute(addr);
display_and_vsync();
}
}

View file

@ -0,0 +1,298 @@
diff --git a/Makefile b/Makefile
index 26c76d3d..bfc8bb18 100644
--- a/Makefile
+++ b/Makefile
@@ -341,6 +341,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 ccc989aa..e54c3eab 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 2fda11d7..8ba0a1c9 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")
+
#ifdef VERSION_JP
/**
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 7fbee0c5..e7effd85 100644
--- a/levels/intro/geo.c
+++ b/levels/intro/geo.c
@@ -13,6 +13,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 3ffd7859..b8c3ae41 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 f677f6f9..a164beb1 100644
--- a/src/game/main.c
+++ b/src/game/main.c
@@ -12,6 +12,7 @@
#include "buffers/buffers.h"
#include "segments.h"
#include "main.h"
+#include "mem_error_screen.h"
// Message IDs
#define MESG_SP_COMPLETE 100
@@ -125,6 +126,10 @@ void AllocPool(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);
}
@@ -314,7 +319,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..20eeef8f
--- /dev/null
+++ b/src/game/mem_error_screen.c
@@ -0,0 +1,105 @@
+/* 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 <types.h>
+#include "segments.h"
+#include "text_strings.h"
+#include "game.h"
+#include "main.h"
+#include "display.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);
+
+ func_80247ED8();
+
+ while (1) {
+ func_80247FAC();
+ addr = level_script_execute(addr);
+ display_and_vsync();
+ }
+}
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

View file

@ -0,0 +1,177 @@
diff --git a/src/game/game.c b/src/game/game.c
index ad800839..810e2ba3 100644
--- a/src/game/game.c
+++ b/src/game/game.c
@@ -52,6 +52,45 @@ struct DemoInput *gCurrDemoInput = NULL; // demo input sequence
u16 gDemoInputListID = 0;
struct DemoInput gRecordedDemoInput = { 0 }; // possibly removed in EU. TODO: Check
+/*
+ * This enhancement allows you to record gameplay demos for the mario head screen.
+ *
+ * Note:
+ * This enhancement does require the lastest versions of PJ64 from the nightly builds,
+ * because it uses the javascript API to automatically dump the demo files from RAM
+ * once the demo is completed. See enhancements/RecordDemo.js for more info
+ *
+*/
+
+#include "../src/game/mario.h"
+
+#define DEMOREC_STATUS_NOT_RECORDING 0
+#define DEMOREC_STATUS_PREPARING 1
+#define DEMOREC_STATUS_RECORDING 2
+#define DEMOREC_STATUS_STOPPING 3
+#define DEMOREC_STATUS_DONE 4
+
+#define DEMOREC_PRINT_X 10
+#define DEMOREC_PRINT_Y 10
+
+#define DEMOREC_DONE_DELAY 60 // Show "DONE" message for 2 seconds.
+
+#define DEMOREC_MAX_INPUTS 1025 // Max number of recorded inputs.
+
+/*
+ DO NOT REMOVE, MODIFY, OR MAKE A COPY OF THIS EXACT STRING!
+ This is here so that the js dump script can find the control variables easily.
+*/
+char gDemoRecTag[] = "DEMORECVARS";
+
+// Control variables. It is easier if they are each 4 byte aligned, which is why they are u32.
+u32 gRecordingStatus = DEMOREC_STATUS_NOT_RECORDING;
+u32 gDoneDelay = 0;
+u32 gNumOfRecordedInputs = 0;
+struct DemoInput gRecordedInputs[DEMOREC_MAX_INPUTS];
+struct DemoInput* gRecordedInputsPtr = (struct DemoInput*)gRecordedInputs;
+struct DemoInput gRecordedDemoInputCopy;
+
// 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) {
@@ -85,6 +124,118 @@ static void record_demo(void) {
gRecordedDemoInput.timer++;
}
+void record_new_demo_input(void) {
+ if(gRecordedDemoInput.timer == 1 && gRecordedDemoInputCopy.timer > 0) {
+ gRecordedInputs[gNumOfRecordedInputs].timer = gRecordedDemoInputCopy.timer;
+ gRecordedInputs[gNumOfRecordedInputs + 1].timer = 0;
+ gRecordedInputs[gNumOfRecordedInputs].rawStickX = gRecordedDemoInputCopy.rawStickX;
+ gRecordedInputs[gNumOfRecordedInputs + 1].rawStickX = gRecordedDemoInputCopy.rawStickX;
+ gRecordedInputs[gNumOfRecordedInputs].rawStickY = gRecordedDemoInputCopy.rawStickY;
+ gRecordedInputs[gNumOfRecordedInputs + 1].rawStickY = gRecordedDemoInputCopy.rawStickY;
+ gRecordedInputs[gNumOfRecordedInputs].buttonMask = gRecordedDemoInputCopy.buttonMask;
+ gRecordedInputs[gNumOfRecordedInputs + 1].buttonMask = gRecordedDemoInputCopy.buttonMask;
+ gNumOfRecordedInputs++;
+ }
+}
+
+// Self explanitory
+void copy_gRecordedDemoInput(void) {
+ gRecordedDemoInputCopy.timer = gRecordedDemoInput.timer;
+ gRecordedDemoInputCopy.rawStickX = gRecordedDemoInput.rawStickX;
+ gRecordedDemoInputCopy.rawStickY = gRecordedDemoInput.rawStickY;
+ gRecordedDemoInputCopy.buttonMask = gRecordedDemoInput.buttonMask;
+}
+
+// Runs when the demo is recording.
+void recording(void) {
+
+ // Force-stop when someone makes too many inputs.
+ if(gNumOfRecordedInputs + 1 > DEMOREC_MAX_INPUTS) {
+ gRecordingStatus = DEMOREC_STATUS_STOPPING;
+ return;
+ }
+
+ copy_gRecordedDemoInput();
+ record_demo(); // Defined in game.c
+ record_new_demo_input();
+}
+
+// Makes sure the last demo input is zeroed out, to make it look more clean.
+void record_cleanup(void) {
+ gRecordedInputs[gNumOfRecordedInputs].timer = 0;
+ gRecordedInputs[gNumOfRecordedInputs].rawStickX = 0;
+ gRecordedInputs[gNumOfRecordedInputs].rawStickY = 0;
+ gRecordedInputs[gNumOfRecordedInputs].buttonMask = 0;
+
+ // Make sure the done delay is reset before moving to DONE status.
+ gDoneDelay = 0;
+}
+
+void record_run(void) {
+ switch(gRecordingStatus) {
+ case DEMOREC_STATUS_NOT_RECORDING:
+ break;
+ case DEMOREC_STATUS_PREPARING:
+ if(gMarioObject != NULL && gCurrLevelNum >= 5) { // If the game is in an active level
+ gRecordingStatus = DEMOREC_STATUS_RECORDING;
+
+ // A bit of a hack, but it works.
+ gNumOfRecordedInputs = 1;
+ gRecordedInputs[0].timer = gCurrLevelNum;
+ gRecordedInputs[0].rawStickX = 0;
+ gRecordedInputs[0].rawStickY = 0;
+ gRecordedInputs[0].buttonMask = 0;
+ }
+ break;
+ case DEMOREC_STATUS_RECORDING:
+ recording();
+ break;
+ case DEMOREC_STATUS_DONE:
+ if(gDoneDelay > DEMOREC_DONE_DELAY)
+ gRecordingStatus = DEMOREC_STATUS_NOT_RECORDING;
+ else
+ gDoneDelay++;
+ break;
+ }
+}
+
+// Prints the status on the bottom-left side of the screen in colorful text.
+void print_status(void) {
+ switch(gRecordingStatus) {
+ case DEMOREC_STATUS_PREPARING:
+ print_text(DEMOREC_PRINT_X, DEMOREC_PRINT_Y, "READY");
+ break;
+ case DEMOREC_STATUS_RECORDING:
+ print_text(DEMOREC_PRINT_X, DEMOREC_PRINT_Y, "REC");
+ break;
+ case DEMOREC_STATUS_STOPPING:
+ print_text(DEMOREC_PRINT_X, DEMOREC_PRINT_Y, "WAIT");
+ break;
+ case DEMOREC_STATUS_DONE:
+ print_text(DEMOREC_PRINT_X, DEMOREC_PRINT_Y, "DONE");
+ break;
+ }
+}
+
+// Main function that should be called from thread5_game_loop()
+void recordingDemo(void) {
+ // Mario needs to enter directly into a level and not from a warp,
+ // so the debug level select is used for that.
+ gDebugLevelSelect = TRUE;
+
+ if(gPlayer1Controller->buttonPressed & L_TRIG) {
+ if(gRecordingStatus == DEMOREC_STATUS_NOT_RECORDING) {
+ gRecordingStatus = DEMOREC_STATUS_PREPARING;
+ } else if (gRecordingStatus == DEMOREC_STATUS_RECORDING) {
+ gRecordingStatus = DEMOREC_STATUS_STOPPING;
+ record_cleanup();
+ }
+ }
+
+ record_run();
+ print_status();
+}
+
// take the updated controller struct and calculate
// the new x, y, and distance floats.
void adjust_analog_stick(struct Controller *controller) {
@@ -325,6 +476,7 @@ void thread5_game_loop(UNUSED void *arg) {
audio_game_loop_tick();
func_80247FAC();
read_controller_inputs();
+ recordingDemo();
addr = level_script_execute(addr);
display_and_vsync();

View file

@ -1,163 +0,0 @@
/*
* This enhancement allows you to record gameplay demos for the mario head screen.
*
* Note:
* This enhancement does require the lastest versions of PJ64 from the nightly builds,
* because it uses the javascript API to automatically dump the demo files from RAM
* once the demo is completed. See RecordDemo.js for more info
*
* SETUP:
*
* First add the following above the 'thread5_game_loop' function in src/game/game.c
#include "../enhancements/record_demo/record_demo.inc.c"
*
* Then, inside thread5_game_loop(), add the recordingDemo function call RIGHT AFTER
* read_controller_inputs like so:
func_802494A8();
func_80247FAC();
read_controller_inputs();
recordingDemo();
addr = level_script_execute(addr);
display_and_vsync();
*/
#include "../src/game/mario.h"
#define DEMOREC_STATUS_NOT_RECORDING 0
#define DEMOREC_STATUS_PREPARING 1
#define DEMOREC_STATUS_RECORDING 2
#define DEMOREC_STATUS_STOPPING 3
#define DEMOREC_STATUS_DONE 4
#define DEMOREC_PRINT_X 10
#define DEMOREC_PRINT_Y 10
#define DEMOREC_DONE_DELAY 60 // Show "DONE" message for 2 seconds.
#define DEMOREC_MAX_INPUTS 1025 // Max number of recorded inputs.
/*
DO NOT REMOVE, MODIFY, OR MAKE A COPY OF THIS EXACT STRING!
This is here so that the js dump script can find the control variables easily.
*/
char gDemoRecTag[] = "DEMORECVARS";
// Control variables. It is easier if they are each 4 byte aligned, which is why they are u32.
u32 gRecordingStatus = DEMOREC_STATUS_NOT_RECORDING;
u32 gDoneDelay = 0;
u32 gNumOfRecordedInputs = 0;
struct DemoInput gRecordedInputs[DEMOREC_MAX_INPUTS];
struct DemoInput* gRecordedInputsPtr = (struct DemoInput*)gRecordedInputs;
struct DemoInput gRecordedDemoInputCopy;
void record_new_demo_input(void) {
if(gRecordedDemoInput.timer == 1 && gRecordedDemoInputCopy.timer > 0) {
gRecordedInputs[gNumOfRecordedInputs].timer = gRecordedDemoInputCopy.timer;
gRecordedInputs[gNumOfRecordedInputs + 1].timer = 0;
gRecordedInputs[gNumOfRecordedInputs].rawStickX = gRecordedDemoInputCopy.rawStickX;
gRecordedInputs[gNumOfRecordedInputs + 1].rawStickX = gRecordedDemoInputCopy.rawStickX;
gRecordedInputs[gNumOfRecordedInputs].rawStickY = gRecordedDemoInputCopy.rawStickY;
gRecordedInputs[gNumOfRecordedInputs + 1].rawStickY = gRecordedDemoInputCopy.rawStickY;
gRecordedInputs[gNumOfRecordedInputs].button = gRecordedDemoInputCopy.button;
gRecordedInputs[gNumOfRecordedInputs + 1].button = gRecordedDemoInputCopy.button;
gNumOfRecordedInputs++;
}
}
// Self explanitory
void copy_gRecordedDemoInput(void) {
gRecordedDemoInputCopy.timer = gRecordedDemoInput.timer;
gRecordedDemoInputCopy.rawStickX = gRecordedDemoInput.rawStickX;
gRecordedDemoInputCopy.rawStickY = gRecordedDemoInput.rawStickY;
gRecordedDemoInputCopy.button = gRecordedDemoInput.button;
}
// Runs when the demo is recording.
void recording(void) {
// Force-stop when someone makes too many inputs.
if(gNumOfRecordedInputs + 1 > DEMOREC_MAX_INPUTS) {
gRecordingStatus = DEMOREC_STATUS_STOPPING;
return;
}
copy_gRecordedDemoInput();
record_demo(); // Defined in game.c
record_new_demo_input();
}
// Makes sure the last demo input is zeroed out, to make it look more clean.
void record_cleanup(void) {
gRecordedInputs[gNumOfRecordedInputs].timer = 0;
gRecordedInputs[gNumOfRecordedInputs].rawStickX = 0;
gRecordedInputs[gNumOfRecordedInputs].rawStickY = 0;
gRecordedInputs[gNumOfRecordedInputs].button = 0;
// Make sure the done delay is reset before moving to DONE status.
gDoneDelay = 0;
}
void record_run(void) {
switch(gRecordingStatus) {
case DEMOREC_STATUS_NOT_RECORDING:
break;
case DEMOREC_STATUS_PREPARING:
if(gMarioObject != NULL && gCurrLevelNum >= 5) { // If the game is in an active level
gRecordingStatus = DEMOREC_STATUS_RECORDING;
// A bit of a hack, but it works.
gNumOfRecordedInputs = 1;
gRecordedInputs[0].timer = gCurrLevelNum;
gRecordedInputs[0].rawStickX = 0;
gRecordedInputs[0].rawStickY = 0;
gRecordedInputs[0].button = 0;
}
break;
case DEMOREC_STATUS_RECORDING:
recording();
break;
case DEMOREC_STATUS_DONE:
if(gDoneDelay > DEMOREC_DONE_DELAY)
gRecordingStatus = DEMOREC_STATUS_NOT_RECORDING;
else
gDoneDelay++;
break;
}
}
// Prints the status on the bottom-left side of the screen in colorful text.
void print_status(void) {
switch(gRecordingStatus) {
case DEMOREC_STATUS_PREPARING:
print_text(DEMOREC_PRINT_X, DEMOREC_PRINT_Y, "READY");
break;
case DEMOREC_STATUS_RECORDING:
print_text(DEMOREC_PRINT_X, DEMOREC_PRINT_Y, "REC");
break;
case DEMOREC_STATUS_STOPPING:
print_text(DEMOREC_PRINT_X, DEMOREC_PRINT_Y, "WAIT");
break;
case DEMOREC_STATUS_DONE:
print_text(DEMOREC_PRINT_X, DEMOREC_PRINT_Y, "DONE");
break;
}
}
// Main function that should be called from thread5_game_loop()
void recordingDemo(void) {
// Mario needs to enter directly into a level and not from a warp,
// so the debug level select is used for that.
gDebugLevelSelect = TRUE;
if(gPlayer1Controller->buttonPressed & L_TRIG) {
if(gRecordingStatus == DEMOREC_STATUS_NOT_RECORDING) {
gRecordingStatus = DEMOREC_STATUS_PREPARING;
} else if (gRecordingStatus == DEMOREC_STATUS_RECORDING) {
gRecordingStatus = DEMOREC_STATUS_STOPPING;
record_cleanup();
}
}
record_run();
print_status();
}

View file

@ -164,15 +164,17 @@ def main():
assets = todo[key] assets = todo[key]
lang, mio0 = key lang, mio0 = key
if mio0 == "@sound": if mio0 == "@sound":
with tempfile.NamedTemporaryFile(prefix="ctl") as ctl_file: with tempfile.NamedTemporaryFile(prefix="ctl", delete=False) as ctl_file:
with tempfile.NamedTemporaryFile(prefix="tbl") as tbl_file: with tempfile.NamedTemporaryFile(prefix="tbl", delete=False) as tbl_file:
rom = roms[lang] rom = roms[lang]
size, locs = asset_map["@sound ctl " + lang] size, locs = asset_map["@sound ctl " + lang]
offset = locs[lang][0] offset = locs[lang][0]
ctl_file.write(rom[offset : offset + size]) ctl_file.write(rom[offset : offset + size])
ctl_file.close()
size, locs = asset_map["@sound tbl " + lang] size, locs = asset_map["@sound tbl " + lang]
offset = locs[lang][0] offset = locs[lang][0]
tbl_file.write(rom[offset : offset + size]) tbl_file.write(rom[offset : offset + size])
tbl_file.close()
args = [ args = [
"python3", "python3",
"tools/disassemble_sound.py", "tools/disassemble_sound.py",
@ -183,7 +185,11 @@ def main():
for (asset, pos, size, meta) in assets: for (asset, pos, size, meta) in assets:
print("extracting", asset) print("extracting", asset)
args.append(asset + ":" + str(pos)) args.append(asset + ":" + str(pos))
subprocess.run(args, check=True) try:
subprocess.run(args, check=True)
finally:
os.unlink(ctl_file.name)
os.unlink(tbl_file.name)
continue continue
if mio0 is not None: if mio0 is not None:
@ -194,7 +200,7 @@ def main():
"-o", "-o",
str(mio0), str(mio0),
"baserom." + lang + ".z64", "baserom." + lang + ".z64",
"/dev/stdout", "-",
], ],
check=True, check=True,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,

View file

@ -50,6 +50,10 @@ if len(mybin) != len(basebin):
print("Modified ROM has different size...") print("Modified ROM has different size...")
exit(1) exit(1)
if mybin == basebin:
print("No differences!")
exit(0)
def search_map(rom_addr): def search_map(rom_addr):
ram_offset = None ram_offset = None
last_ram = 0 last_ram = 0

View file

@ -35,6 +35,7 @@ extern "C" {
#endif #endif
#include <PR/ultratypes.h> #include <PR/ultratypes.h>
#include <PR/os_thread.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)

View file

@ -1,6 +1,6 @@
#ifndef _ULTRA64_OS_MISC_H_ #ifndef _ULTRA64_OS_MISC_H_
#define _ULTRA64_OS_MISC_H_ #define _ULTRA64_OS_MISC_H_
#include <PR/ultratypes.h>
/* Miscellaneous OS functions */ /* Miscellaneous OS functions */
void osInitialize(void); void osInitialize(void);

View file

@ -5,9 +5,10 @@
/* Types */ /* Types */
typedef struct typedef struct {
{ #ifndef VERSION_EU
u32 errStatus; u32 errStatus;
#endif
void *dramAddr; void *dramAddr;
void *C2Addr; void *C2Addr;
u32 sectorSize; u32 sectorSize;
@ -15,20 +16,21 @@ typedef struct
u32 C1ErrSector[4]; u32 C1ErrSector[4];
} __OSBlockInfo; } __OSBlockInfo;
typedef struct typedef struct {
{ u32 cmdType; // 0
u32 cmdType; u16 transferMode; // 4
u16 transferMode; u16 blockNum; // 6
u16 blockNum; s32 sectorNum; // 8
s32 sectorNum; uintptr_t devAddr; // c
uintptr_t devAddr; #ifdef VERSION_EU
u32 bmCtlShadow; u32 unk10; //error status added moved to blockinfo
u32 seqCtlShadow; #endif
__OSBlockInfo block[2]; u32 bmCtlShadow; // 10
u32 seqCtlShadow; // 14
__OSBlockInfo block[2]; // 18
} __OSTranxInfo; } __OSTranxInfo;
typedef struct OSPiHandle_s typedef struct OSPiHandle_s {
{
struct OSPiHandle_s *next; struct OSPiHandle_s *next;
u8 type; u8 type;
u8 latency; u8 latency;
@ -41,27 +43,26 @@ typedef struct OSPiHandle_s
__OSTranxInfo transferInfo; __OSTranxInfo transferInfo;
} OSPiHandle; } OSPiHandle;
typedef struct typedef struct {
{
u8 type; u8 type;
uintptr_t address; uintptr_t address;
} OSPiInfo; } OSPiInfo;
typedef struct typedef struct {
{
u16 type; u16 type;
u8 pri; u8 pri;
u8 status; u8 status;
OSMesgQueue *retQueue; OSMesgQueue *retQueue;
} OSIoMesgHdr; } OSIoMesgHdr;
typedef struct typedef struct {
{
/*0x00*/ OSIoMesgHdr hdr; /*0x00*/ OSIoMesgHdr hdr;
/*0x08*/ void *dramAddr; /*0x08*/ void *dramAddr;
/*0x0C*/ uintptr_t devAddr; /*0x0C*/ uintptr_t devAddr;
/*0x10*/ size_t size; /*0x10*/ size_t size;
//OSPiHandle *piHandle; //from the official definition #ifdef VERSION_EU
OSPiHandle *piHandle; // from the official definition
#endif
} OSIoMesg; } OSIoMesg;
/* Definitions */ /* Definitions */
@ -74,12 +75,13 @@ typedef struct
/* Functions */ /* Functions */
s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr,
uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *mq); size_t nbytes, OSMesgQueue *mq);
void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt);
s32 cmdMsgCnt);
OSMesgQueue *osPiGetCmdQueue(void); OSMesgQueue *osPiGetCmdQueue(void);
s32 osPiWriteIo(uintptr_t devAddr, u32 data); s32 osPiWriteIo(uintptr_t devAddr, u32 data);
s32 osPiReadIo(uintptr_t devAddr, u32 *data); s32 osPiReadIo(uintptr_t devAddr, u32 *data);
s32 osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size);
s32 osEPiRawStartDma(OSPiHandle *piHandle, s32 dir, u32 cart_addr, void *dram_addr, size_t size);
#endif #endif

View file

@ -1,6 +1,6 @@
#ifndef _ULTRA64_THREAD_H_ #ifndef _ULTRA64_THREAD_H_
#define _ULTRA64_THREAD_H_ #define _ULTRA64_THREAD_H_
#include "ultratypes.h"
/* Recommended priorities for system threads */ /* Recommended priorities for system threads */
#define OS_PRIORITY_MAX 255 #define OS_PRIORITY_MAX 255
#define OS_PRIORITY_VIMGR 254 #define OS_PRIORITY_VIMGR 254

View file

@ -254,6 +254,8 @@
#define SOUND_GENERAL_BOWSER_BOMB_EXPLOSION SOUND_ARG_LOAD(3, 1, 0x2F, 0x00, 8) #define SOUND_GENERAL_BOWSER_BOMB_EXPLOSION SOUND_ARG_LOAD(3, 1, 0x2F, 0x00, 8)
/* not verified */ #define SOUND_GENERAL_COIN_SPURT SOUND_ARG_LOAD(3, 0, 0x30, 0x00, 8) /* not verified */ #define SOUND_GENERAL_COIN_SPURT SOUND_ARG_LOAD(3, 0, 0x30, 0x00, 8)
/* not verified */ #define SOUND_GENERAL_COIN_SPURT_2 SOUND_ARG_LOAD(3, 8, 0x30, 0x00, 8) /* not verified */ #define SOUND_GENERAL_COIN_SPURT_2 SOUND_ARG_LOAD(3, 8, 0x30, 0x00, 8)
/* not verified */ #define SOUND_GENERAL_COIN_SPURT_EU SOUND_ARG_LOAD(3, 8, 0x30, 0x20, 8)
/* not verified */ #define SOUND_GENERAL_EXPLOSION6 0x3031 /* not verified */ #define SOUND_GENERAL_EXPLOSION6 0x3031
/* not verified */ #define SOUND_GENERAL_UNK32 0x3032 /* not verified */ #define SOUND_GENERAL_UNK32 0x3032
/* not verified */ #define SOUND_GENERAL_BOAT_TILT1 SOUND_ARG_LOAD(3, 0, 0x34, 0x40, 8) /* not verified */ #define SOUND_GENERAL_BOAT_TILT1 SOUND_ARG_LOAD(3, 0, 0x34, 0x40, 8)

View file

@ -246,8 +246,8 @@ extern const BehaviorScript bhvOpenableCageDoor[];
extern const BehaviorScript bhvOpenableGrill[]; extern const BehaviorScript bhvOpenableGrill[];
extern const BehaviorScript bhvWaterLevelDiamond[]; extern const BehaviorScript bhvWaterLevelDiamond[];
extern const BehaviorScript bhvInitializeChangingWaterLevel[]; extern const BehaviorScript bhvInitializeChangingWaterLevel[];
extern const BehaviorScript bhvTornadoSandParticle[]; extern const BehaviorScript bhvTweesterSandParticle[];
extern const BehaviorScript bhvTornado[]; extern const BehaviorScript bhvTweester[];
extern const BehaviorScript bhvMerryGoRoundBooManager[]; extern const BehaviorScript bhvMerryGoRoundBooManager[];
extern const BehaviorScript bhvPlaysMusicTrackWhenTouched[]; extern const BehaviorScript bhvPlaysMusicTrackWhenTouched[];
extern const BehaviorScript bhvAnimatedTexture[]; extern const BehaviorScript bhvAnimatedTexture[];
@ -524,7 +524,7 @@ extern const BehaviorScript bhvBird[];
extern const BehaviorScript bhvRacingPenguin[]; extern const BehaviorScript bhvRacingPenguin[];
extern const BehaviorScript bhvPenguinRaceFinishLine[]; extern const BehaviorScript bhvPenguinRaceFinishLine[];
extern const BehaviorScript bhvPenguinRaceShortcutCheck[]; extern const BehaviorScript bhvPenguinRaceShortcutCheck[];
extern const BehaviorScript bhvCoffinManager[]; extern const BehaviorScript bhvCoffinSpawner[];
extern const BehaviorScript bhvCoffin[]; extern const BehaviorScript bhvCoffin[];
extern const BehaviorScript bhvClamShell[]; extern const BehaviorScript bhvClamShell[];
extern const BehaviorScript bhvSkeeter[]; extern const BehaviorScript bhvSkeeter[];

View file

@ -19,7 +19,7 @@
/// player exits their activation radius. /// player exits their activation radius.
#define BUGFIX_PIRANHA_PLANT_STATE_RESET (0 || VERSION_US || VERSION_EU) #define BUGFIX_PIRANHA_PLANT_STATE_RESET (0 || VERSION_US || VERSION_EU)
/// Fixes bug where sleeping Piranha Plants damage players that bump into them /// Fixes bug where sleeping Piranha Plants damage players that bump into them
#define BUGFIX_PIRANHA_PLANT_SLEEP_DAMAGE (0 || VERSION_US || VERSION_EU) #define BUGFIX_PIRANHA_PLANT_SLEEP_DAMAGE (0 || VERSION_US)
/// Fixes bug where it shows a star when you grab a key in bowser battle stages /// Fixes bug where it shows a star when you grab a key in bowser battle stages
#define BUGFIX_STAR_BOWSER_KEY (0 || VERSION_US || VERSION_EU) #define BUGFIX_STAR_BOWSER_KEY (0 || VERSION_US || VERSION_EU)
@ -28,6 +28,10 @@
#define SCREEN_HEIGHT 240 #define SCREEN_HEIGHT 240
// Border Height Define for NTSC Versions // Border Height Define for NTSC Versions
#ifndef VERSION_EU
#define BORDER_HEIGHT 8 #define BORDER_HEIGHT 8
#else
#define BORDER_HEIGHT 1
#endif
#endif #endif

View file

@ -151,7 +151,7 @@ struct MacroPreset MacroObjectPresets[] = {
{bhvYellowCoin, MODEL_YELLOW_COIN, 0}, {bhvYellowCoin, MODEL_YELLOW_COIN, 0},
{bhvYellowCoin, MODEL_YELLOW_COIN, 0}, {bhvYellowCoin, MODEL_YELLOW_COIN, 0},
{bhvStaticObject, MODEL_KLEPTO, 0}, // unused {bhvStaticObject, MODEL_KLEPTO, 0}, // unused
{bhvTornado, MODEL_TORNADO, 0}, // unused {bhvTweester, MODEL_TWEESTER, 0}, // unused
{bhvPokey, MODEL_NONE, 0}, {bhvPokey, MODEL_NONE, 0},
{bhvPokey, MODEL_NONE, 0}, // unused {bhvPokey, MODEL_NONE, 0}, // unused
{bhvToxBox, MODEL_SSL_TOX_BOX, 0}, // unused {bhvToxBox, MODEL_SSL_TOX_BOX, 0}, // unused

View file

@ -360,7 +360,7 @@
// group 5 // group 5
#define MODEL_POKEY_HEAD 0x54 // pokey_head_geo #define MODEL_POKEY_HEAD 0x54 // pokey_head_geo
#define MODEL_POKEY_BODY_PART 0x55 // pokey_body_part_geo #define MODEL_POKEY_BODY_PART 0x55 // pokey_body_part_geo
#define MODEL_TORNADO 0x56 // tornado_seg5_geo_05014630 #define MODEL_TWEESTER 0x56 // tweester_geo
#define MODEL_KLEPTO 0x57 // klepto_geo #define MODEL_KLEPTO 0x57 // klepto_geo
#define MODEL_EYEROK_LEFT_HAND 0x58 // eyerok_left_hand_geo #define MODEL_EYEROK_LEFT_HAND 0x58 // eyerok_left_hand_geo
#define MODEL_EYEROK_RIGHT_HAND 0x59 // eyerok_right_hand_geo #define MODEL_EYEROK_RIGHT_HAND 0x59 // eyerok_right_hand_geo

View file

@ -382,6 +382,18 @@
#define BBH_DYNAMIC_SURFACE_ROOM 0 #define BBH_DYNAMIC_SURFACE_ROOM 0
#define BBH_OUTSIDE_ROOM 13 #define BBH_OUTSIDE_ROOM 13
/* Coffin Spawner */
/* oAction */
#define COFFIN_SPAWNER_ACT_COFFINS_UNLOADED 0
/* Coffin */
/* oAction */
#define COFFIN_ACT_IDLE 0
#define COFFIN_ACT_STAND_UP 1
/* oBehParams2ndByte */
#define COFFIN_BP_STATIC 0
/* WDW Arrow Lift */ /* WDW Arrow Lift */
/* oAction */ /* oAction */
#define ARROW_LIFT_ACT_IDLE 0 #define ARROW_LIFT_ACT_IDLE 0
@ -853,6 +865,17 @@
#define SKEETER_ACT_LUNGE 1 #define SKEETER_ACT_LUNGE 1
#define SKEETER_ACT_WALK 2 #define SKEETER_ACT_WALK 2
/* Tweester */
/* oAction */
#define TWEESTER_ACT_IDLE 0
#define TWEESTER_ACT_CHASE 1
#define TWEESTER_ACT_HIDE 2
/* oSubAction */
#define TWEESTER_SUB_ACT_WAIT 0
#define TWEESTER_SUB_ACT_CHASE 0
/* Triplet butterfly */ /* Triplet butterfly */
/* oAction */ /* oAction */
#define TRIPLET_BUTTERFLY_ACT_INIT 0 #define TRIPLET_BUTTERFLY_ACT_INIT 0

View file

@ -132,7 +132,7 @@
#define /*0x1B4*/ oWallAngle OBJECT_FIELD_U32(0x4B) #define /*0x1B4*/ oWallAngle OBJECT_FIELD_U32(0x4B)
#define /*0x1B8*/ oFloorType OBJECT_FIELD_S16(0x4C, 0) #define /*0x1B8*/ oFloorType OBJECT_FIELD_S16(0x4C, 0)
#define /*0x1BA*/ oFloorRoom OBJECT_FIELD_S16(0x4C, 1) #define /*0x1BA*/ oFloorRoom OBJECT_FIELD_S16(0x4C, 1)
#define /*0x1BC*/ oUnk1BC OBJECT_FIELD_S32(0x4D) #define /*0x1BC*/ oAngleToHome OBJECT_FIELD_S32(0x4D)
#define /*0x1C0*/ oFloor OBJECT_FIELD_SURFACE(0x4E) #define /*0x1C0*/ oFloor OBJECT_FIELD_SURFACE(0x4E)
#define /*0x1C4*/ oDeathSound OBJECT_FIELD_S32(0x4F) #define /*0x1C4*/ oDeathSound OBJECT_FIELD_S32(0x4F)
@ -1042,8 +1042,8 @@
#define /*0x0F4*/ oTumblingBridgeUnkF4 OBJECT_FIELD_S32(0x1B) #define /*0x0F4*/ oTumblingBridgeUnkF4 OBJECT_FIELD_S32(0x1B)
/* Tweester */ /* Tweester */
#define /*0x0F4*/ oTweesterUnkF4 OBJECT_FIELD_S32(0x1B) #define /*0x0F4*/ oTweesterScaleTimer OBJECT_FIELD_S32(0x1B)
#define /*0x0F8*/ oTweesterUnkF8 OBJECT_FIELD_S32(0x1C) #define /*0x0F8*/ oTweesterUnused OBJECT_FIELD_S32(0x1C)
/* Ukiki */ /* Ukiki */
#define /*0x0F4*/ oUkikiTauntCounter OBJECT_FIELD_S16(0x1B, 0) #define /*0x0F4*/ oUkikiTauntCounter OBJECT_FIELD_S16(0x1B, 0)

View file

@ -15,14 +15,23 @@
#define SEG_POOL_START 0x8005C000 #define SEG_POOL_START 0x8005C000
#define SEG_POOL_END SEG_BUFFERS #define SEG_POOL_END SEG_BUFFERS
#define SEG_GODDARD 0x8016F000 #define SEG_GODDARD 0x8016F000
#define SEG_BUFFERS 0x801C1000 #define SEG_BUFFERS 0x801C1000
#ifdef VERSION_EU #ifdef VERSION_EU
#define SEG_MAIN 0x80241800 // TODO: Investigate why it's different? #define SEG_MAIN 0x80241800 // TODO: Investigate why it's different?
#else #else
#define SEG_MAIN 0x80246000 #define SEG_MAIN 0x80246000
#endif #endif
#ifdef VERSION_EU
#define SEG_ENGINE 0x8036FF00
#else
#define SEG_ENGINE 0x80378800 #define SEG_ENGINE 0x80378800
#endif
#define SEG_FRAMEBUFFERS 0x8038F800 #define SEG_FRAMEBUFFERS 0x8038F800
#else /* Use Expansion Pak space for pool. */ #else /* Use Expansion Pak space for pool. */

View file

@ -164,8 +164,8 @@
#define ACT_FLAG_CONTROL_JUMP_HEIGHT /* 0x02000000 */ (1 << 25) #define ACT_FLAG_CONTROL_JUMP_HEIGHT /* 0x02000000 */ (1 << 25)
#define ACT_FLAG_ALLOW_FIRST_PERSON /* 0x04000000 */ (1 << 26) #define ACT_FLAG_ALLOW_FIRST_PERSON /* 0x04000000 */ (1 << 26)
#define ACT_FLAG_PAUSE_EXIT /* 0x08000000 */ (1 << 27) #define ACT_FLAG_PAUSE_EXIT /* 0x08000000 */ (1 << 27)
#define ACT_FLAG_SWIMMING_OR_FLYING /* 0x10000000 */ (1 << 28) // not checked by game #define ACT_FLAG_SWIMMING_OR_FLYING /* 0x10000000 */ (1 << 28)
#define ACT_FLAG_WATER_OR_TEXT /* 0x20000000 */ (1 << 29) // not checked by game #define ACT_FLAG_WATER_OR_TEXT /* 0x20000000 */ (1 << 29)
#define ACT_FLAG_THROWING /* 0x80000000 */ (1 << 31) #define ACT_FLAG_THROWING /* 0x80000000 */ (1 << 31)
#define ACT_UNINITIALIZED 0x00000000 // (0x000) #define ACT_UNINITIALIZED 0x00000000 // (0x000)

View file

@ -226,6 +226,102 @@
#ifdef VERSION_EU #ifdef VERSION_EU
/**
* File Select Text
*/
#define TEXT_RETURN_FR _("RETOUR")
#define TEXT_RETURN_DE _("ZURÜCK")
#define TEXT_CHECK_SCORE_FR _("SCORE")
#define TEXT_CHECK_SCORE_DE _("LEISTUNG")
#define TEXT_COPY_FILE_FR _("COPIER")
#define TEXT_COPY_FILE_DE _("KOPIEREN")
#define TEXT_ERASE_FILE_FR _("EFFACER")
#define TEXT_ERASE_FILE_DE _("LÖSCHEN")
#define TEXT_SELECT_FILE_FR _("CHOISIR FICHIER")
#define TEXT_SELECT_FILE_DE _("WwHLE SPIEL")
#define TEXT_SCORE_FR _("SCORE")
#define TEXT_SCORE_DE _("LEISTUNG")
#define TEXT_COPY_FR _("COPIER")
#define TEXT_COPY_DE _("KOPIEREN")
#define TEXT_ERASE_FR _("EFFACER")
#define TEXT_ERASE_DE _("LÖSCHEN")
#define TEXT_OPTION _("OPTION") // new in EU
#define TEXT_OPTION_FR _("OPTION")
#define TEXT_OPTION_DE _("OPTIONEN")
#define TEXT_CHECK_FILE_FR _("VOIR SCORE")
#define TEXT_CHECK_FILE_DE _("VON WELCHEM SPIEL")
#define TEXT_NO_SAVED_DATA_EXISTS_FR _("AUCUNE SAUVEGARDE DISPONIBLE")
#define TEXT_NO_SAVED_DATA_EXISTS_DE _("KEIN SPIEL VORHANDEN")
#define TEXT_COPY_FILE_BUTTON_FR _("COPIER FICHIER")
#define TEXT_COPY_FILE_BUTTON_DE _("SPIEL KOPIEREN")
#define TEXT_COPY_IT_TO_WHERE_FR _("COPIER SUR?")
#define TEXT_COPY_IT_TO_WHERE_DE _("WOHIN KOPIEREN?")
#define TEXT_COPYING_COMPLETED_FR _("COPIE ACHEVEÉ")
#define TEXT_COPYING_COMPLETED_DE _("SPIEL KOPIERT")
#define TEXT_SAVED_DATA_EXISTS_FR _("SAVEGARDE EXISTANTE")
#define TEXT_SAVED_DATA_EXISTS_DE _("BEREITS BELEGT")
#define TEXT_NO_FILE_TO_COPY_FROM_FR _("AUCUN FICHIER VIDE")
#define TEXT_NO_FILE_TO_COPY_FROM_DE _("KEIN PLATZ VORHANDEN")
#define TEXT_YES_FR _("OUI")
#define TEXT_YES_DE _("JA")
#define TEXT_NO_FR _("NON")
#define TEXT_NO_DE _("NEIN")
#define TEXT_ERASE_FILE_BUTTON_FR _("EFFACER FICHIER")
#define TEXT_ERASE_FILE_BUTTON_DE _("SPIEL LxSCHEN")
#define TEXT_SURE_FR _("OK?")
#define TEXT_SURE_DE _("SICHER?")
#define TEXT_FILE_MARIO_A_JUST_ERASED_FR _("MARIO A EFFACÉ")
#define TEXT_FILE_MARIO_A_JUST_ERASED_DE _("MARIO A GELÖSCHT")
#define TEXT_SOUND_SELECT_FR _("SON")
#define TEXT_SOUND_SELECT_DE _("SOUND")
#define TEXT_LANGUAGE_SELECT _("LANGUAGE SELECT") // new in EU
#define TEXT_LANGUAGE_SELECT_FR _("SELECTION LANGUE")
#define TEXT_LANGUAGE_SELECT_DE _("WwHLE SPRACHE")
#define TEXT_STEREO_FR _("STÉRÉO")
#define TEXT_MONO_FR _("MONO")
#define TEXT_HEADSET_FR _("CASQUE")
#define TEXT_STEREO_DE _("STEREO")
#define TEXT_MONO_DE _("MONO")
#define TEXT_HEADSET_DE _("PHONES")
#define TEXT_ENGLISH _("ENGLISH")
#define TEXT_FRENCH _("FRANÇAIS")
#define TEXT_GERMAN _("DEUTSCH")
#define TEXT_HI_SCORE_FR _("MEILLEUR SCORE")
#define TEXT_HI_SCORE_DE _("BESTLEISTUNG")
#define TEXT_MY_SCORE_FR _("MON SCORE")
#define TEXT_MY_SCORE_DE _("LEISTUNG")
#define TEXT_NEW_FR _("VIDE")
#define TEXT_NEW_DE _("FREI")
/** /**
* Menus Text (Pause, Course Completed) * Menus Text (Pause, Course Completed)
*/ */
@ -291,6 +387,89 @@
#define TEXT_LETS_HAVE_CAKE_DE _("Laßt uns einen leckeren Kuchen backen...") #define TEXT_LETS_HAVE_CAKE_DE _("Laßt uns einen leckeren Kuchen backen...")
#define TEXT_FOR_MARIO_DE _("...für Mario...") #define TEXT_FOR_MARIO_DE _("...für Mario...")
/**
* Course Table names for Score Menu Save view
*/
#define TEXT_MENU_BOB _(" 1 BOB-OMB BATTLEFIELD")
#define TEXT_MENU_WF _(" 2 WHOMP'S FORTRESS")
#define TEXT_MENU_JRB _(" 3 JOLLY ROGER BAY")
#define TEXT_MENU_CCM _(" 4 COOL, COOL MOUNTAIN")
#define TEXT_MENU_BBH _(" 5 BIG BOO'S HAUNT")
#define TEXT_MENU_HMC _(" 6 HAZY MAZE CAVE")
#define TEXT_MENU_LLL _(" 7 LETHAL LAVA LAND")
#define TEXT_MENU_SSL _(" 8 SHIFTING SAND LAND")
#define TEXT_MENU_DDD _(" 9 DIRE, DIRE DOCKS")
#define TEXT_MENU_SL _("10 SNOWMAN'S LAND")
#define TEXT_MENU_WDW _("11 WET-DRY WORLD")
#define TEXT_MENU_TTM _("12 TALL, TALL MOUNTAIN")
#define TEXT_MENU_THI _("13 TINY-HUGE ISLAND")
#define TEXT_MENU_TTC _("14 TICK TOCK CLOCK")
#define TEXT_MENU_RR _("15 RAINBOW RIDE")
#define TEXT_MENU_BITDW _(" BOWSER IN THE DARK WORLD")
#define TEXT_MENU_BITFS _(" BOWSER IN THE FIRE SEA")
#define TEXT_MENU_BITS _(" BOWSER IN THE SKY")
#define TEXT_MENU_PSS _(" THE PRINCESS'S SECRET SLIDE")
#define TEXT_MENU_COTMC _(" CAVERN OF THE METAL CAP")
#define TEXT_MENU_TOTWC _(" TOWER OF THE WING CAP")
#define TEXT_MENU_VCUTM _(" VANISH CAP UNDER THE MOAT")
#define TEXT_MENU_WMOTR _(" WING MARIO OVER THE RAINBOW")
#define TEXT_MENU_SA _(" THE SECRET AQUARIUM")
#define TEXT_MENU_NONE _("")
#define TEXT_MENU_STARS _(" CASTLE SECRET STARS")
#define TEXT_MENU_BOB_FR _(" 1 BATAILLE DE BOB-OMB")
#define TEXT_MENU_WF_FR _(" 2 FORTERESSE DE WHOMP")
#define TEXT_MENU_JRB_FR _(" 3 BAIE DES PIRATES")
#define TEXT_MENU_CCM_FR _(" 4 MONTAGNE GLA-GLA")
#define TEXT_MENU_BBH_FR _(" 5 MANOIR DE BIG BOO")
#define TEXT_MENU_HMC_FR _(" 6 CAVERNE BRUMEUSE")
#define TEXT_MENU_LLL_FR _(" 7 LAVES FATALES")
#define TEXT_MENU_SSL_FR _(" 8 SABLES TROP MOUVANTS")
#define TEXT_MENU_DDD_FR _(" 9 AFFREUX BASSIN")
#define TEXT_MENU_SL_FR _("10 CHEZ LE ROI DES NEIGES")
#define TEXT_MENU_WDW_FR _("11 MONDE TREMPE-SECHE")
#define TEXT_MENU_TTM_FR _("12 TROP HAUTE MONTAGNE")
#define TEXT_MENU_THI_FR _("13 ILE GRANDS-PETITS")
#define TEXT_MENU_TTC_FR _("14 HORLOGE TIC-TAC")
#define TEXT_MENU_RR_FR _("15 COURSE ARC-EN-CIEL")
#define TEXT_MENU_BITDW_FR _(" BOWSER DES TENEBRES")
#define TEXT_MENU_BITFS_FR _(" BOWSER DES LAVES")
#define TEXT_MENU_BITS_FR _(" BOWSER DES CIEUX")
#define TEXT_MENU_PSS_FR _(" GLISSADE DE LA PRINCESSE")
#define TEXT_MENU_COTMC_FR _(" MINE DES CASQUETTES-METAL")
#define TEXT_MENU_TOTWC_FR _(" INTERRUPTEUR DE LA TOUR AILEE")
#define TEXT_MENU_VCUTM_FR _(" INVISIBLE SOUS LES DOUVES")
#define TEXT_MENU_WMOTR_FR _(" AU-DELA DE L'ARC-EN-CIEL")
#define TEXT_MENU_SA_FR _(" AQUARIUM SECRET")
#define TEXT_MENU_NONE_FR _("")
#define TEXT_MENU_STARS_FR _(" ETOILES SECRETES")
#define TEXT_MENU_BOB_DE _(" 1 BOB-OMBS BOMBENBERG")
#define TEXT_MENU_WF_DE _(" 2 WUMMPS WUCHTWALL")
#define TEXT_MENU_JRB_DE _(" 3 PIRATENBUCHT PANIK")
#define TEXT_MENU_CCM_DE _(" 4 BIBBERBERG BOB")
#define TEXT_MENU_BBH_DE _(" 5 BIG BOOS BURG")
#define TEXT_MENU_HMC_DE _(" 6 GRÜNE GIFTGROTTE")
#define TEXT_MENU_LLL_DE _(" 7 LAVA LAGUNE")
#define TEXT_MENU_SSL_DE _(" 8 WOBIWABA WÜSTE")
#define TEXT_MENU_DDD_DE _(" 9 WILDE WASSERWERFT")
#define TEXT_MENU_SL_DE _("10 FROSTBEULEN FRUST")
#define TEXT_MENU_WDW_DE _("11 ATLANTIS AQUARIA")
#define TEXT_MENU_TTM_DE _("12 FLIEGENPILZ FIASKO")
#define TEXT_MENU_THI_DE _("13 GULLIVER GUMBA")
#define TEXT_MENU_TTC_DE _("14 TICK TACK TRAUMA")
#define TEXT_MENU_RR_DE _("15 REGENBOGEN RASEREI")
#define TEXT_MENU_BITDW_DE _(" BOWSERS SCHATTENWELT")
#define TEXT_MENU_BITFS_DE _(" BOWSERS LAVASEE")
#define TEXT_MENU_BITS_DE _(" BOWSERS LUFTSCHLOSS")
#define TEXT_MENU_PSS_DE _(" TOADSTOOLS RUTSCHBAHN")
#define TEXT_MENU_COTMC_DE _(" GRÜNER SCHALTERPALAST")
#define TEXT_MENU_TOTWC_DE _(" ROTER SCHALTERPALAST")
#define TEXT_MENU_VCUTM_DE _(" BLAUER SCHALTERPALAST")
#define TEXT_MENU_WMOTR_DE _(" REGENBOGEN FEUERWERK")
#define TEXT_MENU_SA_DE _(" VERSTECKTES AQUARIUM")
#define TEXT_MENU_NONE_DE _("")
#define TEXT_MENU_STARS_DE _(" GEHEIME STERNE")
#endif #endif
#endif #endif

View file

@ -7,6 +7,18 @@
#include <ultra64.h> #include <ultra64.h>
#include "macros.h" #include "macros.h"
// Certain functions are marked as having return values, but do not
// actually return a value. This causes undefined behavior, which we'd rather
// avoid on modern GCC. This only impacts -O2 and can matter for both the function
// itself and functions that call it.
#ifdef AVOID_UB
#define BAD_RETURN(cmd) void
#else
#define BAD_RETURN(cmd) cmd
#endif
struct Controller struct Controller
{ {
/*0x00*/ s16 rawStickX; // /*0x00*/ s16 rawStickX; //
@ -233,16 +245,16 @@ struct Surface
struct MarioBodyState struct MarioBodyState
{ {
/*0x00*/ u32 action; /*0x00*/ u32 action;
/*0x04*/ s8 capState; /*0x04*/ s8 capState; /// see MarioCapGSCId
/*0x05*/ s8 eyeState; /*0x05*/ s8 eyeState;
/*0x06*/ s8 handState; /*0x06*/ s8 handState;
/*0x07*/ s8 unk07; /*0x07*/ s8 wingFlutter; /// whether Mario's wing cap wings are fluttering
/*0x08*/ s16 modelState; /*0x08*/ s16 modelState;
/*0x0A*/ s8 grabPos; /*0x0A*/ s8 grabPos;
/*0x0B*/ u8 unk0B; /*0x0B*/ u8 punchState; /// 2 bits for type of punch, 6 bits for punch animation timer
/*0x0C*/ Vec3s unkC; /*0x0C*/ Vec3s torsoAngle;
/*0x12*/ Vec3s unk12; /*0x12*/ Vec3s headAngle;
/*0x18*/ Vec3f unk18; /*0x18*/ Vec3f heldObjLastPosition; /// also known as HOLP
u8 padding[4]; u8 padding[4];
}; };

View file

@ -33,7 +33,7 @@ static const LevelScript script_func_local_2[] = {
OBJECT(/*model*/ MODEL_BBH_MOVING_BOOKSHELF, /*pos*/ -1994, 819, 213, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvHauntedBookshelf), OBJECT(/*model*/ MODEL_BBH_MOVING_BOOKSHELF, /*pos*/ -1994, 819, 213, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvHauntedBookshelf),
OBJECT(/*model*/ MODEL_BBH_MESH_ELEVATOR, /*pos*/ -2985, -205, 5400, /*angle*/ 0, -45, 0, /*behParam*/ 0x00000000, /*beh*/ bhvMeshElevator), OBJECT(/*model*/ MODEL_BBH_MESH_ELEVATOR, /*pos*/ -2985, -205, 5400, /*angle*/ 0, -45, 0, /*behParam*/ 0x00000000, /*beh*/ bhvMeshElevator),
OBJECT(/*model*/ MODEL_BBH_MERRY_GO_ROUND, /*pos*/ -205, -2560, 205, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvMerryGoRound), OBJECT(/*model*/ MODEL_BBH_MERRY_GO_ROUND, /*pos*/ -205, -2560, 205, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvMerryGoRound),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 2200, 819, -800, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvCoffinManager), OBJECT(/*model*/ MODEL_NONE, /*pos*/ 2200, 819, -800, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvCoffinSpawner),
RETURN(), RETURN(),
}; };

View file

@ -19,6 +19,9 @@ const GeoLayout ending_geo_000050[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_NODE_ORTHO(100), GEO_NODE_ORTHO(100),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
#ifdef VERSION_EU
GEO_BACKGROUND_COLOR(0x0001),
#endif
GEO_ASM(0, geo_exec_cake_end_screen), GEO_ASM(0, geo_exec_cake_end_screen),
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),

View file

@ -57,7 +57,7 @@ const GeoLayout intro_geo_00035C[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_CAMERA_FRUSTUM(45, 128, 16384), GEO_CAMERA_FRUSTUM(45, 128, 16384),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(2, Geo18_802764B0), GEO_ASM(2, geo_draw_mario_head_goddard),
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
@ -79,7 +79,7 @@ const GeoLayout intro_geo_0003B8[] = {
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_CAMERA_FRUSTUM(45, 128, 16384), GEO_CAMERA_FRUSTUM(45, 128, 16384),
GEO_OPEN_NODE(), GEO_OPEN_NODE(),
GEO_ASM(3, Geo18_802764B0), GEO_ASM(3, geo_draw_mario_head_goddard),
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(), GEO_CLOSE_NODE(),

View file

@ -39,6 +39,11 @@ extern const Gfx dl_menu_texture_course_upper[];
extern const Gfx dl_menu_texture_niveau_upper[]; extern const Gfx dl_menu_texture_niveau_upper[];
extern const Gfx dl_menu_texture_kurs_upper[]; extern const Gfx dl_menu_texture_kurs_upper[];
extern const Collision main_menu_seg7_collision[]; extern const Collision main_menu_seg7_collision[];
#ifdef VERSION_EU
extern const u8 eu_course_strings_en_table[];
extern const u8 eu_course_strings_fr_table[];
extern const u8 eu_course_strings_de_table[];
#endif
// script // script
extern const LevelScript level_main_menu_entry_1[]; extern const LevelScript level_main_menu_entry_1[];

View file

@ -6,7 +6,9 @@
#include "macro_preset_names.h" #include "macro_preset_names.h"
#include "special_preset_names.h" #include "special_preset_names.h"
#include "textures.h" #include "textures.h"
#ifdef VERSION_EU
#include "text_strings.h"
#endif
#include "make_const_nonconst.h" #include "make_const_nonconst.h"
// 0x07000000 - 0x07000018 // 0x07000000 - 0x07000018
@ -1777,6 +1779,8 @@ const Gfx dl_menu_rgba16_wood_course[] = {
gsDPSetRenderMode(G_RM_AA_TEX_EDGE, G_RM_AA_TEX_EDGE2), gsDPSetRenderMode(G_RM_AA_TEX_EDGE, G_RM_AA_TEX_EDGE2),
#ifdef VERSION_EU #ifdef VERSION_EU
gsSPEndDisplayList(), gsSPEndDisplayList(),
};
const Gfx dl_menu_rgba16_wood_course_end[] = {
#else #else
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, texture_menu_course_upper), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, texture_menu_course_upper),
#endif #endif
@ -1835,3 +1839,23 @@ const Collision main_menu_seg7_collision[] = {
COL_TRI_STOP(), COL_TRI_STOP(),
COL_END(), COL_END(),
}; };
#ifdef VERSION_EU
// Duplicate course name tables; the main menu needs all languages loaded at
// once since it switches language, so the copies in segment 19 aren't good
// enough.
#define COURSE_TABLE eu_course_strings_en_table
#include "text/us/define_courses.inc.c"
#undef COURSE_TABLE
#define COURSE_TABLE eu_course_strings_fr_table
#include "text/fr/define_courses.inc.c"
#undef COURSE_TABLE
#define COURSE_TABLE eu_course_strings_de_table
#include "text/de/define_courses.inc.c"
#undef COURSE_TABLE
#endif

View file

@ -230,7 +230,7 @@ const LevelScript script_func_global_5[] = {
const LevelScript script_func_global_6[] = { const LevelScript script_func_global_6[] = {
LOAD_MODEL_FROM_GEO(MODEL_POKEY_HEAD, pokey_head_geo), LOAD_MODEL_FROM_GEO(MODEL_POKEY_HEAD, pokey_head_geo),
LOAD_MODEL_FROM_GEO(MODEL_POKEY_BODY_PART, pokey_body_part_geo), LOAD_MODEL_FROM_GEO(MODEL_POKEY_BODY_PART, pokey_body_part_geo),
LOAD_MODEL_FROM_GEO(MODEL_TORNADO, tornado_seg5_geo_05014630), LOAD_MODEL_FROM_GEO(MODEL_TWEESTER, tweester_geo),
LOAD_MODEL_FROM_GEO(MODEL_KLEPTO, klepto_geo), LOAD_MODEL_FROM_GEO(MODEL_KLEPTO, klepto_geo),
LOAD_MODEL_FROM_GEO(MODEL_EYEROK_LEFT_HAND, eyerok_left_hand_geo), LOAD_MODEL_FROM_GEO(MODEL_EYEROK_LEFT_HAND, eyerok_left_hand_geo),
LOAD_MODEL_FROM_GEO(MODEL_EYEROK_RIGHT_HAND, eyerok_right_hand_geo), LOAD_MODEL_FROM_GEO(MODEL_EYEROK_RIGHT_HAND, eyerok_right_hand_geo),

View file

@ -15,6 +15,7 @@
#include "make_const_nonconst.h" #include "make_const_nonconst.h"
#include "levels/sl/header.h" #include "levels/sl/header.h"
static const LevelScript script_func_local_1[] = { static const LevelScript script_func_local_1[] = {
OBJECT_WITH_ACTS(/*model*/ MODEL_STAR, /*pos*/ 700, 4500, 690, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvStar, /*acts*/ ALL_ACTS), OBJECT_WITH_ACTS(/*model*/ MODEL_STAR, /*pos*/ 700, 4500, 690, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvStar, /*acts*/ ALL_ACTS),
OBJECT_WITH_ACTS(/*model*/ MODEL_STAR, /*pos*/ 4350, 1350, 4350, /*angle*/ 0, 0, 0, /*behParam*/ 0x02000000, /*beh*/ bhvStar, /*acts*/ ALL_ACTS), OBJECT_WITH_ACTS(/*model*/ MODEL_STAR, /*pos*/ 4350, 1350, 4350, /*angle*/ 0, 0, 0, /*behParam*/ 0x02000000, /*beh*/ bhvStar, /*acts*/ ALL_ACTS),

View file

@ -24,11 +24,11 @@ static const LevelScript script_func_local_2[] = {
OBJECT(/*model*/ MODEL_SSL_TOX_BOX, /*pos*/ -1284, 0, -5895, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvToxBox), OBJECT(/*model*/ MODEL_SSL_TOX_BOX, /*pos*/ -1284, 0, -5895, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvToxBox),
OBJECT(/*model*/ MODEL_SSL_TOX_BOX, /*pos*/ 1283, 0, -4865, /*angle*/ 0, 0, 0, /*behParam*/ 0x00010000, /*beh*/ bhvToxBox), OBJECT(/*model*/ MODEL_SSL_TOX_BOX, /*pos*/ 1283, 0, -4865, /*angle*/ 0, 0, 0, /*behParam*/ 0x00010000, /*beh*/ bhvToxBox),
OBJECT(/*model*/ MODEL_SSL_TOX_BOX, /*pos*/ 4873, 0, -3335, /*angle*/ 0, 0, 0, /*behParam*/ 0x00020000, /*beh*/ bhvToxBox), OBJECT(/*model*/ MODEL_SSL_TOX_BOX, /*pos*/ 4873, 0, -3335, /*angle*/ 0, 0, 0, /*behParam*/ 0x00020000, /*beh*/ bhvToxBox),
OBJECT(/*model*/ MODEL_TORNADO, /*pos*/ -3600, -200, 2940, /*angle*/ 0, 0, 0, /*behParam*/ 0x00120000, /*beh*/ bhvTornado), OBJECT(/*model*/ MODEL_TWEESTER, /*pos*/ -3600, -200, 2940, /*angle*/ 0, 0, 0, /*behParam*/ 0x00120000, /*beh*/ bhvTweester),
OBJECT_WITH_ACTS(/*model*/ MODEL_TORNADO, /*pos*/ 1017, -200, 3832, /*angle*/ 0, 0, 0, /*behParam*/ 0x00190000, /*beh*/ bhvTornado, /*acts*/ ACT_4 | ACT_5 | ACT_6), OBJECT_WITH_ACTS(/*model*/ MODEL_TWEESTER, /*pos*/ 1017, -200, 3832, /*angle*/ 0, 0, 0, /*behParam*/ 0x00190000, /*beh*/ bhvTweester, /*acts*/ ACT_4 | ACT_5 | ACT_6),
OBJECT_WITH_ACTS(/*model*/ MODEL_TORNADO, /*pos*/ 3066, -200, 400, /*angle*/ 0, 0, 0, /*behParam*/ 0x00190000, /*beh*/ bhvTornado, /*acts*/ ACT_4 | ACT_5 | ACT_6), OBJECT_WITH_ACTS(/*model*/ MODEL_TWEESTER, /*pos*/ 3066, -200, 400, /*angle*/ 0, 0, 0, /*behParam*/ 0x00190000, /*beh*/ bhvTweester, /*acts*/ ACT_4 | ACT_5 | ACT_6),
OBJECT_WITH_ACTS(/*model*/ MODEL_KLEPTO, /*pos*/ 2200, 1174, -2820, /*angle*/ 0, 0, 0, /*behParam*/ 0x00010000, /*beh*/ bhvKlepto, /*acts*/ ACT_1), OBJECT_WITH_ACTS(/*model*/ MODEL_KLEPTO, /*pos*/ 2200, 1174, -2820, /*angle*/ 0, 0, 0, /*behParam*/ 0x00010000, /*beh*/ bhvKlepto, /*acts*/ ACT_1),
OBJECT_WITH_ACTS(/*model*/ MODEL_KLEPTO, /*pos*/ -5963, 573, -4784, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvKlepto, /*acts*/ ACT_2 | ACT_3 | ACT_4 | ACT_5 | ACT_6), OBJECT_WITH_ACTS(/*model*/ MODEL_KLEPTO, /*pos*/ -5963, 573, -4784, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvKlepto, /*acts*/ ACT_2 | ACT_3 | ACT_4 | ACT_5 | ACT_6),
RETURN(), RETURN(),
}; };

BIN
lib/PR/boot/F3D_boot_eu.bin Normal file

Binary file not shown.

Binary file not shown.

View file

@ -15,6 +15,7 @@ glabel __osExceptionPreamble
glabel __osException glabel __osException
.ifndef VERSION_EU
lui $k0, %hi(gInterruptedThread) # $k0, 0x8036 lui $k0, %hi(gInterruptedThread) # $k0, 0x8036
addiu $k0, %lo(gInterruptedThread) # addiu $k0, $k0, 0x5f40 addiu $k0, %lo(gInterruptedThread) # addiu $k0, $k0, 0x5f40
sd $at, 0x20($k0) sd $at, 0x20($k0)
@ -28,6 +29,7 @@ glabel __osException
sd $t2, 0x68($k0) sd $t2, 0x68($k0)
sw $zero, 0x18($k0) sw $zero, 0x18($k0)
mfc0 $t0, $13 mfc0 $t0, $13
andi $t1, $t0, 0x7c andi $t1, $t0, 0x7c
li $t2, 0 li $t2, 0
bne $t1, $t2, .L80326750 bne $t1, $t2, .L80326750
@ -52,6 +54,7 @@ glabel __osException
lui $at, %hi(D_80334934) # $at, 0x8033 lui $at, %hi(D_80334934) # $at, 0x8033
sw $zero, %lo(D_80334934)($at) sw $zero, %lo(D_80334934)($at)
lui $at, %hi(D_80334938) # $at, 0x8033 lui $at, %hi(D_80334938) # $at, 0x8033
move $t0, $k0 move $t0, $k0
sw $zero, %lo(D_80334938)($at) sw $zero, %lo(D_80334938)($at)
lui $k0, %hi(D_803348A0) # $k0, 0x8033 lui $k0, %hi(D_803348A0) # $k0, 0x8033
@ -95,7 +98,43 @@ glabel __osException
sd $sp, 0xf0($k0) sd $sp, 0xf0($k0)
sd $fp, 0xf8($k0) sd $fp, 0xf8($k0)
sd $ra, 0x100($k0) sd $ra, 0x100($k0)
.ifndef VERSION_EU
sd $t0, 0x110($k0) sd $t0, 0x110($k0)
.else
beqz $t1, .L802F3A18
sd $t0, 0x110($k0)
lui $t0, %hi(D_8030208C) # $t0, 0x8030
addiu $t0, $t0, %lo(D_8030208C) # addiu $t0, $t0, 0x208c
lw $t0, ($t0)
li $at, -1
xor $t0, $t0, $at
lui $at, (0xFFFF00FF >> 16) # lui $at, 0xffff
andi $t0, $t0, 0xff00
ori $at, (0xFFFF00FF & 0xFFFF) # ori $at, $at, 0xff
or $t1, $t1, $t0
and $k1, $k1, $at
or $k1, $k1, $t1
sw $k1, 0x118($k0)
.L802F3A18:
lui $t1, %hi(D_A430000C) # $t1, 0xa430
lw $t1, %lo(D_A430000C)($t1)
beqz $t1, .L802F3A50
nop
lui $t0, %hi(D_8030208C) # $t0, 0x8030
addiu $t0, $t0, %lo(D_8030208C) # addiu $t0, $t0, 0x208c
lw $t0, ($t0)
lw $t4, 0x128($k0)
li $at, -1
srl $t0, $t0, 0x10
xor $t0, $t0, $at
andi $t0, $t0, 0x3f
and $t0, $t0, $t4
or $t1, $t1, $t0
.L802F3A50:
sw $t1, 0x128($k0)
.endif
mfc0 $t0, $14 mfc0 $t0, $14
sw $t0, 0x11c($k0) sw $t0, 0x11c($k0)
lw $t0, 0x18($k0) lw $t0, 0x18($k0)
@ -385,6 +424,365 @@ glabel L80326BE8
li $a0, 96 li $a0, 96
j __osDispatchThread j __osDispatchThread
nop nop
.else
lui $k0, %hi(gInterruptedThread) # $k0, 0x8033
addiu $k0, %lo(gInterruptedThread) # addiu $k0, $k0, 0x6ce0
sd $at, 0x20($k0)
mfc0 $k1, $12
sw $k1, 0x118($k0)
li $at, -4
and $k1, $k1, $at
mtc0 $k1, $12
sd $t0, 0x58($k0)
sd $t1, 0x60($k0)
sd $t2, 0x68($k0)
sw $zero, 0x18($k0)
mfc0 $t0, $13
move $t0, $k0
lui $k0, %hi(D_803348A0) # $k0, 0x8030
lw $k0, %lo(D_803348A0)($k0)
ld $t1, 0x20($t0)
sd $t1, 0x20($k0)
ld $t1, 0x118($t0)
sd $t1, 0x118($k0)
ld $t1, 0x58($t0)
sd $t1, 0x58($k0)
ld $t1, 0x60($t0)
sd $t1, 0x60($k0)
ld $t1, 0x68($t0)
sd $t1, 0x68($k0)
lw $k1, 0x118($k0)
mflo $t0
sd $t0, 0x108($k0)
mfhi $t0
andi $t1, $k1, 0xff00
sd $v0, 0x28($k0)
sd $v1, 0x30($k0)
sd $a0, 0x38($k0)
sd $a1, 0x40($k0)
sd $a2, 0x48($k0)
sd $a3, 0x50($k0)
sd $t3, 0x70($k0)
sd $t4, 0x78($k0)
sd $t5, 0x80($k0)
sd $t6, 0x88($k0)
sd $t7, 0x90($k0)
sd $s0, 0x98($k0)
sd $s1, 0xa0($k0)
sd $s2, 0xa8($k0)
sd $s3, 0xb0($k0)
sd $s4, 0xb8($k0)
sd $s5, 0xc0($k0)
sd $s6, 0xc8($k0)
sd $s7, 0xd0($k0)
sd $t8, 0xd8($k0)
sd $t9, 0xe0($k0)
sd $gp, 0xe8($k0)
sd $sp, 0xf0($k0)
sd $fp, 0xf8($k0)
sd $ra, 0x100($k0)
beqz $t1, .L802F3A18
sd $t0, 0x110($k0)
lui $t0, %hi(D_8030208C) # $t0, 0x8030
addiu $t0, %lo(D_8030208C) # addiu $t0, $t0, 0x208c
lw $t0, ($t0)
li $at, -1
xor $t0, $t0, $at
lui $at, (0xFFFF00FF >> 16) # lui $at, 0xffff
andi $t0, $t0, 0xff00
ori $at, (0xFFFF00FF & 0xFFFF) # ori $at, $at, 0xff
or $t1, $t1, $t0
and $k1, $k1, $at
or $k1, $k1, $t1
sw $k1, 0x118($k0)
.L802F3A18:
lui $t1, %hi(D_A430000C) # $t1, 0xa430
lw $t1, %lo(D_A430000C)($t1)
beqz $t1, .L802F3A50
nop
lui $t0, %hi(D_8030208C) # $t0, 0x8030
addiu $t0, %lo(D_8030208C) # addiu $t0, $t0, 0x208c
lw $t0, ($t0)
lw $t4, 0x128($k0)
li $at, -1
srl $t0, $t0, 0x10
xor $t0, $t0, $at
andi $t0, $t0, 0x3f
and $t0, $t0, $t4
or $t1, $t1, $t0
.L802F3A50:
sw $t1, 0x128($k0)
mfc0 $t0, $14
sw $t0, 0x11c($k0)
lw $t0, 0x18($k0)
beqz $t0, .L802F3AB4
nop
cfc1 $t0, $31
nop
sw $t0, 0x12c($k0)
sdc1 $f0, 0x130($k0)
sdc1 $f2, 0x138($k0)
sdc1 $f4, 0x140($k0)
sdc1 $f6, 0x148($k0)
sdc1 $f8, 0x150($k0)
sdc1 $f10, 0x158($k0)
sdc1 $f12, 0x160($k0)
sdc1 $f14, 0x168($k0)
sdc1 $f16, 0x170($k0)
sdc1 $f18, 0x178($k0)
sdc1 $f20, 0x180($k0)
sdc1 $f22, 0x188($k0)
sdc1 $f24, 0x190($k0)
sdc1 $f26, 0x198($k0)
sdc1 $f28, 0x1a0($k0)
sdc1 $f30, 0x1a8($k0)
.L802F3AB4:
mfc0 $t0, $13
sw $t0, 0x120($k0)
li $t1, 2
sh $t1, 0x10($k0)
andi $t1, $t0, 0x7c
li $t2, 36
beq $t1, $t2, .L802F3D90
nop
li $t2, 44
beq $t1, $t2, .L80326CCC
nop
li $t2, 0
bne $t1, $t2, .L80326BE8
nop
and $s0, $k1, $t0
.L802F3AF0:
andi $t1, $s0, 0xff00
srl $t2, $t1, 0xc
bnez $t2, .L802F3B08
nop
srl $t2, $t1, 8
addi $t2, $t2, 0x10
.L802F3B08:
lui $at, %hi(D_80338610)
addu $at, $at, $t2
lbu $t2, %lo(D_80338610)($at)
lui $at, %hi(jtbl_80338630)
addu $at, $at, $t2
lw $t2, %lo(jtbl_80338630)($at)
jr $t2
nop
li $at, -8193
b .L802F3AF0
and $s0, $s0, $at
li $at, -16385
b .L802F3AF0
and $s0, $s0, $at
glabel L80326964 #probably not right...
mfc0 $t1, $11
mtc0 $t1, $11
jal send_mesg
li $a0, 24
lui $at, (0xFFFF7FFF >> 16) # lui $at, 0xffff
ori $at, (0xFFFF7FFF & 0xFFFF) # ori $at, $at, 0x7fff
b .L802F3AF0
and $s0, $s0, $at
glabel L80326984 #possibly wrong
li $at, -2049
and $s0, $s0, $at
li $t2, 4
lui $at, %hi(D_80334920)
addu $at, $at, $t2
lw $t2, %lo(D_80334920)($at)
lui $sp, %hi(D_80365E40) # $sp, 0x8033 #.bss stack for D_802F4380
addiu $sp, %lo(D_80365E40) # addiu $sp, $sp, 0x5c20
li $a0, 16
beqz $t2, .L802F3BA4
addiu $sp, $sp, 0xff0
jalr $t2
nop
beqz $v0, .L802F3BA4
nop
b .L802F3DA8
nop
.L802F3BA4:
jal send_mesg
nop
b .L802F3AF0
nop
glabel L803269B8
lui $t0, %hi(D_8030208C) # $t0, 0x8030
addiu $t0, %lo(D_8030208C) # addiu $t0, $t0, 0x208c
lw $t0, ($t0)
lui $s1, %hi(D_A4300008) # $s1, 0xa430
lw $s1, %lo(D_A4300008)($s1)
srl $t0, $t0, 0x10
and $s1, $s1, $t0
andi $t1, $s1, 1
beqz $t1, .L802F3C24
nop
lui $t4, %hi(D_A4040010) # $t4, 0xa404
lw $t4, %lo(D_A4040010)($t4)
li $t1, 8
lui $at, %hi(D_A4040010) # $at, 0xa404
andi $t4, $t4, 0x300
andi $s1, $s1, 0x3e
beqz $t4, .L802F3C14
sw $t1, %lo(D_A4040010)($at)
jal send_mesg
li $a0, 32
beqz $s1, .L802F3CE8
nop
b .L802F3C24
nop
.L802F3C14:
jal send_mesg
li $a0, 88
beqz $s1, .L802F3CE8
nop
.L802F3C24:
andi $t1, $s1, 8
beqz $t1, .L802F3C48
lui $at, %hi(D_A4400010) # $at, 0xa440
andi $s1, $s1, 0x37
sw $zero, %lo(D_A4400010)($at)
jal send_mesg
li $a0, 56
beqz $s1, .L802F3CE8
nop
.L802F3C48:
andi $t1, $s1, 4
beqz $t1, .L802F3C74
nop
li $t1, 1
lui $at, %hi(D_A450000C) # $at, 0xa450
andi $s1, $s1, 0x3b
sw $t1, %lo(D_A450000C)($at)
jal send_mesg
li $a0, 48
beqz $s1, .L802F3CE8
nop
.L802F3C74:
andi $t1, $s1, 2
beqz $t1, .L802F3C98
lui $at, %hi(D_A4800018) # $at, 0xa480
andi $s1, $s1, 0x3d
sw $zero, %lo(D_A4800018)($at)
jal send_mesg
li $a0, 40
beqz $s1, .L802F3CE8
nop
.L802F3C98:
andi $t1, $s1, 0x10
beqz $t1, .L802F3CC4
nop
li $t1, 2
lui $at, %hi(D_A4600010) # $at, 0xa460
andi $s1, $s1, 0x2f
sw $t1, %lo(D_A4600010)($at)
jal send_mesg
li $a0, 64
beqz $s1, .L802F3CE8
nop
.L802F3CC4:
andi $t1, $s1, 0x20
beqz $t1, .L802F3CE8
nop
li $t1, 2048
lui $at, 0xa430
andi $s1, $s1, 0x1f
sw $t1, ($at)
jal send_mesg
li $a0, 72
.L802F3CE8:
li $at, -1025
b .L802F3AF0
and $s0, $s0, $at
glabel L80326AE8
lw $k1, 0x118($k0)
li $at, -4097
lui $t1, %hi(D_80334808) # $t1, 0x8030
and $k1, $k1, $at
sw $k1, 0x118($k0)
addiu $t1, %lo(D_80334808) # addiu $t1, $t1, 0x2088
lw $t2, ($t1)
beqz $t2, .L802F3D20
li $at, -4097
b .L802F3DA8
and $s0, $s0, $at
.L802F3D20:
li $t2, 1
sw $t2, ($t1)
jal send_mesg
li $a0, 112
lui $t2, %hi(D_80334898) # $t2, 0x8030
lw $t2, %lo(D_80334898)($t2)
li $at, -4097
and $s0, $s0, $at
lw $k1, 0x118($t2)
and $k1, $k1, $at
b .L802F3DA8
sw $k1, 0x118($t2)
glabel L80326B44
li $at, -513
and $t0, $t0, $at
mtc0 $t0, $13
jal send_mesg
li $a0, 8
li $at, -513
b .L802F3AF0
and $s0, $s0, $at
glabel L80326B64
li $at, -257
and $t0, $t0, $at
mtc0 $t0, $13
jal send_mesg
li $a0, 0
li $at, -257
b .L802F3AF0
and $s0, $s0, $at
.L802F3D90:
li $t1, 1
sh $t1, 0x12($k0)
jal send_mesg
li $a0, 80
b .L802F3DA8
nop
.L802F3DA8:
glabel L80326B9C
lui $t2, %hi(D_80334898) # $t2, 0x8030
lw $t2, %lo(D_80334898)($t2)
lw $t1, 4($k0)
lw $t3, 4($t2)
slt $at, $t1, $t3
beqz $at, .L80326BD0
nop
lui $a0, %hi(D_80334898) # $a0, 0x8030
move $a1, $k0
jal __osEnqueueThread
addiu $a0, %lo(D_80334898) # addiu $a0, $a0, 0x2ef8
j __osDispatchThread
nop
.L80326BD0:
lui $t1, %hi(D_80334898) # $t1, 0x8030
addiu $t1, %lo(D_80334898) # addiu $t1, $t1, 0x2ef8
lw $t2, ($t1)
sw $t2, ($k0)
j __osDispatchThread
sw $k0, ($t1)
.L80326BE8:
glabel L80326BE8
lui $at, %hi(D_803348A4) # $at, 0x8030
sw $k0, %lo(D_803348A4)($at)
li $t1, 1
sh $t1, 0x10($k0)
li $t1, 2
sh $t1, 0x12($k0)
mfc0 $t2, $8
sw $t2, 0x124($k0)
jal send_mesg
li $a0, 96
j __osDispatchThread
nop
.endif
glabel send_mesg glabel send_mesg
lui $t2, %hi(D_80363830) # $t2, 0x8036 lui $t2, %hi(D_80363830) # $t2, 0x8036
@ -470,7 +868,11 @@ glabel __osEnqueueAndYield
sd $sp, 0xf0($a1) sd $sp, 0xf0($a1)
sd $fp, 0xf8($a1) sd $fp, 0xf8($a1)
sd $ra, 0x100($a1) sd $ra, 0x100($a1)
.ifdef VERSION_EU
beqz $k1, .L802F3F7C
.else
beqz $k1, .L80326D70 beqz $k1, .L80326D70
.endif
sw $ra, 0x11c($a1) sw $ra, 0x11c($a1)
cfc1 $k1, $31 cfc1 $k1, $31
sdc1 $f20, 0x180($a1) sdc1 $f20, 0x180($a1)
@ -480,9 +882,49 @@ glabel __osEnqueueAndYield
sdc1 $f28, 0x1a0($a1) sdc1 $f28, 0x1a0($a1)
sdc1 $f30, 0x1a8($a1) sdc1 $f30, 0x1a8($a1)
sw $k1, 0x12c($a1) sw $k1, 0x12c($a1)
.ifdef VERSION_EU
.L802F3F7C:
/* 0B377C 802F3F7C 8CBB0118 */ lw $k1, 0x118($a1)
/* 0B3780 802F3F80 3369FF00 */ andi $t1, $k1, 0xff00
/* 0B3784 802F3F84 1120000D */ beqz $t1, .L802F3FBC
/* 0B3788 802F3F88 00000000 */ nop
/* 0B378C 802F3F8C 3C088030 */ lui $t0, %hi(D_8030208C) # $t0, 0x8030
/* 0B3790 802F3F90 2508208C */ addiu $t0, %lo(D_8030208C) # addiu $t0, $t0, 0x208c
/* 0B3794 802F3F94 8D080000 */ lw $t0, ($t0)
/* 0B3798 802F3F98 2401FFFF */ li $at, -1
/* 0B379C 802F3F9C 01014026 */ xor $t0, $t0, $at
/* 0B37A0 802F3FA0 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) # lui $at, 0xffff
/* 0B37A4 802F3FA4 3108FF00 */ andi $t0, $t0, 0xff00
/* 0B37A8 802F3FA8 342100FF */ ori $at, (0xFFFF00FF & 0xFFFF) # ori $at, $at, 0xff
/* 0B37AC 802F3FAC 01284825 */ or $t1, $t1, $t0
/* 0B37B0 802F3FB0 0361D824 */ and $k1, $k1, $at
/* 0B37B4 802F3FB4 0369D825 */ or $k1, $k1, $t1
/* 0B37B8 802F3FB8 ACBB0118 */ sw $k1, 0x118($a1)
.L802F3FBC:
/* 0B37BC 802F3FBC 3C1BA430 */ lui $k1, %hi(D_A430000C) # $k1, 0xa430
/* 0B37C0 802F3FC0 8F7B000C */ lw $k1, %lo(D_A430000C)($k1)
/* 0B37C4 802F3FC4 1360000B */ beqz $k1, .L802F3FF4
/* 0B37C8 802F3FC8 00000000 */ nop
/* 0B37CC 802F3FCC 3C1A8030 */ lui $k0, %hi(D_8030208C) # $k0, 0x8030
/* 0B37D0 802F3FD0 275A208C */ addiu $k0, %lo(D_8030208C) # addiu $k0, $k0, 0x208c
/* 0B37D4 802F3FD4 8F5A0000 */ lw $k0, ($k0)
/* 0B37D8 802F3FD8 8CA80128 */ lw $t0, 0x128($a1)
/* 0B37DC 802F3FDC 2401FFFF */ li $at, -1
/* 0B37E0 802F3FE0 001AD402 */ srl $k0, $k0, 0x10
/* 0B37E4 802F3FE4 0341D026 */ xor $k0, $k0, $at
/* 0B37E8 802F3FE8 335A003F */ andi $k0, $k0, 0x3f
/* 0B37EC 802F3FEC 0348D024 */ and $k0, $k0, $t0
/* 0B37F0 802F3FF0 037AD825 */ or $k1, $k1, $k0
.L802F3FF4:
.endif
.L80326D70: .L80326D70:
.ifndef VERSION_EU
lui $k1, %hi(D_A430000C) # $k1, 0xa430 lui $k1, %hi(D_A430000C) # $k1, 0xa430
lw $k1, %lo(D_A430000C)($k1) lw $k1, %lo(D_A430000C)($k1)
.endif
beqz $a0, .L80326D88 beqz $a0, .L80326D88
sw $k1, 0x128($a1) sw $k1, 0x128($a1)
jal __osEnqueueThread jal __osEnqueueThread
@ -530,6 +972,22 @@ glabel __osDispatchThread
li $t0, 4 li $t0, 4
sh $t0, 0x10($v0) sh $t0, 0x10($v0)
move $k0, $v0 move $k0, $v0
.ifdef VERSION_EU
/* 0B3884 802F4084 3C088030 */ lui $t0, %hi(D_8030208C) # $t0, 0x8030
/* 0B3888 802F4088 8F5B0118 */ lw $k1, 0x118($k0)
/* 0B388C 802F408C 2508208C */ addiu $t0, %lo(D_8030208C) # addiu $t0, $t0, 0x208c
/* 0B3890 802F4090 8D080000 */ lw $t0, ($t0)
/* 0B3894 802F4094 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) # lui $at, 0xffff
/* 0B3898 802F4098 3369FF00 */ andi $t1, $k1, 0xff00
/* 0B389C 802F409C 342100FF */ ori $at, (0xFFFF00FF & 0xFFFF) # ori $at, $at, 0xff
/* 0B38A0 802F40A0 3108FF00 */ andi $t0, $t0, 0xff00
/* 0B38A4 802F40A4 01284824 */ and $t1, $t1, $t0
/* 0B38A8 802F40A8 0361D824 */ and $k1, $k1, $at
/* 0B38AC 802F40AC 0369D825 */ or $k1, $k1, $t1
/* 0B38B0 802F40B0 409B6000 */ mtc0 $k1, $12
.endif
.L80326E08: .L80326E08:
ld $k1, 0x108($k0) ld $k1, 0x108($k0)
ld $at, 0x20($k0) ld $at, 0x20($k0)
@ -566,8 +1024,10 @@ glabel __osDispatchThread
ld $ra, 0x100($k0) ld $ra, 0x100($k0)
lw $k1, 0x11c($k0) lw $k1, 0x11c($k0)
mtc0 $k1, $14 mtc0 $k1, $14
.ifndef VERSION_EU
lw $k1, 0x118($k0) lw $k1, 0x118($k0)
mtc0 $k1, $12 mtc0 $k1, $12
.endif
lw $k1, 0x18($k0) lw $k1, 0x18($k0)
beqz $k1, .L80326EF0 beqz $k1, .L80326EF0
nop nop
@ -591,6 +1051,13 @@ glabel __osDispatchThread
ldc1 $f30, 0x1a8($k0) ldc1 $f30, 0x1a8($k0)
.L80326EF0: .L80326EF0:
lw $k1, 0x128($k0) lw $k1, 0x128($k0)
.ifdef VERSION_EU
/* 0B3998 802F4198 3C1A8030 */ lui $k0, %hi(D_8030208C) # $k0, 0x8030
/* 0B399C 802F419C 275A208C */ addiu $k0, %lo(D_8030208C) # addiu $k0, $k0, 0x208c
/* 0B39A0 802F41A0 8F5A0000 */ lw $k0, ($k0)
/* 0B39A4 802F41A4 001AD402 */ srl $k0, $k0, 0x10
/* 0B39A8 802F41A8 037AD824 */ and $k1, $k1, $k0
.endif
sll $k1, $k1, 1 sll $k1, $k1, 1
lui $k0, %hi(D_803386D0) # $k0, 0x8034 lui $k0, %hi(D_803386D0) # $k0, 0x8034
addiu $k0, %lo(D_803386D0) # addiu $k0, $k0, -0x7930 addiu $k0, %lo(D_803386D0) # addiu $k0, $k0, -0x7930
@ -624,8 +1091,6 @@ glabel D_80334938
.word 0 .word 0
.word 0 .word 0
.section .rodata .section .rodata
glabel D_80338610 glabel D_80338610
@ -638,8 +1103,13 @@ glabel jtbl_80338630
.word L803269B8 .word L803269B8
.word L80326984 .word L80326984
.word L80326AE8 .word L80326AE8
.ifdef VERSION_EU
.word 0x802f3b28
.word 0x802f3b34
.else
.word L80326BE8 .word L80326BE8
.word L80326BE8 .word L80326BE8
.endif
.word L80326964 .word L80326964
.word 0 .word 0
.word 0 .word 0

View file

@ -0,0 +1,22 @@
.set noreorder # don't insert nops after branches
.set gp=64
.set noat
.include "macros.inc"
.section .text, "ax"
# cache related
glabel __os_eu_802ef550
lui $t0,0x8000
li $t2,0x2000
addu $t1,$t0,$t2
addiu $t1,$t1,-0x10
.L: cache 0x1,0($t0)
sltu $at,$t0,$t1
bnez $at,.L
addiu $t0,$t0,0x10
jr $ra
nop
nop
nop

View file

@ -9,14 +9,38 @@
.section .text, "ax" .section .text, "ax"
glabel osSetIntMask glabel osSetIntMask
.ifndef VERSION_EU
mfc0 $t1, $12 mfc0 $t1, $12
andi $v0, $t1, 0xff01 andi $v0, $t1, 0xff01
.else
mfc0 $t4, $12
andi $v0, $t4, 0xff01
lui $t0, %hi(D_8030208C) # $t0, 0x8030
addiu $t0, %lo(D_8030208C) # addiu $t0, $t0, 0x208c
lw $t3, ($t0)
li $at, -1
xor $t0, $t3, $at
andi $t0, $t0, 0xff00
or $v0, $v0, $t0
.endif
lui $t2, %hi(MI_INTR_MASK_REG) # $t2, 0xa430 lui $t2, %hi(MI_INTR_MASK_REG) # $t2, 0xa430
lw $t2, %lo(MI_INTR_MASK_REG)($t2) lw $t2, %lo(MI_INTR_MASK_REG)($t2)
.ifdef VERSION_EU
beqz $t2, .L80200074
srl $t1, $t3, 0x10
li $at, -1
xor $t1, $t1, $at
andi $t1, $t1, 0x3f
or $t2, $t2, $t1
.L80200074:
.endif
sll $t2, $t2, 0x10 sll $t2, $t2, 0x10
or $v0, $v0, $t2 or $v0, $v0, $t2
lui $at, 0x3f lui $at, 0x3f
and $t0, $a0, $at and $t0, $a0, $at
.ifdef VERSION_EU
and $t0, $t0, $t3
.endif
srl $t0, $t0, 0xf srl $t0, $t0, 0xf
lui $t2, %hi(D_803386D0) lui $t2, %hi(D_803386D0)
addu $t2, $t2, $t0 addu $t2, $t2, $t0
@ -24,11 +48,21 @@ glabel osSetIntMask
lui $at, %hi(MI_INTR_MASK_REG) # $at, 0xa430 lui $at, %hi(MI_INTR_MASK_REG) # $at, 0xa430
sw $t2, %lo(MI_INTR_MASK_REG)($at) sw $t2, %lo(MI_INTR_MASK_REG)($at)
andi $t0, $a0, 0xff01 andi $t0, $a0, 0xff01
.ifdef VERSION_EU
andi $t1, $t3, 0xff00
and $t0, $t0, $t1
.endif
lui $at, (0xFFFF00FF >> 16) # lui $at, 0xffff lui $at, (0xFFFF00FF >> 16) # lui $at, 0xffff
ori $at, (0xFFFF00FF & 0xFFFF) # ori $at, $at, 0xff ori $at, (0xFFFF00FF & 0xFFFF) # ori $at, $at, 0xff
.ifndef VERSION_EU
and $t1, $t1, $at and $t1, $t1, $at
or $t1, $t1, $t0 or $t1, $t1, $t0
mtc0 $t1, $12 mtc0 $t1, $12
.else
and $t4, $t4, $at
or $t4, $t4, $t0
mtc0 $t4, $12
.endif
nop nop
nop nop
jr $ra jr $ra

18
lib/asm/parameters.s Normal file
View file

@ -0,0 +1,18 @@
.macro gsymbol sym addr
.global \sym
.set \sym, \addr
.ifndef VERSION_JP
nop
nop
.endif
.endm
.text
gsymbol osTvType 0x80000300
gsymbol osRomType 0x80000304
gsymbol osRomBase 0x80000308
gsymbol osResetType 0x8000030C
gsymbol osCiCId 0x80000310
gsymbol osVersion 0x80000314
gsymbol osMemSize 0x80000318
gsymbol osAppNmiBuffer 0x8000031C

View file

@ -5,7 +5,12 @@
.balign 16 .balign 16
glabel rspF3DBootStart glabel rspF3DBootStart
.ifndef VERSION_EU
.incbin "lib/PR/boot/F3D_boot.bin" .incbin "lib/PR/boot/F3D_boot.bin"
.else
.incbin "lib/PR/boot/F3D_boot_eu.bin"
.half 0
.endif
glabel rspF3DBootEnd glabel rspF3DBootEnd
.balign 16 .balign 16
@ -131,7 +136,11 @@ glabel rspS2DEXEnd
.ifndef F3DEX_GBI_SHARED /* Use regular Fast3D data (default) */ .ifndef F3DEX_GBI_SHARED /* Use regular Fast3D data (default) */
glabel rspF3DDataStart glabel rspF3DDataStart
.ifndef F3D_OLD /* OS 2.0H (J2 and IQ) */ .ifndef F3D_OLD /* OS 2.0H (J2 and IQ) */
.ifdef VERSION_EU
.incbin "lib/PR/f3d/new/F3D_data_EU.bin"
.else
.incbin "lib/PR/f3d/new/F3D_data.bin" .incbin "lib/PR/f3d/new/F3D_data.bin"
.endif
.else /* OS 2.0D (US and JP) */ .else /* OS 2.0D (US and JP) */
.incbin "lib/PR/f3d/old/F3D_data.bin" .incbin "lib/PR/f3d/old/F3D_data.bin"
.endif .endif

147
lib/src/D_802F4380.c Normal file
View file

@ -0,0 +1,147 @@
#include "libultra_internal.h"
#include "hardware.h"
#include "new_func.h"
#include "macros.h"
#ifdef VERSION_EU
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

12
lib/src/EU_D_802f4330.c Normal file
View file

@ -0,0 +1,12 @@
#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);
}

View file

@ -99,9 +99,7 @@ void _Ldtob(printf_struct *args, u8 type) {
if (exp > 0) { if (exp > 0) {
factor = 1; factor = 1;
exp &= ~3; exp &= ~3;
n = exp; for (n = exp, i = 0; n > 0; n >>= 1, i++) {
for (i = 0; n > 0; n >>= 1, i++) {
if ((n & 1) != 0) { if ((n & 1) != 0) {
factor *= D_80338670[i]; factor *= D_80338670[i];
} }

View file

@ -1,5 +1,88 @@
#include "libultra_internal.h" #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) { void __osDevMgrMain(void *args) {
OSIoMesg *sp34; OSIoMesg *sp34;
OSMesg sp30; OSMesg sp30;
@ -35,3 +118,4 @@ void __osDevMgrMain(void *args) {
} }
} }
} }
#endif

View file

@ -0,0 +1,5 @@
#include "libultra_internal.h"
extern OSThread* D_8033489C;
OSThread *__osGetCurrFaultedThread() {
return D_8033489C; // 80302efc
}

View file

@ -6,6 +6,7 @@ typedef struct {
u8 unk01 : 2; u8 unk01 : 2;
u8 unk2[3]; u8 unk2[3];
} unkStruct; } unkStruct;
u32 D_80334A40 = 0; u32 D_80334A40 = 0;
u32 D_80334A44 = 1; u32 D_80334A44 = 1;

View file

@ -8,14 +8,23 @@ extern u32 osTvType;
OSViContext D_803348B0[2] = { 0 }; OSViContext D_803348B0[2] = { 0 };
OSViContext *D_80334910 = &D_803348B0[0]; OSViContext *D_80334910 = &D_803348B0[0];
OSViContext *D_80334914 = &D_803348B0[1]; 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_80334918 = TV_TYPE_NTSC;
u32 D_8033491C = 0x02E6D354; u32 D_8033491C = 0x02E6D354;
#endif
extern OSViMode D_80334990; extern OSViMode D_80334990;
extern OSViMode D_803349E0; extern OSViMode D_803349E0;
#ifdef VERSION_EU
extern OSViMode D_80302FD0;
#endif
void __osViInit(void) { void __osViInit(void) {
//#ifdef VERSION_JP //#ifdef VERSION_JP
#ifndef VERSION_JP #ifdef VERSION_US
D_80334918 = osTvType; D_80334918 = osTvType;
#endif #endif
bzero(D_803348B0, sizeof(D_803348B0)); bzero(D_803348B0, sizeof(D_803348B0));
@ -23,6 +32,21 @@ void __osViInit(void) {
D_80334914 = &D_803348B0[1]; D_80334914 = &D_803348B0[1];
D_80334914->retraceCount = 1; D_80334914->retraceCount = 1;
D_80334910->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 #ifdef VERSION_JP
if (D_80334918 != TV_TYPE_PAL) if (D_80334918 != TV_TYPE_PAL)
#else #else
@ -39,6 +63,7 @@ void __osViInit(void) {
D_8033491C = 0x02E6025C; D_8033491C = 0x02E6025C;
#endif #endif
} }
#endif
D_80334914->unk00 = 32; D_80334914->unk00 = 32;
D_80334914->features = D_80334914->unk08->comRegs.ctrl; D_80334914->features = D_80334914->unk08->comRegs.ctrl;
#ifndef VERSION_JP #ifndef VERSION_JP

171
lib/src/func_802F4A20.c Normal file
View file

@ -0,0 +1,171 @@
#include "new_func.h"
extern OSThread *D_80334898;
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(D_A4600010) # $t8, 0xa460
// lw $t9, %lo(D_A4600010)($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(D_A4600010) # $t2, 0xa460
// lw $t3, %lo(D_A4600010)($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(D_A4600010) # $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(D_A4600010)($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(D_A4600010) # $t4, 0xa460
// lw $t5, %lo(D_A4600010)($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(D_A4600010) # $t2, 0xa460
// sw $t1, %lo(D_A4600010)($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
}

31
lib/src/func_802F7140.c Normal file
View file

@ -0,0 +1,31 @@
#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 */

36
lib/src/func_802F71A0.c Normal file
View file

@ -0,0 +1,36 @@
#include "libultra_internal.h"
#include "hardware.h"
//possibly osEpiWriteIo
s32 func_802F71A0(OSPiHandle *a0, u32 a1, u32 a2) {
register u32 a3 = HW_REG(PI_STATUS_REG, u32);
while (a3 & PI_STATUS_ERROR)
a3 = HW_REG(PI_STATUS_REG, u32);
HW_REG(a0->baseAddress | a1, u32) = a2;
return 0;
}
/*
/ 0B69A0 802F71A0 3C0EA460 / lui $t6, %hi(D_A4600010) # $t6, 0xa460
/ 0B69A4 802F71A4 8DC70010 / lw $a3, %lo(D_A4600010)($t6)
/ 0B69A8 802F71A8 27BDFFF8 / addiu $sp, $sp, -8
/ 0B69AC 802F71AC 30EF0003 / andi $t7, $a3, 3
/ 0B69B0 802F71B0 11E00006 / beqz $t7, .L802F71CC
/ 0B69B4 802F71B4 00000000 / nop
.L802F71B8:
/ 0B69B8 802F71B8 3C18A460 / lui $t8, %hi(D_A4600010) # $t8, 0xa460
/ 0B69BC 802F71BC 8F070010 / lw $a3, %lo(D_A4600010)($t8)
/ 0B69C0 802F71C0 30F90003 / andi $t9, $a3, 3
/ 0B69C4 802F71C4 1720FFFC / bnez $t9, .L802F71B8
/ 0B69C8 802F71C8 00000000 / nop
.L802F71CC:
/ 0B69CC 802F71CC 8C88000C / lw $t0, 0xc($a0)
/ 0B69D0 802F71D0 3C01A000 / lui $at, 0xa000
/ 0B69D4 802F71D4 27BD0008 / addiu $sp, $sp, 8
/ 0B69D8 802F71D8 01054825 / or $t1, $t0, $a1
/ 0B69DC 802F71DC 01215025 / or $t2, $t1, $at
/ 0B69E0 802F71E0 AD460000 / sw $a2, ($t2)
/ 0B69E4 802F71E4 03E00008 / jr $ra
/ 0B69E8 802F71E8 00001025 / move $v0, $zero
/ 0B69EC 802F71EC 00000000 / nop */

33
lib/src/func_802F71F0.c Normal file
View file

@ -0,0 +1,33 @@
#include "libultra_internal.h"
extern OSThread *D_803348A0;
extern OSThread *D_80334898;
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 */

View file

@ -66,6 +66,9 @@
#define PI_STATUS_IOBUSY 0x2 #define PI_STATUS_IOBUSY 0x2
#define PI_STATUS_ERROR 0x3 #define PI_STATUS_ERROR 0x3
#define PI_STATUS_RESET_CONTROLLER 0x1
#define PI_STATUS_CLEAR_INTR 0x2
#define SI_DRAM_ADDR_REG 0x04800000 #define SI_DRAM_ADDR_REG 0x04800000
#define SI_PIF_ADDR_RD64B_REG 0x04800004 #define SI_PIF_ADDR_RD64B_REG 0x04800004
#define SI_PIF_ADDR_WR64B_REG 0x04800010 #define SI_PIF_ADDR_WR64B_REG 0x04800010
@ -82,4 +85,43 @@
#define MI_INTR_REG 0x04300008 #define MI_INTR_REG 0x04300008
#define MI_INTR_MASK_REG 0x0430000C #define MI_INTR_MASK_REG 0x0430000C
//https://github.com/LuigiBlood/64dd/wiki/Registers
#define ASIC_STATUS 0x05000508
#define DATA_REQUEST 0x40000000
#define C2_TRANSFER 0x10000000
#define BUFFER_MANAGER_ERROR 0x08000000
#define BUFFER_MANAGER_INTERRUPT 0x04000000
#define MECHANIC_INTERRUPT 0x02000000
#define DISK_PRESENT 0x01000000
#define BUSY_STATE 0x00800000
#define RESET_STATE 0x00400000
#define MOTOR_NOT_SPINNING 0x00100000
#define HEAD_RETRACTED 0x00080000
#define WRITE_PROTECT_ERROR 0x00040000
#define MECHANIC_ERROR 0x00020000
#define DISK_CHANGE 0x00010000
#define _64DD_PRESENT_MASK 0xFFFF
//ro
#define ASIC_BM_STATUS 0x05000510
#define MICRO_STATUS 0x02000000
#define C1_DOUBLE 0x00400000
#define C1_SINGLE 0x00200000
//wo
#define ASIC_BM_CTL 0x05000510
#define BUFFER_MANAGER_RESET 0x10000000
#define MECHANIC_INTERRUPT_RESET 0x01000000
/*- Start Buffer Manager (0x80000000)
- Buffer Manager Mode (0x40000000)
- BM Interrupt Mask (0x20000000)
- Buffer Manager Reset (0x10000000)
- Disable OR Check? (0x08000000)
- Disable C1 Correction (0x04000000)
- Block Transfer (0x02000000)
- Mechanic Interrupt Reset (0x01000000)*/
#endif #endif

View file

@ -13,7 +13,7 @@ u32 D_80334A30 = 0;
u32 D_80334A34 = 0; u32 D_80334A34 = 0;
s32 D_80334A38 = 0; s32 D_80334A38 = 0;
u8 D_80365E40[0x100]; extern u8 D_80365E40[0x1000];
OSThread gInterruptedThread; OSThread gInterruptedThread;

View file

@ -2,44 +2,48 @@
#define _LIBULTRA_INTERNAL_H_ #define _LIBULTRA_INTERNAL_H_
#include <ultra64.h> #include <ultra64.h>
typedef struct typedef struct {
{ u32 initialized; // probably something like initialized?
u32 initialized; //probably something like initialized?
OSThread *mgrThread; OSThread *mgrThread;
OSMesgQueue *unk08; OSMesgQueue *unk08;
OSMesgQueue *unk0c; OSMesgQueue *unk0c;
OSMesgQueue *unk10; OSMesgQueue *unk10;
s32 (*dma_func)(s32,u32,void*,size_t); s32 (*dma_func)(s32, u32, void *, size_t);
#ifdef VERSION_EU
s32 (*edma_func)(OSPiHandle*, s32, u32, void *, size_t);
#else
u64 force_align; u64 force_align;
#endif
} OSMgrArgs; } OSMgrArgs;
s32 __osDisableInt(); s32 __osDisableInt();
void __osRestoreInt(s32); void __osRestoreInt(s32);
void __osEnqueueAndYield(OSThread**); void __osEnqueueAndYield(OSThread **);
void __osDequeueThread(OSThread**, OSThread*); void __osDequeueThread(OSThread **, OSThread *);
void __osEnqueueThread(OSThread**, OSThread*); void __osEnqueueThread(OSThread **, OSThread *);
OSThread* __osPopThread(OSThread**); OSThread *__osPopThread(OSThread **);
s32 __osSiRawStartDma(s32, void*); s32 __osSiRawStartDma(s32, void *);
void __osSiCreateAccessQueue(); void __osSiCreateAccessQueue();
void __osSiGetAccess(); void __osSiGetAccess();
void __osSiRelAccess(); void __osSiRelAccess();
u32 __osProbeTLB(void*); u32 __osProbeTLB(void *);
void __osPiCreateAccessQueue(); void __osPiCreateAccessQueue();
void __osPiGetAccess(); void __osPiGetAccess();
void __osSetSR(u32); void __osSetSR(u32);
u32 __osGetSR(); u32 __osGetSR();
void __osSetFpcCsr(u32); void __osSetFpcCsr(u32);
s32 __osSiRawReadIo(void*, u32*); s32 __osSiRawReadIo(void *, u32 *);
s32 __osSiRawWriteIo(void*, u32); s32 __osSiRawWriteIo(void *, u32);
s32 osPiRawReadIo(u32 a0, u32 *a1); s32 osPiRawReadIo(u32 a0, u32 *a1);
void __osSpSetStatus(u32); void __osSpSetStatus(u32);
u32 __osSpGetStatus(); u32 __osSpGetStatus();
s32 __osSpSetPc(void*); s32 __osSpSetPc(void *);
s32 __osSpDeviceBusy(); s32 __osSpDeviceBusy();
s32 __osSiDeviceBusy(); s32 __osSiDeviceBusy();
s32 __osSpRawStartDma(u32 dir, void *sp_ptr, void *dram_ptr, size_t size); s32 __osSpRawStartDma(u32 dir, void *sp_ptr, void *dram_ptr, size_t size);
void __osViInit(); void __osViInit();
OSViContext * __osViGetCurrentContext(); OSViContext *__osViGetCurrentContext();
OSViContext *__osViGetCurrentContext2();
void __osViSwapContext(); void __osViSwapContext();
void __osSetTimerIntr(u64); void __osSetTimerIntr(u64);
u64 __osInsertTimer(OSTimer *); u64 __osInsertTimer(OSTimer *);
@ -47,5 +51,5 @@ void __osSetCompare(u32);
s32 __osAiDeviceBusy(); s32 __osAiDeviceBusy();
void __osDispatchThread(); void __osDispatchThread();
u32 __osGetCause(); u32 __osGetCause();
s32 __osAtomicDec(u32*); s32 __osAtomicDec(u32 *);
#endif #endif

22
lib/src/new_func.h Normal file
View file

@ -0,0 +1,22 @@
#ifndef NEW_FUNC_H
#define NEW_FUNC_H
#include "libultra_internal.h"
#include "hardware.h"
#define WAIT_ON_IOBUSY(var) \
var = HW_REG(PI_STATUS_REG, u32); \
while (var & PI_STATUS_IOBUSY) \
var = HW_REG(PI_STATUS_REG, u32);
extern u32 EU_D_80302090;
extern OSPiHandle *__osDiskHandle; //possibly __osPiTable
extern volatile u32 D_8030208C;
s32 osEPiRawStartDma(OSPiHandle *arg0, s32 dir, u32 cart_addr, void *dram_addr, u32 size);
void func_802F4B08();
void func_802F4A20();
void func_802F7140(u32);
void func_802F71A0(OSPiHandle*, u32, u32); //osEPi something
void func_802F71F0();
#endif

View file

@ -43,7 +43,11 @@ s32 osContInit(OSMesgQueue *mq, u8 *a1, OSContStatus *status) {
sp78 = __osSiRawStartDma(0, D_80365CE0); sp78 = __osSiRawStartDma(0, D_80365CE0);
osRecvMesg(mq, &mesg, OS_MESG_BLOCK); osRecvMesg(mq, &mesg, OS_MESG_BLOCK);
__osContGetInitData(a1, status); __osContGetInitData(a1, status);
#ifdef VERSION_EU
D_80365D20 = 0;
#else
D_80365D20 = 255; D_80365D20 = 255;
#endif
__osSiCreateAccessQueue(); __osSiCreateAccessQueue();
osCreateMesgQueue(&_osContMesgQueue, _osContMesgBuff, 1); osCreateMesgQueue(&_osContMesgQueue, _osContMesgBuff, 1);
return sp78; return sp78;

View file

@ -3,11 +3,14 @@
#define OS_PI_MGR_MESG_BUFF_SIZE 1 #define OS_PI_MGR_MESG_BUFF_SIZE 1
OSMgrArgs piMgrArgs = { 0 }; OSMgrArgs piMgrArgs = { 0 };
#ifdef VERSION_EU
OSPiHandle *D_80302DFC = NULL;
#endif
OSThread piMgrThread; OSThread piMgrThread;
u32 piMgrStack[0x400]; // stack bottom u32 piMgrStack[0x400]; // stack bottom
OSMesgQueue __osPiMesgQueue; OSMesgQueue __osPiMesgQueue;
OSMesg piMgrMesgBuff[OS_PI_MGR_MESG_BUFF_SIZE + 1]; OSMesg piMgrMesgBuff[OS_PI_MGR_MESG_BUFF_SIZE + 1];
s32 osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size);
extern u32 gOsPiAccessQueueCreated; extern u32 gOsPiAccessQueueCreated;
extern OSMesgQueue gOsPiMessageQueue; extern OSMesgQueue gOsPiMessageQueue;
void __osDevMgrMain(void *); void __osDevMgrMain(void *);
@ -37,6 +40,9 @@ void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgC
piMgrArgs.unk0c = &__osPiMesgQueue; piMgrArgs.unk0c = &__osPiMesgQueue;
piMgrArgs.unk10 = &gOsPiMessageQueue; piMgrArgs.unk10 = &gOsPiMessageQueue;
piMgrArgs.dma_func = osPiRawStartDma; piMgrArgs.dma_func = osPiRawStartDma;
#ifdef VERSION_EU
piMgrArgs.edma_func = osEPiRawStartDma;
#endif
osCreateThread(&piMgrThread, 0, __osDevMgrMain, (void *) &piMgrArgs, &piMgrStack[0x400], pri); osCreateThread(&piMgrThread, 0, __osDevMgrMain, (void *) &piMgrArgs, &piMgrStack[0x400], pri);
osStartThread(&piMgrThread); osStartThread(&piMgrThread);
__osRestoreInt(int_disabled); __osRestoreInt(int_disabled);

Some files were not shown because too many files have changed in this diff Show more