1 /*---------------------------------------------------------------------------* 2 Project: Sound Pipeline (SP) for AX 3 File: sp.h 4 5 Copyright (C)1998-2011 Nintendo. All Rights Reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 *---------------------------------------------------------------------------*/ 13 14 #ifndef __SP_H__ 15 #define __SP_H__ 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 22 typedef struct 23 { 24 AXPBADPCM adpcm; 25 AXPBADPCMLOOP adpcmloop; 26 27 } SPAdpcmEntry; 28 29 30 typedef struct 31 { 32 u32 type; 33 u32 sampleRate; 34 u32 loopAddr; 35 u32 loopEndAddr; 36 u32 endAddr; 37 u32 currentAddr; 38 SPAdpcmEntry *adpcm; 39 40 } SPSoundEntry; 41 42 43 #define SP_TYPE_ADPCM_ONESHOT 0 44 #define SP_TYPE_ADPCM_LOOPED 1 45 #define SP_TYPE_PCM16_ONESHOT 2 46 #define SP_TYPE_PCM16_LOOPED 3 47 #define SP_TYPE_PCM8_ONESHOT 4 48 #define SP_TYPE_PCM8_LOOPED 5 49 50 51 typedef struct 52 { 53 54 u32 entries; 55 SPSoundEntry sound[1]; 56 57 } SPSoundTable; 58 59 60 61 void SPInitSoundTable(SPSoundTable *table, u8 *samples, u8 *zerobuffer); 62 SPSoundEntry * SPGetSoundEntry(SPSoundTable *table, u32 index); 63 void SPPrepareSound(SPSoundEntry *sound, AXVPB *axvpb, u32 sampleRate); 64 void SPPrepareEnd(SPSoundEntry *sound, AXVPB *axvpb); 65 66 67 #ifdef __cplusplus 68 } 69 #endif 70 71 #endif // __SP_H__ 72