29 |
txtData.UseFixedBytesPerLine = true; |
txtData.UseFixedBytesPerLine = true; |
30 |
txtData.StringViewVisible = true; |
txtData.StringViewVisible = true; |
31 |
ramScroll.Minimum = (int)MemoryStart; |
ramScroll.Minimum = (int)MemoryStart; |
32 |
for (uint i = MemoryStart; i < (MemoryStart + MemorySize); i += max_address_width) { ramScroll.Maximum += (int)max_address_width; } |
for (uint i = MemoryStart; i < (MemoryStart + max_ram_view); i += max_address_width) { ramScroll.Maximum += (int)max_address_width; } |
33 |
ramScroll.Value = ramScroll.Minimum; |
ramScroll.Value = ramScroll.Minimum; |
34 |
this.CanChangeUpdateInterval = false; |
this.CanChangeUpdateInterval = false; |
35 |
|
|
58 |
public IConfigPlugin AcceptedPlugin { get; set; } |
public IConfigPlugin AcceptedPlugin { get; set; } |
59 |
#endregion |
#endregion |
60 |
#region IAcceptsMemoryRange members |
#region IAcceptsMemoryRange members |
61 |
public uint MemoryStart { get; set; } |
private uint MemoryStart { get { return 0; } } |
62 |
public uint MemorySize { get; set; } |
private uint MemorySize { get { return int.MaxValue; } } |
63 |
#endregion |
#endregion |
64 |
public void GotoTop() { this.CURRENT_TOP_ADDR = 0; } |
public void GotoTop() { this.CURRENT_TOP_ADDR = 0; } |
65 |
public void GotoBottom() { uint size = MemorySize; this.CURRENT_TOP_ADDR = (uint)((size - 1) - max_ram_view); } |
public void GotoBottom() { uint size = MemorySize; this.CURRENT_TOP_ADDR = (uint)((size - 1) - max_ram_view); } |
196 |
if (AcceptedPlugin == null) { return; } |
if (AcceptedPlugin == null) { return; } |
197 |
|
|
198 |
byte[] data = GetMemory(); |
byte[] data = GetMemory(); |
|
|
|
|
List<byte> ByteData = new List<byte>((int)(address + (max_ram_view - 0))); |
|
|
|
|
199 |
try |
try |
200 |
{ |
{ |
201 |
AddressList = ""; |
RamData = data; |
|
AsciiData = ""; |
|
202 |
|
|
|
// create a byte array holding only the bytes that we need |
|
|
for (uint i = address; i < (address + (max_ram_view + 1)); i += 1) { ByteData.Add(data[i]); } |
|
203 |
|
|
204 |
|
AddressList = ""; |
205 |
|
AsciiData = ""; |
206 |
// write the addreses out |
// write the addreses out |
207 |
for (uint i = address; i < (address + max_ram_view); i += max_address_width) |
for (uint i = address; i < (address + max_ram_view); i += max_address_width) |
208 |
{ |
{ |
209 |
AddressList = AddressList + string.Format("{0:X8}:\n", i); |
AddressList = AddressList + string.Format("{0:X8}:\n", i); |
210 |
} |
} |
211 |
// write out the ascii data |
//// write out the ascii data |
212 |
StringBuilder builder = new StringBuilder(); |
StringBuilder builder = new StringBuilder(); |
213 |
for (uint i = address; i < (address + max_ram_view); i += max_address_width) |
for (uint i = address; i < (address + max_ram_view); i += max_address_width) |
214 |
{ |
{ |
215 |
for (uint j = 0; j < max_address_width; j++) |
try |
216 |
{ |
{ |
217 |
uint current_addr = i + j; |
for (uint j = 0; j < max_address_width; j++) |
|
if (current_addr >= MemorySize) break; |
|
|
byte ascii_value_raw = data[current_addr]; |
|
|
char ascii_value = (char)data[current_addr]; |
|
|
if (ascii_value_raw >= 0x20 && ascii_value_raw <= 0x7e) |
|
|
{ |
|
|
builder.Append(ascii_value.ToString()); |
|
|
} |
|
|
else |
|
218 |
{ |
{ |
219 |
builder.Append("."); |
uint current_addr = i + j; |
220 |
|
if (current_addr >= MemorySize) break; |
221 |
|
byte ascii_value_raw = data[j]; |
222 |
|
char ascii_value = (char)data[j]; |
223 |
|
if (ascii_value_raw >= 0x20 && ascii_value_raw <= 0x7e) |
224 |
|
{ |
225 |
|
builder.Append(ascii_value.ToString()); |
226 |
|
} |
227 |
|
else |
228 |
|
{ |
229 |
|
builder.Append("."); |
230 |
|
} |
231 |
} |
} |
232 |
|
builder.AppendLine(); |
233 |
|
} |
234 |
|
catch (Exception ex) |
235 |
|
{ |
236 |
|
logger.Error.WriteLine("{0}.UpdateMemroyView().BuildingAsciiString:{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString()); |
237 |
|
return; |
238 |
} |
} |
|
builder.AppendLine(); |
|
239 |
} |
} |
240 |
AsciiData = builder.ToString(); |
AsciiData = builder.ToString(); |
|
// write out the bytes |
|
|
RamData = ByteData.ToArray(); |
|
241 |
|
|
242 |
|
|
243 |
} |
} |
305 |
uint ORIGINAL_ADDR = this.CURRENT_TOP_ADDR; |
uint ORIGINAL_ADDR = this.CURRENT_TOP_ADDR; |
306 |
|
|
307 |
////if (e.Type == ScrollEventType.EndScroll) return; |
////if (e.Type == ScrollEventType.EndScroll) return; |
308 |
uint size = MemorySize; |
uint size = max_ram_view; |
309 |
|
|
310 |
bool haveModifier = false; |
bool haveModifier = false; |
311 |
switch (e.Modifiers) |
switch (e.Modifiers) |
349 |
} |
} |
350 |
if (this.CURRENT_TOP_ADDR < MemoryStart) this.CURRENT_TOP_ADDR = MemoryStart; |
if (this.CURRENT_TOP_ADDR < MemoryStart) this.CURRENT_TOP_ADDR = MemoryStart; |
351 |
//if (this.CURRENT_TOP_ADDR >= VTLB_VADDR_SIZE) this.CURRENT_TOP_ADDR = (size - 1) - max_ram_view; |
//if (this.CURRENT_TOP_ADDR >= VTLB_VADDR_SIZE) this.CURRENT_TOP_ADDR = (size - 1) - max_ram_view; |
352 |
if (this.CURRENT_TOP_ADDR + max_ram_view >= MemoryStart) this.CURRENT_TOP_ADDR = (size - 1) - max_ram_view; |
if (this.CURRENT_TOP_ADDR + max_ram_view >= MemorySize) this.CURRENT_TOP_ADDR = (size - 1); |
353 |
|
|
354 |
//this.UpdateEnabled = reenable; |
//this.UpdateEnabled = reenable; |
355 |
} |
} |