Page 1 of 1

Exporting sprites

Posted: Sun Mar 07, 2010 6:28 pm
by saf
I'm hacking snes9x code to detect objects on screen and (maybe) react to them - you can imagine something like simple game autopilot.

It's not difficult to extract bacground layers 1-4, but I got stuck with sprites. I can easily extract whole layer with sprites, but I'd like to get the sprites separted and complete - if sprite A is partially hiddden behind sprite B, I'd like to have two pixmaps, one for B, second for full uncovered A.

I'm looking at DrawOBJS(), but I got lost in tile.cpp to locate the sprite pixels being drawn :(. I don't care if the sprite is not resized correctly or if the sprite is not flipped, I just need the pixels. I found sprite positions in PPU.OBJ[] and it seems that GET_CACHED_TILE() macro is way to go. I am just not able to put it together. What is 'pCache' in GET_CACHED_TILE pointing at? Is it the pixmap? Or how to convert it to one?

Dirty hacks allowed ;)