Commit graph

28 commits

Author SHA1 Message Date
graham sanderson
368a6210f7 squashed rp2040-doom changes 2022-03-07 12:44:30 -06: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
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
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
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
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
4a70f989d2 Convert to American English spellings.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1700
2009-10-01 00:08:48 +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
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
e33a496133 Working SDL OPL driver.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1632
2009-08-28 18:04:04 +00:00
Simon Howard
b09cb29b9f Disable debug output.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1541
2009-06-02 01:08:20 +00:00
Simon Howard
98ee23f426 Add initial callback/timer API.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1538
2009-05-30 23:24:11 +00:00
Simon Howard
d9f55dd56c Fix compile warning.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1491
2009-03-29 22:40:44 +00:00
Simon Howard
962d6dcf12 Debug trace code for register writes.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1462
2009-03-11 20:20:05 +00:00
Simon Howard
84a05be9db Add OPL lib plumbing and Linux native driver.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1458
2009-03-10 21:55:55 +00:00
Simon Howard
9f8ab35852 Add opl library main header and stub functions.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1455
2009-03-10 00:02:41 +00:00