MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Pages: 1

Heihachi_73
I am the Table!
Reged: 10/29/03
Posts: 1074
Loc: Melbourne, Australia
Send PM


Got a decoding job for someone
#156526 - 07/07/08 11:14 PM Attachment: gfx.rar 80 KB (25 downloads)


For anyone who is bored, I have attached an unknown graphics/animation format which needs a bit of a look at. AFAIK all files are 8-bit images, but lack any palette info.



Mednafen
MAME Fan
Reged: 07/01/08
Posts: 9
Send PM


Re: Got a decoding job for someone new [Re: Heihachi_73]
#163624 - 09/03/08 05:19 AM


Screenshots of the graphics as they appear in the game would help immensely.



mw
MAME Fan
Reged: 01/01/07
Posts: 76
Send PM


Re: Got a decoding job for someone new [Re: Mednafen]
#163654 - 09/03/08 08:10 AM Attachment: x3.png 8 KB (5 downloads)


> Screenshots of the graphics as they appear in the game would help immensely.

A screenshot might help, but probably not immensely.

This is the ff_x3.raw file, interpreted as gray scale. It is also the first image (of 24) from the ax3.raw file after un-encoding it.

The encoding of first image of the animation seems to be a simple run-length method.

The other 23 images in the ax3.raw file and the x3.raw file seem to use a less obvious technique.

[ATTACHED IMAGE]

Attachment



Heihachi_73
I am the Table!
Reged: 10/29/03
Posts: 1074
Loc: Melbourne, Australia
Send PM


Re: Got a decoding job for someone new [Re: Mednafen]
#163766 - 09/04/08 09:04 AM


Unfortunately, there aren't any screenshots of the game itself (it was blacklisted in December last year so I can't personally get a photo of it). This hardware hasn't been emulated before

Sorry about the lack of an image in the zip (oops!). Luckily, mw posted an image in the next post! I ripped 152 images from this game so far, with only two being normal 'raw' images (the ones that even IrfanView can open).



Heihachi_73
I am the Table!
Reged: 10/29/03
Posts: 1074
Loc: Melbourne, Australia
Send PM


Re: Got a decoding job for someone new [Re: mw]
#163767 - 09/04/08 09:25 AM


As just above, there aren't any screenshots as there isn't a driver for the game yet. If anyone is interested I could help out with a few things but there isn't much info on the actual hardware itself (it's not in the PDFs on the AGEMAME forum).

Unfortunately, it's that 'less obvious' algorithm which 98% of the game uses. On the updated Indian Dreaming (MK5) game the graphics are mostly uncompressed, but the game needs to be redumped. If anyone's interested in seeing one in MAME sometime in the future, simply PM me.

Game has since been redumped and added to MAME along with a few others.

Edited by Heihachi_73 (02/22/09 05:43 PM)



mw
MAME Fan
Reged: 01/01/07
Posts: 76
Send PM


Re: Got a decoding job for someone new [Re: Heihachi_73]
#163812 - 09/04/08 09:12 PM


Some notes:

On the animated image ("ax3.raw"), all 24 frame headers seem to be 22 bytes long. The frames themselves are various lengths, the first being under 6k, the rest are all under 5k. The 21st header byte seems to be a compression type indicator, being either 15 for the simple byte based run-length encoding in frame 1, or 7 for the unknown format in frames 2-24.

Speculating that the idea is to predraw frame 1 in non-real time, then apply a faster or more computationally efficient algorithm to do the animation in real time. The CPU used may have some method to apply blocks of word-organized data quickly. The frame 2-24 data seems to be pre-fromatted, rather than compressed.

I noticed that frames 2-24 all have an even number of bytes, and there are a lot of "0"s and "FF"s in the data. The thought occurs that the data may be organized as 16-bit in those frames. I'm guessing that there is some means of indicating how many words (of the previous frame) to skip over, then another means of indicating how many words to overwrite with new data. And repeating until end of frame.

But it's not too clear what delimits the skipping and overwriting sections.

The compression in the "x3.raw" file seems to be a third type. Haven't spotted a pattern there, so far. It appears to be more densely compressed than method 1 or 2.



Mednafen
MAME Fan
Reged: 07/01/08
Posts: 9
Send PM


Re: Got a decoding job for someone new [Re: mw]
#164337 - 09/07/08 10:02 PM


> The compression in the "x3.raw" file seems to be a third type. Haven't spotted a
> pattern there, so far. It appears to be more densely compressed than method 1 or 2.

LZSS? Huffman-coded deltas(with a static table in the game's code)?



mw
MAME Fan
Reged: 01/01/07
Posts: 76
Send PM


Re: Got a decoding job for someone new [Re: Heihachi_73]
#167014 - 10/01/08 05:46 AM Attachment: S01.TXT 16 KB (12 downloads)


I think I found a pattern in the frame 2-24 data. Attached is a text file with strategic CRLFs added to show the pattern. The attachment is a hexadecimal representation of frame1, frame0 being the .png file I previously posted. See next post for animated example of all 24 frames.



mw
MAME Fan
Reged: 01/01/07
Posts: 76
Send PM


Re: Got a decoding job for someone new [Re: mw]
#167015 - 10/01/08 05:48 AM Attachment: x3_tst.gif 65 KB (5 downloads)


Animated .gif of all 24 frames.

[ATTACHED IMAGE]

Attachment



Heihachi_73
I am the Table!
Reged: 10/29/03
Posts: 1074
Loc: Melbourne, Australia
Send PM


Re: Got a decoding job for someone new [Re: mw]
#168468 - 10/16/08 07:32 PM


Whoa, haven't been here in a long time! Awesome work there!

Apparently the same compression is used on the later MK6 games too, possibly the FLIC headered animation files. If I can understand the text file a bit later I might see if I can reproduce the image, but right now it's still strange to me with the 16-bit format...



mw
MAME Fan
Reged: 01/01/07
Posts: 76
Send PM


Re: Got a decoding job for someone new [Re: Heihachi_73]
#168477 - 10/16/08 08:24 PM Attachment: S01a.TXT 17 KB (6 downloads)


Attached is a partially annotated file for the first few lines of frame1.

Did you aready work out the details of frame0, or would you like to see an annotated file for that too? It's an ordinary 8-bit rle scheme.


Quote:


If I can understand the text file a bit later I might see if I can reproduce the image, but right now it's still strange to me with the 16-bit format...





Heihachi_73
I am the Table!
Reged: 10/29/03
Posts: 1074
Loc: Melbourne, Australia
Send PM


Re: Got a decoding job for someone new [Re: mw]
#168486 - 10/16/08 10:14 PM


> Attached is a partially annotated file for the first few lines of frame1.
>
> Did you aready work out the details of frame0, or would you like to see an annotated
> file for that too? It's an ordinary 8-bit rle scheme.
>

Nah, that's fine, I was just a bit iffy about why everything was in the F0-FF range on those ones! I haven't had much time to really look at the text files, as it's very early in the morning over here (5:50am as of now). I did get the first RLE frame sorted out a while ago, but gave up on decoding the others as I didn't know what to do. Luckily, it's not needed for the emulation of this game (which is way beyond my scope alone), but it's still a bit of fun seeing it light up outside its native machine.



Heihachi_73
I am the Table!
Reged: 10/29/03
Posts: 1074
Loc: Melbourne, Australia
Send PM


Back again, with color new [Re: Heihachi_73]
#178573 - 01/23/09 07:21 PM Attachment: record1.gif 255 KB (4 downloads)


> For anyone who is bored, I have attached an unknown graphics/animation format which
> needs a bit of a look at. AFAIK all files are 8-bit images, but lack any palette
> info.

The palette used in this image is the original 8-bit color palette used in every game on the MK5 platform. It is also used less commonly in the MK6 hardware, under the name 'Legacy', where I actually found it by chance.

Sorry for asking, but would there be any chance of a small command line prog to convert/decompress each frame to raw 8-bit?

I cheated a little to get this image working (too much nerding around trying to do this by hand). A certain 'emulator' and hex editor came in handy, also proving that the 8-bit FLIC and MV anim formats are indeed the same. Note: The game itself is not emulated at all (this requires someone who is experienced in both MAME coding and ARM emulation, which I am not).

[ATTACHED IMAGE]

Attachment



Heihachi_73
I am the Table!
Reged: 10/29/03
Posts: 1074
Loc: Melbourne, Australia
Send PM


Re: Unknown compression - LZW new [Re: mw]
#182292 - 02/22/09 06:24 PM


Another update: The 'unknown' compression is standard LZW, identical to GIF files.




mw
MAME Fan
Reged: 01/01/07
Posts: 76
Send PM


Re: Got a decoding job for someone new [Re: mw]
#182802 - 02/26/09 08:11 PM Attachment: x3_pal.gif 84 KB (2 downloads)


Animated .gif w/ MK5 palette

[ATTACHED IMAGE]

Attachment



Heihachi_73
I am the Table!
Reged: 10/29/03
Posts: 1074
Loc: Melbourne, Australia
Send PM


Awesome job there, congrats! new [Re: mw]
#182819 - 02/26/09 09:10 PM


> Animated .gif w/ MK5 palette

That looks 1000 times better than my glitchy, hacked ones! I kept getting bad colours even with the modified palette already there; only two animations out of every single one I tried actually worked with the right colours, the rest looked like crap! You probably noticed a few glitches in the record one I put up earlier too, that was the emulator putting black in some areas of the graphic (the parts that had lots of leading FF's).

Edited by Heihachi_73 (02/26/09 09:19 PM)



mw
MAME Fan
Reged: 01/01/07
Posts: 76
Send PM


Re: Awesome job there, congrats! new [Re: Heihachi_73]
#182827 - 02/26/09 10:25 PM Attachment: mv2raw.zip 6 KB (3 downloads)


Here's the first step, a command line splitter written as a vb2008 console app. It splits the .MV format into individual .raw frames. I haven't yet added the decode process, as it requires an image buffer (which was more intutitive to debug in previous enviroment I was working in). The buffer is required to avoid those black spots you mentioned.

I plan on adding the decode process next, taking a break for several hours right now. Check back later, or maybe tomorrow.

> > Animated .gif w/ MK5 palette
>
> That looks 1000 times better than my glitchy, hacked ones! I kept getting bad colours
> even with the modified palette already there; only two animations out of every single
> one I tried actually worked with the right colours, the rest looked like crap! You
> probably noticed a few glitches in the record one I put up earlier too, that was the
> emulator putting black in some areas of the graphic (the parts that had lots of
> leading FF's).



mw
MAME Fan
Reged: 01/01/07
Posts: 76
Send PM


Re: Awesome job there, congrats! new [Re: mw]
#182882 - 02/27/09 07:36 AM Attachment: mv2raw.zip 9 KB (6 downloads)


Here's the next iteration. It splits a MV file into decoded 8-bit images, or optionally 24-bit images utilizing the MK5 palette.

Run the app with no parameters for usage info.


Pages: 1

MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 2 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 4764