From a8fafdc32e9139d51c952f8c06d05dee395a0f85 Mon Sep 17 00:00:00 2001 From: jaby Date: Sun, 24 Mar 2024 21:54:18 -0500 Subject: [PATCH] Create BIOS Info Overlay --- examples/PoolBox/application/Overlays.json | 3 ++ .../PoolBox/application/include/asset_mgr.hpp | 1 + .../src/Overlay/BIOSInfo/bios_info.cpp | 38 +++++++++++++++++++ .../application/src/Overlay/Overlays.hpp | 4 ++ .../PoolBox/application/src/application.cpp | 6 +++ .../PoolBox/application/src/asset_mgr.cpp | 13 ++++++- examples/PoolBox/iso/Config.xml | 1 + 7 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 examples/PoolBox/application/src/Overlay/BIOSInfo/bios_info.cpp diff --git a/examples/PoolBox/application/Overlays.json b/examples/PoolBox/application/Overlays.json index cdec7013..ee993961 100644 --- a/examples/PoolBox/application/Overlays.json +++ b/examples/PoolBox/application/Overlays.json @@ -1,5 +1,8 @@ { "slot_0": { + "bios_info": { + "pattern": "bin/*/src/Overlay/BIOSInfo/*.o" + }, "controller_tests": { "pattern": "bin/*/src/Overlay/ControllerTest/*.o" }, diff --git a/examples/PoolBox/application/include/asset_mgr.hpp b/examples/PoolBox/application/include/asset_mgr.hpp index fb4b3381..fabff1c9 100644 --- a/examples/PoolBox/application/include/asset_mgr.hpp +++ b/examples/PoolBox/application/include/asset_mgr.hpp @@ -20,6 +20,7 @@ namespace Assets { } namespace Overlay { + void load_bios_info(); void load_controller_test(); void load_gpu_test(); void load_gte_test(); diff --git a/examples/PoolBox/application/src/Overlay/BIOSInfo/bios_info.cpp b/examples/PoolBox/application/src/Overlay/BIOSInfo/bios_info.cpp new file mode 100644 index 00000000..f0aff8bf --- /dev/null +++ b/examples/PoolBox/application/src/Overlay/BIOSInfo/bios_info.cpp @@ -0,0 +1,38 @@ +#include "../../../include/asset_mgr.hpp" +#include "../../../include/shared.hpp" +#include +#include + +namespace BIOSInfo { + using namespace JabyEngine; + + static void setup() { + Shared::back_menu.reset(); + printf("Planschbecken!\n"); + } + + static bool update_or_exit() { + Periphery::query_controller(); + if(Shared::back_menu.update(Make::PositionI16(0, GPU::Display::Height - 32))) { + return true; + } + + return false; + } + + static void render() { + Shared::back_menu.render(); + } + + void main() { + setup(); + + while(true) { + if(update_or_exit()) { + break; + } + GPU::swap_buffers_vsync(1); + render(); + } + } +} \ No newline at end of file diff --git a/examples/PoolBox/application/src/Overlay/Overlays.hpp b/examples/PoolBox/application/src/Overlay/Overlays.hpp index e08715ec..9ea7096c 100644 --- a/examples/PoolBox/application/src/Overlay/Overlays.hpp +++ b/examples/PoolBox/application/src/Overlay/Overlays.hpp @@ -1,6 +1,10 @@ #pragma once #include +namespace BIOSInfo { + void main(); +} + namespace ControllerTest { extern const volatile JabyEngine::AutoLBAEntry lba[]; extern JabyEngine::CDFile Assets[1]; diff --git a/examples/PoolBox/application/src/application.cpp b/examples/PoolBox/application/src/application.cpp index 893382e8..97cb2f91 100644 --- a/examples/PoolBox/application/src/application.cpp +++ b/examples/PoolBox/application/src/application.cpp @@ -36,6 +36,7 @@ static const Menu::SimpleMenu::Entry MenuEntries[] = { {"GTE Test"}, {"Font Cycler"}, {"Screen Center"}, + {"BIOS Information"} }; static const auto doener_fish = Make::SPRT( @@ -94,6 +95,11 @@ static void setup() { state_changer.asset_load = Assets::Overlay::load_screen_center; state_changer.main = ScreenCenter::main; break; + + case 5: + state_changer.asset_load = Assets::Overlay::load_bios_info; + state_changer.main = BIOSInfo::main; + break; } },MenuEntries); } diff --git a/examples/PoolBox/application/src/asset_mgr.cpp b/examples/PoolBox/application/src/asset_mgr.cpp index 756706c5..9b3cc89f 100644 --- a/examples/PoolBox/application/src/asset_mgr.cpp +++ b/examples/PoolBox/application/src/asset_mgr.cpp @@ -5,6 +5,7 @@ #include #include +extern "C" uint32_t __bios_info_start; extern "C" uint32_t __controller_tests_start; extern "C" uint32_t __gpu_tests_start; extern "C" uint32_t __screen_center_start; @@ -14,6 +15,7 @@ namespace Assets { __jabyengine_start_lba_request __jabyengine_request_lba_for(PACO, "ASSETS/MAIN/PACO.BIN"), __jabyengine_request_lba_for(DFISH, "ASSETS/MAIN/DFISH.BIN"), + __jabyengine_request_lba_for(BIOS_INFO_OVL, "BIO.BIN"), __jabyengine_request_lba_for(GPU_TEST_OVL, "GTO.BIN"), __jabyengine_request_lba_for(GTE_TEST_OVL, "GTE.BIN"), __jabyengine_request_lba_for(CONT_TEST_OVL, "CTO.BIN"), @@ -63,7 +65,16 @@ namespace Assets { } namespace Overlay { - // All these loadings can be done by one function taking the LBA of ther overlay, the new LBA and the new Asset array + // TODO: All these loadings can be done by one function taking the LBA of ther overlay, the new LBA and the new Asset array + + void load_bios_info() { + const CDFile Files[] = { + CDFileBuilder::overlay(LBA::BIOS_INFO_OVL, &__bios_info_start) + }; + + ::Assets::load(lba, Files); + } + void load_controller_test() { const CDFile Files[] = { CDFileBuilder::overlay(LBA::CONT_TEST_OVL, &__controller_tests_start) diff --git a/examples/PoolBox/iso/Config.xml b/examples/PoolBox/iso/Config.xml index 0de12301..03a54e97 100644 --- a/examples/PoolBox/iso/Config.xml +++ b/examples/PoolBox/iso/Config.xml @@ -6,6 +6,7 @@ System.cnf.subst
../application/bin/%PSX_TV_FORMAT%/PSX-release/PoolBox.psexe
+ ../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.bios_info ../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.controller_tests ../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gpu_tests ../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gte_tests