📄 mini_system.c
字号:
/******************************************************************************
*
* The information contained herein is the exclusive property of
* Sunplus Technology Co. And shall not be distributed, reproduced,
* or disclosed in whole in part without prior written permission.
*
* (C) COPYRIGHT 2005 SUNPLUS TECHNOLOGY CO.
* ALL RIGHTS RESERVED
*
* The entire notice above must be reproduced on all authorized copies.
*
*****************************************************************************/
/******************************************************************************
* Filename: Mini_System.c
* Author: Robin.xjliu (eMail: xjliu@sunplus.com)
* Tel: 00885-028-87848688-5884
* Date: 2005-11-11
* Description: initialize a mini system, that is to say it's a basic system.
* Reference:
* Version history:
*-----------------------------------------------------------------------------
* Version YYYY-MM-DD-INDEX Modified By Description
* 1.0.0 2005-11-11 xjliu Create
*
*****************************************************************************/
#include "Include/Mini_System.h"
#include "Include/MIU_Control.h"
#include "Include/PPU_Control.h"
#include "Include/GPIO_Joystick.h"
#include "Include/Tve_Control.h"
/**
* InitSystem - initialize all basic function
*/
void InitSystem(void)
{
//initialize MIU1 & MIU2
MIU1_Init();
//MIU2_Init();
//clear all register
ClearAllSetting();
//initialize joystick
InitJoystick();
//load data
//Sys_Load_SDCard(&testLoadInfo, ASZ(testLoadInfo));
//initial TV
//InitTV();//must use Fade_In
//initial PPU
InitPPU();
*P_VBLK_TIME = 0x5a;
*P_IRQ_CONTROL = 0x00000001;
}
/**
* ClearAllSetting - clear all register setting
*/
void ClearAllSetting(void)
{
U32 i;
//clear Texture register
ClearTextRegister();
//clear Sprite register
for ( i = 0 ; i < 512*2 ; i++ )
*(P_PPU_Sprite + i )= 0;
//clear movement
for(i=0; i<512; i++)
*(P_PPU_Tx_HOffset_ADR+i) = 0x00;
//clear compress
for(i=0; i<512; i++)
*(P_PPU_Tx1_HCmp_ADR+i) = 0x100;
// Enable PPU to TV Hardware Buffer Control
*P_PTR_SETTING = PPU_P2L_HW4|TVE_P2T_HW4;
*P_P2T_SETTING = PPU_P2T_EN; // PPU2TVE Enable, $8809003C = 0x00000001
*P_HW4_SETTING = 0x01;
// Setup PPU Output Frame Buffer Start Address
*P_PPU_FB_START_ADR1 = 0xa0d00000;
*P_PPU_FB_START_ADR2 = 0xa0e00000;
*P_PPU_FB_START_ADR3 = 0xa0f00000;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -