More work on pong doubles. Working again (if enabled).

This commit is contained in:
Couriersud 2014-05-04 21:38:11 +00:00
parent 2ca54e049f
commit 962bf9df8b
6 changed files with 98 additions and 34 deletions

View File

@ -2,8 +2,12 @@
// copyright-holders:DICE Team,couriersud
/*
* Changelog:
* - Original version imported from DICE
* - Added discrete paddle potentiometers (couriersud)
* - Changes made to run in MAME (couriersud)
* - Original version imported from DICE
*
* TODO:
* - implement trimmers
*
* The MAME team has asked for and received written confirmation from the
* author of DICE to use, modify and redistribute code under
@ -68,11 +72,11 @@
static Mono555Desc a3_555_desc(K_OHM(100.0), U_FARAD(0.1));
static Mono555Desc a10_555_desc(K_OHM(70.0), U_FARAD(0.1));
static Mono555Desc b10_555_desc(K_OHM(70.0), U_FARAD(0.1));
static Mono555Desc a10_555_desc(K_OHM(70.0), U_FARAD(0.1)); // actually 56k + 50k trimmer
static Mono555Desc b10_555_desc(K_OHM(70.0), U_FARAD(0.1)); // actually 56k + 50k trimmer
static Mono555Desc b9a_555_desc(K_OHM(70.0), U_FARAD(0.1));
static Mono555Desc b9b_555_desc(K_OHM(70.0), U_FARAD(0.1));
static Mono555Desc b9a_555_desc(K_OHM(70.0), U_FARAD(0.1)); // actually 56k + 50k trimmer
static Mono555Desc b9b_555_desc(K_OHM(70.0), U_FARAD(0.1)); // actually 56k + 50k trimmer
static Mono555Desc f5_555_desc(K_OHM(330.0), U_FARAD(4.7));
static Mono555Desc g5_555_desc(K_OHM(220.0), U_FARAD(1.0));
@ -137,6 +141,18 @@ CIRCUIT_LAYOUT( pongdoubles )
//CHIP("B10", 555_Mono, &b10_555_desc)
CHIP_555_Mono(B10, &b10_555_desc)
// NETLIST - analog start
POT(B10_POT, RES_K(1)) // This is a guess!!
PARAM(B10_POT.DIALLOG, 1) // Log Dial ...
RES(B10_RPRE, 470)
NET_C(B10_POT.1, V5)
NET_C(B10_POT.3, GND)
NET_C(B10_POT.2, B10_RPRE.1)
NET_C(B10_RPRE.2, B10.5)
// NETLIST - analog end
CHIP("C10", 7404)
CHIP("A7", 7493)
CHIP("B8", 7400)
@ -144,7 +160,19 @@ CIRCUIT_LAYOUT( pongdoubles )
//CHIP("A10", 555_Mono, &a10_555_desc)
CHIP_555_Mono(A10, &a10_555_desc)
CHIP("A9", 7493)
// NETLIST - analog start
POT(A10_POT, RES_K(1)) // This is a guess!!
PARAM(A10_POT.DIALLOG, 1) // Log Dial ...
RES(A10_RPRE, 470)
NET_C(A10_POT.1, V5)
NET_C(A10_POT.3, GND)
NET_C(A10_POT.2, A10_RPRE.1)
NET_C(A10_RPRE.2, A10.5)
// NETLIST - analog end
CHIP("A9", 7493)
CHIP("H4", 7474)
@ -208,9 +236,32 @@ CIRCUIT_LAYOUT( pongdoubles )
//CHIP("B9A", 555_Mono, &b9a_555_desc)
CHIP_555_Mono(B9A, &b9a_555_desc)
// NETLIST - analog start
POT(B9A_POT, RES_K(1)) // This is a guess!!
PARAM(B9A_POT.DIALLOG, 1) // Log Dial ...
RES(B9A_RPRE, 470)
NET_C(B9A_POT.1, V5)
NET_C(B9A_POT.3, GND)
NET_C(B9A_POT.2, B9A_RPRE.1)
NET_C(B9A_RPRE.2, B9A.5)
// NETLIST - analog end
//CHIP("B9B", 555_Mono, &b9b_555_desc)
CHIP_555_Mono(B9B, &b9b_555_desc)
// NETLIST - analog start
POT(B9B_POT, RES_K(1)) // This is a guess!!
PARAM(B9B_POT.DIALLOG, 1) // Log Dial ...
RES(B9B_RPRE, 470)
NET_C(B9B_POT.1, V5)
NET_C(B9B_POT.3, GND)
NET_C(B9B_POT.2, B9B_RPRE.1)
NET_C(B9B_RPRE.2, B9B.5)
// NETLIST - analog end
CHIP_SERIES_RC(C33, &c33_desc)
#if 0
@ -235,11 +286,11 @@ CIRCUIT_LAYOUT( pongdoubles )
#endif
//CHIP("COIN", COIN_INPUT)
CHIP_INPUT(COIN)
CHIP_INPUT_ACTIVE_LOW(COIN)
//CHIP("LATCH", LATCH)
CHIP_LATCH(LATCH)
//CHIP("START", START_INPUT)
CHIP_INPUT(START)
CHIP_INPUT_ACTIVE_HIGH(START)
//CHIP("DIPSW1", DIPSWITCH, &dipswitch1_desc)
SWITCH2(DIPSW1)
SWITCH2(DIPSW2)

View File

@ -841,17 +841,18 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start()
m_mat_solvers.add(ms);
SOLVER_VERBOSE_OUT(("%d ==> %d nets %s\n", i, groups[i].count(), (*groups[i].first())->m_head->name().cstr()));
SOLVER_VERBOSE_OUT((" has %s elements\n", ms->is_dynamic() ? "dynamic" : "no dynamic"));
SOLVER_VERBOSE_OUT((" has %s elements\n", ms->is_timestep() ? "timestep" : "no timestep"));
netlist().log("Solver %s", ms->name().cstr());
netlist().log(" # %d ==> %d nets %s", i, groups[i].count(), (*(*groups[i].first())->m_core_terms.first())->name().cstr());
netlist().log(" has %s elements", ms->is_dynamic() ? "dynamic" : "no dynamic");
netlist().log(" has %s elements", ms->is_timestep() ? "timestep" : "no timestep");
for (int j=0; j<groups[i].count(); j++)
{
SOLVER_VERBOSE_OUT(("Net %d: %s\n", j, groups[i][j]->name().cstr()));
netlist().log("Net %d: %s", j, groups[i][j]->name().cstr());
netlist_net_t *n = groups[i][j];
for (int k = 0; k < n->m_core_terms.count(); k++)
{
ATTR_UNUSED netlist_core_terminal_t *p = n->m_core_terms[k];
SOLVER_VERBOSE_OUT((" %s\n", p->name().cstr()));
const netlist_core_terminal_t *p = n->m_core_terms[k];
netlist().log(" %s", p->name().cstr());
}
}
}

View File

@ -22,14 +22,14 @@ NETLIB_RESET(nicRSFF)
NETLIB_UPDATE(nicRSFF)
{
if (INPLOGIC(m_S))
if (!INPLOGIC(m_S))
{
OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(20));
OUTLOGIC(m_QQ, 0, NLTIME_FROM_NS(20));
}
else if (!INPLOGIC(m_R))
{
OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(10));
OUTLOGIC(m_QQ, 0, NLTIME_FROM_NS(10));
}
else if (INPLOGIC(m_R))
{
OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(10));
OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(10));
OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(20));
OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(20));
}
}

View File

@ -62,16 +62,22 @@ public:
ALIAS(_name.2, _name ## _R.2) \
ALIAS(_name.1, _name ## _C.1)
#define CHIP_INPUT(_name) \
#define CHIP_INPUT_ACTIVE_LOW(_name) \
SWITCH2(_name ## _SW) \
NET_C(_name ## _SW.2, V5) \
NET_CSTR(# _name "_SW.1", "GND") \
NET_C(_name ## _SW.1, V5) \
NET_CSTR(# _name "_SW.2", "GND") \
ALIAS(_name.1, _name ## _SW.Q)
#define CHIP_INPUT_ACTIVE_HIGH(_name) \
SWITCH2(_name ## _SW) \
NET_C(_name ## _SW.2, V5) \
NET_CSTR(# _name "_SW.1", "GND") \
ALIAS(_name.1, _name ## _SW.Q)
#define CHIP_LATCH(_name) \
NETDEV_RSFF(_name) \
ALIAS(_name.1, _name.S) \
ALIAS(_name.2, _name.R) \
ALIAS(_name.1, _name.R) \
ALIAS(_name.2, _name.S) \
ALIAS(_name.3, _name.QQ)

View File

@ -393,7 +393,7 @@ nld_base_d_to_a_proxy *netlist_setup_t::get_d_a_proxy(netlist_output_t &out)
{
// create a new one ...
proxy = new nld_d_to_a_proxy(out);
pstring x = pstring::sprintf("proxy_da_%d", m_proxy_cnt);
pstring x = pstring::sprintf("proxy_da_%s_%d", out.name().cstr(), m_proxy_cnt);
m_proxy_cnt++;
register_dev(proxy, x);
@ -423,7 +423,7 @@ void netlist_setup_t::connect_input_output(netlist_input_t &in, netlist_output_t
if (out.isFamily(netlist_terminal_t::ANALOG) && in.isFamily(netlist_terminal_t::LOGIC))
{
nld_a_to_d_proxy *proxy = new nld_a_to_d_proxy(in);
pstring x = pstring::sprintf("proxy_ad_%d", m_proxy_cnt);
pstring x = pstring::sprintf("proxy_ad_%s_%d", in.name().cstr(), m_proxy_cnt);
m_proxy_cnt++;
register_dev(proxy, x);
@ -456,7 +456,7 @@ void netlist_setup_t::connect_terminal_input(netlist_terminal_t &term, netlist_i
{
NL_VERBOSE_OUT(("connect_terminal_input: connecting proxy\n"));
nld_a_to_d_proxy *proxy = new nld_a_to_d_proxy(inp);
pstring x = pstring::sprintf("proxy_da_%d", m_proxy_cnt);
pstring x = pstring::sprintf("proxy_ad_%s_%d", inp.name().cstr(), m_proxy_cnt);
m_proxy_cnt++;
register_dev(proxy, x);

View File

@ -830,13 +830,17 @@ INPUT_PORTS_END
#if PONGD
static INPUT_PORTS_START( pongd )
#if 0
PORT_START( "PADDLE0" ) /* fake input port for player 1 paddle */
PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot0")
PORT_START( "PADDLE1" ) /* fake input port for player 2 paddle */
PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(2) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot1")
#endif
PORT_START( "PADDLE2" ) /* fake input port for player 3 paddle */
PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(3) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot2")
PORT_START( "PADDLE3" ) /* fake input port for player 4 paddle */
PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(4) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot3")
PORT_START("IN0") /* fake as well */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) NETLIST_LOGIC_PORT_CHANGED("maincpu", "coinsw")
@ -931,9 +935,11 @@ static MACHINE_CONFIG_START( pongd, pong_state )
MCFG_NETLIST_ANALOG_INPUT_MULT_OFFSET(1.0 / 100.0 * RES_K(50), RES_K(56) )
MCFG_NETLIST_ANALOG_INPUT("maincpu", "vr1", "ic_a9_R.R")
MCFG_NETLIST_ANALOG_INPUT_MULT_OFFSET(1.0 / 100.0 * RES_K(50), RES_K(56) )
MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot0", "ic_b9_POT.DIAL")
MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot1", "ic_a9_POT.DIAL")
#endif
MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot0", "A10_POT.DIAL")
MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot1", "B10_POT.DIAL")
MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot2", "B9B_POT.DIAL")
MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot3", "B9A_POT.DIAL")
MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1a", "DIPSW1.POS", 0, 0x01)
MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1b", "DIPSW2.POS", 0, 0x01)
MCFG_NETLIST_LOGIC_INPUT("maincpu", "coinsw", "COIN_SW.POS", 0, 0x01)