AUDIO - Nuked OPL3 Patch for DOSBox(+Windows build) (SDL1)

Here you can discuss the development of patches.

AUDIO - Nuked OPL3 Patch for DOSBox(+Windows build) (SDL1)

Postby nukeykt » 2016-8-03 @ 14:11

This patch adds my Nuked OPL3 emulator to DOSBox SVN.
Set oplemu to nuked in config file. Also set oplrate and mixer rate to 49716 for best sound quality.
You do not have the required permissions to view the files attached to this post.
nukeykt
Newbie
 
Posts: 91
Joined: 2013-8-28 @ 11:11
Location: Russia


Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby James-F » 2016-8-28 @ 11:10

Make absolutely sure that both the Mixer and oplrate set to 49716 in DOSBox config else there is high level of harmonic distortion in the OPL emulation.
User avatar
James-F
Oldbie
 
Posts: 1405
Joined: 2015-11-30 @ 04:10

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby KainXVIII » 2016-8-31 @ 11:51

James-F wrote:Make absolutely sure that both the Mixer and oplrate set to 49716 in DOSBox config else there is high level of harmonic distortion in the OPL emulation.

What about real sound card setting? 48KHz is not enough and you need set higher (i.e. 96KHz if you can, of course)?
User avatar
KainXVIII
Member
 
Posts: 221
Joined: 2015-5-20 @ 15:04
Location: Yaroslavl

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby James-F » 2016-9-02 @ 10:00

No, for the real sound card DirectX (if you are on Windows) handles the sample rate conversion so everything should be right.
SDL which DOSBox uses for audio has far from alright sample rate conversion.

Anything but 49716 on both mixer and OPL, sounds distorted and noisy.
This applies to the Fast/Compat modes as well as for Nuked.

49.png

44.png

48.png


Real OPL3 for reference (YMF719):
YMF719.png
You do not have the required permissions to view the files attached to this post.
User avatar
James-F
Oldbie
 
Posts: 1405
Joined: 2015-11-30 @ 04:10

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby synamax » 2016-10-02 @ 22:28

Awesome stuff! I'm currently listening to MegaRace's music right now and it sounds perfect! At first, the song "Maeva" was playing weird but it turns out I had the oplmode set to "opl3gold" (which I turned on earlier for my reverse engineer work on Dune and MegaRace's music format). Everything went back to normal once I switched the oplmode back to "opl3". Keep up the excellent work!
User avatar
synamax
Newbie
 
Posts: 69
Joined: 2016-9-07 @ 04:57

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby notindeed » 2017-1-09 @ 17:58

Is this now added to any of the dosbox forks? (As the attached is 64bit only).

Or can I just use this : viewtopic.php?f=9&t=36667 and then set dosbox to use it as midi? (i'm guessing not as i don't think dosbox supports external soundcard emulation?)
notindeed
Newbie
 
Posts: 78
Joined: 2010-9-19 @ 01:08

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby James-F » 2017-1-09 @ 18:14

The user Yesterplay80 is compiling all the latest SVN versions with many useful patches.
https://drive.google.com/drive/folders/0BxEUSpZ8xHkvaW1aYXlRRkRpVE0

The Enhanced version has a PATCHES.TXT which lists all the patches applied to the SVN.
Including the bit perfect Nuked OPL3 emulation.
User avatar
James-F
Oldbie
 
Posts: 1405
Joined: 2015-11-30 @ 04:10

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby notindeed » 2017-1-10 @ 01:00

Thanks, I'll try it.

Are there any good crt filters/shaders for dosbox too? That's something I always missed (along with scaling options)
notindeed
Newbie
 
Posts: 78
Joined: 2010-9-19 @ 01:08

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby James-F » 2017-6-09 @ 09:22

@nukeykt
Do you have a YM3812 version too of nukedOPL?
I ask because SB1.x,SB2.0,SBPro1 are still using the less accurate OPL2 emulation.
User avatar
James-F
Oldbie
 
Posts: 1405
Joined: 2015-11-30 @ 04:10

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby nukeykt » 2017-6-09 @ 10:45

James-F wrote:@nukeykt
Do you have a YM3812 version too of nukedOPL?
I ask because SB1.x,SB2.0,SBPro1 are still using the less accurate OPL2 emulation.

No. I cancelled it due to 2 reasons:
1) For me OPL2 sounds exactly like OPL3. Indeed, Nuked OPL3 sounds closer to OPL2 than any OPL2 emulator.
2) As i mentioned earlier, i'm busy with OPN2 emulator.
You can use OPL3 with blocked high ports. It will behave almost like real OPL2, except CSM(never was used), WSE bit(enables 4 waveforms on OPL2. These waves always active on OPL3)
nukeykt
Newbie
 
Posts: 91
Joined: 2013-8-28 @ 11:11
Location: Russia

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby James-F » 2017-6-09 @ 10:57

Alright, the question is whether your patch activates the NukedOPL core on the SBPro1 and SB1/2 cards in dosbox?
User avatar
James-F
Oldbie
 
Posts: 1405
Joined: 2015-11-30 @ 04:10

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby nukeykt » 2017-6-09 @ 11:06

James-F wrote:Alright, the question is whether your patch activates the NukedOPL core on the SBPro1 and SB1/2 cards in dosbox?

Yes. It should. Except SBPro 1 it behaves like OPL3 in OPL2 mode. DOSBox actually uses OPL3 to emulate Dual OPL2, so Rhythm mode can be broken.
nukeykt
Newbie
 
Posts: 91
Joined: 2013-8-28 @ 11:11
Location: Russia

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby James-F » 2017-6-10 @ 15:46

A programmer friend asks a question about how nukedOPL enabled OPL2 modes:
"How do I set NukedOPL into OPL2 and Dual OPL2 modes?"
User avatar
James-F
Oldbie
 
Posts: 1405
Joined: 2015-11-30 @ 04:10

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby nukeykt » 2017-6-10 @ 16:27

James-F wrote:A programmer friend asks a question about how nukedOPL enabled OPL2 modes:
"How do I set NukedOPL into OPL2 and Dual OPL2 modes?"

For OPL2 just ignore high bank writes. There are two ways to emulate Dual OPL2:
1) "True" Dual OPL2: Just run two instances of the Nuked OPL3 for each OPL2. But it would be heavy for CPU.
2) DOSBox way: Enable OPL3 mode. Set L/R panning. And just map first OPL2 chip commands to first bank, and second chip commands to second bank. You should also filter and block OPL3 specific commands. Look DOSBox source code for further information.
nukeykt
Newbie
 
Posts: 91
Joined: 2013-8-28 @ 11:11
Location: Russia

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby James-F » 2017-6-10 @ 17:18

nukeykt,
Is this how dosbox does OPL2 with its cores, It just ignores high bank writes when using the opl core?
It seems that there is a separate OPL2 emulation in dbopl cores besides the OPL3.
User avatar
James-F
Oldbie
 
Posts: 1405
Joined: 2015-11-30 @ 04:10

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby Battler » 2017-6-10 @ 17:42

The friend in question is me. I am doing this in 86Box which is a fork of PCem. It uses (old?) dbopl.cpp, which has a variable that when turned off, makes the code pretend to be an OPL 2 and make the required adjustments. But nukedopl.cpp has no such switch and I'd rather not write my own code to do such adjustments because I have no idea how to do it right.
Battler
Newbie
 
Posts: 62
Joined: 2014-3-22 @ 21:27

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby nukeykt » 2017-6-10 @ 17:47

James-F wrote:nukeykt,
Is this how dosbox does OPL2 with its cores, It just ignores high bank writes when using the opl core?
It seems that there is a separate OPL2 emulation in dbopl cores besides the OPL3.

DBOPL is a combined OPL2/OPL3 emulator. When OPL3 mode disabled it emulates OPL2, when you enable OPL3 it emulates OPL3. But in fact it only affects on WSE bit, which was removed in OPL3.
OPL3 in OPL2 mode should be good. OPL3 mode register is on high bank. So you never will be able to enable OPL3 mode with blocked bank. It'll stuck in OPL2 mode.
nukeykt
Newbie
 
Posts: 91
Joined: 2013-8-28 @ 11:11
Location: Russia

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby nukeykt » 2017-6-10 @ 17:53

Battler wrote:The friend in question is me. I am doing this in 86Box which is a fork of PCem. It uses (old?) dbopl.cpp, which has a variable that when turned off, makes the code pretend to be an OPL 2 and make the required adjustments. But nukedopl.cpp has no such switch and I'd rather not write my own code to do such adjustments because I have no idea how to do it right.

OPL3 was designed to be fully OPL2 compatibly. Yamaha added second register bank for extra channels. It's mapped to 0x222-0x223 and 0x38a-0x38b ports. Register which enables OPL3 mode is located on high bank. So it's enought to block writes to high bank.
nukeykt
Newbie
 
Posts: 91
Joined: 2013-8-28 @ 11:11
Location: Russia

Re: Nuked OPL3 Patch for DOSBox(+Windows build)

Postby Battler » 2017-6-10 @ 18:02

So basically, all I need to do is not map the high bank, and that's it?
Battler
Newbie
 
Posts: 62
Joined: 2014-3-22 @ 21:27

Next

Return to DOSBox Patches

Who is online

Users browsing this forum: Yesterplay80 and 1 guest