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

📄 pacland.c

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



static struct MachineDriver machine_driver =
{
	/* basic machine hardware */
	{
		{
			CPU_M6809,
			2000000,	/* 2.000 Mhz (?) */
			0,
			readmem,writemem,0,0,
			interrupt,1
		},
		{
			CPU_HD63701,	/* or compatible 6808 with extra instructions */
			2000000,	/* 2.000 Mhz (?) */
			3,
			mcu_readmem,mcu_writemem,0,0,
			interrupt,1
		},
	},
	60,DEFAULT_REAL_60HZ_VBLANK_DURATION,
	100,	/* we need heavy synching between the MCU and the CPU */
	pacland_init_machine,

	/* video hardware */
	42*8, 32*8, { 3*8, 39*8-1, 2*8, 30*8-1 },
	gfxdecodeinfo,
	256,256*4+256*4+2*64*16,
	pacland_vh_convert_color_prom,

	VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE,
	0,
	pacland_vh_start,
	pacland_vh_stop,
	pacland_vh_screenrefresh,

	/* sound hardware */
	0,0,0,0
};


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

  Game driver(s)

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

ROM_START( pacland_rom )
	ROM_REGION(0x20000)	/* 128k for code */
	ROM_LOAD( "pl5_01b.bin",  0x08000, 0x4000, 0xb0ea7631 )
	ROM_LOAD( "pl5_02.bin",   0x0C000, 0x4000, 0xd903e84e )
	/* all the following are banked at 0x4000-0x5fff */
	ROM_LOAD( "pl1-3",        0x10000, 0x4000, 0xaa9fa739 )
	ROM_LOAD( "pl1-4",        0x14000, 0x4000, 0x2b895a90 )
	ROM_LOAD( "pl1-5",        0x18000, 0x4000, 0x7af66200 )
	ROM_LOAD( "pl3_06.bin",   0x1c000, 0x4000, 0x2ffe3319 )

	ROM_REGION_DISPOSE(0x20000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "pl2_12.bin",   0x00000, 0x2000, 0xa63c8726 )	/* chars */
	ROM_LOAD( "pl4_13.bin",   0x02000, 0x2000, 0x3ae582fd )
	ROM_LOAD( "pl1-9",        0x10000, 0x4000, 0xf5d5962b )	/* sprites */
	ROM_LOAD( "pl1-10",       0x14000, 0x4000, 0xc7cf1904 )
	ROM_LOAD( "pl1-8",        0x18000, 0x4000, 0xa2ebfa4a )
	ROM_LOAD( "pl1-11",       0x1c000, 0x4000, 0x6621361a )

	ROM_REGION(0x1400)	/* color PROMs */
	ROM_LOAD( "pl1-2.bin",    0x0000, 0x0400, 0x472885de )	/* red and green component */
	ROM_LOAD( "pl1-1.bin",    0x0400, 0x0400, 0xa78ebdaf )	/* blue component */
	ROM_LOAD( "pl1-3.bin",    0x0800, 0x0400, 0x80558da8 )	/* sprites lookup table */
	ROM_LOAD( "pl1-5.bin",    0x0c00, 0x0400, 0x4b7ee712 )	/* foreground lookup table */
	ROM_LOAD( "pl1-4.bin",    0x1000, 0x0400, 0x3a7be418 )	/* background lookup table */

	ROM_REGION(0x10000)	/* 64k for code */
	ROM_LOAD( "pl1-7",        0x8000, 0x2000, 0x8c5becae ) /* sub program for the mcu */
	ROM_LOAD( "pl1-mcu.bin",  0xf000, 0x1000, 0x6ef08fb3 ) /* microcontroller */
ROM_END

ROM_START( pacland2_rom )
	ROM_REGION(0x20000)	/* 128k for code */
	ROM_LOAD( "pl6_01.bin",   0x08000, 0x4000, 0x4c96e11c )
	ROM_LOAD( "pl6_02.bin",   0x0C000, 0x4000, 0x8cf5bd8d )
	/* all the following are banked at 0x4000-0x5fff */
	ROM_LOAD( "pl1-3",        0x10000, 0x4000, 0xaa9fa739 )
	ROM_LOAD( "pl1-4",        0x14000, 0x4000, 0x2b895a90 )
	ROM_LOAD( "pl1-5",        0x18000, 0x4000, 0x7af66200 )
	ROM_LOAD( "pl1-6",        0x1c000, 0x4000, 0xb01e59a9 )

	ROM_REGION_DISPOSE(0x20000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "pl0_12.bin",   0x00000, 0x2000, 0xc8cb61ab )	/* chars */
	ROM_LOAD( "pl1-13",       0x02000, 0x2000, 0x6c5ed9ae )
	ROM_LOAD( "pl1_09b.bin",  0x10000, 0x4000, 0x80768a87 )	/* sprites */
	ROM_LOAD( "pl1_10b.bin",  0x14000, 0x4000, 0xffd9d66e )
	ROM_LOAD( "pl1_08.bin",   0x18000, 0x4000, 0x2b20e46d )
	ROM_LOAD( "pl1_11.bin",   0x1c000, 0x4000, 0xc59775d8 )

	ROM_REGION(0x1400)	/* color PROMs */
	ROM_LOAD( "pl1-2.bin",    0x0000, 0x0400, 0x472885de )	/* red and green component */
	ROM_LOAD( "pl1-1.bin",    0x0400, 0x0400, 0xa78ebdaf )	/* blue component */
	ROM_LOAD( "pl1-3.bin",    0x0800, 0x0400, 0x80558da8 )	/* sprites lookup table */
	ROM_LOAD( "pl1-5.bin",    0x0c00, 0x0400, 0x4b7ee712 )	/* foreground lookup table */
	ROM_LOAD( "pl1-4.bin",    0x1000, 0x0400, 0x3a7be418 )	/* background lookup table */

	ROM_REGION(0x10000)	/* 64k for code */
	ROM_LOAD( "pl1-7",        0x8000, 0x2000, 0x8c5becae ) /* sub program for the mcu */
	ROM_LOAD( "pl1-mcu.bin",  0xf000, 0x1000, 0x6ef08fb3 ) /* microcontroller */
ROM_END

ROM_START( pacland3_rom )
	ROM_REGION(0x20000)	/* 128k for code */
	ROM_LOAD( "pln1-1",       0x08000, 0x4000, 0xf729fb94 )
	ROM_LOAD( "pln1-2",       0x0C000, 0x4000, 0x5c66eb6f )
	/* all the following are banked at 0x4000-0x5fff */
	ROM_LOAD( "pl1-3",        0x10000, 0x4000, 0xaa9fa739 )
	ROM_LOAD( "pl1-4",        0x14000, 0x4000, 0x2b895a90 )
	ROM_LOAD( "pl1-5",        0x18000, 0x4000, 0x7af66200 )
	ROM_LOAD( "pl1-6",        0x1c000, 0x4000, 0xb01e59a9 )

	ROM_REGION_DISPOSE(0x20000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "pl1-12",       0x00000, 0x2000, 0xc159fbce )	/* chars */
	ROM_LOAD( "pl1-13",       0x02000, 0x2000, 0x6c5ed9ae )
	ROM_LOAD( "pl1_09b.bin",  0x10000, 0x4000, 0x80768a87 )	/* sprites */
	ROM_LOAD( "pl1_10b.bin",  0x14000, 0x4000, 0xffd9d66e )
	ROM_LOAD( "pl1_08.bin",   0x18000, 0x4000, 0x2b20e46d )
	ROM_LOAD( "pl1_11.bin",   0x1c000, 0x4000, 0xc59775d8 )

	ROM_REGION(0x1400)	/* color PROMs */
	ROM_LOAD( "pl1-2.bin",    0x0000, 0x0400, 0x472885de )	/* red and green component */
	ROM_LOAD( "pl1-1.bin",    0x0400, 0x0400, 0xa78ebdaf )	/* blue component */
	ROM_LOAD( "pl1-3.bin",    0x0800, 0x0400, 0x80558da8 )	/* sprites lookup table */
	ROM_LOAD( "pl1-5.bin",    0x0c00, 0x0400, 0x4b7ee712 )	/* foreground lookup table */
	ROM_LOAD( "pl1-4.bin",    0x1000, 0x0400, 0x3a7be418 )	/* background lookup table */

	ROM_REGION(0x10000)	/* 64k for code */
	ROM_LOAD( "pl1-7",        0x8000, 0x2000, 0x8c5becae ) /* sub program for the mcu */
	ROM_LOAD( "pl1-mcu.bin",  0xf000, 0x1000, 0x6ef08fb3 ) /* microcontroller */
ROM_END

ROM_START( paclandm_rom )
	ROM_REGION(0x20000)	/* 128k for code */
	ROM_LOAD( "pl1-1",        0x08000, 0x4000, 0xa938ae99 )
	ROM_LOAD( "pl1-2",        0x0C000, 0x4000, 0x3fe43bb5 )
	/* all the following are banked at 0x4000-0x5fff */
	ROM_LOAD( "pl1-3",        0x10000, 0x4000, 0xaa9fa739 )
	ROM_LOAD( "pl1-4",        0x14000, 0x4000, 0x2b895a90 )
	ROM_LOAD( "pl1-5",        0x18000, 0x4000, 0x7af66200 )
	ROM_LOAD( "pl1-6",        0x1c000, 0x4000, 0xb01e59a9 )

	ROM_REGION_DISPOSE(0x20000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "pl1-12",       0x00000, 0x2000, 0xc159fbce )	/* chars */
	ROM_LOAD( "pl1-13",       0x02000, 0x2000, 0x6c5ed9ae )
	ROM_LOAD( "pl1-9",        0x10000, 0x4000, 0xf5d5962b )	/* sprites */
	ROM_LOAD( "pl1-10",       0x14000, 0x4000, 0xc7cf1904 )
	ROM_LOAD( "pl1-8",        0x18000, 0x4000, 0xa2ebfa4a )
	ROM_LOAD( "pl1-11",       0x1c000, 0x4000, 0x6621361a )

	ROM_REGION(0x1400)	/* color PROMs */
	ROM_LOAD( "pl1-2.bin",    0x0000, 0x0400, 0x472885de )	/* red and green component */
	ROM_LOAD( "pl1-1.bin",    0x0400, 0x0400, 0xa78ebdaf )	/* blue component */
	ROM_LOAD( "pl1-3.bin",    0x0800, 0x0400, 0x80558da8 )	/* sprites lookup table */
	ROM_LOAD( "pl1-5.bin",    0x0c00, 0x0400, 0x4b7ee712 )	/* foreground lookup table */
	ROM_LOAD( "pl1-4.bin",    0x1000, 0x0400, 0x3a7be418 )	/* background lookup table */

	ROM_REGION(0x10000)	/* 64k for code */
	ROM_LOAD( "pl1-7",        0x8000, 0x2000, 0x8c5becae ) /* sub program for the mcu */
	ROM_LOAD( "pl1-mcu.bin",  0xf000, 0x1000, 0x6ef08fb3 ) /* microcontroller */
ROM_END



static int hiload(void)
{
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];


	if  (memcmp(&RAM[0x2140],"\x00\x08\x00",3) == 0 &&
			memcmp(&RAM[0x02187],"\xE6\xE6\xE6",3) == 0 )
	{
		void *f;

		if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
		{
			osd_fread(f,&RAM[0x2140],74);
			RAM[0x205D] = RAM[0x2140];
			RAM[0x205E] = RAM[0x2141];
			RAM[0x205F] = RAM[0x2142];

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



struct GameDriver pacland_driver =
{
	__FILE__,
	0,
	"pacland",
	"Pac-Land (set 1)",
	"1984",
	"Namco",
	"Ernesto Corvi\nMirko Buffoni\nNicola Salmoria",
	0,
	&machine_driver,
	0,

	pacland_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

struct GameDriver pacland2_driver =
{
	__FILE__,
	&pacland_driver,
	"pacland2",
	"Pac-Land (set 2)",
	"1984",
	"Namco",
	"Ernesto Corvi\nMirko Buffoni\nNicola Salmoria",
	0,
	&machine_driver,
	0,

	pacland2_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

struct GameDriver pacland3_driver =
{
	__FILE__,
	&pacland_driver,
	"pacland3",
	"Pac-Land (set 3)",
	"1984",
	"Namco",
	"Ernesto Corvi\nMirko Buffoni\nNicola Salmoria",
	0,
	&machine_driver,
	0,

	pacland3_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

struct GameDriver paclandm_driver =
{
	__FILE__,
	&pacland_driver,
	"paclandm",
	"Pac-Land (Midway)",
	"1984",
	"[Namco] (Bally Midway license)",
	"Ernesto Corvi\nMirko Buffoni\nNicola Salmoria",
	0,
	&machine_driver,
	0,

	paclandm_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

⌨️ 快捷键说明

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