src/mess/devices/snapquik.c
| r2282 | r2283 | |
| 14 | 14 | |
| 15 | 15 | struct snapquick_info |
| 16 | 16 | { |
| 17 | | const struct IODevice *dev; |
| 18 | 17 | const device_config *img; |
| 19 | 18 | int file_size; |
| 20 | 19 | struct snapquick_info *next; |
| r2282 | r2283 | |
| 29 | 28 | struct snapquick_info *si = (struct snapquick_info *) ptr; |
| 30 | 29 | snapquick_loadproc loadproc; |
| 31 | 30 | const char *file_type; |
| 31 | const struct IODevice *dev; |
| 32 | 32 | |
| 33 | | loadproc = (snapquick_loadproc) mess_device_get_info_fct(&si->dev->devclass, MESS_DEVINFO_PTR_SNAPSHOT_LOAD); |
| 33 | dev = mess_device_from_core_device(si->img); |
| 34 | loadproc = (snapquick_loadproc) mess_device_get_info_fct(&dev->devclass, MESS_DEVINFO_PTR_SNAPSHOT_LOAD); |
| 34 | 35 | file_type = image_filetype(si->img); |
| 35 | 36 | loadproc(machine, si->img, file_type, si->file_size); |
| 36 | 37 | image_unload(si->img); |
| r2282 | r2283 | |
| 56 | 57 | dev = mess_device_from_core_device(image); |
| 57 | 58 | assert(dev); |
| 58 | 59 | |
| 59 | | si->dev = dev; |
| 60 | 60 | si->img = image; |
| 61 | 61 | si->file_size = file_size; |
| 62 | 62 | si->next = snapquick_infolist; |
| 63 | 63 | snapquick_infolist = si; |
| 64 | 64 | |
| 65 | | delay = mess_device_get_info_double(&si->dev->devclass, MESS_DEVINFO_FLOAT_SNAPSHOT_DELAY); |
| 65 | delay = mess_device_get_info_double(&dev->devclass, MESS_DEVINFO_FLOAT_SNAPSHOT_DELAY); |
| 66 | 66 | |
| 67 | 67 | timer_set(double_to_attotime(delay), si, 0, snapquick_processsnapshot); |
| 68 | 68 | return INIT_PASS; |
src/mess/filemngr.c
| r2282 | r2283 | |
| 636 | 636 | static int previous_sel; |
| 637 | 637 | const char *name; |
| 638 | 638 | ui_menu_item menu_items[40]; |
| 639 | | const struct IODevice *devices[40]; |
| 639 | const device_config *devices[40]; |
| 640 | 640 | char names[40][64]; |
| 641 | 641 | int sel, total, arrowize; |
| 642 | 642 | const device_config *image; |
| r2282 | r2283 | |
| 654 | 654 | menu_items[total].text = (names[total]) ? names[total] : "---"; |
| 655 | 655 | menu_items[total].subtext = (name) ? name : "---"; |
| 656 | 656 | |
| 657 | | devices[total] = mess_device_from_core_device(image); |
| 657 | devices[total] = image; |
| 658 | 658 | |
| 659 | 659 | total++; |
| 660 | 660 | } |
| r2282 | r2283 | |
| 663 | 663 | /* if the fileselect() mode is active */ |
| 664 | 664 | if (sel & (2 << SEL_BITS)) |
| 665 | 665 | { |
| 666 | | image = image_from_device(devices[previous_sel & SEL_MASK]); |
| 666 | image = devices[previous_sel & SEL_MASK]; |
| 667 | 667 | sel = fileselect(selected & ~(2 << SEL_BITS), image_filename(image), image_working_directory(image)); |
| 668 | 668 | if (sel != 0 && sel != -1 && sel!=-2) |
| 669 | 669 | return sel | (2 << SEL_BITS); |
| r2282 | r2283 | |
| 676 | 676 | previous_sel = previous_sel & SEL_MASK; |
| 677 | 677 | |
| 678 | 678 | /* attempt a filename change */ |
| 679 | | image = image_from_device(devices[previous_sel]); |
| 679 | image = devices[previous_sel]; |
| 680 | 680 | if (entered_filename[0]) |
| 681 | 681 | image_load(image, entered_filename); |
| 682 | 682 | else |
| r2282 | r2283 | |
| 713 | 713 | { |
| 714 | 714 | /* yes */ |
| 715 | 715 | sel &= SEL_MASK; |
| 716 | | image = image_from_device(devices[sel]); |
| 716 | image = devices[sel]; |
| 717 | 717 | image_load(image, NULL); |
| 718 | 718 | } |
| 719 | 719 | |
| r2282 | r2283 | |
| 743 | 743 | /* no, let the osd code have a crack at changing files */ |
| 744 | 744 | else |
| 745 | 745 | { |
| 746 | | image = image_from_device(devices[sel]); |
| 746 | image = devices[sel]; |
| 747 | 747 | os_sel = 0; |
| 748 | 748 | } |
| 749 | 749 | |
src/mess/machine/cbm.c
| r2282 | r2283 | |
| 169 | 169 | cbm_rom[id].chip = 0; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | | static const struct IODevice *cbm_rom_find_device(running_machine *machine) |
| 173 | | { |
| 174 | | return device_find_from_machine(machine, IO_CARTSLOT); |
| 175 | | } |
| 176 | | |
| 177 | 172 | static DEVICE_START(cbm_rom) |
| 178 | 173 | { |
| 179 | 174 | int id = image_index_in_device(device); |
| r2282 | r2283 | |
| 190 | 185 | int size, j, read_; |
| 191 | 186 | const char *filetype; |
| 192 | 187 | int adr = 0; |
| 193 | | const struct IODevice *dev; |
| 194 | 188 | |
| 195 | 189 | for (i=0; (i<sizeof(cbm_rom) / sizeof(cbm_rom[0])) && (cbm_rom[i].size!=0); i++) |
| 196 | 190 | ; |
| 197 | 191 | if (i >= sizeof(cbm_rom) / sizeof(cbm_rom[0])) |
| 198 | 192 | return INIT_FAIL; |
| 199 | 193 | |
| 200 | | dev = cbm_rom_find_device(image->machine); |
| 201 | | |
| 202 | 194 | size = image_length(image); |
| 203 | 195 | |
| 204 | 196 | filetype = image_filetype(image); |