ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater/Docking/UI/UIMemoryViewer.cs
(Generate patch)

Comparing trunk/RomCheater/Docking/UI/UIMemoryViewer.cs (file contents):
Revision 255 by william, Sun Jun 3 16:09:05 2012 UTC vs.
Revision 256 by william, Sun Jun 3 16:50:16 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
2 < #define DISABLE_GETFIRSTNONZERO_BYTE // when defined will make GetFirstNonZeroByte() an empty void method
1 > //#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
3   using System;
4   using System.Collections.Generic;
5   using System.ComponentModel;
# Line 58 | Line 58 | namespace RomCheater.Docking.UI
58              {
59                  GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this);
60                  provider.OpenProvider();
61 <                uint addr = 0;
61 >                int addr = 0;
62                  provider.ReadFirstNonZeroByte(MemoryStart, MemorySize, out addr);
63                  provider.CloseProvider();
64                  GotoAddress(addr);
# Line 88 | Line 88 | namespace RomCheater.Docking.UI
88          #endregion
89          #region IAcceptsMemoryRange members
90          public int MemoryStart { get { return 0; } }
91 <        public int MemorySize { get { return int.MaxValue; } }
91 >        public uint MemorySize { get { return int.MaxValue; } }
92          #endregion
93          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); }
95 <        public void GotoAddress(uint addr) { this.CURRENT_TOP_ADDR = (int)(addr & 0xFFFFFFF0); }
95 >        public void GotoAddress(int addr) { this.CURRENT_TOP_ADDR = (int)(addr & 0xFFFFFFF0); }
96          private bool _UpdateEnabled;
97          public bool UpdateEnabled
98          {
# Line 145 | Line 145 | namespace RomCheater.Docking.UI
145          }
146          private void btnGotoAddress_Click(object sender, EventArgs e)
147          {
148 <            this.GotoAddress(txthexGoto.ToUInt32());
148 >            this.GotoAddress(txthexGoto.ToInt32());
149          }
150  
151          private void btnEditBytes_Click(object sender, EventArgs e)
# Line 396 | Line 396 | namespace RomCheater.Docking.UI
396              }
397              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;
399 <            if (this.CURRENT_TOP_ADDR + max_ram_view >= MemorySize) this.CURRENT_TOP_ADDR = (MemorySize - max_ram_view);
399 >            if (this.CURRENT_TOP_ADDR + max_ram_view >= MemorySize) this.CURRENT_TOP_ADDR = (int)(MemorySize - max_ram_view);
400              
401              //this.UpdateEnabled = reenable;
402          }
# Line 496 | Line 496 | namespace RomCheater.Docking.UI
496              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;
498              //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;
499 >            if (this.CURRENT_TOP_ADDR + max_ram_view >= MemorySize) this.CURRENT_TOP_ADDR = (int)(MemorySize - max_ram_view);
500              //this.UpdateEnabled = reenable;
501              //isScrolling = false;
502          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines