We just released a Feb. 5 '89 prototype of DuckTales for the NES!
If you'd like to support our preservation efforts (and this wasn't cheap), please consider donating or supporting us on Patreon. Thank you!

Data:Lumines II

From The Cutting Room Floor
Jump to navigation Jump to search

This page contains info on data for the game Lumines II.


The Compression Method (Lumines-Type Pseudo-RLE)

Most graphic and text files in this game are compressed with a seemingly unique method to several Lumines games, which include Lumines II, Lumines LIVE! and Lumines: Puzzle Fusion (Windows). Here is an explanation on how it works and how to decompress it.

Beginning of the File

At the beginning of a compressed file, there are three headers, taking 4 bytes each. In Lumines II and Lumines: Puzzle Fusion (Windows), these are in little endian, but in Lumines LIVE!, they are in big endian. The examples below are on little endian for consistency.
The first header is the uncompressed size. The second header is the compressed size, excluding the headers. The third header is a flag, widely used in the compressed data.
Example: 20 5A 02 00 4A D7 00 00 FE 00 00 00

Red: Uncompressed Size
Green: Compressed Size
Yellow: Flag

The flag header seen here will be used as an example in the next sections.

Compressed Data

After the headers, the "key" byte can be seen multiple times. It is some sort of rewind/replace command.

Type 1: Byte 3 of a smaller value than Byte 2

Example: 00 01 02 03 04 FE 05 04

Yellow: Flag
Blue: Bytes to rewind (Byte 2)
Pink: Bytes in the "rewinded" area to copy (Byte 3)
Dark purple area: Bytes to be copied

Output: 00 01 02 03 04 00 01 02 03

Type 2: Byte 3 of an equal value than Byte 2

Example: 05 04 03 02 FE 04 04

Yellow: Flag
Blue: Bytes to rewind (Byte 2)
Pink: Bytes in the "rewinded" area to copy (Byte 3)
Dark purple area: Bytes to be copied

Output: 05 04 03 02 05 04 03 02

Type 3: Byte 3 of a higher value than Byte 2

Example: 74 63 72 66 FE 04 0C

Yellow: Flag
Blue: Bytes to rewind (Byte 2)
Pink: Bytes in the "rewinded" area to copy (Byte 3)
Dark purple area: Bytes to be copied

Output: 74 63 72 66 74 63 72 66 74 63 72 66 74 63 72 66

Observations

Flag Value

The flag byte's value can be any. Most of the times, it is the value of a byte that does not appear many times in the uncompressed file.

Maximum Bytes 2 and 3 Values

The maximum values for Bytes 2 and 3 is FF, which means it is possible to "rewind" and "copy" up to 255 bytes.

Two Flag Bytes in a Row

If the flag byte appears twice in a row, these bytes don't act as flags. One of them can be removed, but the determination of whether it should or not be removed is random.

Example: EF FE FE EF

Red: Not flag

Flag Byte in Byte 3

If the flag byte appears in "Byte 3", when a different flag has already started, it should not be counted as one.

Example: FE 01 FE 10 0C

Yellow: Flag
Blue: Bytes to rewind (Byte 2)
Red: Bytes in the "rewinded" area to copy (Byte 3); Not flag