Skip to content

Add support for more resource formats and fix several extraction and decoding issues - #29

Merged
crskycode merged 18 commits into
nanami5270:masterfrom
icey9527:20260930
Oct 5, 2026
Merged

crskycode merged 18 commits into
nanami5270:masterfrom
icey9527:20260930

Conversation

@icey9527

Copy link
Copy Markdown
Contributor

Codebase changes:

Fixes

  • f4a0257: fix noise in images extracted from PS2 PAC archives. Tested on きると 貴方と紡ぐ夢と恋のドレス.
  • 2d6877b: fix incorrect extraction of PSD entries in CG archives. Tested on WHITE CLARITY.
  • 5dd94b3: NCG images no longer claim text files from other games as images.
  • 6bbd02a: fix red/blue channel swap and transparency in PS1 TIM images. Tested on ときめきメモリアル ドラマシリーズVol.3 旅立ちの詩 / アクエリアンエイジ 〜東京ウォーズ〜.

New formats and improvements

  • 40cc414: GswSys Pack 2.0 archive and image support. Tested on ヤミと帽子と本の旅人.
  • 95513dc: P00 archive improvements, new IPFB variant. Tested on ギャラクシーエンジェル.
  • ac759eb: T32/TBM image support. Tested on ギャラクシーエンジェル.
  • a8bce6b: encrypted MPEG video in gadat1xx.pak. Tested on ギャラクシーエンジェル.
  • 4d01aa0: IPG image support. Tested on 楽園 / 僕の心は雨のち晴れ (PSP).
  • b94bdb8: PB6 image support. Tested on WHITE CLARITY (PS2).
  • 7e22ac4: LEAFPACK variant support. Tested on To Heart PSE.
  • ed92528: LFB/LCF/LFF image support. Tested on To Heart PSE.
  • f43831a: remove the Broccoli opener that mis-claimed DATA$TOP archives (evidence below). Tested on デ・ジ・キャラット ファンタジー.
  • cf3da35: HEADLOCK engine DAT archives. Tested on ギャラクシーエンジェル EX / プリンセスコンチェルト.
  • 431a54d: PIDX archive and AGI/FAC/TAG/TEX/TXF image support. Tested on ギャラクシーエンジェル (PS2).
  • ed132c8: GHP3 image decoding and ARC1 entry typing. Tested on プリズムパレット.
  • 90e5692: DPK, MSP and TTP archive support. Tested on ときめきメモリアル ドラマシリーズVol.3 旅立ちの詩.

About removing BroccoliPak.cs (f43831a)

The removed opener claimed MOONSTONE DATA$TOP archives — the se_c11.wav it looks for is merely an entry name inside such an archive, which is already parsed by the existing ArcPAK.cs. Actual sample header:

00000000   44 41 54 41 24 54 4F 50 00 00 00 00 00 00 00 00  DATA$TOP........
00000010   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000020   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000030   00 00 00 00 00 00 00 00 38 05 00 00 00 00 00 00  ........8.......
00000040   73 65 5F 63 31 31 2E 77 61 76 00 00 00 00 00 00  se_c11.wav......
00000050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000060   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000070   00 00 00 00 00 00 00 00 78 29 02 00 00 00 00 00  ........x)......
00000080   73 65 5F 62 6F 6D 62 30 32 2E 77 61 76 00 00 00  se_bomb02.wav...
00000090   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000A0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000B0   78 29 02 00 78 29 02 00 FC A3 00 00 00 00 00 00  x)..x)..........
000000C0   74 72 75 65 5F 62 61 63 6B 5F 74 65 78 38 2E 67  true_back_tex8.g
000000D0   72 70 00 00 00 00 00 00 00 00 00 00 00 00 00 00  rp..............
000000E0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000F0   74 CD 02 00 74 CD 02 00 58 90 00 00 00 00 00 00  t...t...X.......

Refs #21

Add the GswSys Pack 2.0 archive format and its GRP image format,
supporting ヤミと帽子と本の旅人.
Add the IPFB variant (big-endian index) alongside the existing P00 archives, and rename the shared description to the Ikusabune engine. Register the p00-p09 data part extensions so parts can be opened directly, and detect each entry's type from its header (decompressing Z0/Z1 blocks first) so images and scripts get proper extensions.
Add little-endian T32/TBM variants and the console big-endian ones
(T8aD/T8aC/T4aD/T4aC/T1aD/T1aC, TBMD/TBMC). Headers and parts tables
are parsed by absolute offsets, including raw whole-image parts==0
handling and source clipping for negatively placed console parts.
The first 0x10000 bytes are XOR-encrypted with a keystream seeded from
the file name (Mersenne Twister); the rest is a plain MPEG stream.
BroccoliPak matches the same layout already supported by the MOONSTONE
implementation.
Add the IPG image format (raw RGBA32 pixels after a 12-byte
"IPG0" header), used by SALA ONE and EDEN* (PSP).
Add the PB6 image format used by ACTGS engine PS2 games (8bpp with
palette, or 24/32bpp pixel-RLE data after a 54-byte BMP-style header).
16bpp pixels were emitted as Bgr555 although PS1 stores red in the low bits, swapping red and blue channels. Rows are now read at their stored word width, 5-bit components are expanded by bit replication, and black (0,0,0) is treated as the transparency key.
DPK: FRID/DIRF index with either byte order. MSP: ' PSM' archives of TIM images. TTP: image archives storing TIM-like blocks that are rebuilt into standard TIM files on extraction.
@crskycode

Copy link
Copy Markdown
Collaborator

Before commit your vibe code, you must ensure your agent strictly adheres to the coding paradigms used by GARbro.

Fix stream lifetime, clipping and image size checks.
Correct GHP3 prefix tables and reuse PrefixStream for video.
@icey9527

icey9527 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Adjusted.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure it still works with supported games.

@icey9527 icey9527 Oct 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes have been tested with the corresponding games. I also did the localization for v791, so I am very familiar with this game and can confirm that the changes here work correctly.

GARbro-Mod actually has two separate issues with this game.

The first one is the color issue in ImageTM2.cs This is unrelated to my changes, since I did not modify this file.
vis00507:
image

The second one is the extraction issue, which is fixed by this PR, as shown below:
vis30064:
image

If you are still concerned, here is the original
vis.pac

@crskycode
crskycode merged commit 4e26c50 into nanami5270:master Oct 5, 2026
1 check passed
@icey9527
icey9527 deleted the 20260930 branch October 5, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants