diff options
author | 2014-11-17 17:03:54 -0500 | |
---|---|---|
committer | 2014-11-17 17:03:54 -0500 | |
commit | d68a3a45b3dfc13f92096c0b7d58a49a2ef75f68 (patch) | |
tree | 056e3d80e0d9c2b018909468a7ace963e231e707 /src/emu/machine/at28c16.c | |
parent | a6d9826322d00e9f55c02d6ee378c0f9bbbf5aed (diff) |
Touching all the candy again: [Alex Jackson]
Fixed an annoying inconsistency between memory_share and memory_region:
the width() method of the former returned the width in bits (8, 16, 32 or 64)
while the width() method of the latter returned the width in bytes
(1, 2, 4 or 8). Now both classes have a bitwidth() method and a bytewidth()
method. Updated all callers to use whichever one was more appropriate.
Removed the implicit-cast-to-any-integer-pointer ability of memory_regions,
which was rather unsafe (if you weren't careful with your * operators and
casts it was easy to accidentally get a pointer to the memory_region object
itself instead of to the data, with no warning from the compiler... or at
least I kept doing it) Updated all devices and drivers that were accessing
regions that way to use a region_ptr_finder when possible, and otherwise to
call base() explicitly.
Diffstat (limited to 'src/emu/machine/at28c16.c')
-rw-r--r-- | src/emu/machine/at28c16.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/emu/machine/at28c16.c b/src/emu/machine/at28c16.c index 1a797c12a51..cd773f61073 100644 --- a/src/emu/machine/at28c16.c +++ b/src/emu/machine/at28c16.c @@ -125,15 +125,15 @@ void at28c16_device::nvram_default() fatalerror( "at28c16 region '%s' wrong size (expected size = 0x%X)\n", tag(), AT28C16_DATA_BYTES ); } - if( m_region->width() != 1 ) + if( m_region->bytewidth() != 1 ) { fatalerror( "at28c16 region '%s' needs to be an 8-bit region\n", tag() ); } + UINT8 *default_data = m_region->base(); + for( offs_t offs = 0; offs < AT28C16_DATA_BYTES; offs++ ) - { - m_addrspace[ 0 ]->write_byte( offs, m_region->u8( offs ) ); - } + m_addrspace[ 0 ]->write_byte( offs, default_data[offs] ); } } |