SonAni2Gif

Discussion in 'Approved' started by MainMemory, Apr 6, 2012.

  1. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    860
    [​IMG]


    [​IMG]


    Download


    OK so here's how you use this:


    On the left click the Add button to load an art file (a dialog will ask the compression type). The rest of the stuff is changing the order art files are used in and what address it's loaded at, allowing you to create a virtual VRAM space. The bottom of the form allows you to view the loaded tiles (you can scroll through it with arrow keys).


    Click "Import Palette" to load a palette file and tell it what offset to load it at. Do this as many times as you need.Then in the File menu, you can load Mappings, DPLC and Animations. Each item will have a check mark when it is loaded. For all three, you can specify Binary or ASM and a starting address or label.


    For mappings, you can choose the game and the starting palette line.


    For DPLCs, you can choose the game. Note that S3K's player objects use S2 format, while other objects use a different format.


    On the right you can select an animation, with labels if you loaded ASM mappings, or hex offsets otherwise, and then click "GIF Export".


    Animations which have the speed value set to $FD, $FE or $FF will use a value of 4 instead.


    Animations which are set to loop indefinitely ($FF) will produce infinitely looping GIFs. Animations which jump back a number of frames ($FE) will be split into _intro and _loop GIFs. Animations which change to a different animation ($FD) will go through each animation until it finds a non-FD animation, then it will stop; if the last animation ends with $FE it will be split into _intro and _loop GIFs. All other types will play once, then stop.


    KNOWN BUG: The two pixels on the bottom right are always black. I have no explanation for this.
     
    Last edited by a moderator: May 6, 2012
  2. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    That's just great.Any chance to have an option to export entire sprite sheet rather than animations?
     
  3. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    860
  4. Crash

    Crash Well-Known Member Member

    Joined:
    Jul 15, 2010
    Messages:
    302
    Location:
    Australia
    Cool, I assume this is the vestigial remains of the mappings editor you were talking about on retro?
     
  5. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    860
    The idea yes. The UI, no. The UI for this is actually based on an unreleased "VRAM emulator", which allows you to load multiple art files and see how they fit together in VRAM. And then there's some stuff from SonLVL for mappings and DPLCs. But nothing from SonSpr, because I didn't actually do anything with it other than copy a bunch of stuff from SonLVL. :x


    Edit: I've updated it to change the handling of $FE animations: it now produces _intro and _loop GIFs.


    [​IMG]
     
    Last edited by a moderator: May 6, 2012
  6. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    860
    Another update, now frame values from $80 to $EF are usable.
     
  7. redhotsonic

    redhotsonic Also known as RHS Retired Staff

    Joined:
    Aug 10, 2007
    Messages:
    2,967
    Location:
    England
    [​IMG]Cool, it works for my Sonic "standing".I tried using it for other objects, like my purple badnik, but the palette seems to fail. I loaded MTZ art, the purple badnik's mappings, and MTZ palette. The palette wouldn't load correctly, even if I used offset $20 (for palette line 2, I tried $0 and $40 but didn't work either). I then ripped the palette line using a hex editor to a new bin file so it only has that palette line.The palette seems to load now (the tiles look right), but when I exported the gif, it still came out wrong:[​IMG]When it's meant to look like this:[​IMG][​IMG]The palette looks okay to me hereIs this a bug or have I gone wrong? =P
     
  8. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    860
    If your mappings start at line 0, but use line 1, you have to load the palette at index $10.
     
  9. Pokepunch

    Pokepunch That guy who posts on occasion Member

    Joined:
    Aug 7, 2009
    Messages:
    269
    Location:
    UK
    Yep works great [​IMG]
     
  10. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    860
    A bugfix, and a new feature: S3K objects with DPLCs now display properly, and rather than simply rounding the frame delay to the nearest centisecond, it keeps track of the fractional remainder and adds one to the delay when it reaches one.