Added a validity check

This commit is contained in:
Nathan Woods 2009-01-06 03:21:11 +00:00
parent 6d8e81d505
commit 59dbaaa70a

View File

@ -255,6 +255,24 @@ static DEVICE_RESET( cia )
}
/*-------------------------------------------------
DEVICE_VALIDITY_CHECK( cia )
-------------------------------------------------*/
static DEVICE_VALIDITY_CHECK( cia )
{
int error = FALSE;
if (device->clock <= 0)
{
mame_printf_error("%s: %s has a cia with an invalid clock\n", driver->source_file, driver->name);
error = TRUE;
}
return error;
}
/*-------------------------------------------------
cia_update_interrupts
-------------------------------------------------*/
@ -852,6 +870,7 @@ DEVICE_GET_INFO(cia6526r1)
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(cia); break;
case DEVINFO_FCT_STOP: /* Nothing */ break;
case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cia); break;
case DEVINFO_FCT_VALIDITY_CHECK: info->validity_check = DEVICE_VALIDITY_CHECK_NAME(cia); break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case DEVINFO_STR_NAME: strcpy(info->s, "6526 CIA rev1"); break;