Idea for new JPC-RR dumpformat:

All numbers are big-endian.

BYTE is 1 byte, WORD is 2, DWORD is 4, QWORD is 8.

VARIABLE has bit 7 set for all but the last byte, and only 7 low bits in each
byte contribute. Thus e.g. 130 is encoded as 0x81 0x02.

Dump is split into one or more chapters, just concatenated one after another.
Timecodes in first chapter start from 0 and in each subsequent chapter they start
from last timecode of previous chapter.


The structure of each chapter:
------------------------------
Offset:		Length:		Description:
0		16		Magic: FFFFh JPCRRMULTIDUMP
16		2		Number of streams (WORD). Must be nonzero.
18		?		Stream header table (consists of stream header elements)
?		?		Data table (consists of data elements and special elements)

Stream header element structure:
--------------------------------
Offset:		Length:		Description:
0		2		Channel number (WORD, FFFFh is reserved an MUST NOT be used)
				All stream numbers must be unique within chapter.
2		2		Stream type.
				0x0000:		Video
				0x0001:		PCM audio
				0x0002:		FM audio
				0x0003:		Dummy
				0x0004:		Subtitle
				0x0005:		Runinfo
4		2		Stream name length in bytes (0 if no name).
6		?		Stream name (UTF-8).

Special element (time skip):
----------------------------
Offset:		Length:		Description:
0		6		Magic: FFFFFFFFFFFFh

Signals that no events occur in 2^32-1 ns. Last known timestamp is updated.

Data elemement:
---------------
Offset:		Length:		Description:
0		2		Stream number. WORD, FFFFh MUST NOT be used.
2		4		Time in nanoseconds (DWORD) relative to last timestamp.
6		1		Event subtype
7		?		Event payload data size (not counting any headers, VARIABLE).
?		?		Event payload data.

Payload for stream type 0 subtype 0/1 (video frame):
----------------------------------------------------
Offset:		Length:		Description:
0		2		Frame width (WORD)
2		2		Frame height (WORD)
4		?		If subtype is 0, Raw RGBx video data.
				If subtype is 1, zlib-compressed Raw RGBx video data.

Payload for stream type 1/2 subtype 0 (audio volume):
-----------------------------------------------------
Offset:		Length:		Description:
0		4		Left channel volume numerator (DWORD)
4		4		Left channel volume denumerator (DWORD)
8		4		Right channel volume numerator (DWORD)
12		4		Right channel volume denumerator (DWORD)

Payload for stream type 1 subtype 1 (PCM sample):
-------------------------------------------------
Offset:		Length:		Description:
0		2		Left sample (signed WORD).
2		2		Right sample (signed WORD).

Payload for stream type 2 subtype 1/2 (FM write):
-------------------------------------------------
Offset:		Length:		Description:
0		1		Low byte of register number (BYTE). The bit 8 of register number is clear if
				subtype is 1, set if subtype is 2.
1		1		Data to write.


Payload for stream type 2 subtype 3 (Reset):
--------------------------------------------
No data.

Payload for stream type 3 (dummy):
----------------------------------
Ignored.

Payload for stream type 4 subtype 0 (Subtitle):
-----------------------------------------------
Offset:		Length:		Description:
0		8		Length of subtitle display in ns (QWORD).
8		?		UTF-8 encoded subtitle text.

Payload for stream type 5 subtype 71 (Game name):
-------------------------------------------------
Offset:		Length:		Description:
0		?		UTF-8 encoded game name.

Payload for stream type 5 subtype 65 (Authors):
-----------------------------------------------
Offset:		Length:		Description:
0		?		UTF-8 encoded authors string.

Payload for stream type 5 subtype 76 (Length):
-----------------------------------------------
Offset:		Length:		Description:
0		8		Length of movie in ns (QWORD).

Payload for stream type 5 subtype 82 (Rerecords):
-------------------------------------------------
Offset:		Length:		Description:
0		8		Number of rerecords (QWORD).

Payload for stream type 6 subtype 0 (General MIDI data):
--------------------------------------------------------
Offset:		Length:		Description:
0		1		Data byte.
