--- trunk/RomCheater/Docking/UI/UIMemoryViewer.cs 2012/06/03 16:45:47 255 +++ trunk/RomCheater/Docking/UI/UIMemoryViewer.cs 2012/06/03 16:50:16 256 @@ -1,5 +1,5 @@ -#define DISABLE_GETFIRSTNONZEROBYTE_ONUPDATE_ACCEPTEDPROCESS // when defined will not call GetFirstNonZeroByte() when AcceptedProcess is updated and is not null -#define DISABLE_GETFIRSTNONZERO_BYTE // when defined will make GetFirstNonZeroByte() an empty void method +//#define DISABLE_GETFIRSTNONZEROBYTE_ONUPDATE_ACCEPTEDPROCESS // when defined will not call GetFirstNonZeroByte() when AcceptedProcess is updated and is not null +//#define DISABLE_GETFIRSTNONZERO_BYTE // when defined will make GetFirstNonZeroByte() an empty void method using System; using System.Collections.Generic; using System.ComponentModel; @@ -58,7 +58,7 @@ namespace RomCheater.Docking.UI { GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this); provider.OpenProvider(); - uint addr = 0; + int addr = 0; provider.ReadFirstNonZeroByte(MemoryStart, MemorySize, out addr); provider.CloseProvider(); GotoAddress(addr); @@ -88,11 +88,11 @@ namespace RomCheater.Docking.UI #endregion #region IAcceptsMemoryRange members public int MemoryStart { get { return 0; } } - public int MemorySize { get { return int.MaxValue; } } + public uint MemorySize { get { return int.MaxValue; } } #endregion public void GotoTop() { this.CURRENT_TOP_ADDR = 0; } public void GotoBottom() { uint size = (uint)MemorySize; this.CURRENT_TOP_ADDR = (int)((size - 1) - max_ram_view); } - public void GotoAddress(uint addr) { this.CURRENT_TOP_ADDR = (int)(addr & 0xFFFFFFF0); } + public void GotoAddress(int addr) { this.CURRENT_TOP_ADDR = (int)(addr & 0xFFFFFFF0); } private bool _UpdateEnabled; public bool UpdateEnabled { @@ -145,7 +145,7 @@ namespace RomCheater.Docking.UI } private void btnGotoAddress_Click(object sender, EventArgs e) { - this.GotoAddress(txthexGoto.ToUInt32()); + this.GotoAddress(txthexGoto.ToInt32()); } private void btnEditBytes_Click(object sender, EventArgs e) @@ -396,7 +396,7 @@ namespace RomCheater.Docking.UI } if (this.CURRENT_TOP_ADDR < MemoryStart) this.CURRENT_TOP_ADDR = MemoryStart; //if (this.CURRENT_TOP_ADDR >= VTLB_VADDR_SIZE) this.CURRENT_TOP_ADDR = (size - 1) - max_ram_view; - 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); //this.UpdateEnabled = reenable; } @@ -496,7 +496,7 @@ namespace RomCheater.Docking.UI if (this.CURRENT_TOP_ADDR < 0) this.CURRENT_TOP_ADDR = 0; //if (this.CURRENT_TOP_ADDR >= VTLB_VADDR_SIZE) this.CURRENT_TOP_ADDR = VTLB_VADDR_SIZE - max_ram_view; //if (this.CURRENT_TOP_ADDR < 0 || this.CURRENT_TOP_ADDR >= VTLB_VADDR_SIZE) this.CURRENT_TOP_ADDR = ORIGINAL_ADDR; - 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); //this.UpdateEnabled = reenable; //isScrolling = false; } |