Commit graph

69 commits

Author SHA1 Message Date
Simon Howard
e3954613bd opl: Fix compile errors.
I think these were introduced when functions in the file were made
static, eg.
"static declaration of 'OPL3_EnvelopeGenOff' follows non-static declaration"
Make function prototypes static where appropriate.
2016-02-28 13:25:19 -05:00
nukeykt
166c3d2e9b opl: Fix tab characters 2016-02-28 21:59:12 +09:00
nukeykt
eb3cd65176 opl: Nuked OPL3 v1.7
Reformat the OPL3 code.
Remove the DBOPL core.
The OPL3 chip write delay implementation.
2016-02-28 21:53:03 +09:00
nukeykt
e25368ca6b opl:Nuked OPL emulator 2016-02-11 20:49:48 +09:00
Rodrigo Rebello
2e855ffeb6 opl: limit use of ioperm/inb/outb to x86 architecture
The use of I/O ports in the Linux driver to directly control OPL chips
is x86 specific and only really makes sense for x86-based PC's with
compatible hardware.

For some architectures (e.g. ARM), ioperm, inb and outb do exist and are
detected by the configure script (via AC_CHECK_FUNCS(ioperm)), but their
use is inappropriate in these cases and should be avoided.

In some other scenarios, like when using a GNU toolchain + uClibc for
PowerPC, the build even fails with the following error:

  opl_linux.c:26:20: fatal error: sys/io.h: No such file or directory

That is so because ioperm() is exported by uClibc and gets detected by
configure, which enables the "Linux" driver via definition of
HAVE_IOPERM, but in practice 'sys/io.h' is missing for ppc (inb/outb is
not implemented, and the call to ioperm() would return EIO anyway).

So, besides testing for HAVE_IOPERM, also test if either __i386__ or
__x86_64__ are defined before enabling this OPL driver.
2015-11-06 12:14:01 -02:00
Simon Howard
25c67b7160 opl: Change result from OPL_Init() to an enum.
This no longer returns a boolean value, but actually returns an
integer indicating the type of OPL chip that was detected. Change
the return value to have a more meaningful value.
2015-06-08 21:12:26 -04:00
Simon Howard
e986a93409 opl: Add missing function prototype to header.
Since the addition of OPL3 support, compile of opl_sdl.c generates a
warning because the declaration of Chip__GenerateBlock3() was not added
to dbopl.h.
2015-06-08 20:04:14 -04:00
Simon Howard
6b00568544 Fix tab character. 2015-05-30 13:06:47 -04:00
Nuke.YKT
1e516e3491 Text formatting. 2015-05-29 17:30:12 +09:00
Nuke.YKT
54c2e6d4e5 One result checking is enought to detect OPL3. 2015-05-29 02:12:23 +09:00
Nuke.YKT
7c377fc88a Added OPL3 mode support. 2015-05-29 02:00:45 +09:00
Simon Howard
981d972f3d Add missing #includes. 2015-04-10 23:42:01 -04:00
Dave Murphy
d66659c606 allow building in subdirectory or outside source directory 2014-12-26 15:40:46 +00:00
Simon Howard
e4d9b85aa4 opl: Use uint64_t for microsecond times.
Previous revamping of the OPL library changed delay times from ms
to us, and switched to 64-bit times for storage for them. However
this type change was botched and some functions were still using
32-bit arguments. Change to 64-bit types.

Thanks Quasar for reporting this. This fixes #438.
2014-10-07 22:47:29 -04:00
Simon Howard
72ce424207 opl: Change library to use us instead of ms.
Multi-track MIDI files are played back using separate callback chains
for each track, and this introduces the possibility of one track
becoming out of sync with the others. This was noticeable in WADs
that use multi-track MIDIs, such as Alien Vendetta. Increase the
timing resolution to microsecond precision to fix this.
2014-05-11 00:14:04 -04:00
Simon Howard
495694da29 opl: Add API to adjust tempo.
When the tempo is changed, the times on all active timers must be
adjusted to match the new timing values. Add an API to do this and
invoke it when a tempo change meta event is read.
2014-05-10 14:00:41 -04:00
Simon Howard
7684ddcfd8 Clean up file headers.
This change rewrites and simplifies the copyright headers at the top
of all source files:

 * Remove "Emacs style mode select" line; this line was included in
   the headers for the originally released source files and appears
   to be to set the file type for old versions of Emacs. I'm not sure
   entirely why it was required but I don't think it is any more.
 * Remove "You should have received a copy of..." text from copyright
   header. This refers to the old 59 Temple Place address where the
   FSF headquarters used to be located and is no longer correct.
   Rather than change to the new address, just remove the paragraph
   as it is superfluous anyway. This fixes #311.
 * Remove ---- separator lines so that the file headers are barer
   and more simplified.
2014-05-05 00:20:54 -04:00
Simon Howard
63acb55b18 Remove Windows CE support.
What support exists is for obsolete devices I no longer possess; I've
never been contacted about the port and it's been several years since
I even bothered to build a new version. All the extra overrides are
clutter that can just be removed.

Subversion-branch: /branches/v2-branch
Subversion-revision: 2615
2013-08-11 17:32:29 +00:00
James Haley
ec74db9272 Support for Win32 native OPL output when compiled with Microsoft Visual
C++. Confirmed to work with Aureal Vortex AU8830 in Win98SE by
GhostlyDeath.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2331
2011-04-26 05:49:53 +00:00
Simon Howard
6a5d123fc6 Fix Visual Studio build (thanks GhostlyDeath).
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2287
2011-03-03 21:41:51 +00:00
Simon Howard
c53762058b Don't double OPL sample values, as it causes horrible things to happen
with the Heretic title screen music.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1988
2010-08-31 19:59:24 +00:00
Simon Howard
966089e8bd Shut up compiler warning.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1964
2010-08-22 17:59:12 +00:00
Simon Howard
60226b1183 Fix volume multiply; DBOPL now generating output.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1957
2010-08-15 15:23:28 +00:00
Simon Howard
578a06c798 Hook DBOPL into OPL library and remove FMOPL. Does not generate any
sound yet.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1956
2010-08-15 14:57:37 +00:00
Simon Howard
6ebf557c44 Add C-converted version of DOSbox OPL emulator.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1955
2010-08-13 18:42:52 +00:00
Simon Howard
695b64ce29 Add OPL-TODO to dist, set svn:ignore properties.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1880
2010-03-08 18:52:59 +00:00
Simon Howard
b9e1822962 Load advapi32.dll pointers dynamically at runtime. This should fix any
potential problems with that library not existing on Win9x.

Subversion-branch: /branches/opl-branch
Subversion-revision: 1877
2010-03-08 00:51:00 +00:00
Simon Howard
92c9d5c388 Use wide-character versions of Win32 API functions. Clean up properly if
it was not possible to start the ioperm service.

Subversion-branch: /branches/opl-branch
Subversion-revision: 1875
2010-02-27 19:11:24 +00:00
Simon Howard
77ea97c627 When loading driver, pass the full path to the ioperm.sys file.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1874
2010-02-27 18:57:46 +00:00
Simon Howard
1398c8aed3 Fix race condition with condition variable freed before it is signaled.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1873
2010-02-27 17:48:25 +00:00
Simon Howard
06b97d2d11 Add OPL hardware playback support for Windows NT-based systems.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1871
2010-02-26 21:07:59 +00:00
Simon Howard
cdacf59ace Add a hint message about permissions if unable to get I/O permissions
for hardware OPL access.

Subversion-branch: /branches/opl-branch
Subversion-revision: 1844
2010-02-05 03:27:58 +00:00
Simon Howard
a8e7930856 Change GetSliceSize() to always return a power of two.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1724
2009-10-17 22:45:22 +00:00
Simon Howard
e30325c40f Add OPL library API function to set software emulation sample rate, and
set from snd_samplerate in the configuration file.

Subversion-branch: /branches/opl-branch
Subversion-revision: 1723
2009-10-17 22:36:15 +00:00
Simon Howard
73cc6b5a60 Make OpenBSD native OPL backend work on x86_64 as well as i386.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1707
2009-10-04 04:21:40 +00:00
Simon Howard
073e710f68 Use Mix_HookMusic rather than Mix_SetPostMix for OPL emulation, to avoid
conflict with PC speaker emulation.

Subversion-branch: /branches/opl-branch
Subversion-revision: 1706
2009-10-03 22:43:07 +00:00
Simon Howard
4a70f989d2 Convert to American English spellings.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1700
2009-10-01 00:08:48 +00:00
Simon Howard
b8b755758c Initialize dwOSVersionInfoSize before calling GetVersionEx().
Subversion-branch: /branches/opl-branch
Subversion-revision: 1697
2009-09-30 01:13:18 +00:00
Simon Howard
d484bfaf00 Add Win9x native OPL driver (untested).
Subversion-branch: /branches/opl-branch
Subversion-revision: 1696
2009-09-30 00:11:44 +00:00
Simon Howard
de66c6b967 Set privilege level to 3, not 1.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1694
2009-09-27 00:40:55 +00:00
Simon Howard
dce2c95f05 Move register read/write code into OPL library. Detect OPL in the
library code, so that we fall back to software emulation if we have port
access but an OPL is not detected. Fix detection of ioperm in configure.

Subversion-branch: /branches/opl-branch
Subversion-revision: 1692
2009-09-26 23:52:41 +00:00
Simon Howard
6f3d0abb12 Add OpenBSD/NetBSD native OPL backend.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1690
2009-09-26 19:56:24 +00:00
Simon Howard
07f5024578 Disable OPL debug output.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1689
2009-09-24 21:57:21 +00:00
Simon Howard
79698ecfd9 Implement pausing of music.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1688
2009-09-21 22:20:33 +00:00
Simon Howard
076adeb0aa Add method to clear all existing callbacks.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1642
2009-08-30 12:07:04 +00:00
Simon Howard
a10180a460 Use OPL_Delay to wait 1ms for timer to expire when doing OPL detect.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1638
2009-08-29 21:26:43 +00:00
Simon Howard
6cae0f05cf Don't crash if OPL is shutdown after SDL was initialised.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1635
2009-08-29 21:03:24 +00:00
Simon Howard
e7262d2a88 Fix crash when specifying an invalid filename.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1634
2009-08-29 20:12:49 +00:00
Simon Howard
ca065a06ca Set timer callback for OPL emulator so that the adlib detection routine
works.

Subversion-branch: /branches/opl-branch
Subversion-revision: 1633
2009-08-29 20:08:21 +00:00
Simon Howard
e33a496133 Working SDL OPL driver.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1632
2009-08-28 18:04:04 +00:00