diff options
-rw-r--r-- | src/mame/drivers/polyplay.cpp | 68 | ||||
-rw-r--r-- | src/mame/includes/polyplay.h | 2 | ||||
-rw-r--r-- | src/mame/layout/polyplay.lay | 117 |
3 files changed, 173 insertions, 14 deletions
diff --git a/src/mame/drivers/polyplay.cpp b/src/mame/drivers/polyplay.cpp index 546d64efbc3..21b9b290775 100644 --- a/src/mame/drivers/polyplay.cpp +++ b/src/mame/drivers/polyplay.cpp @@ -104,9 +104,9 @@ i/o ports: bit 7 = coin sensor (+IRQ to make the game acknowledge it) 85 PIO PORT B - bit 0-4 = light organ (unemulated :)) ) - bit 5-7 = sound parameter (unemulated, it's very difficult to - figure out how those work) + bit 0-2 = light organ + bit 3-4 = control panel (not connected) + bit 5-7 = sound parameter (not used on production units?) 86 PIO CTRL A @@ -135,6 +135,7 @@ this.) #include "cpu/z80/z80.h" #include "cpu/z80/z80daisy.h" #include "includes/polyplay.h" +#include "polyplay.lh" static const z80_daisy_config daisy_chain_zre[] = { @@ -151,6 +152,11 @@ static const z80_daisy_config daisy_chain_zrepp[] = { nullptr } }; +INTERRUPT_GEN_MEMBER(polyplay_state::nmi_handler) +{ + m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); +} + /* I/O Port handling */ WRITE_LINE_MEMBER(polyplay_state::ctc_zc2_w) { @@ -176,14 +182,47 @@ READ8_MEMBER(polyplay_state::pio_portb_r) WRITE8_MEMBER(polyplay_state::pio_portb_w) { - /* ZRE -pio_portb_w: 78 - */ - - /* ZRE-PP -pio_portb_w: f8 - */ - osd_printf_verbose("pio_portb_w: %02x\n", data); + uint8_t lightState = data & 0x07; + //uint8_t soundState = data & 0xe0; + + // there is a DS8205D attached to bit 0 and 1 + switch (lightState) + { + case 0: + output().set_lamp_value(1, 1); + output().set_lamp_value(2, 0); + output().set_lamp_value(3, 0); + output().set_lamp_value(4, 0); + break; + + case 1: + output().set_lamp_value(1, 0); + output().set_lamp_value(2, 1); + output().set_lamp_value(3, 0); + output().set_lamp_value(4, 0); + break; + + case 2: + output().set_lamp_value(1, 0); + output().set_lamp_value(2, 0); + output().set_lamp_value(3, 1); + output().set_lamp_value(4, 0); + break; + + case 3: + output().set_lamp_value(1, 0); + output().set_lamp_value(2, 0); + output().set_lamp_value(3, 0); + output().set_lamp_value(4, 1); + break; + + default: + output().set_lamp_value(1, 0); + output().set_lamp_value(2, 0); + output().set_lamp_value(3, 0); + output().set_lamp_value(4, 0); + break; + } } INPUT_CHANGED_MEMBER(polyplay_state::input_changed) @@ -274,6 +313,7 @@ static MACHINE_CONFIG_START( polyplay_zre, polyplay_state ) MCFG_Z80_DAISY_CHAIN(daisy_chain_zre) MCFG_CPU_PROGRAM_MAP(polyplay_mem_zre) MCFG_CPU_IO_MAP(polyplay_io_zre) + MCFG_CPU_PERIODIC_INT_DRIVER(polyplay_state, nmi_handler, 100) /* A302 - zero cross detection from AC (50Hz) */ /* devices */ MCFG_DEVICE_ADD(Z80CTC_TAG, Z80CTC, POLYPLAY_MAIN_CLOCK / 4) /* UB857D */ @@ -393,6 +433,6 @@ ROM_START( polyplay2c ) ROM_END /* game driver */ -GAME( 1986, polyplay, 0, polyplay_zre, polyplay, driver_device, 0, ROT0, "VEB Polytechnik Karl-Marx-Stadt", "Poly-Play (ZRE)", 0 ) -GAME( 1989, polyplay2, 0, polyplay_zrepp, polyplay, driver_device, 0, ROT0, "VEB Polytechnik Karl-Marx-Stadt", "Poly-Play (ZRE-PP)", 0 ) -GAME( 1989, polyplay2c, polyplay2, polyplay_zrepp, polyplay, driver_device, 0, ROT0, "VEB Polytechnik Karl-Marx-Stadt", "Poly-Play (ZRE-PP - Czech)", 0 ) +GAMEL( 1986, polyplay, 0, polyplay_zre, polyplay, driver_device, 0, ROT0, "VEB Polytechnik Karl-Marx-Stadt", "Poly-Play (ZRE)", 0, layout_polyplay ) +GAMEL( 1989, polyplay2, 0, polyplay_zrepp, polyplay, driver_device, 0, ROT0, "VEB Polytechnik Karl-Marx-Stadt", "Poly-Play (ZRE-PP)", 0, layout_polyplay ) +GAMEL( 1989, polyplay2c, polyplay2, polyplay_zrepp, polyplay, driver_device, 0, ROT0, "VEB Polytechnik Karl-Marx-Stadt", "Poly-Play (ZRE-PP - Czech)", 0, layout_polyplay ) diff --git a/src/mame/includes/polyplay.h b/src/mame/includes/polyplay.h index 1e54ae627d1..4f66519b51d 100644 --- a/src/mame/includes/polyplay.h +++ b/src/mame/includes/polyplay.h @@ -42,6 +42,8 @@ public: required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; + INTERRUPT_GEN_MEMBER(nmi_handler); + /* devices */ DECLARE_WRITE_LINE_MEMBER(ctc_zc0_w); DECLARE_WRITE_LINE_MEMBER(ctc_zc1_w); diff --git a/src/mame/layout/polyplay.lay b/src/mame/layout/polyplay.lay new file mode 100644 index 00000000000..ef1ce3a1dff --- /dev/null +++ b/src/mame/layout/polyplay.lay @@ -0,0 +1,117 @@ +<?xml version="1.0"?> +<mamelayout version="2"> + <element name="red1"> + <text state ="0" string="Y"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="0.3" green="0.1" blue="0.1" /> + </text> + <text state ="1" string="Y"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="1.0" green="0.1" blue="0.1" /> + </text> + </element> + <element name="blue1"> + <text state ="0" string="A"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="0.1" green="0.1" blue="0.3" /> + </text> + <text state ="1" string="A"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="0.1" green="0.1" blue="1.0" /> + </text> + </element> + <element name="yellow1"> + <text state ="0" string="L"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="0.3" green="0.3" blue="0.1" /> + </text> + <text state ="1" string="L"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="1.0" green="1.0" blue="0.1" /> + </text> + </element> + <element name="green1"> + <text state ="0" string="P"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="0.1" green="0.3" blue="0.1" /> + </text> + <text state ="1" string="P"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="0.1" green="1.0" blue="0.1" /> + </text> + </element> + <element name="red2"> + <text state ="0" string="Y"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="0.3" green="0.1" blue="0.1" /> + </text> + <text state ="1" string="Y"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="1.0" green="0.1" blue="0.1" /> + </text> + </element> + <element name="blue2"> + <text state ="0" string="L"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="0.1" green="0.1" blue="0.3" /> + </text> + <text state ="1" string="L"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="0.1" green="0.1" blue="1.0" /> + </text> + </element> + <element name="yellow2"> + <text state ="0" string="O"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="0.3" green="0.3" blue="0.1" /> + </text> + <text state ="1" string="O"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="1.0" green="1.0" blue="0.1" /> + </text> + </element> + <element name="green2"> + <text state ="0" string="P"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="0.1" green="0.3" blue="0.1" /> + </text> + <text state ="1" string="P"> + <bounds x="0" y="0" width="7" height="7" /> + <color red="0.1" green="1.0" blue="0.1" /> + </text> + </element> + <view name="Screen only"> + <screen index="0"> + <bounds x="0" y="0" width="4" height="3" /> + </screen> + </view> + <view name="Screen + Lights"> + <backdrop name="lamp1" element="red1" state="0"> + <bounds x="7" y="0" width="1" height="1"/> + </backdrop> + <backdrop name="lamp2" element="blue1" state="0"> + <bounds x="6" y="0" width="1" height="1"/> + </backdrop> + <backdrop name="lamp3" element="yellow1" state="0"> + <bounds x="5" y="0" width="1" height="1"/> + </backdrop> + <backdrop name="lamp4" element="green1" state="0"> + <bounds x="4" y="0" width="1" height="1"/> + </backdrop> + <backdrop name="lamp1" element="red2" state="0"> + <bounds x="3" y="0" width="1" height="1"/> + </backdrop> + <backdrop name="lamp2" element="blue2" state="0"> + <bounds x="2" y="0" width="1" height="1"/> + </backdrop> + <backdrop name="lamp3" element="yellow2" state="0"> + <bounds x="1" y="0" width="1" height="1"/> + </backdrop> + <backdrop name="lamp4" element="green2" state="0"> + <bounds x="0" y="0" width="1" height="1"/> + </backdrop> + <screen index="0"> + <bounds x="0" y="1" width="8" height="6" /> + </screen> + </view> +</mamelayout>
\ No newline at end of file |