Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /storage/content/49/145849/famitracker.com/public_html/forum/classes/dbHandler.php on line 29
That's because there's no real "format" for the DPCM channel, it just reads the bytes of anything, and examines the bits (8 bits = 1 byte) one by one, that's why the NES does 1-bit DPCM (Today, we have 16-bit wav for example, which means that two bytes are processed at a time). Look up pictures of hex editors, that's what EVERYTHING is in real, just a bunch of numbers.
[quote=za909]That's because there's no real "format" for the DPCM channel, it just reads the bytes of anything, and examines the bits (8 bits = 1 byte) one by one, that's why the NES does 1-bit DPCM (Today, we have 16-bit wav for example, which means that two bytes are processed at a time). Look up pictures of hex editors, that's what EVERYTHING is in real, just a bunch of numbers. [/quote]
To go from DMC to WAV, you make the wave go up when there's a 1, and make the wave go down when there's a 0. When you reach the maximum value (127), you stop going up. When you reach the minimum value (0), you stop going down. That's what DMC is. 8 times as many samples as there are bytes.
The NES DPCM data is still a format. It's not "just hex", those bytes and bits mean something.
It actually increases the counter by 2 on a 1 bit and down by 2 on a 0 bit.
If the counter is 126 or 127 it will not increase, if it is 1 or 0 it will not decrease. (Note: the DPCM sample can never change the least significant bit of the DMC counter.)
The bits are read LSB first, so hex $79 = binary $01111001 gets read as: 1, 0, 0, 1, 1, 1, 1, 0. Since most humans work with numbers in big-endian format, it will look backwards to you.
e.g. $79 $11 would read as...
1001111010001000
Even though normally in big-endian binary you would write it out:
%01111001 %00010001
The actual length of a DPCM sample must a multiple of 16 bytes + 1 extra byte. e.g. valid sample lengths are 1 byte, 17 bytes, 33 bytes, etc...
DPCM has no dedicated file format so that's why any file can be interpreted as DPCM data, there is no header or anything telling if the file is valid or not.