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

Author Topic: PS1 tools  (Read 5296 times)

Mugi

  • Full Member
  • ***
  • Posts: 205
  • Personal text
    • View Profile
    • Blacklabel-translations
Re: PS1 tools
« Reply #20 on: February 18, 2018, 11:29:50 pm »
i tried all of them i could get my hands on, official or not, they all load, and one of them (not this one) actually opens TIM's too, but could not save them or saved broken files.

this one simply says that the plugin cannot read the image correctly for any and all TIM you try to open.

it's not a big deal for me though since i have the ps2 edition of imagestudio with actual tim/tm2 support :P
In PSP we trust.

NERV Agent

  • Sr. Member
  • ****
  • Posts: 425
  • Fist deep into that honey pot....
    • View Profile
Re: PS1 tools
« Reply #21 on: February 18, 2018, 11:33:10 pm »
Yep, the ".TIMproject" file is just a TXT document which saves the settings for the given file.

HERE is a copy of the tool with the width/height limits removed. I tested it on the full-length span from Level1, and it seems to work. But keep in mind, the TIM format wasn't necessarily designed for such large sizes so quirks may show up.
 Unfortunately that's all the tool was designed to do since text-graphics rarely have more that one CLUT. Also note that the tool does not re-insert CLUTs so any edits to the palette will not be transfered back into the file.
 I didn't really, :P The CLUTs are in a big block starting at 0x44b8 which holds 104 CLUTs at 0x20 bytes each. They are listed in the same sequence as used in the textures. In other words, CLUT1 is used for texture1 on sheet1, CLUT2 for texture2 on sheet1. The pattern begins to break down when you come to textures which reuse previous CLUTs (such as the wolf tracks) so matching a texture in the middle would be pretty hard. I'm sure the information linking texture to palette is somewhere in the file, but I don't know where.
 PSP is compatible with Photoshop plugins. If you go to 'Help > Help Topics' and search for "setting plug-in locations" you should see directions for installation.

Just for the fun of it, I injected all the CLUTs into the Level1 texture TIM HERE. TimViewer opens it, but I think official TIMs were capped at 16 CLUTs max.

Mugi, what version of PSP are you using?

With regards to finding the CLUT before the palette, do you mean to tell me you just made a lucky guess? And how did you find out that there are 104 of them, each 32 bytes? I mean, there must of been some logic behind finding this specific info. :P

Anyway, I was able to use this new version to extract the entire 256 x 2816 texture map, but like last time only one CLUT was extracted. How do you inject new CLUTs into a TIM?

I also tried to load the LEVEL1 texture with all the CLUTs into Jasc Paint Shop Pro 9, and I got some error about CLUT entries exceeding 256 and it wouldn't open. It won't open in Tim2View, either. However, I can open it with TimViewer, though.

Also, how do you cycle through all the different CLUTs in Jasc Paint Shop Pro 9 (if it is even possible)?

Oh, Mugi, try using Jasc Paint Shop Pro 9. I got the plugin to work with that.

UPDATE: I used PSP9 to open a multi-CLUT TIM from FF7. It opens, but the palette is a single 256 palette, and the image only refers to the first 16 entries. How do I cycle through the different individual 16 color palettes instead of loading them as one 256 palette?
« Last Edit: February 18, 2018, 11:59:01 pm by NERV Agent »
Pen Pen Toblerone Vomit Pooh is waifu of the year.

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #22 on: February 19, 2018, 03:30:30 am »
Quote
it's not a big deal for me though since i have the ps2 edition of imagestudio with actual tim/tm2 support
Oh sure, show of with your fancy-schmancy new PS2 generation tools! ;D

Quote
And how did you find out that there are 104 of them, each 32 bytes? I mean, there must of been some logic behind finding this specific info.
Other than 24bit, all TIMs use 16bit color. Indexed images still use 16bit color in their palettes.

That means each color entry in a palette is 2bytes long (aka 16bits). So a 16 color TIM has 32 bytes per CLUT (aka 0x20). For 256 colors, that's 512 bytes per CLUT (aka 0x100). In Tomb Raider, the block of CLUTs is separated from other stuff by a field of 00s, so it's easy to measure its total size of 0x2080. Divide that by 0x20 per CLUT = 0x104. Incidentally, there was a typo earlier. The block of CLUTs actually begins at 0xC44b8.

As far as knowing that CLUT1 went with texture1, that was an educated guess. Games are assembled by computers and computers usually do things in a patterned way.

As far as how to find the CLUT block to begin with, I looked a the VRAM and saw what looked like the CLUT block. They're almost always stored near the image data in a file, so I just scanned before and after the image data using nana, and saw the same 'shape' as in VRAM.
Spoiler:

Quote
How do you inject new CLUTs into a TIM?
A 16 color TIM header looks like the picture below. I just copied the entire chunk of CLUTs from Level1 and inserted it over the original single CLUT. Then edited the other values to match the new CLUT size and count.
Spoiler:
You may know the PS1 is 'little endian' meaning the byte order is reversed, so 0x104 CLUTs x 0x20 bytes each = 0x2080. Reversed and +0xC = 0x208C. Number of CLUTs = 0x104, reversed is 0x0401.

Another useful trick, since indexed palettes are identical in format to a 16bit TIM, you can extract/insert them with RAWtoTIM as a 16bit TIM. The 'number of colors' becomes width, and 'number of CLUTs' becomes height. Because the tool wasn't specifically designed for this, you may lose the 'transparency', but most TIMs don't use this feature anyways.
Spoiler:

Quote
Also, how do you cycle through all the different CLUTs in Jasc Paint Shop Pro 9 (if it is even possible)?
Unfortunately the plugin doesn't support cycling through CLUTs. You also have to be careful about preserving the VRAM coordinates. One way to simplify this is to use RAWtoTIM to extract a TIM from the TIM. It sounds silly, but will leave all the header data intact since it only inserts the image data.

Mugi

  • Full Member
  • ***
  • Posts: 205
  • Personal text
    • View Profile
    • Blacklabel-translations
Re: PS1 tools
« Reply #23 on: February 19, 2018, 05:30:27 am »
Oh sure, show of with your fancy-schmancy new PS2 generation tools! ;D
You also have to be careful about preserving the VRAM coordinates.

meanwhile...



 ;D ;D ;D
In PSP we trust.

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #24 on: February 19, 2018, 05:47:51 pm »
 :thumbsup:
Those options look similar to what the plugin has. The problem is that the vRAM coordinates are not retained when you open a TIM. In other words, when you go to save, they set to a default rather than keeping the original values. Even if you knew what coordinates to enter, who wants to enter them manually every time you save?
Spoiler:
Does imagestudio retain the coordinates? What about multi-CLUT; does it have an easy way to switch between CLUTs?


Tenkarider

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
Re: PS1 tools
« Reply #25 on: February 19, 2018, 08:43:25 pm »
meanwhile...



 ;D ;D ;D
is that an actual ps2 tool?

Mugi

  • Full Member
  • ***
  • Posts: 205
  • Personal text
    • View Profile
    • Blacklabel-translations
Re: PS1 tools
« Reply #26 on: February 19, 2018, 10:41:34 pm »
:thumbsup:
Those options look similar to what the plugin has. The problem is that the vRAM coordinates are not retained when you open a TIM. In other words, when you go to save, they set to a default rather than keeping the original values. Even if you knew what coordinates to enter, who wants to enter them manually every time you save?
Spoiler:
Does imagestudio retain the coordinates? What about multi-CLUT; does it have an easy way to switch between CLUTs?

as far as i know it does retain them (they're always different when you open a tim) but i cant really say i know what im talking about with that, since i've never actually made a tim with it that i've inserted back to a ps1 game.

it doesnt support using multiple cluts at once as far as i know, they're saved and loaded as external files. (more or less like you can do on photoshop i guess?) I'd be interesting to see if something actually tailored for ps1 would have a multi clut functionality, but this one is really more for ps2, so i guess the tim support is a "legacy" function :P

is that an actual ps2 tool?

yes. It's a version of imagestudio tailored for ps2 development, comes with support for various formats for the system (tim/tm2/ all kinds of funky raw formats) also has an image optimizer for creating low color count indexed images, the color reduction engine on imagestudio is just amazing.

it's also capable of connecting to development units for direct graphics previewing on actual hardware.
The program was (still is?) stupidly expensive by the time i acquired my copy of it, single licence costed thousands of dollars, and I believe you had to have a developer licence to even purchase one to begin with. Myself, I was lucky enough that a copy of the program along with it's licences and the hardware key came with one of the development TOOLs I bought back in the day.
« Last Edit: February 19, 2018, 10:59:29 pm by Mugi »
In PSP we trust.

NERV Agent

  • Sr. Member
  • ****
  • Posts: 425
  • Fist deep into that honey pot....
    • View Profile
Re: PS1 tools
« Reply #27 on: February 20, 2018, 01:22:51 am »
A 16 color TIM header looks like the picture below. I just copied the entire chunk of CLUTs from Level1 and inserted it over the original single CLUT. Then edited the other values to match the new CLUT size and count.
Spoiler:
You may know the PS1 is 'little endian' meaning the byte order is reversed, so 0x104 CLUTs x 0x20 bytes each = 0x2080. Reversed and +0xC = 0x208C. Number of CLUTs = 0x104, reversed is 0x0401.

Thanks for this info.

However, I was lost in figuring the math, until I realized that 'little endian' means the same as Intel byte order.

So a note to all you n00bs out there who were also struggling in figuring out the math, set your hex editor byte order to "Intel".

For size of CLUTs (green part):

C (Raw Hex) = 12 (decimal)

32 (bytes) + 12 = 44 = 2C000000 (Intel byte order)

0x2080 means 2080 in Raw Hex which is 8320 in decimal.

8320 (bytes) + 12 = 8332 = 8C200000 (Intel byte order)

For the number of CLUTs (yellow part):

1 CLUT = 01000000 (Intel byte order) (For this only the first four digits "0100" matter.)

0x104 CLUTs (Raw Hex) = 260 CLUTs (Decimal) = 04010000 (Intel byte order) (For this only the first four digits "0401" matter.)
« Last Edit: February 20, 2018, 02:44:28 am by NERV Agent »
Pen Pen Toblerone Vomit Pooh is waifu of the year.

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #28 on: February 20, 2018, 02:12:36 pm »
Thank you for clarifying that NERV Agent. I think I'll call it unINTELligible byte order from now on  :P

Mugi, that was quite a find! It looks like they stopped selling the PS2 version a few years back, but the ARCHIVED site shows it was quite expensive. 

Mugi

  • Full Member
  • ***
  • Posts: 205
  • Personal text
    • View Profile
    • Blacklabel-translations
Re: PS1 tools
« Reply #29 on: February 21, 2018, 01:18:58 am »
yeah, it's pretty old.. I'm loving it though, it's pretty much my swiss army knife when it comes to graphics :P
as a painting program its pretty terrible though, but the format supports and the color reduction engine make up for that ^^
In PSP we trust.

Tenkarider

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
Re: PS1 tools
« Reply #30 on: February 22, 2018, 11:47:19 am »
uhm, that's nasty... since i'd like to make a try to discover how to hack Breath of Fire 5, perhaps a tool like
that might come handy, considered there's not even a single tool for that game...  :(

theflyingzamboni

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: PS1 tools
« Reply #31 on: March 06, 2018, 12:45:34 am »
Movie Audio Dubber
A tool which I will share upon request (not included in download), it splices new audio segments into an existing PS1 STR movie. The results require patches much smaller than baked-in subtitles (and no messy re-encoding), and it's much simpler than software-subtitles. For example, injecting speech samples totaling around 30 seconds, adds less than 1MB size to the final patch.

Source code (Autoit) is included- not well optimized, but fairly well 'noted'. Feel free to recommend tweaks. 
DOWNLOAD LINK
So does this allow you to just entirely replace the audio for a STR movie? In its entirety?
« Last Edit: March 06, 2018, 04:53:36 pm by theflyingzamboni »
ROM wasn't hacked in a day.

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #32 on: March 12, 2018, 05:58:02 pm »
I have never tested it for that use, but it should work. The tool reads a TXT document with time range(s) which are to be spliced into the STR. You would simply use a single entry which covered the entire length.

The audio in STR files is interlaced with video. Most games I've looked at use the same interlacing pattern, but the STR format supports many patterns. This tool only works with the type I've needed to edit. If you want to try it, I can prepare a little 'how to' and upload the tool.
« Last Edit: March 12, 2018, 06:03:03 pm by weissvulf »

theflyingzamboni

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: PS1 tools
« Reply #33 on: March 23, 2018, 03:35:41 pm »
I don't know if I'll do anything with it, but I would definitely be interested in the utility if you're willing to share it.
ROM wasn't hacked in a day.

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #34 on: March 25, 2018, 04:20:01 pm »
HERE is a link. I wrote simple directions, but they don't cover some aspects. If you have any issues, let me know and I'll see if I can sort it out. 

ShadyRounds

  • Jr. Member
  • **
  • Posts: 36
  • Apathetic, yet Helpful.
    • View Profile
Re: PS1 tools
« Reply #35 on: April 25, 2018, 09:21:10 am »
Coming back about the text tool. So you're saying, I can hex-edit, your tool, so I don't have to do as much hex editing? That honestly sounds tempting. One last question. It supports A-Z, a-z, 0-9, and .,?!/(), but would it support weird symbols in any way you think? I'm talking really weird, it doesn't have to portray the symbols accurately, just one that the text doesn't use like ` or ~, because what I actually need are spots for α and Ω (you'd know what game if you recognize them)
Apathetic, yet Helpful. :beer:
Project: Megaman Legends Remix