implemented sceKernelGetProcessTimeCounter , sceKernelGetProcessTimeCounterFrequency

This commit is contained in:
georgemoralis 2023-10-30 12:53:52 +02:00
parent 51dda8e8a5
commit 0ad40cff1b
4 changed files with 20 additions and 4 deletions

View File

@ -13,6 +13,7 @@
#include "Libs.h" #include "Libs.h"
#include "Emulator/HLE/Libraries/LibKernel/FileSystem/file_system.h" #include "Emulator/HLE/Libraries/LibKernel/FileSystem/file_system.h"
#include "Emulator/HLE/Libraries/LibKernel/FileSystem/posix_file_system.h" #include "Emulator/HLE/Libraries/LibKernel/FileSystem/posix_file_system.h"
#include "Core/hle/libraries/libkernel/time_management.h"
namespace HLE::Libs::LibKernel { namespace HLE::Libs::LibKernel {
@ -50,6 +51,8 @@ void LibKernel_Register(SymbolsResolver* sym) {
// fs // fs
LIB_FUNCTION("1G3lF1Gg1k8", "libkernel", 1, "libkernel", 1, 1, Emulator::HLE::Libraries::LibKernel::FileSystem::sceKernelOpen); LIB_FUNCTION("1G3lF1Gg1k8", "libkernel", 1, "libkernel", 1, 1, Emulator::HLE::Libraries::LibKernel::FileSystem::sceKernelOpen);
LIB_FUNCTION("wuCroIGjt2g", "libScePosix", 1, "libkernel", 1, 1, Emulator::HLE::Libraries::LibKernel::FileSystem::POSIX::open); LIB_FUNCTION("wuCroIGjt2g", "libScePosix", 1, "libkernel", 1, 1, Emulator::HLE::Libraries::LibKernel::FileSystem::POSIX::open);
Core::Libraries::LibKernel::timeSymbolsRegister(sym);
} }
}; // namespace HLE::Libs::LibKernel }; // namespace HLE::Libs::LibKernel

View File

@ -8,7 +8,14 @@ namespace Core::Libraries::LibKernel {
u64 sceKernelGetProcessTime() { u64 sceKernelGetProcessTime() {
return static_cast<u64>(Emulator::emuTimer::getTimeMsec() * 1000.0); // return time in microseconds return static_cast<u64>(Emulator::emuTimer::getTimeMsec() * 1000.0); // return time in microseconds
} }
u64 sceKernelGetProcessTimeCounter() { return Emulator::emuTimer::getTimeCounter(); }
void timeSymbolsRegister(SymbolsResolver* sym) { LIB_FUNCTION("4J2sUJmuHZQ", "libkernel", 1, "libkernel", 1, 1, sceKernelGetProcessTime); } u64 sceKernelGetProcessTimeCounterFrequency() { return Emulator::emuTimer::getTimeFrequency(); }
} // namespace Core::Libraries void timeSymbolsRegister(SymbolsResolver* sym) {
LIB_FUNCTION("4J2sUJmuHZQ", "libkernel", 1, "libkernel", 1, 1, sceKernelGetProcessTime);
LIB_FUNCTION("fgxnMeTNUtY", "libkernel", 1, "libkernel", 1, 1, sceKernelGetProcessTimeCounter);
LIB_FUNCTION("BNowx2l588E", "libkernel", 1, "libkernel", 1, 1, sceKernelGetProcessTimeCounterFrequency);
}
} // namespace Core::Libraries::LibKernel

View File

@ -7,4 +7,8 @@ void start() { timer.Start(); }
double getTimeMsec() { return timer.GetTimeMsec(); } double getTimeMsec() { return timer.GetTimeMsec(); }
} u64 getTimeCounter() { return timer.GetTicks(); }
u64 getTimeFrequency() { return timer.GetFrequency(); }
} // namespace Emulator::emuTimer

View File

@ -1,7 +1,9 @@
#pragma once #pragma once
#include "types.h"
namespace Emulator::emuTimer { namespace Emulator::emuTimer {
void start(); void start();
double getTimeMsec(); double getTimeMsec();
u64 getTimeCounter();
u64 getTimeFrequency();
} // namespace Emulator::emuTimer } // namespace Emulator::emuTimer