VOGONS


Reply 20 of 23, by Scali

User metadata
Rank l33t
Rank
l33t
SirNickity 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.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 21 of 23, by SirNickity

User metadata
Rank Oldbie
Rank
Oldbie

OK, well.. short answer: It works the way you expect it should.

On the SB Pro installation disk, test-sbc.exe plays the 2-operator test in stereo -- which I didn't know before. The high arpeggios are played on the right channel, for example. The lower riffs are panned center. So that's Dual OPL2 functionality covered.

The 4-operator test (which requires OPL3) plays the rhythm on the left channel, and you can kind of hear a low, incorrect rendering of the melody on the right channel. I wasn't quite sure what to expect with this test, since it's not meant to be played on OPL2 hardware, but I think this sounds reasonable.

So then I ran Lemmings, for some classic single OPL2 music. It sounded just like every other AdLib-compatible sound card. 2-op FM in mono, panned dead center.

There you have it.

Reply 22 of 23, by Scali

User metadata
Rank l33t
Rank
l33t
SirNickity wrote:

On the SB Pro installation disk, test-sbc.exe plays the 2-operator test in stereo -- which I didn't know before. The high arpeggios are played on the right channel, for example. The lower riffs are panned center. So that's Dual OPL2 functionality covered.

That's interesting, I didn't know that (I only ever had an SB Pro 2, so as far as I was aware, the 2-operator test was just there for the AdLib/SB compatibility).
I'll study it a bit with DOSBox in various configurations to see what happens. I assume that it uses the DSP version to detect whether or not it is running on a SB Pro 1, and will then use a stereo version of the tune, played over different ports than the regular tune would be.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 23 of 23, by SirNickity

User metadata
Rank Oldbie
Rank
Oldbie

Yeah, that was a neat surprise. I'm not sure what all they're doing with it. My test bench speakers are the rears from a plastic HTIB crapfest connected to a little (couple watts) class-D amp, hastily thrown together and sitting wherever they aren't in the way. I could hear the left-to-right sweep of the digital audio test and the extreme panning from the FM demos, but a critical listening setup it is most definitely not.

I assume you're right about it adapting based on the DSP. The test program checks that earlier, so it would know anyway. What I find mildly curious is that it still allows you to run the 4-op test regardless. I guess they just never bothered to disable the menu option since it doesn't hurt anything.