GetRAMReference() private method

private GetRAMReference ( Segment segment ) : void
segment Segment
return void
Example #1
0
        private void RefreshMemoryReference()
        {
            // set byte[] reference.
            if (IsNotPresent)
            {
                MemoryReference = null;
            }
            else
            {
                if (IsDevice)
                {
                    // will select rom if index == 0, device memory if index is between 1-15.
                    m_Bus.GetDeviceMemoryReference(this, DeviceIndex);
                }
                else
                {
                    m_Bus.GetRAMReference(this);
                }
            }

            // get size
            uint s = (m_Register & c_SegRegSize) >> c_SegRegSizeShift;

            m_Size = s == 0 ? ushort.MaxValue + 1 : s;

            // get base
            if (IsDevice)
            {
                uint b = m_Register & c_SegRegDeviceBase;
                Base = b << 8;
            }
            else
            {
                uint b = m_Register & c_SegRegMemBase;
                Base = b << 8;
            }
        }