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

📄 xevious.c

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 C
📖 第 1 页 / 共 3 页
字号:
	ROM_LOAD( "xe-1m-a.bin",  0x0000, 0x2000, 0x92fa6cae )
	ROM_LOAD( "xe-1l-a.bin",  0x2000, 0x2000, 0xbd74609a )

	ROM_REGION_DISPOSE(0xb000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "xe-3b.bin",    0x0000, 0x1000, 0x088c8b26 )	/* foreground characters */
	ROM_LOAD( "xe-3c.bin",    0x1000, 0x1000, 0xde60ba25 )	/* bg pattern B0 */
	ROM_LOAD( "xe-3d.bin",    0x2000, 0x1000, 0x535cdbbc )	/* bg pattern B1 */
	ROM_LOAD( "xe-4m.bin",    0x3000, 0x2000, 0xdc2c0ecb )	/* sprite set #1, planes 0/1 */
	ROM_LOAD( "xe-4r.bin",    0x5000, 0x2000, 0x02417d19 )	/* sprite set #1, plane 2, set #2, plane 0 */
	ROM_LOAD( "xe-4p.bin",    0x7000, 0x2000, 0xdfb587ce )	/* sprite set #2, planes 1/2 */
	ROM_LOAD( "xe-4n.bin",    0x9000, 0x1000, 0x605ca889 )	/* sprite set #3, planes 0/1 */
	/* 0xa000-0xafff empty space to decode sprite set #3 as 3 bits per pixel */

	ROM_REGION(0x0700)	/* color proms */
	ROM_LOAD( "xevious.6a",   0x0000, 0x0100, 0xa0334cef ) /* palette red component */
	ROM_LOAD( "xevious.6d",   0x0100, 0x0100, 0xa076a85c ) /* palette green component */
	ROM_LOAD( "xevious.6e",   0x0200, 0x0100, 0xc04737e5 ) /* palette blue component */
	ROM_LOAD( "4h-4f",        0x0300, 0x0200, 0xc21a65ff ) /* background tiles lookup table */
	/* These are probably not the original PROMs. The transparency information */
	/* (bit 7) is missing. The 0x80 bytes are mine, needed to fix the targeting cursor */
	ROM_LOAD( "3l-3m",        0x0500, 0x0200, 0x48d96000 ) /* sprite lookup table */

	ROM_REGION(0x10000)	/* 64k for the second CPU */
	ROM_LOAD( "xe-4c-a.bin",  0x0000, 0x2000, 0x0ede5706 )

	ROM_REGION(0x10000)	/* 64k for the audio CPU */
	ROM_LOAD( "xe-2c-a.bin",  0x0000, 0x1000, 0xdd35cf1c )

	ROM_REGION(0x4000)	/* gfx map */
	ROM_LOAD( "xe-2a.bin",    0x0000, 0x1000, 0x57ed9879 )
	ROM_LOAD( "xe-2b.bin",    0x1000, 0x2000, 0xae3ba9e5 )
	ROM_LOAD( "xe-2c.bin",    0x3000, 0x1000, 0x31e244dd )

	ROM_REGION(0x0100)	/* sound prom */
	ROM_LOAD( "xevious.spr",  0x0000, 0x0100, 0xa9fe382c )
ROM_END

ROM_START( xeviousa_rom )
	ROM_REGION(0x10000)	/* 64k for the first CPU */
	ROM_LOAD( "xea-1m-a.bin", 0x0000, 0x2000, 0x8c2b50ec )
	ROM_LOAD( "xea-1l-a.bin", 0x2000, 0x2000, 0x0821642b )

	ROM_REGION_DISPOSE(0xb000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "xe-3b.bin",    0x0000, 0x1000, 0x088c8b26 )	/* foreground characters */
	ROM_LOAD( "xe-3c.bin",    0x1000, 0x1000, 0xde60ba25 )	/* bg pattern B0 */
	ROM_LOAD( "xe-3d.bin",    0x2000, 0x1000, 0x535cdbbc )	/* bg pattern B1 */
	ROM_LOAD( "xe-4m.bin",    0x3000, 0x2000, 0xdc2c0ecb )	/* sprite set #1, planes 0/1 */
	ROM_LOAD( "xe-4r.bin",    0x5000, 0x2000, 0x02417d19 )	/* sprite set #1, plane 2, set #2, plane 0 */
	ROM_LOAD( "xe-4p.bin",    0x7000, 0x2000, 0xdfb587ce )	/* sprite set #2, planes 1/2 */
	ROM_LOAD( "xe-4n.bin",    0x9000, 0x1000, 0x605ca889 )	/* sprite set #3, planes 0/1 */
	/* 0xa000-0xafff empty space to decode sprite set #3 as 3 bits per pixel */

	ROM_REGION(0x0700)	/* color proms */
	ROM_LOAD( "xevious.6a",   0x0000, 0x0100, 0xa0334cef ) /* palette red component */
	ROM_LOAD( "xevious.6d",   0x0100, 0x0100, 0xa076a85c ) /* palette green component */
	ROM_LOAD( "xevious.6e",   0x0200, 0x0100, 0xc04737e5 ) /* palette blue component */
	ROM_LOAD( "4h-4f",        0x0300, 0x0200, 0xc21a65ff ) /* background tiles lookup table */
	/* These are probably not the original PROMs. The transparency information */
	/* (bit 7) is missing. The 0x80 bytes are mine, needed to fix the targeting cursor */
	ROM_LOAD( "3l-3m",        0x0500, 0x0200, 0x48d96000 ) /* sprite lookup table */

	ROM_REGION(0x10000)	/* 64k for the second CPU */
	ROM_LOAD( "xea-4c-a.bin", 0x0000, 0x2000, 0x14d8fa03 )

	ROM_REGION(0x10000)	/* 64k for the audio CPU */
	ROM_LOAD( "xe-2c-a.bin",  0x0000, 0x1000, 0xdd35cf1c )

	ROM_REGION(0x4000)	/* gfx map */
	ROM_LOAD( "xe-2a.bin",    0x0000, 0x1000, 0x57ed9879 )
	ROM_LOAD( "xe-2b.bin",    0x1000, 0x2000, 0xae3ba9e5 )
	ROM_LOAD( "xe-2c.bin",    0x3000, 0x1000, 0x31e244dd )

	ROM_REGION(0x0100)	/* sound prom */
	ROM_LOAD( "xevious.spr",  0x0000, 0x0100, 0xa9fe382c )
ROM_END

ROM_START( xevios_rom )
	ROM_REGION(0x10000)	/* 64k for the first CPU */
	ROM_LOAD( "4.7h",         0x0000, 0x1000, 0x1f8ca4c0 )
	ROM_LOAD( "5.6h",         0x1000, 0x1000, 0x2e47ce8f )
	ROM_LOAD( "6.5h",         0x2000, 0x1000, 0x79754b7d )
	ROM_LOAD( "7.4h",         0x3000, 0x1000, 0x7033f2e3 )

	ROM_REGION_DISPOSE(0xb000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "xe-3b.bin",    0x0000, 0x1000, 0x088c8b26 )	/* foreground characters */
	ROM_LOAD( "xe-3c.bin",    0x1000, 0x1000, 0xde60ba25 )	/* bg pattern B0 */
	ROM_LOAD( "xe-3d.bin",    0x2000, 0x1000, 0x535cdbbc )	/* bg pattern B1 */
	ROM_LOAD( "xe-4m.bin",    0x3000, 0x2000, 0xdc2c0ecb )	/* sprite set #1, planes 0/1 */
	ROM_LOAD( "16.8d",        0x5000, 0x2000, 0x44262c04 )	/* sprite set #1, plane 2, set #2, plane 0 */
	ROM_LOAD( "xe-4p.bin",    0x7000, 0x2000, 0xdfb587ce )	/* sprite set #2, planes 1/2 */
	ROM_LOAD( "xe-4n.bin",    0x9000, 0x1000, 0x605ca889 )	/* sprite set #3, planes 0/1 */
	/* 0xa000-0xafff empty space to decode sprite set #3 as 3 bits per pixel */

	ROM_REGION(0x0700)	/* color proms */
	ROM_LOAD( "xevious.6a",   0x0000, 0x0100, 0xa0334cef ) /* palette red component */
	ROM_LOAD( "xevious.6d",   0x0100, 0x0100, 0xa076a85c ) /* palette green component */
	ROM_LOAD( "xevious.6e",   0x0200, 0x0100, 0xc04737e5 ) /* palette blue component */
	ROM_LOAD( "4h-4f",        0x0300, 0x0200, 0xc21a65ff ) /* background tiles lookup table */
	/* These are probably not the original PROMs. The transparency information */
	/* (bit 7) is missing. The 0x80 bytes are mine, needed to fix the targeting cursor */
	ROM_LOAD( "3l-3m",        0x0500, 0x0200, 0x48d96000 ) /* sprite lookup table */

	ROM_REGION(0x10000)	/* 64k for the second CPU */
	ROM_LOAD( "xe-4c-a.bin",  0x0000, 0x2000, 0x0ede5706 )

	ROM_REGION(0x10000)	/* 64k for the audio CPU */
	ROM_LOAD( "xe-2c-a.bin",  0x0000, 0x1000, 0xdd35cf1c )

	ROM_REGION(0x4000)	/* gfx map */
	ROM_LOAD( "10.1d",        0x0000, 0x1000, 0x10baeebb )
	ROM_LOAD( "xe-2b.bin",    0x1000, 0x2000, 0xae3ba9e5 )
	ROM_LOAD( "12.3d",        0x3000, 0x1000, 0x51a4e83b )

	ROM_REGION(0x0100)	/* sound prom */
	ROM_LOAD( "xevious.spr",  0x0000, 0x0100, 0xa9fe382c )

	/* extra ROMs (function unknown, could be emulation of the custom I/O */
	/* chip with a Z80): */
	/* 1.16J */
	/* 2.17B */
ROM_END

ROM_START( sxevious_rom )
	ROM_REGION(0x10000)	/* 64k for the first CPU */
	ROM_LOAD( "cpu_3p.rom",   0x0000, 0x1000, 0x1c8d27d5 )
	ROM_LOAD( "cpu_3m.rom",   0x1000, 0x1000, 0xfd04e615 )
	ROM_LOAD( "cpu_2m.rom",   0x2000, 0x1000, 0x294d5404 )
	ROM_LOAD( "cpu_2l.rom",   0x3000, 0x1000, 0x6a44bf92 )

	ROM_REGION_DISPOSE(0xb000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "xe-3b.bin",    0x0000, 0x1000, 0x088c8b26 )	/* foreground characters */
	ROM_LOAD( "xe-3c.bin",    0x1000, 0x1000, 0xde60ba25 )	/* bg pattern B0 */
	ROM_LOAD( "xe-3d.bin",    0x2000, 0x1000, 0x535cdbbc )	/* bg pattern B1 */
	ROM_LOAD( "xe-4m.bin",    0x3000, 0x2000, 0xdc2c0ecb )	/* sprite set #1, planes 0/1 */
	ROM_LOAD( "xe-4r.bin",    0x5000, 0x2000, 0x02417d19 )	/* sprite set #1, plane 2, set #2, plane 0 */
	ROM_LOAD( "xe-4p.bin",    0x7000, 0x2000, 0xdfb587ce )	/* sprite set #2, planes 1/2 */
	ROM_LOAD( "xe-4n.bin",    0x9000, 0x1000, 0x605ca889 )	/* sprite set #3, planes 0/1 */
	/* 0xa000-0xafff empty space to decode sprite set #3 as 3 bits per pixel */

	ROM_REGION(0x0700)	/* color proms */
	ROM_LOAD( "xevious.6a",   0x0000, 0x0100, 0xa0334cef ) /* palette red component */
	ROM_LOAD( "xevious.6d",   0x0100, 0x0100, 0xa076a85c ) /* palette green component */
	ROM_LOAD( "xevious.6e",   0x0200, 0x0100, 0xc04737e5 ) /* palette blue component */
	ROM_LOAD( "4h-4f",        0x0300, 0x0200, 0xc21a65ff ) /* background tiles lookup table */
	/* These are probably not the original PROMs. The transparency information */
	/* (bit 7) is missing. The 0x80 bytes are mine, needed to fix the targeting cursor */
	ROM_LOAD( "3l-3m",        0x0500, 0x0200, 0x48d96000 ) /* sprite lookup table */

	ROM_REGION(0x10000)	/* 64k for the second CPU */
	ROM_LOAD( "cpu_3f.rom",   0x0000, 0x1000, 0xd4bd3d81 )
	ROM_LOAD( "cpu_3j.rom",   0x1000, 0x1000, 0xaf06be5f )

	ROM_REGION(0x10000)	/* 64k for the audio CPU */
	ROM_LOAD( "xe-2c-a.bin",  0x0000, 0x1000, 0xdd35cf1c )

	ROM_REGION(0x4000)	/* gfx map */
	ROM_LOAD( "xe-2a.bin",    0x0000, 0x1000, 0x57ed9879 )
	ROM_LOAD( "xe-2b.bin",    0x1000, 0x2000, 0xae3ba9e5 )
	ROM_LOAD( "xe-2c.bin",    0x3000, 0x1000, 0x31e244dd )

	ROM_REGION(0x0100)	/* sound prom */
	ROM_LOAD( "xevious.spr",  0x0000, 0x0100, 0xa9fe382c )
ROM_END



static void xevios_decode(void)
{
	int A,i;


	/* convert one of the sprite ROMs to the format used by Xevious */
	for (A = 0x5000;A < 0x7000;A++)
	{
		int bit[8];
		unsigned char *RAM = Machine->memory_region[1];

		/* 76543210 -> 13570246 bit rotation */
		for (i = 0;i < 8;i++)
			bit[i] = (RAM[A] >> i) & 1;

		RAM[A] =
			(bit[6] << 0) +
			(bit[4] << 1) +
			(bit[2] << 2) +
			(bit[0] << 3) +
			(bit[7] << 4) +
			(bit[5] << 5) +
			(bit[3] << 6) +
			(bit[1] << 7);
	}

	/* convert one of tile map ROMs to the format used by Xevious */
	for (A = 0x0000;A < 0x1000;A++)
	{
		int bit[8];
		unsigned char *RAM = Machine->memory_region[5];

		/* 76543210 -> 37512640 bit rotation */
		for (i = 0;i < 8;i++)
			bit[i] = (RAM[A] >> i) & 1;

		RAM[A] =
			(bit[0] << 0) +
			(bit[4] << 1) +
			(bit[6] << 2) +
			(bit[2] << 3) +
			(bit[1] << 4) +
			(bit[5] << 5) +
			(bit[7] << 6) +
			(bit[3] << 7);
	}
}



static const char *xevious_sample_names[] =
{
	"*xevious",
	"explo1.sam",	/* ground target explosion */
	"explo2.sam",	/* Solvalou explosion */
	0	/* end of array */
};



static int hiload(void) /* V.V */
{
	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[0x8024],"\x00\x40\x00",3) == 0 &&
	    memcmp(&RAM[0x8510],"\x00\x40\x00",3) == 0)
	{
		void *f;


		if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
		{
			osd_fread(f,&RAM[0x8024],3);
			osd_fread(f,&RAM[0x8510],16*5);
			osd_fclose(f);
		}

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



static void hisave(void) /* V.V */
{
	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[0x8024],3);
		osd_fwrite(f,&RAM[0x8510],16*5);
		osd_fclose(f);
	}
}



struct GameDriver xevious_driver =
{
	__FILE__,
	0,
	"xevious",
	"Xevious (Namco)",
	"1982",
	"Namco",
	"Mirko Buffoni\nTatsuyuki Satoh\nNicola Salmoria",
	0,
	&machine_driver,
	0,

	xevious_rom,
	0, 0,
	xevious_sample_names,
	0,	/* sound_prom */

	xevious_input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

struct GameDriver xeviousa_driver =
{
	__FILE__,
	&xevious_driver,
	"xeviousa",
	"Xevious (Atari)",
	"1982",
	"Namco (Atari license)",
	"Mirko Buffoni\nTatsuyuki Satoh\nNicola Salmoria",
	0,
	&machine_driver,
	0,

	xeviousa_rom,
	0, 0,
	xevious_sample_names,
	0,	/* sound_prom */

	xeviousa_input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

struct GameDriver xevios_driver =
{
	__FILE__,
	&xevious_driver,
	"xevios",
	"Xevios",
	"1983",
	"bootleg",
	"Mirko Buffoni\nTatsuyuki Satoh\nNicola Salmoria",
	0,
	&machine_driver,
	0,

	xevios_rom,
	xevios_decode, 0,
	xevious_sample_names,
	0,	/* sound_prom */

	xevious_input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

struct GameDriver sxevious_driver =
{
	__FILE__,
	&xevious_driver,
	"sxevious",
	"Super Xevious",
	"1984",
	"Namco",
	"Mirko Buffoni\nTatsuyuki Satoh\nNicola Salmoria",
	0,
	&machine_driver,
	0,

	sxevious_rom,
	0, 0,
	xevious_sample_names,
	0,	/* sound_prom */

	sxevious_input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

⌨️ 快捷键说明

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