From a83e41b2ccf87fe8b396280b34f71328b191a861 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Sat, 22 Jan 2022 19:37:46 -0500 Subject: [PATCH 1/5] move m4a track definitions --- sound/music_player_table.inc | 38 ++++++++++++++++++++++++++++++++---- src/m4a_1.s | 22 +-------------------- sym_bss.txt | 1 + 3 files changed, 36 insertions(+), 25 deletions(-) diff --git a/sound/music_player_table.inc b/sound/music_player_table.inc index 6c74a1352..c4c4d4b62 100644 --- a/sound/music_player_table.inc +++ b/sound/music_player_table.inc @@ -1,6 +1,36 @@ + .equiv TRACK_SIZE, 0x50 + .equiv NUM_TRACKS_BGM, 10 + .equiv NUM_TRACKS_SE1, 3 + .equiv NUM_TRACKS_SE2, 9 + .equiv NUM_TRACKS_SE3, 1 + + .bss + + .global gMPlayTrack_BGM +gMPlayTrack_BGM: + .space TRACK_SIZE * NUM_TRACKS_BGM + .size gMPlayTrack_BGM, .-gMPlayTrack_BGM + + .global gMPlayTrack_SE1 +gMPlayTrack_SE1: + .space TRACK_SIZE * NUM_TRACKS_SE1 + .size gMPlayTrack_SE1, .-gMPlayTrack_SE1 + + .global gMPlayTrack_SE2 +gMPlayTrack_SE2: + .space TRACK_SIZE * NUM_TRACKS_SE2 + .size gMPlayTrack_SE2, .-gMPlayTrack_SE2 + + .global gMPlayTrack_SE3 +gMPlayTrack_SE3: + .space TRACK_SIZE * NUM_TRACKS_SE3 + .size gMPlayTrack_SE3, .-gMPlayTrack_SE3 + + .section .rodata + .align 2 gMPlayTable:: - music_player gMPlayInfo_BGM, gMPlayTrack_BGM, 10, 0 - music_player gMPlayInfo_SE1, gMPlayTrack_SE1, 3, 1 - music_player gMPlayInfo_SE2, gMPlayTrack_SE2, 9, 1 - music_player gMPlayInfo_SE3, gMPlayTrack_SE3, 1, 0 + music_player gMPlayInfo_BGM, gMPlayTrack_BGM, NUM_TRACKS_BGM, 0 + music_player gMPlayInfo_SE1, gMPlayTrack_SE1, NUM_TRACKS_SE1, 1 + music_player gMPlayInfo_SE2, gMPlayTrack_SE2, NUM_TRACKS_SE2, 1 + music_player gMPlayInfo_SE3, gMPlayTrack_SE3, NUM_TRACKS_SE3, 0 diff --git a/src/m4a_1.s b/src/m4a_1.s index f71a5546e..be5d3576e 100644 --- a/src/m4a_1.s +++ b/src/m4a_1.s @@ -1910,27 +1910,7 @@ _081DDD90: .align 2, 0 @ Don't pad with nop. - .bss + .bss gDecodingBuffer: @ Used as a buffer for audio decoded from compressed DPCM .space 0x40 .size gDecodingBuffer, .-gDecodingBuffer - - .global gMPlayTrack_BGM -gMPlayTrack_BGM: - .space 0x320 - .size gMPlayTrack_BGM, .-gMPlayTrack_BGM - - .global gMPlayTrack_SE1 -gMPlayTrack_SE1: - .space 0xF0 - .size gMPlayTrack_SE1, .-gMPlayTrack_SE1 - - .global gMPlayTrack_SE2 -gMPlayTrack_SE2: - .space 0x2D0 - .size gMPlayTrack_SE2, .-gMPlayTrack_SE2 - - .global gMPlayTrack_SE3 -gMPlayTrack_SE3: - .space 0x50 - .size gMPlayTrack_SE3, .-gMPlayTrack_SE3 diff --git a/sym_bss.txt b/sym_bss.txt index 75da960bf..3a23e7478 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -55,6 +55,7 @@ .include "src/ereader_helpers.o" .include "src/faraway_island.o" .include "src/m4a_1.o" + .include "data/sound_data.o" .include "src/agb_flash.o" .include "src/siirtc.o" .include "*libgcc.a:dp-bit.o" From 04013fbdf2e3d06ba27ec25111c54798d92bc31d Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Sat, 22 Jan 2022 19:41:31 -0500 Subject: [PATCH 2/5] forgot we could do this --- sound/music_player_table.inc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/music_player_table.inc b/sound/music_player_table.inc index c4c4d4b62..5981a4d03 100644 --- a/sound/music_player_table.inc +++ b/sound/music_player_table.inc @@ -6,23 +6,19 @@ .bss - .global gMPlayTrack_BGM -gMPlayTrack_BGM: +gMPlayTrack_BGM:: .space TRACK_SIZE * NUM_TRACKS_BGM .size gMPlayTrack_BGM, .-gMPlayTrack_BGM - .global gMPlayTrack_SE1 -gMPlayTrack_SE1: +gMPlayTrack_SE1:: .space TRACK_SIZE * NUM_TRACKS_SE1 .size gMPlayTrack_SE1, .-gMPlayTrack_SE1 - .global gMPlayTrack_SE2 -gMPlayTrack_SE2: +gMPlayTrack_SE2:: .space TRACK_SIZE * NUM_TRACKS_SE2 .size gMPlayTrack_SE2, .-gMPlayTrack_SE2 - .global gMPlayTrack_SE3 -gMPlayTrack_SE3: +gMPlayTrack_SE3:: .space TRACK_SIZE * NUM_TRACKS_SE3 .size gMPlayTrack_SE3, .-gMPlayTrack_SE3 From 317e302147672d97bfcfa73efeb8372d797cee95 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Sat, 22 Jan 2022 19:43:11 -0500 Subject: [PATCH 3/5] fix inconsistent indentation --- src/m4a_1.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m4a_1.s b/src/m4a_1.s index be5d3576e..cc5d3238d 100644 --- a/src/m4a_1.s +++ b/src/m4a_1.s @@ -1912,5 +1912,5 @@ _081DDD90: .bss gDecodingBuffer: @ Used as a buffer for audio decoded from compressed DPCM - .space 0x40 - .size gDecodingBuffer, .-gDecodingBuffer + .space 0x40 + .size gDecodingBuffer, .-gDecodingBuffer From 3b756bfb3dd23bbdb2fb74606c0b064e92002a45 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Sat, 22 Jan 2022 20:38:41 -0500 Subject: [PATCH 4/5] fix compilation on modern --- ld_script_modern.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/ld_script_modern.txt b/ld_script_modern.txt index 092ff26c6..153ce7f6d 100644 --- a/ld_script_modern.txt +++ b/ld_script_modern.txt @@ -27,6 +27,7 @@ SECTIONS { /* .bss starts at 0x3000000 */ src/*.o(.bss); gflib/*.o(.bss); + data/*.o(.bss); *libc.a:*.o(.bss*); *libnosys.a:*.o(.bss*); From 2cc301603e47ece925deeceaf3c363b7250781ce Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Sat, 22 Jan 2022 21:30:39 -0500 Subject: [PATCH 5/5] lmao whitespace --- ld_script_modern.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ld_script_modern.txt b/ld_script_modern.txt index 153ce7f6d..a988fe0cd 100644 --- a/ld_script_modern.txt +++ b/ld_script_modern.txt @@ -27,7 +27,7 @@ SECTIONS { /* .bss starts at 0x3000000 */ src/*.o(.bss); gflib/*.o(.bss); - data/*.o(.bss); + data/*.o(.bss); *libc.a:*.o(.bss*); *libnosys.a:*.o(.bss*);