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

📄 twincobr.c

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 C
📖 第 1 页 / 共 2 页
字号:
	4,	/* 4 bits per pixel */
	{ 0*8192*8*8, 1*8192*8*8, 2*8192*8*8, 3*8192*8*8 }, /* the bitplanes are separated */
	{ 0, 1, 2, 3, 4, 5, 6, 7 },
	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
	8*8    /* every tile takes 8 consecutive bytes */
};

static struct GfxLayout bgtilelayout =
{
	8,8,	/* 8*8 tiles */
	4096,	/* 4096 tiles */
	4,	/* 4 bits per pixel */
	{ 0*4096*8*8, 1*4096*8*8, 2*4096*8*8, 3*4096*8*8 }, /* the bitplanes are separated */
	{ 0, 1, 2, 3, 4, 5, 6, 7 },
	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
	8*8    /* every tile takes 8 consecutive bytes */
};

static struct GfxLayout spritelayout =
{
	16,16,	/* 16*16 sprites */
	2048,	/* 2048 sprites */
	4,	/* 4 bits per pixel */
	{ 0*2048*32*8, 1*2048*32*8, 2*2048*32*8, 3*2048*32*8 }, /* the bitplanes are separated */
	{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
	{ 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 },
	32*8	/* every sprite takes 32 consecutive bytes */
};

static struct GfxDecodeInfo gfxdecodeinfo[] =
{
	{ 1, 0x00000, &charlayout,   1536, 32 },	/* colors 1536-1791 */
	{ 1, 0x0c000, &fgtilelayout, 1280, 16 },	/* colors 1280-1535 */
	{ 1, 0x4c000, &bgtilelayout, 1024, 16 },	/* colors 1024-1079 */
	{ 1, 0x6c000, &spritelayout,    0, 64 },	/* colors    0-1023 */
	{ -1 } /* end of array */
};



/* handler called by the 3812 emulator when the internal timers cause an IRQ */
static void irqhandler(void)
{
	cpu_cause_interrupt(1,0xff);
}

static struct YM3812interface ym3812_interface =
{
	1,			/* 1 chip (no more supported) */
	3500000,	/* 3.5 MHz ? (partially supported) */
	{ 255 },		/* (not supported) */
	irqhandler,
};



static struct MachineDriver machine_driver =
{
	/* basic machine hardware */
	{
		{
			CPU_M68000,
			7000000,       /* 7 MHz */
			0,
			readmem,writemem,0,0,
			twincobr_interrupt,1
		},
		{
			CPU_Z80,
			3500000,        /* 3.5 MHz  */
			2,	/* memory region #2 */
			sound_readmem,sound_writemem,sound_readport,sound_writeport,
			ignore_interrupt,0	/* IRQs are caused by the YM3812 */
		}
	},
	60, DEFAULT_REAL_60HZ_VBLANK_DURATION,	/* frames per second, vblank duration */
	100,	/* 100 CPU slices per frame */
	0,

	/* video hardware */
	64*8, 32*8, { 0*8, 40*8-1, 0*8, 30*8-1 },
	gfxdecodeinfo,
	1792, 1792,
	0,

	VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
	0,
	twincobr_vh_start,
	twincobr_vh_stop,
	twincobr_vh_screenrefresh,

	/* sound hardware */
	0,0,0,0,
	{
		{
			SOUND_YM3812,
			&ym3812_interface
		}
	}
};




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

  Game driver(s)

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

ROM_START( twincobr_rom )
	ROM_REGION(0x30000)	/* 3*64k for code */
	ROM_LOAD_EVEN( "tc16",         0x00000, 0x10000, 0x07f64d13 )
	ROM_LOAD_ODD ( "tc14",         0x00000, 0x10000, 0x41be6978 )
	ROM_LOAD_EVEN( "tc15",         0x20000, 0x08000, 0x3a646618 )
	ROM_LOAD_ODD ( "tc13",         0x20000, 0x08000, 0xd7d1e317 )

	ROM_REGION_DISPOSE(0xac000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "tc11",         0x00000, 0x04000, 0x0a254133 )	/* chars */
	ROM_LOAD( "tc03",         0x04000, 0x04000, 0xe9e2d4b1 )
	ROM_LOAD( "tc04",         0x08000, 0x04000, 0xa599d845 )
	ROM_LOAD( "tc01",         0x0c000, 0x10000, 0x15b3991d )	/* fg tiles */
	ROM_LOAD( "tc02",         0x1c000, 0x10000, 0xd9e2e55d )
	ROM_LOAD( "tc05",         0x2c000, 0x10000, 0x8cc79357 )
	ROM_LOAD( "tc06",         0x3c000, 0x10000, 0x13daeac8 )
	ROM_LOAD( "tc07",         0x4c000, 0x08000, 0xb5d48389 )	/* bg tiles */
	ROM_LOAD( "tc08",         0x54000, 0x08000, 0x97f20fdc )
	ROM_LOAD( "tc09",         0x5c000, 0x08000, 0x170c01db )
	ROM_LOAD( "tc10",         0x64000, 0x08000, 0x44f5accd )
	ROM_LOAD( "tc20",         0x6c000, 0x10000, 0xcb4092b8 )	/* sprites */
	ROM_LOAD( "tc19",         0x7c000, 0x10000, 0x9cb8675e )
	ROM_LOAD( "tc18",         0x8c000, 0x10000, 0x806fb374 )
	ROM_LOAD( "tc17",         0x9c000, 0x10000, 0x4264bff8 )

	ROM_REGION(0x10000)     /* 32k for second CPU */
	ROM_LOAD( "tc12",         0x00000, 0x08000, 0xe37b3c44 )	/* slightly different from the other two sets */

	ROM_REGION(0x01000)     /* 4k for TI TMS320C10NL-14 Microcontroller */
	ROM_LOAD_EVEN( "tc1b",         0x0000, 0x0800, 0x1757cc33 )
	ROM_LOAD_ODD ( "tc2a",         0x0000, 0x0800, 0xd6d878c9 )
ROM_END

ROM_START( twincobu_rom )
	ROM_REGION(0x30000)	/* 3*64k for code */
	ROM_LOAD_EVEN( "tc16",         0x00000, 0x10000, 0x07f64d13 )
	ROM_LOAD_ODD ( "tc14",         0x00000, 0x10000, 0x41be6978 )
	ROM_LOAD_EVEN( "tcbra26.bin",  0x20000, 0x08000, 0xbdd00ba4 )
	ROM_LOAD_ODD ( "tcbra27.bin",  0x20000, 0x08000, 0xed600907 )

	ROM_REGION_DISPOSE(0xac000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "tc11",         0x00000, 0x04000, 0x0a254133 )	/* chars */
	ROM_LOAD( "tc03",         0x04000, 0x04000, 0xe9e2d4b1 )
	ROM_LOAD( "tc04",         0x08000, 0x04000, 0xa599d845 )
	ROM_LOAD( "tc01",         0x0c000, 0x10000, 0x15b3991d )	/* fg tiles */
	ROM_LOAD( "tc02",         0x1c000, 0x10000, 0xd9e2e55d )
	ROM_LOAD( "tc05",         0x2c000, 0x10000, 0x8cc79357 )
	ROM_LOAD( "tc06",         0x3c000, 0x10000, 0x13daeac8 )
	ROM_LOAD( "tc07",         0x4c000, 0x08000, 0xb5d48389 )	/* bg tiles */
	ROM_LOAD( "tc08",         0x54000, 0x08000, 0x97f20fdc )
	ROM_LOAD( "tc09",         0x5c000, 0x08000, 0x170c01db )
	ROM_LOAD( "tc10",         0x64000, 0x08000, 0x44f5accd )
	ROM_LOAD( "tc20",         0x6c000, 0x10000, 0xcb4092b8 )	/* sprites */
	ROM_LOAD( "tc19",         0x7c000, 0x10000, 0x9cb8675e )
	ROM_LOAD( "tc18",         0x8c000, 0x10000, 0x806fb374 )
	ROM_LOAD( "tc17",         0x9c000, 0x10000, 0x4264bff8 )

	ROM_REGION(0x10000)     /* 32k for second CPU */
	ROM_LOAD( "b30-05",       0x00000, 0x08000, 0x1a8f1e10 )

	ROM_REGION(0x01000)     /* 4k for TI TMS320C10NL-14 Microcontroller */
	ROM_LOAD_EVEN( "tc1b",         0x0000, 0x0800, 0x1757cc33 )
	ROM_LOAD_ODD ( "tc2a",         0x0000, 0x0800, 0xd6d878c9 )
ROM_END

ROM_START( ktiger_rom )
	ROM_REGION(0x30000)	/* 3*64k for code */
	ROM_LOAD_EVEN( "tc16",         0x00000, 0x10000, 0x07f64d13 )
	ROM_LOAD_ODD ( "tc14",         0x00000, 0x10000, 0x41be6978 )
	ROM_LOAD_EVEN( "b30-02",       0x20000, 0x08000, 0x1d63e9c4 )
	ROM_LOAD_ODD ( "b30-04",       0x20000, 0x08000, 0x03957a30 )

	ROM_REGION_DISPOSE(0xac000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "tc11",         0x00000, 0x04000, 0x0a254133 )	/* chars */
	ROM_LOAD( "tc03",         0x04000, 0x04000, 0xe9e2d4b1 )
	ROM_LOAD( "tc04",         0x08000, 0x04000, 0xa599d845 )
	ROM_LOAD( "tc01",         0x0c000, 0x10000, 0x15b3991d )	/* fg tiles */
	ROM_LOAD( "tc02",         0x1c000, 0x10000, 0xd9e2e55d )
	ROM_LOAD( "tc05",         0x2c000, 0x10000, 0x8cc79357 )
	ROM_LOAD( "tc06",         0x3c000, 0x10000, 0x13daeac8 )
	ROM_LOAD( "tc07",         0x4c000, 0x08000, 0xb5d48389 )	/* bg tiles */
	ROM_LOAD( "tc08",         0x54000, 0x08000, 0x97f20fdc )
	ROM_LOAD( "tc09",         0x5c000, 0x08000, 0x170c01db )
	ROM_LOAD( "tc10",         0x64000, 0x08000, 0x44f5accd )
	ROM_LOAD( "tc20",         0x6c000, 0x10000, 0xcb4092b8 )	/* sprites */
	ROM_LOAD( "tc19",         0x7c000, 0x10000, 0x9cb8675e )
	ROM_LOAD( "tc18",         0x8c000, 0x10000, 0x806fb374 )
	ROM_LOAD( "tc17",         0x9c000, 0x10000, 0x4264bff8 )

	ROM_REGION(0x10000)     /* 32k for second CPU */
	ROM_LOAD( "b30-05",       0x00000, 0x08000, 0x1a8f1e10 )

	ROM_REGION(0x01000)     /* 4k for TI TMS320C10NL-14 Microcontroller */
	ROM_LOAD_EVEN( "tc1b",         0x0000, 0x0800, 0x1757cc33 )
	ROM_LOAD_ODD ( "tc2a",         0x0000, 0x0800, 0xd6d878c9 )
ROM_END

ROM_START( fshark_rom )
	ROM_REGION(0x20000)     /* 2*64k for code */
	ROM_LOAD_EVEN( "b02_18-1.rom", 0x00000, 0x10000, 0x0 )
	ROM_LOAD_ODD ( "b02_17-1.rom", 0x00000, 0x10000, 0x0 )

	ROM_REGION_DISPOSE(0xac000)     /* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "b02_05-1.rom", 0x00000, 0x04000, 0x0 )        /* chars */
	ROM_LOAD( "b02_06-1.rom", 0x04000, 0x04000, 0x0 )
	ROM_LOAD( "b02_07-1.rom", 0x08000, 0x04000, 0x0 )
	ROM_LOAD( "b02_01.256",   0x0c000, 0x08000, 0x0 )        /* fg tiles */
	ROM_LOAD( "b02_02.256",   0x14000, 0x08000, 0x0 )
	ROM_LOAD( "b02_03.256",   0x1c000, 0x08000, 0x0 )
	ROM_LOAD( "b02_04.256",   0x24000, 0x08000, 0x0 )
	ROM_LOAD( "b02_08.rom",   0x2c000, 0x08000, 0x0 )
	ROM_LOAD( "b02_09.rom",   0x34000, 0x08000, 0x0 )
	ROM_LOAD( "b02_10.rom",   0x3c000, 0x08000, 0x0 )
	ROM_LOAD( "b02_11.rom",   0x44000, 0x08000, 0x0 )
	ROM_LOAD( "b02_12.rom",   0x4c000, 0x08000, 0x0 )        /* bg tiles */
	ROM_LOAD( "b02_13.rom",   0x54000, 0x08000, 0x0 )
	ROM_LOAD( "b02_14.rom",   0x5c000, 0x08000, 0x0 )
	ROM_LOAD( "b02_15.rom",   0x64000, 0x08000, 0x0 )
	ROM_LOAD( "b02_01.512",   0x6c000, 0x10000, 0x0 )        /* sprites */
	ROM_LOAD( "b02_02.512",   0x7c000, 0x10000, 0x0 )
	ROM_LOAD( "b02_03.512",   0x8c000, 0x10000, 0x0 )
	ROM_LOAD( "b02_04.512",   0x9c000, 0x10000, 0x0 )

	ROM_REGION(0x10000)     /* 64k for second CPU */
	ROM_LOAD( "b02_16.rom",   0x0000, 0x8000, 0x0 )
ROM_END




struct GameDriver twincobr_driver =
{
	__FILE__,
	0,
	"twincobr",
	"Twin Cobra (Taito)",
	"1987",
	"Taito",
	"Quench\nNicola Salmoria",
	GAME_NOT_WORKING,
	&machine_driver,
	0,

	twincobr_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	input_ports,

	0, 0, 0,
	ORIENTATION_ROTATE_270,
	0, 0
};

struct GameDriver twincobu_driver =
{
	__FILE__,
	&twincobr_driver,
	"twincobu",
	"Twin Cobra (Romstar)",
	"1987",
	"Taito of America (Romstar license)",
	"Quench\nNicola Salmoria",
	GAME_NOT_WORKING,
	&machine_driver,
	0,

	twincobu_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	input_ports,

	0, 0, 0,
	ORIENTATION_ROTATE_270,
	0, 0
};

/* This doesn't work yet */
struct GameDriver ktiger_driver =
{
	__FILE__,
	&twincobr_driver,
	"ktiger",
	"Kyukyoku Tiger",
	"1987",
	"Taito",
	"Quench\nNicola Salmoria",
	GAME_NOT_WORKING,
	&machine_driver,
	0,

	ktiger_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	input_ports,

	0, 0, 0,
	ORIENTATION_ROTATE_270,
	0, 0
};

struct GameDriver fshark_driver =
{
	__FILE__,
	0,
	"fshark",
	"Flying Shark",
	"????",
	"?????",
	"Quench\nNicola Salmoria",
	0,
	&machine_driver,
	0,

	fshark_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	input_ports,

	0, 0, 0,
	ORIENTATION_ROTATE_270,
	0, 0
};

⌨️ 快捷键说明

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