mirror of
https://github.com/holub/mame
synced 2025-06-06 04:43:45 +03:00
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.
This commit is contained in:
parent
cbf1582e4f
commit
0f3eb00085
@ -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);
|
||||
|
@ -38,7 +38,6 @@ protected:
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// read interfaces differ between implementations
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user