2006-06-15 04:19:30 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include "RegViewSCU.h"
|
2006-07-13 02:44:13 +00:00
|
|
|
#include "../COP_SCU.h"
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2012-03-12 05:24:43 +00:00
|
|
|
CRegViewSCU::CRegViewSCU(HWND hParent, RECT* pR, CVirtualMachine& virtualMachine, CMIPS* pC)
|
|
|
|
: CRegViewPage(hParent, pR)
|
|
|
|
, m_pCtx(pC)
|
2006-06-15 04:19:30 +00:00
|
|
|
{
|
2012-03-12 05:24:43 +00:00
|
|
|
virtualMachine.OnMachineStateChange.connect(boost::bind(&CRegViewSCU::Update, this));
|
|
|
|
virtualMachine.OnRunningStateChange.connect(boost::bind(&CRegViewSCU::Update, this));
|
2006-06-15 04:19:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CRegViewSCU::~CRegViewSCU()
|
|
|
|
{
|
2006-12-26 21:53:04 +00:00
|
|
|
|
2006-06-15 04:19:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CRegViewSCU::Update()
|
|
|
|
{
|
2008-05-14 03:09:54 +00:00
|
|
|
SetDisplayText(GetDisplayText().c_str());
|
2006-06-15 04:19:30 +00:00
|
|
|
CRegViewPage::Update();
|
|
|
|
}
|
|
|
|
|
2012-03-12 05:24:43 +00:00
|
|
|
std::string CRegViewSCU::GetDisplayText()
|
2006-06-15 04:19:30 +00:00
|
|
|
{
|
2008-05-14 03:09:54 +00:00
|
|
|
MIPSSTATE* s = &m_pCtx->m_State;
|
2012-03-12 05:24:43 +00:00
|
|
|
std::string result;
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2008-05-14 03:09:54 +00:00
|
|
|
for(unsigned int i = 0; i < 32; i++)
|
2006-06-15 04:19:30 +00:00
|
|
|
{
|
2012-03-12 05:24:43 +00:00
|
|
|
char sTemp[256];
|
2006-06-15 04:19:30 +00:00
|
|
|
sprintf(sTemp, "%10s : 0x%0.8X\r\n", CCOP_SCU::m_sRegName[i], s->nCOP0[i]);
|
2008-05-14 03:09:54 +00:00
|
|
|
result += sTemp;
|
2006-06-15 04:19:30 +00:00
|
|
|
}
|
2008-05-14 03:09:54 +00:00
|
|
|
|
2012-03-12 05:24:43 +00:00
|
|
|
return result;
|
2006-06-15 04:19:30 +00:00
|
|
|
}
|