don't fatalerror on parse error

This commit is contained in:
hap 2014-11-20 17:45:30 +01:00
parent 4aa10d383f
commit 4ca23dc263
2 changed files with 22 additions and 12 deletions

View File

@ -26,7 +26,8 @@ pla_device::pla_device(const machine_config &mconfig, const char *tag, device_t
m_inputs(0), m_inputs(0),
m_outputs(0), m_outputs(0),
m_terms(0), m_terms(0),
m_input_mask(0) m_input_mask(0),
m_xor(0)
{ {
} }
@ -85,7 +86,16 @@ void pla_device::parse_fusemap()
} }
if (result != JEDERR_NONE) if (result != JEDERR_NONE)
fatalerror("%s PLA parse error %d\n", tag(), result); {
for (int p = 0; p < m_terms; p++)
{
m_term[p].and_mask = 0;
m_term[p].or_mask = 0;
}
logerror("%s PLA parse error %d!\n", tag(), result);
return;
}
// parse it // parse it
UINT32 fusenum = 0; UINT32 fusenum = 0;
@ -95,26 +105,26 @@ void pla_device::parse_fusemap()
term *term = &m_term[p]; term *term = &m_term[p];
// AND mask // AND mask
term->m_and = 0; term->and_mask = 0;
for (int i = 0; i < m_inputs; i++) for (int i = 0; i < m_inputs; i++)
{ {
// complement // complement
term->m_and |= (UINT64)jed_get_fuse(&jed, fusenum++) << (i + 32); term->and_mask |= (UINT64)jed_get_fuse(&jed, fusenum++) << (i + 32);
// true // true
term->m_and |= (UINT64)jed_get_fuse(&jed, fusenum++) << i; term->and_mask |= (UINT64)jed_get_fuse(&jed, fusenum++) << i;
} }
// OR mask // OR mask
term->m_or = 0; term->or_mask = 0;
for (int f = 0; f < m_outputs; f++) for (int f = 0; f < m_outputs; f++)
{ {
term->m_or |= !jed_get_fuse(&jed, fusenum++) << f; term->or_mask |= !jed_get_fuse(&jed, fusenum++) << f;
} }
term->m_or <<= 32; term->or_mask <<= 32;
} }
// XOR mask // XOR mask
@ -158,9 +168,9 @@ UINT32 pla_device::read(UINT32 input)
{ {
term* term = &m_term[i]; term* term = &m_term[i];
if ((term->m_and | inputs) == m_input_mask) if ((term->and_mask | inputs) == m_input_mask)
{ {
s |= term->m_or; s |= term->or_mask;
} }
} }

View File

@ -127,8 +127,8 @@ private:
struct term struct term
{ {
UINT64 m_and; UINT64 and_mask;
UINT64 m_or; UINT64 or_mask;
} m_term[MAX_TERMS]; } m_term[MAX_TERMS];
}; };