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

📄 sidearms.c

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



static struct MachineDriver sidearms_machine_driver =
{
	/* basic machine hardware */
	{
		{
			CPU_Z80,
			4000000,	/* 4 Mhz (?) */
			0,
			readmem,writemem,0,0,
			interrupt,1
		},
		{
			CPU_Z80 | CPU_AUDIO_CPU,
			3000000,	/* 3 Mhz (?) */
			2,	/* memory region #2 */
			sound_readmem,sound_writemem,0,0,
			ignore_interrupt,0	/* IRQs are triggered by the YM2203 */
		},
#ifdef THIRD_CPU
		{
			CPU_Z80,
			4000000,	/* 4 Mhz (?) */
			4,	/* memory region #4 */
			readmem2,writemem2,0,0,
			nmi_interrupt,1
		}
#endif
	},
	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 */
	48*8, 32*8, { 0*8, 48*8-1, 2*8, 30*8-1 },
	gfxdecodeinfo,
	1024, 1024,
	0,

	VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
	0,
	sidearms_vh_start,
	sidearms_vh_stop,
	sidearms_vh_screenrefresh,

	/* sound hardware */
	0,0,0,0,
	{
		{
			SOUND_YM2203,
			&ym2203_interface
		}
	}
};



ROM_START( sidearms_rom )
	ROM_REGION(0x20000)	/* 64k for code + banked ROMs images */
	ROM_LOAD( "sa03.bin",     0x00000, 0x08000, 0xe10fe6a0 )	/* CODE */
	ROM_LOAD( "a_14e.rom",    0x10000, 0x08000, 0x4925ed03 )	/* 0+1 */
	ROM_LOAD( "a_12e.rom",    0x18000, 0x08000, 0x81d0ece7 )	/* 2+3 */

	ROM_REGION_DISPOSE(0x88000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "a_10j.rom",    0x00000, 0x4000, 0x651fef75 )	/* characters */
	ROM_LOAD( "b_13d.rom",    0x08000, 0x8000, 0x3c59afe1 )	/* tiles */
	ROM_LOAD( "b_13e.rom",    0x10000, 0x8000, 0x64bc3b77 )
	ROM_LOAD( "b_13f.rom",    0x18000, 0x8000, 0xe6bcea6f )
	ROM_LOAD( "b_13g.rom",    0x20000, 0x8000, 0xc71a3053 )
	ROM_LOAD( "b_14d.rom",    0x28000, 0x8000, 0x826e8a97 )
	ROM_LOAD( "b_14e.rom",    0x30000, 0x8000, 0x6cfc02a4 )
	ROM_LOAD( "b_14f.rom",    0x38000, 0x8000, 0x9b9f6730 )
	ROM_LOAD( "b_14g.rom",    0x40000, 0x8000, 0xef6af630 )
	ROM_LOAD( "b_11b.rom",    0x48000, 0x8000, 0xeb6f278c )	/* sprites */
	ROM_LOAD( "b_13b.rom",    0x50000, 0x8000, 0xe91b4014 )
	ROM_LOAD( "b_11a.rom",    0x58000, 0x8000, 0x2822c522 )
	ROM_LOAD( "b_13a.rom",    0x60000, 0x8000, 0x3e8a9f75 )
	ROM_LOAD( "b_12b.rom",    0x68000, 0x8000, 0x86e43eda )
	ROM_LOAD( "b_14b.rom",    0x70000, 0x8000, 0x076e92d1 )
	ROM_LOAD( "b_12a.rom",    0x78000, 0x8000, 0xce107f3c )
	ROM_LOAD( "b_14a.rom",    0x80000, 0x8000, 0xdba06076 )

	ROM_REGION(0x10000)	/* 64k for the audio CPU */
	ROM_LOAD( "a_04k.rom",    0x0000, 0x8000, 0x34efe2d2 )

	ROM_REGION(0x08000)	/* 32k tile map */
	ROM_LOAD( "b_03d.rom",    0x0000, 0x8000, 0x6f348008 )

#ifdef THIRD_CPU
	ROM_REGION(0x10000)	/* 64k for CPU */
	ROM_LOAD( "b_11j.rom",    0x0000, 0x8000, 0x0 )
#endif
ROM_END

ROM_START( sidearmr_rom )
	ROM_REGION(0x20000)	/* 64k for code + banked ROMs images */
	ROM_LOAD( "03",           0x00000, 0x08000, 0x9a799c45 )	/* CODE */
	ROM_LOAD( "a_14e.rom",    0x10000, 0x08000, 0x4925ed03 )	/* 0+1 */
	ROM_LOAD( "a_12e.rom",    0x18000, 0x08000, 0x81d0ece7 )	/* 2+3 */

	ROM_REGION_DISPOSE(0x88000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "a_10j.rom",    0x00000, 0x4000, 0x651fef75 )	/* characters */
	ROM_LOAD( "b_13d.rom",    0x08000, 0x8000, 0x3c59afe1 )	/* tiles */
	ROM_LOAD( "b_13e.rom",    0x10000, 0x8000, 0x64bc3b77 )
	ROM_LOAD( "b_13f.rom",    0x18000, 0x8000, 0xe6bcea6f )
	ROM_LOAD( "b_13g.rom",    0x20000, 0x8000, 0xc71a3053 )
	ROM_LOAD( "b_14d.rom",    0x28000, 0x8000, 0x826e8a97 )
	ROM_LOAD( "b_14e.rom",    0x30000, 0x8000, 0x6cfc02a4 )
	ROM_LOAD( "b_14f.rom",    0x38000, 0x8000, 0x9b9f6730 )
	ROM_LOAD( "b_14g.rom",    0x40000, 0x8000, 0xef6af630 )
	ROM_LOAD( "b_11b.rom",    0x48000, 0x8000, 0xeb6f278c )	/* sprites */
	ROM_LOAD( "b_13b.rom",    0x50000, 0x8000, 0xe91b4014 )
	ROM_LOAD( "b_11a.rom",    0x58000, 0x8000, 0x2822c522 )
	ROM_LOAD( "b_13a.rom",    0x60000, 0x8000, 0x3e8a9f75 )
	ROM_LOAD( "b_12b.rom",    0x68000, 0x8000, 0x86e43eda )
	ROM_LOAD( "b_14b.rom",    0x70000, 0x8000, 0x076e92d1 )
	ROM_LOAD( "b_12a.rom",    0x78000, 0x8000, 0xce107f3c )
	ROM_LOAD( "b_14a.rom",    0x80000, 0x8000, 0xdba06076 )

	ROM_REGION(0x10000)	/* 64k for the audio CPU */
	ROM_LOAD( "a_04k.rom",    0x0000, 0x8000, 0x34efe2d2 )

	ROM_REGION(0x08000)	/* 32k tile map */
	ROM_LOAD( "b_03d.rom",    0x0000, 0x8000, 0x6f348008 )

#ifdef THIRD_CPU
	ROM_REGION(0x10000)	/* 64k for CPU */
	ROM_LOAD( "b_11j.rom",    0x0000, 0x8000, 0x0 )
#endif
ROM_END

ROM_START( sidearjp_rom )
	ROM_REGION(0x20000)	/* 64k for code + banked ROMs images */
	ROM_LOAD( "a_15e.rom",    0x00000, 0x08000, 0x61ceb0cc )	/* CODE */
	ROM_LOAD( "a_14e.rom",    0x10000, 0x08000, 0x4925ed03 )	/* 0+1 */
	ROM_LOAD( "a_12e.rom",    0x18000, 0x08000, 0x81d0ece7 )	/* 2+3 */

	ROM_REGION_DISPOSE(0x88000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "a_10j.rom",    0x00000, 0x4000, 0x651fef75 )	/* characters */
	ROM_LOAD( "b_13d.rom",    0x08000, 0x8000, 0x3c59afe1 )	/* tiles */
	ROM_LOAD( "b_13e.rom",    0x10000, 0x8000, 0x64bc3b77 )
	ROM_LOAD( "b_13f.rom",    0x18000, 0x8000, 0xe6bcea6f )
	ROM_LOAD( "b_13g.rom",    0x20000, 0x8000, 0xc71a3053 )
	ROM_LOAD( "b_14d.rom",    0x28000, 0x8000, 0x826e8a97 )
	ROM_LOAD( "b_14e.rom",    0x30000, 0x8000, 0x6cfc02a4 )
	ROM_LOAD( "b_14f.rom",    0x38000, 0x8000, 0x9b9f6730 )
	ROM_LOAD( "b_14g.rom",    0x40000, 0x8000, 0xef6af630 )
	ROM_LOAD( "b_11b.rom",    0x48000, 0x8000, 0xeb6f278c )	/* sprites */
	ROM_LOAD( "b_13b.rom",    0x50000, 0x8000, 0xe91b4014 )
	ROM_LOAD( "b_11a.rom",    0x58000, 0x8000, 0x2822c522 )
	ROM_LOAD( "b_13a.rom",    0x60000, 0x8000, 0x3e8a9f75 )
	ROM_LOAD( "b_12b.rom",    0x68000, 0x8000, 0x86e43eda )
	ROM_LOAD( "b_14b.rom",    0x70000, 0x8000, 0x076e92d1 )
	ROM_LOAD( "b_12a.rom",    0x78000, 0x8000, 0xce107f3c )
	ROM_LOAD( "b_14a.rom",    0x80000, 0x8000, 0xdba06076 )

	ROM_REGION(0x10000)	/* 64k for the audio CPU */
	ROM_LOAD( "a_04k.rom",    0x0000, 0x8000, 0x34efe2d2 )

	ROM_REGION(0x08000)	/* 32k tile map */
	ROM_LOAD( "b_03d.rom",    0x0000, 0x8000, 0x6f348008 )

#ifdef THIRD_CPU
	ROM_REGION(0x10000)	/* 64k for CPU */
	ROM_LOAD( "b_11j.rom",    0x0000, 0x8000, 0x0 )
#endif
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[0xe680],"\x00\x00\x00\x01\x00\x00\x00\x00",8) == 0)
	{
		void *f;


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

                        osd_fread(f,&RAM[0xe680],16*5);

                        memcpy(&RAM[0xe600], &RAM[0xe680], 8);
                        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[0xe680],16*5);
		osd_fclose(f);
	}
}



struct GameDriver sidearms_driver =
{
	__FILE__,
	0,
	"sidearms",
	"Sidearms (World)",
	"1986",
	"Capcom",
	"Paul Leaman (MAME driver)\nNicola Salmoria (additional code)",
	0,
	&sidearms_machine_driver,
	0,

	sidearms_rom,
	0,0,
	0,
	0,	/* sound_prom */

	input_ports,

	0, 0, 0,
	ORIENTATION_DEFAULT,
	hiload, hisave
};

struct GameDriver sidearmr_driver =
{
	__FILE__,
	&sidearms_driver,
	"sidearmr",
	"Sidearms (US)",
	"1986",
	"Capcom (Romstar license)",
	"Paul Leaman (MAME driver)\nNicola Salmoria (additional code)",
	0,
	&sidearms_machine_driver,
	0,

	sidearmr_rom,
	0,0,
	0,
	0,	/* sound_prom */

	input_ports,

	0, 0, 0,
	ORIENTATION_DEFAULT,
	hiload, hisave
};

struct GameDriver sidearjp_driver =
{
	__FILE__,
	&sidearms_driver,
	"sidearjp",
	"Sidearms (Japan)",
	"1986",
	"Capcom",
	"Paul Leaman (MAME driver)\nNicola Salmoria (additional code)",
	0,
	&sidearms_machine_driver,
	0,

	sidearjp_rom,
	0,0,
	0,
	0,	/* sound_prom */

	input_ports,

	0, 0, 0,
	ORIENTATION_DEFAULT,
	hiload, hisave
};

⌨️ 快捷键说明

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