AXInitSpecifyMem

C Specification

#include <revolution>

void AXInitSpecifyMem(u32 num, void* mem);

Arguments

num Maximum voice count.
mem User allocated AX library memory.

Return Values

None.

Description

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

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

User-allocated AX library memory will be specified to the argument mem. The memory size is obtained with the macro AXGetMemorySize. The top address of the memory needs to be 32 byte aligned.

The AX library needs AXPB, AXVPB, and AXPBITDBUFFER structures for each voice to control voice. The AX library has count AX_MAX_VOICES of each structure, defined by static.

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

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

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

Note: Generally, MEM2 will have slower access speed compared to MEM1. Placing the voice control structures on MEM2 will decrease the simultaneous playback voices compared to placement in MEM1. Also, the DSP load estimate of AX presupposes 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 the 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