News:

11 March 2016 - Forum Rules

Main Menu

PS1 tools

Started by weissvulf, December 13, 2017, 05:06:14 PM

Previous topic - Next topic

Mugi

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

#21
Quote from: weissvulf on February 18, 2018, 11:00:34 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?

weissvulf

Quoteit'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

QuoteAnd 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
[close]

QuoteHow 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
[close]
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
[close]

QuoteAlso, 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

Quote from: weissvulf on February 19, 2018, 03:30:30 AM
Oh sure, show of with your fancy-schmancy new PS2 generation tools! ;D
Quote from: weissvulf on February 19, 2018, 03:30:30 AM
You also have to be careful about preserving the VRAM coordinates.

meanwhile...



;D ;D ;D
In PSP we trust.

weissvulf

 :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
[close]
Does imagestudio retain the coordinates? What about multi-CLUT; does it have an easy way to switch between CLUTs?


Tenkarider


Mugi

#26
Quote from: weissvulf 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
[close]
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

Quote from: Tenkarider on February 19, 2018, 08:43:25 PM
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.
In PSP we trust.

NERV Agent

#27
Quote from: weissvulf on February 19, 2018, 03:30:30 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
[close]
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.)

weissvulf

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

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

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

#31
Quote from: weissvulf on December 13, 2017, 05:06:14 PM
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?
ROM wasn't hacked in a day.

weissvulf

#32
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.

theflyingzamboni

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

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

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

baby_cart

Hi, sorry to be a bother, but Windows Defender tags this download from mediafire as a severe trojan. Where can a get the Raw to TIM?

DragonSpikeXIII

Quote from: baby_cart on January 31, 2020, 04:28:07 AM
Hi, sorry to be a bother, but Windows Defender tags this download from mediafire as a severe trojan. Where can a get the Raw to TIM?

Here's a link to just Raw to TIM: https://www.dropbox.com/s/mbmjtgmraywz8ks/PS1mple%20RAW%20to%20TIM%20v13.7z?dl=0

baby_cart

Quote from: DragonSpikeXIII on January 31, 2020, 12:58:33 PM
Here's a link to just Raw to TIM: https://www.dropbox.com/s/mbmjtgmraywz8ks/PS1mple%20RAW%20to%20TIM%20v13.7z?dl=0

Thanks very much!  :woot!:

Still haven't found what I've been looking for, but this tool helps!

SlavaVlasov

Quote from: weissvulf on December 13, 2017, 05:06:14 PM
These are some specialized tools I'm making, geared specifically toward Playstation 1 translating.
Hello. Can you make a console application for batch conversion of BMP to TIM and TIM to BMP? Really needed!
As for the ways to work with Color bits, I offer options:
1. If there is a conversion from BMP to TIM, then take the color settings from the BMP (for example, 4, 8, 16 bits, if the BMP already been saved with indexed colors), and save in TIM with the same parameters (the same when converting TIM to BMP).
2. Set the parameters in the batch file.
3. Use both options.

P. S. What is needed is a console application.