示例#1
0
        //-------------------------------------------------
        //  device_start - device override which calls
        //  the various helpers
        //-------------------------------------------------
        protected override void device_start()
        {
            // reschedule ourselves to be last
            foreach (device_t test in new device_iterator(this))
            {
                if (test != this && !test.started())
                {
                    throw new device_missing_dependencies();
                }
            }

            // call the game-specific init
            if (m_system.driver_init != null)
            {
                m_system.driver_init(this);
            }

            // finish image devices init process
            machine().image().postdevice_init();

            // start the various pieces
            driver_start();

            if (m_callbacks[(int)callback_type.CB_MACHINE_START] != null)
            {
                m_callbacks[(int)callback_type.CB_MACHINE_START]();
            }
            else
            {
                machine_start();
            }

            if (m_callbacks[(int)callback_type.CB_SOUND_START] != null)
            {
                m_callbacks[(int)callback_type.CB_SOUND_START]();
            }
            else
            {
                sound_start();
            }

            if (m_callbacks[(int)callback_type.CB_VIDEO_START] != null)
            {
                m_callbacks[(int)callback_type.CB_VIDEO_START]();
            }
            else
            {
                video_start();
            }

            // save generic states
            save_item(m_flip_screen_x, "m_flip_screen_x");
            save_item(m_flip_screen_y, "m_flip_screen_y");
        }