What's new

Extracting palette from Tomb Raider 1 (PSX)

sb iq

New member
I am trying to extract the palette from Tomb Raider 1 for the PlayStation, but I'm not sure where to begin. Using Peops soft GPU with epsxe, I took a snapshot of what was in the VRAM. The snapshot is below, but I had to convert it into .png so it would load on the board faster and Photobucket shrank it to 800 x 600.

tr1vram.png


I am guessing the palette is the stuff I have boxed in green spray paint in the picture below:

possiblepalette.png


Am I correct in my reasoning?

And would my palette be 768 bytes or some strange larger number?

I am assuming the "rainbow lines" at the bottom of the block I surrounded with green spray paint is the end of the palette (if that really is the palette).

However, I am having trouble trying to figure out the ending hex address of my "palette".

Using Tile Molester I was able to figure out that it begins at hex address 0009E978 but I am having serious trouble finding the ending address.

I found the beginning address by opening the file GYM.PSX and viewing it using the 16 bpp ABGR codec in 2-Dimensional mode. I scrolled down until I could see my "palette".

I then switched to 8bpp linear and went down line by line by going 128 bytes relative to where I was. I found that my "palette" begins around 0009E900 but the first dot was all the way to the right, so I shifted left 120 times. Every time I shifted left I added how many shifts I made to the hex address where I was. Of course when I was finished shifting I would then close the file and not save it, because it has been my experience that whenever I shift stuff Tile Molester does something weird to the file and puts the data out of place.

So 0009E900 is 649472 in decimal.

649472+120=649592

649592 is 0009E978 in hex.

"palette" begins at: 0009E978

I thought I could use that same logic in finding the hex address where my "palette" ends but I was wrong (in this case I went down line by line until I could no longer see the "rainbow lines").

I THOUGHT the "palette" ended at 000A1778. So I opened up GYM.PSX in Hex Workshop, went to Edit --> Goto and selected Hex and Beginning of File and entered in 0009E978. I then went to Edit --> Select Block and selected Hex and Ending Position and entered in 000A1778. I copied and pasted my selection into a blank file, saved the blank file, and opened it in Tile Molester using the 16 bpp ABGR codec in 2-Dimensional mode. Everything seemed fine, except that my "rainbow lines" aren't there!

So today I copied and pasted the “rainbow lines” into temporary separate files including extra zeros (due to blank space left behind by Tile Molester). Whenever I copy something, I make sure I copy it into a new blank file that uses the same codec I am using at the time.

I view the data using the 16 bpp ABGR and 8bpp linear codecs and the “rainbow lines” appear along with the black space left behind by Tile Molester. But after I remove the extra zeros the “rainbow lines” disappear. However, their bits of data can be seen in a hex editor.

What's up with that?

Can anyone find the ending hex address and teach me how they did it? I'm willing to send the file if need be.
 
Last edited:

Top