areainfo.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:2k
- /*
- Desc: Implentation file for funtions to put area info to Vaddise SDRAM.
- Author: Jerry CAI
- Created on: Dec 17, 2003
- */
- #include "config.h"
- #if D_SUPPORT_SACD
- #include "playcorescpadscmgr.h"
- #include "playcoresampsamp_gen.h"
- /*
- Description: save a number bytes within SACD area info to Vaddise SDRAM.
- Input: SAMP(SACD_Area) area, should be either SAMP(SACD_AREA_MULTICHANNEL) or SAMP(SACD_AREA_STEREO).
- SAMP(Byte) *buffPtr, pointer to the buffer that contains a part of the area info.
- SAMP(UInt16) offset, the 1st byte's relative position within the context of struct SAMP(SAMP_AreaInfoDef).
- SAMP(UInt16) size, the number of bytes to be saved.
- */
- void SaveSACDAreaInfo(SAMP(SACD_Area) area, SAMP(Byte) *buffPtr, SAMP(UInt16) offset, SAMP(UInt16) size)
- {
- DWORD startAddrInSDRAM = SDRAM_2CH_AREA_INFO_BASE;
- if(SAMP(SACD_AREA_MULTICHANNEL) == area)
- startAddrInSDRAM = SDRAM_MULTICH_AREA_INFO_BASE;
- sc_SetBytes32(startAddrInSDRAM, offset, size, (const BYTE *)buffPtr);
- }
- #if 0
- void test(void)
- {
- int i;
- char buff[2];
- for(i = 0; i < 3000; i++)
- {
- buff[0] = i%250;
- SaveSACDAreaInfo(SAMP(SACD_AREA_MULTICHANNEL), buff, i, 1);
- }
- for(i = 3000; i > 0; i--)
- {
- buff[0] = i%250;
- SaveSACDAreaInfo(SAMP(SACD_AREA_STEREO), buff, i, 1);
- }
- for(i = 0; i < 3000; i++)
- {
- sc_GetBytes32(SDRAM_MULTICH_AREA_INFO_BASE, i, 1, buff);
- printf("%dn", buff[0]);
- }
- for(i = 0; i < 3000; i++)
- {
- sc_GetBytes32(SDRAM_2CH_AREA_INFO_BASE, i, 1, buff);
- printf("%dn", buff[0]);
- }
- }
- #endif
- #endif