Exemplo n.º 1
0
        public void SetByteAt(uint address, byte value)
        {
            if ((address & 0xfffc) == 0x0800)
            {
                return;
            }                                              // mirrored register
            else if ((address &= AddressMask) >= this.Storage.Length)
            {
                return;
            }

            this.Log("Set register byte at address " + address.ToString("x3") + " " + value.ToString("x"));
            IORegister reg = this.Storage[address];

            bool offset = (address & 1) > 0;

            if (!offset)
            {
                reg.Set(value, true, false);
            }
            else
            {
                reg.Set((ushort)(value << 8), false, true);
            }
        }
Exemplo n.º 2
0
        public void SetHalfWordAt(uint address, ushort value)
        {
            if ((address & 0xfffc) == 0x0800)
            {
                return;
            }                                              // mirrored register
            else if ((address &= AddressMask) >= this.Storage.Length)
            {
                return;
            }
            address &= 0x00ff_fffe;  // force align

            this.Log("Set register halfword at address " + address.ToString("x3") + " " + value.ToString("x"));
            IORegister reg = this.Storage[address];

            // force alignment makes these accesses a lot simpler!
            reg.Set(value, true, true);
        }