Author Topic: Squaresoft's TIZ format  (Read 8300 times)

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Squaresoft's TIZ format
« on: 2014-06-28 02:10:52 »
I have been playing an early square game from the 1990s called "Another Mind". It a text FMV game and it has a bunch of files I'm trying to figure out.

The main one is the compressed TIM format or .TIZ

I have an example file It's located here

The name of the file is Kanji.tiz From what I gather it's the main TIM with all the kanji loaded into video memory on load and is used thought the game (as it is a Text adventure game). I picked this one because the kanji is 1BPP and I have a "snapshot" of it in PSX memory. (It's in the lower left hand corner)



The file is obviously compressed with, I'm assuming, some kind of Lempel–Ziv compression due to it's popularity with Japanese and Squaresoft in general. (LZS/LZH)  Most likely Lempel–Ziv–Stac. as Square obviously had a library already.

Bytes 0x00-0x05 seem to be a header of sorts (0x04 and 0x05 are double zeros, which is imposable with compression.) Strangely, running it though LZSCDec does produce output, but I think it was blindly decompressing and the end result gives me no TIM headers.

You guys want to help take a stab at it?



myst6re

  • *
  • Posts: 641
  • Light King of the Savegame - Field Master - FF8.fr
    • View Profile
    • FF8.fr
Re: Squaresoft's TIZ format
« Reply #1 on: 2014-06-28 11:28:01 »
Bytes 0x02-0x05 is the size of the file.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Squaresoft's TIZ format
« Reply #2 on: 2014-06-28 20:08:11 »
That's what I thought, as the LZSCDec doesn't barf on it I wish there was an way way in no$psx to set a breakpoint at the decompressor.

Kranmer

  • *
  • Posts: 766
    • View Profile
Re: Squaresoft's TIZ format
« Reply #3 on: 2014-06-29 16:28:54 »
You just want to decompress the TIZ ?
here is your sample TIZ converted to PNG (atleast i think this is right)


EDIT - Forgot to post the TIZ converted to TIM (oops)
http://www.mediafire.com/download/1y9sbhpwmo5j3p2
« Last Edit: 2014-06-29 16:35:12 by Kranmer »

myst6re

  • *
  • Posts: 641
  • Light King of the Savegame - Field Master - FF8.fr
    • View Profile
    • FF8.fr
Re: Squaresoft's TIZ format
« Reply #4 on: 2014-06-29 17:37:16 »
So there is a header of 6 bytes, with 2 unknown bytes followed by the full (compressed) file size. And data are simply LZS-ed.
« Last Edit: 2014-06-29 17:39:50 by myst6re »

Kranmer

  • *
  • Posts: 766
    • View Profile
Re: Squaresoft's TIZ format
« Reply #5 on: 2014-06-29 18:03:39 »
So there is a header of 6 bytes, with 2 unknown bytes followed by the full (compressed) file size. And data are simply LZS-ed.

Yeah after removing the first 2 bytes then decompressing the LZS you get the TIM

myst6re

  • *
  • Posts: 641
  • Light King of the Savegame - Field Master - FF8.fr
    • View Profile
    • FF8.fr
Re: Squaresoft's TIZ format
« Reply #6 on: 2014-06-29 19:04:59 »
Yeah after removing the first 2 bytes then decompressing the LZS you get the TIM

Normally the LZS header should be the compressed data size (file size - header size <=> file size - 4).

Kranmer

  • *
  • Posts: 766
    • View Profile
Re: Squaresoft's TIZ format
« Reply #7 on: 2014-06-30 11:41:41 »
Normally the LZS header should be the compressed data size (file size - header size <=> file size - 4).
I just compared the sample TIZ file halkun posted to the FF7 PSX TIZ file for the Sub Minigame and the header was very similar (excluding the first 2 bytes) so i removed them and then decompressed the LZS.
Also Halkun are you planning to do something with the game ? Translation ? or just a personal project ?

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Squaresoft's TIZ format
« Reply #8 on: 2014-07-01 02:48:20 »
It turns out every compressed file in the disk (anything that ends in .__Z) starts with that those two bytes (C3 FF) so it appears to be just a magic number identifying a compressed  file. This includes executable (.BIZ), pictures (.TIZ) dialogs (.ZZZ) answers (.ANZ) 

I can decrypt the movies, pictures, and probably sound/music data so far.  The game itself is pretty tiny, only about a meg a and a half.

I would love to get a dialog dump of the game and write my own engine around it. I have yet to decipher the text encoding, but that would be pretty awesome. The game engine has it's scripting opcodes in enshlish peppered around the main executable.

It's a shame the game is so rare, I'd like to have a tiny team help pick it apart.

I don't know how tolerate the game is to file re-insets, if it goes by filename of disk sector.  The game isn't exactly made for speed so who knows....

myst6re

  • *
  • Posts: 641
  • Light King of the Savegame - Field Master - FF8.fr
    • View Profile
    • FF8.fr
Re: Squaresoft's TIZ format
« Reply #9 on: 2014-07-01 21:52:21 »
This time, anything is possible.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Squaresoft's TIZ format
« Reply #10 on: 2014-07-01 22:34:21 »
Yea, I've been here for a while :P

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Squaresoft's TIZ format
« Reply #11 on: 2014-07-27 23:06:52 »
myst6re, Can you add a command-line switch to qt-lzs so I can decompress "Another Mind" style LZS files. (The ones with the "CC FF" in the header)

Better yet, if it detects "C3 FF" at the beginning of the file to ignore them and decompress the rest. It's a pain to edit several hundred files one at a time to remove those two bytes.