sdk-core
v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Toggle main menu visibility
Loading...
Searching...
No Matches
rtc.c
Go to the documentation of this file.
1
/*
2
# _____ ___ ____ ___ ____
3
# ____| | ____| | | |____|
4
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5
#-----------------------------------------------------------------------
6
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7
# Licenced under Academic Free License version 2.0
8
# Review ps2sdk README & LICENSE files for further details.
9
*/
10
15
16
#include <
time.h
>
17
#include <
stdio.h
>
18
#include <
stdlib.h
>
19
#include "
ps2sdkapi.h
"
20
#define OSD_CONFIG_NO_LIBCDVD
21
#include "
osd_config.h
"
22
#include "
timer_alarm.h
"
23
24
// The definition for this function is located in ee/rpc/cdvd/src/scmd.c
25
extern
time_t ps2time(time_t *t);
26
27
s64 _ps2sdk_rtc_offset_from_busclk = 0;
28
29
s64 _libcglue_rtc_get_offset_from_busclk(
void
)
30
{
31
return
_ps2sdk_rtc_offset_from_busclk;
32
}
33
34
void
_libcglue_rtc_update_impl()
35
{
36
time_t rtc_sec;
37
u32 busclock_sec;
38
u32 busclock_usec;
39
40
rtc_sec = ps2time(NULL);
41
TimerBusClock2USec(
GetTimerSystemTime
(), &busclock_sec, &busclock_usec);
42
43
_ps2sdk_rtc_offset_from_busclk = ((s64)rtc_sec) - ((s64)busclock_sec);
44
}
45
46
void
__attribute__
((weak)) _libcglue_rtc_update_impl();
47
__attribute__
((weak))
48
void
_libcglue_rtc_update()
49
{
50
// cppcheck-suppress knownConditionTrueFalse
51
if
(&_libcglue_rtc_update_impl)
52
{
53
_libcglue_rtc_update_impl();
54
}
55
}
osd_config.h
ps2sdkapi.h
stdio.h
stdlib.h
__attribute__
Definition
gif_registers.h:40
time.h
GetTimerSystemTime
u64 GetTimerSystemTime(void)
Definition
timer.c:487
timer_alarm.h
core
libcglue
src
rtc.c
Generated by
1.18.0