Exemplo n.º 1
0
        protected byte GetByte(bool bypassFreeze = false)
        {
            if (!bypassFreeze && Global.CheatList.IsActive(_domain, Address))
            {
                // LIAR logic
                return(Global.CheatList.GetByteValue(_domain, Address) ?? 0);
            }

            if (_domain.Size == 0)
            {
                return(_domain.PeekByte(Address));
            }

            return(_domain.PeekByte(Address % _domain.Size));
        }
Exemplo n.º 2
0
            public void Update(PreviousType type, MemoryDomain domain, bool bigendian)
            {
                var value = domain.PeekByte(Address % domain.Size);

                if (value != _prevFrame)
                {
                    _changecount++;
                }

                switch (type)
                {
                case PreviousType.Original:
                case PreviousType.LastSearch:
                    break;

                case PreviousType.LastFrame:
                    _previous = _prevFrame;
                    break;

                case PreviousType.LastChange:
                    if (_prevFrame != value)
                    {
                        _previous = _prevFrame;
                    }
                    break;
                }

                _prevFrame = value;
            }
Exemplo n.º 3
0
        public override BlastUnit GetBackup()
        {
            if (!IsEnabled)
            {
                return(null);
            }

            try
            {
                MemoryDomain md = RTC_MemoryZones.getDomain(Domain);

                if (md == null || Type == BlastByteType.NONE)
                {
                    return(null);
                }

                return(new BlastByte(Domain, Address, BlastByteType.SET, md.PeekByte(Address), true));
            }
            catch (Exception ex)
            {
                MessageBox.Show("The BlastByte apply() function threw up. \n" +
                                "This is not a BizHawk error so you should probably send a screenshot of this to the devs\n\n" +
                                ex.ToString());
                return(null);
            }
        }
Exemplo n.º 4
0
            public override string Disassemble(MemoryDomain m, uint addr, out int length)
            {
                var ret = LR35902.Disassemble((ushort)addr, a => m.PeekByte(a), UseRGBDSSyntax, out var tmp);

                length = tmp;
                return(ret);
            }
Exemplo n.º 5
0
        public string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            int    loc = (int)addr;
            string ret = Disassemble(() => m.PeekByte(loc++));

            length = loc - (int)addr;
            return(ret);
        }
Exemplo n.º 6
0
        public override string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            ushort tmp;
            string ret = LR35902.Disassemble((ushort)addr, a => m.PeekByte(a), out tmp);

            length = tmp;
            return(ret);
        }
        public static byte GetByte(long address, MemoryDomain domain)
        {
            if (!IsValid(address, domain))
            {
                return(0);
            }

            return(domain.PeekByte(address));
        }
Exemplo n.º 8
0
 protected byte GetByte()
 {
     if (Global.CheatList.IsActive(_domain, _address))
     {
         return(Global.CheatList.GetByteValue(_domain, _address).Value);
     }
     else
     {
         if (_domain.Size == 0)
         {
             return(_domain.PeekByte(_address));
         }
         else
         {
             return(_domain.PeekByte(_address % _domain.Size));
         }
     }
 }
Exemplo n.º 9
0
        public string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            int    loc    = (int)addr;
            ushort unused = 0;
            string ret    = Disassemble((ushort)addr, a => m.PeekByte(a), out unused);

            length = loc - (int)addr;
            return(ret);
        }
Exemplo n.º 10
0
        public override void Apply()
        {
            if (!IsEnabled)
            {
                return;
            }

            try
            {
                MemoryDomain md = RTC_MemoryZones.getDomain(Domain);

                if (md == null || md.PokeByte == null)
                {
                    return;
                }

                switch (Type)
                {
                case BlastByteType.SET:
                    md.PokeByte(Address, (byte)Value);
                    break;

                case BlastByteType.ADD:
                    md.PokeByte(Address, (byte)(md.PeekByte(Address) + Value));
                    break;

                case BlastByteType.SUBSTRACT:
                    md.PokeByte(Address, (byte)(md.PeekByte(Address) - Value));
                    break;

                case BlastByteType.NONE:
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("The BlastByte apply() function threw up. \n" +
                                "This is not a BizHawk error so you should probably send a screenshot of this to the devs\n\n" +
                                ex.ToString());
                return;
            }
        }
Exemplo n.º 11
0
        public string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            _disassemblerInstance.ReadWord = (a) => (short)m.PeekUshort(a, m.EndianType == MemoryDomain.Endian.Big);
            _disassemblerInstance.ReadByte = (a) => (sbyte)m.PeekByte(a);
            _disassemblerInstance.ReadLong = (a) => (int)m.PeekUint(a, m.EndianType == MemoryDomain.Endian.Big);
            var info = _disassemblerInstance.Disassemble((int)addr);

            length = info.Length;

            return(string.Format("{0:X4}  {1,-7} {2}", info.RawBytes.Substring(0, 4), info.Mnemonic, info.Args));
        }
Exemplo n.º 12
0
        public override string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            if (m is NDS.NDSSystemBus NdsSysBus)
            {
                NdsSysBus.UseArm9 = int.Parse(Cpu.Substring(5, 1)) == 5;
                m = NdsSysBus;
            }

            if (Cpu.Length == 14)
            {
                addr &= ~1u;
                int    op  = m.PeekByte(addr) | m.PeekByte(addr + 1) << 8;
                string ret = _libdarm.DisassembleStuff(addr | 1, (uint)op);
                length = 2;
                return(ret);
            }
            else
            {
                addr &= ~3u;
                int op = m.PeekByte(addr)
                         | m.PeekByte(addr + 1) << 8
                         | m.PeekByte(addr + 2) << 16
                         | m.PeekByte(addr + 3) << 24;
                string ret = _libdarm.DisassembleStuff(addr, (uint)op);
                length = 4;
                return(ret);
            }
        }
Exemplo n.º 13
0
        private void CHRROMViewRefresh()
        {
            if (CHRROM != null)
            {
                int offs = 8192 * (int)numericUpDownCHRROMBank.Value;
                for (int i = 0; i < 8192; i++)
                {
                    chrromcache[i] = CHRROM.PeekByte(offs + i);
                }

                DrawPatternView(CHRROMView, chrromcache);
            }
        }
Exemplo n.º 14
0
 public override byte PeekByte(long address)
 {
     if (md == null)
     {
         return((byte)RTC_Core.SendCommandToBizhawk(new RTC_Command(CommandType.REMOTE_DOMAIN_PEEKBYTE)
         {
             objectValue = new object[] { name, address }
         }, true));
     }
     else
     {
         return(md.PeekByte(address));
     }
 }
Exemplo n.º 15
0
        public static bool CanPoke(this MemoryDomain d)
        {
            if (!d.Writable)
            {
                return(false);
            }

            try
            {
                d.PokeByte(0, d.PeekByte(0));
            }
            catch (NotImplementedException)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 16
0
        private int GetRamvalue(int addr)
        {
            int val;

            switch (_dataSize)
            {
            default:
            case 1:
                val = _currentDomain.PeekByte(addr);
                break;

            case 2:
                val = _currentDomain.PeekUshort(addr, _bigEndian);
                break;

            case 4:
                val = (int)_currentDomain.PeekUint(addr, _bigEndian);
                break;
            }

            return(val);
        }
Exemplo n.º 17
0
 public override string Disassemble(MemoryDomain m, uint addr, out int length)
 {
     if (_cpu == "ARM v4 (Thumb)")
     {
         addr &= unchecked ((uint)~1);
         int    op  = m.PeekByte((int)addr) | m.PeekByte((int)addr + 1) << 8;
         string ret = Emulation.Cores.Components.ARM.Darm.DisassembleStuff(addr | 1, (uint)op);
         length = 2;
         return(ret);
     }
     else
     {
         addr &= unchecked ((uint)~3);
         int op = m.PeekByte((int)addr)
                  | m.PeekByte((int)addr + 1) << 8
                  | m.PeekByte((int)addr + 2) << 16
                  | m.PeekByte((int)addr + 3) << 24;
         string ret = Emulation.Cores.Components.ARM.Darm.DisassembleStuff(addr, (uint)op);
         length = 4;
         return(ret);
     }
 }
Exemplo n.º 18
0
 public string Disassemble(MemoryDomain m, uint addr, out int length)
 {
     return(Components.M6502.MOS6502X.Disassemble((ushort)addr, out length, (a) => m.PeekByte(a)));
 }
Exemplo n.º 19
0
 public string Disassemble(MemoryDomain m, uint addr, out int length)
 {
     return(MOS6502X.Disassemble((ushort)addr, out length, a => m.PeekByte((int)a)));
 }
 public override byte PeekByte(long addr)
 {
     return(_m.PeekByte(addr));
 }
Exemplo n.º 21
0
        public override string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            ushort tmp;
            string ret = Common.Components.Z80GB.NewDisassembler.Disassemble((ushort)addr, (a) => m.PeekByte(a), out tmp);

            length = tmp;
            return(ret);
        }
Exemplo n.º 22
0
 public string Disassemble(MemoryDomain m, uint addr, out int length)
 {
     return(DisassembleExt((ushort)addr, out length,
                           (a) => m.PeekByte(a),
                           (a) => (ushort)(m.PeekByte(a) | m.PeekByte(a + 1) << 8)));
 }
Exemplo n.º 23
0
 public bool is_p2_in_move()
 {
     if (_currentDomain.PeekByte(0x0007E9) == 0)
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 24
0
        public string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            string ret = Disassemble((ushort)addr, a => m.PeekByte(a), out length);

            return(ret);
        }
Exemplo n.º 25
0
 public MiniByteWatch(MemoryDomain domain, long addr)
 {
     Address   = addr;
     _previous = domain.PeekByte(Address % domain.Size);
 }
Exemplo n.º 26
0
 public override byte PeekByte(long addr) => UseArm9?Arm9Bus.PeekByte(addr) : Arm7Bus.PeekByte(addr);
Exemplo n.º 27
0
 public void SetPreviousToCurrent(MemoryDomain domain, bool bigendian)
 {
     _previous = _prevFrame = domain.PeekByte(Address % domain.Size);
 }
Exemplo n.º 28
0
 protected byte GetByte()
 {
     return(_domain.PeekByte(_address % _domain.Size));
 }
Exemplo n.º 29
0
 public byte PeekByte(long addr)
 {
     //Ensure we stay within range
     return(addr < MD.Size ? MD.PeekByte(addr) : (byte)0);
 }