wc90b.c

来自「这个是延伸mame的在wince平台下的游戏模拟器的代码」· C语言 代码 · 共 503 行 · 第 1/2 页

C
503
字号
	PORT_DIPSETTING(    0x0a, "5 Coins/1 Credit" )
	PORT_DIPSETTING(    0x06, "4 Coins/1 Credit" )
	PORT_DIPSETTING(    0x0e, "3 Coins/1 Credit" )
	PORT_DIPSETTING(    0x09, "2 Coins/1 Credit" )
	PORT_DIPSETTING(    0x0f, "1 Coin/1 Credit" )
	PORT_DIPSETTING(    0x01, "2 Coins/3 Credits" )
	PORT_DIPSETTING(    0x07, "1 Coin/2 Credits" )
	PORT_DIPSETTING(    0x0b, "1 Coin/3 Credits" )
	PORT_DIPSETTING(    0x03, "1 Coin/4 Credits" )
	PORT_DIPSETTING(    0x0d, "1 Coin/5 Credits" )
	PORT_DIPSETTING(    0x05, "1 Coin/6 Credits" )
	PORT_DIPNAME( 0x30, 0x30, "Difficulty", IP_KEY_NONE )
	PORT_DIPSETTING(    0x30, "Easy" )
	PORT_DIPSETTING(    0x10, "Normal" )
	PORT_DIPSETTING(    0x20, "Hard" )
	PORT_DIPSETTING(    0x00, "Hardest" )
	PORT_DIPNAME( 0x40, 0x40, "Continue Game countdown speed", IP_KEY_NONE )
	PORT_DIPSETTING(    0x40, "Normal (1 sec per number)" )
	PORT_DIPSETTING(    0x00, "Faster (56/60 per number)" )
	PORT_DIPNAME( 0x80, 0x80, "Demo Sounds", IP_KEY_NONE )
	PORT_DIPSETTING(    0x00, "Off" )
	PORT_DIPSETTING(    0x80, "On" )

	PORT_START	/* DSWB */
	PORT_DIPNAME( 0x03, 0x03, "1 Player Game Time", IP_KEY_NONE )
	PORT_DIPSETTING(    0x01, "1:00" )
	PORT_DIPSETTING(    0x02, "1:30" )
	PORT_DIPSETTING(    0x03, "2:00" )
	PORT_DIPSETTING(    0x00, "2:30" )
	PORT_DIPNAME( 0x1c, 0x1c, "2 Player Game Time", IP_KEY_NONE )
	PORT_DIPSETTING(    0x0c, "1:00" )
	PORT_DIPSETTING(    0x14, "1:30" )
	PORT_DIPSETTING(    0x04, "2:00" )
	PORT_DIPSETTING(    0x18, "2:30" )
	PORT_DIPSETTING(    0x1c, "3:00" )
	PORT_DIPSETTING(    0x08, "3:30" )
	PORT_DIPSETTING(    0x10, "4:00" )
	PORT_DIPSETTING(    0x00, "5:00" )
	PORT_DIPNAME( 0x20, 0x20, "Unknown", IP_KEY_NONE )
	PORT_DIPSETTING(    0x20, "Off" )
	PORT_DIPSETTING(    0x00, "On" )
	PORT_DIPNAME( 0x40, 0x40, "Unknown", IP_KEY_NONE )
	PORT_DIPSETTING(    0x40, "Off" )
	PORT_DIPSETTING(    0x00, "On" )
	PORT_DIPNAME( 0x80, 0x00, "Language", IP_KEY_NONE )
	PORT_DIPSETTING(    0x00, "English" )
	PORT_DIPSETTING(    0x80, "Japanese" )
INPUT_PORTS_END

static struct GfxLayout charlayout =
{
	8,8,	/* 8*8 characters */
	2048,	/* 2048 characters */
	4,	/* 4 bits per pixel */
	{ 0, 0x4000*8, 0x8000*8, 0xc000*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 char takes 8 consecutive bytes */
};

static struct GfxLayout tilelayout =
{
	16,16,	/* 16*16 characters */
	256,	/* 256 characters */
	4,	/* 4 bits per pixel */
	{ 0, 0x20000*8, 0x40000*8, 0x60000*8 },	/* the bitplanes are separated */
	{ 0, 1, 2, 3, 4, 5, 6, 7,
		(0x1000*8)+0, (0x1000*8)+1, (0x1000*8)+2, (0x1000*8)+3, (0x1000*8)+4, (0x1000*8)+5, (0x1000*8)+6, (0x1000*8)+7 },
	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
		0x800*8, 0x800*8+1*8, 0x800*8+2*8, 0x800*8+3*8, 0x800*8+4*8, 0x800*8+5*8, 0x800*8+6*8, 0x800*8+7*8 },
	8*8	/* every char takes 8 consecutive bytes */
};

static struct GfxLayout spritelayout =
{
	16,16,	/* 32*32 characters */
	4096,	/* 1024 characters */
	4,	/* 4 bits per pixel */
	{ 0, 0x20000*8, 0x40000*8, 0x60000*8 },	/* the bitplanes are separated */
	{ 0, 1, 2, 3, 4, 5, 6, 7,
		(16*8)+0, (16*8)+1, (16*8)+2, (16*8)+3, (16*8)+4, (16*8)+5, (16*8)+6, (16*8)+7 },
	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
		8*8, 8*8+1*8, 8*8+2*8, 8*8+3*8, 8*8+4*8, 8*8+5*8, 8*8+6*8, 8*8+7*8 },
	32*8	/* every char takes 128 consecutive bytes */
};

static struct GfxDecodeInfo gfxdecodeinfo[] =
{
	{ 1, 0x00000, &charlayout,      	1*16*16, 16*16 },

	{ 1, 0x10000, &tilelayout,			2*16*16, 16*16 },
	{ 1, 0x12000, &tilelayout,			2*16*16, 16*16 },

	{ 1, 0x14000, &tilelayout,			2*16*16, 16*16 },
	{ 1, 0x16000, &tilelayout,			2*16*16, 16*16 },
	{ 1, 0x18000, &tilelayout,			2*16*16, 16*16 },
	{ 1, 0x1A000, &tilelayout,			2*16*16, 16*16 },

	{ 1, 0x1C000, &tilelayout,			2*16*16, 16*16 },
	{ 1, 0x1E000, &tilelayout,			2*16*16, 16*16 },

	{ 1, 0x20000, &tilelayout,			3*16*16, 16*16 },
	{ 1, 0x22000, &tilelayout,			3*16*16, 16*16 },

	{ 1, 0x24000, &tilelayout,			3*16*16, 16*16 },
	{ 1, 0x26000, &tilelayout,			3*16*16, 16*16 },
	{ 1, 0x28000, &tilelayout,			3*16*16, 16*16 },
	{ 1, 0x2A000, &tilelayout,			3*16*16, 16*16 },

	{ 1, 0x2C000, &tilelayout,			3*16*16, 16*16 },
	{ 1, 0x2E000, &tilelayout,			3*16*16, 16*16 },

	{ 1, 0x90000, &spritelayout,		0*16*16, 16*16 }, 
	{ -1 } /* end of array */
};



/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler(void)
{
	cpu_cause_interrupt(2,Z80_NMI_INT);
}

static struct YM2203interface ym2203_interface =
{
	2,			/* 2 chips */
	1500000,	/* 1.5 MHz ????? */
	{ YM2203_VOL(255,255), YM2203_VOL(255,255) },
	{ 0 },
	{ 0 },
	{ 0 },
	{ 0 },
	{ irqhandler }
};

static struct MachineDriver wc90b_machine_driver =
{
	/* basic machine hardware */
	{
		{
			CPU_Z80,
			6000000,	/* 6.0 Mhz ??? */
			0,
			wc90b_readmem1, wc90b_writemem1,0,0,
			interrupt,1
		},
		{
			CPU_Z80,
			6000000,	/* 6.0 Mhz ??? */
			2,
			wc90b_readmem2, wc90b_writemem2,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 YM2203 */
								/* IRQs are triggered by the main CPU */
		}

	},
	60, DEFAULT_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,
	4*16*16, 4*16*16,
	0,

	VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
	0,
	wc90b_vh_start,
	wc90b_vh_stop,
	wc90b_vh_screenrefresh,

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

ROM_START( wc90b_rom )
	ROM_REGION(0x20000)	/* 128k for code */
	ROM_LOAD( "a02.bin",      0x00000, 0x10000, 0x192a03dd )	/* c000-ffff is not used */
	ROM_LOAD( "a03.bin",      0x10000, 0x10000, 0xf54ff17a )	/* banked at f000-f7ff */

	ROM_REGION_DISPOSE(0x110000)	/* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "a06.bin",      0x00000, 0x04000, 0x3b5387b7 )
	ROM_LOAD( "a08.bin",      0x04000, 0x04000, 0xc622a5a3 )
	ROM_LOAD( "a10.bin",      0x08000, 0x04000, 0x0923d9f6 )
	ROM_LOAD( "a20.bin",      0x0C000, 0x04000, 0xb8dec83e )

	ROM_LOAD( "a07.bin",      0x10000, 0x20000, 0x38c31817 )
	ROM_LOAD( "a09.bin",      0x30000, 0x20000, 0x32e39e29 )
	ROM_LOAD( "a11.bin",      0x50000, 0x20000, 0x5ccec796 )
	ROM_LOAD( "a21.bin",      0x70000, 0x20000, 0x0c54a091 )

	ROM_LOAD( "146_a12.bin",  0x090000, 0x10000, 0xd5a60096 )
	ROM_LOAD( "147_a13.bin",  0x0a0000, 0x10000, 0x36bbf467 )
	ROM_LOAD( "148_a14.bin",  0x0b0000, 0x10000, 0x26371c18 )
	ROM_LOAD( "149_a15.bin",  0x0c0000, 0x10000, 0x75aa9b86 )
	ROM_LOAD( "150_a16.bin",  0x0d0000, 0x10000, 0x0da825f9 )
	ROM_LOAD( "151_a17.bin",  0x0e0000, 0x10000, 0x228429d8 )
	ROM_LOAD( "152_a18.bin",  0x0f0000, 0x10000, 0x516b6c09 )
	ROM_LOAD( "153_a19.bin",  0x100000, 0x10000, 0xf36390a9 )

	ROM_REGION(0x20000)	/* 96k for code */  /* Second CPU */
	ROM_LOAD( "a04.bin",      0x00000, 0x10000, 0x3d535e2f )	/* c000-ffff is not used */
	ROM_LOAD( "a05.bin",      0x10000, 0x10000, 0x9e421c4b )	/* banked at f000-f7ff */

	ROM_REGION(0x10000)	/* 192k for the audio CPU */
	ROM_LOAD( "a01.bin",      0x00000, 0x10000, 0x3d317622 )
ROM_END


extern struct GameDriver wc90_driver;
struct GameDriver wc90b_driver =
{
	__FILE__,
	&wc90_driver,
	"wc90b",
	"World Cup 90 (bootleg)",
	"1989",
	"bootleg",
    "Ernesto Corvi",
	0,
	&wc90b_machine_driver,
	0,

	wc90b_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	wc90b_input_ports,

	0, 0, 0,
	ORIENTATION_DEFAULT,

	0, 0
};

⌨️ 快捷键说明

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