diff options
author | 2022-04-03 03:05:53 +1000 | |
---|---|---|
committer | 2022-04-03 03:07:28 +1000 | |
commit | 530c5abb5da585ac71f9c643c9d6a2171280fe67 (patch) | |
tree | 978357b74d3506db174181e74bb3f4d81c421f64 /src/devices/bus/megadrive | |
parent | c4f9ff9790382c1c5b99a2ffbb2a14e04d4c7cea (diff) |
Revert initialisation of device members in headers.
This is problematic in several ways:
* Initialising things at construction that aren't needed until after
start slows down -romident, -validate, -listxml, etc. Slot cards can
be a particular drain on -listxml and -validate as they're
instantiated for every compatible slot. It's more pronounced for
array members, too.
* Splitting member initialisation between declaration in headers and
constructors in source files means you have to look at two places to
check for the initial value, and you always need to check the
constructor even if an initialiser is present in the header because
the constructor initaliser list takes precedence. (This isn't as much
of an issue for driver classes because the constructor is most often
inlined at declaration, so it isn't far from the member declarations.)
* Initialisers in headers for frequently-used devices increases the
frequency of recompiling dependent devices/drivers as they're exposed
to any changes in initialisers.
* Initialisers in frequently-used headers increase build times because
there's more for the compiler to parse/cache. (This affects
makedep.py as well for single-driver builds, but that's a single
pass.) It's not a lot individually, but it adds up given the size of
MAME, which keeps increasing. We've already had one contributor
banned from GitHub actions for resource usage, we don't want to waste
compiler time unnecessarily.
Diffstat (limited to 'src/devices/bus/megadrive')
-rw-r--r-- | src/devices/bus/megadrive/eeprom.h | 26 | ||||
-rw-r--r-- | src/devices/bus/megadrive/rom.h | 2 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/devices/bus/megadrive/eeprom.h b/src/devices/bus/megadrive/eeprom.h index 9b7770445fc..7f5b0e450a4 100644 --- a/src/devices/bus/megadrive/eeprom.h +++ b/src/devices/bus/megadrive/eeprom.h @@ -204,20 +204,20 @@ private: std::vector<uint8_t> m_sram; // EEPROM runtime vars - uint8_t m_eeprom_sda = 0; // current SDA - uint8_t m_eeprom_prev_sda = 0; // previous SDA - uint8_t m_eeprom_scl = 0; // current SCL - uint8_t m_eeprom_prev_scl = 0; // previous SCL - uint8_t m_eeprom_cnt = 0; // operation count in 0-9 - uint8_t m_eeprom_readwrite = 0; // read/write bit - uint16_t m_eeprom_slave_mask = 0; // dev addr - uint16_t m_eeprom_word_address = 0; // memory addr - uint16_t m_eeprom_devsel = 0; // selected device - uint16_t m_eeprom_byte = 0; // byte to be written - int m_eeprom_cur_state = 0; // current state + uint8_t m_eeprom_sda; // current SDA + uint8_t m_eeprom_prev_sda; // previous SDA + uint8_t m_eeprom_scl; // current SCL + uint8_t m_eeprom_prev_scl; // previous SCL + uint8_t m_eeprom_cnt; // operation count in 0-9 + uint8_t m_eeprom_readwrite; // read/write bit + uint16_t m_eeprom_slave_mask; // dev addr + uint16_t m_eeprom_word_address; // memory addr + uint16_t m_eeprom_devsel; // selected device + uint16_t m_eeprom_byte; // byte to be written + int m_eeprom_cur_state; // current state // EEPROM physical characteristics (configured at init) - uint16_t m_eeprom_mask = 0; // size of the memory - 1 - uint16_t m_eeprom_pagewrite_mask = 0; // max number of bytes that can be written in a single write cycle + uint16_t m_eeprom_mask; // size of the memory - 1 + uint16_t m_eeprom_pagewrite_mask; // max number of bytes that can be written in a single write cycle }; diff --git a/src/devices/bus/megadrive/rom.h b/src/devices/bus/megadrive/rom.h index b9899dc9b56..0acf73061ee 100644 --- a/src/devices/bus/megadrive/rom.h +++ b/src/devices/bus/megadrive/rom.h @@ -501,7 +501,7 @@ protected: virtual void device_reset() override; private: - uint16_t m_retvalue = 0; + uint16_t m_retvalue; }; |