Esempio n. 1
0
        protected m6805_base_device(
            machine_config mconfig,
            string tag,
            device_t owner,
            uint32_t clock,
            device_type type,
            configuration_params params_,
            address_map_constructor internal_map)
            : base(mconfig, type, tag, owner, clock)
        {
            //m_class_interfaces.Add(new device_execute_interface_m6805_base(mconfig, this));
            m_class_interfaces.Add(new device_memory_interface_m6805_base(mconfig, this));
            m_class_interfaces.Add(new device_state_interface_m6805_base(mconfig, this));
            //m_class_interfaces.Add(new device_disasm_interface_m6805_base(mconfig, this));

            m_dimemory = GetClassInterface <device_memory_interface_m6805_base>();
            m_distate  = GetClassInterface <device_state_interface_m6805_base>();


            init_s_hmos_s_ops();


            m_params         = params_;
            m_program_config = new address_space_config("program", ENDIANNESS_BIG, 8, (u8)params_.m_addr_width, 0, internal_map);
        }
Esempio n. 2
0
        // configuration helpers
        //template <typename T, typename U, typename Ret, typename... Params>
        //std::enable_if_t<is_related_device<T, U>::value> set_addrmap(int spacenum, T &obj, Ret (U::*func)(Params...)) { set_addrmap(spacenum, address_map_constructor(func, obj.tag(), &downcast<U &>(obj))); }
        //template <typename T, typename U, typename Ret, typename... Params>
        //std::enable_if_t<is_related_interface<T, U>::value> set_addrmap(int spacenum, T &obj, Ret (U::*func)(Params...)) { set_addrmap(spacenum, address_map_constructor(func, obj.device().tag(), &downcast<U &>(obj))); }
        //template <typename T, typename U, typename Ret, typename... Params>
        //std::enable_if_t<is_unrelated_device<T, U>::value> set_addrmap(int spacenum, T &obj, Ret (U::*func)(Params...)) { set_addrmap(spacenum, address_map_constructor(func, obj.tag(), &dynamic_cast<U &>(obj))); }
        //template <typename T, typename U, typename Ret, typename... Params>
        //std::enable_if_t<is_unrelated_interface<T, U>::value> set_addrmap(int spacenum, T &obj, Ret (U::*func)(Params...)) { set_addrmap(spacenum, address_map_constructor(func, obj.device().tag(), &dynamic_cast<U &>(obj))); }
        //template <typename T, typename Ret, typename... Params>
        //std::enable_if_t<is_related_class<device_t, T>::value> set_addrmap(int spacenum, Ret (T::*func)(Params...));
        //template <typename T, typename Ret, typename... Params>
        //std::enable_if_t<!is_related_class<device_t, T>::value> set_addrmap(int spacenum, Ret (T::*func)(Params...));

        //-------------------------------------------------
        //  set_addrmap - connect an address map to a device
        //-------------------------------------------------
        public void set_addrmap(int spacenum, address_map_constructor map)
        {
            if (spacenum >= (int)(m_address_map.size()))
            {
                m_address_map.resize(spacenum + 1, null);
            }

            m_address_map[spacenum] = map;
        }
Esempio n. 3
0
        // configuration helpers
        //template <typename T, typename U, typename Ret, typename... Params>
        //std::enable_if_t<is_related_device<T, U>::value> set_addrmap(int spacenum, T &obj, Ret (U::*func)(Params...)) { set_addrmap(spacenum, address_map_constructor(func, obj.tag(), &downcast<U &>(obj))); }
        //template <typename T, typename U, typename Ret, typename... Params>
        //std::enable_if_t<is_related_interface<T, U>::value> set_addrmap(int spacenum, T &obj, Ret (U::*func)(Params...)) { set_addrmap(spacenum, address_map_constructor(func, obj.device().tag(), &downcast<U &>(obj))); }
        //template <typename T, typename U, typename Ret, typename... Params>
        //std::enable_if_t<is_unrelated_device<T, U>::value> set_addrmap(int spacenum, T &obj, Ret (U::*func)(Params...)) { set_addrmap(spacenum, address_map_constructor(func, obj.tag(), &dynamic_cast<U &>(obj))); }
        //template <typename T, typename U, typename Ret, typename... Params>
        //std::enable_if_t<is_unrelated_interface<T, U>::value> set_addrmap(int spacenum, T &obj, Ret (U::*func)(Params...)) { set_addrmap(spacenum, address_map_constructor(func, obj.device().tag(), &dynamic_cast<U &>(obj))); }
        //template <typename T, typename Ret, typename... Params>
        //void set_addrmap(int spacenum, Ret (T::*func)(Params...));


        //-------------------------------------------------
        //  set_addrmap - connect an address map to a device
        //-------------------------------------------------
        public void set_addrmap(int spacenum, address_map_constructor map)
        {
            assert(0 <= spacenum);

            if (spacenum >= (int)(m_address_map.size()))
            {
                m_address_map.resize((size_t)spacenum + 1);
            }

            m_address_map[spacenum] = map;
        }
Esempio n. 4
0
 protected m6800_cpu_device(machine_config mconfig, device_type type, string tag, device_t owner, uint32_t clock, op_func [] insn, uint8_t [] cycles, address_map_constructor internal_)
     : base(mconfig, type, tag, owner, clock)
 {
     m_program_config           = new address_space_config("program", ENDIANNESS_BIG, 8, 16, 0, internal_);
     m_decrypted_opcodes_config = new address_space_config("program", ENDIANNESS_BIG, 8, 16, 0);
     m_insn   = insn;
     m_cycles = cycles;
 }
Esempio n. 5
0
        protected m6801_cpu_device(machine_config mconfig, device_type type, string tag, device_t owner, uint32_t clock, op_func [] insn, uint8_t [] cycles, address_map_constructor internal_ = null)
            : base(mconfig, type, tag, owner, clock, insn, cycles, internal_)
        {
            m_class_interfaces.Add(new device_execute_interface_m6801(mconfig, this));
            m_class_interfaces.Add(new device_memory_interface_m6800(mconfig, this));
            m_class_interfaces.Add(new device_state_interface_m6800(mconfig, this));

            init_m6803_insn();

            m_in_port_func   = new devcb_read8.array <u64_const_4>(this, () => { return(new devcb_read8(this)); });
            m_out_port_func  = new devcb_write8.array <u64_const_4>(this, () => { return(new devcb_write8(this)); });
            m_out_sc2_func   = new devcb_write_line(this);
            m_out_sertx_func = new devcb_write_line(this);
            m_sclk_divider   = 8;
        }
Esempio n. 6
0
 // this function is needed when passing in a non-static address_map_constructor in the ctor.  'this' isn't available
 protected void m6805_base_device_after_ctor(address_map_constructor internal_map)
 {
     m_program_config = new address_space_config("program", ENDIANNESS_BIG, 8, (u8)m_params.m_addr_width, 0, internal_map);
 }
Esempio n. 7
0
 //define MCFG_DEVICE_DATA_MAP(_map)             MCFG_DEVICE_ADDRESS_MAP(AS_DATA, _map)
 public static void MCFG_DEVICE_IO_MAP(device_t device, address_map_constructor map)
 {
     MCFG_DEVICE_ADDRESS_MAP(device, global_object.AS_IO, map);
 }
Esempio n. 8
0
        //**************************************************************************
        //  INTERFACE CONFIGURATION MACROS
        //**************************************************************************

        static void MCFG_DEVICE_ADDRESS_MAP(device_t device, int space, address_map_constructor map)
        {
            device.memory().set_addrmap(space, map);
        }
Esempio n. 9
0
 // configuration helpers
 public address_map_bank_device set_map(address_map_constructor args)
 {
     m_dimemory.set_addrmap(0, args); return(this);
 }                                                                                                                       //template <typename... T> address_map_bank_device& set_map(T &&... args) { set_addrmap(0, std::forward<T>(args)...); return *this; }