Play-/Source/ui_qt/DebugSupport/RegViewSCU.cpp

31 lines
601 B
C++
Raw Normal View History

2019-08-31 12:33:24 -04:00
#include <stdio.h>
#include <string.h>
#include <QHeaderView>
#include "RegViewSCU.h"
#include "COP_SCU.h"
CRegViewSCU::CRegViewSCU(QWidget* parent, CMIPS* ctx)
: CRegViewPage(parent)
, m_ctx(ctx)
{
2019-12-19 22:13:49 +00:00
AllocateTableEntries(2, 32);
setColumnWidth(0, 85);
horizontalHeader()->setStretchLastSection(true);
2019-08-31 12:33:24 -04:00
for(unsigned int x = 0; x < 32; x++)
{
2019-12-19 22:13:49 +00:00
setRowHeight(x, 16);
WriteTableLabel(x, CCOP_SCU::m_sRegName[x]);
2019-08-31 12:33:24 -04:00
}
2019-12-19 22:13:49 +00:00
Update();
2019-08-31 12:33:24 -04:00
}
void CRegViewSCU::Update()
{
const auto& state = m_ctx->m_State;
for(unsigned int i = 0; i < 32; i++)
{
2019-12-19 22:13:49 +00:00
WriteTableEntry(i, "0x%08X", state.nCOP0[i]);
2019-08-31 12:33:24 -04:00
}
}