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

44 lines
1.1 KiB
C++
Raw Permalink Normal View History

2019-08-31 12:33:24 -04:00
#include <stdio.h>
#include <string.h>
#include <QHeaderView>
#include "RegViewGeneral.h"
2019-12-19 21:37:47 +00:00
CRegViewGeneral::CRegViewGeneral(QWidget* hParent, CMIPS* pC)
2019-08-31 12:33:24 -04:00
: CRegViewPage(hParent)
, m_pCtx(pC)
{
2019-12-19 22:13:49 +00:00
AllocateTableEntries(2, 37);
setColumnWidth(0, 32);
horizontalHeader()->setStretchLastSection(true);
2019-08-31 12:33:24 -04:00
for(unsigned int x = 0; x < 37; x++)
{
2019-12-19 22:13:49 +00:00
setRowHeight(x, 16);
2019-08-31 12:33:24 -04:00
}
for(unsigned int x = 0; x < 32; x++)
{
2019-12-19 22:13:49 +00:00
WriteTableLabel(x, CMIPS::m_sGPRName[x]);
2019-08-31 12:33:24 -04:00
}
2019-12-19 22:13:49 +00:00
WriteTableLabel(32, "LO");
WriteTableLabel(33, "HI");
WriteTableLabel(34, "LO1");
WriteTableLabel(35, "HI1");
WriteTableLabel(36, "SA");
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 CRegViewGeneral::Update()
{
2019-12-19 22:13:49 +00:00
MIPSSTATE* s = &m_pCtx->m_State;
2019-08-31 12:33:24 -04:00
for(unsigned int i = 0; i < 32; i++)
{
2019-12-19 22:13:49 +00:00
WriteTableEntry(i, "0x%08X%08X%08X%08X", s->nGPR[i].nV[3], s->nGPR[i].nV[2], s->nGPR[i].nV[1], s->nGPR[i].nV[0]);
2019-08-31 12:33:24 -04:00
}
2019-12-19 22:13:49 +00:00
WriteTableEntry(32, "0x%08X%08X", s->nLO[1], s->nLO[0]);
WriteTableEntry(33, "0x%08X%08X", s->nHI[1], s->nHI[0]);
WriteTableEntry(34, "0x%08X%08X", s->nLO1[1], s->nLO1[0]);
WriteTableEntry(35, "0x%08X%08X", s->nHI1[1], s->nHI1[0]);
WriteTableEntry(36, "0x%08X", s->nSA);
2019-08-31 12:33:24 -04:00
}