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
diff --git a/include/PSX/GPU/Primitives/primitive_gpu_commands.hpp b/include/PSX/GPU/Primitives/primitive_gpu_commands.hpp
index 19174585..80e385bd 100644
--- a/include/PSX/GPU/Primitives/primitive_gpu_commands.hpp
+++ b/include/PSX/GPU/Primitives/primitive_gpu_commands.hpp
@@ -16,6 +16,8 @@ namespace JabyEngine {
};
struct CPU2VRAM {
+ static constexpr bool is_render_primitive = true;
+
GPU_IO_Values::GP0 cmd;
GPU_IO_Values::GP0 pos;
GPU_IO_Values::GP0 size;
@@ -28,5 +30,23 @@ namespace JabyEngine {
};
}
};
+
+ struct VRAM2VRAM {
+ static constexpr bool is_render_primitive = true;
+
+ GPU_IO_Values::GP0 cmd;
+ GPU_IO_Values::GP0 src_pos;
+ GPU_IO_Values::GP0 dst_pos;
+ GPU_IO_Values::GP0 size;
+
+ static constexpr VRAM2VRAM create(const AreaU16& src, const PositionU16& dst) {
+ return VRAM2VRAM{
+ .cmd = GPU_IO_Values::GP0::VRAM2VRAMBlitting(),
+ .src_pos = GPU_IO_Values::GP0::PostionTopLeft(src.position),
+ .dst_pos = GPU_IO_Values::GP0::PostionTopLeft(dst),
+ .size = GPU_IO_Values::GP0::WidthHeight(src.size)
+ };
+ }
+ };
}
}
\ No newline at end of file
diff --git a/src/Library/src/File/Processor/TIM/tim_processor.cpp b/src/Library/src/File/Processor/TIM/tim_processor.cpp
index a7d86347..bc39345b 100644
--- a/src/Library/src/File/Processor/TIM/tim_processor.cpp
+++ b/src/Library/src/File/Processor/TIM/tim_processor.cpp
@@ -23,11 +23,21 @@ namespace JabyEngine {
static constexpr auto HEADER_SIZE = 2*sizeof(uint32_t);
if(config.data_bytes >= (HEADER_SIZE + sizeof(BlockInfo))) {
- BlockInfo block_info;
+ uint32_t flag;
+
+ config.processed(sizeof(uint32_t));
+ Helper::simple_read(flag, config);
+
+ if(flag & (0x1 << 3)) {
+ BlockInfo block_info;
- config.processed(HEADER_SIZE);
- Helper::simple_read(block_info, config);
- this->clut_area = AreaU16::create(block_info.x, block_info.y, block_info.w, block_info.h);
+ Helper::simple_read(block_info, config);
+ this->clut_area = AreaU16::create(block_info.x, block_info.y, block_info.w, block_info.h);
+ }
+
+ else {
+ this->clut_area = AreaU16::create(0, 0, 0, 0);
+ }
return Progress::Done;
}
return Progress::Error;
diff --git a/src/Tools/psxfileconv/Cargo.toml b/src/Tools/psxfileconv/Cargo.toml
index ee4b3b20..6ae4771b 100644
--- a/src/Tools/psxfileconv/Cargo.toml
+++ b/src/Tools/psxfileconv/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "psxfileconv"
-version = "0.8.6"
+version = "0.8.7"
edition = "2021"
[profile.release]
diff --git a/src/Tools/psxfileconv/src/images/tim/types.rs b/src/Tools/psxfileconv/src/images/tim/types.rs
index fa4959c0..93c4eaff 100644
--- a/src/Tools/psxfileconv/src/images/tim/types.rs
+++ b/src/Tools/psxfileconv/src/images/tim/types.rs
@@ -28,9 +28,9 @@ impl Default for Header {
impl HeaderEncoder for Header {
fn encode_settings(&mut self, color_type: ColorType, tex_rect: Rect, clut_rect: Rect) -> Result<(), Error> {
self.flag = match color_type {
- ColorType::Clut4 => (Self::FLAG_PMODE_BIT_RANGE.as_value(0x0) | Self::FLAG_CF_BIT.as_value(true)) as u32,
- ColorType::Clut8 => (Self::FLAG_PMODE_BIT_RANGE.as_value(0x1) | Self::FLAG_CF_BIT.as_value(true)) as u32,
- ColorType::Full16 => (Self::FLAG_PMODE_BIT_RANGE.as_value(0x2) | Self::FLAG_CF_BIT.as_value(true)) as u32,
+ ColorType::Clut4 => (Self::FLAG_PMODE_BIT_RANGE.as_value(0x0) | Self::FLAG_CF_BIT.as_value(true)) as u32,
+ ColorType::Clut8 => (Self::FLAG_PMODE_BIT_RANGE.as_value(0x1) | Self::FLAG_CF_BIT.as_value(true)) as u32,
+ ColorType::Full16 => (Self::FLAG_PMODE_BIT_RANGE.as_value(0x2) | Self::FLAG_CF_BIT.as_value(false)) as u32,
};
self.clut_block = DataBlock::new(clut_rect);
@@ -44,7 +44,13 @@ impl HeaderEncoder for Header {
}
fn write_clut_header(&self, output: &mut dyn Write) -> Result {
- Ok(output.write(&self.clut_block.convert_to_raw())?)
+ if self.clut_block.w > 0 {
+ Ok(output.write(&self.clut_block.convert_to_raw())?)
+ }
+
+ else {
+ Ok(0)
+ }
}
fn write_pixel_header(&self, output: &mut dyn Write) -> Result {