Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Some touhou game

Get your graphics formats figures out here! Got details for others? Post here!
Post Reply
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Some touhou game

Post by finale00 »

Got a request for graphic reversal for some touhou game.
It doesn't seem to be compressed, so I went through texture finder.

And got something that I at least recognize from the franchise.

Image



Image

The file seems to be split into three parts.
First, you have the header, which is 40 bytes.
Then, there's some stuff after the header, which is unknown size.
Finally, you have what I guess is the pixel data, where the size is the 2nd integer * 3rd integer in the header.

So for example, this file is 240896 in size, which looks like a nice rounded number

Code: Select all

struct File {
   int32 header size
   int32 width
   int32 height
   ...
}

The unknown data takes up 856 bytes, where the pattern in the data then changes.
Including the header, this is the first 896 bytes of the file, followed by the other 240000 bytes for the pixel data.

There are some other files that are just plain RGB24, but the one I posted isn't.

Anyone want to give a shot?

EDIT: lol turns out it's a mahjong game. I just found some tiles
You do not have the required permissions to view the files attached to this post.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Some touhou game

Post by howfie »

Did you try a 214 color palette? Are all values after 0x380 less than D6?

Edit:
Yeah, looks like a 214 color palette. Kind of odd to use 214 lol.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Some touhou game

Post by howfie »

This is what I got...

Image
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Some touhou game

Post by finale00 »

It's probably just for that particular file. Other files have less colors in the palette.

EDIT: ya, at offset 32 that integer tells you how many colors there are.

Guess it's time to go figure out how to work with palettes in noesis.
Last edited by finale00 on Fri Jul 06, 2012 8:22 am, edited 1 time in total.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Some touhou game

Post by howfie »

lol

if noesis can save 32-bit BMP/TGA, just iterate through the pixels converting 8-bit pixel data to 32-bit pixel data using the table. i doubt rich would have anything to save images with arbitrary-length palettes.

another thing you could do is if noesis supports 256-color bitmaps is to just do that and fill whatever palette colors are leftover with zeroes.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Some touhou game

Post by finale00 »

Ya I think there was something about creating a palette of some size and then passing in the color map down and out pops an rgba image.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Some touhou game

Post by finale00 »

Alright got it working in noesis. Just had to call imageDecodeRawPal and pass in the map and the palette.
Though, some of the colors seem to be off.

Script: http://db.tt/F5m2QCf7

Image Image

Some images seem kind of weird as well.
It's the same character, but a cropped version (probably for message windows and stuff.

Image

They have the palette, but there seems to be more indices in the map than there are pixels in the actual image (numBytes > width * height)

I can't come up with what the issue might be. I tried doing some random offsetting into the data but it didn't do anything.

I can't come up with a way to visually "reconstruct" the image in my head either lol it's like the image was tilted on its side and then chopped into pieces.
You do not have the required permissions to view the files attached to this post.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Some touhou game

Post by howfie »

image is 150 x 154... probably a pitch thing. does noesis have a data-alignment parameter?
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Some touhou game

Post by howfie »

yeah, works fine for me...

Image

Actual data starts at 0x3E8. Pitch is 32-bit aligned. I don't think TGA uses data alignment. I don't know what you're saving to, but you should be either saving to DDS or BMP.

To test, you can use MSPAINT. Create a blank 150 x 154 image in MSPAINT. Save as 256 color bitmap. Load in hex editor. At offset 0x36, delete the next 0x400 bytes (the default color table). Paste in your own 0x3?? + padding (to make 0x400 bytes) color table. Then at 0x436, delete everything from there to the end. Paste in the color data from dat file.

BTW, the other image is like that. Swizzled in some kind of way maybe? Not sure.
Post Reply