protected override byte[] ReadBytes(IWabbitcodeDebugger debugger, int address) { var bytes = new byte[2]; int grayscaleOffset = (ImageSize.Width / 8) * ImageSize.Height; bytes[0] = debugger.ReadByte((ushort)address); bytes[1] = debugger.ReadByte((ushort)(address + grayscaleOffset)); return(bytes); }
protected override string GetDisplayValue(IWabbitcodeDebugger debugger, int address, int size) { string outputValue = string.Empty; if (size == ReadToEnd) { int i = 0; char charToAdd; do { charToAdd = (char)debugger.ReadByte((ushort)(address + i)); outputValue += charToAdd.ToString(); i++; } while (charToAdd != '\0'); } else { var bytes = debugger.ReadMemory((ushort)address, (ushort)size); for (int i = 0; i < size; i++) { outputValue += (char)bytes[i]; } } return(outputValue); }
protected override string GetDisplayValue(IWabbitcodeDebugger debugger, int address, int size) { byte readByte = debugger.ReadByte((ushort)address); var enumValues = new List <string>(); foreach (var maskKey in _enum.EnumMapping) { string label; byte maskedValue = (byte)(readByte & maskKey.Key); if (_symbolCache.TryGetValue(new ByteMaskKey(maskedValue, maskKey.Key), out label)) { enumValues.Add(label); } } if (enumValues.Count == 0) { throw new ArgumentException("Invalid enum type: " + readByte); } return(string.Join(" | ", enumValues)); }
protected override byte[] ReadBytes(IWabbitcodeDebugger debugger, int address) { return(new[] { debugger.ReadByte((ushort)address) }); }