summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/pla.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/pla.cpp')
-rw-r--r--src/devices/machine/pla.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/devices/machine/pla.cpp b/src/devices/machine/pla.cpp
index e8ca43d448f..417fb4e6c3f 100644
--- a/src/devices/machine/pla.cpp
+++ b/src/devices/machine/pla.cpp
@@ -24,7 +24,7 @@ pla_device::pla_device(const machine_config &mconfig, const char *tag, device_t
m_outputs(0),
m_terms(0),
m_input_mask(0),
- m_xor(0)
+ m_xor(0), m_cache_size(0), m_cache2_ptr(0)
{
}
@@ -35,7 +35,7 @@ pla_device::pla_device(const machine_config &mconfig, const char *tag, device_t
void pla_device::device_start()
{
- assert(region() != NULL);
+ assert(region() != nullptr);
assert(m_terms < MAX_TERMS);
assert(m_inputs < 32 && m_outputs <= 32);
@@ -48,8 +48,8 @@ void pla_device::device_start()
// initialize cache
m_cache2_ptr = 0;
- for (int i = 0; i < CACHE2_SIZE; i++)
- m_cache2[i] = 0x80000000;
+ for (auto & elem : m_cache2)
+ elem = 0x80000000;
m_cache_size = 0;
int csize = 1 << ((m_inputs > MAX_CACHE_BITS) ? MAX_CACHE_BITS : m_inputs);
@@ -146,9 +146,9 @@ UINT32 pla_device::read(UINT32 input)
if (input < m_cache_size)
return m_cache[input];
- for (int i = 0; i < CACHE2_SIZE; ++i)
+ for (auto cache2_entry : m_cache2)
{
- UINT64 cache2_entry = m_cache2[i];
+
if ((UINT32)cache2_entry == input)
{