/[RomCheater]/trunk/RomCheater/Docking/UI/UIMemoryViewer.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/UI/UIMemoryViewer.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 249 by william, Sun Jun 3 16:09:05 2012 UTC revision 274 by william, Sun Jun 3 21:41:19 2012 UTC
# Line 1  Line 1 
1  #define DISABLE_GETFIRSTNONZEROBYTE_ONUPDATE_ACCEPTEDPROCESS // when defined will not call GetFirstNonZeroByte() when AcceptedProcess is updated and is not null  //#define DISABLE_GETFIRSTNONZEROBYTE_ONUPDATE_ACCEPTEDPROCESS // when defined will not call GetFirstNonZeroByte() when AcceptedProcess is updated and is not null
2  #define DISABLE_GETFIRSTNONZERO_BYTE // when defined will make GetFirstNonZeroByte() an empty void method  //#define DISABLE_GETFIRSTNONZERO_BYTE // when defined will make GetFirstNonZeroByte() an empty void method
3  using System;  using System;
4  using System.Collections.Generic;  using System.Collections.Generic;
5  using System.ComponentModel;  using System.ComponentModel;
# Line 58  namespace RomCheater.Docking.UI Line 58  namespace RomCheater.Docking.UI
58              {              {
59                  GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this);                  GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this);
60                  provider.OpenProvider();                  provider.OpenProvider();
61                  uint addr = 0;                  int addr = 0;
62                  provider.ReadFirstNonZeroByte(MemoryStart, MemorySize, out addr);                  provider.ReadFirstNonZeroByte(MemoryStart, MemorySize, out addr);
63                  provider.CloseProvider();                  provider.CloseProvider();
64                  GotoAddress(addr);                  GotoAddress(addr);
# Line 88  namespace RomCheater.Docking.UI Line 88  namespace RomCheater.Docking.UI
88          #endregion          #endregion
89          #region IAcceptsMemoryRange members          #region IAcceptsMemoryRange members
90          public int MemoryStart { get { return 0; } }          public int MemoryStart { get { return 0; } }
91          public int MemorySize { get { return int.MaxValue; } }          public uint MemorySize { get { return int.MaxValue; } }
92          #endregion          #endregion
93          public void GotoTop() { this.CURRENT_TOP_ADDR = 0; }          public void GotoTop() { this.CURRENT_TOP_ADDR = 0; }
94          public void GotoBottom() { uint size = (uint)MemorySize; this.CURRENT_TOP_ADDR = (int)((size - 1) - max_ram_view); }          public void GotoBottom() { uint size = (uint)MemorySize; this.CURRENT_TOP_ADDR = (int)((size - 1) - max_ram_view); }
95          public void GotoAddress(uint addr) { this.CURRENT_TOP_ADDR = (int)(addr & 0xFFFFFFF0); }          public void GotoAddress(int addr) { this.CURRENT_TOP_ADDR = (int)(addr & 0xFFFFFFF0); }
96          private bool _UpdateEnabled;          private bool _UpdateEnabled;
97          public bool UpdateEnabled          public bool UpdateEnabled
98          {          {
# Line 141  namespace RomCheater.Docking.UI Line 141  namespace RomCheater.Docking.UI
141              int TotalHeight = txtData.Height;              int TotalHeight = txtData.Height;
142              int NumberOfBytes = (int)((TotalHeight / ByteHeight) * max_address_width);              int NumberOfBytes = (int)((TotalHeight / ByteHeight) * max_address_width);
143              int byte_width = (max_address_width * 2);              int byte_width = (max_address_width * 2);
144              max_ram_view = NumberOfBytes + (byte_width - 1);              max_ram_view = NumberOfBytes + (byte_width);
145          }          }
146          private void btnGotoAddress_Click(object sender, EventArgs e)          private void btnGotoAddress_Click(object sender, EventArgs e)
147          {          {
148              this.GotoAddress(txthexGoto.ToUInt32());              this.GotoAddress(txthexGoto.ToInt32());
149          }          }
150    
151          private void btnEditBytes_Click(object sender, EventArgs e)          private void btnEditBytes_Click(object sender, EventArgs e)
# Line 396  namespace RomCheater.Docking.UI Line 396  namespace RomCheater.Docking.UI
396              }              }
397              if (this.CURRENT_TOP_ADDR < MemoryStart) this.CURRENT_TOP_ADDR = MemoryStart;              if (this.CURRENT_TOP_ADDR < MemoryStart) this.CURRENT_TOP_ADDR = MemoryStart;
398              //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;
399              if (this.CURRENT_TOP_ADDR + max_ram_view >= MemorySize) this.CURRENT_TOP_ADDR = (MemorySize - max_ram_view);              if (this.CURRENT_TOP_ADDR + max_ram_view >= MemorySize) this.CURRENT_TOP_ADDR = (int)(MemorySize - max_ram_view);
400                            
401              //this.UpdateEnabled = reenable;              //this.UpdateEnabled = reenable;
402          }          }
# Line 496  namespace RomCheater.Docking.UI Line 496  namespace RomCheater.Docking.UI
496              if (this.CURRENT_TOP_ADDR < 0) this.CURRENT_TOP_ADDR = 0;              if (this.CURRENT_TOP_ADDR < 0) this.CURRENT_TOP_ADDR = 0;
497              //if (this.CURRENT_TOP_ADDR >= VTLB_VADDR_SIZE) this.CURRENT_TOP_ADDR = VTLB_VADDR_SIZE - max_ram_view;              //if (this.CURRENT_TOP_ADDR >= VTLB_VADDR_SIZE) this.CURRENT_TOP_ADDR = VTLB_VADDR_SIZE - max_ram_view;
498              //if (this.CURRENT_TOP_ADDR < 0 || this.CURRENT_TOP_ADDR >= VTLB_VADDR_SIZE) this.CURRENT_TOP_ADDR = ORIGINAL_ADDR;              //if (this.CURRENT_TOP_ADDR < 0 || this.CURRENT_TOP_ADDR >= VTLB_VADDR_SIZE) this.CURRENT_TOP_ADDR = ORIGINAL_ADDR;
499              if (this.CURRENT_TOP_ADDR + max_ram_view >= MemorySize) this.CURRENT_TOP_ADDR = MemorySize - max_ram_view;              if (this.CURRENT_TOP_ADDR + max_ram_view >= MemorySize) this.CURRENT_TOP_ADDR = (int)(MemorySize - max_ram_view);
500              //this.UpdateEnabled = reenable;              //this.UpdateEnabled = reenable;
501              //isScrolling = false;              //isScrolling = false;
502          }          }

Legend:
Removed from v.249  
changed lines
  Added in v.274

  ViewVC Help
Powered by ViewVC 1.1.22