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

📄 bwidow.c

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 C
📖 第 1 页 / 共 3 页
字号:
			bwidow_readmem,bwidow_writemem,0,0,
			interrupt,4	/* 4.1ms */
		}
	},
	60, 0,	/* frames per second, vblank duration (vector game, so no vblank) */
	1,
	0,

	/* video hardware */
	320, 240, { 0, 480, 0, 440 },
	0,
	256, 256,
	avg_init_colors,

	VIDEO_TYPE_VECTOR,
	0,
	avg_start,
	avg_stop,
	avg_screenrefresh,

	/* sound hardware */
	0,0,0,0,
	{
		{
			SOUND_POKEY,
			&pokey_interface
		}
	}
};

static struct MachineDriver gravitar_machine_driver =
{
	/* basic machine hardware */
	{
		{
			CPU_M6502,
			1500000,	/* 1.5 Mhz */
			0,
			bwidow_readmem,bwidow_writemem,0,0,
			interrupt,4 /* 4.1ms */
		}
	},
	60, 0,	/* frames per second, vblank duration (vector game, so no vblank) */
	1,
	0,

	/* video hardware */
	320, 240, { 0, 420, 0, 400 },
	0,
	256, 256,
	avg_init_colors,

	VIDEO_TYPE_VECTOR,
	0,
	avg_start,
	avg_stop,
	avg_screenrefresh,

	/* sound hardware */
	0,0,0,0,
	{
		{
			SOUND_POKEY,
			&pokey_interface
		}
	}
};

static struct MachineDriver spacduel_machine_driver =
{
	/* basic machine hardware */
	{
		{
			CPU_M6502,
			1500000,	/* 1.5 Mhz */
			0,
			spacduel_readmem,spacduel_writemem,0,0,
			interrupt,4 /* 5.4ms */
		}
	},
	45, 0,	/* frames per second, vblank duration (vector game, so no vblank) */
	1,
	0,

	/* video hardware */
	320, 240, { 0, 540, 0, 400 },
	0,
	256, 256,
	avg_init_colors,

	VIDEO_TYPE_VECTOR,
	0,
	avg_start,
	avg_stop,
	avg_screenrefresh,

	/* sound hardware */
	0,0,0,0,
	{
		{
			SOUND_POKEY,
			&pokey_interface
		}
	}
};



/***************************************************************************

  Game driver(s)

***************************************************************************/

/* Black Widow cannot use the the earom routines
 * She writes into some locations at $2fac-$2fd7, which is clearly
 * the vector rom. Perhaps there is some address-logic that is not yet
 * emulated
 */

static int bwidow_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[0x0310],"\x00\x00\x00",3) == 0 &&
		memcmp(&RAM[0x03a0],"\x01\x01\x11",3) == 0)
	{
		void *f;


		if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
		{
			osd_fread(f,&RAM[0x0310],7*21);
			osd_fclose(f);
		}

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

static void bwidow_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[0x0310],7*21);
		osd_fclose(f);
	}
}


ROM_START( bwidow_rom )
	ROM_REGION(0x10000)	/* 64k for code */
	/* Vector ROM */
	ROM_LOAD( "136017.107",   0x2800, 0x0800, 0x97f6000c )
	ROM_LOAD( "136017.108",   0x3000, 0x1000, 0x3da354ed )
	ROM_LOAD( "136017.109",   0x4000, 0x1000, 0x2fc4ce79 )
	ROM_LOAD( "136017.110",   0x5000, 0x1000, 0x0dd52987 )
	/* Program ROM */
	ROM_LOAD( "136017.101",   0x9000, 0x1000, 0xfe3febb7 )
	ROM_LOAD( "136017.102",   0xa000, 0x1000, 0x10ad0376 )
	ROM_LOAD( "136017.103",   0xb000, 0x1000, 0x8a1430ee )
	ROM_LOAD( "136017.104",   0xc000, 0x1000, 0x44f9943f )
	ROM_LOAD( "136017.105",   0xd000, 0x1000, 0xa046a2e2 )
	ROM_LOAD( "136017.106",   0xe000, 0x1000, 0x4dc28b22 )
	ROM_RELOAD(              0xf000, 0x1000 )	/* for reset/interrupt vectors */
ROM_END


struct GameDriver bwidow_driver =
{
	__FILE__,
	0,
	"bwidow",
	"Black Widow",
	"1982",
	"Atari",
	"Brad Oliver (MAME driver)\n"VECTOR_TEAM,
	0,
	&bwidow_machine_driver,
	0,

	bwidow_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	bwidow_input_ports,

	color_prom, 0,0,
	ORIENTATION_DEFAULT,

	bwidow_hiload, bwidow_hisave
};



/***************************************************************************

  Game driver(s)

***************************************************************************/

/* Gravitar now uses the earom routines
 * However, we keep the highscore location, just in case
 *		osd_fwrite(f,&RAM[0x041e],3*16);
 */

ROM_START( gravitar_rom )
	ROM_REGION(0x10000)	/* 64k for code */
	/* Vector ROM */
	ROM_LOAD( "136010.210",   0x2800, 0x0800, 0xdebcb243 )
	ROM_LOAD( "136010.207",   0x3000, 0x1000, 0x4135629a )
	ROM_LOAD( "136010.208",   0x4000, 0x1000, 0x358f25d9 )
	ROM_LOAD( "136010.209",   0x5000, 0x1000, 0x37034287 )
	/* Program ROM */
	ROM_LOAD( "136010.201",   0x9000, 0x1000, 0x167315e4 )
	ROM_LOAD( "136010.202",   0xa000, 0x1000, 0xaaa9e62c )
	ROM_LOAD( "136010.203",   0xb000, 0x1000, 0xae437253 )
	ROM_LOAD( "136010.204",   0xc000, 0x1000, 0x5d6bc29e )
	ROM_LOAD( "136010.205",   0xd000, 0x1000, 0x0db1ff34 )
	ROM_LOAD( "136010.206",   0xe000, 0x1000, 0x4521ca48 )
	ROM_RELOAD(              0xf000, 0x1000 )	/* for reset/interrupt vectors */
ROM_END


struct GameDriver gravitar_driver =
{
	__FILE__,
	0,
	"gravitar",
	"Gravitar",
	"1982",
	"Atari",
	"Brad Oliver (MAME driver)\n"VECTOR_TEAM,
	0,
	&gravitar_machine_driver,
	0,

	gravitar_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	gravitar_input_ports,

	color_prom, 0, 0,
	ORIENTATION_DEFAULT,

	atari_vg_earom_load, atari_vg_earom_save
};

/***************************************************************************

  Game driver(s)

***************************************************************************/

/* Space Duel now uses the earom routines
 * However, we keep the highscore location, just in case
 *	osd_fwrite(f,&RAM[0x00dd],3*20+3*25);
 */

ROM_START( spacduel_rom )
	ROM_REGION(0x10000)	/* 64k for code */
	/* Vector ROM */
	ROM_LOAD( "136006.106",   0x2800, 0x0800, 0x691122fe )
	ROM_LOAD( "136006.107",   0x3000, 0x1000, 0xd8dd0461 )
	/* Program ROM */
	ROM_LOAD( "136006.201",   0x4000, 0x1000, 0xf4037b6e )
	ROM_LOAD( "136006.102",   0x5000, 0x1000, 0x4c451e8a )
	ROM_LOAD( "136006.103",   0x6000, 0x1000, 0xee72da63 )
	ROM_LOAD( "136006.104",   0x7000, 0x1000, 0xe41b38a3 )
	ROM_LOAD( "136006.105",   0x8000, 0x1000, 0x5652710f )
	ROM_RELOAD(              0x9000, 0x1000 )
	ROM_RELOAD(              0xa000, 0x1000 )
	ROM_RELOAD(              0xb000, 0x1000 )
	ROM_RELOAD(              0xc000, 0x1000 )
	ROM_RELOAD(              0xd000, 0x1000 )
	ROM_RELOAD(              0xe000, 0x1000 )
	ROM_RELOAD(              0xf000, 0x1000 )	/* for reset/interrupt vectors */
ROM_END

struct GameDriver spacduel_driver =
{
	__FILE__,
	0,
	"spacduel",
	"Space Duel",
	"1980",
	"Atari",
	"Brad Oliver (MAME driver)\n"VECTOR_TEAM,
	0,
	&spacduel_machine_driver,
	0,

	spacduel_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	spacduel_input_ports,

	color_prom, 0, 0,
	ORIENTATION_DEFAULT,

	atari_vg_earom_load, atari_vg_earom_save
};

⌨️ 快捷键说明

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