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

📄 bublbobl.c

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 C
📖 第 1 页 / 共 2 页
字号:
	1,			/* 1 chip */
	3000000,	/* 3 MHz ??? (hand tuned) */
	{ YM2203_VOL(25,25) },
	{ 0 },
	{ 0 },
	{ 0 },
	{ 0 },
	{ irqhandler }
};

static struct YM3526interface ym3526_interface =
{
	1,			/* 1 chip (no more supported) */
	3000000,	/* 3 MHz ??? (hand tuned) */
	{ 255 }		/* (not supported) */
};



static struct MachineDriver bublbobl_machine_driver =
{
	/* basic machine hardware */
	{				/* MachineCPU */
		{
			CPU_Z80,
			6000000,		/* 6 Mhz??? */
			0,			/* memory_region */
			readmem,writemem,0,0,
			bublbobl_interrupt,1
		},
		{
			CPU_Z80,
			6000000,		/* 6 Mhz??? */
			2,			/* memory_region */
			readmem_lvl,writemem_lvl,0,0,
			interrupt,1
		},
		{
			CPU_Z80 | CPU_AUDIO_CPU,
			3000000,	/* 4 Mhz ??? */
			3,	/* memory region #3 */
			sound_readmem,sound_writemem,0,0,
			ignore_interrupt,0	/* NMIs are triggered by the main CPU */
								/* IRQs are triggered by the YM2203 */
		}
	},
	60, DEFAULT_60HZ_VBLANK_DURATION,	/* frames per second, vblank duration */
	100,	/* 100 CPU slices per frame - an high value to ensure proper */
			/* synchronization of the CPUs */
	0,		/* init_machine() */

	/* video hardware */
	32*8, 32*8,			/* screen_width, height */
	{ 0, 32*8-1, 2*8, 30*8-1 }, /* visible_area */
	gfxdecodeinfo,
	256, 256,
	bublbobl_vh_convert_color_prom,

	VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE,
	0,
	bublbobl_vh_start,
	bublbobl_vh_stop,
	bublbobl_vh_screenrefresh,

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

static struct MachineDriver boblbobl_machine_driver =
{
	/* basic machine hardware */
	{				/* MachineCPU */
		{
			CPU_Z80,
			6000000,		/* 6 Mhz??? */
			0,			/* memory_region */
			readmem,writemem,0,0,
			interrupt,1	/* interrupt mode 1, unlike Bubble Bobble */
		},
		{
			CPU_Z80,
			6000000,		/* 6 Mhz??? */
			2,			/* memory_region */
			readmem_lvl,writemem_lvl,0,0,
			interrupt,1
		},
		{
			CPU_Z80 | CPU_AUDIO_CPU,
			4000000,	/* 4 Mhz ??? */
			3,	/* memory region #3 */
			sound_readmem,sound_writemem,0,0,
			ignore_interrupt,0	/* NMIs are triggered by the main CPU */
								/* IRQs are triggered by the YM2203 */
		}
	},
	60, DEFAULT_60HZ_VBLANK_DURATION,	/* frames per second, vblank duration */
	100,	/* 100 CPU slices per frame - an high value to ensure proper */
			/* synchronization of the CPUs */
	0,		/* init_machine() */

	/* video hardware */
	32*8, 32*8,			/* screen_width, height */
	{ 0, 32*8-1, 2*8, 30*8-1 }, /* visible_area */
	gfxdecodeinfo,
	256, 256,
	bublbobl_vh_convert_color_prom,

	VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE,
	0,
	bublbobl_vh_start,
	bublbobl_vh_stop,
	bublbobl_vh_screenrefresh,

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



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

  Game driver(s)

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

ROM_START( bublbobl_rom )
    ROM_REGION(0x1c000)	/* 64k+64k for the first CPU */
    ROM_LOAD( "a78_06.bin",   0x00000, 0x8000, 0x32c8305b )
    ROM_LOAD( "a78_05.bin",   0x08000, 0x4000, 0x53f4bc6e )	/* banked at 8000-bfff. I must load */
	ROM_CONTINUE(           0x10000, 0xc000 )				/* bank 0 at 8000 because the code falls into */
															/* it from 7fff, so bank switching wouldn't work */
    ROM_REGION_DISPOSE(0x60000)	/* temporary space for graphics (disposed after conversion) */
    ROM_LOAD( "a78_09.bin",   0x00000, 0x8000, 0x20358c22 )
    ROM_LOAD( "a78_10.bin",   0x08000, 0x8000, 0x930168a9 )
    ROM_LOAD( "a78_11.bin",   0x10000, 0x8000, 0x9773e512 )
    ROM_LOAD( "a78_12.bin",   0x18000, 0x8000, 0xd045549b )
    ROM_LOAD( "a78_13.bin",   0x20000, 0x8000, 0xd0af35c5 )
    ROM_LOAD( "a78_14.bin",   0x28000, 0x8000, 0x7b5369a8 )
    ROM_LOAD( "a78_15.bin",   0x30000, 0x8000, 0x6b61a413 )
    ROM_LOAD( "a78_16.bin",   0x38000, 0x8000, 0xb5492d97 )
    ROM_LOAD( "a78_17.bin",   0x40000, 0x8000, 0xd69762d5 )
    ROM_LOAD( "a78_18.bin",   0x48000, 0x8000, 0x9f243b68 )
    ROM_LOAD( "a78_19.bin",   0x50000, 0x8000, 0x66e9438c )
    ROM_LOAD( "a78_20.bin",   0x58000, 0x8000, 0x9ef863ad )

    ROM_REGION(0x10000)	/* 64k for the second CPU */
    ROM_LOAD( "a78_08.bin",   0x0000, 0x08000, 0xae11a07b )

    ROM_REGION(0x10000)	/* 64k for the third CPU */
    ROM_LOAD( "a78_07.bin",   0x0000, 0x08000, 0x4f9a26e8 )
ROM_END

ROM_START( boblbobl_rom )
    ROM_REGION(0x1c000)	/* 64k+64k for the first CPU */
    ROM_LOAD( "bb3",          0x00000, 0x8000, 0x01f81936 )
    ROM_LOAD( "bb5",          0x08000, 0x4000, 0x13118eb1 )	/* banked at 8000-bfff. I must load */
	ROM_CONTINUE(    0x10000, 0x4000 )				/* bank 0 at 8000 because the code falls into */
													/* it from 7fff, so bank switching wouldn't work */
    ROM_LOAD( "bb4",          0x14000, 0x8000, 0xafda99d8 )	/* banked at 8000-bfff */

    ROM_REGION_DISPOSE(0x60000)	/* temporary space for graphics (disposed after conversion) */
    ROM_LOAD( "a78_09.bin",   0x00000, 0x8000, 0x20358c22 )
    ROM_LOAD( "a78_10.bin",   0x08000, 0x8000, 0x930168a9 )
    ROM_LOAD( "a78_11.bin",   0x10000, 0x8000, 0x9773e512 )
    ROM_LOAD( "a78_12.bin",   0x18000, 0x8000, 0xd045549b )
    ROM_LOAD( "a78_13.bin",   0x20000, 0x8000, 0xd0af35c5 )
    ROM_LOAD( "a78_14.bin",   0x28000, 0x8000, 0x7b5369a8 )
    ROM_LOAD( "a78_15.bin",   0x30000, 0x8000, 0x6b61a413 )
    ROM_LOAD( "a78_16.bin",   0x38000, 0x8000, 0xb5492d97 )
    ROM_LOAD( "a78_17.bin",   0x40000, 0x8000, 0xd69762d5 )
    ROM_LOAD( "a78_18.bin",   0x48000, 0x8000, 0x9f243b68 )
    ROM_LOAD( "a78_19.bin",   0x50000, 0x8000, 0x66e9438c )
    ROM_LOAD( "a78_20.bin",   0x58000, 0x8000, 0x9ef863ad )

    ROM_REGION(0x10000)	/* 64k for the second CPU */
    ROM_LOAD( "a78_08.bin",   0x0000, 0x08000, 0xae11a07b )

    ROM_REGION(0x10000)	/* 64k for the third CPU */
    ROM_LOAD( "a78_07.bin",   0x0000, 0x08000, 0x4f9a26e8 )
ROM_END

ROM_START( sboblbob_rom )
    ROM_REGION(0x1c000)	/* 64k+64k for the first CPU */
    ROM_LOAD( "bbb-3.rom",    0x00000, 0x8000, 0xf304152a )
    ROM_LOAD( "bbb-5.rom",    0x08000, 0x4000, 0x13118eb1 )	/* banked at 8000-bfff. I must load */
	ROM_CONTINUE(    0x10000, 0x4000 )				/* bank 0 at 8000 because the code falls into */
													/* it from 7fff, so bank switching wouldn't work */
    ROM_LOAD( "bbb-4.rom",    0x14000, 0x8000, 0x94c75591 )	/* banked at 8000-bfff */

    ROM_REGION_DISPOSE(0x60000)	/* temporary space for graphics (disposed after conversion) */
    ROM_LOAD( "a78_09.bin",   0x00000, 0x8000, 0x20358c22 )
    ROM_LOAD( "a78_10.bin",   0x08000, 0x8000, 0x930168a9 )
    ROM_LOAD( "a78_11.bin",   0x10000, 0x8000, 0x9773e512 )
    ROM_LOAD( "a78_12.bin",   0x18000, 0x8000, 0xd045549b )
    ROM_LOAD( "a78_13.bin",   0x20000, 0x8000, 0xd0af35c5 )
    ROM_LOAD( "a78_14.bin",   0x28000, 0x8000, 0x7b5369a8 )
    ROM_LOAD( "a78_15.bin",   0x30000, 0x8000, 0x6b61a413 )
    ROM_LOAD( "a78_16.bin",   0x38000, 0x8000, 0xb5492d97 )
    ROM_LOAD( "a78_17.bin",   0x40000, 0x8000, 0xd69762d5 )
    ROM_LOAD( "a78_18.bin",   0x48000, 0x8000, 0x9f243b68 )
    ROM_LOAD( "a78_19.bin",   0x50000, 0x8000, 0x66e9438c )
    ROM_LOAD( "a78_20.bin",   0x58000, 0x8000, 0x9ef863ad )

    ROM_REGION(0x10000)	/* 64k for the second CPU */
    ROM_LOAD( "a78_08.bin",   0x0000, 0x08000, 0xae11a07b )

    ROM_REGION(0x10000)	/* 64k for the third CPU */
    ROM_LOAD( "a78_07.bin",   0x0000, 0x08000, 0x4f9a26e8 )
ROM_END



/* High Score memory, etc
 *
 *  E64C-E64E - the high score - initialised with points for first extra life
 *
 *  [ E64F-E653 - memory for copy protection routine ]
 *
 *  E654/5/6 score 1     E657 level     E658/9/A initials
 *  E65B/C/D score 2     E65E level     E65f/0/1 initials
 *  E662/3/4 score 3     E665 level     E666/7/8 initials
 *  E669/A/B score 4     E66C level     E66d/E/F initials
 *  E670/1/2 score 5     E673 level     E674/5/6 initials
 *
 *  E677 - position we got to in the high scores
 *  E67B - initialised to 1F - record level number reached
 *  E67C - initialised to 1F - p1's best level reached
 *  E67D - initialised to 13 - p2's best level reached
 */
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[0xe654],&RAM[0xe670],3) == 0 &&
			memcmp(&RAM[0xe654],&RAM[0xe64c],3) == 0 &&	/* high score */
			memcmp(&RAM[0xe67b],"\x1f\x1f\x13",3) == 0 &&	/* level number */
			(memcmp(&RAM[0xe654],"\x00\x20\x00",3) == 0 ||
			memcmp(&RAM[0xe654],"\x00\x30\x00",3) == 0 ||
			memcmp(&RAM[0xe654],"\x00\x40\x00",3) == 0 ||
			memcmp(&RAM[0xe654],"\x00\x50\x00",3) == 0))
	{
		void *f;


		if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
		{
			osd_fread(f,&RAM[0xe654],7*5);
			osd_fread(f,&RAM[0xe67b],3);
			RAM[0xe64c] = RAM[0xe654];
			RAM[0xe64d] = RAM[0xe655];
			RAM[0xe64e] = RAM[0xe656];
			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[0xe654],7*5);
		osd_fwrite(f,&RAM[0xe67b],3);
		osd_fclose(f);
	}
}



struct GameDriver bublbobl_driver =
{
	__FILE__,
	0,
	"bublbobl",
	"Bubble Bobble",
	"1986",
	"Taito",
	"Chris Moore\nOliver White\nNicola Salmoria\nMarco Cassili",
	GAME_NOT_WORKING,
	&bublbobl_machine_driver,
	0,

	bublbobl_rom,
	bublbobl_patch, 0,	/* remove protection */
	0,
	0,	/* sound_prom */

	bublbobl_input_ports,

	0, 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

struct GameDriver boblbobl_driver =
{
	__FILE__,
	&bublbobl_driver,
	"boblbobl",
	"Bobble Bobble",
	"1986",
	"bootleg",
	"Chris Moore\nOliver White\nNicola Salmoria\nMarco Cassili",
	0,
	&boblbobl_machine_driver,
	0,

	boblbobl_rom,
	boblbobl_patch, 0,	/* remove protection */
	0,
	0,	/* sound_prom */

	boblbobl_input_ports,

	0, 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

struct GameDriver sboblbob_driver =
{
	__FILE__,
	&bublbobl_driver,
	"sboblbob",
	"Super Bobble Bobble",
	"1986",
	"bootleg",
	"Chris Moore\nOliver White\nNicola Salmoria\nMarco Cassili",
	0,
	&boblbobl_machine_driver,
	0,

	sboblbob_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	sboblbob_input_ports,

	0, 0, 0,
	ORIENTATION_DEFAULT,

	hiload, hisave
};

⌨️ 快捷键说明

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