Beispiel #1
0
void print_game_ramoptions(FILE* out, const game_driver* game)
{
	int i, count;
	UINT32 ram;

	count = ram_option_count(game);

	for (i = 0; i < count; i++)
	{
		ram = ram_option(game, i);
		fprintf(out, "\t\t<ramoption>%u</ramoption>\n", ram);
	}
}
Beispiel #2
0
int mess_validitychecks(void)
{
    int i, j;
    int error = 0;
    iodevice_t devtype;
    struct IODevice *devices;
    const char *name;
    input_port_entry *inputports = NULL;
    extern int device_valididtychecks(void);
    extern const char *mess_default_text[];
    struct SystemConfigurationParamBlock cfg;
    device_getinfo_handler handlers[64];
    int count_overrides[sizeof(handlers) / sizeof(handlers[0])];
    device_class devclass;

    /* make sure that all of the UI_* strings are set for all devices */
    for (devtype = 0; devtype < IO_COUNT; devtype++)
    {
        name = mess_default_text[UI_cartridge - IO_CARTSLOT - UI_last_mame_entry + devtype];
        if (!name || !name[0])
        {
            printf("Device type %d does not have an associated UI string\n", devtype);
            error = 1;
        }
    }

    /* MESS specific driver validity checks */
    for (i = 0; drivers[i]; i++)
    {
        devices = devices_allocate(drivers[i]);

        /* make sure that there are no clones that reference nonexistant drivers */
        if (driver_get_clone(drivers[i]))
        {
            if (drivers[i]->compatible_with && !(drivers[i]->compatible_with->flags & NOT_A_DRIVER))
            {
                printf("%s: both compatbile_with and clone_of are specified\n", drivers[i]->name);
                error = 1;
            }

            for (j = 0; drivers[j]; j++)
            {
                if (driver_get_clone(drivers[i]) == drivers[j])
                    break;
            }
            if (!drivers[j])
            {
                printf("%s: is a clone of %s, which is not in drivers[]\n", drivers[i]->name, driver_get_clone(drivers[i])->name);
                error = 1;
            }
        }

        /* make sure that there are no clones that reference nonexistant drivers */
        if (drivers[i]->compatible_with && !(drivers[i]->compatible_with->flags & NOT_A_DRIVER))
        {
            for (j = 0; drivers[j]; j++)
            {
                if (drivers[i]->compatible_with == drivers[j])
                    break;
            }
            if (!drivers[j])
            {
                printf("%s: is compatible with %s, which is not in drivers[]\n", drivers[i]->name, drivers[i]->compatible_with->name);
                error = 1;
            }
        }

        /* check devices */
        if (drivers[i]->sysconfig_ctor)
        {
            memset(&cfg, 0, sizeof(cfg));
            memset(handlers, 0, sizeof(handlers));
            cfg.device_slotcount = sizeof(handlers) / sizeof(handlers[0]);
            cfg.device_handlers = handlers;
            cfg.device_countoverrides = count_overrides;
            drivers[i]->sysconfig_ctor(&cfg);

            for (j = 0; handlers[j]; j++)
            {
                devclass.gamedrv = drivers[i];
                devclass.get_info = handlers[j];

                if (validate_device(&devclass))
                    error = 1;
            }
        }

        /* check system config */
        ram_option_count(drivers[i]);

        /* make sure that our input system likes this driver */
        if (inputx_validitycheck(drivers[i], &inputports))
            error = 1;

        devices = NULL;
    }

    /* call other validity checks */
    if (inputx_validitycheck(NULL, &inputports))
        error = 1;
    if (device_valididtychecks())
        error = 1;

    /* now that we are completed, re-expand the actual driver to compensate
     * for the tms9928a hack */
    if (Machine && Machine->gamedrv)
    {
        machine_config drv;
        expand_machine_driver(Machine->gamedrv->drv, &drv);
    }

    return error;
}