From 709fcb99c1ac03ec7b5bd3a4f7281186b307773c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Sat, 16 Feb 2013 09:20:14 +0000 Subject: [PATCH] fixed initialization of i2cmem_device (nw) --- src/emu/machine/i2cmem.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/emu/machine/i2cmem.c b/src/emu/machine/i2cmem.c index 02a8c400e07..75fd490fc83 100644 --- a/src/emu/machine/i2cmem.c +++ b/src/emu/machine/i2cmem.c @@ -85,14 +85,6 @@ i2cmem_device::i2cmem_device( const machine_config &mconfig, const char *tag, de m_sdar( 1 ), m_state( STATE_IDLE ) { - m_address_bits = 0; - - int i = m_data_size - 1; - while( i > 0 ) - { - m_address_bits++; - i >>= 1; - } } @@ -110,6 +102,21 @@ void i2cmem_device::device_config_complete() { *static_cast(this) = *intf; } + else + { + m_slave_address = 0; + m_page_size = 0; + m_data_size = 0; + } + + m_address_bits = 0; + + int i = m_data_size - 1; + while( i > 0 ) + { + m_address_bits++; + i >>= 1; + } m_space_config = address_space_config( "i2cmem", ENDIANNESS_BIG, 8, m_address_bits, 0, *ADDRESS_MAP_NAME( i2cmem_map8 ) ); }