void image_unload_all(int ispreload) { int id; const struct IODevice *dev; mess_image *image; if (!ispreload) osd_begin_final_unloading(); /* normalize ispreload */ ispreload = ispreload ? 1 : 0; /* unload all devices with matching preload */ if (Machine->devices) { for (dev = Machine->devices; dev->type < IO_COUNT; dev++) { if (dev->load_at_init == ispreload) { /* all instances */ for (id = 0; id < dev->count; id++) { image = image_from_device_and_index(dev, id); /* unload this image */ image_unload_internal(image, TRUE); } } } } }
int image_index_in_device(mess_image *img) { int indx; assert(img); indx = img - image_from_device_and_index(img->dev, 0); assert(indx >= 0); assert(indx < img->dev->count); return indx; }
int ui_sprintf_image_info(char *buf) { char *dst = buf; const struct IODevice *dev; int id; dst += sprintf(dst, "%s\n\n", Machine->gamedrv->description); if (options.ram) { char buf2[RAM_STRING_BUFLEN]; dst += sprintf(dst, "RAM: %s\n\n", ram_string(buf2, options.ram)); } for (dev = Machine->devices; dev->type < IO_COUNT; dev++) { for (id = 0; id < dev->count; id++) { mess_image *img = image_from_device_and_index(dev, id); const char *name = image_filename(img); if( name ) { const char *base_filename; const char *info; char *base_filename_noextension; base_filename = image_basename(img); base_filename_noextension = strip_extension((char *) base_filename); /* display device type and filename */ dst += sprintf(dst,"%s: %s\n", image_typename_id(img), base_filename); /* display long filename, if present and doesn't correspond to name */ info = image_longname(img); if (info && (!base_filename_noextension || mame_stricmp(info, base_filename_noextension))) dst += sprintf(dst,"%s\n", info); /* display manufacturer, if available */ info = image_manufacturer(img); if (info) { dst += sprintf(dst,"%s", info); info = stripspace(image_year(img)); if (info && *info) dst += sprintf(dst,", %s", info); dst += sprintf(dst,"\n"); } /* display playable information, if available */ info = image_playable(img); if (info) dst += sprintf(dst,"%s\n", info); if (base_filename_noextension) free(base_filename_noextension); } else { dst += sprintf(dst,"%s: ---\n", image_typename_id(img)); } } } return dst - buf; }