Maxmod
Data Fields
t_mmgbasystem Struct Reference

GBA setup information, passed to mmInit(). More...

#include <mm_types.h>

Data Fields

mm_addr active_channels
 Pointer to active channel buffer, this can be placed in EWRAM. Size of buffer must be MM_SIZEOF_ACTCH * mix_channel_count bytes.
 
mm_word mix_channel_count
 Number of mixing channels. Higher numbers offer better polyphony at expense of larger memory footprint and CPU load.
 
mm_addr mixing_channels
 Pointer to mixing channel buffer, this can be placed in EWRAM. Size of buffer must be MM_SIZEOF_MIXCH * mix_channel_count bytes.
 
mm_addr mixing_memory
 Pointer to mixing buffer, should be placed in IWRAM. Placing this buffer in EWRAM will cause a much higher CPU load. See description for size specification.
 
mm_mixmode mixing_mode
 Software mixing rate. May be 8, 10, 13, 16, 18, or 21 KHz (select value from enum). Higher values offer better quality at expense of a larger CPU and memory load.
 
mm_word mod_channel_count
 This is the amount of module channels there will be. It must be greater or equal to the largest channel number used by your modules (notice: NOT virtual channel number).
 
mm_addr module_channels
 Pointer to module channel buffer, this can be placed in EWRAM. Size of buffer must be MM_SIZEOF_MODCH * mod_channel_count bytes.
 
mm_addr soundbank
 Pointer to your soundbank file. (Most likely somewhere in the cartridge space).
 
mm_addr wave_memory
 Pointer to wave output buffer, this can be placed in EWRAM. see description for size specification.
 

Detailed Description

GBA setup information, passed to mmInit().

About mixing_memory: The mixing memory is a heavily used area of memory and should most definitely be located in the fast IWRAM. By default, devkitARM will place any global variables in IWRAM. The size of this buffer depeds on the mixing rate selected.

Check the mm_mixlen_enum values. These values contain the size of the mixing buffer in bytes. If you're using 16KHz mixing rate, your mixing buffer should be defined like this (as a global array):

u8 my_mixing_buffer[ MM_MIXEN_16KHZ ] __attribute__((aligned(4)));

Notice also that the mixing buffer should be aligned by 4 bytes.

About the wave buffer: The wave buffer is a not-so-heavily used area of memory and can be placed in EWRAM. The wave buffer contains the final waveform data that is DMA copied to the sound FIFO. The size of the waveform buffer must be equal to the size of the mixing buffer. By default (devkitARM), the malloc function can be used to allocate the wave buffer in EWRAM. The wave buffer must be aligned by 4 bytes too.


The documentation for this struct was generated from the following file: