VOGONS


Reply 20 of 42, by 640K!enough

User metadata
Rank Oldbie
Rank
Oldbie
noop wrote:

AFAIK MMA only serves as bus address decoder for OPL3. For all purposes it can be considered transparent if we are only concerned with OPL3 (and if mixer is alreadty set up properly).
4 MMA chip regs follow 4 OPL3 regs and the method of accessing its state mirrors OPL3.

I may have had the address ranges slightly wrong (I will have to look into it, if there is a need), but there are three main components that software typically addresses on GSS cards: OPL3, MMA (digital audio, MIDI, joystick) and the control chip. All three are required for the usual routines to identify a Gold card of some sort. If my memory isn't too hazy, the MMA is usually checked first, followed by OPL3, and lastly, the control chip.

To complicate matters, GSS level 1 cards don't have a control chip. For level 2 cards, the control chip may be at an address just after MMA, or may overlap the second set of OPL3 addresses (38A, was it?). That last option was referred to as "phantom control", and it was necessary to "disable" the OPL3 before addressing the control chip.

Some of this is unnecessary information for your purposes, but the point is that no properly GSS-compliant software will find a card without something acting like an MMA. If you fool the detection routines, what do you do if/when they finally try to make use of the MMA that they think is there?

Reply 21 of 42, by noop

User metadata
Rank Member
Rank
Member
640K!enough wrote:

If you fool the detection routines, what do you do if/when they finally try to make use of the MMA that they think is there?

Depends on how many checks are done. Probably just FIFO status bits that need to be set with some periodicity and returned on port read. Seems doable, just not sure if worth it. May just be enough to, say, alternate between 2 values read from 38C with some periodicity while ignoring everything else.

Thanks for the addional info, will read some more docs on the subject
Update.
After some study I found that Level 2 device (with control chip) does have minor overlap with 2nd bank of OPL3 that can, if not emulated, cause the game to screw up OPL3 sound IF the game changes stereo mixer master volume after starting to use OPL3. This probably never happens. Bogus OPL3 accesses resulting from other control chip usage scenarios seem to be harmless and will only cause the program to read incorrect data from nonexistent control chip.
If an application uses MMA timers or depends on interrupts, tough luck.

Reply 22 of 42, by 640K!enough

User metadata
Rank Oldbie
Rank
Oldbie

This is all hypothetical, of course; I'm still not convinced this is worth your time. At best, you might be able to get such software running, but how close can more modern hardware come to the actual Gold sound quality? Still, unless I'm mistaken, that overlap exists only in the case of phantom control. On a true level 2 card (like every production-ready card Ad Lib designed, shipped or not), the control chip I/O addresses are after the MMA address range, so there should be no need to disable the OPL3 to access the control features (EDIT: Correction: Ad Lib's Gold line may have been level 2 cards, but used phantom control). It seems that you could get away with faking the MMA detection code, actually passing the OPL3 accesses to the hardware you're working with, and mostly just allowing the control chip accesses (at level 2 address range), faking only those necessary for detection and those that are likely to be read back and depended upon by software.

For a game like Dune, you would also likely have to emulate the feature detection, so that you could report that the surround module and other options are not present.

A more aggressive detection routine could conceivably add another step that does a concurrent MMA timer test and waits for the interrupts to be signalled via the control chip, but I don't know if any of the small number of titles that bothered to do anything unique with GSS hardware ever did. The result of not getting that right is that the software would likely wait forever or decide that no GSS hardware is present after some pre-defined delay.

Last edited by 640K!enough on 2018-03-16, 05:35. Edited 1 time in total.

Reply 23 of 42, by noop

User metadata
Rank Member
Rank
Member
640K!enough wrote:

On a true level 2 card

In the documentation I read there is no mention of control chip being mapped behind MMA on level 2 cards, only over OPL3 2nd bank.
And on level 1 there is no control chip/mixer/optional boards and therefore no possible conflicts. Just OPL3 and MMA. mapped at 388 one after another

Note that I'm not considering Adlib Gold emulation strictly for this utility. I plan creating more of those "virtualization" utilities later.
In particular, OPL2LPT/OPL3LPT emulation utility trying some of my own ideas about implementing delays and patching client executables. Supporting Adlib Gold detection would be nice.
Also possibly an utility that forces OPL3 SB compatible card to behave like OPL2, or pure OPL3 card without DSP, like resound (and few more possibilities) to force OPL2 sound in games or test what games are compatible with resound without buying one 😀

Reply 24 of 42, by 640K!enough

User metadata
Rank Oldbie
Rank
Oldbie
noop wrote:

In the documentation I read there is no mention of control chip being mapped behind MMA on level 2 cards, only over OPL3 2nd bank.
And on level 1 there is no control chip/mixer/optional boards and therefore no possible conflicts. Just OPL3 and MMA. mapped at 388 one after another

Now that you bring this up, I decided to modify a quick test I wrote a while ago. This was its output, with a real Ad Lib Gold 1000 installed:

Gold Test.jpg
Filename
Gold Test.jpg
File size
84.49 KiB
Views
1970 views
File comment
Output from Ad Lib Gold detection test
File license
Fair use/fair dealing exception

So, it appears that the Gold 1000 does indeed use phantom control.

I also just re-checked the details I had, and it is stated that the control chip can be at either baseAddress + 2 (phantom control) or baseAddress + 8, where baseAddress is 388 by default, unless re-located. Whether any shipping GSS card actually did that, and whether the GSS-enabled software that shipped supported both designs, remains unclear.

noop wrote:

Note that I'm not considering Adlib Gold emulation strictly for this utility. I plan creating more of those "virtualization" utilities later.
In particular, OPL2LPT/OPL3LPT emulation utility trying some of my own ideas about implementing delays and patching client executables. Supporting Adlib Gold detection would be nice.
Also possibly an utility that forces OPL3 SB compatible card to behave like OPL2, or pure OPL3 card without DSP, like resound (and few more possibilities) to force OPL2 sound in games or test what games are compatible with resound without buying one 😀

Interesting ideas. I'll be interested to see what you create. The OPL3LPT may be somewhat limiting, if they still don't connect the interrupt line to the parallel port's corresponding pin.

Reply 25 of 42, by Scali

User metadata
Rank l33t
Rank
l33t

I see a lot of things that make no sense to me... 'GSS', 'Level 2', 'MMA', 'Phantom control'...
Is there any documentation on all this?

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

Reply 26 of 42, by noop

User metadata
Rank Member
Rank
Member
Scali wrote:

Is there any documentation on all this?

I generated this PDF after fixing the formatting in the original Word 2.0 doc extracted from the file named sdtk.zip, found here: http://www.dcee.net/

Filename
SDTK.pdf
File size
642.04 KiB
Downloads
122 downloads
File license
Fair use/fair dealing exception

Didn't bother with multiple typos. Have no idea if newer version exists.

This is Yamaha's documentation for MMA chip:

Filename
YMZ263B-F.pdf
File size
678.88 KiB
Downloads
85 downloads
File license
Fair use/fair dealing exception

Reply 27 of 42, by 640K!enough

User metadata
Rank Oldbie
Rank
Oldbie
Scali wrote:

I see a lot of things that make no sense to me... 'GSS', 'Level 2', 'MMA', 'Phantom control'...
Is there any documentation on all this?

Unfortunately, there doesn't seem to be an abundance of documentation. Whatever there used to be seems to have disappeared with Ad Lib and the standardisation effort. From appearances, noop is looking at the same documents that I have. I am also trying to fill in details from old articles that I had read, but recycled the magazines long ago.

Briefly, GSS refers to the Ad Lib/Yamaha Gold Sound Standard; at the time, an effort to produce a more open, flexible sound standard to supplant the Sound Blaster and clones. The only cards I ever read about used mostly Yamaha parts (and, yes, there were apparently GSS cards other than those from Ad Lib).

The Gold Sound Standard apparently allowed for two levels of compliance; level 1 and level 2. Level 1 cards were more basic, not supporting the standard methods for software configuration, lacking a control chip and software-controllable mixing and volume control. Level 2 designs offered all of these things, and the control chip could either have its own dedicated I/O address range, or be overlaid on the second half of the OPL3 range (38A by default). This was called "phantom control", as writes to these addresses were passed to the OPL3 by default, but writing a certain value would cause the control chip to process subsequent writes, rather than passing them to the OPL3. Writing other specific values once access to the control features was complete would cause the control chip to go back to transparently passing writes to the OPL3.

One of the main chips used was the YMZ263, also called MMA (MultiMedia Audio?). This handled the digital audio recording/playback (including 3:1 ADPCM), MIDI port and game port functionality, as well as providing three timers. Later, non-Ad Lib cards seemed to use a different variant, the YMZ263B, though I don't know what the differences are, if any.

Reply 28 of 42, by noop

User metadata
Rank Member
Rank
Member

I must add that OPL3 and MMA were seemingly produced together by Yamaha, specifically for this project, as they are accessed in a very similar way.
Basically OPL3 (transparently) connected through MMA to ISA (+ stereo DAC for OPL3 and misc chips) make up level 1 GSS device, which, like Adlib, is tied to port 388.
Like early SB devices, MMA is half-duplex, accepts data up to 44100KHz 16 bits but has 12-bit DAC/ADC, albeit of a very decent quality, more than enough for most purposes. Could probably be trivially expanded to 16 later.
Level 2 adds port remapping, digital mixer / routing control, SCSI CD controller, some basic surround processing, and support for options such as telephone interface and reverb daughterboard.
MMA MIDI interface, like SBMIDI, is not compatible with MPU-401 without TSR, but, unlike SBMIDI, can be used together with digital audio and probably would have no concurrency bugs like stuck notes on "MPU401-compatible" SB16/AWE32.

Reply 29 of 42, by Kamerat

User metadata
Rank Oldbie
Rank
Oldbie

Found out that one of my sound cards, a Trident 4DWAVE-NX based one, can run Sound Blaster samples over it's PCI I/O adresses. It's available at base address +10h and I tried it first on Duke Nukem 3D (manually altered DUKE3D.CFG) and Epic Pinball (used REMAPCMI A3C0 with a PCI base address of A400h).

I also tested One Must Fall 2097, Jazz Jackrabbit and Pinball Fantasies successfully with REMAPCMI.

The MPU401 interface of the card is avaiable at PCI base address +20h, unfortunately it doesn't work well when the card is initialized in to legacy mode.

DOS Sound Blaster compatibility: PCI sound cards vs. PCI chipsets
YouTube channel

Reply 30 of 42, by noop

User metadata
Rank Member
Rank
Member
Kamerat wrote:

...

So, it is time to do an update. What syntax would you prefer for specifying ports?
remapcmi sb at 220 to 4040 opl2 at 388 to 4050
OR
remapcmi 4000 sb 220 - base+40
OR
remapcmi 220-22E 4040 320-331 4050
OR something else?

Reply 31 of 42, by Kamerat

User metadata
Rank Oldbie
Rank
Oldbie

Last one would be more flexible and easier to use on other chips than the 8738. It also would be nice if sampled Sound Blaster and FM could be seperated if you use two cards as the 4DWAVE-NX doesn't have hardware FM but good Sound Blaster emulation, for the 8738 it's the other way around.

DOS Sound Blaster compatibility: PCI sound cards vs. PCI chipsets
YouTube channel

Reply 32 of 42, by noop

User metadata
Rank Member
Rank
Member

Latter version of command line is elegant, but is device-agnoistic, giving no ability to specify what device is being emulated and assumes that the user knows both start and end port.
I not only thinking about flexibility but also about accessibility and conciseness. Should we require users to know what specific address ranges are used by various audio components?
On a typical SB-compatible card, 3 port ranges are given to a single OPL3-compatible chip (assuming base to be 220): 220-223, 228-229, 388-33B(or possibly just 388-339). This is complicated by the fact that some rare old games that would use 228h probably also attempt to detect digital part of the SB.. So, if we later discover a need to emulate DSP version, we'll need a way to specify this.
And one more thing.
I believe we definitely need a pass-through flag that was requested for OPL2LPT utility, that allows data to be sent to both destinations.

Reply 33 of 42, by Kamerat

User metadata
Rank Oldbie
Rank
Oldbie

Got REMAPCMI working with PCM/sample playback on a YMF744 based card on a motheboard not supporting legacy addressing over PCI. Used base address -10h when loading REMAPCMI as Sound Blaster emulation can be found at base address +40h. Maybe it's time for a REMAPYMF utility? 😊 FM can be found at base address +60h and MPU401 possibly at +68h.

DOS Sound Blaster compatibility: PCI sound cards vs. PCI chipsets
YouTube channel

Reply 34 of 42, by noop

User metadata
Rank Member
Rank
Member

Hi. I Almost forgot about this and a few other DOS projects. Definitely should do something. I have another idea which I won't name until I actually implement it.

Reply 36 of 42, by ytrezq

User metadata
Rank Newbie
Rank
Newbie
noop wrote on 2018-03-08, 00:17:
Hello, I developed a small utility to help owners of CMI8x38-based cards to run DOS software. Based on the information from this […]
Show full quote

Hello, I developed a small utility to help owners of CMI8x38-based cards to run DOS software.
Based on the information from this thread: I've got the OPL3 synth from a CMI8738 working in Windows 7 x64
You specify PCI base port of the card and it redirects standard 220h, 388h, 330h port accesses to their proper locations relative to that base port.

It uses the same method that is used by SoftMPU & ADLiPT, but is written from scratch in assembly. Same requirements, needs EMM386 3.46+ running.
It remaps hardcoded port ranges and doesn't pass the data through to whatever may live on those ports. This may be later improved in the future, or made configurable.

Thanks to pdw for opensourcing his projects and to Kamerat for coming up with the idea and testing with plenty of DOS software.

Current version is 1.11
Redirects SB, Adlib, MPU401 port ranges, but digital audio support is not yet confirmed. Relative to unreleased 1.1 only has internal code refactorings and text changes. AdLib ports are redirected to SB OPL3 base port, seem to work ok.

Can this be used for getting opl3 with motherboards without an sb link port?

Reply 37 of 42, by dondiego

User metadata
Rank Member
Rank
Member

For me it doesn't work at all. I have a cmi8738/pci-sx rev 037d, the pci base port is c000. My mainboard is a i810 based soyo.
I've tried without initializing the card with the dos driver, using setaudio first it doesn't work either.
On windows there's a OPL3/OPL2 synthetizer in dxdiag but i get no sound. One guy said in other thread that my revision still has the FM core.
I've read in a phil's video that i need to initialize the fm core in dos with setaudio before loading windows so it works there too.
I get no FM neither on dos nor on win98, i'm using the VXD drivers.

LZDoom, ZDoom32, ZDoom LE
RUDE (Doom)
Romero's Heresy II (Heretic)

Reply 38 of 42, by tyukok

User metadata
Rank Newbie
Rank
Newbie
dondiego wrote on 2022-09-04, 14:25:
For me it doesn't work at all. I have a cmi8738/pci-sx rev 037d, the pci base port is c000. My mainboard is a i810 based soyo. I […]
Show full quote

For me it doesn't work at all. I have a cmi8738/pci-sx rev 037d, the pci base port is c000. My mainboard is a i810 based soyo.
I've tried without initializing the card with the dos driver, using setaudio first it doesn't work either.
On windows there's a OPL3/OPL2 synthetizer in dxdiag but i get no sound. One guy said in other thread that my revision still has the FM core.
I've read in a phil's video that i need to initialize the fm core in dos with setaudio before loading windows so it works there too.
I get no FM neither on dos nor on win98, i'm using the VXD drivers.

I remember having sound on a PCIe CMI8738 card in DOS. I was neither initializing the card with the driver, nor using setaudio, just ran "remapcmi 9000" and it worked.

Reply 39 of 42, by dondiego

User metadata
Rank Member
Rank
Member

Thanks. I've tried that and i get no sound, "remapcmi c000". Did you get FM? May be the card has no FM?
@Kodi said the chip has FM and even later chips.

LZDoom, ZDoom32, ZDoom LE
RUDE (Doom)
Romero's Heresy II (Heretic)