Start to display BIOS information

This commit is contained in:
2024-03-30 11:57:07 -05:00
parent a8fafdc32e
commit 5b53383d80
6 changed files with 132 additions and 6 deletions

View File

@@ -55,6 +55,14 @@ namespace JabyEngine {
};
#pragma pack(pop)
struct BIOSVersion {
uint32_t date_bcd;
const char* kernel_maker;
const char* gui_version;
};
BIOSVersion get_bios_version();
#define __syscall_function_cast(table, ...) reinterpret_cast<__VA_ARGS__>(table)
static __always_inline void* memcpy(void *dst, const void *src, size_t len) {

View File

@@ -27,6 +27,13 @@ namespace JabyEngine {
public:
constexpr SimpleTimer() = default;
static SimpleTimer create() {
SimpleTimer timer;
timer.reset();
return timer;
}
bool is_expired_for(T time) const {
return static_cast<T>((MasterTime::read_as<T>() - this->value)) >= time;
}
@@ -46,6 +53,14 @@ namespace JabyEngine {
constexpr IntervalTimer(T interval) : SimpleTimer<T>(), interval(interval) {
}
static constexpr IntervalTimer create(T interval) {
IntervalTimer timer;
static_cast<SimpleTimer<T>&>(timer) = SimpleTimer<T>::create();
timer.interval = interval;
return timer;
}
void set_interval(T interval) {
this->interval = interval;
}

9
include/string.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef __STRING__H
#define __STRING__H
#include "PSX/jabyengine_defines.h"
START_C_FUNCTIONS
size_t strlen(const char* str);
END_C_FUNCTIONS
#endif // !__STRING__H