cop400: added L pins tri-state callback (nw)

I'll summarize the cop400 changes manually in whatsnew next week
This commit is contained in:
hap 2016-12-21 17:50:41 +01:00
parent cdc30dbeee
commit 866f537c6d
5 changed files with 15 additions and 27 deletions

View File

@ -176,6 +176,7 @@ cop400_cpu_device::cop400_cpu_device(const machine_config &mconfig, device_type
, m_program_config("program", ENDIANNESS_LITTLE, 8, program_addr_bits, 0, internal_map_program)
, m_data_config("data", ENDIANNESS_LITTLE, 8, data_addr_bits, 0, internal_map_data) // data width is really 4
, m_read_l(*this)
, m_read_l_tristate(*this)
, m_write_l(*this)
, m_read_g(*this)
, m_write_g(*this)
@ -904,6 +905,7 @@ void cop400_cpu_device::device_start()
/* find i/o handlers */
m_read_l.resolve_safe(0);
m_read_l_tristate.resolve_safe(0);
m_write_l.resolve_safe();
m_read_g.resolve_safe(0);
m_write_g.resolve_safe();

View File

@ -20,6 +20,9 @@
cop400_cpu_device::set_read_l_callback(*device, DEVCB_##_devcb);
#define MCFG_COP400_WRITE_L_CB(_devcb) \
cop400_cpu_device::set_write_l_callback(*device, DEVCB_##_devcb);
// output state when pins are in tri-state, default 0
#define MCFG_COP400_READ_L_TRISTATE_CB(_devcb) \
cop400_cpu_device::set_read_l_tristate_callback(*device, DEVCB_##_devcb);
// G pins: 4-bit bi-directional
#define MCFG_COP400_READ_G_CB(_devcb) \
@ -125,6 +128,7 @@ public:
// static configuration helpers
template<class _Object> static devcb_base &set_read_l_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_read_l.set_callback(object); }
template<class _Object> static devcb_base &set_read_l_tristate_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_read_l_tristate.set_callback(object); }
template<class _Object> static devcb_base &set_write_l_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_write_l.set_callback(object); }
template<class _Object> static devcb_base &set_read_g_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_read_g.set_callback(object); }
template<class _Object> static devcb_base &set_write_g_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_write_g.set_callback(object); }
@ -176,6 +180,7 @@ protected:
// i/o handlers
devcb_read8 m_read_l;
devcb_read8 m_read_l_tristate;
devcb_write8 m_write_l;
devcb_read8 m_read_g;
devcb_write8 m_write_g;

View File

@ -950,7 +950,8 @@ INSTRUCTION( lei )
}
else
{
OUT_L(0);
// tri-state(floating) pins
OUT_L(m_read_l_tristate(0, 0xff));
}
}

View File

@ -718,6 +718,7 @@ public:
DECLARE_WRITE8_MEMBER(write_d);
DECLARE_WRITE8_MEMBER(write_l);
DECLARE_WRITE8_MEMBER(write_g);
DECLARE_READ8_MEMBER(read_l_tristate) { return 0xff; }
DECLARE_INPUT_CHANGED_MEMBER(reset_button);
};
@ -735,7 +736,7 @@ WRITE8_MEMBER(funrlgl_state::write_l)
{
// L0-L3: led state
// L4-L7: N/C
m_l = data & 0xf;
m_l = ~data & 0xf;
display_matrix(4, 4, m_l, m_d);
}
@ -775,6 +776,7 @@ static MACHINE_CONFIG_START( funrlgl, funrlgl_state )
MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_8, COP400_CKO_OSCILLATOR_OUTPUT, true) // guessed
MCFG_COP400_WRITE_D_CB(WRITE8(funrlgl_state, write_d))
MCFG_COP400_WRITE_L_CB(WRITE8(funrlgl_state, write_l))
MCFG_COP400_READ_L_TRISTATE_CB(READ8(funrlgl_state, read_l_tristate))
MCFG_COP400_WRITE_G_CB(WRITE8(funrlgl_state, write_g))
MCFG_COP400_READ_G_CB(IOPORT("IN.0"))
@ -1344,7 +1346,7 @@ CONS( 1980, h2hbaskb, 0, 0, h2hbaskb, h2hbaskb, driver_device, 0, "Col
CONS( 1981, einvaderc, einvader, 0, einvaderc, einvaderc, driver_device, 0, "Entex", "Space Invader (Entex, COP444L version)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK )
CONS( 1979, funjacks, 0, 0, funjacks, funjacks, driver_device, 0, "Mattel", "Funtronics Jacks", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING )
CONS( 1979, funrlgl, 0, 0, funrlgl, funrlgl, driver_device, 0, "Mattel", "Funtronics Red Light Green Light", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING )
CONS( 1979, funrlgl, 0, 0, funrlgl, funrlgl, driver_device, 0, "Mattel", "Funtronics Red Light Green Light", MACHINE_SUPPORTS_SAVE )
CONS( 1980, plus1, 0, 0, plus1, plus1, driver_device, 0, "Milton Bradley", "Plus One", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // ***
CONS( 1981, lightfgt, 0, 0, lightfgt, lightfgt, driver_device, 0, "Milton Bradley", "Lightfight", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -18,9 +18,9 @@
<!-- build screen -->
<view name="Internal Layout">
<bounds left="-1" right="12" top="-0.2" bottom="20" />
<bounds left="-1" right="12" top="-0.2" bottom="12" />
<bezel element="static_black">
<bounds left="-1" right="12" top="-0.2" bottom="20" />
<bounds left="-1" right="12" top="-0.2" bottom="12" />
</bezel>
<bezel name="0.0" element="ledr"><bounds x="0" y="0" width="1" height="1" /></bezel>
@ -40,27 +40,5 @@
<bezel name="0.3" element="ledr"><bounds x="10" y="8" width="1" height="1" /></bezel>
<bezel name="1.3" element="ledr"><bounds x="10" y="10" width="1" height="1" /></bezel>
<!-- test -->
<bezel name="0.0" element="ledr"><bounds x="0" y="12" width="1" height="1" /></bezel>
<bezel name="0.1" element="ledr"><bounds x="1" y="12" width="1" height="1" /></bezel>
<bezel name="0.2" element="ledr"><bounds x="2" y="12" width="1" height="1" /></bezel>
<bezel name="0.3" element="ledr"><bounds x="3" y="12" width="1" height="1" /></bezel>
<bezel name="1.0" element="ledr"><bounds x="0" y="13" width="1" height="1" /></bezel>
<bezel name="1.1" element="ledr"><bounds x="1" y="13" width="1" height="1" /></bezel>
<bezel name="1.2" element="ledr"><bounds x="2" y="13" width="1" height="1" /></bezel>
<bezel name="1.3" element="ledr"><bounds x="3" y="13" width="1" height="1" /></bezel>
<bezel name="2.0" element="ledr"><bounds x="0" y="14" width="1" height="1" /></bezel>
<bezel name="2.1" element="ledr"><bounds x="1" y="14" width="1" height="1" /></bezel>
<bezel name="2.2" element="ledr"><bounds x="2" y="14" width="1" height="1" /></bezel>
<bezel name="2.3" element="ledr"><bounds x="3" y="14" width="1" height="1" /></bezel>
<bezel name="3.0" element="ledr"><bounds x="0" y="15" width="1" height="1" /></bezel>
<bezel name="3.1" element="ledr"><bounds x="1" y="15" width="1" height="1" /></bezel>
<bezel name="3.2" element="ledr"><bounds x="2" y="15" width="1" height="1" /></bezel>
<bezel name="3.3" element="ledr"><bounds x="3" y="15" width="1" height="1" /></bezel>
</view>
</mamelayout>