📄 gamemain.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: GameMain.c
* Author: Robin.xjliu (eMail: xjliu@sunplus.com)
* Tel: 00885-028-87848688-5884
* Date: 2005-11-15
* Description: Benthal World game main
* Reference:
* Version history:
*-----------------------------------------------------------------------------
* Version YYYY-MM-DD-INDEX Modified By Description
* 1.0.0 2005-11-15 xjliu Create
*
*****************************************************************************/
#include "Include/GameMain.h"
#include "Include/Game_LCD.h"
extern U32 old_game_time, game_time;
extern U8 g_nText3Mode;
extern GAMESTATE BW_Play(void);
extern GAMESTATE BW_Complete(void);
U8 g_nKeyCnt;
/*
const LOAD_INFO LoadSpriteCell[] = {
{".\\Game_Sprite.bin" , SP_PGT_ADDR , O_CREAT | O_RDONLY, 0x480000},//0x479400
};*/
/**
* BW_Main - Benthal World game main function
*/
void BW_Main(void)
{
GAMESTATE nGameState;
InitTimer();
nGameState = BW_INIT;
old_game_time = 0;
game_time = 0;
while(1)
{
//Check State
switch(nGameState)
{
case BW_INIT:
LCD_LoadData();//Load sprite cell bin and LCD image data
InitTFTLcd(AUO_236, S_RGBDM, QVGA_Data,NO_SCL ,NO_SCL , 0);
LCD_InitBG();
#if defined(MIDI_ENABLE) || defined(AUDIO_ENABLE)
//init SPU
InitSPU();
//SetMidiChannelMask(0x00FF,0xFFFF);//bit0 ~ bit15 used by midi
SetMidiChannelMask(0x00FFFFFF);
SetMidiVolume(127);
#endif
g_nText3Mode = 1;//Texture3 will be init
g_bTextScrollFlag = false;
nGameState = BW_PRELUDE;
break;
case BW_PRELUDE:
nGameState = BW_Prelude();
break;
// case BW_MP4:
// nGameState = BW_INIT;//BW_PlayMP4();
// break;
case BW_PLAY:
nGameState = BW_Play();
asm("nop");
asm("nop");
break;
case BW_COMPLETE:
nGameState = BW_Complete();
break;
case BW_GAMESTATE_MAXNUM:
return;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -