de_2: Made CPU board a device, and hooked it up to all drivers in de_2.c.

This commit is contained in:
mahlemiut 2013-07-20 09:23:15 +00:00
parent bdec93724a
commit d2405e2145
5 changed files with 844 additions and 239 deletions

2
.gitattributes vendored
View File

@ -5010,6 +5010,8 @@ src/mame/machine/decocpu6.h svneol=native#text/plain
src/mame/machine/decocpu7.c svneol=native#text/plain
src/mame/machine/decocpu7.h svneol=native#text/plain
src/mame/machine/decocrpt.c svneol=native#text/plain
src/mame/machine/decopincpu.c svneol=native#text/plain
src/mame/machine/decopincpu.h svneol=native#text/plain
src/mame/machine/docastle.c svneol=native#text/plain
src/mame/machine/fd1089.c svneol=native#text/plain
src/mame/machine/fd1089.h svneol=native#text/plain

View File

@ -11,6 +11,7 @@
#include "machine/genpin.h"
#include "cpu/m6800/m6800.h"
#include "cpu/m6809/m6809.h"
#include "machine/decopincpu.h"
#include "machine/6821pia.h"
#include "sound/2151intf.h"
#include "sound/msm5205.h"
@ -40,14 +41,7 @@ class de_2_state : public genpin_class
public:
de_2_state(const machine_config &mconfig, device_type type, const char *tag)
: genpin_class(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_ym2151(*this, "ym2151"),
m_pia21(*this, "pia21"),
m_pia24(*this, "pia24"),
m_pia28(*this, "pia28"),
m_pia2c(*this, "pia2c"),
m_pia30(*this, "pia30"),
m_pia34(*this, "pia34"),
m_audiocpu(*this, "audiocpu"),
m_msm5205(*this, "msm5205"),
m_sample_bank(*this, "sample_bank")
@ -56,18 +50,7 @@ public:
protected:
// devices
required_device<cpu_device> m_maincpu;
required_device<ym2151_device> m_ym2151;
required_device<pia6821_device> m_pia21;
required_device<pia6821_device> m_pia24;
required_device<pia6821_device> m_pia28;
required_device<pia6821_device> m_pia2c;
required_device<pia6821_device> m_pia30;
required_device<pia6821_device> m_pia34;
// driver_device overrides
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
static const device_timer_id TIMER_IRQ = 0;
public:
DECLARE_DRIVER_INIT(de_2);
@ -75,6 +58,8 @@ public:
DECLARE_MACHINE_RESET(de_2_alpha3);
DECLARE_WRITE8_MEMBER(sample_w);
DECLARE_WRITE8_MEMBER(pia34_pa_w);
DECLARE_WRITE8_MEMBER(type2alpha3_pia34_pa_w);
DECLARE_WRITE8_MEMBER(alpha3_pia34_pa_w);
DECLARE_READ8_MEMBER(switch_r);
DECLARE_WRITE8_MEMBER(switch_w);
DECLARE_WRITE8_MEMBER(pia2c_pa_w);
@ -84,6 +69,8 @@ public:
DECLARE_READ8_MEMBER(pia28_w7_r);
DECLARE_WRITE8_MEMBER(dig0_w);
DECLARE_WRITE8_MEMBER(dig1_w);
DECLARE_WRITE8_MEMBER(type2alpha3_dig1_w);
DECLARE_WRITE8_MEMBER(alpha3_dig1_w);
DECLARE_WRITE8_MEMBER(lamp0_w);
DECLARE_WRITE8_MEMBER(lamp1_w) { };
DECLARE_WRITE_LINE_MEMBER(ym2151_irq_w);
@ -99,13 +86,19 @@ public:
DECLARE_READ8_MEMBER(sound_latch_r);
DECLARE_WRITE8_MEMBER(sample_bank_w);
// devcb2 callbacks
DECLARE_READ8_MEMBER(display_r);
DECLARE_WRITE8_MEMBER(display_w);
DECLARE_WRITE8_MEMBER(type2alpha3_display_w);
DECLARE_WRITE8_MEMBER(alpha3_display_w);
DECLARE_WRITE8_MEMBER(lamps_w);
required_device<cpu_device> m_audiocpu;
required_device<msm5205_device> m_msm5205;
required_memory_bank m_sample_bank;
UINT8 m_sample_data;
bool m_more_data;
bool m_nmi_enable;
bool m_is_alpha3;
private:
UINT32 m_segment1;
@ -114,15 +107,13 @@ private:
UINT8 m_kbdrow;
UINT8 m_diag;
bool m_ca1;
emu_timer* m_irq_timer;
bool m_irq_active;
UINT8 m_sound_data;
UINT8 m_sample_bank_num;
UINT8 m_msm_prescaler;
};
static ADDRESS_MAP_START( de_2_map, AS_PROGRAM, 8, de_2_state )
/*static ADDRESS_MAP_START( de_2_map, AS_PROGRAM, 8, de_2_state )
AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x2100, 0x2103) AM_DEVREADWRITE("pia21", pia6821_device, read, write) // sound+solenoids
AM_RANGE(0x2200, 0x2200) AM_WRITE(sol3_w) // solenoids
@ -133,7 +124,7 @@ static ADDRESS_MAP_START( de_2_map, AS_PROGRAM, 8, de_2_state )
AM_RANGE(0x3400, 0x3403) AM_DEVREADWRITE("pia34", pia6821_device, read, write) // widget
AM_RANGE(0x4000, 0xffff) AM_ROM
ADDRESS_MAP_END
*/
static ADDRESS_MAP_START( de_2_audio_map, AS_PROGRAM, 8, de_2_state )
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
@ -217,62 +208,18 @@ static INPUT_PORTS_START( de_2 )
PORT_START("INP80")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DIAGS")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Audio Diag") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, de_2_state, audio_nmi, 1)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Main Diag") PORT_CODE(KEYCODE_F2) PORT_CHANGED_MEMBER(DEVICE_SELF, de_2_state, main_nmi, 1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Advance") PORT_CODE(KEYCODE_0)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Up/Down") PORT_CODE(KEYCODE_9) PORT_TOGGLE
PORT_CONFNAME( 0x10, 0x10, "Language" )
PORT_CONFSETTING( 0x00, "German" )
PORT_CONFSETTING( 0x10, "English" )
INPUT_PORTS_END
void de_2_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
switch(id)
{
case TIMER_IRQ:
if(param == 1)
{
m_maincpu->set_input_line(M6800_IRQ_LINE,ASSERT_LINE);
m_irq_timer->adjust(attotime::from_ticks(32,E_CLOCK),0);
m_irq_active = true;
m_pia28->ca1_w(BIT(ioport("DIAGS")->read(), 2)); // Advance
m_pia28->cb1_w(BIT(ioport("DIAGS")->read(), 3)); // Up/Down
}
else
{
m_maincpu->set_input_line(M6800_IRQ_LINE,CLEAR_LINE);
m_irq_timer->adjust(attotime::from_ticks(S11_IRQ_CYCLES,E_CLOCK),1);
m_irq_active = false;
m_pia28->ca1_w(1);
m_pia28->cb1_w(1);
}
break;
}
}
MACHINE_RESET_MEMBER(de_2_state, de_2)
{
m_sample_bank->set_entry(0);
m_more_data = false;
m_is_alpha3 = false;
}
MACHINE_RESET_MEMBER(de_2_state, de_2_alpha3)
{
m_sample_bank->set_entry(0);
m_more_data = false;
m_is_alpha3 = true;
}
DRIVER_INIT_MEMBER(de_2_state, de_2)
{
UINT8 *ROM = memregion("sound1")->base();
m_irq_timer = timer_alloc(TIMER_IRQ);
m_irq_timer->adjust(attotime::from_ticks(S11_IRQ_CYCLES,E_CLOCK),1);
m_irq_active = false;
m_sample_bank->configure_entries(0, 16, &ROM[0x0000], 0x4000);
m_sample_bank->set_entry(0);
}
@ -298,40 +245,7 @@ WRITE_LINE_MEMBER(de_2_state::msm5205_irq_w)
}
}
WRITE_LINE_MEMBER(de_2_state::pia_irq)
{
if(state == CLEAR_LINE)
{
// restart IRQ timer
m_irq_timer->adjust(attotime::from_ticks(S11_IRQ_CYCLES,E_CLOCK),1);
m_irq_active = false;
}
else
{
// disable IRQ timer while other IRQs are being handled
// (counter is reset every 32 cycles while a PIA IRQ is handled)
m_irq_timer->adjust(attotime::zero);
m_irq_active = true;
}
}
INPUT_CHANGED_MEMBER( de_2_state::main_nmi )
{
// Diagnostic button sends a pulse to NMI pin
if (newval==CLEAR_LINE)
m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
INPUT_CHANGED_MEMBER( de_2_state::audio_nmi )
{
// Not on DECO board?
// Diagnostic button sends a pulse to NMI pin
// if (newval==CLEAR_LINE)
// if(m_audiocpu)
// m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
// 6821 PIA at 0x2000
// 6821 PIA at 0x2100
WRITE8_MEMBER( de_2_state::sol3_w )
{
}
@ -348,45 +262,11 @@ WRITE_LINE_MEMBER( de_2_state::pia21_ca2_w )
m_ca1 = state;
}
static const pia6821_interface pia21_intf =
{
DEVCB_NULL, //DEVCB_DRIVER_MEMBER(de_2_state, dac_r), /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_LINE_GND, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_DRIVER_MEMBER(de_2_state, sol2_w), /* port A out */
DEVCB_NULL, /* port B out */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia21_ca2_w), /* line CA2 out */
DEVCB_NULL, //DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia21_cb2_w), /* line CB2 out */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq), /* IRQA */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq) /* IRQB */
};
// 6821 PIA at 0x2400
WRITE8_MEMBER( de_2_state::lamp0_w )
{
m_maincpu->set_input_line(M6800_IRQ_LINE, CLEAR_LINE);
}
static const pia6821_interface pia24_intf =
{
DEVCB_NULL, /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_LINE_GND, /* line CA1 in */
DEVCB_LINE_GND, /* line CB1 in */
DEVCB_LINE_VCC, /* line CA2 in */
DEVCB_LINE_VCC, /* line CB2 in */
DEVCB_DRIVER_MEMBER(de_2_state, lamp0_w), /* port A out */
DEVCB_DRIVER_MEMBER(de_2_state, lamp1_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, //DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia24_cb2_w), /* line CB2 out */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq), /* IRQA */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq) /* IRQB */
};
// 6821 PIA at 0x2800
WRITE8_MEMBER( de_2_state::dig0_w )
{
@ -405,10 +285,29 @@ WRITE8_MEMBER( de_2_state::dig1_w )
m_segment2 |= 0x30000;
if ((m_segment2 & 0x70000) == 0x30000)
{
if(m_is_alpha3) // Alphanumeric type 2 uses 7 segment LEDs on the bottom row, type 3 uses 14 segment LEDs
output_set_digit_value(m_strobe+16, BITSWAP16(m_segment2, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0));
else
output_set_digit_value(m_strobe+16, BITSWAP16(m_segment2, 11, 15, 12, 10, 8, 14, 13, 9, 7, 6, 5, 4, 3, 2, 1, 0));
output_set_digit_value(m_strobe+16, BITSWAP16(m_segment2, 11, 15, 12, 10, 8, 14, 13, 9, 7, 6, 5, 4, 3, 2, 1, 0));
m_segment2 |= 0x40000;
}
}
WRITE8_MEMBER( de_2_state::type2alpha3_dig1_w )
{
m_segment2 |= data;
m_segment2 |= 0x20000;
if ((m_segment2 & 0x70000) == 0x30000)
{
output_set_digit_value(m_strobe+16, BITSWAP16(m_segment2, 11, 15, 12, 10, 8, 14, 13, 9, 7, 6, 5, 4, 3, 2, 1, 0));
m_segment2 |= 0x40000;
}
}
WRITE8_MEMBER( de_2_state::alpha3_dig1_w )
{
m_segment2 |= data;
m_segment2 |= 0x20000;
if ((m_segment2 & 0x70000) == 0x30000)
{
output_set_digit_value(m_strobe+16, BITSWAP16(m_segment2, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0));
m_segment2 |= 0x40000;
}
}
@ -420,29 +319,9 @@ READ8_MEMBER( de_2_state::pia28_w7_r )
ret |= m_strobe;
ret |= m_diag << 4;
if(BIT(ioport("DIAGS")->read(), 4)) // W7 Jumper
ret &= ~0x80;
return ret;
}
static const pia6821_interface pia28_intf =
{
DEVCB_DRIVER_MEMBER(de_2_state, pia28_w7_r), /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_DRIVER_MEMBER(de_2_state, dig0_w), /* port A out */
DEVCB_DRIVER_MEMBER(de_2_state, dig1_w), /* port B out */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia28_ca2_w), /* line CA2 out */ // comma 3+4
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia28_cb2_w), /* line CB2 out */ // comma 1+2
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq), /* IRQA */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq) /* IRQB */
};
// 6821 PIA at 0x2c00
WRITE8_MEMBER( de_2_state::pia2c_pa_w )
{
@ -466,22 +345,6 @@ WRITE8_MEMBER( de_2_state::pia2c_pb_w )
}
}
static const pia6821_interface pia2c_intf =
{
DEVCB_NULL, /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_DRIVER_MEMBER(de_2_state, pia2c_pa_w), /* port A out */
DEVCB_DRIVER_MEMBER(de_2_state, pia2c_pb_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* line CB2 out */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq), /* IRQA */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq) /* IRQB */
};
// 6821 PIA at 0x3000
READ8_MEMBER( de_2_state::switch_r )
@ -493,29 +356,26 @@ READ8_MEMBER( de_2_state::switch_r )
WRITE8_MEMBER( de_2_state::switch_w )
{
m_kbdrow = data;
}
int x;
static const pia6821_interface pia30_intf =
{
DEVCB_DRIVER_MEMBER(de_2_state, switch_r), /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_LINE_GND, /* line CA1 in */
DEVCB_LINE_GND, /* line CB1 in */
DEVCB_LINE_VCC, /* line CA2 in */
DEVCB_LINE_VCC, /* line CB2 in */
DEVCB_NULL, /* port A out */
DEVCB_DRIVER_MEMBER(de_2_state, switch_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, //DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia30_cb2_w), /* line CB2 out */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq), /* IRQA */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq) /* IRQB */
};
// about every second, 0xFF is written here, but it would be impossible to select more than one set of switches
// at once, so just return the first bit set. Maybe 0xFF has special meaning, or is just a disable?
for(x=0;x<8;x++)
{
if(data & (1<<x))
break;
}
m_kbdrow = data & (1<<x);
}
// 6821 PIA at 0x3400
WRITE8_MEMBER( de_2_state::pia34_pa_w )
{
// Not connected?
// Not connected on alphanumeric type 2 boards
}
WRITE8_MEMBER( de_2_state::type2alpha3_pia34_pa_w )
{
m_segment2 |= (data<<8);
m_segment2 |= 0x10000;
if ((m_segment2 & 0x70000) == 0x30000)
@ -525,21 +385,16 @@ WRITE8_MEMBER( de_2_state::pia34_pa_w )
}
}
static const pia6821_interface pia34_intf =
WRITE8_MEMBER( de_2_state::alpha3_pia34_pa_w )
{
DEVCB_NULL, /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_DRIVER_MEMBER(de_2_state, pia34_pa_w), /* port A out */
DEVCB_DRIVER_MEMBER(de_2_state, sound_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, //DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia34_cb2_w), /* line CB2 out */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq), /* IRQA */
DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq) /* IRQB */
};
m_segment2 |= (data<<8);
m_segment2 |= 0x10000;
if ((m_segment2 & 0x70000) == 0x30000)
{
output_set_digit_value(m_strobe+16, BITSWAP16(m_segment2, 11, 15, 12, 10, 8, 14, 13, 9, 7, 6, 5, 4, 3, 2, 1, 0));
m_segment2 |= 0x40000;
}
}
// Sound board
@ -566,16 +421,111 @@ WRITE8_MEMBER( de_2_state::sample_bank_w )
m_msm5205->reset_w(data & 0x40);
}
READ8_MEMBER(de_2_state::display_r)
{
UINT8 ret = 0x00;
switch(offset)
{
case 0:
ret = pia28_w7_r(space,0);
break;
}
return ret;
}
WRITE8_MEMBER(de_2_state::display_w)
{
switch(offset)
{
case 0:
dig0_w(space,0,data);
break;
case 1:
dig1_w(space,0,data);
break;
case 2:
pia2c_pa_w(space,0,data);
break;
case 3:
pia2c_pb_w(space,0,data);
break;
case 4:
pia34_pa_w(space,0,data);
break;
}
}
WRITE8_MEMBER(de_2_state::type2alpha3_display_w)
{
switch(offset)
{
case 0:
dig0_w(space,0,data);
break;
case 1:
type2alpha3_dig1_w(space,0,data);
break;
case 2:
pia2c_pa_w(space,0,data);
break;
case 3:
pia2c_pb_w(space,0,data);
break;
case 4:
type2alpha3_pia34_pa_w(space,0,data);
break;
}
}
WRITE8_MEMBER(de_2_state::alpha3_display_w)
{
switch(offset)
{
case 0:
dig0_w(space,0,data);
break;
case 1:
alpha3_dig1_w(space,0,data);
break;
case 2:
pia2c_pa_w(space,0,data);
break;
case 3:
pia2c_pb_w(space,0,data);
break;
case 4:
alpha3_pia34_pa_w(space,0,data);
break;
}
}
WRITE8_MEMBER(de_2_state::lamps_w)
{
switch(offset)
{
case 0:
lamp0_w(space,0,data);
break;
case 1:
lamp1_w(space,0,data);
break;
}
}
static const msm5205_interface msm5205_intf =
{
DEVCB_DRIVER_LINE_MEMBER(de_2_state,msm5205_irq_w),
MSM5205_S96_4B
};
static MACHINE_CONFIG_START( de_2, de_2_state )
static MACHINE_CONFIG_START( de_type1, de_2_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6808, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(de_2_map)
MCFG_DECOCPU_TYPE1_ADD("decocpu",XTAL_8MHz / 2, ":maincpu")
MCFG_DECOCPU_DISPLAY(READ8(de_2_state,display_r),WRITE8(de_2_state,display_w))
MCFG_DECOCPU_SOUNDLATCH(WRITE8(de_2_state,sound_w))
MCFG_DECOCPU_SWITCH(READ8(de_2_state,switch_r),WRITE8(de_2_state,switch_w))
MCFG_DECOCPU_LAMP(WRITE8(de_2_state,lamps_w))
MCFG_MACHINE_RESET_OVERRIDE(de_2_state, de_2)
/* Video */
@ -583,15 +533,6 @@ static MACHINE_CONFIG_START( de_2, de_2_state )
MCFG_FRAGMENT_ADD( genpin_audio )
/* Devices */
MCFG_PIA6821_ADD("pia21", pia21_intf)
MCFG_PIA6821_ADD("pia24", pia24_intf)
MCFG_PIA6821_ADD("pia28", pia28_intf)
MCFG_PIA6821_ADD("pia2c", pia2c_intf)
MCFG_PIA6821_ADD("pia30", pia30_intf)
MCFG_PIA6821_ADD("pia34", pia34_intf)
MCFG_NVRAM_ADD_1FILL("nvram")
/* sound CPU */
MCFG_CPU_ADD("audiocpu", M6809E, 8000000) // MC68B09E
MCFG_CPU_PROGRAM_MAP(de_2_audio_map)
@ -605,11 +546,88 @@ static MACHINE_CONFIG_START( de_2, de_2_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( de_2_alpha3, de_2 )
MCFG_MACHINE_RESET_OVERRIDE(de_2_state, de_2_alpha3)
MCFG_DEFAULT_LAYOUT(layout_de2a3)
static MACHINE_CONFIG_START( de_type2, de_2_state )
/* basic machine hardware */
MCFG_DECOCPU_TYPE2_ADD("decocpu",XTAL_8MHz / 2, ":maincpu")
MCFG_DECOCPU_DISPLAY(READ8(de_2_state,display_r),WRITE8(de_2_state,display_w))
MCFG_DECOCPU_SOUNDLATCH(WRITE8(de_2_state,sound_w))
MCFG_DECOCPU_SWITCH(READ8(de_2_state,switch_r),WRITE8(de_2_state,switch_w))
MCFG_DECOCPU_LAMP(WRITE8(de_2_state,lamps_w))
MCFG_MACHINE_RESET_OVERRIDE(de_2_state, de_2)
/* Video */
MCFG_DEFAULT_LAYOUT(layout_de2)
MCFG_FRAGMENT_ADD( genpin_audio )
/* sound CPU */
MCFG_CPU_ADD("audiocpu", M6809E, 8000000) // MC68B09E
MCFG_CPU_PROGRAM_MAP(de_2_audio_map)
MCFG_SPEAKER_STANDARD_MONO("bg")
MCFG_YM2151_ADD("ym2151", 3580000)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(de_2_state, ym2151_irq_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
MCFG_SOUND_ADD("msm5205", MSM5205, 384000)
MCFG_SOUND_CONFIG(msm5205_intf)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( de_type2_alpha3, de_2_state )
/* basic machine hardware */
MCFG_DECOCPU_TYPE2_ADD("decocpu",XTAL_8MHz / 2, ":maincpu")
MCFG_DECOCPU_DISPLAY(READ8(de_2_state,display_r),WRITE8(de_2_state,type2alpha3_display_w))
MCFG_DECOCPU_SOUNDLATCH(WRITE8(de_2_state,sound_w))
MCFG_DECOCPU_SWITCH(READ8(de_2_state,switch_r),WRITE8(de_2_state,switch_w))
MCFG_DECOCPU_LAMP(WRITE8(de_2_state,lamps_w))
MCFG_MACHINE_RESET_OVERRIDE(de_2_state, de_2)
/* Video */
MCFG_DEFAULT_LAYOUT(layout_de2a3)
MCFG_FRAGMENT_ADD( genpin_audio )
/* sound CPU */
MCFG_CPU_ADD("audiocpu", M6809E, 8000000) // MC68B09E
MCFG_CPU_PROGRAM_MAP(de_2_audio_map)
MCFG_SPEAKER_STANDARD_MONO("bg")
MCFG_YM2151_ADD("ym2151", 3580000)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(de_2_state, ym2151_irq_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
MCFG_SOUND_ADD("msm5205", MSM5205, 384000)
MCFG_SOUND_CONFIG(msm5205_intf)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( de_type3, de_2_state )
/* basic machine hardware */
MCFG_DECOCPU_TYPE3_ADD("decocpu",XTAL_8MHz / 2, ":maincpu")
MCFG_DECOCPU_DISPLAY(READ8(de_2_state,display_r),WRITE8(de_2_state,alpha3_display_w))
MCFG_DECOCPU_SOUNDLATCH(WRITE8(de_2_state,sound_w))
MCFG_DECOCPU_SWITCH(READ8(de_2_state,switch_r),WRITE8(de_2_state,switch_w))
MCFG_DECOCPU_LAMP(WRITE8(de_2_state,lamps_w))
MCFG_MACHINE_RESET_OVERRIDE(de_2_state, de_2)
/* Video */
MCFG_DEFAULT_LAYOUT(layout_de2a3)
MCFG_FRAGMENT_ADD( genpin_audio )
/* sound CPU */
MCFG_CPU_ADD("audiocpu", M6809E, 8000000) // MC68B09E
MCFG_CPU_PROGRAM_MAP(de_2_audio_map)
MCFG_SPEAKER_STANDARD_MONO("bg")
MCFG_YM2151_ADD("ym2151", 3580000)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(de_2_state, ym2151_irq_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
MCFG_SOUND_ADD("msm5205", MSM5205, 384000)
MCFG_SOUND_CONFIG(msm5205_intf)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
MACHINE_CONFIG_END
/*--------------------------------------------------------------------------------
/ Back To the Future - CPU Rev 3 /Alpha Type 3 - 32K Roms - 32/64K Sound Roms
/--------------------------------------------------------------------------------*/
@ -698,6 +716,7 @@ ROM_END
/*-------------------------------------------------------------------------------
/ Phantom of the Opera - CPU Rev 3 /Alpha Type 3 16/32K Roms - 32/64K Sound Roms
/-------------------------------------------------------------------------------*/
// Display LED inputs are in the same order as for Monday Night Football, is this actually CPU type 2?
ROM_START(poto_a32)
ROM_REGION(0x10000, "maincpu", 0)
ROM_LOAD("potob5.3-2", 0x4000, 0x4000, CRC(bdc39205) SHA1(67b3f56655ef2cc056912ab6e351cf83352abaa9))
@ -827,20 +846,20 @@ ROM_START(torp_e21)
ROM_END
GAME(1990, bttf_a27, 0, de_2_alpha3, de_2, de_2_state, de_2, ROT0, "Data East", "Back To the Future (2.7)", GAME_IS_SKELETON_MECHANICAL)
GAME(1990, bttf_a20, bttf_a27, de_2_alpha3, de_2, de_2_state, de_2, ROT0, "Data East", "Back To the Future (2.0)", GAME_IS_SKELETON_MECHANICAL)
GAME(1990, bttf_a21, bttf_a27, de_2_alpha3, de_2, de_2_state, de_2, ROT0, "Data East", "Back To The Future (2.1)", GAME_IS_SKELETON_MECHANICAL)
GAME(199?, bttf_g27, bttf_a27, de_2_alpha3, de_2, de_2_state, de_2, ROT0, "Data East", "Back To the Future (2.7 Germany)", GAME_IS_SKELETON_MECHANICAL)
GAME(1987, lwar_a83, 0, de_2, de_2, de_2_state, de_2, ROT0, "Data East", "Laser War (8.3)", GAME_IS_SKELETON_MECHANICAL)
GAME(1987, lwar_e90, lwar_a83, de_2, de_2, de_2_state, de_2, ROT0, "Data East", "Laser War (9.0 Europe)", GAME_IS_SKELETON_MECHANICAL)
GAME(1989, mnfb_c27, 0, de_2_alpha3, de_2, de_2_state, de_2, ROT0, "Data East", "Monday Night Football (2.7, 50cts)", GAME_IS_SKELETON_MECHANICAL)
GAME(1990, poto_a32, 0, de_2_alpha3, de_2, de_2_state, de_2, ROT0, "Data East", "The Phantom of the Opera (3.2)", GAME_IS_SKELETON_MECHANICAL)
GAME(1989, play_a24, 0, de_2, de_2, de_2_state, de_2, ROT0, "Data East", "Playboy 35th Anniversary (2.4)", GAME_IS_SKELETON_MECHANICAL)
GAME(1989, robo_a34, 0, de_2_alpha3, de_2, de_2_state, de_2, ROT0, "Data East", "Robocop (3.4)", GAME_IS_SKELETON_MECHANICAL)
GAME(1988, ssvc_a26, 0, de_2, de_2, de_2_state, de_2, ROT0, "Data East", "Secret Service (2.6)", GAME_IS_SKELETON_MECHANICAL)
GAME(1988, ssvc_b26, ssvc_a26, de_2, de_2, de_2_state, de_2, ROT0, "Data East", "Secret Service (2.6 alternate sound)", GAME_IS_SKELETON_MECHANICAL)
GAME(1990, simp_a27, 0, de_2_alpha3, de_2, de_2_state, de_2, ROT0, "Data East", "The Simpsons (2.7)", GAME_IS_SKELETON_MECHANICAL)
GAME(1990, simp_a20, simp_a27, de_2_alpha3, de_2, de_2_state, de_2, ROT0, "Data East", "The Simpsons (2.0)", GAME_IS_SKELETON_MECHANICAL)
GAME(1988, tmac_a24, 0, de_2, de_2, de_2_state, de_2, ROT0, "Data East", "Time Machine (2.4)", GAME_IS_SKELETON_MECHANICAL)
GAME(1988, tmac_a18, tmac_a24, de_2, de_2, de_2_state, de_2, ROT0, "Data East", "Time Machine (1.8)", GAME_IS_SKELETON_MECHANICAL)
GAME(1988, torp_e21, 0, de_2, de_2, de_2_state, de_2, ROT0, "Data East", "Torpedo Alley (2.1, Europe)", GAME_IS_SKELETON_MECHANICAL)
GAME(1990, bttf_a27, 0, de_type3, de_2, de_2_state, de_2, ROT0, "Data East", "Back To the Future (2.7)", GAME_IS_SKELETON_MECHANICAL)
GAME(1990, bttf_a20, bttf_a27, de_type3, de_2, de_2_state, de_2, ROT0, "Data East", "Back To the Future (2.0)", GAME_IS_SKELETON_MECHANICAL)
GAME(1990, bttf_a21, bttf_a27, de_type3, de_2, de_2_state, de_2, ROT0, "Data East", "Back To The Future (2.1)", GAME_IS_SKELETON_MECHANICAL)
GAME(199?, bttf_g27, bttf_a27, de_type3, de_2, de_2_state, de_2, ROT0, "Data East", "Back To the Future (2.7 Germany)", GAME_IS_SKELETON_MECHANICAL)
GAME(1987, lwar_a83, 0, de_type1, de_2, de_2_state, de_2, ROT0, "Data East", "Laser War (8.3)", GAME_IS_SKELETON_MECHANICAL)
GAME(1987, lwar_e90, lwar_a83, de_type1, de_2, de_2_state, de_2, ROT0, "Data East", "Laser War (9.0 Europe)", GAME_IS_SKELETON_MECHANICAL)
GAME(1989, mnfb_c27, 0, de_type2_alpha3, de_2, de_2_state, de_2, ROT0, "Data East", "Monday Night Football (2.7, 50cts)", GAME_IS_SKELETON_MECHANICAL)
GAME(1990, poto_a32, 0, de_type2_alpha3, de_2, de_2_state, de_2, ROT0, "Data East", "The Phantom of the Opera (3.2)", GAME_IS_SKELETON_MECHANICAL)
GAME(1989, play_a24, 0, de_type2, de_2, de_2_state, de_2, ROT0, "Data East", "Playboy 35th Anniversary (2.4)", GAME_IS_SKELETON_MECHANICAL)
GAME(1989, robo_a34, 0, de_type3, de_2, de_2_state, de_2, ROT0, "Data East", "Robocop (3.4)", GAME_IS_SKELETON_MECHANICAL)
GAME(1988, ssvc_a26, 0, de_type2, de_2, de_2_state, de_2, ROT0, "Data East", "Secret Service (2.6)", GAME_IS_SKELETON_MECHANICAL)
GAME(1988, ssvc_b26, ssvc_a26, de_type2, de_2, de_2_state, de_2, ROT0, "Data East", "Secret Service (2.6 alternate sound)", GAME_IS_SKELETON_MECHANICAL)
GAME(1990, simp_a27, 0, de_type3, de_2, de_2_state, de_2, ROT0, "Data East", "The Simpsons (2.7)", GAME_IS_SKELETON_MECHANICAL)
GAME(1990, simp_a20, simp_a27, de_type3, de_2, de_2_state, de_2, ROT0, "Data East", "The Simpsons (2.0)", GAME_IS_SKELETON_MECHANICAL)
GAME(1988, tmac_a24, 0, de_type2, de_2, de_2_state, de_2, ROT0, "Data East", "Time Machine (2.4)", GAME_IS_SKELETON_MECHANICAL)
GAME(1988, tmac_a18, tmac_a24, de_type2, de_2, de_2_state, de_2, ROT0, "Data East", "Time Machine (1.8)", GAME_IS_SKELETON_MECHANICAL)
GAME(1988, torp_e21, 0, de_type2, de_2, de_2_state, de_2, ROT0, "Data East", "Torpedo Alley (2.1, Europe)", GAME_IS_SKELETON_MECHANICAL)

View File

@ -0,0 +1,430 @@
/*
* Data East Pinball CPU boards
*
* Type 1: Based on Williams System 11 CPU boards, but without the generic pinball audio hardware
* Type 2: RAM increased from 2kB to 8kB
* Type 3: Adds CPU controlled solenoids
* Type 3b: Adds printer option
*
* TODO:
* - make use of solenoid callbacks
* - printer option (type 3b)
*/
#include "decopincpu.h"
const device_type DECOCPU1 = &device_creator<decocpu_type1_device>;
const device_type DECOCPU2 = &device_creator<decocpu_type2_device>;
const device_type DECOCPU3 = &device_creator<decocpu_type3_device>;
static ADDRESS_MAP_START( decocpu1_map, AS_PROGRAM, 8, decocpu_type1_device )
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x2100, 0x2103) AM_DEVREADWRITE("pia21", pia6821_device, read, write) // sound+solenoids
AM_RANGE(0x2200, 0x2200) AM_WRITE(solenoid2_w) // solenoids
AM_RANGE(0x2400, 0x2403) AM_DEVREADWRITE("pia24", pia6821_device, read, write) // lamps
AM_RANGE(0x2800, 0x2803) AM_DEVREADWRITE("pia28", pia6821_device, read, write) // display
AM_RANGE(0x2c00, 0x2c03) AM_DEVREADWRITE("pia2c", pia6821_device, read, write) // alphanumeric display
AM_RANGE(0x3000, 0x3003) AM_DEVREADWRITE("pia30", pia6821_device, read, write) // inputs
AM_RANGE(0x3400, 0x3403) AM_DEVREADWRITE("pia34", pia6821_device, read, write) // widget
//AM_RANGE(0x4000, 0xffff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( decocpu2_map, AS_PROGRAM, 8, decocpu_type2_device )
AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x2100, 0x2103) AM_DEVREADWRITE("pia21", pia6821_device, read, write) // sound+solenoids
AM_RANGE(0x2200, 0x2200) AM_WRITE(solenoid2_w) // solenoids
AM_RANGE(0x2400, 0x2403) AM_DEVREADWRITE("pia24", pia6821_device, read, write) // lamps
AM_RANGE(0x2800, 0x2803) AM_DEVREADWRITE("pia28", pia6821_device, read, write) // display
AM_RANGE(0x2c00, 0x2c03) AM_DEVREADWRITE("pia2c", pia6821_device, read, write) // alphanumeric display
AM_RANGE(0x3000, 0x3003) AM_DEVREADWRITE("pia30", pia6821_device, read, write) // inputs
AM_RANGE(0x3400, 0x3403) AM_DEVREADWRITE("pia34", pia6821_device, read, write) // widget
//AM_RANGE(0x4000, 0xffff) AM_ROM
ADDRESS_MAP_END
static INPUT_PORTS_START( decocpu1 )
PORT_START("DIAGS")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Audio Diag") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, decocpu_type1_device, audio_nmi, 1)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Main Diag") PORT_CODE(KEYCODE_F2) PORT_CHANGED_MEMBER(DEVICE_SELF, decocpu_type1_device, main_nmi, 1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Advance") PORT_CODE(KEYCODE_0)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Up/Down") PORT_CODE(KEYCODE_9) PORT_TOGGLE
PORT_CONFNAME( 0x10, 0x10, "Language" )
PORT_CONFSETTING( 0x00, "German" )
PORT_CONFSETTING( 0x10, "English" )
INPUT_PORTS_END
void decocpu_type1_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
switch(id)
{
case TIMER_IRQ:
if(param == 1)
{
m_cpu->set_input_line(M6800_IRQ_LINE,ASSERT_LINE);
m_irq_timer->adjust(attotime::from_ticks(32,E_CLOCK),0);
m_irq_active = true;
m_pia28->ca1_w(BIT(ioport("DIAGS")->read(), 2));
m_pia28->cb1_w(BIT(ioport("DIAGS")->read(), 3));
}
else
{
m_cpu->set_input_line(M6800_IRQ_LINE,CLEAR_LINE);
m_irq_timer->adjust(attotime::from_ticks(S11_IRQ_CYCLES,E_CLOCK),1);
m_irq_active = false;
m_pia28->ca1_w(1);
m_pia28->cb1_w(1);
}
break;
}
}
INPUT_CHANGED_MEMBER( decocpu_type1_device::main_nmi )
{
// Diagnostic button sends a pulse to NMI pin
if (newval==CLEAR_LINE)
m_cpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
INPUT_CHANGED_MEMBER( decocpu_type1_device::audio_nmi )
{
// Not on DECO board?
}
WRITE_LINE_MEMBER(decocpu_type1_device::cpu_pia_irq)
{
if(state == CLEAR_LINE)
{
// restart IRQ timer
m_irq_timer->adjust(attotime::from_ticks(S11_IRQ_CYCLES,E_CLOCK),1);
m_irq_active = false;
}
else
{
// disable IRQ timer while other IRQs are being handled
// (counter is reset every 32 cycles while a PIA IRQ is handled)
m_irq_timer->adjust(attotime::zero);
m_irq_active = true;
}
}
// 5F - PIA at 0x2100
static const pia6821_interface cpu_pia21_intf =
{
DEVCB_NULL, /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_LINE_GND, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, solenoid1_w), /* port A out */
DEVCB_NULL, /* port B out */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, pia21_ca2_w), /* line CA2 out */
DEVCB_NULL, /* line CB2 out */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, cpu_pia_irq), /* IRQA */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, cpu_pia_irq) /* IRQB */
};
WRITE_LINE_MEMBER( decocpu_type1_device::pia21_ca2_w )
{
// sound ns
m_ca2 = state;
}
// 11D - PIA at 0x2400
static const pia6821_interface cpu_pia24_intf =
{
DEVCB_NULL, /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_LINE_GND, /* line CA1 in */
DEVCB_LINE_GND, /* line CB1 in */
DEVCB_LINE_VCC, /* line CA2 in */
DEVCB_LINE_VCC, /* line CB2 in */
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, lamp0_w), /* port A out */
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, lamp1_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* line CB2 out */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, cpu_pia_irq), /* IRQA */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, cpu_pia_irq) /* IRQB */
};
WRITE8_MEMBER( decocpu_type1_device::lamp0_w )
{
m_cpu->set_input_line(M6800_IRQ_LINE, CLEAR_LINE);
m_write_switch(0,data,0xff);
}
WRITE8_MEMBER( decocpu_type1_device::lamp1_w )
{
m_write_switch(1,data,0xff);
}
// 11B - PIA at 0x2800
static const pia6821_interface cpu_pia28_intf =
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, display_strobe_r), /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, display_strobe_w), /* port A out */
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, display_out1_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* line CB2 out */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, cpu_pia_irq), /* IRQA */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, cpu_pia_irq) /* IRQB */
};
READ8_MEMBER( decocpu_type1_device::display_strobe_r )
{
UINT8 ret = 0x80;
if(BIT(ioport("DIAGS")->read(), 4)) // W7 Jumper
ret &= ~0x80;
return ret | (m_read_display(0) & 0x7f);
}
WRITE8_MEMBER( decocpu_type1_device::display_strobe_w )
{
m_write_display(0,data,0xff);
}
WRITE8_MEMBER( decocpu_type1_device::display_out1_w )
{
m_write_display(1,data,0xff);
}
// 9B - PIA at 0x2c00
static const pia6821_interface cpu_pia2c_intf =
{
DEVCB_NULL, /* port A in */
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, display_in3_r), /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, display_out2_w), /* port A out */
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, display_out3_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* line CB2 out */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, cpu_pia_irq), /* IRQA */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, cpu_pia_irq) /* IRQB */
};
WRITE8_MEMBER( decocpu_type1_device::display_out2_w )
{
m_write_display(2,data,0xff);
}
WRITE8_MEMBER( decocpu_type1_device::display_out3_w )
{
m_write_display(3,data,0xff);
}
READ8_MEMBER( decocpu_type1_device::display_in3_r )
{
return m_read_display(3);
}
// 8H - PIA at 0x3000
static const pia6821_interface cpu_pia30_intf =
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, switch_r), /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_LINE_GND, /* line CA1 in */
DEVCB_LINE_GND, /* line CB1 in */
DEVCB_LINE_VCC, /* line CA2 in */
DEVCB_LINE_VCC, /* line CB2 in */
DEVCB_NULL, /* port A out */
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, switch_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* line CB2 out */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, cpu_pia_irq), /* IRQA */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, cpu_pia_irq) /* IRQB */
};
WRITE8_MEMBER( decocpu_type1_device::switch_w )
{
m_write_switch(0,data,0xff);
}
READ8_MEMBER( decocpu_type1_device::switch_r )
{
return m_read_switch(0);
}
// 7B - PIA at 0x3400
static const pia6821_interface cpu_pia34_intf =
{
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, dmdstatus_r), /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, display_out4_w), /* port A out */
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, sound_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* line CB2 out */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, cpu_pia_irq), /* IRQA */
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, decocpu_type1_device, cpu_pia_irq) /* IRQB */
};
READ8_MEMBER( decocpu_type1_device::dmdstatus_r )
{
// TODO: display callback
return m_read_dmdstatus(0);
}
WRITE8_MEMBER( decocpu_type1_device::display_out4_w )
{
m_write_display(4,data,0xff);
}
WRITE8_MEMBER( decocpu_type1_device::sound_w )
{
m_write_soundlatch(0,data,0xff);
}
WRITE8_MEMBER( decocpu_type1_device::solenoid1_w )
{
// todo
}
WRITE8_MEMBER( decocpu_type1_device::solenoid2_w )
{
// todo
}
static MACHINE_CONFIG_FRAGMENT( decocpu1 )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6808, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(decocpu1_map)
/* Devices */
MCFG_PIA6821_ADD("pia21", cpu_pia21_intf)
MCFG_PIA6821_ADD("pia24", cpu_pia24_intf)
MCFG_PIA6821_ADD("pia28", cpu_pia28_intf)
MCFG_PIA6821_ADD("pia2c", cpu_pia2c_intf)
MCFG_PIA6821_ADD("pia30", cpu_pia30_intf)
MCFG_PIA6821_ADD("pia34", cpu_pia34_intf)
MCFG_NVRAM_ADD_1FILL("nvram")
MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( decocpu2 )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6808, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(decocpu2_map)
/* Devices */
MCFG_PIA6821_ADD("pia21", cpu_pia21_intf)
MCFG_PIA6821_ADD("pia24", cpu_pia24_intf)
MCFG_PIA6821_ADD("pia28", cpu_pia28_intf)
MCFG_PIA6821_ADD("pia2c", cpu_pia2c_intf)
MCFG_PIA6821_ADD("pia30", cpu_pia30_intf)
MCFG_PIA6821_ADD("pia34", cpu_pia34_intf)
MCFG_NVRAM_ADD_1FILL("nvram")
MACHINE_CONFIG_END
machine_config_constructor decocpu_type1_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( decocpu1 );
}
ioport_constructor decocpu_type1_device::device_input_ports() const
{
return INPUT_PORTS_NAME( decocpu1 );
}
decocpu_type1_device::decocpu_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, DECOCPU1, "Data East Pinball CPU Board Type 1", tag, owner, clock, "decocpu1", __FILE__),
m_cpu(*this,"maincpu"),
m_pia21(*this, "pia21"),
m_pia24(*this, "pia24"),
m_pia28(*this, "pia28"),
m_pia2c(*this, "pia2c"),
m_pia30(*this, "pia30"),
m_pia34(*this, "pia34"),
m_read_display(*this),
m_write_display(*this),
m_read_dmdstatus(*this),
m_write_soundlatch(*this),
m_read_switch(*this),
m_write_switch(*this),
m_write_lamp(*this),
m_write_solenoid(*this)
{}
decocpu_type1_device::decocpu_type1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
m_cpu(*this,"maincpu"),
m_pia21(*this, "pia21"),
m_pia24(*this, "pia24"),
m_pia28(*this, "pia28"),
m_pia2c(*this, "pia2c"),
m_pia30(*this, "pia30"),
m_pia34(*this, "pia34"),
m_read_display(*this),
m_write_display(*this),
m_read_dmdstatus(*this),
m_write_soundlatch(*this),
m_read_switch(*this),
m_write_switch(*this),
m_write_lamp(*this),
m_write_solenoid(*this)
{}
void decocpu_type1_device::device_start()
{
UINT8* ROM = memregion(m_cputag)->base();
// resolve callbacks
m_read_display.resolve_safe(0);
m_write_display.resolve_safe();
m_read_dmdstatus.resolve_safe(0);
m_write_soundlatch.resolve_safe();
m_read_switch.resolve_safe(0);
m_write_switch.resolve_safe();
m_write_lamp.resolve_safe();
m_write_solenoid.resolve_safe();
m_irq_timer = timer_alloc(TIMER_IRQ);
m_irq_timer->adjust(attotime::from_ticks(S11_IRQ_CYCLES,E_CLOCK),1);
m_irq_active = false;
m_cpu->space(AS_PROGRAM).install_rom(0x4000,0xffff,ROM+0x4000);
}
void decocpu_type1_device::static_set_cpuregion(device_t &device, const char *tag)
{
decocpu_type1_device &cpuboard = downcast<decocpu_type1_device &>(device);
cpuboard.m_cputag = tag;
}
decocpu_type2_device::decocpu_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: decocpu_type1_device(mconfig, DECOCPU2, "Data East Pinball CPU Board Type 2", tag, owner, clock, "decocpu2", __FILE__)
{}
decocpu_type2_device::decocpu_type2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
: decocpu_type1_device(mconfig, type, name, tag, owner, clock, shortname, source)
{}
machine_config_constructor decocpu_type2_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( decocpu2 );
}
void decocpu_type2_device::device_start()
{
decocpu_type1_device::device_start();
}
decocpu_type3_device::decocpu_type3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: decocpu_type2_device(mconfig, DECOCPU3, "Data East Pinball CPU Board Type 3", tag, owner, clock, "decocpu3", __FILE__)
{}
void decocpu_type3_device::device_start()
{
decocpu_type1_device::device_start();
}

View File

@ -0,0 +1,153 @@
/*
* Data East Pinball CPU boards
*
* Created on: 10/07/2013
*/
#ifndef DECOPINCPU_H_
#define DECOPINCPU_H_
#include "emu.h"
#include "cpu/m6800/m6800.h"
#include "machine/6821pia.h"
#include "machine/nvram.h"
#define MCFG_DECOCPU_TYPE1_ADD(_tag, _clock, _region) \
MCFG_DEVICE_ADD(_tag, DECOCPU1, _clock) \
decocpu_type1_device::static_set_cpuregion(*device, _region);
#define MCFG_DECOCPU_TYPE2_ADD(_tag, _clock, _region) \
MCFG_DEVICE_ADD(_tag, DECOCPU2, _clock) \
decocpu_type1_device::static_set_cpuregion(*device, _region);
#define MCFG_DECOCPU_TYPE3_ADD(_tag, _clock, _region) \
MCFG_DEVICE_ADD(_tag, DECOCPU3, _clock) \
decocpu_type1_device::static_set_cpuregion(*device, _region);
#define MCFG_DECOCPU_DISPLAY(_disp_r, _disp_w) \
downcast<decocpu_type1_device *>(device)->set_display_read_callback(DEVCB2_##_disp_r); \
downcast<decocpu_type1_device *>(device)->set_display_write_callback(DEVCB2_##_disp_w);
#define MCFG_DECOCPU_DMDSTATUS(_dmdstat_r) \
downcast<decocpu_type1_device *>(device)->set_dmdstatus_read_callback(DEVCB2_##_dmdstat_r);
#define MCFG_DECOCPU_SOUNDLATCH(_soundlatch_w) \
downcast<decocpu_type1_device *>(device)->set_soundlatch_write_callback(DEVCB2_##_soundlatch_w);
#define MCFG_DECOCPU_SWITCH(_switch_r, _switch_w) \
downcast<decocpu_type1_device *>(device)->set_switch_read_callback(DEVCB2_##_switch_r); \
downcast<decocpu_type1_device *>(device)->set_switch_write_callback(DEVCB2_##_switch_w);
#define MCFG_DECOCPU_LAMP(_lamp_w) \
downcast<decocpu_type1_device *>(device)->set_lamp_write_callback(DEVCB2_##_lamp_w);
#define MCFG_DECOCPU_SOLENOIDS(_sol_w) \
downcast<decocpu_type1_device *>(device)->set_solenoid_write_callback(DEVCB2_##_sol_w);
// 6808 CPU's input clock is 4MHz
// but because it has an internal /4 divider, its E clock runs at 1/4 that frequency
#define E_CLOCK (XTAL_4MHz/4)
// Length of time in cycles between IRQs on the main 6808 CPU
// This length is determined by the settings of the W14 and W15 jumpers
// It can be 0x300, 0x380, 0x700 or 0x780 cycles long.
// IRQ length is always 32 cycles
#define S11_IRQ_CYCLES 0x380
class decocpu_type1_device : public device_t
{
public:
decocpu_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
decocpu_type1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
required_device<cpu_device> m_cpu;
required_device<pia6821_device> m_pia21;
required_device<pia6821_device> m_pia24;
required_device<pia6821_device> m_pia28;
required_device<pia6821_device> m_pia2c;
required_device<pia6821_device> m_pia30;
required_device<pia6821_device> m_pia34;
// callbacks
template<class _disp_r> void set_display_read_callback(_disp_r disp_r) { m_read_display.set_callback(disp_r); }
template<class _disp_w> void set_display_write_callback(_disp_w disp_w) { m_write_display.set_callback(disp_w); }
template<class _dmdstat_r> void set_dmdstatus_read_callback(_dmdstat_r dmdstat_r) { m_read_dmdstatus.set_callback(dmdstat_r); }
template<class _soundlatch_w> void set_soundlatch_write_callback(_soundlatch_w slatch_w) { m_write_soundlatch.set_callback(slatch_w); }
template<class _switch_r> void set_switch_read_callback(_switch_r switch_r) { m_read_switch.set_callback(switch_r); }
template<class _switch_w> void set_switch_write_callback(_switch_w switch_w) { m_write_switch.set_callback(switch_w); }
template<class _lamp_w> void set_lamp_write_callback(_lamp_w lamp_w) { m_write_lamp.set_callback(lamp_w); }
template<class _sol_w> void set_solenoid_write_callback(_sol_w sol_w) { m_write_solenoid.set_callback(sol_w); }
DECLARE_WRITE_LINE_MEMBER(cpu_pia_irq);
DECLARE_WRITE_LINE_MEMBER(pia21_ca2_w);
DECLARE_WRITE8_MEMBER(lamp0_w);
DECLARE_WRITE8_MEMBER(lamp1_w);
DECLARE_READ8_MEMBER(display_strobe_r);
DECLARE_WRITE8_MEMBER(display_strobe_w);
DECLARE_WRITE8_MEMBER(display_out1_w);
DECLARE_WRITE8_MEMBER(display_out2_w);
DECLARE_WRITE8_MEMBER(display_out3_w);
DECLARE_WRITE8_MEMBER(display_out4_w);
DECLARE_READ8_MEMBER(display_in3_r);
DECLARE_WRITE8_MEMBER(switch_w);
DECLARE_READ8_MEMBER(switch_r);
DECLARE_READ8_MEMBER(dmdstatus_r);
DECLARE_WRITE8_MEMBER(sound_w);
DECLARE_WRITE8_MEMBER(solenoid1_w);
DECLARE_WRITE8_MEMBER(solenoid2_w);
INPUT_CHANGED_MEMBER(main_nmi);
INPUT_CHANGED_MEMBER(audio_nmi);
static void static_set_cpuregion(device_t &device, const char *tag);
protected:
// overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_start();
virtual ioport_constructor device_input_ports() const;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
static const device_timer_id TIMER_IRQ = 0;
private:
const char* m_cputag; // region for cpu board code and data
emu_timer* m_irq_timer;
bool m_irq_active;
bool m_ca2;
// callbacks
devcb2_read8 m_read_display;
devcb2_write8 m_write_display;
devcb2_read8 m_read_dmdstatus;
devcb2_write8 m_write_soundlatch;
devcb2_read8 m_read_switch;
devcb2_write8 m_write_switch;
devcb2_write8 m_write_lamp;
devcb2_write8 m_write_solenoid;
};
class decocpu_type2_device : public decocpu_type1_device
{
public:
decocpu_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
decocpu_type2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
protected:
// overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_start();
};
class decocpu_type3_device : public decocpu_type2_device
{
public:
decocpu_type3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// overrides
virtual void device_start();
};
extern const device_type DECOCPU1;
extern const device_type DECOCPU2;
extern const device_type DECOCPU3;
#endif /* DECOPINCPU_H_ */

View File

@ -1920,6 +1920,7 @@ $(MAMEOBJ)/pinball.a: \
$(DRIVERS)/capcom.o \
$(DRIVERS)/de_2.o \
$(DRIVERS)/de_3.o \
$(MACHINE)/decopincpu.o \
$(VIDEO)/decodmd1.o \
$(VIDEO)/decodmd2.o \
$(DRIVERS)/de_3b.o \