Beispiel #1
0
wxString CRegTable::GetValue(int row, int col)
{
	if (row < 32)
	{
		switch (col)
		{
		case 0: return StrToWxStr(GetGPRName(row));
		case 1: return wxString::Format("%08x", GPR(row));
		case 2: return StrToWxStr(GetFPRName(row));
		case 3: return wxString::Format("%016llx", riPS0(row));
		case 4: return wxString::Format("%016llx", riPS1(row));
		default: return wxEmptyString;
		}
	}
	else
	{
		if (row - 32 < NUM_SPECIALS)
		{
			switch (col)
			{
			case 0: return StrToWxStr(special_reg_names[row - 32]);
			case 1: return wxString::Format("%08x", GetSpecialRegValue(row - 32));
			default: return wxEmptyString;
			}
		}
	}
	return wxEmptyString;
}
Beispiel #2
0
void CRegTable::UpdateCachedRegs()
{
	for (int i = 0; i < 32; ++i)
	{
		m_CachedRegHasChanged[i] = (m_CachedRegs[i] != GPR(i));
		m_CachedRegs[i] = GPR(i);

		m_CachedFRegHasChanged[i][0] = (m_CachedFRegs[i][0] != riPS0(i));
		m_CachedFRegs[i][0] = riPS0(i);
		m_CachedFRegHasChanged[i][1] = (m_CachedFRegs[i][1] != riPS1(i));
		m_CachedFRegs[i][1] = riPS1(i);
	}
	for (int i = 0; i < NUM_SPECIALS; ++i)
	{
		m_CachedSpecialRegHasChanged[i] = (m_CachedSpecialRegs[i] != GetSpecialRegValue(i));
		m_CachedSpecialRegs[i] = GetSpecialRegValue(i);
	}
}
Beispiel #3
0
wxString CRegTable::GetValue(int row, int col)
{
  if (row < 32)
  {
    switch (col)
    {
    case 0:
      return StrToWxStr(GekkoDisassembler::GetGPRName(row));
    case 1:
      return FormatGPR(row);
    case 2:
      return StrToWxStr(GekkoDisassembler::GetFPRName(row));
    case 3:
      return FormatFPR(row, 0);
    case 4:
      return FormatFPR(row, 1);
    case 5:
    {
      if (row < 4)
        return wxString::Format("DBAT%01d", row);

      if (row < 8)
        return wxString::Format("IBAT%01d", row - 4);

      if (row < 12)
        return wxString::Format("DBAT%01d", row - 4);

      if (row < 16)
        return wxString::Format("IBAT%01d", row - 8);

      break;
    }
    case 6:
    {
      if (row < 4)
        return wxString::Format("%016llx", (u64)PowerPC::ppcState.spr[SPR_DBAT0U + row * 2] << 32 |
                                               PowerPC::ppcState.spr[SPR_DBAT0L + row * 2]);

      if (row < 8)
        return wxString::Format("%016llx", (u64)PowerPC::ppcState.spr[SPR_IBAT0U + (row - 4) * 2]
                                                   << 32 |
                                               PowerPC::ppcState.spr[SPR_IBAT0L + (row - 4) * 2]);

      if (row < 12)
        return wxString::Format("%016llx", (u64)PowerPC::ppcState.spr[SPR_DBAT4U + (row - 12) * 2]
                                                   << 32 |
                                               PowerPC::ppcState.spr[SPR_DBAT4L + (row - 12) * 2]);

      if (row < 16)
        return wxString::Format("%016llx", (u64)PowerPC::ppcState.spr[SPR_IBAT4U + (row - 16) * 2]
                                                   << 32 |
                                               PowerPC::ppcState.spr[SPR_IBAT4L + (row - 16) * 2]);

      break;
    }
    case 7:
    {
      if (row < 16)
        return wxString::Format("SR%02d", row);

      break;
    }
    case 8:
    {
      if (row < 16)
        return wxString::Format("%08x", PowerPC::ppcState.sr[row]);

      break;
    }
    default:
      return wxEmptyString;
    }
  }
  else
  {
    if (static_cast<size_t>(row - 32) < NUM_SPECIALS)
    {
      switch (col)
      {
      case 0:
        return StrToWxStr(special_reg_names[row - 32]);
      case 1:
        return wxString::Format("%08x", GetSpecialRegValue(row - 32));
      default:
        return wxEmptyString;
      }
    }
  }
  return wxEmptyString;
}