diff options
author | wilbertpol <wilbertpol@users.noreply.github.com> | 2018-03-03 18:18:08 +0100 |
---|---|---|
committer | Vas Crabb <cuavas@users.noreply.github.com> | 2018-03-04 04:18:08 +1100 |
commit | 3b923d59ccb8d2d8e386392518450006f8e644fe (patch) | |
tree | 73c48568e76d69edbde9f96a3f57d173dd05a747 /src/devices/machine/eeprom.cpp | |
parent | 25472091b626bd01ef47f11389a4b2ebe0fc0008 (diff) |
destaticify initializations (nw) (#3289)
* destaticify initializations (nw)
* fix this->set_screen (nw)
Diffstat (limited to 'src/devices/machine/eeprom.cpp')
-rw-r--r-- | src/devices/machine/eeprom.cpp | 57 |
1 files changed, 15 insertions, 42 deletions
diff --git a/src/devices/machine/eeprom.cpp b/src/devices/machine/eeprom.cpp index 2ed8e3fa65c..02ec231478a 100644 --- a/src/devices/machine/eeprom.cpp +++ b/src/devices/machine/eeprom.cpp @@ -45,70 +45,43 @@ eeprom_base_device::eeprom_base_device(const machine_config &mconfig, device_typ //------------------------------------------------- -// static_set_default_data - configuration helpers +// set_default_data - configuration helpers // to set the default data //------------------------------------------------- -void eeprom_base_device::static_set_size(device_t &device, int cells, int cellbits) +void eeprom_base_device::set_size(int cells, int cellbits) { - eeprom_base_device &eeprom = downcast<eeprom_base_device &>(device); - eeprom.m_cells = cells; - eeprom.m_data_bits = cellbits; + m_cells = cells; + m_data_bits = cellbits; // compute address bits (validation checks verify cells was an even power of 2) cells--; - eeprom.m_address_bits = 0; + m_address_bits = 0; while (cells != 0) { cells >>= 1; - eeprom.m_address_bits++; + m_address_bits++; } } //------------------------------------------------- -// static_set_default_data - configuration helpers +// set_default_data - configuration helpers // to set the default data //------------------------------------------------- -void eeprom_base_device::static_set_default_data(device_t &device, const uint8_t *data, uint32_t size) +void eeprom_base_device::set_default_data(const uint8_t *data, uint32_t size) { - eeprom_base_device &eeprom = downcast<eeprom_base_device &>(device); - assert(eeprom.m_data_bits == 8); - eeprom.m_default_data = data; - eeprom.m_default_data_size = size; + assert(m_data_bits == 8); + m_default_data = data; + m_default_data_size = size; } -void eeprom_base_device::static_set_default_data(device_t &device, const uint16_t *data, uint32_t size) +void eeprom_base_device::set_default_data(const uint16_t *data, uint32_t size) { - eeprom_base_device &eeprom = downcast<eeprom_base_device &>(device); - assert(eeprom.m_data_bits == 16); - eeprom.m_default_data = data; - eeprom.m_default_data_size = size / 2; -} - - -//------------------------------------------------- -// static_set_default_value - configuration helper -// to set the default value -//------------------------------------------------- - -void eeprom_base_device::static_set_default_value(device_t &device, uint32_t value) -{ - eeprom_base_device &eeprom = downcast<eeprom_base_device &>(device); - eeprom.m_default_value = value; - eeprom.m_default_value_set = true; -} - - -//------------------------------------------------- -// static_set_timing - configuration helper -// to set timing constants for various operations -//------------------------------------------------- - -void eeprom_base_device::static_set_timing(device_t &device, timing_type type, const attotime &duration) -{ - downcast<eeprom_base_device &>(device).m_operation_time[type] = duration; + assert(m_data_bits == 16); + m_default_data = data; + m_default_data_size = size / 2; } |