示例#1
0
        // save/restore
        //void save_restore(ymfm_saved_state &state);

        // reset the channel state
        //void reset();

        // return the channel offset
        //uint32_t choffs() const { return m_choffs; }


        // assign operators
        public void assign(uint32_t index, fm_operator <RegisterType, RegisterType_OPS> op)
        {
            assert(index < m_op.Length);
            m_op[index] = op;
            if (op != null)
            {
                op.set_choffs(m_choffs);
            }
        }
示例#2
0
        fm_operator <RegisterType, RegisterType_OPS> [] m_operator = new fm_operator <RegisterType, RegisterType_OPS> [OPERATORS]; // operator pointers  //std::unique_ptr<fm_operator<RegisterType>> m_operator[OPERATORS]; // operator pointers


        // constructor
        public fm_engine_base(ymfm_interface intf)
        {
            m_intf              = intf;
            m_env_counter       = 0;
            m_status            = 0;
            m_clock_prescale    = (uint8_t)register_ops.DEFAULT_PRESCALE;
            m_irq_mask          = (uint8_t)(STATUS_TIMERA | STATUS_TIMERB);
            m_irq_state         = 0;
            m_timer_running     = new uint8_t[] { 0, 0 };
            m_active_channels   = ALL_CHANNELS;
            m_modified_channels = ALL_CHANNELS;
            m_prepare_count     = 0;


            // inform the interface of their engine
            m_intf.m_engine = this;


            m_regs = new RegisterType();


            // create the channels
            for (uint32_t chnum = 0; chnum < CHANNELS; chnum++)
            {
                m_channel[chnum] = new fm_channel <RegisterType, RegisterType_OPS>(this, register_ops.channel_offset(chnum));
            }

            // create the operators
            for (uint32_t opnum = 0; opnum < OPERATORS; opnum++)
            {
                m_operator[opnum] = new fm_operator <RegisterType, RegisterType_OPS>(this, register_ops.operator_offset(opnum));
            }

            // do the initial operator assignment
            assign_operators();
        }