Finished getting JerryScript on all the platforms.
This commit is contained in:
@@ -20,4 +20,5 @@ add_subdirectory(log)
|
||||
add_subdirectory(display)
|
||||
add_subdirectory(input)
|
||||
add_subdirectory(network)
|
||||
add_subdirectory(system)
|
||||
add_subdirectory(system)
|
||||
add_subdirectory(time)
|
||||
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2026 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
target_sources(${DUSK_LIBRARY_TARGET_NAME}
|
||||
PUBLIC
|
||||
timedolphin.c
|
||||
)
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "time/timedolphin.h"
|
||||
|
||||
double_t timeGetRealDolphin(void) {
|
||||
// "Returns time in ticks since 2000"
|
||||
u64 timeInMillis = PPCTicksToMs(SYS_Time());
|
||||
double_t timeSeconds = (double_t)timeInMillis / 1000.0;
|
||||
|
||||
// Time to adjust time from 2000 to 1970, in seconds
|
||||
double_t timeOffset = 946684800.0;
|
||||
|
||||
timeSeconds += timeOffset;
|
||||
return timeSeconds;
|
||||
}
|
||||
|
||||
double_t timeGetRealTimeZoneDolphin(void) {
|
||||
return 0.0;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "dusk.h"
|
||||
|
||||
/**
|
||||
* Returns the real current time, in seconds since January 1, 1970.
|
||||
*
|
||||
* @return The real current time, in seconds since January 1, 1970.
|
||||
*/
|
||||
double_t timeGetRealDolphin(void);
|
||||
|
||||
/**
|
||||
* Returns the real time zone offset in seconds from UTC.
|
||||
*
|
||||
* @return The real time zone offset in seconds from UTC.
|
||||
*/
|
||||
double_t timeGetRealTimeZoneDolphin(void);
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "time/timedolphin.h"
|
||||
|
||||
#define timeGetRealPlatform timeGetRealDolphin
|
||||
#define timeGetRealTimeZonePlatform timeGetRealTimeZoneDolphin
|
||||
Reference in New Issue
Block a user