Previous 15994 Revisions Next

r1004 Wednesday 19th September, 2007 at 02:48:32 UTC by Nathan Woods
Fixed multisession crash with the new menu selector. (bug #1328)
[docs]messnew.txt
[src/mess]mess.c messopts.c messopts.h

src/mess/mess.c
r1003r1004
130130   int id;
131131   int result = INIT_FAIL;
132132   const char *image_name;
133   const char *dev_name;
134133   mess_image *image;
135134
136135   /* convienient place to call this */
r1003r1004
163162         /* identify the image */
164163         image = image_from_device_and_index(dev, id);
165164
166         /* identify the option name */
167         dev_name = device_instancename(&dev->devclass, id);
168
169165         /* is an image specified for this image */
170         image_name = options_get_string(mame_options(), dev_name);
166         image_name = mess_get_device_option(&dev->devclass, id);
171167         if ((image_name != NULL) && (image_name[0] != '\0'))
172168         {
173169            /* try to load this image */
src/mess/messopts.c
r1003r1004
3737***************************************************************************/
3838
3939/*-------------------------------------------------
40    mess_get_device_option - accesses a device
41   option, by device and index
42-------------------------------------------------*/
43
44const char *mess_get_device_option(const device_class *devclass, int device_index)
45{
46   const char *result = NULL;
47   const char *dev_name;
48
49   if (added_device_options)
50   {
51      /* identify the option name */
52      dev_name = device_instancename(devclass, device_index);
53
54      /* access the option */
55      result = options_get_string(mame_options(), dev_name);
56   }
57   return result;
58}
59
60
61
62/*-------------------------------------------------
4063    mess_enumerate_devices - runs a specified proc
4164   for all devices on a driver
4265-------------------------------------------------*/
r1003r1004
188211   const char *dev_name;
189212   const char *filename;
190213
214   assert_always(added_device_options, "extract_device_options_for_device() called without device options");
215
191216   /* identify the correct image */
192217   dev_tag = device_get_info_string(devclass, DEVINFO_STR_DEV_TAG);
193218   if (dev_tag != NULL)
r1003r1004
252277
253278void mess_options_extract(void)
254279{
255   mess_enumerate_devices(mame_options(), Machine->gamedrv, extract_device_options_for_device);
280   /* only extract the device options if we've added them */
281   if (added_device_options)
282      mess_enumerate_devices(mame_options(), Machine->gamedrv, extract_device_options_for_device);
256283
284   /* write the config, if appropriate */
257285   if (options_get_bool(mame_options(), OPTION_WRITECONFIG))
258   {
259286      write_config(NULL, Machine->gamedrv);
260   }
261287}
src/mess/messopts.h
r1003r1004
3737/* add the device options for a specified device */
3838void mess_add_device_options(core_options *opts, const game_driver *driver);
3939
40/* accesses a device option, by device and index */
41const char *mess_get_device_option(const device_class *devclass, int device_index);
42
4043#endif /* __MESSOPTS_H__ */
41
docs/messnew.txt
r1003r1004
2626
2727Source Changes:
2828----------------
29(none)
29- Fixed multisession crash with the new menu selector.  (bug #1328) [Nate
30  Woods]
3031
3132
3233

Previous 15994 Revisions Next


© 1998-2018 The MESS Team