Beispiel #1
0
        public override void write(offs_t offset, uX data, uX mem_mask)  //template<int Width, int AddrShift> void handler_entry_write_units<Width, AddrShift>::write(offs_t offset, uX data, uX mem_mask)
        {
            this.ref_();

            for (int index = 0; index < m_subunits; index++)
            {
                subunit_info si = m_subunit_infos[index];
                if ((mem_mask & si.m_amask) != 0)
                {
                    offs_t aoffset = (si.m_ashift >= 0 ? offset >> si.m_ashift : offset << si.m_ashift) + si.m_offset;
                    switch (si.m_width)
                    {
                    case 0:
                        ((handler_entry_write <int_const_0, int_const_0>)si.m_handler).write(aoffset, data >> si.m_dshift, mem_mask >> si.m_dshift);  //static_cast<handler_entry_write<0,  0> *>(si.m_handler)->write(aoffset, data >> si.m_dshift, mem_mask >> si.m_dshift);
                        break;

                    case 1:
                        ((handler_entry_write <int_const_1, int_const_n1>)si.m_handler).write(aoffset, data >> si.m_dshift, mem_mask >> si.m_dshift);  //static_cast<handler_entry_write<1, -1> *>(si.m_handler)->write(aoffset, data >> si.m_dshift, mem_mask >> si.m_dshift);
                        break;

                    case 2:
                        ((handler_entry_write <int_const_2, int_const_n2>)si.m_handler).write(aoffset, data >> si.m_dshift, mem_mask >> si.m_dshift);  //static_cast<handler_entry_write<2, -2> *>(si.m_handler)->write(aoffset, data >> si.m_dshift, mem_mask >> si.m_dshift);
                        break;

                    default:
                        throw new emu_fatalerror("handler_entry_write_units.write() - abort");  //abort();
                    }
                }
            }

            this.unref();
        }
Beispiel #2
0
        public override uX read(offs_t offset, uX mem_mask)  //template<int Width, int AddrShift> typename emu::detail::handler_entry_size<Width>::uX handler_entry_read_units<Width, AddrShift>::read(offs_t offset, uX mem_mask) const
        {
            this.ref_();

            uX result = m_unmap;

            for (int index = 0; index < m_subunits; index++)
            {
                subunit_info si = m_subunit_infos[index];
                if ((mem_mask & si.m_amask) != 0)
                {
                    offs_t aoffset = (si.m_ashift >= 0 ? offset >> si.m_ashift : offset << si.m_ashift) + si.m_offset;
                    switch (si.m_width)
                    {
                    case 0:
                        result |= ((handler_entry_read <int_const_0, int_const_0>)si.m_handler).read(aoffset, mem_mask >> si.m_dshift) << si.m_dshift;  //result |= uX(static_cast<handler_entry_read<0,  0> *>(si.m_handler)->read(aoffset, mem_mask >> si.m_dshift)) << si.m_dshift;
                        break;

                    case 1:
                        result |= ((handler_entry_read <int_const_1, int_const_n1>)si.m_handler).read(aoffset, mem_mask >> si.m_dshift) << si.m_dshift;  //result |= uX(static_cast<handler_entry_read<1, -1> *>(si.m_handler)->read(aoffset, mem_mask >> si.m_dshift)) << si.m_dshift;
                        break;

                    case 2:
                        result |= ((handler_entry_read <int_const_2, int_const_n2>)si.m_handler).read(aoffset, mem_mask >> si.m_dshift) << si.m_dshift;  //result |= uX(static_cast<handler_entry_read<2, -2> *>(si.m_handler)->read(aoffset, mem_mask >> si.m_dshift)) << si.m_dshift;
                        break;

                    default:
                        throw new emu_fatalerror("handler_entry_read_units.read() - abort");  //abort();
                    }
                }
            }

            this.unref();
            return(result);
        }
Beispiel #3
0
        void fill(memory_units_descriptor <int_Width, int_AddrShift> descriptor, std.vector <memory_units_descriptor <int_Width, int_AddrShift> .entry> entries)
        {
            handler_entry handler = descriptor.get_subunit_handler();

            handler.ref_((int)entries.size());
            foreach (var e in entries)
            {
                m_subunit_infos[m_subunits++] = new subunit_info(handler, e.m_amask, e.m_dmask, e.m_ashift, e.m_offset, e.m_dshift, descriptor.get_subunit_width());
            }
        }