Display BIOS date correctly

This commit is contained in:
2024-03-30 12:36:23 -05:00
parent 5b53383d80
commit b35a391887
4 changed files with 35 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
#include <PSX/Auxiliary/math_helper.hpp>
#include <PSX/System/syscalls.hpp>
namespace JabyEngine {
@@ -5,7 +6,11 @@ namespace JabyEngine {
BIOSVersion get_bios_version() {
BIOSVersion version;
version.date_bcd = *reinterpret_cast<uint32_t*>(0xBFC00100);
const auto date_bcd = *reinterpret_cast<uint32_t*>(0xBFC00100);
version.date.day = from_bcd(static_cast<uint8_t>(date_bcd & 0xFF));
version.date.month = from_bcd(static_cast<uint8_t>((date_bcd >> 8) & 0xFF));
version.date.year = from_bcd(static_cast<uint16_t>(date_bcd >> 16));
version.kernel_maker = reinterpret_cast<const char*>(0xBFC00108);
version.gui_version = reinterpret_cast<const char*>(0xBFC7FF32);
return version;