summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCameron Hall <cameronghall@cox.net>2019-08-01 23:00:58 -0500
committerCameron Hall <cameronghall@cox.net>2019-08-01 23:00:58 -0500
commit840dc3e1c2fee61ded7cbd88e6d8626bd4c14d8b (patch)
tree637fa2eab597e6da11c1fb5c5fd2aef61596ca6d
parentc04e14d2fe1bd7ca5b45f2b85db228fc35ad6b4f (diff)
define SoundMainRAM_Buffer
-rwxr-xr-xld_script.txt5
-rwxr-xr-xsrc/m4a_2.c7
-rwxr-xr-xsym_bss.txt3
3 files changed, 7 insertions, 8 deletions
diff --git a/ld_script.txt b/ld_script.txt
index d835ab3..8fa89eb 100755
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -15,8 +15,11 @@ SECTIONS
iwram (NOLOAD) :
ALIGN(4)
{
- /* .bss starts at 0x3000000 */
+ /* .bss starts at 0x3000000 */
<BSS>
+ /* .bss.code starts at 0x3007400 */
+ src/m4a_2.o(.bss.code);
+
. = 0x8000;
}
diff --git a/src/m4a_2.c b/src/m4a_2.c
index 0381b6a..3dd2ffc 100755
--- a/src/m4a_2.c
+++ b/src/m4a_2.c
@@ -1,6 +1,6 @@
#include "gba/m4a_internal.h"
-// #define BSS_CODE __attribute__((section(".bss.code")))
+#define BSS_CODE __attribute__((section(".bss.code")))
asm(".set gScaleTable, 0x0852D928"); // TODO:
asm(".set gFreqTable, 0x0852D9DC"); // TODO:
@@ -14,7 +14,8 @@ asm(".set gCgbScaleTable, 0x0852DA24"); // TODO:
asm(".set gCgbFreqTable, 0x0852DAA8"); // TODO:
asm(".set gNumMusicPlayers, 0x4"); // TODO:
-extern char SoundMainRAM_Buffer[0x800];
+BSS_CODE ALIGNED(4) char SoundMainRAM_Buffer[0x800] = {0};
+
struct SoundInfo gSoundInfo;
struct PokemonCrySong gPokemonCrySongs[MAX_POKEMON_CRIES];
struct MusicPlayerInfo gPokemonCryMusicPlayers[MAX_POKEMON_CRIES];
@@ -27,8 +28,6 @@ struct MusicPlayerInfo gMPlayInfo_SE1;
struct MusicPlayerInfo gMPlayInfo_SE2;
u8 gMPlayMemAccArea[0x10];
-// BSS_CODE ALIGNED(4) char SoundMainRAM_Buffer[0x800] = {0};
-
u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust)
{
u32 val1;
diff --git a/sym_bss.txt b/sym_bss.txt
index f282d64..fc81cd3 100755
--- a/sym_bss.txt
+++ b/sym_bss.txt
@@ -12,6 +12,3 @@ gUnknown_03005C00: @ 0x3005C00
.space 0xC00
.space 0xC00
-
-SoundMainRAM_Buffer: @ 0x3007400
- .space 0x800