From 1f8bee518d055ebdd43232a451334d34b57b9a79 Mon Sep 17 00:00:00 2001 From: JaceCear <11230293+JaceCear@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:07:36 +0100 Subject: [PATCH] Implement m4a for PC (#166) * Refactor m4a for better names * Bring in m4a PC backend code * Update songs data to work on 64bit * Move m4a to it's own folder * Add linker map to sdl build --------- Co-authored-by: Oliver Bell --- .vscode/c_cpp_properties.json | 14 + .vscode/launch.json | 8 + .vscode/settings.json | 8 +- Makefile | 23 +- asm/macros/music_voice.inc | 22 +- asm/macros/portable.inc | 11 +- .../sound/voicegroups/voicegroup000.inc | 92 + .../sound/voicegroups/voicegroup001.inc | 51 + constants/m4a_constants.inc | 257 ++ data/sound_data.s | 1 + include/gba/defines.h | 9 +- include/gba/m4a_internal.h | 455 ---- include/global.h | 2 +- include/lib/{ => agb_flash}/agb_flash.h | 0 .../{gba => lib/agb_flash}/flash_internal.h | 16 +- include/lib/m4a.h | 36 - include/lib/m4a/m4a.h | 34 + include/lib/m4a/m4a_internal.h | 468 ++++ include/platform/platform.h | 16 +- include/platform/shared/audio/README.txt | 4 + include/platform/shared/audio/cgb_audio.h | 36 + include/platform/shared/audio/cgb_tables.h | 2100 +++++++++++++++++ ldscript.txt | 30 +- sound/music_player_table.inc | 28 +- sound/song_table.inc | 506 ++++ sound/songs/se_291.s | 1 + sound/voicegroups/voicegroup000.inc | 92 + sound/voicegroups/voicegroup001.inc | 36 + sound/voicegroups/voicegroup002.inc | 47 + sound/voicegroups/voicegroup003.inc | 92 + sound/voicegroups/voicegroup004.inc | 37 + sound/voicegroups/voicegroup005.inc | 127 + sound/voicegroups/voicegroup006.inc | 33 + sound/voicegroups/voicegroup007.inc | 128 + sound/voicegroups/voicegroup008.inc | 128 + sound/voicegroups/voicegroup009.inc | 128 + sound/voicegroups/voicegroup010.inc | 128 + sound/voicegroups/voicegroup011.inc | 92 + sound/voicegroups/voicegroup012.inc | 83 + sound/voicegroups/voicegroup013.inc | 128 + sound/voicegroups/voicegroup014.inc | 92 + sound/voicegroups/voicegroup015.inc | 31 + sound/voicegroups/voicegroup016.inc | 92 + sound/voicegroups/voicegroup017.inc | 84 + sound/voicegroups/voicegroup018.inc | 31 + sound/voicegroups/voicegroup019.inc | 128 + sound/voicegroups/voicegroup020.inc | 128 + sound/voicegroups/voicegroup021.inc | 128 + sound/voicegroups/voicegroup022.inc | 127 + sound/voicegroups/voicegroup023.inc | 92 + sound/voicegroups/voicegroup024.inc | 151 ++ src/background.c | 2 +- src/core.c | 6 +- src/game/bosses/boss_1.c | 4 +- src/game/bosses/boss_2.c | 2 +- src/game/bosses/boss_3.c | 2 +- src/game/bosses/boss_4.c | 2 +- src/game/bosses/boss_5.c | 2 +- src/game/bosses/boss_6.c | 2 +- src/game/bosses/boss_7.c | 2 +- src/game/bosses/boss_8.c | 2 +- src/game/bosses/boss_9.c | 2 +- src/game/bosses/eggmobile_escape_sequence.c | 2 +- src/game/bosses/final_intro.c | 2 +- src/game/character_select.c | 2 +- src/game/cheese.c | 2 +- src/game/countdown.c | 2 +- src/game/course_select.c | 2 +- src/game/cutscenes/credits.c | 2 +- src/game/cutscenes/credits_end.c | 2 +- src/game/cutscenes/credits_slides.c | 2 +- src/game/cutscenes/endings.c | 2 +- src/game/cutscenes/extra_ending_fall.c | 2 +- src/game/cutscenes/extra_ending_slides.c | 2 +- src/game/cutscenes/final_ending_fall.c | 2 +- src/game/cutscenes/final_ending_land.c | 2 +- src/game/cutscenes/level_endings.c | 2 +- src/game/cutscenes/missing_emeralds.c | 2 +- src/game/decomp_credits.c | 2 +- src/game/enemies/koura.c | 2 +- src/game/enemies/kubinaga.c | 2 +- src/game/enemies/yado.c | 2 +- src/game/game_over.c | 2 +- src/game/interactables_1/booster.c | 2 +- src/game/interactables_1/bouncy_bar.c | 2 +- src/game/interactables_1/checkpoint.c | 2 +- src/game/interactables_1/corkscrew.c | 2 +- src/game/interactables_1/corkscrew_3d.c | 2 +- src/game/interactables_1/incline_ramp.c | 2 +- src/game/interactables_1/rotating_handle.c | 2 +- src/game/interactables_1/spikes.c | 2 +- src/game/interactables_1/spring_bouncy.c | 2 +- src/game/interactables_1/stage_goal.c | 2 +- src/game/interactables_2/egg_utopia/cannon.c | 2 +- .../egg_utopia/flying_handle.c | 2 +- .../interactables_2/egg_utopia/launcher.c | 2 +- src/game/interactables_2/egg_utopia/pole.c | 2 +- .../egg_utopia/speeding_platform.c | 2 +- src/game/interactables_2/hot_crater/crane.c | 2 +- .../interactables_2/hot_crater/dash_ring.c | 2 +- .../hot_crater/floating_spring.c | 2 +- .../interactables_2/hot_crater/hook_rail.c | 2 +- .../ice_paradise/big_snowball.c | 2 +- .../ice_paradise/funnel_sphere.c | 2 +- .../music_plant/german_flute.c | 2 +- .../music_plant/guitar_string.c | 2 +- .../interactables_2/music_plant/keyboard.c | 2 +- .../interactables_2/music_plant/note_block.c | 2 +- .../interactables_2/music_plant/note_sphere.c | 2 +- .../interactables_2/music_plant/pipe_horn.c | 2 +- .../interactables_2/notification_ring_bonus.c | 2 +- .../interactables_2/sky_canyon/propeller.c | 2 +- .../sky_canyon/propeller_spring.c | 2 +- .../sky_canyon/small_windmill.c | 2 +- .../interactables_2/sky_canyon/whirlwind.c | 2 +- src/game/interactables_2/special_ring.c | 2 +- .../techno_base/arrow_platform.c | 2 +- .../techno_base/bounce_block.c | 2 +- .../techno_base/light_bridge.c | 2 +- .../interactables_2/techno_base/light_globe.c | 2 +- .../techno_base/spike_platform.c | 2 +- src/game/multiboot/collect_rings/results.c | 2 +- src/game/multiboot/connection.c | 2 +- src/game/multiplayer/communication_outcome.c | 2 +- src/game/multiplayer/finish.c | 2 +- src/game/multiplayer/mode_select.c | 2 +- src/game/multiplayer/mp_player.c | 2 +- src/game/multiplayer/multipak_connection.c | 2 +- src/game/multiplayer/results.c | 2 +- src/game/multiplayer/team_play.c | 2 +- src/game/multiplayer/unknown_task.c | 2 +- src/game/multiplayer_lobby.c | 2 +- src/game/mystery_item_box.c | 2 +- src/game/options_screen.c | 2 +- src/game/player_callbacks.c | 2 +- src/game/sa1_leftovers/collect_ring_effect.c | 4 +- src/game/sa1_leftovers/collision.c | 2 +- src/game/sa1_leftovers/collision_1.c | 2 +- src/game/sa1_leftovers/demo_manager.c | 2 +- src/game/sa1_leftovers/entities_manager.c | 2 +- .../sa1_leftovers/interactables/grind_rail.c | 2 +- src/game/sa1_leftovers/interactables/pipe.c | 2 +- .../interactables/platform_thin.c | 2 +- src/game/sa1_leftovers/interactables/spring.c | 2 +- src/game/sa1_leftovers/item_box.c | 2 +- src/game/sa1_leftovers/music_manager.c | 8 +- src/game/sa1_leftovers/pause_menu.c | 3 +- src/game/sa1_leftovers/unused_level_select.c | 2 +- src/game/save.c | 4 +- src/game/sound_test.c | 10 +- src/game/special_stage/collectables.c | 2 +- src/game/special_stage/guard_robo.c | 2 +- src/game/special_stage/main.c | 2 +- src/game/special_stage/physics.c | 2 +- src/game/special_stage/ui.c | 2 +- src/game/special_stage/world.c | 2 +- src/game/stage/boss_results_transition.c | 2 +- src/game/stage/item_tasks.c | 2 +- src/game/stage/player.c | 4 +- src/game/stage/player_super_sonic.c | 2 +- src/game/stage/results.c | 2 +- src/game/stage/rings_scatter.c | 2 +- src/game/stage/stage.c | 2 +- src/game/stage/ui.c | 2 +- src/game/time_attack/lobby.c | 2 +- src/game/time_attack/mode_select.c | 2 +- src/game/time_attack/results.c | 2 +- src/game/title_screen.c | 2 +- src/game/unknown_effect.c | 2 +- src/lib/{ => agb_flash}/agb_flash.c | 4 +- src/lib/{ => agb_flash}/agb_flash_512k.c | 2 +- src/lib/{ => agb_flash}/agb_flash_le_512k.c | 2 +- src/lib/{ => agb_flash}/agb_flash_mx_512k.c | 2 +- src/lib/m4a.c | 1380 ----------- src/lib/m4a/m4a.c | 1477 ++++++++++++ src/lib/m4a/m4a0.s | 1905 +++++++++++++++ src/lib/{ => m4a}/m4a_tables.c | 15 +- src/lib/m4a0.s | 1629 ------------- src/platform/pret_sdl/sdl2.c | 13 +- src/platform/shared/audio/README.txt | 4 + src/platform/shared/audio/cgb_audio.c | 267 +++ src/platform/shared/audio/m4a_sound_mixer.c | 923 ++++++++ src/platform/shared/common.c | 2 +- src/platform/shared/m4a_stub.c | 45 - src/platform/shared/stub.c | 2 - src/platform/win32/win32.c | 2 + src/sprite.c | 2 +- src/task.c | 2 +- tools/mid2agb/agb.cpp | 1 + 189 files changed, 10757 insertions(+), 3776 deletions(-) create mode 100644 constants/m4a_constants.inc delete mode 100644 include/gba/m4a_internal.h rename include/lib/{ => agb_flash}/agb_flash.h (100%) rename include/{gba => lib/agb_flash}/flash_internal.h (93%) delete mode 100644 include/lib/m4a.h create mode 100644 include/lib/m4a/m4a.h create mode 100644 include/lib/m4a/m4a_internal.h create mode 100644 include/platform/shared/audio/README.txt create mode 100644 include/platform/shared/audio/cgb_audio.h create mode 100644 include/platform/shared/audio/cgb_tables.h rename src/lib/{ => agb_flash}/agb_flash.c (98%) rename src/lib/{ => agb_flash}/agb_flash_512k.c (97%) rename src/lib/{ => agb_flash}/agb_flash_le_512k.c (99%) rename src/lib/{ => agb_flash}/agb_flash_mx_512k.c (98%) delete mode 100644 src/lib/m4a.c create mode 100644 src/lib/m4a/m4a.c create mode 100644 src/lib/m4a/m4a0.s rename src/lib/{ => m4a}/m4a_tables.c (79%) delete mode 100644 src/lib/m4a0.s create mode 100644 src/platform/shared/audio/README.txt create mode 100644 src/platform/shared/audio/cgb_audio.c create mode 100644 src/platform/shared/audio/m4a_sound_mixer.c delete mode 100644 src/platform/shared/m4a_stub.c diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index bf674fb2d..6a02a95b2 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -12,6 +12,20 @@ "intelliSenseMode": "linux-gcc-x64", "configurationProvider": "ms-vscode.makefile-tools" }, + { + "name": "Linux portable", + "includePath": [ + "${workspaceFolder}/include/**" + ], + "defines": [ + "PORTABLE=1" + ], + "compilerPath": "/usr/bin/gcc", + "cStandard": "gnu17", + "cppStandard": "gnu++17", + "intelliSenseMode": "linux-gcc-x64", + "configurationProvider": "ms-vscode.makefile-tools" + }, { "name": "Linux-chao_garden", "includePath": [ diff --git a/.vscode/launch.json b/.vscode/launch.json index e372e8a4e..d239f6186 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,5 +12,13 @@ "cwd": "${workspaceFolder}", "MIMode": "lldb", }, + { + "name": "SDL Debug Linux", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/sa2_debug.sdl", + "cwd": "${workspaceFolder}", + "MIMode": "gdb", + }, ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 3cb2a447f..8a597b297 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -345,7 +345,13 @@ "iron_ball.h": "c", "char_states.h": "c", "course_select.h": "c", - "level_endings.h": "c" + "level_endings.h": "c", + "music_player.h": "c", + "sound_mixer.h": "c", + "cgb_audio.h": "c", + "shared.h": "c", + "mp2k_common.h": "c", + "cgb_tables.h": "c" }, "asm-code-lens.donated": true, "editor.formatOnSave": true, diff --git a/Makefile b/Makefile index e648ef3ac..632d08a97 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ include config.mk ROOT_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST))))) +OS := $(shell uname) ifeq ($(PLATFORM),gba) TOOLCHAIN := $(DEVKITARM) @@ -164,6 +165,20 @@ else CPPFLAGS += -D ENABLE_DECOMP_CREDITS=1 endif +# TODO: compile songs to C so that we can work around this +# MacOS refuses to link the songs data because some pointers +# are not aligned. This is a simple work around which tells +# the compiler not to care. Once we are compiling the songs +# to C, we can cast the pointers to integers to make the linker +# care less +ifeq ($(OS), Darwin) + LINKER_MAP_FLAGS = -Wl,-map, "$(ROOT_DIR)/$(MAP)" + ifneq ($(PLATFORM), gba) + export MACOSX_DEPLOYMENT_TARGET := 11 + endif +else + LINKER_MAP_FLAGS = -Xlinker -Map="$(ROOT_DIR)/$(MAP)" +endif # Clear the default suffixes .SUFFIXES: @@ -284,12 +299,12 @@ OBJS_REL := $(patsubst $(OBJ_DIR)/%,%,$(OBJS)) # Use the old compiler for m4a, as it was prebuilt and statically linked # to the original codebase -$(C_BUILDDIR)/lib/m4a.o: CC1 := $(CC1_OLD) +$(C_BUILDDIR)/lib/m4a/m4a.o: CC1 := $(CC1_OLD) # Use `-O1` for agb_flash libs, as these were also prebuilt ifeq ($(PLATFORM),gba) -$(C_BUILDDIR)/lib/agb_flash.o: CC1FLAGS := -O1 -mthumb-interwork -Werror -$(C_BUILDDIR)/lib/agb_flash%.o: CC1FLAGS := -O1 -mthumb-interwork -Werror +$(C_BUILDDIR)/lib/agb_flash/agb_flash.o: CC1FLAGS := -O1 -mthumb-interwork -Werror +$(C_BUILDDIR)/lib/agb_flash/agb_flash%.o: CC1FLAGS := -O1 -mthumb-interwork -Werror endif MAKEFLAGS += --no-print-directory @@ -416,7 +431,7 @@ else @echo Outputting $(ROOT_DIR)/$@ @touch $(ROOT_DIR)/$(MAP) ifeq ($(PLATFORM),sdl) - @cd $(OBJ_DIR) && $(CC1) $(OBJS_REL) $(shell sdl2-config --cflags --libs) -o $(ROOT_DIR)/$@ + @cd $(OBJ_DIR) && $(CC1) $(OBJS_REL) $(shell sdl2-config --cflags --libs) $(LINKER_MAP_FLAGS) -o $(ROOT_DIR)/$@ else ifeq ($(PLATFORM),sdl_win32) @cd $(OBJ_DIR) && $(CC1) -mwin32 $(OBJS_REL) -lmingw32 -L$(ROOT_DIR)/$(SDL_MINGW_LIB) -lSDL2main -lSDL2.dll -lwinmm -lkernel32 -lxinput -o $(ROOT_DIR)/$@ -Xlinker -Map "$(ROOT_DIR)/$(MAP)" else diff --git a/asm/macros/music_voice.inc b/asm/macros/music_voice.inc index 95d168497..b072f25ba 100644 --- a/asm/macros/music_voice.inc +++ b/asm/macros/music_voice.inc @@ -21,6 +21,7 @@ .else .byte 0 .endif +mAlignWord mPtr \sample_data_pointer .byte \attack .byte \decay @@ -39,8 +40,10 @@ .macro _voice_square_1 type, sweep, duty_cycle, attack, decay, sustain, release .byte \type, 60, 0 .byte \sweep +mAlignWord .byte (\duty_cycle & 0x3) .byte 0, 0, 0 +mAlignWord .byte (\attack & 0x7) .byte (\decay & 0x7) .byte (\sustain & 0xF) @@ -57,8 +60,10 @@ .macro _voice_square_2 type, duty_cycle, attack, decay, sustain, release .byte \type, 60, 0, 0 +mAlignWord .byte (\duty_cycle & 0x3) .byte 0, 0, 0 +mAlignWord .byte (\attack & 0x7) .byte (\decay & 0x7) .byte (\sustain & 0xF) @@ -75,6 +80,7 @@ .macro _voice_programmable_wave type, wave_samples_pointer, attack, decay, sustain, release .byte \type, 60, 0, 0 +mAlignWord mPtr \wave_samples_pointer .byte (\attack & 0x7) .byte (\decay & 0x7) @@ -92,8 +98,10 @@ .macro _voice_noise type, unk1, unk2, unk3, period, attack, decay, sustain, release .byte \type, \unk1, \unk2, \unk3 +mAlignWord .byte (\period & 0x1) .byte 0, 0, 0 +mAlignWord .byte (\attack & 0x7) .byte (\decay & 0x7) .byte (\sustain & 0xF) @@ -102,24 +110,14 @@ .macro voice_keysplit voice_group_pointer, keysplit_table_pointer .byte 0x40, 0, 0, 0 +mAlignWord mPtr \voice_group_pointer mPtr \keysplit_table_pointer .endm .macro voice_keysplit_all voice_group_pointer .byte 0x80, 0, 0, 0 +mAlignWord mPtr \voice_group_pointer .int 0 .endm - - .macro cry sample - .byte 0x20, 60, 0, 0 - .int \sample - .byte 0xff, 0, 0xff, 0 - .endm - - .macro cry2 sample - .byte 0x30, 60, 0, 0 - .int \sample - .byte 0xff, 0, 0xff, 0 - .endm diff --git a/asm/macros/portable.inc b/asm/macros/portable.inc index 757b6f161..b389fb26a 100644 --- a/asm/macros/portable.inc +++ b/asm/macros/portable.inc @@ -9,7 +9,6 @@ // Used so that we can have cross platform (32bit or 64bit) pointers .macro mPtr value #if defined(__aarch64__) || defined(__x86_64__) - .align 4 .quad \value #else .int \value @@ -18,9 +17,13 @@ // Used for cross platform aligning of labels .macro mAlignWord -#if defined(__aarch64__) || defined(__x86_64__) - .align 4 +#if defined(__APPLE__) && (defined(__aarch64__) || defined(__x86_64__)) + .align 3 // Align to 8 bytes on macOS (2^3 = 8) +#elif defined(__aarch64__) || defined(__x86_64__) + .align 8 // Align to 8 bytes on other platforms +#elif defined(PLATFORM_GBA) + .align 2 // Align to 4 bytes on GBA #else - .align 2 + .align 4 // Default alignment to 4 bytes #endif .endm diff --git a/chao_garden/sound/voicegroups/voicegroup000.inc b/chao_garden/sound/voicegroups/voicegroup000.inc index 638890f10..3921cc23e 100644 --- a/chao_garden/sound/voicegroups/voicegroup000.inc +++ b/chao_garden/sound/voicegroups/voicegroup000.inc @@ -3,95 +3,187 @@ .global voicegroup000 voicegroup000: @ 0x02019D30 +mAlignWord voice_square_1_alt 0, 0, 0, 0, 15, 0 @02019D30 +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @02019D3C +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @02019D48 +mAlignWord voice_square_1_alt 0, 3, 0, 0, 15, 0 @02019D54 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 0 @02019D60 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019D6C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019D78 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019D84 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019D90 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019D9C +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @02019DA8 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @02019DB4 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @02019DC0 +mAlignWord voice_square_2_alt 3, 0, 0, 15, 0 @02019DCC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019DD8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019DE4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019DF0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019DFC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E08 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E14 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E20 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E2C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E38 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E44 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E50 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E5C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E68 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E74 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E80 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E8C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019E98 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019EA4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019EB0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019EBC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019EC8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019ED4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019EE0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019EEC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019EF8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019F04 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_201A3E4, 0, 4, 4, 0 @02019F10 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_201A3F4, 0, 0, 15, 0 @02019F1C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_201A404, 0, 0, 15, 0 @02019F28 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_201A414, 0, 0, 15, 0 @02019F34 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_201A424, 0, 0, 15, 0 @02019F40 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_201A434, 0, 0, 15, 0 @02019F4C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_201A444, 0, 0, 15, 0 @02019F58 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_201A454, 0, 0, 15, 0 @02019F64 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_201A464, 0, 3, 0, 2 @02019F70 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_201A3E4, 0, 5, 0, 2 @02019F7C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @02019F88 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @02019F94 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 4 @02019FA0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_201A3F4, 0, 6, 1, 0 @02019FAC +mAlignWord voice_square_2_alt 2, 0, 4, 1, 0 @02019FB8 +mAlignWord voice_directsound 60, 0, DirectSoundData_roland_sr_jv80_02__186_harp_1, 255, 242, 25, 0 @02019FC4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019FD0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019FDC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019FE8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @02019FF4 +mAlignWord voice_square_1_alt 0, 2, 0, 3, 3, 0 @0201A000 +mAlignWord voice_square_1_alt 0, 2, 1, 2, 3, 0 @0201A00C +mAlignWord voice_square_1_alt 0, 2, 0, 2, 3, 0 @0201A018 +mAlignWord voice_square_1_alt 0, 2, 1, 5, 1, 0 @0201A024 +mAlignWord voice_square_1_alt 0, 0, 1, 0, 15, 0 @0201A030 +mAlignWord voice_square_1_alt 0, 0, 1, 5, 1, 0 @0201A03C +mAlignWord voice_square_1_alt 0, 2, 1, 4, 1, 0 @0201A048 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A054 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A060 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A06C +mAlignWord voice_square_2_alt 2, 1, 5, 7, 0 @0201A078 +mAlignWord voice_directsound 60, 0, DirectSoundData_roland_jv2080__pr_d__banjo, 255, 246, 51, 127 @0201A084 +mAlignWord voice_directsound 60, 0, DirectSoundData_roland_jv2080__pr_d__harmonica, 255, 246, 128, 127 @0201A090 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A09C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A0A8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A0B4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A0C0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A0CC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A0D8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A0E4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A0F0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A0FC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A108 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A114 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A120 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A12C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A138 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A144 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A150 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A15C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A168 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A174 diff --git a/chao_garden/sound/voicegroups/voicegroup001.inc b/chao_garden/sound/voicegroups/voicegroup001.inc index be839a575..b559cf954 100644 --- a/chao_garden/sound/voicegroups/voicegroup001.inc +++ b/chao_garden/sound/voicegroups/voicegroup001.inc @@ -3,54 +3,105 @@ .global voicegroup001 voicegroup001: @ 0x0201A180 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A180 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A18C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A198 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A1A4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A1B0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A1BC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A1C8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A1D4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A1E0 +mAlignWord voice_directsound 60, 0, DirectSoundData_roland_jv2080__pr_d__019_organ_3__5, 255, 0, 255, 127 @0201A1EC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A1F8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A204 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A210 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A21C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A228 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A234 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A240 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A24C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A258 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A264 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A270 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A27C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A288 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A294 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A2A0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A2AC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A2B8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A2C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A2D0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A2DC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A2E8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A2F4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A300 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A30C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A318 +mAlignWord voice_keysplit_all voicegroup001 @0201A324 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundData_korg_trinity__standard_kit__1__shortened, 255, 255, 255, 0 @0201A330 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundData_korg_trinity__standard_kit__2__shortened, 255, 0, 255, 0 @0201A33C +mAlignWord voice_noise 84, 0, 192, 0, 0, 1, 0, 0 @0201A348 +mAlignWord voice_noise 84, 0, 192, 0, 0, 2, 0, 0 @0201A354 +mAlignWord voice_noise 84, 0, 192, 0, 0, 3, 7, 0 @0201A360 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A36C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A378 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A384 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A390 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A39C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A3A8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A3B4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A3C0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @0201A3CC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundData_roland_jv2080__pr_e__jazz_drum_set1__2, 255, 0, 255, 0 @0201A3D8 diff --git a/constants/m4a_constants.inc b/constants/m4a_constants.inc new file mode 100644 index 000000000..8072c6922 --- /dev/null +++ b/constants/m4a_constants.inc @@ -0,0 +1,257 @@ +#ifndef GUARD_CONSTANTS_M4A_CONSTANTS_INC +#define GUARD_CONSTANTS_M4A_CONSTANTS_INC + + .equiv ID_NUMBER, 0x68736d53 + + .equiv PCM_DMA_BUF_SIZE, 1584 + .equiv MAX_DIRECTSOUND_CHANNELS, 12 + + .equiv C_V, 0x40 + + .equiv TONEDATA_TYPE_CGB, 0x07 + .equiv TONEDATA_TYPE_FIX, 0x08 + .equiv TONEDATA_TYPE_REV, 0x10 + .equiv TONEDATA_TYPE_CMP, 0x20 + .equiv TONEDATA_TYPE_SPL, 0x40 /* key split*/ + .equiv TONEDATA_TYPE_RHY, 0x80 /* rhythm*/ + + .equiv TONEDATA_P_S_PAN, 0xc0 + + .equiv SOUND_CHANNEL_SF_START, 0x80 + .equiv SOUND_CHANNEL_SF_STOP, 0x40 + .equiv SOUND_CHANNEL_SF_SPECIAL, 0x20 + .equiv SOUND_CHANNEL_SF_LOOP, 0x10 + .equiv SOUND_CHANNEL_SF_IEC, 0x04 + .equiv SOUND_CHANNEL_SF_ENV, 0x03 + .equiv SOUND_CHANNEL_SF_ENV_ATTACK, 0x03 + .equiv SOUND_CHANNEL_SF_ENV_DECAY, 0x02 + .equiv SOUND_CHANNEL_SF_ENV_SUSTAIN, 0x01 + .equiv SOUND_CHANNEL_SF_ENV_RELEASE, 0x00 + .equiv SOUND_CHANNEL_SF_ON, (SOUND_CHANNEL_SF_START | SOUND_CHANNEL_SF_STOP | SOUND_CHANNEL_SF_IEC | SOUND_CHANNEL_SF_ENV) + + .equiv CGB_CHANNEL_MO_PIT, 0x02 + .equiv CGB_CHANNEL_MO_VOL, 0x01 + + .equiv WAVE_DATA_FLAG_LOOP, 0xC0 + + .equiv MPT_FLG_VOLSET, 0x01 + .equiv MPT_FLG_VOLCHG, 0x03 + .equiv MPT_FLG_PITSET, 0x04 + .equiv MPT_FLG_PITCHG, 0x0C + .equiv MPT_FLG_START, 0x40 + .equiv MPT_FLG_EXIST, 0x80 + + .macro struct_begin + .struct 0 + .endm + + .macro struct_field name, size +\name: + .struct \name + \size + .endm + + struct_begin + struct_field o_WaveData_type, 2 + struct_field o_WaveData_d1, 1 + struct_field o_WaveData_flags, 1 + struct_field o_WaveData_freq, 4 + struct_field o_WaveData_loopStart, 4 + struct_field o_WaveData_size, 4 + struct_field o_WaveData_data, 0 + struct_field WaveData_size, 0 + + struct_begin + struct_field o_ToneData_type, 1 + struct_field o_ToneData_key, 1 + struct_field o_ToneData_length, 1 + struct_field o_ToneData_pan_sweep, 1 + struct_field o_ToneData_wav, 4 + struct_field o_ToneData_attack, 1 + struct_field o_ToneData_decay, 1 + struct_field o_ToneData_sustain, 1 + struct_field o_ToneData_release, 1 + struct_field ToneData_size, 0 + + struct_begin + struct_field o_SoundInfo_ident, 4 + struct_field o_SoundInfo_pcmDmaCounter, 1 + struct_field o_SoundInfo_reverb, 1 + struct_field o_SoundInfo_maxChans, 1 + struct_field o_SoundInfo_masterVolume, 1 + struct_field o_SoundInfo_freq, 1 + struct_field o_SoundInfo_mode, 1 + struct_field o_SoundInfo_c15, 1 + struct_field o_SoundInfo_pcmDmaPeriod, 1 + struct_field o_SoundInfo_maxLines, 1 + struct_field o_SoundInfo_gap, 3 + struct_field o_SoundInfo_pcmSamplesPerVBlank, 4 + struct_field o_SoundInfo_pcmFreq, 4 + struct_field o_SoundInfo_divFreq, 4 + struct_field o_SoundInfo_cgbChans, 4 + struct_field o_SoundInfo_MPlayMainHead, 4 + struct_field o_SoundInfo_musicPlayerHead, 4 + struct_field o_SoundInfo_CgbSound, 4 + struct_field o_SoundInfo_CgbOscOff, 4 + struct_field o_SoundInfo_MidiKeyToCgbFreq, 4 + struct_field o_SoundInfo_MPlayJumpTable, 4 + struct_field o_SoundInfo_plynote, 4 + struct_field o_SoundInfo_ExtVolPit, 4 + struct_field o_SoundInfo_gap2, 16 + struct_field o_SoundInfo_chans, MAX_DIRECTSOUND_CHANNELS * 64 + struct_field o_SoundInfo_pcmBuffer, PCM_DMA_BUF_SIZE * 2 + struct_field SoundInfo_size, 0 + + struct_begin + struct_field o_SoundChannel_statusFlags, 1 + struct_field o_SoundChannel_type, 1 + struct_field o_SoundChannel_rightVolume, 1 + struct_field o_SoundChannel_leftVolume, 1 + struct_field o_SoundChannel_attack, 1 + struct_field o_SoundChannel_decay, 1 + struct_field o_SoundChannel_sustain, 1 + struct_field o_SoundChannel_release, 1 + struct_field o_SoundChannel_key, 1 + struct_field o_SoundChannel_envelopeVolume, 1 + struct_field o_SoundChannel_envelopeVolumeRight, 1 + struct_field o_SoundChannel_envelopeVolumeLeft, 1 + struct_field o_SoundChannel_pseudoEchoVolume, 1 + struct_field o_SoundChannel_pseudoEchoLength, 1 + struct_field o_SoundChannel_dummy1, 1 + struct_field o_SoundChannel_dummy2, 1 + struct_field o_SoundChannel_gateTime, 1 + struct_field o_SoundChannel_midiKey, 1 + struct_field o_SoundChannel_velocity, 1 + struct_field o_SoundChannel_priority, 1 + struct_field o_SoundChannel_rhythmPan, 1 + struct_field o_SoundChannel_dummy3, 3 + struct_field o_SoundChannel_count, 4 + struct_field o_SoundChannel_fw, 4 + struct_field o_SoundChannel_frequency, 4 + struct_field o_SoundChannel_wav, 4 + struct_field o_SoundChannel_currentPointer, 4 + struct_field o_SoundChannel_track, 4 + struct_field o_SoundChannel_prevChannelPointer, 4 + struct_field o_SoundChannel_nextChannelPointer, 4 + struct_field o_SoundChannel_dummy4, 4 + struct_field o_SoundChannel_xpi, 2 + struct_field o_SoundChannel_xpc, 2 + struct_field SoundChannel_size, 0 + + struct_begin + struct_field o_MusicPlayerTrack_flags, 1 + struct_field o_MusicPlayerTrack_wait, 1 + struct_field o_MusicPlayerTrack_patternLevel, 1 + struct_field o_MusicPlayerTrack_repN, 1 + struct_field o_MusicPlayerTrack_gateTime, 1 + struct_field o_MusicPlayerTrack_key, 1 + struct_field o_MusicPlayerTrack_velocity, 1 + struct_field o_MusicPlayerTrack_runningStatus, 1 + struct_field o_MusicPlayerTrack_keyM, 1 + struct_field o_MusicPlayerTrack_pitM, 1 + struct_field o_MusicPlayerTrack_keyShift, 1 + struct_field o_MusicPlayerTrack_keyShiftX, 1 + struct_field o_MusicPlayerTrack_tune, 1 + struct_field o_MusicPlayerTrack_pitX, 1 + struct_field o_MusicPlayerTrack_bend, 1 + struct_field o_MusicPlayerTrack_bendRange, 1 + struct_field o_MusicPlayerTrack_volMR, 1 + struct_field o_MusicPlayerTrack_volML, 1 + struct_field o_MusicPlayerTrack_vol, 1 + struct_field o_MusicPlayerTrack_volX, 1 + struct_field o_MusicPlayerTrack_pan, 1 + struct_field o_MusicPlayerTrack_panX, 1 + struct_field o_MusicPlayerTrack_modM, 1 + struct_field o_MusicPlayerTrack_mod, 1 + struct_field o_MusicPlayerTrack_modT, 1 + struct_field o_MusicPlayerTrack_lfoSpeed, 1 + struct_field o_MusicPlayerTrack_lfoSpeedC, 1 + struct_field o_MusicPlayerTrack_lfoDelay, 1 + struct_field o_MusicPlayerTrack_lfoDelayC, 1 + struct_field o_MusicPlayerTrack_priority, 1 + struct_field o_MusicPlayerTrack_pseudoEchoVolume, 1 + struct_field o_MusicPlayerTrack_pseudoEchoLength, 1 + struct_field o_MusicPlayerTrack_chan, 4 + struct_field o_MusicPlayerTrack_ToneData_type, 1 + struct_field o_MusicPlayerTrack_ToneData_key, 1 + struct_field o_MusicPlayerTrack_ToneData_length, 1 + struct_field o_MusicPlayerTrack_ToneData_pan_sweep, 1 + struct_field o_MusicPlayerTrack_ToneData_wav, 4 + struct_field o_MusicPlayerTrack_ToneData_attack, 1 + struct_field o_MusicPlayerTrack_ToneData_decay, 1 + struct_field o_MusicPlayerTrack_ToneData_sustain, 1 + struct_field o_MusicPlayerTrack_ToneData_release, 1 + struct_field o_MusicPlayerTrack_gap, 10 + struct_field o_MusicPlayerTrack_unk_3A, 2 + struct_field o_MusicPlayerTrack_unk_3C, 4 + struct_field o_MusicPlayerTrack_cmdPtr, 4 + struct_field o_MusicPlayerTrack_patternStack, 12 + struct_field MusicPlayerTrack_size, 0 + + .equiv o_MusicPlayerTrack_ToneData_keySplitTable, o_MusicPlayerTrack_ToneData_attack + + struct_begin + struct_field o_MusicPlayerInfo_songHeader, 4 + struct_field o_MusicPlayerInfo_status, 4 + struct_field o_MusicPlayerInfo_trackCount, 1 + struct_field o_MusicPlayerInfo_priority, 1 + struct_field o_MusicPlayerInfo_cmd, 1 + struct_field o_MusicPlayerInfo_unk_B, 1 + struct_field o_MusicPlayerInfo_clock, 4 + struct_field o_MusicPlayerInfo_gap, 8 + struct_field o_MusicPlayerInfo_memAccArea, 4 + struct_field o_MusicPlayerInfo_tempoD, 2 + struct_field o_MusicPlayerInfo_tempoU, 2 + struct_field o_MusicPlayerInfo_tempoI, 2 + struct_field o_MusicPlayerInfo_tempoC, 2 + struct_field o_MusicPlayerInfo_fadeOI, 2 + struct_field o_MusicPlayerInfo_fadeOC, 2 + struct_field o_MusicPlayerInfo_fadeOV, 2 + struct_field o_MusicPlayerInfo_padding, 2 + struct_field o_MusicPlayerInfo_tracks, 4 + struct_field o_MusicPlayerInfo_tone, 4 + struct_field o_MusicPlayerInfo_ident, 4 + struct_field o_MusicPlayerInfo_func, 4 + struct_field o_MusicPlayerInfo_intp, 4 + struct_field MusicPlayerInfo_size, 0 + + struct_begin + struct_field o_CgbChannel_statusFlags, 1 + struct_field o_CgbChannel_type, 1 + struct_field o_CgbChannel_rightVolume, 1 + struct_field o_CgbChannel_leftVolume, 1 + struct_field o_CgbChannel_attack, 1 + struct_field o_CgbChannel_decay, 1 + struct_field o_CgbChannel_sustain, 1 + struct_field o_CgbChannel_release, 1 + struct_field o_CgbChannel_key, 1 + struct_field o_CgbChannel_envelopeVolume, 1 + struct_field o_CgbChannel_envelopeGoal, 1 + struct_field o_CgbChannel_envelopeCounter, 1 + struct_field o_CgbChannel_pseudoEchoVolume, 1 + struct_field o_CgbChannel_pseudoEchoLength, 1 + struct_field o_CgbChannel_dummy1, 1 + struct_field o_CgbChannel_dummy2, 1 + struct_field o_CgbChannel_gateTime, 1 + struct_field o_CgbChannel_midiKey, 1 + struct_field o_CgbChannel_velocity, 1 + struct_field o_CgbChannel_priority, 1 + struct_field o_CgbChannel_rhythmPan, 1 + struct_field o_CgbChannel_dummy3, 3 + struct_field o_CgbChannel_dummy5, 1 + struct_field o_CgbChannel_sustainGoal, 1 + struct_field o_CgbChannel_n4, 1 + struct_field o_CgbChannel_pan, 1 + struct_field o_CgbChannel_panMask, 1 + struct_field o_CgbChannel_modify, 1 + struct_field o_CgbChannel_length, 1 + struct_field o_CgbChannel_sweep, 1 + struct_field o_CgbChannel_frequency, 4 + struct_field o_CgbChannel_wavePointer, 4 + struct_field o_CgbChannel_currentPointer, 4 + struct_field o_CgbChannel_track, 4 + struct_field o_CgbChannel_prevChannelPointer, 4 + struct_field o_CgbChannel_nextChannelPointer, 4 + struct_field o_CgbChannel_dummy4, 8 + struct_field CgbChannel_size, 0 + +#endif @ GUARD_CONSTANTS_M4A_CONSTANTS_INC diff --git a/data/sound_data.s b/data/sound_data.s index 08cc402e7..1002dda43 100644 --- a/data/sound_data.s +++ b/data/sound_data.s @@ -3,6 +3,7 @@ .include "asm/macros/music_voice.inc" .include "asm/macros/c_decl.inc" +@; TODO: Convert this all to C mSectionRodata .include "sound/voice_groups.inc" .include "sound/keysplit_tables.inc" diff --git a/include/gba/defines.h b/include/gba/defines.h index e8b56b6c4..bb964ee26 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -40,9 +40,10 @@ #define DISPLAY_WIDTH 240 #define DISPLAY_HEIGHT 160 -#include "gba/types.h" -#define OAM_SIZE (OAM_ENTRY_COUNT*sizeof(OamData)) -extern struct SoundInfo *SOUND_INFO_PTR; +//#include "gba/types.h" +// TODO: Fix #define OAM_SIZE (OAM_ENTRY_COUNT*sizeof(OamData)) +#define OAM_SIZE (OAM_ENTRY_COUNT*8) +extern struct SoundMixerState *SOUND_INFO_PTR; extern uint16_t INTR_CHECK; extern void (*INTR_VECTOR)(void); @@ -80,7 +81,7 @@ extern uint8_t VRAM[VRAM_SIZE]; // NOTE(Jace): I tried replacing these altogether, // but that resulted in a nonmatching ROM // (see notes above) -#define SOUND_INFO_PTR (*(struct SoundInfo **)0x3007FF0) +#define SOUND_INFO_PTR (*(struct SoundMixerState **)0x3007FF0) #define INTR_CHECK (*(u16 *)0x3007FF8) #define INTR_VECTOR (*(void **)0x3007FFC) diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h deleted file mode 100644 index 557692f61..000000000 --- a/include/gba/m4a_internal.h +++ /dev/null @@ -1,455 +0,0 @@ -#ifndef GUARD_M4A_INTERNAL_H -#define GUARD_M4A_INTERNAL_H - -#include "gba/gba.h" - -// ASCII encoding of 'Smsh' in reverse -// This is presumably short for SMASH, the developer of MKS4AGB. -#define ID_NUMBER 0x68736D53 - -#define C_V 0x40 // center value for PAN, BEND, and TUNE - -#define SOUND_MODE_REVERB_VAL 0x0000007F -#define SOUND_MODE_REVERB_SET 0x00000080 -#define SOUND_MODE_MAXCHN 0x00000F00 -#define SOUND_MODE_MAXCHN_SHIFT 8 -#define SOUND_MODE_MASVOL 0x0000F000 -#define SOUND_MODE_MASVOL_SHIFT 12 -#define SOUND_MODE_FREQ_05734 0x00010000 -#define SOUND_MODE_FREQ_07884 0x00020000 -#define SOUND_MODE_FREQ_10512 0x00030000 -#define SOUND_MODE_FREQ_13379 0x00040000 -#define SOUND_MODE_FREQ_15768 0x00050000 -#define SOUND_MODE_FREQ_18157 0x00060000 -#define SOUND_MODE_FREQ_21024 0x00070000 -#define SOUND_MODE_FREQ_26758 0x00080000 -#define SOUND_MODE_FREQ_31536 0x00090000 -#define SOUND_MODE_FREQ_36314 0x000A0000 -#define SOUND_MODE_FREQ_40137 0x000B0000 -#define SOUND_MODE_FREQ_42048 0x000C0000 -#define SOUND_MODE_FREQ 0x000F0000 -#define SOUND_MODE_FREQ_SHIFT 16 -#define SOUND_MODE_DA_BIT_9 0x00800000 -#define SOUND_MODE_DA_BIT_8 0x00900000 -#define SOUND_MODE_DA_BIT_7 0x00A00000 -#define SOUND_MODE_DA_BIT_6 0x00B00000 -#define SOUND_MODE_DA_BIT 0x00B00000 -#define SOUND_MODE_DA_BIT_SHIFT 20 - -struct WaveData -{ - u16 type; - u16 status; - u32 freq; - u32 loopStart; - u32 size; // number of samples - s8 data[1]; // samples -}; - -#define TONEDATA_TYPE_CGB 0x07 -#define TONEDATA_TYPE_FIX 0x08 -#define TONEDATA_TYPE_SPL 0x40 // key split -#define TONEDATA_TYPE_RHY 0x80 // rhythm - -#define TONEDATA_P_S_PAN 0xc0 -#define TONEDATA_P_S_PAM TONEDATA_P_S_PAN - -struct ToneData -{ - u8 type; - u8 key; - u8 length; // sound length (compatible sound) - u8 pan_sweep; // pan or sweep (compatible sound ch. 1) - struct WaveData *wav; - u8 attack; - u8 decay; - u8 sustain; - u8 release; -}; - -struct CgbChannel -{ - u8 sf; - u8 ty; - u8 rightVolume; - u8 leftVolume; - u8 at; - u8 de; - u8 su; - u8 re; - u8 ky; - u8 ev; - u8 eg; - u8 ec; - u8 echoVolume; - u8 echoLength; - u8 d1; - u8 d2; - u8 gt; - u8 mk; - u8 ve; - u8 pr; - u8 rp; - u8 d3[3]; - u8 d5; - u8 sg; - u8 n4; - u8 pan; - u8 panMask; - u8 mo; - u8 le; - u8 sw; - u32 fr; - u32 *wp; - u32 cp; - u32 tp; - u32 pp; - u32 np; - u8 d4[8]; -}; - -struct MusicPlayerTrack; - -struct SoundChannel -{ - u8 status; - u8 type; - u8 rightVolume; - u8 leftVolume; - u8 attack; - u8 decay; - u8 sustain; - u8 release; - u8 ky; - u8 ev; - u8 er; - u8 el; - u8 echoVolume; - u8 echoLength; - u8 d1; - u8 d2; - u8 gt; - u8 mk; - u8 ve; - u8 pr; - u8 rp; - u8 d3[3]; - u32 ct; - u32 fw; - u32 freq; - struct WaveData *wav; - u32 cp; - struct MusicPlayerTrack *track; - u32 pp; - u32 np; - u32 d4; - u16 xpi; - u16 xpc; -}; - -#define MAX_DIRECTSOUND_CHANNELS 12 - -#define PCM_DMA_BUF_SIZE 1584 // size of Direct Sound buffer - -struct MusicPlayerInfo; - -typedef void (*MPlayFunc)(); -typedef void (*PlyNoteFunc)(u32, struct MusicPlayerInfo *, struct MusicPlayerTrack *); -typedef void (*CgbSoundFunc)(void); -typedef void (*CgbOscOffFunc)(u8); -typedef u32 (*MidiKeyToCgbFreqFunc)(u8, u8, u8); -typedef void (*ExtVolPitFunc)(void); -typedef void (*MPlayMainFunc)(struct MusicPlayerInfo *); - -// TODO: update this struct with better names from pret -struct SoundInfo -{ - // This field is normally equal to ID_NUMBER but it is set to other - // values during sensitive operations for locking purposes. - // This field should be volatile but isn't. This could potentially cause - // race conditions. - u32 ident; - - vu8 pcmDmaCounter; - - // Direct Sound - u8 reverb; - u8 maxChans; - u8 masterVolume; - u8 freq; - - u8 mode; - u8 c15; // periodically counts from 14 down to 0 (15 states) - u8 pcmDmaPeriod; // number of V-blanks per PCM DMA - u8 maxLines; - u8 gap[3]; - s32 pcmSamplesPerVBlank; - s32 pcmFreq; - s32 divFreq; - struct CgbChannel *cgbChans; - u32 func; - u32 intp; - void (*CgbSound)(void); - void (*CgbOscOff)(u8); - u32 (*MidiKeyToCgbFreq)(u8, u8, u8); - u32 MPlayJumpTable; - u32 plynote; - u32 ExtVolPit; - u8 gap2[16]; - struct SoundChannel chans[MAX_DIRECTSOUND_CHANNELS]; - s8 pcmBuffer[PCM_DMA_BUF_SIZE * 2]; -}; - -struct SongHeader -{ - u8 trackCount; - u8 blockCount; - u8 priority; - u8 reverb; - struct ToneData *tone; - u8 *part[1]; -}; - -struct PokemonCrySong -{ - u8 trackCount; - u8 blockCount; - u8 priority; - u8 reverb; - struct ToneData *tone; - u8 *part[2]; - u8 gap; - u8 part0; // 0x11 - u8 tuneValue; // 0x12 - u8 gotoCmd; // 0x13 - u32 gotoTarget; // 0x14 - u8 part1; // 0x18 - u8 tuneValue2; // 0x19 - u8 cont[2]; // 0x1A - u8 volCmd; // 0x1C - u8 volumeValue; // 0x1D - u8 unkCmd0D[2]; // 0x1E - u32 unkCmd0DParam; // 0x20 - u8 xreleCmd[2]; // 0x24 - u8 releaseValue; // 0x26 - u8 panCmd; - u8 panValue; // 0x28 - u8 tieCmd; // 0x29 - u8 tieKeyValue; // 0x2A - u8 tieVelocityValue; // 0x2B - u8 unkCmd0C[2]; // 0x2C - u16 unkCmd0CParam; // 0x2E - u8 end[2]; // 0x30 -}; - -#define MPT_FLG_VOLSET 0x01 -#define MPT_FLG_VOLCHG 0x03 -#define MPT_FLG_PITSET 0x04 -#define MPT_FLG_PITCHG 0x0C -#define MPT_FLG_START 0x40 -#define MPT_FLG_EXIST 0x80 - -struct MusicPlayerTrack -{ - u8 flags; - u8 wait; - u8 patternLevel; - u8 repN; - u8 gateTime; - u8 key; - u8 velocity; - u8 runningStatus; - u8 keyM; - u8 pitM; - s8 keyShift; - s8 keyShiftX; - s8 tune; - u8 pitX; - s8 bend; - u8 bendRange; - u8 volMR; - u8 volML; - u8 vol; - u8 volX; - s8 pan; - s8 panX; - s8 modM; - u8 mod; - u8 modT; - u8 lfoSpeed; - u8 lfoSpeedC; - u8 lfoDelay; - u8 lfoDelayC; - u8 priority; - u8 echoVolume; - u8 echoLength; - struct SoundChannel *chan; - struct ToneData tone; - u8 gap[10]; - u16 unk_3A; - u32 unk_3C; - u8 *cmdPtr; - u8 *patternStack[3]; -}; - -#define MUSICPLAYER_STATUS_TRACK 0x0000ffff -#define MUSICPLAYER_STATUS_PAUSE 0x80000000 - -#define MAX_MUSICPLAYER_TRACKS 16 - -#define TEMPORARY_FADE 0x0001 -#define FADE_IN 0x0002 -#define FADE_VOL_MAX 64 -#define FADE_VOL_SHIFT 2 - -struct MusicPlayerInfo -{ - struct SongHeader *songHeader; - u32 status; - u8 trackCount; - u8 priority; - u8 cmd; - u8 unk_B; - u32 clock; - u8 gap[8]; - u8 *memAccArea; - u16 tempoD; - u16 tempoU; - u16 tempoI; - u16 tempoC; - u16 fadeOI; - u16 fadeOC; - u16 fadeOV; - struct MusicPlayerTrack *tracks; - struct ToneData *tone; - u32 ident; - u32 func; - u32 intp; -}; - -struct MusicPlayer -{ - struct MusicPlayerInfo *info; - struct MusicPlayerTrack *track; - u8 unk_8; - u16 unk_A; -}; - -struct Song -{ - struct SongHeader *header; - u16 ms; - u16 me; -}; - -extern const struct MusicPlayer gMPlayTable[]; -extern const struct Song gSongTable[]; - - - -extern u8 gMPlayMemAccArea[]; - -extern char SoundMainRAM[]; - -extern MPlayFunc gMPlayJumpTable[]; - -typedef void (*XcmdFunc)(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -extern const XcmdFunc gXcmdTable[]; - -extern struct CgbChannel gCgbChans[]; -extern const u8 gCgb3Vol[]; - -extern const u8 gScaleTable[]; -extern const u32 gFreqTable[]; -extern const u16 gPcmSamplesPerVBlankTable[]; - -extern const u8 gCgbScaleTable[]; -extern const s16 gCgbFreqTable[]; -extern const u8 gNoiseTable[]; - -extern const struct PokemonCrySong gPokemonCrySongTemplate; - -extern const struct ToneData voicegroup_pokemon_cry; - -extern char gNumMusicPlayers[]; -extern char gMaxLines[]; - -#if PLATFORM_GBA -#define NUM_MUSIC_PLAYERS ((u16)(uintptr_t)gNumMusicPlayers) -#else -#define NUM_MUSIC_PLAYERS 4 -#endif -#define MAX_LINES ((uintptr_t)gMaxLines) - -u32 umul3232H32(u32 multiplier, u32 multiplicand); -void SoundMain(void); -void SoundMainBTM(void); -void TrackStop(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track); -void MPlayMain(void); -void RealClearChain(void *x); - -void MPlayContinue(struct MusicPlayerInfo *mplayInfo); -void MPlayStart(struct MusicPlayerInfo *mplayInfo, struct SongHeader *songHeader); -void MPlayStop(struct MusicPlayerInfo *mplayInfo); -void FadeOutBody(struct MusicPlayerInfo *mplayInfo); -void TrkVolPitSet(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track); -void MPlayFadeOut(struct MusicPlayerInfo *mplayInfo, u16 speed); -void ClearChain(void *x); -void Clear64byte(void *addr); -void SoundInit(struct SoundInfo *soundInfo); -void MPlayExtender(struct CgbChannel *cgbChans); -void m4aSoundMode(u32 mode); -void MPlayOpen(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track, u8 a3); -void CgbSound(void); -void CgbOscOff(u8); -u32 MidiKeyToCgbFreq(u8, u8, u8); -void MPlayJumpTableCopy(MPlayFunc *mplayJumpTable); -void SampleFreqSet(u32 freq); -void m4aSoundVSyncOn(void); -void m4aSoundVSyncOff(void); - -void ClearModM(struct MusicPlayerTrack *track); -void m4aMPlayModDepthSet(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u8 modDepth); -void m4aMPlayLFOSpeedSet(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u8 lfoSpeed); - -// sound command handler functions -void ply_fine(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_goto(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_patt(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_pend(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_rept(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_memacc(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_prio(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_tempo(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_keysh(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_voice(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_vol(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_pan(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_bend(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_bendr(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_lfos(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_lfodl(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_mod(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_modt(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_tune(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_port(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xcmd(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_endtie(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_note(struct MusicPlayerInfo *, struct MusicPlayerTrack *); - -// extended sound command handler functions -void ply_xxx(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xwave(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xtype(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xatta(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xdeca(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xsust(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xrele(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xiecv(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xiecl(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xleng(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xswee(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xcmd_0C(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_xcmd_0D(struct MusicPlayerInfo *, struct MusicPlayerTrack *); - -#endif // GUARD_M4A_INTERNAL_H diff --git a/include/global.h b/include/global.h index ad963c560..504bba211 100644 --- a/include/global.h +++ b/include/global.h @@ -7,7 +7,7 @@ #if PLATFORM_GBA #define ENABLE_AUDIO TRUE #else -#define ENABLE_AUDIO !TRUE +#define ENABLE_AUDIO TRUE #define ENABLE_VRAM_VIEW !TRUE #endif diff --git a/include/lib/agb_flash.h b/include/lib/agb_flash/agb_flash.h similarity index 100% rename from include/lib/agb_flash.h rename to include/lib/agb_flash/agb_flash.h diff --git a/include/gba/flash_internal.h b/include/lib/agb_flash/flash_internal.h similarity index 93% rename from include/gba/flash_internal.h rename to include/lib/agb_flash/flash_internal.h index fe696f7c3..6ff24db09 100644 --- a/include/gba/flash_internal.h +++ b/include/lib/agb_flash/flash_internal.h @@ -2,7 +2,7 @@ #define GUARD_GBA_FLASH_INTERNAL_H #define FLASH_ROM_SIZE_1M 131072 // 1 megabit ROM -#define SECTORS_PER_BANK 16 +#define SECTORS_PER_BANK 16 #if !PORTABLE #define FLASH_BASE ((u8 *)0xE000000) @@ -12,9 +12,7 @@ extern u8 FLASH_BASE[FLASH_ROM_SIZE_1M * SECTORS_PER_BANK]; #define FLASH_WRITE(addr, data) ((*(vu8 *)(FLASH_BASE + (addr))) = (data)) - -struct FlashSector -{ +struct FlashSector { u32 size; u8 shift; u16 count; @@ -29,15 +27,14 @@ struct FlashType { // TODO: add support for anonymous unions/structs if possible union { struct { - u8 makerId; - u8 deviceId; + u8 makerId; + u8 deviceId; } separate; u16 joined; } ids; }; -struct FlashSetupInfo -{ +struct FlashSetupInfo { u16 (*programFlashSector)(u16, void *); u16 (*eraseFlashChip)(void); u16 (*eraseFlashSector)(u16); @@ -54,14 +51,13 @@ extern u16 (*EraseFlashSector)(u16); extern const u16 *gFlashMaxTime; extern const struct FlashType *gFlash; - extern u8 gFlashTimeoutFlag; extern u8 (*PollFlashStatus)(u8 *); extern u16 (*WaitForFlashWrite)(u8, u8 *, u8); extern const struct FlashSetupInfo LE39FW512; -//extern const struct FlashSetupInfo AT29LV512; +// extern const struct FlashSetupInfo AT29LV512; extern const struct FlashSetupInfo MN63F805MNP; extern const struct FlashSetupInfo MX29L512; extern const struct FlashSetupInfo DefaultFlash512K; diff --git a/include/lib/m4a.h b/include/lib/m4a.h deleted file mode 100644 index 4146628e6..000000000 --- a/include/lib/m4a.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef GUARD_M4A_H -#define GUARD_M4A_H - -#include "gba/m4a_internal.h" - -extern struct SoundInfo gSoundInfo; - -extern struct MusicPlayerInfo gMPlayInfo_BGM; -extern struct MusicPlayerInfo gMPlayInfo_SE1; -extern struct MusicPlayerInfo gMPlayInfo_SE2; -extern struct MusicPlayerInfo gMPlayInfo_SE3; - -void m4aSoundVSync(void); - -void m4aSoundInit(void); -void m4aSoundMain(void); -void m4aSongNumStart(u16); -void m4aSongNumStartOrChange(u16); -void m4aSongNumStartOrContinue(u16); -void m4aSongNumStop(u16 n); -void m4aMPlayAllStop(void); -void m4aMPlayAllContinue(void); -void m4aMPlayContinue(struct MusicPlayerInfo *mplayInfo); -void m4aMPlayFadeOut(struct MusicPlayerInfo *mplayInfo, u16 speed); -void m4aMPlayFadeOutTemporarily(struct MusicPlayerInfo *mplayInfo, u16 speed); -void m4aMPlayFadeIn(struct MusicPlayerInfo *mplayInfo, u16 speed); -void m4aMPlayImmInit(struct MusicPlayerInfo *mplayInfo); - -void m4aMPlayTempoControl(struct MusicPlayerInfo *mplayInfo, u16 tempo); -void m4aMPlayVolumeControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u16 volume); -void m4aMPlayPitchControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, s16 pitch); -void m4aMPlayPanpotControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, s8 pan); - -#define DEFAULT_SOUND_MODE (SOUND_MODE_DA_BIT_8 | SOUND_MODE_FREQ_10512 | (15 << SOUND_MODE_MASVOL_SHIFT) | (5 << SOUND_MODE_MAXCHN_SHIFT)) - -#endif // GUARD_M4A_H diff --git a/include/lib/m4a/m4a.h b/include/lib/m4a/m4a.h new file mode 100644 index 000000000..9acb2fb4d --- /dev/null +++ b/include/lib/m4a/m4a.h @@ -0,0 +1,34 @@ +#ifndef GUARD_M4A_H +#define GUARD_M4A_H + +#include "lib/m4a/m4a_internal.h" + +extern struct SoundMixerState gSoundInfo; + +extern struct MP2KPlayerState gMPlayInfo_BGM; +extern struct MP2KPlayerState gMPlayInfo_SE1; +extern struct MP2KPlayerState gMPlayInfo_SE2; +extern struct MP2KPlayerState gMPlayInfo_SE3; + +void m4aSoundVSync(void); + +void m4aSoundInit(void); +void m4aSoundMain(void); +void m4aSongNumStart(u16); +void m4aSongNumStartOrChange(u16); +void m4aSongNumStartOrContinue(u16); +void m4aSongNumStop(u16 n); +void m4aMPlayAllStop(void); +void m4aMPlayAllContinue(void); +void m4aMPlayContinue(struct MP2KPlayerState *mplayInfo); +void m4aMPlayFadeOut(struct MP2KPlayerState *mplayInfo, u16 speed); +void m4aMPlayFadeOutTemporarily(struct MP2KPlayerState *mplayInfo, u16 speed); +void m4aMPlayFadeIn(struct MP2KPlayerState *mplayInfo, u16 speed); +void m4aMPlayImmInit(struct MP2KPlayerState *mplayInfo); + +void m4aMPlayTempoControl(struct MP2KPlayerState *mplayInfo, u16 tempo); +void m4aMPlayVolumeControl(struct MP2KPlayerState *mplayInfo, u16 trackBits, u16 volume); +void m4aMPlayPitchControl(struct MP2KPlayerState *mplayInfo, u16 trackBits, s16 pitch); +void m4aMPlayPanpotControl(struct MP2KPlayerState *mplayInfo, u16 trackBits, s8 pan); + +#endif // GUARD_M4A_H diff --git a/include/lib/m4a/m4a_internal.h b/include/lib/m4a/m4a_internal.h new file mode 100644 index 000000000..d22a6f2b1 --- /dev/null +++ b/include/lib/m4a/m4a_internal.h @@ -0,0 +1,468 @@ +#ifndef GUARD_GBA_M4A_INTERNAL_H +#define GUARD_GBA_M4A_INTERNAL_H + +#include "gba/gba.h" + +// ASCII encoding of 'Smsh' in reverse +// This is presumably short for SMASH, the developer of MKS4AGB. +#define ID_NUMBER 0x68736D53 + +#define C_V 0x40 // center value for PAN, BEND, and TUNE + +#define SOUND_MODE_REVERB_VAL 0x0000007F +#define SOUND_MODE_REVERB_SET 0x00000080 +#define SOUND_MODE_MAXCHN 0x00000F00 +#define SOUND_MODE_MAXCHN_SHIFT 8 +#define SOUND_MODE_MASVOL 0x0000F000 +#define SOUND_MODE_MASVOL_SHIFT 12 +#define SOUND_MODE_FREQ_05734 0x00010000 +#define SOUND_MODE_FREQ_07884 0x00020000 +#define SOUND_MODE_FREQ_10512 0x00030000 +#define SOUND_MODE_FREQ_13379 0x00040000 +#define SOUND_MODE_FREQ_15768 0x00050000 +#define SOUND_MODE_FREQ_18157 0x00060000 +#define SOUND_MODE_FREQ_21024 0x00070000 +#define SOUND_MODE_FREQ_26758 0x00080000 +#define SOUND_MODE_FREQ_31536 0x00090000 +#define SOUND_MODE_FREQ_36314 0x000A0000 +#define SOUND_MODE_FREQ_40137 0x000B0000 +#define SOUND_MODE_FREQ_42048 0x000C0000 +#define SOUND_MODE_FREQ 0x000F0000 +#define SOUND_MODE_FREQ_SHIFT 16 +#define SOUND_MODE_DA_BIT_9 0x00800000 +#define SOUND_MODE_DA_BIT_8 0x00900000 +#define SOUND_MODE_DA_BIT_7 0x00A00000 +#define SOUND_MODE_DA_BIT_6 0x00B00000 +#define SOUND_MODE_DA_BIT 0x00B00000 +#define SOUND_MODE_DA_BIT_SHIFT 20 + +#define DEFAULT_SOUND_MODE (SOUND_MODE_DA_BIT_8 | SOUND_MODE_FREQ_10512 | (15 << SOUND_MODE_MASVOL_SHIFT) | (5 << SOUND_MODE_MAXCHN_SHIFT)) + +#define TONEDATA_TYPE_CGB 0x07 +#define TONEDATA_TYPE_FIX 0x08 +#define TONEDATA_TYPE_SPL 0x40 // key split +#define TONEDATA_TYPE_RHY 0x80 // rhythm + +#define TONEDATA_P_S_PAN 0xc0 +#define TONEDATA_P_S_PAM TONEDATA_P_S_PAN + +#define SOUND_CHANNEL_SF_START 0x80 +#define SOUND_CHANNEL_SF_STOP 0x40 +#define SOUND_CHANNEL_SF_LOOP 0x10 +#define SOUND_CHANNEL_SF_IEC 0x04 +#define SOUND_CHANNEL_SF_ENV 0x03 +#define SOUND_CHANNEL_SF_ENV_ATTACK 0x03 +#define SOUND_CHANNEL_SF_ENV_DECAY 0x02 +#define SOUND_CHANNEL_SF_ENV_SUSTAIN 0x01 +#define SOUND_CHANNEL_SF_ENV_RELEASE 0x00 +#define SOUND_CHANNEL_SF_ON (SOUND_CHANNEL_SF_START | SOUND_CHANNEL_SF_STOP | SOUND_CHANNEL_SF_IEC | SOUND_CHANNEL_SF_ENV) + +#define CGB_CHANNEL_MO_PIT 0x02 +#define CGB_CHANNEL_MO_VOL 0x01 + +#define CGB_NRx2_ENV_DIR_DEC 0x00 +#define CGB_NRx2_ENV_DIR_INC 0x08 + +#define MPT_FLG_VOLSET 0x01 +#define MPT_FLG_VOLCHG 0x03 +#define MPT_FLG_PITSET 0x04 +#define MPT_FLG_PITCHG 0x0C +#define MPT_FLG_START 0x40 +#define MPT_FLG_EXIST 0x80 + +#define MUSICPLAYER_STATUS_TRACK 0x0000ffff +#define MUSICPLAYER_STATUS_PAUSE 0x80000000 + +#define MAX_MUSICPLAYER_TRACKS 16 + +#define TRACKS_ALL 0xFFFF + +#define TEMPORARY_FADE 0x0001 +#define FADE_IN 0x0002 +#define FADE_VOL_MAX 64 +#define FADE_VOL_SHIFT 2 + +#define MAX_DIRECTSOUND_CHANNELS 12 + +#if PLATFORM_GBA +#define PCM_DMA_BUF_SIZE 1584 // size of Direct Sound buffer +#else +#define PCM_DMA_BUF_SIZE 4907 // size of Direct Sound buffer +#endif + +#if PLATFORM_GBA +#define NUM_MUSIC_PLAYERS ((u16)gNumMusicPlayers) +#define MAX_LINES ((u32)gMaxLines) +#else +#define NUM_MUSIC_PLAYERS 4 +#define MAX_LINES 0 +#endif + +struct MP2KTrack; +struct MP2KPlayerState; + +typedef void (*MPlayFunc)(); +typedef void (*MP2KEventNoteFunc)(u8, struct MP2KPlayerState *, struct MP2KTrack *); +typedef void (*MP2KEventFunc)(struct MP2KPlayerState *, struct MP2KTrack *); +typedef void (*CgbSoundFunc)(void); +typedef void (*CgbOscOffFunc)(u8); +typedef u32 (*MidiKeyToCgbFreqFunc)(u8, u8, u8); +typedef void (*ExtVolPitFunc)(void); +typedef void (*MPlayMainFunc)(struct MP2KPlayerState *); + +struct MixerSource { + u8 status; + u8 type; + u8 rightVol; + u8 leftVol; + + union { + struct { + u8 attack; + u8 decay; + u8 sustain; + u8 release; + u8 key; + u8 envelopeVol; + + u8 envelopeGoal; + u8 envelopeCtr; + + u8 echoVol; + u8 echoLen; + u8 padding1; + u8 padding2; + u8 gateTime; + u8 untransposedKey; + u8 velocity; + u8 priority; + u8 rhythmPan; + u8 padding3; + u8 padding4; + u8 padding5; + + u8 padding6; + u8 sustainGoal; + u8 nrx4; + u8 pan; + + u8 panMask; + u8 cgbStatus; + u8 length; + u8 sweep; + + u32 freq; + } cgb; + struct { + u8 attack; + u8 decay; + u8 sustain; + u8 release; + u8 key; + u8 envelopeVol; + + u8 envelopeVolR; + u8 envelopeVolL; + + u8 echoVol; + u8 echoLen; + u8 padding1; + u8 padding2; + u8 gateTime; + u8 untransposedKey; + u8 velocity; + u8 priority; + u8 rhythmPan; + u8 padding3; + u8 padding4; + u8 padding5; + + u32 ct; + float fw; + + u32 freq; + } sound; + } data; + + void *wav; // The next peice of data to be loading + void *current; // The working pointer from wav + + struct MP2KTrack *track; + struct MixerSource *prev; + struct MixerSource *next; + u32 padding7; // d4 + u32 blockCount; // bdpcm block count +}; + +struct SoundMixerState { + // This field is normally equal to ID_NUMBER but it is set to other + // values during sensitive operations for locking purposes. + u32 lockStatus; + + vu8 dmaCounter; + + // Direct Sound + u8 reverb; + u8 numChans; + u8 masterVol; + u8 freqOption; + + u8 extensionFlags; + u8 cgbCounter15; // periodically counts from 14 down to 0 (15 states) + u8 framesPerDmaCycle; // number of V-blanks per PCM DMA + u8 maxScanlines; + u8 gap[3]; + s32 samplesPerFrame; + s32 sampleRate; +#if PLATFORM_GBA + s32 sampleRateReciprocal; +#else + float sampleRateReciprocal; +#endif + struct MixerSource *cgbChans; + MPlayMainFunc MPlayMainHead; + struct MP2KPlayerState *musicPlayerHead; + CgbSoundFunc CgbSound; + CgbOscOffFunc CgbOscOff; + MidiKeyToCgbFreqFunc MidiKeyToCgbFreq; + MPlayFunc *MPlayJumpTable; + MP2KEventNoteFunc plynote; + ExtVolPitFunc ExtVolPit; + void *reserved2; + void *reserved3; + void *reversed4; + void *reserved5; + struct MixerSource chans[MAX_DIRECTSOUND_CHANNELS]; +#if PLATFORM_GBA + s8 pcmBuffer[PCM_DMA_BUF_SIZE * 2]; +#else + float pcmBuffer[PCM_DMA_BUF_SIZE * 2]; +#endif +}; + +struct MP2KVoiceGroup { + u8 type; + u8 drumKey; + u8 cgbLength; + u8 pan_sweep; // pan or sweep (compatible sound ch. 1) + union { + struct { + struct WaveData *wav; + u8 attack; + u8 decay; + u8 sustain; + u8 release; + } sound; + struct { + struct MP2KVoiceGroup *group; + u8 *keySplitTable; + } keySplit; + } data; +}; + +struct WaveData { + u16 type; + u16 status; + + u32 freq; + u32 loopStart; + u32 size; // number of samples + s8 data[1]; // samples +}; + +struct MP2KSongHeader { + u8 trackCount; + u8 blockCount; + u8 priority; + u8 reverb; + struct MP2KVoiceGroup *voicegroup; + u8 *part[1]; +}; + +struct MP2KTrack { + u8 status; + u8 wait; + u8 patternLevel; + u8 repeatCount; + u8 gateTime; // 0 if TIE + u8 key; + u8 velocity; + u8 runningStatus; + s8 keyShiftCalculated; // Calculated by TrkVolPitSet using fields below. Units: semitones + u8 pitchCalculated; // Calculated by TrkVolPitSet using fields below. Units: 256ths of a semitone + s8 keyShift; // Units: semitones + s8 keyShiftPublic; // Units: semitones + s8 tune; // Units: 64ths of a semitone + u8 pitchPublic; // Units: 256ths of a semitone + s8 bend; // Units: (bendRange / 64)ths of a semitone + u8 bendRange; + u8 volRightCalculated; + u8 volLeftCalculated; + u8 vol; + u8 volPublic; // Used both for fades and MPlayVolumeControl + s8 pan; + s8 panPublic; + s8 modCalculated; // Pitch units: 16ths of a semitone + u8 modDepth; + u8 modType; + u8 lfoSpeed; + u8 lfoSpeedCounter; + u8 lfoDelay; + u8 lfoDelayCounter; + u8 priority; + u8 echoVolume; + u8 echoLength; + + struct MixerSource *chan; + struct MP2KVoiceGroup voicegroup; + + u8 gap[10]; + u16 unk_3A; + u32 unk_3C; + u8 *cmdPtr; + u8 *patternStack[3]; +}; + +struct MP2KPlayerState { + struct MP2KSongHeader *songHeader; + u32 status; + u8 trackCount; + u8 priority; + u8 cmd; + bool8 checkSongPriority; + u32 clock; + u8 padding[8]; + u8 *memAccArea; + u16 tempoRawBPM; // 150 initially... this doesn't seem right but whatever + u16 tempoScale; // 0x100 initially + u16 tempoInterval; // 150 initially + u16 tempoCounter; + u16 fadeInterval; + u16 fadeCounter; + u16 fadeOV; + struct MP2KTrack *tracks; + struct MP2KVoiceGroup *voicegroup; + u32 lockStatus; + MPlayMainFunc nextPlayerFunc; + struct MP2KPlayerState *nextPlayer; +}; + +struct MusicPlayer { + struct MP2KPlayerState *info; + struct MP2KTrack *track; + u8 numTracks; + u16 unk_A; +}; + +struct Song { + struct MP2KSongHeader *header; + u16 ms; + u16 me; +}; + +typedef void (*XcmdFunc)(struct MP2KPlayerState *, struct MP2KTrack *); + +extern char SoundMainRAM[]; +extern u8 gMPlayMemAccArea[]; +extern MPlayFunc gMPlayJumpTable[]; +extern struct MixerSource gCgbChans[]; + +extern const struct MusicPlayer gMPlayTable[]; +extern const struct Song gSongTable[]; +extern const XcmdFunc gXcmdTable[]; + +extern const u8 gClockTable[]; +extern const u8 gScaleTable[]; +extern const u32 gFreqTable[]; +extern const u16 gPcmSamplesPerVBlankTable[]; +extern void *const gMPlayJumpTableTemplate[]; + +extern const u8 gCgbScaleTable[]; +extern const s16 gCgbFreqTable[]; +extern const u8 gNoiseTable[]; +extern const u8 gCgb3Vol[]; + +#if PLATFORM_GBA +extern char gNumMusicPlayers[]; +extern char gMaxLines[]; +#endif + +u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust); +u32 umul3232H32(u32 multiplier, u32 multiplicand); +void SoundMain(void); +void SoundMainBTM(void *ptr); +void TrackStop(struct MP2KPlayerState *player, struct MP2KTrack *track); +void MP2KPlayerMain(struct MP2KPlayerState *); + +void ClearChain(struct MixerSource *chan); +void MP2KClearChain(struct MixerSource *chan); + +void MPlayContinue(struct MP2KPlayerState *mplayInfo); +void MPlayStart(struct MP2KPlayerState *mplayInfo, struct MP2KSongHeader *songHeader); +void MPlayStop(struct MP2KPlayerState *mplayInfo); +void FadeOutBody(struct MP2KPlayerState *mplayInfo); +void TrkVolPitSet(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track); +void MPlayFadeOut(struct MP2KPlayerState *mplayInfo, u16 speed); +void Clear64byte(void *addr); +void SoundInit(struct SoundMixerState *soundInfo); +void MPlayExtender(struct MixerSource *cgbChans); +void m4aSoundMode(u32 mode); +void MPlayOpen(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *tracks, u8 trackCount); +void CgbSound(void); +void CgbOscOff(u8); +void CgbModVol(struct MixerSource *chan); +u32 MidiKeyToCgbFreq(u8, u8, u8); +void MPlayJumpTableCopy(void **mplayJumpTable); +void SampleFreqSet(u32 freq); +void m4aSoundVSyncOn(void); +void m4aSoundVSyncOff(void); + +void m4aMPlayTempoControl(struct MP2KPlayerState *mplayInfo, u16 tempo); +void m4aMPlayVolumeControl(struct MP2KPlayerState *mplayInfo, u16 trackBits, u16 volume); +void m4aMPlayPitchControl(struct MP2KPlayerState *mplayInfo, u16 trackBits, s16 pitch); +void m4aMPlayPanpotControl(struct MP2KPlayerState *mplayInfo, u16 trackBits, s8 pan); +void ClearModM(struct MP2KTrack *track); +void m4aMPlayModDepthSet(struct MP2KPlayerState *mplayInfo, u16 trackBits, u8 modDepth); +void m4aMPlayLFOSpeedSet(struct MP2KPlayerState *mplayInfo, u16 trackBits, u8 lfoSpeed); + +// sound command handler functions +void MP2K_event_fine(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_goto(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_patt(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_pend(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_rept(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_memacc(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_prio(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_tempo(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_keysh(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_voice(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_vol(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_pan(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_bend(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_bendr(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_lfos(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_lfodl(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_mod(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_modt(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_tune(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_port(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xcmd(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_endtie(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_nxx(u8 clock, struct MP2KPlayerState *, struct MP2KTrack *); + +// extended sound command handler functions +void MP2K_event_xxx(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xwave(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xtype(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xatta(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xdeca(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xsust(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xrele(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xiecv(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xiecl(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xleng(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xswee(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xcmd_0C(struct MP2KPlayerState *, struct MP2KTrack *); +void MP2K_event_xcmd_0D(struct MP2KPlayerState *, struct MP2KTrack *); + +#endif // GUARD_GBA_M4A_INTERNAL_H diff --git a/include/platform/platform.h b/include/platform/platform.h index 524508d8b..0a44b8f1f 100644 --- a/include/platform/platform.h +++ b/include/platform/platform.h @@ -1,6 +1,8 @@ #ifndef GUARD_SA2_PLATFORM_H #define GUARD_SA2_PLATFORM_H +#include "gba/types.h" + /* NOTE: * "Unsafe" versions included for compatibility. * This is just here so if someone accidentally calls @@ -12,11 +14,13 @@ * anymore. */ #define ENABLE_RL_LZ_LOGGING 1 -unsigned char *Platform_LZDecompress(unsigned char *src, int srcSize); -unsigned char *Platform_RLDecompress(unsigned char *src, int srcSize); -void Platform_LZFree(unsigned char *dest); -void Platform_RLFree(unsigned char *dest); -void Platform_LZDecompressUnsafe(unsigned char *src, unsigned char *dest); -void Platform_RLDecompressUnsafe(unsigned char *src, unsigned char *dest); +extern unsigned char *Platform_LZDecompress(unsigned char *src, int srcSize); +extern unsigned char *Platform_RLDecompress(unsigned char *src, int srcSize); +extern void Platform_LZFree(unsigned char *dest); +extern void Platform_RLFree(unsigned char *dest); +extern void Platform_LZDecompressUnsafe(unsigned char *src, unsigned char *dest); +extern void Platform_RLDecompressUnsafe(unsigned char *src, unsigned char *dest); + +extern void Platform_QueueAudio(const void *data, u32 numBytes); #endif // GUARD_SA2_PLATFORM_H diff --git a/include/platform/shared/audio/README.txt b/include/platform/shared/audio/README.txt new file mode 100644 index 000000000..11d4506a3 --- /dev/null +++ b/include/platform/shared/audio/README.txt @@ -0,0 +1,4 @@ +The source code in this folder is from: +https://github.com/Kurausukun/pokeemerald/tree/pc_port + +Thanks to camthesaxman, Kurausukun, Pidgey and NT_x86 for allowing us to use the code! diff --git a/include/platform/shared/audio/cgb_audio.h b/include/platform/shared/audio/cgb_audio.h new file mode 100644 index 000000000..65dd77a91 --- /dev/null +++ b/include/platform/shared/audio/cgb_audio.h @@ -0,0 +1,36 @@ +#ifndef CGB_AUDIO_H +#define CGB_AUDIO_H + +#include "lib/m4a/m4a_internal.h" + +struct AudioCGB { + u16 ch1Freq; + u8 ch1SweepCounter; + u8 ch1SweepCounterI; + bool8 ch1SweepDir; + u8 ch1SweepShift; + u8 Vol[4]; + u8 VolI[4]; + u8 Len[4]; + u8 LenI[4]; + bool8 LenOn[4]; + u8 EnvCounter[4]; + u8 EnvCounterI[4]; + bool8 EnvDir[4]; + bool8 DAC[4]; + float WAVRAM[32]; + u16 ch4LFSR[2]; + float outBuffer[PCM_DMA_BUF_SIZE * 2]; +}; + +void cgb_audio_init(u32 rate); +void cgb_set_sweep(u8 sweep); +void cgb_set_wavram(); +void cgb_toggle_length(u8 channel, bool8 state); +void cgb_set_length(u8 channel, u8 length); +void cgb_set_envelope(u8 channel, u8 envelope); +void cgb_trigger_note(u8 channel); +void cgb_audio_generate(u16 samplesPerFrame); +float *cgb_get_buffer(); + +#endif diff --git a/include/platform/shared/audio/cgb_tables.h b/include/platform/shared/audio/cgb_tables.h new file mode 100644 index 000000000..0966471ae --- /dev/null +++ b/include/platform/shared/audio/cgb_tables.h @@ -0,0 +1,2100 @@ +#ifndef CGB_TABLES_H +#define CGB_TABLES_H + +const int16_t PU0[32] + = { 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; + +const int16_t PU1[32] + = { 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; + +const int16_t PU2[32] = { 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1 }; + +const int16_t PU3[32] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1 }; + +int16_t WAV[32] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1 }; + +const float freqTable[2048] = { 32, + 32.0156326331216, + 32.0312805474096, + 32.0469437652812, + 32.0626223091976, + 32.0783162016642, + 32.0940254652302, + 32.109750122489, + 32.1254901960784, + 32.1412457086807, + 32.1570166830226, + 32.1728031418753, + 32.188605108055, + 32.2044226044226, + 32.220255653884, + 32.2361042793901, + 32.251968503937, + 32.2678483505662, + 32.2837438423645, + 32.2996550024643, + 32.3155818540434, + 32.3315244203256, + 32.3474827245805, + 32.3634567901235, + 32.3794466403162, + 32.3954522985665, + 32.4114737883284, + 32.4275111331024, + 32.4435643564356, + 32.4596334819217, + 32.4757185332012, + 32.4918195339613, + 32.5079365079365, + 32.5240694789082, + 32.5402184707051, + 32.5563835072032, + 32.572564612326, + 32.5887618100448, + 32.6049751243781, + 32.6212045793927, + 32.6374501992032, + 32.6537120079721, + 32.6699900299103, + 32.6862842892768, + 32.7025948103792, + 32.7189216175736, + 32.7352647352647, + 32.751624187906, + 32.768, + 32.784392196098, + 32.8008008008008, + 32.8172258387581, + 32.8336673346693, + 32.8501253132832, + 32.8665997993982, + 32.8830908178625, + 32.8995983935743, + 32.9161225514817, + 32.9326633165829, + 32.9492207139266, + 32.9657947686117, + 32.9823855057876, + 32.9989929506546, + 33.0156171284635, + 33.0322580645161, + 33.0489157841654, + 33.0655903128153, + 33.0822816759213, + 33.0989898989899, + 33.1157150075796, + 33.1324570273003, + 33.1492159838139, + 33.165991902834, + 33.1827848101266, + 33.1995947315096, + 33.2164216928535, + 33.2332657200811, + 33.2501268391679, + 33.2670050761421, + 33.2839004570848, + 33.3008130081301, + 33.3177427554652, + 33.3346897253306, + 33.3516539440204, + 33.3686354378819, + 33.3856342333164, + 33.4026503567788, + 33.4196838347782, + 33.4367346938776, + 33.4538029606942, + 33.4708886618999, + 33.4879918242207, + 33.5051124744376, + 33.5222506393862, + 33.539406345957, + 33.5565796210957, + 33.5737704918033, + 33.5909789851358, + 33.6082051282051, + 33.6254489481786, + 33.6427104722793, + 33.6599897277863, + 33.6772867420349, + 33.6946015424164, + 33.7119341563786, + 33.7292846114256, + 33.7466529351184, + 33.7640391550747, + 33.7814432989691, + 33.7988653945333, + 33.8163054695562, + 33.8337635518844, + 33.8512396694215, + 33.8687338501292, + 33.8862461220269, + 33.9037765131919, + 33.9213250517598, + 33.9388917659244, + 33.9564766839378, + 33.9740798341109, + 33.9917012448133, + 34.0093409444733, + 34.0269989615784, + 34.0446753246753, + 34.0623700623701, + 34.0800832033281, + 34.0978147762747, + 34.1155648099948, + 34.1333333333333, + 34.1511203751954, + 34.1689259645464, + 34.1867501304121, + 34.2045929018789, + 34.222454308094, + 34.2403343782654, + 34.2582331416623, + 34.2761506276151, + 34.2940868655154, + 34.3120418848168, + 34.330015715034, + 34.3480083857442, + 34.3660199265863, + 34.3840503672613, + 34.4020997375328, + 34.4201680672269, + 34.4382553862323, + 34.4563617245005, + 34.4744871120463, + 34.4926315789474, + 34.5107951553449, + 34.5289778714436, + 34.5471797575119, + 34.5654008438819, + 34.5836411609499, + 34.6019007391763, + 34.6201796090861, + 34.6384778012685, + 34.6567953463776, + 34.6751322751323, + 34.6934886183166, + 34.7118644067797, + 34.7302596714361, + 34.7486744432662, + 34.7671087533156, + 34.7855626326964, + 34.8040361125863, + 34.8225292242295, + 34.8410419989367, + 34.8595744680851, + 34.8781266631187, + 34.8966986155485, + 34.9152903569526, + 34.9339019189765, + 34.9525333333333, + 34.9711846318036, + 34.989855846236, + 35.008547008547, + 35.0272581507215, + 35.0459893048128, + 35.0647405029427, + 35.0835117773019, + 35.10230316015, + 35.1211146838156, + 35.1399463806971, + 35.1587982832618, + 35.1776704240472, + 35.1965628356606, + 35.2154755507792, + 35.2344086021505, + 35.2533620225928, + 35.2723358449946, + 35.2913301023156, + 35.3103448275862, + 35.3293800539084, + 35.3484358144552, + 35.3675121424717, + 35.3866090712743, + 35.4057266342518, + 35.4248648648649, + 35.4440237966468, + 35.4632034632035, + 35.4824038982133, + 35.501625135428, + 35.5208672086721, + 35.5401301518438, + 35.5594139989148, + 35.5787187839305, + 35.5980445410103, + 35.6173913043478, + 35.636759108211, + 35.6561479869423, + 35.6755579749592, + 35.6949891067538, + 35.7144414168937, + 35.7339149400218, + 35.7534097108565, + 35.7729257641921, + 35.792463134899, + 35.8120218579235, + 35.8316019682887, + 35.8512035010941, + 35.8708264915161, + 35.8904709748083, + 35.9101369863014, + 35.9298245614035, + 35.9495337356007, + 35.9692645444566, + 35.9890170236134, + 36.0087912087912, + 36.0285871357889, + 36.048404840484, + 36.0682443588332, + 36.0881057268722, + 36.1079889807162, + 36.1278941565601, + 36.1478212906784, + 36.167770419426, + 36.187741579238, + 36.2077348066298, + 36.2277501381979, + 36.2477876106195, + 36.267847260653, + 36.2879291251384, + 36.3080332409972, + 36.3281596452328, + 36.3483083749307, + 36.3684794672586, + 36.388672959467, + 36.4088888888889, + 36.4291272929405, + 36.4493882091212, + 36.4696716750139, + 36.4899777282851, + 36.5103064066852, + 36.5306577480491, + 36.5510317902956, + 36.5714285714286, + 36.5918481295366, + 36.6122905027933, + 36.6327557294578, + 36.6532438478747, + 36.6737548964745, + 36.6942889137738, + 36.7148459383753, + 36.7354260089686, + 36.7560291643298, + 36.7766554433221, + 36.7973048848961, + 36.8179775280899, + 36.8386734120292, + 36.859392575928, + 36.8801350590884, + 36.9009009009009, + 36.9216901408451, + 36.9425028184893, + 36.9633389734913, + 36.9841986455982, + 37.0050818746471, + 37.025988700565, + 37.0469191633691, + 37.0678733031674, + 37.0888511601585, + 37.1098527746319, + 37.1308781869688, + 37.1519274376417, + 37.173000567215, + 37.1940976163451, + 37.2152186257808, + 37.2363636363636, + 37.2575326890279, + 37.2787258248009, + 37.2999430848036, + 37.3211845102506, + 37.3424501424501, + 37.363740022805, + 37.3850541928123, + 37.4063926940639, + 37.4277555682467, + 37.4491428571429, + 37.4705546026301, + 37.4919908466819, + 37.5134516313681, + 37.5349369988545, + 37.556446991404, + 37.5779816513761, + 37.5995410212278, + 37.6211251435132, + 37.6427340608845, + 37.664367816092, + 37.6860264519839, + 37.7077100115075, + 37.7294185377087, + 37.7511520737327, + 37.7729106628242, + 37.7946943483276, + 37.8165031736872, + 37.838337182448, + 37.8601964182553, + 37.8820809248555, + 37.903990746096, + 37.9259259259259, + 37.9478865083961, + 37.9698725376593, + 37.991884057971, + 38.0139211136891, + 38.0359837492745, + 38.0580720092915, + 38.0801859384079, + 38.1023255813953, + 38.1244909831297, + 38.1466821885914, + 38.1688992428655, + 38.1911421911422, + 38.2134110787172, + 38.2357059509918, + 38.2580268534734, + 38.2803738317757, + 38.3027469316189, + 38.3251461988304, + 38.3475716793446, + 38.3700234192037, + 38.3925014645577, + 38.4150058616647, + 38.4375366568915, + 38.4600938967136, + 38.4826776277158, + 38.5052878965922, + 38.527924750147, + 38.5505882352941, + 38.5732783990583, + 38.5959952885748, + 38.6187389510902, + 38.6415094339623, + 38.6643067846608, + 38.6871310507674, + 38.7099822799764, + 38.7328605200946, + 38.755765819042, + 38.7786982248521, + 38.801657785672, + 38.824644549763, + 38.8476585655009, + 38.870699881376, + 38.8937685459941, + 38.916864608076, + 38.9399881164587, + 38.9631391200951, + 38.9863176680547, + 39.0095238095238, + 39.0327575938058, + 39.0560190703218, + 39.0793082886106, + 39.1026252983294, + 39.1259701492537, + 39.1493428912784, + 39.1727435744172, + 39.1961722488038, + 39.2196289646918, + 39.2431137724551, + 39.2666267225884, + 39.2901678657074, + 39.3137372525495, + 39.3373349339736, + 39.360960960961, + 39.3846153846154, + 39.4082982561636, + 39.4320096269555, + 39.4557495484648, + 39.4795180722892, + 39.5033152501507, + 39.5271411338963, + 39.5509957754979, + 39.5748792270531, + 39.5987915407855, + 39.6227327690447, + 39.6467029643073, + 39.6707021791768, + 39.694730466384, + 39.7187878787879, + 39.7428744693754, + 39.7669902912621, + 39.7911353976928, + 39.8153098420413, + 39.8395136778115, + 39.8637469586375, + 39.8880097382836, + 39.9123020706455, + 39.9366240097502, + 39.9609756097561, + 39.9853569249542, + 40.009768009768, + 40.0342089187538, + 40.0586797066015, + 40.0831804281346, + 40.1077111383109, + 40.1322718922229, + 40.156862745098, + 40.1814837522992, + 40.2061349693252, + 40.2308164518109, + 40.2555282555283, + 40.280270436386, + 40.3050430504305, + 40.3298461538462, + 40.3546798029557, + 40.3795440542206, + 40.4044389642417, + 40.4293645897594, + 40.4543209876543, + 40.4793082149475, + 40.504326328801, + 40.5293753865182, + 40.5544554455446, + 40.5795665634675, + 40.6047087980174, + 40.6298822070676, + 40.6550868486352, + 40.6803227808814, + 40.7055900621118, + 40.7308887507769, + 40.7562189054726, + 40.7815805849409, + 40.8069738480697, + 40.8323987538941, + 40.857855361596, + 40.8833437305053, + 40.9088639200999, + 40.9344159900062, + 40.96, + 40.9856160100063, + 41.0112640801001, + 41.0369442705072, + 41.062656641604, + 41.0884012539185, + 41.1141781681305, + 41.1399874450722, + 41.1658291457287, + 41.1917033312382, + 41.2176100628931, + 41.2435494021397, + 41.2695214105793, + 41.2955261499685, + 41.3215636822194, + 41.3476340694006, + 41.3737373737374, + 41.3998736576121, + 41.4260429835651, + 41.4522454142948, + 41.4784810126582, + 41.504749841672, + 41.531051964512, + 41.5573874445149, + 41.5837563451777, + 41.6101587301587, + 41.6365946632783, + 41.6630642085188, + 41.6895674300254, + 41.7161043921069, + 41.7426751592357, + 41.7692797960484, + 41.7959183673469, + 41.8225909380983, + 41.8492975734355, + 41.8760383386582, + 41.9028132992327, + 41.9296225207934, + 41.9564660691421, + 41.9833440102498, + 42.0102564102564, + 42.0372033354715, + 42.0641848523748, + 42.0912010276172, + 42.1182519280206, + 42.1453376205788, + 42.1724581724582, + 42.1996136509981, + 42.2268041237113, + 42.254029658285, + 42.2812903225807, + 42.3085861846352, + 42.3359173126615, + 42.3632837750485, + 42.3906856403622, + 42.4181229773463, + 42.4455958549223, + 42.4731043421905, + 42.5006485084306, + 42.5282284231019, + 42.5558441558442, + 42.5834957764782, + 42.6111833550065, + 42.6389069616135, + 42.6666666666667, + 42.6944625407166, + 42.722294654498, + 42.7501630789302, + 42.7780678851175, + 42.8060091443501, + 42.8339869281046, + 42.8620013080445, + 42.890052356021, + 42.9181401440733, + 42.9462647444299, + 42.9744262295082, + 43.002624671916, + 43.0308601444517, + 43.0591327201051, + 43.0874424720579, + 43.1157894736842, + 43.1441737985517, + 43.1725955204216, + 43.2010547132498, + 43.2295514511873, + 43.2580858085809, + 43.2866578599736, + 43.3152676801057, + 43.3439153439153, + 43.3726009265387, + 43.4013245033113, + 43.4300861497681, + 43.4588859416446, + 43.4877239548772, + 43.5166002656043, + 43.5455149501661, + 43.5744680851064, + 43.6034597471723, + 43.6324900133156, + 43.6615589606929, + 43.6906666666667, + 43.7198132088059, + 43.7489986648865, + 43.7782231128925, + 43.807486631016, + 43.8367892976589, + 43.8661311914324, + 43.8955123911587, + 43.9249329758713, + 43.9543930248156, + 43.9838926174497, + 44.0134318334453, + 44.0430107526882, + 44.0726294552791, + 44.1022880215343, + 44.1319865319865, + 44.1617250673855, + 44.1915037086986, + 44.221322537112, + 44.2511816340311, + 44.2810810810811, + 44.3110209601082, + 44.34100135318, + 44.3710223425863, + 44.4010840108401, + 44.431186440678, + 44.4613297150611, + 44.4915139171758, + 44.5217391304348, + 44.5520054384772, + 44.5823129251701, + 44.6126616746086, + 44.6430517711172, + 44.6734832992502, + 44.7039563437926, + 44.7344709897611, + 44.7650273224044, + 44.7956254272044, + 44.8262653898769, + 44.8569472963724, + 44.8876712328767, + 44.9184372858122, + 44.9492455418381, + 44.9800960878518, + 45.010989010989, + 45.0419243986254, + 45.0729023383769, + 45.1039229181005, + 45.1349862258953, + 45.1660923501034, + 45.1972413793103, + 45.2284334023465, + 45.2596685082873, + 45.2909467864547, + 45.3222683264177, + 45.3536332179931, + 45.3850415512465, + 45.4164934164934, + 45.4479889042996, + 45.4795281054823, + 45.5111111111111, + 45.5427380125087, + 45.5744089012517, + 45.6061238691719, + 45.6378830083566, + 45.6696864111498, + 45.7015341701534, + 45.7334263782275, + 45.7653631284916, + 45.7973445143256, + 45.8293706293706, + 45.8614415675297, + 45.8935574229692, + 45.9257182901191, + 45.9579242636746, + 45.9901754385965, + 46.0224719101124, + 46.0548137737175, + 46.0872011251758, + 46.1196340605208, + 46.1521126760563, + 46.184637068358, + 46.2172073342736, + 46.2498235709245, + 46.2824858757062, + 46.3151943462898, + 46.3479490806223, + 46.3807501769285, + 46.4135977337111, + 46.446491849752, + 46.4794326241135, + 46.5124201561391, + 46.5454545454545, + 46.5785358919687, + 46.6116642958748, + 46.6448398576513, + 46.6780626780627, + 46.7113328581611, + 46.7446504992867, + 46.7780157030692, + 46.8114285714286, + 46.8448892065761, + 46.8783977110157, + 46.9119541875447, + 46.945558739255, + 46.9792114695341, + 47.012912482066, + 47.0466618808327, + 47.0804597701149, + 47.1143062544932, + 47.1482014388489, + 47.1821454283657, + 47.2161383285303, + 47.2501802451334, + 47.2842712842713, + 47.3184115523466, + 47.3526011560694, + 47.3868402024584, + 47.4211287988423, + 47.4554670528602, + 47.4898550724638, + 47.5242929659173, + 47.5587808417997, + 47.5933188090051, + 47.6279069767442, + 47.6625454545455, + 47.6972343522562, + 47.7319737800437, + 47.7667638483965, + 47.8016046681255, + 47.836496350365, + 47.8714390065741, + 47.906432748538, + 47.9414776883687, + 47.9765739385066, + 48.0117216117216, + 48.0469208211144, + 48.0821716801174, + 48.1174743024963, + 48.1528288023512, + 48.1882352941176, + 48.2236938925681, + 48.259204712813, + 48.2947678703021, + 48.330383480826, + 48.3660516605166, + 48.4017725258493, + 48.4375461936438, + 48.4733727810651, + 48.5092524056255, + 48.5451851851852, + 48.581171237954, + 48.6172106824926, + 48.6533036377134, + 48.6894502228826, + 48.7256505576208, + 48.7619047619048, + 48.7982129560685, + 48.8345752608048, + 48.8709917971663, + 48.9074626865672, + 48.9439880507842, + 48.9805680119582, + 49.0172026925954, + 49.0538922155689, + 49.0906367041199, + 49.1274362818591, + 49.1642910727682, + 49.2012012012012, + 49.2381667918858, + 49.2751879699248, + 49.3122648607976, + 49.3493975903615, + 49.3865862848531, + 49.4238310708899, + 49.4611320754717, + 49.4984894259819, + 49.535903250189, + 49.5733736762481, + 49.6109008327025, + 49.6484848484849, + 49.6861258529189, + 49.7238239757208, + 49.7615793470008, + 49.7993920972644, + 49.8372623574145, + 49.8751902587519, + 49.9131759329779, + 49.9512195121951, + 49.9893211289092, + 50.0274809160305, + 50.0656990068755, + 50.1039755351682, + 50.1423106350421, + 50.1807044410413, + 50.2191570881226, + 50.2576687116564, + 50.296239447429, + 50.3348694316436, + 50.3735588009224, + 50.4123076923077, + 50.451116243264, + 50.4899845916795, + 50.5289128758674, + 50.5679012345679, + 50.6069498069498, + 50.6460587326121, + 50.6852281515855, + 50.7244582043344, + 50.7637490317583, + 50.8031007751938, + 50.8425135764158, + 50.8819875776397, + 50.9215229215229, + 50.9611197511664, + 51.0007782101167, + 51.0404984423676, + 51.0802805923617, + 51.1201248049922, + 51.160031225605, + 51.2, + 51.2400312744331, + 51.2801251956182, + 51.3202819107283, + 51.3605015673981, + 51.4007843137255, + 51.4411302982732, + 51.4815396700707, + 51.5220125786164, + 51.5625491738788, + 51.6031496062992, + 51.6438140267928, + 51.6845425867508, + 51.7253354380426, + 51.7661927330174, + 51.8071146245059, + 51.8481012658228, + 51.889152810768, + 51.9302694136292, + 51.9714512291832, + 52.0126984126984, + 52.0540111199365, + 52.0953895071542, + 52.1368337311058, + 52.1783439490446, + 52.2199203187251, + 52.2615629984051, + 52.3032721468476, + 52.3450479233227, + 52.3868904876099, + 52.4288, + 52.470776621297, + 52.5128205128205, + 52.5549318364074, + 52.5971107544141, + 52.6393574297189, + 52.6816720257235, + 52.7240547063556, + 52.7665056360709, + 52.809024979855, + 52.8516129032258, + 52.8942695722357, + 52.9369951534734, + 52.9797898140663, + 53.0226537216829, + 53.0655870445344, + 53.1085899513776, + 53.1516626115166, + 53.1948051948052, + 53.2380178716491, + 53.2813008130081, + 53.3246541903987, + 53.3680781758958, + 53.4115729421353, + 53.4551386623165, + 53.4987755102041, + 53.5424836601307, + 53.5862632869992, + 53.6301145662848, + 53.6740376740377, + 53.7180327868852, + 53.7621000820345, + 53.8062397372742, + 53.8504519309778, + 53.8947368421053, + 53.9390946502058, + 53.9835255354201, + 54.0280296784831, + 54.0726072607261, + 54.1172584640793, + 54.1619834710744, + 54.206782464847, + 54.2516556291391, + 54.2966031483016, + 54.3416252072969, + 54.3867219917012, + 54.4318936877076, + 54.477140482128, + 54.522462562396, + 54.5678601165695, + 54.6133333333333, + 54.6588824020017, + 54.7045075125209, + 54.750208855472, + 54.7959866220736, + 54.8418410041841, + 54.8877721943049, + 54.9337803855826, + 54.9798657718121, + 55.0260285474391, + 55.072268907563, + 55.1185870479394, + 55.1649831649832, + 55.2114574557709, + 55.2580101180438, + 55.304641350211, + 55.3513513513514, + 55.3981403212172, + 55.4450084602369, + 55.4919559695174, + 55.5389830508475, + 55.5860899067006, + 55.6332767402377, + 55.6805437553101, + 55.7278911564626, + 55.7753191489362, + 55.8228279386712, + 55.8704177323103, + 55.9180887372014, + 55.9658411614005, + 56.0136752136752, + 56.0615911035073, + 56.1095890410959, + 56.1576692373608, + 56.2058319039451, + 56.2540772532189, + 56.3024054982818, + 56.3508168529665, + 56.3993115318417, + 56.4478897502153, + 56.4965517241379, + 56.5452976704055, + 56.594127806563, + 56.6430423509075, + 56.6920415224914, + 56.7411255411255, + 56.790294627383, + 56.8395490026019, + 56.8888888888889, + 56.9383145091225, + 56.9878260869565, + 57.0374238468233, + 57.0871080139373, + 57.1368788142982, + 57.1867364746946, + 57.2366812227074, + 57.2867132867133, + 57.336832895888, + 57.3870402802102, + 57.4373356704645, + 57.4877192982456, + 57.5381913959614, + 57.5887521968366, + 57.6394019349165, + 57.6901408450704, + 57.7409691629956, + 57.7918871252205, + 57.8428949691086, + 57.8939929328622, + 57.9451812555261, + 57.9964601769912, + 58.0478299379982, + 58.0992907801418, + 58.150842945874, + 58.202486678508, + 58.2542222222222, + 58.3060498220641, + 58.3579697239537, + 58.4099821746881, + 58.4620874219447, + 58.5142857142857, + 58.5665773011618, + 58.6189624329159, + 58.6714413607878, + 58.7240143369176, + 58.7766816143498, + 58.8294434470377, + 58.8823000898473, + 58.9352517985612, + 58.988298829883, + 59.0414414414414, + 59.0946798917944, + 59.1480144404332, + 59.2014453477868, + 59.254972875226, + 59.3085972850679, + 59.3623188405797, + 59.4161378059837, + 59.470054446461, + 59.5240690281562, + 59.5781818181818, + 59.6323930846224, + 59.6867030965392, + 59.7411121239745, + 59.7956204379562, + 59.8502283105023, + 59.9049360146252, + 59.9597438243367, + 60.014652014652, + 60.0696608615949, + 60.1247706422018, + 60.1799816345271, + 60.2352941176471, + 60.2907083716651, + 60.3462246777164, + 60.4018433179724, + 60.4575645756458, + 60.5133887349954, + 60.5693160813309, + 60.6253469010176, + 60.6814814814815, + 60.7377201112141, + 60.7940630797774, + 60.8505106778087, + 60.907063197026, + 60.9637209302326, + 61.0204841713222, + 61.0773532152843, + 61.134328358209, + 61.1914098972923, + 61.2485981308411, + 61.3058933582788, + 61.3632958801498, + 61.4208059981256, + 61.4784240150094, + 61.5361502347418, + 61.593984962406, + 61.6519285042333, + 61.7099811676083, + 61.7681432610745, + 61.8264150943396, + 61.8847969782814, + 61.9432892249527, + 62.0018921475875, + 62.0606060606061, + 62.1194312796209, + 62.1783681214421, + 62.2374169040836, + 62.2965779467681, + 62.3558515699334, + 62.4152380952381, + 62.4747378455672, + 62.5343511450382, + 62.5940783190067, + 62.6539196940727, + 62.7138755980861, + 62.7739463601533, + 62.8341323106424, + 62.89443378119, + 62.954851104707, + 63.0153846153846, + 63.0760346487007, + 63.1368015414258, + 63.1976856316297, + 63.2586872586873, + 63.319806763285, + 63.3810444874275, + 63.4424007744434, + 63.5038759689923, + 63.5654704170708, + 63.6271844660194, + 63.6890184645287, + 63.7509727626459, + 63.8130477117819, + 63.8752436647174, + 63.9375609756098, + 64, + 64.0625610948192, + 64.1252446183953, + 64.1880509304603, + 64.2509803921569, + 64.3140333660451, + 64.37721021611, + 64.440511307768, + 64.503937007874, + 64.5674876847291, + 64.6311637080868, + 64.6949654491609, + 64.7588932806324, + 64.8229475766568, + 64.8871287128713, + 64.9514370664024, + 65.015873015873, + 65.0804369414101, + 65.1451292246521, + 65.2099502487562, + 65.2749003984064, + 65.3399800598205, + 65.4051896207585, + 65.4705294705295, + 65.536, + 65.6016016016016, + 65.6673346693387, + 65.7331995987964, + 65.7991967871486, + 65.8653266331658, + 65.9315895372234, + 65.9979859013092, + 66.0645161290323, + 66.1311806256307, + 66.1979797979798, + 66.2649140546006, + 66.331983805668, + 66.3991894630193, + 66.4665314401623, + 66.5340101522843, + 66.6016260162602, + 66.6693794506612, + 66.7372708757637, + 66.8053007135576, + 66.8734693877551, + 66.9417773237998, + 67.0102249488753, + 67.078812691914, + 67.1475409836066, + 67.2164102564103, + 67.2854209445585, + 67.3545734840699, + 67.4238683127572, + 67.4933058702369, + 67.5628865979382, + 67.6326109391125, + 67.702479338843, + 67.7724922440538, + 67.8426501035197, + 67.9129533678757, + 67.9834024896266, + 68.0539979231568, + 68.1247401247401, + 68.1956295525494, + 68.2666666666667, + 68.3378519290928, + 68.4091858037578, + 68.4806687565308, + 68.5523012552301, + 68.6240837696335, + 68.6960167714885, + 68.7681007345226, + 68.8403361344538, + 68.9127234490011, + 68.9852631578947, + 69.0579557428872, + 69.1308016877637, + 69.2038014783527, + 69.276955602537, + 69.3502645502646, + 69.4237288135593, + 69.4973488865324, + 69.5711252653928, + 69.6450584484591, + 69.7191489361702, + 69.7933972310969, + 69.8678038379531, + 69.9423692636073, + 70.017094017094, + 70.0919786096257, + 70.1670235546039, + 70.2422293676313, + 70.3175965665236, + 70.3931256713212, + 70.4688172043011, + 70.5446716899892, + 70.6206896551724, + 70.6968716289105, + 70.7732181425486, + 70.8497297297297, + 70.9264069264069, + 71.0032502708559, + 71.0802603036876, + 71.157437567861, + 71.2347826086957, + 71.3122959738847, + 71.3899782135076, + 71.4678298800436, + 71.5458515283843, + 71.624043715847, + 71.7024070021882, + 71.7809419496166, + 71.859649122807, + 71.9385290889133, + 72.0175824175824, + 72.0968096809681, + 72.1762114537445, + 72.2557883131202, + 72.3355408388521, + 72.4154696132597, + 72.4955752212389, + 72.5758582502769, + 72.6563192904656, + 72.7369589345172, + 72.8177777777778, + 72.8987764182425, + 72.9799554565702, + 73.0613154960981, + 73.1428571428571, + 73.2245810055866, + 73.3064876957494, + 73.3885778275476, + 73.4708520179372, + 73.5533108866442, + 73.6359550561798, + 73.718785151856, + 73.8018018018018, + 73.8850056369786, + 73.9683972911964, + 74.0519774011299, + 74.1357466063348, + 74.2197055492639, + 74.3038548752835, + 74.3881952326901, + 74.4727272727273, + 74.5574516496018, + 74.6423690205011, + 74.72748004561, + 74.8127853881279, + 74.8982857142857, + 74.9839816933639, + 75.0698739977091, + 75.1559633027523, + 75.2422502870264, + 75.3287356321839, + 75.415420023015, + 75.5023041474654, + 75.5893886966551, + 75.6766743648961, + 75.764161849711, + 75.8518518518518, + 75.9397450753187, + 76.0278422273782, + 76.116144018583, + 76.2046511627907, + 76.2933643771828, + 76.3822843822844, + 76.4714119019837, + 76.5607476635514, + 76.6502923976608, + 76.7400468384075, + 76.8300117233294, + 76.9201877934272, + 77.0105757931845, + 77.1011764705882, + 77.1919905771496, + 77.2830188679245, + 77.3742621015348, + 77.4657210401891, + 77.5573964497041, + 77.6492890995261, + 77.7413997627521, + 77.833729216152, + 77.9262782401902, + 78.0190476190476, + 78.1120381406436, + 78.2052505966587, + 78.2986857825568, + 78.3923444976077, + 78.4862275449102, + 78.5803357314149, + 78.6746698679472, + 78.7692307692308, + 78.864019253911, + 78.9590361445783, + 79.0542822677925, + 79.1497584541063, + 79.2454655380895, + 79.3414043583535, + 79.4375757575758, + 79.5339805825243, + 79.6306196840826, + 79.7274939172749, + 79.8246041412911, + 79.9219512195122, + 80.019536019536, + 80.1173594132029, + 80.2154222766218, + 80.3137254901961, + 80.4122699386503, + 80.5110565110565, + 80.610086100861, + 80.7093596059113, + 80.8088779284834, + 80.9086419753086, + 81.008652657602, + 81.1089108910891, + 81.2094175960347, + 81.3101736972705, + 81.4111801242236, + 81.5124378109453, + 81.6139476961395, + 81.715710723192, + 81.8177278401998, + 81.92, + 82.0225281602002, + 82.125313283208, + 82.228356336261, + 82.3316582914573, + 82.4352201257862, + 82.5390428211587, + 82.6431273644388, + 82.7474747474748, + 82.8520859671302, + 82.9569620253165, + 83.0621039290241, + 83.1675126903553, + 83.2731893265565, + 83.3791348600509, + 83.4853503184713, + 83.5918367346939, + 83.698595146871, + 83.8056265984655, + 83.9129321382842, + 84.0205128205128, + 84.1283697047497, + 84.2365038560411, + 84.3449163449163, + 84.4536082474227, + 84.5625806451613, + 84.671834625323, + 84.7813712807245, + 84.8911917098446, + 85.0012970168612, + 85.1116883116883, + 85.222366710013, + 85.3333333333333, + 85.4445893089961, + 85.556135770235, + 85.6679738562091, + 85.7801047120419, + 85.8925294888598, + 86.005249343832, + 86.1182654402102, + 86.2315789473684, + 86.3451910408432, + 86.4591029023747, + 86.5733157199472, + 86.6878306878307, + 86.8026490066225, + 86.9177718832891, + 87.0332005312085, + 87.1489361702128, + 87.2649800266312, + 87.3813333333333, + 87.497997329773, + 87.6149732620321, + 87.7322623828648, + 87.8498659517426, + 87.9677852348993, + 88.0860215053763, + 88.2045760430686, + 88.3234501347709, + 88.442645074224, + 88.5621621621622, + 88.68200270636, + 88.8021680216802, + 88.9226594301221, + 89.0434782608696, + 89.1646258503401, + 89.2861035422343, + 89.4079126875853, + 89.5300546448087, + 89.6525307797538, + 89.7753424657534, + 89.8984910836763, + 90.021978021978, + 90.1458046767538, + 90.2699724517906, + 90.3944827586207, + 90.5193370165746, + 90.6445366528354, + 90.7700831024931, + 90.8959778085992, + 91.0222222222222, + 91.1488178025035, + 91.2757660167131, + 91.4030683403068, + 91.5307262569833, + 91.6587412587413, + 91.7871148459384, + 91.9158485273492, + 92.0449438202247, + 92.1744022503516, + 92.3042253521127, + 92.4344146685472, + 92.5649717514124, + 92.6958981612447, + 92.8271954674221, + 92.958865248227, + 93.0909090909091, + 93.2233285917497, + 93.3561253561254, + 93.4893009985735, + 93.6228571428572, + 93.7567954220315, + 93.89111747851, + 94.025824964132, + 94.1609195402299, + 94.2964028776978, + 94.4322766570605, + 94.5685425685426, + 94.7052023121387, + 94.8422575976845, + 94.9797101449275, + 95.1175616835994, + 95.2558139534884, + 95.3944687045124, + 95.533527696793, + 95.6729927007299, + 95.812865497076, + 95.9531478770132, + 96.0938416422287, + 96.2349486049927, + 96.3764705882353, + 96.5184094256259, + 96.6607669616519, + 96.8035450516987, + 96.9467455621302, + 97.0903703703704, + 97.2344213649852, + 97.3789004457652, + 97.5238095238095, + 97.6691505216095, + 97.8149253731343, + 97.9611360239163, + 98.1077844311377, + 98.2548725637181, + 98.4024024024024, + 98.5503759398496, + 98.6987951807229, + 98.8476621417798, + 98.9969788519637, + 99.1467473524962, + 99.2969696969697, + 99.4476479514416, + 99.5987841945289, + 99.7503805175038, + 99.9024390243902, + 100.054961832061, + 100.207951070336, + 100.361408882083, + 100.515337423313, + 100.669738863287, + 100.824615384615, + 100.979969183359, + 101.135802469136, + 101.292117465224, + 101.448916408669, + 101.606201550388, + 101.76397515528, + 101.922239502333, + 102.080996884735, + 102.240249609984, + 102.4, + 102.560250391236, + 102.721003134796, + 102.882260596546, + 103.044025157233, + 103.206299212598, + 103.369085173502, + 103.532385466035, + 103.696202531646, + 103.860538827258, + 104.025396825397, + 104.190779014308, + 104.356687898089, + 104.52312599681, + 104.690095846645, + 104.8576, + 105.025641025641, + 105.194221508828, + 105.363344051447, + 105.533011272142, + 105.703225806452, + 105.873990306947, + 106.045307443366, + 106.217179902755, + 106.38961038961, + 106.562601626016, + 106.736156351792, + 106.910277324633, + 107.084967320261, + 107.26022913257, + 107.436065573771, + 107.612479474548, + 107.789473684211, + 107.96705107084, + 108.145214521452, + 108.323966942149, + 108.503311258278, + 108.683250414594, + 108.863787375415, + 109.044925124792, + 109.226666666667, + 109.409015025042, + 109.591973244147, + 109.77554438861, + 109.959731543624, + 110.144537815126, + 110.329966329966, + 110.516020236088, + 110.702702702703, + 110.890016920474, + 111.077966101695, + 111.266553480475, + 111.455782312925, + 111.645655877342, + 111.836177474403, + 112.02735042735, + 112.219178082192, + 112.41166380789, + 112.604810996564, + 112.798623063683, + 112.993103448276, + 113.188255613126, + 113.384083044983, + 113.580589254766, + 113.777777777778, + 113.975652173913, + 114.174216027875, + 114.373472949389, + 114.573426573427, + 114.77408056042, + 114.975438596491, + 115.177504393673, + 115.380281690141, + 115.583774250441, + 115.787985865724, + 115.992920353982, + 116.198581560284, + 116.404973357016, + 116.612099644128, + 116.819964349376, + 117.028571428571, + 117.237924865832, + 117.448028673835, + 117.658886894075, + 117.870503597122, + 118.082882882883, + 118.296028880866, + 118.509945750452, + 118.724637681159, + 118.940108892922, + 119.156363636364, + 119.373406193078, + 119.591240875912, + 119.80987202925, + 120.029304029304, + 120.249541284404, + 120.470588235294, + 120.692449355433, + 120.915129151292, + 121.138632162662, + 121.362962962963, + 121.588126159555, + 121.814126394052, + 122.040968342644, + 122.268656716418, + 122.497196261682, + 122.7265917603, + 122.956848030019, + 123.187969924812, + 123.419962335217, + 123.652830188679, + 123.886578449906, + 124.121212121212, + 124.356736242884, + 124.593155893536, + 124.830476190476, + 125.068702290076, + 125.307839388145, + 125.547892720307, + 125.78886756238, + 126.030769230769, + 126.273603082852, + 126.517374517375, + 126.762088974855, + 127.007751937985, + 127.254368932039, + 127.501945525292, + 127.750487329435, + 128, + 128.250489236791, + 128.501960784314, + 128.75442043222, + 129.007874015748, + 129.262327416174, + 129.517786561265, + 129.774257425743, + 130.031746031746, + 130.290258449304, + 130.549800796813, + 130.810379241517, + 131.072, + 131.334669338677, + 131.598393574297, + 131.863179074447, + 132.129032258065, + 132.39595959596, + 132.663967611336, + 132.933062880325, + 133.20325203252, + 133.474541751527, + 133.74693877551, + 134.020449897751, + 134.295081967213, + 134.570841889117, + 134.847736625514, + 135.125773195876, + 135.404958677686, + 135.685300207039, + 135.966804979253, + 136.24948024948, + 136.533333333333, + 136.818371607516, + 137.10460251046, + 137.392033542977, + 137.680672268908, + 137.970526315789, + 138.261603375527, + 138.553911205074, + 138.847457627119, + 139.142250530786, + 139.43829787234, + 139.735607675906, + 140.034188034188, + 140.334047109208, + 140.635193133047, + 140.937634408602, + 141.241379310345, + 141.546436285097, + 141.852813852814, + 142.160520607375, + 142.469565217391, + 142.779956427015, + 143.091703056769, + 143.404814004376, + 143.719298245614, + 144.035164835165, + 144.352422907489, + 144.671081677704, + 144.991150442478, + 145.312638580931, + 145.635555555556, + 145.95991091314, + 146.285714285714, + 146.612975391499, + 146.941704035874, + 147.27191011236, + 147.603603603604, + 147.936794582393, + 148.27149321267, + 148.607709750567, + 148.945454545455, + 149.284738041002, + 149.625570776256, + 149.967963386728, + 150.311926605505, + 150.657471264368, + 151.004608294931, + 151.353348729792, + 151.703703703704, + 152.055684454756, + 152.409302325581, + 152.764568764569, + 153.121495327103, + 153.480093676815, + 153.840375586854, + 154.202352941176, + 154.566037735849, + 154.931442080378, + 155.298578199052, + 155.667458432304, + 156.038095238095, + 156.410501193317, + 156.784688995215, + 157.16067146283, + 157.538461538462, + 157.918072289157, + 158.299516908213, + 158.682808716707, + 159.067961165049, + 159.45498783455, + 159.843902439024, + 160.234718826406, + 160.627450980392, + 161.022113022113, + 161.418719211823, + 161.817283950617, + 162.217821782178, + 162.620347394541, + 163.024875621891, + 163.431421446384, + 163.84, + 164.250626566416, + 164.663316582915, + 165.078085642317, + 165.49494949495, + 165.913924050633, + 166.335025380711, + 166.758269720102, + 167.183673469388, + 167.611253196931, + 168.041025641026, + 168.473007712082, + 168.907216494845, + 169.343669250646, + 169.782383419689, + 170.223376623377, + 170.666666666667, + 171.11227154047, + 171.560209424084, + 172.010498687664, + 172.463157894737, + 172.918205804749, + 173.375661375661, + 173.835543766578, + 174.297872340426, + 174.762666666667, + 175.229946524064, + 175.699731903485, + 176.172043010753, + 176.646900269542, + 177.124324324324, + 177.60433604336, + 178.086956521739, + 178.572207084469, + 179.060109289618, + 179.550684931507, + 180.043956043956, + 180.539944903581, + 181.038674033149, + 181.540166204986, + 182.044444444444, + 182.551532033426, + 183.061452513966, + 183.574229691877, + 184.089887640449, + 184.608450704225, + 185.129943502825, + 185.654390934844, + 186.181818181818, + 186.712250712251, + 187.245714285714, + 187.78223495702, + 188.32183908046, + 188.864553314121, + 189.410404624277, + 189.959420289855, + 190.511627906977, + 191.067055393586, + 191.625730994152, + 192.187683284457, + 192.752941176471, + 193.321533923304, + 193.89349112426, + 194.46884272997, + 195.047619047619, + 195.629850746269, + 196.215568862275, + 196.804804804805, + 197.397590361446, + 197.993957703928, + 198.593939393939, + 199.197568389058, + 199.804878048781, + 200.415902140673, + 201.030674846626, + 201.649230769231, + 202.271604938272, + 202.897832817337, + 203.527950310559, + 204.16199376947, + 204.8, + 205.442006269592, + 206.088050314465, + 206.738170347003, + 207.392405063291, + 208.050793650794, + 208.713375796178, + 209.380191693291, + 210.051282051282, + 210.726688102894, + 211.406451612903, + 212.090614886731, + 212.779220779221, + 213.472312703583, + 214.169934640523, + 214.872131147541, + 215.578947368421, + 216.290429042904, + 217.006622516556, + 217.727574750831, + 218.453333333333, + 219.183946488294, + 219.919463087248, + 220.659932659933, + 221.405405405405, + 222.15593220339, + 222.91156462585, + 223.672354948805, + 224.438356164384, + 225.209621993127, + 225.986206896552, + 226.768166089965, + 227.555555555556, + 228.348432055749, + 229.146853146853, + 229.950877192982, + 230.760563380282, + 231.575971731449, + 232.397163120567, + 233.224199288256, + 234.057142857143, + 234.89605734767, + 235.741007194245, + 236.592057761733, + 237.449275362319, + 238.312727272727, + 239.182481751825, + 240.058608058608, + 240.941176470588, + 241.830258302583, + 242.725925925926, + 243.628252788104, + 244.537313432836, + 245.453183520599, + 246.375939849624, + 247.305660377358, + 248.242424242424, + 249.186311787072, + 250.137404580153, + 251.095785440613, + 252.061538461538, + 253.034749034749, + 254.015503875969, + 255.003891050584, + 256, + 257.003921568627, + 258.015748031496, + 259.03557312253, + 260.063492063492, + 261.099601593625, + 262.144, + 263.196787148594, + 264.258064516129, + 265.327935222672, + 266.406504065041, + 267.49387755102, + 268.590163934426, + 269.695473251029, + 270.809917355372, + 271.933609958506, + 273.066666666667, + 274.20920502092, + 275.361344537815, + 276.523206751055, + 277.694915254237, + 278.876595744681, + 280.068376068376, + 281.270386266094, + 282.48275862069, + 283.705627705628, + 284.939130434783, + 286.183406113537, + 287.438596491228, + 288.704845814978, + 289.982300884956, + 291.271111111111, + 292.571428571429, + 293.883408071749, + 295.207207207207, + 296.542986425339, + 297.890909090909, + 299.251141552511, + 300.623853211009, + 302.009216589862, + 303.407407407407, + 304.818604651163, + 306.242990654206, + 307.680751173709, + 309.132075471698, + 310.597156398104, + 312.07619047619, + 313.569377990431, + 315.076923076923, + 316.599033816425, + 318.135922330097, + 319.687804878049, + 321.254901960784, + 322.837438423645, + 324.435643564356, + 326.049751243781, + 327.68, + 329.326633165829, + 330.989898989899, + 332.670050761421, + 334.367346938775, + 336.082051282051, + 337.814432989691, + 339.564766839378, + 341.333333333333, + 343.120418848168, + 344.926315789474, + 346.751322751323, + 348.595744680851, + 350.459893048128, + 352.344086021505, + 354.248648648649, + 356.173913043478, + 358.120218579235, + 360.087912087912, + 362.077348066298, + 364.088888888889, + 366.122905027933, + 368.179775280899, + 370.25988700565, + 372.363636363636, + 374.491428571429, + 376.64367816092, + 378.820809248555, + 381.023255813953, + 383.251461988304, + 385.505882352941, + 387.786982248521, + 390.095238095238, + 392.431137724551, + 394.795180722892, + 397.187878787879, + 399.609756097561, + 402.061349693252, + 404.543209876543, + 407.055900621118, + 409.6, + 412.176100628931, + 414.784810126582, + 417.426751592357, + 420.102564102564, + 422.812903225807, + 425.558441558442, + 428.339869281046, + 431.157894736842, + 434.013245033113, + 436.906666666667, + 439.838926174497, + 442.810810810811, + 445.823129251701, + 448.876712328767, + 451.972413793103, + 455.111111111111, + 458.293706293706, + 461.521126760563, + 464.794326241135, + 468.114285714286, + 471.482014388489, + 474.898550724638, + 478.36496350365, + 481.882352941176, + 485.451851851852, + 489.074626865672, + 492.751879699248, + 496.484848484849, + 500.274809160305, + 504.123076923077, + 508.031007751938, + 512, + 516.031496062992, + 520.126984126984, + 524.288, + 528.516129032258, + 532.813008130081, + 537.180327868852, + 541.619834710744, + 546.133333333333, + 550.72268907563, + 555.389830508475, + 560.136752136752, + 564.965517241379, + 569.878260869565, + 574.877192982456, + 579.964601769912, + 585.142857142857, + 590.414414414414, + 595.781818181818, + 601.247706422018, + 606.814814814815, + 612.485981308411, + 618.264150943396, + 624.152380952381, + 630.153846153846, + 636.271844660194, + 642.509803921569, + 648.871287128713, + 655.36, + 661.979797979798, + 668.734693877551, + 675.628865979381, + 682.666666666667, + 689.852631578947, + 697.191489361702, + 704.688172043011, + 712.347826086956, + 720.175824175824, + 728.177777777778, + 736.359550561798, + 744.727272727273, + 753.287356321839, + 762.046511627907, + 771.011764705882, + 780.190476190476, + 789.590361445783, + 799.219512195122, + 809.086419753086, + 819.2, + 829.569620253165, + 840.205128205128, + 851.116883116883, + 862.315789473684, + 873.813333333333, + 885.621621621622, + 897.753424657534, + 910.222222222222, + 923.042253521127, + 936.228571428571, + 949.797101449275, + 963.764705882353, + 978.149253731343, + 992.969696969697, + 1008.24615384615, + 1024, + 1040.25396825397, + 1057.03225806452, + 1074.36065573771, + 1092.26666666667, + 1110.77966101695, + 1129.93103448276, + 1149.75438596491, + 1170.28571428571, + 1191.56363636364, + 1213.62962962963, + 1236.52830188679, + 1260.30769230769, + 1285.01960784314, + 1310.72, + 1337.4693877551, + 1365.33333333333, + 1394.3829787234, + 1424.69565217391, + 1456.35555555556, + 1489.45454545455, + 1524.09302325581, + 1560.38095238095, + 1598.43902439024, + 1638.4, + 1680.41025641026, + 1724.63157894737, + 1771.24324324324, + 1820.44444444444, + 1872.45714285714, + 1927.52941176471, + 1985.93939393939, + 2048, + 2114.06451612903, + 2184.53333333333, + 2259.86206896552, + 2340.57142857143, + 2427.25925925926, + 2520.61538461538, + 2621.44, + 2730.66666666667, + 2849.39130434783, + 2978.90909090909, + 3120.7619047619, + 3276.8, + 3449.26315789474, + 3640.88888888889, + 3855.05882352941, + 4096, + 4369.06666666667, + 4681.14285714286, + 5041.23076923077, + 5461.33333333333, + 5957.81818181818, + 6553.6, + 7281.77777777778, + 8192, + 9362.28571428571, + 10922.6666666667, + 13107.2, + 16384, + 21845.3333333333, + 32768, + 65536 }; + +const float freqTableNSE[256] = { + 524288, 262144, 131072, 87381.3333333333, 65536, 52428.8, 43690.6666666667, 37449.1428571429, + 524288, 262144, 131072, 87381.3333333333, 65536, 52428.8, 43690.6666666667, 37449.1428571429, + 262144, 131072, 65536, 43690.6666666667, 32768, 26214.4, 21845.3333333333, 18724.5714285714, + 262144, 131072, 65536, 43690.6666666667, 32768, 26214.4, 21845.3333333333, 18724.5714285714, + 131072, 65536, 32768, 21845.3333333333, 16384, 13107.2, 10922.6666666667, 9362.28571428571, + 131072, 65536, 32768, 21845.3333333333, 16384, 13107.2, 10922.6666666667, 9362.28571428571, + 65536, 32768, 16384, 10922.6666666667, 8192, 6553.6, 5461.33333333333, 4681.14285714286, + 65536, 32768, 16384, 10922.6666666667, 8192, 6553.6, 5461.33333333333, 4681.14285714286, + 32768, 16384, 8192, 5461.33333333333, 4096, 3276.8, 2730.66666666667, 2340.57142857143, + 32768, 16384, 8192, 5461.33333333333, 4096, 3276.8, 2730.66666666667, 2340.57142857143, + 16384, 8192, 4096, 2730.66666666667, 2048, 1638.4, 1365.33333333333, 1170.28571428571, + 16384, 8192, 4096, 2730.66666666667, 2048, 1638.4, 1365.33333333333, 1170.28571428571, + 8192, 4096, 2048, 1365.33333333333, 1024, 819.2, 682.666666666667, 585.142857142857, + 8192, 4096, 2048, 1365.33333333333, 1024, 819.2, 682.666666666667, 585.142857142857, + 4096, 2048, 1024, 682.666666666667, 512, 409.6, 341.333333333333, 292.571428571429, + 4096, 2048, 1024, 682.666666666667, 512, 409.6, 341.333333333333, 292.571428571429, + 2048, 1024, 512, 341.333333333333, 256, 204.8, 170.666666666667, 146.285714285714, + 2048, 1024, 512, 341.333333333333, 256, 204.8, 170.666666666667, 146.285714285714, + 1024, 512, 256, 170.666666666667, 128, 102.4, 85.3333333333333, 73.1428571428571, + 1024, 512, 256, 170.666666666667, 128, 102.4, 85.3333333333333, 73.1428571428571, + 512, 256, 128, 85.3333333333333, 64, 51.2, 42.6666666666667, 36.5714285714286, + 512, 256, 128, 85.3333333333333, 64, 51.2, 42.6666666666667, 36.5714285714286, + 256, 128, 64, 42.6666666666667, 32, 25.6, 21.3333333333333, 18.2857142857143, + 256, 128, 64, 42.6666666666667, 32, 25.6, 21.3333333333333, 18.2857142857143, + 128, 64, 32, 21.3333333333333, 16, 12.8, 10.6666666666667, 9.14285714285714, + 128, 64, 32, 21.3333333333333, 16, 12.8, 10.6666666666667, 9.14285714285714, + 64, 32, 16, 10.6666666666667, 8, 6.4, 5.33333333333333, 4.57142857142857, + 64, 32, 16, 10.6666666666667, 8, 6.4, 5.33333333333333, 4.57142857142857, + 32, 16, 8, 5.33333333333333, 4, 3.2, 2.66666666666667, 2.28571428571429, + 32, 16, 8, 5.33333333333333, 4, 3.2, 2.66666666666667, 2.28571428571429, + 16, 8, 4, 2.66666666666667, 2, 1.6, 1.33333333333333, 1.14285714285714, + 16, 8, 4, 2.66666666666667, 2, 1.6, 1.33333333333333, 1.14285714285714, +}; + +#endif diff --git a/ldscript.txt b/ldscript.txt index e493a3fb7..9464d07c2 100644 --- a/ldscript.txt +++ b/ldscript.txt @@ -8,7 +8,7 @@ SECTIONS ALIGN(4) { data/sound_data.o(ewram_data); - src/lib/m4a.o(ewram_data); + src/lib/m4a/m4a.o(ewram_data); src/core.o(ewram_data); ewram_end = .; } @@ -18,7 +18,7 @@ SECTIONS ALIGN(4) { /**** bss ****/ - src/lib/m4a.o(.bss.code); + src/lib/m4a/m4a.o(.bss.code); src/multi_boot.o(.bss); . = 0x00000408; @@ -30,7 +30,7 @@ SECTIONS . = 0x00000410; src/game/stage/collision.o(.bss); - src/lib/agb_flash.o(.bss); + src/lib/agb_flash/agb_flash.o(.bss); /**** common ****/ . = ALIGN(16); @@ -72,7 +72,7 @@ SECTIONS /* libs */ . = ALIGN(16); - src/lib/agb_flash.o(.data); + src/lib/agb_flash/agb_flash.o(.data); iwram_end = .; } @@ -363,13 +363,13 @@ SECTIONS /* libs */ #if (CPU_ARCH_ARM == 1) - src/lib/m4a0.o(.text); + src/lib/m4a/m4a0.o(.text); #endif - src/lib/m4a.o(.text); - src/lib/agb_flash.o(.text); - src/lib/agb_flash_512k.o(.text); - src/lib/agb_flash_le_512k.o(.text); - src/lib/agb_flash_mx_512k.o(.text); + src/lib/m4a/m4a.o(.text); + src/lib/agb_flash/agb_flash.o(.text); + src/lib/agb_flash/agb_flash_512k.o(.text); + src/lib/agb_flash/agb_flash_le_512k.o(.text); + src/lib/agb_flash/agb_flash_mx_512k.o(.text); #if (PLATFORM_GBA == 1) *libagbsyscall.a:ArcTan2.o(.text); *libagbsyscall.a:CpuFastSet.o(.text); @@ -550,7 +550,7 @@ SECTIONS src/data/tileset_debug_text.o(.rodata); src/data/tilemap_data.o(.rodata); - src/lib/m4a_tables.o(.rodata); + src/lib/m4a/m4a_tables.o(.rodata); data/sound_data.o(.rodata); /* Songs */ @@ -814,10 +814,10 @@ SECTIONS sound/songs/midi/mus_506.o(.rodata); /* Lib data */ - src/lib/agb_flash.o(.rodata); - src/lib/agb_flash_512k.o(.rodata); - src/lib/agb_flash_le_512k.o(.rodata); - src/lib/agb_flash_mx_512k.o(.rodata); + src/lib/agb_flash/agb_flash.o(.rodata); + src/lib/agb_flash/agb_flash_512k.o(.rodata); + src/lib/agb_flash/agb_flash_le_512k.o(.rodata); + src/lib/agb_flash/agb_flash_mx_512k.o(.rodata); *libgcc.a:_divdi3.o(.rodata); /* Asset data */ diff --git a/sound/music_player_table.inc b/sound/music_player_table.inc index 04f1131e3..25730fab1 100644 --- a/sound/music_player_table.inc +++ b/sound/music_player_table.inc @@ -1,31 +1,17 @@ -.equiv TRACK_SIZE, 0x50 .equiv NUM_TRACKS_BGM, 16 .equiv NUM_TRACKS_SE1, 16 .equiv NUM_TRACKS_SE2, 16 .equiv NUM_TRACKS_SE3, 16 -#if !PORTABLE -.section ewram_data -#endif - -gMPlayTrack_BGM: - .space TRACK_SIZE * NUM_TRACKS_BGM - -gMPlayTrack_SE1: - .space TRACK_SIZE * NUM_TRACKS_SE1 - -gMPlayTrack_SE2: - .space TRACK_SIZE * NUM_TRACKS_SE2 - -gMPlayTrack_SE3: - .space TRACK_SIZE * NUM_TRACKS_SE3 - mSectionRodata mAlignWord .global C_DECL(gMPlayTable) C_DECL(gMPlayTable): - music_player C_DECL(gMPlayInfo_BGM), gMPlayTrack_BGM, NUM_TRACKS_BGM, 0 - music_player C_DECL(gMPlayInfo_SE1), gMPlayTrack_SE1, NUM_TRACKS_SE1, 0 - music_player C_DECL(gMPlayInfo_SE2), gMPlayTrack_SE2, NUM_TRACKS_SE2, 0 - music_player C_DECL(gMPlayInfo_SE3), gMPlayTrack_SE3, NUM_TRACKS_SE3, 0 + music_player C_DECL(gMPlayInfo_BGM), C_DECL(gMPlayTrack_BGM), NUM_TRACKS_BGM, 0 +mAlignWord + music_player C_DECL(gMPlayInfo_SE1), C_DECL(gMPlayTrack_SE1), NUM_TRACKS_SE1, 0 +mAlignWord + music_player C_DECL(gMPlayInfo_SE2), C_DECL(gMPlayTrack_SE2), NUM_TRACKS_SE2, 0 +mAlignWord + music_player C_DECL(gMPlayInfo_SE3), C_DECL(gMPlayTrack_SE3), NUM_TRACKS_SE3, 0 diff --git a/sound/song_table.inc b/sound/song_table.inc index fdcba631f..2023b19d8 100644 --- a/sound/song_table.inc +++ b/sound/song_table.inc @@ -2,511 +2,1017 @@ .global C_DECL(gSongTable) C_DECL(gSongTable): @ 0x08AD4F4C song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(mus_intro), 0, 0 +mAlignWord song C_DECL(mus_title_fanfare), 0, 0 +mAlignWord song C_DECL(mus_character_selection), 0, 0 +mAlignWord song C_DECL(mus_ta_course_selection), 0, 0 +mAlignWord song C_DECL(mus_course_selection_2), 0, 0 +mAlignWord song C_DECL(mus_course_selection_3), 0, 0 +mAlignWord song C_DECL(mus_time_attack_menu), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(mus_options), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(mus_leaf_forest__act_1), 0, 0 +mAlignWord song C_DECL(mus_leaf_forest__act_2), 0, 0 +mAlignWord song C_DECL(mus_hot_crater__act_1), 0, 0 +mAlignWord song C_DECL(mus_hot_crater__act_2), 0, 0 +mAlignWord song C_DECL(mus_music_plant__act_1), 0, 0 +mAlignWord song C_DECL(mus_music_plant__act_2), 0, 0 +mAlignWord song C_DECL(mus_ice_paradise__act_1), 0, 0 +mAlignWord song C_DECL(mus_ice_paradise__act_2), 0, 0 +mAlignWord song C_DECL(mus_sky_canyon__act_1), 0, 0 +mAlignWord song C_DECL(mus_sky_canyon__act_2), 0, 0 +mAlignWord song C_DECL(mus_techno_base__act_1), 0, 0 +mAlignWord song C_DECL(mus_techno_base__act_2), 0, 0 +mAlignWord song C_DECL(mus_egg_utopia__act_1), 0, 0 +mAlignWord song C_DECL(mus_egg_utopia__act_2), 0, 0 +mAlignWord song C_DECL(mus_xx__final_zone), 0, 0 +mAlignWord song C_DECL(mus_true_area_53), 0, 0 +mAlignWord song C_DECL(mus_invincibility), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(mus_drowning), 0, 0 +mAlignWord song C_DECL(mus_boss), 0, 0 +mAlignWord song C_DECL(mus_boss_pinch), 0, 0 +mAlignWord song C_DECL(mus_boss_knuckles), 0, 0 +mAlignWord song C_DECL(mus_7_boss), 0, 0 +mAlignWord song C_DECL(mus_7_boss_pinch), 0, 0 +mAlignWord song C_DECL(mus_final_boss), 0, 0 +mAlignWord song C_DECL(mus_final_boss_pinch), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(mus_game_over), 0, 0 +mAlignWord song C_DECL(mus_final_ending), 0, 0 +mAlignWord song C_DECL(mus_extra_ending), 0, 0 +mAlignWord song C_DECL(mus_staff_credits), 0, 0 +mAlignWord song C_DECL(mus_demo_1), 0, 0 +mAlignWord song C_DECL(mus_demo_2), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(mus_extra_demo_1), 0, 0 +mAlignWord song C_DECL(mus_extra_demo_2), 0, 0 +mAlignWord song C_DECL(mus_special_stage_intro), 0, 0 +mAlignWord song C_DECL(mus_special_stage), 0, 0 +mAlignWord song C_DECL(mus_special_stage_pinch), 0, 0 +mAlignWord song C_DECL(mus_achievement), 0, 0 +mAlignWord song C_DECL(mus_special_stage_clear), 0, 0 +mAlignWord song C_DECL(mus_special_stage_result), 0, 0 +mAlignWord song C_DECL(mus_chaos_emerald), 0, 0 +mAlignWord song C_DECL(mus_special_stage_result_lose), 0, 0 +mAlignWord song C_DECL(mus_vs_2), 0, 0 +mAlignWord song C_DECL(mus_vs_3), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(mus_connection_pending), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(mus_vs_lobby), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(mus_vs_select_pak_mode), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(se_ring), 3, 3 +mAlignWord song C_DECL(se_shift), 3, 3 +mAlignWord song C_DECL(se_success), 3, 3 +mAlignWord song C_DECL(se_abort), 3, 3 +mAlignWord song C_DECL(se_select), 2, 2 +mAlignWord song C_DECL(se_return), 2, 2 +mAlignWord song C_DECL(se_menu_cursor_move), 2, 2 +mAlignWord song C_DECL(se_spin_attack), 3, 3 +mAlignWord song C_DECL(se_spin_dash_release), 2, 2 +mAlignWord song C_DECL(se_sonic_skid_attack), 3, 3 +mAlignWord song C_DECL(se_sonic_midair_somersault), 3, 3 +mAlignWord song C_DECL(se_sonic_insta_shield), 2, 2 +mAlignWord song C_DECL(se_114), 2, 2 +mAlignWord song C_DECL(se_brake), 2, 2 +mAlignWord song C_DECL(se_jump), 2, 2 +mAlignWord song C_DECL(se_ring_copy), 3, 3 +mAlignWord song C_DECL(se_rings_lost), 3, 3 +mAlignWord song C_DECL(se_life_lost), 2, 2 +mAlignWord song C_DECL(se_tails_propeller_flying), 3, 3 +mAlignWord song C_DECL(se_tails_tail_swipe), 3, 3 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(se_125), 3, 3 +mAlignWord song C_DECL(se_126), 3, 3 +mAlignWord song C_DECL(se_127), 3, 3 +mAlignWord song C_DECL(se_amy_ground_hammer), 3, 3 +mAlignWord song C_DECL(se_amy_super_hammer_attack), 3, 3 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(se_amy_hammer_swirl), 3, 3 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(se_sa1_goal_post), 3, 3 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(se_item_box), 2, 2 +mAlignWord song C_DECL(se_timer), 2, 2 +mAlignWord song C_DECL(se_stage_result_counter), 2, 2 +mAlignWord song C_DECL(se_stage_result_counter_done), 3, 3 +mAlignWord song C_DECL(se_pause_screen), 3, 3 +mAlignWord song C_DECL(se_143), 1, 1 +mAlignWord song C_DECL(se_144), 3, 3 +mAlignWord song C_DECL(se_145), 3, 3 +mAlignWord song C_DECL(se_146), 3, 3 +mAlignWord song C_DECL(se_spin), 2, 2 +mAlignWord song C_DECL(se_148), 3, 3 +mAlignWord song C_DECL(se_time_up), 3, 3 +mAlignWord song C_DECL(se_item_box_2), 2, 2 +mAlignWord song C_DECL(se_151), 2, 2 +mAlignWord song C_DECL(se_checkpoint), 2, 2 +mAlignWord song C_DECL(se_spring), 2, 2 +mAlignWord song C_DECL(se_spikes), 2, 2 +mAlignWord song C_DECL(se_speed_booster), 2, 2 +mAlignWord song C_DECL(se_156), 2, 2 +mAlignWord song C_DECL(se_157), 2, 2 +mAlignWord song C_DECL(se_air_bubble), 2, 2 +mAlignWord song C_DECL(se_alarm_1), 3, 3 +mAlignWord song C_DECL(se_alarm_2), 3, 3 +mAlignWord song C_DECL(se_alarm_3), 3, 3 +mAlignWord song C_DECL(se_alarm_4), 3, 3 +mAlignWord song C_DECL(se_alarm_5), 3, 3 +mAlignWord song C_DECL(se_alarm_6), 3, 3 +mAlignWord song C_DECL(se_alarm_7), 3, 3 +mAlignWord song C_DECL(se_alarm_8), 3, 3 +mAlignWord song C_DECL(se_alarm_9), 3, 3 +mAlignWord song C_DECL(se_alarm_10), 3, 3 +mAlignWord song C_DECL(se_springy_pole), 2, 2 +mAlignWord song C_DECL(se_springy_spring), 2, 2 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(voice__announcer__sonic_advance_2), 2, 2 +mAlignWord song C_DECL(voice__announcer__sonic), 2, 2 +mAlignWord song C_DECL(voice__announcer__tails), 2, 2 +mAlignWord song C_DECL(voice__announcer__knuckles), 2, 2 +mAlignWord song C_DECL(voice__announcer__amy), 2, 2 +mAlignWord song C_DECL(voice__announcer__cream), 2, 2 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(voice__announcer__3), 2, 2 +mAlignWord song C_DECL(voice__announcer__2), 2, 2 +mAlignWord song C_DECL(voice__announcer__1), 2, 2 +mAlignWord song C_DECL(voice__announcer__go), 2, 2 +mAlignWord song C_DECL(voice__announcer__congratulations), 2, 2 +mAlignWord song C_DECL(se_map_move), 2, 2 +mAlignWord song C_DECL(se_map_214), 2, 2 +mAlignWord song C_DECL(se_map_move_end), 2, 2 +mAlignWord song C_DECL(se_216), 2, 2 +mAlignWord song C_DECL(se_217), 2, 2 +mAlignWord song C_DECL(se_218), 2, 2 +mAlignWord song C_DECL(se_219), 2, 2 +mAlignWord song C_DECL(se_delete_game_data), 2, 2 +mAlignWord song C_DECL(se_221), 2, 2 +mAlignWord song C_DECL(se_222), 2, 2 +mAlignWord song C_DECL(se_223), 2, 2 +mAlignWord song C_DECL(se_224), 2, 2 +mAlignWord song C_DECL(se_225), 2, 2 +mAlignWord song C_DECL(se_226), 2, 2 +mAlignWord song C_DECL(se_cream_flying), 3, 3 +mAlignWord song C_DECL(se_228), 2, 2 +mAlignWord song C_DECL(se_cream_cheese_attack), 2, 2 +mAlignWord song C_DECL(se_230), 2, 2 +mAlignWord song C_DECL(se_231), 2, 2 +mAlignWord song C_DECL(se_long_brake), 2, 2 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(se_234), 2, 2 +mAlignWord song C_DECL(se_235), 2, 2 +mAlignWord song C_DECL(se_236), 2, 2 +mAlignWord song C_DECL(se_237), 2, 2 +mAlignWord song C_DECL(se_238), 2, 2 +mAlignWord song C_DECL(se_239), 2, 2 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(se_241), 2, 2 +mAlignWord song C_DECL(se_242), 2, 2 +mAlignWord song C_DECL(se_243), 2, 2 +mAlignWord song C_DECL(se_244), 2, 2 +mAlignWord song C_DECL(se_245), 2, 2 +mAlignWord song C_DECL(se_246), 2, 2 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(se_248), 2, 2 +mAlignWord song C_DECL(se_249), 2, 2 +mAlignWord song C_DECL(se_250), 2, 2 +mAlignWord song C_DECL(se_251), 2, 2 +mAlignWord song C_DECL(se_252), 2, 2 +mAlignWord song C_DECL(se_253), 2, 2 +mAlignWord song C_DECL(se_254), 2, 2 +mAlignWord song C_DECL(se_255), 2, 2 +mAlignWord song C_DECL(se_256), 2, 2 +mAlignWord song C_DECL(se_257), 2, 2 +mAlignWord song C_DECL(se_258), 2, 2 +mAlignWord song C_DECL(se_259), 2, 2 +mAlignWord song C_DECL(se_260), 2, 2 +mAlignWord song C_DECL(se_261), 2, 2 +mAlignWord song C_DECL(se_262), 2, 2 +mAlignWord song C_DECL(se_263), 2, 2 +mAlignWord song C_DECL(se_264), 2, 2 +mAlignWord song C_DECL(se_265), 2, 2 +mAlignWord song C_DECL(se_266), 2, 2 +mAlignWord song C_DECL(se_267), 2, 2 +mAlignWord song C_DECL(se_268), 2, 2 +mAlignWord song C_DECL(se_269), 2, 2 +mAlignWord song C_DECL(se_suction), 2, 2 +mAlignWord song C_DECL(se_271), 2, 2 +mAlignWord song C_DECL(se_272), 2, 2 +mAlignWord song C_DECL(se_273), 2, 2 +mAlignWord song C_DECL(se_274), 2, 2 +mAlignWord song C_DECL(se_275), 2, 2 +mAlignWord song C_DECL(se_276), 2, 2 +mAlignWord song C_DECL(se_277), 2, 2 +mAlignWord song C_DECL(se_278), 2, 2 +mAlignWord song C_DECL(se_279), 2, 2 +mAlignWord song C_DECL(se_280), 2, 2 +mAlignWord song C_DECL(se_281), 2, 2 +mAlignWord song C_DECL(se_282), 2, 2 +mAlignWord song C_DECL(se_283), 2, 2 +mAlignWord song C_DECL(se_284), 2, 2 +mAlignWord song C_DECL(se_285), 2, 2 +mAlignWord song C_DECL(se_286), 2, 2 +mAlignWord song C_DECL(se_287), 2, 2 +mAlignWord song C_DECL(se_288), 2, 2 +mAlignWord song C_DECL(se_289), 2, 2 +mAlignWord song C_DECL(se_290), 2, 2 +mAlignWord song C_DECL(se_291), 2, 2 +mAlignWord song C_DECL(se_ice_paradise_slide), 2, 2 +mAlignWord song C_DECL(se_293), 2, 2 +mAlignWord song C_DECL(se_techno_base_note_block), 2, 2 +mAlignWord song C_DECL(se_295), 2, 2 +mAlignWord song C_DECL(se_296), 2, 2 +mAlignWord song C_DECL(se_297), 2, 2 +mAlignWord song C_DECL(se_special_ring), 2, 2 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(se_music_plant_spring_1), 2, 2 +mAlignWord song C_DECL(se_music_plant_spring_2), 2, 2 +mAlignWord song C_DECL(se_music_plant_spring_3), 2, 2 +mAlignWord song C_DECL(se_music_plant_spring_4), 2, 2 +mAlignWord song C_DECL(se_music_plant_crash_hit), 2, 2 +mAlignWord song C_DECL(se_music_plant_notes_1), 2, 2 +mAlignWord song C_DECL(se_music_plant_notes_2), 2, 2 +mAlignWord song C_DECL(se_music_plant_notes_3), 2, 2 +mAlignWord song C_DECL(se_music_plant_notes_4), 2, 2 +mAlignWord song C_DECL(se_music_plant_notes_5), 2, 2 +mAlignWord song C_DECL(se_music_plant_notes_6), 2, 2 +mAlignWord song C_DECL(se_music_plant_notes_7), 2, 2 +mAlignWord song C_DECL(se_music_plant_notes_8), 2, 2 +mAlignWord song C_DECL(se_music_plant_glockenspiel_1), 2, 2 +mAlignWord song C_DECL(se_music_plant_glockenspiel_2), 2, 2 +mAlignWord song C_DECL(se_music_plant_glockenspiel_3), 2, 2 +mAlignWord song C_DECL(se_music_plant_glockenspiel_4), 2, 2 +mAlignWord song C_DECL(se_music_plant_glockenspiel_5), 2, 2 +mAlignWord song C_DECL(se_music_plant_glockenspiel_6), 2, 2 +mAlignWord song C_DECL(se_music_plant_enter_horn), 2, 2 +mAlignWord song C_DECL(se_music_plant_exit_horn), 2, 2 +mAlignWord song C_DECL(se_music_plant_enter_horn2), 2, 2 +mAlignWord song C_DECL(se_music_plant_exit_horn2), 2, 2 +mAlignWord song C_DECL(se_music_plant_horn3), 2, 2 +mAlignWord song C_DECL(se_music_plant_guitar_string), 2, 2 +mAlignWord song C_DECL(se_music_plant_piano), 2, 2 +mAlignWord song C_DECL(se_music_plant_flute_1), 2, 2 +mAlignWord song C_DECL(se_music_plant_flute_2), 2, 2 +mAlignWord song C_DECL(se_music_plant_flute_3), 2, 2 +mAlignWord song C_DECL(se_music_plant_flute_4), 2, 2 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(se_331), 2, 2 +mAlignWord song C_DECL(se_332), 2, 2 +mAlignWord song C_DECL(se_333), 2, 2 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(mus_act_clear), 0, 0 +mAlignWord song C_DECL(mus_boss_clear), 0, 0 +mAlignWord song C_DECL(mus_final_clear), 0, 0 +mAlignWord song C_DECL(mus_extra_clear), 0, 0 +mAlignWord song C_DECL(mus_time_attack_2), 0, 0 +mAlignWord song C_DECL(mus_time_attack_3), 0, 0 +mAlignWord song C_DECL(mus_1_up), 0, 0 +mAlignWord song C_DECL(mus_message_2), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(mus_got_all_chaos_emeralds), 0, 0 +mAlignWord song C_DECL(mus_fanfare), 1, 1 +mAlignWord song C_DECL(mus_vs_exit), 1, 1 +mAlignWord song C_DECL(mus_vs_success), 1, 1 +mAlignWord song C_DECL(mus_vs_miss), 1, 1 +mAlignWord song C_DECL(mus_message), 1, 1 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(dummy_song_header), 0, 0 +mAlignWord song C_DECL(mus_504), 0, 0 +mAlignWord song C_DECL(mus_505), 0, 0 +mAlignWord song C_DECL(mus_506), 0, 0 mAlignWord diff --git a/sound/songs/se_291.s b/sound/songs/se_291.s index 58728613c..94183e80e 100644 --- a/sound/songs/se_291.s +++ b/sound/songs/se_291.s @@ -88,6 +88,7 @@ C_DECL(se_291): .byte 20 .byte 128 +mAlignWord mPtr voicegroup005 mPtr song0291_1 diff --git a/sound/voicegroups/voicegroup000.inc b/sound/voicegroups/voicegroup000.inc index ed883bf36..598eaa0b3 100644 --- a/sound/voicegroups/voicegroup000.inc +++ b/sound/voicegroups/voicegroup000.inc @@ -1,95 +1,187 @@ mAlignWord .global voicegroup000 voicegroup000: @ 0x08ACDF50 +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08ACDF50 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08ACDF5C +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACDF68 +mAlignWord voice_square_2_alt 3, 0, 0, 15, 0 @08ACDF74 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACDF80 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACDF8C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACDF98 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACDFA4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACDFB0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACDFBC +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08ACDFC8 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08ACDFD4 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACDFE0 +mAlignWord voice_square_2_alt 3, 0, 0, 15, 0 @08ACDFEC +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACDFF8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE004 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE010 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE01C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE028 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE034 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE040 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE04C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE058 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE064 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE070 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE07C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE088 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE094 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE0A0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE0AC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE0B8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE0C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE0D0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE0DC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE0E8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE0F4 +mAlignWord voice_square_2_alt 1, 1, 0, 15, 0 @08ACE100 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE10C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE118 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE124 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 4, 4, 0 @08ACE130 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_3, 0, 0, 15, 0 @08ACE13C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_4, 0, 0, 15, 0 @08ACE148 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_5, 0, 0, 15, 0 @08ACE154 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08ACE160 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08ACE16C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08ACE178 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08ACE184 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08ACE190 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE19C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACE1A8 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACE1B4 +mAlignWord voice_square_2_alt 2, 0, 3, 0, 0 @08ACE1C0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 0, 15, 0 @08ACE1CC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08ACE1D8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 0, 15, 0 @08ACE1E4 +mAlignWord voice_square_2_alt 0, 0, 0, 15, 5 @08ACE1F0 +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 0 @08ACE1FC +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACE208 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACE214 +mAlignWord voice_square_2_alt 0, 0, 4, 0, 0 @08ACE220 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 4, 0, 0 @08ACE22C +mAlignWord voice_square_2_alt 0, 0, 4, 4, 0 @08ACE238 +mAlignWord voice_square_2_alt 1, 0, 3, 0, 0 @08ACE244 +mAlignWord voice_square_2_alt 1, 0, 2, 0, 0 @08ACE250 +mAlignWord voice_square_2_alt 3, 0, 1, 0, 1 @08ACE25C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08ACE268 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08ACE274 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08ACE280 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08ACE28C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_1, 255, 0, 255, 0 @08ACE298 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_2, 255, 0, 255, 0 @08ACE2A4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_3, 255, 0, 255, 0 @08ACE2B0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_4, 255, 0, 255, 0 @08ACE2BC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08ACE2C8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_6, 255, 0, 255, 127 @08ACE2D4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_7, 255, 0, 255, 0 @08ACE2E0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_8, 255, 235, 38, 165 @08ACE2EC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_9, 255, 0, 255, 127 @08ACE2F8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_10, 255, 0, 255, 0 @08ACE304 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08ACE310 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_12, 255, 0, 255, 127 @08ACE31C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_13, 255, 0, 255, 127 @08ACE328 +mAlignWord voice_keysplit voicegroup002, KeySplitTable1 @08ACE334 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_14, 255, 246, 64, 149 @08ACE340 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_15, 255, 0, 255, 127 @08ACE34C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_16, 255, 0, 255, 127 @08ACE358 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_17, 255, 0, 255, 127 @08ACE364 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_18, 255, 0, 255, 127 @08ACE370 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08ACE37C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_19, 255, 0, 255, 127 @08ACE388 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_20, 255, 231, 0, 188 @08ACE394 diff --git a/sound/voicegroups/voicegroup001.inc b/sound/voicegroups/voicegroup001.inc index 538152ccc..e8d3790da 100644 --- a/sound/voicegroups/voicegroup001.inc +++ b/sound/voicegroups/voicegroup001.inc @@ -1,39 +1,75 @@ mAlignWord .global voicegroup001 voicegroup001: @ 0x08ACE3A0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_21, 255, 0, 255, 0 @08ACE3A0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_22, 255, 0, 255, 149 @08ACE3AC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_23, 255, 235, 25, 165 @08ACE3B8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_24, 255, 0, 255, 149 @08ACE3C4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_25, 255, 0, 255, 0 @08ACE3D0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 37, 0, 255, 165 @08ACE3DC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 255, 0, 255, 165 @08ACE3E8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_27, 255, 252, 0, 149 @08ACE3F4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE400 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE40C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE418 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE424 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE430 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE43C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE448 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE454 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE460 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE46C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE478 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE484 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE490 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE49C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE4A8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE4B4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_28, 255, 0, 255, 0 @08ACE4C0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_29, 255, 250, 18, 250 @08ACE4CC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_30, 255, 216, 25, 0 @08ACE4D8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_31, 37, 0, 255, 149 @08ACE4E4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_32, 255, 0, 255, 0 @08ACE4F0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_33, 255, 0, 255, 0 @08ACE4FC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_34, 255, 0, 255, 149 @08ACE508 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 5, 1, 0 @08ACE514 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_35, 255, 216, 25, 0 @08ACE520 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 4, 4, 0 @08ACE52C +mAlignWord voice_keysplit_all voicegroup004 @08ACE538 +mAlignWord voice_keysplit_all voicegroup001 @08ACE544 diff --git a/sound/voicegroups/voicegroup002.inc b/sound/voicegroups/voicegroup002.inc index 022396394..4d5f99137 100644 --- a/sound/voicegroups/voicegroup002.inc +++ b/sound/voicegroups/voicegroup002.inc @@ -1,50 +1,97 @@ mAlignWord .global voicegroup002 voicegroup002: @ 0x08ACE550 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_36, 255, 255, 255, 0 @08ACE550 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_37, 255, 0, 255, 0 @08ACE55C +mAlignWord voice_noise 84, 0, 192, 0, 0, 1, 0, 0 @08ACE568 +mAlignWord voice_noise 84, 0, 192, 0, 0, 2, 0, 0 @08ACE574 +mAlignWord voice_noise 84, 0, 192, 0, 0, 3, 7, 0 @08ACE580 +mAlignWord voice_directsound 45, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08ACE58C +mAlignWord voice_directsound 50, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08ACE598 +mAlignWord voice_directsound 55, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08ACE5A4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08ACE5B0 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08ACE5BC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_39, 255, 0, 255, 0 @08ACE5C8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_40, 255, 0, 255, 0 @08ACE5D4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_41, 255, 0, 255, 0 @08ACE5E0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_42, 255, 0, 255, 0 @08ACE5EC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_43, 255, 0, 255, 0 @08ACE5F8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_44, 255, 0, 255, 0 @08ACE604 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_45, 255, 0, 255, 0 @08ACE610 +mAlignWord voice_directsound 57, 0, DirectSoundWaveData_42, 255, 0, 255, 0 @08ACE61C +mAlignWord voice_directsound 59, 0, DirectSoundWaveData_42, 255, 0, 255, 0 @08ACE628 +mAlignWord voice_directsound 61, 0, DirectSoundWaveData_42, 255, 0, 255, 0 @08ACE634 +mAlignWord voice_directsound 45, 0, DirectSoundWaveData_46, 255, 0, 255, 0 @08ACE640 +mAlignWord voice_directsound 50, 0, DirectSoundWaveData_46, 255, 0, 255, 0 @08ACE64C +mAlignWord voice_directsound 55, 0, DirectSoundWaveData_46, 255, 0, 255, 0 @08ACE658 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_46, 255, 0, 255, 0 @08ACE664 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_46, 255, 0, 255, 0 @08ACE670 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE67C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE688 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE694 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE6A0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE6AC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE6B8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE6C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE6D0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE6DC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE6E8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE6F4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE700 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE70C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE718 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE724 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE730 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE73C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE748 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE754 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE760 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE76C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_47, 255, 0, 255, 0 @08ACE778 diff --git a/sound/voicegroups/voicegroup003.inc b/sound/voicegroups/voicegroup003.inc index 6f9609665..71fa4fcb2 100644 --- a/sound/voicegroups/voicegroup003.inc +++ b/sound/voicegroups/voicegroup003.inc @@ -1,95 +1,187 @@ mAlignWord .global voicegroup003 voicegroup003: @ 0x08ACE784 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_48, 255, 0, 255, 0 @08ACE784 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_49, 255, 0, 255, 0 @08ACE790 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_50, 255, 0, 255, 0 @08ACE79C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_51, 255, 0, 255, 0 @08ACE7A8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_52, 255, 0, 255, 0 @08ACE7B4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE7C0 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACE7CC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE7D8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE7E4 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACE7F0 +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08ACE7FC +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08ACE808 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACE814 +mAlignWord voice_square_2_alt 3, 0, 0, 15, 0 @08ACE820 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACE82C +mAlignWord voice_noise 60, 0, 0, 1, 1, 0, 12, 2 @08ACE838 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 12, 2 @08ACE844 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08ACE850 +mAlignWord voice_square_2_alt 1, 0, 0, 5, 3 @08ACE85C +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 12, 2 @08ACE868 +mAlignWord voice_noise 60, 0, 0, 1, 1, 0, 12, 2 @08ACE874 +mAlignWord voice_noise 60, 0, 0, 1, 4, 0, 12, 2 @08ACE880 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACE88C +mAlignWord voice_square_2_alt 1, 0, 0, 5, 4 @08ACE898 +mAlignWord voice_square_2_alt 0, 0, 0, 15, 5 @08ACE8A4 +mAlignWord voice_square_2_alt 2, 0, 2, 0, 0 @08ACE8B0 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACE8BC +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 2 @08ACE8C8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE8D4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE8E0 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACE8EC +mAlignWord voice_noise 60, 0, 0, 0, 3, 0, 15, 4 @08ACE8F8 +mAlignWord voice_square_2_alt 1, 0, 2, 0, 0 @08ACE904 +mAlignWord voice_square_2_alt 1, 0, 2, 0, 0 @08ACE910 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACE91C +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 0 @08ACE928 +mAlignWord voice_square_2_alt 1, 1, 0, 15, 0 @08ACE934 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACE940 +mAlignWord voice_square_2_alt 1, 0, 2, 0, 0 @08ACE94C +mAlignWord voice_square_2_alt 2, 2, 0, 15, 1 @08ACE958 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 4, 4, 0 @08ACE964 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_3, 0, 0, 15, 0 @08ACE970 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_4, 0, 0, 15, 0 @08ACE97C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_5, 0, 0, 15, 0 @08ACE988 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08ACE994 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08ACE9A0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08ACE9AC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08ACE9B8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08ACE9C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACE9D0 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACE9DC +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACE9E8 +mAlignWord voice_square_2_alt 2, 0, 3, 0, 0 @08ACE9F4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 0, 15, 0 @08ACEA00 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08ACEA0C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 0, 15, 0 @08ACEA18 +mAlignWord voice_square_2_alt 0, 0, 0, 15, 5 @08ACEA24 +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 0 @08ACEA30 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACEA3C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACEA48 +mAlignWord voice_square_2_alt 0, 0, 4, 0, 0 @08ACEA54 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 4, 0, 0 @08ACEA60 +mAlignWord voice_square_2_alt 0, 0, 4, 4, 0 @08ACEA6C +mAlignWord voice_square_2_alt 1, 0, 3, 0, 0 @08ACEA78 +mAlignWord voice_square_2_alt 1, 0, 2, 0, 0 @08ACEA84 +mAlignWord voice_square_2_alt 3, 0, 1, 0, 1 @08ACEA90 +mAlignWord voice_square_2_alt 2, 0, 2, 2, 2 @08ACEA9C +mAlignWord voice_square_2_alt 2, 1, 0, 10, 3 @08ACEAA8 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACEAB4 +mAlignWord voice_square_2_alt 1, 0, 2, 0, 0 @08ACEAC0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_1, 255, 0, 255, 0 @08ACEACC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_2, 255, 0, 255, 0 @08ACEAD8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_3, 255, 0, 255, 0 @08ACEAE4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_4, 255, 0, 255, 0 @08ACEAF0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08ACEAFC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_6, 255, 0, 255, 127 @08ACEB08 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_7, 255, 0, 255, 0 @08ACEB14 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_8, 255, 235, 38, 165 @08ACEB20 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_9, 255, 0, 255, 127 @08ACEB2C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_10, 255, 0, 255, 0 @08ACEB38 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08ACEB44 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_12, 255, 0, 255, 127 @08ACEB50 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_13, 255, 0, 255, 127 @08ACEB5C +mAlignWord voice_noise 60, 0, 0, 0, 3, 0, 15, 4 @08ACEB68 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACEB74 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08ACEB80 +mAlignWord voice_square_2_alt 2, 0, 2, 0, 0 @08ACEB8C +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 1 @08ACEB98 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACEBA4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACEBB0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_19, 255, 0, 255, 0 @08ACEBBC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_20, 255, 0, 255, 0 @08ACEBC8 diff --git a/sound/voicegroups/voicegroup004.inc b/sound/voicegroups/voicegroup004.inc index 3835f70d8..e05cbaee2 100644 --- a/sound/voicegroups/voicegroup004.inc +++ b/sound/voicegroups/voicegroup004.inc @@ -1,40 +1,77 @@ mAlignWord .global voicegroup004 voicegroup004: @ 0x08ACEBD4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_21, 255, 0, 255, 0 @08ACEBD4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08ACEBE0 +mAlignWord voice_noise 60, 0, 0, 1, 1, 0, 12, 2 @08ACEBEC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACEBF8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACEC04 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACEC10 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACEC1C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACEC28 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_53, 255, 0, 255, 0 @08ACEC34 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_54, 255, 0, 255, 0 @08ACEC40 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_55, 255, 0, 255, 0 @08ACEC4C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_56, 255, 0, 255, 0 @08ACEC58 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_57, 255, 0, 255, 0 @08ACEC64 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_58, 255, 0, 255, 0 @08ACEC70 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_59, 255, 0, 255, 0 @08ACEC7C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACEC88 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACEC94 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACECA0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACECAC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACECB8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACECC4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACECD0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACECDC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACECE8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_60, 255, 0, 255, 0 @08ACECF4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_61, 255, 0, 255, 0 @08ACED00 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACED0C +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 2 @08ACED18 +mAlignWord voice_noise 60, 0, 0, 1, 1, 0, 12, 2 @08ACED24 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 0 @08ACED30 +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 2 @08ACED3C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACED48 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 2 @08ACED54 +mAlignWord voice_square_2_alt 2, 3, 0, 10, 3 @08ACED60 +mAlignWord voice_square_2_alt 1, 0, 2, 0, 0 @08ACED6C +mAlignWord voice_keysplit_all voicegroup001 @08ACED78 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_32, 255, 0, 255, 0 @08ACED84 diff --git a/sound/voicegroups/voicegroup005.inc b/sound/voicegroups/voicegroup005.inc index 6c4effeb3..df1982d08 100644 --- a/sound/voicegroups/voicegroup005.inc +++ b/sound/voicegroups/voicegroup005.inc @@ -1,130 +1,257 @@ mAlignWord .global voicegroup005 voicegroup005: @ 0x08ACED90 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACED90 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_voice__announcer__sonic_advance_2, 255, 0, 255, 0 @08ACED9C +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_voice__announcer__sonic, 255, 0, 255, 0 @08ACEDA8 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_62, 255, 0, 255, 0 @08ACEDB4 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_63, 255, 0, 255, 0 @08ACEDC0 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_64, 255, 0, 255, 0 @08ACEDCC +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_voice__announcer__cream, 255, 0, 255, 0 @08ACEDD8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACEDE4 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_65, 255, 0, 255, 0 @08ACEDF0 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_66, 255, 0, 255, 0 @08ACEDFC +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_67, 255, 0, 255, 0 @08ACEE08 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_68, 255, 0, 255, 0 @08ACEE14 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_69, 255, 0, 255, 0 @08ACEE20 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACEE2C +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACEE38 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACEE44 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08ACEE50 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08ACEE5C +mAlignWord voice_square_2_alt 0, 2, 0, 15, 5 @08ACEE68 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACEE74 +mAlignWord voice_square_2_alt 1, 2, 0, 3, 3 @08ACEE80 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACEE8C +mAlignWord voice_noise 60, 0, 0, 0, 2, 0, 15, 0 @08ACEE98 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACEEA4 +mAlignWord voice_noise 60, 0, 0, 0, 3, 0, 15, 2 @08ACEEB0 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 12, 2 @08ACEEBC +mAlignWord voice_noise 60, 0, 0, 1, 4, 0, 12, 2 @08ACEEC8 +mAlignWord voice_noise 60, 0, 0, 1, 1, 0, 12, 2 @08ACEED4 +mAlignWord voice_square_2_alt 2, 3, 0, 10, 4 @08ACEEE0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_56, 255, 0, 255, 0 @08ACEEEC +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 4 @08ACEEF8 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACEF04 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACEF10 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACEF1C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACEF28 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACEF34 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACEF40 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACEF4C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 4 @08ACEF58 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 12, 2 @08ACEF64 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACEF70 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 12, 2 @08ACEF7C +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACEF88 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 2 @08ACEF94 +mAlignWord voice_square_2_alt 2, 2, 0, 9, 6 @08ACEFA0 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 12, 2 @08ACEFAC +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACEFB8 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACEFC4 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACEFD0 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 2 @08ACEFDC +mAlignWord voice_noise 60, 0, 0, 1, 4, 0, 12, 2 @08ACEFE8 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 2 @08ACEFF4 +mAlignWord voice_square_2_alt 0, 0, 3, 13, 0 @08ACF000 +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08ACF00C +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08ACF018 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08ACF024 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACF030 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACF03C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF048 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 2 @08ACF054 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACF060 +mAlignWord voice_square_2_alt 0, 0, 3, 0, 2 @08ACF06C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF078 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF084 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF090 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACF09C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF0A8 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 2 @08ACF0B4 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF0C0 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF0CC +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF0D8 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACF0E4 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACF0F0 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF0FC +mAlignWord voice_square_1_alt 0, 2, 0, 2, 0, 0 @08ACF108 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACF114 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF120 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF12C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF138 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACF144 +mAlignWord voice_noise 60, 0, 0, 0, 2, 0, 15, 0 @08ACF150 +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 0 @08ACF15C +mAlignWord voice_noise 60, 0, 0, 0, 3, 0, 15, 4 @08ACF168 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF174 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACF180 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF18C +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACF198 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF1A4 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 0 @08ACF1B0 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACF1BC +mAlignWord voice_square_1_alt 0, 2, 0, 0, 10, 3 @08ACF1C8 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 12, 2 @08ACF1D4 +mAlignWord voice_square_2_alt 2, 0, 2, 2, 0 @08ACF1E0 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08ACF1EC +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACF1F8 +mAlignWord voice_square_2_alt 2, 0, 4, 13, 6 @08ACF204 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACF210 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 12, 2 @08ACF21C +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08ACF228 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACF234 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08ACF240 +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 2 @08ACF24C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_50, 255, 0, 255, 0 @08ACF258 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 0 @08ACF264 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF270 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACF27C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF288 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF294 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF2A0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF2AC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF2B8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF2C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF2D0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF2DC +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08ACF2E8 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08ACF2F4 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACF300 +mAlignWord voice_square_2_alt 3, 0, 0, 15, 0 @08ACF30C +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACF318 +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08ACF324 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08ACF330 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACF33C +mAlignWord voice_square_2_alt 3, 0, 0, 15, 0 @08ACF348 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACF354 +mAlignWord voice_square_2_alt 1, 1, 0, 15, 0 @08ACF360 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACF36C +mAlignWord voice_square_2_alt 0, 2, 0, 15, 0 @08ACF378 diff --git a/sound/voicegroups/voicegroup006.inc b/sound/voicegroups/voicegroup006.inc index c48f6ca22..55bca1c68 100644 --- a/sound/voicegroups/voicegroup006.inc +++ b/sound/voicegroups/voicegroup006.inc @@ -1,36 +1,69 @@ mAlignWord .global voicegroup006 voicegroup006: @ 0x08ACF384 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF384 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_70, 255, 0, 255, 0 @08ACF390 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF39C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF3A8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF3B4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_71, 255, 0, 255, 0 @08ACF3C0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_72, 255, 0, 255, 0 @08ACF3CC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF3D8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF3E4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF3F0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF3FC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF408 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF414 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF420 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_73, 255, 0, 255, 0 @08ACF42C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF438 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF444 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF450 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF45C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF468 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF474 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF480 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_74, 64, 0, 255, 0 @08ACF48C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF498 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF4A4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_75, 64, 0, 255, 0 @08ACF4B0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF4BC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF4C8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_76, 255, 0, 255, 0 @08ACF4D4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_77, 255, 0, 255, 0 @08ACF4E0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_22, 255, 0, 255, 149 @08ACF4EC +mAlignWord voice_square_2_alt 2, 0, 2, 1, 0 @08ACF4F8 +mAlignWord voice_square_2_alt 2, 0, 2, 2, 6 @08ACF504 diff --git a/sound/voicegroups/voicegroup007.inc b/sound/voicegroups/voicegroup007.inc index d014f4378..abb082f51 100644 --- a/sound/voicegroups/voicegroup007.inc +++ b/sound/voicegroups/voicegroup007.inc @@ -1,131 +1,259 @@ mAlignWord .global voicegroup007 voicegroup007: @ 0x08ACF510 +mAlignWord voice_square_1_alt 0, 0, 0, 0, 15, 0 @08ACF510 +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @08ACF51C +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08ACF528 +mAlignWord voice_square_1_alt 0, 3, 0, 0, 15, 0 @08ACF534 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 0 @08ACF540 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF54C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF558 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF564 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF570 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF57C +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08ACF588 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08ACF594 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACF5A0 +mAlignWord voice_square_2_alt 3, 0, 0, 15, 0 @08ACF5AC +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08ACF5B8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF5C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF5D0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF5DC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF5E8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF5F4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF600 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF60C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF618 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF624 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF630 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF63C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF648 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF654 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF660 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF66C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF678 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF684 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF690 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF69C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF6A8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF6B4 +mAlignWord voice_square_1_alt 0, 1, 1, 0, 15, 0 @08ACF6C0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF6CC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF6D8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF6E4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 4, 4, 0 @08ACF6F0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_3, 0, 0, 15, 0 @08ACF6FC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_4, 0, 0, 15, 0 @08ACF708 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_5, 0, 0, 15, 0 @08ACF714 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08ACF720 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08ACF72C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08ACF738 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08ACF744 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08ACF750 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF75C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08ACF768 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACF774 +mAlignWord voice_square_1_alt 0, 2, 0, 3, 0, 0 @08ACF780 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 0, 15, 0 @08ACF78C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08ACF798 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 0, 15, 0 @08ACF7A4 +mAlignWord voice_square_1_alt 0, 0, 0, 0, 15, 5 @08ACF7B0 +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 0 @08ACF7BC +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08ACF7C8 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08ACF7D4 +mAlignWord voice_square_1_alt 0, 0, 0, 4, 0, 0 @08ACF7E0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 4, 0, 0 @08ACF7EC +mAlignWord voice_square_2_alt 0, 0, 4, 4, 0 @08ACF7F8 +mAlignWord voice_square_1_alt 0, 1, 0, 3, 0, 0 @08ACF804 +mAlignWord voice_square_1_alt 0, 1, 0, 2, 0, 0 @08ACF810 +mAlignWord voice_square_1_alt 0, 3, 0, 1, 0, 1 @08ACF81C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08ACF828 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08ACF834 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08ACF840 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08ACF84C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_1, 255, 0, 255, 0 @08ACF858 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_2, 255, 0, 255, 0 @08ACF864 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_3, 255, 0, 255, 0 @08ACF870 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_4, 255, 0, 255, 0 @08ACF87C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08ACF888 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_6, 255, 0, 255, 127 @08ACF894 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_7, 255, 0, 255, 0 @08ACF8A0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_8, 255, 235, 38, 165 @08ACF8AC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_9, 255, 0, 255, 127 @08ACF8B8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_10, 255, 0, 255, 0 @08ACF8C4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08ACF8D0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_12, 255, 0, 255, 127 @08ACF8DC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_13, 255, 0, 255, 127 @08ACF8E8 +mAlignWord voice_keysplit voicegroup002, KeySplitTable1 @08ACF8F4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_14, 255, 246, 64, 149 @08ACF900 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_15, 255, 0, 255, 127 @08ACF90C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_16, 255, 0, 255, 127 @08ACF918 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_17, 255, 0, 255, 127 @08ACF924 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_18, 255, 0, 255, 127 @08ACF930 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08ACF93C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_19, 255, 0, 255, 127 @08ACF948 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_20, 255, 231, 0, 188 @08ACF954 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_21, 255, 0, 255, 0 @08ACF960 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_22, 255, 0, 255, 149 @08ACF96C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_23, 255, 235, 25, 165 @08ACF978 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_24, 255, 0, 255, 149 @08ACF984 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_25, 255, 0, 255, 0 @08ACF990 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 37, 0, 255, 165 @08ACF99C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 255, 0, 255, 165 @08ACF9A8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_27, 255, 252, 0, 149 @08ACF9B4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF9C0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF9CC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF9D8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF9E4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF9F0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACF9FC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFA08 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFA14 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFA20 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFA2C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFA38 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFA44 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFA50 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFA5C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFA68 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFA74 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_28, 255, 0, 255, 0 @08ACFA80 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_29, 255, 250, 18, 250 @08ACFA8C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_30, 255, 216, 25, 0 @08ACFA98 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_31, 37, 0, 255, 149 @08ACFAA4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_32, 255, 0, 255, 0 @08ACFAB0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_33, 255, 0, 255, 0 @08ACFABC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_34, 255, 0, 255, 149 @08ACFAC8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 5, 1, 0 @08ACFAD4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_35, 255, 216, 25, 0 @08ACFAE0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 4, 4, 0 @08ACFAEC +mAlignWord voice_keysplit_all voicegroup004 @08ACFAF8 +mAlignWord voice_keysplit_all voicegroup001 @08ACFB04 diff --git a/sound/voicegroups/voicegroup008.inc b/sound/voicegroups/voicegroup008.inc index 82e6e0281..46c0fcee9 100644 --- a/sound/voicegroups/voicegroup008.inc +++ b/sound/voicegroups/voicegroup008.inc @@ -1,131 +1,259 @@ mAlignWord .global voicegroup008 voicegroup008: @ 0x08ACFB10 +mAlignWord voice_square_1_alt 0, 0, 0, 0, 15, 0 @08ACFB10 +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @08ACFB1C +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08ACFB28 +mAlignWord voice_square_1_alt 0, 3, 0, 0, 15, 0 @08ACFB34 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 0 @08ACFB40 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFB4C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFB58 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFB64 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFB70 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFB7C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFB88 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08ACFB94 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_13, 255, 0, 255, 127 @08ACFBA0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08ACFBAC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFBB8 +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @08ACFBC4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_7, 255, 0, 255, 0 @08ACFBD0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08ACFBDC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFBE8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_78, 255, 0, 255, 0 @08ACFBF4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_79, 255, 0, 255, 0 @08ACFC00 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACFC0C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_22, 255, 0, 255, 149 @08ACFC18 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 7, 0 @08ACFC24 +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08ACFC30 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_80, 255, 0, 255, 0 @08ACFC3C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFC48 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08ACFC54 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_6, 255, 0, 255, 127 @08ACFC60 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08ACFC6C +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08ACFC78 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 7, 0 @08ACFC84 +mAlignWord voice_square_1_alt 0, 2, 0, 3, 4, 0 @08ACFC90 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFC9C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFCA8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFCB4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFCC0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFCCC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFCD8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFCE4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFCF0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFCFC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD08 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD14 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD20 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD2C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD38 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD44 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD50 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD5C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD68 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD74 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD80 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD8C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFD98 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFDA4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFDB0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFDBC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFDC8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFDD4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFDE0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFDEC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFDF8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE04 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE10 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE1C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE28 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE34 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE40 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE4C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE58 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE64 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE70 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE7C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE88 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFE94 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFEA0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFEAC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFEB8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFEC4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFED0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFEDC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFEE8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFEF4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF00 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF0C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF18 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF24 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF30 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF3C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF48 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF54 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF60 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF6C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF78 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF84 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF90 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFF9C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFFA8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFFB4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFFC0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFFCC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFFD8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFFE4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFFF0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08ACFFFC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0008 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0014 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0020 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD002C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0038 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0044 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0050 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD005C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0068 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0074 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0080 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD008C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0098 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD00A4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD00B0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD00BC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD00C8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD00D4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD00E0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD00EC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD00F8 +mAlignWord voice_keysplit_all voicegroup012 @08AD0104 diff --git a/sound/voicegroups/voicegroup009.inc b/sound/voicegroups/voicegroup009.inc index 412ebada2..de697b632 100644 --- a/sound/voicegroups/voicegroup009.inc +++ b/sound/voicegroups/voicegroup009.inc @@ -1,131 +1,259 @@ mAlignWord .global voicegroup009 voicegroup009: @ 0x08AD0110 +mAlignWord voice_square_1_alt 0, 0, 0, 0, 15, 0 @08AD0110 +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @08AD011C +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08AD0128 +mAlignWord voice_square_1_alt 0, 3, 0, 0, 15, 0 @08AD0134 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 0 @08AD0140 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD014C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0158 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0164 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0170 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD017C +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08AD0188 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08AD0194 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD01A0 +mAlignWord voice_square_2_alt 3, 0, 0, 15, 0 @08AD01AC +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08AD01B8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD01C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD01D0 +mAlignWord voice_square_2_alt 0, 0, 3, 0, 2 @08AD01DC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 4, 0 @08AD01E8 +mAlignWord voice_square_2_alt 2, 0, 2, 2, 0 @08AD01F4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_22, 255, 0, 255, 149 @08AD0200 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_81, 255, 0, 255, 149 @08AD020C +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 3 @08AD0218 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 7, 0 @08AD0224 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD0230 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 9, 6 @08AD023C +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD0248 +mAlignWord voice_square_2_alt 2, 0, 4, 0, 6 @08AD0254 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD0260 +mAlignWord voice_square_2_alt 2, 0, 4, 13, 6 @08AD026C +mAlignWord voice_square_1_alt 0, 1, 0, 2, 0, 0 @08AD0278 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08AD0284 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08AD0290 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 4 @08AD029C +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD02A8 +mAlignWord voice_square_1_alt 0, 1, 0, 6, 0, 6 @08AD02B4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 2, 0, 15, 0 @08AD02C0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 2 @08AD02CC +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD02D8 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD02E4 +mAlignWord voice_square_1_alt 0, 1, 0, 6, 0, 6 @08AD02F0 +mAlignWord voice_square_1_alt 0, 2, 0, 6, 0, 6 @08AD02FC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08AD0308 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD0314 +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 3 @08AD0320 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD032C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 4 @08AD0338 +mAlignWord voice_square_1_alt 0, 2, 0, 6, 0, 6 @08AD0344 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 6, 0, 6 @08AD0350 +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 3 @08AD035C +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08AD0368 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 4 @08AD0374 +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 3 @08AD0380 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD038C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 3 @08AD0398 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD03A4 +mAlignWord voice_square_1_alt 0, 1, 2, 0, 10, 3 @08AD03B0 +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 0 @08AD03BC +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08AD03C8 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08AD03D4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_78, 255, 0, 255, 0 @08AD03E0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_79, 255, 0, 255, 0 @08AD03EC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_82, 255, 0, 255, 0 @08AD03F8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_83, 255, 0, 255, 0 @08AD0404 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_80, 255, 0, 255, 0 @08AD0410 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_78, 255, 0, 255, 0 @08AD041C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_79, 255, 0, 255, 0 @08AD0428 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_82, 255, 250, 18, 250 @08AD0434 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_83, 255, 250, 18, 250 @08AD0440 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_80, 255, 250, 18, 250 @08AD044C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_1, 255, 0, 255, 0 @08AD0458 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_2, 255, 0, 255, 0 @08AD0464 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_3, 255, 0, 255, 0 @08AD0470 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_4, 255, 0, 255, 0 @08AD047C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD0488 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_6, 255, 0, 255, 127 @08AD0494 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_7, 255, 0, 255, 0 @08AD04A0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_8, 255, 235, 38, 165 @08AD04AC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_9, 255, 0, 255, 127 @08AD04B8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_10, 255, 0, 255, 0 @08AD04C4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08AD04D0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_12, 255, 0, 255, 127 @08AD04DC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_13, 255, 0, 255, 127 @08AD04E8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD04F4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0500 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD050C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0518 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 1 @08AD0524 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0530 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD053C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_19, 255, 0, 255, 0 @08AD0548 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_20, 255, 0, 255, 0 @08AD0554 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_21, 255, 0, 255, 0 @08AD0560 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD056C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0578 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0584 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0590 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD059C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD05A8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD05B4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD05C0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD05CC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD05D8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD05E4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD05F0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD05FC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0608 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_84, 255, 0, 255, 0 @08AD0614 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_85, 255, 0, 255, 0 @08AD0620 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_86, 255, 0, 255, 0 @08AD062C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_87, 255, 0, 255, 0 @08AD0638 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_88, 255, 0, 255, 0 @08AD0644 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_89, 255, 0, 255, 0 @08AD0650 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_90, 255, 0, 255, 0 @08AD065C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_91, 255, 0, 255, 0 @08AD0668 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_92, 255, 0, 255, 0 @08AD0674 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_60, 255, 0, 255, 0 @08AD0680 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_61, 255, 0, 255, 0 @08AD068C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08AD0698 +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 2 @08AD06A4 +mAlignWord voice_noise 60, 0, 0, 1, 1, 0, 12, 2 @08AD06B0 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 0 @08AD06BC +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 2 @08AD06C8 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08AD06D4 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 2 @08AD06E0 +mAlignWord voice_square_1_alt 0, 2, 3, 0, 10, 3 @08AD06EC +mAlignWord voice_square_1_alt 0, 1, 0, 2, 0, 0 @08AD06F8 +mAlignWord voice_keysplit_all voicegroup012 @08AD0704 diff --git a/sound/voicegroups/voicegroup010.inc b/sound/voicegroups/voicegroup010.inc index d3997663e..ab3b69f5b 100644 --- a/sound/voicegroups/voicegroup010.inc +++ b/sound/voicegroups/voicegroup010.inc @@ -1,131 +1,259 @@ mAlignWord .global voicegroup010 voicegroup010: @ 0x08AD0710 +mAlignWord voice_square_1_alt 0, 2, 0, 3, 1, 3 @08AD0710 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD071C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 3, 0 @08AD0728 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD0734 +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08AD0740 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 4, 0 @08AD074C +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08AD0758 +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 3 @08AD0764 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD0770 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 7, 0 @08AD077C +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08AD0788 +mAlignWord voice_square_1_alt 0, 2, 0, 3, 4, 0 @08AD0794 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD07A0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 7, 0 @08AD07AC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 3, 0 @08AD07B8 +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 3 @08AD07C4 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD07D0 +mAlignWord voice_square_2_alt 2, 0, 3, 1, 2 @08AD07DC +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 3 @08AD07E8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 7, 0 @08AD07F4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_22, 255, 0, 255, 149 @08AD0800 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_81, 255, 0, 255, 149 @08AD080C +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 3 @08AD0818 +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08AD0824 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 3 @08AD0830 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 9, 6 @08AD083C +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD0848 +mAlignWord voice_square_2_alt 2, 0, 4, 0, 6 @08AD0854 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD0860 +mAlignWord voice_square_2_alt 2, 0, 4, 13, 6 @08AD086C +mAlignWord voice_square_1_alt 0, 1, 0, 2, 0, 0 @08AD0878 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08AD0884 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08AD0890 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 4 @08AD089C +mAlignWord voice_square_1_alt 0, 2, 0, 6, 0, 6 @08AD08A8 +mAlignWord voice_square_2_alt 1, 0, 6, 0, 6 @08AD08B4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 2, 0, 15, 0 @08AD08C0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 2 @08AD08CC +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD08D8 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD08E4 +mAlignWord voice_square_1_alt 0, 1, 0, 6, 0, 6 @08AD08F0 +mAlignWord voice_square_1_alt 0, 2, 0, 6, 0, 6 @08AD08FC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08AD0908 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD0914 +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 3 @08AD0920 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD092C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 4 @08AD0938 +mAlignWord voice_square_1_alt 0, 2, 0, 6, 0, 6 @08AD0944 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 6, 0, 6 @08AD0950 +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 3 @08AD095C +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08AD0968 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 4 @08AD0974 +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 3 @08AD0980 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD098C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 3 @08AD0998 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD09A4 +mAlignWord voice_square_1_alt 0, 1, 2, 0, 10, 3 @08AD09B0 +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 0 @08AD09BC +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08AD09C8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_93, 255, 0, 128, 235 @08AD09D4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_78, 255, 0, 255, 0 @08AD09E0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_79, 255, 0, 255, 0 @08AD09EC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_82, 255, 0, 255, 0 @08AD09F8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_83, 255, 0, 255, 0 @08AD0A04 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_80, 255, 0, 255, 0 @08AD0A10 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_78, 255, 0, 255, 0 @08AD0A1C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_79, 255, 0, 255, 0 @08AD0A28 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_82, 255, 250, 18, 250 @08AD0A34 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_83, 255, 250, 18, 250 @08AD0A40 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_80, 255, 250, 18, 250 @08AD0A4C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_1, 255, 0, 255, 0 @08AD0A58 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_2, 255, 0, 255, 0 @08AD0A64 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_3, 255, 0, 255, 0 @08AD0A70 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_4, 255, 0, 255, 0 @08AD0A7C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD0A88 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_6, 255, 0, 255, 127 @08AD0A94 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_7, 255, 0, 255, 0 @08AD0AA0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_8, 255, 235, 38, 165 @08AD0AAC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_9, 255, 0, 255, 127 @08AD0AB8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_10, 255, 0, 255, 0 @08AD0AC4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08AD0AD0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_12, 255, 0, 255, 127 @08AD0ADC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_13, 255, 0, 255, 127 @08AD0AE8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 3 @08AD0AF4 +mAlignWord voice_square_2_alt 2, 0, 4, 10, 0 @08AD0B00 +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 3 @08AD0B0C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0B18 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 1 @08AD0B24 +mAlignWord voice_square_1_alt 0, 2, 0, 6, 0, 2 @08AD0B30 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0B3C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_19, 255, 0, 255, 0 @08AD0B48 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_20, 255, 0, 255, 0 @08AD0B54 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_21, 255, 0, 255, 0 @08AD0B60 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 7, 2 @08AD0B6C +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 2 @08AD0B78 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 2 @08AD0B84 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 2, 9, 2 @08AD0B90 +mAlignWord voice_square_2_alt 2, 1, 0, 10, 3 @08AD0B9C +mAlignWord voice_square_1_alt 0, 2, 0, 4, 10, 0 @08AD0BA8 +mAlignWord voice_square_2_alt 3, 1, 6, 0, 0 @08AD0BB4 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD0BC0 +mAlignWord voice_square_1_alt 0, 2, 0, 4, 0, 4 @08AD0BCC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 2, 9, 2 @08AD0BD8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 1, 2, 9, 2 @08AD0BE4 +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08AD0BF0 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD0BFC +mAlignWord voice_square_1_alt 0, 2, 0, 4, 0, 4 @08AD0C08 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 2, 9, 2 @08AD0C14 +mAlignWord voice_square_2_alt 2, 0, 4, 0, 4 @08AD0C20 +mAlignWord voice_square_1_alt 0, 2, 0, 4, 0, 4 @08AD0C2C +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD0C38 +mAlignWord voice_square_1_alt 0, 2, 0, 4, 0, 4 @08AD0C44 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 2, 9, 2 @08AD0C50 +mAlignWord voice_square_2_alt 2, 1, 3, 3, 5 @08AD0C5C +mAlignWord voice_square_1_alt 0, 2, 1, 3, 3, 5 @08AD0C68 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD0C74 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0C80 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0C8C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0C98 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0CA4 +mAlignWord voice_square_1_alt 0, 2, 0, 4, 0, 4 @08AD0CB0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 2, 9, 2 @08AD0CBC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 7, 2 @08AD0CC8 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 2 @08AD0CD4 +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 2 @08AD0CE0 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD0CEC +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @08AD0CF8 +mAlignWord voice_keysplit_all voicegroup012 @08AD0D04 diff --git a/sound/voicegroups/voicegroup011.inc b/sound/voicegroups/voicegroup011.inc index 55b64c1a5..45dc91f43 100644 --- a/sound/voicegroups/voicegroup011.inc +++ b/sound/voicegroups/voicegroup011.inc @@ -1,95 +1,187 @@ mAlignWord .global voicegroup011 voicegroup011: @ 0x08AD0D10 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08AD0D10 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08AD0D1C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD0D28 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08AD0D34 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_17, 255, 0, 255, 127 @08AD0D40 +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @08AD0D4C +mAlignWord voice_square_1_alt 0, 3, 0, 6, 1, 0 @08AD0D58 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_94, 255, 0, 255, 127 @08AD0D64 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_95, 255, 0, 255, 0 @08AD0D70 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_96, 255, 0, 255, 0 @08AD0D7C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_97, 255, 235, 25, 165 @08AD0D88 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 4, 3, 0 @08AD0D94 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0DA0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0DAC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0DB8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0DC4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0DD0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0DDC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0DE8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0DF4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E00 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E0C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E18 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E24 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E30 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E3C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E48 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E54 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E60 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E6C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E78 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E84 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E90 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0E9C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0EA8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0EB4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0EC0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0ECC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0ED8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0EE4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0EF0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0EFC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F08 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F14 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F20 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F2C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F38 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F44 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F50 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F5C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F68 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F74 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F80 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F8C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0F98 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0FA4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0FB0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0FBC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0FC8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0FD4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0FE0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0FEC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD0FF8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1004 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1010 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD101C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1028 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1034 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1040 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD104C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1058 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1064 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1070 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD107C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1088 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1094 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD10A0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD10AC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD10B8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD10C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD10D0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD10DC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD10E8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD10F4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1100 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD110C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1118 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1124 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1130 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD113C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1148 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1154 diff --git a/sound/voicegroups/voicegroup012.inc b/sound/voicegroups/voicegroup012.inc index 6935a12d7..060b66a4d 100644 --- a/sound/voicegroups/voicegroup012.inc +++ b/sound/voicegroups/voicegroup012.inc @@ -1,86 +1,169 @@ mAlignWord .global voicegroup012 voicegroup012: @ 0x08AD1160 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1160 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD116C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1178 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1184 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1190 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD119C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD11A8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD11B4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD11C0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD11CC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD11D8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD11E4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD11F0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD11FC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1208 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1214 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1220 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD122C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1238 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1244 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1250 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD125C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1268 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1274 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1280 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD128C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1298 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD12A4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD12B0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD12BC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD12C8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD12D4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD12E0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD12EC +mAlignWord voice_keysplit_all voicegroup004 @08AD12F8 +mAlignWord voice_keysplit_all voicegroup012 @08AD1304 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_36, 255, 255, 255, 0 @08AD1310 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_37, 255, 0, 255, 0 @08AD131C +mAlignWord voice_noise 84, 0, 192, 0, 0, 1, 0, 0 @08AD1328 +mAlignWord voice_noise 84, 0, 192, 0, 0, 2, 0, 0 @08AD1334 +mAlignWord voice_noise 84, 0, 192, 0, 0, 3, 7, 0 @08AD1340 +mAlignWord voice_directsound 45, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08AD134C +mAlignWord voice_directsound 50, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08AD1358 +mAlignWord voice_directsound 55, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08AD1364 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08AD1370 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08AD137C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_39, 255, 0, 255, 0 @08AD1388 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_40, 255, 0, 255, 0 @08AD1394 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_41, 255, 0, 255, 0 @08AD13A0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_42, 255, 0, 255, 0 @08AD13AC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_43, 255, 0, 255, 0 @08AD13B8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_44, 255, 0, 255, 0 @08AD13C4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_45, 255, 0, 255, 0 @08AD13D0 +mAlignWord voice_directsound 57, 0, DirectSoundWaveData_42, 255, 0, 255, 0 @08AD13DC +mAlignWord voice_directsound 59, 0, DirectSoundWaveData_42, 255, 0, 255, 0 @08AD13E8 +mAlignWord voice_directsound 61, 0, DirectSoundWaveData_42, 255, 0, 255, 0 @08AD13F4 +mAlignWord voice_directsound 45, 0, DirectSoundWaveData_46, 255, 0, 255, 0 @08AD1400 +mAlignWord voice_directsound 50, 0, DirectSoundWaveData_46, 255, 0, 255, 0 @08AD140C +mAlignWord voice_directsound 55, 0, DirectSoundWaveData_46, 255, 0, 255, 0 @08AD1418 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_46, 255, 0, 255, 0 @08AD1424 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_46, 255, 0, 255, 0 @08AD1430 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD143C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1448 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1454 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1460 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD146C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1478 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1484 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1490 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD149C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD14A8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD14B4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD14C0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD14CC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD14D8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD14E4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD14F0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD14FC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1508 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1514 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1520 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD152C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_47, 255, 0, 255, 0 @08AD1538 diff --git a/sound/voicegroups/voicegroup013.inc b/sound/voicegroups/voicegroup013.inc index 82bd4ccf7..f13e8e400 100644 --- a/sound/voicegroups/voicegroup013.inc +++ b/sound/voicegroups/voicegroup013.inc @@ -1,131 +1,259 @@ mAlignWord .global voicegroup013 voicegroup013: @ 0x08AD1544 +mAlignWord voice_square_1_alt 0, 2, 0, 3, 1, 3 @08AD1544 +mAlignWord voice_square_2_alt 2, 0, 4, 4, 6 @08AD1550 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 3, 0 @08AD155C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD1568 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_98, 255, 250, 18, 250 @08AD1574 +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08AD1580 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08AD158C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 3, 0 @08AD1598 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 255, 0, 255, 165 @08AD15A4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08AD15B0 +mAlignWord voice_square_1_alt 0, 2, 0, 6, 0, 3 @08AD15BC +mAlignWord voice_square_2_alt 2, 1, 6, 0, 4 @08AD15C8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 13, 0 @08AD15D4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD15E0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_82, 255, 250, 18, 250 @08AD15EC +mAlignWord voice_square_1_alt 0, 2, 1, 6, 7, 3 @08AD15F8 +mAlignWord voice_square_2_alt 2, 1, 6, 7, 4 @08AD1604 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1610 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD161C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_99, 255, 0, 255, 127 @08AD1628 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 3, 0 @08AD1634 +mAlignWord voice_square_1_alt 0, 2, 0, 6, 0, 3 @08AD1640 +mAlignWord voice_square_2_alt 2, 1, 6, 0, 4 @08AD164C +mAlignWord voice_square_1_alt 0, 2, 1, 6, 7, 3 @08AD1658 +mAlignWord voice_square_2_alt 2, 1, 6, 7, 4 @08AD1664 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_100, 255, 0, 255, 0 @08AD1670 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_20, 255, 0, 255, 0 @08AD167C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_78, 255, 0, 255, 0 @08AD1688 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD1694 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD16A0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08AD16AC +mAlignWord voice_square_1_alt 0, 2, 0, 0, 7, 0 @08AD16B8 +mAlignWord voice_square_2_alt 2, 0, 0, 7, 0 @08AD16C4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 1 @08AD16D0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD16DC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_20, 255, 0, 255, 0 @08AD16E8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 255, 0, 255, 165 @08AD16F4 +mAlignWord voice_square_1_alt 0, 1, 0, 0, 13, 1 @08AD1700 +mAlignWord voice_square_2_alt 1, 0, 0, 13, 1 @08AD170C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_100, 255, 0, 255, 0 @08AD1718 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08AD1724 +mAlignWord voice_square_1_alt 0, 2, 0, 0, 7, 0 @08AD1730 +mAlignWord voice_square_2_alt 2, 0, 0, 7, 0 @08AD173C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 3 @08AD1748 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_80, 255, 0, 255, 0 @08AD1754 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 255, 0, 255, 165 @08AD1760 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_98, 255, 250, 18, 250 @08AD176C +mAlignWord voice_square_1_alt 0, 1, 0, 3, 1, 3 @08AD1778 +mAlignWord voice_square_2_alt 1, 0, 4, 4, 6 @08AD1784 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1790 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD179C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD17A8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 3 @08AD17B4 +mAlignWord voice_square_1_alt 0, 2, 0, 0, 7, 0 @08AD17C0 +mAlignWord voice_square_2_alt 2, 0, 0, 7, 0 @08AD17CC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08AD17D8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_93, 255, 0, 128, 235 @08AD17E4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_12, 255, 0, 255, 127 @08AD17F0 +mAlignWord voice_square_1_alt 0, 2, 0, 3, 1, 3 @08AD17FC +mAlignWord voice_square_2_alt 2, 0, 3, 1, 3 @08AD1808 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1814 +mAlignWord voice_square_1_alt 0, 2, 1, 6, 7, 3 @08AD1820 +mAlignWord voice_square_2_alt 2, 1, 6, 7, 4 @08AD182C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 3 @08AD1838 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_20, 255, 0, 255, 0 @08AD1844 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_78, 255, 0, 255, 0 @08AD1850 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_80, 255, 0, 255, 0 @08AD185C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_100, 255, 0, 255, 0 @08AD1868 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD1874 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_82, 255, 0, 255, 0 @08AD1880 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08AD188C +mAlignWord voice_square_1_alt 0, 2, 0, 0, 7, 0 @08AD1898 +mAlignWord voice_square_2_alt 2, 0, 0, 7, 0 @08AD18A4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 1 @08AD18B0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD18BC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_20, 255, 0, 255, 0 @08AD18C8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 255, 0, 255, 165 @08AD18D4 +mAlignWord voice_square_1_alt 0, 1, 0, 0, 13, 1 @08AD18E0 +mAlignWord voice_square_2_alt 1, 0, 0, 13, 1 @08AD18EC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_100, 255, 0, 255, 0 @08AD18F8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08AD1904 +mAlignWord voice_square_1_alt 0, 2, 0, 0, 7, 0 @08AD1910 +mAlignWord voice_square_2_alt 2, 0, 0, 7, 0 @08AD191C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 1, 1 @08AD1928 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD1934 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_20, 255, 0, 255, 0 @08AD1940 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 255, 0, 255, 165 @08AD194C +mAlignWord voice_square_1_alt 0, 1, 0, 0, 13, 1 @08AD1958 +mAlignWord voice_square_2_alt 1, 0, 0, 13, 1 @08AD1964 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_100, 255, 0, 255, 0 @08AD1970 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_19, 255, 0, 255, 127 @08AD197C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1988 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1994 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD19A0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD19AC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD19B8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD19C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD19D0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD19DC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD19E8 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD19F4 +mAlignWord voice_square_1_alt 0, 2, 0, 4, 0, 4 @08AD1A00 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 2, 9, 2 @08AD1A0C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 1, 2, 9, 2 @08AD1A18 +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08AD1A24 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD1A30 +mAlignWord voice_square_1_alt 0, 2, 0, 4, 0, 4 @08AD1A3C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 2, 9, 2 @08AD1A48 +mAlignWord voice_square_2_alt 2, 0, 4, 0, 4 @08AD1A54 +mAlignWord voice_square_1_alt 0, 2, 0, 4, 0, 4 @08AD1A60 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD1A6C +mAlignWord voice_square_1_alt 0, 2, 0, 4, 0, 4 @08AD1A78 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 2, 9, 2 @08AD1A84 +mAlignWord voice_square_2_alt 2, 1, 3, 3, 5 @08AD1A90 +mAlignWord voice_square_1_alt 0, 2, 1, 3, 3, 5 @08AD1A9C +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD1AA8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1AB4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1AC0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1ACC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1AD8 +mAlignWord voice_square_1_alt 0, 2, 0, 4, 0, 4 @08AD1AE4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 2, 9, 2 @08AD1AF0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 3, 7, 2 @08AD1AFC +mAlignWord voice_square_2_alt 2, 0, 6, 0, 2 @08AD1B08 +mAlignWord voice_square_1_alt 0, 2, 1, 0, 10, 2 @08AD1B14 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 6 @08AD1B20 +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @08AD1B2C +mAlignWord voice_keysplit_all voicegroup012 @08AD1B38 diff --git a/sound/voicegroups/voicegroup014.inc b/sound/voicegroups/voicegroup014.inc index 838c8034e..7a2aa7539 100644 --- a/sound/voicegroups/voicegroup014.inc +++ b/sound/voicegroups/voicegroup014.inc @@ -1,95 +1,187 @@ mAlignWord .global voicegroup014 voicegroup014: @ 0x08AD1B44 +mAlignWord voice_square_1_alt 0, 0, 0, 0, 15, 0 @08AD1B44 +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @08AD1B50 +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08AD1B5C +mAlignWord voice_square_1_alt 0, 3, 0, 0, 15, 0 @08AD1B68 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 0 @08AD1B74 +mAlignWord voice_noise_alt 60, 0, 0, 0, 0, 0, 15, 0 @08AD1B80 +mAlignWord voice_noise_alt 60, 0, 0, 1, 0, 0, 15, 0 @08AD1B8C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1B98 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1BA4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1BB0 +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08AD1BBC +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08AD1BC8 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD1BD4 +mAlignWord voice_square_2_alt 3, 0, 0, 15, 0 @08AD1BE0 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08AD1BEC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1BF8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C04 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C10 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C1C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C28 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C34 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C40 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C4C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C58 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C64 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C70 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C7C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C88 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1C94 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1CA0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1CAC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1CB8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1CC4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1CD0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1CDC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1CE8 +mAlignWord voice_square_1_alt 0, 1, 1, 0, 15, 0 @08AD1CF4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1D00 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1D0C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1D18 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 4, 4, 0 @08AD1D24 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_3, 0, 0, 15, 0 @08AD1D30 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_4, 0, 0, 15, 0 @08AD1D3C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_5, 0, 0, 15, 0 @08AD1D48 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08AD1D54 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08AD1D60 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08AD1D6C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08AD1D78 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08AD1D84 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 4, 3, 0 @08AD1D90 +mAlignWord voice_square_1_alt 0, 3, 0, 6, 1, 0 @08AD1D9C +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 2 @08AD1DA8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 2, 0, 15, 2 @08AD1DB4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_3, 0, 4, 3, 0 @08AD1DC0 +mAlignWord voice_square_1_alt 0, 2, 0, 6, 0, 0 @08AD1DCC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 3, 6, 4, 2 @08AD1DD8 +mAlignWord voice_square_1_alt 0, 2, 0, 6, 1, 0 @08AD1DE4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1DF0 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 0 @08AD1DFC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_101, 255, 0, 255, 127 @08AD1E08 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_102, 255, 0, 255, 127 @08AD1E14 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_103, 255, 0, 255, 127 @08AD1E20 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_104, 255, 0, 255, 127 @08AD1E2C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD1E38 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_9, 255, 0, 255, 127 @08AD1E44 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_105, 255, 249, 0, 127 @08AD1E50 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_95, 255, 0, 255, 127 @08AD1E5C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_96, 255, 0, 255, 127 @08AD1E68 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_106, 255, 0, 255, 127 @08AD1E74 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_105, 26, 0, 255, 188 @08AD1E80 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_107, 255, 235, 128, 127 @08AD1E8C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_108, 255, 249, 51, 127 @08AD1E98 +mAlignWord voice_square_1_alt 0, 3, 0, 6, 6, 0 @08AD1EA4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_109, 26, 0, 255, 188 @08AD1EB0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 3, 3, 0 @08AD1EBC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 4, 7, 0 @08AD1EC8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_110, 255, 0, 255, 0 @08AD1ED4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_111, 255, 249, 25, 0 @08AD1EE0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_112, 255, 249, 25, 127 @08AD1EEC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_94, 255, 0, 255, 127 @08AD1EF8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1F04 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1F10 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_13, 255, 0, 255, 127 @08AD1F1C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1F28 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_14, 255, 246, 64, 149 @08AD1F34 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1F40 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1F4C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_17, 255, 0, 255, 127 @08AD1F58 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_113, 255, 0, 255, 127 @08AD1F64 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08AD1F70 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_19, 255, 0, 255, 127 @08AD1F7C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_20, 255, 231, 0, 188 @08AD1F88 diff --git a/sound/voicegroups/voicegroup015.inc b/sound/voicegroups/voicegroup015.inc index c0ae8b685..f6249ec94 100644 --- a/sound/voicegroups/voicegroup015.inc +++ b/sound/voicegroups/voicegroup015.inc @@ -1,34 +1,65 @@ mAlignWord .global voicegroup015 voicegroup015: @ 0x08AD1F94 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1F94 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_25, 255, 0, 255, 149 @08AD1FA0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD1FAC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_24, 255, 0, 255, 149 @08AD1FB8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_114, 255, 249, 90, 165 @08AD1FC4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 19, 0, 255, 165 @08AD1FD0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 255, 0, 255, 165 @08AD1FDC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_115, 255, 0, 255, 127 @08AD1FE8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_116, 255, 0, 255, 127 @08AD1FF4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_117, 255, 0, 255, 127 @08AD2000 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_97, 255, 235, 25, 165 @08AD200C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 4, 4, 0 @08AD2018 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2024 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2030 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD203C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2048 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2054 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2060 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_118, 255, 0, 255, 127 @08AD206C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_119, 255, 0, 255, 127 @08AD2078 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_120, 255, 0, 255, 127 @08AD2084 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_121, 255, 0, 255, 127 @08AD2090 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_122, 255, 0, 255, 127 @08AD209C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD20A8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD20B4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD20C0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD20CC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD20D8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD20E4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD20F0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD20FC diff --git a/sound/voicegroups/voicegroup016.inc b/sound/voicegroups/voicegroup016.inc index 010581b75..7ba82b215 100644 --- a/sound/voicegroups/voicegroup016.inc +++ b/sound/voicegroups/voicegroup016.inc @@ -1,95 +1,187 @@ mAlignWord .global voicegroup016 voicegroup016: @ 0x08AD2108 +mAlignWord voice_keysplit_all voicegroup019 @08AD2108 +mAlignWord voice_keysplit_all voicegroup018 @08AD2114 +mAlignWord voice_keysplit_all voicegroup017 @08AD2120 +mAlignWord voice_keysplit_all voicegroup016 @08AD212C +mAlignWord voice_keysplit_all voicegroup015 @08AD2138 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_36, 255, 255, 255, 0 @08AD2144 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_37, 255, 0, 255, 0 @08AD2150 +mAlignWord voice_noise 84, 0, 192, 0, 0, 1, 0, 0 @08AD215C +mAlignWord voice_noise 84, 0, 192, 0, 0, 2, 0, 0 @08AD2168 +mAlignWord voice_noise 84, 0, 192, 0, 0, 3, 7, 0 @08AD2174 +mAlignWord voice_directsound 45, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08AD2180 +mAlignWord voice_directsound 50, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08AD218C +mAlignWord voice_directsound 55, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08AD2198 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08AD21A4 +mAlignWord voice_directsound 65, 0, DirectSoundWaveData_38, 255, 0, 255, 0 @08AD21B0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_39, 255, 0, 255, 0 @08AD21BC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_40, 255, 0, 255, 0 @08AD21C8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_41, 255, 0, 255, 0 @08AD21D4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_42, 255, 0, 255, 0 @08AD21E0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_43, 255, 0, 255, 0 @08AD21EC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_44, 255, 0, 255, 0 @08AD21F8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_45, 255, 0, 255, 0 @08AD2204 +mAlignWord voice_directsound 57, 0, DirectSoundWaveData_42, 255, 0, 255, 0 @08AD2210 +mAlignWord voice_directsound 59, 0, DirectSoundWaveData_42, 255, 0, 255, 0 @08AD221C +mAlignWord voice_directsound 61, 0, DirectSoundWaveData_42, 255, 0, 255, 0 @08AD2228 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2234 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2240 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD224C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2258 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2264 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_123, 255, 0, 255, 0 @08AD2270 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_124, 255, 242, 51, 0 @08AD227C +mAlignWord voice_directsound 70, 0, DirectSoundWaveData_125, 255, 0, 255, 0 @08AD2288 +mAlignWord voice_directsound 64, 0, DirectSoundWaveData_126, 255, 0, 255, 0 @08AD2294 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD22A0 +mAlignWord voice_directsound 64, 0, DirectSoundWaveData_127, 255, 0, 255, 0 @08AD22AC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_128, 255, 0, 255, 0 @08AD22B8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_129, 255, 0, 255, 0 @08AD22C4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_130, 255, 0, 255, 0 @08AD22D0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_131, 255, 0, 255, 0 @08AD22DC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_132, 255, 0, 255, 0 @08AD22E8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD22F4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2300 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD230C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_133, 255, 0, 255, 0 @08AD2318 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_134, 255, 0, 255, 0 @08AD2324 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_135, 255, 0, 255, 0 @08AD2330 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_136, 255, 0, 255, 0 @08AD233C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_137, 255, 0, 255, 0 @08AD2348 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_138, 255, 0, 255, 0 @08AD2354 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_139, 255, 0, 255, 0 @08AD2360 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_140, 255, 0, 255, 0 @08AD236C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_141, 255, 0, 255, 0 @08AD2378 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_142, 255, 0, 255, 0 @08AD2384 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_143, 255, 0, 255, 0 @08AD2390 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_144, 255, 0, 255, 0 @08AD239C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_145, 255, 0, 255, 0 @08AD23A8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_146, 255, 0, 255, 0 @08AD23B4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_147, 255, 0, 255, 0 @08AD23C0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_148, 255, 0, 255, 0 @08AD23CC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_149, 255, 0, 255, 0 @08AD23D8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_150, 255, 0, 255, 0 @08AD23E4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_151, 255, 0, 255, 0 @08AD23F0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_152, 255, 0, 255, 0 @08AD23FC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_153, 255, 0, 255, 0 @08AD2408 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2414 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2420 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD242C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_154, 255, 0, 255, 0 @08AD2438 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_155, 255, 0, 255, 0 @08AD2444 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_156, 255, 0, 255, 0 @08AD2450 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_157, 255, 0, 255, 0 @08AD245C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_158, 255, 0, 255, 0 @08AD2468 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_159, 255, 0, 255, 0 @08AD2474 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_160, 255, 0, 255, 0 @08AD2480 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_161, 255, 0, 255, 0 @08AD248C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_162, 255, 0, 255, 0 @08AD2498 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_163, 255, 0, 255, 0 @08AD24A4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_164, 255, 0, 255, 0 @08AD24B0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_165, 255, 0, 255, 0 @08AD24BC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_166, 255, 0, 255, 0 @08AD24C8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_167, 255, 0, 255, 0 @08AD24D4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_168, 255, 0, 255, 0 @08AD24E0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD24EC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD24F8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2504 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2510 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD251C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2528 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2534 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2540 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD254C diff --git a/sound/voicegroups/voicegroup017.inc b/sound/voicegroups/voicegroup017.inc index 7084ed4ea..9594bd438 100644 --- a/sound/voicegroups/voicegroup017.inc +++ b/sound/voicegroups/voicegroup017.inc @@ -1,87 +1,171 @@ mAlignWord .global voicegroup017 voicegroup017: @ 0x08AD2558 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2558 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2564 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2570 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD257C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2588 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2594 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD25A0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_169, 255, 0, 255, 0 @08AD25AC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_170, 255, 0, 255, 0 @08AD25B8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_171, 255, 0, 255, 0 @08AD25C4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_172, 255, 0, 255, 0 @08AD25D0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_173, 255, 0, 255, 0 @08AD25DC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_174, 255, 0, 255, 0 @08AD25E8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_175, 255, 0, 255, 0 @08AD25F4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_176, 255, 0, 255, 0 @08AD2600 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_177, 255, 0, 255, 0 @08AD260C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_178, 255, 0, 255, 0 @08AD2618 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_179, 255, 0, 255, 0 @08AD2624 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_180, 255, 0, 255, 0 @08AD2630 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_181, 255, 0, 255, 0 @08AD263C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_182, 255, 0, 255, 0 @08AD2648 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_183, 255, 0, 255, 0 @08AD2654 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_184, 255, 0, 255, 0 @08AD2660 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_185, 255, 0, 255, 0 @08AD266C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_186, 255, 0, 255, 0 @08AD2678 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_187, 255, 0, 255, 0 @08AD2684 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_188, 255, 0, 255, 0 @08AD2690 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_189, 255, 0, 255, 0 @08AD269C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_190, 255, 0, 255, 0 @08AD26A8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_191, 255, 0, 255, 0 @08AD26B4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_192, 255, 0, 255, 0 @08AD26C0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_193, 255, 0, 255, 0 @08AD26CC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_194, 255, 0, 255, 0 @08AD26D8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_195, 255, 0, 255, 0 @08AD26E4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_196, 255, 0, 255, 0 @08AD26F0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_197, 255, 0, 255, 0 @08AD26FC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_198, 255, 0, 255, 0 @08AD2708 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_199, 255, 0, 255, 0 @08AD2714 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_200, 255, 0, 255, 0 @08AD2720 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_201, 255, 0, 255, 0 @08AD272C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_202, 255, 0, 255, 0 @08AD2738 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_203, 255, 0, 255, 0 @08AD2744 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_204, 255, 0, 255, 0 @08AD2750 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_205, 255, 0, 255, 0 @08AD275C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_206, 255, 0, 255, 0 @08AD2768 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_207, 255, 0, 255, 0 @08AD2774 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_208, 255, 0, 255, 0 @08AD2780 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_209, 255, 0, 255, 0 @08AD278C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_210, 255, 0, 255, 0 @08AD2798 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_211, 255, 0, 255, 0 @08AD27A4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_212, 255, 0, 255, 0 @08AD27B0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_213, 255, 0, 255, 0 @08AD27BC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD27C8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD27D4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD27E0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD27EC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD27F8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2804 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2810 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD281C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2828 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2834 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2840 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_214, 255, 0, 255, 0 @08AD284C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_215, 255, 0, 255, 0 @08AD2858 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_216, 255, 0, 255, 0 @08AD2864 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_217, 255, 0, 255, 0 @08AD2870 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_218, 255, 0, 255, 0 @08AD287C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_219, 255, 0, 255, 0 @08AD2888 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_220, 255, 0, 255, 0 @08AD2894 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_221, 255, 0, 255, 0 @08AD28A0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_222, 255, 0, 255, 0 @08AD28AC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_223, 255, 0, 255, 0 @08AD28B8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_224, 255, 0, 255, 0 @08AD28C4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_225, 255, 0, 255, 0 @08AD28D0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_226, 255, 0, 255, 0 @08AD28DC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_227, 255, 0, 255, 0 @08AD28E8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_228, 255, 0, 255, 0 @08AD28F4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_229, 255, 0, 255, 0 @08AD2900 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_230, 255, 0, 255, 0 @08AD290C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_231, 255, 0, 255, 0 @08AD2918 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_232, 255, 0, 255, 0 @08AD2924 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_233, 255, 0, 255, 0 @08AD2930 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_234, 255, 0, 255, 0 @08AD293C diff --git a/sound/voicegroups/voicegroup018.inc b/sound/voicegroups/voicegroup018.inc index 727f4bb27..b69e7fccd 100644 --- a/sound/voicegroups/voicegroup018.inc +++ b/sound/voicegroups/voicegroup018.inc @@ -1,34 +1,65 @@ mAlignWord .global voicegroup018 voicegroup018: @ 0x08AD2948 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_235, 255, 0, 255, 0 @08AD2948 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_236, 255, 0, 255, 0 @08AD2954 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_237, 255, 0, 255, 0 @08AD2960 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_238, 255, 0, 255, 0 @08AD296C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_239, 255, 0, 255, 0 @08AD2978 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_240, 255, 0, 255, 0 @08AD2984 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_241, 255, 0, 255, 0 @08AD2990 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_242, 255, 0, 255, 0 @08AD299C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_243, 255, 0, 255, 0 @08AD29A8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_244, 255, 0, 255, 0 @08AD29B4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_245, 255, 0, 255, 0 @08AD29C0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_246, 255, 0, 255, 0 @08AD29CC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_247, 255, 0, 255, 0 @08AD29D8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_248, 255, 0, 255, 0 @08AD29E4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_249, 255, 0, 255, 0 @08AD29F0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_250, 255, 0, 255, 0 @08AD29FC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_251, 255, 0, 255, 0 @08AD2A08 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_252, 255, 0, 255, 0 @08AD2A14 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_253, 255, 0, 255, 0 @08AD2A20 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_254, 255, 0, 255, 0 @08AD2A2C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_255, 255, 0, 255, 0 @08AD2A38 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_256, 255, 0, 255, 0 @08AD2A44 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_257, 255, 0, 255, 0 @08AD2A50 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_258, 255, 0, 255, 0 @08AD2A5C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_259, 255, 0, 255, 0 @08AD2A68 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_260, 255, 0, 255, 0 @08AD2A74 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_261, 255, 0, 255, 0 @08AD2A80 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_262, 255, 0, 255, 0 @08AD2A8C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_263, 255, 0, 255, 0 @08AD2A98 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_264, 255, 0, 255, 0 @08AD2AA4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_265, 255, 0, 255, 0 @08AD2AB0 diff --git a/sound/voicegroups/voicegroup019.inc b/sound/voicegroups/voicegroup019.inc index d197f870a..fe8eb8036 100644 --- a/sound/voicegroups/voicegroup019.inc +++ b/sound/voicegroups/voicegroup019.inc @@ -1,131 +1,259 @@ mAlignWord .global voicegroup019 voicegroup019: @ 0x08AD2ABC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_266, 255, 0, 255, 0 @08AD2ABC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_267, 255, 0, 255, 0 @08AD2AC8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_268, 255, 0, 255, 0 @08AD2AD4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_269, 255, 0, 255, 0 @08AD2AE0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_270, 255, 0, 255, 0 @08AD2AEC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_271, 255, 0, 255, 0 @08AD2AF8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_272, 255, 0, 255, 0 @08AD2B04 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_273, 255, 0, 255, 0 @08AD2B10 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_274, 255, 0, 255, 0 @08AD2B1C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_275, 255, 0, 255, 0 @08AD2B28 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_276, 255, 0, 255, 0 @08AD2B34 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_277, 255, 0, 255, 0 @08AD2B40 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_278, 255, 0, 255, 0 @08AD2B4C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_279, 255, 0, 255, 0 @08AD2B58 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_280, 255, 0, 255, 0 @08AD2B64 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_281, 255, 0, 255, 0 @08AD2B70 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_282, 255, 0, 255, 0 @08AD2B7C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_283, 255, 0, 255, 0 @08AD2B88 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_284, 255, 0, 255, 0 @08AD2B94 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_285, 255, 0, 255, 0 @08AD2BA0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_286, 255, 0, 255, 0 @08AD2BAC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_287, 255, 0, 255, 0 @08AD2BB8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_288, 255, 0, 255, 0 @08AD2BC4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_289, 255, 0, 255, 0 @08AD2BD0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_290, 255, 0, 255, 0 @08AD2BDC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_291, 255, 0, 255, 0 @08AD2BE8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_292, 255, 0, 255, 0 @08AD2BF4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_293, 255, 0, 255, 0 @08AD2C00 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_294, 255, 0, 255, 0 @08AD2C0C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_295, 255, 0, 255, 0 @08AD2C18 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_296, 255, 0, 255, 0 @08AD2C24 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_297, 255, 0, 255, 0 @08AD2C30 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_298, 255, 0, 255, 0 @08AD2C3C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_299, 255, 0, 255, 0 @08AD2C48 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_300, 255, 0, 255, 0 @08AD2C54 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_301, 255, 0, 255, 0 @08AD2C60 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_302, 255, 0, 255, 0 @08AD2C6C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_303, 255, 0, 255, 0 @08AD2C78 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_304, 255, 0, 255, 0 @08AD2C84 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_305, 255, 0, 255, 0 @08AD2C90 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_306, 255, 0, 255, 0 @08AD2C9C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_307, 255, 0, 255, 0 @08AD2CA8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_308, 255, 0, 255, 0 @08AD2CB4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_309, 255, 0, 255, 0 @08AD2CC0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_310, 255, 0, 255, 0 @08AD2CCC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_311, 255, 0, 255, 0 @08AD2CD8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_312, 255, 0, 255, 0 @08AD2CE4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_313, 255, 0, 255, 0 @08AD2CF0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_314, 255, 0, 255, 0 @08AD2CFC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_315, 255, 0, 255, 0 @08AD2D08 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_316, 255, 0, 255, 0 @08AD2D14 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_317, 255, 0, 255, 0 @08AD2D20 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_318, 255, 0, 255, 0 @08AD2D2C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_319, 255, 0, 255, 0 @08AD2D38 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_320, 255, 0, 255, 0 @08AD2D44 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_321, 255, 0, 255, 0 @08AD2D50 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_322, 255, 0, 255, 0 @08AD2D5C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_323, 255, 0, 255, 0 @08AD2D68 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_324, 255, 0, 255, 0 @08AD2D74 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_325, 255, 0, 255, 0 @08AD2D80 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_326, 255, 0, 255, 0 @08AD2D8C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_327, 255, 0, 255, 0 @08AD2D98 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_328, 255, 0, 255, 0 @08AD2DA4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_329, 255, 0, 255, 0 @08AD2DB0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_330, 255, 0, 255, 0 @08AD2DBC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_331, 255, 0, 255, 0 @08AD2DC8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_332, 255, 0, 255, 0 @08AD2DD4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_333, 255, 0, 255, 0 @08AD2DE0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_334, 255, 0, 255, 0 @08AD2DEC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_335, 255, 0, 255, 0 @08AD2DF8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_336, 255, 0, 255, 0 @08AD2E04 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_337, 255, 0, 255, 0 @08AD2E10 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_338, 255, 0, 255, 0 @08AD2E1C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_339, 255, 0, 255, 0 @08AD2E28 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_340, 255, 0, 255, 0 @08AD2E34 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_341, 255, 0, 255, 0 @08AD2E40 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_342, 255, 0, 255, 0 @08AD2E4C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_343, 255, 0, 255, 0 @08AD2E58 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_344, 255, 0, 255, 0 @08AD2E64 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_345, 255, 0, 255, 0 @08AD2E70 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_346, 255, 0, 255, 0 @08AD2E7C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_347, 255, 0, 255, 0 @08AD2E88 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_348, 255, 0, 255, 0 @08AD2E94 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_349, 255, 0, 255, 0 @08AD2EA0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_350, 255, 0, 255, 0 @08AD2EAC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_351, 255, 0, 255, 0 @08AD2EB8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_352, 255, 0, 255, 0 @08AD2EC4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_353, 255, 0, 255, 0 @08AD2ED0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_354, 255, 0, 255, 0 @08AD2EDC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2EE8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2EF4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2F00 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2F0C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2F18 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2F24 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2F30 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2F3C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2F48 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD2F54 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_169, 255, 0, 255, 0 @08AD2F60 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_170, 255, 0, 255, 0 @08AD2F6C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_171, 255, 0, 255, 0 @08AD2F78 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_172, 255, 0, 255, 0 @08AD2F84 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_173, 255, 0, 255, 0 @08AD2F90 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_174, 255, 0, 255, 0 @08AD2F9C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_175, 255, 0, 255, 0 @08AD2FA8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_176, 255, 0, 255, 0 @08AD2FB4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_177, 255, 0, 255, 0 @08AD2FC0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_178, 255, 0, 255, 0 @08AD2FCC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_179, 255, 0, 255, 0 @08AD2FD8 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_180, 255, 0, 255, 0 @08AD2FE4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_181, 255, 0, 255, 0 @08AD2FF0 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_182, 255, 0, 255, 0 @08AD2FFC +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_183, 255, 0, 255, 0 @08AD3008 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_184, 255, 0, 255, 0 @08AD3014 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_185, 255, 0, 255, 0 @08AD3020 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_186, 255, 0, 255, 0 @08AD302C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_187, 255, 0, 255, 0 @08AD3038 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_188, 255, 0, 255, 0 @08AD3044 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_189, 255, 0, 255, 0 @08AD3050 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_190, 255, 0, 255, 0 @08AD305C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_191, 255, 0, 255, 0 @08AD3068 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_192, 255, 0, 255, 0 @08AD3074 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_193, 255, 0, 255, 0 @08AD3080 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_194, 255, 0, 255, 0 @08AD308C +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_195, 255, 0, 255, 0 @08AD3098 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_196, 255, 0, 255, 0 @08AD30A4 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_197, 255, 0, 255, 0 @08AD30B0 diff --git a/sound/voicegroups/voicegroup020.inc b/sound/voicegroups/voicegroup020.inc index d5275151c..a8a36e894 100644 --- a/sound/voicegroups/voicegroup020.inc +++ b/sound/voicegroups/voicegroup020.inc @@ -1,131 +1,259 @@ mAlignWord .global voicegroup020 voicegroup020: @ 0x08AD30BC +mAlignWord voice_square_1_alt 0, 0, 0, 0, 15, 0 @08AD30BC +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @08AD30C8 +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08AD30D4 +mAlignWord voice_square_1_alt 0, 3, 0, 0, 15, 0 @08AD30E0 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 0 @08AD30EC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD30F8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3104 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3110 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD311C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3128 +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08AD3134 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08AD3140 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD314C +mAlignWord voice_square_2_alt 3, 0, 0, 15, 0 @08AD3158 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08AD3164 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3170 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD317C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3188 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3194 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD31A0 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08AD31AC +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 2 @08AD31B8 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 2 @08AD31C4 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 2 @08AD31D0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD31DC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD31E8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD31F4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3200 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD320C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3218 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3224 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3230 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD323C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3248 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3254 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3260 +mAlignWord voice_square_1_alt 0, 1, 1, 0, 15, 0 @08AD326C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3278 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3284 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3290 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 4, 4, 0 @08AD329C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_3, 0, 0, 15, 0 @08AD32A8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_4, 0, 0, 15, 0 @08AD32B4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_5, 0, 0, 15, 0 @08AD32C0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08AD32CC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08AD32D8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08AD32E4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08AD32F0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08AD32FC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 4, 3, 0 @08AD3308 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08AD3314 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08AD3320 +mAlignWord voice_square_1_alt 0, 2, 0, 3, 0, 0 @08AD332C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 0, 15, 0 @08AD3338 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08AD3344 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 0, 15, 0 @08AD3350 +mAlignWord voice_square_1_alt 0, 0, 0, 0, 15, 5 @08AD335C +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 0 @08AD3368 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08AD3374 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08AD3380 +mAlignWord voice_square_1_alt 0, 0, 0, 4, 0, 0 @08AD338C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 4, 0, 0 @08AD3398 +mAlignWord voice_square_2_alt 0, 0, 4, 4, 0 @08AD33A4 +mAlignWord voice_square_1_alt 0, 1, 0, 3, 0, 0 @08AD33B0 +mAlignWord voice_square_1_alt 0, 1, 0, 2, 0, 0 @08AD33BC +mAlignWord voice_square_1_alt 0, 3, 0, 1, 0, 1 @08AD33C8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08AD33D4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08AD33E0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08AD33EC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08AD33F8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_1, 255, 0, 255, 0 @08AD3404 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_2, 255, 0, 255, 0 @08AD3410 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_3, 255, 0, 255, 0 @08AD341C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_4, 255, 0, 255, 0 @08AD3428 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD3434 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_6, 255, 0, 255, 127 @08AD3440 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_7, 255, 0, 255, 0 @08AD344C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_8, 255, 235, 38, 165 @08AD3458 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_9, 255, 0, 255, 127 @08AD3464 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_10, 255, 0, 255, 0 @08AD3470 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08AD347C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_12, 255, 0, 255, 127 @08AD3488 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_13, 255, 0, 255, 127 @08AD3494 +mAlignWord voice_keysplit voicegroup002, KeySplitTable1 @08AD34A0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_14, 255, 246, 64, 149 @08AD34AC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_15, 255, 0, 255, 127 @08AD34B8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_16, 255, 0, 255, 127 @08AD34C4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_17, 255, 0, 255, 127 @08AD34D0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_18, 255, 0, 255, 127 @08AD34DC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08AD34E8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_19, 255, 0, 255, 127 @08AD34F4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_20, 255, 231, 0, 188 @08AD3500 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_21, 255, 0, 255, 0 @08AD350C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_22, 255, 0, 255, 149 @08AD3518 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_23, 255, 235, 25, 165 @08AD3524 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_24, 255, 0, 255, 149 @08AD3530 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_25, 255, 0, 255, 0 @08AD353C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 37, 0, 255, 165 @08AD3548 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 255, 0, 255, 165 @08AD3554 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_27, 255, 252, 0, 149 @08AD3560 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_355, 255, 0, 255, 0 @08AD356C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_356, 255, 0, 255, 0 @08AD3578 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_357, 255, 0, 255, 0 @08AD3584 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_358, 255, 0, 255, 0 @08AD3590 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_359, 255, 0, 255, 0 @08AD359C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_360, 255, 0, 255, 0 @08AD35A8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_361, 255, 0, 255, 0 @08AD35B4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_24, 255, 0, 255, 149 @08AD35C0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_114, 255, 249, 90, 165 @08AD35CC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 19, 0, 255, 165 @08AD35D8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_26, 255, 0, 255, 165 @08AD35E4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_95, 255, 0, 255, 127 @08AD35F0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_96, 255, 0, 255, 127 @08AD35FC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_106, 255, 0, 255, 127 @08AD3608 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3614 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3620 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_28, 255, 0, 255, 0 @08AD362C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_29, 255, 250, 18, 250 @08AD3638 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_30, 255, 216, 25, 0 @08AD3644 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_31, 37, 0, 255, 149 @08AD3650 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_32, 255, 0, 255, 0 @08AD365C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_33, 255, 0, 255, 0 @08AD3668 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_34, 255, 0, 255, 149 @08AD3674 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 5, 1, 0 @08AD3680 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_35, 255, 216, 25, 0 @08AD368C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 4, 4, 0 @08AD3698 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD36A4 +mAlignWord voice_keysplit_all voicegroup001 @08AD36B0 diff --git a/sound/voicegroups/voicegroup021.inc b/sound/voicegroups/voicegroup021.inc index 05af80f8d..f23b9abb1 100644 --- a/sound/voicegroups/voicegroup021.inc +++ b/sound/voicegroups/voicegroup021.inc @@ -1,131 +1,259 @@ mAlignWord .global voicegroup021 voicegroup021: @ 0x08AD36BC +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08AD36BC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08AD36C8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD36D4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08AD36E0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_17, 255, 0, 255, 127 @08AD36EC +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @08AD36F8 +mAlignWord voice_square_1_alt 0, 3, 0, 6, 1, 0 @08AD3704 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_94, 255, 0, 255, 127 @08AD3710 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_95, 255, 0, 255, 0 @08AD371C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_96, 255, 0, 255, 0 @08AD3728 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_97, 255, 235, 25, 165 @08AD3734 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 4, 3, 0 @08AD3740 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_24, 255, 0, 255, 149 @08AD374C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3758 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3764 +mAlignWord voice_noise_alt 60, 0, 0, 0, 2, 6, 1, 0 @08AD3770 +mAlignWord voice_noise_alt 60, 0, 0, 1, 0, 0, 15, 0 @08AD377C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3788 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3794 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD37A0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD37AC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD37B8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD37C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD37D0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD37DC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD37E8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD37F4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3800 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD380C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3818 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3824 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3830 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD383C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3848 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3854 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3860 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD386C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3878 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3884 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3890 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD389C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD38A8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD38B4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD38C0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD38CC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD38D8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD38E4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD38F0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD38FC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3908 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3914 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3920 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD392C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3938 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3944 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3950 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD395C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3968 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3974 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3980 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD398C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3998 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD39A4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD39B0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD39BC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD39C8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD39D4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD39E0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD39EC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD39F8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A04 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A10 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A1C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A28 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A34 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A40 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A4C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A58 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A64 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A70 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A7C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A88 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3A94 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3AA0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3AAC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3AB8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3AC4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3AD0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3ADC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3AE8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3AF4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B00 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B0C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B18 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B24 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B30 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B3C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B48 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B54 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B60 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B6C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B78 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B84 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B90 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3B9C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3BA8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3BB4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3BC0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3BCC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3BD8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3BE4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3BF0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3BFC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C08 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C14 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C20 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C2C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C38 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C44 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C50 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C5C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C68 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C74 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C80 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C8C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3C98 +mAlignWord voice_keysplit_all voicegroup004 @08AD3CA4 +mAlignWord voice_keysplit_all voicegroup012 @08AD3CB0 diff --git a/sound/voicegroups/voicegroup022.inc b/sound/voicegroups/voicegroup022.inc index fc4ae5a11..37146d53e 100644 --- a/sound/voicegroups/voicegroup022.inc +++ b/sound/voicegroups/voicegroup022.inc @@ -2,130 +2,257 @@ .global voicegroup022 voicegroup022: @ 0x08AD3CBC voice_square_1_alt 0, 0, 0, 0, 15, 0 @08AD3CBC +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @08AD3CC8 +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08AD3CD4 +mAlignWord voice_square_1_alt 0, 3, 0, 0, 15, 0 @08AD3CE0 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 0 @08AD3CEC +mAlignWord voice_square_1_alt 0, 3, 2, 4, 1, 3 @08AD3CF8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3D04 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3D10 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3D1C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3D28 +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08AD3D34 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08AD3D40 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD3D4C +mAlignWord voice_square_2_alt 3, 0, 0, 15, 0 @08AD3D58 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08AD3D64 +mAlignWord voice_square_2_alt 1, 2, 4, 1, 3 @08AD3D70 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3D7C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3D88 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3D94 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3DA0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3DAC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3DB8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3DC4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3DD0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3DDC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3DE8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3DF4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E00 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E0C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E18 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E24 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E30 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E3C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E48 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E54 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E60 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E6C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E78 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E84 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3E90 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 4, 4, 0 @08AD3E9C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_3, 0, 0, 15, 0 @08AD3EA8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_4, 0, 0, 15, 0 @08AD3EB4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_5, 0, 0, 15, 0 @08AD3EC0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08AD3ECC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08AD3ED8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08AD3EE4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08AD3EF0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08AD3EFC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD3F08 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08AD3F14 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08AD3F20 +mAlignWord voice_square_1_alt 0, 2, 0, 3, 0, 0 @08AD3F2C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 0, 15, 0 @08AD3F38 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08AD3F44 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 0, 15, 0 @08AD3F50 +mAlignWord voice_square_1_alt 0, 0, 0, 0, 15, 5 @08AD3F5C +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 0 @08AD3F68 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08AD3F74 +mAlignWord voice_noise 60, 0, 0, 0, 0, 2, 0, 3 @08AD3F80 +mAlignWord voice_square_1_alt 0, 0, 0, 4, 0, 0 @08AD3F8C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 4, 0, 0 @08AD3F98 +mAlignWord voice_square_2_alt 0, 0, 4, 4, 0 @08AD3FA4 +mAlignWord voice_square_1_alt 0, 1, 0, 3, 0, 0 @08AD3FB0 +mAlignWord voice_square_1_alt 0, 1, 0, 2, 0, 0 @08AD3FBC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08AD3FC8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08AD3FD4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08AD3FE0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08AD3FEC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 3, 7, 2 @08AD3FF8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_1, 255, 0, 255, 0 @08AD4004 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4010 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_362, 255, 0, 255, 0 @08AD401C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_363, 255, 0, 255, 0 @08AD4028 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_5, 255, 0, 255, 127 @08AD4034 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_6, 255, 0, 255, 127 @08AD4040 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_7, 255, 0, 255, 0 @08AD404C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_8, 255, 235, 38, 165 @08AD4058 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_9, 255, 0, 255, 127 @08AD4064 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_10, 255, 0, 255, 0 @08AD4070 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_11, 255, 0, 255, 0 @08AD407C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4088 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4094 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_364, 255, 0, 255, 127 @08AD40A0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD40AC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_15, 255, 0, 255, 127 @08AD40B8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_16, 255, 0, 255, 127 @08AD40C4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_17, 255, 0, 255, 127 @08AD40D0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_18, 255, 0, 255, 127 @08AD40DC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_365, 255, 0, 255, 149 @08AD40E8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD40F4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4100 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_21, 255, 0, 255, 0 @08AD410C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_22, 255, 0, 255, 149 @08AD4118 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_23, 255, 235, 25, 165 @08AD4124 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4130 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_25, 255, 0, 255, 0 @08AD413C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4148 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4154 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4160 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_355, 255, 0, 255, 0 @08AD416C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_356, 255, 0, 255, 0 @08AD4178 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_357, 255, 0, 255, 0 @08AD4184 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_358, 255, 0, 255, 0 @08AD4190 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_359, 255, 0, 255, 0 @08AD419C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD41A8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_361, 255, 0, 255, 0 @08AD41B4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_366, 255, 0, 255, 0 @08AD41C0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_367, 255, 0, 255, 0 @08AD41CC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD41D8 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_368, 255, 0, 255, 0 @08AD41E4 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_369, 255, 0, 255, 0 @08AD41F0 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_370, 255, 0, 255, 188 @08AD41FC +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_371, 255, 0, 255, 188 @08AD4208 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_372, 255, 0, 255, 188 @08AD4214 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_373, 255, 0, 255, 196 @08AD4220 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_374, 255, 0, 255, 0 @08AD422C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_100, 255, 0, 255, 0 @08AD4238 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_375, 255, 0, 255, 0 @08AD4244 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4250 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_376, 255, 0, 255, 188 @08AD425C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4268 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4274 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_370, 255, 235, 25, 204 @08AD4280 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_371, 255, 235, 25, 204 @08AD428C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_372, 255, 235, 25, 204 @08AD4298 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_374, 255, 235, 25, 204 @08AD42A4 +mAlignWord voice_keysplit_all voicegroup001 @08AD42B0 diff --git a/sound/voicegroups/voicegroup023.inc b/sound/voicegroups/voicegroup023.inc index 8ab279035..6d558fef2 100644 --- a/sound/voicegroups/voicegroup023.inc +++ b/sound/voicegroups/voicegroup023.inc @@ -1,95 +1,187 @@ mAlignWord .global voicegroup023 voicegroup023: @ 0x08AD42BC +mAlignWord voice_square_1_alt 0, 0, 0, 0, 15, 0 @08AD42BC +mAlignWord voice_square_1_alt 0, 1, 0, 0, 15, 0 @08AD42C8 +mAlignWord voice_square_1_alt 0, 2, 0, 0, 15, 0 @08AD42D4 +mAlignWord voice_square_1_alt 0, 3, 0, 0, 15, 0 @08AD42E0 +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 0 @08AD42EC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD42F8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4304 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4310 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD431C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4328 +mAlignWord voice_square_2_alt 0, 0, 0, 15, 0 @08AD4334 +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08AD4340 +mAlignWord voice_square_2_alt 2, 0, 0, 15, 0 @08AD434C +mAlignWord voice_square_2_alt 3, 0, 0, 15, 0 @08AD4358 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 0 @08AD4364 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4370 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD437C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4388 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4394 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD43A0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD43AC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD43B8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD43C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD43D0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD43DC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD43E8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD43F4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4400 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD440C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4418 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4424 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4430 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD443C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4448 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4454 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4460 +mAlignWord voice_square_1_alt 0, 1, 1, 0, 15, 0 @08AD446C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4478 +mAlignWord voice_square_2_alt 1, 0, 2, 0, 0 @08AD4484 +mAlignWord voice_square_2_alt 2, 2, 0, 15, 1 @08AD4490 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 4, 4, 0 @08AD449C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_3, 0, 0, 15, 0 @08AD44A8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_4, 0, 0, 15, 0 @08AD44B4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_5, 0, 0, 15, 0 @08AD44C0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08AD44CC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08AD44D8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08AD44E4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08AD44F0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08AD44FC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4508 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08AD4514 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08AD4520 +mAlignWord voice_square_2_alt 2, 0, 3, 0, 0 @08AD452C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 0, 15, 0 @08AD4538 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 3, 0, 2 @08AD4544 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_2, 0, 0, 15, 0 @08AD4550 +mAlignWord voice_square_1_alt 0, 0, 0, 0, 15, 5 @08AD455C +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 0 @08AD4568 +mAlignWord voice_noise 60, 0, 0, 1, 0, 0, 15, 0 @08AD4574 +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08AD4580 +mAlignWord voice_square_2_alt 0, 0, 4, 0, 0 @08AD458C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_10, 0, 4, 0, 0 @08AD4598 +mAlignWord voice_square_2_alt 0, 0, 4, 4, 0 @08AD45A4 +mAlignWord voice_square_1_alt 0, 1, 0, 3, 0, 0 @08AD45B0 +mAlignWord voice_square_1_alt 0, 1, 0, 2, 0, 0 @08AD45BC +mAlignWord voice_square_1_alt 0, 3, 0, 1, 0, 1 @08AD45C8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 0, 15, 0 @08AD45D4 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 0, 0, 15, 0 @08AD45E0 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_8, 0, 0, 15, 0 @08AD45EC +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 0, 0, 15, 0 @08AD45F8 +mAlignWord voice_noise 60, 0, 0, 0, 1, 0, 15, 2 @08AD4604 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4610 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD461C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4628 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4634 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4640 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD464C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4658 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4664 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4670 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD467C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 5, 1, 0 @08AD4688 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4694 +mAlignWord voice_square_1_alt 0, 2, 0, 6, 0, 0 @08AD46A0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD46AC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD46B8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD46C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD46D0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD46DC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD46E8 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_6, 0, 4, 3, 0 @08AD46F4 +mAlignWord voice_square_1_alt 0, 3, 0, 6, 1, 0 @08AD4700 diff --git a/sound/voicegroups/voicegroup024.inc b/sound/voicegroups/voicegroup024.inc index 295856504..1e29f9816 100644 --- a/sound/voicegroups/voicegroup024.inc +++ b/sound/voicegroups/voicegroup024.inc @@ -1,154 +1,305 @@ mAlignWord .global voicegroup024 voicegroup024: @ 0x08AD470C +mAlignWord voice_square_1_alt 0, 2, 2, 0, 15, 2 @08AD470C +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_7, 2, 0, 15, 2 @08AD4718 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_3, 0, 4, 3, 0 @08AD4724 +mAlignWord voice_square_1_alt 0, 2, 0, 6, 0, 0 @08AD4730 +mAlignWord voice_programmable_wave_alt ProgrammableWaveData_9, 3, 6, 4, 2 @08AD473C +mAlignWord voice_square_1_alt 0, 2, 0, 6, 1, 0 @08AD4748 +mAlignWord voice_square_1_alt 0, 2, 0, 6, 1, 0 @08AD4754 +mAlignWord voice_square_2_alt 2, 0, 6, 0, 0 @08AD4760 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_377, 255, 0, 255, 127 @08AD476C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_378, 255, 0, 255, 127 @08AD4778 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_379, 255, 0, 255, 127 @08AD4784 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_377, 255, 249, 77, 127 @08AD4790 +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_378, 255, 249, 77, 127 @08AD479C +mAlignWord voice_directsound 60, 0, DirectSoundWaveData_379, 255, 249, 77, 127 @08AD47A8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD47B4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD47C0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD47CC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD47D8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD47E4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD47F0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD47FC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4808 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4814 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4820 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD482C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4838 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4844 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4850 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD485C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4868 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4874 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4880 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD488C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4898 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD48A4 +mAlignWord voice_keysplit_all voicegroup024 @08AD48B0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD48BC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD48C8 +mAlignWord voice_noise 84, 0, 192, 0, 0, 1, 0, 0 @08AD48D4 +mAlignWord voice_noise 84, 0, 192, 0, 0, 2, 0, 0 @08AD48E0 +mAlignWord voice_noise 84, 0, 192, 0, 0, 3, 7, 0 @08AD48EC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD48F8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4904 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4910 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD491C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4928 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4934 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4940 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD494C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4958 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4964 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_44, 255, 0, 255, 0 @08AD4970 +mAlignWord voice_directsound_no_resample 60, 0, DirectSoundWaveData_45, 255, 0, 255, 0 @08AD497C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4988 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4994 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD49A0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD49AC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD49B8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD49C4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD49D0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD49DC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD49E8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD49F4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A00 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A0C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A18 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A24 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A30 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A3C +mAlignWord voice_square_2_alt 1, 0, 0, 15, 0 @08AD4A48 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A54 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A60 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A6C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A78 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A84 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A90 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4A9C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4AA8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4AB4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4AC0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4ACC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4AD8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4AE4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4AF0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4AFC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B08 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B14 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B20 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B2C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B38 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B44 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B50 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B5C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B68 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B74 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B80 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B8C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4B98 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4BA4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4BB0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4BBC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4BC8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4BD4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4BE0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4BEC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4BF8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C04 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C10 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C1C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C28 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C34 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C40 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C4C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C58 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C64 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C70 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C7C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C88 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4C94 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4CA0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4CAC +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 2 @08AD4CB8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4CC4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4CD0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4CDC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4CE8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4CF4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D00 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D0C +mAlignWord voice_noise 60, 0, 0, 0, 0, 0, 15, 0 @08AD4D18 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D24 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D30 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D3C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D48 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D54 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D60 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D6C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D78 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D84 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D90 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4D9C +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4DA8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4DB4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4DC0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4DCC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4DD8 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4DE4 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4DF0 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4DFC +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4E08 +mAlignWord voice_square_1 0, 2, 0, 0, 15, 0 @08AD4E14 diff --git a/src/background.c b/src/background.c index 8b942b743..47a889170 100644 --- a/src/background.c +++ b/src/background.c @@ -3,7 +3,7 @@ #include "flags.h" #include "sprite.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "animation_commands.h" diff --git a/src/core.c b/src/core.c index 67f866696..6337284ec 100644 --- a/src/core.c +++ b/src/core.c @@ -1,14 +1,14 @@ #include "core.h" #include "global.h" -#include "lib/m4a.h" #include "malloc_ewram.h" +#include "malloc_vram.h" #include "multi_sio.h" #include "sprite.h" #include "task.h" -#include "lib/agb_flash.h" #include "flags.h" #include "input_recorder.h" -#include "malloc_vram.h" +#include "lib/m4a/m4a.h" +#include "lib/agb_flash/agb_flash.h" // TODO: the order of these vars has // been shuffled due to compilation losses. diff --git a/src/game/bosses/boss_1.c b/src/game/bosses/boss_1.c index 4db8ca543..9a0c35e6a 100644 --- a/src/game/bosses/boss_1.c +++ b/src/game/bosses/boss_1.c @@ -1,8 +1,10 @@ #include "core.h" +#include "flags.h" #include "sprite.h" #include "task.h" #include "malloc_vram.h" #include "trig.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/collision.h" @@ -23,12 +25,10 @@ #include "game/stage/screen_shake.h" #include "game/time_attack/results.h" -#include "lib/m4a.h" #include "constants/animations.h" #include "constants/char_states.h" #include "constants/songs.h" #include "constants/zones.h" -#include "flags.h" typedef struct { ScreenFade fade; /* 0xB4 */ diff --git a/src/game/bosses/boss_2.c b/src/game/bosses/boss_2.c index f636d5c38..44c474760 100644 --- a/src/game/bosses/boss_2.c +++ b/src/game/bosses/boss_2.c @@ -15,7 +15,7 @@ #include "game/stage/boss_results_transition.h" #include "game/cheese.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/zones.h" #include "constants/animations.h" diff --git a/src/game/bosses/boss_3.c b/src/game/bosses/boss_3.c index f1228f804..a1d0e1880 100644 --- a/src/game/bosses/boss_3.c +++ b/src/game/bosses/boss_3.c @@ -2,7 +2,7 @@ #include "flags.h" #include "trig.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/collision.h" #include "game/entity.h" #include "game/bosses/common.h" diff --git a/src/game/bosses/boss_4.c b/src/game/bosses/boss_4.c index dbca23fd4..1c9fc6eb5 100644 --- a/src/game/bosses/boss_4.c +++ b/src/game/bosses/boss_4.c @@ -3,7 +3,7 @@ #include "malloc_vram.h" #include "task.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/camera.h" #include "game/sa1_leftovers/collision.h" diff --git a/src/game/bosses/boss_5.c b/src/game/bosses/boss_5.c index 7fc4d4a28..5f8b15602 100644 --- a/src/game/bosses/boss_5.c +++ b/src/game/bosses/boss_5.c @@ -20,7 +20,7 @@ #include "game/stage/screen_fade.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/songs.h" #include "constants/zones.h" #include "constants/animations.h" diff --git a/src/game/bosses/boss_6.c b/src/game/bosses/boss_6.c index 9dc5a2994..4195074a3 100644 --- a/src/game/bosses/boss_6.c +++ b/src/game/bosses/boss_6.c @@ -3,7 +3,7 @@ #include "sprite.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/globals.h" #include "game/sa1_leftovers/collision.h" diff --git a/src/game/bosses/boss_7.c b/src/game/bosses/boss_7.c index 103e21ac7..98dc8307b 100644 --- a/src/game/bosses/boss_7.c +++ b/src/game/bosses/boss_7.c @@ -18,7 +18,7 @@ #include "game/math.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/songs.h" diff --git a/src/game/bosses/boss_8.c b/src/game/bosses/boss_8.c index 57f970139..4f3746c18 100644 --- a/src/game/bosses/boss_8.c +++ b/src/game/bosses/boss_8.c @@ -5,7 +5,7 @@ #include "trig.h" #include "bg_triangles.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/globals.h" #include "game/sa1_leftovers/camera.h" #include "game/sa1_leftovers/collision.h" diff --git a/src/game/bosses/boss_9.c b/src/game/bosses/boss_9.c index 50c8ca02a..42d009b3b 100644 --- a/src/game/bosses/boss_9.c +++ b/src/game/bosses/boss_9.c @@ -4,7 +4,7 @@ #include "sprite.h" #include "task.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/math.h" #include "game/bosses/common.h" #include "game/bosses/boss_9.h" diff --git a/src/game/bosses/eggmobile_escape_sequence.c b/src/game/bosses/eggmobile_escape_sequence.c index e5833bce3..19b793ff5 100644 --- a/src/game/bosses/eggmobile_escape_sequence.c +++ b/src/game/bosses/eggmobile_escape_sequence.c @@ -2,7 +2,7 @@ #include "malloc_vram.h" #include "sprite.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/songs.h" diff --git a/src/game/bosses/final_intro.c b/src/game/bosses/final_intro.c index c70f24c1e..88a78aa23 100644 --- a/src/game/bosses/final_intro.c +++ b/src/game/bosses/final_intro.c @@ -3,7 +3,7 @@ #include "sprite.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/globals.h" diff --git a/src/game/character_select.c b/src/game/character_select.c index a8691bbf9..b99bec3ef 100644 --- a/src/game/character_select.c +++ b/src/game/character_select.c @@ -5,7 +5,7 @@ #include "sprite.h" #include "game/character_select.h" #include "game/save.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "task.h" #include "malloc_vram.h" #include "flags.h" diff --git a/src/game/cheese.c b/src/game/cheese.c index 43f790002..7604d806f 100644 --- a/src/game/cheese.c +++ b/src/game/cheese.c @@ -7,7 +7,7 @@ #include "game/stage/camera.h" #include "game/multiplayer/mp_player.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/zones.h" #include "constants/characters.h" diff --git a/src/game/countdown.c b/src/game/countdown.c index 757d69493..cf0486996 100644 --- a/src/game/countdown.c +++ b/src/game/countdown.c @@ -9,7 +9,7 @@ #include "game/stage/player.h" #include "game/stage/camera.h" #include "game/multiplayer/mp_player.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/char_states.h" diff --git a/src/game/course_select.c b/src/game/course_select.c index d38ffbc6e..f2e1f0555 100644 --- a/src/game/course_select.c +++ b/src/game/course_select.c @@ -6,7 +6,7 @@ #include "game/save.h" #include "game/stage/stage.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/character_select.h" #include "constants/songs.h" #include "constants/text.h" diff --git a/src/game/cutscenes/credits.c b/src/game/cutscenes/credits.c index 6726e3be9..2bb0f7d37 100644 --- a/src/game/cutscenes/credits.c +++ b/src/game/cutscenes/credits.c @@ -6,7 +6,7 @@ #include "sprite.h" #include "game/stage/screen_fade.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/save.h" #include "constants/tilemaps.h" diff --git a/src/game/cutscenes/credits_end.c b/src/game/cutscenes/credits_end.c index 812b9c73c..c17d2853f 100644 --- a/src/game/cutscenes/credits_end.c +++ b/src/game/cutscenes/credits_end.c @@ -3,7 +3,7 @@ #include "sprite.h" #include "task.h" #include "animation_commands_bg.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/cutscenes/credits.h" #include "game/cutscenes/credits_end.h" #include "game/cutscenes/missing_emeralds.h" diff --git a/src/game/cutscenes/credits_slides.c b/src/game/cutscenes/credits_slides.c index cb172a6c3..f08029e51 100644 --- a/src/game/cutscenes/credits_slides.c +++ b/src/game/cutscenes/credits_slides.c @@ -5,7 +5,7 @@ #include "sprite.h" #include "game/stage/screen_fade.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/save.h" #include "constants/animations.h" diff --git a/src/game/cutscenes/endings.c b/src/game/cutscenes/endings.c index 202a10296..acfe6be25 100644 --- a/src/game/cutscenes/endings.c +++ b/src/game/cutscenes/endings.c @@ -7,7 +7,7 @@ #include "game/cutscenes/extra_ending_fall.h" #include "game/cutscenes/final_ending_fall.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "trig.h" #include "game/save.h" diff --git a/src/game/cutscenes/extra_ending_fall.c b/src/game/cutscenes/extra_ending_fall.c index ad02f1c56..f64dc1eba 100644 --- a/src/game/cutscenes/extra_ending_fall.c +++ b/src/game/cutscenes/extra_ending_fall.c @@ -5,7 +5,7 @@ #include "sprite.h" #include "game/stage/screen_fade.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "trig.h" #include "game/save.h" #include "game/math.h" diff --git a/src/game/cutscenes/extra_ending_slides.c b/src/game/cutscenes/extra_ending_slides.c index af9d0a254..889a00500 100644 --- a/src/game/cutscenes/extra_ending_slides.c +++ b/src/game/cutscenes/extra_ending_slides.c @@ -4,7 +4,7 @@ #include "sprite.h" #include "game/stage/screen_fade.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/save.h" #include "constants/animations.h" diff --git a/src/game/cutscenes/final_ending_fall.c b/src/game/cutscenes/final_ending_fall.c index daf642704..3aa4feea2 100644 --- a/src/game/cutscenes/final_ending_fall.c +++ b/src/game/cutscenes/final_ending_fall.c @@ -5,7 +5,7 @@ #include "sprite.h" #include "game/stage/screen_fade.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/save.h" #include "game/math.h" diff --git a/src/game/cutscenes/final_ending_land.c b/src/game/cutscenes/final_ending_land.c index e1a2adb12..27050f5a7 100644 --- a/src/game/cutscenes/final_ending_land.c +++ b/src/game/cutscenes/final_ending_land.c @@ -5,7 +5,7 @@ #include "task.h" #include "game/cutscenes/credits.h" #include "game/cutscenes/missing_emeralds.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "trig.h" #include "game/save.h" #include "game/title_screen.h" diff --git a/src/game/cutscenes/level_endings.c b/src/game/cutscenes/level_endings.c index 3627dbea4..d6f830a02 100644 --- a/src/game/cutscenes/level_endings.c +++ b/src/game/cutscenes/level_endings.c @@ -5,7 +5,7 @@ #include "game/stage/screen_fade.h" #include "task.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "trig.h" #include "game/course_select.h" #include "game/save.h" diff --git a/src/game/cutscenes/missing_emeralds.c b/src/game/cutscenes/missing_emeralds.c index ea1d4accf..a0c7834f7 100644 --- a/src/game/cutscenes/missing_emeralds.c +++ b/src/game/cutscenes/missing_emeralds.c @@ -4,7 +4,7 @@ #include "game/stage/screen_fade.h" #include "sprite.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/save.h" #include "game/title_screen.h" diff --git a/src/game/decomp_credits.c b/src/game/decomp_credits.c index 1ea948e28..0a7cf76ab 100644 --- a/src/game/decomp_credits.c +++ b/src/game/decomp_credits.c @@ -3,7 +3,7 @@ #include "sprite.h" #include "task.h" #include "core.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/game.h" #include "game/save.h" #include "game/options_screen.h" diff --git a/src/game/enemies/koura.c b/src/game/enemies/koura.c index 8391aa26c..93020e327 100644 --- a/src/game/enemies/koura.c +++ b/src/game/enemies/koura.c @@ -1,6 +1,6 @@ #include "global.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/entity.h" #include "game/enemies/koura.h" diff --git a/src/game/enemies/kubinaga.c b/src/game/enemies/kubinaga.c index 0982b3e69..cccbe88d0 100644 --- a/src/game/enemies/kubinaga.c +++ b/src/game/enemies/kubinaga.c @@ -2,7 +2,7 @@ #include "malloc_vram.h" #include "sprite.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/entities_manager.h" diff --git a/src/game/enemies/yado.c b/src/game/enemies/yado.c index 46d6949ea..9465d5986 100644 --- a/src/game/enemies/yado.c +++ b/src/game/enemies/yado.c @@ -8,7 +8,7 @@ #include "game/enemies/projectiles.h" #include "game/stage/trapped_animals.h" #include "game/multiplayer/player_unk_1.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/char_states.h" diff --git a/src/game/game_over.c b/src/game/game_over.c index 041afc257..d04e0d10f 100644 --- a/src/game/game_over.c +++ b/src/game/game_over.c @@ -4,7 +4,7 @@ #include "malloc_vram.h" #include "flags.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/globals.h" diff --git a/src/game/interactables_1/booster.c b/src/game/interactables_1/booster.c index 8a140b9b3..5c034489d 100644 --- a/src/game/interactables_1/booster.c +++ b/src/game/interactables_1/booster.c @@ -2,7 +2,7 @@ #include "malloc_vram.h" #include "sprite.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/collision.h" #include "game/sa1_leftovers/entities_manager.h" diff --git a/src/game/interactables_1/bouncy_bar.c b/src/game/interactables_1/bouncy_bar.c index 1c6747063..3957f6811 100644 --- a/src/game/interactables_1/bouncy_bar.c +++ b/src/game/interactables_1/bouncy_bar.c @@ -6,7 +6,7 @@ #include "game/entity.h" #include "game/stage/player.h" #include "game/stage/camera.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/collision.h" #include "game/sa1_leftovers/entities_manager.h" diff --git a/src/game/interactables_1/checkpoint.c b/src/game/interactables_1/checkpoint.c index b62cefea2..9ac8d78ec 100644 --- a/src/game/interactables_1/checkpoint.c +++ b/src/game/interactables_1/checkpoint.c @@ -1,7 +1,7 @@ #include "global.h" #include "core.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "flags.h" #include "sprite.h" diff --git a/src/game/interactables_1/corkscrew.c b/src/game/interactables_1/corkscrew.c index 666e71219..f13a04a6a 100644 --- a/src/game/interactables_1/corkscrew.c +++ b/src/game/interactables_1/corkscrew.c @@ -1,6 +1,6 @@ #include "global.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "task.h" #include "core.h" diff --git a/src/game/interactables_1/corkscrew_3d.c b/src/game/interactables_1/corkscrew_3d.c index 7d529b50f..fd38c6050 100644 --- a/src/game/interactables_1/corkscrew_3d.c +++ b/src/game/interactables_1/corkscrew_3d.c @@ -1,6 +1,6 @@ #include "global.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/stage/player.h" #include "game/stage/camera.h" diff --git a/src/game/interactables_1/incline_ramp.c b/src/game/interactables_1/incline_ramp.c index 75adfc6f3..4cfdf21c1 100644 --- a/src/game/interactables_1/incline_ramp.c +++ b/src/game/interactables_1/incline_ramp.c @@ -1,6 +1,6 @@ #include "global.h" #include "gba/types.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/stage/player.h" #include "game/stage/camera.h" diff --git a/src/game/interactables_1/rotating_handle.c b/src/game/interactables_1/rotating_handle.c index 32199d5c6..5d0e8fee7 100644 --- a/src/game/interactables_1/rotating_handle.c +++ b/src/game/interactables_1/rotating_handle.c @@ -2,7 +2,7 @@ #include "global.h" #include "gba/types.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/entity.h" #include "game/stage/player.h" diff --git a/src/game/interactables_1/spikes.c b/src/game/interactables_1/spikes.c index 6d154b6ac..1c64617c7 100644 --- a/src/game/interactables_1/spikes.c +++ b/src/game/interactables_1/spikes.c @@ -2,7 +2,7 @@ #include "global.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "malloc_vram.h" #include "game/sa1_leftovers/collision.h" diff --git a/src/game/interactables_1/spring_bouncy.c b/src/game/interactables_1/spring_bouncy.c index c6902379f..9ba6102dc 100644 --- a/src/game/interactables_1/spring_bouncy.c +++ b/src/game/interactables_1/spring_bouncy.c @@ -1,5 +1,5 @@ #include "global.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "gba/syscall.h" #include "malloc_vram.h" diff --git a/src/game/interactables_1/stage_goal.c b/src/game/interactables_1/stage_goal.c index be6e5f580..2658ac3be 100644 --- a/src/game/interactables_1/stage_goal.c +++ b/src/game/interactables_1/stage_goal.c @@ -1,5 +1,5 @@ #include "global.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "gba/syscall.h" #include "malloc_vram.h" diff --git a/src/game/interactables_2/egg_utopia/cannon.c b/src/game/interactables_2/egg_utopia/cannon.c index 4c7235206..9d73df889 100644 --- a/src/game/interactables_2/egg_utopia/cannon.c +++ b/src/game/interactables_2/egg_utopia/cannon.c @@ -7,7 +7,7 @@ #include "game/stage/camera.h" #include "game/interactables_2/egg_utopia/cannon.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "trig.h" #include "game/math.h" diff --git a/src/game/interactables_2/egg_utopia/flying_handle.c b/src/game/interactables_2/egg_utopia/flying_handle.c index c5fcb831f..993680599 100644 --- a/src/game/interactables_2/egg_utopia/flying_handle.c +++ b/src/game/interactables_2/egg_utopia/flying_handle.c @@ -8,7 +8,7 @@ #include "game/interactables_2/egg_utopia/flying_handle.h" #include "malloc_vram.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/char_states.h" diff --git a/src/game/interactables_2/egg_utopia/launcher.c b/src/game/interactables_2/egg_utopia/launcher.c index 7996bebdf..0f1042a0e 100644 --- a/src/game/interactables_2/egg_utopia/launcher.c +++ b/src/game/interactables_2/egg_utopia/launcher.c @@ -1,6 +1,6 @@ #include "global.h" #include "gba/types.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "malloc_vram.h" diff --git a/src/game/interactables_2/egg_utopia/pole.c b/src/game/interactables_2/egg_utopia/pole.c index db1b683da..f0d2fd825 100644 --- a/src/game/interactables_2/egg_utopia/pole.c +++ b/src/game/interactables_2/egg_utopia/pole.c @@ -1,6 +1,6 @@ #include "global.h" #include "core.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/stage/player_controls.h" #include "game/entity.h" diff --git a/src/game/interactables_2/egg_utopia/speeding_platform.c b/src/game/interactables_2/egg_utopia/speeding_platform.c index f24ee20d4..c4edc0be2 100644 --- a/src/game/interactables_2/egg_utopia/speeding_platform.c +++ b/src/game/interactables_2/egg_utopia/speeding_platform.c @@ -3,7 +3,7 @@ #include "malloc_vram.h" #include "task.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/collision.h" #include "game/entity.h" diff --git a/src/game/interactables_2/hot_crater/crane.c b/src/game/interactables_2/hot_crater/crane.c index 87a7293c1..446f8ebd6 100644 --- a/src/game/interactables_2/hot_crater/crane.c +++ b/src/game/interactables_2/hot_crater/crane.c @@ -5,7 +5,7 @@ #include "task.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/entity.h" #include "game/stage/player.h" diff --git a/src/game/interactables_2/hot_crater/dash_ring.c b/src/game/interactables_2/hot_crater/dash_ring.c index f24a1d9d8..1f5576b0d 100644 --- a/src/game/interactables_2/hot_crater/dash_ring.c +++ b/src/game/interactables_2/hot_crater/dash_ring.c @@ -1,6 +1,6 @@ #include "global.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "trig.h" #include "game/stage/player.h" diff --git a/src/game/interactables_2/hot_crater/floating_spring.c b/src/game/interactables_2/hot_crater/floating_spring.c index 67db135e1..9504c5cc4 100644 --- a/src/game/interactables_2/hot_crater/floating_spring.c +++ b/src/game/interactables_2/hot_crater/floating_spring.c @@ -3,7 +3,7 @@ #include "malloc_vram.h" #include "sprite.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/entity.h" #include "game/stage/player.h" #include "game/stage/camera.h" diff --git a/src/game/interactables_2/hot_crater/hook_rail.c b/src/game/interactables_2/hot_crater/hook_rail.c index b8ebffccd..a276f2f8b 100644 --- a/src/game/interactables_2/hot_crater/hook_rail.c +++ b/src/game/interactables_2/hot_crater/hook_rail.c @@ -3,7 +3,7 @@ #include "malloc_vram.h" #include "sprite.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/entity.h" #include "game/stage/player_controls.h" diff --git a/src/game/interactables_2/ice_paradise/big_snowball.c b/src/game/interactables_2/ice_paradise/big_snowball.c index b6973995f..37b063cd7 100644 --- a/src/game/interactables_2/ice_paradise/big_snowball.c +++ b/src/game/interactables_2/ice_paradise/big_snowball.c @@ -3,7 +3,7 @@ #include "malloc_vram.h" #include "task.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" diff --git a/src/game/interactables_2/ice_paradise/funnel_sphere.c b/src/game/interactables_2/ice_paradise/funnel_sphere.c index 56f2f7a3b..f51fb7bd5 100644 --- a/src/game/interactables_2/ice_paradise/funnel_sphere.c +++ b/src/game/interactables_2/ice_paradise/funnel_sphere.c @@ -5,7 +5,7 @@ #include "malloc_vram.h" #include "task.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/entity.h" #include "game/stage/player.h" #include "game/stage/camera.h" diff --git a/src/game/interactables_2/music_plant/german_flute.c b/src/game/interactables_2/music_plant/german_flute.c index d0da57d1e..8fd3c4355 100644 --- a/src/game/interactables_2/music_plant/german_flute.c +++ b/src/game/interactables_2/music_plant/german_flute.c @@ -1,5 +1,5 @@ #include "global.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "task.h" #include "trig.h" diff --git a/src/game/interactables_2/music_plant/guitar_string.c b/src/game/interactables_2/music_plant/guitar_string.c index 1c91aab76..8c6721570 100644 --- a/src/game/interactables_2/music_plant/guitar_string.c +++ b/src/game/interactables_2/music_plant/guitar_string.c @@ -1,6 +1,6 @@ #include "global.h" #include "core.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "sprite.h" #include "game/entity.h" diff --git a/src/game/interactables_2/music_plant/keyboard.c b/src/game/interactables_2/music_plant/keyboard.c index bbfbcb7c5..d58bc15d5 100644 --- a/src/game/interactables_2/music_plant/keyboard.c +++ b/src/game/interactables_2/music_plant/keyboard.c @@ -1,5 +1,5 @@ #include "global.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "task.h" #include "trig.h" diff --git a/src/game/interactables_2/music_plant/note_block.c b/src/game/interactables_2/music_plant/note_block.c index 0b8fbf97e..450d1056f 100644 --- a/src/game/interactables_2/music_plant/note_block.c +++ b/src/game/interactables_2/music_plant/note_block.c @@ -1,5 +1,5 @@ #include "global.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "task.h" #include "trig.h" diff --git a/src/game/interactables_2/music_plant/note_sphere.c b/src/game/interactables_2/music_plant/note_sphere.c index 45f55c3b7..522589516 100644 --- a/src/game/interactables_2/music_plant/note_sphere.c +++ b/src/game/interactables_2/music_plant/note_sphere.c @@ -1,7 +1,7 @@ #include "global.h" #include "gba/syscall.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/math.h" #include "sprite.h" #include "task.h" diff --git a/src/game/interactables_2/music_plant/pipe_horn.c b/src/game/interactables_2/music_plant/pipe_horn.c index 3c307ae0c..0dca7b5fc 100644 --- a/src/game/interactables_2/music_plant/pipe_horn.c +++ b/src/game/interactables_2/music_plant/pipe_horn.c @@ -1,5 +1,5 @@ #include "global.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "trig.h" #include "sprite.h" diff --git a/src/game/interactables_2/notification_ring_bonus.c b/src/game/interactables_2/notification_ring_bonus.c index 5b4ac6207..a12f139e5 100644 --- a/src/game/interactables_2/notification_ring_bonus.c +++ b/src/game/interactables_2/notification_ring_bonus.c @@ -1,6 +1,6 @@ #include "global.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/stage/player.h" #include "game/stage/camera.h" diff --git a/src/game/interactables_2/sky_canyon/propeller.c b/src/game/interactables_2/sky_canyon/propeller.c index d1203fa83..692b036a4 100644 --- a/src/game/interactables_2/sky_canyon/propeller.c +++ b/src/game/interactables_2/sky_canyon/propeller.c @@ -3,7 +3,7 @@ #include "malloc_vram.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/entities_manager.h" diff --git a/src/game/interactables_2/sky_canyon/propeller_spring.c b/src/game/interactables_2/sky_canyon/propeller_spring.c index b7b661ca0..dd6df303e 100644 --- a/src/game/interactables_2/sky_canyon/propeller_spring.c +++ b/src/game/interactables_2/sky_canyon/propeller_spring.c @@ -1,7 +1,7 @@ #include "global.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/entities_manager.h" diff --git a/src/game/interactables_2/sky_canyon/small_windmill.c b/src/game/interactables_2/sky_canyon/small_windmill.c index 119d12668..50cc80f37 100644 --- a/src/game/interactables_2/sky_canyon/small_windmill.c +++ b/src/game/interactables_2/sky_canyon/small_windmill.c @@ -8,7 +8,7 @@ #include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/sky_canyon/small_windmill.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/char_states.h" diff --git a/src/game/interactables_2/sky_canyon/whirlwind.c b/src/game/interactables_2/sky_canyon/whirlwind.c index 0a15ae0e1..1c1439359 100644 --- a/src/game/interactables_2/sky_canyon/whirlwind.c +++ b/src/game/interactables_2/sky_canyon/whirlwind.c @@ -3,7 +3,7 @@ #include "game/math.h" #include "core.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/techno_base/light_globe.h" diff --git a/src/game/interactables_2/special_ring.c b/src/game/interactables_2/special_ring.c index a380d822b..61a049771 100644 --- a/src/game/interactables_2/special_ring.c +++ b/src/game/interactables_2/special_ring.c @@ -1,6 +1,6 @@ #include "global.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/player_callbacks.h" #include "game/stage/player.h" diff --git a/src/game/interactables_2/techno_base/arrow_platform.c b/src/game/interactables_2/techno_base/arrow_platform.c index ef700bf41..2698fd2e5 100644 --- a/src/game/interactables_2/techno_base/arrow_platform.c +++ b/src/game/interactables_2/techno_base/arrow_platform.c @@ -3,7 +3,7 @@ #include "malloc_vram.h" #include "task.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/collision.h" #include "game/entity.h" #include "game/stage/player.h" diff --git a/src/game/interactables_2/techno_base/bounce_block.c b/src/game/interactables_2/techno_base/bounce_block.c index bd030e187..205c49bba 100644 --- a/src/game/interactables_2/techno_base/bounce_block.c +++ b/src/game/interactables_2/techno_base/bounce_block.c @@ -3,7 +3,7 @@ #include "trig.h" #include "game/stage/player.h" #include "game/stage/camera.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/char_states.h" diff --git a/src/game/interactables_2/techno_base/light_bridge.c b/src/game/interactables_2/techno_base/light_bridge.c index 00ebe8953..8d94afd3d 100644 --- a/src/game/interactables_2/techno_base/light_bridge.c +++ b/src/game/interactables_2/techno_base/light_bridge.c @@ -6,7 +6,7 @@ #include "sprite.h" #include "task.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/interactables.h" #include "constants/animations.h" diff --git a/src/game/interactables_2/techno_base/light_globe.c b/src/game/interactables_2/techno_base/light_globe.c index e144a404a..1714ab644 100644 --- a/src/game/interactables_2/techno_base/light_globe.c +++ b/src/game/interactables_2/techno_base/light_globe.c @@ -4,7 +4,7 @@ #include "game/entity.h" #include "core.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/interactables_2/techno_base/light_globe.h" #include "malloc_vram.h" #include "trig.h" diff --git a/src/game/interactables_2/techno_base/spike_platform.c b/src/game/interactables_2/techno_base/spike_platform.c index a90e342e6..498060a2a 100644 --- a/src/game/interactables_2/techno_base/spike_platform.c +++ b/src/game/interactables_2/techno_base/spike_platform.c @@ -3,7 +3,7 @@ #include "malloc_vram.h" #include "task.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/collision.h" diff --git a/src/game/multiboot/collect_rings/results.c b/src/game/multiboot/collect_rings/results.c index 4585010da..e36f295db 100644 --- a/src/game/multiboot/collect_rings/results.c +++ b/src/game/multiboot/collect_rings/results.c @@ -15,7 +15,7 @@ #include "game/save.h" #include "game/title_screen.h" #include "game/stage/screen_fade.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "multi_boot.h" #include "sio32_multi_load.h" diff --git a/src/game/multiboot/connection.c b/src/game/multiboot/connection.c index f08f2949b..26b282d33 100644 --- a/src/game/multiboot/connection.c +++ b/src/game/multiboot/connection.c @@ -3,7 +3,7 @@ #include "flags.h" #include "sprite.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "mb_programs.h" #include "multi_boot.h" #include "sio32_multi_load.h" diff --git a/src/game/multiplayer/communication_outcome.c b/src/game/multiplayer/communication_outcome.c index e287e5340..9fd9d78f0 100644 --- a/src/game/multiplayer/communication_outcome.c +++ b/src/game/multiplayer/communication_outcome.c @@ -5,7 +5,7 @@ #include "multi_sio.h" #include "flags.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/character_select.h" #include "game/save.h" diff --git a/src/game/multiplayer/finish.c b/src/game/multiplayer/finish.c index 836d01577..02afec136 100644 --- a/src/game/multiplayer/finish.c +++ b/src/game/multiplayer/finish.c @@ -138,7 +138,7 @@ void TaskDestructor_8019EF4(struct Task *t) #include "game/multiboot/collect_rings/results.h" #include "game/multiplayer/results.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" typedef struct { u16 unk0; diff --git a/src/game/multiplayer/mode_select.c b/src/game/multiplayer/mode_select.c index dda75c360..b93c24766 100644 --- a/src/game/multiplayer/mode_select.c +++ b/src/game/multiplayer/mode_select.c @@ -5,7 +5,7 @@ #include "multi_sio.h" #include "sprite.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/multiplayer/mode_select.h" #include "game/multiplayer/multipak_connection.h" #include "game/multiboot/connection.h" diff --git a/src/game/multiplayer/mp_player.c b/src/game/multiplayer/mp_player.c index 15ed4931e..11bb4c3a8 100644 --- a/src/game/multiplayer/mp_player.c +++ b/src/game/multiplayer/mp_player.c @@ -2,7 +2,7 @@ #include "task.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/globals.h" #include "game/sa1_leftovers/collision.h" diff --git a/src/game/multiplayer/multipak_connection.c b/src/game/multiplayer/multipak_connection.c index bd287b1a9..72399a66c 100644 --- a/src/game/multiplayer/multipak_connection.c +++ b/src/game/multiplayer/multipak_connection.c @@ -14,7 +14,7 @@ #include "game/stage/screen_fade.h" #include "game/stage/tilemap_table.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/text.h" #include "flags.h" diff --git a/src/game/multiplayer/results.c b/src/game/multiplayer/results.c index 69350ace5..75b1673e5 100644 --- a/src/game/multiplayer/results.c +++ b/src/game/multiplayer/results.c @@ -14,7 +14,7 @@ #ifdef TEAMPLAY_AVAILABLE #include "game/multiplayer/team_play.h" #endif -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/songs.h" diff --git a/src/game/multiplayer/team_play.c b/src/game/multiplayer/team_play.c index 934099442..f217a8442 100644 --- a/src/game/multiplayer/team_play.c +++ b/src/game/multiplayer/team_play.c @@ -6,7 +6,7 @@ #include "sprite.h" #include "multi_sio.h" #include "game/multiplayer/multipak_connection.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "flags.h" #include "game/course_select.h" #include "trig.h" diff --git a/src/game/multiplayer/unknown_task.c b/src/game/multiplayer/unknown_task.c index 93320692b..b71f21d26 100644 --- a/src/game/multiplayer/unknown_task.c +++ b/src/game/multiplayer/unknown_task.c @@ -10,7 +10,7 @@ #include "game/multiplayer/finish.h" #include "game/multiplayer/mp_player.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/char_states.h" #include "constants/songs.h" diff --git a/src/game/multiplayer_lobby.c b/src/game/multiplayer_lobby.c index 5a0d94a76..5b70dc38b 100644 --- a/src/game/multiplayer_lobby.c +++ b/src/game/multiplayer_lobby.c @@ -4,7 +4,7 @@ #include "task.h" #include "sprite.h" #include "game/stage/screen_fade.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/songs.h" #include "game/save.h" #include "malloc_vram.h" diff --git a/src/game/mystery_item_box.c b/src/game/mystery_item_box.c index 6a9d10b48..c6d9328d9 100644 --- a/src/game/mystery_item_box.c +++ b/src/game/mystery_item_box.c @@ -8,7 +8,7 @@ #include "game/sa1_leftovers/dust_cloud.h" #include "game/stage/player.h" #include "game/stage/camera.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/char_states.h" diff --git a/src/game/options_screen.c b/src/game/options_screen.c index 00ad6fea1..4b9b7ae56 100644 --- a/src/game/options_screen.c +++ b/src/game/options_screen.c @@ -1,7 +1,7 @@ #include "global.h" #include "core.h" #include "game/options_screen.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "task.h" #include "game/save.h" #include "malloc_ewram.h" diff --git a/src/game/player_callbacks.c b/src/game/player_callbacks.c index 7faa12e3f..d1bb72d2e 100644 --- a/src/game/player_callbacks.c +++ b/src/game/player_callbacks.c @@ -1,6 +1,6 @@ #include "global.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "malloc_vram.h" #include "game/sa1_leftovers/globals.h" diff --git a/src/game/sa1_leftovers/collect_ring_effect.c b/src/game/sa1_leftovers/collect_ring_effect.c index dba659fd3..5495b9909 100644 --- a/src/game/sa1_leftovers/collect_ring_effect.c +++ b/src/game/sa1_leftovers/collect_ring_effect.c @@ -1,6 +1,6 @@ #include "global.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/globals.h" #include "game/sa1_leftovers/collect_ring_effect.h" @@ -19,7 +19,7 @@ typedef struct { void Task_CollectRingEffect(void); -extern struct SongHeader se_ring_copy; +extern struct MP2KSongHeader se_ring_copy; void CreateCollectRingEffect(s16 x, s16 y) { diff --git a/src/game/sa1_leftovers/collision.c b/src/game/sa1_leftovers/collision.c index e16c3fb1f..d78e4541c 100644 --- a/src/game/sa1_leftovers/collision.c +++ b/src/game/sa1_leftovers/collision.c @@ -1,7 +1,7 @@ #include "global.h" #include "rect.h" #include "sprite.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/globals.h" #include "game/sa1_leftovers/collision.h" #include "game/sa1_leftovers/dust_cloud.h" diff --git a/src/game/sa1_leftovers/collision_1.c b/src/game/sa1_leftovers/collision_1.c index d85eb9ca7..d7bb13238 100644 --- a/src/game/sa1_leftovers/collision_1.c +++ b/src/game/sa1_leftovers/collision_1.c @@ -2,7 +2,7 @@ #include "rect.h" #include "sprite.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/globals.h" #include "game/sa1_leftovers/collision.h" diff --git a/src/game/sa1_leftovers/demo_manager.c b/src/game/sa1_leftovers/demo_manager.c index b4238969f..df742f9cf 100644 --- a/src/game/sa1_leftovers/demo_manager.c +++ b/src/game/sa1_leftovers/demo_manager.c @@ -4,7 +4,7 @@ #include "sprite.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/demo_manager.h" #include "game/sa1_leftovers/player.h" diff --git a/src/game/sa1_leftovers/entities_manager.c b/src/game/sa1_leftovers/entities_manager.c index 24aa69d0a..c6b155998 100644 --- a/src/game/sa1_leftovers/entities_manager.c +++ b/src/game/sa1_leftovers/entities_manager.c @@ -4,7 +4,7 @@ #include "malloc_ewram.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/camera.h" #include "game/entity.h" diff --git a/src/game/sa1_leftovers/interactables/grind_rail.c b/src/game/sa1_leftovers/interactables/grind_rail.c index 56f683fd4..2e44fdcbf 100644 --- a/src/game/sa1_leftovers/interactables/grind_rail.c +++ b/src/game/sa1_leftovers/interactables/grind_rail.c @@ -7,7 +7,7 @@ #include "game/stage/player.h" #include "game/stage/camera.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/songs.h" #include "constants/player_transitions.h" diff --git a/src/game/sa1_leftovers/interactables/pipe.c b/src/game/sa1_leftovers/interactables/pipe.c index 1cb580fad..0873dff4f 100644 --- a/src/game/sa1_leftovers/interactables/pipe.c +++ b/src/game/sa1_leftovers/interactables/pipe.c @@ -2,7 +2,7 @@ #include "gba/types.h" #include "sprite.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/entity.h" #include "game/sa1_leftovers/interactables/pipe.h" diff --git a/src/game/sa1_leftovers/interactables/platform_thin.c b/src/game/sa1_leftovers/interactables/platform_thin.c index 121493c1d..bbaa593ba 100644 --- a/src/game/sa1_leftovers/interactables/platform_thin.c +++ b/src/game/sa1_leftovers/interactables/platform_thin.c @@ -3,7 +3,7 @@ #include "sprite.h" #include "task.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/collision.h" #include "game/sa1_leftovers/interactables/platform_thin.h" diff --git a/src/game/sa1_leftovers/interactables/spring.c b/src/game/sa1_leftovers/interactables/spring.c index 8de067b75..e01ea3dd4 100644 --- a/src/game/sa1_leftovers/interactables/spring.c +++ b/src/game/sa1_leftovers/interactables/spring.c @@ -4,7 +4,7 @@ #include "sprite.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/stage/player.h" #include "game/stage/camera.h" diff --git a/src/game/sa1_leftovers/item_box.c b/src/game/sa1_leftovers/item_box.c index 7367a31e8..656c1af5c 100644 --- a/src/game/sa1_leftovers/item_box.c +++ b/src/game/sa1_leftovers/item_box.c @@ -4,7 +4,7 @@ #include "sprite.h" #include "task.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/collision.h" #include "game/sa1_leftovers/dust_cloud.h" diff --git a/src/game/sa1_leftovers/music_manager.c b/src/game/sa1_leftovers/music_manager.c index ef2fe2148..4b29c8035 100644 --- a/src/game/sa1_leftovers/music_manager.c +++ b/src/game/sa1_leftovers/music_manager.c @@ -5,7 +5,7 @@ #include "game/sa1_leftovers/player.h" #include "game/sa1_leftovers/music_manager.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/songs.h" @@ -62,7 +62,7 @@ const u16 gUnknown_080D5254[7] = { void Task_StageMusicManager(void) { - struct SongHeader *songHeader = gMPlayTable[0].info->songHeader; + struct MP2KSongHeader *songHeader = gMPlayTable[0].info->songHeader; if ((gUnknown_030054A8.unk0 == 0) && PLAYER_IS_ALIVE) { if ((gUnknown_030054A8.unk1 & 0xF0) == 0x30) { @@ -140,7 +140,7 @@ void CreateStageMusicManager(void) static void MusManager_UpdateBgmParams(void) { - struct MusicPlayerInfo *bgmInfo = &gMPlayInfo_BGM; + struct MP2KPlayerState *bgmInfo = &gMPlayInfo_BGM; m4aMPlayImmInit(bgmInfo); m4aMPlayVolumeControl(bgmInfo, 0xFF, 4); @@ -153,7 +153,7 @@ static void MusManager_UpdateBgmParams(void) void sub_800BF74(u16 fadeoutSpeed) { - struct MusicPlayerInfo *bgmInfo = &gMPlayInfo_BGM; + struct MP2KPlayerState *bgmInfo = &gMPlayInfo_BGM; m4aMPlayFadeOutTemporarily(bgmInfo, fadeoutSpeed / 16); diff --git a/src/game/sa1_leftovers/pause_menu.c b/src/game/sa1_leftovers/pause_menu.c index e97f44b2a..1be027501 100644 --- a/src/game/sa1_leftovers/pause_menu.c +++ b/src/game/sa1_leftovers/pause_menu.c @@ -1,6 +1,5 @@ #include "global.h" -#include "lib/m4a.h" -#include "gba/m4a_internal.h" +#include "lib/m4a/m4a.h" #include "core.h" #include "malloc_vram.h" diff --git a/src/game/sa1_leftovers/unused_level_select.c b/src/game/sa1_leftovers/unused_level_select.c index 1a8fa0a8e..a1c295df8 100644 --- a/src/game/sa1_leftovers/unused_level_select.c +++ b/src/game/sa1_leftovers/unused_level_select.c @@ -1,6 +1,6 @@ #include "global.h" #include "core.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "task.h" #include "game/sa1_leftovers/globals.h" diff --git a/src/game/save.c b/src/game/save.c index db9eeb128..a9b9b636b 100644 --- a/src/game/save.c +++ b/src/game/save.c @@ -1,9 +1,9 @@ #include "global.h" -#include "lib/agb_flash.h" +#include "lib/agb_flash/agb_flash.h" #include "malloc_ewram.h" #include "flags.h" #include "game/save.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/math.h" #include "constants/text.h" #include "constants/zones.h" diff --git a/src/game/sound_test.c b/src/game/sound_test.c index 4cb6f80b4..b2736f2e9 100644 --- a/src/game/sound_test.c +++ b/src/game/sound_test.c @@ -3,7 +3,7 @@ #include "core.h" #include "game/options_screen.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "flags.h" #include "trig.h" #include "game/backgrounds.h" @@ -547,7 +547,7 @@ static void SoundTestScreenRenderUI(void) Sprite *speakerConeElement = soundTestScreen->speakerCone; SpriteTransform *speakerConeEffects = soundTestScreen->speakerConeEffects; - struct SoundInfo *soundInfo; + struct SoundMixerState *soundInfo; s16 i; const u8 *E0C30; @@ -634,15 +634,15 @@ static void SoundTestScreenRenderUI(void) soundInfo = &gSoundInfo; for (i = 0; i < 8; i++) { - if (soundTestScreen->channelFreqs[i] != soundInfo->chans[i].freq) { - s32 change = soundTestScreen->channelFreqs[i] - soundInfo->chans[i].freq; + if (soundTestScreen->channelFreqs[i] != soundInfo->chans[i].data.sound.freq) { + s32 change = soundTestScreen->channelFreqs[i] - soundInfo->chans[i].data.sound.freq; if (change - soundTestScreen->freqChanges[i] > 256) { soundTestScreen->speakerSize += 32; soundTestScreen->speakerAnimFrame = 32; numChangeElements++; } soundTestScreen->freqChanges[i] = change; - soundTestScreen->channelFreqs[i] = soundInfo->chans[i].freq; + soundTestScreen->channelFreqs[i] = soundInfo->chans[i].data.sound.freq; } } diff --git a/src/game/special_stage/collectables.c b/src/game/special_stage/collectables.c index 25dfbdb07..9e6a7ae54 100644 --- a/src/game/special_stage/collectables.c +++ b/src/game/special_stage/collectables.c @@ -5,7 +5,7 @@ #include "game/special_stage/collectables.h" #include "game/special_stage/data.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "trig.h" #include "game/math.h" #include "constants/songs.h" diff --git a/src/game/special_stage/guard_robo.c b/src/game/special_stage/guard_robo.c index 8894e4be0..7ebe41789 100644 --- a/src/game/special_stage/guard_robo.c +++ b/src/game/special_stage/guard_robo.c @@ -9,7 +9,7 @@ #include "game/special_stage/tables.h" #include "game/special_stage/data.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/songs.h" void sub_80714C4(void); diff --git a/src/game/special_stage/main.c b/src/game/special_stage/main.c index 75fce0342..94094aa5e 100644 --- a/src/game/special_stage/main.c +++ b/src/game/special_stage/main.c @@ -12,7 +12,7 @@ #include "game/save.h" #include "sprite.h" #include "game/stage/screen_fade.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "task.h" #include "game/title_screen.h" #include "constants/zones.h" diff --git a/src/game/special_stage/physics.c b/src/game/special_stage/physics.c index ae8dc18d1..0ab137c2c 100644 --- a/src/game/special_stage/physics.c +++ b/src/game/special_stage/physics.c @@ -7,7 +7,7 @@ #include "game/special_stage/data.h" #include "task.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/songs.h" diff --git a/src/game/special_stage/ui.c b/src/game/special_stage/ui.c index 63fb7085c..4ba28df89 100644 --- a/src/game/special_stage/ui.c +++ b/src/game/special_stage/ui.c @@ -1,5 +1,5 @@ #include "core.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/save.h" #include "game/special_stage/main.h" #include "game/special_stage/player.h" diff --git a/src/game/special_stage/world.c b/src/game/special_stage/world.c index da81083fb..4a7f1aca3 100644 --- a/src/game/special_stage/world.c +++ b/src/game/special_stage/world.c @@ -6,7 +6,7 @@ #include "game/special_stage/guard_robo.h" #include "game/special_stage/data.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/save.h" #include "trig.h" #include "malloc_ewram.h" diff --git a/src/game/stage/boss_results_transition.c b/src/game/stage/boss_results_transition.c index c27de5609..151a885c8 100644 --- a/src/game/stage/boss_results_transition.c +++ b/src/game/stage/boss_results_transition.c @@ -2,7 +2,7 @@ #include "core.h" #include "flags.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/cheese.h" #include "game/save.h" #include "game/stage/player.h" diff --git a/src/game/stage/item_tasks.c b/src/game/stage/item_tasks.c index 963b38e9c..324918d59 100644 --- a/src/game/stage/item_tasks.c +++ b/src/game/stage/item_tasks.c @@ -2,7 +2,7 @@ #include "malloc_vram.h" #include "sprite.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/globals.h" diff --git a/src/game/stage/player.c b/src/game/stage/player.c index a13dd21fb..8e9516bd7 100644 --- a/src/game/stage/player.c +++ b/src/game/stage/player.c @@ -2,7 +2,7 @@ #include "core.h" #include "trig.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/sa1_leftovers/music_manager.h" #include "game/sa1_leftovers/input_buffer.h" @@ -4528,7 +4528,7 @@ void Player_Spindash(Player *p) } if (p->frameInput & gPlayerControls.jump) { - struct MusicPlayerInfo *mPlayerInfo; + struct MP2KPlayerState *mPlayerInfo; m4aSongNumStart(SE_SPIN_ATTACK); mPlayerInfo = gMPlayTable[gSongTable[SE_SPIN_ATTACK].ms].info; diff --git a/src/game/stage/player_super_sonic.c b/src/game/stage/player_super_sonic.c index b265e436f..408a86211 100644 --- a/src/game/stage/player_super_sonic.c +++ b/src/game/stage/player_super_sonic.c @@ -13,7 +13,7 @@ #include "game/save.h" #include "game/stage/stage.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/char_states.h" diff --git a/src/game/stage/results.c b/src/game/stage/results.c index 7e683bbcc..568daec06 100644 --- a/src/game/stage/results.c +++ b/src/game/stage/results.c @@ -3,7 +3,7 @@ #include "malloc_vram.h" #include "sprite.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/stage/player.h" #include "game/stage/stage.h" #include "game/course_select.h" diff --git a/src/game/stage/rings_scatter.c b/src/game/stage/rings_scatter.c index 8719e05e4..4b595b898 100644 --- a/src/game/stage/rings_scatter.c +++ b/src/game/stage/rings_scatter.c @@ -1,7 +1,7 @@ #include "global.h" #include "core.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "rect.h" #include "game/sa1_leftovers/globals.h" diff --git a/src/game/stage/stage.c b/src/game/stage/stage.c index ee87d7bc4..55cc8c94f 100644 --- a/src/game/stage/stage.c +++ b/src/game/stage/stage.c @@ -24,7 +24,7 @@ #include "game/multiboot/collect_rings/time_display.h" #include "game/multiplayer/mp_player.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/characters.h" diff --git a/src/game/stage/ui.c b/src/game/stage/ui.c index 60ebc2e8f..685ac9388 100644 --- a/src/game/stage/ui.c +++ b/src/game/stage/ui.c @@ -7,7 +7,7 @@ #include "game/stage/player.h" #include "game/stage/ui.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/animations.h" #include "constants/songs.h" diff --git a/src/game/time_attack/lobby.c b/src/game/time_attack/lobby.c index 00632316a..c9c854cf9 100644 --- a/src/game/time_attack/lobby.c +++ b/src/game/time_attack/lobby.c @@ -5,7 +5,7 @@ #include "game/stage/screen_fade.h" #include "game/stage/stage.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/character_select.h" #include "game/course_select.h" #include "game/options_screen.h" diff --git a/src/game/time_attack/mode_select.c b/src/game/time_attack/mode_select.c index 4b69e0884..f397aec9e 100644 --- a/src/game/time_attack/mode_select.c +++ b/src/game/time_attack/mode_select.c @@ -2,7 +2,7 @@ #include "malloc_vram.h" #include "sprite.h" #include "task.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "game/character_select.h" #include "game/stage/boss_results_transition.h" #include "game/save.h" diff --git a/src/game/time_attack/results.c b/src/game/time_attack/results.c index bdd2caf6b..b358c4838 100644 --- a/src/game/time_attack/results.c +++ b/src/game/time_attack/results.c @@ -6,7 +6,7 @@ #include "game/stage/player.h" #include "game/stage/ui.h" #include "malloc_vram.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "trig.h" #include "task.h" #include "game/stage/results.h" diff --git a/src/game/title_screen.c b/src/game/title_screen.c index 4000a615e..049480516 100644 --- a/src/game/title_screen.c +++ b/src/game/title_screen.c @@ -3,7 +3,7 @@ #include "flags.h" #include "global.h" #include "core.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "task.h" #include "sprite.h" #include "game/save.h" diff --git a/src/game/unknown_effect.c b/src/game/unknown_effect.c index 3ca2fa92a..88e20db7d 100644 --- a/src/game/unknown_effect.c +++ b/src/game/unknown_effect.c @@ -4,7 +4,7 @@ #include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "constants/songs.h" diff --git a/src/lib/agb_flash.c b/src/lib/agb_flash/agb_flash.c similarity index 98% rename from src/lib/agb_flash.c rename to src/lib/agb_flash/agb_flash.c index 101b4b5e2..ac067e5f1 100644 --- a/src/lib/agb_flash.c +++ b/src/lib/agb_flash/agb_flash.c @@ -1,6 +1,6 @@ #include "global.h" -#include "gba/flash_internal.h" -#include "lib/agb_flash.h" +#include "lib/agb_flash/flash_internal.h" +#include "lib/agb_flash/agb_flash.h" static u8 sTimerNum; static u16 sTimerCount; diff --git a/src/lib/agb_flash_512k.c b/src/lib/agb_flash/agb_flash_512k.c similarity index 97% rename from src/lib/agb_flash_512k.c rename to src/lib/agb_flash/agb_flash_512k.c index 9d57ec7f3..bad4c82ad 100644 --- a/src/lib/agb_flash_512k.c +++ b/src/lib/agb_flash/agb_flash_512k.c @@ -1,5 +1,5 @@ #include "global.h" -#include "gba/flash_internal.h" +#include "lib/agb_flash/flash_internal.h" static const char AgbLibFlash512KVersion[] = "FLASH512_V130"; const struct FlashSetupInfo *const gSetup512KInfos[] = { diff --git a/src/lib/agb_flash_le_512k.c b/src/lib/agb_flash/agb_flash_le_512k.c similarity index 99% rename from src/lib/agb_flash_le_512k.c rename to src/lib/agb_flash/agb_flash_le_512k.c index 38488599c..10ff2a6bc 100644 --- a/src/lib/agb_flash_le_512k.c +++ b/src/lib/agb_flash/agb_flash_le_512k.c @@ -1,5 +1,5 @@ #include "global.h" -#include "gba/flash_internal.h" +#include "lib/agb_flash/flash_internal.h" const u16 le512kMaxTime[] = { 10, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK, // diff --git a/src/lib/agb_flash_mx_512k.c b/src/lib/agb_flash/agb_flash_mx_512k.c similarity index 98% rename from src/lib/agb_flash_mx_512k.c rename to src/lib/agb_flash/agb_flash_mx_512k.c index 48993d1b7..e1831c5ae 100644 --- a/src/lib/agb_flash_mx_512k.c +++ b/src/lib/agb_flash/agb_flash_mx_512k.c @@ -1,5 +1,5 @@ #include "global.h" -#include "gba/flash_internal.h" +#include "lib/agb_flash/flash_internal.h" const u16 mx512kMaxTime[] = { 10, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK, // diff --git a/src/lib/m4a.c b/src/lib/m4a.c deleted file mode 100644 index ff722f24e..000000000 --- a/src/lib/m4a.c +++ /dev/null @@ -1,1380 +0,0 @@ -#include "lib/m4a.h" - -#include "global.h" - -#if !PORTABLE -__attribute__((section(".bss.code"))) char SoundMainRAM_Buffer[0x400] = {}; -#else -char SoundMainRAM_Buffer[0x400] = {}; -#endif - -EWRAM_DATA struct SoundInfo gSoundInfo = {}; -EWRAM_DATA MPlayFunc gMPlayJumpTable[36] = {}; -EWRAM_DATA struct CgbChannel gCgbChans[4] = {}; - -// For some reason these were declared in this order -EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_BGM = {}; -EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_SE1 = {}; -EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_SE2 = {}; -EWRAM_DATA u8 gMPlayMemAccArea[0x10] = {}; -EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_SE3 = {}; - -static void DummyCallback(void); - -u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust) -{ - u32 val1; - u32 val2; - u32 fineAdjustShifted = fineAdjust << 24; - - if (key > 178) { - key = 178; - fineAdjustShifted = 255 << 24; - } - val1 = gScaleTable[key]; - val1 = gFreqTable[val1 & 0xF] >> (val1 >> 4); - val2 = gScaleTable[key + 1]; - val2 = gFreqTable[val2 & 0xF] >> (val2 >> 4); - return umul3232H32(wav->freq, val1 + umul3232H32(val2 - val1, fineAdjustShifted)); -} - -static void DummyFunc(void) { } - -void MPlayContinue(struct MusicPlayerInfo *mplayInfo) -{ -#if !ENABLE_AUDIO - return; -#endif - if (mplayInfo->ident == ID_NUMBER) { - ++mplayInfo->ident; - mplayInfo->status &= ~MUSICPLAYER_STATUS_PAUSE; - mplayInfo->ident = ID_NUMBER; - } -} - -void MPlayFadeOut(struct MusicPlayerInfo *mplayInfo, u16 speed) -{ -#if !ENABLE_AUDIO - return; -#endif - if (mplayInfo->ident == ID_NUMBER) { - ++mplayInfo->ident; - mplayInfo->fadeOC = speed; - mplayInfo->fadeOI = speed; - mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT); - mplayInfo->ident = ID_NUMBER; - } -} - -void m4aSoundInit(void) -{ - s32 i; -#if !ENABLE_AUDIO - return; -#endif - CpuCopy32((void *)((intptr_t)SoundMainRAM & ~1), SoundMainRAM_Buffer, sizeof(SoundMainRAM_Buffer)); - SoundInit(&gSoundInfo); - MPlayExtender(gCgbChans); - m4aSoundMode(DEFAULT_SOUND_MODE); - for (i = 0; i < NUM_MUSIC_PLAYERS; ++i) { - struct MusicPlayerInfo *mplayInfo = gMPlayTable[i].info; - - MPlayOpen(mplayInfo, gMPlayTable[i].track, gMPlayTable[i].unk_8); - mplayInfo->unk_B = gMPlayTable[i].unk_A; - mplayInfo->memAccArea = gMPlayMemAccArea; - } -} - -void m4aSoundMain(void) { SoundMain(); } - -void m4aSongNumStart(u16 n) -{ -#if !ENABLE_AUDIO - return; -#endif - const struct MusicPlayer *mplayTable = gMPlayTable; - const struct Song *songTable = gSongTable; - const struct Song *song = &songTable[n]; - const struct MusicPlayer *mplay = &mplayTable[song->ms]; - - MPlayStart(mplay->info, song->header); -} - -void m4aSongNumStartOrChange(u16 n) -{ -#if !ENABLE_AUDIO - return; -#endif - const struct MusicPlayer *mplayTable = gMPlayTable; - const struct Song *songTable = gSongTable; - const struct Song *song = &songTable[n]; - const struct MusicPlayer *mplay = &mplayTable[song->ms]; - - if (mplay->info->songHeader != song->header) { - MPlayStart(mplay->info, song->header); - } else { - if ((mplay->info->status & MUSICPLAYER_STATUS_TRACK) == 0 || (mplay->info->status & MUSICPLAYER_STATUS_PAUSE)) { - MPlayStart(mplay->info, song->header); - } - } -} - -void m4aSongNumStartOrContinue(u16 n) -{ -#if !ENABLE_AUDIO - return; -#endif - const struct MusicPlayer *mplayTable = gMPlayTable; - const struct Song *songTable = gSongTable; - const struct Song *song = &songTable[n]; - const struct MusicPlayer *mplay = &mplayTable[song->ms]; - - if (mplay->info->songHeader != song->header) - MPlayStart(mplay->info, song->header); - else if ((mplay->info->status & MUSICPLAYER_STATUS_TRACK) == 0) - MPlayStart(mplay->info, song->header); - else if (mplay->info->status & MUSICPLAYER_STATUS_PAUSE) - MPlayContinue(mplay->info); -} - -void m4aSongNumStop(u16 n) -{ -#if !ENABLE_AUDIO - return; -#endif - const struct MusicPlayer *mplayTable = gMPlayTable; - const struct Song *songTable = gSongTable; - const struct Song *song = &songTable[n]; - const struct MusicPlayer *mplay = &mplayTable[song->ms]; - - if (mplay->info->songHeader == song->header) - MPlayStop(mplay->info); -} - -void m4aSongNumContinue(u16 n) -{ -#if !ENABLE_AUDIO - return; -#endif - const struct MusicPlayer *mplayTable = gMPlayTable; - const struct Song *songTable = gSongTable; - const struct Song *song = &songTable[n]; - const struct MusicPlayer *mplay = &mplayTable[song->ms]; - - if (mplay->info->songHeader == song->header) - MPlayContinue(mplay->info); -} - -void m4aMPlayAllStop(void) -{ - s32 i; -#if !ENABLE_AUDIO - return; -#endif - for (i = 0; i < NUM_MUSIC_PLAYERS; ++i) - MPlayStop(gMPlayTable[i].info); -} - -void m4aMPlayContinue(struct MusicPlayerInfo *mplayInfo) -{ -#if !ENABLE_AUDIO - return; -#endif - MPlayContinue(mplayInfo); -} - -void m4aMPlayAllContinue(void) -{ - s32 i; -#if !ENABLE_AUDIO - return; -#endif - for (i = 0; i < NUM_MUSIC_PLAYERS; ++i) - MPlayContinue(gMPlayTable[i].info); -} - -void m4aMPlayFadeOut(struct MusicPlayerInfo *mplayInfo, u16 speed) -{ -#if !ENABLE_AUDIO - return; -#endif - MPlayFadeOut(mplayInfo, speed); -} - -void m4aMPlayFadeOutTemporarily(struct MusicPlayerInfo *mplayInfo, u16 speed) -{ -#if !ENABLE_AUDIO - return; -#endif - if (mplayInfo->ident == ID_NUMBER) { - ++mplayInfo->ident; - mplayInfo->fadeOC = speed; - mplayInfo->fadeOI = speed; - mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT) | TEMPORARY_FADE; - mplayInfo->ident = ID_NUMBER; - } -} - -void m4aMPlayFadeIn(struct MusicPlayerInfo *mplayInfo, u16 speed) -{ -#if !ENABLE_AUDIO - return; -#endif - if (mplayInfo->ident == ID_NUMBER) { - ++mplayInfo->ident; - mplayInfo->fadeOC = speed; - mplayInfo->fadeOI = speed; - mplayInfo->fadeOV = (0 << FADE_VOL_SHIFT) | FADE_IN; - mplayInfo->status &= ~MUSICPLAYER_STATUS_PAUSE; - mplayInfo->ident = ID_NUMBER; - } -} - -void m4aMPlayImmInit(struct MusicPlayerInfo *mplayInfo) -{ -#if !ENABLE_AUDIO - return; -#endif - s32 trackCount = mplayInfo->trackCount; - struct MusicPlayerTrack *track = mplayInfo->tracks; - - while (trackCount > 0) { - if (track->flags & MPT_FLG_EXIST) { - if (track->flags & MPT_FLG_START) { - Clear64byte(track); - track->flags = MPT_FLG_EXIST; - track->bendRange = 2; - track->volX = 64; - track->lfoSpeed = 22; - track->tone.type = 1; - } - } - - --trackCount; - ++track; - } -} - -void MPlayExtender(struct CgbChannel *cgbChans) -{ - struct SoundInfo *soundInfo; - u32 ident; -#if !ENABLE_AUDIO - return; -#endif - REG_SOUNDCNT_X = SOUND_MASTER_ENABLE | SOUND_4_ON | SOUND_3_ON | SOUND_2_ON | SOUND_1_ON; - REG_SOUNDCNT_L = 0; // set master volume to zero - REG_NR12 = 0x8; - REG_NR22 = 0x8; - REG_NR42 = 0x8; - REG_NR14 = 0x80; - REG_NR24 = 0x80; - REG_NR44 = 0x80; - REG_NR30 = 0; - REG_NR50 = 0x77; - soundInfo = SOUND_INFO_PTR; - ident = soundInfo->ident; - if (ident != ID_NUMBER) - return; - ++soundInfo->ident; - gMPlayJumpTable[8] = ply_memacc; - gMPlayJumpTable[17] = ply_lfos; - gMPlayJumpTable[19] = ply_mod; - gMPlayJumpTable[28] = ply_xcmd; - gMPlayJumpTable[29] = ply_endtie; - gMPlayJumpTable[30] = SampleFreqSet; - gMPlayJumpTable[31] = TrackStop; - gMPlayJumpTable[32] = FadeOutBody; - gMPlayJumpTable[33] = TrkVolPitSet; - soundInfo->cgbChans = cgbChans; - soundInfo->CgbSound = CgbSound; - soundInfo->CgbOscOff = CgbOscOff; - soundInfo->MidiKeyToCgbFreq = MidiKeyToCgbFreq; - soundInfo->maxLines = MAX_LINES; - CpuFill32(0, cgbChans, sizeof(struct CgbChannel) * 4); - cgbChans[0].ty = 1; - cgbChans[0].panMask = 0x11; - cgbChans[1].ty = 2; - cgbChans[1].panMask = 0x22; - cgbChans[2].ty = 3; - cgbChans[2].panMask = 0x44; - cgbChans[3].ty = 4; - cgbChans[3].panMask = 0x88; - soundInfo->ident = ident; -} - -#if PLATFORM_GBA -void MusicPlayerJumpTableCopy(void) { asm("swi 0x2A"); } -#else -// TODO: Implement -void MusicPlayerJumpTableCopy(void) { } -#endif - -void ClearChain(void *x) -{ - void (*func)(void *) = *(&gMPlayJumpTable[34]); - func(x); -} - -void Clear64byte(void *x) -{ - void (*func)(void *) = *(&gMPlayJumpTable[35]); -#if PORTABLE - if (func != NULL) -#endif - func(x); -} - -void SoundInit(struct SoundInfo *soundInfo) -{ - soundInfo->ident = 0; -#if !USE_NEW_DMA - if (REG_DMA1CNT & (DMA_REPEAT << 16)) - REG_DMA1CNT = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4; - if (REG_DMA2CNT & (DMA_REPEAT << 16)) - REG_DMA2CNT = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4; - REG_DMA1CNT_H = DMA_32BIT; - REG_DMA2CNT_H = DMA_32BIT; - REG_SOUNDCNT_X = SOUND_MASTER_ENABLE | SOUND_4_ON | SOUND_3_ON | SOUND_2_ON | SOUND_1_ON; - REG_SOUNDCNT_H = SOUND_B_FIFO_RESET | SOUND_B_TIMER_0 | SOUND_B_LEFT_OUTPUT | SOUND_A_FIFO_RESET | SOUND_A_TIMER_0 - | SOUND_A_RIGHT_OUTPUT | SOUND_ALL_MIX_FULL; - REG_SOUNDBIAS_H = (REG_SOUNDBIAS_H & 0x3F) | 0x40; - REG_DMA1SAD = (intptr_t)soundInfo->pcmBuffer; - REG_DMA1DAD = (intptr_t)®_FIFO_A; - REG_DMA2SAD = (intptr_t)soundInfo->pcmBuffer + PCM_DMA_BUF_SIZE; - REG_DMA2DAD = (intptr_t)®_FIFO_B; -#endif - SOUND_INFO_PTR = soundInfo; - CpuFill32(0, soundInfo, sizeof(struct SoundInfo)); - soundInfo->maxChans = 8; - soundInfo->masterVolume = 15; - soundInfo->plynote = (uintptr_t)ply_note; - soundInfo->CgbSound = DummyCallback; - soundInfo->CgbOscOff = (void (*)(u8))DummyCallback; - soundInfo->MidiKeyToCgbFreq = (u32(*)(u8, u8, u8))DummyCallback; - soundInfo->ExtVolPit = (uintptr_t)DummyCallback; - MPlayJumpTableCopy(gMPlayJumpTable); - soundInfo->MPlayJumpTable = (uintptr_t)gMPlayJumpTable; - SampleFreqSet(SOUND_MODE_FREQ_13379); // ??? - soundInfo->ident = ID_NUMBER; -} - -void SampleFreqSet(u32 freq) -{ - struct SoundInfo *soundInfo = SOUND_INFO_PTR; - - freq = (freq & 0xF0000) >> 16; - soundInfo->freq = freq; - soundInfo->pcmSamplesPerVBlank = gPcmSamplesPerVBlankTable[freq - 1]; - soundInfo->pcmDmaPeriod = PCM_DMA_BUF_SIZE / soundInfo->pcmSamplesPerVBlank; - // LCD refresh rate 59.7275Hz - soundInfo->pcmFreq = (597275 * soundInfo->pcmSamplesPerVBlank + 5000) / 10000; - // CPU frequency 16.78Mhz - soundInfo->divFreq = (0x1000000 / soundInfo->pcmFreq + 1) >> 1; - // Turn off timer 0. - REG_TM0CNT_H = 0; - // cycles per LCD fresh 280896 - REG_TM0CNT_L = -(280896 / soundInfo->pcmSamplesPerVBlank); - m4aSoundVSyncOn(); -#if !PORTABLE - while (*(vu8 *)REG_ADDR_VCOUNT == 159) - ; - while (*(vu8 *)REG_ADDR_VCOUNT != 159) - ; -#else - REG_VCOUNT = DISPLAY_HEIGHT; -#endif - REG_TM0CNT_H = TIMER_ENABLE | TIMER_1CLK; -} - -void m4aSoundMode(u32 mode) -{ - struct SoundInfo *soundInfo = SOUND_INFO_PTR; - u32 temp; -#if !ENABLE_AUDIO - return; -#endif - if (soundInfo->ident != ID_NUMBER) - return; - ++soundInfo->ident; - temp = mode & (SOUND_MODE_REVERB_SET | SOUND_MODE_REVERB_VAL); - if (temp) - soundInfo->reverb = temp & SOUND_MODE_REVERB_VAL; - temp = mode & SOUND_MODE_MAXCHN; - if (temp) { - struct SoundChannel *chan; - - soundInfo->maxChans = temp >> SOUND_MODE_MAXCHN_SHIFT; - temp = MAX_DIRECTSOUND_CHANNELS; - chan = &soundInfo->chans[0]; - while (temp != 0) { - chan->status = 0; - --temp; - ++chan; - } - } - temp = mode & SOUND_MODE_MASVOL; - if (temp) - soundInfo->masterVolume = temp >> SOUND_MODE_MASVOL_SHIFT; - temp = mode & SOUND_MODE_DA_BIT; - if (temp) { - temp = (temp & 0x300000) >> 14; - REG_SOUNDBIAS_H = (REG_SOUNDBIAS_H & 0x3F) | temp; - } - temp = mode & SOUND_MODE_FREQ; - if (temp) { - m4aSoundVSyncOff(); - SampleFreqSet(temp); - } - soundInfo->ident = ID_NUMBER; -} - -void SoundClear(void) -{ - struct SoundInfo *soundInfo = SOUND_INFO_PTR; - s32 i; - void *chan; - - if (soundInfo->ident != ID_NUMBER) - return; - ++soundInfo->ident; - i = MAX_DIRECTSOUND_CHANNELS; - chan = &soundInfo->chans[0]; - while (i > 0) { - ((struct SoundChannel *)chan)->status = 0; - --i; - chan = (void *)((uintptr_t)chan + sizeof(struct SoundChannel)); - } - chan = soundInfo->cgbChans; - if (chan) { - i = 1; - while (i <= 4) { - soundInfo->CgbOscOff(i); - ((struct CgbChannel *)chan)->sf = 0; - ++i; - chan = (void *)((uintptr_t)chan + sizeof(struct CgbChannel)); - } - } - soundInfo->ident = ID_NUMBER; -} - -void m4aSoundVSyncOff(void) -{ -#if !ENABLE_AUDIO - return; -#endif - struct SoundInfo *soundInfo = SOUND_INFO_PTR; - - if (soundInfo->ident >= ID_NUMBER && soundInfo->ident <= ID_NUMBER + 1) { - soundInfo->ident += 10; -#if !USE_NEW_DMA - if (REG_DMA1CNT & (DMA_REPEAT << 16)) - REG_DMA1CNT = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4; - if (REG_DMA2CNT & (DMA_REPEAT << 16)) - REG_DMA2CNT = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4; - REG_DMA1CNT_H = DMA_32BIT; - REG_DMA2CNT_H = DMA_32BIT; -#endif // !USE_NEW_DMA - CpuFill32(0, soundInfo->pcmBuffer, sizeof(soundInfo->pcmBuffer)); - } -} - -void m4aSoundVSyncOn(void) -{ -#if !ENABLE_AUDIO - return; -#endif - struct SoundInfo *soundInfo = SOUND_INFO_PTR; - u32 ident = soundInfo->ident; - - if (ident == ID_NUMBER) - return; -#if !USE_NEW_DMA - REG_DMA1CNT_H = DMA_ENABLE | DMA_START_SPECIAL | DMA_32BIT | DMA_REPEAT; - REG_DMA2CNT_H = DMA_ENABLE | DMA_START_SPECIAL | DMA_32BIT | DMA_REPEAT; -#endif - soundInfo->pcmDmaCounter = 0; - soundInfo->ident = ident - 10; -} - -void MPlayOpen(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *tracks, u8 trackCount) -{ - struct SoundInfo *soundInfo; -#if !ENABLE_AUDIO - return; -#endif - if (trackCount == 0) - return; - if (trackCount > MAX_MUSICPLAYER_TRACKS) - trackCount = MAX_MUSICPLAYER_TRACKS; - soundInfo = SOUND_INFO_PTR; - if (soundInfo->ident != ID_NUMBER) - return; - ++soundInfo->ident; - Clear64byte(mplayInfo); - mplayInfo->tracks = tracks; - mplayInfo->trackCount = trackCount; - mplayInfo->status = MUSICPLAYER_STATUS_PAUSE; - while (trackCount != 0) { - tracks->flags = 0; - --trackCount; - ++tracks; - } - if (soundInfo->func != 0) { - mplayInfo->func = soundInfo->func; - mplayInfo->intp = soundInfo->intp; - soundInfo->func = 0; - } - soundInfo->intp = (uintptr_t)mplayInfo; - soundInfo->func = (uintptr_t)MPlayMain; - soundInfo->ident = ID_NUMBER; - mplayInfo->ident = ID_NUMBER; -} - -void MPlayStart(struct MusicPlayerInfo *mplayInfo, struct SongHeader *songHeader) -{ - s32 i; - u8 unk_B; - struct MusicPlayerTrack *track; -#if !ENABLE_AUDIO - return; -#endif - if (mplayInfo->ident != ID_NUMBER) - return; - unk_B = mplayInfo->unk_B; - if (!unk_B - || ((!mplayInfo->songHeader || !(mplayInfo->tracks[0].flags & MPT_FLG_START)) - && ((mplayInfo->status & MUSICPLAYER_STATUS_TRACK) == 0 || (mplayInfo->status & MUSICPLAYER_STATUS_PAUSE))) - || (mplayInfo->priority <= songHeader->priority)) { - ++mplayInfo->ident; - mplayInfo->status = 0; - mplayInfo->songHeader = songHeader; - mplayInfo->tone = songHeader->tone; - mplayInfo->priority = songHeader->priority; - mplayInfo->clock = 0; - mplayInfo->tempoD = 150; - mplayInfo->tempoI = 150; - mplayInfo->tempoU = 0x100; - mplayInfo->tempoC = 0; - mplayInfo->fadeOI = 0; - i = 0; - track = mplayInfo->tracks; - while (i < songHeader->trackCount && i < mplayInfo->trackCount) { - TrackStop(mplayInfo, track); - track->flags = MPT_FLG_EXIST | MPT_FLG_START; - track->chan = 0; - track->cmdPtr = songHeader->part[i]; - ++i; - ++track; - } - while (i < mplayInfo->trackCount) { - TrackStop(mplayInfo, track); - track->flags = 0; - ++i; - ++track; - } - if (songHeader->reverb & 0x80) - m4aSoundMode(songHeader->reverb); - mplayInfo->ident = ID_NUMBER; - } -} - -void MPlayStop(struct MusicPlayerInfo *mplayInfo) -{ - s32 i; - struct MusicPlayerTrack *track; -#if !ENABLE_AUDIO - return; -#endif - - if (mplayInfo->ident != ID_NUMBER) - return; - - ++mplayInfo->ident; - mplayInfo->status |= MUSICPLAYER_STATUS_PAUSE; - - i = mplayInfo->trackCount; - track = mplayInfo->tracks; - - while (i > 0) { - TrackStop(mplayInfo, track); - --i; - ++track; - } - - mplayInfo->ident = ID_NUMBER; -} - -void FadeOutBody(struct MusicPlayerInfo *mplayInfo) -{ - s32 i; - struct MusicPlayerTrack *track; - u16 fadeOV; - - if (mplayInfo->fadeOI == 0) - return; - if (--mplayInfo->fadeOC != 0) - return; - - mplayInfo->fadeOC = mplayInfo->fadeOI; - - if (mplayInfo->fadeOV & FADE_IN) { - if ((u16)(mplayInfo->fadeOV += (4 << FADE_VOL_SHIFT)) >= (64 << FADE_VOL_SHIFT)) { - mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT); - mplayInfo->fadeOI = 0; - } - } else { - if ((s16)(mplayInfo->fadeOV -= (4 << FADE_VOL_SHIFT)) <= 0) { - i = mplayInfo->trackCount; - track = mplayInfo->tracks; - - while (i > 0) { - u32 val; - - TrackStop(mplayInfo, track); - - val = TEMPORARY_FADE; - fadeOV = mplayInfo->fadeOV; - val &= fadeOV; - - if (!val) - track->flags = 0; - - i--; - track++; - } - - if (mplayInfo->fadeOV & TEMPORARY_FADE) - mplayInfo->status |= MUSICPLAYER_STATUS_PAUSE; - else - mplayInfo->status = MUSICPLAYER_STATUS_PAUSE; - - mplayInfo->fadeOI = 0; - return; - } - } - - i = mplayInfo->trackCount; - track = mplayInfo->tracks; - - while (i > 0) { - if (track->flags & MPT_FLG_EXIST) { - fadeOV = mplayInfo->fadeOV; - - track->volX = (fadeOV >> FADE_VOL_SHIFT); - track->flags |= MPT_FLG_VOLCHG; - } - - i--; - track++; - } -} - -void TrkVolPitSet(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - if (track->flags & MPT_FLG_VOLSET) { - s32 x, y; - - x = (u32)(track->vol * track->volX) >> 5; - if (track->modT == 1) - x = (u32)(x * (track->modM + 128)) >> 7; - y = 2 * track->pan + track->panX; - if (track->modT == 2) - y += track->modM; - if (y < -128) - y = -128; - else if (y > 127) - y = 127; - track->volMR = (u32)((y + 128) * x) >> 8; - track->volML = (u32)((127 - y) * x) >> 8; - } - if (track->flags & MPT_FLG_PITSET) { - s32 bend = track->bend * track->bendRange; - s32 x = (track->tune + bend) * 4 + (track->keyShift << 8) + (track->keyShiftX << 8) + track->pitX; - - if (track->modT == 0) - x += 16 * track->modM; - track->keyM = x >> 8; - track->pitM = x; - } - track->flags &= ~(MPT_FLG_PITSET | MPT_FLG_VOLSET); -} - -u32 MidiKeyToCgbFreq(u8 chanNum, u8 key, u8 fineAdjust) -{ - if (chanNum == 4) { - if (key <= 20) { - key = 0; - } else { - key -= 21; - if (key > 59) - key = 59; - } - return gNoiseTable[key]; - } else { - s32 val1; - s32 val2; - - if (key <= 35) { - fineAdjust = 0; - key = 0; - } else { - key -= 36; - if (key > 130) { - key = 130; - fineAdjust = 255; - } - } - val1 = gCgbScaleTable[key]; - val1 = gCgbFreqTable[val1 & 0xF] >> (val1 >> 4); - val2 = gCgbScaleTable[key + 1]; - val2 = gCgbFreqTable[val2 & 0xF] >> (val2 >> 4); - return val1 + ((fineAdjust * (val2 - val1)) >> 8) + 2048; - } -} - -void CgbOscOff(u8 chanNum) -{ - switch (chanNum) { - case 1: - REG_NR12 = 8; - REG_NR14 = 0x80; - break; - case 2: - REG_NR22 = 8; - REG_NR24 = 0x80; - break; - case 3: - REG_NR30 = 0; - break; - default: - REG_NR42 = 8; - REG_NR44 = 0x80; - } -} - -static inline s32 CgbPan(struct CgbChannel *chan) -{ - u32 rightVolume = chan->rightVolume; - u32 leftVolume = chan->leftVolume; - - if ((rightVolume = (u8)rightVolume) >= (leftVolume = (u8)leftVolume)) { - if (rightVolume / 2 >= leftVolume) { - chan->pan = 0x0F; - return 1; - } - } else { - if (leftVolume / 2 >= rightVolume) { - chan->pan = 0xF0; - return 1; - } - } - return 0; -} - -void CgbModVol(struct CgbChannel *chan) -{ - if (!CgbPan(chan)) { - chan->pan = 0xFF; - chan->eg = (u32)(chan->rightVolume + chan->leftVolume) / 16; - } else { - chan->eg = (u32)(chan->rightVolume + chan->leftVolume) / 16; - if (chan->eg > 15) - chan->eg = 15; - } - chan->sg = (chan->eg * chan->su + 15) >> 4; - chan->pan &= chan->panMask; -} - -void CgbSound(void) -{ - s32 ch; - struct CgbChannel *channels; - s32 evAdd; - s32 prevC15; - struct SoundInfo *soundInfo = SOUND_INFO_PTR; - vu8 *nrx0ptr; - vu8 *nrx1ptr; - vu8 *nrx2ptr; - vu8 *nrx3ptr; - vu8 *nrx4ptr; - // Most comparision operations that cast to s8 perform 'and' by 0xFF. - s32 mask = 0xff; - - if (soundInfo->c15) - --soundInfo->c15; - else - soundInfo->c15 = 14; - for (ch = 1, channels = soundInfo->cgbChans; ch <= 4; ++ch, ++channels) { - if (!(channels->sf & 0xc7)) - continue; - switch (ch) { - case 1: - nrx0ptr = ®_NR10; - nrx1ptr = ®_NR11; - nrx2ptr = ®_NR12; - nrx3ptr = ®_NR13; - nrx4ptr = ®_NR14; - break; - case 2: - nrx0ptr = (vu8 *)(REG_ADDR_NR10 + 1); - nrx1ptr = ®_NR21; - nrx2ptr = ®_NR22; - nrx3ptr = ®_NR23; - nrx4ptr = ®_NR24; - break; - case 3: - nrx0ptr = ®_NR30; - nrx1ptr = ®_NR31; - nrx2ptr = ®_NR32; - nrx3ptr = ®_NR33; - nrx4ptr = ®_NR34; - break; - default: - nrx0ptr = (vu8 *)(REG_ADDR_NR30 + 1); - nrx1ptr = ®_NR41; - nrx2ptr = ®_NR42; - nrx3ptr = ®_NR43; - nrx4ptr = ®_NR44; - break; - } - prevC15 = soundInfo->c15; - evAdd = *nrx2ptr; - if (channels->sf & 0x80) { - if (!(channels->sf & 0x40)) { - channels->sf = 3; - channels->mo = 3; - CgbModVol(channels); - switch (ch) { - case 1: - *nrx0ptr = channels->sw; - // fallthrough - case 2: - *nrx1ptr = ((uintptr_t)channels->wp << 6) + channels->le; - goto loc_82E0E30; - case 3: - if ((uintptr_t)channels->wp != channels->cp) { - *nrx0ptr = 0x40; - REG_WAVE_RAM0 = channels->wp[0]; - REG_WAVE_RAM1 = channels->wp[1]; - REG_WAVE_RAM2 = channels->wp[2]; - REG_WAVE_RAM3 = channels->wp[3]; - channels->cp = (uintptr_t)channels->wp; - } - *nrx0ptr = 0; - *nrx1ptr = channels->le; - if (channels->le) - channels->n4 = -64; - else - channels->n4 = -128; - break; - default: - *nrx1ptr = channels->le; - *nrx3ptr = (uintptr_t)channels->wp << 3; - loc_82E0E30: - evAdd = channels->at + 8; - if (channels->le) - channels->n4 = 64; - else - channels->n4 = 0; - break; - } - channels->ec = channels->at; - if ((s8)(channels->at & mask)) { - channels->ev = 0; - goto EC_MINUS; - } else { - goto loc_82E0F96; - } - } else { - goto loc_82E0E82; - } - } else if (channels->sf & 0x04) { - --channels->echoLength; - if ((s8)(channels->echoLength & mask) <= 0) { - loc_82E0E82: - CgbOscOff(ch); - channels->sf = 0; - goto _0815107C; - } - goto loc_82E0FD6; - } else if ((channels->sf & 0x40) && (channels->sf & 0x03)) { - channels->sf &= 0xfc; - channels->ec = channels->re; - if ((s8)(channels->re & mask)) { - channels->mo |= 1; - if (ch != 3) - evAdd = channels->re; - goto EC_MINUS; - } else { - goto loc_82E0F02; - } - } else { - loc_82E0ED0: - if (channels->ec == 0) { - if (ch == 3) - channels->mo |= 1; - CgbModVol(channels); - if ((channels->sf & 0x3) == 0) { - --channels->ev; - if ((s8)(channels->ev & mask) <= 0) { - loc_82E0F02: - channels->ev = ((channels->eg * channels->echoVolume) + 0xFF) >> 8; - if (channels->ev) { - channels->sf |= 0x4; - channels->mo |= 1; - if (ch != 3) - evAdd = 8; - goto loc_82E0FD6; - } else { - goto loc_82E0E82; - } - } else { - channels->ec = channels->re; - } - } else if ((channels->sf & 0x3) == 1) { - loc_82E0F3A: - channels->ev = channels->sg; - channels->ec = 7; - } else if ((channels->sf & 0x3) == 2) { - s32 ev, sg; - - --channels->ev; - ev = (s8)(channels->ev & mask); - sg = (s8)(channels->sg); - if (ev <= sg) { - loc_82E0F5A: - if (channels->su == 0) { - channels->sf &= 0xfc; - goto loc_82E0F02; - } else { - --channels->sf; - channels->mo |= 1; - if (ch != 3) - evAdd = 8; - goto loc_82E0F3A; - } - } else { - channels->ec = channels->de; - } - } else { - ++channels->ev; - if ((u8)(channels->ev & mask) >= channels->eg) { - loc_82E0F96: - --channels->sf; - channels->ec = channels->de; - if ((u8)(channels->ec & mask)) { - channels->mo |= 1; - channels->ev = channels->eg; - if (ch != 3) { - evAdd = channels->de; - } - } else { - goto loc_82E0F5A; - } - } else { - channels->ec = channels->at; - } - } - } - } - EC_MINUS: - --channels->ec; - if (prevC15 == 0) { - --prevC15; - goto loc_82E0ED0; - } - loc_82E0FD6: - if (channels->mo & 0x2) { - if (ch < 4 && (channels->ty & 0x08)) { - s32 biasH = REG_SOUNDBIAS_H; - - if (biasH < 64) - channels->fr = (channels->fr + 2) & 0x7fc; - else if (biasH < 128) - channels->fr = (channels->fr + 1) & 0x7fe; - } - if (ch != 4) { - *nrx3ptr = channels->fr; - } else { - *nrx3ptr = (*nrx3ptr & 0x08) | channels->fr; - } - channels->n4 = (channels->n4 & 0xC0) + (*((u8 *)(&channels->fr) + 1)); - *nrx4ptr = (s8)(channels->n4 & mask); - } - if (channels->mo & 1) { - REG_NR51 = (REG_NR51 & ~channels->panMask) | channels->pan; - if (ch == 3) { - *nrx2ptr = gCgb3Vol[channels->ev]; - if (channels->n4 & 0x80) { - *nrx0ptr = 0x80; - *nrx4ptr = channels->n4; - channels->n4 &= 0x7f; - } - } else { - evAdd &= 0xf; - *nrx2ptr = (channels->ev << 4) + evAdd; - *nrx4ptr = channels->n4 | 0x80; - if (ch == 1 && !(*nrx0ptr & 0x08)) { - *nrx4ptr = channels->n4 | 0x80; - } - } - } - _0815107C: - channels->mo = 0; - } -} - -void m4aMPlayTempoControl(struct MusicPlayerInfo *mplayInfo, u16 tempo) -{ -#if !ENABLE_AUDIO - return; -#endif - if (mplayInfo->ident == ID_NUMBER) { - ++mplayInfo->ident; - mplayInfo->tempoU = tempo; - mplayInfo->tempoI = (mplayInfo->tempoD * mplayInfo->tempoU) >> 8; - mplayInfo->ident = ID_NUMBER; - } -} - -void m4aMPlayVolumeControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u16 volume) -{ - s32 i; - u32 bit; - struct MusicPlayerTrack *track; - -#if !ENABLE_AUDIO - return; -#endif - - if (mplayInfo->ident != ID_NUMBER) - return; - ++mplayInfo->ident; - i = mplayInfo->trackCount; - track = mplayInfo->tracks; - bit = 1; - while (i > 0) { - if (trackBits & bit) { - if (track->flags & MPT_FLG_EXIST) { - track->volX = volume / 4; - track->flags |= MPT_FLG_VOLCHG; - } - } - --i; - ++track; - bit <<= 1; - } - mplayInfo->ident = ID_NUMBER; -} - -void m4aMPlayPitchControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, s16 pitch) -{ - s32 i; - u32 bit; - struct MusicPlayerTrack *track; - -#if !ENABLE_AUDIO - return; -#endif - - if (mplayInfo->ident != ID_NUMBER) - return; - ++mplayInfo->ident; - i = mplayInfo->trackCount; - track = mplayInfo->tracks; - bit = 1; - while (i > 0) { - if (trackBits & bit) { - if (track->flags & MPT_FLG_EXIST) { - track->keyShiftX = pitch >> 8; - track->pitX = pitch; - track->flags |= MPT_FLG_PITCHG; - } - } - --i; - ++track; - bit <<= 1; - } - mplayInfo->ident = ID_NUMBER; -} - -void m4aMPlayPanpotControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, s8 pan) -{ - s32 i; - u32 bit; - struct MusicPlayerTrack *track; - -#if !ENABLE_AUDIO - return; -#endif - - if (mplayInfo->ident != ID_NUMBER) - return; - ++mplayInfo->ident; - i = mplayInfo->trackCount; - track = mplayInfo->tracks; - bit = 1; - while (i > 0) { - if (trackBits & bit) { - if (track->flags & MPT_FLG_EXIST) { - track->panX = pan; - track->flags |= MPT_FLG_VOLCHG; - } - } - --i; - ++track; - bit <<= 1; - } - mplayInfo->ident = ID_NUMBER; -} - -void ClearModM(struct MusicPlayerTrack *track) -{ - track->lfoSpeedC = 0; - track->modM = 0; - if (track->modT == 0) - track->flags |= MPT_FLG_PITCHG; - else - track->flags |= MPT_FLG_VOLCHG; -} - -void m4aMPlayModDepthSet(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u8 modDepth) -{ - s32 i; - u32 bit; - struct MusicPlayerTrack *track; - -#if !ENABLE_AUDIO - return; -#endif - - if (mplayInfo->ident != ID_NUMBER) - return; - ++mplayInfo->ident; - i = mplayInfo->trackCount; - track = mplayInfo->tracks; - bit = 1; - while (i > 0) { - if (trackBits & bit) { - if (track->flags & MPT_FLG_EXIST) { - track->mod = modDepth; - if (!track->mod) - ClearModM(track); - } - } - --i; - ++track; - bit <<= 1; - } - mplayInfo->ident = ID_NUMBER; -} - -void m4aMPlayLFOSpeedSet(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u8 lfoSpeed) -{ - s32 i; - u32 bit; - struct MusicPlayerTrack *track; - -#if !ENABLE_AUDIO - return; -#endif - - if (mplayInfo->ident != ID_NUMBER) - return; - ++mplayInfo->ident; - i = mplayInfo->trackCount; - track = mplayInfo->tracks; - bit = 1; - while (i > 0) { - if (trackBits & bit) { - if (track->flags & MPT_FLG_EXIST) { - track->lfoSpeed = lfoSpeed; - - if (!track->lfoSpeed) - ClearModM(track); - } - } - --i; - ++track; - bit <<= 1; - } - - mplayInfo->ident = ID_NUMBER; -} - -#define MEMACC_COND_JUMP(cond) \ - if (cond) \ - goto cond_true; \ - else \ - goto cond_false; - -void ply_memacc(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - u32 op; - u8 *addr; - u8 data; - - op = *track->cmdPtr; - ++track->cmdPtr; - addr = mplayInfo->memAccArea + *track->cmdPtr; - ++track->cmdPtr; - data = *track->cmdPtr; - ++track->cmdPtr; - switch (op) { - case 0: - *addr = data; - return; - case 1: - *addr += data; - return; - case 2: - *addr -= data; - return; - case 3: - *addr = mplayInfo->memAccArea[data]; - return; - case 4: - *addr += mplayInfo->memAccArea[data]; - return; - case 5: - *addr -= mplayInfo->memAccArea[data]; - return; - case 6: - MEMACC_COND_JUMP(*addr == data) - return; - case 7: - MEMACC_COND_JUMP(*addr != data) - return; - case 8: - MEMACC_COND_JUMP(*addr > data) - return; - case 9: - MEMACC_COND_JUMP(*addr >= data) - return; - case 10: - MEMACC_COND_JUMP(*addr <= data) - return; - case 11: - MEMACC_COND_JUMP(*addr < data) - return; - case 12: - MEMACC_COND_JUMP(*addr == mplayInfo->memAccArea[data]) - return; - case 13: - MEMACC_COND_JUMP(*addr != mplayInfo->memAccArea[data]) - return; - case 14: - MEMACC_COND_JUMP(*addr > mplayInfo->memAccArea[data]) - return; - case 15: - MEMACC_COND_JUMP(*addr >= mplayInfo->memAccArea[data]) - return; - case 16: - MEMACC_COND_JUMP(*addr <= mplayInfo->memAccArea[data]) - return; - case 17: - MEMACC_COND_JUMP(*addr < mplayInfo->memAccArea[data]) - return; - default: - return; - } -cond_true : { - void (*func)(struct MusicPlayerInfo *, struct MusicPlayerTrack *) = *(&gMPlayJumpTable[1]); - func(mplayInfo, track); - return; -} -cond_false: - track->cmdPtr += 4; -} - -void ply_xcmd(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - u32 n = *track->cmdPtr; - - ++track->cmdPtr; - gXcmdTable[n](mplayInfo, track); -} - -void ply_xxx(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - void (*func)(struct MusicPlayerInfo *, struct MusicPlayerTrack *) = *(&gMPlayJumpTable[0]); - - func(mplayInfo, track); -} - -#define READ_XCMD_BYTE(var, n) \ - { \ - u32 byte = track->cmdPtr[(n)]; \ - byte <<= n * 8; \ - (var) &= ~(0xFF << (n * 8)); \ - (var) |= byte; \ - } - -void ply_xwave(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - uintptr_t wav; - - READ_XCMD_BYTE(wav, 0) // UB: uninitialized variable - READ_XCMD_BYTE(wav, 1) - READ_XCMD_BYTE(wav, 2) - READ_XCMD_BYTE(wav, 3) - track->tone.wav = (struct WaveData *)wav; - track->cmdPtr += 4; -} - -void ply_xtype(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - track->tone.type = *track->cmdPtr; - ++track->cmdPtr; -} - -void ply_xatta(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - track->tone.attack = *track->cmdPtr; - ++track->cmdPtr; -} - -void ply_xdeca(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - track->tone.decay = *track->cmdPtr; - ++track->cmdPtr; -} - -void ply_xsust(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - track->tone.sustain = *track->cmdPtr; - ++track->cmdPtr; -} - -void ply_xrele(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - track->tone.release = *track->cmdPtr; - ++track->cmdPtr; -} - -void ply_xiecv(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - track->echoVolume = *track->cmdPtr; - ++track->cmdPtr; -} - -void ply_xiecl(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - track->echoLength = *track->cmdPtr; - ++track->cmdPtr; -} - -void ply_xleng(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - track->tone.length = *track->cmdPtr; - ++track->cmdPtr; -} - -void ply_xswee(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) -{ - track->tone.pan_sweep = *track->cmdPtr; - ++track->cmdPtr; -} - -static void DummyCallback(void) { } diff --git a/src/lib/m4a/m4a.c b/src/lib/m4a/m4a.c new file mode 100644 index 000000000..1a4ef480b --- /dev/null +++ b/src/lib/m4a/m4a.c @@ -0,0 +1,1477 @@ +#include +#include "gba/types.h" +#include "lib/m4a/m4a_internal.h" + +#include + +#if !PLATFORM_GBA +#include "platform/shared/audio/cgb_audio.h" +#endif + +#if PLATFORM_GBA +#define BSS_CODE __attribute__((section(".bss.code"))) + +BSS_CODE ALIGNED(4) char SoundMainRAM_Buffer[0x400] = { 0 }; +#endif + +EWRAM_DATA struct MP2KTrack gMPlayTrack_BGM[16] = {}; +EWRAM_DATA struct MP2KTrack gMPlayTrack_SE1[16] = {}; +EWRAM_DATA struct MP2KTrack gMPlayTrack_SE2[16] = {}; +EWRAM_DATA struct MP2KTrack gMPlayTrack_SE3[16] = {}; + +// TODO: convert sound_data to C +// const struct MusicPlayer gMPlayTable[] = { +// { &gMPlayInfo_BGM, gMPlayTrack_BGM, 16 }, +// { &gMPlayInfo_SE1, gMPlayTrack_SE1, 16 }, +// { &gMPlayInfo_SE2, gMPlayTrack_SE2, 16 }, +// { &gMPlayInfo_SE3, gMPlayTrack_SE3, 16 }, +// }; + +EWRAM_DATA struct SoundMixerState gSoundInfo = {}; +EWRAM_DATA MPlayFunc gMPlayJumpTable[36] = {}; +EWRAM_DATA struct MixerSource gCgbChans[4] = {}; + +// For some reason these were declared in this order +EWRAM_DATA struct MP2KPlayerState gMPlayInfo_BGM = {}; +EWRAM_DATA struct MP2KPlayerState gMPlayInfo_SE1 = {}; +EWRAM_DATA struct MP2KPlayerState gMPlayInfo_SE2 = {}; +EWRAM_DATA u8 gMPlayMemAccArea[4 * sizeof(uintptr_t)] = {}; +EWRAM_DATA struct MP2KPlayerState gMPlayInfo_SE3 = {}; + +static void MP2K_event_null(void); + +u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust) +{ + u32 val1; + u32 val2; + u32 fineAdjustShifted = fineAdjust << 24; + + if (key > 178) { + key = 178; + fineAdjustShifted = 255 << 24; + } + + val1 = gScaleTable[key]; + val1 = gFreqTable[val1 & 0xF] >> (val1 >> 4); + + val2 = gScaleTable[key + 1]; + val2 = gFreqTable[val2 & 0xF] >> (val2 >> 4); + + return umul3232H32(wav->freq, val1 + umul3232H32(val2 - val1, fineAdjustShifted)); +} + +UNUSED static void UnusedFunc(void) { } + +void MPlayContinue(struct MP2KPlayerState *mplayInfo) +{ + if (mplayInfo->lockStatus == ID_NUMBER) { + mplayInfo->lockStatus++; + mplayInfo->status &= ~MUSICPLAYER_STATUS_PAUSE; + mplayInfo->lockStatus = ID_NUMBER; + } +} + +void MPlayFadeOut(struct MP2KPlayerState *mplayInfo, u16 speed) +{ + if (mplayInfo->lockStatus == ID_NUMBER) { + mplayInfo->lockStatus++; + mplayInfo->fadeCounter = speed; + mplayInfo->fadeInterval = speed; + mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT); + mplayInfo->lockStatus = ID_NUMBER; + } +} + +void m4aSoundInit(void) +{ + s32 i; +#if PLATFORM_GBA + CpuCopy32((void *)((s32)SoundMainRAM & ~1), SoundMainRAM_Buffer, sizeof(SoundMainRAM_Buffer)); +#endif + + SoundInit(&gSoundInfo); + MPlayExtender(gCgbChans); + m4aSoundMode(DEFAULT_SOUND_MODE); + + for (i = 0; i < NUM_MUSIC_PLAYERS; i++) { + struct MP2KPlayerState *mplayInfo = gMPlayTable[i].info; + MPlayOpen(mplayInfo, gMPlayTable[i].track, gMPlayTable[i].numTracks); + mplayInfo->checkSongPriority = gMPlayTable[i].unk_A; + mplayInfo->memAccArea = gMPlayMemAccArea; + } +} + +void m4aSoundMain(void) { SoundMain(); } + +void m4aSongNumStart(u16 n) +{ + const struct MusicPlayer *mplayTable = gMPlayTable; + const struct Song *songTable = gSongTable; + const struct Song *song = &songTable[n]; + const struct MusicPlayer *mplay = &mplayTable[song->ms]; + + MPlayStart(mplay->info, song->header); +} + +void m4aSongNumStartOrChange(u16 n) +{ + const struct MusicPlayer *mplayTable = gMPlayTable; + const struct Song *songTable = gSongTable; + const struct Song *song = &songTable[n]; + const struct MusicPlayer *mplay = &mplayTable[song->ms]; + + if (mplay->info->songHeader != song->header) { + MPlayStart(mplay->info, song->header); + } else { + if ((mplay->info->status & MUSICPLAYER_STATUS_TRACK) == 0 || (mplay->info->status & MUSICPLAYER_STATUS_PAUSE)) { + MPlayStart(mplay->info, song->header); + } + } +} + +void m4aSongNumStartOrContinue(u16 n) +{ + const struct MusicPlayer *mplayTable = gMPlayTable; + const struct Song *songTable = gSongTable; + const struct Song *song = &songTable[n]; + const struct MusicPlayer *mplay = &mplayTable[song->ms]; + + if (mplay->info->songHeader != song->header) + MPlayStart(mplay->info, song->header); + else if ((mplay->info->status & MUSICPLAYER_STATUS_TRACK) == 0) + MPlayStart(mplay->info, song->header); + else if (mplay->info->status & MUSICPLAYER_STATUS_PAUSE) + MPlayContinue(mplay->info); +} + +void m4aSongNumStop(u16 n) +{ + const struct MusicPlayer *mplayTable = gMPlayTable; + const struct Song *songTable = gSongTable; + const struct Song *song = &songTable[n]; + const struct MusicPlayer *mplay = &mplayTable[song->ms]; + + if (mplay->info->songHeader == song->header) + MPlayStop(mplay->info); +} + +void m4aSongNumContinue(u16 n) +{ + const struct MusicPlayer *mplayTable = gMPlayTable; + const struct Song *songTable = gSongTable; + const struct Song *song = &songTable[n]; + const struct MusicPlayer *mplay = &mplayTable[song->ms]; + + if (mplay->info->songHeader == song->header) + MPlayContinue(mplay->info); +} + +void m4aMPlayAllStop(void) +{ + s32 i; + + for (i = 0; i < NUM_MUSIC_PLAYERS; i++) + MPlayStop(gMPlayTable[i].info); +} + +void m4aMPlayContinue(struct MP2KPlayerState *mplayInfo) { MPlayContinue(mplayInfo); } + +void m4aMPlayAllContinue(void) +{ + s32 i; + + for (i = 0; i < NUM_MUSIC_PLAYERS; i++) + MPlayContinue(gMPlayTable[i].info); +} + +void m4aMPlayFadeOut(struct MP2KPlayerState *mplayInfo, u16 speed) { MPlayFadeOut(mplayInfo, speed); } + +void m4aMPlayFadeOutTemporarily(struct MP2KPlayerState *mplayInfo, u16 speed) +{ + if (mplayInfo->lockStatus == ID_NUMBER) { + mplayInfo->lockStatus++; + mplayInfo->fadeCounter = speed; + mplayInfo->fadeInterval = speed; + mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT) | TEMPORARY_FADE; + mplayInfo->lockStatus = ID_NUMBER; + } +} + +void m4aMPlayFadeIn(struct MP2KPlayerState *mplayInfo, u16 speed) +{ + if (mplayInfo->lockStatus == ID_NUMBER) { + mplayInfo->lockStatus++; + mplayInfo->fadeCounter = speed; + mplayInfo->fadeInterval = speed; + mplayInfo->fadeOV = (0 << FADE_VOL_SHIFT) | FADE_IN; + mplayInfo->status &= ~MUSICPLAYER_STATUS_PAUSE; + mplayInfo->lockStatus = ID_NUMBER; + } +} + +void m4aMPlayImmInit(struct MP2KPlayerState *mplayInfo) +{ + s32 trackCount = mplayInfo->trackCount; + struct MP2KTrack *track = mplayInfo->tracks; + + while (trackCount > 0) { + if (track->status & MPT_FLG_EXIST) { + if (track->status & MPT_FLG_START) { + Clear64byte(track); + track->status = MPT_FLG_EXIST; + track->bendRange = 2; + track->volPublic = 64; + track->lfoSpeed = 22; + track->voicegroup.type = 1; + } + } + + trackCount--; + track++; + } +} + +void MPlayExtender(struct MixerSource *cgbChans) +{ + struct SoundMixerState *soundInfo; + u32 lockStatus; + + REG_SOUNDCNT_X = SOUND_MASTER_ENABLE | SOUND_4_ON | SOUND_3_ON | SOUND_2_ON | SOUND_1_ON; + REG_SOUNDCNT_L = 0; // set master volume to zero + REG_NR12 = 0x8; + REG_NR22 = 0x8; + REG_NR42 = 0x8; + REG_NR14 = 0x80; + REG_NR24 = 0x80; + REG_NR44 = 0x80; + REG_NR30 = 0; + REG_NR50 = 0x77; + +#if !PLATFORM_GBA + for (u8 i = 0; i < 4; i++) { + cgb_set_envelope(i, 8); + cgb_trigger_note(i); + } +#endif + + soundInfo = SOUND_INFO_PTR; + + lockStatus = soundInfo->lockStatus; + + if (lockStatus != ID_NUMBER) + return; + + soundInfo->lockStatus++; + + gMPlayJumpTable[8] = MP2K_event_memacc; + gMPlayJumpTable[17] = MP2K_event_lfos; + gMPlayJumpTable[19] = MP2K_event_mod; + gMPlayJumpTable[28] = MP2K_event_xcmd; + gMPlayJumpTable[29] = MP2K_event_endtie; + gMPlayJumpTable[30] = SampleFreqSet; + gMPlayJumpTable[31] = TrackStop; + gMPlayJumpTable[32] = FadeOutBody; + gMPlayJumpTable[33] = TrkVolPitSet; + + soundInfo->cgbChans = cgbChans; + soundInfo->CgbSound = CgbSound; + soundInfo->CgbOscOff = CgbOscOff; + soundInfo->MidiKeyToCgbFreq = MidiKeyToCgbFreq; + soundInfo->maxScanlines = MAX_LINES; + + CpuFill32(0, cgbChans, sizeof(struct MixerSource) * 4); + + cgbChans[0].type = 1; + cgbChans[0].data.cgb.panMask = 0x11; + cgbChans[1].type = 2; + cgbChans[1].data.cgb.panMask = 0x22; + cgbChans[2].type = 3; + cgbChans[2].data.cgb.panMask = 0x44; + cgbChans[3].type = 4; + cgbChans[3].data.cgb.panMask = 0x88; + + soundInfo->lockStatus = lockStatus; +} + +#if PLATFORM_GBA +void MusicPlayerJumpTableCopy(void) { asm("swi 0x2A"); } +#endif + +void ClearChain(struct MixerSource *chan) +{ + void (*func)(void *) = *(&gMPlayJumpTable[34]); + func(chan); +} + +void Clear64byte(void *x) +{ + void (*func)(void *) = *(&gMPlayJumpTable[35]); + func(x); +} + +void SoundInit(struct SoundMixerState *soundInfo) +{ + soundInfo->lockStatus = 0; +#if !USE_NEW_DMA + if (REG_DMA1CNT & (DMA_REPEAT << 16)) + REG_DMA1CNT = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4; + if (REG_DMA2CNT & (DMA_REPEAT << 16)) + REG_DMA2CNT = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4; + REG_DMA1CNT_H = DMA_32BIT; + REG_DMA2CNT_H = DMA_32BIT; + REG_SOUNDCNT_X = SOUND_MASTER_ENABLE | SOUND_4_ON | SOUND_3_ON | SOUND_2_ON | SOUND_1_ON; + REG_SOUNDCNT_H = SOUND_B_FIFO_RESET | SOUND_B_TIMER_0 | SOUND_B_LEFT_OUTPUT | SOUND_A_FIFO_RESET | SOUND_A_TIMER_0 + | SOUND_A_RIGHT_OUTPUT | SOUND_ALL_MIX_FULL; + REG_SOUNDBIAS_H = (REG_SOUNDBIAS_H & 0x3F) | 0x40; + REG_DMA1SAD = (intptr_t)soundInfo->pcmBuffer; + REG_DMA1DAD = (intptr_t)®_FIFO_A; + REG_DMA2SAD = (intptr_t)soundInfo->pcmBuffer + PCM_DMA_BUF_SIZE; + REG_DMA2DAD = (intptr_t)®_FIFO_B; +#endif + + SOUND_INFO_PTR = soundInfo; + CpuFill32(0, soundInfo, sizeof(struct SoundMixerState)); + + soundInfo->numChans = 8; + soundInfo->masterVol = 15; + soundInfo->plynote = MP2K_event_nxx; + soundInfo->CgbSound = MP2K_event_null; + soundInfo->CgbOscOff = (CgbOscOffFunc)MP2K_event_null; + soundInfo->MidiKeyToCgbFreq = (MidiKeyToCgbFreqFunc)MP2K_event_null; + soundInfo->ExtVolPit = (ExtVolPitFunc)MP2K_event_null; + + MPlayJumpTableCopy((void **)gMPlayJumpTable); + + soundInfo->MPlayJumpTable = gMPlayJumpTable; + +#if PLATFORM_GBA + SampleFreqSet(SOUND_MODE_FREQ_13379); +#else + SampleFreqSet(SOUND_MODE_FREQ_42048); +#endif + + soundInfo->lockStatus = ID_NUMBER; +} + +void SampleFreqSet(u32 freq) +{ + struct SoundMixerState *soundInfo = SOUND_INFO_PTR; + + freq = (freq & 0xF0000) >> 16; + soundInfo->freqOption = freq; + +#if PLATFORM_GBA + soundInfo->samplesPerFrame = gPcmSamplesPerVBlankTable[freq - 1]; + soundInfo->framesPerDmaCycle = PCM_DMA_BUF_SIZE / soundInfo->samplesPerFrame; + + // LCD refresh rate 59.7275Hz + soundInfo->sampleRate = (597275 * soundInfo->samplesPerFrame + 5000) / 10000; + + // CPU freq 16.78Mhz + soundInfo->sampleRateReciprocal = (0x1000000 / soundInfo->sampleRate + 1) >> 1; +#else + soundInfo->samplesPerFrame = 701; + soundInfo->framesPerDmaCycle = PCM_DMA_BUF_SIZE / soundInfo->samplesPerFrame; + soundInfo->sampleRate = 60.0f * soundInfo->samplesPerFrame; + soundInfo->sampleRateReciprocal = 1.0f / soundInfo->sampleRate; +#endif + + // Turn off timer 0. + REG_TM0CNT_H = 0; + + // cycles per LCD fresh 280896 + REG_TM0CNT_L = -(280896 / soundInfo->samplesPerFrame); + + m4aSoundVSyncOn(); +#if PLATFORM_GBA + while (*(vu8 *)REG_ADDR_VCOUNT == 159) + ; + + while (*(vu8 *)REG_ADDR_VCOUNT != 159) + ; +#endif + REG_TM0CNT_H = TIMER_ENABLE | TIMER_1CLK; +} + +void m4aSoundMode(u32 mode) +{ + struct SoundMixerState *soundInfo = SOUND_INFO_PTR; + u32 temp; + + if (soundInfo->lockStatus != ID_NUMBER) + return; + + soundInfo->lockStatus++; + + temp = mode & (SOUND_MODE_REVERB_SET | SOUND_MODE_REVERB_VAL); + + if (temp) + soundInfo->reverb = temp & SOUND_MODE_REVERB_VAL; + + temp = mode & SOUND_MODE_MAXCHN; + + if (temp) { + struct MixerSource *chan; + + soundInfo->numChans = temp >> SOUND_MODE_MAXCHN_SHIFT; + + temp = MAX_DIRECTSOUND_CHANNELS; + chan = &soundInfo->chans[0]; + + while (temp != 0) { + chan->status = 0; + temp--; + chan++; + } + } + + temp = mode & SOUND_MODE_MASVOL; + + if (temp) + soundInfo->masterVol = temp >> SOUND_MODE_MASVOL_SHIFT; + + temp = mode & SOUND_MODE_DA_BIT; + + if (temp) { + temp = (temp & 0x300000) >> 14; + REG_SOUNDBIAS_H = (REG_SOUNDBIAS_H & 0x3F) | temp; + } + + temp = mode & SOUND_MODE_FREQ; + + if (temp) { + m4aSoundVSyncOff(); + SampleFreqSet(temp); + } + + soundInfo->lockStatus = ID_NUMBER; +} + +void SoundClear(void) +{ + struct SoundMixerState *soundInfo = SOUND_INFO_PTR; + s32 i; + struct MixerSource *chan; + + if (soundInfo->lockStatus != ID_NUMBER) + return; + + soundInfo->lockStatus++; + + i = MAX_DIRECTSOUND_CHANNELS; + chan = &soundInfo->chans[0]; + + while (i > 0) { + chan->status = 0; + i--; + chan = (void *)((intptr_t)chan + sizeof(struct MixerSource)); + } + + chan = soundInfo->cgbChans; + + if (chan) { + i = 1; + + while (i <= 4) { + soundInfo->CgbOscOff(i); + chan->status = 0; + i++; + chan = (void *)((intptr_t)chan + sizeof(struct MixerSource)); + } + } + + soundInfo->lockStatus = ID_NUMBER; +} + +void m4aSoundVSyncOff(void) +{ + struct SoundMixerState *soundInfo = SOUND_INFO_PTR; + + if (soundInfo->lockStatus >= ID_NUMBER && soundInfo->lockStatus <= ID_NUMBER + 1) { + soundInfo->lockStatus += 10; + + if (REG_DMA1CNT & (DMA_REPEAT << 16)) + REG_DMA1CNT = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4; + + if (REG_DMA2CNT & (DMA_REPEAT << 16)) + REG_DMA2CNT = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4; + + REG_DMA1CNT_H = DMA_32BIT; + REG_DMA2CNT_H = DMA_32BIT; + + CpuFill32(0, soundInfo->pcmBuffer, sizeof(soundInfo->pcmBuffer)); + } +} + +void m4aSoundVSyncOn(void) +{ + struct SoundMixerState *soundInfo = SOUND_INFO_PTR; + u32 lockStatus = soundInfo->lockStatus; + + if (lockStatus == ID_NUMBER) + return; + + REG_DMA1CNT_H = DMA_ENABLE | DMA_START_SPECIAL | DMA_32BIT | DMA_REPEAT; + REG_DMA2CNT_H = DMA_ENABLE | DMA_START_SPECIAL | DMA_32BIT | DMA_REPEAT; + + soundInfo->dmaCounter = 0; + soundInfo->lockStatus = lockStatus - 10; +} + +void MPlayOpen(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *tracks, u8 trackCount) +{ + struct SoundMixerState *soundInfo; + + if (trackCount == 0) + return; + + if (trackCount > MAX_MUSICPLAYER_TRACKS) + trackCount = MAX_MUSICPLAYER_TRACKS; + + soundInfo = SOUND_INFO_PTR; + + if (soundInfo->lockStatus != ID_NUMBER) + return; + + soundInfo->lockStatus++; + + Clear64byte(mplayInfo); + + mplayInfo->tracks = tracks; + mplayInfo->trackCount = trackCount; + mplayInfo->status = MUSICPLAYER_STATUS_PAUSE; + + while (trackCount != 0) { + tracks->status = 0; + trackCount--; + tracks++; + } + + // append music player and MP2KPlayerMain to linked list + + if (soundInfo->MPlayMainHead != NULL) { + mplayInfo->nextPlayerFunc = soundInfo->MPlayMainHead; + mplayInfo->nextPlayer = soundInfo->musicPlayerHead; + // NULL assignment semantically useless, but required for match + soundInfo->MPlayMainHead = NULL; + } + + soundInfo->musicPlayerHead = mplayInfo; + soundInfo->MPlayMainHead = MP2KPlayerMain; + + soundInfo->lockStatus = ID_NUMBER; + mplayInfo->lockStatus = ID_NUMBER; +} + +void MPlayStart(struct MP2KPlayerState *mplayInfo, struct MP2KSongHeader *songHeader) +{ + s32 i; + u8 checkSongPriority; + struct MP2KTrack *track; + + if (mplayInfo->lockStatus != ID_NUMBER) + return; + + checkSongPriority = mplayInfo->checkSongPriority; + + if (!checkSongPriority + || ((!mplayInfo->songHeader || !(mplayInfo->tracks[0].status & MPT_FLG_START)) + && ((mplayInfo->status & MUSICPLAYER_STATUS_TRACK) == 0 || (mplayInfo->status & MUSICPLAYER_STATUS_PAUSE))) + || (mplayInfo->priority <= songHeader->priority)) { + mplayInfo->lockStatus++; + mplayInfo->status = 0; + mplayInfo->songHeader = songHeader; + mplayInfo->voicegroup = songHeader->voicegroup; + mplayInfo->priority = songHeader->priority; + mplayInfo->clock = 0; + mplayInfo->tempoRawBPM = 150; + mplayInfo->tempoInterval = 150; + mplayInfo->tempoScale = 0x100; + mplayInfo->tempoCounter = 0; + mplayInfo->fadeInterval = 0; + + i = 0; + track = mplayInfo->tracks; + + while (i < songHeader->trackCount && i < mplayInfo->trackCount) { + TrackStop(mplayInfo, track); + track->status = MPT_FLG_EXIST | MPT_FLG_START; + track->chan = 0; + track->cmdPtr = songHeader->part[i]; + i++; + track++; + } + + while (i < mplayInfo->trackCount) { + TrackStop(mplayInfo, track); + track->status = 0; + i++; + track++; + } + + if (songHeader->reverb & SOUND_MODE_REVERB_SET) + m4aSoundMode(songHeader->reverb); + + mplayInfo->lockStatus = ID_NUMBER; + } +} + +void MPlayStop(struct MP2KPlayerState *mplayInfo) +{ + s32 i; + struct MP2KTrack *track; + + if (mplayInfo->lockStatus != ID_NUMBER) + return; + + mplayInfo->lockStatus++; + mplayInfo->status |= MUSICPLAYER_STATUS_PAUSE; + + i = mplayInfo->trackCount; + track = mplayInfo->tracks; + + while (i > 0) { + TrackStop(mplayInfo, track); + i--; + track++; + } + + mplayInfo->lockStatus = ID_NUMBER; +} + +void FadeOutBody(struct MP2KPlayerState *mplayInfo) +{ + s32 i; + struct MP2KTrack *track; + u16 fadeOV; + + if (mplayInfo->fadeInterval == 0) + return; + if (--mplayInfo->fadeCounter != 0) + return; + + mplayInfo->fadeCounter = mplayInfo->fadeInterval; + + if (mplayInfo->fadeOV & FADE_IN) { + if ((u16)(mplayInfo->fadeOV += (4 << FADE_VOL_SHIFT)) >= (64 << FADE_VOL_SHIFT)) { + mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT); + mplayInfo->fadeInterval = 0; + } + } else { + if ((s16)(mplayInfo->fadeOV -= (4 << FADE_VOL_SHIFT)) <= 0) { + i = mplayInfo->trackCount; + track = mplayInfo->tracks; + + while (i > 0) { + u32 val; + + TrackStop(mplayInfo, track); + + val = TEMPORARY_FADE; + fadeOV = mplayInfo->fadeOV; + val &= fadeOV; + + if (!val) + track->status = 0; + + i--; + track++; + } + + if (mplayInfo->fadeOV & TEMPORARY_FADE) + mplayInfo->status |= MUSICPLAYER_STATUS_PAUSE; + else + mplayInfo->status = MUSICPLAYER_STATUS_PAUSE; + + mplayInfo->fadeInterval = 0; + return; + } + } + + i = mplayInfo->trackCount; + track = mplayInfo->tracks; + + while (i > 0) { + if (track->status & MPT_FLG_EXIST) { + fadeOV = mplayInfo->fadeOV; + + track->volPublic = (fadeOV >> FADE_VOL_SHIFT); + track->status |= MPT_FLG_VOLCHG; + } + + i--; + track++; + } +} + +void TrkVolPitSet(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + if (track->status & MPT_FLG_VOLSET) { + s32 x; + s32 y; + + x = (u32)(track->vol * track->volPublic) >> 5; + + if (track->modType == 1) + x = (u32)(x * (track->modCalculated + 128)) >> 7; + + y = 2 * track->pan + track->panPublic; + + if (track->modType == 2) + y += track->modCalculated; + + if (y < -128) + y = -128; + else if (y > 127) + y = 127; + + track->volRightCalculated = (u32)((y + 128) * x) >> 8; + track->volLeftCalculated = (u32)((127 - y) * x) >> 8; + } + + if (track->status & MPT_FLG_PITSET) { + s32 bend = track->bend * track->bendRange; + s32 x = (track->tune + bend) * 4 + (track->keyShift << 8) + (track->keyShiftPublic << 8) + track->pitchPublic; + + if (track->modType == 0) + x += 16 * track->modCalculated; + + track->keyShiftCalculated = x >> 8; + track->pitchCalculated = x; + } + + track->status &= ~(MPT_FLG_PITSET | MPT_FLG_VOLSET); +} + +u32 MidiKeyToCgbFreq(u8 chanNum, u8 key, u8 fineAdjust) +{ + if (chanNum == 4) { + if (key <= 20) { + key = 0; + } else { + key -= 21; + if (key > 59) + key = 59; + } + + return gNoiseTable[key]; + } else { + s32 val1; + s32 val2; + + if (key <= 35) { + fineAdjust = 0; + key = 0; + } else { + key -= 36; + if (key > 130) { + key = 130; + fineAdjust = 255; + } + } + + val1 = gCgbScaleTable[key]; + val1 = gCgbFreqTable[val1 & 0xF] >> (val1 >> 4); + + val2 = gCgbScaleTable[key + 1]; + val2 = gCgbFreqTable[val2 & 0xF] >> (val2 >> 4); + + return val1 + ((fineAdjust * (val2 - val1)) >> 8) + 2048; + } +} + +void CgbOscOff(u8 chanNum) +{ + switch (chanNum) { + case 1: + REG_NR12 = 8; + REG_NR14 = 0x80; + break; + case 2: + REG_NR22 = 8; + REG_NR24 = 0x80; + break; + case 3: + REG_NR30 = 0; + break; + default: + REG_NR42 = 8; + REG_NR44 = 0x80; + } +#if !PLATFORM_GBA + cgb_set_envelope(chanNum - 1, 8); + cgb_trigger_note(chanNum - 1); +#endif +} + +static inline int CgbPan(struct MixerSource *chan) +{ + u32 rightVol = chan->rightVol; + u32 leftVol = chan->leftVol; + + if ((rightVol = (u8)rightVol) >= (leftVol = (u8)leftVol)) { + if (rightVol / 2 >= leftVol) { + chan->data.cgb.pan = 0x0F; + return 1; + } + } else { + if (leftVol / 2 >= rightVol) { + chan->data.cgb.pan = 0xF0; + return 1; + } + } + + return 0; +} + +void CgbModVol(struct MixerSource *chan) +{ + if (!CgbPan(chan)) { + chan->data.cgb.pan = 0xFF; + chan->data.cgb.envelopeGoal = (u32)(chan->rightVol + chan->leftVol) / 16; + } else { + chan->data.cgb.envelopeGoal = (u32)(chan->rightVol + chan->leftVol) / 16; + + if (chan->data.cgb.envelopeGoal > 15) + chan->data.cgb.envelopeGoal = 15; + } + + chan->data.cgb.sustainGoal = (chan->data.cgb.envelopeGoal * chan->data.cgb.sustain + 15) >> 4; + chan->data.cgb.pan &= chan->data.cgb.panMask; +} + +void CgbSound(void) +{ + s32 ch; + struct MixerSource *channels; + s32 prevC15; + struct SoundMixerState *soundInfo = SOUND_INFO_PTR; + vu8 *nrx0ptr; + vu8 *nrx1ptr; + vu8 *nrx2ptr; + vu8 *nrx3ptr; + vu8 *nrx4ptr; + s32 envelopeStepTimeAndDir; + + // Most comparision operations that cast to s8 perform 'and' by 0xFF. + int mask = 0xff; + + if (soundInfo->cgbCounter15) + soundInfo->cgbCounter15--; + else + soundInfo->cgbCounter15 = 14; + + for (ch = 1, channels = soundInfo->cgbChans; ch <= 4; ch++, channels++) { + if (!(channels->status & SOUND_CHANNEL_SF_ON)) + continue; + + /* 1. determine hardware channel registers */ + switch (ch) { + case 1: + nrx0ptr = ®_NR10; + nrx1ptr = ®_NR11; + nrx2ptr = ®_NR12; + nrx3ptr = ®_NR13; + nrx4ptr = ®_NR14; + break; + case 2: + nrx0ptr = (vu8 *)(REG_ADDR_NR10 + 1); + nrx1ptr = ®_NR21; + nrx2ptr = ®_NR22; + nrx3ptr = ®_NR23; + nrx4ptr = ®_NR24; + break; + case 3: + nrx0ptr = ®_NR30; + nrx1ptr = ®_NR31; + nrx2ptr = ®_NR32; + nrx3ptr = ®_NR33; + nrx4ptr = ®_NR34; + break; + default: + nrx0ptr = (vu8 *)(REG_ADDR_NR30 + 1); + nrx1ptr = ®_NR41; + nrx2ptr = ®_NR42; + nrx3ptr = ®_NR43; + nrx4ptr = ®_NR44; + break; + } + + prevC15 = soundInfo->cgbCounter15; + envelopeStepTimeAndDir = *nrx2ptr; + + /* 2. calculate envelope volume */ + if (channels->status & SOUND_CHANNEL_SF_START) { + if (!(channels->status & SOUND_CHANNEL_SF_STOP)) { + channels->status = SOUND_CHANNEL_SF_ENV_ATTACK; + channels->data.cgb.cgbStatus = CGB_CHANNEL_MO_PIT | CGB_CHANNEL_MO_VOL; + CgbModVol(channels); + switch (ch) { + case 1: + *nrx0ptr = channels->data.cgb.sweep; +#if !PLATFORM_GBA + cgb_set_sweep(channels->data.cgb.sweep); +#endif + // fallthrough + case 2: + *nrx1ptr = ((intptr_t)channels->wav << 6) + channels->data.cgb.length; + goto init_env_step_time_dir; + case 3: + if (channels->wav != channels->current) { + *nrx0ptr = 0x40; + REG_WAVE_RAM0 = ((u32 *)channels->wav)[0]; + REG_WAVE_RAM1 = ((u32 *)channels->wav)[1]; + REG_WAVE_RAM2 = ((u32 *)channels->wav)[2]; + REG_WAVE_RAM3 = ((u32 *)channels->wav)[3]; + channels->current = channels->wav; +#if !PLATFORM_GBA + cgb_set_wavram(); +#endif + } + *nrx0ptr = 0; + *nrx1ptr = channels->data.cgb.length; + if (channels->data.cgb.length) + channels->data.cgb.nrx4 = 0xC0; + else + channels->data.cgb.nrx4 = 0x80; + break; + default: + *nrx1ptr = channels->data.cgb.length; + *nrx3ptr = (intptr_t)channels->wav << 3; + init_env_step_time_dir: + envelopeStepTimeAndDir = channels->data.cgb.attack + CGB_NRx2_ENV_DIR_INC; + if (channels->data.cgb.length) + channels->data.cgb.nrx4 = 0x40; + else + channels->data.cgb.nrx4 = 0x00; + break; + } +#if !PLATFORM_GBA + cgb_set_length(ch - 1, channels->data.cgb.length); +#endif + channels->data.cgb.envelopeCtr = channels->data.cgb.attack; + if ((s8)(channels->data.cgb.attack & mask)) { + channels->data.cgb.envelopeVol = 0; + goto envelope_step_complete; + } else { + // skip attack phase if attack is instantaneous (=0) + goto envelope_decay_start; + } + } else { + goto oscillator_off; + } + } else if (channels->status & SOUND_CHANNEL_SF_IEC) { + channels->data.cgb.echoLen--; + if ((s8)(channels->data.cgb.echoLen & mask) <= 0) { + oscillator_off: + CgbOscOff(ch); + channels->status = 0; + goto channel_complete; + } + goto envelope_complete; + } else if ((channels->status & SOUND_CHANNEL_SF_STOP) && (channels->status & SOUND_CHANNEL_SF_ENV)) { + channels->status &= ~SOUND_CHANNEL_SF_ENV; + channels->data.cgb.envelopeCtr = channels->data.cgb.release; + if ((s8)(channels->data.cgb.release & mask)) { + channels->data.cgb.cgbStatus |= CGB_CHANNEL_MO_VOL; + if (ch != 3) + envelopeStepTimeAndDir = channels->data.cgb.release | CGB_NRx2_ENV_DIR_DEC; + goto envelope_step_complete; + } else { + goto envelope_pseudoecho_start; + } + } else { + envelope_step_repeat: + if (channels->data.cgb.envelopeCtr == 0) { + if (ch == 3) + channels->data.cgb.cgbStatus |= CGB_CHANNEL_MO_VOL; + + CgbModVol(channels); + if ((channels->status & SOUND_CHANNEL_SF_ENV) == SOUND_CHANNEL_SF_ENV_RELEASE) { + channels->data.cgb.envelopeVol--; + if ((s8)(channels->data.cgb.envelopeVol & mask) <= 0) { + envelope_pseudoecho_start: + channels->data.cgb.envelopeVol = ((channels->data.cgb.envelopeGoal * channels->data.cgb.echoVol) + 0xFF) >> 8; + if (channels->data.cgb.envelopeVol) { + channels->status |= SOUND_CHANNEL_SF_IEC; + channels->data.cgb.cgbStatus |= CGB_CHANNEL_MO_VOL; + if (ch != 3) + envelopeStepTimeAndDir = 0 | CGB_NRx2_ENV_DIR_INC; + goto envelope_complete; + } else { + goto oscillator_off; + } + } else { + channels->data.cgb.envelopeCtr = channels->data.cgb.release; + } + } else if ((channels->status & SOUND_CHANNEL_SF_ENV) == SOUND_CHANNEL_SF_ENV_SUSTAIN) { + envelope_sustain: + channels->data.cgb.envelopeVol = channels->data.cgb.sustainGoal; + channels->data.cgb.envelopeCtr = 7; + } else if ((channels->status & SOUND_CHANNEL_SF_ENV) == SOUND_CHANNEL_SF_ENV_DECAY) { + int envelopeVol, sustainGoal; + + channels->data.cgb.envelopeVol--; + envelopeVol = (s8)(channels->data.cgb.envelopeVol & mask); + sustainGoal = (s8)(channels->data.cgb.sustainGoal); + if (envelopeVol <= sustainGoal) { + envelope_sustain_start: + if (channels->data.cgb.sustain == 0) { + channels->status &= ~SOUND_CHANNEL_SF_ENV; + goto envelope_pseudoecho_start; + } else { + channels->status--; + channels->data.cgb.cgbStatus |= CGB_CHANNEL_MO_VOL; + if (ch != 3) + envelopeStepTimeAndDir = 0 | CGB_NRx2_ENV_DIR_INC; + goto envelope_sustain; + } + } else { + channels->data.cgb.envelopeCtr = channels->data.cgb.decay; + } + } else { + channels->data.cgb.envelopeVol++; + if ((u8)(channels->data.cgb.envelopeVol & mask) >= channels->data.cgb.envelopeGoal) { + envelope_decay_start: + channels->status--; + channels->data.cgb.envelopeCtr = channels->data.cgb.decay; + if ((u8)(channels->data.cgb.envelopeCtr & mask)) { + channels->data.cgb.cgbStatus |= CGB_CHANNEL_MO_VOL; + channels->data.cgb.envelopeVol = channels->data.cgb.envelopeGoal; + if (ch != 3) + envelopeStepTimeAndDir = channels->data.cgb.decay | CGB_NRx2_ENV_DIR_DEC; + } else { + goto envelope_sustain_start; + } + } else { + channels->data.cgb.envelopeCtr = channels->data.cgb.attack; + } + } + } + } + + envelope_step_complete: + // every 15 frames, envelope calculation has to be done twice + // to keep up with the hardware envelope rate (1/64 s) + channels->data.cgb.envelopeCtr--; + if (prevC15 == 0) { + prevC15--; + goto envelope_step_repeat; + } + + envelope_complete: + /* 3. apply pitch to HW registers */ + if (channels->data.cgb.cgbStatus & CGB_CHANNEL_MO_PIT) { + if (ch < 4 && (channels->type & TONEDATA_TYPE_FIX)) { + int dac_pwm_rate = REG_SOUNDBIAS_H; + + if (dac_pwm_rate < 0x40) // if PWM rate = 32768 Hz + channels->data.cgb.freq = (channels->data.cgb.freq + 2) & 0x7fc; + else if (dac_pwm_rate < 0x80) // if PWM rate = 65536 Hz + channels->data.cgb.freq = (channels->data.cgb.freq + 1) & 0x7fe; + } + + if (ch != 4) + *nrx3ptr = channels->data.cgb.freq; + else + *nrx3ptr = (*nrx3ptr & 0x08) | channels->data.cgb.freq; + channels->data.cgb.nrx4 = (channels->data.cgb.nrx4 & 0xC0) + (*((u8 *)(&channels->data.cgb.freq) + 1)); + *nrx4ptr = (s8)(channels->data.cgb.nrx4 & mask); + } + + /* 4. apply envelope & volume to HW registers */ + if (channels->data.cgb.cgbStatus & CGB_CHANNEL_MO_VOL) { + REG_NR51 = (REG_NR51 & ~channels->data.cgb.panMask) | channels->data.cgb.pan; + if (ch == 3) { + *nrx2ptr = gCgb3Vol[channels->data.cgb.envelopeVol]; + if (channels->data.cgb.nrx4 & 0x80) { + *nrx0ptr = 0x80; + *nrx4ptr = channels->data.cgb.nrx4; + channels->data.cgb.nrx4 &= 0x7f; + } + } else { + u32 envMask = 0xF; + *nrx2ptr = (envelopeStepTimeAndDir & envMask) + (channels->data.cgb.envelopeVol << 4); + *nrx4ptr = channels->data.cgb.nrx4 | 0x80; + if (ch == 1 && !(*nrx0ptr & 0x08)) + *nrx4ptr = channels->data.cgb.nrx4 | 0x80; + } +#if !PLATFORM_GBA + cgb_set_envelope(ch - 1, *nrx2ptr); + cgb_toggle_length(ch - 1, (*nrx4ptr & 0x40)); + cgb_trigger_note(ch - 1); +#endif + } + + channel_complete: + channels->data.cgb.cgbStatus = 0; + } +} + +void m4aMPlayTempoControl(struct MP2KPlayerState *mplayInfo, u16 tempo) +{ + if (mplayInfo->lockStatus == ID_NUMBER) { + mplayInfo->lockStatus++; + mplayInfo->tempoScale = tempo; + mplayInfo->tempoInterval = (mplayInfo->tempoRawBPM * mplayInfo->tempoScale) >> 8; + mplayInfo->lockStatus = ID_NUMBER; + } +} + +void m4aMPlayVolumeControl(struct MP2KPlayerState *mplayInfo, u16 trackBits, u16 volume) +{ + s32 i; + u32 bit; + struct MP2KTrack *track; + + if (mplayInfo->lockStatus != ID_NUMBER) + return; + + mplayInfo->lockStatus++; + + i = mplayInfo->trackCount; + track = mplayInfo->tracks; + bit = 1; + + while (i > 0) { + if (trackBits & bit) { + if (track->status & MPT_FLG_EXIST) { + track->volPublic = volume / 4; + track->status |= MPT_FLG_VOLCHG; + } + } + + i--; + track++; + bit <<= 1; + } + + mplayInfo->lockStatus = ID_NUMBER; +} + +void m4aMPlayPitchControl(struct MP2KPlayerState *mplayInfo, u16 trackBits, s16 pitch) +{ + s32 i; + u32 bit; + struct MP2KTrack *track; + + if (mplayInfo->lockStatus != ID_NUMBER) + return; + + mplayInfo->lockStatus++; + + i = mplayInfo->trackCount; + track = mplayInfo->tracks; + bit = 1; + + while (i > 0) { + if (trackBits & bit) { + if (track->status & MPT_FLG_EXIST) { + track->keyShiftPublic = pitch >> 8; + track->pitchPublic = pitch; + track->status |= MPT_FLG_PITCHG; + } + } + + i--; + track++; + bit <<= 1; + } + + mplayInfo->lockStatus = ID_NUMBER; +} + +void m4aMPlayPanpotControl(struct MP2KPlayerState *mplayInfo, u16 trackBits, s8 pan) +{ + s32 i; + u32 bit; + struct MP2KTrack *track; + + if (mplayInfo->lockStatus != ID_NUMBER) + return; + + mplayInfo->lockStatus++; + + i = mplayInfo->trackCount; + track = mplayInfo->tracks; + bit = 1; + + while (i > 0) { + if (trackBits & bit) { + if (track->status & MPT_FLG_EXIST) { + track->panPublic = pan; + track->status |= MPT_FLG_VOLCHG; + } + } + + i--; + track++; + bit <<= 1; + } + + mplayInfo->lockStatus = ID_NUMBER; +} + +void ClearModM(struct MP2KTrack *track) +{ + track->lfoSpeedCounter = 0; + track->modCalculated = 0; + + if (track->modType == 0) + track->status |= MPT_FLG_PITCHG; + else + track->status |= MPT_FLG_VOLCHG; +} + +void m4aMPlayModDepthSet(struct MP2KPlayerState *mplayInfo, u16 trackBits, u8 modDepth) +{ + s32 i; + u32 bit; + struct MP2KTrack *track; + + if (mplayInfo->lockStatus != ID_NUMBER) + return; + + mplayInfo->lockStatus++; + + i = mplayInfo->trackCount; + track = mplayInfo->tracks; + bit = 1; + + while (i > 0) { + if (trackBits & bit) { + if (track->status & MPT_FLG_EXIST) { + track->modDepth = modDepth; + + if (!track->modDepth) + ClearModM(track); + } + } + + i--; + track++; + bit <<= 1; + } + + mplayInfo->lockStatus = ID_NUMBER; +} + +void m4aMPlayLFOSpeedSet(struct MP2KPlayerState *mplayInfo, u16 trackBits, u8 lfoSpeed) +{ + s32 i; + u32 bit; + struct MP2KTrack *track; + + if (mplayInfo->lockStatus != ID_NUMBER) + return; + + mplayInfo->lockStatus++; + + i = mplayInfo->trackCount; + track = mplayInfo->tracks; + bit = 1; + + while (i > 0) { + if (trackBits & bit) { + if (track->status & MPT_FLG_EXIST) { + track->lfoSpeed = lfoSpeed; + + if (!track->lfoSpeed) + ClearModM(track); + } + } + + i--; + track++; + bit <<= 1; + } + + mplayInfo->lockStatus = ID_NUMBER; +} + +#define MEMACC_COND_JUMP(cond) \ + if (cond) \ + goto cond_true; \ + else \ + goto cond_false; + +void MP2K_event_memacc(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + u32 op; + u8 *addr; + u8 data; + + op = *track->cmdPtr; + track->cmdPtr++; + + addr = mplayInfo->memAccArea + *track->cmdPtr; + track->cmdPtr++; + + data = *track->cmdPtr; + track->cmdPtr++; + + switch (op) { + case 0: + *addr = data; + return; + case 1: + *addr += data; + return; + case 2: + *addr -= data; + return; + case 3: + *addr = mplayInfo->memAccArea[data]; + return; + case 4: + *addr += mplayInfo->memAccArea[data]; + return; + case 5: + *addr -= mplayInfo->memAccArea[data]; + return; + case 6: + MEMACC_COND_JUMP(*addr == data) + return; + case 7: + MEMACC_COND_JUMP(*addr != data) + return; + case 8: + MEMACC_COND_JUMP(*addr > data) + return; + case 9: + MEMACC_COND_JUMP(*addr >= data) + return; + case 10: + MEMACC_COND_JUMP(*addr <= data) + return; + case 11: + MEMACC_COND_JUMP(*addr < data) + return; + case 12: + MEMACC_COND_JUMP(*addr == mplayInfo->memAccArea[data]) + return; + case 13: + MEMACC_COND_JUMP(*addr != mplayInfo->memAccArea[data]) + return; + case 14: + MEMACC_COND_JUMP(*addr > mplayInfo->memAccArea[data]) + return; + case 15: + MEMACC_COND_JUMP(*addr >= mplayInfo->memAccArea[data]) + return; + case 16: + MEMACC_COND_JUMP(*addr <= mplayInfo->memAccArea[data]) + return; + case 17: + MEMACC_COND_JUMP(*addr < mplayInfo->memAccArea[data]) + return; + default: + return; + } + +cond_true : { + { + void (*func)(struct MP2KPlayerState *, struct MP2KTrack *) = *(&gMPlayJumpTable[1]); + func(mplayInfo, track); + } + return; +} + +cond_false: + track->cmdPtr += 4; +} + +void MP2K_event_xcmd(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + u32 n = *track->cmdPtr; + track->cmdPtr++; + + gXcmdTable[n](mplayInfo, track); +} + +void MP2K_event_xxx(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + void (*func)(struct MP2KPlayerState *, struct MP2KTrack *) = *(&gMPlayJumpTable[0]); + func(mplayInfo, track); +} + +#define READ_XCMD_BYTE(var, n) \ + { \ + u32 byte = track->cmdPtr[(n)]; \ + byte <<= n * 8; \ + (var) &= ~(0xFF << (n * 8)); \ + (var) |= byte; \ + } + +void MP2K_event_xwave(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + uintptr_t wav; + +#ifdef BUG_FIX + wav = 0; +#endif + + READ_XCMD_BYTE(wav, 0) // UB: uninitialized variable + READ_XCMD_BYTE(wav, 1) + READ_XCMD_BYTE(wav, 2) + READ_XCMD_BYTE(wav, 3) + + track->voicegroup.data.sound.wav = (struct WaveData *)wav; + track->cmdPtr += 4; +} + +void MP2K_event_xtype(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + track->voicegroup.type = *track->cmdPtr; + track->cmdPtr++; +} + +void MP2K_event_xatta(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + track->voicegroup.data.sound.attack = *track->cmdPtr; + track->cmdPtr++; +} + +void MP2K_event_xdeca(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + track->voicegroup.data.sound.decay = *track->cmdPtr; + track->cmdPtr++; +} + +void MP2K_event_xsust(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + track->voicegroup.data.sound.sustain = *track->cmdPtr; + track->cmdPtr++; +} + +void MP2K_event_xrele(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + track->voicegroup.data.sound.release = *track->cmdPtr; + track->cmdPtr++; +} + +void MP2K_event_xiecv(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + track->echoVolume = *track->cmdPtr; + track->cmdPtr++; +} + +void MP2K_event_xiecl(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + track->echoLength = *track->cmdPtr; + track->cmdPtr++; +} + +void MP2K_event_xleng(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + track->voicegroup.cgbLength = *track->cmdPtr; + track->cmdPtr++; +} + +void MP2K_event_xswee(struct MP2KPlayerState *mplayInfo, struct MP2KTrack *track) +{ + track->voicegroup.pan_sweep = *track->cmdPtr; + track->cmdPtr++; +} + +void MP2K_event_null(void) { } diff --git a/src/lib/m4a/m4a0.s b/src/lib/m4a/m4a0.s new file mode 100644 index 000000000..7f000b7f0 --- /dev/null +++ b/src/lib/m4a/m4a0.s @@ -0,0 +1,1905 @@ + .include "asm/macros.inc" + .include "constants/gba_constants.inc" + .include "constants/m4a_constants.inc" + + .syntax unified + + .text + + thumb_func_start umul3232H32 +umul3232H32: + adr r2, __umul3232H32 + bx r2 + .arm +__umul3232H32: + umull r2, r3, r0, r1 + add r0, r3, 0 + bx lr + thumb_func_end umul3232H32 + + thumb_func_start SoundMain +SoundMain: + ldr r0, lt_SOUND_INFO_PTR + ldr r0, [r0] + ldr r2, lt_ID_NUMBER + ldr r3, [r0, o_SoundInfo_ident] + cmp r2, r3 + beq SoundMain_1 + bx lr @ Exit the function if ident doesn't match ID_NUMBER. +SoundMain_1: + adds r3, 1 + str r3, [r0, o_SoundInfo_ident] + push {r4-r7,lr} + mov r1, r8 + mov r2, r9 + mov r3, r10 + mov r4, r11 + push {r0-r4} + sub sp, 0x18 + ldrb r1, [r0, o_SoundInfo_maxLines] + cmp r1, 0 @ if maxLines is 0, there is no maximum + beq SoundMain_3 + ldr r2, lt_REG_VCOUNT + ldrb r2, [r2] + cmp r2, VCOUNT_VBLANK + bhs SoundMain_2 + adds r2, TOTAL_SCANLINES +SoundMain_2: + adds r1, r2 +SoundMain_3: + str r1, [sp, 0x14] + ldr r3, [r0, o_SoundInfo_MPlayMainHead] + cmp r3, 0 + beq SoundMain_4 + ldr r0, [r0, o_SoundInfo_musicPlayerHead] + bl _081DD25E + ldr r0, [sp, 0x18] +SoundMain_4: + ldr r3, [r0, o_SoundInfo_CgbSound] + bl _081DD25E + ldr r0, [sp, 0x18] + ldr r3, [r0, o_SoundInfo_pcmSamplesPerVBlank] + mov r8, r3 + ldr r5, lt_o_SoundInfo_pcmBuffer + adds r5, r0 + ldrb r4, [r0, o_SoundInfo_pcmDmaCounter] + subs r7, r4, 1 + bls SoundMain_5 + ldrb r1, [r0, o_SoundInfo_pcmDmaPeriod] + subs r1, r7 + mov r2, r8 + muls r2, r1 + adds r5, r2 +SoundMain_5: + str r5, [sp, 0x8] + ldr r6, lt_PCM_DMA_BUF_SIZE + ldr r3, lt_SoundMainRAM_Buffer + bx r3 + + .align 2, 0 +lt_SOUND_INFO_PTR: .word SOUND_INFO_PTR +lt_ID_NUMBER: .word ID_NUMBER +lt_SoundMainRAM_Buffer: .word SoundMainRAM_Buffer + 1 +lt_REG_VCOUNT: .word REG_VCOUNT +lt_o_SoundInfo_pcmBuffer: .word o_SoundInfo_pcmBuffer +lt_PCM_DMA_BUF_SIZE: .word PCM_DMA_BUF_SIZE + thumb_func_end SoundMain + + thumb_func_start SoundMainRAM +SoundMainRAM: + ldrb r3, [r0, o_SoundInfo_reverb] + cmp r3, 0 + beq SoundMainRAM_NoReverb + adr r1, SoundMainRAM_Reverb + bx r1 + .arm +SoundMainRAM_Reverb: + cmp r4, 0x2 + addeq r7, r0, o_SoundInfo_pcmBuffer + addne r7, r5, r8 + mov r4, r8 +_081DCEC4: + ldrsb r0, [r5, r6] + ldrsb r1, [r5] + add r0, r0, r1 + ldrsb r1, [r7, r6] + add r0, r0, r1 + ldrsb r1, [r7], 0x1 + add r0, r0, r1 + mul r1, r0, r3 + mov r0, r1, asr 9 + tst r0, 0x80 + addne r0, r0, 0x1 + strb r0, [r5, r6] + strb r0, [r5], 0x1 + subs r4, r4, 0x1 + bgt _081DCEC4 + adr r0, _081DCF36 + 1 @ plus 1 because THUMB + bx r0 + .thumb +SoundMainRAM_NoReverb: + movs r0, 0 + mov r1, r8 + adds r6, r5 + lsrs r1, 3 + bcc SoundMainRAM_NoReverb_Ok + stm r5!, {r0} + stm r6!, {r0} +SoundMainRAM_NoReverb_Ok: + lsrs r1, 1 + bcc SoundMainRAM_NoReverb_Loop + stm r5!, {r0} + stm r6!, {r0} + stm r5!, {r0} + stm r6!, {r0} +SoundMainRAM_NoReverb_Loop: + stm r5!, {r0} + stm r6!, {r0} + stm r5!, {r0} + stm r6!, {r0} + stm r5!, {r0} + stm r6!, {r0} + stm r5!, {r0} + stm r6!, {r0} + subs r1, 1 + bgt SoundMainRAM_NoReverb_Loop +_081DCF36: + ldr r4, [sp, 0x18] + ldr r0, [r4, o_SoundInfo_divFreq] + mov r12, r0 + ldrb r0, [r4, o_SoundInfo_maxChans] + adds r4, o_SoundInfo_chans + +SoundMainRAM_ChanLoop: + str r0, [sp, 0x4] + ldr r3, [r4, o_SoundChannel_wav] + ldr r0, [sp, 0x14] + cmp r0, 0 + beq _081DCF60 + ldr r1, =REG_VCOUNT + ldrb r1, [r1] + cmp r1, VCOUNT_VBLANK + bhs _081DCF54 + adds r1, TOTAL_SCANLINES +_081DCF54: + cmp r1, r0 + blo _081DCF60 + b _081DD24A + + .pool + +_081DCF60: + ldrb r6, [r4, o_SoundChannel_statusFlags] + movs r0, SOUND_CHANNEL_SF_ON + tst r0, r6 + bne _081DCF6A + b _081DD240 +_081DCF6A: + movs r0, SOUND_CHANNEL_SF_START + tst r0, r6 + beq _081DCFA0 + movs r0, SOUND_CHANNEL_SF_STOP + tst r0, r6 + bne _081DCFB0 + movs r6, SOUND_CHANNEL_SF_ENV_ATTACK + strb r6, [r4, o_SoundChannel_statusFlags] + adds r0, r3, 0 + adds r0, o_WaveData_data + str r0, [r4, o_SoundChannel_currentPointer] + ldr r0, [r3, o_WaveData_size] + str r0, [r4, o_SoundChannel_count] + movs r5, 0 + strb r5, [r4, o_SoundChannel_envelopeVolume] + str r5, [r4, o_SoundChannel_fw] + ldrb r2, [r3, o_WaveData_flags] + movs r0, WAVE_DATA_FLAG_LOOP + tst r0, r2 + beq _081DCFF8 + movs r0, SOUND_CHANNEL_SF_LOOP + orrs r6, r0 + strb r6, [r4, o_SoundChannel_statusFlags] + b _081DCFF8 +_081DCFA0: + ldrb r5, [r4, o_SoundChannel_envelopeVolume] + movs r0, SOUND_CHANNEL_SF_IEC + tst r0, r6 + beq _081DCFB6 + ldrb r0, [r4, o_SoundChannel_pseudoEchoLength] + subs r0, 1 + strb r0, [r4, o_SoundChannel_pseudoEchoLength] + bhi _081DD006 +_081DCFB0: + movs r0, 0 + strb r0, [r4, o_SoundChannel_statusFlags] + b _081DD240 +_081DCFB6: + movs r0, SOUND_CHANNEL_SF_STOP + tst r0, r6 + beq _081DCFD6 + ldrb r0, [r4, o_SoundChannel_release] + muls r5, r0 + lsrs r5, 8 + ldrb r0, [r4, o_SoundChannel_pseudoEchoVolume] + cmp r5, r0 + bhi _081DD006 +_081DCFC8: + ldrb r5, [r4, o_SoundChannel_pseudoEchoVolume] + cmp r5, 0 + beq _081DCFB0 + movs r0, SOUND_CHANNEL_SF_IEC + orrs r6, r0 + strb r6, [r4, o_SoundChannel_statusFlags] + b _081DD006 +_081DCFD6: + movs r2, SOUND_CHANNEL_SF_ENV + ands r2, r6 + cmp r2, SOUND_CHANNEL_SF_ENV_DECAY + bne _081DCFF4 + ldrb r0, [r4, o_SoundChannel_decay] + muls r5, r0 + lsrs r5, 8 + ldrb r0, [r4, o_SoundChannel_sustain] + cmp r5, r0 + bhi _081DD006 + adds r5, r0, 0 + beq _081DCFC8 + subs r6, 0x1 + strb r6, [r4, o_SoundChannel_statusFlags] + b _081DD006 +_081DCFF4: + cmp r2, SOUND_CHANNEL_SF_ENV_ATTACK + bne _081DD006 +_081DCFF8: + ldrb r0, [r4, o_SoundChannel_attack] + adds r5, r0 + cmp r5, 0xFF + bcc _081DD006 + movs r5, 0xFF + subs r6, 0x1 + strb r6, [r4, o_SoundChannel_statusFlags] +_081DD006: + strb r5, [r4, o_SoundChannel_envelopeVolume] + ldr r0, [sp, 0x18] + ldrb r0, [r0, o_SoundChannel_release] + adds r0, 0x1 + muls r0, r5 + lsrs r5, r0, 4 + ldrb r0, [r4, o_SoundChannel_rightVolume] + muls r0, r5 + lsrs r0, 8 + strb r0, [r4, o_SoundChannel_envelopeVolumeRight] + ldrb r0, [r4, o_SoundChannel_leftVolume] + muls r0, r5 + lsrs r0, 8 + strb r0, [r4, o_SoundChannel_envelopeVolumeLeft] + movs r0, SOUND_CHANNEL_SF_LOOP + ands r0, r6 + str r0, [sp, 0x10] + beq _081DD03A + adds r0, r3, 0 + adds r0, o_WaveData_data + ldr r1, [r3, o_WaveData_loopStart] + adds r0, r1 + str r0, [sp, 0xC] + ldr r0, [r3, o_WaveData_size] + subs r0, r1 + str r0, [sp, 0x10] +_081DD03A: + ldr r5, [sp, 0x8] + ldr r2, [r4, o_SoundChannel_count] + ldr r3, [r4, o_SoundChannel_currentPointer] + adr r0, _081DD044 + bx r0 + .arm +_081DD044: + str r8, [sp] + ldrb r10, [r4, o_SoundChannel_envelopeVolumeRight] + ldrb r11, [r4, o_SoundChannel_envelopeVolumeLeft] + lsl sl, sl, #0x10 + lsl fp, fp, #0x10 + ldrb r0, [r4, o_SoundChannel_type] + tst r0, 0x8 + beq _081DD19C +_081DD07C: + cmp r2, 0x4 + ble _081DD0EC + subs r2, r2, r8 + movgt lr, 0 + bgt _081DD0A8 + mov lr, r8 + add r2, r2, r8 + sub r8, r2, 0x4 + sub lr, lr, r8 + ands r2, r2, 0x3 + moveq r2, 0x4 +_081DD0A8: + ldr r6, [r5] + ldr r7, [r5, PCM_DMA_BUF_SIZE] +_081DD0B0: + ldrsb r0, [r3], 0x1 + mul r1, r10, r0 + bic r1, r1, 0xFF0000 + add r6, r1, r6, ror 8 + mul r1, r11, r0 + bic r1, r1, 0xFF0000 + add r7, r1, r7, ror 8 + adds r5, r5, 0x40000000 + bcc _081DD0B0 + str r7, [r5, PCM_DMA_BUF_SIZE] + str r6, [r5], 0x4 + subs r8, r8, 0x4 + bgt _081DD0A8 + adds r8, r8, lr + beq _081DD22C +_081DD0EC: + ldr r6, [r5] + ldr r7, [r5, PCM_DMA_BUF_SIZE] +_081DD0F4: + ldrsb r0, [r3], 0x1 + mul r1, r10, r0 + bic r1, r1, 0xFF0000 + add r6, r1, r6, ror 8 + mul r1, r11, r0 + bic r1, r1, 0xFF0000 + add r7, r1, r7, ror 8 + subs r2, r2, 0x1 + beq _081DD164 +_081DD118: + adds r5, r5, 0x40000000 + bcc _081DD0F4 + str r7, [r5, PCM_DMA_BUF_SIZE] + str r6, [r5], 0x4 + subs r8, r8, 0x4 + bgt _081DD07C + b _081DD22C +_081DD134: + ldr r0, [sp, 0x18] + cmp r0, 0 + beq _081DD158 + ldr r3, [sp, 0x14] + rsb sb, r2, 0 +_081DD148: + adds r2, r0, r2 + bgt _081DD1FC + sub sb, sb, r0 + b _081DD148 +_081DD158: + pop {r4,r12} + mov r2, 0 + b _081DD174 +_081DD164: + ldr r2, [sp, 0x10] + cmp r2, 0 + ldrne r3, [sp, 0xC] + bne _081DD118 +_081DD174: + strb r2, [r4, o_SoundChannel_statusFlags] + mov r0, r5, lsr 30 + bic r5, r5, 0xC0000000 + rsb r0, r0, 0x3 + mov r0, r0, lsl 3 + mov r6, r6, ror r0 + mov r7, r7, ror r0 + str r7, [r5, PCM_DMA_BUF_SIZE] + str r6, [r5], 0x4 + b _081DD234 +_081DD19C: + push {r4,r12} + ldr lr, [r4, #0x1c] + ldr r1, [r4, o_SoundChannel_frequency] + mul r4, r12, r1 + ldrsb r0, [r3] + ldrsb r1, [r3, 0x1]! + sub r1, r1, r0 +_081DD1B4: + ldr r6, [r5] + ldr r7, [r5, PCM_DMA_BUF_SIZE] +_081DD1BC: + mul sb, lr, r1 + add sb, r0, sb, asr 23 + mul r12, r10, sb + bic r12, r12, 0xFF0000 + add r6, r12, r6, ror 8 + mul r12, r11, sb + bic r12, r12, 0xFF0000 + add r7, r12, r7, ror 8 + add lr, lr, r4 + lsrs sb, lr, 23 + beq _081DD208 + bic lr, lr, 0x3F800000 + subs r2, r2, sb + ble _081DD134 + subs sb, sb, 0x1 + addeq r0, r0, r1 +_081DD1FC: + ldrsbne r0, [r3, sb]! + ldrsb r1, [r3, 0x1]! + sub r1, r1, r0 +_081DD208: + adds r5, r5, 0x40000000 + bcc _081DD1BC + str r7, [r5, PCM_DMA_BUF_SIZE] + str r6, [r5], 0x4 + subs r8, r8, 0x4 + bgt _081DD1B4 + sub r3, r3, 0x1 + pop {r4,r12} + str lr, [r4, o_SoundChannel_fw] +_081DD22C: + str r2, [r4, o_SoundChannel_count] + str r3, [r4, o_SoundChannel_currentPointer] +_081DD234: + ldr r8, [sp] + add r0, pc, 0x1 + bx r0 + .thumb +_081DD240: + ldr r0, [sp, 0x4] + subs r0, 1 + ble _081DD24A + adds r4, SoundChannel_size + b SoundMainRAM_ChanLoop +_081DD24A: + ldr r0, [sp, 0x18] + ldr r3, =ID_NUMBER + str r3, [r0] + add sp, 0x1C + pop {r0-r7} + mov r8, r0 + mov r9, r1 + mov r10, r2 + mov r11, r3 + pop {r3} +_081DD25E: + bx r3 + .pool + thumb_func_end SoundMainRAM + +@ Not present in GBA SDK 3.0 +.if 0 + arm_func_start SoundMainRAM_Unk1 +SoundMainRAM_Unk1: + ldr r6, [r4, o_SoundChannel_wav] + ldrb r0, [r4, o_SoundChannel_statusFlags] + tst r0, SOUND_CHANNEL_SF_SPECIAL + bne _081DD2B4 + orr r0, r0, SOUND_CHANNEL_SF_SPECIAL + strb r0, [r4, o_SoundChannel_statusFlags] + ldrb r0, [r4, o_SoundChannel_type] + tst r0, TONEDATA_TYPE_REV + beq _081DD29C + ldr r1, [r6, o_WaveData_size] + add r1, r1, r6, lsl 1 + add r1, r1, 0x20 + sub r3, r1, r3 + str r3, [r4, o_SoundChannel_currentPointer] +_081DD29C: + ldrh r0, [r6, o_WaveData_type] + cmp r0, 0 + beq _081DD2B4 + sub r3, r3, r6 + sub r3, r3, 0x10 + str r3, [r4, o_SoundChannel_currentPointer] +_081DD2B4: + push {r8,r12,lr} + mov r10, r10, lsl 16 + mov r11, r11, lsl 16 + ldr r1, [r4, o_SoundChannel_frequency] + ldrb r0, [r4, o_SoundChannel_type] + tst r0, TONEDATA_TYPE_FIX + movne r8, 0x800000 + muleq r8, r12, r1 + ldrh r0, [r6, o_WaveData_type] + cmp r0, 0 + beq _081DD468 + mov r0, 0xFF000000 + str r0, [r4, o_SoundChannel_xpi] + ldrb r0, [r4, o_SoundChannel_type] + tst r0, TONEDATA_TYPE_REV + bne _081DD3C0 + bl SoundMainRAM_Unk2 + mov r0, r1 + add r3, r3, 0x1 + bl SoundMainRAM_Unk2 + sub r1, r1, r0 +_081DD308: + ldr r6, [r5] + ldr r7, [r5, PCM_DMA_BUF_SIZE] +_081DD310: + mul lr, r9, r1 + add lr, r0, lr, asr 23 + mul r12, r10, lr + bic r12, r12, 0xFF0000 + add r6, r12, r6, ror 8 + mul r12, r11, lr + bic r12, r12, 0xFF0000 + add r7, r12, r7, ror 8 + add r9, r9, r8 + movs lr, r9, lsr 23 + beq _081DD370 + bic r9, r9, 0x3F800000 + subs r2, r2, lr + ble _081DD398 + subs lr, lr, 0x1 + bne _081DD358 + add r0, r0, r1 + b _081DD364 +_081DD358: + add r3, r3, lr + bl SoundMainRAM_Unk2 + mov r0, r1 +_081DD364: + add r3, r3, 0x1 + bl SoundMainRAM_Unk2 + sub r1, r1, r0 +_081DD370: + adds r5, r5, 0x40000000 + bcc _081DD310 + str r7, [r5, PCM_DMA_BUF_SIZE] + str r6, [r5], 0x4 + ldr r6, [sp] + subs r6, r6, 0x4 + str r6, [sp] + bgt _081DD308 + sub r3, r3, 0x1 + b _081DD4F0 +_081DD398: + ldr r0, [sp, 0x1C] + cmp r0, 0 + beq _081DD4F4 + ldr r3, [r4, o_SoundChannel_wav] + ldr r3, [r3, o_WaveData_loopStart] + rsb lr, r2, 0 +_081DD3B0: + adds r2, r2, r0 + bgt _081DD358 + sub lr, lr, r0 + b _081DD3B0 +_081DD3C0: + sub r3, r3, 0x1 + bl SoundMainRAM_Unk2 + mov r0, r1 + sub r3, r3, 0x1 + bl SoundMainRAM_Unk2 + sub r1, r1, r0 +_081DD3D8: + ldr r6, [r5] + ldr r7, [r5, PCM_DMA_BUF_SIZE] +_081DD3E0: + mul lr, r9, r1 + add lr, r0, lr, asr 23 + mul r12, r10, lr + bic r12, r12, 0xFF0000 + add r6, r12, r6, ror 8 + mul r12, r11, lr + bic r12, r12, 0xFF0000 + add r7, r12, r7, ror 8 + add r9, r9, r8 + movs lr, r9, lsr 23 + beq _081DD440 + bic r9, r9, 0x3F800000 + subs r2, r2, lr + ble _081DD4F4 + subs lr, lr, 0x1 + bne _081DD428 + add r0, r0, r1 + b _081DD434 +_081DD428: + sub r3, r3, lr + bl SoundMainRAM_Unk2 + mov r0, r1 +_081DD434: + sub r3, r3, 0x1 + bl SoundMainRAM_Unk2 + sub r1, r1, r0 +_081DD440: + adds r5, r5, 0x40000000 + bcc _081DD3E0 + str r7, [r5, PCM_DMA_BUF_SIZE] + str r6, [r5], 0x4 + ldr r6, [sp] + subs r6, r6, 0x4 + str r6, [sp] + bgt _081DD3D8 + add r3, r3, 0x2 + b _081DD4F0 +_081DD468: + ldrb r0, [r4, o_SoundChannel_type] + tst r0, TONEDATA_TYPE_REV + beq _081DD4F0 + ldrsb r0, [r3, -0x1]! + ldrsb r1, [r3, -0x1] + sub r1, r1, r0 +_081DD480: + ldr r6, [r5] + ldr r7, [r5, 0x630] +_081DD488: + mul lr, r9, r1 + add lr, r0, lr, asr 23 + mul r12, r10, lr + bic r12, r12, 0xFF0000 + add r6, r12, r6, ror 8 + mul r12, r11, lr + bic r12, r12, 0xFF0000 + add r7, r12, r7, ror 8 + add r9, r9, r8 + movs lr, r9, lsr 23 + beq _081DD4CC + bic r9, r9, 0x3F800000 + subs r2, r2, lr + ble _081DD4F4 + ldrsb r0, [r3, -lr]! + ldrsb r1, [r3, -0x1] + sub r1, r1, r0 +_081DD4CC: + adds r5, r5, 0x40000000 + bcc _081DD488 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + ldr r6, [sp] + subs r6, r6, 0x4 + str r6, [sp] + bgt _081DD480 + add r3, r3, 0x1 +_081DD4F0: + pop {r8,r12,pc} +_081DD4F4: + mov r2, 0 + strb r2, [r4, o_SoundChannel_statusFlags] + mov r0, r5, lsr 30 + bic r5, r5, 0xC0000000 + rsb r0, r0, 0x3 + mov r0, r0, lsl 3 + mov r6, r6, ror r0 + mov r7, r7, ror r0 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + pop {r8,r12,pc} + arm_func_end SoundMainRAM_Unk1 + +@ Not present in GBA SDK 3.0 + arm_func_start SoundMainRAM_Unk2 +SoundMainRAM_Unk2: + push {r0,r2,r5-r7,lr} + mov r0, r3, lsr 6 + ldr r1, [r4, o_SoundChannel_xpi] + cmp r0, r1 + beq _081DD594 + str r0, [r4, o_SoundChannel_xpi] + mov r1, 0x21 + mul r2, r1, r0 + ldr r1, [r4, o_SoundChannel_wav] + add r2, r2, r1 + add r2, r2, 0x10 + ldr r5, =sDecodingBuffer + ldr r6, =gDeltaEncodingTable + mov r7, 0x40 + ldrb lr, [r2], 1 + strb lr, [r5], 1 + ldrb r1, [r2], 1 + b _081DD57C +_081DD568: + ldrb r1, [r2], 1 + mov r0, r1, lsr 4 + ldrsb r0, [r6, r0] + add lr, lr, r0 + strb lr, [r5], 1 +_081DD57C: + and r0, r1, 0xF + ldrsb r0, [r6, r0] + add lr, lr, r0 + strb lr, [r5], 1 + subs r7, r7, 2 + bgt _081DD568 +_081DD594: + ldr r5, =sDecodingBuffer + and r0, r3, 0x3F + ldrsb r1, [r5, r0] + pop {r0,r2,r5-r7,pc} + .pool + arm_func_end SoundMainRAM_Unk2 +.endif + thumb_func_start SoundMainBTM +SoundMainBTM: + mov r12, r4 + movs r1, 0 + movs r2, 0 + movs r3, 0 + movs r4, 0 + stm r0!, {r1-r4} + stm r0!, {r1-r4} + stm r0!, {r1-r4} + stm r0!, {r1-r4} + mov r4, r12 + bx lr + thumb_func_end SoundMainBTM + + thumb_func_start MP2KClearChain +MP2KClearChain: + ldr r3, [r0, o_SoundChannel_track] + cmp r3, 0 + beq _081DD5E2 + ldr r1, [r0, o_SoundChannel_nextChannelPointer] + ldr r2, [r0, o_SoundChannel_prevChannelPointer] + cmp r2, 0 + beq _081DD5D6 + str r1, [r2, o_SoundChannel_nextChannelPointer] + b _081DD5D8 +_081DD5D6: + str r1, [r3, o_MusicPlayerTrack_chan] +_081DD5D8: + cmp r1, 0 + beq _081DD5DE + str r2, [r1, o_SoundChannel_prevChannelPointer] +_081DD5DE: + movs r1, 0 + str r1, [r0, o_SoundChannel_track] +_081DD5E2: + bx lr + thumb_func_end MP2KClearChain + + thumb_func_start MP2K_event_fine +MP2K_event_fine: + push {r4,r5,lr} + adds r5, r1, 0 + ldr r4, [r5, o_MusicPlayerTrack_chan] + cmp r4, 0 + beq MP2K_event_fine_done +MP2K_event_fine_loop: + ldrb r1, [r4, o_SoundChannel_statusFlags] + movs r0, SOUND_CHANNEL_SF_ON + tst r0, r1 + beq MP2K_event_fine_ok + movs r0, SOUND_CHANNEL_SF_STOP + orrs r1, r0 + strb r1, [r4, o_SoundChannel_statusFlags] +MP2K_event_fine_ok: + adds r0, r4, 0 + bl MP2KClearChain + ldr r4, [r4, o_SoundChannel_nextChannelPointer] + cmp r4, 0 + bne MP2K_event_fine_loop +MP2K_event_fine_done: + movs r0, 0 + strb r0, [r5, o_MusicPlayerTrack_flags] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end MP2K_event_fine + + thumb_func_start MPlayJumpTableCopy +MPlayJumpTableCopy: + mov r12, lr + movs r1, 0x24 + ldr r2, lt_MPlayJumpTableTemplate +MPlayJumpTableCopy_Loop: + ldr r3, [r2] + bl chk_adr_r2 + stm r0!, {r3} + adds r2, 0x4 + subs r1, 0x1 + bgt MPlayJumpTableCopy_Loop + bx r12 + thumb_func_end MPlayJumpTableCopy + + .align 2, 0 + .thumb_func +ldrb_r3_r2: + ldrb r3, [r2] + +@ This attempts to protect against reading anything from the BIOS ROM +@ besides the jump table template. +@ It assumes that the jump table template is located at the end of the ROM. + .thumb_func +chk_adr_r2: + push {r0} + lsrs r0, r2, 25 + bne chk_adr_r2_done @ if adr >= 0x2000000 (i.e. not in BIOS ROM), accept it + ldr r0, lt_MPlayJumpTableTemplate + cmp r2, r0 + blo chk_adr_r2_reject @ if adr < gMPlayJumpTableTemplate, reject it + lsrs r0, r2, 14 + beq chk_adr_r2_done @ if adr < 0x40000 (i.e. in BIOS ROM), accept it +chk_adr_r2_reject: + movs r3, 0 +chk_adr_r2_done: + pop {r0} + bx lr + + .align 2, 0 +lt_MPlayJumpTableTemplate: .word gMPlayJumpTableTemplate + + thumb_func_start ld_r3_tp_adr_i +ld_r3_tp_adr_i: + ldr r2, [r1, o_MusicPlayerTrack_cmdPtr] +_081DD64A: + adds r3, r2, 0x1 + str r3, [r1, o_MusicPlayerTrack_cmdPtr] + ldrb r3, [r2] + b chk_adr_r2 + thumb_func_end ld_r3_tp_adr_i + + thumb_func_start MP2K_event_goto +MP2K_event_goto: + push {lr} +MP2K_event_goto_1: + ldr r2, [r1, o_MusicPlayerTrack_cmdPtr] + ldrb r0, [r2, 0x3] + lsls r0, 8 + ldrb r3, [r2, 0x2] + orrs r0, r3 + lsls r0, 8 + ldrb r3, [r2, 0x1] + orrs r0, r3 + lsls r0, 8 + bl ldrb_r3_r2 + orrs r0, r3 + str r0, [r1, o_MusicPlayerTrack_cmdPtr] + pop {r0} + bx r0 + thumb_func_end MP2K_event_goto + + thumb_func_start MP2K_event_patt +MP2K_event_patt: + ldrb r2, [r1, o_MusicPlayerTrack_patternLevel] + cmp r2, 3 + bhs MP2K_event_patt_done + lsls r2, 2 + adds r3, r1, r2 + ldr r2, [r1, o_MusicPlayerTrack_cmdPtr] + adds r2, 0x4 + str r2, [r3, o_MusicPlayerTrack_patternStack] + ldrb r2, [r1, o_MusicPlayerTrack_patternLevel] + adds r2, 1 + strb r2, [r1, o_MusicPlayerTrack_patternLevel] + b MP2K_event_goto +MP2K_event_patt_done: + b MP2K_event_fine + thumb_func_end MP2K_event_patt + + thumb_func_start MP2K_event_pend +MP2K_event_pend: + ldrb r2, [r1, o_MusicPlayerTrack_patternLevel] + cmp r2, 0 + beq MP2K_event_pend_done + subs r2, 1 + strb r2, [r1, o_MusicPlayerTrack_patternLevel] + lsls r2, 2 + adds r3, r1, r2 + ldr r2, [r3, o_MusicPlayerTrack_patternStack] + str r2, [r1, o_MusicPlayerTrack_cmdPtr] +MP2K_event_pend_done: + bx lr + thumb_func_end MP2K_event_pend + + thumb_func_start MP2K_event_rept +MP2K_event_rept: + push {lr} + ldr r2, [r1, o_MusicPlayerTrack_cmdPtr] + ldrb r3, [r2] + cmp r3, 0 + bne MP2K_event_rept_1 + adds r2, 1 + str r2, [r1, o_MusicPlayerTrack_cmdPtr] + b MP2K_event_goto_1 +MP2K_event_rept_1: + ldrb r3, [r1, o_MusicPlayerTrack_repN] + adds r3, 1 + strb r3, [r1, o_MusicPlayerTrack_repN] + mov r12, r3 + bl ld_r3_tp_adr_i + cmp r12, r3 + bhs MP2K_event_rept_2 + b MP2K_event_goto_1 +MP2K_event_rept_2: + movs r3, 0 + strb r3, [r1, o_MusicPlayerTrack_repN] + adds r2, 5 + str r2, [r1, o_MusicPlayerTrack_cmdPtr] + pop {r0} + bx r0 + thumb_func_end MP2K_event_rept + + thumb_func_start MP2K_event_prio +MP2K_event_prio: + mov r12, lr + bl ld_r3_tp_adr_i + strb r3, [r1, o_MusicPlayerTrack_priority] + bx r12 + thumb_func_end MP2K_event_prio + + thumb_func_start MP2K_event_tempo +MP2K_event_tempo: + mov r12, lr + bl ld_r3_tp_adr_i + lsls r3, 1 + strh r3, [r0, o_MusicPlayerInfo_tempoD] + ldrh r2, [r0, o_MusicPlayerInfo_tempoU] + muls r3, r2 + lsrs r3, 8 + strh r3, [r0, o_MusicPlayerInfo_tempoI] + bx r12 + thumb_func_end MP2K_event_tempo + + thumb_func_start MP2K_event_keysh +MP2K_event_keysh: + mov r12, lr + bl ld_r3_tp_adr_i + strb r3, [r1, o_MusicPlayerTrack_keyShift] + ldrb r3, [r1, o_MusicPlayerTrack_flags] + movs r2, 0xC + orrs r3, r2 + strb r3, [r1, o_MusicPlayerTrack_flags] + bx r12 + thumb_func_end MP2K_event_keysh + + thumb_func_start MP2K_event_voice +MP2K_event_voice: + mov r12, lr + ldr r2, [r1, o_MusicPlayerTrack_cmdPtr] + ldrb r3, [r2] + adds r2, 1 + str r2, [r1, o_MusicPlayerTrack_cmdPtr] + lsls r2, r3, 1 + adds r2, r3 + lsls r2, 2 + ldr r3, [r0, o_MusicPlayerInfo_tone] + adds r2, r3 + ldr r3, [r2, o_ToneData_type] + bl chk_adr_r2 + str r3, [r1, o_MusicPlayerTrack_ToneData_type] + ldr r3, [r2, o_ToneData_wav] + bl chk_adr_r2 + str r3, [r1, o_MusicPlayerTrack_ToneData_wav] + ldr r3, [r2, o_ToneData_attack] + bl chk_adr_r2 + str r3, [r1, o_MusicPlayerTrack_ToneData_attack] + bx r12 + thumb_func_end MP2K_event_voice + + thumb_func_start MP2K_event_vol +MP2K_event_vol: + mov r12, lr + bl ld_r3_tp_adr_i + strb r3, [r1, o_MusicPlayerTrack_vol] + ldrb r3, [r1, o_MusicPlayerTrack_flags] + movs r2, MPT_FLG_VOLCHG + orrs r3, r2 + strb r3, [r1, o_MusicPlayerTrack_flags] + bx r12 + thumb_func_end MP2K_event_vol + + thumb_func_start MP2K_event_pan +MP2K_event_pan: + mov r12, lr + bl ld_r3_tp_adr_i + subs r3, C_V + strb r3, [r1, o_MusicPlayerTrack_pan] + ldrb r3, [r1, o_MusicPlayerTrack_flags] + movs r2, MPT_FLG_VOLCHG + orrs r3, r2 + strb r3, [r1, o_MusicPlayerTrack_flags] + bx r12 + thumb_func_end MP2K_event_pan + + thumb_func_start MP2K_event_bend +MP2K_event_bend: + mov r12, lr + bl ld_r3_tp_adr_i + subs r3, C_V + strb r3, [r1, o_MusicPlayerTrack_bend] + ldrb r3, [r1, o_MusicPlayerTrack_flags] + movs r2, MPT_FLG_PITCHG + orrs r3, r2 + strb r3, [r1, o_MusicPlayerTrack_flags] + bx r12 + thumb_func_end MP2K_event_bend + + thumb_func_start MP2K_event_bendr +MP2K_event_bendr: + mov r12, lr + bl ld_r3_tp_adr_i + strb r3, [r1, o_MusicPlayerTrack_bendRange] + ldrb r3, [r1, o_MusicPlayerTrack_flags] + movs r2, MPT_FLG_PITCHG + orrs r3, r2 + strb r3, [r1, o_MusicPlayerTrack_flags] + bx r12 + thumb_func_end MP2K_event_bendr + + thumb_func_start MP2K_event_lfodl +MP2K_event_lfodl: + mov r12, lr + bl ld_r3_tp_adr_i + strb r3, [r1, o_MusicPlayerTrack_lfoDelay] + bx r12 + thumb_func_end MP2K_event_lfodl + + thumb_func_start MP2K_event_modt +MP2K_event_modt: + mov r12, lr + bl ld_r3_tp_adr_i + ldrb r0, [r1, o_MusicPlayerTrack_modT] + cmp r0, r3 + beq _081DD7AA + strb r3, [r1, o_MusicPlayerTrack_modT] + ldrb r3, [r1, o_MusicPlayerTrack_flags] + movs r2, MPT_FLG_VOLCHG | MPT_FLG_PITCHG + orrs r3, r2 + strb r3, [r1, o_MusicPlayerTrack_flags] +_081DD7AA: + bx r12 + thumb_func_end MP2K_event_modt + + thumb_func_start MP2K_event_tune +MP2K_event_tune: + mov r12, lr + bl ld_r3_tp_adr_i + subs r3, C_V + strb r3, [r1, o_MusicPlayerTrack_tune] + ldrb r3, [r1, o_MusicPlayerTrack_flags] + movs r2, MPT_FLG_PITCHG + orrs r3, r2 + strb r3, [r1, o_MusicPlayerTrack_flags] + bx r12 + thumb_func_end MP2K_event_tune + + thumb_func_start MP2K_event_port +MP2K_event_port: + mov r12, lr + ldr r2, [r1, o_MusicPlayerTrack_cmdPtr] + ldrb r3, [r2] + adds r2, 1 + ldr r0, =REG_SOUND1CNT_L @ sound register base address + adds r0, r3 + bl _081DD64A + strb r3, [r0] + bx r12 + .pool + thumb_func_end MP2K_event_port + + thumb_func_start m4aSoundVSync +m4aSoundVSync: + ldr r0, lt2_SOUND_INFO_PTR + ldr r0, [r0] + + @ Exit the function if ident is not ID_NUMBER or ID_NUMBER+1. + ldr r2, lt2_ID_NUMBER + ldr r3, [r0, o_SoundInfo_ident] + subs r3, r2 + cmp r3, 1 + bhi m4aSoundVSync_Done + + @ Decrement the PCM DMA counter. If it reaches 0, we need to do a DMA. + ldrb r1, [r0, o_SoundInfo_pcmDmaCounter] + subs r1, 1 + strb r1, [r0, o_SoundInfo_pcmDmaCounter] + bgt m4aSoundVSync_Done + + @ Reload the PCM DMA counter. + ldrb r1, [r0, o_SoundInfo_pcmDmaPeriod] + strb r1, [r0, o_SoundInfo_pcmDmaCounter] + + ldr r2, =REG_DMA1 + + ldr r1, [r2, 0x8] @ DMA1CNT + lsls r1, 7 + bcc m4aSoundVSync_SkipDMA1 @ branch if repeat bit isn't set + + ldr r1, =((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4 + str r1, [r2, 0x8] @ DMA1CNT + +m4aSoundVSync_SkipDMA1: + ldr r1, [r2, 0xC + 0x8] @ DMA2CNT + lsls r1, 7 + bcc m4aSoundVSync_SkipDMA2 @ branch if repeat bit isn't set + + ldr r1, =((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4 + str r1, [r2, 0xC + 0x8] @ DMA2CNT + +m4aSoundVSync_SkipDMA2: + + @ turn off DMA1/DMA2 + movs r1, DMA_32BIT >> 8 + lsls r1, 8 + strh r1, [r2, 0xA] @ DMA1CNT_H + strh r1, [r2, 0xC + 0xA] @ DMA2CNT_H + + @ turn on DMA1/DMA2 direct-sound FIFO mode + movs r1, (DMA_ENABLE | DMA_START_SPECIAL | DMA_32BIT | DMA_REPEAT) >> 8 + lsls r1, 8 @ LSB is 0, so DMA_SRC_INC is used (destination is always fixed in FIFO mode) + strh r1, [r2, 0xA] @ DMA1CNT_H + strh r1, [r2, 0xC + 0xA] @ DMA2CNT_H + +m4aSoundVSync_Done: + bx lr + + .pool + thumb_func_end m4aSoundVSync + + thumb_func_start MP2KPlayerMain +MP2KPlayerMain: + ldr r2, lt2_ID_NUMBER + ldr r3, [r0, o_MusicPlayerInfo_ident] + cmp r2, r3 + beq _081DD82E + bx lr +_081DD82E: + adds r3, 0x1 + str r3, [r0, o_MusicPlayerInfo_ident] + push {r0,lr} + ldr r3, [r0, o_MusicPlayerInfo_func] + cmp r3, 0 + beq _081DD840 + ldr r0, [r0, o_MusicPlayerInfo_intp] + bl call_r3 +_081DD840: + pop {r0} + push {r4-r7} + mov r4, r8 + mov r5, r9 + mov r6, r10 + mov r7, r11 + push {r4-r7} + adds r7, r0, 0 + ldr r0, [r7, o_MusicPlayerInfo_status] + cmp r0, 0 + bge _081DD858 + b _081DDA6C +_081DD858: + ldr r0, lt2_SOUND_INFO_PTR + ldr r0, [r0] + mov r8, r0 + adds r0, r7, 0 + bl FadeOutBody + ldr r0, [r7, o_MusicPlayerInfo_status] + cmp r0, 0 + bge _081DD86C + b _081DDA6C +_081DD86C: + ldrh r0, [r7, o_MusicPlayerInfo_tempoC] + ldrh r1, [r7, o_MusicPlayerInfo_tempoI] + adds r0, r1 + b _081DD9BC +_081DD874: + ldrb r6, [r7, o_MusicPlayerInfo_trackCount] + ldr r5, [r7, o_MusicPlayerInfo_tracks] + movs r3, 0x1 + movs r4, 0 +_081DD87C: + ldrb r0, [r5, o_MusicPlayerTrack_flags] + movs r1, MPT_FLG_EXIST + tst r1, r0 + bne _081DD886 + b _081DD998 +_081DD886: + mov r10, r3 + orrs r4, r3 + mov r11, r4 + ldr r4, [r5, o_MusicPlayerTrack_chan] + cmp r4, 0 + beq _081DD8BA +_081DD892: + ldrb r1, [r4, o_SoundChannel_statusFlags] + movs r0, SOUND_CHANNEL_SF_ON + tst r0, r1 + beq _081DD8AE + ldrb r0, [r4, o_SoundChannel_gateTime] + cmp r0, 0 + beq _081DD8B4 + subs r0, 0x1 + strb r0, [r4, o_SoundChannel_gateTime] + bne _081DD8B4 + movs r0, SOUND_CHANNEL_SF_STOP + orrs r1, r0 + strb r1, [r4, o_SoundChannel_statusFlags] + b _081DD8B4 +_081DD8AE: + adds r0, r4, 0 + bl ClearChain +_081DD8B4: + ldr r4, [r4, o_SoundChannel_nextChannelPointer] + cmp r4, 0 + bne _081DD892 +_081DD8BA: + ldrb r3, [r5, o_MusicPlayerTrack_flags] + movs r0, MPT_FLG_START + tst r0, r3 + beq _081DD938 + adds r0, r5, 0 + bl Clear64byte + movs r0, MPT_FLG_EXIST + strb r0, [r5, o_MusicPlayerTrack_flags] + movs r0, 0x2 + strb r0, [r5, o_MusicPlayerTrack_bendRange] + movs r0, 0x40 + strb r0, [r5, o_MusicPlayerTrack_volX] + movs r0, 0x16 + strb r0, [r5, o_MusicPlayerTrack_lfoSpeed] + movs r0, 0x1 + adds r1, r5, 0x6 + strb r0, [r1, o_MusicPlayerTrack_ToneData_type - 0x6] + b _081DD938 +_081DD8E0: + ldr r2, [r5, o_MusicPlayerTrack_cmdPtr] + ldrb r1, [r2] + cmp r1, 0x80 + bhs _081DD8EC + ldrb r1, [r5, o_MusicPlayerTrack_runningStatus] + b _081DD8F6 +_081DD8EC: + adds r2, 0x1 + str r2, [r5, o_MusicPlayerTrack_cmdPtr] + cmp r1, 0xBD + bcc _081DD8F6 + strb r1, [r5, o_MusicPlayerTrack_runningStatus] +_081DD8F6: + cmp r1, 0xCF + bcc _081DD90C + mov r0, r8 + ldr r3, [r0, o_SoundInfo_plynote] + adds r0, r1, 0 + subs r0, 0xCF + adds r1, r7, 0 + adds r2, r5, 0 + bl call_r3 + b _081DD938 +_081DD90C: + cmp r1, 0xB0 + bls _081DD92E + adds r0, r1, 0 + subs r0, 0xB1 + strb r0, [r7, o_MusicPlayerInfo_cmd] + mov r3, r8 + ldr r3, [r3, o_SoundInfo_MPlayJumpTable] + lsls r0, 2 + ldr r3, [r3, r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl call_r3 + ldrb r0, [r5, o_MusicPlayerTrack_flags] + cmp r0, 0 + beq _081DD994 + b _081DD938 +_081DD92E: + ldr r0, lt_gClockTable + subs r1, 0x80 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r5, o_MusicPlayerTrack_wait] +_081DD938: + ldrb r0, [r5, o_MusicPlayerTrack_wait] + cmp r0, 0 + beq _081DD8E0 + subs r0, 0x1 + strb r0, [r5, o_MusicPlayerTrack_wait] + ldrb r1, [r5, o_MusicPlayerTrack_lfoSpeed] + cmp r1, 0 + beq _081DD994 + ldrb r0, [r5, o_MusicPlayerTrack_mod] + cmp r0, 0 + beq _081DD994 + ldrb r0, [r5, o_MusicPlayerTrack_lfoDelayC] + cmp r0, 0 + beq _081DD95A + subs r0, 0x1 + strb r0, [r5, o_MusicPlayerTrack_lfoDelayC] + b _081DD994 +_081DD95A: + ldrb r0, [r5, o_MusicPlayerTrack_lfoSpeedC] + adds r0, r1 + strb r0, [r5, o_MusicPlayerTrack_lfoSpeedC] + adds r1, r0, 0 + subs r0, 0x40 + lsls r0, 24 + bpl _081DD96E + lsls r2, r1, 24 + asrs r2, 24 + b _081DD972 +_081DD96E: + movs r0, 0x80 + subs r2, r0, r1 +_081DD972: + ldrb r0, [r5, o_MusicPlayerTrack_mod] + muls r0, r2 + asrs r2, r0, 6 + ldrb r0, [r5, o_MusicPlayerTrack_modM] + eors r0, r2 + lsls r0, 24 + beq _081DD994 + strb r2, [r5, o_MusicPlayerTrack_modM] + ldrb r0, [r5] + ldrb r1, [r5, o_MusicPlayerTrack_modT] + cmp r1, 0 + bne _081DD98E + movs r1, MPT_FLG_PITCHG + b _081DD990 +_081DD98E: + movs r1, MPT_FLG_VOLCHG +_081DD990: + orrs r0, r1 + strb r0, [r5, o_MusicPlayerTrack_flags] +_081DD994: + mov r3, r10 + mov r4, r11 +_081DD998: + subs r6, 0x1 + ble _081DD9A4 + movs r0, MusicPlayerTrack_size + adds r5, r0 + lsls r3, 1 + b _081DD87C +_081DD9A4: + ldr r0, [r7, o_MusicPlayerInfo_clock] + adds r0, 0x1 + str r0, [r7, o_MusicPlayerInfo_clock] + cmp r4, 0 + bne _081DD9B6 + movs r0, 0x80 + lsls r0, 24 + str r0, [r7, o_MusicPlayerInfo_status] + b _081DDA6C +_081DD9B6: + str r4, [r7, o_MusicPlayerInfo_status] + ldrh r0, [r7, o_MusicPlayerInfo_tempoC] + subs r0, 150 +_081DD9BC: + strh r0, [r7, o_MusicPlayerInfo_tempoC] + cmp r0, 150 + bcc _081DD9C4 + b _081DD874 +_081DD9C4: + ldrb r2, [r7, o_MusicPlayerInfo_trackCount] + ldr r5, [r7, o_MusicPlayerInfo_tracks] +_081DD9C8: + ldrb r0, [r5, o_MusicPlayerTrack_flags] + movs r1, 0x80 + tst r1, r0 + beq _081DDA62 + movs r1, MPT_FLG_VOLCHG | MPT_FLG_PITCHG + tst r1, r0 + beq _081DDA62 + mov r9, r2 + adds r0, r7, 0 + adds r1, r5, 0 + bl TrkVolPitSet + ldr r4, [r5, o_MusicPlayerTrack_chan] + cmp r4, 0 + beq _081DDA58 +_081DD9E6: + ldrb r1, [r4, o_SoundChannel_statusFlags] + movs r0, SOUND_CHANNEL_SF_ON + tst r0, r1 + bne _081DD9F6 + adds r0, r4, 0 + bl ClearChain + b _081DDA52 +_081DD9F6: + ldrb r0, [r4, o_SoundChannel_type] + movs r6, TONEDATA_TYPE_CGB + ands r6, r0 + ldrb r3, [r5, o_MusicPlayerTrack_flags] + movs r0, MPT_FLG_VOLCHG + tst r0, r3 + beq _081DDA14 + bl ChnVolSetAsm + cmp r6, 0 + beq _081DDA14 + ldrb r0, [r4, o_CgbChannel_modify] + movs r1, CGB_CHANNEL_MO_VOL + orrs r0, r1 + strb r0, [r4, o_CgbChannel_modify] +_081DDA14: + ldrb r3, [r5, o_MusicPlayerTrack_flags] + movs r0, MPT_FLG_PITCHG + tst r0, r3 + beq _081DDA52 + ldrb r1, [r4, o_SoundChannel_key] + movs r0, o_MusicPlayerTrack_keyM + ldrsb r0, [r5, r0] + adds r2, r1, r0 + bpl _081DDA28 + movs r2, 0 +_081DDA28: + cmp r6, 0 + beq _081DDA46 + mov r0, r8 + ldr r3, [r0, o_SoundInfo_MidiKeyToCgbFreq] + adds r1, r2, 0 + ldrb r2, [r5, o_MusicPlayerTrack_pitM] + adds r0, r6, 0 + bl call_r3 + str r0, [r4, o_CgbChannel_frequency] + ldrb r0, [r4, o_CgbChannel_modify] + movs r1, CGB_CHANNEL_MO_PIT + orrs r0, r1 + strb r0, [r4, o_CgbChannel_modify] + b _081DDA52 +_081DDA46: + adds r1, r2, 0 + ldrb r2, [r5, o_MusicPlayerTrack_pitM] + ldr r0, [r4, o_SoundChannel_wav] + bl MidiKeyToFreq + str r0, [r4, o_SoundChannel_frequency] +_081DDA52: + ldr r4, [r4, o_SoundChannel_nextChannelPointer] + cmp r4, 0 + bne _081DD9E6 +_081DDA58: + ldrb r0, [r5, o_MusicPlayerTrack_flags] + movs r1, 0xF0 + ands r0, r1 + strb r0, [r5, o_MusicPlayerTrack_flags] + mov r2, r9 +_081DDA62: + subs r2, 0x1 + ble _081DDA6C + movs r0, MusicPlayerTrack_size + adds r5, r0 + bgt _081DD9C8 +_081DDA6C: + ldr r0, lt2_ID_NUMBER + str r0, [r7, o_MusicPlayerInfo_ident] + pop {r0-r7} + mov r8, r0 + mov r9, r1 + mov r10, r2 + mov r11, r3 + pop {r3} + +call_r3: + bx r3 + + .align 2, 0 +lt_gClockTable: .word gClockTable +lt2_SOUND_INFO_PTR: .word SOUND_INFO_PTR +lt2_ID_NUMBER: .word ID_NUMBER + thumb_func_end MP2KPlayerMain + + thumb_func_start TrackStop +TrackStop: + push {r4-r6,lr} + adds r5, r1, 0 + ldrb r1, [r5, o_MusicPlayerTrack_flags] + movs r0, MPT_FLG_EXIST + tst r0, r1 + beq TrackStop_Done + ldr r4, [r5, o_MusicPlayerTrack_chan] + cmp r4, 0 + beq TrackStop_3 + movs r6, 0 +TrackStop_Loop: + ldrb r0, [r4, o_SoundChannel_statusFlags] + cmp r0, 0 + beq TrackStop_2 + ldrb r0, [r4, o_SoundChannel_type] + movs r3, TONEDATA_TYPE_CGB + ands r0, r3 + beq TrackStop_1 + ldr r3, =SOUND_INFO_PTR + ldr r3, [r3] + ldr r3, [r3, o_SoundInfo_CgbOscOff] + bl call_r3 +TrackStop_1: + strb r6, [r4, o_SoundChannel_statusFlags] +TrackStop_2: + str r6, [r4, o_SoundChannel_track] + ldr r4, [r4, o_SoundChannel_nextChannelPointer] + cmp r4, 0 + bne TrackStop_Loop +TrackStop_3: + str r4, [r5, o_MusicPlayerTrack_chan] +TrackStop_Done: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end TrackStop + + thumb_func_start ChnVolSetAsm +ChnVolSetAsm: + ldrb r1, [r4, o_SoundChannel_velocity] + movs r0, o_SoundChannel_rhythmPan + ldrsb r2, [r4, r0] + movs r3, 0x80 + adds r3, r2 + muls r3, r1 + ldrb r0, [r5, o_MusicPlayerTrack_volMR] + muls r0, r3 + asrs r0, 14 + cmp r0, 0xFF + bls _081DDAE8 + movs r0, 0xFF +_081DDAE8: + strb r0, [r4, o_SoundChannel_rightVolume] + movs r3, 0x7F + subs r3, r2 + muls r3, r1 + ldrb r0, [r5, o_MusicPlayerTrack_volML] + muls r0, r3 + asrs r0, 14 + cmp r0, 0xFF + bls _081DDAFC + movs r0, 0xFF +_081DDAFC: + strb r0, [r4, o_SoundChannel_leftVolume] + bx lr + thumb_func_end ChnVolSetAsm + + thumb_func_start MP2K_event_nxx +MP2K_event_nxx: + push {r4-r7,lr} + mov r4, r8 + mov r5, r9 + mov r6, r10 + mov r7, r11 + push {r4-r7} + sub sp, 0x18 + str r1, [sp] + adds r5, r2, 0 + ldr r1, =SOUND_INFO_PTR + ldr r1, [r1] + str r1, [sp, 0x4] + ldr r1, =gClockTable + adds r0, r1 + ldrb r0, [r0] + strb r0, [r5, o_MusicPlayerTrack_gateTime] + ldr r3, [r5, o_MusicPlayerTrack_cmdPtr] + ldrb r0, [r3] + cmp r0, 0x80 + bhs _081DDB46 + strb r0, [r5, o_MusicPlayerTrack_key] + adds r3, 0x1 + ldrb r0, [r3] + cmp r0, 0x80 + bhs _081DDB44 + strb r0, [r5, o_MusicPlayerTrack_velocity] + adds r3, 0x1 + ldrb r0, [r3] + cmp r0, 0x80 + bhs _081DDB44 + ldrb r1, [r5, o_MusicPlayerTrack_gateTime] + adds r1, r0 + strb r1, [r5, o_MusicPlayerTrack_gateTime] + adds r3, 0x1 +_081DDB44: + str r3, [r5, o_MusicPlayerTrack_cmdPtr] +_081DDB46: + movs r0, 0 + str r0, [sp, 0x14] + adds r4, r5, 0 + adds r4, o_MusicPlayerTrack_ToneData_type + ldrb r2, [r4] + movs r0, TONEDATA_TYPE_RHY | TONEDATA_TYPE_SPL + tst r0, r2 + beq _081DDB98 + ldrb r3, [r5, o_MusicPlayerTrack_key] + movs r0, TONEDATA_TYPE_SPL + tst r0, r2 + beq _081DDB66 + ldr r1, [r5, o_MusicPlayerTrack_ToneData_keySplitTable] + adds r1, r3 + ldrb r0, [r1] + b _081DDB68 +_081DDB66: + adds r0, r3, 0 +_081DDB68: + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r0, [r5, o_MusicPlayerTrack_ToneData_wav] + adds r1, r0 + mov r9, r1 + mov r6, r9 + ldrb r1, [r6] + movs r0, TONEDATA_TYPE_SPL | TONEDATA_TYPE_RHY + tst r0, r1 + beq _081DDB80 + b _081DDCEA +_081DDB80: + movs r0, TONEDATA_TYPE_RHY + tst r0, r2 + beq _081DDB9C + ldrb r1, [r6, o_ToneData_pan_sweep] + movs r0, 0x80 + tst r0, r1 + beq _081DDB94 + subs r1, TONEDATA_P_S_PAN + lsls r1, 1 + str r1, [sp, 0x14] +_081DDB94: + ldrb r3, [r6, o_SoundChannel_type] + b _081DDB9C +_081DDB98: + mov r9, r4 + ldrb r3, [r5, o_MusicPlayerTrack_key] +_081DDB9C: + str r3, [sp, 0x8] + ldr r6, [sp] + ldrb r1, [r6, o_MusicPlayerInfo_priority] + ldrb r0, [r5, o_MusicPlayerTrack_priority] + adds r0, r1 + cmp r0, 0xFF + bls _081DDBAC + movs r0, 0xFF +_081DDBAC: + str r0, [sp, 0x10] + mov r6, r9 + ldrb r0, [r6, o_ToneData_type] + movs r6, TONEDATA_TYPE_CGB + ands r6, r0 + str r6, [sp, 0xC] + beq _081DDBEC + ldr r0, [sp, 0x4] + ldr r4, [r0, o_SoundInfo_cgbChans] + cmp r4, 0 + bne _081DDBC4 + b _081DDCEA +_081DDBC4: + subs r6, 0x1 + lsls r0, r6, 6 + adds r4, r0 + ldrb r1, [r4, o_CgbChannel_statusFlags] + movs r0, SOUND_CHANNEL_SF_ON + tst r0, r1 + beq _081DDC40 + movs r0, SOUND_CHANNEL_SF_STOP + tst r0, r1 + bne _081DDC40 + ldrb r1, [r4, o_CgbChannel_priority] + ldr r0, [sp, 0x10] + cmp r1, r0 + bcc _081DDC40 + beq _081DDBE4 + b _081DDCEA +_081DDBE4: + ldr r0, [r4, o_CgbChannel_track] + cmp r0, r5 + bcs _081DDC40 + b _081DDCEA +_081DDBEC: + ldr r6, [sp, 0x10] + adds r7, r5, 0 + movs r2, 0 + mov r8, r2 + ldr r4, [sp, 0x4] + ldrb r3, [r4, o_SoundInfo_maxChans] + adds r4, o_SoundInfo_chans +_081DDBFA: + ldrb r1, [r4, o_SoundChannel_statusFlags] + movs r0, SOUND_CHANNEL_SF_ON + tst r0, r1 + beq _081DDC40 + movs r0, SOUND_CHANNEL_SF_STOP + tst r0, r1 + beq _081DDC14 + cmp r2, 0 + bne _081DDC18 + adds r2, 0x1 + ldrb r6, [r4, o_SoundChannel_priority] + ldr r7, [r4, o_SoundChannel_track] + b _081DDC32 +_081DDC14: + cmp r2, 0 + bne _081DDC34 +_081DDC18: + ldrb r0, [r4, o_SoundChannel_priority] + cmp r0, r6 + bcs _081DDC24 + adds r6, r0, 0 + ldr r7, [r4, o_SoundChannel_track] + b _081DDC32 +_081DDC24: + bhi _081DDC34 + ldr r0, [r4, o_SoundChannel_track] + cmp r0, r7 + bls _081DDC30 + adds r7, r0, 0 + b _081DDC32 +_081DDC30: + bcc _081DDC34 +_081DDC32: + mov r8, r4 +_081DDC34: + adds r4, SoundChannel_size + subs r3, 0x1 + bgt _081DDBFA + mov r4, r8 + cmp r4, 0 + beq _081DDCEA +_081DDC40: + adds r0, r4, 0 + bl ClearChain + movs r1, 0 + str r1, [r4, o_SoundChannel_prevChannelPointer] + ldr r3, [r5, o_MusicPlayerTrack_chan] + str r3, [r4, o_SoundChannel_nextChannelPointer] + cmp r3, 0 + beq _081DDC54 + str r4, [r3, o_SoundChannel_prevChannelPointer] +_081DDC54: + str r4, [r5, o_MusicPlayerTrack_chan] + str r5, [r4, o_SoundChannel_track] + ldrb r0, [r5, o_MusicPlayerTrack_lfoDelay] + strb r0, [r5, o_MusicPlayerTrack_lfoDelayC] + cmp r0, r1 + beq _081DDC66 + adds r1, r5, 0 + bl clear_modM +_081DDC66: + ldr r0, [sp] + adds r1, r5, 0 + bl TrkVolPitSet + ldr r0, [r5, o_MusicPlayerTrack_gateTime] + str r0, [r4, o_SoundChannel_gateTime] + ldr r0, [sp, 0x10] + strb r0, [r4, o_SoundChannel_priority] + ldr r0, [sp, 0x8] + strb r0, [r4, o_SoundChannel_key] + ldr r0, [sp, 0x14] + strb r0, [r4, o_SoundChannel_rhythmPan] + mov r6, r9 + ldrb r0, [r6, o_ToneData_type] + strb r0, [r4, o_SoundChannel_type] + ldr r7, [r6, o_ToneData_wav] + str r7, [r4, o_SoundChannel_wav] + ldr r0, [r6, o_ToneData_attack] + str r0, [r4, o_SoundChannel_attack] + ldrh r0, [r5, o_MusicPlayerTrack_pseudoEchoVolume] + strh r0, [r4, o_SoundChannel_pseudoEchoVolume] + bl ChnVolSetAsm + ldrb r1, [r4, o_SoundChannel_key] + movs r0, o_MusicPlayerTrack_keyM + ldrsb r0, [r5, r0] + adds r3, r1, r0 + bpl _081DDCA0 + movs r3, 0 +_081DDCA0: + ldr r6, [sp, 0xC] + cmp r6, 0 + beq _081DDCCE + mov r6, r9 + ldrb r0, [r6, o_ToneData_length] + strb r0, [r4, o_CgbChannel_length] + ldrb r1, [r6, o_ToneData_pan_sweep] + movs r0, 0x80 + tst r0, r1 + bne _081DDCBA + movs r0, 0x70 + tst r0, r1 + bne _081DDCBC +_081DDCBA: + movs r1, 0x8 +_081DDCBC: + strb r1, [r4, o_CgbChannel_sweep] + ldrb r2, [r5, o_MusicPlayerTrack_pitM] + adds r1, r3, 0 + ldr r0, [sp, 0xC] + ldr r3, [sp, 0x4] + ldr r3, [r3, o_SoundInfo_MidiKeyToCgbFreq] + bl call_r3 + b _081DDCDC +_081DDCCE: + ldrb r2, [r5, o_MusicPlayerTrack_pitM] + adds r1, r3, 0 + adds r0, r7, 0 + bl MidiKeyToFreq +_081DDCDC: + str r0, [r4, o_SoundChannel_frequency] + movs r0, SOUND_CHANNEL_SF_START + strb r0, [r4, o_SoundChannel_statusFlags] + ldrb r1, [r5, o_MusicPlayerTrack_flags] + movs r0, 0xF0 + ands r0, r1 + strb r0, [r5, o_MusicPlayerTrack_flags] +_081DDCEA: + add sp, 0x18 + pop {r0-r7} + mov r8, r0 + mov r9, r1 + mov r10, r2 + mov r11, r3 + pop {r0} + bx r0 + .pool + thumb_func_end MP2K_event_nxx + + thumb_func_start MP2K_event_endtie +MP2K_event_endtie: + push {r4,r5} + ldr r2, [r1, o_MusicPlayerTrack_cmdPtr] + ldrb r3, [r2] + cmp r3, 0x80 + bhs _081DDD16 + strb r3, [r1, o_MusicPlayerTrack_key] + adds r2, 0x1 + str r2, [r1, o_MusicPlayerTrack_cmdPtr] + b _081DDD18 +_081DDD16: + ldrb r3, [r1, o_MusicPlayerTrack_key] +_081DDD18: + ldr r1, [r1, o_MusicPlayerTrack_chan] + cmp r1, 0 + beq _081DDD40 + movs r4, SOUND_CHANNEL_SF_START | SOUND_CHANNEL_SF_ENV + movs r5, SOUND_CHANNEL_SF_STOP +_081DDD22: + ldrb r2, [r1, o_SoundChannel_statusFlags] + tst r2, r4 + beq _081DDD3A + tst r2, r5 + bne _081DDD3A + ldrb r0, [r1, o_SoundChannel_midiKey] + cmp r0, r3 + bne _081DDD3A + movs r0, SOUND_CHANNEL_SF_STOP + orrs r2, r0 + strb r2, [r1, o_SoundChannel_statusFlags] + b _081DDD40 +_081DDD3A: + ldr r1, [r1, o_SoundChannel_nextChannelPointer] + cmp r1, 0 + bne _081DDD22 +_081DDD40: + pop {r4,r5} + bx lr + thumb_func_end MP2K_event_endtie + + thumb_func_start clear_modM +clear_modM: + movs r2, 0 + strb r2, [r1, o_MusicPlayerTrack_modM] + strb r2, [r1, o_MusicPlayerTrack_lfoSpeedC] + ldrb r2, [r1, o_MusicPlayerTrack_modT] + cmp r2, 0 + bne _081DDD54 + movs r2, MPT_FLG_PITCHG + b _081DDD56 +_081DDD54: + movs r2, MPT_FLG_VOLCHG +_081DDD56: + ldrb r3, [r1, o_MusicPlayerTrack_flags] + orrs r3, r2 + strb r3, [r1, o_MusicPlayerTrack_flags] + bx lr + thumb_func_end clear_modM + + thumb_func_start ld_r3_tp_adr_i +ld_r3_tp_adr_i_unchecked: + ldr r2, [r1, o_MusicPlayerTrack_cmdPtr] + adds r3, r2, 1 + str r3, [r1, o_MusicPlayerTrack_cmdPtr] + ldrb r3, [r2] + bx lr + thumb_func_end ld_r3_tp_adr_i + + thumb_func_start MP2K_event_lfos +MP2K_event_lfos: + mov r12, lr + bl ld_r3_tp_adr_i_unchecked + strb r3, [r1, o_MusicPlayerTrack_lfoSpeed] + cmp r3, 0 + bne _081DDD7C + bl clear_modM +_081DDD7C: + bx r12 + thumb_func_end MP2K_event_lfos + + thumb_func_start MP2K_event_mod +MP2K_event_mod: + mov r12, lr + bl ld_r3_tp_adr_i_unchecked + strb r3, [r1, o_MusicPlayerTrack_mod] + cmp r3, 0 + bne _081DDD90 + bl clear_modM +_081DDD90: + bx r12 + thumb_func_end MP2K_event_mod + + .align 2, 0 @ Don't pad with nop. + + .bss +sDecodingBuffer: @ Used as a buffer for audio decoded from compressed DPCM + .space 0x40 + .size sDecodingBuffer, .-sDecodingBuffer diff --git a/src/lib/m4a_tables.c b/src/lib/m4a/m4a_tables.c similarity index 79% rename from src/lib/m4a_tables.c rename to src/lib/m4a/m4a_tables.c index c0d154fc7..6a3e15465 100644 --- a/src/lib/m4a_tables.c +++ b/src/lib/m4a/m4a_tables.c @@ -1,13 +1,15 @@ -#include "gba/m4a_internal.h" +#include "lib/m4a/m4a_internal.h" // Some of these functions have different signatures, so we need to make this // an array of void pointers or a struct. It's simpler to just make it an array // for now. void *const gMPlayJumpTableTemplate[] = { - ply_fine, ply_goto, ply_patt, ply_pend, ply_rept, ply_fine, ply_fine, ply_fine, ply_fine, - ply_prio, ply_tempo, ply_keysh, ply_voice, ply_vol, ply_pan, ply_bend, ply_bendr, ply_lfos, - ply_lfodl, ply_mod, ply_modt, ply_fine, ply_fine, ply_tune, ply_fine, ply_fine, ply_fine, - ply_port, ply_fine, ply_endtie, SampleFreqSet, TrackStop, FadeOutBody, TrkVolPitSet, RealClearChain, SoundMainBTM, + MP2K_event_fine, MP2K_event_goto, MP2K_event_patt, MP2K_event_pend, MP2K_event_rept, MP2K_event_fine, + MP2K_event_fine, MP2K_event_fine, MP2K_event_fine, MP2K_event_prio, MP2K_event_tempo, MP2K_event_keysh, + MP2K_event_voice, MP2K_event_vol, MP2K_event_pan, MP2K_event_bend, MP2K_event_bendr, MP2K_event_lfos, + MP2K_event_lfodl, MP2K_event_mod, MP2K_event_modt, MP2K_event_fine, MP2K_event_fine, MP2K_event_tune, + MP2K_event_fine, MP2K_event_fine, MP2K_event_fine, MP2K_event_port, MP2K_event_fine, MP2K_event_endtie, + SampleFreqSet, TrackStop, FadeOutBody, TrkVolPitSet, MP2KClearChain, SoundMainBTM, }; const u8 gScaleTable[] = { @@ -61,5 +63,6 @@ const u8 gClockTable[] = { }; const XcmdFunc gXcmdTable[] = { - ply_xxx, ply_xwave, ply_xtype, ply_xxx, ply_xatta, ply_xdeca, ply_xsust, ply_xrele, ply_xiecv, ply_xiecl, ply_xleng, ply_xswee, + MP2K_event_xxx, MP2K_event_xwave, MP2K_event_xtype, MP2K_event_xxx, MP2K_event_xatta, MP2K_event_xdeca, + MP2K_event_xsust, MP2K_event_xrele, MP2K_event_xiecv, MP2K_event_xiecl, MP2K_event_xleng, MP2K_event_xswee, }; diff --git a/src/lib/m4a0.s b/src/lib/m4a0.s deleted file mode 100644 index b4c8f556a..000000000 --- a/src/lib/m4a0.s +++ /dev/null @@ -1,1629 +0,0 @@ -.include "asm/macros.inc" -.include "constants/constants.inc" - -.syntax unified -.arm - - thumb_func_start umul3232H32 -umul3232H32: @ 0x080945E8 - add r2, pc, #0x0 @ =__umul3232H32 - bx r2 - - arm_func_start __umul3232H32 -__umul3232H32: @ 0x080945EC - umull r2, r3, r0, r1 - add r0, r3, #0 - bx lr - - thumb_func_start SoundMain -SoundMain: @ 0x080945F8 - ldr r0, _08094664 @ =SOUND_INFO_PTR - ldr r0, [r0] - ldr r2, _08094668 @ =0x68736D53 - ldr r3, [r0] - cmp r2, r3 - beq _08094606 - bx lr -_08094606: - adds r3, #1 - str r3, [r0] - push {r4, r5, r6, r7, lr} - mov r1, r8 - mov r2, sb - mov r3, sl - mov r4, fp - push {r0, r1, r2, r3, r4} - sub sp, #0x18 - ldrb r1, [r0, #0xc] - cmp r1, #0 - beq _0809462A - ldr r2, _08094670 @ =0x04000006 - ldrb r2, [r2] - cmp r2, #0xa0 - bhs _08094628 - adds r2, #0xe4 -_08094628: - adds r1, r1, r2 -_0809462A: - str r1, [sp, #0x14] - ldr r3, [r0, #0x20] - cmp r3, #0 - beq _0809463A - ldr r0, [r0, #0x24] - bl sub_08094A1A - ldr r0, [sp, #0x18] -_0809463A: - ldr r3, [r0, #0x28] - bl sub_08094A1A - ldr r0, [sp, #0x18] - ldr r3, [r0, #0x10] - mov r8, r3 - ldr r5, _08094674 @ =0x00000350 - adds r5, r5, r0 - ldrb r4, [r0, #4] - subs r7, r4, #1 - bls _0809465A - ldrb r1, [r0, #0xb] - subs r1, r1, r7 - mov r2, r8 - muls r2, r1, r2 - adds r5, r5, r2 -_0809465A: - str r5, [sp, #8] - ldr r6, _08094678 @ =0x00000630 - ldr r3, _0809466C @ =SoundMainRAM_Buffer + 1 - bx r3 - .align 2, 0 -_08094664: .4byte SOUND_INFO_PTR -_08094668: .4byte 0x68736D53 -_0809466C: .4byte SoundMainRAM_Buffer + 1 -_08094670: .4byte 0x04000006 -_08094674: .4byte 0x00000350 -_08094678: .4byte 0x00000630 - - thumb_func_start SoundMainRAM -SoundMainRAM: @ 0x0809467C - ldrb r3, [r0, #5] - cmp r3, #0 - beq SoundMainRAM_NoReverb - add r1, pc, #0x4 @ =SoundMainRAM_Reverb - bx r1 - .align 2, 0 - - arm_func_start SoundMainRAM_Reverb -SoundMainRAM_Reverb: @ 0x08094688 - cmp r4, #2 - addeq r7, r0, #0x350 - addne r7, r5, r8 - mov r4, r8 -_08094698: - ldrsb r0, [r5, r6] - ldrsb r1, [r5] - add r0, r0, r1 - ldrsb r1, [r7, r6] - add r0, r0, r1 - ldrsb r1, [r7], #1 - add r0, r0, r1 - mul r1, r0, r3 - asr r0, r1, #9 - tst r0, #0x80 - addne r0, r0, #1 - strb r0, [r5, r6] - strb r0, [r5], #1 - subs r4, r4, #1 - bgt _08094698 - add r0, pc, #0x2F @ =SoundMainRAM_ChanLoop - bx r0 - - thumb_func_start SoundMainRAM_NoReverb -SoundMainRAM_NoReverb: @ 0x080946DC - movs r0, #0 - mov r1, r8 - adds r6, r6, r5 - lsrs r1, r1, #3 - blo _080946EA - stm r5!, {r0} - stm r6!, {r0} -_080946EA: - lsrs r1, r1, #1 - blo _080946F6 - stm r5!, {r0} - stm r6!, {r0} - stm r5!, {r0} - stm r6!, {r0} -_080946F6: - stm r5!, {r0} - stm r6!, {r0} - stm r5!, {r0} - stm r6!, {r0} - stm r5!, {r0} - stm r6!, {r0} - stm r5!, {r0} - stm r6!, {r0} - subs r1, #1 - bgt _080946F6 - - non_word_aligned_thumb_func_start SoundMainRAM_ChanLoop -SoundMainRAM_ChanLoop: @ 0x0809470A - ldr r4, [sp, #0x18] - ldr r0, [r4, #0x18] - mov ip, r0 - ldrb r0, [r4, #6] - adds r4, #0x50 -_08094714: - str r0, [sp, #4] - ldr r3, [r4, #0x24] - ldr r0, [sp, #0x14] - cmp r0, #0 - beq _08094734 - ldr r1, _08094730 @ =0x04000006 - ldrb r1, [r1] - cmp r1, #0xa0 - bhs _08094728 - adds r1, #0xe4 -_08094728: - cmp r1, r0 - blo _08094734 - b _08094A06 - .align 2, 0 -_08094730: .4byte 0x04000006 -_08094734: - ldrb r6, [r4] - movs r0, #0xc7 - tst r0, r6 - bne _0809473E - b sub_080949FC -_0809473E: - movs r0, #0x80 - tst r0, r6 - beq _0809476E - movs r0, #0x40 - tst r0, r6 - bne _0809477E - movs r6, #3 - strb r6, [r4] - adds r0, r3, #0 - adds r0, #0x10 - str r0, [r4, #0x28] - ldr r0, [r3, #0xc] - str r0, [r4, #0x18] - movs r5, #0 - strb r5, [r4, #9] - str r5, [r4, #0x1c] - ldrb r2, [r3, #3] - movs r0, #0xc0 - tst r0, r2 - beq _080947C6 - movs r0, #0x10 - orrs r6, r0 - strb r6, [r4] - b _080947C6 -_0809476E: - ldrb r5, [r4, #9] - movs r0, #4 - tst r0, r6 - beq _08094784 - ldrb r0, [r4, #0xd] - subs r0, #1 - strb r0, [r4, #0xd] - bhi _080947D4 -_0809477E: - movs r0, #0 - strb r0, [r4] - b sub_080949FC -_08094784: - movs r0, #0x40 - tst r0, r6 - beq _080947A4 - ldrb r0, [r4, #7] - muls r5, r0, r5 - lsrs r5, r5, #8 - ldrb r0, [r4, #0xc] - cmp r5, r0 - bhi _080947D4 -_08094796: - ldrb r5, [r4, #0xc] - cmp r5, #0 - beq _0809477E - movs r0, #4 - orrs r6, r0 - strb r6, [r4] - b _080947D4 -_080947A4: - movs r2, #3 - ands r2, r6 - cmp r2, #2 - bne _080947C2 - ldrb r0, [r4, #5] - muls r5, r0, r5 - lsrs r5, r5, #8 - ldrb r0, [r4, #6] - cmp r5, r0 - bhi _080947D4 - adds r5, r0, #0 - beq _08094796 - subs r6, #1 - strb r6, [r4] - b _080947D4 -_080947C2: - cmp r2, #3 - bne _080947D4 -_080947C6: - ldrb r0, [r4, #4] - adds r5, r5, r0 - cmp r5, #0xff - blo _080947D4 - movs r5, #0xff - subs r6, #1 - strb r6, [r4] -_080947D4: - strb r5, [r4, #9] - ldr r0, [sp, #0x18] - ldrb r0, [r0, #7] - adds r0, #1 - muls r0, r5, r0 - lsrs r5, r0, #4 - ldrb r0, [r4, #2] - muls r0, r5, r0 - lsrs r0, r0, #8 - strb r0, [r4, #0xa] - ldrb r0, [r4, #3] - muls r0, r5, r0 - lsrs r0, r0, #8 - strb r0, [r4, #0xb] - movs r0, #0x10 - ands r0, r6 - str r0, [sp, #0x10] - beq _08094808 - adds r0, r3, #0 - adds r0, #0x10 - ldr r1, [r3, #8] - adds r0, r0, r1 - str r0, [sp, #0xc] - ldr r0, [r3, #0xc] - subs r0, r0, r1 - str r0, [sp, #0x10] -_08094808: - ldr r5, [sp, #8] - ldr r2, [r4, #0x18] - ldr r3, [r4, #0x28] - add r0, pc, #0x4 @ =sub_08094814 - bx r0 - .align 2, 0 - - arm_func_start sub_08094814 -sub_08094814: @ 0x08094814 - str r8, [sp] - ldrb sl, [r4, #0xa] - ldrb fp, [r4, #0xb] - lsl sl, sl, #0x10 - lsl fp, fp, #0x10 - ldrb r0, [r4, #1] - tst r0, #8 - beq _08094954 -_08094834: - cmp r2, #4 - ble _080948A4 - subs r2, r2, r8 - movgt lr, #0 - bgt _08094860 - mov lr, r8 - add r2, r2, r8 - sub r8, r2, #4 - sub lr, lr, r8 - ands r2, r2, #3 - moveq r2, #4 -_08094860: - ldr r6, [r5] - ldr r7, [r5, #0x630] -_08094868: - ldrsb r0, [r3], #1 - mul r1, sl, r0 - bic r1, r1, #0xff0000 - add r6, r1, r6, ror #8 - mul r1, fp, r0 - bic r1, r1, #0xff0000 - add r7, r1, r7, ror #8 - adds r5, r5, #0x40000000 - blo _08094868 - str r7, [r5, #0x630] - str r6, [r5], #4 - subs r8, r8, #4 - bgt _08094860 - adds r8, r8, lr - beq _080949E8 -_080948A4: - ldr r6, [r5] - ldr r7, [r5, #0x630] -_080948AC: - ldrsb r0, [r3], #1 - mul r1, sl, r0 - bic r1, r1, #0xff0000 - add r6, r1, r6, ror #8 - mul r1, fp, r0 - bic r1, r1, #0xff0000 - add r7, r1, r7, ror #8 - subs r2, r2, #1 - beq _0809491C -_080948D0: - adds r5, r5, #0x40000000 - blo _080948AC - str r7, [r5, #0x630] - str r6, [r5], #4 - subs r8, r8, #4 - bgt _08094834 - b _080949E8 -_080948EC: - ldr r0, [sp, #0x18] - cmp r0, #0 - beq _08094910 - ldr r3, [sp, #0x14] - rsb sb, r2, #0 -_08094900: - adds r2, r0, r2 - bgt _080949B8 - sub sb, sb, r0 - b _08094900 -_08094910: - pop {r4, ip} - mov r2, #0 - b _0809492C -_0809491C: - ldr r2, [sp, #0x10] - cmp r2, #0 - ldrne r3, [sp, #0xc] - bne _080948D0 -_0809492C: - strb r2, [r4] - lsr r0, r5, #0x1e - bic r5, r5, #0xc0000000 - rsb r0, r0, #3 - lsl r0, r0, #3 - ror r6, r6, r0 - ror r7, r7, r0 - str r7, [r5, #0x630] - str r6, [r5], #4 - b _080949F0 -_08094954: - push {r4, ip} - ldr lr, [r4, #0x1c] - ldr r1, [r4, #0x20] - mul r4, ip, r1 - ldrsb r0, [r3] - ldrsb r1, [r3, #1]! - sub r1, r1, r0 -_08094970: - ldr r6, [r5] - ldr r7, [r5, #0x630] -_08094978: - mul sb, lr, r1 - add sb, r0, sb, asr #23 - mul ip, sl, sb - bic ip, ip, #0xff0000 - add r6, ip, r6, ror #8 - mul ip, fp, sb - bic ip, ip, #0xff0000 - add r7, ip, r7, ror #8 - add lr, lr, r4 - lsrs sb, lr, #0x17 - beq _080949C4 - bic lr, lr, #0x3f800000 - subs r2, r2, sb - ble _080948EC - subs sb, sb, #1 - addeq r0, r0, r1 -_080949B8: - ldrsbne r0, [r3, sb]! - ldrsb r1, [r3, #1]! - sub r1, r1, r0 -_080949C4: - adds r5, r5, #0x40000000 - blo _08094978 - str r7, [r5, #0x630] - str r6, [r5], #4 - subs r8, r8, #4 - bgt _08094970 - sub r3, r3, #1 - pop {r4, ip} - str lr, [r4, #0x1c] -_080949E8: - str r2, [r4, #0x18] - str r3, [r4, #0x28] -_080949F0: - ldr r8, [sp] - add r0, pc, #0x1 @ =sub_080949FC - bx r0 - - thumb_func_start sub_080949FC -sub_080949FC: @ 0x080949FC - ldr r0, [sp, #4] - subs r0, #1 - ble _08094A06 - adds r4, #0x40 - b _08094714 -_08094A06: - ldr r0, [sp, #0x18] - ldr r3, _08094A1C @ =0x68736D53 - str r3, [r0] - add sp, #0x1c - pop {r0, r1, r2, r3, r4, r5, r6, r7} - mov r8, r0 - mov sb, r1 - mov sl, r2 - mov fp, r3 - pop {r3} - - non_word_aligned_thumb_func_start sub_08094A1A -sub_08094A1A: @ 0x08094A1A - bx r3 - .align 2, 0 -_08094A1C: .4byte 0x68736D53 - - thumb_func_start SoundMainBTM -SoundMainBTM: @ 0x0814F810 - mov ip, r4 - movs r1, #0 - movs r2, #0 - movs r3, #0 - movs r4, #0 - stm r0!, {r1, r2, r3, r4} - stm r0!, {r1, r2, r3, r4} - stm r0!, {r1, r2, r3, r4} - stm r0!, {r1, r2, r3, r4} - mov r4, ip - bx lr - .align 2, 0 - - thumb_func_start RealClearChain -RealClearChain: @ 0x08094A38 - ldr r3, [r0, #0x2c] - cmp r3, #0 - beq _08094A56 - ldr r1, [r0, #0x34] - ldr r2, [r0, #0x30] - cmp r2, #0 - beq _08094A4A - str r1, [r2, #0x34] - b _08094A4C -_08094A4A: - str r1, [r3, #0x20] -_08094A4C: - cmp r1, #0 - beq _08094A52 - str r2, [r1, #0x30] -_08094A52: - movs r1, #0 - str r1, [r0, #0x2c] -_08094A56: - bx lr - - thumb_func_start ply_fine -ply_fine: - push {r4, r5, lr} - adds r5, r1, #0 - ldr r4, [r5, #0x20] - cmp r4, #0 - beq _08094A7C -_08094A62: - ldrb r1, [r4] - movs r0, #0xc7 - tst r0, r1 - beq _08094A70 - movs r0, #0x40 - orrs r1, r0 - strb r1, [r4] -_08094A70: - adds r0, r4, #0 - bl RealClearChain - ldr r4, [r4, #0x34] - cmp r4, #0 - bne _08094A62 -_08094A7C: - movs r0, #0 - strb r0, [r5] - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 - - thumb_func_start MPlayJumpTableCopy -MPlayJumpTableCopy: @ 0x08094A88 - mov ip, lr - movs r1, #0x24 - ldr r2, _08094AB8 @ =gMPlayJumpTableTemplate -_08094A8E: - ldr r3, [r2] - bl _08094AA2 - stm r0!, {r3} - adds r2, #4 - subs r1, #1 - bgt _08094A8E - bx ip - .align 2, 0 - - thumb_func_start sub_8094AA0 -sub_8094AA0: @ 0x08094AA0 - ldrb r3, [r2] -_08094AA2: - push {r0} - lsrs r0, r2, #0x19 - bne _08094AB4 - ldr r0, _08094AB8 @ =gMPlayJumpTableTemplate - cmp r2, r0 - blo _08094AB2 - lsrs r0, r2, #0xe - beq _08094AB4 -_08094AB2: - movs r3, #0 -_08094AB4: - pop {r0} - bx lr - .align 2, 0 -_08094AB8: .4byte gMPlayJumpTableTemplate - - thumb_func_start sub_8094ABC -sub_8094ABC: @ 0x08094ABC - ldr r2, [r1, #0x40] - - non_word_aligned_thumb_func_start sub_08094ABE -sub_08094ABE: @ 0x08094ABE - adds r3, r2, #1 - str r3, [r1, #0x40] - ldrb r3, [r2] - b _08094AA2 - .align 2, 0 - - thumb_func_start ply_goto -ply_goto: - push {lr} -_08094ACA: - ldr r2, [r1, #0x40] - ldrb r0, [r2, #3] - lsls r0, r0, #8 - ldrb r3, [r2, #2] - orrs r0, r3 - lsls r0, r0, #8 - ldrb r3, [r2, #1] - orrs r0, r3 - lsls r0, r0, #8 - bl sub_8094AA0 - orrs r0, r3 - str r0, [r1, #0x40] - pop {r0} - bx r0 - - thumb_func_start ply_patt -ply_patt: @ 0x08094AE8 - ldrb r2, [r1, #2] - cmp r2, #3 - bhs _08094B00 - lsls r2, r2, #2 - adds r3, r1, r2 - ldr r2, [r1, #0x40] - adds r2, #4 - str r2, [r3, #0x44] - ldrb r2, [r1, #2] - adds r2, #1 - strb r2, [r1, #2] - b ply_goto -_08094B00: - b ply_fine - .align 2, 0 - - thumb_func_start ply_pend -ply_pend: @ 0x08094B04 - ldrb r2, [r1, #2] - cmp r2, #0 - beq _08094B16 - subs r2, #1 - strb r2, [r1, #2] - lsls r2, r2, #2 - adds r3, r1, r2 - ldr r2, [r3, #0x44] - str r2, [r1, #0x40] -_08094B16: - bx lr - - thumb_func_start ply_rept -ply_rept: @ 0x08094B18 - push {lr} - ldr r2, [r1, #0x40] - ldrb r3, [r2] - cmp r3, #0 - bne _08094B28 - adds r2, #1 - str r2, [r1, #0x40] - b _08094ACA -_08094B28: - ldrb r3, [r1, #3] - adds r3, #1 - strb r3, [r1, #3] - mov ip, r3 - bl sub_8094ABC - cmp ip, r3 - bhs _08094B3A - b _08094ACA -_08094B3A: - movs r3, #0 - strb r3, [r1, #3] - adds r2, #5 - str r2, [r1, #0x40] - pop {r0} - bx r0 - .align 2, 0 - - thumb_func_start ply_prio -ply_prio: @ 0x08094B48 - mov ip, lr - bl sub_8094ABC - strb r3, [r1, #0x1d] - bx ip - .align 2, 0 - - thumb_func_start ply_tempo -ply_tempo: @ 0x08094B54 - mov ip, lr - bl sub_8094ABC - lsls r3, r3, #1 - strh r3, [r0, #0x1c] - ldrh r2, [r0, #0x1e] - muls r3, r2, r3 - lsrs r3, r3, #8 - strh r3, [r0, #0x20] - bx ip - - thumb_func_start ply_keysh -ply_keysh: @ 0x08094B68 - mov ip, lr - bl sub_8094ABC - strb r3, [r1, #0xa] - ldrb r3, [r1] - movs r2, #0xc - orrs r3, r2 - strb r3, [r1] - bx ip - .align 2, 0 - - thumb_func_start ply_voice -ply_voice: @ 0x08094B7C - mov ip, lr - ldr r2, [r1, #0x40] - ldrb r3, [r2] - adds r2, #1 - str r2, [r1, #0x40] - lsls r2, r3, #1 - adds r2, r2, r3 - lsls r2, r2, #2 - ldr r3, [r0, #0x30] - adds r2, r2, r3 - ldr r3, [r2] - bl _08094AA2 - str r3, [r1, #0x24] - ldr r3, [r2, #4] - bl _08094AA2 - str r3, [r1, #0x28] - ldr r3, [r2, #8] - bl _08094AA2 - str r3, [r1, #0x2c] - bx ip - .align 2, 0 - - thumb_func_start ply_vol -ply_vol: @ 0x08094BAC - mov ip, lr - bl sub_8094ABC - strb r3, [r1, #0x12] - ldrb r3, [r1] - movs r2, #3 - orrs r3, r2 - strb r3, [r1] - bx ip - .align 2, 0 - - thumb_func_start ply_pan -ply_pan: @ 0x08094BC0 - mov ip, lr - bl sub_8094ABC - subs r3, #0x40 - strb r3, [r1, #0x14] - ldrb r3, [r1] - movs r2, #3 - orrs r3, r2 - strb r3, [r1] - bx ip - - thumb_func_start ply_bend -ply_bend: @ 0x08094BD4 - mov ip, lr - bl sub_8094ABC - subs r3, #0x40 - strb r3, [r1, #0xe] - ldrb r3, [r1] - movs r2, #0xc - orrs r3, r2 - strb r3, [r1] - bx ip - - thumb_func_start ply_bendr -ply_bendr: @ 0x08094BE8 - mov ip, lr - bl sub_8094ABC - strb r3, [r1, #0xf] - ldrb r3, [r1] - movs r2, #0xc - orrs r3, r2 - strb r3, [r1] - bx ip - .align 2, 0 - - thumb_func_start ply_lfodl -ply_lfodl: @ 0x08094BFC - mov ip, lr - bl sub_8094ABC - strb r3, [r1, #0x1b] - bx ip - .align 2, 0 - - thumb_func_start ply_modt -ply_modt: @ 0x08094C08 - mov ip, lr - bl sub_8094ABC - ldrb r0, [r1, #0x18] - cmp r0, r3 - beq _08094C1E - strb r3, [r1, #0x18] - ldrb r3, [r1] - movs r2, #0xf - orrs r3, r2 - strb r3, [r1] -_08094C1E: - bx ip - - thumb_func_start ply_tune -ply_tune: @ 0x08094C20 - mov ip, lr - bl sub_8094ABC - subs r3, #0x40 - strb r3, [r1, #0xc] - ldrb r3, [r1] - movs r2, #0xc - orrs r3, r2 - strb r3, [r1] - bx ip - - thumb_func_start ply_port -ply_port: @ 0x08094C34 - mov ip, lr - ldr r2, [r1, #0x40] - ldrb r3, [r2] - adds r2, #1 - ldr r0, _08094C48 @ =0x04000060 - adds r0, r0, r3 - bl sub_08094ABE - - thumb_func_start sub_8094C44 -sub_8094C44: @ 0x08094C44 - strb r3, [r0] - bx ip - .align 2, 0 -_08094C48: .4byte 0x04000060 - - thumb_func_start m4aSoundVSync -m4aSoundVSync: @ 0x08094C4C - ldr r0, _08094EF8 @ =SOUND_INFO_PTR - ldr r0, [r0] - ldr r2, _08094EFC @ =0x68736D53 - ldr r3, [r0] - subs r3, r3, r2 - cmp r3, #1 - bhi _08094C8C - ldrb r1, [r0, #4] - subs r1, #1 - strb r1, [r0, #4] - bgt _08094C8C - ldrb r1, [r0, #0xb] - strb r1, [r0, #4] - ldr r2, _08094C90 @ =0x040000BC - ldr r1, [r2, #8] - lsls r1, r1, #7 - blo _08094C72 - ldr r1, _08094C94 @ =0x84400004 - str r1, [r2, #8] -_08094C72: - ldr r1, [r2, #0x14] - lsls r1, r1, #7 - blo _08094C7C - ldr r1, _08094C94 @ =0x84400004 - str r1, [r2, #0x14] -_08094C7C: - movs r1, #4 - lsls r1, r1, #8 - strh r1, [r2, #0xa] - strh r1, [r2, #0x16] - movs r1, #0xb6 - lsls r1, r1, #8 - strh r1, [r2, #0xa] - strh r1, [r2, #0x16] -_08094C8C: - bx lr - .align 2, 0 -_08094C90: .4byte 0x040000BC -_08094C94: .4byte 0x84400004 - - thumb_func_start MPlayMain -MPlayMain: @ 0x08094C98 - ldr r2, _08094EFC @ =0x68736D53 - ldr r3, [r0, #0x34] - cmp r2, r3 - beq _08094CA2 - bx lr -_08094CA2: - adds r3, #1 - str r3, [r0, #0x34] - push {r0, lr} - ldr r3, [r0, #0x38] - cmp r3, #0 - beq _08094CB4 - ldr r0, [r0, #0x3c] - bl sub_08094EF0 -_08094CB4: - pop {r0} - push {r4, r5, r6, r7} - mov r4, r8 - mov r5, sb - mov r6, sl - mov r7, fp - push {r4, r5, r6, r7} - adds r7, r0, #0 - ldr r0, [r7, #4] - cmp r0, #0 - bge _08094CCC - b _08094EE0 -_08094CCC: - ldr r0, _08094EF8 @ =SOUND_INFO_PTR - ldr r0, [r0] - mov r8, r0 - adds r0, r7, #0 - bl FadeOutBody - ldr r0, [r7, #4] - cmp r0, #0 - bge _08094CE0 - b _08094EE0 -_08094CE0: - ldrh r0, [r7, #0x22] - ldrh r1, [r7, #0x20] - adds r0, r0, r1 - b _08094E30 -_08094CE8: - ldrb r6, [r7, #8] - ldr r5, [r7, #0x2c] - movs r3, #1 - movs r4, #0 -_08094CF0: - ldrb r0, [r5] - movs r1, #0x80 - tst r1, r0 - bne _08094CFA - b _08094E0C -_08094CFA: - mov sl, r3 - orrs r4, r3 - mov fp, r4 - ldr r4, [r5, #0x20] - cmp r4, #0 - beq _08094D2E -_08094D06: - ldrb r1, [r4] - movs r0, #0xc7 - tst r0, r1 - beq _08094D22 - ldrb r0, [r4, #0x10] - cmp r0, #0 - beq _08094D28 - subs r0, #1 - strb r0, [r4, #0x10] - bne _08094D28 - movs r0, #0x40 - orrs r1, r0 - strb r1, [r4] - b _08094D28 -_08094D22: - adds r0, r4, #0 - bl ClearChain -_08094D28: - ldr r4, [r4, #0x34] - cmp r4, #0 - bne _08094D06 -_08094D2E: - ldrb r3, [r5] - movs r0, #0x40 - tst r0, r3 - beq _08094DAC - adds r0, r5, #0 - bl Clear64byte - movs r0, #0x80 - strb r0, [r5] - movs r0, #2 - strb r0, [r5, #0xf] - movs r0, #0x40 - strb r0, [r5, #0x13] - movs r0, #0x16 - strb r0, [r5, #0x19] - movs r0, #1 - adds r1, r5, #6 - strb r0, [r1, #0x1e] - b _08094DAC -_08094D54: - ldr r2, [r5, #0x40] - ldrb r1, [r2] - cmp r1, #0x80 - bhs _08094D60 - ldrb r1, [r5, #7] - b _08094D6A -_08094D60: - adds r2, #1 - str r2, [r5, #0x40] - cmp r1, #0xbd - blo _08094D6A - strb r1, [r5, #7] -_08094D6A: - cmp r1, #0xcf - blo _08094D80 - mov r0, r8 - ldr r3, [r0, #0x38] - adds r0, r1, #0 - subs r0, #0xcf - adds r1, r7, #0 - adds r2, r5, #0 - bl sub_08094EF0 - b _08094DAC -_08094D80: - cmp r1, #0xb0 - bls _08094DA2 - adds r0, r1, #0 - subs r0, #0xb1 - strb r0, [r7, #0xa] - mov r3, r8 - ldr r3, [r3, #0x34] - lsls r0, r0, #2 - ldr r3, [r3, r0] - adds r0, r7, #0 - adds r1, r5, #0 - bl sub_08094EF0 - ldrb r0, [r5] - cmp r0, #0 - beq _08094E08 - b _08094DAC -_08094DA2: - ldr r0, _08094EF4 @ =gClockTable - subs r1, #0x80 - adds r1, r1, r0 - ldrb r0, [r1] - strb r0, [r5, #1] -_08094DAC: - ldrb r0, [r5, #1] - cmp r0, #0 - beq _08094D54 - subs r0, #1 - strb r0, [r5, #1] - ldrb r1, [r5, #0x19] - cmp r1, #0 - beq _08094E08 - ldrb r0, [r5, #0x17] - cmp r0, #0 - beq _08094E08 - ldrb r0, [r5, #0x1c] - cmp r0, #0 - beq _08094DCE - subs r0, #1 - strb r0, [r5, #0x1c] - b _08094E08 -_08094DCE: - ldrb r0, [r5, #0x1a] - adds r0, r0, r1 - strb r0, [r5, #0x1a] - adds r1, r0, #0 - subs r0, #0x40 - lsls r0, r0, #0x18 - bpl _08094DE2 - lsls r2, r1, #0x18 - asrs r2, r2, #0x18 - b _08094DE6 -_08094DE2: - movs r0, #0x80 - subs r2, r0, r1 -_08094DE6: - ldrb r0, [r5, #0x17] - muls r0, r2, r0 - asrs r2, r0, #6 - ldrb r0, [r5, #0x16] - eors r0, r2 - lsls r0, r0, #0x18 - beq _08094E08 - strb r2, [r5, #0x16] - ldrb r0, [r5] - ldrb r1, [r5, #0x18] - cmp r1, #0 - bne _08094E02 - movs r1, #0xc - b _08094E04 -_08094E02: - movs r1, #3 -_08094E04: - orrs r0, r1 - strb r0, [r5] -_08094E08: - mov r3, sl - mov r4, fp -_08094E0C: - subs r6, #1 - ble _08094E18 - movs r0, #0x50 - adds r5, r5, r0 - lsls r3, r3, #1 - b _08094CF0 -_08094E18: - ldr r0, [r7, #0xc] - adds r0, #1 - str r0, [r7, #0xc] - cmp r4, #0 - bne _08094E2A - movs r0, #0x80 - lsls r0, r0, #0x18 - str r0, [r7, #4] - b _08094EE0 -_08094E2A: - str r4, [r7, #4] - ldrh r0, [r7, #0x22] - subs r0, #0x96 -_08094E30: - strh r0, [r7, #0x22] - cmp r0, #0x96 - blo _08094E38 - b _08094CE8 -_08094E38: - ldrb r2, [r7, #8] - ldr r5, [r7, #0x2c] -_08094E3C: - ldrb r0, [r5] - movs r1, #0x80 - tst r1, r0 - beq _08094ED6 - movs r1, #0xf - tst r1, r0 - beq _08094ED6 - mov sb, r2 - adds r0, r7, #0 - adds r1, r5, #0 - bl TrkVolPitSet - ldr r4, [r5, #0x20] - cmp r4, #0 - beq _08094ECC -_08094E5A: - ldrb r1, [r4] - movs r0, #0xc7 - tst r0, r1 - bne _08094E6A - adds r0, r4, #0 - bl ClearChain - b _08094EC6 -_08094E6A: - ldrb r0, [r4, #1] - movs r6, #7 - ands r6, r0 - ldrb r3, [r5] - movs r0, #3 - tst r0, r3 - beq _08094E88 - bl sub_8094F44 - cmp r6, #0 - beq _08094E88 - ldrb r0, [r4, #0x1d] - movs r1, #1 - orrs r0, r1 - strb r0, [r4, #0x1d] -_08094E88: - ldrb r3, [r5] - movs r0, #0xc - tst r0, r3 - beq _08094EC6 - ldrb r1, [r4, #8] - movs r0, #8 - ldrsb r0, [r5, r0] - adds r2, r1, r0 - bpl _08094E9C - movs r2, #0 -_08094E9C: - cmp r6, #0 - beq _08094EBA - mov r0, r8 - ldr r3, [r0, #0x30] - adds r1, r2, #0 - ldrb r2, [r5, #9] - adds r0, r6, #0 - bl sub_08094EF0 - str r0, [r4, #0x20] - ldrb r0, [r4, #0x1d] - movs r1, #2 - orrs r0, r1 - strb r0, [r4, #0x1d] - b _08094EC6 -_08094EBA: - adds r1, r2, #0 - ldrb r2, [r5, #9] - ldr r0, [r4, #0x24] - bl MidiKeyToFreq - str r0, [r4, #0x20] -_08094EC6: - ldr r4, [r4, #0x34] - cmp r4, #0 - bne _08094E5A -_08094ECC: - ldrb r0, [r5] - movs r1, #0xf0 - ands r0, r1 - strb r0, [r5] - mov r2, sb -_08094ED6: - subs r2, #1 - ble _08094EE0 - movs r0, #0x50 - adds r5, r5, r0 - bgt _08094E3C -_08094EE0: - ldr r0, _08094EFC @ =0x68736D53 - str r0, [r7, #0x34] - pop {r0, r1, r2, r3, r4, r5, r6, r7} - mov r8, r0 - mov sb, r1 - mov sl, r2 - mov fp, r3 - pop {r3} - - thumb_func_start sub_08094EF0 -sub_08094EF0: @ 0x08094EF0 - bx r3 - .align 2, 0 -_08094EF4: .4byte gClockTable -_08094EF8: .4byte SOUND_INFO_PTR -_08094EFC: .4byte 0x68736D53 - - thumb_func_start TrackStop -TrackStop: @ 0x08094F00 - push {r4, r5, r6, lr} - adds r5, r1, #0 - ldrb r1, [r5] - movs r0, #0x80 - tst r0, r1 - beq _08094F38 - ldr r4, [r5, #0x20] - cmp r4, #0 - beq _08094F36 - movs r6, #0 -_08094F14: - ldrb r0, [r4] - cmp r0, #0 - beq _08094F2E - ldrb r0, [r4, #1] - movs r3, #7 - ands r0, r3 - beq _08094F2C - ldr r3, _08094F40 @ =SOUND_INFO_PTR - ldr r3, [r3] - ldr r3, [r3, #0x2c] - bl sub_08094EF0 -_08094F2C: - strb r6, [r4] -_08094F2E: - str r6, [r4, #0x2c] - ldr r4, [r4, #0x34] - cmp r4, #0 - bne _08094F14 -_08094F36: - str r4, [r5, #0x20] -_08094F38: - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_08094F40: .4byte SOUND_INFO_PTR - - thumb_func_start sub_8094F44 -sub_8094F44: @ 0x08094F44 - ldrb r1, [r4, #0x12] - movs r0, #0x14 - ldrsb r2, [r4, r0] - movs r3, #0x80 - adds r3, r3, r2 - muls r3, r1, r3 - ldrb r0, [r5, #0x10] - muls r0, r3, r0 - asrs r0, r0, #0xe - cmp r0, #0xff - bls _08094F5C - movs r0, #0xff -_08094F5C: - strb r0, [r4, #2] - movs r3, #0x7f - subs r3, r3, r2 - muls r3, r1, r3 - ldrb r0, [r5, #0x11] - muls r0, r3, r0 - asrs r0, r0, #0xe - cmp r0, #0xff - bls _08094F70 - movs r0, #0xff -_08094F70: - strb r0, [r4, #3] - bx lr - - thumb_func_start ply_note -ply_note: @ 0x08094F74 - push {r4, r5, r6, r7, lr} - mov r4, r8 - mov r5, sb - mov r6, sl - mov r7, fp - push {r4, r5, r6, r7} - sub sp, #0x18 - str r1, [sp] - adds r5, r2, #0 - ldr r1, _0809516C @ =SOUND_INFO_PTR - ldr r1, [r1] - str r1, [sp, #4] - ldr r1, _08095170 @ =gClockTable - adds r0, r0, r1 - ldrb r0, [r0] - strb r0, [r5, #4] - ldr r3, [r5, #0x40] - ldrb r0, [r3] - cmp r0, #0x80 - bhs _08094FBA - strb r0, [r5, #5] - adds r3, #1 - ldrb r0, [r3] - cmp r0, #0x80 - bhs _08094FB8 - strb r0, [r5, #6] - adds r3, #1 - ldrb r0, [r3] - cmp r0, #0x80 - bhs _08094FB8 - ldrb r1, [r5, #4] - adds r1, r1, r0 - strb r1, [r5, #4] - adds r3, #1 -_08094FB8: - str r3, [r5, #0x40] -_08094FBA: - movs r0, #0 - str r0, [sp, #0x14] - adds r4, r5, #0 - adds r4, #0x24 - ldrb r2, [r4] - movs r0, #0xc0 - tst r0, r2 - beq _0809500C - ldrb r3, [r5, #5] - movs r0, #0x40 - tst r0, r2 - beq _08094FDA - ldr r1, [r5, #0x2c] - adds r1, r1, r3 - ldrb r0, [r1] - b _08094FDC -_08094FDA: - adds r0, r3, #0 -_08094FDC: - lsls r1, r0, #1 - adds r1, r1, r0 - lsls r1, r1, #2 - ldr r0, [r5, #0x28] - adds r1, r1, r0 - mov sb, r1 - mov r6, sb - ldrb r1, [r6] - movs r0, #0xc0 - tst r0, r1 - beq _08094FF4 - b _0809515A -_08094FF4: - movs r0, #0x80 - tst r0, r2 - beq _08095010 - ldrb r1, [r6, #3] - movs r0, #0x80 - tst r0, r1 - beq _08095008 - subs r1, #0xc0 - lsls r1, r1, #1 - str r1, [sp, #0x14] -_08095008: - ldrb r3, [r6, #1] - b _08095010 -_0809500C: - mov sb, r4 - ldrb r3, [r5, #5] -_08095010: - str r3, [sp, #8] - ldr r6, [sp] - ldrb r1, [r6, #9] - ldrb r0, [r5, #0x1d] - adds r0, r0, r1 - cmp r0, #0xff - bls _08095020 - movs r0, #0xff -_08095020: - str r0, [sp, #0x10] - mov r6, sb - ldrb r0, [r6] - movs r6, #7 - ands r6, r0 - str r6, [sp, #0xc] - beq _08095060 - ldr r0, [sp, #4] - ldr r4, [r0, #0x1c] - cmp r4, #0 - bne _08095038 - b _0809515A -_08095038: - subs r6, #1 - lsls r0, r6, #6 - adds r4, r4, r0 - ldrb r1, [r4] - movs r0, #0xc7 - tst r0, r1 - beq _080950B4 - movs r0, #0x40 - tst r0, r1 - bne _080950B4 - ldrb r1, [r4, #0x13] - ldr r0, [sp, #0x10] - cmp r1, r0 - blo _080950B4 - beq _08095058 - b _0809515A -_08095058: - ldr r0, [r4, #0x2c] - cmp r0, r5 - bhs _080950B4 - b _0809515A -_08095060: - ldr r6, [sp, #0x10] - adds r7, r5, #0 - movs r2, #0 - mov r8, r2 - ldr r4, [sp, #4] - ldrb r3, [r4, #6] - adds r4, #0x50 -_0809506E: - ldrb r1, [r4] - movs r0, #0xc7 - tst r0, r1 - beq _080950B4 - movs r0, #0x40 - tst r0, r1 - beq _08095088 - cmp r2, #0 - bne _0809508C - adds r2, #1 - ldrb r6, [r4, #0x13] - ldr r7, [r4, #0x2c] - b _080950A6 -_08095088: - cmp r2, #0 - bne _080950A8 -_0809508C: - ldrb r0, [r4, #0x13] - cmp r0, r6 - bhs _08095098 - adds r6, r0, #0 - ldr r7, [r4, #0x2c] - b _080950A6 -_08095098: - bhi _080950A8 - ldr r0, [r4, #0x2c] - cmp r0, r7 - bls _080950A4 - adds r7, r0, #0 - b _080950A6 -_080950A4: - blo _080950A8 -_080950A6: - mov r8, r4 -_080950A8: - adds r4, #0x40 - subs r3, #1 - bgt _0809506E - mov r4, r8 - cmp r4, #0 - beq _0809515A -_080950B4: - adds r0, r4, #0 - bl ClearChain - movs r1, #0 - str r1, [r4, #0x30] - ldr r3, [r5, #0x20] - str r3, [r4, #0x34] - cmp r3, #0 - beq _080950C8 - str r4, [r3, #0x30] -_080950C8: - str r4, [r5, #0x20] - str r5, [r4, #0x2c] - ldrb r0, [r5, #0x1b] - strb r0, [r5, #0x1c] - cmp r0, r1 - beq _080950DA - adds r1, r5, #0 - bl sub_80951B4 -_080950DA: - ldr r0, [sp] - adds r1, r5, #0 - bl TrkVolPitSet - ldr r0, [r5, #4] - str r0, [r4, #0x10] - ldr r0, [sp, #0x10] - strb r0, [r4, #0x13] - ldr r0, [sp, #8] - strb r0, [r4, #8] - ldr r0, [sp, #0x14] - strb r0, [r4, #0x14] - mov r6, sb - ldrb r0, [r6] - strb r0, [r4, #1] - ldr r7, [r6, #4] - str r7, [r4, #0x24] - ldr r0, [r6, #8] - str r0, [r4, #4] - ldrh r0, [r5, #0x1e] - strh r0, [r4, #0xc] - bl sub_8094F44 - ldrb r1, [r4, #8] - movs r0, #8 - ldrsb r0, [r5, r0] - adds r3, r1, r0 - bpl _08095114 - movs r3, #0 -_08095114: - ldr r6, [sp, #0xc] - cmp r6, #0 - beq _08095142 - mov r6, sb - ldrb r0, [r6, #2] - strb r0, [r4, #0x1e] - ldrb r1, [r6, #3] - movs r0, #0x80 - tst r0, r1 - bne _0809512E - movs r0, #0x70 - tst r0, r1 - bne _08095130 -_0809512E: - movs r1, #8 -_08095130: - strb r1, [r4, #0x1f] - ldrb r2, [r5, #9] - adds r1, r3, #0 - ldr r0, [sp, #0xc] - ldr r3, [sp, #4] - ldr r3, [r3, #0x30] - bl sub_08094EF0 - b _0809514C -_08095142: - ldrb r2, [r5, #9] - adds r1, r3, #0 - adds r0, r7, #0 - bl MidiKeyToFreq -_0809514C: - str r0, [r4, #0x20] - movs r0, #0x80 - strb r0, [r4] - ldrb r1, [r5] - movs r0, #0xf0 - ands r0, r1 - strb r0, [r5] -_0809515A: - add sp, #0x18 - pop {r0, r1, r2, r3, r4, r5, r6, r7} - mov r8, r0 - mov sb, r1 - mov sl, r2 - mov fp, r3 - pop {r0} - bx r0 - .align 2, 0 -_0809516C: .4byte SOUND_INFO_PTR -_08095170: .4byte gClockTable - - thumb_func_start ply_endtie -ply_endtie: @ 0x08095174 - push {r4, r5} - ldr r2, [r1, #0x40] - ldrb r3, [r2] - cmp r3, #0x80 - bhs _08095186 - strb r3, [r1, #5] - adds r2, #1 - str r2, [r1, #0x40] - b _08095188 -_08095186: - ldrb r3, [r1, #5] -_08095188: - ldr r1, [r1, #0x20] - cmp r1, #0 - beq _080951B0 - movs r4, #0x83 - movs r5, #0x40 -_08095192: - ldrb r2, [r1] - tst r2, r4 - beq _080951AA - tst r2, r5 - bne _080951AA - ldrb r0, [r1, #0x11] - cmp r0, r3 - bne _080951AA - movs r0, #0x40 - orrs r2, r0 - strb r2, [r1] - b _080951B0 -_080951AA: - ldr r1, [r1, #0x34] - cmp r1, #0 - bne _08095192 -_080951B0: - pop {r4, r5} - bx lr - - thumb_func_start sub_80951B4 -sub_80951B4: @ 0x080951B4 - movs r2, #0 - strb r2, [r1, #0x16] - strb r2, [r1, #0x1a] - ldrb r2, [r1, #0x18] - cmp r2, #0 - bne _080951C4 - movs r2, #0xc - b _080951C6 -_080951C4: - movs r2, #3 -_080951C6: - ldrb r3, [r1] - orrs r3, r2 - strb r3, [r1] - bx lr - .align 2, 0 - - thumb_func_start sub_80951D0 -sub_80951D0: @ 0x080951D0 - ldr r2, [r1, #0x40] - adds r3, r2, #1 - str r3, [r1, #0x40] - ldrb r3, [r2] - bx lr - .align 2, 0 - - thumb_func_start ply_lfos -ply_lfos: @ 0x080951DC - mov ip, lr - bl sub_80951D0 - strb r3, [r1, #0x19] - cmp r3, #0 - bne _080951EC - bl sub_80951B4 -_080951EC: - bx ip - .align 2, 0 - - thumb_func_start ply_mod -ply_mod: @ 0x080951F0 - mov ip, lr - bl sub_80951D0 - strb r3, [r1, #0x17] - cmp r3, #0 - bne _08095200 - bl sub_80951B4 -_08095200: - bx ip - .align 2, 0 diff --git a/src/platform/pret_sdl/sdl2.c b/src/platform/pret_sdl/sdl2.c index 356387105..3133c7331 100644 --- a/src/platform/pret_sdl/sdl2.c +++ b/src/platform/pret_sdl/sdl2.c @@ -14,14 +14,14 @@ #include "global.h" #include "core.h" #include "gba/defines.h" -#include "gba/flash_internal.h" #include "gba/io_reg.h" #include "gba/types.h" -#include "gba/m4a_internal.h" +#include "lib/agb_flash/flash_internal.h" #define DMA_DEST_MASK 0x0060 #define DMA_SRC_MASK 0x0180 + #if ENABLE_AUDIO -#include "cgb_audio.h" +#include "platform/shared/audio/cgb_audio.h" #endif #ifndef TILE_WIDTH @@ -254,6 +254,9 @@ int main(int argc, char **argv) #if ENABLE_VRAM_VIEW VramDraw(vramTexture); #endif + // Prevent the multiplayer screen from being drawn ( see core.c:GameInit() ) + REG_RCNT = 0x8000; + mainLoopThread = SDL_CreateThread(DoMain, "AgbMain", NULL); double accumulator = 0.0; @@ -264,8 +267,6 @@ int main(int argc, char **argv) UpdateInternalClock(); #endif - // Prevent the multiplayer screen from being drawn ( see core.c:GameInit() ) - REG_RCNT = 0x8000; REG_KEYINPUT = 0x3FF; while (isRunning) { @@ -408,6 +409,8 @@ static u16 keys; u32 fullScreenFlags = 0; static SDL_DisplayMode sdlDispMode = { 0 }; +void Platform_QueueAudio(const void *data, uint32_t bytesCount) { SDL_QueueAudio(1, data, bytesCount); } + void ProcessSDLEvents(void) { SDL_Event event; diff --git a/src/platform/shared/audio/README.txt b/src/platform/shared/audio/README.txt new file mode 100644 index 000000000..11d4506a3 --- /dev/null +++ b/src/platform/shared/audio/README.txt @@ -0,0 +1,4 @@ +The source code in this folder is from: +https://github.com/Kurausukun/pokeemerald/tree/pc_port + +Thanks to camthesaxman, Kurausukun, Pidgey and NT_x86 for allowing us to use the code! diff --git a/src/platform/shared/audio/cgb_audio.c b/src/platform/shared/audio/cgb_audio.c new file mode 100644 index 000000000..787a65f43 --- /dev/null +++ b/src/platform/shared/audio/cgb_audio.c @@ -0,0 +1,267 @@ +#include "global.h" +#include "platform/shared/audio/cgb_audio.h" +#include "platform/shared/audio/cgb_tables.h" + +static struct AudioCGB gb; +static float soundChannelPos[4]; +static const s16 *PU1Table; +static const s16 *PU2Table; +static u32 apuFrame; +static u8 apuCycle; +static u32 sampleRate; +static u16 lfsrMax[2]; +float ch4Samples; + +void cgb_audio_init(u32 rate) +{ + gb.ch1Freq = 0; + gb.ch1SweepCounter = 0; + gb.ch1SweepCounterI = 0; + gb.ch1SweepDir = 0; + gb.ch1SweepShift = 0; + for (u8 ch = 0; ch < 4; ch++) { + gb.Vol[ch] = 0; + gb.VolI[ch] = 0; + gb.Len[ch] = 0; + gb.LenI[ch] = 0; + gb.LenOn[ch] = 0; + gb.EnvCounter[ch] = 0; + gb.EnvCounterI[ch] = 0; + gb.EnvDir[ch] = 0; + gb.DAC[ch] = 0; + soundChannelPos[ch] = 0; + } + soundChannelPos[1] = 1; + PU1Table = PU0; + PU2Table = PU0; + sampleRate = rate; + gb.ch4LFSR[0] = 0x8000; + gb.ch4LFSR[1] = 0x80; + lfsrMax[0] = 0x8000; + lfsrMax[1] = 0x80; + ch4Samples = 0.0f; +} + +void cgb_set_sweep(u8 sweep) +{ + gb.ch1SweepDir = (sweep & 0x08) >> 3; + gb.ch1SweepCounter = gb.ch1SweepCounterI = (sweep & 0x70) >> 4; + gb.ch1SweepShift = (sweep & 0x07); +} + +void cgb_set_wavram() +{ + for (u8 wavi = 0; wavi < 0x10; wavi++) { + gb.WAVRAM[(wavi << 1)] = (((*(REG_ADDR_WAVE_RAM0 + wavi)) & 0xF0) >> 4) / 7.5f - 1.0f; + gb.WAVRAM[(wavi << 1) + 1] = (((*(REG_ADDR_WAVE_RAM0 + wavi)) & 0x0F)) / 7.5f - 1.0f; + } +} + +void cgb_toggle_length(u8 channel, bool8 state) { gb.LenOn[channel] = state; } + +void cgb_set_length(u8 channel, u8 length) { gb.Len[channel] = gb.LenI[channel] = length; } + +void cgb_set_envelope(u8 channel, u8 envelope) +{ + if (channel == 2) { + switch ((envelope & 0xE0)) { + case 0x00: // mute + gb.Vol[2] = gb.VolI[2] = 0; + break; + case 0x20: // full + gb.Vol[2] = gb.VolI[2] = 4; + break; + case 0x40: // half + gb.Vol[2] = gb.VolI[2] = 2; + break; + case 0x60: // quarter + gb.Vol[2] = gb.VolI[2] = 1; + break; + case 0x80: // 3 quarters + gb.Vol[2] = gb.VolI[2] = 3; + break; + } + } else { + gb.DAC[channel] = (envelope & 0xF8) > 0; + gb.Vol[channel] = gb.VolI[channel] = (envelope & 0xF0) >> 4; + gb.EnvDir[channel] = (envelope & 0x08) >> 3; + gb.EnvCounter[channel] = gb.EnvCounterI[channel] = (envelope & 0x07); + } +} + +void cgb_trigger_note(u8 channel) +{ + gb.Vol[channel] = gb.VolI[channel]; + gb.Len[channel] = gb.LenI[channel]; + if (channel != 2) + gb.EnvCounter[channel] = gb.EnvCounterI[channel]; + if (channel == 3) { + gb.ch4LFSR[0] = 0x8000; + gb.ch4LFSR[1] = 0x80; + } +} + +void cgb_audio_generate(u16 samplesPerFrame) +{ + float *outBuffer = gb.outBuffer; + switch (REG_NR11 & 0xC0) { + case 0x00: + PU1Table = PU0; + break; + case 0x40: + PU1Table = PU1; + break; + case 0x80: + PU1Table = PU2; + break; + case 0xC0: + PU1Table = PU3; + break; + } + + switch (REG_NR21 & 0xC0) { + case 0x00: + PU2Table = PU0; + break; + case 0x40: + PU2Table = PU1; + break; + case 0x80: + PU2Table = PU2; + break; + case 0xC0: + PU2Table = PU3; + break; + } + + for (u16 i = 0; i < samplesPerFrame; i++, outBuffer += 2) { + apuFrame += 512; + if (apuFrame >= sampleRate) { + apuFrame -= sampleRate; + apuCycle++; + + if ((apuCycle & 1) == 0) { // Length + for (u8 ch = 0; ch < 4; ch++) { + if (gb.Len[ch]) { + if (--gb.Len[ch] == 0 && gb.LenOn[ch]) { + REG_NR52 &= (0xFF ^ (1 << ch)); + } + } + } + } + + if ((apuCycle & 7) == 7) { // Envelope + for (u8 ch = 0; ch < 4; ch++) { + if (ch == 2) + continue; // Skip wave channel + if (gb.EnvCounter[ch]) { + if (--gb.EnvCounter[ch] == 0) { + if (gb.Vol[ch] && !gb.EnvDir[ch]) { + gb.Vol[ch]--; + gb.EnvCounter[ch] = gb.EnvCounterI[ch]; + } else if (gb.Vol[ch] < 0x0F && gb.EnvDir[ch]) { + gb.Vol[ch]++; + gb.EnvCounter[ch] = gb.EnvCounterI[ch]; + } + } + } + } + } + + if ((apuCycle & 3) == 2) { // Sweep + if (gb.ch1SweepCounterI && gb.ch1SweepShift) { + if (--gb.ch1SweepCounter == 0) { + gb.ch1Freq = REG_SOUND1CNT_X & 0x7FF; + if (gb.ch1SweepDir) { + gb.ch1Freq -= gb.ch1Freq >> gb.ch1SweepShift; + if (gb.ch1Freq & 0xF800) + gb.ch1Freq = 0; + } else { + gb.ch1Freq += gb.ch1Freq >> gb.ch1SweepShift; + if (gb.ch1Freq & 0xF800) { + gb.ch1Freq = 0; + gb.EnvCounter[0] = 0; + gb.Vol[0] = 0; + } + } + REG_NR13 = gb.ch1Freq & 0xFF; + REG_NR14 &= 0xF8; + REG_NR14 += (gb.ch1Freq >> 8) & 0x07; + gb.ch1SweepCounter = gb.ch1SweepCounterI; + } + } + } + } + // Sound generation loop + soundChannelPos[0] += freqTable[REG_SOUND1CNT_X & 0x7FF] / (sampleRate / 32); + soundChannelPos[1] += freqTable[REG_SOUND2CNT_H & 0x7FF] / (sampleRate / 32); + soundChannelPos[2] += freqTable[REG_SOUND3CNT_X & 0x7FF] / (sampleRate / 32); + while (soundChannelPos[0] >= 32) + soundChannelPos[0] -= 32; + while (soundChannelPos[1] >= 32) + soundChannelPos[1] -= 32; + while (soundChannelPos[2] >= 32) + soundChannelPos[2] -= 32; + float outputL = 0; + float outputR = 0; + if (REG_NR52 & 0x80) { + if ((gb.DAC[0]) && (REG_NR52 & 0x01)) { + if (REG_NR51 & 0x10) + outputL += gb.Vol[0] * PU1Table[(int)(soundChannelPos[0])] / 15.0f; + if (REG_NR51 & 0x01) + outputR += gb.Vol[0] * PU1Table[(int)(soundChannelPos[0])] / 15.0f; + } + if ((gb.DAC[1]) && (REG_NR52 & 0x02)) { + if (REG_NR51 & 0x20) + outputL += gb.Vol[1] * PU2Table[(int)(soundChannelPos[1])] / 15.0f; + if (REG_NR51 & 0x02) + outputR += gb.Vol[1] * PU2Table[(int)(soundChannelPos[1])] / 15.0f; + } + if ((REG_NR30 & 0x80) && (REG_NR52 & 0x04)) { + if (REG_NR51 & 0x40) + outputL += gb.Vol[2] * gb.WAVRAM[(int)(soundChannelPos[2])] / 4.0f; + if (REG_NR51 & 0x04) + outputR += gb.Vol[2] * gb.WAVRAM[(int)(soundChannelPos[2])] / 4.0f; + } + if ((gb.DAC[3]) && (REG_NR52 & 0x08)) { + bool32 lfsrMode = ((REG_NR43 & 0x08) == 8); + ch4Samples += freqTableNSE[REG_SOUND4CNT_H & 0xFF] / sampleRate; + int ch4Out = 0; + if (gb.ch4LFSR[lfsrMode] & 1) { + ch4Out++; + } else { + ch4Out--; + } + int avgDiv = 1; + while (ch4Samples >= 1) { + avgDiv++; + bool8 lfsrCarry = 0; + if (gb.ch4LFSR[lfsrMode] & 2) + lfsrCarry ^= 1; + gb.ch4LFSR[lfsrMode] >>= 1; + if (gb.ch4LFSR[lfsrMode] & 2) + lfsrCarry ^= 1; + if (lfsrCarry) + gb.ch4LFSR[lfsrMode] |= lfsrMax[lfsrMode]; + if (gb.ch4LFSR[lfsrMode] & 1) { + ch4Out++; + } else { + ch4Out--; + } + ch4Samples--; + } + float sample = ch4Out; + if (avgDiv > 1) + sample /= avgDiv; + if (REG_NR51 & 0x80) + outputL += gb.Vol[3] * sample / 15.0f; + if (REG_NR51 & 0x08) + outputR += gb.Vol[3] * sample / 15.0f; + } + } + outBuffer[0] = outputL * 0.25f; + outBuffer[1] = outputR * 0.25f; + } +} + +float *cgb_get_buffer() { return gb.outBuffer; } diff --git a/src/platform/shared/audio/m4a_sound_mixer.c b/src/platform/shared/audio/m4a_sound_mixer.c new file mode 100644 index 000000000..b6e57b1a7 --- /dev/null +++ b/src/platform/shared/audio/m4a_sound_mixer.c @@ -0,0 +1,923 @@ +#include "global.h" + +#include "lib/m4a/m4a_internal.h" + +#include "platform/platform.h" +#include "platform/shared/audio/cgb_audio.h" + +static inline void GenerateAudio(struct SoundMixerState *mixer, struct MixerSource *chan, struct WaveData *wav, float *pcmBuffer, + u16 samplesPerFrame, float sampleRateReciprocal); +static void SampleMixer(struct SoundMixerState *mixer, u32 scanlineLimit, u16 samplesPerFrame, float *pcmBuffer, u8 dmaCounter, + u16 maxBufSize); +static inline bool32 TickEnvelope(struct MixerSource *chan, struct WaveData *wav); +static void ChnVolSetAsm(struct MixerSource *chan, struct MP2KTrack *track); + +#define VCOUNT_VBLANK 160 +#define TOTAL_SCANLINES 228 + +#ifndef __has_builtin +#define __has_builtin(x) defined(__GNUC__) +#endif + +#if ((-1 >> 1) == -1) && __has_builtin(__builtin_ctz) +#define FLOOR_DIV_POW2(a, b) ((a) >> __builtin_ctz(b)) +#else +#define FLOOR_DIV_POW2(a, b) ((a) > 0 ? (a) / (b) : (((a) + 1 - (b)) / (b))) +#endif + +static float audioBuffer[PCM_DMA_BUF_SIZE]; +static struct SoundMixerState sSoundInfo = { 0 }; +struct SoundMixerState *SOUND_INFO_PTR = &sSoundInfo; + +void SoundMain(void) +{ + struct SoundMixerState *mixer = SOUND_INFO_PTR; + + if (mixer->lockStatus != ID_NUMBER) { + return; + } + mixer->lockStatus++; + + u32 maxScanlines = mixer->maxScanlines; + if (mixer->maxScanlines != 0) { + u32 vcount = REG_VCOUNT; + maxScanlines += vcount; + if (vcount < VCOUNT_VBLANK) { + maxScanlines += TOTAL_SCANLINES; + } + } + + if (mixer->MPlayMainHead != NULL) { + mixer->MPlayMainHead(mixer->musicPlayerHead); + } + + mixer->CgbSound(); + + s32 samplesPerFrame = mixer->samplesPerFrame; + float *pcmBuffer = mixer->pcmBuffer; + s32 dmaCounter = mixer->dmaCounter; + + if (dmaCounter > 1) { + pcmBuffer += samplesPerFrame * (mixer->framesPerDmaCycle - (dmaCounter - 1)) * 2; + } + + SampleMixer(mixer, maxScanlines, samplesPerFrame, pcmBuffer, dmaCounter, PCM_DMA_BUF_SIZE); + cgb_audio_generate(samplesPerFrame); +} + +static void SampleMixer(struct SoundMixerState *mixer, u32 scanlineLimit, u16 samplesPerFrame, float *pcmBuffer, u8 dmaCounter, + u16 maxBufSize) +{ + u32 reverb = mixer->reverb; + if (reverb) { + // The vanilla reverb effect outputs a mono sound from four sources: + // - L/R channels as they were mixer->framesPerDmaCycle frames ago + // - L/R channels as they were (mixer->framesPerDmaCycle - 1) frames ago + float *tmp1 = pcmBuffer; + float *tmp2; + if (dmaCounter == 2) { + tmp2 = mixer->pcmBuffer; + } else { + tmp2 = pcmBuffer + samplesPerFrame * 2; + } + u16 i = 0; + do { + float s = tmp1[0] + tmp1[1] + tmp2[0] + tmp2[1]; + s *= ((float)reverb / 512.0f); + tmp1[0] = tmp1[1] = s; + tmp1 += 2; + tmp2 += 2; + } while (++i < samplesPerFrame); + } else { + // memset(pcmBuffer, 0, samplesPerFrame); + // memset(pcmBuffer + maxBufSize, 0, samplesPerFrame); + for (int i = 0; i < samplesPerFrame; i++) { + float *dst = &pcmBuffer[i * 2]; + dst[1] = dst[0] = 0.0f; + } + } + + float sampleRateReciprocal = mixer->sampleRateReciprocal; + s8 numChans = mixer->numChans; + struct MixerSource *chan = mixer->chans; + + for (int i = 0; i < numChans; i++, chan++) { + struct WaveData *wav = chan->wav; + + if (scanlineLimit != 0) { + u16 vcount = REG_VCOUNT; + if (vcount < VCOUNT_VBLANK) { + vcount += TOTAL_SCANLINES; + } + if (vcount >= scanlineLimit) { + goto returnEarly; + } + } + + if (TickEnvelope(chan, wav)) { + GenerateAudio(mixer, chan, wav, pcmBuffer, samplesPerFrame, sampleRateReciprocal); + } + } +returnEarly: + mixer->lockStatus = ID_NUMBER; +} + +// Returns TRUE if channel is still active after moving envelope forward a frame +//__attribute__((target("thumb"))) +static inline bool32 TickEnvelope(struct MixerSource *chan, struct WaveData *wav) +{ + // MP2K envelope shape + // | + // (linear)^ | + // Attack / \Decay (exponential) | + // / \_ | + // / '., Sustain | + // / '.______________ | + // / '-. Echo (linear) | + // / Release (exp) ''--..|\ | + // / \ | + + u8 status = chan->status; + if ((status & 0xC7) == 0) { + return FALSE; + } + + u8 env = 0; + if ((status & 0x80) == 0) { + env = chan->data.sound.envelopeVol; + + if (status & 4) { + // Note-wise echo + --chan->data.sound.echoVol; + if (chan->data.sound.echoVol <= 0) { + chan->status = 0; + return FALSE; + } else { + return TRUE; + } + } else if (status & 0x40) { + // Release + chan->data.sound.envelopeVol = env * chan->data.sound.release / 256U; + u8 echoVol = chan->data.sound.echoVol; + if (chan->data.sound.envelopeVol > echoVol) { + return TRUE; + } else if (echoVol == 0) { + chan->status = 0; + return FALSE; + } else { + chan->status |= 4; + return TRUE; + } + } + + switch (status & 3) { + u16 newEnv; + case 2: + // Decay + chan->data.sound.envelopeVol = env * chan->data.sound.decay / 256U; + + u8 sustain = chan->data.sound.sustain; + if (chan->data.sound.envelopeVol <= sustain && sustain == 0) { + // Duplicated echo check from Release section above + if (chan->data.sound.echoVol == 0) { + chan->status = 0; + return FALSE; + } else { + chan->status |= 4; + return TRUE; + } + } else if (chan->data.sound.envelopeVol <= sustain) { + chan->data.sound.envelopeVol = sustain; + --chan->status; + } + break; + case 3: + attack: + newEnv = env + chan->data.sound.attack; + if (newEnv > 0xFF) { + chan->data.sound.envelopeVol = 0xFF; + --chan->status; + } else { + chan->data.sound.envelopeVol = newEnv; + } + break; + case 1: // Sustain + default: + break; + } + + return TRUE; + } else if (status & 0x40) { + // Init and stop cancel each other out + chan->status = 0; + return FALSE; + } else { + // Init channel + chan->status = 3; + chan->current = wav->data; + chan->data.sound.ct = wav->size; + chan->data.sound.fw = 0; + chan->data.sound.envelopeVol = 0; + if ((wav->status >> 8) & 0xC0) { + chan->status |= 0x10; + } + goto attack; + } +} + +static inline void GenerateAudio(struct SoundMixerState *mixer, struct MixerSource *chan, struct WaveData *wav, float *pcmBuffer, + u16 samplesPerFrame, float sampleRateReciprocal) +{ /*, [[[]]]) {*/ + u8 v = chan->data.sound.envelopeVol * (mixer->masterVol + 1) / 16U; + chan->data.sound.envelopeVolR = chan->rightVol * v / 256U; + chan->data.sound.envelopeVolL = chan->leftVol * v / 256U; + + s32 loopLen = 0; + s8 *loopStart; + if (chan->status & 0x10) { + loopStart = wav->data + wav->loopStart; + loopLen = wav->size - wav->loopStart; + } + s32 samplesLeftInWav = chan->data.sound.ct; + s8 *current = chan->current; + signed envR = chan->data.sound.envelopeVolR; + signed envL = chan->data.sound.envelopeVolL; + + if (chan->type & TONEDATA_TYPE_CGB) { + for (u16 i = 0; i < samplesPerFrame; i++, pcmBuffer += 2) { + s8 c = *(current++); + + pcmBuffer[1] += (c * envR) / 32768.0f; + pcmBuffer[0] += (c * envL) / 32768.0f; + if (--samplesLeftInWav == 0) { + samplesLeftInWav = loopLen; + if (loopLen != 0) { + current = loopStart; + } else { + chan->status = 0; + return; + } + } + } + + chan->data.sound.ct = samplesLeftInWav; + chan->current = current; + } else { + float finePos = chan->data.sound.fw; + float romSamplesPerOutputSample = chan->data.sound.freq * sampleRateReciprocal; + + s16 b = current[0]; + s16 m = current[1] - b; + current += 1; + + for (u16 i = 0; i < samplesPerFrame; i++, pcmBuffer += 2) { + // Use linear interpolation to calculate a value between the current sample in the wav + // and the next sample. Also cancel out the 9.23 stuff + float sample = (finePos * m) + b; + + pcmBuffer[1] += (sample * envR) / 32768.0f; + pcmBuffer[0] += (sample * envL) / 32768.0f; + + finePos += romSamplesPerOutputSample; + u32 newCoarsePos = finePos; + if (newCoarsePos != 0) { + finePos -= (int)finePos; + samplesLeftInWav -= newCoarsePos; + if (samplesLeftInWav <= 0) { + if (loopLen != 0) { + current = loopStart; + newCoarsePos = -samplesLeftInWav; + samplesLeftInWav += loopLen; + while (samplesLeftInWav <= 0) { + newCoarsePos -= loopLen; + samplesLeftInWav += loopLen; + } + b = current[newCoarsePos]; + m = current[newCoarsePos + 1] - b; + current += newCoarsePos + 1; + } else { + chan->status = 0; + return; + } + } else { + b = current[newCoarsePos - 1]; + m = current[newCoarsePos] - b; + current += newCoarsePos; + } + } + } + + chan->data.sound.fw = finePos; + chan->data.sound.ct = samplesLeftInWav; + chan->current = current - 1; + } +} + +u32 umul3232H32(u32 a, u32 b) +{ + u64 result = a; + result *= b; + return result >> 32; +} + +void SoundMainBTM(void *ptr) { CpuFill32(0, ptr, offsetof(struct MP2KTrack, cmdPtr)); } + +// Removes chan from the doubly-linked list of channels associated with chan->track. +// Gonna rename this to like "FreeChannel" or something, similar to VGMS +void MP2KClearChain(struct MixerSource *chan) +{ + struct MP2KTrack *track = chan->track; + if (chan->track == NULL) { + return; + } + struct MixerSource *next = chan->next; + struct MixerSource *prev = chan->prev; + + if (prev != NULL) { + prev->next = next; + } else { + track->chan = next; + } + + if (next != NULL) { + next->prev = prev; + } + + chan->track = NULL; +} + +static u8 ConsumeTrackByte(struct MP2KTrack *track) { return *track->cmdPtr++; } + +void MPlayJumpTableCopy(void **mplayJumpTable) +{ + for (u8 i = 0; i < 36; i++) { + mplayJumpTable[i] = gMPlayJumpTableTemplate[i]; + } +} + +// Ends the current track. (Fine as in the Italian musical word, not English) +void MP2K_event_fine(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + struct MP2KTrack *r5 = track; + for (struct MixerSource *chan = track->chan; chan != NULL; chan = chan->next) { + if (chan->status & 0xC7) { + chan->status |= 0x40; + } + ClearChain(chan); + } + track->status = 0; +} + +// Sets the track's cmdPtr to the specified address. +void MP2K_event_goto(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + u8 *cmdPtr = track->cmdPtr; + uintptr_t addr = 0; + for (size_t i = sizeof(uintptr_t) - 1; i > 0; i--) { + addr |= cmdPtr[i]; + addr <<= 8; + } + addr |= *cmdPtr; + track->cmdPtr = (u8 *)addr; +} + +// Sets the track's cmdPtr to the specified address after backing up its current position. +void MP2K_event_patt(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + u8 level = track->patternLevel; + if (level < 3) { + track->patternStack[level] = track->cmdPtr + sizeof(u8 *); + track->patternLevel++; + MP2K_event_goto(unused, track); + } else { + // Stop playing this track, as an indication to the music programmer that they need to quit + // nesting patterns so darn much. + MP2K_event_fine(unused, track); + } +} + +// Marks the end of the current pattern, if there is one, by resetting the pattern to the +// most recently saved value. +void MP2K_event_pend(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + if (track->patternLevel != 0) { + u8 index = --track->patternLevel; + track->cmdPtr = track->patternStack[index]; + } +} + +// Loops back until a REPT event has been reached the specified number of times +void MP2K_event_rept(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + if (*track->cmdPtr == 0) { + // "Repeat 0 times" == loop forever + track->cmdPtr++; + MP2K_event_goto(unused, track); + } else { + u8 repeatCount = ++track->repeatCount; + if (repeatCount < ConsumeTrackByte(track)) { + MP2K_event_goto(unused, track); + } else { + track->repeatCount = 0; + track->cmdPtr += sizeof(u8) + sizeof(u8 *); + } + } +} + +// Sets the note priority for new notes in this track. +void MP2K_event_prio(struct MP2KPlayerState *unused, struct MP2KTrack *track) { track->priority = ConsumeTrackByte(track); } + +// Sets the BPM of all tracks to the specified tempo (in beats per half-minute, because 255 as a max tempo +// kinda sucks but 510 is plenty). +void MP2K_event_tempo(struct MP2KPlayerState *player, struct MP2KTrack *track) +{ + u16 bpm = ConsumeTrackByte(track); + bpm *= 2; + player->tempoRawBPM = bpm; + player->tempoInterval = (bpm * player->tempoScale) / 256; +} + +void MP2K_event_keysh(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + track->keyShift = ConsumeTrackByte(track); + track->status |= 0xC; +} + +void MP2K_event_voice(struct MP2KPlayerState *player, struct MP2KTrack *track) +{ + u8 voice = *(track->cmdPtr++); + struct MP2KVoiceGroup *voicegroup = &player->voicegroup[voice]; + track->voicegroup = *voicegroup; +} + +void MP2K_event_vol(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + track->vol = ConsumeTrackByte(track); + track->status |= 0x3; +} + +void MP2K_event_pan(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + track->pan = ConsumeTrackByte(track) - 0x40; + track->status |= 0x3; +} + +void MP2K_event_bend(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + track->bend = ConsumeTrackByte(track) - 0x40; + track->status |= 0xC; +} + +void MP2K_event_bendr(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + track->bendRange = ConsumeTrackByte(track); + track->status |= 0xC; +} + +void MP2K_event_lfodl(struct MP2KPlayerState *unused, struct MP2KTrack *track) { track->lfoDelay = ConsumeTrackByte(track); } + +void MP2K_event_modt(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + u8 type = ConsumeTrackByte(track); + if (type != track->modType) { + track->modType = type; + track->status |= 0xF; + } +} + +void MP2K_event_tune(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + track->tune = ConsumeTrackByte(track) - 0x40; + track->status |= 0xC; +} + +void MP2K_event_port(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + + vu8 *offset = (vu8 *)(REG_ADDR_NR10 + *(track->cmdPtr++)); + *offset = ConsumeTrackByte(track); +} + +void MP2KPlayerMain(struct MP2KPlayerState *player) +{ + struct SoundMixerState *mixer = SOUND_INFO_PTR; + + if (player->lockStatus != ID_NUMBER) { + return; + } + player->lockStatus++; + + if (player->nextPlayerFunc != NULL) { + player->nextPlayerFunc(player->nextPlayer); + } + + if (player->status & MUSICPLAYER_STATUS_PAUSE) { + goto returnEarly; + } + FadeOutBody(player); + if (player->status & MUSICPLAYER_STATUS_PAUSE) { + goto returnEarly; + } + + player->tempoCounter += player->tempoInterval; + while (player->tempoCounter >= 150) { + u16 trackBits = 0; + + for (u32 i = 0; i < player->trackCount; i++) { + struct MP2KTrack *currentTrack = player->tracks + i; + struct MixerSource *chan; + if ((currentTrack->status & MPT_FLG_EXIST) == 0) { + continue; + } + trackBits |= (1 << i); + + chan = currentTrack->chan; + while (chan != NULL) { + if ((chan->status & SOUND_CHANNEL_SF_ON) == 0) { + ClearChain(chan); + } else if (chan->data.sound.gateTime != 0 && --chan->data.sound.gateTime == 0) { + chan->status |= SOUND_CHANNEL_SF_STOP; + } + chan = chan->next; + } + + if (currentTrack->status & MPT_FLG_START) { + CpuFill32(0, currentTrack, offsetof(struct MP2KTrack, cmdPtr)); + currentTrack->status = MPT_FLG_EXIST; + currentTrack->bendRange = 2; + currentTrack->volPublic = 64; + currentTrack->lfoSpeed = 22; + currentTrack->voicegroup.type = 1; + } + + while (currentTrack->wait == 0) { + u8 event = *currentTrack->cmdPtr; + if (event < 0x80) { + event = currentTrack->runningStatus; + } else { + currentTrack->cmdPtr++; + if (event >= 0xBD) { + currentTrack->runningStatus = event; + } + } + + if (event >= 0xCF) { + mixer->plynote(event - 0xCF, player, currentTrack); + } else if (event >= 0xB1) { + player->cmd = event - 0xB1; + MP2KEventFunc eventFunc = mixer->MPlayJumpTable[player->cmd]; + eventFunc(player, currentTrack); + + if (currentTrack->status == 0) { + goto nextTrack; + } + } else { + currentTrack->wait = gClockTable[event - 0x80]; + } + } + + currentTrack->wait--; + + if (currentTrack->lfoSpeed != 0 && currentTrack->modDepth != 0) { + if (currentTrack->lfoDelayCounter != 0U) { + currentTrack->lfoDelayCounter--; + goto nextTrack; + } + + currentTrack->lfoSpeedCounter += currentTrack->lfoSpeed; + + s8 r; + if (currentTrack->lfoSpeedCounter >= 0x40U && currentTrack->lfoSpeedCounter < 0xC0U) { + r = 128 - currentTrack->lfoSpeedCounter; + } else if (currentTrack->lfoSpeedCounter >= 0xC0U) { + // Unsigned -> signed casts where the value is out of range are implementation defined. + // Why not add a few extra lines to make behavior the same for literally everyone? + r = currentTrack->lfoSpeedCounter - 256; + } else { + r = currentTrack->lfoSpeedCounter; + } + r = FLOOR_DIV_POW2(currentTrack->modDepth * r, 64); + + if (r != currentTrack->modCalculated) { + currentTrack->modCalculated = r; + if (currentTrack->modType == 0) { + currentTrack->status |= MPT_FLG_PITCHG; + } else { + currentTrack->status |= MPT_FLG_VOLCHG; + } + } + } + + nextTrack:; + } + + player->clock++; + if (trackBits == 0) { + player->status = MUSICPLAYER_STATUS_PAUSE; + goto returnEarly; + } + player->status = trackBits; + player->tempoCounter -= 150; + } + + u32 i = 0; + + do { + struct MP2KTrack *track = player->tracks + i; + + if ((track->status & MPT_FLG_EXIST) == 0 || (track->status & 0xF) == 0) { + continue; + } + TrkVolPitSet(player, track); + for (struct MixerSource *chan = track->chan; chan != NULL; chan = chan->next) { + if ((chan->status & 0xC7) == 0) { + ClearChain(chan); + continue; + } + u8 cgbType = chan->type & TONEDATA_TYPE_CGB; + if (track->status & MPT_FLG_VOLCHG) { + ChnVolSetAsm(chan, track); + if (cgbType != 0) { + chan->data.cgb.cgbStatus |= 1; + } + } + if (track->status & MPT_FLG_PITCHG) { + s32 key = chan->data.sound.key + track->keyShiftCalculated; + if (key < 0) { + key = 0; + } + if (cgbType != 0) { + chan->data.cgb.freq = mixer->MidiKeyToCgbFreq(cgbType, key, track->pitchCalculated); + chan->data.cgb.cgbStatus |= 0x2; + } else { + chan->data.sound.freq = MidiKeyToFreq(chan->wav, key, track->pitchCalculated); + } + } + } + track->status &= ~0xF; + } while (++i < player->trackCount); +returnEarly:; + player->lockStatus = ID_NUMBER; +} + +void TrackStop(struct MP2KPlayerState *player, struct MP2KTrack *track) +{ + if (track->status & 0x80) { + for (struct MixerSource *chan = track->chan; chan != NULL; chan = chan->next) { + if (chan->status != 0) { + u8 cgbType = chan->type & TONEDATA_TYPE_CGB; + if (cgbType != 0) { + struct SoundMixerState *mixer = SOUND_INFO_PTR; + mixer->CgbOscOff(cgbType); + } + chan->status = 0; + } + chan->track = NULL; + } + track->chan = NULL; + } +} + +static void ChnVolSetAsm(struct MixerSource *chan, struct MP2KTrack *track) +{ + s8 forcedPan = chan->data.sound.rhythmPan; + u32 rightVolume = (u8)(forcedPan + 128) * chan->data.sound.velocity * track->volRightCalculated / 128 / 128; + if (rightVolume > 0xFF) { + rightVolume = 0xFF; + } + chan->rightVol = rightVolume; + + u32 leftVolume = (u8)(127 - forcedPan) * chan->data.sound.velocity * track->volLeftCalculated / 128 / 128; + if (leftVolume > 0xFF) { + leftVolume = 0xFF; + } + chan->leftVol = leftVolume; +} + +void MP2K_event_nxx(u8 clock, struct MP2KPlayerState *player, struct MP2KTrack *track) +{ + struct SoundMixerState *mixer = SOUND_INFO_PTR; + + // A note can be anywhere from 1 to 4 bytes long. First is always the note length... + track->gateTime = gClockTable[clock]; + if (*track->cmdPtr < 0x80) { + // Then the note name... + track->key = *(track->cmdPtr++); + if (*track->cmdPtr < 0x80) { + // Then the velocity... + track->velocity = *(track->cmdPtr++); + if (*track->cmdPtr < 0x80) { + // Then a number to add ticks to get exotic or more precise note lengths without TIE. + track->gateTime += *(track->cmdPtr++); + } + } + } + + // sp14 + s8 forcedPan = 0; + // First r4, then r9 + struct MP2KVoiceGroup *voicegroup = &track->voicegroup; + // sp8 + u8 key = track->key; + u8 type = voicegroup->type; + + if (type & (TONEDATA_TYPE_RHY | TONEDATA_TYPE_SPL)) { + u8 voicegroupIndex; + if (voicegroup->type & TONEDATA_TYPE_SPL) { + voicegroupIndex = voicegroup->data.keySplit.keySplitTable[track->key]; + } else { + voicegroupIndex = track->key; + } + + voicegroup = voicegroup->data.keySplit.group + voicegroupIndex; + if (voicegroup->type & (TONEDATA_TYPE_RHY | TONEDATA_TYPE_SPL)) { + return; + } + if (type & TONEDATA_TYPE_RHY) { + if (voicegroup->pan_sweep & 0x80) { + forcedPan = ((s8)(voicegroup->pan_sweep & 0x7F) - 0x40) * 2; + } + key = voicegroup->drumKey; + } + } + + // sp10 + u16 priority = player->priority + track->priority; + if (priority > 0xFF) { + priority = 0xFF; + } + + u8 cgbType = voicegroup->type & TONEDATA_TYPE_CGB; + struct MixerSource *chan; + + if (cgbType != 0) { + if (mixer->cgbChans == NULL) { + return; + } + // There's only one CgbChannel of a given type, so we don't need to loop to find it. + chan = mixer->cgbChans + cgbType - 1; + + // If this channel is running and not stopped, + if ((chan->status & SOUND_CHANNEL_SF_ON) && (chan->status & SOUND_CHANNEL_SF_STOP) == 0) { + // then make sure this note is higher priority (or same priority but from a later track). + if (chan->data.sound.priority > priority || (chan->data.sound.priority == priority && chan->track < track)) { + return; + } + } + } else { + u16 p = priority; + struct MP2KTrack *t = track; + bool32 foundStoppingChannel = FALSE; + chan = NULL; + u8 numChans = mixer->numChans; + struct MixerSource *currChan = mixer->chans; + + for (u8 i = 0; i < numChans; i++, currChan++) { + if ((currChan->status & SOUND_CHANNEL_SF_ON) == 0) { + // Hey, we found a completely inactive channel! Let's use that. + chan = currChan; + break; + } + + if (currChan->status & SOUND_CHANNEL_SF_STOP && !foundStoppingChannel) { + // In the absence of a completely finalized channel, we can take over one that's about to + // finalize. That's a tier above any channel that's currently playing a note. + foundStoppingChannel = TRUE; + p = currChan->data.sound.priority; + t = currChan->track; + chan = currChan; + } else if ((currChan->status & SOUND_CHANNEL_SF_STOP && foundStoppingChannel) + || ((currChan->status & SOUND_CHANNEL_SF_STOP) == 0 && !foundStoppingChannel)) { + // The channel we're checking is on the same tier, so check the priority and track order + if (currChan->data.sound.priority < p) { + p = currChan->data.sound.priority; + t = currChan->track; + chan = currChan; + } else if (currChan->data.sound.priority == p && currChan->track > t) { + t = currChan->track; + chan = currChan; + } else if (currChan->data.sound.priority == p && currChan->track == t) { + chan = currChan; + } + } + } + } + + if (chan == NULL) { + return; + } + + ClearChain(chan); + + chan->prev = NULL; + chan->next = track->chan; + if (track->chan != NULL) { + track->chan->prev = chan; + } + track->chan = chan; + chan->track = track; + + track->lfoDelayCounter = track->lfoDelay; + if (track->lfoDelay != 0) { + ClearModM(track); + } + TrkVolPitSet(player, track); + + chan->data.sound.gateTime = track->gateTime; + chan->data.sound.untransposedKey = track->key; + chan->data.sound.velocity = track->velocity; + chan->data.sound.priority = priority; + chan->data.sound.key = key; + chan->data.sound.rhythmPan = forcedPan; + chan->type = voicegroup->type; + chan->wav = voicegroup->data.sound.wav; + chan->data.sound.attack = voicegroup->data.sound.attack; + chan->data.sound.decay = voicegroup->data.sound.decay; + chan->data.sound.sustain = voicegroup->data.sound.sustain; + chan->data.sound.release = voicegroup->data.sound.release; + chan->data.sound.echoVol = track->echoVolume; + chan->data.sound.echoLen = track->echoLength; + ChnVolSetAsm(chan, track); + + // Avoid promoting keyShiftCalculated to u8 by splitting the addition into a separate statement + s16 transposedKey = chan->data.sound.key; + transposedKey += track->keyShiftCalculated; + if (transposedKey < 0) { + transposedKey = 0; + } + + if (cgbType != 0) { + // struct CgbChannel *cgbChan = (struct CgbChannel *)chan; + chan->data.cgb.length = voicegroup->cgbLength; + if (voicegroup->pan_sweep & 0x80 || (voicegroup->pan_sweep & 0x70) == 0) { + chan->data.cgb.sweep = 8; + } else { + chan->data.cgb.sweep = voicegroup->pan_sweep; + } + + chan->data.cgb.freq = mixer->MidiKeyToCgbFreq(cgbType, transposedKey, track->pitchCalculated); + } else { + chan->data.sound.freq = MidiKeyToFreq(chan->wav, transposedKey, track->pitchCalculated); + } + + chan->status = SOUND_CHANNEL_SF_START; + track->status &= ~0xF; +} + +void MP2K_event_endtie(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + u8 key = *track->cmdPtr; + if (key < 0x80) { + track->key = key; + track->cmdPtr++; + } else { + key = track->key; + } + + struct MixerSource *chan = track->chan; + while (chan != NULL) { + if (chan->status & 0x83 && (chan->status & 0x40) == 0 && chan->data.sound.untransposedKey == key) { + chan->status |= 0x40; + return; + } + chan = chan->next; + } +} + +void MP2K_event_lfos(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + track->lfoSpeed = *(track->cmdPtr++); + if (track->lfoSpeed == 0) { + ClearModM(track); + } +} + +void MP2K_event_mod(struct MP2KPlayerState *unused, struct MP2KTrack *track) +{ + track->modDepth = *(track->cmdPtr++); + if (track->modDepth == 0) { + ClearModM(track); + } +} + +void m4aSoundVSync(void) +{ + struct SoundMixerState *mixer = SOUND_INFO_PTR; + if (mixer->lockStatus - ID_NUMBER <= 1) { + s32 samplesPerFrame = mixer->samplesPerFrame * 2; + float *m4aBuffer = mixer->pcmBuffer; + float *cgbBuffer = cgb_get_buffer(); + s32 dmaCounter = mixer->dmaCounter; + + if (dmaCounter > 1) { + m4aBuffer += samplesPerFrame * (mixer->framesPerDmaCycle - (dmaCounter - 1)); + } + + for (u32 i = 0; i < samplesPerFrame; i++) + audioBuffer[i] = m4aBuffer[i] + cgbBuffer[i]; + + Platform_QueueAudio(audioBuffer, samplesPerFrame * 4); + if ((s8)(--mixer->dmaCounter) <= 0) + mixer->dmaCounter = mixer->framesPerDmaCycle; + } +} diff --git a/src/platform/shared/common.c b/src/platform/shared/common.c index ff840fb41..02e9e8eef 100644 --- a/src/platform/shared/common.c +++ b/src/platform/shared/common.c @@ -1,5 +1,5 @@ #include "core.h" -#include "gba/flash_internal.h" +#include "lib/agb_flash/flash_internal.h" ALIGNED(256) uint8_t EWRAM_START[EWRAM_SIZE] = { 0 }; ALIGNED(256) uint8_t IWRAM_START[IWRAM_SIZE] = { 0 }; diff --git a/src/platform/shared/m4a_stub.c b/src/platform/shared/m4a_stub.c deleted file mode 100644 index 8846b45a9..000000000 --- a/src/platform/shared/m4a_stub.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Function stubs for M4A functions */ - -#include "global.h" -#include "gba/m4a_internal.h" - -struct SoundInfo sSoundInfo = { 0 }; -struct SoundInfo *SOUND_INFO_PTR = &sSoundInfo; - -u32 umul3232H32(u32 multiplier, u32 multiplicand) { return ((u64)multiplier * (u64)multiplicand) >> 32; } - -void TrackStop(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) { } -void SoundMain(void) { } -void m4aSoundVSync(void) { } -char SoundMainRAM[sizeof(*SoundMain)]; -void MPlayMain(void) { } -void MPlayJumpTableCopy(MPlayFunc *mplayJumpTable) { } - -// sound command handler functions -void ply_fine(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_goto(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_patt(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_pend(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_rept(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -// void ply_memacc(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) {} -void ply_prio(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_tempo(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_keysh(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_voice(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_vol(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_pan(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_bend(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_bendr(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_lfos(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_lfodl(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_mod(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_modt(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_tune(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_port(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -// void ply_xcmd(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) {} -void ply_endtie(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_note(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } - -// extended sound command handler functions -void ply_xcmd_0C(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } -void ply_xcmd_0D(struct MusicPlayerInfo *info, struct MusicPlayerTrack *track) { } diff --git a/src/platform/shared/stub.c b/src/platform/shared/stub.c index 94749a9ae..134cc253d 100644 --- a/src/platform/shared/stub.c +++ b/src/platform/shared/stub.c @@ -20,7 +20,5 @@ u32 sub_800D0A0(Sprite *s, s16 x, s16 y, s16 param3, s16 param4, u8 param5, u32 void sub_802E784(u16 p0, u16 p1, u16 p2, s16 x, s16 y, s16 p5) { } // TEMP -void RealClearChain(void) { } -void SoundMainBTM(void) { } double sqrt(double v) { return 0; } float atan2f(float a, float b) { return 0; } diff --git a/src/platform/win32/win32.c b/src/platform/win32/win32.c index 958da76cc..d52d2cdbe 100644 --- a/src/platform/win32/win32.c +++ b/src/platform/win32/win32.c @@ -87,3 +87,5 @@ void DmaWait(int dmaNum) { printf("DmaWait: %d\n", dmaNum); } void *Platform_malloc(int numBytes) { return HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY, numBytes); } void Platform_free(void *ptr) { HeapFree(GetProcessHeap(), 0, ptr); } + +void Platform_QueueAudio(const u8 *data, u32 numBytes) { } \ No newline at end of file diff --git a/src/sprite.c b/src/sprite.c index f8a9ecbe5..cf67eb500 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -4,7 +4,7 @@ #include "flags.h" #include "sprite.h" #include "trig.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" #include "data/sprite_data.h" #include "animation_commands.h" diff --git a/src/task.c b/src/task.c index d678b0411..53fdb0c68 100644 --- a/src/task.c +++ b/src/task.c @@ -8,7 +8,7 @@ #include "core.h" #include "task.h" #include "flags.h" -#include "lib/m4a.h" +#include "lib/m4a/m4a.h" static void TaskMainDummy1(void); static void TaskMainDummy2(void); diff --git a/tools/mid2agb/agb.cpp b/tools/mid2agb/agb.cpp index 98038eb47..a92807093 100644 --- a/tools/mid2agb/agb.cpp +++ b/tools/mid2agb/agb.cpp @@ -556,6 +556,7 @@ void PrintAgbFooter() std::fprintf(g_outputFile, "\t.byte\t%s_pri\t%s\n", g_asmLabel.c_str(), Comment("Priority").c_str()); std::fprintf(g_outputFile, "\t.byte\t%s_rev\t%s\n", g_asmLabel.c_str(), Comment("Reverb").c_str()); std::fprintf(g_outputFile, "\n"); + std::fprintf(g_outputFile, "mAlignWord\n"); std::fprintf(g_outputFile, "\tmPtr\t%s_grp\n", g_asmLabel.c_str()); std::fprintf(g_outputFile, "\n");