+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Extracting palette from Tomb Raider 1 (PSX).
Pages: [1]
Author Topic: Extracting palette from Tomb Raider 1 (PSX).  (Read 322 times)
sb iq
Guest
« on: July 28, 2007, 09:10:23 pm »

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.



A while back I was able to find Tomb Raider 2's palette with Gemini's help.

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



Am I correct in my reasoning?

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

Also, does TR2 have the same palette as TR1? I ask this because I have already extracted the TR2 palette, and if by some chance TR2 uses the same palette as TR1 that would save me a lot of extra work.
« Last Edit: July 28, 2007, 09:17:53 pm by sb iq »
creaothceann
Guest
« Reply #1 on: July 29, 2007, 05:02:34 am »

Quote from: sb  iq on July 28, 2007, 09:10:23 pm
A while back I was able to find Tomb Raider 2's palette with Gemini's help.

But can you use that palette to view the other data?


Quote from: sb  iq on July 28, 2007, 09:10:23 pm
Also, does TR2 have the same palette as TR1? I ask this because I have already extracted the TR2 palette, and if by some chance TR2 uses the same palette as TR1 that would save me a lot of extra work.

If you have a viewer then you could just try.
sb iq
Guest
« Reply #2 on: July 29, 2007, 04:12:22 pm »

I ask because I am going on an uneducated assumption that what I see in that snapshot is the palette.

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 TM using the 16 bpp ABGR codec in 2-Dimensional mode. Everything seemed fine, except that my "rainbow lines" aren't there!

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

EDIT: Now that I think about it, I used this same logic to extract my TR2 "palette". The "palette" I extracted from TR2 probably isn't right, either.
« Last Edit: July 29, 2007, 08:02:06 pm by sb iq »
sb iq
Guest
« Reply #3 on: July 31, 2007, 04:06:44 pm »

Today I copied and pasted the “rainbow lines” into temporary separate files including extra zeros (due to blank space left behind by TM). 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 TM. 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?
« Last Edit: July 31, 2007, 04:40:52 pm by sb iq »
creaothceann
Guest
« Reply #4 on: July 31, 2007, 04:42:16 pm »

To be honest, I don't think you'll get much further with these methods (e.g. hex editors and image editing programs).

You need to learn more about the PSX hardware. I'd also suggest writin your own tools, which will make the learning process much easier.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC