2006-06-15 04:19:30 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2006-12-26 21:53:04 +00:00
|
|
|
#include <boost/bind.hpp>
|
2006-06-15 04:19:30 +00:00
|
|
|
#include "RegViewSCU.h"
|
2006-07-13 02:44:13 +00:00
|
|
|
#include "../COP_SCU.h"
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
using namespace Framework;
|
2006-12-26 21:53:04 +00:00
|
|
|
using namespace boost;
|
2008-05-14 03:09:54 +00:00
|
|
|
using namespace std;
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2007-12-01 04:08:34 +00:00
|
|
|
CRegViewSCU::CRegViewSCU(HWND hParent, RECT* pR, CVirtualMachine& virtualMachine, CMIPS* pC) :
|
2006-06-15 04:19:30 +00:00
|
|
|
CRegViewPage(hParent, pR)
|
|
|
|
{
|
|
|
|
m_pCtx = pC;
|
|
|
|
|
2007-12-01 04:08:34 +00:00
|
|
|
virtualMachine.m_OnMachineStateChange.connect(bind(&CRegViewSCU::Update, this));
|
|
|
|
virtualMachine.m_OnRunningStateChange.connect(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();
|
|
|
|
}
|
|
|
|
|
2008-05-14 03:09:54 +00:00
|
|
|
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;
|
|
|
|
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
|
|
|
{
|
2008-05-14 03:09:54 +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
|
|
|
|
|
|
|
return result;
|
2006-06-15 04:19:30 +00:00
|
|
|
}
|