Skip to content

AUDIO : hardware / software OPL2 / 3 (YM262 / YM3812) support for Atari TOS#7395

Closed
n0kturnal wants to merge 56 commits intoscummvm:masterfrom
n0kturnal:atari_opl_support_pr
Closed

AUDIO : hardware / software OPL2 / 3 (YM262 / YM3812) support for Atari TOS#7395
n0kturnal wants to merge 56 commits intoscummvm:masterfrom
n0kturnal:atari_opl_support_pr

Conversation

@n0kturnal
Copy link
Copy Markdown
Contributor

Added integration with nFM library (https://framagit.org/nokturnal/nfm), which provides driver layer for various OPL devices on Atari TOS target. Library is crossplatform, but changelist provides Atari support only for now. Integration might be extended to other platforms as well (if there will be any demand) with some additional work on library (mostly toolchain / packaging / testing related) and ScummVM side (rather minor, providing platform flags and enabling / disabling drivers depending on target).

It requires '--enable-nfm' switch and prebuilt library package for m68k-mintelf-gcc downloaded / built from repository or downloaded (I can provide prebuilt one for now) and copied to a folder set by '--with-nfm-prefix'). Enabling step will be added as separate PRs, right now change isn't enabled by default.

Software driver integration wasn't tested, might be revisited after Atari audio backend updates by @mikrosk .
I plan to remove dual opl2 on opl3 emulation at some point, right now I leaving it as is (want to implement something similar on nFM library level). Any comments or suggestions appreciated. Tested locally with / without switches provided. Formatted by AStyle with recommended set of switches.

Added integration with nFM library (https://framagit.org/nokturnal/nfm), which provides driver layer for various OPL devices. Changelist provides Atari support only for now, it might be extended to other platforms as well with some additional work. It requires build system adjustments either by prebuilding library directly from repository or downloading prebuilt package to a place folder set by '--with-nfm-prefix' and with --enable-nfm switch enabling nFM support in build). Software driver integration wasn't tested, might be revisited after Atari audio backend updates.
Copy link
Copy Markdown
Member

@sev- sev- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good to me.

Comment thread audio/nfmopl.h Outdated

extern "C"
{
#include "nfmcore.h"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be

Suggested change
#include "nfmcore.h"
#include <nfmcore.h>

Copy link
Copy Markdown
Contributor Author

@n0kturnal n0kturnal Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sev- Yes, you are right, corrected angled braces in all includes in follow up commit.

{ "sdlnet", "USE_SDL_NET", true, true, "SDL_net support" },
{ "discord", "USE_DISCORD", true, false, "Discord support" },
{ "retrowave", "USE_RETROWAVE", true, false, "RetroWave OPL3 support" },
{ "nFM", "USE_NFM", true, false, "Nokturnal nFM OPL2/OPL3 support" },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ "nFM", "USE_NFM", true, false, "Nokturnal nFM OPL2/OPL3 support" },
{ "nFM", "USE_NFM", true, false, "Nokturnal nFM OPL2/OPL3 support" },

So it is nicely aligned

Copy link
Copy Markdown
Contributor Author

@n0kturnal n0kturnal Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sev- Ok, fixed it in follow up commit.

Comment thread configure Outdated
_mad=auto
_opl2lpt=no
_retrowave=auto
_nfm=no
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have a test, why not do it auto?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sev- Turned out that test in configure script was broken, fixed it and set detection to auto as you suggested.

n0kturnal and others added 28 commits April 6, 2026 09:30
Fixed broken auto nFM tests in configure script, set library detection to auto ('--enable-nfm' is not needed if path '--with-nfm-prefix' is valid and contains library). Use angled braces for library includes. Minor formatting in create project as in suggested changes by SEV.
Currently translated at 100.0% (3076 of 3076 strings)
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: ScummVM/scummvm
Translate-URL: https://translations.scummvm.org/projects/scummvm/scummvm/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: ScummVM/scummvm
Translate-URL: https://translations.scummvm.org/projects/scummvm/scummvm/
Currently translated at 100.0% (3075 of 3075 strings)
This header is included more than once in ScummVM
But still switch to fullscreen after setting it up.
This avoids changing the window size in fullscreen which does not make
sense.
ccawley2011 and others added 18 commits April 6, 2026 09:50
# Conflicts:
#	audio/fmopl.cpp
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: ScummVM/scummvm
Translate-URL: https://translations.scummvm.org/projects/scummvm/scummvm/
Apple Clang has its own versioning, distinct from vanilla Clang.

Differentiate them, to avoid any ambiguity when reporting a compiler
version.  This relies on `__apple_build_version__`, as done by CMake.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: ScummVM/scummvm
Translate-URL: https://translations.scummvm.org/projects/scummvm/scummvm/
@n0kturnal
Copy link
Copy Markdown
Contributor Author

n0kturnal commented Apr 6, 2026

Had to sync with main branch and resolve conflict related to null opl driver changes. Also comma at the end of enum OplEmulator was removed in last commits related to null driver, so I had to readd it (added it as a part of 'USE_NFM' ifdef ). Disabled explicitly nFM on Coldfire target (it's unsupported atm).

@bluegr
Copy link
Copy Markdown
Member

bluegr commented Apr 6, 2026

This PR contains unrelated commits. Looks like an erroneous sync with master

@n0kturnal
Copy link
Copy Markdown
Contributor Author

@bluegr @sev- I will close this PR and resubmit new one in one commit, because this one became a mess and creating new one will be faster for me..

@mikrosk
Copy link
Copy Markdown
Contributor

mikrosk commented Apr 6, 2026

@n0kturnal no need to close the PR, just force-push your branch with new content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.