Useful links:
OPL2 / 3 Decapsulation report by Olli Niemitalo and Matthew Gambrell
Olli Niemitalo's blog posting on this topic, including data capture hardware design
Datasheet for Yamaha YM2151 - OPM
Datasheet for Yamaha YM2203 - OPLN
Translated Datasheet for Yamaha YM2608 - OPLNA
Datasheet and Application Manual for Yamaha Y8950 - MSX-Audio
Datasheet and Application Manual for Yamaha YM2413 - OPLL
Datasheet for Yamaha YM3812 - OPL2
Datasheet for Yamaha YMF262 - OPL3
Datasheet and Application Manual for Yamaha YMF278B - OPL4
DOSBox - a DOS emulator including OPL2/OPL3 emulators
MAME sound chip emulations
Links
Re: Links
Attenuation lookup table.
I frequently refer to this lookup table while I'm reviewing the data output from the data capture.
The first columns give the attenuation value in the inverse logarithmic form used throughout most of the calculations.
The result column gives the resultant waveform amplitude after the exponential conversion
+1 is that amplitude above the 16-bit midpoint 32768
+2 is twice that amplitude above the midpoint (useful for addititive synthesis mode CNT=1)
-1 is that amplitude below the midpoint
-2 is twice that amplitude below the midpoint
I frequently refer to this lookup table while I'm reviewing the data output from the data capture.
The first columns give the attenuation value in the inverse logarithmic form used throughout most of the calculations.
The result column gives the resultant waveform amplitude after the exponential conversion
+1 is that amplitude above the 16-bit midpoint 32768
+2 is twice that amplitude above the midpoint (useful for addititive synthesis mode CNT=1)
-1 is that amplitude below the midpoint
-2 is twice that amplitude below the midpoint
Re: Links
I use a similar table, but with a different negative amplitude. Usually I just compare captured values to values generated by software.
A sine wave and other applicable waveforms can have both positive and negative sign, even if the attenuation is so high that the output value is 0. In OPL, the positive zero is 0, and the negative zero is -1, because it is done as ones complement.
Thus, for example a square wave is either +4084 or -4085, in offset binary 36852 (0x8FF4) or 28683 (0x700B).
This is why sometimes some calculations seem wrong, if the assumption is that an operator always outputs 0 when it has high attennuation. But if the phase generator is running (phase increment is larger than 0), and the waveform has a negative part, then it will alternate between 0 and -1 accordingly. I solve that by selecting a waveform that only has positive sign. Attack speed of 0 will also keep that max attenuation so output keeps at 0.
That is also the noise that can be seen output from the chip when all notes are just turned off and set to high attenuation. There might be any number of channels having phase generators running and outputing 0 or -1. So to reset a chip into silent mode, every channel needs a note on-note off sequence which starts a zero frequency note with waveform that only has positive part and also the attack speed of 0 so the envelope will stay at max attenuation.
A sine wave and other applicable waveforms can have both positive and negative sign, even if the attenuation is so high that the output value is 0. In OPL, the positive zero is 0, and the negative zero is -1, because it is done as ones complement.
Thus, for example a square wave is either +4084 or -4085, in offset binary 36852 (0x8FF4) or 28683 (0x700B).
This is why sometimes some calculations seem wrong, if the assumption is that an operator always outputs 0 when it has high attennuation. But if the phase generator is running (phase increment is larger than 0), and the waveform has a negative part, then it will alternate between 0 and -1 accordingly. I solve that by selecting a waveform that only has positive sign. Attack speed of 0 will also keep that max attenuation so output keeps at 0.
That is also the noise that can be seen output from the chip when all notes are just turned off and set to high attenuation. There might be any number of channels having phase generators running and outputing 0 or -1. So to reset a chip into silent mode, every channel needs a note on-note off sequence which starts a zero frequency note with waveform that only has positive part and also the attack speed of 0 so the envelope will stay at max attenuation.
Re: Links
That's a useful description of what's necessary to silence the chip. Thanks.