diff options
author | 2016-03-13 13:54:57 +1100 | |
---|---|---|
committer | 2016-03-14 18:55:00 +1100 | |
commit | 42fbb9c3967fcda37f2d9ae17d5796a79cf027b9 (patch) | |
tree | a43047ee00431e5e22bfc5f8f612ff775586e415 /src/emu/machine.cpp | |
parent | 5fc27747031b6ed6f6c0582502098ebfb960be67 (diff) |
Make osd_file a polymorphic class that's held with smart pointers
Make avi_file a class that's held with smart pointers, encapsulate various AVI I/O structures
Make zip_file and _7z_file classes rather than having free functions everywhere
Hide zip/7z class implementation behind an interface, no longer need to call close() to send back to the cache
Don't dump as much crap in global namespace
Add solaris PTY implementation
Improve variable expansion for SDL OSD - supports ~/$FOO/${BAR} syntax
Rearrange stuff so the same things are in file module for all OSDs
Move file stuff into its own module
7z/zip open and destruct are still not thread-safe due to lack of interlocks around cache access
Directory functions still need to be moved to file module
SDL OSD may not initialise WinSock on Windows
Diffstat (limited to 'src/emu/machine.cpp')
-rw-r--r-- | src/emu/machine.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index b3ac263473e..00db05b59c3 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -333,8 +333,8 @@ int running_machine::run(bool firstrun) if (options().log() && &system() != &GAME_NAME(___empty)) { m_logfile = std::make_unique<emu_file>(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - file_error filerr = m_logfile->open("error.log"); - assert_always(filerr == FILERR_NONE, "unable to open log file"); + osd_file::error filerr = m_logfile->open("error.log"); + assert_always(filerr == osd_file::error::NONE, "unable to open log file"); add_logerror_callback(logfile_callback); } @@ -440,7 +440,7 @@ int running_machine::run(bool firstrun) // call all exit callbacks registered call_notifiers(MACHINE_NOTIFY_EXIT); - zip_file_cache_clear(); + zip_file::cache_clear(); // close the logfile m_logfile.reset(); @@ -824,7 +824,7 @@ void running_machine::handle_saveload() UINT32 openflags = (m_saveload_schedule == SLS_LOAD) ? OPEN_FLAG_READ : (OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); const char *opnamed = (m_saveload_schedule == SLS_LOAD) ? "loaded" : "saved"; const char *opname = (m_saveload_schedule == SLS_LOAD) ? "load" : "save"; - file_error filerr = FILERR_NONE; + osd_file::error filerr = osd_file::error::NONE; // if no name, bail emu_file file(m_saveload_searchpath, openflags); @@ -846,7 +846,7 @@ void running_machine::handle_saveload() // open the file filerr = file.open(m_saveload_pending_file.c_str()); - if (filerr == FILERR_NONE) + if (filerr == osd_file::error::NONE) { // read/write the save state save_error saverr = (m_saveload_schedule == SLS_LOAD) ? m_save.read_file(file) : m_save.write_file(file); @@ -1171,7 +1171,7 @@ void running_machine::nvram_load() for (device_nvram_interface *nvram = iter.first(); nvram != nullptr; nvram = iter.next()) { emu_file file(options().nvram_directory(), OPEN_FLAG_READ); - if (file.open(nvram_filename(nvram->device()).c_str()) == FILERR_NONE) + if (file.open(nvram_filename(nvram->device()).c_str()) == osd_file::error::NONE) { nvram->nvram_load(file); file.close(); @@ -1192,7 +1192,7 @@ void running_machine::nvram_save() for (device_nvram_interface *nvram = iter.first(); nvram != nullptr; nvram = iter.next()) { emu_file file(options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - if (file.open(nvram_filename(nvram->device()).c_str()) == FILERR_NONE) + if (file.open(nvram_filename(nvram->device()).c_str()) == osd_file::error::NONE) { nvram->nvram_save(file); file.close(); |