AXInitSpecifyMem

Syntax

#include <revolution/ax.h>

void AXInitSpecifyMem(u32 num, void* mem);

Arguments

num Maximum voice count.
mem User-allocated memory area for the AX library.

Return Values

None.

Description

The AXInitSpecifyMem function expands the AXInit function to allow specification of maximum voice count and library memory area.

The num argument specifies maximum voice count. The upper limit of voice count is AX_MAX_VOICES.

User-allocated AX library memory will be specified to the mem argument. Memory size is obtained using the AXGetMemorySize macro. Top address of the memory has to be 32-byte aligned.

To control a voice, AX library needs the AXPB, AXVPB, and AXPBITDBUFFER structures for each voice. AX library has the AX_MAX_VOICES count of each structure, which is defined as static.

If AXInit is used for the AX library initialization, the above structures defined in the library are used for controlling voices.

Alternately, if this function is used in place of AXInit, the structures allocated to the area specified by mem will be used for the control. Here, the linkers for the structures defined within the library will not link; unnecessary structures will not consume extra memory.

Use this function to make the maximum voice count smaller than AX_MAX_VOICES, or to allocate voice control structures to a memory of choice between MEM1 and MEM2.

Note: Generally, MEM2 has a slower access speed than MEM1. Compared to MEM1, placing the voice control structures on MEM2 will decrease the number of simultaneous playback voices. In addition, the DSP load estimate of AX assumes that the structures are placed in MEM1. Their placement in MEM2 will make the actual DSP processing time longer than the AX-estimate time, resulting in possible noise in the playback. When placing voice control structures in MEM2, use the AXRegisterExceedCallback function to adjust the maximum voice count to prevent noise.

See Also

AXInit, AXGetMemorySize, AXRegisterExceedCallback

Revision History

2006/10/24 Initial version.


CONFIDENTIAL