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

📄 gottlieb.c

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 C
📖 第 1 页 / 共 5 页
字号:

static const char *qbert_sample_names[] =
{
	"*qbert",
	"FX_18.SAM", /*curse*/
	"FX_20.SAM", /*little purple guy*/
	"fx_22.sam", /*snake falling */
	"fx_17.sam", /*green guy*/
     0	/* end of array */
};

/* Reactor is the only game which doesn't have non volatile RAM */
static int reactor_hiload(void)
{
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];


	/* check if the hi score table has already been initialized */
	if (memcmp(&RAM[0x04e3],"\x01\x00\x00\x00",4) == 0 &&
			memcmp(&RAM[0x0554],"\x03\x00\x00",3) == 0 &&
			memcmp(&RAM[0x05c7],"\x02\x00\x00\x00",4) == 0 &&
			memcmp(&RAM[0x0638],"\x06\x00\x00",3) == 0)
	{
		void *f;


		if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
		{
			osd_fread(f,&RAM[0x04d8],16*8);	/* 3 lives */
			osd_fread(f,&RAM[0x05bc],16*8);	/* 7 lives */

			osd_fclose(f);
		}

		return 1;
	}
	else return 0;	/* we can't load the hi scores yet */
}

static void reactor_hisave(void)
{
	void *f;
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];


	if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,1)) != 0)
	{
		osd_fwrite(f,&RAM[0x04d8],16*8);	/* 3 lives */
		osd_fwrite(f,&RAM[0x05bc],16*8);	/* 7 lives */
		osd_fclose(f);
	}
}


int gottlieb_nvram_load(void)
{
	void *f;
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];


	/* Try loading static RAM */
	if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
	{
		/* just load in everything, the game will overwrite what it doesn't want */
		osd_fread(f,&RAM[0x0000],0x1000);
		osd_fclose(f);
	}
	/* Invalidate the static RAM to force reset to factory settings */
	else memset(&RAM[0x0000],0xff,0x1000);

	return 1;
}

void gottlieb_nvram_save(void)
{
	void *f;
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];


	if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,1)) != 0)
	{
		osd_fwrite(f,&RAM[0x0000],0x1000);
		osd_fclose(f);
	}
}


struct GameDriver reactor_driver =
{
	__FILE__,
	0,
	"reactor",
	"Reactor",
	"1982",
	"Gottlieb",
	"Fabrice Frances",
	0,
	&reactor_machine_driver,
	0,

	reactor_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	reactor_input_ports,

	0, 0, 0,
	ORIENTATION_DEFAULT,

	reactor_hiload, reactor_hisave     /* hi-score load and save */
};

struct GameDriver mplanets_driver =
{
	__FILE__,
	0,
	"mplanets",
	"Mad Planets",
	"1983",
	"Gottlieb",
	"Fabrice Frances",
	0,
	&gottlieb_machine_driver,
	0,

	mplanets_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	mplanets_input_ports,

	0, 0, 0,
	ORIENTATION_ROTATE_270,

	gottlieb_nvram_load, gottlieb_nvram_save
};

struct GameDriver qbert_driver =
{
	__FILE__,
	0,
	"qbert",
	"Q*Bert (US)",
	"1982",
	"Gottlieb",
	"Fabrice Frances (MAME driver)\nMarco Cassili\nJohn Butler     (speech\nHowie Cohen     samples)\n\nDedicated to:\nWarren Davis\nJeff Lee\nDavid Thiel",
	0,
	&gottlieb_machine_driver,
	0,

	qbert_rom,
	0, 0,
	qbert_sample_names,
	0,	/* sound_prom */

	qbert_input_ports,

	0, 0, 0,
	ORIENTATION_ROTATE_270,

	gottlieb_nvram_load, gottlieb_nvram_save
};

struct GameDriver qbertjp_driver =
{
	__FILE__,
	&qbert_driver,
	"qbertjp",
	"Q*Bert (Japan)",
	"1982",
	"Gottlieb (Konami license)",
	"Fabrice Frances (MAME driver)\nMarco Cassili\nJohn Butler     (speech\nHowie Cohen     samples)\n\nDedicated to:\nWarren Davis\nJeff Lee\nDavid Thiel",
	0,
	&gottlieb_machine_driver,
	0,

	qbertjp_rom,
	0, 0,
	qbert_sample_names,
	0,	/* sound_prom */

	qbert_input_ports,

	0, 0, 0,
	ORIENTATION_ROTATE_270,

	gottlieb_nvram_load, gottlieb_nvram_save
};

struct GameDriver sqbert_driver =
{
	__FILE__,
	0,
	"sqbert",
	"FHMC Q*Bert",
	"1983",
	"Mylstar",
	"Fabrice Frances (MAME driver)\nMarco Cassili\nJohn Butler     (speech\nHowie Cohen     samples)\n\n Special thanks to:\nFred Sookiasian\n\nDedicated to:\nWarren Davis\nJeff Lee\nDavid Thiel",
	0,
	&gottlieb_machine_driver,
	0,

	sqbert_rom,
	0, 0,
	qbert_sample_names,
	0,	/* sound_prom */

	qbert_input_ports,

	0, 0, 0,
	ORIENTATION_ROTATE_270,

	gottlieb_nvram_load, gottlieb_nvram_save
};

struct GameDriver qbertqub_driver =
{
	__FILE__,
	0,
	"qbertqub",
	"Q*Bert Qubes",
	"1983",
	"Mylstar",
	"Fabrice Frances & Rodimus Prime (MAME driver)\nMarco Cassili",
	0,
	&qbertqub_machine_driver,
	0,

	qbertqub_rom,
	0, 0,
	qbert_sample_names,
	0,	/* sound_prom */

	qbertqub_input_ports,

	0, 0, 0,
	ORIENTATION_ROTATE_270,

	gottlieb_nvram_load, gottlieb_nvram_save
};

struct GameDriver krull_driver =
{
	__FILE__,
	0,
	"krull",
	"Krull",
	"1983",
	"Gottlieb",
	"Fabrice Frances (MAME driver)\nMarco Cassili",
	0,
	&krull_machine_driver,
	0,

	krull_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	krull_input_ports,

	0, 0, 0,
	ORIENTATION_ROTATE_270,

	gottlieb_nvram_load, gottlieb_nvram_save
};

struct GameDriver mach3_driver =
{
	__FILE__,
	0,
	"mach3",
	"M.A.C.H. 3",
	"1983",
	"Mylstar",
	"Fabrice Frances (MAME driver)\n\n"
	"This is a LASER DISC game, so it doesn't work.",
	GAME_NOT_WORKING,
	&mach3_machine_driver,
	0,

	mach3_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	mach3_input_ports,

	0, 0, 0,
	ORIENTATION_DEFAULT,

	gottlieb_nvram_load, gottlieb_nvram_save
};

struct GameDriver usvsthem_driver =
{
	__FILE__,
	0,
	"usvsthem",
	"Us vs. Them",
	"????",
	"Mylstar",
	"Fabrice Frances (MAME driver)\n\n"
	"This is a LASER DISC game, so it doesn't work.",
	GAME_NOT_WORKING,
	&usvsthem_machine_driver,
	0,

	usvsthem_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	usvsthem_input_ports,

	0, 0, 0,
	ORIENTATION_DEFAULT,

	gottlieb_nvram_load, gottlieb_nvram_save
};

struct GameDriver stooges_driver =
{
	__FILE__,
	0,
	"3stooges",
	"Three Stooges",
	"1984",
	"Mylstar",
	"Fabrice Frances (MAME driver)\nJohn Butler\nMarco Cassili",
	0,
	&stooges_machine_driver,
	0,

	stooges_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	stooges_input_ports,

	0, 0, 0,
	ORIENTATION_DEFAULT,

	gottlieb_nvram_load, gottlieb_nvram_save
};

struct GameDriver curvebal_driver =
{
	__FILE__,
	0,
	"curvebal",
	"Curve Ball",
	"1984",
	"Mylstar",
	"Fabrice Frances (MAME driver)",
	0,
	&gottlieb_machine_driver,
	0,

	curvebal_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	curvebal_input_ports,

	0, 0, 0,
	ORIENTATION_ROTATE_270,

	gottlieb_nvram_load, gottlieb_nvram_save
};

⌨️ 快捷键说明

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