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

📄 blktiger.c

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 C
📖 第 1 页 / 共 2 页
字号:
	{ -1 } /* end of array */
};



/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler(void)
{
	cpu_cause_interrupt(1,0xff);
}

static struct YM2203interface ym2203_interface =
{
	2,			/* 2 chips */
	3500000,	/* 3.5 MHz ? (hand tuned) */
	{ YM2203_VOL(15,15), YM2203_VOL(15,15) },
	{ 0 },
	{ 0 },
	{ 0 },
	{ 0 },
	{ irqhandler }
};



static struct MachineDriver machine_driver =
{
	/* basic machine hardware */
	{
		{
			CPU_Z80,
			4000000,	/* 4 Mhz (?) */
			0,
			readmem,writemem,readport,writeport,
			interrupt,1
		},
		{
			CPU_Z80 | CPU_AUDIO_CPU,
			3000000,	/* 3 Mhz (?) */
			2,	/* memory region #2 */
			sound_readmem,sound_writemem,0,0,
			ignore_interrupt,0	/* IRQs are triggered by the YM2203 */
		}
	},
	60, 1500,	/* frames per second, vblank duration - hand tuned to get rid of sprite lag */
	1,	/* 1 CPU slice per frame - interleaving is forced when a sound command is written */
	0,

	/* video hardware */
	32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
	gfxdecodeinfo,
	1024, 1024,
	0,

	VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
	0,
	blktiger_vh_start,
	blktiger_vh_stop,
	blktiger_vh_screenrefresh,

	/* sound hardware */
	0,0,0,0,
	{
		{
			SOUND_YM2203,
			&ym2203_interface
		}
	}
};


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

  Game driver(s)

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

ROM_START( blktiger_rom )
	ROM_REGION(0x50000)	/* 64k for code + banked ROMs images */
	ROM_LOAD( "blktiger.5e",  0x00000, 0x08000, 0xa8f98f22 )	/* CODE */
	ROM_LOAD( "blktiger.6e",  0x10000, 0x10000, 0x7bef96e8 )	/* 0+1 */
	ROM_LOAD( "blktiger.8e",  0x20000, 0x10000, 0x4089e157 )	/* 2+3 */
	ROM_LOAD( "blktiger.9e",  0x30000, 0x10000, 0xed6af6ec )	/* 4+5 */
	ROM_LOAD( "blktiger.10e", 0x40000, 0x10000, 0xae59b72e )	/* 6+7 */

	ROM_REGION_DISPOSE(0x90000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "blktiger.2n",  0x00000, 0x08000, 0x70175d78 )	/* characters */
	ROM_LOAD( "blktiger.5b",  0x10000, 0x10000, 0xc4524993 )	/* tiles */
	ROM_LOAD( "blktiger.4b",  0x20000, 0x10000, 0x7932c86f )
	ROM_LOAD( "blktiger.9b",  0x30000, 0x10000, 0xdc49593a )
	ROM_LOAD( "blktiger.8b",  0x40000, 0x10000, 0x7ed7a122 )
	ROM_LOAD( "blktiger.5a",  0x50000, 0x10000, 0xe2f17438 )	/* sprites */
	ROM_LOAD( "blktiger.4a",  0x60000, 0x10000, 0x5fccbd27 )
	ROM_LOAD( "blktiger.9a",  0x70000, 0x10000, 0xfc33ccc6 )
	ROM_LOAD( "blktiger.8a",  0x80000, 0x10000, 0xf449de01 )

	ROM_REGION(0x10000)	/* 64k for the audio CPU */
	ROM_LOAD( "blktiger.1l",  0x0000, 0x8000, 0x2cf54274 )
ROM_END

ROM_START( bktigerb_rom )
	ROM_REGION(0x50000)	/* 64k for code + banked ROMs images */
	ROM_LOAD( "btiger1.f6",   0x00000, 0x08000, 0x9d8464e8 )	/* CODE */
	ROM_LOAD( "blktiger.6e",  0x10000, 0x10000, 0x7bef96e8 )	/* 0+1 */
	ROM_LOAD( "btiger3.j6",   0x20000, 0x10000, 0x52c56ed1 )	/* 2+3 */
	ROM_LOAD( "blktiger.9e",  0x30000, 0x10000, 0xed6af6ec )	/* 4+5 */
	ROM_LOAD( "blktiger.10e", 0x40000, 0x10000, 0xae59b72e )	/* 6+7 */

	ROM_REGION_DISPOSE(0x90000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "blktiger.2n",  0x00000, 0x08000, 0x70175d78 )	/* characters */
	ROM_LOAD( "blktiger.5b",  0x10000, 0x10000, 0xc4524993 )	/* tiles */
	ROM_LOAD( "blktiger.4b",  0x20000, 0x10000, 0x7932c86f )
	ROM_LOAD( "blktiger.9b",  0x30000, 0x10000, 0xdc49593a )
	ROM_LOAD( "blktiger.8b",  0x40000, 0x10000, 0x7ed7a122 )
	ROM_LOAD( "blktiger.5a",  0x50000, 0x10000, 0xe2f17438 )	/* sprites */
	ROM_LOAD( "blktiger.4a",  0x60000, 0x10000, 0x5fccbd27 )
	ROM_LOAD( "blktiger.9a",  0x70000, 0x10000, 0xfc33ccc6 )
	ROM_LOAD( "blktiger.8a",  0x80000, 0x10000, 0xf449de01 )

	ROM_REGION(0x10000)	/* 64k for the audio CPU */
	ROM_LOAD( "blktiger.1l",  0x0000, 0x8000, 0x2cf54274 )
ROM_END

ROM_START( blkdrgon_rom )
	ROM_REGION(0x50000)	/* 64k for code + banked ROMs images */
	ROM_LOAD( "blkdrgon.5e",  0x00000, 0x08000, 0x27ccdfbc )	/* CODE */
	ROM_LOAD( "blkdrgon.6e",  0x10000, 0x10000, 0x7d39c26f )	/* 0+1 */
	ROM_LOAD( "blkdrgon.8e",  0x20000, 0x10000, 0xd1bf3757 )	/* 2+3 */
	ROM_LOAD( "blkdrgon.9e",  0x30000, 0x10000, 0x4d1d6680 )	/* 4+5 */
	ROM_LOAD( "blkdrgon.10e", 0x40000, 0x10000, 0xc8d0c45e )	/* 6+7 */

	ROM_REGION_DISPOSE(0x90000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "blkdrgon.2n",  0x00000, 0x08000, 0x3821ab29 )	/* characters */
	ROM_LOAD( "blkdrgon.5b",  0x10000, 0x10000, 0x22d0a4b0 )	/* tiles */
	ROM_LOAD( "blkdrgon.4b",  0x20000, 0x10000, 0xc8b5fc52 )
	ROM_LOAD( "blkdrgon.9b",  0x30000, 0x10000, 0x9498c378 )
	ROM_LOAD( "blkdrgon.8b",  0x40000, 0x10000, 0x5b0df8ce )
	ROM_LOAD( "blktiger.5a",  0x50000, 0x10000, 0xe2f17438 )	/* sprites */
	ROM_LOAD( "blktiger.4a",  0x60000, 0x10000, 0x5fccbd27 )
	ROM_LOAD( "blktiger.9a",  0x70000, 0x10000, 0xfc33ccc6 )
	ROM_LOAD( "blktiger.8a",  0x80000, 0x10000, 0xf449de01 )

	ROM_REGION(0x10000)	/* 64k for the audio CPU */
	ROM_LOAD( "blktiger.1l",  0x0000, 0x8000, 0x2cf54274 )
ROM_END


static int 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[0xe204],"\x02\x00\x00",3) == 0 &&
			memcmp(&RAM[0xe244],"\x01\x02\x00",3) == 0 &&
			memcmp(&RAM[0xe012],"\x6a\x81\x00",3) == 0)

	{
		void *f;


		if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
		{
			osd_fread(f,&RAM[0xe200],16*5);
			memcpy(&RAM[0xe1e0],&RAM[0xe200],8);
			osd_fclose(f);
		}

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

static void 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[0xe200],16*5);
		osd_fclose(f);
	}
}



struct GameDriver blktiger_driver =
{
	__FILE__,
	0,
	"blktiger",
	"Black Tiger",
	"1987",
	"Capcom",
	"Paul Leaman (MAME driver)\nIshmair\nDani Portillo (protection)",
	0,
	&machine_driver,
	0,

	blktiger_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	input_ports,

	NULL, 0, 0,

	ORIENTATION_DEFAULT,
	hiload, hisave
};

struct GameDriver bktigerb_driver =
{
	__FILE__,
	&blktiger_driver,
	"bktigerb",
	"Black Tiger (bootleg)",
	"1987",
	"bootleg",
	"Paul Leaman (MAME driver)\nIshmair\nDani Portillo (protection)",
	0,
	&machine_driver,
	0,

	bktigerb_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	input_ports,

	NULL, 0, 0,

	ORIENTATION_DEFAULT,
	hiload, hisave
};

struct GameDriver blkdrgon_driver =
{
	__FILE__,
	&blktiger_driver,
	"blkdrgon",
	"Black Dragon",
	"1987",
	"Capcom",
	"Paul Leaman (MAME driver)\nIshmair\nDani Portillo (protection)",
	0,
	&machine_driver,
	0,

	blkdrgon_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	input_ports,

	NULL, 0, 0,

	ORIENTATION_DEFAULT,
	hiload, hisave
};

⌨️ 快捷键说明

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