Skip to content

Commit

Permalink
Use formatters in GetBPRegInfo; add missing commands
Browse files Browse the repository at this point in the history
BPMEM_TEV_COLOR_ENV + 6 (0xC6) was missing due to a typo.  BPMEM_BP_MASK (0xFE) does not lend itself well to documentation with the current FIFO analyzer implementation (since it requires remembering the values in BP memory) but still shouldn't be treated as unknown.  BPMEM_TX_SETMODE0_4 and BPMEM_TX_SETMODE1_4 (0xA4-0xAB) were missing entirely.
  • Loading branch information
Pokechu22 committed Mar 3, 2021
1 parent 186bd63 commit ce018f0
Show file tree
Hide file tree
Showing 3 changed files with 821 additions and 378 deletions.
28 changes: 17 additions & 11 deletions Source/Core/DolphinQt/FIFO/FIFOAnalyzer.cpp
Expand Up @@ -287,11 +287,17 @@ void FIFOAnalyzer::UpdateDetails()

case OpcodeDecoder::GX_LOAD_BP_REG:
{
u32 cmd2 = Common::swap32(objectdata);
objectdata += 4;
new_label = QStringLiteral("BP %1 %2")
.arg(cmd2 >> 24, 2, 16, QLatin1Char('0'))
.arg(cmd2 & 0xFFFFFF, 6, 16, QLatin1Char('0'));
const u8 cmd2 = *objectdata++;
const u32 cmddata = Common::swap24(objectdata);
objectdata += 3;

const auto [name, desc] = GetBPRegInfo(cmd2, cmddata);
ASSERT(!name.empty());

new_label = QStringLiteral("BP %1 %2 %3")
.arg(cmd2, 2, 16, QLatin1Char('0'))
.arg(cmddata, 6, 16, QLatin1Char('0'))
.arg(QString::fromStdString(name));
}
break;

Expand Down Expand Up @@ -476,14 +482,14 @@ void FIFOAnalyzer::UpdateDescription()
QString text;
if (*cmddata == OpcodeDecoder::GX_LOAD_BP_REG)
{
std::string name;
std::string desc;
GetBPRegInfo(cmddata + 1, &name, &desc);
const u8 cmd = *(cmddata + 1);
const u32 value = Common::swap24(cmddata + 2);

const auto [name, desc] = GetBPRegInfo(cmd, value);
ASSERT(!name.empty());

text = tr("BP register ");
text += name.empty() ?
QStringLiteral("UNKNOWN_%1").arg(*(cmddata + 1), 2, 16, QLatin1Char('0')) :
QString::fromStdString(name);
text += QString::fromStdString(name);
text += QLatin1Char{'\n'};

if (desc.empty())
Expand Down

0 comments on commit ce018f0

Please sign in to comment.