Miiverse doesnt crash, but soft locks. Mostly stubbed

This commit is contained in:
Jonathan Barrow 2023-07-31 00:23:01 -04:00 committed by Arian Kordi
parent f75d734fb8
commit c662456e41
3 changed files with 67 additions and 0 deletions

View File

@ -18,6 +18,7 @@ namespace nn
struct PortalAppParam_t
{
/* +0x1A663B */ char serviceToken[32]; // size is unknown
/* +0x1A5E3C */ char startUrl[37]; // https://discovery.olv.pretendo.cc/v1/endpoint
};
void exportPortalAppParam_GetServiceToken(PPCInterpreter_t* hCPU)
@ -109,6 +110,16 @@ namespace nn
return GetErrorCodeImpl(pResult->value());
}
void exportPortalAppParam_GetStartUrl(PPCInterpreter_t* hCPU)
{
// r3 = PortalAppParam
ppcDefineParamTypePtr(portalAppParam, PortalAppParam_t, 0);
strcpy(portalAppParam->startUrl, "discovery.olv.pretendo.cc/v1/endpoint");
osLib_returnFromFunction(hCPU, memory_getVirtualOffsetFromPointer(&portalAppParam->startUrl));
}
static_assert(GetErrorCodeImpl(0xa119c600) == 1155004);
void load()
@ -126,6 +137,7 @@ namespace nn
cafeExportRegisterFunc(GetErrorCode, "nn_olv", "GetErrorCode__Q2_2nn3olvFRCQ2_2nn6Result", LogType::NN_OLV);
osLib_addFunction("nn_olv", "GetStartUrl__Q4_2nn3olv6hidden14PortalAppParamCFv", exportPortalAppParam_GetStartUrl);
osLib_addFunction("nn_olv", "GetServiceToken__Q4_2nn3olv6hidden14PortalAppParamCFv", exportPortalAppParam_GetServiceToken);
cafeExportRegisterFunc(StubPostApp, "nn_olv", "UploadPostDataByPostApp__Q2_2nn3olvFPCQ3_2nn3olv28UploadPostDataByPostAppParam", LogType::NN_OLV);

View File

@ -277,6 +277,14 @@ namespace nn
return OLV_RESULT_SUCCESS;
}
sint32 InitializePortalApp(nn::olv::PortalAppParam* pPortalAppParam, nn::olv::InitializeParam* pInitializeParam)
{
// todo - stub
Initialize(pInitializeParam);
return OLV_RESULT_SUCCESS;
}
namespace Report
{
uint32 GetReportTypes()

View File

@ -101,6 +101,48 @@ namespace nn
};
static_assert(sizeof(nn::olv::InitializeParam) == 0x40, "sizeof(nn::olv::InitializeParam) != 0x40");
class PortalAppParam
{
public:
PortalAppParam()
{
this->m_serviceToken = ""; // todo
this->m_startUrl = "https://discovery.olv.pretendo.cc/v1/endpoint";
}
static PortalAppParam* __ctor(PortalAppParam* _this)
{
if (!_this)
{
assert_dbg(); // DO NOT CONTINUE, SHOULD NEVER HAPPEN
return nullptr;
}
else
return new (_this) PortalAppParam();
}
std::string GetStartUrl()
{
return this->m_startUrl;
}
static std::string __GetStartUrl(PortalAppParam* _this)
{
return _this->GetStartUrl();
}
std::string GetDefaultBodyMemo()
{
// todo - i dont think this is right
return "Default Body Baby";
}
static std::string __GetDefaultBodyMemo(PortalAppParam* _this)
{
return _this->GetDefaultBodyMemo();
}
std::string m_serviceToken;
std::string m_startUrl;
};
namespace Report
{
@ -110,6 +152,7 @@ namespace nn
bool IsInitialized();
sint32 Initialize(nn::olv::InitializeParam* pParam);
sint32 InitializePortalApp(nn::olv::PortalAppParam* pPortalAppParam, nn::olv::InitializeParam* pInitializeParam);
static void loadOliveInitializeTypes()
{
@ -123,6 +166,10 @@ namespace nn
cafeExportRegisterFunc(InitializeParam::__SetWork, "nn_olv", "SetWork__Q3_2nn3olv15InitializeParamFPUcUi", LogType::NN_OLV);
cafeExportRegisterFunc(InitializeParam::__SetReportTypes, "nn_olv", "SetReportTypes__Q3_2nn3olv15InitializeParamFUi", LogType::NN_OLV);
cafeExportRegisterFunc(InitializeParam::__SetSysArgs, "nn_olv", "SetSysArgs__Q3_2nn3olv15InitializeParamFPCvUi", LogType::NN_OLV);
cafeExportRegisterFunc(PortalAppParam::__ctor, "nn_olv", "__ct__Q4_2nn3olv6hidden14PortalAppParamFv", LogType::NN_OLV);
cafeExportRegisterFunc(PortalAppParam::__GetStartUrl, "nn_olv", "GetStartUrl__Q4_2nn3olv6hidden14PortalAppParamCFv", LogType::NN_OLV);
cafeExportRegisterFunc(PortalAppParam::__GetDefaultBodyMemo, "nn_olv", "GetDefaultBodyMemo__Q4_2nn3olv6hidden14PortalAppParamCFv", LogType::NN_OLV);
}
}
}