diff options
Diffstat (limited to 'src/emu/machine.c')
-rw-r--r-- | src/emu/machine.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/src/emu/machine.c b/src/emu/machine.c index a87433f3e56..2789183b5a6 100644 --- a/src/emu/machine.c +++ b/src/emu/machine.c @@ -81,6 +81,7 @@ #include "validity.h" #include "unzip.h" #include "debug/debugcon.h" +#include "debug/debugvw.h" #include <time.h> @@ -120,14 +121,6 @@ running_machine::running_machine(const machine_config &_config, osd_interface &o m_config(_config), m_system(_config.gamedrv()), m_osd(osd), - m_cheat(NULL), - m_render(NULL), - m_input(NULL), - m_sound(NULL), - m_video(NULL), - m_ui(NULL), - m_tilemap(NULL), - m_debug_view(NULL), m_current_phase(MACHINE_PHASE_PREINIT), m_paused(false), m_hard_reset_pending(false), @@ -139,11 +132,9 @@ running_machine::running_machine(const machine_config &_config, osd_interface &o m_ui_active(_config.options().ui_active()), m_basename(_config.gamedrv().name), m_sample_rate(_config.options().sample_rate()), - m_logfile(NULL), m_saveload_schedule(SLS_NONE), m_saveload_schedule_time(attotime::zero), m_saveload_searchpath(NULL), - m_logerror_list(m_respool), m_save(*this), m_memory(*this), @@ -225,9 +216,9 @@ void running_machine::start() { // initialize basic can't-fail systems here config_init(*this); - m_input = auto_alloc(*this, input_manager(*this)); + m_input.reset(global_alloc(input_manager(*this))); output_init(*this); - m_render = auto_alloc(*this, render_manager(*this)); + m_render.reset(global_alloc(render_manager(*this))); generic_machine_init(*this); // allocate a soft_reset timer @@ -237,8 +228,8 @@ void running_machine::start() m_osd.init(*this); // create the video manager - m_video = auto_alloc(*this, video_manager(*this)); - m_ui = auto_alloc(*this, ui_manager(*this)); + m_video.reset(global_alloc(video_manager(*this))); + m_ui.reset(global_alloc(ui_manager(*this))); // initialize the base time (needed for doing record/playback) ::time(&m_base_time); @@ -254,7 +245,7 @@ void running_machine::start() ui_input_init(*this); // initialize the streams engine before the sound devices start - m_sound = auto_alloc(*this, sound_manager(*this)); + m_sound.reset(global_alloc(sound_manager(*this))); // first load ROMs, then populate memory, and finally initialize CPUs // these operations must proceed in this order @@ -270,7 +261,7 @@ void running_machine::start() // initialize image devices image_init(*this); - m_tilemap = auto_alloc(*this, tilemap_manager(*this)); + m_tilemap.reset(global_alloc(tilemap_manager(*this))); crosshair_init(*this); network_init(*this); @@ -300,7 +291,7 @@ void running_machine::start() schedule_load("auto"); // set up the cheat engine - m_cheat = auto_alloc(*this, cheat_manager(*this)); + m_cheat.reset(global_alloc(cheat_manager(*this))); // allocate autoboot timer m_autoboot_timer = scheduler().timer_alloc(timer_expired_delegate(FUNC(running_machine::autoboot_callback), this)); @@ -348,7 +339,7 @@ int running_machine::run(bool firstrun) // if we have a logfile, set up the callback if (options().log()) { - m_logfile = auto_alloc(*this, emu_file(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS)); + m_logfile.reset(global_alloc(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"); add_logerror_callback(logfile_callback); @@ -442,7 +433,7 @@ int running_machine::run(bool firstrun) zip_file_cache_clear(); // close the logfile - auto_free(*this, m_logfile); + m_logfile.reset(); return error; } @@ -784,7 +775,7 @@ void running_machine::add_notifier(machine_notification event, machine_notify_de void running_machine::add_logerror_callback(logerror_callback callback) { assert_always(m_current_phase == MACHINE_PHASE_INIT, "Can only call add_logerror_callback at init time!"); - m_logerror_list.append(*auto_alloc(*this, logerror_callback_item(callback))); + m_logerror_list.append(*global_alloc(logerror_callback_item(callback))); } @@ -1149,9 +1140,6 @@ void running_machine::stop_all_devices() device_iterator iter(root_device()); for (device_t *device = iter.first(); device != NULL; device = iter.next()) device->stop(); - - // then nuke the device tree -// global_free(m_root_device); } |