1 /*---------------------------------------------------------------------------*
2   Project:  Sound Pipeline (SP) for AX
3   File:     sp.h
4 
5   Copyright (C)1998-2006 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   $Log: sp.h,v $
14   Revision 1.2  2006/01/31 07:11:12  aka
15   Changed arguments of SPInitSoundTable().
16 
17 
18   $NoKeywords: $
19  *---------------------------------------------------------------------------*/
20 
21 #ifndef __SP_H__
22 #define __SP_H__
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 
29 typedef struct
30 {
31     AXPBADPCM       adpcm;
32     AXPBADPCMLOOP   adpcmloop;
33 
34 } SPAdpcmEntry;
35 
36 
37 typedef struct
38 {
39     u32             type;
40     u32             sampleRate;
41     u32             loopAddr;
42     u32             loopEndAddr;
43     u32             endAddr;
44     u32             currentAddr;
45     SPAdpcmEntry    *adpcm;
46 
47 } SPSoundEntry;
48 
49 
50 #define SP_TYPE_ADPCM_ONESHOT   0
51 #define SP_TYPE_ADPCM_LOOPED    1
52 #define SP_TYPE_PCM16_ONESHOT   2
53 #define SP_TYPE_PCM16_LOOPED    3
54 #define SP_TYPE_PCM8_ONESHOT    4
55 #define SP_TYPE_PCM8_LOOPED     5
56 
57 
58 typedef struct
59 {
60 
61     u32             entries;
62     SPSoundEntry    sound[1];
63 
64 } SPSoundTable;
65 
66 
67 
68 void SPInitSoundTable(SPSoundTable *table, u8 *samples, u8 *zerobuffer);
69 SPSoundEntry * SPGetSoundEntry(SPSoundTable *table, u32 index);
70 void SPPrepareSound(SPSoundEntry *sound, AXVPB *axvpb, u32 sampleRate);
71 void SPPrepareEnd(SPSoundEntry *sound, AXVPB *axvpb);
72 
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif // __SP_H__
79