[Patch] OPL3 correction in Sound Blaster

Discussion of development and patch submission.
Post Reply
basic2004
Posts: 124
Joined: Sun 08 Jan, 2017 5:59 pm

[Patch] OPL3 correction in Sound Blaster

Post by basic2004 »

I solved OPL3 problem above Sound Blaster Pro V2, This detected OPL3 but plays like OPL2.
- Extended channel was missing
- Mono playback
- 4OP didn't support

But this patch will solve Sound Blaster series' OPL3 problem.

0x220h-0x223h : 220h-221h use Basic FM music ports, 222h-223h use Advanced FM music ports.
0x228h-0x229h : This use Basic FM music ports only, this is correct. 22ah use DSP port.
0x388h-0x389h : This use Basic FM music ports. It plays like OPL2 if 38ah-38bh is missing.

(Added)
0x38ah-0x38bh : This uses Advanced FM music ports, it wasn't defined. It will define from now.
Attachments
sound_sb.patch
(2.03 KiB) Downloaded 332 times
Last edited by basic2004 on Mon 16 Jan, 2017 4:51 pm, edited 1 time in total.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] OPL3 correction in Sound Blaster

Post by SarahWalker »

I'll have to double check this, but while non-SB OPL3 cards (eg Adlib Gold and Windows Sound System) map the extended registers at 38a/38b, I'm reasonably certain that the OPL3-equipped Sound Blasters don't.
UPerschke
Posts: 72
Joined: Wed 25 May, 2016 7:43 pm

Re: [Patch] OPL3 correction in Sound Blaster

Post by UPerschke »

They don't.
I/O addresses from 38Ah to 39Fh are reserved for future expansion.
Sound Blaster Series Programming Guide, bottom of Page 121.
Guide covers all including SB16 ASP.
User avatar
leilei
Posts: 1039
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Patch] OPL3 correction in Sound Blaster

Post by leilei »

IMO regarding OPL3 accuracy, I would go nuclear.

(I looked into it earlier last year and did get it to compile with PCem without the samples being fed in at that point)
basic2004
Posts: 124
Joined: Sun 08 Jan, 2017 5:59 pm

Re: [Patch] OPL3 correction in Sound Blaster

Post by basic2004 »

I upload a music program and some SOP files (song samples) for test.
Let's run HTS in DOS, and compare before & after this patch.

> SarahWalker, UPerschke
I already watched Hardware Programming Guide and watched that, Sorry but I don't agree that guide.
I attach SB16AWE.INF (Sound Blaster's Setup information file for Windows 9x)

Code: Select all

IOConfig=388-38B
There was no 389 in INF file. 38a,38b using with OPL3 too. It's fact.
Sorry...

> leilei
I want this OPL3 accuration, too!
Attachments
HTS.ZIP
(242.02 KiB) Downloaded 315 times
SB16AWE.INF.TXT
(24.46 KiB) Downloaded 316 times
ecksemmess
Posts: 183
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Patch] OPL3 correction in Sound Blaster

Post by ecksemmess »

Agreed with leilei. That "Nuked" OPL3 emulation update really steps up the accuracy. It would be a delight to have it in PCem.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Patch] OPL3 correction in Sound Blaster

Post by Battler »

I really wouldn't take the official specification of any piece of hardware as gospel, I've seen plenty of cases when the specification says one thing but the actual hardware does something else. I think we need someone with a real Sound Blaster 16 to verify this.
This also seems to suggest ports 38A and 38B are used: http://home.icequake.net/~nemesis/blog/ ... chives/369 , though it's not an official source. Certainly though, the Windows 9x driver is most likely official (ie. done by Creative themselves) and that seems to corroborate ports 38A and 38B being used for OPL.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] OPL3 correction in Sound Blaster

Post by SarahWalker »

Just tried this on both a Pro v2 and a 16 Value, and both DO implement ports 38a/38b. Possibly some cards don't implement them, but I think based on that I'll commit this patch.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] OPL3 correction in Sound Blaster

Post by SarahWalker »

Committed at rev 619.
basic2004
Posts: 124
Joined: Sun 08 Jan, 2017 5:59 pm

Re: [Patch] OPL3 correction in Sound Blaster

Post by basic2004 »

Thanks!

I found OPL3(388h-38bh) supports differently with two revisions of SB Pro 2.
Earlier SB Pro 2 printed an ancient Creative Labs logo, this can't support 388h OPL3, plays like OPL2 (388h-389h).
Later SB Pro 2 printed a modern Creative Labs logo, this can support 388h OPL3 (388h-38bh).
SB16 can support 388h OPL3 (388h-38bh) certainly.

Conclusion : SB Pro 2 can support 388h-38bh OPL3, only later revision.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: [Patch] OPL3 correction in Sound Blaster

Post by omarsis81 »

Maybe we can differentiate both in PCem's config menu like

- Sound Blaster Pro 2 (YM3812) or (OPL2)
- Sound Blaster Pro 2 (YMF262) or (OPL3)

or, by their CT models, like CT1600, CT1620 or whatever their numbers are

Now that we are talking about the Sound Blaster Pro, I never liked how it was listed in the menu. Currently it says "Sound Blaster Pro v1" and "Sound Blaster Pro v2" that would lead to think that there were just one Sound Blaster Pro with a later revision (this case with the FMs chips maybe), but in reality there were just two Sound Blasters Pro! I would list them

- Sound Blaster Pro and
- Sound Blaster Pro 2

you can see in this pic Creative never used the "v1 or v2" in them
https://en.wikipedia.org/wiki/Sound_Bla ... Ct1600.jpg
basic2004
Posts: 124
Joined: Sun 08 Jan, 2017 5:59 pm

Re: [Patch] OPL3 correction in Sound Blaster

Post by basic2004 »

1.jpg
1.jpg (168.89 KiB) Viewed 10193 times
These are two revisions of Sound Blaster Pro 2 cards and different Creative logos.
Finally I got this photo, he agreed to upload this photo in forum.

I think, this should emulate it's maximum feature (possibility) if a model has different revisions, or their own.
Post Reply