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

📄 gauntlet.c

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 C
📖 第 1 页 / 共 2 页
字号:
			&ym2151_interface
		},
		{
			SOUND_TMS5220,
			&tms5220_interface
		},
		{
			SOUND_POKEY,
			&pokey_interface
		}
	}
};


static struct MachineDriver gaunt2p_machine_driver =
{
	/* basic machine hardware */
	{
		{
			CPU_M68000,
			7159160,
			0,
			gauntlet_readmem,gauntlet_writemem,0,0,
			gauntlet_interrupt,1
		},
		{
			CPU_M6502,
			1789790,		/* Clocked by the 2H signal; best guess = (64*8)*(32*8)*60fps/4 = 1.966MHz */
			2,
			gauntlet_sound_readmem,gauntlet_sound_writemem,0,0,
			0,0,
			gauntlet_sound_interrupt,250
		},
	},
	60, DEFAULT_REAL_60HZ_VBLANK_DURATION,	/* frames per second, vblank duration */
	10,
	gaunt2p_init_machine,

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

	VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK,
	0,
	gauntlet_vh_start,
	gauntlet_vh_stop,
	gauntlet_vh_screenrefresh,

	/* sound hardware */
	SOUND_SUPPORTS_STEREO,0,0,0,
	{
		{
			SOUND_YM2151,
			&ym2151_interface
		},
		{
			SOUND_TMS5220,
			&tms5220_interface
		},
		{
			SOUND_POKEY,
			&pokey_interface
		}
	}
};


static struct MachineDriver gauntlet2_machine_driver =
{
	/* basic machine hardware */
	{
		{
			CPU_M68000,
			7159160,
			0,
			gauntlet_readmem,gauntlet_writemem,0,0,
			gauntlet_interrupt,1
		},
		{
			CPU_M6502,
			1789790,		/* Clocked by the 2H signal; best guess = (64*8)*(32*8)*60fps/4 = 1.966MHz */
			2,
			gauntlet_sound_readmem,gauntlet_sound_writemem,0,0,
			0,0,
			gauntlet_sound_interrupt,250
		},
	},
	60, DEFAULT_REAL_60HZ_VBLANK_DURATION,	/* frames per second, vblank duration */
	10,
	gauntlet2_init_machine,

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

	VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK,
	0,
	gauntlet_vh_start,
	gauntlet_vh_stop,
	gauntlet_vh_screenrefresh,

	/* sound hardware */
	SOUND_SUPPORTS_STEREO,0,0,0,
	{
		{
			SOUND_YM2151,
			&ym2151_interface
		},
		{
			SOUND_TMS5220,
			&tms5220_interface
		},
		{
			SOUND_POKEY,
			&pokey_interface
		}
	}
};



/*************************************
 *
 *		ROM definition(s)
 *
 *************************************/

ROM_START( gauntlet_rom )
	ROM_REGION(0x80000)	/* 8*64k for 68000 code */
	ROM_LOAD_EVEN( "gauntlt1.9a",  0x00000, 0x08000, 0x46fe8743 )
	ROM_LOAD_ODD ( "gauntlt1.9b",  0x00000, 0x08000, 0x276e15c4 )
	ROM_LOAD_EVEN( "gauntlt1.10a", 0x38000, 0x04000, 0x6d99ed51 )
	ROM_LOAD_ODD ( "gauntlt1.10b", 0x38000, 0x04000, 0x545ead91 )
	ROM_LOAD_EVEN( "gauntlt1.7a",  0x40000, 0x08000, 0x6fb8419c )
	ROM_LOAD_ODD ( "gauntlt1.7b",  0x40000, 0x08000, 0x931bd2a0 )

	ROM_REGION_DISPOSE(0x64000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "gauntlt1.1a",  0x00000, 0x08000, 0x91700f33 )
	ROM_LOAD( "gauntlt1.1b",  0x08000, 0x08000, 0x869330be )
	ROM_LOAD( "gauntlt1.1l",  0x18000, 0x08000, 0xd497d0a8 )
	ROM_LOAD( "gauntlt1.1mn", 0x20000, 0x08000, 0x29ef9882 )
	ROM_LOAD( "gauntlt1.2a",  0x30000, 0x08000, 0x9510b898 )
	ROM_LOAD( "gauntlt1.2b",  0x38000, 0x08000, 0x11e0ac5b )
	ROM_LOAD( "gauntlt1.2l",  0x48000, 0x08000, 0x29a5db41 )
	ROM_LOAD( "gauntlt1.2mn", 0x50000, 0x08000, 0x8bf3b263 )
	ROM_LOAD( "gauntlt1.6p",  0x60000, 0x04000, 0x6c276a1d )        /* alpha font */

	ROM_REGION(0x10000)	/* 64k for 6502 code */
	ROM_LOAD( "gauntlt1.16r", 0x4000, 0x4000, 0x6ee7f3cc )
	ROM_LOAD( "gauntlt1.16s", 0x8000, 0x8000, 0xfa19861f )
ROM_END


ROM_START( gauntir1_rom )
	ROM_REGION(0x80000)	/* 8*64k for 68000 code */
	ROM_LOAD_EVEN( "gaun1ir1.9a",  0x00000, 0x08000, 0xfd871f81 )
	ROM_LOAD_ODD ( "gaun1ir1.9b",  0x00000, 0x08000, 0xbcb2fb1d )
	ROM_LOAD_EVEN( "gaun1ir1.10a", 0x38000, 0x04000, 0x4642cd95 )
	ROM_LOAD_ODD ( "gaun1ir1.10b", 0x38000, 0x04000, 0xc8df945e )
	ROM_LOAD_EVEN( "gaun1ir1.7a",  0x40000, 0x08000, 0xc57377b3 )
	ROM_LOAD_ODD ( "gaun1ir1.7b",  0x40000, 0x08000, 0x1cac2071 )

	ROM_REGION_DISPOSE(0x64000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "gauntlt1.1a",  0x00000, 0x08000, 0x91700f33 )
	ROM_LOAD( "gauntlt1.1b",  0x08000, 0x08000, 0x869330be )
	ROM_LOAD( "gauntlt1.1l",  0x18000, 0x08000, 0xd497d0a8 )
	ROM_LOAD( "gauntlt1.1mn", 0x20000, 0x08000, 0x29ef9882 )
	ROM_LOAD( "gauntlt1.2a",  0x30000, 0x08000, 0x9510b898 )
	ROM_LOAD( "gauntlt1.2b",  0x38000, 0x08000, 0x11e0ac5b )
	ROM_LOAD( "gauntlt1.2l",  0x48000, 0x08000, 0x29a5db41 )
	ROM_LOAD( "gauntlt1.2mn", 0x50000, 0x08000, 0x8bf3b263 )
	ROM_LOAD( "gauntlt1.6p",  0x60000, 0x04000, 0x6c276a1d )        /* alpha font */

	ROM_REGION(0x10000)	/* 64k for 6502 code */
	ROM_LOAD( "gauntlt1.16r", 0x4000, 0x4000, 0x6ee7f3cc )
	ROM_LOAD( "gauntlt1.16s", 0x8000, 0x8000, 0xfa19861f )
ROM_END


ROM_START( gauntir2_rom )
	ROM_REGION(0x80000)	/* 8*64k for 68000 code */
	ROM_LOAD_EVEN( "gaun1ir2.9a",  0x00000, 0x08000, 0xfd871f81 )
	ROM_LOAD_ODD ( "gaun1ir2.9b",  0x00000, 0x08000, 0xbcb2fb1d )
	ROM_LOAD_EVEN( "gaun1ir2.10a", 0x38000, 0x04000, 0x4642cd95 )
	ROM_LOAD_ODD ( "gaun1ir2.10b", 0x38000, 0x04000, 0xc8df945e )
	ROM_LOAD_EVEN( "gaun1ir2.7a",  0x40000, 0x08000, 0x73e1ad79 )
	ROM_LOAD_ODD ( "gaun1ir2.7b",  0x40000, 0x08000, 0xfd248cea )

	ROM_REGION_DISPOSE(0x64000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "gauntlt1.1a",  0x00000, 0x08000, 0x91700f33 )
	ROM_LOAD( "gauntlt1.1b",  0x08000, 0x08000, 0x869330be )
	ROM_LOAD( "gauntlt1.1l",  0x18000, 0x08000, 0xd497d0a8 )
	ROM_LOAD( "gauntlt1.1mn", 0x20000, 0x08000, 0x29ef9882 )
	ROM_LOAD( "gauntlt1.2a",  0x30000, 0x08000, 0x9510b898 )
	ROM_LOAD( "gauntlt1.2b",  0x38000, 0x08000, 0x11e0ac5b )
	ROM_LOAD( "gauntlt1.2l",  0x48000, 0x08000, 0x29a5db41 )
	ROM_LOAD( "gauntlt1.2mn", 0x50000, 0x08000, 0x8bf3b263 )
	ROM_LOAD( "gauntlt1.6p",  0x60000, 0x04000, 0x6c276a1d )        /* alpha font */

	ROM_REGION(0x10000)	/* 64k for 6502 code */
	ROM_LOAD( "gauntlt1.16r", 0x4000, 0x4000, 0x6ee7f3cc )
	ROM_LOAD( "gauntlt1.16s", 0x8000, 0x8000, 0xfa19861f )
ROM_END


ROM_START( gaunt2p_rom )
	ROM_REGION(0x80000)	/* 8*64k for 68000 code */
	ROM_LOAD_EVEN( "gaunt2p.9a",   0x00000, 0x08000, 0x8784133f )
	ROM_LOAD_ODD ( "gaunt2p.9b",   0x00000, 0x08000, 0x2843bde3 )
	ROM_LOAD_EVEN( "gauntlt1.10a", 0x38000, 0x04000, 0x6d99ed51 )
	ROM_LOAD_ODD ( "gauntlt1.10b", 0x38000, 0x04000, 0x545ead91 )
	ROM_LOAD_EVEN( "gaunt2p.7a",   0x40000, 0x08000, 0x5b4ee415 )
	ROM_LOAD_ODD ( "gaunt2p.7b",   0x40000, 0x08000, 0x41f5c9e2 )

	ROM_REGION_DISPOSE(0x64000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "gauntlt1.1a",  0x00000, 0x08000, 0x91700f33 )
	ROM_LOAD( "gauntlt1.1b",  0x08000, 0x08000, 0x869330be )
	ROM_LOAD( "gauntlt1.1l",  0x18000, 0x08000, 0xd497d0a8 )
	ROM_LOAD( "gauntlt1.1mn", 0x20000, 0x08000, 0x29ef9882 )
	ROM_LOAD( "gauntlt1.2a",  0x30000, 0x08000, 0x9510b898 )
	ROM_LOAD( "gauntlt1.2b",  0x38000, 0x08000, 0x11e0ac5b )
	ROM_LOAD( "gauntlt1.2l",  0x48000, 0x08000, 0x29a5db41 )
	ROM_LOAD( "gauntlt1.2mn", 0x50000, 0x08000, 0x8bf3b263 )
	ROM_LOAD( "gauntlt1.6p",  0x60000, 0x04000, 0x6c276a1d )        /* alpha font */

	ROM_REGION(0x10000)	/* 64k for 6502 code */
	ROM_LOAD( "gauntlt1.16r", 0x4000, 0x4000, 0x6ee7f3cc )
	ROM_LOAD( "gauntlt1.16s", 0x8000, 0x8000, 0xfa19861f )
ROM_END


ROM_START( gaunt2_rom )
	ROM_REGION(0x80000)	/* 8*64k for 68000 code */
	ROM_LOAD_EVEN( "gauntlt2.9a",  0x00000, 0x08000, 0x46fe8743 )
	ROM_LOAD_ODD ( "gauntlt2.9b",  0x00000, 0x08000, 0x276e15c4 )
	ROM_LOAD_EVEN( "gauntlt2.10a", 0x38000, 0x04000, 0x45dfda47 )
	ROM_LOAD_ODD ( "gauntlt2.10b", 0x38000, 0x04000, 0x343c029c )
	ROM_LOAD_EVEN( "gauntlt2.7a",  0x40000, 0x08000, 0x58a0a9a3 )
	ROM_LOAD_ODD ( "gauntlt2.7b",  0x40000, 0x08000, 0x658f0da8 )
	ROM_LOAD_EVEN( "gauntlt2.6a",  0x50000, 0x08000, 0xae301bba )
	ROM_LOAD_ODD ( "gauntlt2.6b",  0x50000, 0x08000, 0xe94aaa8a )

	ROM_REGION_DISPOSE(0x64000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "gauntlt2.1a",  0x00000, 0x08000, 0x09df6e23 )
	ROM_LOAD( "gauntlt2.1b",  0x08000, 0x08000, 0x869330be )
	ROM_LOAD( "gauntlt2.1c",  0x10000, 0x04000, 0xe4c98f01 )
	ROM_RELOAD(               0x14000, 0x04000 )
	ROM_LOAD( "gauntlt2.1l",  0x18000, 0x08000, 0x33cb476e )
	ROM_LOAD( "gauntlt2.1mn", 0x20000, 0x08000, 0x29ef9882 )
	ROM_LOAD( "gauntlt2.1p",  0x28000, 0x04000, 0xc4857879 )
	ROM_RELOAD(               0x2c000, 0x04000 )
	ROM_LOAD( "gauntlt2.2a",  0x30000, 0x08000, 0xf71e2503 )
	ROM_LOAD( "gauntlt2.2b",  0x38000, 0x08000, 0x11e0ac5b )
	ROM_LOAD( "gauntlt2.2c",  0x40000, 0x04000, 0xd9c2c2d1 )
	ROM_RELOAD(               0x44000, 0x04000 )
	ROM_LOAD( "gauntlt2.2l",  0x48000, 0x08000, 0x9e30b2e9 )
	ROM_LOAD( "gauntlt2.2mn", 0x50000, 0x08000, 0x8bf3b263 )
	ROM_LOAD( "gauntlt2.2p",  0x58000, 0x04000, 0xa32c732a )
	ROM_RELOAD(               0x5c000, 0x04000 )
	ROM_LOAD( "gauntlt2.6p",  0x60000, 0x04000, 0xd101905d )        /* alpha font */

	ROM_REGION(0x10000)	/* 64k for 6502 code */
	ROM_LOAD( "gauntlt2.16r", 0x4000, 0x4000, 0x5c731006 )
	ROM_LOAD( "gauntlt2.16s", 0x8000, 0x8000, 0xdc3591e7 )
ROM_END



/*************************************
 *
 *		ROM decoding
 *
 *************************************/

static void gauntlet_rom_decode (void)
{
	unsigned long *p1, *p2, temp;
	int i;

	/* swap the top and bottom halves of the main CPU ROM images */
	p1 = (unsigned long *)&Machine->memory_region[0][0x000000];
	p2 = (unsigned long *)&Machine->memory_region[0][0x008000];
	for (i = 0; i < 0x8000 / 4; i++)
		temp = *p1, *p1++ = *p2, *p2++ = temp;
	p1 = (unsigned long *)&Machine->memory_region[0][0x040000];
	p2 = (unsigned long *)&Machine->memory_region[0][0x048000];
	for (i = 0; i < 0x8000 / 4; i++)
		temp = *p1, *p1++ = *p2, *p2++ = temp;
	p1 = (unsigned long *)&Machine->memory_region[0][0x050000];
	p2 = (unsigned long *)&Machine->memory_region[0][0x058000];
	for (i = 0; i < 0x8000 / 4; i++)
		temp = *p1, *p1++ = *p2, *p2++ = temp;
	p1 = (unsigned long *)&Machine->memory_region[0][0x060000];
	p2 = (unsigned long *)&Machine->memory_region[0][0x068000];
	for (i = 0; i < 0x8000 / 4; i++)
		temp = *p1, *p1++ = *p2, *p2++ = temp;
	p1 = (unsigned long *)&Machine->memory_region[0][0x070000];
	p2 = (unsigned long *)&Machine->memory_region[0][0x078000];
	for (i = 0; i < 0x8000 / 4; i++)
		temp = *p1, *p1++ = *p2, *p2++ = temp;

	/* also invert the graphics bits on the playfield and motion objects */
	for (i = 0; i < 0x60000; i++)
		Machine->memory_region[1][i] ^= 0xff;
}



/*************************************
 *
 *		Game driver(s)
 *
 *************************************/

struct GameDriver gauntlet_driver =
{
	__FILE__,
	0,
	"gauntlet",
	"Gauntlet",
	"1985",
	"Atari Games",
	"Aaron Giles (MAME driver)\nMike Balfour (graphics info)\nFrank Palazzolo (Slapstic decoding)",
	0,
	&gauntlet_machine_driver,
	0,

	gauntlet_rom,
	gauntlet_rom_decode,
	0,
	0,
	0,	/* sound_prom */

	gauntlet_ports,

	0, 0, 0,   /* colors, palette, colortable */
	ORIENTATION_DEFAULT,
	atarigen_hiload, atarigen_hisave
};


struct GameDriver gauntir1_driver =
{
	__FILE__,
	&gauntlet_driver,
	"gauntir1",
	"Gauntlet (Intermediate Release 1)",
	"1985",
	"Atari Games",
	"Aaron Giles (MAME driver)\nMike Balfour (graphics info)\nFrank Palazzolo (Slapstic decoding)",
	0,
	&gauntlet_machine_driver,
	0,

	gauntir1_rom,
	gauntlet_rom_decode,
	0,
	0,
	0,	/* sound_prom */

	gauntlet_ports,

	0, 0, 0,   /* colors, palette, colortable */
	ORIENTATION_DEFAULT,
	atarigen_hiload, atarigen_hisave
};


struct GameDriver gauntir2_driver =
{
	__FILE__,
	&gauntlet_driver,
	"gauntir2",
	"Gauntlet (Intermediate Release 2)",
	"1985",
	"Atari Games",
	"Aaron Giles (MAME driver)\nMike Balfour (graphics info)\nFrank Palazzolo (Slapstic decoding)",
	0,
	&gauntlet_machine_driver,
	0,

	gauntir2_rom,
	gauntlet_rom_decode,
	0,
	0,
	0,	/* sound_prom */

	gauntlet_ports,

	0, 0, 0,   /* colors, palette, colortable */
	ORIENTATION_DEFAULT,
	atarigen_hiload, atarigen_hisave
};


struct GameDriver gaunt2p_driver =
{
	__FILE__,
	&gauntlet_driver,
	"gaunt2p",
	"Gauntlet (2 Players)",
	"1985",
	"Atari Games",
	"Aaron Giles (MAME driver)\nMike Balfour (graphics info)\nFrank Palazzolo (Slapstic decoding)",
	0,
	&gaunt2p_machine_driver,
	0,

	gaunt2p_rom,
	gauntlet_rom_decode,
	0,
	0,
	0,	/* sound_prom */

	gauntlet_ports,

	0, 0, 0,   /* colors, palette, colortable */
	ORIENTATION_DEFAULT,
	atarigen_hiload, atarigen_hisave
};


struct GameDriver gaunt2_driver =
{
	__FILE__,
	0,
	"gaunt2",
	"Gauntlet 2",
	"1986",
	"Atari Games",
	"Aaron Giles (MAME driver)\nMike Balfour (graphics info)\nFrank Palazzolo (Slapstic decoding)",
	0,
	&gauntlet2_machine_driver,
	0,

	gaunt2_rom,
	gauntlet_rom_decode,
	0,
	0,
	0,	/* sound_prom */

	gauntlet_ports,

	0, 0, 0,   /* colors, palette, colortable */
	ORIENTATION_DEFAULT,
	atarigen_hiload, atarigen_hisave
};

⌨️ 快捷键说明

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