RleCodec

object RleCodec

RLE (Run-Length Encoding) codec for Nintendo DS compressed files.

Format (from Nintendo_DS_Compressors reference):

  • Magic byte: 0x30

  • Header (4 bytes): 0x30, sizeLo, sizeMid, sizeHi (24-bit little-endian uncompressed size)

  • Body: sequence of flag+data blocks

    • Flag MSB = 0 -> literal block: copy next (flag & 0x7F) + 1 bytes verbatim

    • Flag MSB = 1 -> run block: repeat next byte (flag & 0x7F) + 3 times

Functions

Link copied to clipboard

Compresses input using the Nintendo DS RLE format.

Link copied to clipboard

Decompresses an RLE-encoded Nintendo DS buffer.