?? 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/PPU_Texture.h"
#include "Include/PPU_Sprite.h"
#include "Include/PPU_Palette.h"
#include "Include/GPIO_Joystick.h"
#include "Include/Tve_Control.h"
/*
const LOAD_INFO testLoadInfo[] =
{
{".\\Index_Text1_xj.bin" , TEXT1_PNT_ADDR , O_CREAT | O_RDONLY, 0x4000 },
{".\\Index_Text2_xj.bin" , TEXT2_PNT_ADDR , O_CREAT | O_RDONLY, 0x4000 },
{".\\Index_Text3_xj.bin" , TEXT3_PNT_ADDR , O_CREAT | O_RDONLY, 0x4000 },
{".\\Pixel_Text1_xj.bin" , TEXT1_PGT_ADDR , O_CREAT | O_RDONLY, 0x100000},
{".\\Pixel_Text2_xj.bin" , TEXT2_PGT_ADDR , O_CREAT | O_RDONLY, 0x100000},
{".\\Pixel_Text3_xj.bin" , TEXT3_PGT_ADDR , O_CREAT | O_RDONLY, 0x100000},
{".\\Palette_xj.bin" , BG_PAL_ADDR , O_CREAT | O_RDONLY, 0x4000 },
//{".\\SPPalette.bin" , SP_PAL_ADDR , O_CREAT | O_RDONLY, 0x0000 },//0x4000
{".\\TextHeader_xj.bin" , TEXT_HEADER_ADDR , O_CREAT | O_RDONLY, 0x8000 },
//{".\\SpriteHeader.bin" , SP_HEADER_ADDR , O_CREAT | O_RDONLY, 0x0000 },//0x8000
//{".\\SpriteTab.bin" , SP_TBL_ADDR , O_CREAT | O_RDONLY, 0x00000 },//0x90000
{".\\SpriteCell_Game.bin" , SP_PGT_ADDR , O_CREAT | O_RDONLY, 0x479400},//0x479400
};*/
/**
* 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
// 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 = 0xa0e10000;
*P_PPU_FB_START_ADR2 = 0xa0ea6000;
*P_PPU_FB_START_ADR3 = 0xa0f3c000;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -