Esempio n. 1
0
 public void configure_scanline(expired_delegate callback, string screen, int first_vpos, int increment)  //template <typename F, typename U> void configure_scanline(F &&callback, const char *name, U &&screen, int first_vpos, int increment)
 {
     m_type     = timer_type.TIMER_TYPE_SCANLINE;
     m_callback = callback;    //m_callback.set(std::forward<F>(callback), name);
     m_screen.set_tag(screen); //m_screen.set_tag(std::forward<U>(screen));
     m_first_vpos = (u32)first_vpos;
     m_increment  = (u32)increment;
 }
Esempio n. 2
0
        // inline configuration helpers

        //template <typename Object> void configure_generic(Object &&cb)
        //{
        //    m_type = TIMER_TYPE_GENERIC;
        //    m_callback = std::forward<Object>(cb);
        //}
        //template <class FunctionClass> void configure_generic(void (FunctionClass::*callback)(timer_device &, void *, s32), const char *name)
        //{
        //    configure_generic(expired_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
        //}

        //template <typename Object> void configure_periodic(Object &&cb, const attotime &period)
        //{
        //    m_type = TIMER_TYPE_PERIODIC;
        //    m_callback = std::forward<Object>(cb);
        //    m_period = period;
        //}
        //template <class FunctionClass> void configure_periodic(void (FunctionClass::*callback)(timer_device &, void *, s32), const char *name,
        //    const attotime &period)
        //{
        //    configure_periodic(expired_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)), period);
        //}

        //template <typename Object>
        public void configure_scanline(expired_delegate cb, string screen, int first_vpos, int increment)
        {
            m_type       = timer_type.TIMER_TYPE_SCANLINE;
            m_callback   = cb; //std::forward<Object>(cb);
            m_screen_tag = screen;
            m_first_vpos = (u32)first_vpos;
            m_increment  = (u32)increment;
        }
Esempio n. 3
0
        // inline configuration helpers

        //template <typename Object> void configure_generic(Object &&cb)
        //{
        //    m_type = TIMER_TYPE_GENERIC;
        //    m_callback = std::forward<Object>(cb);
        //}
        //template <class FunctionClass> void configure_generic(void (FunctionClass::*callback)(timer_device &, void *, s32), const char *name)
        //{
        //    configure_generic(expired_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
        //}

        //template <typename Object> void configure_periodic(Object &&cb, const attotime &period)
        //{
        //    m_type = TIMER_TYPE_PERIODIC;
        //    m_callback = std::forward<Object>(cb);
        //    m_period = period;
        //}
        //template <class FunctionClass> void configure_periodic(void (FunctionClass::*callback)(timer_device &, void *, s32), const char *name,
        //    const attotime &period)
        //{
        //    configure_periodic(expired_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)), period);
        //}


        public void configure_scanline <bool_Required>(expired_delegate callback, device_finder <screen_device, bool_Required> screen, int first_vpos, int increment)  //template <typename F, typename U> void configure_scanline(F &&callback, const char *name, U &&screen, int first_vpos, int increment)
            where bool_Required : bool_const, new()
        {
            m_type     = timer_type.TIMER_TYPE_SCANLINE;
            m_callback = callback;    //m_callback.set(std::forward<F>(callback), name);
            m_screen.set_tag(screen); //m_screen.set_tag(std::forward<U>(screen));
            m_first_vpos = (u32)first_vpos;
            m_increment  = (u32)increment;
        }
Esempio n. 4
0
        bool m_first_time;       // indicates that the system is starting (scanline timers only)


        // construction/destruction
        //-------------------------------------------------
        //  timer_device - constructor
        //-------------------------------------------------
        timer_device(machine_config mconfig, string tag, device_t owner, u32 clock)
            : base(mconfig, TIMER, tag, owner, clock)
        {
            m_type        = timer_type.TIMER_TYPE_GENERIC;
            m_callback    = null;
            m_ptr         = null;
            m_start_delay = attotime.zero;
            m_period      = attotime.zero;
            m_param       = 0;
            m_screen      = new optional_device <screen_device>(this, finder_base.DUMMY_TAG);
            m_first_vpos  = 0;
            m_increment   = 0;
            m_timer       = null;
            m_first_time  = true;
        }