Browse Source

Refresh 8

master
n64 1 year ago
parent
commit
c45aa301bb
100 changed files with 3548 additions and 5074 deletions
  1. +42
    -0
      CHANGES
  2. +44
    -4
      Makefile
  3. +1
    -1
      README.md
  4. +230
    -220
      asm/boot.s
  5. +45
    -1
      asm/decompress.s
  6. +0
    -657
      asm/non_matchings/eu/audio/synthesis_process_note.s
  7. +0
    -738
      asm/non_matchings/synthesis_process_notes_jp.s
  8. +0
    -733
      asm/non_matchings/synthesis_process_notes_us.s
  9. +6
    -1
      asm/rom_header.s
  10. +1485
    -1485
      assets.json
  11. +242
    -207
      data/behavior_data.c
  12. +1
    -1
      diff.py
  13. +2
    -0
      diff_settings.py
  14. +4
    -3
      enhancements/debug_box.patch
  15. +9
    -9
      enhancements/fps.patch
  16. +15
    -15
      enhancements/mem_error_screen.patch
  17. +10
    -10
      enhancements/record_demo.patch
  18. +1
    -1
      extract_assets.py
  19. +4
    -2
      first-diff.py
  20. +15
    -15
      include/behavior_data.h
  21. +4
    -4
      include/config.h
  22. +0
    -1
      include/geo_commands.h
  23. +1
    -1
      include/macro_presets.h
  24. +4
    -0
      include/macros.h
  25. +3
    -2
      include/make_const_nonconst.h
  26. +16
    -16
      include/object_constants.h
  27. +2
    -2
      include/object_fields.h
  28. +17
    -17
      include/sm64.h
  29. +7
    -4
      include/types.h
  30. +2
    -0
      levels/bbh/geo.c
  31. +2
    -0
      levels/bitdw/geo.c
  32. +1
    -1
      levels/bitdw/script.c
  33. +2
    -0
      levels/bitfs/geo.c
  34. +1
    -1
      levels/bitfs/script.c
  35. +2
    -0
      levels/bits/geo.c
  36. +1
    -1
      levels/bits/script.c
  37. +2
    -0
      levels/bob/geo.c
  38. +2
    -0
      levels/bowser_1/geo.c
  39. +2
    -0
      levels/bowser_2/geo.c
  40. +2
    -0
      levels/bowser_3/geo.c
  41. +2
    -0
      levels/castle_courtyard/geo.c
  42. +2
    -0
      levels/castle_grounds/geo.c
  43. +1
    -1
      levels/castle_grounds/script.c
  44. +2
    -0
      levels/castle_inside/geo.c
  45. +15
    -15
      levels/castle_inside/script.c
  46. +2
    -0
      levels/ccm/geo.c
  47. +2
    -0
      levels/cotmc/geo.c
  48. +2
    -0
      levels/ddd/geo.c
  49. +2
    -0
      levels/ending/geo.c
  50. +2
    -0
      levels/hmc/geo.c
  51. +7
    -5
      levels/intro/geo.c
  52. +4
    -4
      levels/intro/script.c
  53. +2
    -0
      levels/jrb/geo.c
  54. +2
    -0
      levels/lll/geo.c
  55. +2
    -0
      levels/menu/geo.c
  56. +2
    -0
      levels/pss/geo.c
  57. +2
    -0
      levels/rr/geo.c
  58. +2
    -0
      levels/sa/geo.c
  59. +2
    -0
      levels/scripts.c
  60. +2
    -0
      levels/sl/geo.c
  61. +2
    -0
      levels/ssl/geo.c
  62. +2
    -0
      levels/thi/geo.c
  63. +2
    -0
      levels/totwc/geo.c
  64. +2
    -0
      levels/ttc/geo.c
  65. +2
    -0
      levels/ttm/geo.c
  66. +2
    -0
      levels/vcutm/geo.c
  67. +2
    -0
      levels/wdw/geo.c
  68. +2
    -0
      levels/wf/geo.c
  69. +2
    -0
      levels/wmotr/geo.c
  70. +78
    -74
      lib/asm/__osExceptionPreamble.s
  71. +100
    -0
      lib/asm/llmuldiv_gcc.s
  72. +5
    -1
      lib/src/__osDequeueThread.c
  73. +1
    -1
      lib/src/__osGetCurrFaultedThread.c
  74. +10
    -11
      lib/src/func_802F4A20.c
  75. +4
    -4
      lib/src/func_802F71A0.c
  76. +0
    -2
      lib/src/func_802F71F0.c
  77. +44
    -0
      lib/src/libultra_internal.h
  78. +0
    -1
      lib/src/osContInit.c
  79. +10
    -0
      lib/src/osContInternal.h
  80. +6
    -0
      lib/src/osContStartReadData.c
  81. +0
    -2
      lib/src/osCreateMesgQueue.c
  82. +0
    -1
      lib/src/osCreateThread.c
  83. +0
    -3
      lib/src/osDestroyThread.c
  84. +0
    -2
      lib/src/osEepromRead.c
  85. +7
    -1
      lib/src/osEepromWrite.c
  86. +0
    -2
      lib/src/osGetThreadPri.c
  87. +0
    -2
      lib/src/osJamMesg.c
  88. +0
    -2
      lib/src/osRecvMesg.c
  89. +0
    -2
      lib/src/osSendMesg.c
  90. +0
    -3
      lib/src/osSetThreadPri.c
  91. +1
    -2
      lib/src/osStartThread.c
  92. +13
    -8
      sm64.ld
  93. +1
    -5
      sound/sequences/00_sound_player.s
  94. +116
    -114
      src/audio/external.c
  95. +4
    -0
      src/audio/external.h
  96. +6
    -0
      src/audio/internal.h
  97. +204
    -198
      src/audio/synthesis.c
  98. +4
    -1
      src/buffers/buffers.c
  99. +4
    -1
      src/buffers/buffers.h
  100. +624
    -453
      src/engine/behavior_script.c

+ 42
- 0
CHANGES View File

@@ -1,3 +1,45 @@
Refresh #8
1.) Use INT_STATUS_ macros for oInteractStatus (#911)
2.) Update bullet_bill.inc.c (#912)
3.) Make geo.c in levels nonconst to reduce diffs with gcc enhancement patch in future (#913)
4.) Improve process_level_music_dynamics (#915)
5.) add AVOID_UB define for fixing libultra aliasing. (#916)
6.) const hack to TARGET_N64 and tweak ld script (#918)
7.) Replace raw level/course numbers with defines (#919)
8.) Label all graph node flags. (#920)
9.) readme.md capitalization
10.) The Big Function PR (Part 5) (#910)
11.) Label hardware registers (#922)
12.) Match EU synthesis_process_note (#923)
13.) Some quick value changes (#909)
14.) Added sequence player defines (#926)
15.) Shindou diffs 2 [merge game.c and display.c, required for SH] (#927)
16.) Match synthesis_process_notes and use -sopt for synthesis.c (#928)
17.) Fix mips64-binutils for Fedora 31 and similar Linux distros (#931)
18.) Update first-diff.py to work with Shindou (#933)
19.) Labelled behavior_script.c (#929)
20.) shindou diffs up to level_update (#932)
21.) Update diff.py and diff_settings.py to work with SH (#936)
22.) Add some Shindou resources to extract_assets.py (#939)
23.) Label and document gd_math.c (#930)
24.) Label all of Mario's actions. (#941)
25.) Label all particles. (#940)
26.) Renamed death related warpBhvs (#942)
27.) Small Shindou differences (#945)
28.) match player_performed_grab_escape_action in all versions (#943)
29.) add main alignment (aglab2, #947)
30.) Match a bunch of fake EU matchings (#944)
31.) Shindou diffs round 4 (#937)
32.) Easy PAL fake matchings (#946)
33.) Merge object_helpers and object_helpers2 headers (#948)
34.) match cap_check_quicksand (#950)
35.) Shindou crash screen diffs (#938)
36.) Thread6 (#951)
37.) Correct IPL3 function and label addresses (#952)
38.) Add COMPILER flag for Makefile and add official mips gcc support. (#953)
39.) add align to sequence_00 (fixes gcc build) (#957)
40.) Fixed itty bitty typo (#959)

Refresh #7
1.) update README.md (#861)
2.) [eu] fix decompilation bugs in synthesis_process_note (#862)


+ 44
- 4
Makefile View File

@@ -19,6 +19,12 @@ COMPARE ?= 1
NON_MATCHING ?= 0
# Build for the N64 (turn this off for ports)
TARGET_N64 ?= 1
# Compiler to use (ido or gcc)
COMPILER ?= ido

ifeq ($(COMPILER),gcc)
NON_MATCHING := 1
endif

# Release

@@ -51,7 +57,7 @@ ifeq ($(VERSION),sh)
GRUCODE_ASFLAGS := --defsym F3D_NEW=1
TARGET := sm64.sh
# TODO: GET RID OF THIS!!! We should mandate assets for Shindou like EU but we dont have the addresses extracted yet so we'll just pretend you have everything extracted for now.
NOEXTRACT := 1
NOEXTRACT := 1
else
$(error unknown version "$(VERSION)")
endif
@@ -96,6 +102,7 @@ endif

ifeq ($(NON_MATCHING),1)
VERSION_CFLAGS := $(VERSION_CFLAGS) -DNON_MATCHING -DAVOID_UB
VERSION_ASFLAGS := --defsym AVOID_UB=1
COMPARE := 0
endif

@@ -153,8 +160,12 @@ ULTRA_BIN_DIRS := lib/bin

GODDARD_SRC_DIRS := src/goddard src/goddard/dynlists

MIPSISET := -mips2
MIPSBIT := -32

MIPSISET := -mips2 -32
ifeq ($(COMPILER),gcc)
MIPSISET := -mips3
endif

ifeq ($(VERSION),eu)
OPT_FLAGS := -O2
@@ -166,6 +177,11 @@ else
endif
endif

# Use a default opt flag for gcc
ifeq ($(COMPILER),gcc)
OPT_FLAGS := -O2
endif

# File dependencies and variables for specific files
include Makefile.split

@@ -228,6 +244,8 @@ IRIX_ROOT := tools/ido5.3_compiler

ifeq ($(shell type mips-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0)
CROSS := mips-linux-gnu-
else ifeq ($(shell type mips64-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0)
CROSS := mips64-linux-gnu-
else
CROSS := mips64-elf-
endif
@@ -249,6 +267,11 @@ OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
PYTHON := python3

# change the compiler to gcc, to use the default, install the gcc-mips-linux-gnu package
ifeq ($(COMPILER),gcc)
CC := $(CROSS)gcc
endif

ifeq ($(TARGET_N64),1)
TARGET_CFLAGS := -nostdinc -I include/libc -DTARGET_N64
CC_CFLAGS := -fno-builtin
@@ -259,13 +282,19 @@ INCLUDE_CFLAGS := -I include -I $(BUILD_DIR) -I $(BUILD_DIR)/include -I src -I .
# Check code syntax with host compiler
CC_CHECK := gcc -fsyntax-only -fsigned-char $(CC_CFLAGS) $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) -std=gnu90 -Wall -Wextra -Wno-format-security -Wno-main -DNON_MATCHING -DAVOID_UB $(VERSION_CFLAGS) $(GRUCODE_CFLAGS)

COMMON_CFLAGS = $(OPT_FLAGS) $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(MIPSISET) $(GRUCODE_CFLAGS)

ASFLAGS := -march=vr4300 -mabi=32 -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS) $(GRUCODE_ASFLAGS)
CFLAGS = -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -Xfullwarn -signed $(OPT_FLAGS) $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(MIPSISET) $(GRUCODE_CFLAGS)
CFLAGS = -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -Xfullwarn -signed $(COMMON_CFLAGS) $(MIPSBIT)
OBJCOPYFLAGS := --pad-to=0x800000 --gap-fill=0xFF
SYMBOL_LINKING_FLAGS := $(addprefix -R ,$(SEG_FILES))
LDFLAGS := -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(SYMBOL_LINKING_FLAGS)
ENDIAN_BITWIDTH := $(BUILD_DIR)/endian-and-bitwidth

ifeq ($(COMPILER),gcc)
CFLAGS := -march=vr4300 -mfix4300 -mno-shared -G 0 -mhard-float -fno-stack-protector -fno-common -I include -I src/ -I $(BUILD_DIR)/include -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra $(COMMON_CFLAGS)
endif

ifeq ($(shell getconf LONG_BIT), 32)
# Work around memory allocation bug in QEMU
export QEMU_GUEST_BASE := 1
@@ -297,6 +326,11 @@ LOADER = loader64
LOADER_FLAGS = -vwf
SHA1SUM = sha1sum

# Use Objcopy instead of extract_data_for_mio
ifeq ($(COMPILER),gcc)
EXTRACT_DATA_FOR_MIO := $(OBJCOPY) -O binary --only-section=.data
endif

###################### Dependency Check #####################

BINUTILS_VER_MAJOR := $(shell $(LD) --version | grep ^GNU | sed 's/^.* //; s/\..*//g')
@@ -339,6 +373,10 @@ $(BUILD_DIR)/include/text_strings.h: include/text_strings.h.in
$(BUILD_DIR)/include/text_menu_strings.h: include/text_menu_strings.h.in
$(TEXTCONV) charmap_menu.txt $< $@

ifeq ($(COMPILER),gcc)
$(BUILD_DIR)/lib/src/math/%.o: CFLAGS += -fno-builtin
endif

ifeq ($(VERSION),eu)
TEXT_DIRS := text/de text/us text/fr

@@ -486,7 +524,7 @@ $(BUILD_DIR)/assets/mario_anim_data.c: $(wildcard assets/anims/*.inc.c)
$(BUILD_DIR)/assets/demo_data.c: assets/demo_data.json $(wildcard assets/demos/*.bin)
$(PYTHON) tools/demo_data_converter.py assets/demo_data.json $(VERSION_CFLAGS) > $@

ifeq ($(COMPILER),ido)
# Source code
$(BUILD_DIR)/levels/%/leveldata.o: OPT_FLAGS := -g
$(BUILD_DIR)/actors/%.o: OPT_FLAGS := -g
@@ -520,6 +558,7 @@ else
# The source-to-source optimizer copt is enabled for audio. This makes it use
# acpp, which needs -Wp,-+ to handle C++-style comments.
$(BUILD_DIR)/src/audio/effects.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0 -sopt,-inline=sequence_channel_process_sound,-scalaroptimize=1 -Wp,-+
$(BUILD_DIR)/src/audio/synthesis.o: OPT_FLAGS := -O2 -sopt,-scalaroptimize=1 -Wp,-+

# Add a target for build/eu/src/audio/*.copt to make it easier to see debug
$(BUILD_DIR)/src/audio/%.acpp: src/audio/%.c
@@ -527,6 +566,7 @@ $(BUILD_DIR)/src/audio/%.acpp: src/audio/%.c
$(BUILD_DIR)/src/audio/%.copt: $(BUILD_DIR)/src/audio/%.acpp
$(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/lib/copt -signed -I=$< -CMP=$@ -cp=i -scalaroptimize=1
endif
endif

ifeq ($(NON_MATCHING),0)
$(GLOBAL_ASM_O_FILES): CC := $(PYTHON) tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --


+ 1
- 1
README.md View File

@@ -113,4 +113,4 @@ discuss what you would like to change.

Run clang-format on your code to ensure it meets the project's coding standards.

Official discord: https://discord.gg/27JtCWs
Official Discord: https://discord.gg/27JtCWs

+ 230
- 220
asm/boot.s View File

@@ -5,15 +5,24 @@

.include "macros.inc"

# 0xA0000000-0xBFFFFFFF: KSEG1 direct map non-cache mirror of 0x00000000
# 0xA4000000-0xA4000FFF: RSP DMEM

# 0xA4000000-0xA400003F: ROM header

.section .text, "ax"

# 0xA4000040-0xA4000B6F: IPL3

# IPL3 entry point jumped to from IPL2
glabel ipl3_entry # 0xA4000040
mtc0 $zero, $13
mtc0 $zero, $9
mtc0 $zero, $11
lui $t0, %hi(D_A4700000)
addiu $t0, %lo(D_A4700000)
lui $t0, %hi(RI_MODE_REG)
addiu $t0, %lo(RI_MODE_REG)
lw $t1, 0xc($t0)
bnez $t1, .L000003D0
bnez $t1, .LA4000410
nop
addiu $sp, $sp, -0x18
sw $s3, ($sp)
@@ -21,47 +30,47 @@
sw $s5, 8($sp)
sw $s6, 0xc($sp)
sw $s7, 0x10($sp)
lui $t0, %hi(D_A4700000)
addiu $t0, %lo(D_A4700000)
lui $t2, (0xa3f80000 >> 16) # $t2, 0xa3f8
lui $t3, (0xa3f00000 >> 16) # $t3, 0xa3f0
lui $t4, %hi(D_A4300000)
addiu $t4, %lo(D_A4300000)
lui $t0, %hi(RI_MODE_REG)
addiu $t0, %lo(RI_MODE_REG)
lui $t2, (0xa3f80000 >> 16)
lui $t3, (0xa3f00000 >> 16)
lui $t4, %hi(MI_MODE_REG)
addiu $t4, %lo(MI_MODE_REG)
ori $t1, $zero, 64
sw $t1, 4($t0)
li $s1, 8000
.L0000005C:
.LA400009C:
nop
addi $s1, $s1, -1
bnez $s1, .L0000005C
bnez $s1, .LA400009C
nop
sw $zero, 8($t0)
ori $t1, $zero, 20
sw $t1, 0xc($t0)
sw $zero, ($t0)
li $s1, 4
.L00000080:
.LA40000C0:
nop
addi $s1, $s1, -1
bnez $s1, .L00000080
bnez $s1, .LA40000C0
nop
ori $t1, $zero, 14
sw $t1, ($t0)
li $s1, 32
.L0000009C:
.LA40000DC:
addi $s1, $s1, -1
bnez $s1, .L0000009C
bnez $s1, .LA40000DC
ori $t1, $zero, 271
sw $t1, ($t4)
lui $t1, (0x18082838 >> 16) # lui $t1, 0x1808
ori $t1, (0x18082838 & 0xFFFF) # ori $t1, $t1, 0x2838
lui $t1, (0x18082838 >> 16)
ori $t1, (0x18082838 & 0xFFFF)
sw $t1, 0x8($t2)
sw $zero, 0x14($t2)
lui $t1, 0x8000
sw $t1, 0x4($t2)
move $t5, $zero
move $t6, $zero
lui $t7, (0xA3F00000 >> 16) # $t7, 0xa3f0
lui $t7, (0xA3F00000 >> 16)
move $t8, $zero
lui $t9, (0xA3F00000 >> 16)
lui $s6, (0xA0000000 >> 16)
@@ -72,25 +81,25 @@
lui $s4, (0xA0000000 >> 16)
addiu $sp, $sp, -0x48
move $fp, $sp
lui $s0, %hi(D_A4300004) # $s0, 0xa430
lw $s0, %lo(D_A4300004)($s0)
lui $s1, 0x0101 # $s1, 0x101
addiu $s1, 0x0101 # addiu $s1, $s1, 0x101
bne $s0, $s1, .L00000120
lui $s0, %hi(MI_VERSION_REG)
lw $s0, %lo(MI_VERSION_REG)($s0)
lui $s1, (0x01010101 >> 16)
addiu $s1, (0x01010101 & 0xFFFF)
bne $s0, $s1, .LA4000160
nop
li $s0, 512
ori $s1, $t3, 0x4000
b .L00000128
b .LA4000168
nop
.L00000120:
.LA4000160:
li $s0, 1024
ori $s1, $t3, 0x8000
.L00000128:
.LA4000168:
sw $t6, 4($s1)
addiu $s5, $t7, 0xc
jal func_04000778
jal func_A4000778
nop
beqz $v0, .L0000021C
beqz $v0, .LA400025C
nop
sw $v0, ($sp)
li $t1, 8192
@@ -103,7 +112,7 @@
li $t1, 4096
sw $t1, ($t4)
lui $t0, 0xb019
bne $t3, $t0, .L000001A0
bne $t3, $t0, .LA40001E0
nop
lui $t0, 0x800
add $t8, $t8, $t0
@@ -114,12 +123,12 @@
add $s4, $s4, $t0
sll $s2, $s2, 1
addi $s2, $s2, 1
b .L000001A8
b .LA40001E8
nop
.L000001A0:
.LA40001E0:
lui $t0, 0x10
add $s4, $s4, $t0
.L000001A8:
.LA40001E8:
li $t0, 8192
sw $t0, ($t4)
lw $t1, 0x24($t7)
@@ -128,47 +137,47 @@
sw $t0, ($t4)
andi $t1, $t1, 0xffff
li $t0, 1280
bne $t1, $t0, .L000001F0
bne $t1, $t0, .LA4000230
nop
lui $k1, 0x100
and $k0, $k0, $k1
bnez $k0, .L000001F0
bnez $k0, .LA4000230
nop
lui $t0, (0x101C0A04 >> 16) # lui $t0, 0x101c
ori $t0, (0x101C0A04 & 0xFFFF) # ori $t0, $t0, 0xa04
lui $t0, (0x101C0A04 >> 16)
ori $t0, (0x101C0A04 & 0xFFFF)
sw $t0, 0x18($t7)
b .L000001FC
.L000001F0:
lui $t0, (0x080C1204 >> 16) # lui $t0, 0x80c
ori $t0, (0x080C1204 & 0xFFFF) # ori $t0, $t0, 0x1204
b .LA400023C
.LA4000230:
lui $t0, (0x080C1204 >> 16)
ori $t0, (0x080C1204 & 0xFFFF)
sw $t0, 0x18($t7)
.L000001FC:
.LA400023C:
lui $t0, 0x800
add $t6, $t6, $t0
add $t7, $t7, $s0
add $t7, $t7, $s0
addiu $t5, $t5, 1
sltiu $t0, $t5, 8
bnez $t0, .L00000128
bnez $t0, .LA4000168
nop
.L0000021C:
.LA400025C:
li $t0, 0xc4000000
sw $t0, 0xc($t2)
li $t0, 0x80000000
sw $t0, 0x4($t2)
move $sp, $fp
move $v1, $zero
.L00000234:
.LA4000274:
lw $t1, 4($sp)
lui $t0, 0xb009
bne $t1, $t0, .L00000298
bne $t1, $t0, .LA40002D8
nop
sw $t8, 4($s1)
addiu $s5, $t9, 0xc
lw $a0, ($sp)
addi $sp, $sp, 8
li $a1, 1
jal func_04000A40
jal func_A4000A40
nop
lw $t0, ($s6)
lui $t0, 8
@@ -183,14 +192,14 @@
add $t9, $t9, $s0
lui $t0, 0x10
add $s6, $s6, $t0
b .L0000031C
.L00000298:
b .LA400035C
.LA40002D8:
sw $s7, 4($s1)
addiu $s5, $a2, 0xc
lw $a0, ($sp)
addi $sp, $sp, 8
li $a1, 1
jal func_04000A40
jal func_A4000A40
nop
lw $t0, ($a3)
lui $t0, 8
@@ -218,22 +227,22 @@
add $a2, $a2, $s0
lui $t0, 0x20
add $a3, $a3, $t0
.L0000031C:
.LA400035C:
addiu $v1, $v1, 1
slt $t0, $v1, $t5
bnez $t0, .L00000234
bnez $t0, .LA4000274
nop
lui $t2, %hi(D_A4700010) # $t2, 0xa470
lui $t2, %hi(RI_REFRESH_REG)
sll $s2, $s2, 0x13
lui $t1, (0x00063634 >> 16) # lui $t1, 6
ori $t1, (0x00063634 & 0xFFFF) # ori $t1, $t1, 0x3634
lui $t1, (0x00063634 >> 16)
ori $t1, (0x00063634 & 0xFFFF)
or $t1, $t1, $s2
sw $t1, %lo(D_A4700010)($t2)
lw $t1, %lo(D_A4700010)($t2)
lui $t0, (0xA0000300 >> 16) # $t0, 0xa000
ori $t0, (0xA0000300 & 0xFFFF) # ori $t0, $t0, 0x300
lui $t1, (0x0FFFFFFF >> 16) # lui $t1, 0xfff
ori $t1, (0x0FFFFFFF & 0xFFFF) # ori $t1, $t1, 0xffff
sw $t1, %lo(RI_REFRESH_REG)($t2)
lw $t1, %lo(RI_REFRESH_REG)($t2)
lui $t0, (0xA0000300 >> 16)
ori $t0, (0xA0000300 & 0xFFFF)
lui $t1, (0x0FFFFFFF >> 16)
ori $t1, (0x0FFFFFFF & 0xFFFF)
and $s6, $s6, $t1
sw $s6, 0x18($t0)
move $sp, $fp
@@ -244,101 +253,101 @@
lw $s6, 0xc($sp)
lw $s7, 0x10($sp)
addiu $sp, $sp, 0x18
lui $t0, %hi(D_80000000)
addiu $t0, $t0, %lo(D_80000000)
lui $t0, %hi(EXCEPTION_TLB_MISS)
addiu $t0, $t0, %lo(EXCEPTION_TLB_MISS)
addiu $t1, $t0, 0x4000
addiu $t1, $t1, -0x20
mtc0 $zero, $28
mtc0 $zero, $29
.L00000398:
.LA40003D8:
cache 8, ($t0)
sltu $at, $t0, $t1
bnez $at, .L00000398
bnez $at, .LA40003D8
addiu $t0, $t0, 0x20
lui $t0, %hi(D_80000000)
addiu $t0, %lo(D_80000000)
lui $t0, %hi(EXCEPTION_TLB_MISS)
addiu $t0, %lo(EXCEPTION_TLB_MISS)
addiu $t1, $t0, 0x2000
addiu $t1, $t1, -0x10
.L000003B8:
.LA40003F8:
cache 9, ($t0)
sltu $at, $t0, $t1
bnez $at, .L000003B8
bnez $at, .LA40003F8
addiu $t0, $t0, 0x10
b .L00000418
b .LA4000458
nop
.L000003D0:
lui $t0, %hi(D_80000000)
addiu $t0, %lo(D_80000000)
.LA4000410:
lui $t0, %hi(EXCEPTION_TLB_MISS)
addiu $t0, %lo(EXCEPTION_TLB_MISS)
addiu $t1, $t0, 0x4000
addiu $t1, $t1, -0x20
mtc0 $zero, $28
mtc0 $zero, $29
.L000003E8:
.LA4000428:
cache 8, ($t0)
sltu $at, $t0, $t1
bnez $at, .L000003E8
bnez $at, .LA4000428
addiu $t0, $t0, 0x20
lui $t0, %hi(D_80000000)
addiu $t0, %lo(D_80000000)
lui $t0, %hi(EXCEPTION_TLB_MISS)
addiu $t0, %lo(EXCEPTION_TLB_MISS)
addiu $t1, $t0, 0x2000
addiu $t1, $t1, -0x10
.L00000408:
.LA4000448:
cache 1, ($t0)
sltu $at, $t0, $t1
bnez $at, .L00000408
bnez $at, .LA4000448
addiu $t0, $t0, 0x10
.L00000418:
lui $t2, %hi(D_A4000000)
addiu $t2, $t2, %lo(D_A4000000)
.LA4000458:
lui $t2, %hi(SP_DMEM)
addiu $t2, $t2, %lo(SP_DMEM)
lui $t3, 0xfff0
lui $t1, 0x0010 # $t1, 0x10
lui $t1, 0x0010
and $t2, $t2, $t3
lui $t0, %hi(D_A40004C0) # $t0, 0xa400
addiu $t1, -1 # addiu $t1, $t1, -1
lui $t3, %hi(D_A4000774) # $t3, 0xa400
addiu $t0, %lo(D_A40004C0) # addiu $t0, $t0, 0x4c0
addiu $t3, %lo(D_A4000774) # addiu $t3, $t3, 0x774
lui $t0, %hi(SP_DMEM_UNK0)
addiu $t1, -1
lui $t3, %hi(SP_DMEM_UNK1)
addiu $t0, %lo(SP_DMEM_UNK0)
addiu $t3, %lo(SP_DMEM_UNK1)
and $t0, $t0, $t1
and $t3, $t3, $t1
lui $t1, 0xa000
or $t0, $t0, $t2
or $t3, $t3, $t2
addiu $t1, $t1, 0
.L00000458:
.LA4000498:
lw $t5, ($t0)
addiu $t0, $t0, 4
sltu $at, $t0, $t3
addiu $t1, $t1, 4
bnez $at, .L00000458
bnez $at, .LA4000498
sw $t5, -4($t1)
lui $t4, %hi(D_80000000)
addiu $t4, %lo(D_80000000)
lui $t4, %hi(EXCEPTION_TLB_MISS)
addiu $t4, %lo(EXCEPTION_TLB_MISS)
jr $t4
nop
lui $t3, %hi(D_B0000008) # $t3, 0xb000
lui $t3, %hi(D_B0000008)
lw $t1, %lo(D_B0000008)($t3)
lui $t2, (0x1FFFFFFF >> 16) # lui $t2, 0x1fff
ori $t2, (0x1FFFFFFF & 0xFFFF) # ori $t2, $t2, 0xffff
lui $at, %hi(D_A4600000)
lui $t2, (0x1FFFFFFF >> 16)
ori $t2, (0x1FFFFFFF & 0xFFFF)
lui $at, %hi(PI_DRAM_ADDR_REG)
and $t1, $t1, $t2
sw $t1, %lo(D_A4600000)($at)
lui $t0, %hi(D_A4600010) # $t0, 0xa460
.L000004A0:
lw $t0, %lo(D_A4600010)($t0)
sw $t1, %lo(PI_DRAM_ADDR_REG)($at)
lui $t0, %hi(PI_STATUS_REG)
.LA40004D0:
lw $t0, %lo(PI_STATUS_REG)($t0)
andi $t0, $t0, 2
bnezl $t0, .L000004A0
lui $t0, %hi(D_A4600010)
bnezl $t0, .LA40004D0
lui $t0, %hi(PI_STATUS_REG)
li $t0, 0x1000
add $t0, $t0, $t3
and $t0, $t0, $t2
lui $at, %hi(D_A4600004) # $at, 0xa460
sw $t0, %lo(D_A4600004)($at)
lui $t2, 0x0010 # $t2, 0x10
addiu $t2, 0xFFFF # addiu $t2, $t2, -1
lui $at, %hi(D_A460000C) # $at, 0xa460
sw $t2, %lo(D_A460000C)($at)
lui $at, %hi(PI_CART_ADDR_REG)
sw $t0, %lo(PI_CART_ADDR_REG)($at)
lui $t2, 0x0010
addiu $t2, 0xFFFF
lui $at, %hi(PI_WR_LEN_REG)
sw $t2, %lo(PI_WR_LEN_REG)($at)

.L000004D4:
.LA4000514:
nop
nop
nop
@@ -367,16 +376,16 @@
nop
nop
nop
lui $t3, %hi(D_A4600010) # $t3, 0xa460
lw $t3, %lo(D_A4600010)($t3)
andi $t3, $t3, 1
bnez $t3, .L000004D4
lui $t3, %hi(PI_STATUS_REG)
lw $t3, %lo(PI_STATUS_REG)($t3)
andi $t3, $t3, 0x1
bnez $t3, .LA4000514
nop
lui $t3, %hi(D_B0000008) # $t3, 0xb000
lui $t3, %hi(D_B0000008)
lw $a0, %lo(D_B0000008)($t3)
move $a1, $s6
lui $at, (0x5D588B65 >> 16) # lui $at, 0x5d58
ori $at, (0x5D588B65 & 0xFFFF) # ori $at, $at, 0x8b65
lui $at, (0x5D588B65 >> 16)
ori $at, (0x5D588B65 & 0xFFFF)
multu $a1, $at
addiu $sp, $sp, -0x20
sw $ra, 0x1c($sp)
@@ -394,14 +403,14 @@
move $s0, $v0
move $a2, $v0
move $t4, $v0
.L000005B0:
.LA40005F0:
lw $v0, ($t1)
addu $v1, $a3, $v0
sltu $at, $v1, $a3
beqz $at, .L000005C8
beqz $at, .LA4000608
move $a1, $v1
addiu $t2, $t2, 1
.L000005C8:
.LA4000608:
andi $v1, $v0, 0x1f
subu $t7, $t5, $v1
srlv $t8, $v0, $t7
@@ -410,104 +419,103 @@
sltu $at, $a2, $v0
move $a3, $a1
xor $t3, $t3, $v0
beqz $at, .L000005FC
beqz $at, .LA400063C
addu $s0, $s0, $a0
xor $t9, $a3, $v0
b .L00000600
b .LA4000640
xor $a2, $t9, $a2
.L000005FC:
.LA400063C:
xor $a2, $a2, $a0
.L00000600:
.LA4000640:
addiu $t0, $t0, 4
xor $t7, $v0, $s0
addiu $t1, $t1, 4
bne $t0, $ra, .L000005B0
bne $t0, $ra, .LA40005F0
addu $t4, $t7, $t4
xor $t6, $a3, $t2
xor $a3, $t6, $t3
xor $t8, $s0, $a2
xor $s0, $t8, $t4
lui $t3, %hi(D_B0000010) # $t3, 0xb000
lui $t3, %hi(D_B0000010)
lw $t0, %lo(D_B0000010)($t3)
bne $a3, $t0, .L00000648
bne $a3, $t0, halt
nop
lw $t0, %lo(D_B0000014)($t3)
bne $s0, $t0, .L00000648
bne $s0, $t0, halt
nop
bal func_00000650
bal func_A4000690
nop

func_00000648:
.L00000648:
bal func_00000648
halt:
bal halt
nop

func_00000650:
lui $t1, %hi(D_A4080000)
lw $t1, %lo(D_A4080000)($t1)
func_A4000690:
lui $t1, %hi(SP_PC)
lw $t1, %lo(SP_PC)($t1)
lw $s0, 0x14($sp)
lw $ra, 0x1c($sp)
beqz $t1, .L0000067C
beqz $t1, .LA40006BC
addiu $sp, $sp, 0x20
li $t2, 65
lui $at, %hi(D_A4040010) # $at, 0xa404
sw $t2, %lo(D_A4040010)($at)
lui $at, %hi(D_A4080000)
sw $zero, %lo(D_A4080000)($at)
.L0000067C:
lui $t3, (0x00AAAAAE >> 16) # lui $t3, 0xaa
ori $t3, (0x00AAAAAE & 0xFFFF) # ori $t3, $t3, 0xaaae
lui $at, %hi(D_A4040010) # $at, 0xa404
sw $t3, %lo(D_A4040010)($at)
lui $at, %hi(D_A430000C) # $at, 0xa430
lui $at, %hi(SP_STATUS_REG)
sw $t2, %lo(SP_STATUS_REG)($at)
lui $at, %hi(SP_PC)
sw $zero, %lo(SP_PC)($at)
.LA40006BC:
lui $t3, (0x00AAAAAE >> 16)
ori $t3, (0x00AAAAAE & 0xFFFF)
lui $at, %hi(SP_STATUS_REG)
sw $t3, %lo(SP_STATUS_REG)($at)
lui $at, %hi(MI_INTR_MASK_REG)
li $t0, 1365
sw $t0, %lo(D_A430000C)($at)
lui $at, %hi(D_A4800018) # $at, 0xa480
sw $zero, %lo(D_A4800018)($at)
lui $at, %hi(D_A450000C) # $at, 0xa450
sw $zero, %lo(D_A450000C)($at)
lui $at, %hi(D_A4300000)
sw $t0, %lo(MI_INTR_MASK_REG)($at)
lui $at, %hi(SI_STATUS_REG)
sw $zero, %lo(SI_STATUS_REG)($at)
lui $at, %hi(AI_STATUS_REG)
sw $zero, %lo(AI_STATUS_REG)($at)
lui $at, %hi(MI_MODE_REG)
li $t1, 2048
sw $t1, %lo(D_A4300000)($at)
sw $t1, %lo(MI_MODE_REG)($at)
li $t1, 2
lui $at, %hi(D_A4600010) # $at, 0xa460
lui $t0, (0xA0000300 >> 16) # $t0, 0xa000
ori $t0, (0xA0000300 & 0xFFFF) # ori $t0, $t0, 0x300
sw $t1, %lo(D_A4600010)($at)
lui $at, %hi(PI_STATUS_REG)
lui $t0, (0xA0000300 >> 16)
ori $t0, (0xA0000300 & 0xFFFF)
sw $t1, %lo(PI_STATUS_REG)($at)
sw $s7, 0x14($t0)
sw $s5, 0xc($t0)
sw $s3, 0x4($t0)
beqz $s3, .L000006E8
beqz $s3, .LA4000728
sw $s4, ($t0)
lui $t1, 0xa600
b .L000006F0
b .LA4000730
addiu $t1, $t1, 0
.L000006E8:
.LA4000728:
lui $t1, 0xb000
addiu $t1, $t1, 0
.L000006F0:
.LA4000730:
sw $t1, 0x8($t0)
lui $t0, %hi(D_A4000000)
addiu $t0, %lo(D_A4000000)
lui $t0, %hi(SP_DMEM)
addiu $t0, %lo(SP_DMEM)
addi $t1, $t0, 0x1000
.L00000700:
.LA4000740:
addiu $t0, $t0, 4
bne $t0, $t1, .L00000700
bne $t0, $t1, .LA4000740
sw $zero, -4($t0)
lui $t0, %hi(D_A4001000) # $t0, 0xa400
addiu $t0, %lo(D_A4001000) # addiu $t0, $t0, 0x1000
lui $t0, %hi(SP_IMEM)
addiu $t0, %lo(SP_IMEM)
addi $t1, $t0, 0x1000
.L00000718:
.LA4000758:
addiu $t0, $t0, 4
bne $t0, $t1, .L00000718
bne $t0, $t1, .LA4000758
sw $zero, -4($t0)
lui $t3, %hi(D_B0000008) # $t3, 0xb000
lui $t3, %hi(D_B0000008)
lw $t1, %lo(D_B0000008)($t3)
jr $t1
nop
nop

func_04000778:
func_A4000778:
addiu $sp, $sp, -0xa0
sw $s0, 0x40($sp)
sw $s1, 0x44($sp)
@@ -537,15 +545,15 @@ func_04000778:
sw $s7, 0x5c($sp)
sw $fp, 0x60($sp)
sw $ra, 0x64($sp)
.L000007AC:
jal func_04000880
.LA40007EC:
jal func_A4000880
nop
addiu $s0, $s0, 1
slti $t1, $s0, 4
bnez $t1, .L000007AC
bnez $t1, .LA40007EC
addu $s1, $s1, $v0
srl $a0, $s1, 2
jal func_04000A40
jal func_A4000A40
li $a1, 1
lw $ra, 0x64($sp)
srl $v0, $s1, 2
@@ -576,19 +584,19 @@ func_04000778:
jr $ra
addiu $sp, $sp, 0xa0

func_04000880:
func_A4000880:
addiu $sp, $sp, -0x20
sw $ra, 0x1c($sp)
move $t1, $zero
move $t3, $zero
move $t4, $zero
.L00000854:
.LA4000894:
slti $k0, $t4, 0x40
beql $k0, $zero, .L000008BC
beql $k0, $zero, .LA40008FC
move $v0, $zero
jal func_0400090C
jal func_A400090C
move $a0, $t4
blezl $v0, .L0000088C
blezl $v0, .LA40008CC
slti $k0, $t1, 0x50
subu $k0, $v0, $t1
multu $k0, $t4
@@ -597,61 +605,61 @@ func_04000880:
addu $t3, $t3, $k0
nop
slti $k0, $t1, 0x50
.L0000088C:
bnez $k0, .L00000854
.LA40008CC:
bnez $k0, .LA4000894
addiu $t4, $t4, 1
sll $a0, $t3, 2
subu $a0, $a0, $t3
sll $a0, $a0, 2
subu $a0, $a0, $t3
sll $a0, $a0, 1
jal func_04000980
addiu $a0, $a0, -0x370 # compute (t3 - 40) * 22
b .L000008C0
jal func_A4000980
addiu $a0, $a0, -0x370
b .LA4000900
lw $ra, 0x1c($sp)
move $v0, $zero
.L000008BC:
.LA40008FC:
lw $ra, 0x1c($sp)
.L000008C0:
.LA4000900:
addiu $sp, $sp, 0x20
jr $ra
nop

func_0400090C:
func_A400090C:
addiu $sp, $sp, -0x28
sw $ra, 0x1c($sp)
move $v0, $zero
jal func_04000A40
jal func_A4000A40
li $a1, 2
move $fp, $zero
li $k0, -1
.L000008E8:
.LA4000928:
sw $k0, 4($s4)
lw $v1, 4($s4)
sw $k0, ($s4)
sw $k0, ($s4)
move $gp, $zero
srl $v1, $v1, 0x10
.L00000900:
.LA4000940:
andi $k0, $v1, 1
beql $k0, $zero, .L00000914
beql $k0, $zero, .LA4000954
addiu $gp, $gp, 1
addiu $v0, $v0, 1
addiu $gp, $gp, 1
.L00000914:
.LA4000954:
slti $k0, $gp, 8
bnez $k0, .L00000900
bnez $k0, .LA4000940
srl $v1, $v1, 1
addiu $fp, $fp, 1
slti $k0, $fp, 0xa
bnezl $k0, .L000008E8
bnezl $k0, .LA4000928
li $k0, -1
lw $ra, 0x1c($sp)
addiu $sp, $sp, 0x28
jr $ra
nop

func_04000980:
func_A4000980:
addiu $sp, $sp, -0x28
sw $ra, 0x1c($sp)
sw $a0, 0x20($sp)
@@ -661,18 +669,18 @@ func_04000980:
li $t5, 51200
move $t6, $zero
slti $k0, $t6, 0x40
.L00000964:
bnezl $k0, .L00000978
.LA40009A4:
bnezl $k0, .LA40009B8
move $a0, $t6
b .L000009F0
b .LA4000A30
move $v0, $zero
move $a0, $t6
.L00000978:
jal func_04000A40
.LA40009B8:
jal func_A4000A40
li $a1, 1
jal func_04000AD0
jal func_A4000AD0
addiu $a0, $sp, 0x27
jal func_04000AD0
jal func_A4000AD0
addiu $a0, $sp, 0x27
lbu $k0, 0x27($sp)
li $k1, 800
@@ -680,44 +688,44 @@ func_04000980:
multu $k0, $k1
mflo $t0
subu $k0, $t0, $a0
bgezl $k0, .L000009B8
bgezl $k0, .LA40009F8
slt $k1, $k0, $t5
subu $k0, $a0, $t0
slt $k1, $k0, $t5
.L000009B8:
beql $k1, $zero, .L000009CC
.LA40009F8:
beql $k1, $zero, .LA4000A0C
lw $a0, 0x20($sp)
move $t5, $k0
move $t2, $t6
lw $a0, 0x20($sp)
.L000009CC:
.LA4000A0C:
slt $k1, $t0, $a0
beql $k1, $zero, .L000009EC
beql $k1, $zero, .LA4000A2C
addu $v0, $t2, $t6
addiu $t6, $t6, 1
slti $k1, $t6, 0x41
bnezl $k1, .L00000964
bnezl $k1, .LA40009A4
slti $k0, $t6, 0x40
addu $v0, $t2, $t6
.L000009EC:
.LA4000A2C:
srl $v0, $v0, 1
.L000009F0:
.LA4000A30:
lw $ra, 0x1c($sp)
addiu $sp, $sp, 0x28
jr $ra
nop

func_04000A40:
func_A4000A40:
addiu $sp, $sp, -0x28
andi $a0, $a0, 0xff
li $k1, 1
xori $a0, $a0, 0x3f
sw $ra, 0x1c($sp)
bne $a1, $k1, .L00000A24
bne $a1, $k1, .LA4000A64
lui $t7, 0x4600
lui $k0, 0x8000
or $t7, $t7, $k0
.L00000A24:
.LA4000A64:
andi $k0, $a0, 1
sll $k0, $k0, 6
or $t7, $t7, $k0
@@ -737,26 +745,26 @@ func_04000A40:
sll $k0, $k0, 0x12
or $t7, $t7, $k0
li $k1, 1
bne $a1, $k1, .L00000A80
bne $a1, $k1, .LA4000AC0
sw $t7, ($s5)
lui $k0, %hi(D_A4300000)
sw $zero, %lo(D_A4300000)($k0)
.L00000A80:
lui $k0, %hi(MI_MODE_REG)
sw $zero, %lo(MI_MODE_REG)($k0)
.LA4000AC0:
lw $ra, 0x1c($sp)
addiu $sp, $sp, 0x28
jr $ra
nop

func_04000AD0:
func_A4000AD0:
addiu $sp, $sp, -0x28
sw $ra, 0x1c($sp)
li $k0, 0x2000
lui $k1, %hi(D_A4300000)
sw $k0, %lo(D_A4300000)($k1)
lui $k1, %hi(MI_MODE_REG)
sw $k0, %lo(MI_MODE_REG)($k1)
move $fp, $zero
lw $fp, ($s5)
li $k0, 0x1000
sw $k0, %lo(D_A4300000)($k1)
sw $k0, %lo(MI_MODE_REG)($k1)
li $k1, 0x40
and $k1, $k1, $fp
srl $k1, $k1, 6
@@ -789,4 +797,6 @@ func_04000AD0:
nop
nop

# 0xA4000B70-0xA4000FFF: IPL3 Font
glabel ipl3_font
.incbin "lib/bin/ipl3_font.bin"

+ 45
- 1
asm/decompress.s View File

@@ -11,7 +11,51 @@
# This file is handwritten.

glabel decompress
.ifdef VERSION_EU
.if VERSION_SH == 1
lw $a3, 8($a0)
lw $t9, 0xc($a0)
lw $t8, 4($a0)
add $a3, $a3, $a0
add $t9, $t9, $a0
move $a2, $zero
addi $a0, $a0, 0x10
add $t8, $t8, $a1
.L802772C0:
bnel $a2, $zero, .L802772D8
slt $t1, $t0, $zero
lw $t0, ($a0)
li $a2, 32
addi $a0, $a0, 4
slt $t1, $t0, $zero
.L802772D8:
beql $t1, $zero, .L802772F8
lhu $t2, ($a3)
lb $t2, ($t9)
addi $t9, $t9, 1
addi $a1, $a1, 1
b .L80277324
sb $t2, -1($a1)
lhu $t2, ($a3)
.L802772F8:
addi $a3, $a3, 2
srl $t3, $t2, 0xc
andi $t2, $t2, 0xfff
sub $t1, $a1, $t2
addi $t3, $t3, 3
.L8027730C:
lb $t2, -1($t1)
addi $t3, $t3, -1
addi $t1, $t1, 1
addi $a1, $a1, 1
bnez $t3, .L8027730C
sb $t2, -1($a1)
.L80277324:
sll $t0, $t0, 1
bne $a1, $t8, .L802772C0
addi $a2, $a2, -1
jr $ra
nop
.elseif VERSION_EU == 1
lw $a3, 8($a0)
lw $t9, 0xc($a0)
lw $t8, 4($a0)


+ 0
- 657
asm/non_matchings/eu/audio/synthesis_process_note.s View File

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

+ 0
- 738
asm/non_matchings/synthesis_process_notes_jp.s View File

@@ -1,738 +0,0 @@
.late_rodata
glabel D_80337BB0
.word 0x3FFFFFD6, 0x0E94EE39
glabel D_80337BB8
.word 0x3FFFFEB0, 0
glabel D_80337BC0
.word 0x400FFFDB, 0x4CC25072
glabel D_80337BC8
.word 0x407FFEDA, 0

.text
glabel synthesis_process_notes
/* 0CF480 80314480 27BDFE88 */ addiu $sp, $sp, -0x178
/* 0CF484 80314484 3C0E8022 */ lui $t6, %hi(gMaxSimultaneousNotes) # $t6, 0x8022
/* 0CF488 80314488 8DCE6D70 */ lw $t6, %lo(gMaxSimultaneousNotes)($t6)
/* 0CF48C 8031448C AFB40030 */ sw $s4, 0x30($sp)
/* 0CF490 80314490 00C0A025 */ move $s4, $a2
/* 0CF494 80314494 AFBF0044 */ sw $ra, 0x44($sp)
/* 0CF498 80314498 AFBE0040 */ sw $fp, 0x40($sp)
/* 0CF49C 8031449C AFB7003C */ sw $s7, 0x3c($sp)
/* 0CF4A0 803144A0 AFB60038 */ sw $s6, 0x38($sp)
/* 0CF4A4 803144A4 AFB50034 */ sw $s5, 0x34($sp)
/* 0CF4A8 803144A8 AFB3002C */ sw $s3, 0x2c($sp)
/* 0CF4AC 803144AC AFB20028 */ sw $s2, 0x28($sp)
/* 0CF4B0 803144B0 AFB10024 */ sw $s1, 0x24($sp)
/* 0CF4B4 803144B4 AFB00020 */ sw $s0, 0x20($sp)
/* 0CF4B8 803144B8 AFA40178 */ sw $a0, 0x178($sp)
/* 0CF4BC 803144BC AFA5017C */ sw $a1, 0x17c($sp)
/* 0CF4C0 803144C0 AFA00174 */ sw $zero, 0x174($sp)
/* 0CF4C4 803144C4 19C00267 */ blez $t6, .L80314E64
/* 0CF4C8 803144C8 AFA0015C */ sw $zero, 0x15c($sp)
/* 0CF4CC 803144CC AFA0006C */ sw $zero, 0x6c($sp)
/* 0CF4D0 803144D0 3C1F8000 */ lui $ra, 0x8000
.L803144D4:
/* 0CF4D4 803144D4 3C188022 */ lui $t8, %hi(gNotes) # $t8, 0x8022
/* 0CF4D8 803144D8 8F182A10 */ lw $t8, %lo(gNotes)($t8)
/* 0CF4DC 803144DC 8FAF006C */ lw $t7, 0x6c($sp)
/* 0CF4E0 803144E0 3C198022 */ lui $t9, %hi(gBankLoadStatus)
/* 0CF4E4 803144E4 3C010100 */ lui $at, 0x100
/* 0CF4E8 803144E8 01F8B821 */ addu $s7, $t7, $t8
/* 0CF4EC 803144EC 92E20007 */ lbu $v0, 7($s7)
/* 0CF4F0 803144F0 8FB80174 */ lw $t8, 0x174($sp)
/* 0CF4F4 803144F4 0322C821 */ addu $t9, $t9, $v0
/* 0CF4F8 803144F8 933918D0 */ lbu $t9, %lo(gBankLoadStatus)($t9)
/* 0CF4FC 803144FC 2B2E0002 */ slti $t6, $t9, 2
/* 0CF500 80314500 11C00006 */ beqz $t6, .L8031451C
/* 0CF504 80314504 00027A00 */ sll $t7, $v0, 8
/* 0CF508 80314508 01F8C821 */ addu $t9, $t7, $t8
/* 0CF50C 8031450C 03217021 */ addu $t6, $t9, $at
/* 0CF510 80314510 3C018033 */ lui $at, %hi(gAudioErrorFlags)
/* 0CF514 80314514 10000249 */ b .L80314E3C
/* 0CF518 80314518 AC2E1D40 */ sw $t6, %lo(gAudioErrorFlags)($at)
.L8031451C:
/* 0CF51C 8031451C 8EEF0000 */ lw $t7, ($s7)
/* 0CF520 80314520 000FC7C2 */ srl $t8, $t7, 0x1f
/* 0CF524 80314524 53000246 */ beql $t8, $zero, .L80314E40
/* 0CF528 80314528 8FAE0174 */ lw $t6, 0x174($sp)
/* 0CF52C 8031452C 8FB9017C */ lw $t9, 0x17c($sp)
/* 0CF530 80314530 AFA00148 */ sw $zero, 0x148($sp)
/* 0CF534 80314534 24010001 */ li $at, 1
/* 0CF538 80314538 00197040 */ sll $t6, $t9, 1
/* 0CF53C 8031453C AFAE0048 */ sw $t6, 0x48($sp)
/* 0CF540 80314540 8EEF0000 */ lw $t7, ($s7)
/* 0CF544 80314544 44802000 */ mtc1 $zero, $f4
/* 0CF548 80314548 240E0001 */ li $t6, 1
/* 0CF54C 8031454C 000FC040 */ sll $t8, $t7, 1
/* 0CF550 80314550 0018CFC2 */ srl $t9, $t8, 0x1f
/* 0CF554 80314554 17210004 */ bne $t9, $at, .L80314568
/* 0CF558 80314558 02802025 */ move $a0, $s4
/* 0CF55C 8031455C AFAE0148 */ sw $t6, 0x148($sp)
/* 0CF560 80314560 AEE00014 */ sw $zero, 0x14($s7)
/* 0CF564 80314564 A6E00020 */ sh $zero, 0x20($s7)
.L80314568:
/* 0CF568 80314568 C6E20038 */ lwc1 $f2, 0x38($s7)
/* 0CF56C 8031456C 3C014000 */ li $at, 0x40000000 # 2.000000
/* 0CF570 80314570 44812800 */ mtc1 $at, $f5
/* 0CF574 80314574 46001021 */ cvt.d.s $f0, $f2
/* 0CF578 80314578 3C018033 */ lui $at, %hi(D_80337BC0)
/* 0CF57C 8031457C 4624003C */ c.lt.d $f0, $f4
/* 0CF580 80314580 02E02825 */ move $a1, $s7
/* 0CF584 80314584 4500000E */ bc1f .L803145C0
/* 0CF588 80314588 00000000 */ nop
/* 0CF58C 8031458C 3C018033 */ lui $at, %hi(D_80337BB0)
/* 0CF590 80314590 D4267BB0 */ ldc1 $f6, %lo(D_80337BB0)($at)
/* 0CF594 80314594 240F0001 */ li $t7, 1
/* 0CF598 80314598 AFAF00E8 */ sw $t7, 0xe8($sp)
/* 0CF59C 8031459C 4620303C */ c.lt.d $f6, $f0
/* 0CF5A0 803145A0 3C018033 */ lui $at, %hi(D_80337BB8)
/* 0CF5A4 803145A4 45000004 */ bc1f .L803145B8
/* 0CF5A8 803145A8 00000000 */ nop
/* 0CF5AC 803145AC C4287BB8 */ lwc1 $f8, %lo(D_80337BB8)($at)
/* 0CF5B0 803145B0 E6E80038 */ swc1 $f8, 0x38($s7)
/* 0CF5B4 803145B4 C6E20038 */ lwc1 $f2, 0x38($s7)
.L803145B8:
/* 0CF5B8 803145B8 10000012 */ b .L80314604
/* 0CF5BC 803145BC 46001306 */ mov.s $f12, $f2
.L803145C0:
/* 0CF5C0 803145C0 D42A7BC0 */ ldc1 $f10, %lo(D_80337BC0)($at)
/* 0CF5C4 803145C4 24180002 */ li $t8, 2
/* 0CF5C8 803145C8 44802000 */ mtc1 $zero, $f4
/* 0CF5CC 803145CC 4620503E */ c.le.d $f10, $f0
/* 0CF5D0 803145D0 AFB800E8 */ sw $t8, 0xe8($sp)
/* 0CF5D4 803145D4 3C018033 */ lui $at, %hi(D_80337BC8)
/* 0CF5D8 803145D8 45020006 */ bc1fl .L803145F4
/* 0CF5DC 803145DC 3C013FE0 */ lui $at, 0x3fe0
/* 0CF5E0 803145E0 C4307BC8 */ lwc1 $f16, %lo(D_80337BC8)($at)
/* 0CF5E4 803145E4 E6F00038 */ swc1 $f16, 0x38($s7)
/* 0CF5E8 803145E8 C6F20038 */ lwc1 $f18, 0x38($s7)
/* 0CF5EC 803145EC 46009021 */ cvt.d.s $f0, $f18
/* 0CF5F0 803145F0 3C013FE0 */ li $at, 0x3FE00000 # 1.750000
.L803145F4:
/* 0CF5F4 803145F4 44812800 */ mtc1 $at, $f5
/* 0CF5F8 803145F8 00000000 */ nop
/* 0CF5FC 803145FC 46240182 */ mul.d $f6, $f0, $f4
/* 0CF600 80314600 46203320 */ cvt.s.d $f12, $f6
.L80314604:
/* 0CF604 80314604 3C014700 */ li $at, 0x47000000 # 32768.000000
/* 0CF608 80314608 44814000 */ mtc1 $at, $f8
/* 0CF60C 8031460C 8FB8017C */ lw $t8, 0x17c($sp)
/* 0CF610 80314610 46086282 */ mul.s $f10, $f12, $f8
/* 0CF614 80314614 4600540D */ trunc.w.s $f16, $f10
/* 0CF618 80314618 440E8000 */ mfc1 $t6, $f16
/* 0CF61C 8031461C 00000000 */ nop
/* 0CF620 80314620 31CFFFFF */ andi $t7, $t6, 0xffff
/* 0CF624 80314624 01F80019 */ multu $t7, $t8
/* 0CF628 80314628 AFAF005C */ sw $t7, 0x5c($sp)
/* 0CF62C 8031462C 96EF0020 */ lhu $t7, 0x20($s7)
/* 0CF630 80314630 8EE20024 */ lw $v0, 0x24($s7)
/* 0CF634 80314634 0000C812 */ mflo $t9
/* 0CF638 80314638 00197040 */ sll $t6, $t9, 1
/* 0CF63C 8031463C 01EE1821 */ addu $v1, $t7, $t6
/* 0CF640 80314640 1440000E */ bnez $v0, .L8031467C
/* 0CF644 80314644 A6E30020 */ sh $v1, 0x20($s7)
/* 0CF648 80314648 00038402 */ srl $s0, $v1, 0x10
/* 0CF64C 8031464C 02003025 */ move $a2, $s0
/* 0CF650 80314650 0C0C53C2 */ jal load_wave_samples
/* 0CF654 80314654 AFA00148 */ sw $zero, 0x148($sp)
/* 0CF658 80314658 8EE90014 */ lw $t1, 0x14($s7)
/* 0CF65C 8031465C 0040A025 */ move $s4, $v0
/* 0CF660 80314660 0009C840 */ sll $t9, $t1, 1
/* 0CF664 80314664 272F0180 */ addiu $t7, $t9, 0x180
/* 0CF668 80314668 A7AF00D6 */ sh $t7, 0xd6($sp)
/* 0CF66C 8031466C 01307021 */ addu $t6, $t1, $s0
/* 0CF670 80314670 AEEE0014 */ sw $t6, 0x14($s7)
/* 0CF674 80314674 100001B9 */ b .L80314D5C
/* 0CF678 80314678 8EE50000 */ lw $a1, ($s7)
.L8031467C:
/* 0CF67C 8031467C 8C460000 */ lw $a2, ($v0)
/* 0CF680 80314680 00031402 */ srl $v0, $v1, 0x10
/* 0CF684 80314684 8CD80008 */ lw $t8, 8($a2)
/* 0CF688 80314688 AFB80160 */ sw $t8, 0x160($sp)
/* 0CF68C 8031468C 8F0F0004 */ lw $t7, 4($t8)
/* 0CF690 80314690 8FB800E8 */ lw $t8, 0xe8($sp)
/* 0CF694 80314694 AFAF0110 */ sw $t7, 0x110($sp)