Support for loading TIM

This commit is contained in:
2024-12-29 21:57:38 +01:00
parent 542669470a
commit 586b1e8124
19 changed files with 286 additions and 125 deletions

View File

@@ -32,5 +32,7 @@ namespace FontCycler {
}
namespace ScreenCenter {
extern const volatile JabyEngine::AutoLBAEntry lba[];
extern JabyEngine::CDFile Assets[1];
void main();
}

View File

@@ -2,6 +2,7 @@
#include "include/frame.hpp"
#include <FontWriter/fonts.hpp>
#include <PSX/GPU/gpu.hpp>
#include <PSX/GPU/make_gpu_primitives.hpp>
#include <PSX/Periphery/periphery.hpp>
#include <PSX/Timer/frame_timer.hpp>
@@ -76,6 +77,13 @@ namespace ScreenCenter {
Formular{.name = PSYQ::Name, .function = PSYQ::set_offset}
};
static constexpr const auto background_img = Make::POLY_FT4(
Make::AreaI16(Make::PositionI16((GPU::Display::Width - 256)/2, (GPU::Display::Height - 240)/2), Make::SizeI16(256, 240)),
Make::PageOffset(0, 0),
Make::TPage(Make::PositionU16(384, 256), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4),
Make::PageClut(Make::PositionU16(384, 255))
);
static auto frame = Frame::create();
static ButtonPulser button_pulse[4];
@@ -182,6 +190,7 @@ namespace ScreenCenter {
}
static void render() {
GPU::render(background_img);
frame.render();
Shared::back_menu.render();
}

View File

@@ -0,0 +1,17 @@
#include <PSX/File/Processor/cd_file_processor.hpp>
#include <PSX/AutoLBA/auto_lba_declaration.hpp>
namespace ScreenCenter {
using namespace JabyEngine;
enum LBA {
__jabyengine_start_lba_request
__jabyengine_request_lba_for(BG_IMAGE, "ASSETS/SAND.TIM"),
__jabyengine_end_lba_request
};
__declare_lba_header(LBA);
CDFile Assets[1] = {
CDFileBuilder::sony_tim(LBA::BG_IMAGE, TIM::create())
};
}