summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-01-11 21:59:31 -0500
committerGravatar bunnei2018-01-11 21:59:31 -0500
commit97ef21e166a95419b97d164c6969ffaf1faacfb0 (patch)
treec3efc75f80d6913bbd0c06805941d59ad9db499a /src/core/hle/kernel/svc.cpp
parentnvdisp_disp0: Call SwapBuffers to render framebuffer. (diff)
downloadyuzu-97ef21e166a95419b97d164c6969ffaf1faacfb0.tar.gz
yuzu-97ef21e166a95419b97d164c6969ffaf1faacfb0.tar.xz
yuzu-97ef21e166a95419b97d164c6969ffaf1faacfb0.zip
svc: Implement GetSystemTick.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 7c2aee417..b43e004bc 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -642,6 +642,16 @@ static ResultCode SignalProcessWideKey(VAddr condition_variable_addr, s32 target
642 return RESULT_SUCCESS; 642 return RESULT_SUCCESS;
643} 643}
644 644
645/// This returns the total CPU ticks elapsed since the CPU was powered-on
646static u64 GetSystemTick() {
647 const u64 result{CoreTiming::GetTicks()};
648
649 // Advance time to defeat dumb games that busy-wait for the frame to end.
650 CoreTiming::AddTicks(400);
651
652 return result;
653}
654
645/// Close a handle 655/// Close a handle
646static ResultCode CloseHandle(Handle handle) { 656static ResultCode CloseHandle(Handle handle) {
647 LOG_TRACE(Kernel_SVC, "Closing handle 0x%08X", handle); 657 LOG_TRACE(Kernel_SVC, "Closing handle 0x%08X", handle);
@@ -659,7 +669,8 @@ static ResultCode ResetSignal(Handle handle) {
659 669
660/// Creates a TransferMemory object 670/// Creates a TransferMemory object
661static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 permissions) { 671static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 permissions) {
662 LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x%llx, size=0x%llx, perms=%08X", addr, size, permissions); 672 LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x%llx, size=0x%llx, perms=%08X", addr, size,
673 permissions);
663 *handle = 0; 674 *handle = 0;
664 return RESULT_SUCCESS; 675 return RESULT_SUCCESS;
665} 676}
@@ -705,7 +716,7 @@ static const FunctionDef SVC_Table[] = {
705 {0x1B, SvcWrap<UnlockMutex>, "UnlockMutex"}, 716 {0x1B, SvcWrap<UnlockMutex>, "UnlockMutex"},
706 {0x1C, SvcWrap<WaitProcessWideKeyAtomic>, "WaitProcessWideKeyAtomic"}, 717 {0x1C, SvcWrap<WaitProcessWideKeyAtomic>, "WaitProcessWideKeyAtomic"},
707 {0x1D, SvcWrap<SignalProcessWideKey>, "SignalProcessWideKey"}, 718 {0x1D, SvcWrap<SignalProcessWideKey>, "SignalProcessWideKey"},
708 {0x1E, nullptr, "GetSystemTick"}, 719 {0x1E, SvcWrap<GetSystemTick>, "GetSystemTick"},
709 {0x1F, SvcWrap<ConnectToPort>, "ConnectToPort"}, 720 {0x1F, SvcWrap<ConnectToPort>, "ConnectToPort"},
710 {0x20, nullptr, "SendSyncRequestLight"}, 721 {0x20, nullptr, "SendSyncRequestLight"},
711 {0x21, SvcWrap<SendSyncRequest>, "SendSyncRequest"}, 722 {0x21, SvcWrap<SendSyncRequest>, "SendSyncRequest"},