2015-05-06 05:27:59 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include "RegViewSCU.h"
|
|
|
|
#include "../COP_SCU.h"
|
|
|
|
|
2017-09-07 16:36:49 +00:00
|
|
|
CRegViewSCU::CRegViewSCU(HWND parentWnd, const RECT& rect, CVirtualMachine& virtualMachine, CMIPS* ctx)
|
|
|
|
: CRegViewPage(parentWnd, rect)
|
|
|
|
, m_ctx(ctx)
|
2015-05-06 05:27:59 +00:00
|
|
|
{
|
|
|
|
virtualMachine.OnMachineStateChange.connect(boost::bind(&CRegViewSCU::Update, this));
|
|
|
|
virtualMachine.OnRunningStateChange.connect(boost::bind(&CRegViewSCU::Update, this));
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRegViewSCU::Update()
|
|
|
|
{
|
|
|
|
SetDisplayText(GetDisplayText().c_str());
|
|
|
|
CRegViewPage::Update();
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string CRegViewSCU::GetDisplayText()
|
|
|
|
{
|
2017-09-07 16:36:49 +00:00
|
|
|
const auto& state = m_ctx->m_State;
|
2015-05-06 05:27:59 +00:00
|
|
|
std::string result;
|
|
|
|
|
|
|
|
for(unsigned int i = 0; i < 32; i++)
|
|
|
|
{
|
|
|
|
char sTemp[256];
|
2017-09-07 16:36:49 +00:00
|
|
|
sprintf(sTemp, "%10s : 0x%08X\r\n", CCOP_SCU::m_sRegName[i], state.nCOP0[i]);
|
2015-05-06 05:27:59 +00:00
|
|
|
result += sTemp;
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|