2014-08-15 16:57:55 +02:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include "Emu/SysCalls/Modules.h"
|
2015-07-26 11:15:15 +02:00
|
|
|
|
2014-08-15 16:57:55 +02:00
|
|
|
#include "sceNpSns.h"
|
|
|
|
|
|
2015-02-18 17:22:06 +01:00
|
|
|
extern Module sceNpSns;
|
2014-08-15 16:57:55 +02:00
|
|
|
|
2015-07-26 11:15:15 +02:00
|
|
|
std::unique_ptr<SceNpSnsInternal> g_sceNpSns;
|
|
|
|
|
|
|
|
|
|
s32 sceNpSnsFbInit(/*const SceNpSnsFbInitParams params*/)
|
|
|
|
|
{
|
2015-07-26 22:48:59 +02:00
|
|
|
sceNpSns.Todo("sceNpSnsFbInit(params=?)"/*, params*/);
|
2015-07-26 11:15:15 +02:00
|
|
|
|
|
|
|
|
if (g_sceNpSns->m_bSceNpSnsInitialized)
|
|
|
|
|
{
|
|
|
|
|
return SCE_NP_SNS_FB_ERROR_ALREADY_INITIALIZED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_sceNpSns->m_bSceNpSnsInitialized = true;
|
|
|
|
|
|
|
|
|
|
// TODO: Use the initialization parameters somewhere
|
|
|
|
|
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s32 sceNpSnsFbTerm()
|
|
|
|
|
{
|
|
|
|
|
sceNpSns.Warning("sceNpSnsFbTerm()");
|
|
|
|
|
|
|
|
|
|
if (!g_sceNpSns->m_bSceNpSnsInitialized)
|
|
|
|
|
{
|
|
|
|
|
return SCE_NP_SNS_FB_ERROR_NOT_INITIALIZED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_sceNpSns->m_bSceNpSnsInitialized = false;
|
|
|
|
|
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s32 sceNpSnsFbCreateHandle()
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(sceNpSns);
|
|
|
|
|
|
|
|
|
|
if (!g_sceNpSns->m_bSceNpSnsInitialized)
|
|
|
|
|
{
|
|
|
|
|
return SCE_NP_SNS_FB_ERROR_NOT_INITIALIZED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s32 sceNpSnsFbDestroyHandle()
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(sceNpSns);
|
|
|
|
|
|
|
|
|
|
if (!g_sceNpSns->m_bSceNpSnsInitialized)
|
|
|
|
|
{
|
|
|
|
|
return SCE_NP_SNS_FB_ERROR_NOT_INITIALIZED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s32 sceNpSnsFbAbortHandle()
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(sceNpSns);
|
|
|
|
|
|
|
|
|
|
if (!g_sceNpSns->m_bSceNpSnsInitialized)
|
|
|
|
|
{
|
|
|
|
|
return SCE_NP_SNS_FB_ERROR_NOT_INITIALIZED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s32 sceNpSnsFbGetAccessToken()
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(sceNpSns);
|
|
|
|
|
|
|
|
|
|
if (!g_sceNpSns->m_bSceNpSnsInitialized)
|
|
|
|
|
{
|
|
|
|
|
return SCE_NP_SNS_FB_ERROR_NOT_INITIALIZED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-18 17:22:06 +01:00
|
|
|
Module sceNpSns("sceNpSns", []()
|
2014-08-15 16:57:55 +02:00
|
|
|
{
|
2015-07-26 11:15:15 +02:00
|
|
|
g_sceNpSns = std::make_unique<SceNpSnsInternal>();
|
|
|
|
|
|
|
|
|
|
REG_FUNC(sceNpSns, sceNpSnsFbInit);
|
|
|
|
|
REG_FUNC(sceNpSns, sceNpSnsFbTerm);
|
|
|
|
|
REG_FUNC(sceNpSns, sceNpSnsFbCreateHandle);
|
|
|
|
|
REG_FUNC(sceNpSns, sceNpSnsFbDestroyHandle);
|
|
|
|
|
REG_FUNC(sceNpSns, sceNpSnsFbAbortHandle);
|
|
|
|
|
REG_FUNC(sceNpSns, sceNpSnsFbGetAccessToken);
|
2015-02-18 17:22:06 +01:00
|
|
|
});
|