VOGONS

Common searches


First post, by nukeykt

User metadata
Rank Member
Rank
Member

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.

Attachments

  • Filename
    dosbox-nuked-opl.zip
    File size
    986.75 KiB
    Downloads
    723 downloads
    File comment
    DOSBox SVN r3990 Build for Windows with Nuked OPL3
    File license
    Fair use/fair dealing exception
  • Filename
    nukedopl.patch
    File size
    46.51 KiB
    Downloads
    643 downloads
    File comment
    Patch
    File license
    Fair use/fair dealing exception

Reply 2 of 48, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

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.


my important / useful posts are here

Reply 3 of 48, by KainXVIII

User metadata
Rank Oldbie
Rank
Oldbie
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)?

Reply 4 of 48, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

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
Filename
49.png
File size
72.54 KiB
Views
22919 views
File license
Fair use/fair dealing exception
44.png
Filename
44.png
File size
149.06 KiB
Views
22919 views
File license
Fair use/fair dealing exception
48.png
Filename
48.png
File size
137.57 KiB
Views
22919 views
File license
Fair use/fair dealing exception

Real OPL3 for reference (YMF719):

YMF719.png
Filename
YMF719.png
File size
115.96 KiB
Views
22918 views
File license
Fair use/fair dealing exception


my important / useful posts are here

Reply 5 of 48, by synamax

User metadata
Rank Newbie
Rank
Newbie

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!

Reply 6 of 48, by notindeed

User metadata
Rank Newbie
Rank
Newbie

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

Or can I just use this : Windows, Doom, Apogee OPL3 Synthesizer. and then set dosbox to use it as midi? (i'm guessing not as i don't think dosbox supports external soundcard emulation?)

Reply 7 of 48, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

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

The Enhanced version has a PATCHES.TXT which lists all the patches applied to the SVN.
Including the bit perfect Nuked OPL3 emulation.


my important / useful posts are here

Reply 10 of 48, by nukeykt

User metadata
Rank Member
Rank
Member
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)

Reply 12 of 48, by nukeykt

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

Reply 14 of 48, by nukeykt

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

Reply 15 of 48, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

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.


my important / useful posts are here

Reply 16 of 48, by Battler

User metadata
Rank Member
Rank
Member

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.

Reply 17 of 48, by nukeykt

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

Reply 18 of 48, by nukeykt

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