2 * AdPlug - Replayer for many OPL2/OPL3 audio file formats.
3 * Copyright (C) 1999 - 2005 Simon Peter <dn.tlp@gmx.net>, et al.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * realopl.h - Real hardware OPL, by Simon Peter <dn.tlp@gmx.net>
22 #ifndef H_ADPLUG_REALOPL
23 #define H_ADPLUG_REALOPL
27 #define DFL_ADLIBPORT 0x388 // default adlib baseport
29 class CRealopl: public Copl
32 CRealopl(unsigned short initport = DFL_ADLIBPORT); // initport = OPL2 hardware baseport
34 bool detect(); // returns true if adlib compatible board is found, else false
35 void setvolume(int volume); // set adlib master volume (0 - 63) 0 = loudest, 63 = softest
36 void setquiet(bool quiet = true); // sets the OPL2 quiet, while still writing to the registers
37 void setport(unsigned short port) // set new OPL2 hardware baseport
41 void setnowrite(bool nw = true) // set hardware write status
46 int getvolume() // get adlib master volume
52 void write(int reg, int val);
54 void settype(ChipType type)
60 void hardwrite(int reg, int val); // write to OPL2 hardware registers
61 bool harddetect(); // do real hardware detection
63 static const unsigned char op_table[9]; // the 9 operators as expected by the OPL2
65 unsigned short adlport; // adlib hardware baseport
66 int hardvol, oldvol; // hardware master volume
67 bool bequiet; // quiet status cache
68 char hardvols[2][22][2]; // volume cache
69 bool nowrite; // don't write to hardware, if true