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

📄 punchout.c

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 C
📖 第 1 页 / 共 3 页
字号:
	0,0,0,0,
	{
		{
			SOUND_NES,
			&nes_interface
		},
		{
			SOUND_DAC,
			&dac_interface
		},
		{
			SOUND_VLM5030,
			&vlm5030_interface
		}
	}
};



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

  Game driver(s)

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

ROM_START( punchout_rom )
	ROM_REGION(0x10000)	/* 64k for code */
	ROM_LOAD( "chp1-c.8l",    0x0000, 0x2000, 0xa4003adc )
	ROM_LOAD( "chp1-c.8k",    0x2000, 0x2000, 0x745ecf40 )
	ROM_LOAD( "chp1-c.8j",    0x4000, 0x2000, 0x7a7f870e )
	ROM_LOAD( "chp1-c.8h",    0x6000, 0x2000, 0x5d8123d7 )
	ROM_LOAD( "chp1-c.8f",    0x8000, 0x4000, 0xc8a55ddb )

	ROM_REGION_DISPOSE(0x48000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "chp1-b.4c",    0x00000, 0x2000, 0xe26dc8b3 )	/* chars #1 */
	ROM_LOAD( "chp1-b.4d",    0x02000, 0x2000, 0xdd1310ca )
	ROM_LOAD( "chp1-b.4a",    0x04000, 0x2000, 0x20fb4829 )	/* chars #2 */
	ROM_LOAD( "chp1-b.4b",    0x06000, 0x2000, 0xedc34594 )
	ROM_LOAD( "chp1-v.2r",    0x08000, 0x4000, 0xbd1d4b2e )	/* chars #3 */
	ROM_LOAD( "chp1-v.2t",    0x0c000, 0x4000, 0xdd9a688a )
	ROM_LOAD( "chp1-v.2u",    0x10000, 0x2000, 0xda6a3c4b )
	/* 12000-13fff empty (space for 16k ROM) */
	ROM_LOAD( "chp1-v.2v",    0x14000, 0x2000, 0x8c734a67 )
	/* 16000-17fff empty (space for 16k ROM) */
	ROM_LOAD( "chp1-v.3r",    0x18000, 0x4000, 0x2e74ad1d )
	ROM_LOAD( "chp1-v.3t",    0x1c000, 0x4000, 0x630ba9fb )
	ROM_LOAD( "chp1-v.3u",    0x20000, 0x2000, 0x6440321d )
	/* 22000-23fff empty (space for 16k ROM) */
	ROM_LOAD( "chp1-v.3v",    0x24000, 0x2000, 0xbb7b7198 )
	/* 26000-27fff empty (space for 16k ROM) */
	ROM_LOAD( "chp1-v.4r",    0x28000, 0x4000, 0x4e5b0fe9 )
	ROM_LOAD( "chp1-v.4t",    0x2c000, 0x4000, 0x37ffc940 )
	ROM_LOAD( "chp1-v.4u",    0x30000, 0x2000, 0x1a7521d4 )
	/* 32000-33fff empty (space for 16k ROM) */
	/* 34000-37fff empty (4v doesn't exist, it is seen as a 0xff fill) */
	ROM_LOAD( "chp1-v.6p",    0x38000, 0x2000, 0x16588f7a )	/* chars #4 */
	ROM_LOAD( "chp1-v.6n",    0x3a000, 0x2000, 0xdc743674 )
	/* 3c000-3ffff empty (space for 6l and 6k) */
	ROM_LOAD( "chp1-v.8p",    0x40000, 0x2000, 0xc2db5b4e )
	ROM_LOAD( "chp1-v.8n",    0x42000, 0x2000, 0xe6af390e )
	/* 44000-47fff empty (space for 8l and 8k) */

	ROM_REGION(0x0d00)	/* color PROMs */
	ROM_LOAD( "chp1-b.6e",    0x0000, 0x0200, 0xe9ca3ac6 )	/* red component */
	ROM_LOAD( "chp1-b.7e",    0x0200, 0x0200, 0x47adf7a2 )	/* red component */
	ROM_LOAD( "chp1-b.6f",    0x0400, 0x0200, 0x02be56ab )	/* green component */
	ROM_LOAD( "chp1-b.8e",    0x0600, 0x0200, 0xb0fc15a8 )	/* green component */
	ROM_LOAD( "chp1-b.7f",    0x0800, 0x0200, 0x11de55f1 )	/* blue component */
	ROM_LOAD( "chp1-b.8f",    0x0a00, 0x0200, 0x1ffd894a )	/* blue component */
	ROM_LOAD( "chp1-v.2d",    0x0c00, 0x0100, 0x71dc0d48 )	/* timing - not used */

	ROM_REGION(0x10000)	/* 64k for the sound CPU */
	ROM_LOAD( "chp1-c.4k",    0xe000, 0x2000, 0xcb6ef376 )

	ROM_REGION(0x4000)	/* 16k for the VLM5030 data */
	ROM_LOAD( "chp1-c.6p",    0x0000, 0x4000, 0xea0bbb31 )
ROM_END

ROM_START( spnchout_rom )
	ROM_REGION(0x10000)	/* 64k for code */
	ROM_LOAD( "chs1-v.8l",    0x0000, 0x2000, 0x703b9780 )
	ROM_LOAD( "chs1-v.8k",    0x2000, 0x2000, 0xe13719f6 )
	ROM_LOAD( "chs1-v.8j",    0x4000, 0x2000, 0x1fa629e8 )
	ROM_LOAD( "chs1-v.8h",    0x6000, 0x2000, 0x15a6c068 )
	ROM_LOAD( "chs1-v.8f",    0x8000, 0x4000, 0x4ff3cdd9 )

	ROM_REGION_DISPOSE(0x48000)	/* temporary space for graphics (disposed after conversion) */
	/* the following two ROMs are BAD! */
	ROM_LOAD( "chs1-b.4c",    0x00000, 0x2000, 0x00000000 )	/* chars #1 */
	ROM_LOAD( "chs1-b.4d",    0x02000, 0x2000, 0x00000000 )
	ROM_LOAD( "chs1-b.4a",    0x04000, 0x2000, 0x20fb4829 )	/* chars #2 */
	ROM_LOAD( "chs1-b.4b",    0x06000, 0x2000, 0xedc34594 )
	ROM_LOAD( "chs1-v.2r",    0x08000, 0x4000, 0xff33405d )	/* chars #3 */
	ROM_LOAD( "chs1-v.2t",    0x0c000, 0x4000, 0xf507818b )
	ROM_LOAD( "chs1-v.2u",    0x10000, 0x4000, 0x0995fc95 )
	ROM_LOAD( "chs1-v.2v",    0x14000, 0x2000, 0xf44d9878 )
	/* 16000-17fff empty (space for 16k ROM) */
	ROM_LOAD( "chs1-v.3r",    0x18000, 0x4000, 0x09570945 )
	ROM_LOAD( "chs1-v.3t",    0x1c000, 0x4000, 0x42c6861c )
	ROM_LOAD( "chs1-v.3u",    0x20000, 0x4000, 0xbf5d02dd )
	ROM_LOAD( "chs1-v.3v",    0x24000, 0x2000, 0x5673f4fc )
	/* 26000-27fff empty (space for 16k ROM) */
	ROM_LOAD( "chs1-v.4r",    0x28000, 0x4000, 0x8e155758 )
	ROM_LOAD( "chs1-v.4t",    0x2c000, 0x4000, 0xb4e43448 )
	ROM_LOAD( "chs1-v.4u",    0x30000, 0x4000, 0x74e0d956 )
	/* 34000-37fff empty (4v doesn't exist, it is seen as a 0xff fill) */
	ROM_LOAD( "chp1-v.6p",    0x38000, 0x2000, 0x16588f7a )	/* chars #4 */
	ROM_LOAD( "chp1-v.6n",    0x3a000, 0x2000, 0xdc743674 )
	/* 3c000-3ffff empty (space for 6l and 6k) */
	ROM_LOAD( "chp1-v.8p",    0x40000, 0x2000, 0xc2db5b4e )
	ROM_LOAD( "chp1-v.8n",    0x42000, 0x2000, 0xe6af390e )
	/* 44000-47fff empty (space for 8l and 8k) */

	ROM_REGION(0x1000)	/* color PROMs */
	ROM_LOAD( "chs1-b.6e",    0x0000, 0x0200, 0x0ad4d727 )	/* red component */
	ROM_LOAD( "chs1-b.7e",    0x0200, 0x0200, 0x4c7e3a67 )	/* red component */
	ROM_LOAD( "chs1-b.6f",    0x0400, 0x0200, 0x86f5cfdb )	/* green component */
	ROM_LOAD( "chs1-b.8e",    0x0600, 0x0200, 0xec659313 )	/* green component */
	ROM_LOAD( "chs1-b.7f",    0x0800, 0x0200, 0x8bd406f8 )	/* blue component */
	ROM_LOAD( "chs1-b.8f",    0x0a00, 0x0200, 0x8b493c09 )	/* blue component */
	ROM_LOAD( "chs1-v.2d",    0x0c00, 0x0100, 0x71dc0d48 )	/* timing - not used */

	ROM_REGION(0x10000)	/* 64k for the sound CPU */
	ROM_LOAD( "chs1-v.4k",    0xe000, 0x2000, 0xcb6ef376 )

	ROM_REGION(0x10000)	/* 64k for the VLM5030 data */
	ROM_LOAD( "chs1-v.6p",    0x0000, 0x4000, 0xad8b64b8 )
ROM_END

static void punchout_decode(void)
{
	unsigned char *RAM;


	/* there is no encryption in Punch Out, however one graphics ROM (4v) doesn't */
	/* exist but must be seen as a 0xff fill for colors to come out properly */
	RAM = Machine->memory_region[1];
	memset(&RAM[0x34000],0xff,0x4000);
}

ROM_START( armwrest_rom )
	ROM_REGION(0x10000)	/* 64k for code */
	ROM_LOAD( "chv1-c.8l",    0x0000, 0x2000, 0xb09764c1 )
	ROM_LOAD( "chv1-c.8k",    0x2000, 0x2000, 0x0e147ff7 )
	ROM_LOAD( "chv1-c.8j",    0x4000, 0x2000, 0xe7365289 )
	ROM_LOAD( "chv1-c.8h",    0x6000, 0x2000, 0xa2118eec )
	ROM_LOAD( "chpv-c.8f",    0x8000, 0x4000, 0x664a07c4 )

	ROM_REGION_DISPOSE(0x54000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "chpv-b.2e",    0x00000, 0x4000, 0x8b45f365 )	/* chars #1 */
	ROM_LOAD( "chpv-b.2d",    0x04000, 0x4000, 0xb1a2850c )
	ROM_LOAD( "chpv-b.2m",    0x08000, 0x4000, 0x19245b37 )	/* chars #2 */
	ROM_LOAD( "chpv-b.2l",    0x0c000, 0x4000, 0x46797941 )
	ROM_LOAD( "chpv-b.2k",    0x10000, 0x4000, 0x24c4c26d )
	ROM_LOAD( "chv1-v.2r",    0x14000, 0x4000, 0xd86056d9 )	/* chars #3 */
	ROM_LOAD( "chv1-v.2t",    0x18000, 0x4000, 0x5ad77059 )
	/* 1c000-1ffff empty */
	ROM_LOAD( "chv1-v.2v",    0x20000, 0x4000, 0xa0fd7338 )
	ROM_LOAD( "chv1-v.3r",    0x24000, 0x4000, 0x690e26fb )
	ROM_LOAD( "chv1-v.3t",    0x28000, 0x4000, 0xea5d7759 )
	/* 2c000-2ffff empty */
	ROM_LOAD( "chv1-v.3v",    0x30000, 0x4000, 0xceb37c05 )
	ROM_LOAD( "chv1-v.4r",    0x34000, 0x4000, 0xe291cba0 )
	ROM_LOAD( "chv1-v.4t",    0x38000, 0x4000, 0xe01f3b59 )
	/* 3c000-3ffff empty */
	/* 40000-43fff empty (4v doesn't exist, it is seen as a 0xff fill) */
	ROM_LOAD( "chv1-v.6p",    0x44000, 0x2000, 0xd834e142 )	/* chars #4 */
	/* 46000-47fff empty (space for 16k ROM) */
	/* 48000-4bfff empty (space for 6l and 6k) */
	ROM_LOAD( "chv1-v.8p",    0x4c000, 0x2000, 0xa2f531db )
	/* 4e000-4ffff empty (space for 8k ROM) */
	/* 50000-53fff empty (space for 8l and 8k) */

	ROM_REGION(0x0e00)	/* color PROMs */
	ROM_LOAD( "chpv-b.7b",    0x0000, 0x0200, 0xdf6fdeb3 )	/* red component */
	ROM_LOAD( "chpv-b.4b",    0x0200, 0x0200, 0x9d51416e )	/* red component */
	ROM_LOAD( "chpv-b.7c",    0x0400, 0x0200, 0xb1da5f42 )	/* green component */
	ROM_LOAD( "chpv-b.4c",    0x0600, 0x0200, 0xb8a25795 )	/* green component */
	ROM_LOAD( "chpv-b.7d",    0x0800, 0x0200, 0x4ede813e )	/* blue component */
	ROM_LOAD( "chpv-b.4d",    0x0a00, 0x0200, 0x474fc3b1 )	/* blue component */
	ROM_LOAD( "chv1-b.3c",    0x0c00, 0x0100, 0xc3f92ea2 )	/* priority encoder - not used */
	ROM_LOAD( "chpv-v.2d",    0x0d00, 0x0100, 0x71dc0d48 )	/* timing - not used */

	ROM_REGION(0x10000)	/* 64k for the sound CPU */
	ROM_LOAD( "chp1-c.4k",    0xe000, 0x2000, 0xcb6ef376 )	/* same as Punch Out */

	ROM_REGION(0x10000)	/* 64k for the VLM5030 data */
	ROM_LOAD( "chv1-c.6p",    0x0000, 0x4000, 0x31b52896 )
ROM_END

static void armwrest_decode(void)
{
	unsigned char *RAM;


	/* there is no encryption in Arm Wrestling, however one graphics ROM (4v) doesn't */
	/* exist but must be seen as a 0xff fill for colors to come out properly */
	RAM = Machine->memory_region[1];
	memset(&RAM[0x40000],0xff,0x4000);

	/* also, ROM 2k is enabled only when its top half is accessed. The other half must */
	/* be seen as a 0xff fill for colors to come out properly */
	memset(&RAM[0x10000],0xff,0x2000);
}



static int hiload(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)
	{
		osd_fread(f,&RAM[0xc000],0x400);
		osd_fclose(f);
	}

	return 1;
}

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[0xc000],0x400);
		osd_fclose(f);
	}
}



struct GameDriver punchout_driver =
{
	__FILE__,
	0,
	"punchout",
	"Punch Out",
	"1984",
	"Nintendo",
	"Nicola Salmoria (MAME driver)\nTim Lindquist (color info)\nBryan Smith (hardware info)\nTatsuyuki Satoh(speech sound)",
	0,
	&machine_driver,
	0,

	punchout_rom,
	punchout_decode, 0,
	punchout_sample_names,
	0,	/* sound_prom */

	punchout_input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

struct GameDriver spnchout_driver =
{
	__FILE__,
	0,
	"spnchout",
	"Super Punch Out",
	"1984",
	"Nintendo",
	"Nicola Salmoria (MAME driver)\nTim Lindquist (color info)\nBryan Smith (hardware info)",
	GAME_NOT_WORKING | GAME_WRONG_COLORS,
	&machine_driver,
	0,

	spnchout_rom,
	punchout_decode, 0,
	spunchout_sample_names,
	0,	/* sound_prom */

	punchout_input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

struct GameDriver armwrest_driver =
{
	__FILE__,
	0,
	"armwrest",
	"Arm Wrestling",
	"1985",
	"Nintendo",
	"Nicola Salmoria",
	0,
	&armwrest_machine_driver,
	0,

	armwrest_rom,
	armwrest_decode, 0,
	0,
	0,	/* sound_prom */

	armwrest_input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

⌨️ 快捷键说明

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