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

Author Topic: PS1 tools  (Read 5230 times)

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
PS1 tools
« on: December 13, 2017, 05:06:14 pm »
These are some specialized tools I'm making, geared specifically toward Playstation 1 translating. I'm posting here to get input... on the off chance that they're actually useful to someone else. I add features and try to improve efficiency as needs arise and would welcome input for the next time a rewrite comes up.

Auto ASM Maker

A tool for select PS1 games that dumps text and pointers into an ASM file for easy editing/insertion with ARMIPS. The main benefit of this tool versus other available dumpers is that it will automatically locate some PS1 pointers that other dumpers don't.

It currently only supports games that use SHIFT-JIS/ASCII. It would be quite easy to add support for table files, I just haven't bothered yet because I haven't needed it.

Convert

A simple address converter designed to help with tracing/hacking between RAM, EXE, Hex-editor etc. It has 3 customizable conversion slots with a 'save' feature so that settings for various projects can be quickly restored.

RAW to TIM

Mainly designed to extract/insert pesky proprietary images from PS1 games (aka headerless TIMs etc). It should work with other raw image data as well. I recently added a TIM<>BMP converter for someone, but it is largely untested since I did a major coding re-write.

HexDecBin Converter

Converts numbers between Hexidecimal, Decimal and Binary. Seldom needed, but sometimes useful for for following bit-shift operations, manually creating CPU-op codes etc. It handles conversions like the Playstation's CPU does (signed) , meaning values above 0x7FFFFFFF (aka have the highest bit set to '1') are treated as negative numbers. For those who don't know, MIPS assembly uses the terminology 'unsigned', but such values are still treated as 'signed'. They just don't set an exception for values in the 'singed' range (aka 0x80000000 - 0xFFFFFFFF). 

Width Scanner

A mostly useless tool (hey, at least I'm honest :D ). It scans non-compressed PS1 emulator save states for potential letter spacing values, and lets you edit/restore the results. It was just a wacky idea for an automated way to find variable-width-font injection points, but it could also work for novices who wish to reduce the gaps between letters on fixed-width fonts. I've had roughly a  1 in 5 success rate on games so don't expect much. May work on other MIPS (PS2, PSP etc) based consoles.

2bit Tool

A basic tool that converts a 2bit BMP into raw binary data. The source BMP can be either 8 or 16 pixels wide- ie a stacked column of letters. It's designed for producing fonts similar to the PS1's BIOS font which are used by many games for storing the full Shift-JIS set in a compact form. Insert the resulting binary font with a tool like ARMIPS.

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
Movie Audio Dubber DOWNLOAD LINK
« Last Edit: March 25, 2018, 04:23:30 pm by weissvulf »

mz

  • Sr. Member
  • ****
  • Posts: 356
  • Whore
    • View Profile
Re: PS1 tools
« Reply #1 on: December 13, 2017, 05:11:59 pm »
That TIM tool looks useful, I'll definitely try it once I resume my work on PSX games.

By the way, are you running Windows 2000 or something? :D
There has to be a better life.

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #2 on: December 13, 2017, 06:06:21 pm »
Ha, Windows 95 forever! No, it's just a classic theme. I prefer the clean lines for my work PC.  :thumbsup:

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #3 on: January 07, 2018, 01:33:24 am »
Updated RawToTIM to fix a bug with non-palleted (16 and 24 bit) TIMs which was erroneously injecting a blank palette under some circumstances leading to a corrupted extract. Also changed quick-set dimensions from 512x512 to 320x240. Added a new WidthScanner tool.

ShadyRounds

  • Jr. Member
  • **
  • Posts: 36
  • Apathetic, yet Helpful.
    • View Profile
Re: PS1 tools
« Reply #4 on: January 07, 2018, 03:11:40 pm »
Didn't read so sorry it this is covered, but what about games that use texture fonts that don't match the native hex alphabet? Megaman Legends letters are between 1B and 4F. Some special characters in the 80s. Does it support thingytable translation? Also, what about snips of hex in the text, such as MML uses an item hex for the game to auto fill the item name, and some hex will just color all text afterwards, so what about nontext within text.
Apathetic, yet Helpful. :beer:
Project: Megaman Legends Remix

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #5 on: January 07, 2018, 05:13:22 pm »
This is the pertinent part:
Quote
It currently only supports SHIFT-JIS/ASCII games that use a '00' end-byte. It would be quite easy to add support for table files and other end-bytes, I just haven't bothered yet because I haven't needed it.
If you have some programming skills, you could do it yourself. There is a point in the source code where the text is read byte by byte before it is dumped to the ASM. It would be an easy place to add a conversion based on a table file. As far as adding support for end-bytes other than 00, all it would take is changing the 'constant' of 00 to a variable and adding user-input to set that variable.  :)

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #6 on: January 15, 2018, 09:29:39 pm »
Added a simple Hex-Decimal-Binary converter optimized for PS1-like behavior, and an audio dubbing tool.

Tenkarider

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
Re: PS1 tools
« Reply #7 on: January 16, 2018, 11:16:25 am »
Sounds neat... just saying, how much harder would be doing the equivalent for PS2? (PS2 tools)

Squall_FF8

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: PS1 tools
« Reply #8 on: January 16, 2018, 01:09:18 pm »
It seems TIM got much attention. Isn't this good enough tool?
https://github.com/Lameguy64/img2tim

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #9 on: January 16, 2018, 05:26:15 pm »
Tenkarider, It wouldn't be any harder to make PS2 specific tools or adapt these to be more PS2 friendly. These were just made for my own projects based on 'holes' in the existing available tools. So they only contain features I've needed so far. Hopefully we will seem more/better PS1/PS2 tools in the near future  :)

Squall_FF8, That looks like a nice tool for creating TIMs. Someone should see if he would like to add it to the RHDN database. My tools are specifically geared towards translating as opposed to ripping or graphic-editing. RawToTIM's main purpose is extracting/inserting proprietary graphics from game files. I just added the converter for convenience, and to avoid some conversion issues I was having with odd-sized graphics. There are far better TIM handlers out there if someone just wants to edit textures or make new TIMs.  :thumbsup:

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #10 on: February 16, 2018, 05:21:57 pm »
Added a re-written version of AutoASM. Significantly faster, supports variable end-bytes, removed unnecessary options, fixed a bug that would endlessly loop if scanning an empty area, added a generic 2byte search mode which increases pointer detection capabilities, etc.

Added '2bit' tool which converts 2 color BMP fonts (similar to the PS1 BIOS font) into raw binary data, ready for insertion.

NERV Agent

  • Sr. Member
  • ****
  • Posts: 425
  • Fist deep into that honey pot....
    • View Profile
Re: PS1 tools
« Reply #11 on: February 16, 2018, 05:51:39 pm »
It seems TIM got much attention. Isn't this good enough tool?
https://github.com/Lameguy64/img2tim

RawToTIM's main purpose is extracting/inserting proprietary graphics from game files.

For example, the textures in the Tomb Raider games aren't stored in ".TIM" files; they are actually stored in the level files themselves (".PSX").

I imagine RawToTIM's purpose is to extract such graphics.

But I have a question of my own, pertaining to RawToTIM. If this is capable of ripping the textures out of the Tomb Raider level files, will it also extract all the CLUTs along with it?
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 #12 on: February 17, 2018, 04:18:52 am »
Quote
But I have a question of my own, pertaining to RawToTIM. If this is capable of ripping the textures out of the Tomb Raider level files, will it also extract all the CLUTs along with it?
Not in a convenient way. The tool was made for translating text images mainly. As such, it only generates TIMs with a single palette.

In the case of Tomb Raider, the image data is 256x256, with each sheet holding multiple textures- and using multiple 4bit palettes. For example, in Level1.psx, the first textures at 0x5c4b8 would be properly extracted as 256x256 with something like 11 CLUTs. This tool could extract 11 copies of the texture, each with a different CLUT, but that would rarely be worth the effort.  :-[

HERE is the project file for the first texture in LEVEL1.PSX if you want to see what I mean. Just put it in the same folder with LEVEL1.PSX and load the psx file.

NERV Agent

  • Sr. Member
  • ****
  • Posts: 425
  • Fist deep into that honey pot....
    • View Profile
Re: PS1 tools
« Reply #13 on: February 18, 2018, 06:58:45 am »
Yeah, I'm getting an invalid TIM header error with TimViewer. But then again, I didn't touch the palette start locations, as I've never figured out how to find the exact palette location in the Tomb Raider games.

Ah, I just looked through some notes about Tomb Raider.

For LEVEL1.PSX, the texture height map is 2816, and RAW to TIM will only let me enter a 3 digit number.

Oh well. :huh:
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 #14 on: February 18, 2018, 01:25:33 pm »
Is the "invalid TIM header error" from a TIM produced with RAWtoTIM? I just tested the Tomb Raider extracts I made and they seemed to open fine. Pictured is the 1st sheet from the opening level - you can see the wolf tracks on the right.

As far as the TombRaider texture height, that 2816 is probably 11 different 256 tall sheets. That's how it's loaded into VRAM. They're just stacked on top of each other with no header in between. But if you would like to extract them as a single image, I can make a special build with the 3-digit cap removed. It's not an 'functional limit'. I put it there to help people avoid making mistakes.  :)

By the way, do you know that Jasc PSP supports TIM natively using the plugin HERE?


NERV Agent

  • Sr. Member
  • ****
  • Posts: 425
  • Fist deep into that honey pot....
    • View Profile
Re: PS1 tools
« Reply #15 on: February 18, 2018, 08:58:59 pm »
Ohhh! I was only loading the file you linked to. So I need to load the project file, then the level file.

So I loaded LEVEL1.PSX and it loads. However, only one 16 color CLUT was extracted, not all 11.

A special build with the 3-digit cap removed would help. It's been my experience that a polygon model in Tomb Raider will have its textures scattered throughout the whole texture map, which is 256 x 2816.

Also, how did you figure out how to find where the CLUT starts? This is something I could never figure out.

Oh, and the plugin you linked to is for Adobe Photoshop, not Jasc Paint Shop Pro 9.
Pen Pen Toblerone Vomit Pooh is waifu of the year.

Mugi

  • Full Member
  • ***
  • Posts: 203
  • Personal text
    • View Profile
    • Blacklabel-translations
Re: PS1 tools
« Reply #16 on: February 18, 2018, 10:48:58 pm »
the plugin can be loaded into paint shop pro (PSP supports photoshop plugins to an extend) however, atleast for my version of PSP, it doesnt work.
In PSP we trust.

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #17 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.

Quote
So I loaded LEVEL1.PSX and it loads. However, only one 16 color CLUT was extracted, not all 11.
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.

Quote
Also, how did you figure out how to find where the CLUT starts? This is something I could never figure out.
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.

Quote
Oh, and the plugin you linked to is for Adobe Photoshop, not Jasc Paint Shop Pro 9.
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?

Mugi

  • Full Member
  • ***
  • Posts: 203
  • Personal text
    • View Profile
    • Blacklabel-translations
Re: PS1 tools
« Reply #18 on: February 18, 2018, 11:10:32 pm »
Mugi, what version of PSP are you using?



lol... dont even ask  ;D ;D
In PSP we trust.

weissvulf

  • Sr. Member
  • ****
  • Posts: 324
  • Good news! An anomaly solved the enigma.
    • View Profile
Re: PS1 tools
« Reply #19 on: February 18, 2018, 11:17:37 pm »
WHaAAAaaaAAAaaaaTTTTTtttt!!!!! :D Jasc made very good software. If it aint broke, don't fix it!
I assume you tried the TIMFMTE.8BI plugin file for older versions?