mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
netlist: Unknown parameters really should be fatal. [Couriersud]
Unknown parameters like Solver.ABCD now will cause a fatal error to be generated.
This commit is contained in:
parent
9351e7ac87
commit
72566426a7
@ -26,7 +26,7 @@ namespace netlist
|
||||
PERRMSGV(MF_UNKNOWN_PARAM_TYPE, 1, "Can not determine param_type for {1}")
|
||||
PERRMSGV(MF_ERROR_CONNECTING_1_TO_2, 2, "Error connecting {1} to {2}")
|
||||
PERRMSGV(MF_NO_SOLVER, 0, "No solver found for this netlist although analog elements are present")
|
||||
PERRMSGV(MF_HND_VAL_NOT_SUPPORTED, 1, "HINT_NO_DEACTIVATE value not supported: <{1}>")
|
||||
PERRMSGV(ME_HND_VAL_NOT_SUPPORTED, 1, "HINT_NO_DEACTIVATE value not supported: <{1}>")
|
||||
PERRMSGV(MW_ROM_NOT_FOUND, 1, "Rom {1} not found")
|
||||
|
||||
// nl_factory.cpp
|
||||
@ -100,8 +100,9 @@ namespace netlist
|
||||
|
||||
PERRMSGV(MW_DATA_1_NOT_FOUND, 1, "unable to find data {1} in sources collection")
|
||||
|
||||
PERRMSGV(MW_DEVICE_NOT_FOUND_FOR_HINT, 1, "Device not found for hint {1}")
|
||||
PERRMSGV(MW_UNKNOWN_PARAMETER, 1, "Unknown parameter {1}")
|
||||
PERRMSGV(ME_DEVICE_NOT_FOUND_FOR_HINT, 1, "Device not found for hint {1}")
|
||||
PERRMSGV(ME_UNKNOWN_PARAMETER, 1, "Unknown parameter {1}")
|
||||
PERRMSGV(MF_ERRORS_FOUND, 1, "Counted {1} errors which need to be fixed")
|
||||
|
||||
// nlid_proxy.cpp
|
||||
|
||||
|
@ -1276,6 +1276,7 @@ void setup_t::prepare_to_run()
|
||||
}
|
||||
}
|
||||
|
||||
int errcnt(0);
|
||||
log().debug("Looking for unknown parameters ...\n");
|
||||
for (auto &p : m_param_values)
|
||||
{
|
||||
@ -1287,10 +1288,16 @@ void setup_t::prepare_to_run()
|
||||
// FIXME: get device name, check for device
|
||||
auto *dev = m_nlstate.find_device(plib::replace_all(p.first, sHINT_NO_DEACTIVATE, ""));
|
||||
if (dev == nullptr)
|
||||
log().warning(MW_DEVICE_NOT_FOUND_FOR_HINT(p.first));
|
||||
{
|
||||
log().error(ME_DEVICE_NOT_FOUND_FOR_HINT(p.first));
|
||||
errcnt++;
|
||||
}
|
||||
}
|
||||
else
|
||||
log().warning(MW_UNKNOWN_PARAMETER(p.first));
|
||||
{
|
||||
log().error(ME_UNKNOWN_PARAMETER(p.first));
|
||||
errcnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1308,17 +1315,26 @@ void setup_t::prepare_to_run()
|
||||
auto v = plib::pstonum_ne<nl_fptype>(p->second, err);
|
||||
if (err || plib::abs(v - plib::floor(v)) > nlconst::magic(1e-6) )
|
||||
{
|
||||
log().fatal(MF_HND_VAL_NOT_SUPPORTED(p->second));
|
||||
throw nl_exception(MF_HND_VAL_NOT_SUPPORTED(p->second));
|
||||
log().error(ME_HND_VAL_NOT_SUPPORTED(p->second));
|
||||
errcnt++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME comparison with zero
|
||||
d.second->set_hint_deactivate(v == nlconst::zero());
|
||||
}
|
||||
// FIXME comparison with zero
|
||||
d.second->set_hint_deactivate(v == nlconst::zero());
|
||||
}
|
||||
}
|
||||
else
|
||||
d.second->set_hint_deactivate(false);
|
||||
}
|
||||
|
||||
if (errcnt)
|
||||
{
|
||||
log().fatal(MF_ERRORS_FOUND(errcnt));
|
||||
throw nl_exception(MF_ERRORS_FOUND(errcnt));
|
||||
}
|
||||
|
||||
// resolve inputs
|
||||
resolve_inputs();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user