so... i get vgm2txt and parse few second of song (for this example it was first song from RnR SMD) and open this song in winhex.
as i understand at the begining lay some system info about chips. until to 0x00000040. from this starts song itself info. in this case (i am not sure) song if easy - no have PCM samples. and i think only 1 instrument per channel (Tony Williams - Bad to the Bone)
1. i think this part some kind of "turn off" function to make silence from previus song.
Code: Select all
0x00000040: 52 28 00 YM2612: Channel 0 Key On/Off: Slot1 Off, Slot2 Off, Slot3 Off, Slot4 Off
0x00000043: 52 28 04 YM2612: Channel 3 Key On/Off: Slot1 Off, Slot2 Off, Slot3 Off, Slot4 Off
0x00000046: 52 28 01 YM2612: Channel 1 Key On/Off: Slot1 Off, Slot2 Off, Slot3 Off, Slot4 Off
0x00000049: 52 28 05 YM2612: Channel 4 Key On/Off: Slot1 Off, Slot2 Off, Slot3 Off, Slot4 Off
0x0000004C: 52 28 02 YM2612: Channel 2 Key On/Off: Slot1 Off, Slot2 Off, Slot3 Off, Slot4 Off
0x0000004F: 52 28 06 YM2612: Channel 5 Key On/Off: Slot1 Off, Slot2 Off, Slot3 Off, Slot4 Off
01-05 - it is value of this $28 regitry
ValleyBell OPN dll equalent command: OPN_Write(0, $28, $01), OPN_Write(0, $28, $02), etc
2. and as i can see later - almost all info in this txt log have 3 bytes. will name it "tripplets". it 2 last value is i am uderstand - what it is first? 52 value? i thought it is some system marker again and used for instrument setting... but then i am see 53 - it is broke my theory. then i remember ValleyBell say for 1-2-3 channel one commands, 4-5-6 need + 255. that is why 53 52 probably it means some kind of "0".
Code: Select all
0x00000067: 52 32 02 YM2612: Ch 2 Slot 0 Detune: 0, Multiple: Freq * 2.0
0x0000006A: 53 32 00 YM2612: Ch 5 Slot 0 Detune: 0, Multiple: Freq * 0.5
3. and then come some strange part:
Code: Select all
0x000002AD: 52 27 2E YM2612: CSM Mode: Disable, 3 Slot Mode: Disable, Enable Timer: -B, Timer IRQ Enable: AB, Reset Timer Status: -B
0x000002B0: 52 40 7F YM2612: Ch 0 Slot 0 Total Level: 0x7F = 0%
0x000002B3: 52 44 7F YM2612: Ch 0 Slot 1 Total Level: 0x7F = 0%
0x000002B6: 52 48 7F YM2612: Ch 0 Slot 2 Total Level: 0x7F = 0%
0x000002B9: 52 4C 7F YM2612: Ch 0 Slot 3 Total Level: 0x7F = 0%
0x000002BC: 52 41 7F YM2612: Ch 1 Slot 0 Total Level: 0x7F = 0%
0x000002BF: 52 45 7F YM2612: Ch 1 Slot 1 Total Level: 0x7F = 0%
0x000002C2: 52 49 7F YM2612: Ch 1 Slot 2 Total Level: 0x7F = 0%
0x000002C5: 52 4D 7F YM2612: Ch 1 Slot 3 Total Level: 0x7F = 0%
0x000002C8: 52 42 7F YM2612: Ch 2 Slot 0 Total Level: 0x7F = 0%
0x000002CB: 52 46 7F YM2612: Ch 2 Slot 1 Total Level: 0x7F = 0%
0x000002CE: 52 4A 7F YM2612: Ch 2 Slot 2 Total Level: 0x7F = 0%
0x000002D1: 52 4E 7F YM2612: Ch 2 Slot 3 Total Level: 0x7F = 0%
0x000002D4: 53 40 7F YM2612: Ch 3 Slot 0 Total Level: 0x7F = 0%
0x000002D7: 53 44 7F YM2612: Ch 3 Slot 1 Total Level: 0x7F = 0%
0x000002DA: 53 48 7F YM2612: Ch 3 Slot 2 Total Level: 0x7F = 0%
0x000002DD: 53 4C 7F YM2612: Ch 3 Slot 3 Total Level: 0x7F = 0%
0x000002E0: 53 42 7F YM2612: Ch 5 Slot 0 Total Level: 0x7F = 0%
0x000002E3: 53 46 7F YM2612: Ch 5 Slot 1 Total Level: 0x7F = 0%
0x000002E6: 53 4A 7F YM2612: Ch 5 Slot 2 Total Level: 0x7F = 0%
0x000002E9: 53 4E 7F YM2612: Ch 5 Slot 3 Total Level: 0x7F = 0%
0x000002EC: 53 41 7F YM2612: Ch 4 Slot 0 Total Level: 0x7F = 0%
0x000002EF: 53 45 7F YM2612: Ch 4 Slot 1 Total Level: 0x7F = 0%
0x000002F2: 53 49 7F YM2612: Ch 4 Slot 2 Total Level: 0x7F = 0%
0x000002F5: 53 4D 7F YM2612: Ch 4 Slot 3 Total Level: 0x7F = 0%
4. and this is probably "volume" setting. and it is come to... 0? or 0 it is max volume?
5. and finaly shows notes (i think notes ):
Code: Select all
0x00000C64: 52 A0 68 YM2612: Ch 0 F-Num (set) LSB = 68
0x00000C67: 52 A5 0B YM2612: Ch 1 F-Num (prepare) MSB = 3, Octave 1
0x00000C6A: 52 A1 D3 YM2612: Ch 1 F-Num (set) LSB = D3
0x00000C6D: 52 A6 03 YM2612: Ch 2 F-Num (prepare) MSB = 3, Octave 0
0x00000C70: 52 A2 37 YM2612: Ch 2 F-Num (set) LSB = 37
0x00000C73: 53 A4 13 YM2612: Ch 3 F-Num (prepare) MSB = 3, Octave 2
0x00000C76: 53 A0 D3 YM2612: Ch 3 F-Num (set) LSB = D3
0x00000C79: 53 A5 23 YM2612: Ch 4 F-Num (prepare) MSB = 3, Octave 4
0x00000C7C: 53 A1 D3 YM2612: Ch 4 F-Num (set) LSB = D3
0x00000C7F: 52 40 7F YM2612: Ch 0 Slot 0 Total Level: 0x7F = 0%
0x00000C82: 52 44 7F YM2612: Ch 0 Slot 1 Total Level: 0x7F = 0%
0x00000C85: 52 48 7F YM2612: Ch 0 Slot 2 Total Level: 0x7F = 0%...
6. then i see:
Code: Select all
0x00000D78: 61 BF 00 Wait: 191 samples ( 4.33 ms) (total 191 (00:00.00))
7. and then catastrophe happen:
Code: Select all
0x00000D87: 77 Wait: 8 sample(s) ( 0.18 ms) (total 222 (00:00.00))
if byte >= 6F read it as 1 byte, else read three bytes. correct? and probably if byte = 66 it is end of music?
8. and how to understand this "wait"? what channel and it is pause, or it is length of note?