src/emu/machine/idectrl.c
| r13034 | r13035 | |
| 155 | 155 | |
| 156 | 156 | chd_file *handle; |
| 157 | 157 | hard_disk_file *disk; |
| 158 | bool is_image_device; |
| 158 | 159 | emu_timer * last_status_timer; |
| 159 | 160 | emu_timer * reset_timer; |
| 160 | 161 | |
| r13034 | r13035 | |
| 1859 | 1860 | config = (const ide_config *)downcast<const legacy_device_base *>(device)->inline_config(); |
| 1860 | 1861 | ide->handle = get_disk_handle(device->machine(), (config->master != NULL) ? config->master : device->tag()); |
| 1861 | 1862 | ide->disk = hard_disk_open(ide->handle); |
| 1863 | ide->is_image_device = false; |
| 1862 | 1864 | assert_always(config->slave == NULL, "IDE controller does not yet support slave drives\n"); |
| 1863 | 1865 | |
| 1864 | 1866 | /* find the bus master space */ |
| r13034 | r13035 | |
| 1955 | 1957 | static DEVICE_STOP( ide_controller ) |
| 1956 | 1958 | { |
| 1957 | 1959 | ide_state *ide = get_safe_token(device); |
| 1958 | | |
| 1959 | | /* close the hard disk */ |
| 1960 | | if (ide->disk != NULL) |
| 1961 | | hard_disk_close(ide->disk); |
| 1960 | if (!ide->is_image_device) { |
| 1961 | /* close the hard disk */ |
| 1962 | if (ide->disk != NULL) |
| 1963 | hard_disk_close(ide->disk); |
| 1964 | } |
| 1962 | 1965 | } |
| 1963 | 1966 | |
| 1964 | 1967 | |
| r13034 | r13035 | |
| 1982 | 1985 | if (ide->handle) |
| 1983 | 1986 | { |
| 1984 | 1987 | ide->disk = device->machine().device<harddisk_image_device>(hardtag.cstr())->get_hard_disk_file(); // should be config->master |
| 1988 | ide->is_image_device = true; |
| 1985 | 1989 | |
| 1986 | 1990 | if (ide->disk != NULL) |
| 1987 | 1991 | { |