short cut to ... [main] [news] [forum] [download] [Hall of Fame] [game] [cg] [link]

S98v2 draft 

OFFSET BASE IS TOP OF HEADER

[HEADER FORMAT]

0000 3BYTE	MAGIC 'S98'
0003 1BYTE	FORMAT VERSION '0' or '1' or '2'
0004 DWORD(LE)	(V1)TIMER INFO1 If value is 0, use 0000000A(10).
0008 DWORD(LE)	(V2)TIMER INFO2 If value is 0, use 000003E8(1000).
000C DWORD(LE)	DUMP DATA COMPRESSING 'Inflate' size in byte, if value is not 0.
0010 DWORD(LE)	OFFSET TO SONGNAME If value is 0, not exist.
0014 DWORD(LE)	OFFSET TO DUMPDATA
0018 DWORD(LE)	OFFSET TO LOOP POINT OF DUMPDATA  If value is 0, not exist.
001C DWORD(LE)	(V2)OFFSET TO COMPRESSED DATA If value is 0, use one TO DUMPDATA
0020 16BYTES	(V2)1ST DEVICE INFO
0030 16BYTES	(V2)2ND DEVICE INFO
0040 16BYTES	(V2)3RD DEVICE INFO
0050 16BYTES	(V2)4TH DEVICE INFO
...


[DEVICE INFO FORMAT]

If 1ST DEVICE info not defined, use  OPNA(7.9872MHz) for copmpatibility

0000 DWORD(LE)	DEVICE TYPE
  00000000:END MARKER OF DEVICE INFO
  00000001:PSG
  00000002:OPN
  00000003:OPN2
  00000004:OPNA
  00000005:OPM
0004 DWORD(LE)	CLOCK
0008 4BYTES	RESERVE(0)
000C DWORD(LE)	OFFSET TO APPLICATION-DEPENDENT DATA

[APPLICATION-DEPENDENT DATA FORMAT]

0000 DWORD(LE)	LENGTH OF APPLICATION-DEPENDENT DATA 
0004 (LENGTH OF APPLICATION-DEPENDENT DATA)BYTES	MAGIC ID AND RAW DATA
???? DWORD(LE)	LENGTH OF APPLICATION-DEPENDENT DATA2
???? (LENGTH OF APPLICATION-DEPENDENT DATA2)BYTES	MAGIC ID AND RAW DATA
...
???? DWORD(LE) 00000000:END MARKER OF APPLICATION-DEPENDENT DATA

[DUMP DATA FORMAT]

00 aa dd  1st device out1
01 aa dd  1st device out2
02 aa dd  2nd device out1
03 aa dd  2nd device out2
04 aa dd  3rd device out1
05 aa dd  3rd device out2
06 aa dd  4th device out1
07 aa dd  4th device out2
...

FF        1SYNC(TIMER INFO2/TIMER INFO1 syncs per sec)
FE vv...  nSYNC
FD        END/LOOP(IF ANY)
80-FC     ABORT(RESERVE)
vv...:variable length BYTE DATA

int getvv(byte *p)
{
    int s = 0, n = 0;
    do
    {
        n |= (*p & 0x7f) << s;
        s += 7;
    }
    while (*p++ & 0x80);
    return n + 2;
}