1 /*---------------------------------------------------------------------------* 2 3 Copyright (C) 2010-2012 Nintendo. All rights reserved. 4 5 These coded instructions, statements, and computer programs contain 6 proprietary information of Nintendo of America Inc. and/or Nintendo 7 Company Ltd., and are protected by Federal copyright law. They may 8 not be disclosed to third parties or copied or duplicated in any form, 9 in whole or in part, without the prior written consent of Nintendo. 10 11 *---------------------------------------------------------------------------*/ 12 13 #ifndef __DEMOAVX_H_ 14 #define __DEMOAVX_H_ 15 16 /*---------------------------------------------------------------------------* 17 * Includes 18 *---------------------------------------------------------------------------*/ 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 #define AVX_FRAME_SIZE_SAMPLES 160 // 160 stereo samples @ 32KHz. 25 #define AVX_FRAME_SIZE_WORDS (160*2) // 2 words per stereo sample. 26 #define AVX_FRAME_SIZE_BYTES (160*2*2) // 2 bytes per sample, 2 channels. 27 28 /// \brief Initializes AVX. 29 /// 30 /// \param left AVX left buffer. 31 /// \param right AVX right buffer. 32 /// \param size AVX buffer size. 33 /// 34 void DEMOAVXInit (s16 *left, s16 *right, u32 size); 35 36 /// \brief Refreshes the AVX buffer. 37 /// 38 /// \param start_index Pointer to save the starting position in the final sample buffer. 39 /// \param end_index Pointer to save the ending position in the final sample buffer. 40 /// 41 /// \retval Number of frames filled * <tt>AVX_FRAME_SIZE_SAMPLES</tt>. 42 u32 DEMOAVXRefreshBuffer (u32 *start_index, u32 *end_index); 43 44 /// \brief Clears the buffer and attaches the AVX interrupt handler. 45 /// 46 /// \param buffer Buffer to clear and use. 47 /// \param num_frames Number of frames in the buffer. 48 /// 49 void DEMOAVXAttach (void *buffer, u32 num_frames); 50 51 /// \brief Gets the current audio frame index. 52 /// 53 /// \retval Current frame index. 54 u32 DEMOAVXGetFrameCounter (void); 55 56 /// \brief Gets the number of frames filled since the last user refresh. 57 /// 58 /// \retval Number of frames filled. 59 u32 DEMOAVXGetNumFilled (void); 60 61 #ifdef __cplusplus 62 } 63 #endif 64 65 #endif // _DEMOAVX_H_ 66