From 6e6eea1bc99ad02a16649f2ad4a58a36aaf62d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Banaan=20Ananas?= Date: Thu, 23 Aug 2012 12:12:19 +0000 Subject: [PATCH] z80 r16491 for msx.c --- src/emu/cpu/z80/z80.c | 18 ++++++++++++------ src/mess/drivers/msx.c | 16 ++++++++-------- src/mess/machine/msx.c | 40 ++++++++++++++++++++-------------------- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/src/emu/cpu/z80/z80.c b/src/emu/cpu/z80/z80.c index ea4d4e852da..b3a127c1c41 100644 --- a/src/emu/cpu/z80/z80.c +++ b/src/emu/cpu/z80/z80.c @@ -261,7 +261,8 @@ static const UINT8 cc_op[0x100] = { 5,10,10,10,10,11, 7,11, 5,10,10, 0,10,17, 7,11, /* cb -> cc_cb */ 5,10,10,11,10,11, 7,11, 5, 4,10,11,10, 0, 7,11, /* dd -> cc_xy */ 5,10,10,19,10,11, 7,11, 5, 4,10, 4,10, 0, 7,11, /* ed -> cc_ed */ - 5,10,10, 4,10,11, 7,11, 5, 6,10, 4,10, 0, 7,11}; /* fd -> cc_xy */ + 5,10,10, 4,10,11, 7,11, 5, 6,10, 4,10, 0, 7,11 /* fd -> cc_xy */ +}; static const UINT8 cc_cb[0x100] = { 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, @@ -279,7 +280,8 @@ static const UINT8 cc_cb[0x100] = { 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8}; + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8 +}; static const UINT8 cc_ed[0x100] = { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, @@ -297,7 +299,8 @@ static const UINT8 cc_ed[0x100] = { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8}; + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 +}; /* ix/iy: with the exception of (i+offset) opcodes, t-states are main_opcode_table + 4 */ static const UINT8 cc_xy[0x100] = { @@ -316,7 +319,8 @@ static const UINT8 cc_xy[0x100] = { 5+4,10+4,10+4,10+4,10+4,11+4, 7+4,11+4, 5+4,10+4,10+4, 0 ,10+4,17+4, 7+4,11+4, /* cb -> cc_xycb */ 5+4,10+4,10+4,11+4,10+4,11+4, 7+4,11+4, 5+4, 4+4,10+4,11+4,10+4, 4+4, 7+4,11+4, 5+4,10+4,10+4,19+4,10+4,11+4, 7+4,11+4, 5+4, 4+4,10+4, 4+4,10+4, 4+4, 7+4,11+4, - 5+4,10+4,10+4, 4+4,10+4,11+4, 7+4,11+4, 5+4, 6+4,10+4, 4+4,10+4, 4+4, 7+4,11+4}; + 5+4,10+4,10+4, 4+4,10+4,11+4, 7+4,11+4, 5+4, 6+4,10+4, 4+4,10+4, 4+4, 7+4,11+4 +}; static const UINT8 cc_xycb[0x100] = { 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, @@ -334,7 +338,8 @@ static const UINT8 cc_xycb[0x100] = { 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23}; +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23 +}; /* extra cycles if jr/jp/call taken and 'interrupt latency' on rst 0-7 */ static const UINT8 cc_ex[0x100] = { @@ -353,7 +358,8 @@ static const UINT8 cc_ex[0x100] = { 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, - 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2}; + 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2 +}; #define cc_dd cc_xy #define cc_fd cc_xy diff --git a/src/mess/drivers/msx.c b/src/mess/drivers/msx.c index a2c6b1051e2..4ec5567dae9 100644 --- a/src/mess/drivers/msx.c +++ b/src/mess/drivers/msx.c @@ -1066,7 +1066,7 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_START( msx, msx_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", Z80, 3579545) /* 3.579545 MHz */ + MCFG_CPU_ADD("maincpu", Z80, XTAL_10_738635MHz/3) /* 3.579545 MHz */ MCFG_CPU_PROGRAM_MAP(msx_memory_map) MCFG_CPU_IO_MAP(msx_io_map) MCFG_CPU_VBLANK_INT("screen", msx_interrupt) /* Needed for mouse updates */ @@ -1083,12 +1083,12 @@ static MACHINE_CONFIG_START( msx, msx_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("ay8910", AY8910, 1789773) + MCFG_SOUND_ADD("ay8910", AY8910, XTAL_10_738635MHz/3/2) MCFG_SOUND_CONFIG(msx_ay8910_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) - MCFG_SOUND_ADD("k051649", K051649, 1789773) + MCFG_SOUND_ADD("k051649", K051649, XTAL_10_738635MHz/3/2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("ym2413", YM2413, 3579545) + MCFG_SOUND_ADD("ym2413", YM2413, XTAL_10_738635MHz/3) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) /* printer */ @@ -1145,7 +1145,7 @@ static RP5C01_INTERFACE( rtc_intf ) static MACHINE_CONFIG_START( msx2, msx_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", Z80, 3579545) /* 3.579545 MHz */ + MCFG_CPU_ADD("maincpu", Z80, XTAL_21_4772MHz/6) /* 3.579545 MHz */ MCFG_CPU_PROGRAM_MAP(msx_memory_map) MCFG_CPU_IO_MAP(msx2_io_map) MCFG_TIMER_ADD_SCANLINE("scantimer", msx2_interrupt, "screen", 0, 1) @@ -1177,12 +1177,12 @@ static MACHINE_CONFIG_START( msx2, msx_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("ay8910", AY8910, 1789773) + MCFG_SOUND_ADD("ay8910", AY8910, XTAL_21_4772MHz/6/2) MCFG_SOUND_CONFIG(msx_ay8910_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) - MCFG_SOUND_ADD("k051649", K051649, 1789773) + MCFG_SOUND_ADD("k051649", K051649, XTAL_21_4772MHz/6/2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("ym2413", YM2413, 3579545) + MCFG_SOUND_ADD("ym2413", YM2413, XTAL_21_4772MHz/6) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) /* printer */ diff --git a/src/mess/machine/msx.c b/src/mess/machine/msx.c index 3b9a0ed6eea..dbfd059ef9c 100644 --- a/src/mess/machine/msx.c +++ b/src/mess/machine/msx.c @@ -415,10 +415,10 @@ static const UINT8 cc_op[0x100] = { 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 7+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 7+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 7+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 7+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 7+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 7+1, 4+1, - 5+1,10+1,10+1,10+1,10+1,11+1, 7+1,11+1, 5+1,10+1,10+1, 0+0,10+1,17+1, 7+1,11+1, - 5+1,10+1,10+1,11+1,10+1,11+1, 7+1,11+1, 5+1, 4+1,10+1,11+1,10+1, 0+0, 7+1,11+1, - 5+1,10+1,10+1,19+1,10+1,11+1, 7+1,11+1, 5+1, 4+1,10+1, 4+1,10+1, 0+0, 7+1,11+1, - 5+1,10+1,10+1, 4+1,10+1,11+1, 7+1,11+1, 5+1, 6+1,10+1, 4+1,10+1, 0+0, 7+1,11+1 + 5+1,10+1,10+1,10+1,10+1,11+1, 7+1,11+1, 5+1,10+1,10+1, 0 ,10+1,17+1, 7+1,11+1, + 5+1,10+1,10+1,11+1,10+1,11+1, 7+1,11+1, 5+1, 4+1,10+1,11+1,10+1, 0 , 7+1,11+1, + 5+1,10+1,10+1,19+1,10+1,11+1, 7+1,11+1, 5+1, 4+1,10+1, 4+1,10+1, 0 , 7+1,11+1, + 5+1,10+1,10+1, 4+1,10+1,11+1, 7+1,11+1, 5+1, 6+1,10+1, 4+1,10+1, 0 , 7+1,11+1 }; static const UINT8 cc_cb[0x100] = { @@ -460,22 +460,22 @@ static const UINT8 cc_ed[0x100] = { }; static const UINT8 cc_xy[0x100] = { - 4+2, 4+2, 4+2, 4+2, 4+2, 4+2, 4+2, 4+2, 4+2,15+2, 4+2, 4+2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