News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: SLZ compressor for Star Ocean (PSP)  (Read 5497 times)

MickL39

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
SLZ compressor for Star Ocean (PSP)
« on: July 03, 2012, 06:28:34 am »
Hi all,

I'm looking for a compressor SLZ for the game Star Ocean on PSP but I found nothing.

I would like to know if anyone has this tool.

Thank you in advance.

LostTemplar

  • Hero Member
  • *****
  • Posts: 906
    • View Profile
    • au-ro-ra.net
Re: SLZ compressor for Star Ocean (PSP)
« Reply #1 on: July 03, 2012, 07:07:24 am »
Here's a decompressor, but I don't know whether it's also able to compress data. But it has the source code included, so you could just program your own recompressor.

http://www.romhacking.net/utilities/819/

MickL39

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: SLZ compressor for Star Ocean (PSP)
« Reply #2 on: July 03, 2012, 07:28:59 am »
Thank you but I have already this source code.
The problem is that I can't program the compressor, it seems a little too complicated for me  :(

LostTemplar

  • Hero Member
  • *****
  • Posts: 906
    • View Profile
    • au-ro-ra.net
Re: SLZ compressor for Star Ocean (PSP)
« Reply #3 on: July 04, 2012, 11:13:08 am »
I just looked at the source code. It's actually quite simple, just a standard LZSS compression. I'm sure there's source code for LZSS compressors out there. You could take a look at one and adjust it to yield the compressed output in SLZ format. Just try it, I'm sure it ends up being easier than you had thought.

If you can't program, then you're probably out of luck, though. You could perhaps ask CUE (he's on this forum as well) who seems to be the author of the decompressor, maybe he has a matching compressor.

The format also has an uncompressed mode (named "0/STORE" in the source code). If there's enough space you could just reinsert everything uncompressed.

Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3532
    • View Profile
    • Aeon Genesis
Re: SLZ compressor for Star Ocean (PSP)
« Reply #4 on: July 04, 2012, 12:48:24 pm »
Strictly speaking, if you can't program, you probably shouldn't be messing with compression tools that require programming. It ends badly for everyone involved, and this is coming from persona experience back when *I* couldn't program.

MickL39

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: SLZ compressor for Star Ocean (PSP)
« Reply #5 on: July 04, 2012, 01:12:07 pm »
Strictly speaking, if you can't program, you probably shouldn't be messing with compression tools that require programming. It ends badly for everyone involved, and this is coming from persona experience back when *I* couldn't program.

I would like to translate this game in French.
I have already developed programs to extract some elements of the game as scripts.
I can also edit scripts into RAM.
My problem is that I need a SLZ compressor to inject my changes in the "ISO file" and it seems more complex than what I have already programmed.

For example (I edited the RAM):




@LostTemplar : Unfortunately, the file is too big if I use SLZ 0.
« Last Edit: July 04, 2012, 01:28:45 pm by MickL39 »

Klarth

  • Sr. Member
  • ****
  • Posts: 495
    • View Profile
Re: SLZ compressor for Star Ocean (PSP)
« Reply #6 on: July 04, 2012, 07:40:17 pm »
My problem is that I need a SLZ compressor to inject my changes in the "ISO file" and it seems more complex than what I have already programmed.
It's much more complex than that.  You need a program to unpack/repack the Virtual Filesystem, then you need to make sense of the archive files.  Then you decompress, then you look at the subfiles for script, program a script dumper.  Then you do everything in reverse.  It's a lot of work.

MickL39

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: SLZ compressor for Star Ocean (PSP)
« Reply #7 on: July 04, 2012, 08:41:14 pm »
It's much more complex than that.  You need a program to unpack/repack the Virtual Filesystem, then you need to make sense of the archive files.  Then you decompress, then you look at the subfiles for script, program a script dumper.  Then you do everything in reverse.  It's a lot of work.

I have already extracted scripts, items... so the unpack is not a problem.
But I use a SLZ decompressor (thank to CUE) so if I want to modify something, I need to recompress my file in SLZ. That's why I need a SLZ Compressor.

After that, I need to rebuild the .bin file (the main archive of the game).
It is not really a problem, I just gotta make sure the new file size (for example a SLZ file) is less than or equal to the original.

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: SLZ compressor for Star Ocean (PSP)
« Reply #8 on: July 05, 2012, 02:19:56 am »
Not necessarily. Listen to Klarth. Once you figure out the virtual filesystem, you can unpack and repack the entire game like a ZIP file. Then you won't have to worry (as much) about file size limits.
In the event of a firestorm, the salad bar will remain open.

MickL39

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: SLZ compressor for Star Ocean (PSP)
« Reply #9 on: July 05, 2012, 02:39:11 am »
Not necessarily. Listen to Klarth. Once you figure out the virtual filesystem, you can unpack and repack the entire game like a ZIP file. Then you won't have to worry (as much) about file size limits.

I don't know why but the game crash if I have a different size.

Klarth

  • Sr. Member
  • ****
  • Posts: 495
    • View Profile
Re: SLZ compressor for Star Ocean (PSP)
« Reply #10 on: July 05, 2012, 02:51:35 am »
The two things that you are likely wrong: 1. You aren't modifying the virtual filesystem's file pointers and are just overwriting/moving data or 2. Your VFS is larger than the original and you didn't rebuild the CD image.  An unlikely third is that the game somehow ran out of RAM.

My suggestion is that you code one of the routines you believe are most efficient (LZSS+RLE probably) and use it to recompress everything that needs it.  Leave the rest compressed as-is.  Your compression will likely be a bit less, but it'll be easier and you'll need to expand the files anyways.  If you've made the tools to get this far, the rest isn't too bad.  LZSS might look a bit complex at first, but it really is just a dynamically created dictionary compression.  Unfortunately, the Tales LZSS+RLE looks different from this SLZ's LZSS+RLE.

LostTemplar

  • Hero Member
  • *****
  • Posts: 906
    • View Profile
    • au-ro-ra.net
Re: SLZ compressor for Star Ocean (PSP)
« Reply #11 on: July 05, 2012, 03:45:50 pm »
The file system looks easy enough. Look at so1pack.bin. This seems to be the header:

0x00~0x03 - number of contained files
0x04~0x07 - pointer to table of file offsets
0x08~0x0C - pointer to table of file lengths
0x0D~0x0F - pointer to first file? Dunno.

The two tables have as many entries as there are files. I wrote a small program that unpacks all files and decompresses all files with the SLZ signature, but they themselves often contain multiple SLZ files and at the moment I'm not motivated enough to do everything recursively. That means I couldn't find the script yet, but I like tri-Ace games enough that I might try it again in the next few days.

Be aware that I figured this out by looking at the file, so there's the possibility that anything I wrote is wrong.