Add PeekAddress() to the watch object. Ram Search & Ram Watch refactored to use the object method instead. DWord view implemented as a result. A display bug in Ram Watch 2 byte fixed.
This commit is contained in:
parent
bc74d6c575
commit
f15d16c513
|
@ -19,7 +19,6 @@ namespace BizHawk.MultiClient
|
||||||
//TODO:
|
//TODO:
|
||||||
//Window position gets saved but doesn't load properly
|
//Window position gets saved but doesn't load properly
|
||||||
//Add to Ram watch fails to open ram watch if it has neve been opened
|
//Add to Ram watch fails to open ram watch if it has neve been opened
|
||||||
//Implement DWORD start new search & updateValues
|
|
||||||
//Doesnt' release handle after saving file, Ram Watch too?
|
//Doesnt' release handle after saving file, Ram Watch too?
|
||||||
//Implement Preview search
|
//Implement Preview search
|
||||||
//Implement Check Misaligned (does 2 & 4 byte on each possible address instead of every other (or every 4)
|
//Implement Check Misaligned (does 2 & 4 byte on each possible address instead of every other (or every 4)
|
||||||
|
@ -47,34 +46,10 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
public void UpdateValues()
|
public void UpdateValues()
|
||||||
{
|
{
|
||||||
//TODO: update based on atype
|
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
{
|
{
|
||||||
searchList[x].prev = searchList[x].value;
|
searchList[x].prev = searchList[x].value;
|
||||||
switch (searchList[x].type)
|
searchList[x].PeekAddress(Global.Emulator.MainMemory);
|
||||||
{
|
|
||||||
case atype.BYTE:
|
|
||||||
searchList[x].value = Global.Emulator.MainMemory.PeekByte(searchList[x].address);
|
|
||||||
break;
|
|
||||||
case atype.WORD:
|
|
||||||
if (searchList[x].bigendian)
|
|
||||||
{
|
|
||||||
searchList[x].value = ((Global.Emulator.MainMemory.PeekByte(searchList[x].address) * 256) +
|
|
||||||
Global.Emulator.MainMemory.PeekByte((searchList[x].address) + 1));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
searchList[x].value = (Global.Emulator.MainMemory.PeekByte(searchList[x].address) +
|
|
||||||
(Global.Emulator.MainMemory.PeekByte((searchList[x].address) + 1) * 256));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case atype.DWORD:
|
|
||||||
//TODO
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
searchList[x].value = Global.Emulator.MainMemory.PeekByte(searchList[x].address);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchList[x].prev != searchList[x].value)
|
if (searchList[x].prev != searchList[x].value)
|
||||||
searchList[x].changecount++;
|
searchList[x].changecount++;
|
||||||
|
@ -301,7 +276,7 @@ namespace BizHawk.MultiClient
|
||||||
int startaddress = 0;
|
int startaddress = 0;
|
||||||
if (Global.Emulator.SystemId == "PCE")
|
if (Global.Emulator.SystemId == "PCE")
|
||||||
startaddress = 0x1F0000; //For now, until Emulator core functionality can better handle a prefix
|
startaddress = 0x1F0000; //For now, until Emulator core functionality can better handle a prefix
|
||||||
int count = 1;
|
int count = 0;
|
||||||
int divisor = 1;
|
int divisor = 1;
|
||||||
switch (GetDataSize())
|
switch (GetDataSize())
|
||||||
{
|
{
|
||||||
|
@ -320,33 +295,21 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
searchList.Add(new Watch());
|
searchList.Add(new Watch());
|
||||||
searchList[x].address = count + startaddress;
|
searchList[x].address = count + startaddress;
|
||||||
|
searchList[x].type = GetDataSize();
|
||||||
|
searchList[x].bigendian = GetBigEndian();
|
||||||
|
searchList[x].signed = GetDataType();
|
||||||
|
searchList[x].PeekAddress(Global.Emulator.MainMemory);
|
||||||
|
searchList[x].prev = searchList[x].value;
|
||||||
switch (GetDataSize())
|
switch (GetDataSize())
|
||||||
{
|
{
|
||||||
case atype.BYTE:
|
case atype.BYTE: //TODO: misaligned option
|
||||||
searchList[x].prev = searchList[x].value = Global.Emulator.MainMemory.PeekByte(count);
|
|
||||||
searchList[x].bigendian = GetBigEndian(); //Pointless in 1 byte, but might as well
|
|
||||||
searchList[x].signed = GetDataType();
|
|
||||||
searchList[x].type = atype.BYTE;
|
|
||||||
count++;
|
count++;
|
||||||
break;
|
break;
|
||||||
case atype.WORD:
|
case atype.WORD:
|
||||||
if (GetBigEndian())
|
|
||||||
{
|
|
||||||
searchList[x].prev = searchList[x].value = ((Global.Emulator.MainMemory.PeekByte(searchList[x].address) * 256) +
|
|
||||||
Global.Emulator.MainMemory.PeekByte((searchList[x].address) + 1));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
searchList[x].prev = searchList[x].value = (Global.Emulator.MainMemory.PeekByte(searchList[x].address) +
|
|
||||||
(Global.Emulator.MainMemory.PeekByte((searchList[x].address) + 1) * 256));
|
|
||||||
}
|
|
||||||
searchList[x].bigendian = GetBigEndian(); //Pointless in 1 byte, but might as well
|
|
||||||
searchList[x].signed = GetDataType();
|
|
||||||
searchList[x].type = atype.BYTE;
|
|
||||||
count += 2;
|
count += 2;
|
||||||
break;
|
break;
|
||||||
case atype.DWORD:
|
case atype.DWORD:
|
||||||
//TODO
|
count += 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
//TODO:
|
//TODO:
|
||||||
//Call AskSave in main client X function
|
//Call AskSave in main client X function
|
||||||
//DWORD display
|
|
||||||
//On Movie UP/Down set highlighted items to be what the user had selected (in their new position)
|
//On Movie UP/Down set highlighted items to be what the user had selected (in their new position)
|
||||||
//DisplayWatches needs to do value display properly like updatevalues, or just run update values
|
//DisplayWatches needs to do value display properly like updatevalues, or just run update values
|
||||||
//When Watch object has a changes member, display in watch list with a reset changes function
|
//When Watch object has a changes member, display in watch list with a reset changes function
|
||||||
|
@ -42,33 +41,9 @@ namespace BizHawk.MultiClient
|
||||||
public void UpdateValues()
|
public void UpdateValues()
|
||||||
{
|
{
|
||||||
for (int x = 0; x < watchList.Count; x++)
|
for (int x = 0; x < watchList.Count; x++)
|
||||||
{
|
watchList[x].PeekAddress(Global.Emulator.MainMemory);
|
||||||
if (watchList[x].type == atype.SEPARATOR) continue;
|
|
||||||
switch (watchList[x].type)
|
|
||||||
{
|
|
||||||
case atype.BYTE:
|
|
||||||
watchList[x].value = Global.Emulator.MainMemory.PeekByte(watchList[x].address);
|
|
||||||
break;
|
|
||||||
case atype.WORD:
|
|
||||||
{
|
|
||||||
if (watchList[x].bigendian)
|
|
||||||
{
|
|
||||||
watchList[x].value = ((Global.Emulator.MainMemory.PeekByte(watchList[x].address)*256) +
|
|
||||||
Global.Emulator.MainMemory.PeekByte((watchList[x+1].address)+1) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
watchList[x].value = (Global.Emulator.MainMemory.PeekByte(watchList[x].address) +
|
|
||||||
(Global.Emulator.MainMemory.PeekByte((watchList[x].address)+1)*256) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case atype.DWORD:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
WatchListView.Refresh();
|
WatchListView.Refresh();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void AddWatch(Watch w)
|
public void AddWatch(Watch w)
|
||||||
{
|
{
|
||||||
|
|
|
@ -115,5 +115,51 @@ namespace BizHawk.MultiClient
|
||||||
return 's'; //Just in case
|
return 's'; //Just in case
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PeekByte(MemoryDomain domain)
|
||||||
|
{
|
||||||
|
value = domain.PeekByte(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int PeekWord(MemoryDomain domain, int addr)
|
||||||
|
{
|
||||||
|
int temp = 0;
|
||||||
|
if (bigendian)
|
||||||
|
{
|
||||||
|
temp = ((domain.PeekByte(addr) * 256) +
|
||||||
|
domain.PeekByte(addr + 1));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
temp = ((domain.PeekByte(addr) +
|
||||||
|
domain.PeekByte(addr + 1) * 256));
|
||||||
|
}
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PeekDWord(MemoryDomain domain)
|
||||||
|
{
|
||||||
|
value = ((PeekWord(domain, address) * 65536) +
|
||||||
|
PeekWord(domain, address + 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PeekAddress(MemoryDomain domain)
|
||||||
|
{
|
||||||
|
if (type == atype.SEPARATOR)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch(type)
|
||||||
|
{
|
||||||
|
case atype.BYTE:
|
||||||
|
PeekByte(domain);
|
||||||
|
break;
|
||||||
|
case atype.WORD:
|
||||||
|
value = PeekWord(domain, address);
|
||||||
|
break;
|
||||||
|
case atype.DWORD:
|
||||||
|
PeekDWord(domain);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue