Miles Sound System SDK 7.2a

AIL_set_scratchpad_policy

The function AIL_set_scratchpad_policy specifies whether (and how) MSS can use the PS2's scratchpad RAM.

MSS_RESOURCE_POLICY AIL_set_scratchpad_policy(
  MSS_RESOURCE_POLICY policy
);

In Parameters

policy
specifies the requested resource-usage policy.

Returns

The resource policy currently applicable to scratchpad RAM usage.

Discussion

By default, MSS does not use the PS2 scratchpad. However, certain operations (currently limited to MP3 decoding and DTS encoding) can be accelerated slightly by giving MSS permission to store intermediate results in SPRAM.

If your application does not use MP3 decoding or DTS output, then you do not need to call this function. If your application uses Miles's DTS or MP3 support but otherwise does not use the scratchpad RAM for anything including mixed foreground and background calls to the MP3 decoder, you can call this function with MSS_USE_WITHOUT_SAVING. If you need to be able to use the scratchpad with interrupts enabled, but would like the interrupt-driven parts of MSS to use it as well, you should pass MSS_USE_AND_SAVE to this function. (Saving and restoring the scratchpad contents imposes a performance cost of its own, so we can run a little faster if we don't have to preserve the scratchpad contents at interrupt time.)

You can call this function at any time. However, any requested changes made to Miles's scratchpad-usage policy will not take effect until the next end-of-buffer interrupt that Miles receives from the IOP. At that time, the value reported by AIL_scratchpad_policy (as well as this function) will change to reflect the new policy. Note that any foreground calls made by the application that end up calling the MP3 decoder to decompress audio data will not save the scratchpad contents under any conditions. This means that if you need to disable scratchpad usage in preparation for a foreground call to AIL_process_digital_audio or a similar function, you'll want to poll AIL_scratchpad_policy first until your requested change takes effect.


Group: Low-Level Sony PlayStation 2 Support Services
Related Sections: Miles DTS Provider for the Sony PS2, Resource Usage on the Playstation 2
Related Functions: AIL_process_digital_audio, AIL_scratchpad_policy
Related Basic Types: MSS_RESOURCE_POLICY

For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.