From 85ae5629cdeee3e137e51c397c8dbb5df5df13ce Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 29 Dec 2024 22:59:51 +0100 Subject: [PATCH] Fully support Full16 TIM --- .../Overlay/ScreenCenter/screen_center.cpp | 16 +++++++-------- examples/PoolBox/assets/IMG_6921.png | 4 ++-- examples/PoolBox/assets/Makefile | 4 ++-- examples/PoolBox/iso/Config.xml | 2 +- .../GPU/Primitives/primitive_gpu_commands.hpp | 20 +++++++++++++++++++ .../src/File/Processor/TIM/tim_processor.cpp | 18 +++++++++++++---- src/Tools/psxfileconv/Cargo.toml | 2 +- src/Tools/psxfileconv/src/images/tim/types.rs | 14 +++++++++---- 8 files changed, 57 insertions(+), 23 deletions(-) diff --git a/examples/PoolBox/application/src/Overlay/ScreenCenter/screen_center.cpp b/examples/PoolBox/application/src/Overlay/ScreenCenter/screen_center.cpp index bad6be4d..917b2976 100644 --- a/examples/PoolBox/application/src/Overlay/ScreenCenter/screen_center.cpp +++ b/examples/PoolBox/application/src/Overlay/ScreenCenter/screen_center.cpp @@ -77,12 +77,10 @@ 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 constexpr const GPU::VRAM2VRAM background_img[] = { // TODO: Shouldn't current_id 0 be 0 and not 256? + GPU::VRAM2VRAM::create(Make::AreaU16(384, 240, 256, 240), Make::PositionU16(32, GPU::Display::Height)), + GPU::VRAM2VRAM::create(Make::AreaU16(384, 240, 256, 240), Make::PositionU16(32, 0)), + }; static auto frame = Frame::create(); @@ -112,8 +110,8 @@ namespace ScreenCenter { } auto cursor = FontWriter::update(CenterPoint); - FontWriter::bios_font_writer.write(cursor, IntroductionTest, GPU::Color24::Red()); - FontWriter::bios_font_writer.write(cursor, ScreenFormulars[formular_sel].name, GPU::Color24::Red()); + FontWriter::bios_font_writer.write(cursor, IntroductionTest, GPU::Color24::White()); + FontWriter::bios_font_writer.write(cursor, ScreenFormulars[formular_sel].name, GPU::Color24::White()); } static void update_interactive() { @@ -190,7 +188,7 @@ namespace ScreenCenter { } static void render() { - GPU::render(background_img); + GPU::render(background_img[GPU::Display::current_id]); frame.render(); Shared::back_menu.render(); } diff --git a/examples/PoolBox/assets/IMG_6921.png b/examples/PoolBox/assets/IMG_6921.png index 6e7b9eaf..03c8139e 100644 --- a/examples/PoolBox/assets/IMG_6921.png +++ b/examples/PoolBox/assets/IMG_6921.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:88baf322cd713884e15a7b346f2bd193d25e439a7ef3ca4cbe29c9037da4f45d -size 26397 +oid sha256:f99dd1cd3bb0169428c4b9a3376b0cc09b23bac62c1fca91ef452057251e853b +size 21666 diff --git a/examples/PoolBox/assets/Makefile b/examples/PoolBox/assets/Makefile index 52172fc2..6aee6cbe 100644 --- a/examples/PoolBox/assets/Makefile +++ b/examples/PoolBox/assets/Makefile @@ -35,7 +35,7 @@ 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} +IMG_6921_TIM_FLAGS = tim full16 --clut-pos {384,255} --tex-pos {384,256} $(OUTPUT_DIR)/fox.xa: audio/temp/fox.wav @mkdir -p $(OUTPUT_DIR) @@ -55,7 +55,7 @@ $(OUTPUT_DIR)/%.img: %.png $(OUTPUT_DIR)/%.tim: %.png @mkdir -p $(OUTPUT_DIR) - psxfileconv $< -o $@ $($*_TIM_FLAGS) + psxfileconv --lz4 $< -o $@ $($*_TIM_FLAGS) all: $(INPUT) diff --git a/examples/PoolBox/iso/Config.xml b/examples/PoolBox/iso/Config.xml index f1ad9b65..a1a20b2a 100644 --- a/examples/PoolBox/iso/Config.xml +++ b/examples/PoolBox/iso/Config.xml @@ -41,7 +41,7 @@ ../assets/bin/TexturePage.img ../assets/bin/IconTexture.img - ../assets/bin/IMG_6921.tim + ../assets/bin/IMG_6921.tim