mirror of
https://github.com/holub/mame
synced 2025-04-20 23:42:22 +03:00
wy75: Add default EAROM to avoid hanging at start
er1400: Device refinements - Add ability to load default data from region - Change erase value from all 1s to all 0s
This commit is contained in:
parent
ae147e3e3a
commit
822e3764f2
@ -42,6 +42,7 @@ DEFINE_DEVICE_TYPE(ER1400, er1400_device, "er1400", "ER1400 Serial EAROM (100x14
|
||||
er1400_device::er1400_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, ER1400, tag, owner, clock)
|
||||
, device_nvram_interface(mconfig, *this)
|
||||
, m_default_data(*this, DEVICE_SELF, 100)
|
||||
, m_clock_input(0)
|
||||
, m_code_input(0)
|
||||
, m_data_input(0)
|
||||
@ -85,8 +86,16 @@ void er1400_device::device_start()
|
||||
|
||||
void er1400_device::nvram_default()
|
||||
{
|
||||
// all locations erased
|
||||
std::fill(&m_data_array[0], &m_data_array[100], 0x3fff);
|
||||
if (m_default_data.found())
|
||||
{
|
||||
// obtain default data from memory region
|
||||
std::copy_n(&m_default_data[0], 100, &m_data_array[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// all locations erased
|
||||
std::fill_n(&m_data_array[0], 100, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -176,11 +185,11 @@ void er1400_device::write_data()
|
||||
if (BIT(m_address_register, units))
|
||||
{
|
||||
offs_t offset = 10 * (tens - 10) + units;
|
||||
if ((m_data_array[offset] & ~m_data_register) != 0)
|
||||
if ((~m_data_array[offset] & m_data_register) != 0)
|
||||
{
|
||||
LOG("Writing data at %d (%04X changed to %04X)\n", offset,
|
||||
m_data_array[offset], m_data_array[offset] & m_data_register);
|
||||
m_data_array[offset] &= m_data_register;
|
||||
m_data_array[offset] |= m_data_register;
|
||||
}
|
||||
selected++;
|
||||
}
|
||||
@ -210,10 +219,10 @@ void er1400_device::erase_data()
|
||||
if (BIT(m_address_register, units))
|
||||
{
|
||||
offs_t offset = 10 * (tens - 10) + units;
|
||||
if (m_data_array[offset] != 0x3fff)
|
||||
if (m_data_array[offset] != 0)
|
||||
{
|
||||
LOG("Erasing data at %d\n", offset);
|
||||
m_data_array[offset] = 0x3fff;
|
||||
m_data_array[offset] = 0;
|
||||
}
|
||||
selected++;
|
||||
}
|
||||
|
@ -66,6 +66,9 @@ private:
|
||||
void write_data();
|
||||
void erase_data();
|
||||
|
||||
// optional default data
|
||||
optional_region_ptr<u16> m_default_data;
|
||||
|
||||
// nonvolatile data
|
||||
std::unique_ptr<u16[]> m_data_array;
|
||||
|
||||
|
@ -326,12 +326,15 @@ ROM_START(wy50)
|
||||
ROM_LOAD("2201_b.u16", 0x0000, 0x1000, CRC(ee318814) SHA1(0ac64b60ff978e607a087e9e6f4d547811c015c5)) // 2716
|
||||
ROM_END
|
||||
|
||||
ROM_START(wy75) // 8031, green, 101-key detached keyboard, EAROM labeled "MODE 1"
|
||||
ROM_START(wy75) // 8031, green, 101-key detached keyboard
|
||||
ROM_REGION(0x2000, "maincpu", 0)
|
||||
ROM_LOAD("wy75_4001r.bin", 0x0000, 0x2000, CRC(d1e660e0) SHA1(81960e7780b86b9fe338b20d7bd50f7e991020a4))
|
||||
|
||||
ROM_REGION(0x1000, "chargen", 0)
|
||||
ROM_LOAD("wy75_4101a.bin", 0x0000, 0x1000, CRC(96d377db) SHA1(9e059cf067d84267f4e1d92b0509f137fb2ceb19))
|
||||
|
||||
ROM_REGION16_LE(0xc8, "earom", 0)
|
||||
ROM_LOAD("default.bin", 0x00, 0xc8, CRC(0efeff07) SHA1(304e07ef87a4b107700273321a1d4e34a56d6821))
|
||||
ROM_END
|
||||
|
||||
COMP(1984, wy50, 0, 0, wy50, wy50, wy50_state, empty_init, "Wyse Technology", "WY-50 (Rev. E)", MACHINE_IS_SKELETON)
|
||||
|
Loading…
Reference in New Issue
Block a user