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

@@ -10,7 +10,7 @@ namespace Assets {
GPU::SizeI16 size;
};
static constexpr auto PacoTIM = SimpleTIM::create(896, 0, 960, 510);
static constexpr auto PacoTIM = SimpleTIM::create(896, 0, 960, 510);
static constexpr auto DoenerFishInfo = ImageInfo{
.tim = SimpleTIM::create(896 + 30, 0, 960 + 16, 510),
.size = GPU::SizeI16::create(128, 64)

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())
};
}

View File

@@ -121,7 +121,7 @@ namespace Assets {
}
void load_screen_center() {
load(CDFileBuilder::overlay(LBA::SCREEN_CENT_OVL, &__screen_center_start));
load(CDFileBuilder::overlay(LBA::SCREEN_CENT_OVL, &__screen_center_start), ScreenCenter::lba, ScreenCenter::Assets);
}
}

BIN
examples/PoolBox/assets/IMG_6921.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -1,10 +1,6 @@
include $(JABY_ENGINE_DIR)/mkfile/common/ExportPath.mk
include $(JABY_ENGINE_DIR)/mkfile/common/RebuildTarget.mk
define wuff
$1_FLAGS = $2
endef
OUTPUT_DIR = bin
CLUT_4_COLOR_TRANS_FLAGS = simple-tim clut4 --color-trans
@@ -38,6 +34,9 @@ JabyStar_FLAGS = $(CLUT_4_COLOR_TRANS_FLAGS)
INPUT += $(OUTPUT_DIR)/JabyTails.img
JabyTails_FLAGS = $(CLUT_4_COLOR_TRANS_FLAGS)
INPUT += $(OUTPUT_DIR)/IMG_6921.tim
IMG_6921_TIM_FLAGS = tim clut4 --clut-pos {384,255} --tex-pos {384,256}
$(OUTPUT_DIR)/fox.xa: audio/temp/fox.wav
@mkdir -p $(OUTPUT_DIR)
psxfileconv $< -o $@ xa
@@ -54,6 +53,10 @@ $(OUTPUT_DIR)/%.img: %.png
@mkdir -p $(OUTPUT_DIR)
psxfileconv --lz4 $< -o $@ $($*_FLAGS)
$(OUTPUT_DIR)/%.tim: %.png
@mkdir -p $(OUTPUT_DIR)
psxfileconv $< -o $@ $($*_TIM_FLAGS)
all: $(INPUT)
clean:

View File

@@ -22,7 +22,7 @@
<Overlay name = "GTO.BIN" lba_source = "../application/src/Overlay/GPUTest/gpu_test_assets.cpp" >../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gpu_tests</Overlay>
<Overlay name = "GTE.BIN" lba_source = "../application/src/Overlay/GTETest/gte_test_assets.cpp" >../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gte_tests</Overlay>
<Overlay name = "FCO.BIN" lba_source = "" >../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.font_cycler</Overlay>
<Overlay name = "SCO.BIN" lba_source = "" >../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.screen_center</Overlay>
<Overlay name = "SCO.BIN" lba_source = "../application/src/Overlay/ScreenCenter/screen_center_assets.cpp" >../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.screen_center</Overlay>
<Directory name = "ASSETS" hidden = "true">
<Directory name = "MAIN">
@@ -41,6 +41,7 @@
<File name = "TEX.IMG" lz4 = "already">../assets/bin/TexturePage.img</File>
<File name = "ICON.IMG" lz4 = "already">../assets/bin/IconTexture.img</File>
<File name = "SAND.TIM" lz4 = "none">../assets/bin/IMG_6921.tim</File>
</Directory>
<Directory name = "XAAUDIO" hidden = "true">
<InterleavedFile name = "MIX.XA">