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

📄 mikie.c

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



static struct MachineDriver mikie_machine_driver =
{
	/* basic machine hardware */
	{
		{
			CPU_M6809,
			1250000,        /* 1.25 Mhz */
			0,
			readmem,writemem,0,0,
			interrupt,1
		},
		{
			CPU_Z80 | CPU_AUDIO_CPU,
			14318180/4,	/* ? */
			3,
			sound_readmem,sound_writemem,0,0,
			ignore_interrupt,1	/* interrupts are triggered by the main CPU */
		}
	},
	60, DEFAULT_60HZ_VBLANK_DURATION,	/* frames per second, vblank duration */
	1,	/* 1 CPU slice per frame - interleaving is forced when a sound command is written */
	mikie_init_machine,

	/* video hardware */
	32*8, 32*8, { 2*8, 30*8-1, 0*8, 32*8-1 },
	gfxdecodeinfo,
	256,16*8*16+16*8*16,
	mikie_vh_convert_color_prom,

	VIDEO_TYPE_RASTER,
	0,
	generic_vh_start,
	generic_vh_stop,
	mikie_vh_screenrefresh,

	/* sound hardware */
	0,0,0,0,
	{
		{
			SOUND_SN76496,
			&sn76496_interface
		}
	}
};



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

  Game driver(s)

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


ROM_START( mikie_rom )
	ROM_REGION(0x10000)     /* 64k for code */
	ROM_LOAD( "11c_n14.bin",  0x6000, 0x2000, 0xf698e6dd )
	ROM_LOAD( "12a_o13.bin",  0x8000, 0x4000, 0x826e7035 )
	ROM_LOAD( "12d_o17.bin",  0xc000, 0x4000, 0x161c25c8 )

	ROM_REGION_DISPOSE(0x14000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "o11",          0x00000, 0x4000, 0x3c82aaf3 )
	ROM_LOAD( "001",          0x04000, 0x4000, 0xa2ba0df5 )
	ROM_LOAD( "003",          0x08000, 0x4000, 0x9775ab32 )
	ROM_LOAD( "005",          0x0c000, 0x4000, 0xba44aeef )
	ROM_LOAD( "007",          0x10000, 0x4000, 0x31afc153 )

	ROM_REGION(0x0500)	/* color PROMs */
	ROM_LOAD( "01i_d19.bin",  0x0000, 0x0100, 0x8b83e7cf )	/* red component */
	ROM_LOAD( "03i_d21.bin",  0x0100, 0x0100, 0x3556304a )	/* green component */
	ROM_LOAD( "02i_d20.bin",  0x0200, 0x0100, 0x676a0669 )	/* blue component */
	ROM_LOAD( "12h_d22.bin",  0x0300, 0x0100, 0x872be05c )	/* character lookup table */
	ROM_LOAD( "f09_d18.bin",  0x0400, 0x0100, 0x7396b374 )	/* sprite lookup table */

	ROM_REGION(0x10000)
	ROM_LOAD( "06e_n10.bin",  0x0000, 0x2000, 0x2cf9d670 )
ROM_END

ROM_START( mikiej_rom )
	ROM_REGION(0x10000)     /* 64k for code */
	ROM_LOAD( "11c_n14.bin",  0x6000, 0x2000, 0xf698e6dd )
	ROM_LOAD( "12a_o13.bin",  0x8000, 0x4000, 0x826e7035 )
	ROM_LOAD( "12d_o17.bin",  0xc000, 0x4000, 0x161c25c8 )

	ROM_REGION_DISPOSE(0x14000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "08i_q11.bin",  0x00000, 0x4000, 0xc48b269b )
	ROM_LOAD( "f01_q01.bin",  0x04000, 0x4000, 0x31551987 )
	ROM_LOAD( "f03_q03.bin",  0x08000, 0x4000, 0x34414df0 )
	ROM_LOAD( "h01_q05.bin",  0x0c000, 0x4000, 0xf9e1ebb1 )
	ROM_LOAD( "h03_q07.bin",  0x10000, 0x4000, 0x15dc093b )

	ROM_REGION(0x0500)	/* color PROMs */
	ROM_LOAD( "01i_d19.bin",  0x0000, 0x0100, 0x8b83e7cf )	/* red component */
	ROM_LOAD( "03i_d21.bin",  0x0100, 0x0100, 0x3556304a )	/* green component */
	ROM_LOAD( "02i_d20.bin",  0x0200, 0x0100, 0x676a0669 )	/* blue component */
	ROM_LOAD( "12h_d22.bin",  0x0300, 0x0100, 0x872be05c )	/* character lookup table */
	ROM_LOAD( "f09_d18.bin",  0x0400, 0x0100, 0x7396b374 )	/* sprite lookup table */

	ROM_REGION(0x10000)
	ROM_LOAD( "06e_n10.bin",  0x0000, 0x2000, 0x2cf9d670 )
ROM_END

ROM_START( mikiehs_rom )
	ROM_REGION(0x10000)     /* 64k for code */
	ROM_LOAD( "11c_l14.bin",  0x6000, 0x2000, 0x633f3a6d )
	ROM_LOAD( "12a_m13.bin",  0x8000, 0x4000, 0x9c42d715 )
	ROM_LOAD( "12d_m17.bin",  0xc000, 0x4000, 0xcb5c03c9 )

	ROM_REGION_DISPOSE(0x14000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "08i_l11.bin",  0x00000, 0x4000, 0x5ba9d86b )
	ROM_LOAD( "f01_i01.bin",  0x04000, 0x4000, 0x0c0cab5f )
	ROM_LOAD( "f03_i03.bin",  0x08000, 0x4000, 0x694da32f )
	ROM_LOAD( "h01_i05.bin",  0x0c000, 0x4000, 0x00e357e1 )
	ROM_LOAD( "h03_i07.bin",  0x10000, 0x4000, 0xceeba6ac )

	ROM_REGION(0x0500)	/* color PROMs */
	ROM_LOAD( "01i_d19.bin",  0x0000, 0x0100, 0x8b83e7cf )	/* red component */
	ROM_LOAD( "03i_d21.bin",  0x0100, 0x0100, 0x3556304a )	/* green component */
	ROM_LOAD( "02i_d20.bin",  0x0200, 0x0100, 0x676a0669 )	/* blue component */
	ROM_LOAD( "12h_d22.bin",  0x0300, 0x0100, 0x872be05c )	/* character lookup table */
	ROM_LOAD( "f09_d18.bin",  0x0400, 0x0100, 0x7396b374 )	/* sprite lookup table */

	ROM_REGION(0x10000)
	ROM_LOAD( "06e_h10.bin",  0x0000, 0x2000, 0x4ed887d2 )
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[0x2a00],"\x1d\x2c\x1f\x00\x01",5) == 0)
	{
		void *f;


		if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
		{

                        osd_fread(f,&RAM[0x2a00],9*5);

				/* top score display */
                        memcpy(&RAM[0x29f0], &RAM[0x2a05], 4);

				/* 1p score display, which also displays the top score on startup */
				memcpy(&RAM[0x297c], &RAM[0x2a05], 4);

                        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[0x2a00],9*5);
		osd_fclose(f);
	}
}



struct GameDriver mikie_driver =
{
	__FILE__,
	0,
	"mikie",
	"Mikie",
	"1984",
	"Konami",
	"Allard Van Der Bas (MAME driver)\nMirko Buffoni (MAME driver)\nStefano Mozzi (MAME driver)\nMarco Cassili (dip switches)\nAl Kossow (color info)",
	0,
	&mikie_machine_driver,
	0,

	mikie_rom,
	0, 0,
	0,
	0,

	input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

struct GameDriver mikiej_driver =
{
	__FILE__,
	&mikie_driver,
	"mikiej",
	"Shinnyuushain Tooru-kun",
	"1984",
	"Konami",
	"Allard Van Der Bas (MAME driver)\nMirko Buffoni (MAME driver)\nStefano Mozzi (MAME driver)\nMarco Cassili (dip switches)\nAl Kossow (color info)",
	0,
	&mikie_machine_driver,
	0,

	mikiej_rom,
	0, 0,
	0,
	0,

	input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

struct GameDriver mikiehs_driver =
{
	__FILE__,
	&mikie_driver,
	"mikiehs",
	"Mikie (High School Graffiti)",
	"1984",
	"Konami",
	"Allard Van Der Bas (MAME driver)\nMirko Buffoni (MAME driver)\nStefano Mozzi (MAME driver)\nMarco Cassili (dip switches)\nAl Kossow (color info)",
	0,
	&mikie_machine_driver,
	0,

	mikiehs_rom,
	0, 0,
	0,
	0,

	input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

⌨️ 快捷键说明

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