summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2026-05-04 13:19:38 +0200
committer hap <happppp@users.noreply.github.com>2026-05-04 13:19:55 +0200
commite64983d9abf3129a51d3470cc196e2afcd022582 (patch)
treed438d48e07ffb3c855bcba5c96810b51dda2ea8e
parent09b0ab540c731155e76a784f909d93cde6c6e6b1 (diff)
mboard: add low level interface
-rw-r--r--src/mame/hegenerglaser/mboard.cpp106
-rw-r--r--src/mame/hegenerglaser/mboard.h22
-rw-r--r--src/mame/saitek/leonardo.cpp11
-rw-r--r--src/mame/videogames/looping.cpp10
4 files changed, 125 insertions, 24 deletions
diff --git a/src/mame/hegenerglaser/mboard.cpp b/src/mame/hegenerglaser/mboard.cpp
index 3be8dd534da..c9b67483883 100644
--- a/src/mame/hegenerglaser/mboard.cpp
+++ b/src/mame/hegenerglaser/mboard.cpp
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Sandro Ronco
+// copyright-holders:Sandro Ronco, hap
/*******************************************************************************
Hegener + Glaser Mephisto Sensors Board, for modular chesscomputers
@@ -76,13 +76,31 @@ void mephisto_board_device::device_start()
{
m_led_out.resolve();
+ m_board->set_delay(m_sensordelay);
+
+ // zerofill
m_mux = 0xff;
m_led_data = 0;
+ m_led_latch = 0;
+ m_cb_latch = 0xff;
+
+ m_data = 0;
+ m_row_le = 0;
+ m_ldc_le = 0;
+ m_ldc_en = 0;
+ m_cb_en = 0;
+ // register for savestates
save_item(NAME(m_mux));
save_item(NAME(m_led_data));
-
- m_board->set_delay(m_sensordelay);
+ save_item(NAME(m_led_latch));
+ save_item(NAME(m_cb_latch));
+
+ save_item(NAME(m_data));
+ save_item(NAME(m_row_le));
+ save_item(NAME(m_ldc_le));
+ save_item(NAME(m_ldc_en));
+ save_item(NAME(m_cb_en));
}
@@ -93,7 +111,10 @@ void mephisto_board_device::device_start()
void mephisto_board_device::device_reset()
{
m_mux = 0xff;
- m_led_data = 0x00;
+ m_led_data = 0;
+ m_led_latch = 0;
+ m_cb_latch = 0xff;
+
update_led_pwm();
}
@@ -102,12 +123,20 @@ void mephisto_board_device::device_reset()
// I/O handlers
//-------------------------------------------------
+// misc
+
void mephisto_board_device::refresh_leds_w(offs_t offset, u8 data)
{
if (!m_disable_leds)
m_led_out[(offset >> 6 & 7) | (offset & 7) << 3] = data;
}
+
+// high level interface
+
+// note: the 2 interfaces are identical hardware, the high level one just assumes
+// automatic CS and RW handling via MAME addressmaps
+
u8 mephisto_board_device::input_r()
{
u8 data = 0xff;
@@ -119,11 +148,6 @@ u8 mephisto_board_device::input_r()
return data;
}
-u8 mephisto_board_device::mux_r()
-{
- return m_mux;
-}
-
void mephisto_board_device::mux_w(u8 data)
{
m_mux = data;
@@ -135,3 +159,67 @@ void mephisto_board_device::led_w(u8 data)
m_led_data = data;
update_led_pwm();
}
+
+
+// low level interface
+
+void mephisto_board_device::update_board()
+{
+ if (m_row_le)
+ mux_w(m_data);
+
+ if (m_ldc_le)
+ m_led_latch = m_data;
+
+ if (m_ldc_en)
+ m_cb_latch = input_r();
+ else
+ led_w(m_led_latch);
+}
+
+u8 mephisto_board_device::data_r()
+{
+ if (m_cb_en)
+ return 0xff;
+
+ return m_ldc_en ? input_r() : m_cb_latch;
+}
+
+void mephisto_board_device::data_w(u8 data)
+{
+ m_data = data;
+ update_board();
+}
+
+void mephisto_board_device::row_le_w(int state)
+{
+ // 74373(1) /LE
+ m_row_le = state ? 1 : 0;
+ update_board();
+}
+
+void mephisto_board_device::ldc_le_w(int state)
+{
+ // 74373(2) /LE
+ m_ldc_le = state ? 1 : 0;
+ update_board();
+}
+
+void mephisto_board_device::ldc_en_w(int state)
+{
+ // 74373(2) /OE & 74373(3) /LE
+ state = state ? 1 : 0;
+
+ // refresh inputs
+ if (!state && m_ldc_en)
+ m_cb_latch = input_r();
+
+ m_ldc_en = state;
+ update_board();
+}
+
+void mephisto_board_device::cb_en_w(int state)
+{
+ // 74373(3) /OE
+ m_cb_en = state ? 1 : 0;
+}
diff --git a/src/mame/hegenerglaser/mboard.h b/src/mame/hegenerglaser/mboard.h
index 9471c896ae3..d82bb78a193 100644
--- a/src/mame/hegenerglaser/mboard.h
+++ b/src/mame/hegenerglaser/mboard.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Sandro Ronco
+// copyright-holders:Sandro Ronco, hap
/*******************************************************************************
Mephisto Modular Sensors Board
@@ -29,11 +29,19 @@ public:
sensorboard_device *get() { return m_board; }
+ // high level interface (typical cpu addressmap)
u8 input_r();
void led_w(u8 data);
- u8 mux_r();
void mux_w(u8 data);
+ // low level interface (direct pin access)
+ u8 data_r();
+ void data_w(u8 data);
+ void row_le_w(int state);
+ void ldc_le_w(int state);
+ void ldc_en_w(int state);
+ void cb_en_w(int state);
+
protected:
// device-level overrides
virtual void device_start() override ATTR_COLD;
@@ -42,6 +50,7 @@ protected:
void set_config(machine_config &config, sensorboard_device::sb_type board_type);
void refresh_leds_w(offs_t offset, u8 data);
void update_led_pwm() { m_led_pwm->matrix(~m_mux, m_led_data); }
+ void update_board();
required_device<sensorboard_device> m_board;
required_device<pwm_display_device> m_led_pwm;
@@ -51,6 +60,15 @@ protected:
bool m_disable_leds;
u8 m_led_data;
u8 m_mux;
+
+ u8 m_led_latch;
+ u8 m_cb_latch;
+
+ u8 m_data;
+ int m_row_le;
+ int m_ldc_le;
+ int m_ldc_en;
+ int m_cb_en;
};
diff --git a/src/mame/saitek/leonardo.cpp b/src/mame/saitek/leonardo.cpp
index ff76c5783d3..a46eb031123 100644
--- a/src/mame/saitek/leonardo.cpp
+++ b/src/mame/saitek/leonardo.cpp
@@ -51,11 +51,12 @@ Known expansion modules:
- Brute Force (H8, Frans Morsch)
- Sparc (SPARClite, Spracklen's)
-The H8 Brute Force module doesn't work with the 1st program version of Leonardo,
-this is mentioned in the repair manual and it says it requires an EPROM upgrade.
-The Sparc module doesn't appear to work with it either. Moreover, the Sparc module
-manual mentions that for it to work properly on Leonardo, the chesscomputer needs
-to be upgraded with an EMI PCB (power supply related, meaningless for emulation).
+The H8 Brute Force module doesn't work with the 1st program version of Leonardo
+(setting skill level doesn't work), this is mentioned in the repair manual and
+it says it requires an EPROM upgrade. The Sparc module doesn't appear to work with
+it either. Moreover, the Sparc module manual mentions that for it to work properly
+on Leonardo, the chesscomputer needs to be upgraded with an EMI PCB (power supply
+related, meaningless for emulation).
*******************************************************************************/
diff --git a/src/mame/videogames/looping.cpp b/src/mame/videogames/looping.cpp
index c184b531a6d..b5f3f5d3dbc 100644
--- a/src/mame/videogames/looping.cpp
+++ b/src/mame/videogames/looping.cpp
@@ -429,9 +429,10 @@ void looping_state::int_update(int state)
}
+
/*************************************
*
- * Custom DAC handling
+ * Sound controls
*
*************************************/
@@ -452,13 +453,6 @@ void looping_state::sound_sw(uint8_t data)
}
-
-/*************************************
- *
- * Sound controls
- *
- *************************************/
-
void looping_state::ay_enable_w(int state)
{
for (int output = 0; output < 3; output++)