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

Author Topic: Dealing with Compressed Text in PlayStation RPG  (Read 3732 times)

Xanato

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Dealing with Compressed Text in PlayStation RPG
« on: December 20, 2015, 12:24:28 am »
Yep. That infamous problem has pulled the plug on my plans of changing the dialogue of an old RPG in my collection. From what I've read, you need to know how to do programming in order to decompress the text. Unfortunately, that's a skill which I don't really have. Is there an easier way of getting around this or am I out of luck?
« Last Edit: December 25, 2015, 03:01:55 pm by Xanato »

pablitox

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #1 on: December 20, 2015, 01:02:49 am »
It'd be most useful to know the rpg name.
Re taking hajimari no ishi!

Xanato

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #2 on: December 20, 2015, 01:06:38 am »
It's The Legend of Dragoon.

BlackDog61

  • Hero Member
  • *****
  • Posts: 784
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #3 on: December 20, 2015, 01:25:27 am »
And what have you investigated that leads to the conclusion of compressed text?

Xanato

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #4 on: December 20, 2015, 11:17:28 am »
I've done a lot of relative searches of the BIN file with SearchR X and tried to use Thingy32TW with some table files that I've made. I was able to find text for the additions (fighting skills) in an overlay file, some messages pertaining to Sony Computer Entertainment America, and what appeared to be instructions on which files to load at certain points, but I couldn't find any dialogue from the main game. Using unique or rare words that appear in the script didn't help, either.

BlackDog61

  • Hero Member
  • *****
  • Posts: 784
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #5 on: December 29, 2015, 05:50:21 am »
To help you,we need to hear more details:
- which encodings did you try during your Rsearch? SJIS, UTF8...?
- knowing which game this is could definitely allow someone reading you to try his/her own tricks and point you into the right direction.
- which files have you tried this against?
- have you extracted files from the disk? Do they look like they are archives?
- when you say you've used your own home-made tables, what logic did you use to make them?
- have you tried sjis_dump (or the newer program with some standard tables like UTF8 and UTF16, even if I'd be surprised if an old PSX game used that)? http://www.romhacking.net/forum/index.php/topic,20776.msg291898.htm

FYI: finding some ASCII-encoded "printf" format strings (anddebug strings) is good, but that doesn't give a definite info for the encoding of most Japanese text. I've seen a game with ASCII encoded format strings and yet custom-encoded (=custom table) text.

Xanato

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #6 on: December 29, 2015, 06:21:02 pm »
- I'm not sure which encoding(s) I've used. I just checked the Help section and Readme file for SearchR X 1.0 and didn't find anything about encodings.
- As stated in my second post, the game is The Legend of Dragoon.
- I've mostly tried relative searches on the entire BIN file. Some were done on an overlay file(s).
- I'd ripped an image file from the first disc of the game and mounted it to a virtual drive on my PC. Yes, the file contains folders with different contents.
- Some of my relative searches brought up bits and pieces of additions (fighting skills) that were all listed around the same spot. After doing some research and finding out that some hex values can represent multiple characters, I attempted to fill in the blanks and found the list becoming more complete as I added to the table file. In addition, messages about Sony Computer Entertainment America in other overlay files were also getting more filled in.
- I haven't even heard of sjis_dump or the newer program, but I'll check it out.

- I've realized that the additions list and company messages are a dead end, but it was my first time decoding hex in a game, so at least I know I'm doing something right.

yugisokubodai

  • Full Member
  • ***
  • Posts: 141
    • View Profile
    • Assembly
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #7 on: December 30, 2015, 05:59:09 pm »
My experience with the PSX tell me that you need to search in a state file.
It's better than looking in the Rom.
An emulator with Vram viewer like Agemo is useful, too.

Xanato

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #8 on: December 30, 2015, 07:45:01 pm »
Do you mean a save state file, Yugisokubodai? If so, how would that work?

BlackDog61

  • Hero Member
  • *****
  • Posts: 784
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #9 on: December 31, 2015, 03:57:24 am »
In general, don't look for strings on the CD image. Extract stuff inside it and then look for strings.
Sjis_dump finds stuff in some files, so I'd bet for SJIS table.

Xanato

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #10 on: December 31, 2015, 10:28:30 pm »
I've run searches on files within the BIN itself, too. Aside from a few overlay files and SCUS_944.91, nothing familiar comes up. I'll try to use SJIS Dump and see if that uncovers something.

yugisokubodai

  • Full Member
  • ***
  • Posts: 141
    • View Profile
    • Assembly
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #11 on: January 01, 2016, 05:27:35 am »
Do you mean a save state file, Yugisokubodai? If so, how would that work?

Yes, I mean the save state. You better use PSX1_13's save state than ePsxe. If you're using epsxe's save state, then you must rename the extension to 7z and un-rar it.

Usually, if the text data is compressed, then it will be decompress when displayed on the screen. Take a state when the text is displaying, open your Hex editor and browse to that state file, search for the string.

Xanato

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #12 on: January 01, 2016, 10:57:03 pm »
Would a relative search utility also work or does it have to be a hex editor? I just used SearchR X to check two quick saves from the game, but I couldn't find the dialogue on the screen.

BlackDog61, what's the command that I should use for SJIS Dump? I couldn't really find any instructions for using it.

BlackDog61

  • Hero Member
  • *****
  • Posts: 784
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #13 on: January 02, 2016, 04:12:56 am »
Would a relative search utility also work or does it have to be a hex editor? I just used SearchR X to check two quick saves from the game, but I couldn't find the dialogue on the screen.

BlackDog61, what's the command that I should use for SJIS Dump? I couldn't really find any instructions for using it.
As I suggest in my review: sjis_dump 4 0

Xanato

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #14 on: January 02, 2016, 10:52:31 am »
I have read your review and did not understand the command that was posted. Could you please elaborate on it? This is my first time working with that kind of software, so bear with me.

BlackDog61

  • Hero Member
  • *****
  • Posts: 784
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #15 on: January 02, 2016, 04:23:22 pm »
sjis_dump will try and interpret bytes from the file as SJIS-encoded Japanese text. Not all bytes are even possible SJIS characters, which is what sjis_dump uses to try and detect "real" text. Of course that doesn't work most of the time. :)
The first parameter ("4") tells the program to only dump sequences of 4 valid SJIS characters or more. (It ignores any shorter sequence.) The higher this parameter, the least random data gets interpreted as SJIS. Still, there's goingto be a lot of "not text" dumped.
The second parameter tells whether ASCII is considered valid or not. If you're looking for Japanese text, in general, it's a good idea to not dump ASCII. (There are a lot of bytes in the ASCII range in random data.)

yugisokubodai

  • Full Member
  • ***
  • Posts: 141
    • View Profile
    • Assembly
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #16 on: January 04, 2016, 08:49:21 am »
Would a relative search utility also work or does it have to be a hex editor? I just used SearchR X to check two quick saves from the game, but I couldn't find the dialogue on the screen.

BlackDog61, what's the command that I should use for SJIS Dump? I couldn't really find any instructions for using it.

Chance that you're running with a game that uses DTE, MTE or simply, encrypted.

Xanato

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #17 on: January 06, 2016, 05:34:57 pm »
Okay. How would I deal with that kind of compression/encryption?

Also, I've tried using SJIS Dump on the BIN file, but haven't been able to get it to work. I've gone to the folder that contains the BIN file and entered the following command:

sjis_dump.exe "LoD 1.bin" 4 0

A Windows error message comes up saying that sjis_dump.exe has stopped working. What should I do?

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6817
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #18 on: January 06, 2016, 05:49:29 pm »
I have not used this program but it sounds like people are saying DON'T START BY SEARCHING THE ISO.
That could be a reason it's crashing. (if the program is not designed to support full ISO files that are hundreds of megabytes)
Just going from what I read.
"My watch says 30 chickens" Google, 2018

Vehek

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: Dealing with Compressed Text in PlayStation RPG
« Reply #19 on: January 06, 2016, 07:08:08 pm »
You also have too few parameters. You left out the output file name, which goes between the first file name and the threshold. (A probable mistake in the source code stopped it from spotting that error and warning you.)
« Last Edit: January 06, 2016, 07:14:32 pm by Vehek »