Author
|
Topic: Ripping graphics from a PS2 game (Read 705 times)
|
Darkslime
Guest
|
|
« on: November 26, 2007, 11:25:05 am » |
|
Namco X Capcom, to be specific. (PSicture didn't work, obviously.) I located all the pictures in the BUST.FAC file; the normal pictures are 256x256, and are 8bpp. The palette data before it is 32bpp and lasts for 1024 bytes, allowing for the 256 colors used in the picture. However, this is what I got when I plugged the palette into Tile Molester... http://img.photobucket.com/albums/v167/Darkslime/annoying.png...which is quite obviously not correct. Actually, the 32bpp format that Tile Molester comes with was backwards, and this is using a mask that reverses the bytes for red and blue. Needless to say, the original looked blue. But this isn't right. What exactly am I doing, or, not doing? I'm also not sure what that fourth byte does in this palette. I tried using an alpha mask but there was no difference. :/
|
|
|
|
creaothceann
Guest
|
|
« Reply #1 on: November 26, 2007, 04:55:12 pm » |
|
(Small wording nitpick: palette colors are at most 24 bpp in most cases, but the palette entries might be aligned at 4-byte boundaries.)
Looks like your start offset is off by -(256 * 5) = -1280 bytes.
Alpha masks are usually part of the image data, not the palette. Otherwise you'd get different opacities for all pixels of a color, not just specific pixels. The 4th byte is usually just there to speed up the access to the data in question: mul/div 4 is fast since it can be done with bitshifting.
|
|
|
|
Darkslime
Guest
|
|
« Reply #2 on: November 26, 2007, 08:26:39 pm » |
|
Ah, thank you for the information on the color palettes. That fourth byte there is totally useless, then.
But, which offset is off? I have the palette starting at 0x100, and the picture starting at 0x500, yet...
|
|
|
|
creaothceann
Guest
|
|
« Reply #3 on: November 26, 2007, 08:34:12 pm » |
|
The picture data. (The palette is obviously alright.)
You need to add 1280 to your current offset to skip over the "garbage" lines.
|
|
|
|
Darkslime
Guest
|
|
« Reply #4 on: November 26, 2007, 08:42:11 pm » |
|
Sorry if I'm a little confused. :X The "garbage" lines are the 5 rows of nonsense at the top of that pic, right? The palette? (The first row is actually header stuff, the other four are the palette itself)
If that's so, why would changing the offset you're viewing in the program have any affect on what colors it assigns?
|
|
|
|
creaothceann
Guest
|
|
« Reply #5 on: November 27, 2007, 09:32:32 am » |
|
How are you accessing the file? With a hex editor / your own program / Tile Molester? (I've been assuming that you're using a program that you've written yourself.)
If you're using Tile molester then you'll have to extract the 256 x 256 bytes at offset $0500, and load that instead of BUST.FAC. Then apply the palette to it.
|
|
|
|
Darkslime
Guest
|
|
« Reply #6 on: November 27, 2007, 12:07:12 pm » |
|
Actually yeah, I'm using Tile Molester. I split it up into two files - one with the palette data, and one with the picture data. Unfortunately, Tile Molester doesn't seem to want to let me use the palette from the palette data file in the picture data file.
|
|
|
|
creaothceann
Guest
|
|
« Reply #7 on: November 27, 2007, 02:23:08 pm » |
|
Can't you just use "Palette - import from - another file"?
|
|
|
|
Darkslime
Guest
|
|
« Reply #8 on: November 27, 2007, 06:09:11 pm » |
|
It only lets you import savestate files. :/
EDIT-- Actually, I just tried GGD with those two files; it can load the palette from the separate file. However, I still get the same exact color weirdness, even when the palette data itself is totally separate from the picture...
|
|
« Last Edit: November 27, 2007, 06:30:05 pm by Darkslime »
|
|
|
|
creaothceann
Guest
|
|
« Reply #9 on: November 28, 2007, 10:22:06 pm » |
|
Could you send me the file "BUST.FAC" (via rapidshare or the like) ?
|
|
|
|
Ryusui
Guest
|
|
« Reply #10 on: November 28, 2007, 11:27:00 pm » |
|
It only lets you import savestate files. :/
There's a way to fudge it. Copy the palette data into some blank space in the file you're trying to view/edit, then use Tile Molester's function for loading palette data from the file itself to load the palette data. I used this trick when inserting my title screen data in the GBA Sylvanian Families games.
|
|
|
|
Darkslime
Guest
|
|
« Reply #11 on: November 29, 2007, 11:14:17 am » |
|
Ryusui, the palette data started out in the same file as the pictures, but apparently, that's the problem... I have no idea what's going on. creaothceann, I'm uploading the file now, I'll PM you with the link to it.
|
|
|
|
creaothceann
Guest
|
|
« Reply #12 on: November 29, 2007, 04:06:28 pm » |
|
Thanks, I'll take a look at it. EDIT: This is what I've found out so far: - there are 921 image structures in the file - each one has a header (256 bytes) + a palette (256 * 4 bytes) + image data (256 * 256 or 512 * 256 bytes) + empty space (768 bytes) - if header byte 160 = 9 then the image width is 512, else 256 - the image height is always 256 - there are some rotated images, but I don't know which header bit indicates the rotation, or if there's even one - each palette entry is 4 bytes: R, G, B, and a value of unknown purpose BUST_FAC_reader.rarThe 4th palette entry byte is either a garbage value, or it's used to adjust the color. It's possible that the palettes are stored in another file.
|
|
« Last Edit: November 30, 2007, 12:33:05 am by creaothceann »
|
|
|
|
saito
Guest
|
|
« Reply #13 on: November 30, 2007, 04:03:43 pm » |
|
Thanks for the tool,I will save up with the other's nxc tools.Btw,I've had some problems while testing it,some Delphi's bpl files were missing (at least on xp),here's the link: Download the filesPlace these files in the same directory as "BUST_FAC.exe"
|
|
|
|
creaothceann
Guest
|
|
« Reply #14 on: November 30, 2007, 05:17:40 pm » |
|
Oh yeah, forgot about those... I mentioned them here on this board before; you can get them also from the vSNES website via this link.
|
|
|
|
|