mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
polyplay: add light organ + layout
traced the lines on the board to figure out how the lightorgan worked. a zero cross detector triggers NMI on the cpu, which then operates the light organ.
This commit is contained in:
parent
1981f6bc2c
commit
5970379b7c
@ -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
|
||||
*/
|
||||
uint8_t lightState = data & 0x07;
|
||||
//uint8_t soundState = data & 0xe0;
|
||||
|
||||
/* ZRE-PP
|
||||
pio_portb_w: f8
|
||||
*/
|
||||
osd_printf_verbose("pio_portb_w: %02x\n", data);
|
||||
// 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 )
|
||||
|
@ -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);
|
||||
|
112
src/mame/layout/polyplay.lay
Normal file
112
src/mame/layout/polyplay.lay
Normal file
@ -0,0 +1,112 @@
|
||||
<?xml version="1.0"?>
|
||||
<mamelayout version="2">
|
||||
<element name="redpiece1">
|
||||
<disk state ="0">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="0.3" green="0.1" blue="0.1" />
|
||||
</disk>
|
||||
<disk state ="1">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="1.0" green="0.1" blue="0.1" />
|
||||
</disk>
|
||||
</element>
|
||||
<element name="bluepiece1">
|
||||
<disk state ="0">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="0.1" green="0.1" blue="0.3" />
|
||||
</disk>
|
||||
<disk state ="1">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="0.1" green="0.1" blue="1.0" />
|
||||
</disk>
|
||||
</element>
|
||||
<element name="yellowpiece1">
|
||||
<disk state ="0">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="0.3" green="0.3" blue="0.1" />
|
||||
</disk>
|
||||
<disk state ="1">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="1.0" green="1.0" blue="0.1" />
|
||||
</disk>
|
||||
</element>
|
||||
<element name="greenpiece1">
|
||||
<disk state ="0">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="0.1" green="0.3" blue="0.1" />
|
||||
</disk>
|
||||
<disk state ="1">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="0.1" green="1.0" blue="0.1" />
|
||||
</disk>
|
||||
</element>
|
||||
<element name="redpiece2">
|
||||
<disk state ="0">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="0.3" green="0.1" blue="0.1" />
|
||||
</disk>
|
||||
<disk state ="1">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="1.0" green="0.1" blue="0.1" />
|
||||
</disk>
|
||||
</element>
|
||||
<element name="bluepiece2">
|
||||
<disk state ="0">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="0.1" green="0.1" blue="0.3" />
|
||||
</disk>
|
||||
<disk state ="1">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="0.1" green="0.1" blue="1.0" />
|
||||
</disk>
|
||||
</element>
|
||||
<element name="yellowpiece2">
|
||||
<disk state ="0">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="0.3" green="0.3" blue="0.1" />
|
||||
</disk>
|
||||
<disk state ="1">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="1.0" green="1.0" blue="0.1" />
|
||||
</disk>
|
||||
</element>
|
||||
<element name="greenpiece2">
|
||||
<disk state ="0">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="0.1" green="0.3" blue="0.1" />
|
||||
</disk>
|
||||
<disk state ="1">
|
||||
<bounds x="0" y="0" width="7" height="7" />
|
||||
<color red="0.1" green="1.0" blue="0.1" />
|
||||
</disk>
|
||||
</element>
|
||||
<view name="Light organ without frontispiece">
|
||||
<backdrop name="lamp1" element="redpiece1" state="0">
|
||||
<bounds x="560" y="0" width="70" height="70"/>
|
||||
</backdrop>
|
||||
<backdrop name="lamp1" element="redpiece2" state="0">
|
||||
<bounds x="240" y="0" width="70" height="70"/>
|
||||
</backdrop>
|
||||
<backdrop name="lamp2" element="bluepiece2" state="0">
|
||||
<bounds x="160" y="0" width="70" height="70"/>
|
||||
</backdrop>
|
||||
<backdrop name="lamp2" element="bluepiece1" state="0">
|
||||
<bounds x="480" y="0" width="70" height="70"/>
|
||||
</backdrop>
|
||||
<backdrop name="lamp3" element="yellowpiece1" state="0">
|
||||
<bounds x="400" y="0" width="70" height="70"/>
|
||||
</backdrop>
|
||||
<backdrop name="lamp3" element="yellowpiece2" state="0">
|
||||
<bounds x="80" y="0" width="70" height="70"/>
|
||||
</backdrop>
|
||||
<backdrop name="lamp4" element="greenpiece2" state="0">
|
||||
<bounds x="0" y="0" width="70" height="70"/>
|
||||
</backdrop>
|
||||
<backdrop name="lamp4" element="greenpiece1" state="0">
|
||||
<bounds x="320" y="0" width="70" height="70"/>
|
||||
</backdrop>
|
||||
<screen index="0">
|
||||
<bounds x="0" y="80" width="640" height="480" />
|
||||
</screen>
|
||||
</view>
|
||||
</mamelayout>
|
Loading…
Reference in New Issue
Block a user