Users browsing this thread: 4 Guest(s)
Solution: easy sprite ripping with snes9x
#1
Hi there,

I've found a way to easily rip sprites with snes9x.
Old topics like this have no satisfactory solution, so I'll share mine:
Code:
diff --git a/gfx.cpp b/gfx.cpp
index 0937852..5ec4e37 100644
--- a/gfx.cpp
+++ b/gfx.cpp
@@ -555,8 +555,8 @@ static inline void RenderScreen (bool8 sub)
        BG.NameSelect = 0;
        S9xSelectTileRenderers(PPU.BGMode, sub, FALSE);
 
-       #define DO_BG(n, pal, depth, hires, offset, Zh, Zl, voffoff) \
-               if (BGActive & (1 << n)) \
+       #define DO_BG(n, pal, depth, hires, offset, Zh, Zl, voffoff)
+       /*      if (BGActive & (1 << n)) \
                { \
                        BG.StartPalette = pal; \
                        BG.EnableMath = !sub && (Memory.FillRAM[0x2131] & (1 << n)); \
@@ -581,7 +581,7 @@ static inline void RenderScreen (bool8 sub)
                                else \
                                        DrawBackground(n, D + Zh, D + Zl); \
                        } \
-               }
+               }*/
 
        switch (PPU.BGMode)
        {
diff --git a/tile.cpp b/tile.cpp
index 12ad627..423bedb 100644
--- a/tile.cpp
+++ b/tile.cpp
@@ -984,7 +984,7 @@ void S9xSelectTileConverter (int depth, bool8 hires, bool8 sub, bool8 mosaic)
 #define NO_INTERLACE   1
 #define Z1                             1
 #define Z2                             1
-#define Pix                            0
+#define Pix                            13
 
 #define DRAW_TILE() \
        register uint32 l, x; \

What this patch does basically is change the default backdrop pixel of snes9x to a custom palette color (13 in this case). You may need to change it to another color to get a better fit, just make sure you're not overflowing the palette index.

You can see the commit here on my fork of snes9x: https://github.com/neagix/snes9x-rpi/com...03ebd7fbfd

This allows to easily isolate sprites and automate dumping their animations.
Reply
Thanked by:
#2
- In which file/location should I copy this code?
- How can I trigger it to dump the sprites?
[Image: dariC.png][Image: tumblr_mlf109xOe81rmu6i5o1_250.gif][Image: b0KxM.gif]
Reply
Thanked by:
#3
(05-27-2016, 05:03 PM)Davy Jones Wrote: - In which file/location should I copy this code?
- How can I trigger it to dump the sprites?

It's not *that* easy. In order to use this, you should know how to compile a C++ project (snes9x) and then dump the frames out. As I said it's possible to automate it.
Reply
Thanked by:


Forum Jump: