VOGONS


First post, by j^aws

User metadata
Rank Oldbie
Rank
Oldbie

Anyone build a MAME setup with passthrough for real OPL2/ OPL3 soundcards (ISA/ PCI) as opposed to FM sound being emulated?

What OS and version of MAME worked best? Thx.

Reply 1 of 16, by Stiletto

User metadata
Rank l33t
Rank
l33t

I had to hit the ol' memory banks for this.

I may not be 100% correct but MAME's and MAME32's OPL passthrough feature (-ym3812opl / -noym3812opl, with accompanying MAMEOPL.SYS on Windows/MAME32, direct write on DOS/MAME) entered MAME in MAME 0.23 (June 2 1997) and left after MAME 0.37b14 (April 7 2001). It functioned on both DOS and Windows.

I am not certain if the feature was kept after MAME 0.37b14 in the DOS port. (At MAME 0.37b15, the Windows port became the main supported port.)

I left some of the sourcecode for it in this antique VOGONS VDMSound post here. Note that it was Tatsuyuki Satoh's old code, pre Jarek Burczynski's rewrite.
Features to add...

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto

Reply 3 of 16, by leileilol

User metadata
Rank l33t++
Rank
l33t++

I know the final DOS release had -ym3812opl at least.

Games that usually worked in my experience:
- Bubble Bobble
- Many, many Data East games
- Many, many SNK games (pre-NEOGEO and yes this mutes the singing in Psycho Soldier)

OPL passthrough sounds fun with an AudioPCI "enhancing" these games 😉

Shame there wasn't an attempt to bring the very common YM-2151 into a "passthrough"...

apsosig.png

Reply 4 of 16, by Stiletto

User metadata
Rank l33t
Rank
l33t
leileilol wrote:

I know the final DOS release had -ym3812opl at least.

Do you mean MAME 0.37b14 (DOS)? Or the "official DOS port" DOS MAME 0.106? I am almost tempted to go check...

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto

Reply 5 of 16, by j^aws

User metadata
Rank Oldbie
Rank
Oldbie
leileilol wrote:
I know the final DOS release had -ym3812opl at least. […]
Show full quote

I know the final DOS release had -ym3812opl at least.

Games that usually worked in my experience:
- Bubble Bobble
- Many, many Data East games
- Many, many SNK games (pre-NEOGEO and yes this mutes the singing in Psycho Soldier)

OPL passthrough sounds fun with an AudioPCI "enhancing" these games 😉

Shame there wasn't an attempt to bring the very common YM-2151 into a "passthrough"...

Do you remember any lag with your passthrough setup? I remember a lot of these arcade games, but the tunes played in a noisy arcade environment were often diluted in quality. Would be great to hear them in a passthrough setup, ideally with minimal lag.

And YM2151 (OPM) "passthrough" would've been great to see as well. I wonder what the best host would have been - OPL3? There's OPP (YM2164) for PC (IBM MFC), but OPM was Sharp X68000, IIRC.

@Stilleto: If you're tempted to check, then go ahead - confirmation would be great.

Reply 6 of 16, by Stiletto

User metadata
Rank l33t
Rank
l33t

Did some further checking.

The -ym3812opl option was eliminated from MAME source as of 0.60. DMAME (DOS MAME) fork maintained by "smf" continued from DMAME 0.61 to DMAME 0.106 but did not include it that I can see.

MAMEDEV.org's History pages puts it this way:
https://www.mamedev.org/history.html

02 Jun 97 	0.23 	First FM synthesis-based sound chip supported — but only through a hack to use the OPL on a SoundBlaster card under DOS.
...
01 May 02 0.60 Removed SoundBlaster FM support as software-based emulation finally became better in almost all cases.

from whatsnew060.txt:

- osd_opl_control() and osd_opl_write() removed; direct access to the SoundBlaster OPL chip is no longer useful.

So the passthrough functionality existed in MAME from MAME 0.23 (DOS) to MAME 0.59 (DOS). It wasn't supported by the DOS port from MAME 0.60 up to MAME 0.106 and it also doesn't look like it was ever supported by the official MAME Windows port from MAME 0.37b15 onward.

The official "unofficial" MAME Windows port, MAME32, supported the feature from MAME32 0.34 BETA2 to MAME32 0.37B14.

... as far as I know, that's now the definitive answer.

Ergo, if you want this feature for a retro rig...
- Windows OS: any version of MAME32 0.34 BETA2 to MAME32 0.37B14
- DOS OS: any version of MAME 0.23 to MAME (DOS) 0.59.
(FYI: You cannot currently get DOS MAME binaries > 0.37b14 from mamedev.org and must go elsewhere.)

NOTE: as I understand it, in MAME 0.23, the feature was known as "-fm" and supported as a hack passing emulated YM2203 through to the real YM3812 as well as YM3812 to the YM3812. It didn't become -ym2203opl/-ym3812opl until MAME 0.34b6 (the first YM3812 digital emulation went in in MAME 0.34b5).

I don't know of any forks that backported (forward-ported?) the OPL passthrough feature to DOS versions higher than 0.59, or to any "official" MAME Windows versions at all.

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto

Reply 7 of 16, by j^aws

User metadata
Rank Oldbie
Rank
Oldbie

^^ Amazing detective work!

From the history log:

01 May 02    0.60    Removed SoundBlaster FM support as software-based emulation finally became better in almost all cases.

Do you know what "almost all cases" is referring to?

Reply 8 of 16, by leileilol

User metadata
Rank l33t++
Rank
l33t++

That was long before NukeYKT and knowing better about OPL2/3 emulation 😉

Also maybe some of the OPL passthrough could be forward ported to Raine since MAME's too big and slow for a lot of the games on even a modern DOS system these days and Raine can be rather speedier in some places appropriate for low-end Pentium systems. Seems more appropriate

As for lag I can't recall a significant addition of lag with the OPL passthrough, except on AudioPCI where mame was overall slower from the poor audiopci SB emulation under DOS.

apsosig.png

Reply 9 of 16, by Stiletto

User metadata
Rank l33t
Rank
l33t
leileilol wrote:

That was long before NukeYKT and knowing better about OPL2/3 emulation 😉

Also maybe some of the OPL passthrough could be forward ported to Raine since MAME's too big and slow for a lot of the games on even a modern DOS system these days and Raine can be rather speedier in some places appropriate for low-end Pentium systems. Seems more appropriate

As for lag I can't recall a significant addition of lag with the OPL passthrough, except on AudioPCI where mame was overall slower from the poor audiopci SB emulation under DOS.

Might be a license conflict in doing that, IDK. MAME was GPLv2 from MAME 0.22 to MAME 0.25, a GPLv2+ frankenstein that was frankly embarrassing at MAME 0.26, and then MAME 0.27 began under its own custom license, MAME 0.30 with a modification to that license, and again with MAME 0.33b7 and again with MAME 0.36. Also, some individual sourcecode was under its own licenses as well.

Raine since IDK when seems (eh, vaguely) to be under the Artistic License, either 1.0 or 2.0, who can say.
https://github.com/zelurker/raine/issues/14
No idea what the Artistic license is compatible with, though Artistic 2.0 is approved by the OSI: https://opensource.org/licenses/Artistic-2.0

AdvanceMAME (DOS) might be a better fit as it is still under the "MAME license" for the most part (which edition, IDK): https://www.advancemame.it/

smf has said that someday he'd like to pursue porting something like current MAME to DOS, but VOGONS folks would probably hate it, and I doubt he'd re-enable OPL passthrough 😁 (Besides, like me, smf has a billion things on his to-do list...)

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto

Reply 10 of 16, by Stiletto

User metadata
Rank l33t
Rank
l33t

Here, VOGONS friends, we made you a perma-link 😀
https://docs.mamedev.org/usingmame/commonissu … tml#externalopl

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto

Reply 11 of 16, by Utafuinki

User metadata
Rank Newbie
Rank
Newbie

"..software-based emulation finally became better in almost all cases"

Um, how can -emulation- be better than the thing that's being emulated?

I can understand it in the cases like Amiga's 68060 CPU being faster than a real Mac's 68040, so emulating Mac on that would be better, because it's faster on the Amiga.

But how the heck is software emulation of -any- actual sound chip going to be even as good, let alone better? Software emulation is 'dead', whereas a real sound chip is 'alive' (with its own quirks).

When you compare emulated waveforms, it's dead and repetitive, but a real chip's waveform is more 'wavy' and alive, and there are other differences, like the 'atmosphere' or 'feel' of a real chip that emulation of course can't have.

What an egotistical and ludicrous statement. It's like saying mimicking something can somehow be better than the original. You can only get to 'as good' level (and realistically, you can never reach it), but not 'better', because if it becomes 'better', then it's no longer mimicking the original accurately, and thus is worse again.

The same, exact waveform, same pitch, same everything:

Emulation-vs-Real-Chip.png

You can also hear and feel the difference.

Real thing is always the real thing, no matter how good the emulation gets.

Reply 12 of 16, by Anapan

User metadata
Rank Newbie
Rank
Newbie

It was actually a bit of a challenge to get that last version. OPL works great through my SB16 Value.
edit: Archive.org link here:
https://web.archive.org/web/20050903114511/ht … et/oldmame.html

Last edited by Anapan on 2020-02-25, 07:04. Edited 1 time in total.

norefuge7.png
attitude1.png

Reply 13 of 16, by leileilol

User metadata
Rank l33t++
Rank
l33t++
Utafuinki wrote on 2020-01-27, 03:58:

"..software-based emulation finally became better in almost all cases"

Um, how can -emulation- be better than the thing that's being emulated?

Nice twist. When MAME's OPL passthrough was around, sound cards were already dropping Yamaha chips so the intended use became against the purpose for accuracy (i.e. SBPCI's awful remapping to wavetable, some weird OPL knockoffs in other cards, Creative's CQM, slow SBLive TSR drivers, etc.). OPL passthrough didn't take in account of volume changes and mixing either (i.e. some games using low pass filters)

Also 20 years later the OPL's pretty much figured out by now, especially NukeYKT's research (which isn't part of mame but still is a good mention/inspiration for further yamaha refinement)

apsosig.png

Reply 14 of 16, by HanJammer

User metadata
Rank Oldbie
Rank
Oldbie

When it comes to FM synthesis - there is no replacement for a real chip. Same thing as with analogue vs digital synths. While there are some sophisticated VST plugins closely imitating 'the real thing' - no such approach is present in the emulation world. Some sound characteristics simply can't be recreated by software (ie. noise added by sound circuitry, chip characteristic changes due to temperature and so on) just like LCD will never be able to perfectly emulate the CRT.

For sale (2019.12.01 - new items!!!): 8088, 286 stuff | 386, 486 stuff | Socket 5-8 stuff | Old HDDs and 5.25" FDDs

Reply 16 of 16, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie
HanJammer wrote on 2020-02-10, 13:11:

LCD will never be able to perfectly emulate the CRT.

Fortunately humans, being mere flesh bags, have limits as to what our equipped visual and auditory senses can take in and understand.

Eventually everything analog can be sufficiently emulated or reproduced at a rate that exceeds our eyes and ears, to the point where skilled viewers and listeners fail to distinguish A from B beyond random chance in blind ABX testing.

That's actually one of the forum TOS rules over at Hydrogen audio. There have been many claims shattered and perceptions changed through ABX testing.

But indeed, we're not there yet in emulating CRT displays, but getting there. Decent CRTs have a dot pitch of just over 0.2mm, measured from red-to-red bands, with G and B bands in beteeen. Current a 4K 22 inch monitor has a pixel size of 0.125mm, which is still too big to fit a red, green, and blue row within 0.2mm.

But when screen resolutions double again, those LCD pixels will only be 0.07mm. Three rows of them emulating red, green, and blue bands will add up to 0.21mm, rivaling a decent CRT. Apply some color matching, a hint of noise, glow and phosphor latency, equivalent curvature distortion, all placed behind the same heavy glass front, and you might also not be able to pass an ABX test. I look forward to the day I too will fail that test 😀

Edit: if you have a chance, install https://github.com/Swordfish90/cool-retro-term; it does an amazing job at bringing back the nostalgia of using old TTY terminals up through DOS-era CRTs. (even on my lowly 1080p display).