added alpha_8201_device to champbas.c

Now champbb2j that previously locked up at boot is also playable
(FWIW exctscc2 http://mametesters.org/view.php?id=5026 still happens)
This commit is contained in:
hap 2015-11-02 18:05:07 +01:00
parent 10a15314fe
commit 57132586d5
3 changed files with 47 additions and 60 deletions

View File

@ -72,8 +72,6 @@ Notes:
TODO:
-----
- champbb2, sometime mcu err and ACCESS VIOLATION trap.
- Exciting Soccer: interrupt source for sound CPU is unknown.
- Exciting Soccer: sound CPU writes to unknown ports on startup. Timer configure?
@ -84,10 +82,7 @@ TODO:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/alph8201/alph8201.h"
//#include "cpu/hmcs40/hmcs40.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "includes/champbas.h"
@ -127,6 +122,7 @@ WRITE8_MEMBER(champbas_state::dac2_w)
}
/*************************************
*
* Protection handling
@ -136,20 +132,14 @@ WRITE8_MEMBER(champbas_state::dac2_w)
WRITE8_MEMBER(champbas_state::mcu_switch_w)
{
// switch shared RAM between CPU and MCU bus
// FIXME not implemented
m_alpha_8201->bus_dir_w(data & 1);
}
WRITE8_MEMBER(champbas_state::mcu_halt_w)
WRITE8_MEMBER(champbas_state::mcu_start_w)
{
// MCU not present/not used in champbas
if (m_mcu == NULL)
return;
data &= 1;
m_mcu->set_input_line(INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE);
m_alpha_8201->mcu_start_w(data & 1);
}
/* champbja another protection */
READ8_MEMBER(champbas_state::champbja_protection_r)
{
@ -185,6 +175,7 @@ READ8_MEMBER(champbas_state::champbja_protection_r)
}
/*************************************
*
* Address maps
@ -216,14 +207,13 @@ static ADDRESS_MAP_START( champbas_map, AS_PROGRAM, 8, champbas_state )
AM_RANGE(0xa060, 0xa06f) AM_WRITEONLY AM_SHARE("spriteram")
AM_RANGE(0xa080, 0xa080) AM_WRITE(soundlatch_byte_w)
// AM_RANGE(0xa0a0, 0xa0a0) AM_NOP // ?
AM_RANGE(0xa0c0, 0xa0c0) AM_WRITE(watchdog_reset_w)
ADDRESS_MAP_END
// base map + ALPHA-8x0x protection
static ADDRESS_MAP_START( champbasj_map, AS_PROGRAM, 8, champbas_state )
AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE("share1")
AM_RANGE(0xa006, 0xa006) AM_WRITE(mcu_halt_w)
AM_RANGE(0x6000, 0x63ff) AM_DEVREADWRITE("alpha_8201", alpha_8201_device, ext_ram_r, ext_ram_w)
AM_RANGE(0xa006, 0xa006) AM_WRITE(mcu_start_w)
AM_RANGE(0xa007, 0xa007) AM_WRITE(mcu_switch_w)
AM_IMPORT_FROM( champbas_map )
ADDRESS_MAP_END
@ -256,6 +246,13 @@ static ADDRESS_MAP_START( exctsccr_map, AS_PROGRAM, 8, champbas_state )
AM_IMPORT_FROM( champbasj_map )
ADDRESS_MAP_END
// exctsccrb
static ADDRESS_MAP_START( exctsccrb_map, AS_PROGRAM, 8, champbas_state )
AM_RANGE(0xa004, 0xa004) AM_WRITENOP // no palettebank
AM_RANGE(0xa040, 0xa04f) AM_WRITEONLY AM_SHARE("spriteram2")
AM_IMPORT_FROM( champbasj_map )
ADDRESS_MAP_END
// audiocpu
@ -277,7 +274,7 @@ static ADDRESS_MAP_START( exctsccr_sound_map, AS_PROGRAM, 8, champbas_state )
AM_RANGE(0xc009, 0xc009) AM_WRITE(dac2_w)
AM_RANGE(0xc00c, 0xc00c) AM_WRITE(soundlatch_clear_byte_w)
AM_RANGE(0xc00d, 0xc00d) AM_READ(soundlatch_byte_r)
// AM_RANGE(0xc00f, 0xc00f) AM_NOP // ?
// AM_RANGE(0xc00f, 0xc00f) AM_WRITENOP // ?
ADDRESS_MAP_END
static ADDRESS_MAP_START( exctsccr_sound_io_map, AS_IO, 8, champbas_state )
@ -290,11 +287,6 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, champbas_state )
AM_RANGE(0x0000, 0x03ff) AM_RAM AM_SHARE("share1") /* main CPU shared RAM */
ADDRESS_MAP_END
/*************************************
*
* Input ports
@ -532,8 +524,8 @@ static MACHINE_CONFIG_START( talbot, champbas_state )
MCFG_CPU_PROGRAM_MAP(talbot_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", champbas_state, vblank_irq)
MCFG_CPU_ADD("mcu", ALPHA8201L, XTAL_18_432MHz/6/8)
MCFG_CPU_PROGRAM_MAP(mcu_map)
MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, XTAL_18_432MHz/6/8)
MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu")
MCFG_WATCHDOG_VBLANK_INIT(0x10)
@ -600,12 +592,8 @@ static MACHINE_CONFIG_DERIVED( champbasj, champbas )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(champbasj_map)
/* MCU */
MCFG_CPU_ADD("mcu", ALPHA8201L, XTAL_18_432MHz/6/8)
MCFG_CPU_PROGRAM_MAP(mcu_map)
/* to MCU timeout champbbj */
MCFG_QUANTUM_TIME(attotime::from_hz(3000))
MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, XTAL_18_432MHz/6/8) // note: 8302 rom on champbb2 (same device!)
MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( champbasja, champbas )
@ -638,9 +626,8 @@ static MACHINE_CONFIG_START( exctsccr, champbas_state )
MCFG_TIMER_DRIVER_ADD_PERIODIC("exc_snd_irq", champbas_state, exctsccr_sound_irq, attotime::from_hz(75)) // irq source unknown, determines music tempo
MCFG_TIMER_START_DELAY(attotime::from_hz(75))
/* MCU */
MCFG_CPU_ADD("mcu", ALPHA8301L, XTAL_18_432MHz/6/8) /* Actually 8302 */
MCFG_CPU_PROGRAM_MAP(mcu_map)
MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, XTAL_18_432MHz/6/8) // note: 8302 rom, or 8303 on exctscc2 (same device!)
MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu")
MCFG_WATCHDOG_VBLANK_INIT(0x10)
@ -686,12 +673,15 @@ static MACHINE_CONFIG_START( exctsccrb, champbas_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6)
MCFG_CPU_PROGRAM_MAP(exctsccr_map)
MCFG_CPU_PROGRAM_MAP(exctsccrb_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", champbas_state, vblank_irq)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_18_432MHz/6)
MCFG_CPU_PROGRAM_MAP(champbas_sound_map)
MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, XTAL_18_432MHz/6/8) // champbasj 8201 on pcb, though unused
MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu")
MCFG_WATCHDOG_VBLANK_INIT(0x10)
/* video hardware */
@ -735,7 +725,7 @@ ROM_START( talbot )
ROM_LOAD( "15.10i", 0x4000, 0x1000, CRC(0225b7ef) SHA1(9adee4831eb633b0a31580596205a655df94c2b2) )
ROM_LOAD( "16.11i", 0x5000, 0x1000, CRC(1612adf5) SHA1(9adeb21d5d1692f6e31460062f03f2008076b307) )
ROM_REGION( 0x2000, "mcu", 0 )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
ROM_LOAD( "alpha-8201_44801a75_2f25.bin", 0x0000, 0x2000, CRC(b77931ac) SHA1(405b02585e80d95a2821455538c5c2c31ce262d1) )
ROM_REGION( 0x1000, "gfx1", 0 ) // chars
@ -782,7 +772,7 @@ ROM_START( champbasj )
ROM_LOAD( "17.2l", 0x2000, 0x2000, CRC(f10b148b) SHA1(d66516d509f6f16e51ee59d27c4867e276064c3f) )
ROM_LOAD( "18.2n", 0x4000, 0x2000, CRC(2dc484dd) SHA1(28bd68c787d7e6989849ca52009948dbd5cdcc79) )
ROM_REGION( 0x2000, "mcu", 0 )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
ROM_LOAD( "alpha-8201_44801a75_2f25.bin", 0x0000, 0x2000, CRC(b77931ac) SHA1(405b02585e80d95a2821455538c5c2c31ce262d1) )
ROM_REGION( 0x2000, "gfx1", 0 ) // chars + sprites: rearranged by DRIVER_INIT to leave only chars
@ -831,7 +821,7 @@ ROM_START( champbb2 )
ROM_LOAD( "epr5935", 0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
// the pcb has a 8302 on it, though only the 8201 instructions are used
ROM_REGION( 0x2000, "mcu", 0 )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
ROM_LOAD( "alpha-8302_44801b35.bin", 0x0000, 0x2000, CRC(edabac6c) SHA1(eaf1c51b63023256df526b0d3fd53cffc919c901) )
ROM_REGION( 0x2000, "gfx1", 0 ) // chars + sprites: rearranged by DRIVER_INIT to leave only chars
@ -859,7 +849,7 @@ ROM_START( champbb2a )
ROM_LOAD( "epr5935", 0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
// the pcb has a 8302 on it, though only the 8201 instructions are used
ROM_REGION( 0x2000, "mcu", 0 )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
ROM_LOAD( "alpha-8302_44801b35.bin", 0x0000, 0x2000, CRC(edabac6c) SHA1(eaf1c51b63023256df526b0d3fd53cffc919c901) )
ROM_REGION( 0x2000, "gfx1", 0 ) // chars + sprites: rearranged by DRIVER_INIT to leave only chars
@ -887,7 +877,7 @@ ROM_START( champbb2j )
ROM_LOAD( "8.15e", 0x4000, 0x2000, CRC(2dc484dd) SHA1(28bd68c787d7e6989849ca52009948dbd5cdcc79) )
// the pcb has a 8302 on it, though only the 8201 instructions are used
ROM_REGION( 0x2000, "mcu", 0 )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
ROM_LOAD( "alpha-8302_44801b35.bin", 0x0000, 0x2000, CRC(edabac6c) SHA1(eaf1c51b63023256df526b0d3fd53cffc919c901) )
ROM_REGION( 0x2000, "gfx1", 0 ) // chars + sprites: rearranged by DRIVER_INIT to leave only chars
@ -914,7 +904,7 @@ ROM_START( exctsccr ) /* Teams: ITA AUS GBR FRA FRG BRA */
ROM_LOAD( "7_c6.bin", 0x6000, 0x2000, CRC(6d51521e) SHA1(2809bd2e61f40dcd31d43c62520982bdcfb0a865) )
ROM_LOAD( "1_a6.bin", 0x8000, 0x1000, CRC(20f2207e) SHA1(b1ed2237d0bd50ddbe593fd2fbff9f1d67c1eb11) )
ROM_REGION( 0x2000, "mcu", 0 )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
ROM_LOAD( "alpha-8302_44801b35.bin", 0x0000, 0x2000, CRC(edabac6c) SHA1(eaf1c51b63023256df526b0d3fd53cffc919c901) )
ROM_REGION( 0x04000, "gfx1", 0 ) // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only chars
@ -947,7 +937,7 @@ ROM_START( exctsccra ) /* Teams: ITA AUS GBR FRA FRG BRA */
ROM_LOAD( "7_c6.bin", 0x6000, 0x2000, CRC(6d51521e) SHA1(2809bd2e61f40dcd31d43c62520982bdcfb0a865) )
ROM_LOAD( "1_a6.bin", 0x8000, 0x1000, CRC(20f2207e) SHA1(b1ed2237d0bd50ddbe593fd2fbff9f1d67c1eb11) )
ROM_REGION( 0x2000, "mcu", 0 )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
ROM_LOAD( "alpha-8302_44801b35.bin", 0x0000, 0x2000, CRC(edabac6c) SHA1(eaf1c51b63023256df526b0d3fd53cffc919c901) )
ROM_REGION( 0x04000, "gfx1", 0 ) // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only chars
@ -980,7 +970,7 @@ ROM_START( exctsccru ) /* Teams: ITA USA GBR FRA FRG BRA */
ROM_LOAD( "7_c6.bin", 0x6000, 0x2000, CRC(6d51521e) SHA1(2809bd2e61f40dcd31d43c62520982bdcfb0a865) )
ROM_LOAD( "1_a6.bin", 0x8000, 0x1000, CRC(20f2207e) SHA1(b1ed2237d0bd50ddbe593fd2fbff9f1d67c1eb11) )
ROM_REGION( 0x2000, "mcu", 0 )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
ROM_LOAD( "alpha-8302_44801b35.bin", 0x0000, 0x2000, CRC(edabac6c) SHA1(eaf1c51b63023256df526b0d3fd53cffc919c901) )
ROM_REGION( 0x04000, "gfx1", 0 ) // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only chars
@ -1013,7 +1003,7 @@ ROM_START( exctsccrj ) /* Teams: JPN USA GBR FRA FRG BRA */
ROM_LOAD( "7_c6.bin", 0x6000, 0x2000, CRC(6d51521e) SHA1(2809bd2e61f40dcd31d43c62520982bdcfb0a865) )
ROM_LOAD( "1_a6.bin", 0x8000, 0x1000, CRC(20f2207e) SHA1(b1ed2237d0bd50ddbe593fd2fbff9f1d67c1eb11) )
ROM_REGION( 0x2000, "mcu", 0 )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
ROM_LOAD( "alpha-8302_44801b35.bin", 0x0000, 0x2000, CRC(edabac6c) SHA1(eaf1c51b63023256df526b0d3fd53cffc919c901) )
ROM_REGION( 0x04000, "gfx1", 0 ) // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only chars
@ -1045,7 +1035,7 @@ ROM_START( exctsccrjo ) /* Teams: JPN USA ENG FRA GFR BRA */
ROM_LOAD( "8.6d", 0x4000, 0x2000, CRC(b6b209a5) SHA1(e49a0db65b29337ac6b919237067b1990f2233ab) )
ROM_LOAD( "7.6c", 0x6000, 0x2000, CRC(8856452a) SHA1(4494c225c9df97da09c180caadb4dda49d0d5392) )
ROM_REGION( 0x2000, "mcu", 0 )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
ROM_LOAD( "alpha-8302_44801b35.bin", 0x0000, 0x2000, CRC(edabac6c) SHA1(eaf1c51b63023256df526b0d3fd53cffc919c901) )
ROM_REGION( 0x04000, "gfx1", 0 ) // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only chars
@ -1093,7 +1083,7 @@ ROM_START( exctsccrb )
ROM_LOAD( "es-b.l2", 0x2000, 0x2000, CRC(8b3db794) SHA1(dbfed2357c7631bfca6bbd63a23617bc3abf6ca3) )
ROM_LOAD( "es-c.m2", 0x4000, 0x2000, CRC(7bed2f81) SHA1(cbbb0480519cc04a99e8983228b18c9e49a9985d) )
ROM_REGION( 0x2000, "mcu", 0 )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
ROM_LOAD( "alpha-8201_44801a75_2f25.bin", 0x0000, 0x2000, CRC(b77931ac) SHA1(405b02585e80d95a2821455538c5c2c31ce262d1) )
/* the national flags are wrong. This happens on the real board */
@ -1127,7 +1117,7 @@ ROM_START( exctscc2 )
ROM_LOAD( "7_c6.bin", 0x6000, 0x2000, CRC(6d51521e) SHA1(2809bd2e61f40dcd31d43c62520982bdcfb0a865) ) /* vr.7h */
ROM_LOAD( "1_a6.bin", 0x8000, 0x1000, CRC(20f2207e) SHA1(b1ed2237d0bd50ddbe593fd2fbff9f1d67c1eb11) ) /* vr.7k */
ROM_REGION( 0x2000, "mcu", 0 )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
ROM_LOAD( "alpha-8303_44801b42.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
ROM_REGION( 0x04000, "gfx1", 0 ) // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only chars
@ -1210,9 +1200,9 @@ GAME( 1982, talbot, 0, talbot, talbot, driver_device, 0,
GAME( 1983, champbas, 0, champbas, champbas, champbas_state, champbas, ROT0, "Alpha Denshi Co. (Sega license)", "Champion Base Ball", MACHINE_SUPPORTS_SAVE )
GAME( 1983, champbasj, champbas, champbasj, champbas, champbas_state, champbas, ROT0, "Alpha Denshi Co.", "Champion Base Ball (Japan set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1983, champbasja, champbas, champbasja, champbas, champbas_state, champbas, ROT0, "Alpha Denshi Co.", "Champion Base Ball (Japan set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1983, champbb2, 0, champbb2, champbas, champbas_state, champbas, ROT0, "Alpha Denshi Co. (Sega license)", "Champion Base Ball Part-2: Pair Play (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1983, champbb2a, champbb2, champbb2, champbas, champbas_state, champbas, ROT0, "Alpha Denshi Co.", "Champion Baseball II (set 2)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // no dump
GAME( 1983, champbb2j, champbb2, champbb2, champbas, champbas_state, champbas, ROT0, "Alpha Denshi Co.", "Champion Baseball II (Japan)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 1983, champbb2, 0, champbb2, champbas, champbas_state, champbas, ROT0, "Alpha Denshi Co. (Sega license)", "Champion Base Ball Part-2 (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1983, champbb2a, champbb2, champbb2, champbas, champbas_state, champbas, ROT0, "Alpha Denshi Co.", "Champion Base Ball Part-2 (set 2)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // incomplete dump
GAME( 1983, champbb2j, champbb2, champbb2, champbas, champbas_state, champbas, ROT0, "Alpha Denshi Co.", "Champion Base Ball Part-2 (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1983, exctsccr, 0, exctsccr, exctsccr, champbas_state, exctsccr, ROT270, "Alpha Denshi Co.", "Exciting Soccer", MACHINE_SUPPORTS_SAVE )
GAME( 1983, exctsccru, exctsccr, exctsccr, exctsccr, champbas_state, exctsccr, ROT270, "Alpha Denshi Co.", "Exciting Soccer (US)", MACHINE_SUPPORTS_SAVE )

View File

@ -6,6 +6,7 @@
*************************************************************************/
#include "machine/alpha8201.h"
#include "sound/dac.h"
@ -16,7 +17,7 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_mcu(*this, "mcu"),
m_alpha_8201(*this, "alpha_8201"),
m_dac1(*this, "dac1"),
m_dac2(*this, "dac2"),
m_gfxdecode(*this, "gfxdecode"),
@ -30,7 +31,7 @@ public:
// devices, memory pointers
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
optional_device<cpu_device> m_mcu;
optional_device<alpha_8201_device> m_alpha_8201;
optional_device<dac_device> m_dac1;
optional_device<dac_device> m_dac2;
required_device<gfxdecode_device> m_gfxdecode;
@ -51,7 +52,7 @@ public:
DECLARE_WRITE8_MEMBER(irq_enable_w);
DECLARE_WRITE8_MEMBER(mcu_switch_w);
DECLARE_WRITE8_MEMBER(mcu_halt_w);
DECLARE_WRITE8_MEMBER(mcu_start_w);
DECLARE_READ8_MEMBER(champbja_protection_r);
DECLARE_WRITE8_MEMBER(tilemap_w);
DECLARE_WRITE8_MEMBER(gfxbank_w);

View File

@ -418,16 +418,12 @@ WRITE_LINE_MEMBER(alpha_8201_device::mcu_start_w)
READ8_MEMBER(alpha_8201_device::ext_ram_r)
{
if (m_bus)
logerror("%s: EXT side read bus conflict\n", tag());
// going by exctsccr, m_bus has no effect here
return m_shared_ram[offset & 0x3ff];
}
WRITE8_MEMBER(alpha_8201_device::ext_ram_w)
{
if (!m_bus)
m_shared_ram[offset & 0x3ff] = data;
else
logerror("%s: EXT side write bus conflict\n", tag());
// going by exctsccr, m_bus has no effect here
m_shared_ram[offset & 0x3ff] = data;
}