added support for firmware 3.x.x

This commit is contained in:
Maschell 2016-04-28 21:00:19 +02:00
parent d7afc99b56
commit 9291226f5a
2 changed files with 25 additions and 18 deletions

View File

@ -21,12 +21,12 @@
* 3. This notice may not be removed or altered from any source * 3. This notice may not be removed or altered from any source
* distribution. * distribution.
***************************************************************************/ ***************************************************************************/
#include "common/common.h"
#include "os_functions.h" #include "os_functions.h"
#include "ax_functions.h" #include "ax_functions.h"
unsigned int sound_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(void, AXInitWithParams, u32 * params); EXPORT_DECL(void, AXInitWithParams, u32 * params);
EXPORT_DECL(void, AXInit, void);
EXPORT_DECL(void, AXQuit, void); EXPORT_DECL(void, AXQuit, void);
EXPORT_DECL(u32, AXGetInputSamplesPerSec, void); EXPORT_DECL(u32, AXGetInputSamplesPerSec, void);
EXPORT_DECL(u32, AXGetInputSamplesPerFrame, void); EXPORT_DECL(u32, AXGetInputSamplesPerFrame, void);
@ -47,20 +47,29 @@ EXPORT_DECL(u32, AXGetVoiceLoopCount, void *v);
EXPORT_DECL(void, AXSetVoiceEndOffset, void *v, u32 offset); EXPORT_DECL(void, AXSetVoiceEndOffset, void *v, u32 offset);
EXPORT_DECL(void, AXSetVoiceLoopOffset, void *v, u32 offset); EXPORT_DECL(void, AXSetVoiceLoopOffset, void *v, u32 offset);
void InitAcquireAX(void)
{
OSDynLoad_Acquire("sndcore2.rpl", &sound_handle);
}
void InitAXFunctionPointers(void) void InitAXFunctionPointers(void)
{ {
InitAcquireAX(); unsigned int sound_handle = 0;
unsigned int *funcPointer = 0; unsigned int *funcPointer = 0;
OSDynLoad_Acquire("sndcore2.rpl", &sound_handle);
if(OS_FIRMWARE >= 400)
{
AXInit = 0;
OSDynLoad_Acquire("sndcore2.rpl", &sound_handle);
OS_FIND_EXPORT(sound_handle, AXInitWithParams); OS_FIND_EXPORT(sound_handle, AXInitWithParams);
OS_FIND_EXPORT(sound_handle, AXQuit);
OS_FIND_EXPORT(sound_handle, AXGetInputSamplesPerSec); OS_FIND_EXPORT(sound_handle, AXGetInputSamplesPerSec);
}
else
{
AXInitWithParams = 0;
AXGetInputSamplesPerSec = 0;
OSDynLoad_Acquire("snd_core.rpl", &sound_handle);
OS_FIND_EXPORT(sound_handle, AXInit);
}
OS_FIND_EXPORT(sound_handle, AXQuit);
OS_FIND_EXPORT(sound_handle, AXVoiceBegin); OS_FIND_EXPORT(sound_handle, AXVoiceBegin);
OS_FIND_EXPORT(sound_handle, AXVoiceEnd); OS_FIND_EXPORT(sound_handle, AXVoiceEnd);
OS_FIND_EXPORT(sound_handle, AXSetVoiceType); OS_FIND_EXPORT(sound_handle, AXSetVoiceType);

View File

@ -30,13 +30,11 @@ extern "C" {
#include <gctypes.h> #include <gctypes.h>
extern unsigned int sound_handle;
void InitAXFunctionPointers(void); void InitAXFunctionPointers(void);
void InitAcquireAX(void);
void ProperlyEndTransitionAudio(void); void ProperlyEndTransitionAudio(void);
extern void (* AXInitWithParams)(u32 * params); extern void (* AXInitWithParams)(u32 * params);
extern void (* AXInit)(void);
extern void (* AXQuit)(void); extern void (* AXQuit)(void);
extern u32 (* AXGetInputSamplesPerSec)(void); extern u32 (* AXGetInputSamplesPerSec)(void);
extern s32 (* AXVoiceBegin)(void *v); extern s32 (* AXVoiceBegin)(void *v);