gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Getting sounds loaded on the ARM7

#131291 - NeX - Wed Jun 13, 2007 10:51 pm

Without using supercomplicated filesystems. I am going to be using this with a GBA flashcart (EFA-Linker) and want to load 15kb of sounds into memory. GBFS won't do it, throwing millions of errors at me. And, no matter how hard I try, BIN20 simply will not do anything. I am using the template for combined programs, and I can see clearly at the end of the ARM7 and ARM9 makefiles that BIN20 should be doing something - but the headers are never made and I cannot find any evidence that the makefile instructions are doing anything. I've tried putting the BIN files in a data folder in the ARM7 folder, in the source folder, build folder and even the ARM7 folder itself. Nothing works. How can I get a tiny amount of 16 bit (so BIN2C/BIN2H, which refuse to do anything but 8 bit are out) data into the ARM7? Help!

Here is the makefile bit I think should be converting the BIN files to 0.

Maybe I need to add more to this, but I am unsure.

Code:

#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o   :   %.bin
#---------------------------------------------------------------------------------
   @echo $(notdir $<)
   @$(bin2o)

-include $(DEPENDS)

_________________
Strummer or Drummer?.
Or maybe you would rather play with sand? Sandscape is for you in that case.

#131303 - phlip - Thu Jun 14, 2007 2:04 am

Check that the file is called something.bin, and is in a data/ directory, and that the DATA= directive at the top of the ARM9 Makefile is set to include this data/ directory...
_________________
<link rel="signature" type="text/hilarious" href="/funnysig.txt" />

#131338 - KeithE - Thu Jun 14, 2007 1:47 pm

I just ran into this yesterday - the arm9 makefile for the combined template in the libnds examples has the following:

Code:
DATA      :=       


I needed to change it to this, and put the data into arm9/data:

Code:
DATA      :=   data

#131348 - wintermute - Thu Jun 14, 2007 3:30 pm

NeX wrote:
Nothing works. How can I get a tiny amount of 16 bit (so BIN2C/BIN2H, which refuse to do anything but 8 bit are out) data into the ARM7? Help!


The ARM7 has only 96K available, embedding data there is unwise, especially when the default cores are not yet finalised and subject to future tweaking.

Unless you have a pressing need for a custom ARM7 core and the necessary understanding to keep it working I'd use the standard arm9 templates.

As Keith says you can embed the data easily in the ARM9 core and pointers can be passed to the sound data when you want to play it.

There is a simple sound demo in the libnds examples. The mechanism used to trigger audio will change but the functions will not.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#131353 - NeX - Thu Jun 14, 2007 4:41 pm

I want total control over the sound channels, from which channel the sound is played on to the volume of the channel, to the frequency of the channel. This would need to be changed every frame. And therefore ARM9 only code with an ARM9 only template is inadequate as I cannot access the appropiate registers.

Thanks KeithE. I shall try that.
_________________
Strummer or Drummer?.
Or maybe you would rather play with sand? Sandscape is for you in that case.

#131354 - wintermute - Thu Jun 14, 2007 4:57 pm

NeX wrote:
I want total control over the sound channels, from which channel the sound is played on to the volume of the channel, to the frequency of the channel. This would need to be changed every frame. And therefore ARM9 only code with an ARM9 only template is inadequate as I cannot access the appropiate registers.


That is planned for the default core. Hopefully soon - I have a project in progress which involves some audio handling.

I *still* maintain that adding binary data to the ARM7 core is pretty wasteful.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#131361 - NeX - Thu Jun 14, 2007 5:35 pm

I'm not in the least bothered. It is, after all, nothing more than a new version of StrumMe that is to mix new guitar sounds on the fly, so a whammy bar and custom string tension can be added. Your software is awesome, though, Wintermute.
_________________
Strummer or Drummer?.
Or maybe you would rather play with sand? Sandscape is for you in that case.

#131368 - NeX - Thu Jun 14, 2007 6:10 pm

At least it's finding the files now. But now I get this:
Code:
make[1]: Entering directory `/c/devkitPro/StrumMea/arm7'
make[2]: *** No rule to make target `crough.bin.o', needed by `/c/devkitPro/StrumMea/arm7/StrumMea.arm7.elf'.  Stop.
make[1]: *** [build] Error 2
make[1]: Leaving directory `/c/devkitPro/StrumMea/arm7'
"make": *** [arm7/StrumMea.elf] Error 2

There is a rule for the .BIN format. I have posted it at the top of the page.

A question. If I load the samples into ARM9 RAM, can I just throw a few pointers at the ARM7 and expect it to run them? It has to be in the RAM somewhere, because I intend to remove the cartridge once the program starts.

Oh well, it gives exactly the same error message on an appropiately altered ARM9 makefile, too. Only with the ARM7s turned into ARM9s.
_________________
Strummer or Drummer?.
Or maybe you would rather play with sand? Sandscape is for you in that case.