DCNick3 / shin

A reimplementation of VN engine primarily used by 07-th expansion releases on consoles (and some other entergram games)
https://dcnick3.github.io/shin/shin/
Mozilla Public License 2.0
29 stars 2 forks source link

Extracting data.rom from two PS Vita VNs by Favorite #35

Closed 3cho0 closed 4 months ago

3cho0 commented 9 months ago

I found your tool when I was looking for a way to extract the data.rom found in the following two PS Vita ports: (PCSG00462) Irotoridori no Sekai: World's End Re-Birth (PCSG00901) AstralAir no Shiroki Eien: White Eternity

I tried to extract IroSeka's data.rom, but sdu gave me a bad magic number error. To fix that I changed "ROM" to "ROM2" in a hex editor, but now I get: Error: Parsing ROM

Caused by: Unknown version: 0x00020001

Astral Air already has ROM2 in its file header, but I get the same issue there: Error: Parsing ROM

Caused by: Unknown version: 0x00000001

There are many file formats inside that your tool also supports, such as .snr, .txa, .pic and .bup.

Is it possible to implement support for these two data.roms? Also, is there a way to repack the data.rom file?

DCNick3 commented 9 months ago

These appear to be some older versions of the ROM format (esp since they are on PS Vita). Supporting various versions of the format is not a priority for this project right now, as I am currently trying to make the game engine working, sorry!

The Vita games are on my radar (I am at least trying to collect all the ROMs of them, so thanks for the names of those), but I just haven't gotten around to actually look at their older formats.

You might have better luck with 07th-mod tools from enter_extractor repo blabla.py, which is developed to extract .rom files seems to have support for files with ROM magic. I also remember there being tools supporting other formats (.pic, ¿.bup?, ...), with some attempts to make it work across versions. It might be worth a try.

You can also be interested in ShinDataUtil (developed by me), as it also implements the repacking of data.rom (and also supports encoding of all the .txa, .pic and .bup files). But it was also developed for switch-era games (tested with Higurashi and KonoSuba), so it would probably of no direct interest.

DCNick3 commented 9 months ago

Oh, https://github.com/ItaloKnox/ps3umi might also be useful, it seems to be developed for even older formats

3cho0 commented 9 months ago

Thank you for the quick answer! I will definitely look into those tools, since repacking is inevitable.

In the meantime, I was also looking for other tools and managed to extract the data.rom by modifying the blabla.py from here: https://github.com/07th-mod/enter_extractor

I replaced the 'utf-8' in line 36 with 'sjis' and it worked like a charm.

EDIT: Just saw that you mentioned the exact same tool in your reply, brainfreeze moment there :p

3cho0 commented 9 months ago

A couple of things to note here for Astral Air. I tried enter-extractor, ps3umi, ShinDataUtil and even GARbro, but unfortunately none of the tools support the files from the PS Vita. The .pic files are PIC4, version 1 and .bup files are BUP4, version 2. I tried changing the version numbers and other stuff, but obviously that didn't work.

At least, I was able to convert the files from Irotoridori no Sekai to .png using enter-extractor, since that game was released a bit earlier than Astral Air. I guess, the most interesting part would be to repack the rom file with a translated script and replacing the voice files with higher quality versions from the PC release. Luckily, we have tools to convert from .wav to Vita's .at9 format.

I'll be keeping an eye on your tool, since it seems very promising. Maybe it can be used in the future to mod these games on console.

DCNick3 commented 9 months ago

If you want translation, I would guess that you would be interested in PIC (used for CGs), TXA (used for UI elements & stuff, usually text is pre-rendered there) and SNR (the game scenario, obviously).

From my experience, supporting the PIC and TXA I think would be less effort, while SNR is kind of complicated.

What I am trying to do here with SNR is supporting the full instruction set, while only a few instructions are actually relevant for translation. I think I'll make a spin-off tool focused only on translation for that :thinking:

I'll try to look into it on weekend if something unexpected won't come up.

Btw, I'm dcnick3 on Discord and Telegram, add me if you want. Probably would be easier to communicate there

DCNick3 commented 9 months ago

So, I quickly cobbled together a tool for extracting and patching strings in the SNR file, which should be everything you need from it for translation.

It currently targets Astral Air, but supporting other games should be possible relatively easily. There's still no good way to repack the ROM file, but I was able to hack my way into it by using hex editor:

image

Check it out and let me know if there are any issues/comments: https://github.com/DCNick3/shin-translation-tools

3cho0 commented 9 months ago

Thank you very much for the quick update! The extraction works nicely and translating the script should be doable, too. Creating a patch.rom with modified assets might be easier indeed. I'll keep tinkering with currently available tools to check if it's possible to make this work on the Vita.

About the repacking process, I'm sure you've found Neurochitin's tools already, but I'll leave a link for other people to find: https://gitlab.com/Neurochitin/kaleido/

He also made an english patch for Kaleido for the Switch and PS Vita using the patch.rom method: https://gitlab.com/Neurochitin/miko_kaleido_patch

Other than (PCSG01294) Gensou Rougoku no Kaleidoscope, there is also (PCSG00517) Higurashi no Naku Koro ni Sui with a data.rom file inside. Just leaving this here, since you are researching games with these files.

DCNick3 commented 9 months ago

I indeed know of Neurochitin's work, he even contributed to this repo =)

I am currently compiling all the games (switch/vita) I know of into a spreadsheet and will work on a polyglot tool for all the ROM versions they use, so repacking should be figured out soon

DCNick3 commented 8 months ago

shin-translation-tools has support for extracting and packing ROM files now