2016-01-16 18:43:41 -05:00
|
|
|
#include <assert.h>
|
|
|
|
#include "Iop_MtapMan.h"
|
2025-03-11 12:48:26 -04:00
|
|
|
#include "Log.h"
|
2016-01-16 18:43:41 -05:00
|
|
|
|
|
|
|
using namespace Iop;
|
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
#define LOG_NAME "iop_mtapman"
|
2016-01-16 18:43:41 -05:00
|
|
|
|
|
|
|
CMtapMan::CMtapMan()
|
|
|
|
{
|
|
|
|
m_module901 = CSifModuleAdapter(std::bind(&CMtapMan::Invoke901, this,
|
2018-04-30 21:01:23 +01:00
|
|
|
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6));
|
2016-01-16 18:43:41 -05:00
|
|
|
m_module902 = CSifModuleAdapter(std::bind(&CMtapMan::Invoke902, this,
|
2018-04-30 21:01:23 +01:00
|
|
|
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6));
|
2016-01-16 18:43:41 -05:00
|
|
|
m_module903 = CSifModuleAdapter(std::bind(&CMtapMan::Invoke903, this,
|
2018-04-30 21:01:23 +01:00
|
|
|
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6));
|
2016-01-16 18:43:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
std::string CMtapMan::GetId() const
|
|
|
|
{
|
|
|
|
return "mtapman";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string CMtapMan::GetFunctionName(unsigned int) const
|
|
|
|
{
|
|
|
|
return "unknown";
|
|
|
|
}
|
|
|
|
|
2016-01-16 20:28:45 -05:00
|
|
|
void CMtapMan::RegisterSifModules(CSifMan& sif)
|
2016-01-16 18:43:41 -05:00
|
|
|
{
|
|
|
|
sif.RegisterModule(MODULE_ID_1, &m_module901);
|
|
|
|
sif.RegisterModule(MODULE_ID_2, &m_module902);
|
|
|
|
sif.RegisterModule(MODULE_ID_3, &m_module903);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMtapMan::Invoke(CMIPS& context, unsigned int functionId)
|
|
|
|
{
|
|
|
|
throw std::runtime_error("Not implemented.");
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CMtapMan::Invoke901(uint32 method, uint32* args, uint32 argsSize, uint32* ret, uint32 retSize, uint8* ram)
|
|
|
|
{
|
|
|
|
switch(method)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
ret[1] = PortOpen(args[0]);
|
|
|
|
break;
|
|
|
|
default:
|
2018-05-24 12:59:15 -04:00
|
|
|
CLog::GetInstance().Warn(LOG_NAME, "Unknown method invoked (0x%08X, 0x%08X).\r\n", 0x901, method);
|
2016-01-16 18:43:41 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CMtapMan::Invoke902(uint32 method, uint32* args, uint32 argsSize, uint32* ret, uint32 retSize, uint8* ram)
|
|
|
|
{
|
|
|
|
switch(method)
|
|
|
|
{
|
|
|
|
default:
|
2018-05-24 12:59:15 -04:00
|
|
|
CLog::GetInstance().Warn(LOG_NAME, "Unknown method invoked (0x%08X, 0x%08X).\r\n", 0x902, method);
|
2016-01-16 18:43:41 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CMtapMan::Invoke903(uint32 method, uint32* args, uint32 argsSize, uint32* ret, uint32 retSize, uint8* ram)
|
|
|
|
{
|
|
|
|
switch(method)
|
|
|
|
{
|
|
|
|
default:
|
2018-05-24 12:59:15 -04:00
|
|
|
CLog::GetInstance().Warn(LOG_NAME, "Unknown method invoked (0x%08X, 0x%08X).\r\n", 0x903, method);
|
2016-01-16 18:43:41 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32 CMtapMan::PortOpen(uint32 port)
|
|
|
|
{
|
2018-05-24 12:59:15 -04:00
|
|
|
CLog::GetInstance().Warn(LOG_NAME, "PortOpen(port = %d);\r\n", port);
|
2016-01-16 18:43:41 -05:00
|
|
|
return 0;
|
|
|
|
}
|