diff options
Diffstat (limited to 'src/devices/imagedev')
-rw-r--r-- | src/devices/imagedev/chd_cd.cpp | 2 | ||||
-rw-r--r-- | src/devices/imagedev/diablo.cpp | 6 | ||||
-rw-r--r-- | src/devices/imagedev/floppy.cpp | 33 | ||||
-rw-r--r-- | src/devices/imagedev/harddriv.cpp | 6 |
4 files changed, 24 insertions, 23 deletions
diff --git a/src/devices/imagedev/chd_cd.cpp b/src/devices/imagedev/chd_cd.cpp index d9ab295dfad..630403001ff 100644 --- a/src/devices/imagedev/chd_cd.cpp +++ b/src/devices/imagedev/chd_cd.cpp @@ -109,7 +109,7 @@ bool cdrom_image_device::call_load() if (software_entry() == nullptr) { if (strstr(m_image_name.c_str(), ".chd") && is_loaded()) { - err = m_self_chd.open( *image_core_file() ); /* CDs are never writeable */ + err = m_self_chd.open( image_core_file() ); /* CDs are never writeable */ if ( err ) goto error; chd = &m_self_chd; diff --git a/src/devices/imagedev/diablo.cpp b/src/devices/imagedev/diablo.cpp index f9d4218856a..6ba6aad5cf2 100644 --- a/src/devices/imagedev/diablo.cpp +++ b/src/devices/imagedev/diablo.cpp @@ -124,7 +124,7 @@ bool diablo_image_device::call_create(int create_format, option_resolution *crea /* create the CHD file */ chd_codec_type compression[4] = { CHD_CODEC_NONE }; - err = m_origchd.create(*image_core_file(), (UINT64)totalsectors * (UINT64)sectorsize, hunksize, sectorsize, compression); + err = m_origchd.create(image_core_file(), (UINT64)totalsectors * (UINT64)sectorsize, hunksize, sectorsize, compression); if (err != CHDERR_NONE) goto error; @@ -219,14 +219,14 @@ int diablo_image_device::internal_load_dsk() } else { - err = m_origchd.open(*image_core_file(), true); + err = m_origchd.open(image_core_file(), true); if (err == CHDERR_NONE) { m_chd = &m_origchd; } else if (err == CHDERR_FILE_NOT_WRITEABLE) { - err = m_origchd.open(*image_core_file(), false); + err = m_origchd.open(image_core_file(), false); if (err == CHDERR_NONE) { err = open_disk_diff(device().machine().options(), basename_noext(), m_origchd, m_diffchd); diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp index cb7e184f811..c4269c944ef 100644 --- a/src/devices/imagedev/floppy.cpp +++ b/src/devices/imagedev/floppy.cpp @@ -295,7 +295,7 @@ void floppy_image_device::commit_image() io.procs = &image_ioprocs; io.filler = 0xff; - file_error err = core_truncate(image_core_file(), 0); + file_error err = image_core_file().truncate(0); if (err != 0) popmessage("Error, unable to truncate image: %d", err); @@ -362,7 +362,7 @@ void floppy_image_device::device_timer(emu_timer &timer, device_timer_id id, int floppy_image_format_t *floppy_image_device::identify(std::string filename) { - core_file *fd; + util::core_file::ptr fd; std::string revised_path; file_error err = zippath_fopen(filename.c_str(), OPEN_FLAG_READ, fd, revised_path); @@ -372,19 +372,20 @@ floppy_image_format_t *floppy_image_device::identify(std::string filename) } io_generic io; - io.file = fd; + io.file = fd.get(); io.procs = &corefile_ioprocs_noclose; io.filler = 0xff; int best = 0; floppy_image_format_t *best_format = nullptr; - for(floppy_image_format_t *format = fif_list; format; format = format->next) { + for (floppy_image_format_t *format = fif_list; format; format = format->next) + { int score = format->identify(&io, form_factor); if(score > best) { best = score; best_format = format; } } - core_fclose(fd); + fd.reset(); return best_format; } @@ -515,15 +516,15 @@ void floppy_image_device::mon_w(int state) if (!mon && image) { revolution_start_time = machine().time(); - if (motor_always_on) { - // Drives with motor that is always spinning are immediately ready when a disk is loaded - // because there is no spin-up time - ready = false; - if(!cur_ready_cb.isnull()) - cur_ready_cb(this, ready); - } else { - ready_counter = 2; - } + if (motor_always_on) { + // Drives with motor that is always spinning are immediately ready when a disk is loaded + // because there is no spin-up time + ready = false; + if(!cur_ready_cb.isnull()) + cur_ready_cb(this, ready); + } else { + ready_counter = 2; + } index_resync(); } @@ -1001,11 +1002,11 @@ void ui_menu_control_floppy_image::hook_load(std::string filename, bool softlist if(can_in_place) { file_error filerr; std::string tmp_path; - core_file *tmp_file; + util::core_file::ptr tmp_file; /* attempt to open the file for writing but *without* create */ filerr = zippath_fopen(filename.c_str(), OPEN_FLAG_READ | OPEN_FLAG_WRITE, tmp_file, tmp_path); if(!filerr) - core_fclose(tmp_file); + tmp_file.reset(); else can_in_place = false; } diff --git a/src/devices/imagedev/harddriv.cpp b/src/devices/imagedev/harddriv.cpp index c03b0e4075b..d07852e166f 100644 --- a/src/devices/imagedev/harddriv.cpp +++ b/src/devices/imagedev/harddriv.cpp @@ -148,7 +148,7 @@ bool harddisk_image_device::call_create(int create_format, option_resolution *cr /* create the CHD file */ chd_codec_type compression[4] = { CHD_CODEC_NONE }; - err = m_origchd.create(*image_core_file(), (UINT64)totalsectors * (UINT64)sectorsize, hunksize, sectorsize, compression); + err = m_origchd.create(image_core_file(), (UINT64)totalsectors * (UINT64)sectorsize, hunksize, sectorsize, compression); if (err != CHDERR_NONE) goto error; @@ -243,14 +243,14 @@ int harddisk_image_device::internal_load_hd() } else { - err = m_origchd.open(*image_core_file(), true); + err = m_origchd.open(image_core_file(), true); if (err == CHDERR_NONE) { m_chd = &m_origchd; } else if (err == CHDERR_FILE_NOT_WRITEABLE) { - err = m_origchd.open(*image_core_file(), false); + err = m_origchd.open(image_core_file(), false); if (err == CHDERR_NONE) { err = open_disk_diff(device().machine().options(), basename_noext(), m_origchd, m_diffchd); |