public byte GetByte(uint address) { if (address <= 0x7fff) { return(_rom.GetByte(address)); } throw new InvalidOperationException("Trying to read invalid address from cartridge"); }
private static void PrintMemory(IReadOnlyMemory memory) { var sb = new StringBuilder(); for (uint i = 0; i < 16; i++) { sb.AppendFormat("{0:x2}", memory.GetByte(i)); sb.Append(" "); } Console.WriteLine(sb.ToString()); }