summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-12-21 10:04:47 -0500
committer AJR <ajrhacker@users.noreply.github.com>2018-12-21 10:13:52 -0500
commit0f3eb00085210ade9751b69bf63e27c47eca816a (patch)
tree4d9024ab147f4bd3de3cfd9bdda564b8891b99f6
parentcbf1582e4f0c29fcafcc77dea9ef93c56046b8cd (diff)
eepromser: Serial EEPROMs don't actually have reset lines, so remove the device_reset handler that automatically switches back to STATE_IN_RESET at machine reset time
This change might cause erratic behavior in some systems which should be deasserting CS by clearing their EEPROM latches on reset, but is more appropriate for some MCU-based systems which actually depend on CS being automatically asserted through pull-ups when their quasi-bidirectional ports are reset.
-rw-r--r--src/devices/machine/eepromser.cpp11
-rw-r--r--src/devices/machine/eepromser.h1
-rw-r--r--src/mame/drivers/cardinal.cpp29
3 files changed, 27 insertions, 14 deletions
diff --git a/src/devices/machine/eepromser.cpp b/src/devices/machine/eepromser.cpp
index 74acf0a17dc..bd0447258f6 100644
--- a/src/devices/machine/eepromser.cpp
+++ b/src/devices/machine/eepromser.cpp
@@ -205,17 +205,6 @@ void eeprom_serial_base_device::device_start()
save_item(NAME(m_command));
save_item(NAME(m_address));
save_item(NAME(m_shift_register));
-}
-
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void eeprom_serial_base_device::device_reset()
-{
- // reset the base class
- eeprom_base_device::device_reset();
// reset the state
set_state(STATE_IN_RESET);
diff --git a/src/devices/machine/eepromser.h b/src/devices/machine/eepromser.h
index 4ff8634ce02..fffeded7ec7 100644
--- a/src/devices/machine/eepromser.h
+++ b/src/devices/machine/eepromser.h
@@ -38,7 +38,6 @@ protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
// read interfaces differ between implementations
diff --git a/src/mame/drivers/cardinal.cpp b/src/mame/drivers/cardinal.cpp
index 756a550d388..586ac76c7a3 100644
--- a/src/mame/drivers/cardinal.cpp
+++ b/src/mame/drivers/cardinal.cpp
@@ -27,25 +27,39 @@ public:
cardinal_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_eeprom(*this, "eeprom")
+ , m_address_select(false)
{
}
void cardinal(machine_config &config);
+protected:
+ virtual void machine_start() override;
+
private:
u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
u8 p1_r();
void p1_w(u8 data);
+ u8 vtlc_r();
+ void vtlc_w(u8 data);
+
void prog_map(address_map &map);
void ext_map(address_map &map);
required_device<eeprom_serial_93cxx_device> m_eeprom;
//required_device<crt9028_device> m_vtlc;
+
+ bool m_address_select;
};
+void cardinal_state::machine_start()
+{
+ save_item(NAME(m_address_select));
+}
+
u32 cardinal_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
return 0;
@@ -58,10 +72,21 @@ u8 cardinal_state::p1_r()
void cardinal_state::p1_w(u8 data)
{
- // FIXME: this doesn't quite work
m_eeprom->cs_write(BIT(data, 0));
m_eeprom->di_write(BIT(data, 4));
m_eeprom->clk_write(BIT(data, 3));
+
+ m_address_select = BIT(data, 1);
+}
+
+u8 cardinal_state::vtlc_r()
+{
+ return 0xff;
+}
+
+void cardinal_state::vtlc_w(u8 data)
+{
+ logerror("%s: Writing %02X to CRT9028 %s register\n", machine().describe_context(), data, m_address_select ? "address" : "data");
}
void cardinal_state::prog_map(address_map &map)
@@ -71,7 +96,7 @@ void cardinal_state::prog_map(address_map &map)
void cardinal_state::ext_map(address_map &map)
{
- map(0xff00, 0xff00).nopr();
+ map(0xff00, 0xff00).mirror(0xff).rw(FUNC(cardinal_state::vtlc_r), FUNC(cardinal_state::vtlc_w));
}