⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wince_driver.cpp

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 CPP
字号:
/* PocketCultMAME - MAME Emulator for PocketPC
   (c) Copyright 2006 Manuel Castrillo Mart韓ez

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#include "wince_initWnd.h"
#include "wince_driver.h"
#include "wince_audio.h"
#include "wince_cfg.h"

extern "C" {
	#include "audio.h"
	#include "driver.h"
	#include "wince_util.h"

	extern int soundcard;
	extern int use_emulated_ym3812;

	extern cfgStruct GameConfig;
}

struct GameOptions options;



void gameList(void)
{
}


const char * gameDescriptionByIndex( int gameIndex )
{
	return( drivers[gameIndex]->description );
}


const char * gameNameByIndex( int gameIndex )
{
	return( drivers[gameIndex]->name );
}


int gameExist( char *gname, char *fullName, int &gameIndex )
{
	int i, gi;

	gi = -1;
	for (i = 0; drivers[i] && (gi == -1); i++)
	{
		if (_stricmp(gname,drivers[i]->name) == 0)
		{
			strcpy(fullName, drivers[i]->description);
			gameIndex = i;
			return(1);
		}
	}

	return(0);

}


int gameLaunch( int gameIndex )
{

	char text[256];
	int res;

	// sound
	if( !GameConfig.sndEnabled )
	{
		soundcard = 0;
		use_emulated_ym3812=0;
		options.samplerate = 0;
		options.samplebits = 0;
	}
	else
	{
		soundcard = 1;
		use_emulated_ym3812= 1;
		options.samplerate = sndFrequency[GameConfig.sndFreq];
		options.samplebits = (GameConfig.sndBits == AUDIO_FORMAT_8BITS ) ? 8 : 16;
	}


	// Show init window 
	createInitWindow();

	sprintf(text,"Loading \"%s\"...\n",drivers[gameIndex]->description);
	writeLog(text);

	/* go for it */
	res = run_game(gameIndex , &options);
	
	/* Error? */
	if( res != 0 )
		writeLog("LOAD FAILED !!!");

	return res;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -