carbon14 wrote:Page 29 gives a good description of the accumulator.
The data from the operator cell is a floating point value, with a 10 bit virtual part (including sign bits) and a 3 bit exponent. The accumulator is also floating point. Data is then converted to a slightly different form for the 13-bit output format as used in the OPL2.
It seems likely therefore that the OPL2 does indeed have a floating point accumulator also.
But to me that text on page 29 and picture on page 30 tells me the exact opposite, the accumulator being linear (PCM), not float.
In the text, it says "The accumulator collects operator output for each channel and converts the accumulated result into offset binary data with 10-bit virtual part and a 3-bit exponent part". So it does not say in what format the value is internally in accumulator, just that it is converted to float before output.
In the picture, it shows how the internal OPL data (it looks definitely being 16-bit offset binary number) in accumulator is converted to float for output. The least significant bits are ignored and only most significant bits are used for output, and the leading unsignificant bits are used to count the shift value. This is exactly the same in reverse how Olli's code reconstructs the 16-bit PCM value out of the float output from the chip.
I have also been thinking for the past few days reasons why the accumulator would be in float or in linear (PCM), and came into following conclusions just to back my hypothesis.
The operator output from sine lookup has to be always converted from float to linear (PCM) because the output can be fed to three different things that makes sense to be linear: modulator output feeds carrier input linearly, feedback is used to feed operator output back to operator input linearly, and of course a carrier output is fed to accumulator.
It is also much easier to make the accumulator hardware to just sum linear (PCM) values together (like phase accumulator), instead of summing two float values together. At least if operator output already needs to be linear (PCM) because it can be used for other things as well.
However I do understand it is not that hard to perform sum of two floats either, and there will be rounding errors if only 9 bits + sign bit is used for mantissa and 3 bits for exponent. The internal format seems to have 15 bits + sign bit anyway to avoid rounding errors.