VOGONS


Adlib/FM emulation: I want it too!

Topic actions

  • This topic is locked. You cannot reply or edit posts.

First post, by deeped

User metadata
Rank Newbie
Rank
Newbie

Hi there,

you guys know the DOSbox emulates the AdLIB/FM sounds... this question is for the developers: how to do it by? By DirectSound? (I only interested on Win32 platform). If so, how can I "borrow" it from the source? Which source files uses and how? I used to deal with Adlib in DOS platform. I know its can be used by 388h, 389 ports. Question is again: how to use it to make sounds by writing 388, 389 "ports"?

Reply 7 of 14, by Roxor

User metadata
Rank Newbie
Rank
Newbie

Mate, if you don't like C++, I think you'll have to write your own FM engine from scratch.

You'd probably be better off learning C++, though, seeing as practically everything seems to be written in either C or C++.

By the way guys, thanks for pointing out those source files. They may prove useful in helping me write my own FM engine.

Reply 11 of 14, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

For your way around in dosbox: have a look at adlib.cpp, function OPL_Write().
This handles writes to 0x388/0x389, they'll finally arrive at function
OPLWriteReg() (fmopl.c) or OPL3WriteReg() (ymf262.c). Both functions
control the state of the synthesis.
Then look at OPL_CallBack() in adlib.cpp, that is YM3812UpdateOne()
for fmopl.c and YMF262UpdateOne() for ymf262.c, they generate the
actual output depending on the state.
But you'll definitely need some understanding of C for this to be usable.

Reply 13 of 14, by deeped

User metadata
Rank Newbie
Rank
Newbie

okay finally I started it 😀 its not so hard to implement this in Delphi but.... could you give me more information please? I meant the initial stepts too, tricks or.... which C/C++ files needed only? In addition, Microsoft Visual C++ 6 Standard will be good for me?