From c4deb4771639f8b64a185478d5bbe821dcb22268 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Fri, 19 Sep 2025 12:38:45 +0800 Subject: [PATCH] Fix some background pgd not works --- src/scripts/softpal/img/pgd/base.rs | 8 ++++---- src/scripts/softpal/img/pgd/ge.rs | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/scripts/softpal/img/pgd/base.rs b/src/scripts/softpal/img/pgd/base.rs index 8de26e1..af51095 100644 --- a/src/scripts/softpal/img/pgd/base.rs +++ b/src/scripts/softpal/img/pgd/base.rs @@ -14,11 +14,11 @@ pub struct PgdGeHeader { pub offset_y: u32, pub width: u32, pub height: u32, - // untested pub canvas_width: u32, - // untested pub canvas_height: u32, - pub mode: u32, + pub mode: u16, + // Some background image has this (0xF) + pub _unk: u16, } impl PgdGeHeader { @@ -47,7 +47,7 @@ pub struct PgdReader { width: u32, height: u32, bpp: u8, - method: u32, + method: u16, format: Option, } diff --git a/src/scripts/softpal/img/pgd/ge.rs b/src/scripts/softpal/img/pgd/ge.rs index 563b57b..952c31e 100644 --- a/src/scripts/softpal/img/pgd/ge.rs +++ b/src/scripts/softpal/img/pgd/ge.rs @@ -69,6 +69,7 @@ impl ScriptBuilder for PgdGeBuilder { canvas_width: data.width, canvas_height: data.height, mode: 3, + _unk: 0, }; writer.write_all(b"GE \0")?; header.pack(&mut writer, false, Encoding::Utf8)?;