display-name: "Games/Dig It!"
meta: {"Working": ["Packed file extraction", "Graphics"], "Thanks to": "Frenkel Smeijers"}

if (file.name like "*.xrs")
{
	unsigned16 file-count
	data-start: (file-count * 32) + 2

	package-name: file.name

	file [file-count]
	{
		dirty-string(12) name
		unsigned32 adjusted-offset
		offset: adjusted-offset + data-start
		unsigned32 size
		data(11) unknown
	}
}

if (file.name like "*.pal")
{
	palette
	{
		format: "R6G6B6"
		size: 256
	}
}

if (file.name like "*.txt")
{
	text
}

if (file.name like "*.smp")
{
	sound
	{
		channels: 1
		samples-per-second: 16000 //Not sure if this is exact
		bits-per-sample: 8
		sound-signed: true
	}
}

if (file.name like ["*.ani", "*.mpf", "*.spf"])
{
	unsigned8 frames
	unsigned8 unknown
	frames = frames + 1
	unsigned16 unknown

	palette
	{
		size: 256
		format: "R6G6B6"
	}

	fuzzy-skip: true
	
	if (file.name like "*.spf")
	{
		transparent-index: 0
	}

	compressed [file.remaining-bytes] "pixelpainter-spr"
	{
		image
		{
			format: "I8"
			width: 320
			height: 200 * frames
		}
	}
}

