Sonic and Sega Retro Message Board: UFTC compression/decompression tool - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

UFTC compression/decompression tool Real-time decompression for sprites!

#1 User is offline Sik 

Posted 26 April 2011 - 12:32 PM

  • Sik is pronounced as "seek", not as "sick".
  • Posts: 6719
  • Joined: 17-March 06
  • Gender:Male
  • Project:being an asshole =P
  • Wiki edits:11
http://www.fileden.com/files/2006/12/22/543510/uftc.7z

I should go and update the SLZ tools (and actually go make XSLZ...). In the meanwhile, here goes another compression format: UFTC. This format is meant to compress entire sprite animations (e.g. all player sprites, all sprites of an enemy, etc.), while still being able to decompress them in real-time as the game is running. It does so by splitting tiles into 4x4 pixel "blocks" and then just storing IDs that point to data in a dictionary.

Compression ratio? Didn't really try that out yet, though it depends heavily on how much redundancy is in the animations really. Decompression speed (on the MD) is pretty good: decompressing 16 tiles takes up about 10 scanlines (around 3.82% of a frame in NTSC). The idea of this format was to be able to stream sprites from the cartridge while still being able to do some compression. Useful if you have, for example, lots of sprites for the player and want to reduce space usage somewhat.

So, who wants to try?

EDIT: fixed some stupid issue in the makefile... I hope. Apparently make isn't as smart as I thought.

EDIT 2: derp fixed stupid bug in the decompressor side of the tool, redownload please.
This post has been edited by Sik: 27 April 2011 - 12:38 PM

#2 User is offline FraGag 

Posted 28 April 2011 - 11:54 PM

  • Posts: 659
  • Joined: 09-January 08
  • Gender:Male
  • Location:Québec, Canada
  • Project:an assembler
  • Wiki edits:6
Sonic 1 using UFTC for Sonic's graphics

The uncompressed graphics are 41,248 bytes, and 34,362 bytes after compression. It's not a lot, but someone who would like to make a sprite sheet with smoother animations could see a better compression ratio (as long as the dictionary fits in less than 32,768 bytes; the dictionary in Sonic's art takes 24,048 bytes).

I altered the decompression routine slightly, because using d7 was impractical in the context where it's used (d7 is the counter for the object loop). Also, I removed the bra.s @LoopEnd before the first iteration, because the DPLCs specify the number of tiles minus 1 already.

Also, I fixed the SEGA sound as per the guide on the wiki, otherwise the game would crash in Regen. Speaking of Regen, its debugging tools were very helpful in the (short) development of this hack. v.png

Bonus: uftc.exe

#3 User is offline Sik 

Posted 29 April 2011 - 03:43 AM

  • Sik is pronounced as "seek", not as "sick".
  • Posts: 6719
  • Joined: 17-March 06
  • Gender:Male
  • Project:being an asshole =P
  • Wiki edits:11
Sonic games already arrange Sonic sprites to avoid redundance though (I.e. some tiles are shared among sprites), so that makes UFTC kind of useless in that context. I guess it's something though.

#4 User is offline FraGag 

Posted 29 April 2011 - 07:35 PM

  • Posts: 659
  • Joined: 09-January 08
  • Gender:Male
  • Location:Québec, Canada
  • Project:an assembler
  • Wiki edits:6
QUOTE (Sik @ Apr 29 2011, 04:43 AM)
Sonic games already arrange Sonic sprites to avoid redundance though (I.e. some tiles are shared among sprites), so that makes UFTC kind of useless in that context. I guess it's something though.

Right. Somebody importing a sprite sheet without bothering to optimize it would benefit more from this.

#5 User is offline Sik 

Posted 01 May 2011 - 07:50 AM

  • Sik is pronounced as "seek", not as "sick".
  • Posts: 6719
  • Joined: 17-March 06
  • Gender:Male
  • Project:being an asshole =P
  • Wiki edits:11
Updated 68000 decompressor on request of FraGag who insisted that I should be using movem =P

EDIT: turns out it's slower FFFFFFFFFFFFFFF reuploading old code, sorry.
This post has been edited by Sik: 01 May 2011 - 08:59 AM

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users