Detect type of BIOS

This commit is contained in:
2024-03-31 23:49:32 -05:00
parent 097e7d7f97
commit ab3b94da97
6 changed files with 165 additions and 45 deletions

View File

@@ -17,6 +17,34 @@ R31 ra Return address (set by function call)
*/
namespace JabyEngine {
namespace BIOS {
struct Version {
struct {
uint8_t day;
uint8_t month;
uint16_t year;
} date;
const char* kernel_maker;
const char* version_str;
const char* gui_version;
const char* copyright;
};
enum struct Type {
Devboard,
PS1,
PS2,
PS3,
PSCompatible, // internal usage only
No$psx,
XEBRA,
Unkown
};
Version get_bios_version();
extern Type type;
}
namespace SysCall {
static constexpr const uint32_t Table_A = 0xA0;
static constexpr const uint32_t Table_B = 0xB0;
@@ -55,20 +83,6 @@ namespace JabyEngine {
};
#pragma pack(pop)
struct BIOSVersion {
struct {
uint8_t day;
uint8_t month;
uint16_t year;
} date;
const char* kernel_maker;
const char* version_str;
const char* gui_version;
const char* copyright;
};
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) {