Reply 20 of 23, by Scali
wrote:SB Pro 2.0 and SB16 have (mono) OPL2 compatibility at 220 and OPL3 at 222, but still listen for OPL2 at 228 and 388.
To be more exact, the OPL3 chip is backward-compatible with the OPL2. The OPL2 has two ports: a register index port and a data port.
The OPL3 is designed to have two banks of registers, so it adds a second set of register and data ports. The first register and data port are OPL2-compatible by default, so the chip is a drop-in replacement for single OPL2 in that respect.
The second bank of registers allows you to switch the chip into some OPL3-specific modes. You can set it up to have two sets of 2-operator register banks, where one is panned left, and the other is panned right. This is more or less equivalent to dual OPL2.
On a dual OPL2 SB, you'll get the first OPL2 at 2?0h and 2?1h. The second OPL2 sits at 2?2h and 2?3h.
On an OPL3 SB, the first bank of OPL3 registers is at 2?0h and 2?1h, and the second is at 2?2h and 2?3h. So it is basically very similar to a dual OPL2 setup.
It's not entirely compatible though, since OPL2 has mono output, and they are hard-panned left and right in hardware (as far as I understand, with dual OPL2, any commands written to 2?8h or 388h will be sent to both OPL2 chips at the same time, to get mono functionality.) OPL3 has stereo output, so the panning depends on how the OPL3 is initialized, which is why by default, port 2?0h still responds like mono OPL2, unlike a dual OPL2 card.
This is where the problem is in practice:
You need to switch the OPL3 into a dual OPL2-compatible setup. However, when you start a game, it will reinitialize the OPL2 chips, which is generally done by writing 0 to all registers. This would undo the earlier setup, and it'd be back to the default single OPL2 mode.
It shouldn't be too difficult to modify dual OPL2 games to be OPL3 compatible though.