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

📄 cabal.c

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 C
📖 第 1 页 / 共 2 页
字号:
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ), IP_KEY_NONE )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
INPUT_PORTS_END



static struct GfxLayout text_layout =
{
	8,8,	/* 8*8 characters */
	1024,	/* 1024 characters */
	2,	/* 4 bits per pixel */
	{ 0,4 },//0x4000*8+0, 0x4000*8+4, 0, 4 },
	{ 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0},
	{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
	16*8	/* every char takes 16 consecutive bytes */
};

static struct GfxLayout tile_layout =
{
	16,16,  /* 16*16 tiles */
	4*1024,   /* 1024 tiles */
	4,      /* 4 bits per pixel */
	{ 0, 4, 0x40000*8+0, 0x40000*8+4 },
	{ 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0,
			32*8+3, 32*8+2, 32*8+1, 32*8+0, 33*8+3, 33*8+2, 33*8+1, 33*8+0 },
	{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
			8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
	64*8
};

static struct GfxLayout sprite_layout =
{
	16,16,	/* 16*16 sprites */
	4*1024,	/* 1024 sprites */
	4,	/* 4 bits per pixel */
	{ 0, 4, 0x40000*8+0, 0x40000*8+4 },	/* the two bitplanes for 4 pixels are packed into one byte */
	{ 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0,
			16+3, 16+2, 16+1, 16+0, 24+3, 24+2, 24+1, 24+0 },
	{ 30*16, 28*16, 26*16, 24*16, 22*16, 20*16, 18*16, 16*16,
			14*16, 12*16, 10*16,  8*16,  6*16,  4*16,  2*16,  0*16 },
	64*8	/* every sprite takes 64 consecutive bytes */
};

static struct GfxDecodeInfo cabal_gfxdecodeinfo[] = {
	{ 2,      0x100000, &text_layout,		0, 1024/4 },
	{ 2,      0x000000, &tile_layout,		32*16, 16 },
	{ 2,      0x080000, &sprite_layout,		16*16, 16 },
	{ -1 }
};

static struct MachineDriver cabal_machine_driver =
{
	{
		{
			CPU_M68000,
			12000000, /* 12 Mhz */
			0,
			readmem_cpu,writemem_cpu,0,0,
			m68_level1_irq,1
		},
		{
			CPU_Z80 | CPU_AUDIO_CPU,
			4000000,	/* 4 Mhz */
			1,
			readmem_sound,writemem_sound,0,0,
			interrupt,1
		},
	},
	60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
	1, /* CPU slices per frame */
	cabal_init_machine, /* init machine */

	/* video hardware */
	256, 256, { 0, 255, 16, 255-16 },

	cabal_gfxdecodeinfo,
	1024,1024,
	0,

	VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
	0,
	generic_vh_start,
	generic_vh_stop,
	cabal_vh_screenrefresh,

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

static struct MachineDriver cabalbl_machine_driver =
{
	{
		{
			CPU_M68000,
			12000000, /* 12 Mhz */
			0,
			readmem_cpu,writemem_cpu,0,0,
			m68_level1_irq,1
		},
		{
			CPU_Z80 | CPU_AUDIO_CPU,
			4000000,	/* 4 Mhz */
			1,
			cabalbl_readmem_sound,cabalbl_writemem_sound,0,0,
			interrupt,1
		},
	},
	60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
	10, /* CPU slices per frame */
	cabal_init_machine, /* init machine */

	/* video hardware */
	256, 256, { 0, 255, 16, 255-16 },

	cabal_gfxdecodeinfo,
	1024,1024,
	0,

	VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
	0,
	generic_vh_start,
	generic_vh_stop,
	cabal_vh_screenrefresh,

	/* sound hardware */
	SOUND_SUPPORTS_STEREO,0,0,0,
	{
		{
			SOUND_YM2151,//_ALT,
			&ym2151_interface
		},
		{
			SOUND_ADPCM,
			&adpcm_interface
		}
	}
};

ROM_START( cabal_rom )
	ROM_REGION(0x50000)	/* 64k for cpu code */
	ROM_LOAD_EVEN( "h7_512.bin",      0x00000, 0x10000, 0x8fe16fb4 )
	ROM_LOAD_ODD ( "h6_512.bin",      0x00000, 0x10000, 0x6968101c )
	ROM_LOAD_EVEN( "k7_512.bin",      0x20000, 0x10000, 0x562031a2 )
	ROM_LOAD_ODD ( "k6_512.bin",      0x20000, 0x10000, 0x4fda2856 )

	ROM_REGION(0x10000)	/* 64k for sound cpu code */
	ROM_LOAD( "4-3n",           0x0000, 0x2000, 0x4038eff2 )
	ROM_LOAD( "3-3p",           0x8000, 0x8000, 0xd9defcbf )

	ROM_REGION_DISPOSE(0x104000)
	/* the gfx ROMs were missing in this set, I'm using the ones from */
	/* the bootleg (apart from the characters) */
	ROM_LOAD( "cabal_17.bin",   0x000000, 0x10000, 0x3b6d2b09 ) /* tiles, planes0,1 */
	ROM_LOAD( "cabal_16.bin",   0x010000, 0x10000, 0x77bc7a60 )
	ROM_LOAD( "cabal_18.bin",   0x020000, 0x10000, 0x0bc50075 )
	ROM_LOAD( "cabal_19.bin",   0x030000, 0x10000, 0x67e4fe47 )
	ROM_LOAD( "cabal_15.bin",   0x040000, 0x10000, 0x1023319b ) /* tiles, planes2,3 */
	ROM_LOAD( "cabal_14.bin",   0x050000, 0x10000, 0x420b0801 )
	ROM_LOAD( "cabal_12.bin",   0x060000, 0x10000, 0x543fcb37 )
	ROM_LOAD( "cabal_13.bin",   0x070000, 0x10000, 0xd28d921e )
	ROM_LOAD( "cabal_05.bin",   0x080000, 0x10000, 0x4e49c28e ) /* sprites, planes0,1 */
	ROM_LOAD( "cabal_06.bin",   0x090000, 0x10000, 0x6a0e739d )
	ROM_LOAD( "cabal_07.bin",   0x0a0000, 0x10000, 0x581a50c1 )
	ROM_LOAD( "cabal_08.bin",   0x0b0000, 0x10000, 0x702735c9 )
	ROM_LOAD( "cabal_04.bin",   0x0c0000, 0x10000, 0x34d3cac8 ) /* sprites, planes2,3 */
	ROM_LOAD( "cabal_03.bin",   0x0d0000, 0x10000, 0x7065e840 )
	ROM_LOAD( "cabal_02.bin",   0x0e0000, 0x10000, 0x0e1ec30e )
	ROM_LOAD( "cabal_01.bin",   0x0f0000, 0x10000, 0x55c44764 )
	ROM_LOAD( "t6_128.bin",     0x100000, 0x04000, 0x1ccee214 ) /* characters */

	ROM_REGION(0x20000)	/* Samples? */
	ROM_LOAD( "2-1s",            0x00000, 0x10000, 0x850406b4 )
	ROM_LOAD( "1-1u",            0x10000, 0x10000, 0x8b3e0789 )
ROM_END

ROM_START( cabal2_rom )
	ROM_REGION(0x50000)	/* 64k for cpu code */
	ROM_LOAD_EVEN( "9-7h",            0x00000, 0x10000, 0xebbb9484 )
	ROM_LOAD_ODD ( "7-6h",            0x00000, 0x10000, 0x51aeb49e )
	ROM_LOAD_EVEN( "8-7k",            0x20000, 0x10000, 0x4c24ed9a )
	ROM_LOAD_ODD ( "6-6k",            0x20000, 0x10000, 0x681620e8 )

	ROM_REGION(0x10000)	/* 64k for sound cpu code */
	ROM_LOAD( "4-3n",           0x0000, 0x2000, 0x4038eff2 )
	ROM_LOAD( "3-3p",           0x8000, 0x8000, 0xd9defcbf )

	ROM_REGION_DISPOSE(0x104000)
	/* the gfx ROMs were missing in this set, I'm using the ones from */
	/* the bootleg (apart from the characters) */
	ROM_LOAD( "cabal_17.bin",   0x000000, 0x10000, 0x3b6d2b09 ) /* tiles, planes0,1 */
	ROM_LOAD( "cabal_16.bin",   0x010000, 0x10000, 0x77bc7a60 )
	ROM_LOAD( "cabal_18.bin",   0x020000, 0x10000, 0x0bc50075 )
	ROM_LOAD( "cabal_19.bin",   0x030000, 0x10000, 0x67e4fe47 )
	ROM_LOAD( "cabal_15.bin",   0x040000, 0x10000, 0x1023319b ) /* tiles, planes2,3 */
	ROM_LOAD( "cabal_14.bin",   0x050000, 0x10000, 0x420b0801 )
	ROM_LOAD( "cabal_12.bin",   0x060000, 0x10000, 0x543fcb37 )
	ROM_LOAD( "cabal_13.bin",   0x070000, 0x10000, 0xd28d921e )
	ROM_LOAD( "cabal_05.bin",   0x080000, 0x10000, 0x4e49c28e ) /* sprites, planes0,1 */
	ROM_LOAD( "cabal_06.bin",   0x090000, 0x10000, 0x6a0e739d )
	ROM_LOAD( "cabal_07.bin",   0x0a0000, 0x10000, 0x581a50c1 )
	ROM_LOAD( "cabal_08.bin",   0x0b0000, 0x10000, 0x702735c9 )
	ROM_LOAD( "cabal_04.bin",   0x0c0000, 0x10000, 0x34d3cac8 ) /* sprites, planes2,3 */
	ROM_LOAD( "cabal_03.bin",   0x0d0000, 0x10000, 0x7065e840 )
	ROM_LOAD( "cabal_02.bin",   0x0e0000, 0x10000, 0x0e1ec30e )
	ROM_LOAD( "cabal_01.bin",   0x0f0000, 0x10000, 0x55c44764 )
	ROM_LOAD( "5-6s",           0x100000, 0x04000, 0x6a76955a ) /* characters */

	ROM_REGION(0x20000)	/* Samples? */
	ROM_LOAD( "2-1s",            0x00000, 0x10000, 0x850406b4 )
	ROM_LOAD( "1-1u",            0x10000, 0x10000, 0x8b3e0789 )
ROM_END

ROM_START( cabalbl_rom )
	ROM_REGION(0x50000)	/* 64k for cpu code */
	ROM_LOAD_EVEN( "cabal_24.bin",    0x00000, 0x10000, 0x00abbe0c )
	ROM_LOAD_ODD ( "cabal_22.bin",    0x00000, 0x10000, 0x78c4af27 )
	ROM_LOAD_EVEN( "cabal_23.bin",    0x20000, 0x10000, 0xd763a47c )
	ROM_LOAD_ODD ( "cabal_21.bin",    0x20000, 0x10000, 0x96d5e8af )

	ROM_REGION(0x10000)	/* 64k for sound cpu code */
	ROM_LOAD( "cabal_11.bin",    0x0000, 0x10000, 0xd308a543 )

	ROM_REGION_DISPOSE(0x104000)
	ROM_LOAD( "cabal_17.bin",   0x000000, 0x10000, 0x3b6d2b09 ) /* tiles, planes0,1 */
	ROM_LOAD( "cabal_16.bin",   0x010000, 0x10000, 0x77bc7a60 )
	ROM_LOAD( "cabal_18.bin",   0x020000, 0x10000, 0x0bc50075 )
	ROM_LOAD( "cabal_19.bin",   0x030000, 0x10000, 0x67e4fe47 )
	ROM_LOAD( "cabal_15.bin",   0x040000, 0x10000, 0x1023319b ) /* tiles, planes2,3 */
	ROM_LOAD( "cabal_14.bin",   0x050000, 0x10000, 0x420b0801 )
	ROM_LOAD( "cabal_12.bin",   0x060000, 0x10000, 0x543fcb37 )
	ROM_LOAD( "cabal_13.bin",   0x070000, 0x10000, 0xd28d921e )
	ROM_LOAD( "cabal_05.bin",   0x080000, 0x10000, 0x4e49c28e ) /* sprites, planes0,1 */
	ROM_LOAD( "cabal_06.bin",   0x090000, 0x10000, 0x6a0e739d )
	ROM_LOAD( "cabal_07.bin",   0x0a0000, 0x10000, 0x581a50c1 )
	ROM_LOAD( "cabal_08.bin",   0x0b0000, 0x10000, 0x702735c9 )
	ROM_LOAD( "cabal_04.bin",   0x0c0000, 0x10000, 0x34d3cac8 ) /* sprites, planes2,3 */
	ROM_LOAD( "cabal_03.bin",   0x0d0000, 0x10000, 0x7065e840 )
	ROM_LOAD( "cabal_02.bin",   0x0e0000, 0x10000, 0x0e1ec30e )
	ROM_LOAD( "cabal_01.bin",   0x0f0000, 0x10000, 0x55c44764 )
	ROM_LOAD( "5-6s",           0x100000, 0x04000, 0x6a76955a ) /* characters */

	ROM_REGION(0x20000)
	ROM_LOAD( "cabal_09.bin",    0x00000, 0x10000, 0x4ffa7fe3 ) /* Z80 code/adpcm data */
	ROM_LOAD( "cabal_10.bin",    0x10000, 0x10000, 0x958789b6 ) /* Z80 code/adpcm data */
ROM_END



struct GameDriver cabal_driver =
{
	__FILE__,
	0,
	"cabal",
	"Cabal (US set 1)",
	"1988",
	"Tad (Fabtek license)",
	"Carlos A. Lozano Baides\nPhil Stroffolino\nRichard Bush\nErnesto Corvi\n",
	GAME_NOT_WORKING,
	&cabal_machine_driver,
	0,

	cabal_rom,
	0,0,
	0,
	0, /* sound_prom */

	input_ports,

	0,0,0,
	ORIENTATION_DEFAULT,

	0,0
};

struct GameDriver cabal2_driver =
{
	__FILE__,
	&cabal_driver,
	"cabal2",
	"Cabal (US set 2)",
	"1988",
	"Tad (Fabtek license)",
	"Carlos A. Lozano Baides\nPhil Stroffolino\nRichard Bush\nErnesto Corvi\n",
	GAME_NOT_WORKING,
	&cabal_machine_driver,
	0,

	cabal2_rom,
	0,0,
	0,
	0, /* sound_prom */

	input_ports,

	0,0,0,
	ORIENTATION_DEFAULT,

	0,0
};

struct GameDriver cabalbl_driver =
{
	__FILE__,
	&cabal_driver,
	"cabalbl",
	"Cabal (bootleg)",
	"1988",
	"bootleg",
	"Carlos A. Lozano Baides\nPhil Stroffolino\nRichard Bush\nErnesto Corvi\n",
	0,
	&cabalbl_machine_driver,
	0,

	cabalbl_rom,
	0,0,
	0,
	0, /* sound_prom */

	input_ports,

	0,0,0,
	ORIENTATION_DEFAULT,

	0,0
};

⌨️ 快捷键说明

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