The World's Best Compression Ever?

Discussion in 'NDS - ROM Hacking and Translations' started by Blazer, Jun 30, 2009.

Jun 30, 2009
  1. Blazer
    OP

    Member Blazer GBAtemp Regular

    Joined:
    Aug 10, 2008
    Messages:
    280
    Country:
    United States
    So I'm hacking Fire Emblem DS and I've come across a compression labeled as "The World's Best Compression Ever! (run length encoding! But only if the run is one of zeros!)". I'm not sure if this is actually what it's called, but that's what somebody else called it.

    Pretty much I have a program that can decompress specific files that use this compression but it doesn't help because I need to get some information on the actual compression itself.

    00000000 40 00 66 00 1F 74 7C 73-22 08 85 14 C7 1C A5 18 @.f..t|s".......
    00000010 A7 28 B5 5A 2A 29 E8 20-64 24 84 18 63 10 84 10 .(.Z*). d$..c...
    00000020 E7 20 8C 39 63 20 6A 45-63 1C 63 18 E6 2C A5 1C . .9c jEc.c..,..

    Copy/paste from a hex editor, the header is 4 bytes, ALWAYS starts with 0x40, the next two bytes is the size of the decompressed file but reversed order (so in this case, the size is 0x6600). After that is a 00 and then all the other data.

    I was wondering if anybody knew anything about this compression or a compression that might be similar to this. According to the person who made the program (who I can't contact, btw) the first 512 bytes are the palette and then comes the graphic data.

    There's a palette that's very likely to use the exact same colors as this palette-- I happened to have the hex of that palette and thought it might come in handy in finding out how the compression works.

    Code:
    00000000ÂÂ1F 7C 6F 35 E8 20 65 1C-63 24 42 14 4A 35 08 29ÂÂ.|o5. e.c$B.J5.)
    00000010ÂÂ84 14 A5 18 F7 66 A4 30-C5 30 A4 28 C5 2C E6 30ÂÂ.....f.0.0.(.,.0
    00000020ÂÂ62 1C 83 24 C5 28 E6 2C-C4 34 47 55 E5 38 83 20ÂÂb..$.(.,.4GU.8. 
    00000030ÂÂ48 45 A3 30 62 18 C4 30-E5 34 68 51 89 59 A4 20ÂÂHE.0b..0.4hQ.Y. 
    00000040ÂÂC5 24 CD 45 26 49 47 4D-83 1C 68 4D 06 39 AA 59ÂÂ.$.E&IGM..hM.9.Y
    00000050ÂÂ27 3D EC 5D 82 24 C4 2C-E5 30 89 51 06 35 AA 55ÂÂ'=.].$.,.0.Q.5.U
    00000060ÂÂ26 41 47 45 EB 61 82 20-E4 34 A3 24 05 39 C4 28ÂÂ&AGE.a. .4.$.9.(
    00000070ÂÂ2D 66 E4 30 E5 28 C3 28-E4 2C EA 55 E6 20 66 41ÂÂ-f.0.(.(.,.U. fA
    00000080ÂÂA8 49 49 2D 05 2D 02 35-C3 20 86 41 45 35 89 39ÂÂ.II-.-.5. .AE5.9
    00000090ÂÂE4 1C 62 0C A7 2D 49 25-E5 10 D3 36 07 11 E7 14ÂÂ..b..-I%...6....
    000000A0ÂÂCE 31 9E 47 B6 3E 12 2E-77 32 DB 3A D9 46 35 2EÂÂ.1.G.>..w2.:.F5.
    000000B0ÂÂ54 3E 99 36 3D 53 85 0C-09 1D 36 32 78 3A FD 46ÂÂT>.6=S....62x:.F
    000000C0ÂÂ99 3E BA 42 56 3A 1D 4F-DA 4A 34 3A FB 4E 8E 29ÂÂ.>.BV:.O.J4:.N.)
    000000D0ÂÂD9 4E 2A 21 96 4A 4B 25-6D 25 6C 29 9A 3E DC 46ÂÂ.N*!.JK%m%l).>.F
    000000E0ÂÂDB 4A 3E 57 D2 2D 14 36-B9 4A DA 4E 99 46 D1 31ÂÂ.J>W.-.6.J.N.F.1
    000000F0ÂÂFA 56 12 3E 64 0C A6 14-09 21 6B 2D C6 18 00 00ÂÂ.V.>d....!k-....
    00000100ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    00000110ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    00000120ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    00000130ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    00000140ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    00000150ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    00000160ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    00000170ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    00000180ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    00000190ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    000001A0ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    000001B0ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    000001C0ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    000001D0ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    000001E0ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    000001F0ÂÂ00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00ÂÂ................
    Well, hey, the bytes 0x1F are in common, that means something, right? [​IMG]

    Thanks to anyone if they can help me, and even a list of compressions that are out there might be useful so I can look around and see if this is one of them. [​IMG]
     
  2. DarthNemesis

    Member DarthNemesis GBAtemp Maniac

    Joined:
    Feb 19, 2008
    Messages:
    1,208
    Country:
    United States
  3. Blazer
    OP

    Member Blazer GBAtemp Regular

    Joined:
    Aug 10, 2008
    Messages:
    280
    Country:
    United States
    So you're saying... it's just some header and then run-length encoding the rest of the way, but it only 'applies' RLE if it's a run of 00's, and not anything else. Anywhere I can get something to decompress RLE? [​IMG]
     
  4. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,719
    Country:
    United Kingdom

Share This Page