Cemu/src/Cafe/OS/libs/nn_temp/nn_temp.cpp
2022-08-22 22:21:23 +02:00

24 lines
611 B
C++

#include "Cafe/OS/common/OSCommon.h"
namespace nn::temp
{
uint64 tempIdGenerator = 0xdc1b04bd961f2c04ULL;
void nnTempExport_TEMPCreateAndInitTempDir(PPCInterpreter_t* hCPU)
{
forceLogDebug_printf("TEMPCreateAndInitTempDir(...) - placeholder");
// create random temp id
memory_writeU64Slow(hCPU->gpr[5], tempIdGenerator);
tempIdGenerator = (tempIdGenerator << 3) | (tempIdGenerator >> 61);
tempIdGenerator += 0x56e28bd5f4ULL;
osLib_returnFromFunction(hCPU, 0);
}
void Initialize()
{
osLib_addFunction("nn_temp", "TEMPCreateAndInitTempDir", nnTempExport_TEMPCreateAndInitTempDir);
}
};