예제 #1
0
        string m_string_buffer;  //mutable util::ovectorstream m_string_buffer;


        // construction/destruction

        //-------------------------------------------------
        //  running_machine - constructor
        //-------------------------------------------------
        public running_machine(machine_config _config, machine_manager manager)
        {
            m_side_effects_disabled = 0;
            debug_flags             = 0;
            m_config                 = _config;
            m_system                 = _config.gamedrv();
            m_manager                = manager;
            m_current_phase          = machine_phase.PREINIT;
            m_paused                 = false;
            m_hard_reset_pending     = false;
            m_exit_pending           = false;
            m_soft_reset_timer       = null;
            m_rand_seed              = 0x9d14abd7;
            m_ui_active              = _config.options().ui_active();
            m_basename               = _config.gamedrv().name;
            m_sample_rate            = _config.options().sample_rate();
            m_saveload_schedule      = saveload_schedule.NONE;
            m_saveload_schedule_time = attotime.zero;
            m_saveload_searchpath    = null;

            m_save      = new save_manager(this);
            m_memory    = new memory_manager(this);
            m_ioport    = new ioport_manager(this);
            m_scheduler = new device_scheduler(this);
            m_scheduler.device_scheduler_after_ctor(this);


            for (int i = 0; i < m_notifier_list.Length; i++)
            {
                m_notifier_list[i] = new std.list <notifier_callback_item>();
            }

            m_base_time = 0;

            // set the machine on all devices
            device_enumerator iter = new device_enumerator(root_device());

            foreach (device_t device in iter)
            {
                device.set_machine(this);
            }

            // fetch core options
            if (options().debug())
            {
                debug_flags = (DEBUG_FLAG_ENABLED | DEBUG_FLAG_CALL_HOOK) | (DEBUG_FLAG_OSD_ENABLED);
            }
        }
예제 #2
0
        // construction/destruction

        //-------------------------------------------------
        //  driver_device - constructor
        //-------------------------------------------------

        public driver_device(machine_config mconfig, device_type type, string tag)
            : base(mconfig, type, tag, null, 0)
        {
            m_system        = mconfig.gamedrv();
            m_flip_screen_x = 0;
            m_flip_screen_y = 0;


            // set the search path to include all parents and cache it because devices search system paths
            m_searchpath.emplace_back(m_system.name);
            std.set <game_driver> seen = new std.set <game_driver>();
            for (int ancestor = driver_list.clone(m_system); 0 <= ancestor; ancestor = driver_list.clone((size_t)ancestor))
            {
                if (!seen.insert(driver_list.driver((size_t)ancestor)))
                {
                    throw new emu_fatalerror("driver_device({0}): parent/clone relationships form a loop", m_system.name);
                }
                m_searchpath.emplace_back(driver_list.driver((size_t)ancestor).name);
            }
        }