summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2015-03-28 01:12:44 +0100
committer hap <happppp@users.noreply.github.com>2015-03-28 01:12:44 +0100
commit3a42563d21a01ee49a6b6637732a2b5e2c3034cc (patch)
tree8b8c2b5dda78b62b0788e5640dfdc23a6b62718e /src/mess
parentaf0394e428d6004130f995192052ed3ef35c233a (diff)
ssimon speed switch
Diffstat (limited to 'src/mess')
-rw-r--r--src/mess/drivers/hh_tms1k.c29
-rw-r--r--src/mess/drivers/hh_ucom4.c2
-rw-r--r--src/mess/includes/hh_tms1k.h3
3 files changed, 30 insertions, 4 deletions
diff --git a/src/mess/drivers/hh_tms1k.c b/src/mess/drivers/hh_tms1k.c
index aad5eddcab1..3d67cf4a99c 100644
--- a/src/mess/drivers/hh_tms1k.c
+++ b/src/mess/drivers/hh_tms1k.c
@@ -1051,7 +1051,7 @@ void hh_tms1k_state::ebball3_set_clock()
// MCU clock is from an RC circuit(R=47K, C=33pf) oscillating by default at ~340kHz,
// but on PRO, the difficulty switch adds an extra 150K resistor to Vdd to speed
// it up to around ~440kHz.
- m_maincpu->set_unscaled_clock(m_inp_matrix[3]->read() & 1 ? 440000 : 340000);
+ m_maincpu->set_unscaled_clock((m_inp_matrix[3]->read() & 1) ? 440000 : 340000);
}
INPUT_CHANGED_MEMBER(hh_tms1k_state::ebball3_difficulty_switch)
@@ -1570,17 +1570,38 @@ static INPUT_PORTS_START( ssimon )
PORT_BIT( 0x0d, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN.6") // fake
- PORT_CONFNAME( 0x03, 0x00, "Speed" ) //PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, ssimon_speed_switch, NULL)
+ PORT_CONFNAME( 0x03, 0x01, "Speed" ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, ssimon_speed_switch, NULL)
PORT_CONFSETTING( 0x00, "Simple" )
PORT_CONFSETTING( 0x01, "Normal" )
PORT_CONFSETTING( 0x02, "Super" )
INPUT_PORTS_END
+void hh_tms1k_state::ssimon_set_clock()
+{
+ // MCU clock is from an RC circuit with C=100pf, R=x depending on speed switch:
+ // 0 Simple: R=51K -> ~200kHz
+ // 1 Normal: R=37K -> ~275kHz
+ // 2 Super: R=22K -> ~400kHz
+ UINT8 inp = m_inp_matrix[6]->read();
+ m_maincpu->set_unscaled_clock((inp & 2) ? 400000 : ((inp & 1) ? 275000 : 200000));
+}
+
+INPUT_CHANGED_MEMBER(hh_tms1k_state::ssimon_speed_switch)
+{
+ ssimon_set_clock();
+}
+
+MACHINE_RESET_MEMBER(hh_tms1k_state, ssimon)
+{
+ machine_reset();
+ ssimon_set_clock();
+}
+
static MACHINE_CONFIG_START( ssimon, hh_tms1k_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1100, 350000) // x
+ MCFG_CPU_ADD("maincpu", TMS1100, 275000) // see ssimon_set_clock
MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, ssimon_read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, ssimon_write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, ssimon_write_o))
@@ -1588,6 +1609,8 @@ static MACHINE_CONFIG_START( ssimon, hh_tms1k_state )
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_ssimon)
+ MCFG_MACHINE_RESET_OVERRIDE(hh_tms1k_state, ssimon)
+
/* no video! */
/* sound hardware */
diff --git a/src/mess/drivers/hh_ucom4.c b/src/mess/drivers/hh_ucom4.c
index 04023eea11a..f0265b9cb1a 100644
--- a/src/mess/drivers/hh_ucom4.c
+++ b/src/mess/drivers/hh_ucom4.c
@@ -770,7 +770,7 @@ void hh_ucom4_state::tmtennis_set_clock()
// MCU clock is from an LC circuit oscillating by default at ~360kHz,
// but on PRO1, the difficulty switch puts a capacitor across the LC circuit
// to slow it down to ~260kHz.
- m_maincpu->set_unscaled_clock(m_inp_matrix[1]->read() & 0x100 ? 260000 : 360000);
+ m_maincpu->set_unscaled_clock((m_inp_matrix[1]->read() & 0x100) ? 260000 : 360000);
}
INPUT_CHANGED_MEMBER(hh_ucom4_state::tmtennis_difficulty_switch)
diff --git a/src/mess/includes/hh_tms1k.h b/src/mess/includes/hh_tms1k.h
index f45f040609c..c8695899f2c 100644
--- a/src/mess/includes/hh_tms1k.h
+++ b/src/mess/includes/hh_tms1k.h
@@ -112,6 +112,9 @@ public:
DECLARE_WRITE16_MEMBER(ssimon_write_r);
DECLARE_WRITE16_MEMBER(ssimon_write_o);
DECLARE_READ8_MEMBER(ssimon_read_k);
+ void ssimon_set_clock();
+ DECLARE_INPUT_CHANGED_MEMBER(ssimon_speed_switch);
+ DECLARE_MACHINE_RESET(ssimon);
DECLARE_WRITE16_MEMBER(cnsector_write_r);
DECLARE_WRITE16_MEMBER(cnsector_write_o);