Integrate all the progress into master #6

Merged
jaby merged 595 commits from ToolBox into main 2025-01-01 13:17:44 +00:00
3 changed files with 27 additions and 11 deletions
Showing only changes of commit e74d54f0bb - Show all commits

View File

@ -46,7 +46,18 @@ namespace BIOSInfo {
}
};
static FontSlider font_sliders[2];
static struct {
using BIOSStringOffset = const char*const (SysCall::BIOSVersion::*);
const BIOSStringOffset bios_str_offset;
const char*const display_str;
FontSlider font_slider;
} BIOSStringInfo[3] = {
{.bios_str_offset = &SysCall::BIOSVersion::kernel_maker, .display_str = "Kernel-Maker"},
{.bios_str_offset = &SysCall::BIOSVersion::gui_version, .display_str = "GUI-Version"},
{.bios_str_offset = &SysCall::BIOSVersion::copyright, .display_str = "Copyright"}
};
static GPU::TILE::Linked border_tiles[2] = {
Make::TILE(Make::AreaI16(0, 0, TextOffset.x, GPU::Display::Height), GPU::Color24::Black()).linked(),
Make::TILE(Make::AreaI16(GPU::Display::Width - TextOffset.x, 0, TextOffset.x, GPU::Display::Height), GPU::Color24::Black()).linked()
@ -56,8 +67,9 @@ namespace BIOSInfo {
const auto result = SysCall::get_bios_version();
Shared::back_menu.reset();
font_sliders[0] = FontSlider::create_for(FontWriter::BIOSFont::Info, result.kernel_maker);
font_sliders[1] = FontSlider::create_for(FontWriter::BIOSFont::Info, result.gui_version);
for(auto& bios_str_info : BIOSStringInfo) {
bios_str_info.font_slider = FontSlider::create_for(FontWriter::BIOSFont::Info, result.*(bios_str_info.bios_str_offset));
}
border_tiles[0].concat(border_tiles[1]);
return result;
}
@ -73,17 +85,16 @@ namespace BIOSInfo {
return true;
}
for(auto& font_slider : font_sliders) {
font_slider.advance();
}
auto cursor = FontWriter::update(TextOffset);
FontWriter::bios_font_writer.write(cursor, "BIOS INFORMATION\n----------------\nDate (day/month/year):\n%i/%i/%i\nKernel-Maker:\n", bios_version.date.day, bios_version.date.month, bios_version.date.year);
FontWriter::bios_font_writer.write(cursor, "BIOS INFORMATION\n----------------\nDate (day/month/year):\n%i/%i/%i\n", bios_version.date.day, bios_version.date.month, bios_version.date.year);
const auto old_pos_x = cursor.pos.x;
FontWriter::bios_font_writer.write(move_cursor(cursor, font_sliders[0].count, old_pos_x), "%s\n", bios_version.kernel_maker);
FontWriter::bios_font_writer.write(move_cursor(cursor, 0, old_pos_x), "GUI-Version:\n");
FontWriter::bios_font_writer.write(move_cursor(cursor, font_sliders[1].count, old_pos_x), "%s\n", bios_version.gui_version);
for(auto& bios_str_info : BIOSStringInfo) {
bios_str_info.font_slider.advance();
FontWriter::bios_font_writer.write(move_cursor(cursor, 0, old_pos_x), "%s:\n", bios_str_info.display_str);
FontWriter::bios_font_writer.write(move_cursor(cursor, bios_str_info.font_slider.count, old_pos_x), "%s\n", bios_version.*(bios_str_info.bios_str_offset));
}
FontWriter::bios_font_writer.write(move_cursor(cursor, 0, old_pos_x), "----------------\n");
return false;

View File

@ -63,6 +63,7 @@ namespace JabyEngine {
} date;
const char* kernel_maker;
const char* gui_version;
const char* copyright;
};
BIOSVersion get_bios_version();

View File

@ -1,5 +1,6 @@
#include <PSX/Auxiliary/math_helper.hpp>
#include <PSX/System/syscalls.hpp>
#include <string.h>
namespace JabyEngine {
namespace SysCall {
@ -13,6 +14,9 @@ namespace JabyEngine {
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);
version.copyright = version.gui_version + (strlen(version.gui_version) + 1);
printf(">>> \"%s\"\n", version.copyright);
return version;
}
}