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

📄 exctsccr.c

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 C
📖 第 1 页 / 共 2 页
字号:
	{ 0, 0, 0, 0 },
	{ 0, 0, 0, 0 },
	{ 0, 0, 0, 0 }, /* it writes 0s thru port A, no clue what for */
	{ 0, 0, 0, 0 }
};

static struct DACinterface dac_interface =
{
	2,
	{ 50, 50 }
};

/* Bootleg */
static struct AY8910interface bl_ay8910_interface =
{
	1,	/* 1 chip */
	1500000,	/* 1.5 MHz ? */
	{ 50 }, /* volume */
	{ 0 },
	{ 0 },
	{ 0 },
	{ 0 }
};

static struct DACinterface bl_dac_interface =
{
	1,
	{ 100 }
};

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

	Machine driver(s)

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

static struct MachineDriver machine_driver =
{
	/* basic machine hardware */
	{
		{
			CPU_Z80,
			4000000,	/* 4.0 Mhz (?) */
			0,
			readmem,writemem,0,0,
			interrupt,1
		},
		{
			CPU_Z80,
			4000000,	/* 4.0 Mhz (?) */
			3,
			sound_readmem,sound_writemem,0,sound_writeport,
			ignore_interrupt,0,
			nmi_interrupt, 4000 /* 4 khz, updates the dac */
		},
	},
	60, DEFAULT_REAL_60HZ_VBLANK_DURATION, /* frames per second, vblank duration */
	1,	/* 1 CPU slice per frame - interleaving is forced when a sound command is written */
	0,

	/* video hardware */
	32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
	gfxdecodeinfo,
	32, 64*8,
	exctsccr_vh_convert_color_prom,

	VIDEO_TYPE_RASTER,
	0,
	exctsccr_vh_start,
	exctsccr_vh_stop,
	exctsccr_vh_screenrefresh,

	/* sound hardware */
	0, 0, 0, 0,
	{
		{
			SOUND_AY8910,
			&ay8910_interface
		},
		{
			SOUND_DAC,
			&dac_interface
		}
	}
};

/* Bootleg */
static struct MachineDriver bl_machine_driver =
{
	/* basic machine hardware */
	{
		{
			CPU_Z80,
			4000000,	/* 4.0 Mhz (?) */
			0,
			bl_readmem,bl_writemem,0,0,
			interrupt,1
		},
		{
			CPU_Z80,
			3072000,	/* 3.072 Mhz ? */
			3,
			bl_sound_readmem,bl_sound_writemem,0,0,
			ignore_interrupt,0
		},
	},
	60, DEFAULT_REAL_60HZ_VBLANK_DURATION, /* frames per second, vblank duration */
	1,	/* 1 CPU slice per frame - interleaving is forced when a sound command is written */
	0,

	/* video hardware */
	32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
	gfxdecodeinfo,
	32, 64*8,
	exctsccr_vh_convert_color_prom,

	VIDEO_TYPE_RASTER,
	0,
	generic_vh_start,
	exctsccr_vh_stop,
	exctsccr_vh_screenrefresh,

	/* sound hardware */
	0, 0, 0, 0,
	{
		{
			SOUND_AY8910,
			&bl_ay8910_interface
		},
		{
			SOUND_DAC,
			&bl_dac_interface
		}
	}
};

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

  Game driver(s)

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

ROM_START( exctsccr_rom )
    ROM_REGION(0x10000)     /* 64k for code */
    ROM_LOAD( "1_g10.bin", 0x0000, 0x2000, 0xaa68df66 )
    ROM_LOAD( "2_h10.bin", 0x2000, 0x2000, 0x2d8f8326 )
    ROM_LOAD( "3_j10.bin", 0x4000, 0x2000, 0xdce4a04d )

    ROM_REGION(0x08000)
    ROM_LOAD( "4_a5.bin", 0x0000, 0x2000, 0xc342229b )
    ROM_LOAD( "5_b5.bin", 0x2000, 0x2000, 0x35f4f8c9 )
    ROM_LOAD( "6_c5.bin", 0x4000, 0x2000, 0xeda40e32 )
    ROM_LOAD( "2_k5.bin", 0x6000, 0x1000, 0x7f9cace2 )
    ROM_LOAD( "3_l5.bin", 0x7000, 0x1000, 0xdb2d9e0d )

	ROM_REGION(0x220)	/* color proms */
	ROM_LOAD( "Prom1.e1", 0x000, 0x020, 0xd9b10bf0 ) /* palette */
	ROM_LOAD( "Prom2.8r", 0x020, 0x100, 0x8a9c0edf ) /* lookup table */
	ROM_LOAD( "Prom3.k5", 0x120, 0x100, 0xb5db1c2c ) /* lookup table */

    ROM_REGION(0x10000)     /* 64k for code */
    ROM_LOAD( "0_h6.bin", 0x0000, 0x2000, 0x3babbd6b )
    ROM_LOAD( "9_f6.bin", 0x2000, 0x2000, 0x639998f5 )
    ROM_LOAD( "8_d6.bin", 0x4000, 0x2000, 0x88651ee1 )
    ROM_LOAD( "7_c6.bin", 0x6000, 0x2000, 0x6d51521e )
    ROM_LOAD( "1_a6.bin", 0x8000, 0x1000, 0x20f2207e )
ROM_END

/* Bootleg */
ROM_START( exctsccb_rom )
	ROM_REGION(0x10000)	/* 64k for code */
	ROM_LOAD( "ES-1.E2", 0x0000, 0x2000, 0x997c6a82 )
	ROM_LOAD( "ES-2.G2", 0x2000, 0x2000, 0x5c66e792 )
	ROM_LOAD( "ES-3.H2", 0x4000, 0x2000, 0xe0d504c0 )

	ROM_REGION(0x8000)	/* temporary space for graphics (disposed after conversion) */
    ROM_LOAD( "4_a5.bin", 0x0000, 0x2000, 0xc342229b ) /* ES-4.E5 */
    ROM_LOAD( "5_b5.bin", 0x2000, 0x2000, 0x35f4f8c9 ) /* ES-5.5G */
    ROM_LOAD( "6_c5.bin", 0x4000, 0x2000, 0xeda40e32 ) /* ES-6.S  */
	ROM_LOAD( "2_k5.bin", 0x6000, 0x1000, 0x7f9cace2 ) /* ES-7.S - bad read on the bootleg set */
	ROM_LOAD( "3_l5.bin", 0x7000, 0x1000, 0xdb2d9e0d ) /* ES-8.S - bad read on the bootleg set */

	ROM_REGION(0x220)	/* color proms */
	ROM_LOAD( "Prom1.e1", 0x000, 0x020, 0xd9b10bf0 ) /* palette */
	ROM_LOAD( "Prom2.8r", 0x020, 0x100, 0x8a9c0edf ) /* lookup table */
	ROM_LOAD( "Prom3.k5", 0x120, 0x100, 0xb5db1c2c ) /* lookup table */

	ROM_REGION(0x10000)	/* sound */
	ROM_LOAD( "ES-A.K2", 0x0000, 0x2000, 0x99e87b78 )
	ROM_LOAD( "ES-B.L2", 0x2000, 0x2000, 0x8b3db794 )
	ROM_LOAD( "ES-C.M2", 0x4000, 0x2000, 0x7bed2f81 )
ROM_END


static int hiload_es(void)
{
	/* get RAM pointer (this game is multiCPU, we can't assume the global */
	/* RAM pointer is pointing to the right place) */
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];

	if (memcmp(&RAM[0x7c60],"\x02\x00\x00",3) == 0)
	{
		void *f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0);
		if (f)
		{
			osd_fread(f,&RAM[0x7c90],48);
			osd_fclose(f);

			/* Copy the high score to the work ram as well */

			RAM[0x7c60] = RAM[0x7c93];
			RAM[0x7c61] = RAM[0x7c94];
			RAM[0x7c62] = RAM[0x7c95];
		}
		return 1;
	}
	return 0;  /* we can't load the hi scores yet */
}

static void hisave_es(void)
{
	/* get RAM pointer (this game is multiCPU, we can't assume the global */
	/* RAM pointer is pointing to the right place) */

	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];
	void *f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,1);

	if (f)
	{
		osd_fwrite(f,&RAM[0x7c90],48);
		osd_fclose(f);
	}
}

static int hiload_esb(void)
{
	/* get RAM pointer (this game is multiCPU, we can't assume the global */
	/* RAM pointer is pointing to the right place) */
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];

	if (memcmp(&RAM[0x8c60],"\x02\x00\x00",3) == 0)
	{
		void *f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0);
		if (f)
		{
			osd_fread(f,&RAM[0x8c90],48);
			osd_fclose(f);

			/* Copy the high score to the work ram as well */

			RAM[0x8c60] = RAM[0x8c93];
			RAM[0x8c61] = RAM[0x8c94];
			RAM[0x8c62] = RAM[0x8c95];
		}
		return 1;
	}
	return 0;  /* we can't load the hi scores yet */
}

static void hisave_esb(void)
{
	/* get RAM pointer (this game is multiCPU, we can't assume the global */
	/* RAM pointer is pointing to the right place) */

	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];
	void *f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,1);

	if (f)
	{
		osd_fwrite(f,&RAM[0x8c90],48);
		osd_fclose(f);
	}
}




struct GameDriver exctsccr_driver =
{
	__FILE__,
	0,
	"exctsccr",
	"Exciting Soccer",
	"1983",
	"Alpha Denshi Co.",
	"Ernesto Corvi\nJarek Parchanski\nDedicated to Paolo Nicoletti",
	0,
	&machine_driver,
	0,
	exctsccr_rom,
	0, 0,
	0,
	0,      /* sound_prom */

	input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_ROTATE_90,

	hiload_es, hisave_es
};

/* Bootleg */
struct GameDriver exctsccb_driver =
{
	__FILE__,
	&exctsccr_driver,
	"exctsccb",
	"Exciting Soccer (bootleg)",
	"1984",
	"Kazutomi",
	"Ernesto Corvi\nJarek Parchanski\n\nDedicated to Paolo Nicoletti",
	0,
	&bl_machine_driver,
	0,
	exctsccb_rom,
	0, 0,
	0,
	0,      /* sound_prom */

	input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_ROTATE_90,
	hiload_esb, hisave_esb
};

⌨️ 快捷键说明

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