summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2020-10-03 08:12:29 +0200
committer Ivan Vangelista <mesgnet@yahoo.it>2020-10-03 08:12:29 +0200
commitbb64dd17bccfa1765a883426e562c2bd8af5c1fc (patch)
tree2ef5fb8cc2cd9d904459e51be81f35cc15db2812
parent9ac531e2b9aa690910cbeb35a14bd93fb001592b (diff)
6840ptm.cpp: updated m_gate initialization as per comments to d026d1ba845f899b9faa3f45e5f44fba526f5948 . It seems to fix the remaining on and off crashes in cmi2x
-rw-r--r--src/devices/machine/6840ptm.cpp6
-rw-r--r--src/devices/machine/6840ptm.h1
-rw-r--r--src/mame/drivers/cmi.cpp14
3 files changed, 14 insertions, 7 deletions
diff --git a/src/devices/machine/6840ptm.cpp b/src/devices/machine/6840ptm.cpp
index 3e460f4c3f1..21d8c0d80e9 100644
--- a/src/devices/machine/6840ptm.cpp
+++ b/src/devices/machine/6840ptm.cpp
@@ -153,10 +153,14 @@ void ptm6840_device::device_reset()
m_fired[i] = 0;
m_enabled[i] = 0;
m_mode[i] = 0;
- m_gate[i] = 0;
}
}
+void ptm6840_device::device_resolve_objects()
+{
+ for (int i = 0; i < 3; i++)
+ m_gate[i] = 0;
+}
//-------------------------------------------------
// device_timer - handle timer callbacks
diff --git a/src/devices/machine/6840ptm.h b/src/devices/machine/6840ptm.h
index 537fd4e7c19..6836aa5d317 100644
--- a/src/devices/machine/6840ptm.h
+++ b/src/devices/machine/6840ptm.h
@@ -58,6 +58,7 @@ protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
+ virtual void device_resolve_objects() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
private:
diff --git a/src/mame/drivers/cmi.cpp b/src/mame/drivers/cmi.cpp
index dc0d8a940a4..2f83ed95871 100644
--- a/src/mame/drivers/cmi.cpp
+++ b/src/mame/drivers/cmi.cpp
@@ -2048,6 +2048,14 @@ void cmi_state::machine_reset()
m_m6809_bs_hack_cnt[0] = 0;
m_m6809_bs_hack_cnt[1] = 0;
+ //m_midi_ptm[0]->set_g1(1); // /G1 has unknown source, "TIMER 1A /GATE" per schematic
+ m_midi_ptm[0]->set_g2(0); // /G2 and /G3 wired to ground per schematic
+ m_midi_ptm[0]->set_g3(0);
+
+ m_midi_ptm[1]->set_g1(0); // /G1, /G2, and /G3 wired to ground per schematic
+ m_midi_ptm[1]->set_g2(0);
+ m_midi_ptm[1]->set_g3(0);
+
memset(m_map_sel, 0, 16);
for (int i = 0; i < 4; i++)
@@ -2229,17 +2237,11 @@ void cmi_state::cmi2x(machine_config &config)
PTM6840(config, m_midi_ptm[0], 0);
m_midi_ptm[0]->set_external_clocks(0, 384000, 0); // C1 is 0, C2 is 384kHz per schematic block diagram, C3 is CLICK SYNC IN
- //m_midi_ptm[0]->set_g1(1); // /G1 has unknown source, "TIMER 1A /GATE" per schematic
- m_midi_ptm[0]->set_g2(0); // /G2 and /G3 wired to ground per schematic
- m_midi_ptm[0]->set_g3(0);
//m_midi_ptm[0]->o1_callback().set(FUNC(cmi_state::midi_ptm0_c1_w)); // TIMER 1A O/P per schematic
//m_midi_ptm[0]->o2_callback().set(FUNC(cmi_state::midi_ptm0_c2_w)); // CLK 2 per schematic
m_midi_ptm[0]->o3_callback().set(FUNC(cmi_state::midi_ptm0_c3_w));
PTM6840(config, m_midi_ptm[1], 0); // entirely clocked by PTM 0
- m_midi_ptm[1]->set_g1(0); // /G1, /G2, and /G3 wired to ground per schematic
- m_midi_ptm[1]->set_g2(0);
- m_midi_ptm[1]->set_g3(0);
//m_midi_ptm[1]->o1_callback().set(FUNC(cmi_state::midi_sync_out_1_w)); // SYNC OUT 1 per schematic
//m_midi_ptm[1]->o2_callback().set(FUNC(cmi_state::midi_sync_out_2_w)); // SYNC OUT 2 per schematic
//m_midi_ptm[1]->o3_callback().set(FUNC(cmi_state::midi_sync_out_3_w)); // SYNC OUT 3 per schematic