diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2010-07-31 08:33:21 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2010-07-31 08:33:21 +0000 |
commit | 46e610fe37574a1c48397debbf41721c69bd2535 (patch) | |
tree | d4be1fe11784511ca1c06ce3ae9c8d28dada5f1b /sys | |
parent | 8e5f8ef5637044f0c1e9bbc9736e7a9604b97a12 (diff) |
remove the ``midisyn'' framework and anything using it, i.e., the opl
device and the midi interface to pcppi.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/alpha/conf/GENERIC | 8 | ||||
-rw-r--r-- | sys/arch/amd64/conf/GENERIC | 9 | ||||
-rw-r--r-- | sys/arch/i386/conf/GENERIC | 12 | ||||
-rw-r--r-- | sys/arch/macppc/conf/GENERIC | 7 | ||||
-rw-r--r-- | sys/arch/sparc64/conf/GENERIC | 7 | ||||
-rw-r--r-- | sys/conf/files | 9 | ||||
-rw-r--r-- | sys/dev/ic/opl.c | 610 | ||||
-rw-r--r-- | sys/dev/ic/opl3sa3reg.h | 243 | ||||
-rw-r--r-- | sys/dev/ic/oplinstrs.c | 501 | ||||
-rw-r--r-- | sys/dev/ic/oplreg.h | 139 | ||||
-rw-r--r-- | sys/dev/ic/oplvar.h | 85 | ||||
-rw-r--r-- | sys/dev/isa/files.isa | 14 | ||||
-rw-r--r-- | sys/dev/isa/midi_pcppi.c | 149 | ||||
-rw-r--r-- | sys/dev/isa/opl_ess.c | 98 | ||||
-rw-r--r-- | sys/dev/isa/opl_isa.c | 98 | ||||
-rw-r--r-- | sys/dev/isa/opl_sb.c | 97 | ||||
-rw-r--r-- | sys/dev/midisyn.c | 421 | ||||
-rw-r--r-- | sys/dev/midisynvar.h | 91 | ||||
-rw-r--r-- | sys/dev/pci/files.pci | 11 | ||||
-rw-r--r-- | sys/dev/pci/opl_cmpci.c | 95 | ||||
-rw-r--r-- | sys/dev/pci/opl_eso.c | 102 | ||||
-rw-r--r-- | sys/dev/pci/opl_yds.c | 102 |
22 files changed, 8 insertions, 2900 deletions
diff --git a/sys/arch/alpha/conf/GENERIC b/sys/arch/alpha/conf/GENERIC index 243fc3f4658..161d87acd24 100644 --- a/sys/arch/alpha/conf/GENERIC +++ b/sys/arch/alpha/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.213 2010/07/03 03:59:16 krw Exp $ +# $OpenBSD: GENERIC,v 1.214 2010/07/31 08:33:20 ratchov Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -331,7 +331,6 @@ isapnp0 at isa? mcclock* at isa? port 0x70 pcppi* at isa? # PC prog. periph. interface spkr0 at pcppi? # IBM BASIC emulation -midi* at pcppi? pckbc* at isa? # PC keyboard controller pckbd* at pckbc? # PC keyboard (kbd port) pms* at pckbc? # PS/2-style mouse (aux port) @@ -404,12 +403,7 @@ fms* at pci? # Forte Media FM801 auvia* at pci? # VIA VT82C686A ## -# OPL[23] FM synthesizers -opl* at eso? -opl* at cmpci? - # MIDI support -midi* at opl? # OPL FM synth midi* at eap? #Audio Support diff --git a/sys/arch/amd64/conf/GENERIC b/sys/arch/amd64/conf/GENERIC index fed50eee793..65009359de1 100644 --- a/sys/arch/amd64/conf/GENERIC +++ b/sys/arch/amd64/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.295 2010/07/27 00:40:19 deraadt Exp $ +# $OpenBSD: GENERIC,v 1.296 2010/07/31 08:33:20 ratchov Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -558,14 +558,7 @@ yds* at pci? flags 0x0000 # Yamaha YMF Audio emu* at pci? # SB Live! mpu* at isa? port 0x330 -# OPL[23] FM synthesizers -#opl* at eso? -opl* at yds? -opl* at cmpci? - # MIDI support -midi* at pcppi? # MIDI interface to the PC speaker -midi* at opl? # OPL FM synth #midi* at autri? midi* at eap? midi* at mpu? diff --git a/sys/arch/i386/conf/GENERIC b/sys/arch/i386/conf/GENERIC index 3a5d646414a..5f95aeaf388 100644 --- a/sys/arch/i386/conf/GENERIC +++ b/sys/arch/i386/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.690 2010/07/26 11:29:23 pirofti Exp $ +# $OpenBSD: GENERIC,v 1.691 2010/07/31 08:33:20 ratchov Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -737,18 +737,8 @@ ym* at isapnp? mpu* at isapnp? mpu* at isa? port 0x300 # generic MPU, Yamaha SW60XG -# OPL[23] FM synthesizers -#opl0 at isa? port 0x388 # use only if not attached to sound card -opl* at eso? -opl* at sb? -opl* at ess? -opl* at yds? -opl* at cmpci? - # MIDI support -midi* at pcppi? # MIDI interface to the PC speaker midi* at sb? # SB MPU401 port -midi* at opl? # OPL FM synth midi* at ym? midi* at mpu? midi* at autri? diff --git a/sys/arch/macppc/conf/GENERIC b/sys/arch/macppc/conf/GENERIC index 770aefca7c8..b0fe446f761 100644 --- a/sys/arch/macppc/conf/GENERIC +++ b/sys/arch/macppc/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.197 2010/07/03 03:59:16 krw Exp $g +# $OpenBSD: GENERIC,v 1.198 2010/07/31 08:33:20 ratchov Exp $g # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -369,13 +369,8 @@ audio* at uaudio? audio* at aoa? audio* at daca? -# OPL[23] FM synthesizers -opl* at cmpci? -opl* at eso? - # MIDI support midi* at eap? -midi* at opl? sd* at scsibus? st* at scsibus? diff --git a/sys/arch/sparc64/conf/GENERIC b/sys/arch/sparc64/conf/GENERIC index 9a80595d6c8..d876829e78b 100644 --- a/sys/arch/sparc64/conf/GENERIC +++ b/sys/arch/sparc64/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.252 2010/07/03 03:59:17 krw Exp $ +# $OpenBSD: GENERIC,v 1.253 2010/07/31 08:33:20 ratchov Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -157,13 +157,8 @@ audio* at eap? audio* at emu? audio* at eso? -# OPL[23] FM synthesizers -opl* at cmpci? -opl* at eso? - # MIDI support midi* at autri? -midi* at opl? midi* at eap? # USB Controllers diff --git a/sys/conf/files b/sys/conf/files index 4f5e41e0b57..2a9f3db6141 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,4 +1,4 @@ -# $OpenBSD: files,v 1.498 2010/07/20 15:28:43 matthew Exp $ +# $OpenBSD: files,v 1.499 2010/07/31 08:33:19 ratchov Exp $ # $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 @@ -15,7 +15,6 @@ define atascsi {} define ifmedia define mii {[phy = -1]} define midibus {} -define midisyn define radiobus {} define i2cbus {} define gpiobus {} @@ -324,11 +323,6 @@ file dev/ic/pckbc.c pckbc needs-flag device pcfiic: i2cbus file dev/ic/pcf8584.c pcfiic -# OPL2/OPL3 FM synth driver -device opl: midibus, midisyn -file dev/ic/opl.c opl -file dev/ic/oplinstrs.c opl - # AC-97 CODECs define ac97 file dev/ic/ac97.c ac97 @@ -605,7 +599,6 @@ file dev/ic/lm700x.c lm700x file dev/ic/tc921x.c tc921x file dev/ic/pt2254a.c pt2254a file dev/midi.c midi | midibus needs-flag -file dev/midisyn.c midisyn file dev/mulaw.c mulaw file dev/sequencer.c sequencer needs-flag file dev/systrace.c systrace needs-flag diff --git a/sys/dev/ic/opl.c b/sys/dev/ic/opl.c deleted file mode 100644 index 510517764cb..00000000000 --- a/sys/dev/ic/opl.c +++ /dev/null @@ -1,610 +0,0 @@ -/* $OpenBSD: opl.c,v 1.10 2009/11/29 19:51:21 ratchov Exp $ */ -/* $NetBSD: opl.c,v 1.7 1998/12/08 14:26:56 augustss Exp $ */ - -/* - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Lennart Augustsson (augustss@netbsd.org). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * The OPL3 (YMF262) manual can be found at - * ftp://ftp.yamahayst.com/pub/Fax_Back_Doc/Sound/YMF262.PDF - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/errno.h> -#include <sys/ioctl.h> -#include <sys/syslog.h> -#include <sys/device.h> -#include <sys/selinfo.h> - -#include <machine/cpu.h> -#include <machine/bus.h> - -#include <sys/audioio.h> -#include <sys/midiio.h> -#include <dev/audio_if.h> - -#include <dev/midi_if.h> -#include <dev/midivar.h> -#include <dev/midisynvar.h> - -#include <dev/ic/oplreg.h> -#include <dev/ic/oplvar.h> - -#ifdef AUDIO_DEBUG -#define DPRINTF(x) if (opldebug) printf x -#define DPRINTFN(n,x) if (opldebug >= (n)) printf x -int opldebug = 0; -#else -#define DPRINTF(x) -#define DPRINTFN(n,x) -#endif - -struct real_voice { - u_int8_t voice_num; - u_int8_t voice_mode; /* 0=unavailable, 2=2 OP, 4=4 OP */ - u_int8_t iooffs; /* I/O port (left or right side) */ - u_int8_t op[4]; /* Operator offsets */ -}; - -const struct opl_voice voicetab[] = { -/* No I/O offs OP1 OP2 OP3 OP4 */ -/* --------------------------------------------------- */ - { 0, OPL_L, {0x00, 0x03, 0x08, 0x0b}}, - { 1, OPL_L, {0x01, 0x04, 0x09, 0x0c}}, - { 2, OPL_L, {0x02, 0x05, 0x0a, 0x0d}}, - - { 3, OPL_L, {0x08, 0x0b, 0x00, 0x00}}, - { 4, OPL_L, {0x09, 0x0c, 0x00, 0x00}}, - { 5, OPL_L, {0x0a, 0x0d, 0x00, 0x00}}, - - { 6, OPL_L, {0x10, 0x13, 0x00, 0x00}}, - { 7, OPL_L, {0x11, 0x14, 0x00, 0x00}}, - { 8, OPL_L, {0x12, 0x15, 0x00, 0x00}}, - - { 0, OPL_R, {0x00, 0x03, 0x08, 0x0b}}, - { 1, OPL_R, {0x01, 0x04, 0x09, 0x0c}}, - { 2, OPL_R, {0x02, 0x05, 0x0a, 0x0d}}, - { 3, OPL_R, {0x08, 0x0b, 0x00, 0x00}}, - { 4, OPL_R, {0x09, 0x0c, 0x00, 0x00}}, - { 5, OPL_R, {0x0a, 0x0d, 0x00, 0x00}}, - - { 6, OPL_R, {0x10, 0x13, 0x00, 0x00}}, - { 7, OPL_R, {0x11, 0x14, 0x00, 0x00}}, - { 8, OPL_R, {0x12, 0x15, 0x00, 0x00}} -}; - -static void opl_probe_command(struct opl_attach_arg *, int, int); -static void opl_command(struct opl_softc *, int, int, int); -void opl_reset(struct opl_softc *); -void opl_freq_to_fnum (int freq, int *block, int *fnum); - -int oplsyn_open(midisyn *ms, int); -void oplsyn_close(midisyn *); -void oplsyn_reset(void *); -void oplsyn_noteon(midisyn *, u_int32_t, u_int32_t, u_int32_t); -void oplsyn_noteoff(midisyn *, u_int32_t, u_int32_t, u_int32_t); -void oplsyn_keypressure(midisyn *, u_int32_t, u_int32_t, u_int32_t); -void oplsyn_ctlchange(midisyn *, u_int32_t, u_int32_t, u_int32_t); -void oplsyn_pitchbend(midisyn *, u_int32_t, u_int32_t, u_int32_t); -void oplsyn_loadpatch(midisyn *, struct sysex_info *, struct uio *); - - -void opl_set_op_reg(struct opl_softc *, int, int, int, u_char); -void opl_set_ch_reg(struct opl_softc *, int, int, u_char); -void opl_load_patch(struct opl_softc *, int); -u_int32_t opl_get_block_fnum(int freq); -int opl_calc_vol(int regbyte, int volume, int main_vol); - -struct cfdriver opl_cd = { - NULL, "opl", DV_DULL -}; - -struct midisyn_methods opl3_midi = { - oplsyn_open, - oplsyn_close, - 0, - 0, - oplsyn_noteon, - oplsyn_noteoff, - oplsyn_keypressure, - oplsyn_ctlchange, - 0, - 0, - oplsyn_pitchbend, - 0 -}; - -void -opl_attach(sc) - struct opl_softc *sc; -{ - int i; - struct opl_attach_arg oaa; - - oaa.iot = sc->iot; - oaa.ioh = sc->ioh; - oaa.offs = sc->offs; - oaa.done = 0; - - if ((sc->model = opl_find(&oaa)) == 0) { - printf("\nopl: find failed\n"); - return; - } - - sc->syn.mets = &opl3_midi; - snprintf(sc->syn.name, sizeof sc->syn.name, "%sYamaha OPL%d", - sc->syn.name, sc->model); - sc->syn.data = sc; - sc->syn.nvoice = sc->model == OPL_2 ? OPL2_NVOICE : OPL3_NVOICE; - sc->syn.flags = MS_DOALLOC | MS_FREQXLATE; - midisyn_attach(&sc->mididev, &sc->syn); - - /* Set up voice table */ - for (i = 0; i < OPL3_NVOICE; i++) - sc->voices[i] = voicetab[i]; - - opl_reset(sc); - - printf(": model OPL%d\n", sc->model); - - midi_attach_mi(&midisyn_hw_if, &sc->syn, &sc->mididev.dev); -} - -static void -opl_probe_command(oaa, addr, data) - struct opl_attach_arg *oaa; - int addr, data; -{ - DPRINTFN(4, ("opl_probe_command: addr=0x%02x data=0x%02x\n", - addr, data)); - bus_space_write_1(oaa->iot, oaa->ioh, OPL_ADDR + OPL_L + oaa->offs, - addr); - delay(10); - bus_space_write_1(oaa->iot, oaa->ioh, OPL_DATA + OPL_L + oaa->offs, - data); - delay(30); -} - -static void -opl_command(sc, offs, addr, data) - struct opl_softc *sc; - int offs; - int addr, data; -{ - DPRINTFN(4, ("opl_command: sc=%p, offs=%d addr=0x%02x data=0x%02x\n", - sc, offs, addr, data)); - offs += sc->offs; - bus_space_write_1(sc->iot, sc->ioh, OPL_ADDR+offs, addr); - if (sc->model == OPL_2) - delay(10); - else - delay(6); - bus_space_write_1(sc->iot, sc->ioh, OPL_DATA+offs, data); - if (sc->model == OPL_2) - delay(30); - else - delay(6); -} - -int -opl_find(oaa) - struct opl_attach_arg *oaa; -{ - u_int8_t status1, status2; - int model; - - model = OPL_2; /* worst case assumption */ - - /* Reset timers 1 and 2 */ - opl_probe_command(oaa, OPL_TIMER_CONTROL, - OPL_TIMER1_MASK | OPL_TIMER2_MASK); - /* Reset the IRQ of the FM chip */ - opl_probe_command(oaa, OPL_TIMER_CONTROL, OPL_IRQ_RESET); - - /* get status bits */ - status1 = bus_space_read_1(oaa->iot, oaa->ioh, - OPL_STATUS + OPL_L + oaa->offs); - - opl_probe_command(oaa, OPL_TIMER1, -2); /* wait 2 ticks */ - opl_probe_command(oaa, OPL_TIMER_CONTROL, /* start timer1 */ - OPL_TIMER1_START | OPL_TIMER2_MASK); - delay(1000); /* wait for timer to expire */ - - /* get status bits again */ - status2 = bus_space_read_1(oaa->iot, oaa->ioh, - OPL_STATUS + OPL_L + oaa->offs); - - opl_probe_command(oaa, OPL_TIMER_CONTROL, - OPL_TIMER1_MASK | OPL_TIMER2_MASK); - opl_probe_command(oaa, OPL_TIMER_CONTROL, OPL_IRQ_RESET); - - DPRINTFN(2,("opl_find: %02x %02x\n", status1, status2)); - - if ((status1 & OPL_STATUS_MASK) != 0 || - (status2 & OPL_STATUS_MASK) != (OPL_STATUS_IRQ | OPL_STATUS_FT1)) - return (0); - - switch(status1) { - case 0x00: - case 0x0f: - model = OPL_3; - break; - case 0x06: - model = OPL_2; - break; - default: - return 0; - } - - return (model); -} - -void -opl_set_op_reg(sc, base, voice, op, value) - struct opl_softc *sc; - int base; - int voice; - int op; - u_char value; -{ - struct opl_voice *v = &sc->voices[voice]; - opl_command(sc, v->iooffs, base + v->op[op], value); -} - -void -opl_set_ch_reg(sc, base, voice, value) - struct opl_softc *sc; - int base; - int voice; - u_char value; -{ - struct opl_voice *v = &sc->voices[voice]; - opl_command(sc, v->iooffs, base + v->voiceno, value); -} - - -void -opl_load_patch(sc, v) - struct opl_softc *sc; - int v; -{ - const struct opl_operators *p = sc->voices[v].patch; - - opl_set_op_reg(sc, OPL_AM_VIB, v, 0, p->ops[OO_CHARS+0]); - opl_set_op_reg(sc, OPL_AM_VIB, v, 1, p->ops[OO_CHARS+1]); - opl_set_op_reg(sc, OPL_KSL_LEVEL, v, 0, p->ops[OO_KSL_LEV+0]); - opl_set_op_reg(sc, OPL_KSL_LEVEL, v, 1, p->ops[OO_KSL_LEV+1]); - opl_set_op_reg(sc, OPL_ATTACK_DECAY, v, 0, p->ops[OO_ATT_DEC+0]); - opl_set_op_reg(sc, OPL_ATTACK_DECAY, v, 1, p->ops[OO_ATT_DEC+1]); - opl_set_op_reg(sc, OPL_SUSTAIN_RELEASE, v, 0, p->ops[OO_SUS_REL+0]); - opl_set_op_reg(sc, OPL_SUSTAIN_RELEASE, v, 1, p->ops[OO_SUS_REL+1]); - opl_set_op_reg(sc, OPL_WAVE_SELECT, v, 0, p->ops[OO_WAV_SEL+0]); - opl_set_op_reg(sc, OPL_WAVE_SELECT, v, 1, p->ops[OO_WAV_SEL+1]); - opl_set_ch_reg(sc, OPL_FEEDBACK_CONNECTION, v, p->ops[OO_FB_CONN]); -} - -#define OPL_FNUM_FAIL 0xffff -u_int32_t -opl_get_block_fnum(freq) - int freq; -{ - u_int32_t f_num = freq / 3125; - u_int32_t block = 0; - - while (f_num > 0x3FF && block < 8) { - block++; - f_num >>= 1; - } - - if (block > 7) - return (OPL_FNUM_FAIL); - else - return ((block << 10) | f_num); - } - - -void -opl_reset(sc) - struct opl_softc *sc; -{ - int i; - - for (i = 1; i <= OPL_MAXREG; i++) - opl_command(sc, OPL_L, OPL_KEYON_BLOCK + i, 0); - - opl_command(sc, OPL_L, OPL_TEST, OPL_ENABLE_WAVE_SELECT); - opl_command(sc, OPL_L, OPL_PERCUSSION, 0); - if (sc->model == OPL_3) { - opl_command(sc, OPL_R, OPL_MODE, OPL3_ENABLE); - opl_command(sc, OPL_R,OPL_CONNECTION_SELECT,OPL_NOCONNECTION); - } - - sc->volume = 64; -} - -int -oplsyn_open(ms, flags) - midisyn *ms; - int flags; -{ - struct opl_softc *sc = ms->data; - - DPRINTFN(2, ("oplsyn_open: %d\n", flags)); - - opl_reset(ms->data); - if (sc->spkrctl) - sc->spkrctl(sc->spkrarg, 1); - return (0); -} - -void -oplsyn_close(ms) - midisyn *ms; -{ - struct opl_softc *sc = ms->data; - - DPRINTFN(2, ("oplsyn_close:\n")); - - /*opl_reset(ms->data);*/ - if (sc->spkrctl) - sc->spkrctl(sc->spkrarg, 0); -} - -#if 0 -void -oplsyn_getinfo(addr, sd) - void *addr; - struct synth_dev *sd; -{ - struct opl_softc *sc = addr; - - sd->name = sc->model == OPL_2 ? "Yamaha OPL2" : "Yamaha OPL3"; - sd->type = SYNTH_TYPE_FM; - sd->subtype = sc->model == OPL_2 ? SYNTH_SUB_FM_TYPE_ADLIB - : SYNTH_SUB_FM_TYPE_OPL3; - sd->capabilities = 0; -} -#endif - -void -oplsyn_reset(addr) - void *addr; -{ - struct opl_softc *sc = addr; - DPRINTFN(3, ("oplsyn_reset:\n")); - opl_reset(sc); -} - -int8_t opl_volume_table[128] = - {-64, -48, -40, -35, -32, -29, -27, -26, - -24, -23, -21, -20, -19, -18, -18, -17, - -16, -15, -15, -14, -13, -13, -12, -12, - -11, -11, -10, -10, -10, -9, -9, -8, - -8, -8, -7, -7, -7, -6, -6, -6, - -5, -5, -5, -5, -4, -4, -4, -4, - -3, -3, -3, -3, -2, -2, -2, -2, - -2, -1, -1, -1, -1, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 4, - 4, 4, 4, 4, 4, 4, 4, 5, - 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, - 6, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 8, 8, 8, 8, 8}; - -int -opl_calc_vol(regbyte, volume, mainvol) - int regbyte; - int volume; - int mainvol; -{ - int level = ~regbyte & OPL_TOTAL_LEVEL_MASK; - - if (mainvol > 127) - mainvol = 127; - - volume = (volume * mainvol) / 127; - - if (level) - level += opl_volume_table[volume]; - - if (level > OPL_TOTAL_LEVEL_MASK) - level = OPL_TOTAL_LEVEL_MASK; - if (level < 0) - level = 0; - - return (~level & OPL_TOTAL_LEVEL_MASK); -} - -void -oplsyn_noteon(ms, voice, freq, vel) - midisyn *ms; - u_int32_t voice, freq, vel; -{ - struct opl_softc *sc = ms->data; - struct opl_voice *v; - const struct opl_operators *p; - u_int32_t block_fnum; - int mult; - int c_mult, m_mult; - u_int8_t chars0, chars1, ksl0, ksl1, fbc; - u_int8_t r20m, r20c, r40m, r40c, rA0, rB0; - u_int8_t vol0, vol1; - - DPRINTFN(3, ("oplsyn_noteon: %p %d %d\n", sc, voice, - MIDISYN_FREQ_TO_HZ(freq))); - -#ifdef DIAGNOSTIC - if (voice < 0 || voice >= sc->syn.nvoice) { - printf("oplsyn_noteon: bad voice %d\n", voice); - return; - } -#endif - /* Turn off old note */ - opl_set_op_reg(sc, OPL_KSL_LEVEL, voice, 0, 0xff); - opl_set_op_reg(sc, OPL_KSL_LEVEL, voice, 1, 0xff); - opl_set_ch_reg(sc, OPL_KEYON_BLOCK, voice, 0); - - v = &sc->voices[voice]; - - p = &opl2_instrs[MS_GETPGM(ms, voice)]; - v->patch = p; - opl_load_patch(sc, voice); - - mult = 1; - for (;;) { - block_fnum = opl_get_block_fnum(freq / mult); - if (block_fnum != OPL_FNUM_FAIL) - break; - mult *= 2; - if (mult == 16) - mult = 15; - } - - chars0 = p->ops[OO_CHARS+0]; - chars1 = p->ops[OO_CHARS+1]; - m_mult = (chars0 & OPL_MULTIPLE_MASK) * mult; - c_mult = (chars1 & OPL_MULTIPLE_MASK) * mult; - if ((block_fnum == OPL_FNUM_FAIL) || (m_mult > 15) || (c_mult > 15)) { - printf("oplsyn_noteon: frequence out of range %d\n", - MIDISYN_FREQ_TO_HZ(freq)); - return; - } - r20m = (chars0 &~ OPL_MULTIPLE_MASK) | m_mult; - r20c = (chars1 &~ OPL_MULTIPLE_MASK) | c_mult; - - /* 2 voice */ - ksl0 = p->ops[OO_KSL_LEV+0]; - ksl1 = p->ops[OO_KSL_LEV+1]; - if (p->ops[OO_FB_CONN] & 0x01) { - vol0 = opl_calc_vol(ksl0, vel, sc->volume); - vol1 = opl_calc_vol(ksl1, vel, sc->volume); - } else { - vol0 = ksl0; - vol1 = opl_calc_vol(ksl1, vel, sc->volume); - } - r40m = (ksl0 & OPL_KSL_MASK) | vol0; - r40c = (ksl1 & OPL_KSL_MASK) | vol1; - - rA0 = block_fnum & 0xFF; - rB0 = (block_fnum >> 8) | OPL_KEYON_BIT; - - v->rB0 = rB0; - - fbc = p->ops[OO_FB_CONN]; - if (sc->model == OPL_3) { - fbc &= ~OPL_STEREO_BITS; - /* XXX use pan */ - fbc |= OPL_VOICE_TO_LEFT | OPL_VOICE_TO_RIGHT; - } - opl_set_ch_reg(sc, OPL_FEEDBACK_CONNECTION, voice, fbc); - - opl_set_op_reg(sc, OPL_AM_VIB, voice, 0, r20m); - opl_set_op_reg(sc, OPL_AM_VIB, voice, 1, r20c); - opl_set_op_reg(sc, OPL_KSL_LEVEL, voice, 0, r40m); - opl_set_op_reg(sc, OPL_KSL_LEVEL, voice, 1, r40c); - opl_set_ch_reg(sc, OPL_FNUM_LOW, voice, rA0); - opl_set_ch_reg(sc, OPL_KEYON_BLOCK, voice, rB0); -} - -void -oplsyn_noteoff(ms, voice, note, vel) - midisyn *ms; - u_int32_t voice, note, vel; -{ - struct opl_softc *sc = ms->data; - struct opl_voice *v; - - DPRINTFN(3, ("oplsyn_noteoff: %p %d %d\n", sc, voice, - MIDISYN_FREQ_TO_HZ(note))); - -#ifdef DIAGNOSTIC - if (voice < 0 || voice >= sc->syn.nvoice) { - printf("oplsyn_noteoff: bad voice %d\n", voice); - return; - } -#endif - v = &sc->voices[voice]; - opl_set_ch_reg(sc, 0xB0, voice, v->rB0 & ~OPL_KEYON_BIT); -} - -void -oplsyn_keypressure(ms, voice, note, vel) - midisyn *ms; - u_int32_t voice, note, vel; -{ -#ifdef AUDIO_DEBUG - struct opl_softc *sc = ms->data; - DPRINTFN(1, ("oplsyn_keypressure: %p %d\n", sc, note)); -#endif -} - -void -oplsyn_ctlchange(ms, voice, parm, w14) - midisyn *ms; - u_int32_t voice, parm, w14; -{ -#ifdef AUDIO_DEBUG - struct opl_softc *sc = ms->data; - DPRINTFN(1, ("oplsyn_ctlchange: %p %d\n", sc, voice)); -#endif -} - -void -oplsyn_pitchbend(ms, voice, parm, x) - midisyn *ms; - u_int32_t voice, parm, x; -{ -#ifdef AUDIO_DEBUG - struct opl_softc *sc = ms->data; - DPRINTFN(1, ("oplsyn_pitchbend: %p %d\n", sc, voice)); -#endif -} - -void -oplsyn_loadpatch(ms, sysex, uio) - midisyn *ms; - struct sysex_info *sysex; - struct uio *uio; -{ -#if 0 - struct opl_softc *sc = ms->data; - struct sbi_instrument ins; - - DPRINTFN(1, ("oplsyn_loadpatch: %p\n", sc)); - - memcpy(&ins, sysex, sizeof *sysex); - if (uio->uio_resid >= sizeof ins - sizeof *sysex) - return EINVAL; - uiomove((char *)&ins + sizeof *sysex, sizeof ins - sizeof *sysex, uio); - /* XXX */ -#endif -} diff --git a/sys/dev/ic/opl3sa3reg.h b/sys/dev/ic/opl3sa3reg.h deleted file mode 100644 index d5386af03f3..00000000000 --- a/sys/dev/ic/opl3sa3reg.h +++ /dev/null @@ -1,243 +0,0 @@ -/* $OpenBSD: opl3sa3reg.h,v 1.2 2008/06/26 05:42:16 ray Exp $ */ -/* $NetBSD: opl3sa3reg.h,v 1.1 1999/10/05 03:38:17 itohy Exp $ */ - -/*- - * Copyright (c) 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by ITOH Yasufumi. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * YAMAHA YMF715x (OPL3 Single-chip Audio System 3; OPL3-SA3) - * control register description - * - * Other ports (SBpro, WSS CODEC, MPU401, OPL3, etc.) are NOT listed here. - */ - -/* - * direct registers - */ - -/* offset from the base address */ -#define SA3_CTL_INDEX 0 /* Index port (R/W) */ -#define SA3_CTL_DATA 1 /* Data register port (R/W) */ - -#define SA3_CTL_NPORT 2 /* number of ports */ - -/* - * indirect registers - */ - -#define SA3_PWR_MNG 0x01 /* Power management (R/W) */ -#define SA3_PWR_MNG_ADOWN 0x20 /* Analog Down */ -#define SA3_PWR_MNG_PSV 0x04 /* Power save */ -#define SA3_PWR_MNG_PDN 0x02 /* Power down */ -#define SA3_PWR_MNG_PDX 0x01 /* Oscillation stop */ -#define SA3_PWR_MNG_DEFAULT 0x00 /* default value */ - -#define SA3_SYS_CTL 0x02 /* System control (R/W) */ -#define SA3_SYS_CTL_SBHE 0x80 /* 0: AT-bus, 1: XT-bus */ -#define SA3_SYS_CTL_YMODE 0x30 /* 3D Enhancement mode */ -#define SA3_SYS_CTL_YMODE0 0x00 /* Desktop mode (speaker 5-12cm) */ -#define SA3_SYS_CTL_YMODE1 0x10 /* Notebook PC mode (1) (3cm) */ -#define SA3_SYS_CTL_YMODE2 0x20 /* Notebook PC mode (2) (1.5cm) */ -#define SA3_SYS_CTL_YMODE3 0x30 /* Hi-Fi mode (16-38cm) */ -#define SA3_SYS_CTL_IDSEL 0x06 /* Specify DSP version of SBPro */ -#define SA3_SYS_CTL_IDSEL0 0x00 /* major 0x03, minor 0x01 */ -#define SA3_SYS_CTL_IDSEL1 0x02 /* major 0x02, minor 0x01 */ -#define SA3_SYS_CTL_IDSEL2 0x04 /* major 0x01, minor 0x05 */ -#define SA3_SYS_CTL_IDSEL3 0x06 /* major 0x00, minor 0x00 */ -#define SA3_SYS_CTL_VZE 0x01 /* ZV */ -#define SA3_SYS_CTL_DEFAULT 0x00 /* default value */ - -#define SA3_IRQ_CONF 0x03 /* Interrupt Channel config (R/W) */ -#define SA3_IRQ_CONF_OPL3_B 0x80 /* OPL3 uses IRQ-B */ -#define SA3_IRQ_CONF_MPU_B 0x40 /* MPU401 uses IRQ-B */ -#define SA3_IRQ_CONF_SB_B 0x20 /* Sound Blaster uses IRQ-B */ -#define SA3_IRQ_CONF_WSS_B 0x10 /* WSS CODEC uses IRQ-B */ -#define SA3_IRQ_CONF_OPL3_A 0x08 /* OPL3 uses IRQ-A */ -#define SA3_IRQ_CONF_MPU_A 0x04 /* MPU401 uses IRQ-A */ -#define SA3_IRQ_CONF_SB_A 0x02 /* Sound Blaster uses IRQ-A */ -#define SA3_IRQ_CONF_WSS_A 0x01 /* WSS CODEC uses IRQ-A */ -#define SA3_IRQ_CONF_DEFAULT (SA3_IRQ_CONF_MPU_B | SA3_IRQ_CONF_SB_B | \ - SA3_IRQ_CONF_OPL3_A | SA3_IRQ_CONF_WSS_A) - -#define SA3_IRQA_STAT 0x04 /* Interrupt (IRQ-A) STATUS (RO) */ -#define SA3_IRQB_STAT 0x05 /* Interrupt (IRQ-B) STATUS (RO) */ -#define SA3_IRQ_STAT_MV 0x40 /* Hardware Volume Interrupt */ -#define SA3_IRQ_STAT_OPL3 0x20 /* Internal FM-synthesizer timer */ -#define SA3_IRQ_STAT_MPU 0x10 /* MPU401 Interrupt */ -#define SA3_IRQ_STAT_SB 0x08 /* Sound Blaster Playback Interrupt */ -#define SA3_IRQ_STAT_TI 0x04 /* Timer Flag of CODEC */ -#define SA3_IRQ_STAT_CI 0x02 /* Recording Flag of CODEC */ -#define SA3_IRQ_STAT_PI 0x01 /* Playback Flag of CODEC */ - -#define SA3_DMA_CONF 0x06 /* DMA configuration (R/W) */ -#define SA3_DMA_CONF_SB_B 0x40 /* Sound Blaster playback uses DMA-B */ -#define SA3_DMA_CONF_WSS_R_B 0x20 /* WSS CODEC recording uses DMA-B */ -#define SA3_DMA_CONF_WSS_P_B 0x10 /* WSS CODEC playback uses DMA-B */ -#define SA3_DMA_CONF_SB_A 0x04 /* Sound Blaster playback uses DMA-A */ -#define SA3_DMA_CONF_WSS_R_A 0x02 /* WSS CODEC recording uses DMA-A */ -#define SA3_DMA_CONF_WSS_P_A 0x01 /* WSS CODEC playback uses DMA-A */ -#define SA3_DMA_CONF_DEFAULT (SA3_DMA_CONF_SB_B | SA3_DMA_CONF_WSS_R_B | \ - SA3_DMA_CONF_WSS_P_A) - -#define SA3_VOL_L 0x07 /* Master Volume Lch (R/W) */ -#define SA3_VOL_R 0x08 /* Master Volume Rch (R/W) */ -#define SA3_VOL_MUTE 0x80 /* Mute the channel */ -#define SA3_VOL_MV 0x0f /* Master Volume bits */ -#define SA3_VOL_MV_0 0x00 /* 0dB (maximum volume) */ -#define SA3_VOL_MV_2 0x01 /* -2dB */ -#define SA3_VOL_MV_4 0x02 /* -4dB */ -#define SA3_VOL_MV_6 0x03 /* -6dB */ -#define SA3_VOL_MV_8 0x04 /* -8dB */ -#define SA3_VOL_MV_10 0x05 /* -10dB */ -#define SA3_VOL_MV_12 0x06 /* -12dB */ -#define SA3_VOL_MV_14 0x07 /* -14dB (default) */ -#define SA3_VOL_MV_16 0x08 /* -16dB */ -#define SA3_VOL_MV_18 0x09 /* -18dB */ -#define SA3_VOL_MV_20 0x0a /* -20dB */ -#define SA3_VOL_MV_22 0x0b /* -22dB */ -#define SA3_VOL_MV_24 0x0c /* -24dB */ -#define SA3_VOL_MV_26 0x0d /* -26dB */ -#define SA3_VOL_MV_28 0x0e /* -28dB */ -#define SA3_VOL_MV_30 0x0f /* -30dB (minimum volume) */ -#define SA3_VOL_DEFAULT SA3_VOL_MV_14 - -#define SA3_MIC_VOL 0x09 /* MIC Volume (R/W) */ -#define SA3_MIC_MUTE 0x80 /* Mute Mic Volume */ -#define SA3_MIC_MCV 0x1f /* Mic volume bits */ -#define SA3_MIC_MCV12 0x00 /* +12.0dB (maximum volume) */ -#define SA3_MIC_MCV10_5 0x01 /* +10.5dB */ -#define SA3_MIC_MCV9 0x02 /* +9.0dB */ -#define SA3_MIC_MCV7_5 0x03 /* +7.5dB */ -#define SA3_MIC_MCV6 0x04 /* +6.0dB */ -#define SA3_MIC_MCV4_5 0x05 /* +4.5dB */ -#define SA3_MIC_MCV3 0x06 /* +3.0dB */ -#define SA3_MIC_MCV1_5 0x07 /* +1.5dB */ -#define SA3_MIC_MCV_0 0x08 /* 0.0dB (default) */ -#define SA3_MIC_MCV_1_5 0x09 /* -1.5dB */ -#define SA3_MIC_MCV_3_0 0x0a /* -3.0dB */ -#define SA3_MIC_MCV_4_5 0x0b /* -4.5dB */ -#define SA3_MIC_MCV_6 0x0c /* -6.0dB */ -#define SA3_MIC_MCV_7_5 0x0d /* -7.5dB */ -#define SA3_MIC_MCV_9 0x0e /* -9.0dB */ -#define SA3_MIC_MCV_10_5 0x0f /* -10.5dB */ -#define SA3_MIC_MCV_12 0x10 /* -12.0dB */ -#define SA3_MIC_MCV_13_5 0x11 /* -13.5dB */ -#define SA3_MIC_MCV_15 0x12 /* -15.0dB */ -#define SA3_MIC_MCV_16_5 0x13 /* -16.5dB */ -#define SA3_MIC_MCV_18 0x14 /* -18.0dB */ -#define SA3_MIC_MCV_19_5 0x15 /* -19.5dB */ -#define SA3_MIC_MCV_21 0x16 /* -21.0dB */ -#define SA3_MIC_MCV_22_5 0x17 /* -22.5dB */ -#define SA3_MIC_MCV_24 0x18 /* -24.0dB */ -#define SA3_MIC_MCV_25_5 0x19 /* -25.5dB */ -#define SA3_MIC_MCV_27 0x1a /* -27.0dB */ -#define SA3_MIC_MCV_28_5 0x1b /* -28.5dB */ -#define SA3_MIC_MCV_30 0x1c /* -30.0dB */ -#define SA3_MIC_MCV_31_5 0x1d /* -31.5dB */ -#define SA3_MIC_MCV_33 0x1e /* -33.0dB */ -#define SA3_MIC_MCV_34_5 0x1f /* -34.5dB (minimum volume) */ -#define SA3_MIC_VOL_DEFAULT (SA3_MIC_MUTE | SA3_MIC_MCV_0) - -#define SA3_MISC 0x0a /* Miscellaneous */ -#define SA3_MISC_VEN 0x80 /* Enable hardware volume control */ -#define SA3_MISC_MCSW 0x10 /* A/D is connected to 0: Rch of Mic, - 1: loopback of monaural output */ -#define SA3_MISC_MODE 0x08 /* 0: SB mode, 1: WSS mode (RO) */ -#define SA3_MISC_VER 0x07 /* Version of OPL3-SA3 (RO) */ - /* (4 or 5?) */ -/*#define SA3_MISC_DEFAULT (SA3_MISC_VEN | (4 or 5?)) */ - -/* WSS DMA Base counters (R/W) used for suspend/resume */ -#define SA3_DMA_CNT_PLAY_LOW 0x0b /* Playback Base Counter (Low) */ -#define SA3_DMA_CNT_PLAY_HIGH 0x0c /* Playback Base Counter (High) */ -#define SA3_DMA_CNT_REC_LOW 0x0d /* Recording Base Counter (Low) */ -#define SA3_DMA_CNT_REC_HIGH 0x0e /* Recording Base Counter (High) */ - -#define SA3_WSS_INT_SCAN 0x0f /* WSS Interrupt Scan out/in (R/W) */ -#define SA3_WSS_INT_SCAN_STI 0x04 /* 1: TI = "1" and IRQ active */ -#define SA3_WSS_INT_SCAN_SCI 0x02 /* 1: CI = "1" and IRQ active */ -#define SA3_WSS_INT_SCAN_SPI 0x01 /* 1: PI = "1" and IRQ active */ -#define SA3_WSS_INT_DEFAULT 0x00 /* default value */ - -#define SA3_SB_SCAN 0x10 /* SB Internal State Scan out/in (R/W)*/ -#define SA3_SB_SCAN_SBPDA 0x80 /* Sound Blaster Power Down ack */ -#define SA3_SB_SCAN_SS 0x08 /* Scan Select */ -#define SA3_SB_SCAN_SM 0x04 /* Scan Mode 1: read out, 0: write in */ -#define SA3_SB_SCAN_SE 0x02 /* Scan Enable */ -#define SA3_SB_SCAN_SBPDR 0x01 /* Sound Blaster Power Down Request */ -#define SA3_SB_SCAN_DEFAULT 0x00 /* default value */ - -#define SA3_SB_SCAN_DATA 0x11 /* SB Internal State Scan Data (R/W)*/ - -#define SA3_DPWRDWN 0x12 /* Digital Partial Power Down (R/W) */ -#define SA3_DPWRDWN_JOY 0x80 /* Joystick power down */ -#define SA3_DPWRDWN_MPU 0x40 /* MPU401 power down */ -#define SA3_DPWRDWN_MCLKO 0x20 /* Master Clock disable */ -#define SA3_DPWRDWN_FM 0x10 /* FM (OPL3) power down */ -#define SA3_DPWRDWN_WSS_R 0x08 /* WSS recording power down */ -#define SA3_DPWRDWN_WSS_P 0x04 /* WSS playback power down */ -#define SA3_DPWRDWN_SB 0x02 /* Sound Blaster power down */ -#define SA3_DPWRDWN_PNP 0x01 /* PnP power down */ -#define SA3_DPWRDWN_DEFAULT 0x00 /* default value */ - -#define SA3_APWRDWN 0x13 /* Analog Partial Power Down (R/W) */ -#define SA3_APWRDWN_FMDAC 0x10 /* FMDAC for OPL3 power down */ -#define SA3_APWRDWN_AD 0x08 /* A/D for WSS recording power down */ -#define SA3_APWRDWN_DA 0x04 /* D/A for WSS playback power down */ -#define SA3_APWRDWN_SBDAC 0x02 /* D/A for SB power down */ -#define SA3_APWRDWN_WIDE 0x01 /* Wide Stereo power down */ -#define SA3_APWRDWN_DEFAULT 0x00 /* default value */ - -#define SA3_3D_WIDE 0x14 /* 3D Enhanced control (WIDE) (R/W) */ -#define SA3_3D_WIDE_WIDER 0x70 /* Rch of wide 3D enhanced control */ -#define SA3_3D_WIDE_WIDEL 0x07 /* Lch of wide 3D enhanced control */ -#define SA3_3D_WIDE_DEFAULT 0x00 /* default value */ - -#define SA3_3D_BASS 0x15 /* 3D Enhanced control (BASS) (R/W) */ -#define SA3_3D_BASS_BASSR 0x70 /* Rch of bass 3D enhanced control */ -#define SA3_3D_BASS_BASSL 0x07 /* Lch of bass 3D enhanced control */ -#define SA3_3D_BASS_DEFAULT 0x00 /* default value */ - -#define SA3_3D_TREBLE 0x16 /* 3D Enhanced control (TREBLE) (R/W) */ -#define SA3_3D_TREBLE_TRER 0x70 /* Rch of treble 3D enhanced control */ -#define SA3_3D_TREBLE_TREL 0x07 /* Lch of treble 3D enhanced control */ -#define SA3_3D_TREBLE_DEFAULT 0x00 /* default value */ - -/* common to the 3D enhance registers */ -#define SA3_3D_BITS 0x07 -#define SA3_3D_LSHIFT 0 -#define SA3_3D_RSHIFT 4 - -#define SA3_HVOL_INTR_CNF 0x17 /* Hardware Volume Intr Channel (R/W) */ -#define SA3_HVOL_INTR_CNF_B 0x20 /* Hardware Volume uses IRQ-B */ -#define SA3_HVOL_INTR_CNF_A 0x10 /* Hardware Volume uses IRQ-A */ -#define SA3_HVOL_INTR_CNF_DEFAULT 0x00 - -#define SA3_MULTI_STAT 0x18 /* Multi-purpose Select Pin Stat (RO) */ -#define SA3_MULTI_STAT_SEL 0x70 /* State of SEL2-0 pins */ diff --git a/sys/dev/ic/oplinstrs.c b/sys/dev/ic/oplinstrs.c deleted file mode 100644 index 3369277f4e0..00000000000 --- a/sys/dev/ic/oplinstrs.c +++ /dev/null @@ -1,501 +0,0 @@ -/* $OpenBSD: oplinstrs.c,v 1.3 2005/11/21 18:16:39 millert Exp $ */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/errno.h> -#include <sys/ioctl.h> -#include <sys/syslog.h> -#include <sys/device.h> -#include <sys/selinfo.h> - -#include <machine/bus.h> - -#include <dev/midivar.h> -#include <dev/midisynvar.h> - -#include <dev/ic/oplreg.h> -#include <dev/ic/oplvar.h> - -/* - * Operator settings for the OPL2 and OPL3 FM synths. - * These tables are indexed by the General MIDI instrument number. - */ -const struct opl_operators opl3_instrs[OPL_NINSTR] = { -{ 1, { 0x23, 0x01, 0x15, 0x00, 0xfd, 0x84, 0x7c, 0xf5, 0x03, 0x00, 0x10, - 0x03, 0x01, 0x5d, 0x00, 0xf2, 0xf4, 0x35, 0xf5, 0x00, 0x04, 0x11, } }, -{ 1, { 0x03, 0x01, 0x7d, 0x00, 0xf3, 0xf3, 0xf5, 0xf5, 0x00, 0x04, 0x10, - 0x03, 0x01, 0x55, 0x00, 0xf2, 0xf2, 0xf5, 0xf5, 0x00, 0x04, 0x11, } }, -{ 1, { 0x03, 0x01, 0x4d, 0x00, 0xfb, 0xf3, 0x55, 0xc5, 0x04, 0x04, 0x20, - 0x03, 0x01, 0xce, 0x00, 0xf3, 0xf3, 0x55, 0xd5, 0x00, 0x04, 0x21, } }, -{ 1, { 0x03, 0x01, 0xd7, 0x00, 0xf3, 0xf2, 0xf5, 0xf5, 0x04, 0x04, 0x20, - 0x03, 0x01, 0xd5, 0x00, 0xf3, 0xf3, 0xf5, 0xf5, 0x00, 0x04, 0x21, } }, -{ 1, { 0x16, 0x01, 0x57, 0x00, 0xff, 0xf3, 0x8a, 0x66, 0x00, 0x00, 0x2c, - 0x0b, 0x81, 0x2b, 0x00, 0xe5, 0xe2, 0xb5, 0x86, 0x00, 0x00, 0x21, } }, -{ 1, { 0x0a, 0x01, 0x5f, 0x00, 0xf4, 0xf4, 0x87, 0x86, 0x00, 0x00, 0x10, - 0x03, 0x01, 0xcc, 0x00, 0xf2, 0xe2, 0x86, 0x86, 0x00, 0x00, 0x11, } }, -{ 1, { 0x22, 0x01, 0xd1, 0x80, 0xe3, 0xf3, 0x79, 0xa7, 0x04, 0x04, 0x34, - 0x22, 0x01, 0x96, 0x00, 0xf2, 0xf3, 0x79, 0xa7, 0x04, 0x04, 0x31, } }, -{ 1, { 0x22, 0x01, 0x9c, 0x00, 0xf4, 0xf3, 0x19, 0xa6, 0x05, 0x05, 0x10, - 0x22, 0x01, 0x97, 0x00, 0xf4, 0xf3, 0x19, 0xe6, 0x04, 0x04, 0x11, } }, -{ 1, { 0x1b, 0x19, 0x5a, 0x00, 0xf4, 0xe3, 0xf6, 0xa2, 0x00, 0x00, 0x30, - 0x1a, 0x11, 0x57, 0x00, 0xf3, 0xf2, 0xb2, 0xa3, 0x00, 0x00, 0x31, } }, -{ 1, { 0x1b, 0x17, 0x5a, 0x00, 0xd6, 0xf3, 0x53, 0x53, 0x00, 0x00, 0x20, - 0x1a, 0x11, 0x49, 0x00, 0xd1, 0xf3, 0x52, 0x52, 0x00, 0x00, 0x21, } }, -{ 1, { 0x1b, 0x14, 0x5a, 0x00, 0xf6, 0x63, 0xf6, 0xa3, 0x00, 0x00, 0x30, - 0x1b, 0x11, 0x52, 0x00, 0xd3, 0xf2, 0xb2, 0xa3, 0x00, 0x00, 0x31, } }, -{ 1, { 0x8b, 0x84, 0x5a, 0x00, 0xd7, 0xf1, 0x15, 0x95, 0x00, 0x00, 0x30, - 0x9b, 0x81, 0x49, 0x00, 0xdc, 0xd2, 0x25, 0xb5, 0x00, 0x00, 0x31, } }, -{ 1, { 0x08, 0x01, 0xc0, 0x00, 0xfd, 0xf6, 0x56, 0x68, 0x00, 0x00, 0x20, - 0x95, 0x81, 0x40, 0x00, 0xfe, 0xf0, 0x27, 0x05, 0x00, 0x00, 0x21, } }, -{ 1, { 0x08, 0x03, 0xc0, 0x00, 0xfa, 0xf8, 0x56, 0x66, 0x00, 0x00, 0x30, - 0x97, 0x81, 0x40, 0x00, 0xdf, 0xf8, 0x26, 0x06, 0x00, 0x00, 0x31, } }, -{ 1, { 0x03, 0x00, 0x95, 0x80, 0xf3, 0xf3, 0x33, 0x23, 0x00, 0x00, 0x30, - 0x03, 0x00, 0x8c, 0x80, 0xf4, 0xf3, 0x23, 0x03, 0x00, 0x00, 0x31, } }, -{ 1, { 0x01, 0x00, 0x8b, 0x00, 0xa7, 0x94, 0xf9, 0x36, 0x06, 0x05, 0x30, - 0x02, 0x81, 0x18, 0x80, 0xf6, 0xf4, 0x79, 0x55, 0x04, 0x04, 0x31, } }, -{ 1, { 0x24, 0x24, 0x40, 0x00, 0xfd, 0xfb, 0xfd, 0x0e, 0x00, 0x00, 0x20, - 0x20, 0x20, 0x95, 0x00, 0xfb, 0xf6, 0x0e, 0x0e, 0x00, 0x00, 0x21, } }, -{ 1, { 0x04, 0x24, 0x17, 0x00, 0xfe, 0xf7, 0xb7, 0x67, 0x00, 0x00, 0x20, - 0x20, 0xa0, 0x14, 0x00, 0xf9, 0xf6, 0x06, 0x07, 0x00, 0x00, 0x21, } }, -{ 1, { 0xa2, 0x20, 0x1e, 0x00, 0xb9, 0xa9, 0x36, 0x0e, 0x00, 0x00, 0x30, - 0xb4, 0x20, 0x1a, 0x00, 0x79, 0x77, 0x51, 0x4c, 0x04, 0x00, 0x31, } }, -{ 1, { 0x25, 0xa1, 0x23, 0x00, 0x74, 0x60, 0x11, 0x05, 0x00, 0x00, 0x12, - 0xb0, 0xb0, 0xd3, 0x00, 0x74, 0x60, 0x12, 0x05, 0x04, 0x01, 0x11, } }, -{ 1, { 0x22, 0x21, 0x24, 0x40, 0x76, 0x76, 0x06, 0x06, 0x04, 0x04, 0x10, - 0x20, 0x21, 0x21, 0x00, 0x76, 0x66, 0x06, 0x06, 0x00, 0x02, 0x11, } }, -{ 1, { 0x22, 0x21, 0x1b, 0x00, 0x76, 0x76, 0x07, 0x07, 0x00, 0x04, 0x30, - 0x21, 0x21, 0x19, 0x00, 0x76, 0x66, 0x07, 0x07, 0x00, 0x02, 0x31, } }, -{ 1, { 0x21, 0x21, 0x20, 0x00, 0x93, 0x73, 0x09, 0x09, 0x04, 0x04, 0x30, - 0x21, 0x21, 0x27, 0x00, 0x76, 0x76, 0x09, 0x09, 0x04, 0x04, 0x31, } }, -{ 1, { 0x21, 0x21, 0x1e, 0x00, 0x76, 0x66, 0x09, 0x19, 0x04, 0x05, 0x30, - 0x21, 0x21, 0x22, 0x00, 0x76, 0x66, 0x29, 0x19, 0x04, 0x04, 0x31, } }, -{ 1, { 0x1b, 0x11, 0x4c, 0x00, 0xfe, 0xf2, 0xfe, 0xe3, 0x04, 0x00, 0x10, - 0x31, 0x11, 0x4c, 0x00, 0xf2, 0xf2, 0x45, 0xf4, 0x04, 0x00, 0x11, } }, -{ 1, { 0x30, 0x05, 0x00, 0x0b, 0xf2, 0xfe, 0x49, 0x43, 0x02, 0x01, 0x21, - 0x01, 0x00, 0x00, 0x00, 0xf2, 0xf3, 0xe7, 0x9d, 0x01, 0x02, 0x21, } }, -{ 1, { 0x34, 0x04, 0x00, 0x16, 0xf2, 0xfd, 0x49, 0x43, 0x00, 0x00, 0x31, - 0x01, 0x01, 0x00, 0x00, 0xf2, 0xf3, 0xe7, 0x9d, 0x00, 0x00, 0x31, } }, -{ 1, { 0x03, 0x23, 0x00, 0x00, 0xfb, 0xfc, 0x49, 0x64, 0x06, 0x00, 0x19, - 0x01, 0x01, 0x00, 0x00, 0xf4, 0xf6, 0xc4, 0xc4, 0x02, 0x06, 0x11, } }, -{ 1, { 0x01, 0x01, 0x06, 0x00, 0xf6, 0xf3, 0x27, 0xe7, 0x05, 0x01, 0x30, - 0x02, 0x01, 0x05, 0x00, 0xfa, 0x65, 0x96, 0x9b, 0x04, 0x04, 0x31, } }, -{ 1, { 0x21, 0x21, 0xc1, 0x40, 0xf2, 0xf3, 0x13, 0x16, 0x00, 0x04, 0x30, - 0x21, 0x21, 0x03, 0x00, 0x97, 0x96, 0xae, 0x26, 0x03, 0x05, 0x31, } }, -{ 1, { 0x21, 0x21, 0xc1, 0x00, 0xf2, 0xf2, 0x16, 0x16, 0x00, 0x04, 0x30, - 0x21, 0x20, 0x03, 0x00, 0xc7, 0x90, 0x46, 0x16, 0x03, 0x03, 0x31, } }, -{ 1, { 0x0b, 0x01, 0x40, 0x40, 0x65, 0xf2, 0x1a, 0x3e, 0x00, 0x03, 0x2c, - 0x05, 0x0a, 0x00, 0x40, 0xe2, 0x54, 0x1a, 0x1a, 0x02, 0x01, 0x21, } }, -{ 0, { 0x21, 0x21, 0x12, 0x00, 0xe4, 0xd3, 0x15, 0xa6, 0x00, 0x00, 0x30, } }, -{ 1, { 0x21, 0x01, 0x00, 0x0b, 0xf2, 0xf2, 0x49, 0x97, 0x04, 0x05, 0x31, - 0x01, 0x01, 0x00, 0x00, 0xf6, 0xf3, 0xe7, 0x9d, 0x01, 0x04, 0x31, } }, -{ 1, { 0x21, 0x01, 0x00, 0x08, 0xf2, 0xf2, 0x49, 0x97, 0x04, 0x05, 0x11, - 0x01, 0x01, 0x00, 0x00, 0xf6, 0xf3, 0xe7, 0x9d, 0x01, 0x04, 0x11, } }, -{ 1, { 0x01, 0x01, 0xc0, 0x08, 0xf2, 0xc4, 0x6a, 0x97, 0x00, 0x00, 0x39, - 0x01, 0x01, 0x00, 0x00, 0x91, 0xf2, 0xe7, 0x6d, 0x00, 0x00, 0x31, } }, -{ 1, { 0x01, 0x0b, 0x00, 0x08, 0xfd, 0xfa, 0x49, 0x87, 0x06, 0x04, 0x11, - 0x01, 0x01, 0x00, 0x00, 0xf3, 0xf3, 0xb7, 0x9d, 0x04, 0x04, 0x11, } }, -{ 0, { 0x26, 0x21, 0x24, 0x00, 0xf6, 0xf2, 0x87, 0xf7, 0x04, 0x04, 0x30, } }, -{ 1, { 0x21, 0x01, 0x08, 0x40, 0xf5, 0xf2, 0x47, 0xf7, 0x00, 0x00, 0x20, - 0x21, 0x01, 0x07, 0x40, 0xf5, 0xf2, 0x47, 0xf7, 0x00, 0x00, 0x29, } }, -{ 1, { 0xc1, 0x01, 0x00, 0x21, 0xf2, 0xf2, 0x48, 0x97, 0x00, 0x00, 0x21, - 0x01, 0x01, 0x0a, 0x00, 0xf2, 0xf2, 0x97, 0x77, 0x00, 0x00, 0x20, } }, -{ 1, { 0x22, 0x21, 0xca, 0x00, 0xb4, 0x44, 0x26, 0x06, 0x04, 0x04, 0x3c, - 0x22, 0x01, 0xcc, 0x00, 0x89, 0x5d, 0x16, 0x06, 0x04, 0x04, 0x31, } }, -{ 1, { 0x24, 0x21, 0xcb, 0x00, 0x88, 0x66, 0x26, 0x16, 0x04, 0x04, 0x3c, - 0x34, 0x21, 0xc4, 0x00, 0x86, 0x66, 0x66, 0x06, 0x04, 0x04, 0x31, } }, -{ 1, { 0x22, 0x01, 0xcb, 0x00, 0x72, 0x5f, 0x46, 0x86, 0x04, 0x04, 0x36, - 0x22, 0x21, 0xcd, 0x00, 0x76, 0x54, 0x36, 0x06, 0x04, 0x04, 0x31, } }, -{ 1, { 0x22, 0x01, 0xff, 0x00, 0x86, 0x6f, 0x06, 0x08, 0x04, 0x04, 0x36, - 0x22, 0x21, 0xd2, 0x00, 0x74, 0x54, 0x16, 0x06, 0x04, 0x04, 0x31, } }, -{ 1, { 0x60, 0x61, 0x00, 0x09, 0x68, 0x53, 0x04, 0x45, 0x02, 0x03, 0x11, - 0x61, 0x60, 0x00, 0x00, 0x54, 0x78, 0x54, 0x35, 0x01, 0x03, 0x11, } }, -{ 1, { 0x00, 0x00, 0x07, 0x00, 0xf9, 0xf6, 0xf1, 0x34, 0x03, 0x02, 0x16, - 0x00, 0x00, 0x0c, 0x00, 0x89, 0xb5, 0xf1, 0x34, 0x03, 0x02, 0x11, } }, -{ 1, { 0x12, 0x01, 0xd0, 0x00, 0xb5, 0xc3, 0x23, 0xe3, 0x04, 0x00, 0x30, - 0x12, 0x11, 0xd9, 0x00, 0xe5, 0xa2, 0x15, 0xf3, 0x04, 0x00, 0x31, } }, -{ 1, { 0x11, 0x10, 0xd0, 0x00, 0xe4, 0xd3, 0xe4, 0xf4, 0x01, 0x00, 0x30, - 0x14, 0x10, 0x14, 0x00, 0xf6, 0xf3, 0xf4, 0xf4, 0x02, 0x02, 0x31, } }, -{ 1, { 0x21, 0x21, 0x1b, 0xc0, 0xa9, 0x63, 0x23, 0x25, 0x00, 0x04, 0x3e, - 0x21, 0x21, 0x22, 0x40, 0xa9, 0x43, 0x23, 0x24, 0x00, 0x04, 0x31, } }, -{ 1, { 0x21, 0x21, 0x1f, 0xc0, 0xa9, 0x33, 0x23, 0x15, 0x00, 0x04, 0x3e, - 0x21, 0x21, 0x23, 0x80, 0x60, 0x33, 0x23, 0x25, 0x00, 0x04, 0x31, } }, -{ 1, { 0x20, 0x01, 0x00, 0x0c, 0x52, 0x50, 0xb6, 0x15, 0x02, 0x01, 0x31, - 0x21, 0x20, 0x00, 0x40, 0x44, 0x41, 0x04, 0x27, 0x01, 0x02, 0x31, } }, -{ 1, { 0x22, 0x01, 0x40, 0xc2, 0x51, 0x31, 0xa4, 0xf4, 0x04, 0x01, 0x11, - 0x21, 0x21, 0x00, 0x40, 0x70, 0x34, 0xf4, 0x74, 0x01, 0x04, 0x11, } }, -{ 1, { 0x21, 0x21, 0x10, 0x00, 0x61, 0x66, 0x04, 0x45, 0x00, 0x04, 0x3a, - 0x20, 0x21, 0x1c, 0x00, 0x63, 0x63, 0x05, 0x04, 0x00, 0x00, 0x31, } }, -{ 1, { 0x21, 0x21, 0x16, 0x00, 0xa6, 0x77, 0x66, 0x06, 0x00, 0x00, 0x10, - 0x20, 0x21, 0xd8, 0x00, 0x66, 0x68, 0x36, 0x06, 0x00, 0x00, 0x11, } }, -{ 1, { 0x21, 0x21, 0x12, 0x00, 0x75, 0x67, 0x66, 0x06, 0x00, 0x00, 0x10, - 0x21, 0x21, 0x2d, 0x00, 0x62, 0x68, 0x36, 0x06, 0x00, 0x00, 0x11, } }, -{ 1, { 0x02, 0x01, 0x0e, 0x00, 0x76, 0x64, 0x34, 0x35, 0x00, 0x04, 0x10, - 0x01, 0x00, 0x2d, 0x00, 0x66, 0x63, 0x35, 0x04, 0x04, 0x00, 0x11, } }, -{ 1, { 0x21, 0x21, 0x23, 0x00, 0x72, 0x72, 0x9b, 0x3b, 0x01, 0x04, 0x30, - 0x21, 0x21, 0x23, 0x00, 0x82, 0x92, 0x9b, 0x3b, 0x01, 0x04, 0x31, } }, -{ 1, { 0x21, 0x21, 0x23, 0x00, 0x63, 0x62, 0x9b, 0x3b, 0x01, 0x04, 0x30, - 0x21, 0x21, 0x21, 0x00, 0x73, 0x82, 0x9b, 0x3b, 0x01, 0x04, 0x31, } }, -{ 1, { 0x01, 0x01, 0x14, 0x00, 0x62, 0xe6, 0x0b, 0x2b, 0x05, 0x05, 0x26, - 0x21, 0x22, 0x13, 0x00, 0x55, 0x72, 0x1b, 0x2b, 0x04, 0x00, 0x21, } }, -{ 1, { 0x01, 0x21, 0x11, 0x00, 0x60, 0x62, 0xfb, 0x7b, 0x05, 0x00, 0x10, - 0x01, 0x21, 0x10, 0x00, 0x60, 0x62, 0x3b, 0x7b, 0x05, 0x00, 0x11, } }, -{ 0, { 0x21, 0x21, 0x23, 0x00, 0x41, 0x81, 0x94, 0xf6, 0x00, 0x00, 0x2e, } }, -{ 1, { 0x22, 0x61, 0x4c, 0x40, 0x75, 0xf1, 0x37, 0xb7, 0x01, 0x05, 0x20, - 0x21, 0x20, 0x4d, 0x00, 0x56, 0x72, 0x07, 0x17, 0x05, 0x02, 0x21, } }, -{ 1, { 0x21, 0x21, 0x04, 0x00, 0x82, 0x71, 0xcb, 0x2b, 0x01, 0x01, 0x26, - 0x21, 0x21, 0x11, 0x00, 0x75, 0x80, 0x8b, 0x3b, 0x00, 0x00, 0x21, } }, -{ 1, { 0x21, 0x21, 0x83, 0x40, 0x84, 0xa2, 0x3b, 0x3b, 0x01, 0x00, 0x26, - 0x21, 0x21, 0x0e, 0x00, 0x74, 0x73, 0x7b, 0x3b, 0x00, 0x00, 0x21, } }, -{ 1, { 0x01, 0x02, 0x15, 0x00, 0x70, 0x70, 0xe7, 0xe8, 0x05, 0x00, 0x10, - 0x01, 0x00, 0x42, 0x00, 0x70, 0x70, 0xf8, 0xe8, 0x07, 0x02, 0x11, } }, -{ 1, { 0x01, 0x01, 0x13, 0x00, 0x70, 0x70, 0xe9, 0xe9, 0x05, 0x00, 0x10, - 0x01, 0x40, 0x47, 0x40, 0x70, 0x70, 0xe9, 0xe9, 0x07, 0x02, 0x11, } }, -{ 1, { 0x01, 0x01, 0x15, 0x00, 0x70, 0x70, 0xeb, 0xea, 0x05, 0x00, 0x10, - 0x01, 0x40, 0x09, 0x00, 0x70, 0x70, 0xeb, 0xeb, 0x07, 0x02, 0x11, } }, -{ 1, { 0x01, 0x04, 0x11, 0x00, 0xa4, 0x67, 0xbb, 0x6a, 0x00, 0x00, 0x20, - 0x01, 0x02, 0x0c, 0x00, 0xd0, 0x80, 0xeb, 0xeb, 0x01, 0x02, 0x21, } }, -{ 1, { 0x11, 0x34, 0x17, 0x00, 0x70, 0x61, 0x29, 0x29, 0x00, 0x00, 0x30, - 0x31, 0x34, 0xff, 0x40, 0x60, 0x60, 0x09, 0x09, 0x00, 0x02, 0x31, } }, -{ 1, { 0x01, 0x24, 0x11, 0x00, 0xf0, 0x80, 0x29, 0x09, 0x00, 0x00, 0x10, - 0x31, 0x24, 0xda, 0x00, 0x80, 0x80, 0x09, 0x09, 0x00, 0x00, 0x11, } }, -{ 1, { 0x01, 0x24, 0x13, 0x00, 0x60, 0x80, 0x22, 0x09, 0x00, 0x00, 0x10, - 0x31, 0x24, 0x86, 0x00, 0x80, 0x80, 0x05, 0x09, 0x00, 0x00, 0x11, } }, -{ 1, { 0x32, 0x31, 0x1d, 0x00, 0xa2, 0x51, 0x16, 0x26, 0x04, 0x00, 0x3a, - 0x32, 0x31, 0x45, 0x00, 0xfe, 0x55, 0x52, 0x15, 0x04, 0x00, 0x31, } }, -{ 1, { 0x24, 0xa2, 0x20, 0x00, 0x67, 0x65, 0xf6, 0x06, 0x00, 0x00, 0x10, - 0x24, 0xa2, 0x1c, 0x00, 0x7f, 0x67, 0x27, 0x06, 0x00, 0x00, 0x11, } }, -{ 1, { 0x22, 0xa1, 0x26, 0x00, 0x65, 0x67, 0x66, 0x06, 0x00, 0x00, 0x10, - 0x02, 0x21, 0x2a, 0x00, 0xa2, 0x6f, 0x36, 0x06, 0x00, 0x00, 0x11, } }, -{ 1, { 0x21, 0x31, 0x11, 0x00, 0x85, 0x68, 0x66, 0x06, 0x00, 0x00, 0x10, - 0x32, 0x31, 0x19, 0x00, 0xd5, 0x68, 0x39, 0x06, 0x00, 0x00, 0x11, } }, -{ 1, { 0x20, 0xa0, 0x00, 0x00, 0x77, 0x77, 0x08, 0x58, 0x00, 0x00, 0x2e, - 0x24, 0x21, 0xd3, 0x00, 0x76, 0x76, 0xa9, 0x08, 0x04, 0x00, 0x21, } }, -{ 1, { 0x2b, 0x26, 0x12, 0x00, 0x73, 0x67, 0x68, 0x97, 0x00, 0x00, 0x1e, - 0x22, 0x21, 0x14, 0x00, 0x66, 0x60, 0x46, 0xb6, 0x00, 0x00, 0x11, } }, -{ 1, { 0x61, 0xa1, 0x16, 0x00, 0x67, 0x77, 0x56, 0x06, 0x02, 0x00, 0x30, - 0x21, 0x01, 0x15, 0x00, 0xd7, 0x40, 0x66, 0xb6, 0x02, 0x00, 0x31, } }, -{ 1, { 0x61, 0xa1, 0x31, 0x00, 0xc4, 0x50, 0x56, 0xb6, 0x02, 0x00, 0x20, - 0x61, 0x81, 0x30, 0x00, 0xc4, 0x50, 0x66, 0xb6, 0x01, 0x00, 0x21, } }, -{ 1, { 0x31, 0x31, 0x2b, 0x00, 0x57, 0x68, 0x46, 0x06, 0x04, 0x00, 0x30, - 0x32, 0x31, 0x30, 0x00, 0x47, 0x68, 0x69, 0x06, 0x04, 0x00, 0x31, } }, -{ 1, { 0x21, 0x21, 0x00, 0x0d, 0xd4, 0xc2, 0x1b, 0x26, 0x04, 0x06, 0x21, - 0x21, 0x21, 0x00, 0x00, 0xc6, 0xd0, 0x19, 0x27, 0x04, 0x06, 0x21, } }, -{ 1, { 0x21, 0x20, 0x11, 0x00, 0xd4, 0xc2, 0x1b, 0x36, 0x04, 0x03, 0x10, - 0x21, 0x21, 0x10, 0x00, 0xc9, 0xd0, 0x49, 0x37, 0x04, 0x01, 0x11, } }, -{ 1, { 0x22, 0xa1, 0x0e, 0x00, 0x76, 0x67, 0x66, 0x06, 0x00, 0x00, 0x26, - 0x22, 0x21, 0x1e, 0x00, 0x75, 0x75, 0x06, 0x06, 0x02, 0x00, 0x21, } }, -{ 1, { 0xd1, 0xa0, 0x00, 0x00, 0xb7, 0x87, 0x66, 0x06, 0x02, 0x02, 0x20, - 0x01, 0x60, 0x14, 0x00, 0x75, 0xb5, 0x66, 0x06, 0x02, 0x02, 0x21, } }, -{ 1, { 0x30, 0x22, 0x0c, 0x00, 0xf4, 0x62, 0xa0, 0x0e, 0x00, 0x00, 0x10, - 0x20, 0x21, 0x14, 0x00, 0x77, 0x90, 0x4e, 0x1c, 0x00, 0x00, 0x11, } }, -{ 1, { 0x20, 0x32, 0x1a, 0x00, 0x76, 0x47, 0x64, 0x05, 0x00, 0x00, 0x16, - 0x31, 0x21, 0x1b, 0x00, 0x75, 0x75, 0x03, 0x05, 0x00, 0x00, 0x11, } }, -{ 1, { 0x03, 0x06, 0x00, 0x3f, 0xf2, 0xf0, 0xa6, 0xfb, 0x00, 0x00, 0x17, - 0x01, 0x00, 0x15, 0x00, 0xf0, 0xf3, 0xf8, 0xc8, 0x00, 0x00, 0x10, } }, -{ 1, { 0x02, 0x21, 0x0b, 0x00, 0xf3, 0xf1, 0xfb, 0x2b, 0x01, 0x01, 0x16, - 0x01, 0x21, 0xe1, 0x00, 0xf3, 0xf0, 0xfb, 0x2b, 0x05, 0x00, 0x11, } }, -{ 1, { 0x12, 0x12, 0xc0, 0x00, 0xf2, 0xe2, 0x23, 0x55, 0x00, 0x00, 0x10, - 0x31, 0x30, 0x1c, 0x00, 0x69, 0x52, 0x33, 0x15, 0x02, 0x02, 0x11, } }, -{ 1, { 0x01, 0x31, 0x18, 0x00, 0x21, 0x22, 0x53, 0x55, 0x00, 0x00, 0x30, - 0x11, 0x31, 0xd4, 0x00, 0x21, 0x21, 0x53, 0x45, 0x01, 0x00, 0x31, } }, -{ 1, { 0x20, 0x01, 0x00, 0x00, 0xc3, 0xf0, 0xf4, 0xf5, 0x02, 0x00, 0x10, - 0x01, 0x21, 0x08, 0x00, 0x32, 0x20, 0x14, 0x04, 0x05, 0x00, 0x11, } }, -{ 0, { 0x30, 0x20, 0xd1, 0x00, 0xa2, 0x63, 0x40, 0x48, 0x00, 0x00, 0x20, } }, -{ 1, { 0x06, 0x21, 0x08, 0x00, 0xf0, 0x45, 0xe4, 0x36, 0x00, 0x00, 0x30, - 0x01, 0x21, 0x46, 0x00, 0xe5, 0x40, 0x34, 0x05, 0x04, 0x00, 0x31, } }, -{ 1, { 0x21, 0x21, 0x40, 0x00, 0x63, 0x30, 0x83, 0x13, 0x00, 0x00, 0x10, - 0x21, 0x21, 0x17, 0x00, 0x63, 0x40, 0xa3, 0x13, 0x05, 0x04, 0x11, } }, -{ 1, { 0x31, 0x30, 0x00, 0xc4, 0x60, 0x64, 0x15, 0xf8, 0x00, 0x02, 0x35, - 0x31, 0x31, 0x00, 0x00, 0xb0, 0xd0, 0xc5, 0x45, 0x00, 0x00, 0x31, } }, -{ 1, { 0x31, 0x12, 0x00, 0x8c, 0x44, 0x12, 0xf4, 0xb3, 0x00, 0x00, 0x25, - 0x10, 0x30, 0x00, 0x00, 0x30, 0x74, 0xb4, 0x04, 0x01, 0x01, 0x21, } }, -{ 1, { 0x08, 0x83, 0xc0, 0x00, 0xfb, 0xf5, 0x66, 0x68, 0x00, 0x00, 0x10, - 0x21, 0x21, 0x14, 0x00, 0xf0, 0xde, 0x25, 0x05, 0x00, 0x00, 0x11, } }, -{ 1, { 0x08, 0x01, 0x01, 0x00, 0x33, 0x31, 0xf2, 0xf2, 0x00, 0x00, 0x20, - 0x01, 0x01, 0x04, 0x00, 0x31, 0x32, 0xf2, 0xf2, 0x01, 0x00, 0x21, } }, -{ 1, { 0x17, 0x91, 0xc0, 0x00, 0xf1, 0xf1, 0x31, 0x22, 0x00, 0x00, 0x18, - 0x95, 0x91, 0x9b, 0x00, 0xf1, 0xf1, 0x21, 0x23, 0x00, 0x00, 0x11, } }, -{ 1, { 0x01, 0x17, 0x00, 0x00, 0xd2, 0xd8, 0x24, 0x34, 0x00, 0x00, 0x20, - 0x01, 0x20, 0x17, 0x00, 0xea, 0xe1, 0x34, 0x14, 0x02, 0x02, 0x21, } }, -{ 1, { 0x06, 0x01, 0x08, 0x00, 0xf0, 0xf5, 0xe4, 0x34, 0x00, 0x00, 0x30, - 0x01, 0xa0, 0x44, 0x00, 0xe5, 0xe0, 0x34, 0x44, 0x02, 0x02, 0x31, } }, -{ 1, { 0x04, 0x01, 0x02, 0x00, 0x11, 0x21, 0x32, 0x22, 0x00, 0x00, 0x18, - 0x01, 0x01, 0x41, 0x00, 0x11, 0x11, 0x24, 0x23, 0x00, 0x00, 0x11, } }, -{ 1, { 0x05, 0x01, 0xc0, 0x00, 0xf8, 0xe1, 0xd3, 0x03, 0x00, 0x00, 0x20, - 0x21, 0x21, 0x10, 0x00, 0x69, 0x52, 0x33, 0x13, 0x01, 0x00, 0x21, } }, -{ 1, { 0x02, 0x21, 0x00, 0x00, 0x83, 0x61, 0xf3, 0x23, 0x01, 0x00, 0x16, - 0x01, 0x21, 0x0b, 0x00, 0x73, 0x52, 0xf3, 0x23, 0x05, 0x00, 0x11, } }, -{ 1, { 0x25, 0x01, 0x12, 0x00, 0xf7, 0xf8, 0x44, 0x04, 0x04, 0x04, 0x30, - 0xa7, 0x01, 0x17, 0x00, 0x80, 0xf3, 0x64, 0x74, 0x04, 0x04, 0x31, } }, -{ 1, { 0x01, 0x05, 0x00, 0x25, 0xf4, 0xf8, 0xa6, 0xfb, 0x04, 0x00, 0x35, - 0x01, 0x02, 0x10, 0x00, 0xf4, 0xf6, 0xfb, 0xc7, 0x00, 0x04, 0x30, } }, -{ 1, { 0x04, 0x07, 0x09, 0x00, 0xfa, 0xf8, 0xa6, 0xfb, 0x00, 0x00, 0x24, - 0x01, 0x01, 0x16, 0x00, 0xf3, 0xf3, 0x95, 0xc5, 0x04, 0x04, 0x21, } }, -{ 1, { 0x01, 0x05, 0x00, 0x25, 0xf4, 0xfa, 0xa4, 0xfb, 0x04, 0x04, 0x25, - 0x01, 0x01, 0x18, 0x00, 0xf4, 0xf3, 0xf5, 0xc5, 0x04, 0x04, 0x20, } }, -{ 1, { 0x09, 0x03, 0x00, 0x00, 0xf8, 0xf8, 0x6e, 0x6e, 0x04, 0x04, 0x20, - 0x01, 0x86, 0x00, 0x00, 0xf4, 0xf7, 0x16, 0xea, 0x00, 0x00, 0x21, } }, -{ 1, { 0x11, 0x32, 0x0c, 0x00, 0xd0, 0x80, 0xf3, 0x05, 0x00, 0x00, 0x30, - 0x31, 0x24, 0xc9, 0x00, 0x40, 0x50, 0x09, 0x09, 0x00, 0x04, 0x31, } }, -{ 1, { 0x24, 0x20, 0xc9, 0x00, 0xaa, 0x95, 0x58, 0x08, 0x04, 0x03, 0x30, - 0x24, 0x20, 0xc9, 0x00, 0xc7, 0x72, 0x88, 0x28, 0x05, 0x03, 0x31, } }, -{ 1, { 0x11, 0x32, 0x0c, 0x00, 0xd0, 0x80, 0xf3, 0x05, 0x00, 0x00, 0x10, - 0x31, 0x24, 0xcc, 0x00, 0x60, 0x60, 0x06, 0x06, 0x00, 0x04, 0x11, } }, -{ 1, { 0x16, 0x19, 0x4f, 0x00, 0xf6, 0xf3, 0x53, 0x53, 0x00, 0x00, 0x30, - 0x15, 0x14, 0x41, 0x00, 0xf1, 0xf3, 0x52, 0x52, 0x06, 0x06, 0x31, } }, -{ 1, { 0x17, 0x12, 0x00, 0x00, 0xfa, 0xf5, 0x57, 0x58, 0x00, 0x00, 0x10, - 0x14, 0x12, 0x40, 0x00, 0xf7, 0xf5, 0x52, 0x59, 0x06, 0x06, 0x11, } }, -{ 1, { 0x08, 0x01, 0x1f, 0x00, 0xc6, 0x82, 0x37, 0x95, 0x00, 0x00, 0x36, - 0x05, 0x11, 0x0f, 0x00, 0x65, 0x52, 0x55, 0x75, 0x00, 0x00, 0x31, } }, -{ 1, { 0x02, 0x01, 0x09, 0x00, 0xfc, 0xf7, 0xd6, 0xf7, 0x02, 0x00, 0x20, - 0x07, 0x03, 0x3f, 0xc0, 0xfa, 0xf5, 0x4e, 0xfe, 0x00, 0x00, 0x21, } }, -{ 1, { 0x1a, 0x30, 0x00, 0x00, 0xfb, 0xf3, 0x57, 0x54, 0x00, 0x01, 0x11, - 0x11, 0x10, 0x40, 0x00, 0xc5, 0xc5, 0x52, 0x57, 0x01, 0x00, 0x11, } }, -{ 1, { 0x12, 0x30, 0x01, 0x00, 0xfb, 0xf3, 0xa7, 0x53, 0x00, 0x00, 0x30, - 0x10, 0x10, 0xff, 0x00, 0xf4, 0xc4, 0x52, 0x57, 0x00, 0x00, 0x31, } }, -{ 1, { 0x2b, 0x0b, 0x00, 0x00, 0xff, 0xf7, 0x0e, 0xfe, 0x00, 0x00, 0x3e, - 0x00, 0x20, 0xc0, 0x00, 0xf6, 0xff, 0xfe, 0x0c, 0x02, 0x00, 0x31, } }, -{ 1, { 0x2a, 0x0b, 0x00, 0x00, 0xff, 0x2f, 0x0e, 0x0e, 0x04, 0x04, 0x2e, - 0x28, 0x09, 0x00, 0x00, 0xf9, 0x29, 0x0e, 0x0e, 0x04, 0x04, 0x21, } }, -{ 1, { 0x0b, 0x0b, 0x00, 0x00, 0x64, 0x77, 0xf8, 0xf8, 0x04, 0x04, 0x1e, - 0x0b, 0x09, 0x10, 0x00, 0x56, 0x59, 0xf8, 0xe8, 0x04, 0x04, 0x11, } }, -{ 1, { 0x2b, 0x25, 0x05, 0x00, 0x79, 0x77, 0x05, 0xa5, 0x00, 0x00, 0x2e, - 0x26, 0x01, 0x10, 0x00, 0x66, 0x76, 0xb9, 0xde, 0x04, 0x00, 0x21, } }, -{ 0, { 0x30, 0x10, 0x00, 0x00, 0x11, 0x11, 0x00, 0x32, 0x00, 0x03, 0x3e, } }, -{ 0, { 0x0a, 0x09, 0x00, 0x00, 0x59, 0x69, 0xfe, 0xfe, 0x00, 0x00, 0x21, } }, -{ 1, { 0x0a, 0x02, 0x0b, 0x00, 0xe5, 0xe4, 0xf5, 0xf5, 0x05, 0x00, 0x30, - 0x08, 0x02, 0x43, 0x00, 0xf5, 0xf4, 0xf5, 0xf5, 0x03, 0x00, 0x31, } }, -{ 1, { 0x0b, 0x04, 0x00, 0x80, 0x82, 0x77, 0xfa, 0xfa, 0x00, 0x05, 0x2e, - 0x20, 0x20, 0x11, 0x00, 0xf7, 0xfa, 0xfa, 0xfb, 0x00, 0x00, 0x21, } }, -{ 1, { 0x2b, 0x27, 0x00, 0x00, 0xf0, 0x23, 0x01, 0x13, 0x00, 0x05, 0x3e, - 0x20, 0x20, 0x7f, 0x00, 0xfb, 0xf4, 0xe5, 0xf5, 0x00, 0x00, 0x31, } }, -{ 1, { 0x0b, 0x01, 0x40, 0xc0, 0xf5, 0xf7, 0x67, 0x64, 0x00, 0x00, 0x1e, - 0x07, 0x01, 0x3f, 0x00, 0xf7, 0xfa, 0x34, 0x9e, 0x04, 0x04, 0x11, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x52, 0x11, 0x1b, 0x00, 0x68, 0xd6, 0x1c, 0x43, 0x05, 0x00, 0x2a, } }, -{ 0, { 0x40, 0x01, 0x18, 0x00, 0x68, 0xd6, 0x19, 0x46, 0x02, 0x00, 0x1e, } }, -{ 0, { 0x02, 0x04, 0x07, 0x00, 0xfa, 0xda, 0xbb, 0xbe, 0x00, 0x00, 0x38, } }, -{ 1, { 0x12, 0x01, 0xc0, 0x00, 0xf3, 0xf6, 0xf0, 0xf6, 0x07, 0x00, 0x3e, - 0x10, 0x10, 0x0c, 0x00, 0xf0, 0x91, 0x00, 0x05, 0x03, 0x06, 0x30, } }, -{ 0, { 0x01, 0x05, 0x07, 0x00, 0x9a, 0x9a, 0xb6, 0xbd, 0x02, 0x00, 0x3e, } }, -{ 1, { 0x17, 0x01, 0xc0, 0x00, 0xf3, 0xf8, 0xf0, 0xb7, 0x00, 0x00, 0x1e, - 0x10, 0x10, 0x0c, 0x00, 0xf0, 0xd1, 0x60, 0x75, 0x00, 0x06, 0x10, } }, -{ 0, { 0x01, 0x01, 0x0d, 0x00, 0xe8, 0xa5, 0xec, 0xf7, 0x00, 0x00, 0x16, } }, -{ 0, { 0x2f, 0x31, 0x07, 0x00, 0x73, 0xc4, 0xc2, 0xb4, 0x00, 0x00, 0x2a, } }, -{ 0, { 0x01, 0x01, 0x0d, 0x00, 0xe8, 0xa5, 0xec, 0xf7, 0x01, 0x00, 0x36, } }, -{ 0, { 0x13, 0x10, 0xcd, 0x80, 0xf5, 0xd5, 0x92, 0xd4, 0x01, 0x00, 0x1a, } }, -{ 0, { 0x01, 0x01, 0x0d, 0x00, 0xe8, 0xa5, 0xec, 0xf5, 0x00, 0x00, 0x16, } }, -{ 0, { 0x3c, 0x31, 0x90, 0x00, 0x73, 0xc4, 0xb1, 0xf3, 0x00, 0x00, 0x2a, } }, -}; - -const struct opl_operators opl2_instrs[OPL_NINSTR] = { -{ 0, { 0x01, 0x10, 0x1b, 0x00, 0xc3, 0x92, 0x23, 0x62, 0x02, 0x01, 0x1e, } }, -{ 0, { 0x03, 0x01, 0x7d, 0x00, 0xf3, 0xf3, 0xf5, 0xf5, 0x00, 0x04, 0x30, } }, -{ 0, { 0x03, 0x01, 0x61, 0x00, 0xfb, 0xf5, 0xf5, 0xf5, 0x04, 0x04, 0x30, } }, -{ 0, { 0x03, 0x01, 0xd7, 0x00, 0xf3, 0xf2, 0xf5, 0xf5, 0x04, 0x04, 0x20, } }, -{ 0, { 0x35, 0x12, 0xd4, 0x00, 0x94, 0x92, 0x91, 0x62, 0x02, 0x00, 0x2e, } }, -{ 0, { 0x11, 0x10, 0x00, 0x00, 0xe1, 0x92, 0x63, 0x72, 0x02, 0x00, 0x17, } }, -{ 0, { 0x22, 0x01, 0x8a, 0x00, 0xe3, 0xf4, 0x79, 0xa8, 0x05, 0x04, 0x24, } }, -{ 0, { 0x22, 0x01, 0x9c, 0x00, 0xf4, 0xf3, 0x18, 0x55, 0x05, 0x05, 0x30, } }, -{ 0, { 0x02, 0x01, 0x00, 0x00, 0x93, 0xb6, 0x74, 0x45, 0x00, 0x00, 0x25, } }, -{ 0, { 0x1b, 0x17, 0x5a, 0x00, 0xd6, 0xf3, 0x53, 0x53, 0x00, 0x00, 0x20, } }, -{ 0, { 0x1b, 0x14, 0x5a, 0x00, 0xf6, 0x63, 0xf6, 0x73, 0x00, 0x00, 0x20, } }, -{ 0, { 0x8b, 0x84, 0x5a, 0x00, 0xd8, 0xf4, 0x16, 0xe5, 0x00, 0x00, 0x30, } }, -{ 0, { 0x08, 0x01, 0xc0, 0x00, 0xfd, 0xf6, 0x56, 0x68, 0x00, 0x00, 0x30, } }, -{ 0, { 0x08, 0x03, 0xc0, 0x00, 0xf9, 0xf7, 0x56, 0x68, 0x00, 0x00, 0x30, } }, -{ 0, { 0x35, 0x11, 0xcd, 0x00, 0xf2, 0xf2, 0xf1, 0xf2, 0x00, 0x00, 0x34, } }, -{ 0, { 0x18, 0x02, 0x9a, 0x00, 0xb3, 0xf0, 0x8a, 0xd3, 0x01, 0x01, 0x1c, } }, -{ 0, { 0x24, 0x61, 0xd4, 0x00, 0x81, 0x61, 0x06, 0xa6, 0x03, 0x00, 0x12, } }, -{ 0, { 0xa3, 0x21, 0x95, 0x00, 0x81, 0xd1, 0xf9, 0x0d, 0x01, 0x00, 0x12, } }, -{ 0, { 0x25, 0x61, 0xd2, 0x00, 0x81, 0xd1, 0x06, 0x35, 0x00, 0x00, 0x3e, } }, -{ 0, { 0x27, 0x21, 0x23, 0x00, 0x74, 0x60, 0x11, 0x05, 0x00, 0x00, 0x22, } }, -{ 0, { 0x22, 0x21, 0x24, 0x00, 0x76, 0x76, 0x06, 0x06, 0x04, 0x04, 0x30, } }, -{ 0, { 0x22, 0x21, 0x1b, 0x00, 0x66, 0x66, 0x05, 0x06, 0x00, 0x04, 0x30, } }, -{ 0, { 0x22, 0xb2, 0x15, 0x00, 0x41, 0x31, 0x04, 0x04, 0x03, 0x01, 0x22, } }, -{ 0, { 0x21, 0x21, 0x1e, 0x00, 0x76, 0x66, 0x04, 0x17, 0x04, 0x05, 0x10, } }, -{ 0, { 0x01, 0x11, 0xc0, 0x00, 0xb5, 0xd2, 0x52, 0x72, 0x01, 0x00, 0x20, } }, -{ 0, { 0x23, 0x11, 0x8a, 0x00, 0x85, 0xd2, 0x54, 0x73, 0x01, 0x00, 0x28, } }, -{ 0, { 0x04, 0x01, 0x12, 0x00, 0xfd, 0xf2, 0x43, 0xa6, 0x00, 0x00, 0x20, } }, -{ 0, { 0x23, 0x01, 0x00, 0x00, 0xfc, 0xf4, 0x67, 0xc6, 0x03, 0x02, 0x20, } }, -{ 0, { 0x01, 0x01, 0x06, 0x00, 0xf6, 0xf6, 0x27, 0x25, 0x04, 0x01, 0x10, } }, -{ 0, { 0x21, 0x21, 0xc1, 0x00, 0xf2, 0xf2, 0x13, 0x16, 0x00, 0x04, 0x30, } }, -{ 0, { 0x21, 0x21, 0xc1, 0x00, 0xf2, 0xf2, 0x14, 0x15, 0x00, 0x04, 0x10, } }, -{ 0, { 0x0b, 0x01, 0x40, 0x00, 0x65, 0xf2, 0x1a, 0x3e, 0x00, 0x03, 0x3c, } }, -{ 0, { 0x01, 0x01, 0x0f, 0x00, 0xd8, 0x82, 0x96, 0x66, 0x00, 0x00, 0x10, } }, -{ 0, { 0x01, 0x01, 0x0b, 0x00, 0xf2, 0xf6, 0x97, 0xe6, 0x04, 0x01, 0x20, } }, -{ 0, { 0x01, 0x01, 0x04, 0x00, 0xf2, 0xf6, 0x95, 0xe6, 0x04, 0x01, 0x10, } }, -{ 0, { 0x01, 0x01, 0x48, 0x00, 0xc7, 0x91, 0x96, 0xe6, 0x00, 0x00, 0x30, } }, -{ 0, { 0x0b, 0x01, 0x00, 0x00, 0xfa, 0xf3, 0x86, 0xb6, 0x06, 0x01, 0x10, } }, -{ 0, { 0x0b, 0x01, 0x00, 0x00, 0xfa, 0xf3, 0x87, 0xb7, 0x02, 0x01, 0x10, } }, -{ 0, { 0xc1, 0x01, 0x00, 0x00, 0xe5, 0xf5, 0x65, 0x95, 0x00, 0x00, 0x21, } }, -{ 0, { 0xc1, 0x01, 0x00, 0x00, 0xf2, 0xf2, 0x45, 0x96, 0x00, 0x00, 0x21, } }, -{ 0, { 0x62, 0x61, 0xca, 0x00, 0xb4, 0x44, 0x25, 0x06, 0x04, 0x04, 0x3e, } }, -{ 0, { 0x24, 0x21, 0xcb, 0x00, 0x88, 0x66, 0x24, 0x15, 0x04, 0x04, 0x1e, } }, -{ 0, { 0x24, 0x21, 0xd3, 0x00, 0x88, 0x66, 0x24, 0x16, 0x04, 0x04, 0x1e, } }, -{ 0, { 0x71, 0x61, 0x23, 0x00, 0x51, 0x52, 0x43, 0x15, 0x00, 0x00, 0x1e, } }, -{ 0, { 0xa2, 0xa1, 0xcb, 0x00, 0x84, 0x51, 0x13, 0x55, 0x00, 0x02, 0x2a, } }, -{ 0, { 0xf1, 0xe2, 0x00, 0x80, 0xf5, 0xfd, 0xa8, 0xac, 0x00, 0x00, 0x37, } }, -{ 0, { 0x22, 0x02, 0x00, 0x00, 0xd4, 0xc4, 0x34, 0x26, 0x01, 0x00, 0x29, } }, -{ 0, { 0x10, 0x10, 0x55, 0x00, 0x30, 0xb0, 0x09, 0x04, 0x03, 0x03, 0x2a, } }, -{ 0, { 0x62, 0xa2, 0x8b, 0x40, 0x71, 0x43, 0x33, 0xe5, 0x01, 0x00, 0x24, } }, -{ 0, { 0x61, 0x21, 0x8b, 0x40, 0x71, 0x43, 0x33, 0xe5, 0x01, 0x00, 0x14, } }, -{ 0, { 0x61, 0x22, 0x8b, 0x40, 0x71, 0x43, 0x33, 0xe5, 0x01, 0x00, 0x26, } }, -{ 0, { 0x01, 0x21, 0x13, 0x00, 0x51, 0x44, 0x15, 0x04, 0x02, 0x01, 0x10, } }, -{ 0, { 0xf3, 0xc1, 0x95, 0x00, 0x32, 0x43, 0x40, 0x46, 0x02, 0x01, 0x3e, } }, -{ 0, { 0xf3, 0xc1, 0x51, 0x00, 0xa2, 0x62, 0xa4, 0x84, 0x00, 0x01, 0x1e, } }, -{ 0, { 0xe0, 0xe3, 0x4d, 0x00, 0x52, 0x65, 0x51, 0x35, 0x02, 0x00, 0x36, } }, -{ 0, { 0x20, 0x00, 0x07, 0x00, 0xf7, 0x96, 0xb5, 0x46, 0x00, 0x00, 0x20, } }, -{ 0, { 0x21, 0xa1, 0x1c, 0x00, 0x53, 0x52, 0x14, 0x35, 0x00, 0x00, 0x1c, } }, -{ 0, { 0x21, 0xa2, 0x1a, 0x80, 0x53, 0x52, 0x19, 0x39, 0x00, 0x00, 0x2a, } }, -{ 0, { 0x21, 0x21, 0x21, 0x00, 0x63, 0x85, 0x8c, 0x2c, 0x00, 0x00, 0x3c, } }, -{ 0, { 0xe1, 0xe3, 0x98, 0x00, 0x71, 0x81, 0xa5, 0x96, 0x01, 0x00, 0x1c, } }, -{ 0, { 0x31, 0x21, 0x55, 0x00, 0x53, 0xaa, 0x54, 0x15, 0x00, 0x00, 0x3e, } }, -{ 0, { 0x21, 0xa2, 0x1b, 0x80, 0x53, 0x52, 0x15, 0x36, 0x00, 0x00, 0x3a, } }, -{ 0, { 0x21, 0x21, 0x20, 0x00, 0x83, 0x81, 0x75, 0x86, 0x05, 0x04, 0x1e, } }, -{ 0, { 0x21, 0x21, 0x8e, 0x80, 0x9b, 0x90, 0x25, 0x05, 0x00, 0x00, 0x18, } }, -{ 0, { 0x01, 0x02, 0x15, 0x00, 0x70, 0x70, 0xe5, 0xe6, 0x05, 0x00, 0x20, } }, -{ 0, { 0x01, 0x01, 0x14, 0x00, 0x80, 0x70, 0xe5, 0xe6, 0x05, 0x00, 0x30, } }, -{ 0, { 0x01, 0x01, 0x12, 0x00, 0x80, 0x70, 0xe5, 0xe6, 0x05, 0x00, 0x30, } }, -{ 0, { 0x01, 0xa3, 0x91, 0x00, 0x51, 0x52, 0x57, 0x77, 0x01, 0x00, 0x2a, } }, -{ 0, { 0x71, 0x64, 0xc9, 0x00, 0x6e, 0x8b, 0x13, 0x07, 0x00, 0x01, 0x12, } }, -{ 0, { 0xa1, 0xa3, 0x25, 0x00, 0x71, 0x82, 0xa5, 0x97, 0x00, 0x00, 0x10, } }, -{ 0, { 0x01, 0x24, 0x13, 0x00, 0xf0, 0x80, 0x22, 0x07, 0x00, 0x00, 0x20, } }, -{ 0, { 0x32, 0x31, 0x1d, 0x00, 0xa2, 0x51, 0x14, 0x24, 0x04, 0x00, 0x3a, } }, -{ 0, { 0x21, 0xa1, 0x20, 0x00, 0x77, 0x65, 0x43, 0x06, 0x00, 0x00, 0x20, } }, -{ 0, { 0x01, 0xa1, 0xa4, 0x00, 0x6a, 0x63, 0x64, 0x66, 0x02, 0x00, 0x20, } }, -{ 0, { 0x22, 0x21, 0xac, 0x00, 0x67, 0x65, 0x89, 0x28, 0x00, 0x00, 0x2e, } }, -{ 0, { 0xe3, 0xa1, 0xe9, 0x00, 0x6d, 0x65, 0x8d, 0x29, 0x00, 0x00, 0x1e, } }, -{ 0, { 0x20, 0x26, 0x10, 0x00, 0xd8, 0x68, 0x68, 0x97, 0x00, 0x00, 0x3e, } }, -{ 0, { 0x22, 0x21, 0x6c, 0x00, 0x47, 0x65, 0x0f, 0x2a, 0x00, 0x00, 0x1e, } }, -{ 0, { 0xe1, 0xe2, 0xff, 0x00, 0x70, 0x62, 0x0c, 0xfb, 0x00, 0x00, 0x3e, } }, -{ 0, { 0x31, 0x31, 0x2b, 0x00, 0x57, 0x68, 0x46, 0x06, 0x04, 0x00, 0x20, } }, -{ 0, { 0x91, 0x13, 0x97, 0x80, 0x2a, 0x42, 0x02, 0xf3, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0xa2, 0x91, 0x00, 0x51, 0x52, 0x53, 0x76, 0x01, 0x00, 0x3e, } }, -{ 0, { 0x23, 0x21, 0xd8, 0x00, 0x50, 0x72, 0x00, 0xf8, 0x03, 0x00, 0x1e, } }, -{ 0, { 0xd1, 0xa0, 0x00, 0x00, 0xb7, 0x87, 0x66, 0x06, 0x02, 0x02, 0x10, } }, -{ 0, { 0x00, 0x15, 0x4f, 0x00, 0x71, 0x52, 0x53, 0x74, 0x00, 0x00, 0x26, } }, -{ 0, { 0xe0, 0xe1, 0xc5, 0x00, 0x52, 0x65, 0xa1, 0x35, 0x00, 0x00, 0x36, } }, -{ 0, { 0xb0, 0xb1, 0x00, 0x00, 0xd5, 0x26, 0x13, 0x13, 0x01, 0x00, 0x35, } }, -{ 0, { 0x21, 0xa1, 0x1d, 0x80, 0x53, 0x52, 0x14, 0x35, 0x00, 0x00, 0x2a, } }, -{ 0, { 0x21, 0xa1, 0x1b, 0x00, 0x51, 0x82, 0x15, 0x45, 0x01, 0x00, 0x10, } }, -{ 0, { 0xe1, 0xa1, 0xa3, 0x00, 0x6e, 0x65, 0x8f, 0x06, 0x01, 0x00, 0x2e, } }, -{ 0, { 0x20, 0x01, 0x00, 0x00, 0xc3, 0xf0, 0xf4, 0xf5, 0x02, 0x00, 0x10, } }, -{ 0, { 0xf1, 0xc2, 0x51, 0x00, 0xa2, 0x63, 0x40, 0x46, 0x00, 0x00, 0x3e, } }, -{ 0, { 0xe1, 0xa2, 0x4d, 0x00, 0x71, 0x43, 0x33, 0xe5, 0x01, 0x00, 0x16, } }, -{ 0, { 0x21, 0x21, 0x40, 0x00, 0x63, 0x30, 0x83, 0x15, 0x00, 0x00, 0x10, } }, -{ 0, { 0x24, 0x21, 0x24, 0x00, 0x67, 0x65, 0x8f, 0x2a, 0x02, 0x00, 0x3e, } }, -{ 0, { 0x24, 0x21, 0x15, 0x00, 0x27, 0x65, 0x88, 0x26, 0x02, 0x00, 0x1e, } }, -{ 0, { 0x08, 0x83, 0xc0, 0x00, 0xfb, 0xf5, 0x66, 0x66, 0x00, 0x00, 0x10, } }, -{ 0, { 0xf4, 0xe1, 0x54, 0x00, 0x25, 0xf0, 0xbd, 0x47, 0x00, 0x01, 0x10, } }, -{ 0, { 0xb4, 0xa1, 0x0a, 0x00, 0x67, 0x65, 0x88, 0x2a, 0x02, 0x00, 0x20, } }, -{ 0, { 0x23, 0x21, 0xdb, 0x00, 0x47, 0x65, 0x8f, 0x2a, 0x02, 0x00, 0x1e, } }, -{ 0, { 0x24, 0x21, 0x22, 0x00, 0x47, 0x65, 0x8f, 0x2a, 0x02, 0x00, 0x1e, } }, -{ 0, { 0xe6, 0x30, 0x0b, 0x00, 0x25, 0xf0, 0xb5, 0x45, 0x00, 0x00, 0x28, } }, -{ 0, { 0xe3, 0x70, 0x50, 0x80, 0x25, 0xf0, 0xb0, 0x45, 0x00, 0x00, 0x30, } }, -{ 0, { 0xe6, 0xe0, 0x15, 0x00, 0x70, 0x62, 0x07, 0xf7, 0x00, 0x00, 0x2e, } }, -{ 0, { 0x25, 0x01, 0x12, 0x00, 0xf7, 0xf8, 0x43, 0x05, 0x04, 0x04, 0x30, } }, -{ 0, { 0x01, 0x00, 0x00, 0x00, 0xf4, 0xf8, 0xa6, 0x35, 0x04, 0x00, 0x35, } }, -{ 0, { 0x04, 0x07, 0x09, 0x00, 0xfa, 0xf8, 0xa6, 0xfb, 0x00, 0x00, 0x14, } }, -{ 0, { 0x00, 0x01, 0x13, 0x00, 0xf2, 0xf4, 0x13, 0xf5, 0x00, 0x00, 0x18, } }, -{ 0, { 0x00, 0x01, 0x0f, 0x00, 0xf2, 0xf4, 0x13, 0xf5, 0x00, 0x00, 0x30, } }, -{ 0, { 0x11, 0x32, 0x0c, 0x00, 0xd0, 0x80, 0xf2, 0x05, 0x00, 0x00, 0x10, } }, -{ 0, { 0x10, 0x21, 0x43, 0x40, 0x9b, 0x69, 0x30, 0x0e, 0x03, 0x05, 0x30, } }, -{ 0, { 0x11, 0x32, 0x0c, 0x00, 0xd0, 0x80, 0xf3, 0x05, 0x00, 0x00, 0x20, } }, -{ 0, { 0x16, 0x17, 0x4f, 0x00, 0xf6, 0xf3, 0x53, 0x53, 0x00, 0x00, 0x20, } }, -{ 0, { 0x17, 0x12, 0x00, 0x00, 0xfa, 0xf5, 0x57, 0x58, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x0d, 0x00, 0xa8, 0xd6, 0x4b, 0x4a, 0x00, 0x01, 0x28, } }, -{ 0, { 0x32, 0x10, 0x4a, 0x00, 0xf8, 0xf5, 0xff, 0x7f, 0x00, 0x00, 0x3e, } }, -{ 0, { 0x00, 0x00, 0x0d, 0x00, 0xa8, 0xd6, 0x4c, 0x4f, 0x00, 0x00, 0x10, } }, -{ 0, { 0x12, 0x30, 0x01, 0x00, 0xfb, 0xf3, 0xa7, 0x53, 0x00, 0x00, 0x10, } }, -{ 0, { 0x2b, 0x0b, 0x00, 0x00, 0xff, 0xf7, 0x0e, 0xfe, 0x00, 0x00, 0x3e, } }, -{ 0, { 0x01, 0x10, 0x07, 0x00, 0xf5, 0x54, 0xb5, 0x2f, 0x00, 0x00, 0x26, } }, -{ 0, { 0x00, 0x18, 0x80, 0x00, 0xb3, 0xaf, 0x3f, 0xf0, 0x00, 0x00, 0x1a, } }, -{ 0, { 0x60, 0xef, 0x40, 0x00, 0xb1, 0xb2, 0x73, 0x9b, 0x02, 0x03, 0x3e, } }, -{ 0, { 0xaf, 0xb0, 0x40, 0x00, 0xa1, 0x52, 0x53, 0x73, 0x00, 0x00, 0x3e, } }, -{ 0, { 0x00, 0x07, 0x2e, 0x00, 0xf0, 0x5f, 0xf0, 0xf0, 0x00, 0x00, 0x1e, } }, -{ 0, { 0xe5, 0x70, 0x13, 0x00, 0x70, 0x62, 0x0f, 0xff, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x10, 0x00, 0x00, 0x68, 0xa5, 0xcf, 0x6b, 0x02, 0x00, 0x2e, } }, -{ 0, { 0x2b, 0x27, 0x00, 0x00, 0x82, 0x77, 0x0a, 0x0a, 0x00, 0x05, 0x2e, } }, -{ 0, { 0x00, 0x00, 0x0b, 0x00, 0xfa, 0xf6, 0x6f, 0x8f, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } }, -{ 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, } }, -{ 0, { 0x42, 0x01, 0x1b, 0x00, 0x68, 0xd6, 0x1c, 0x45, 0x03, 0x00, 0x2e, } }, -{ 0, { 0x40, 0x01, 0x18, 0x00, 0x68, 0xd6, 0x19, 0x46, 0x02, 0x00, 0x2e, } }, -{ 0, { 0x02, 0x04, 0x07, 0x00, 0xfa, 0xda, 0xbb, 0xbe, 0x00, 0x00, 0x38, } }, -{ 0, { 0x17, 0x00, 0x00, 0x00, 0xf3, 0xf8, 0xf0, 0xb7, 0x02, 0x00, 0x1e, } }, -{ 0, { 0x01, 0x05, 0x07, 0x00, 0x9a, 0x9a, 0xb6, 0xb9, 0x02, 0x00, 0x3e, } }, -{ 0, { 0x17, 0x03, 0x00, 0x00, 0xf1, 0xf7, 0xf0, 0xb7, 0x02, 0x00, 0x1e, } }, -{ 0, { 0x01, 0x01, 0x0d, 0x00, 0xe8, 0xa5, 0xec, 0xf7, 0x00, 0x00, 0x16, } }, -{ 0, { 0x2f, 0x31, 0x07, 0x00, 0x73, 0xc4, 0xc2, 0xb4, 0x00, 0x00, 0x3a, } }, -{ 0, { 0x01, 0x01, 0x0d, 0x00, 0xe8, 0xa5, 0xec, 0xf7, 0x01, 0x00, 0x36, } }, -{ 0, { 0x13, 0x10, 0xcd, 0x80, 0xf5, 0xd5, 0x92, 0xd4, 0x01, 0x00, 0x2a, } }, -{ 0, { 0x01, 0x01, 0x0d, 0x00, 0xe8, 0xa5, 0xec, 0xf5, 0x00, 0x00, 0x16, } }, -{ 0, { 0x3c, 0x31, 0x0a, 0x40, 0x73, 0xc4, 0xb1, 0xf3, 0x00, 0x00, 0x1a, } }, -}; diff --git a/sys/dev/ic/oplreg.h b/sys/dev/ic/oplreg.h deleted file mode 100644 index a7355fe5632..00000000000 --- a/sys/dev/ic/oplreg.h +++ /dev/null @@ -1,139 +0,0 @@ -/* $OpenBSD: oplreg.h,v 1.2 2008/06/26 05:42:16 ray Exp $ */ -/* $NetBSD: oplreg.h,v 1.3 1998/11/25 22:17:06 augustss Exp $ */ - -/* - * Copyright (c) 1997 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Lennart Augustsson (augustss@netbsd.org). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* Offsets from base address */ -#define OPL_L 0 -#define OPL_R 2 - -/* Offsets from base+[OPL_L|OPL_R] */ -#define OPL_STATUS 0 -#define OPL_STATUS_IRQ 0x80 -#define OPL_STATUS_FT1 0x40 -#define OPL_STATUS_FT2 0x20 -#define OPL_STATUS_MASK 0xE0 -#define OPL_ADDR 0 -#define OPL_DATA 1 - -#define OPL_TEST 0x01 -#define OPL_ENABLE_WAVE_SELECT 0x20 - -#define OPL_TIMER1 0x02 -#define OPL_TIMER2 0x03 - -#define OPL_TIMER_CONTROL 0x04 /* Left */ -#define OPL_TIMER1_START 0x01 -#define OPL_TIMER2_START 0x02 -#define OPL_TIMER2_MASK 0x20 -#define OPL_TIMER1_MASK 0x40 -#define OPL_IRQ_RESET 0x80 - -#define OPL_CONNECTION_SELECT 0x04 /* Right */ -#define OPL_NOCONNECTION 0x00 -#define OPL_R_4OP_0 0x01 -#define OPL_R_4OP_1 0x02 -#define OPL_R_4OP_2 0x04 -#define OPL_L_4OP_0 0x08 -#define OPL_L_4OP_1 0x10 -#define OPL_L_4OP_2 0x20 - -#define OPL_MODE 0x05 /* Right */ -#define OPL3_ENABLE 0x01 -#define OPL4_ENABLE 0x02 - -#define OPL_KBD_SPLIT 0x08 /* Left */ -#define OPL_KEYBOARD_SPLIT 0x40 -#define OPL_COMPOSITE_SINE_WAVE_MODE 0x80 - -#define OPL_PERCUSSION 0xbd /* Left */ -#define OPL_NOPERCUSSION 0x00 -#define OPL_HIHAT 0x01 -#define OPL_CYMBAL 0x02 -#define OPL_TOMTOM 0x04 -#define OPL_SNAREDRUM 0x08 -#define OPL_BASSDRUM 0x10 -#define OPL_PERCUSSION_ENABLE 0x20 -#define OPL_VIBRATO_DEPTH 0x40 -#define OPL_TREMOLO_DEPTH 0x80 - -/* - * Offsets to the register banks for operators. - */ -/* AM/VIB/EG/KSR/Multiple (0x20 to 0x35) */ -#define OPL_AM_VIB 0x20 -#define OPL_KSR 0x10 -#define OPL_SUSTAIN 0x20 -#define OPL_VIBRATO 0x40 -#define OPL_TREMOLO 0x80 -#define OPL_MULTIPLE_MASK 0x0f - -/* KSL/Total level (0x40 to 0x55) */ -#define OPL_KSL_LEVEL 0x40 -#define OPL_KSL_MASK 0xc0 /* Envelope scaling bits */ -#define OPL_TOTAL_LEVEL_MASK 0x3f /* Strength (volume) of OP */ - -/* Attack / Decay rate (0x60 to 0x75) */ -#define OPL_ATTACK_DECAY 0x60 -#define OPL_ATTACK_MASK 0xf0 -#define DECAY_MASK 0x0f - -/* Sustain level / Release rate (0x80 to 0x95) */ -#define OPL_SUSTAIN_RELEASE 0x80 -#define OPL_SUSTAIN_MASK 0xf0 -#define OPL_RELEASE_MASK 0x0f - -/* Wave select (0xE0 to 0xF5) */ -#define OPL_WAVE_SELECT 0xe0 - -#define OPL_MAXREG 0xf5 - -/* - * Offsets to the register banks for voices. - */ -/* F-Number low bits (0xA0 to 0xA8). */ -#define OPL_FNUM_LOW 0xa0 - -/* F-number high bits / Key on / Block (octave) (0xB0 to 0xB8) */ -#define OPL_KEYON_BLOCK 0xb0 -#define OPL_KEYON_BIT 0x20 -#define OPL_BLOCKNUM_MASK 0x1c -#define OPL_FNUM_HIGH_MASK 0x03 - -/* Feedback / Connection (0xc0 to 0xc8) */ -#define OPL_FEEDBACK_CONNECTION 0xc0 -#define OPL_FEEDBACK_MASK 0x0e -#define OPL_CONNECTION_BIT 0x01 -#define OPL_STEREO_BITS 0x30 /* OPL-3 only */ -#define OPL_VOICE_TO_LEFT 0x10 -#define OPL_VOICE_TO_RIGHT 0x20 - -#define OPL2_NVOICE 9 -#define OPL3_NVOICE 18 diff --git a/sys/dev/ic/oplvar.h b/sys/dev/ic/oplvar.h deleted file mode 100644 index af99f97cc64..00000000000 --- a/sys/dev/ic/oplvar.h +++ /dev/null @@ -1,85 +0,0 @@ -/* $OpenBSD: oplvar.h,v 1.5 2008/06/26 05:42:16 ray Exp $ */ -/* $NetBSD: oplvar.h,v 1.3 1998/11/25 22:17:06 augustss Exp $ */ - -/* - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Lennart Augustsson (augustss@netbsd.org). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <dev/midivar.h> -#include <dev/midisynvar.h> - -struct opl_voice { - int voiceno; - int iooffs; - u_int8_t op[4]; - const struct opl_operators *patch; - u_int8_t rB0; -}; - -struct opl_softc { - struct midi_softc mididev; - bus_space_tag_t iot; - bus_space_handle_t ioh; - int offs; - int model; -#define OPL_2 2 -#define OPL_3 3 - struct midisyn syn; - - struct opl_voice voices[OPL3_NVOICE]; - int volume; - - int (*spkrctl)(void *, int); - void *spkrarg; -}; - -struct opl_attach_arg { - bus_space_tag_t iot; - bus_space_handle_t ioh; - int offs; - int done; -}; - -struct opl_operators { - u_int8_t opl3; - u_int8_t ops[22]; -#define OO_CHARS 0 -#define OO_KSL_LEV 2 -#define OO_ATT_DEC 4 -#define OO_SUS_REL 6 -#define OO_WAV_SEL 8 -#define OO_FB_CONN 10 -#define OO_4OP_OFFS 11 -}; - -#define OPL_NINSTR 256 -extern const struct opl_operators opl2_instrs[]; -extern const struct opl_operators opl3_instrs[]; - -int opl_find(struct opl_attach_arg *); -void opl_attach(struct opl_softc *); diff --git a/sys/dev/isa/files.isa b/sys/dev/isa/files.isa index 32337307b03..2ac2806f6c3 100644 --- a/sys/dev/isa/files.isa +++ b/sys/dev/isa/files.isa @@ -1,4 +1,4 @@ -# $OpenBSD: files.isa,v 1.106 2010/03/28 17:04:29 deraadt Exp $ +# $OpenBSD: files.isa,v 1.107 2010/07/31 08:33:20 ratchov Exp $ # $NetBSD: files.isa,v 1.21 1996/05/16 03:45:55 mycroft Exp $ # # Config file and device description for machine-independent ISA code. @@ -230,9 +230,6 @@ file dev/isa/sb.c sb needs-flag attach sb at isa with sb_isa file dev/isa/sb_isa.c sb & (sb_isa | sb_isapnp) needs-flag -attach opl at sbdsp with opl_sb -file dev/isa/opl_sb.c opl_sb - # Soundcards based on Sierra's Aria chipset. # Such as the Prometheus Aria 16 or the Diamond # sonic sound. @@ -274,9 +271,6 @@ file dev/isa/wss_isa.c wss & (wss_isa | wss_isapnp) needs-flag device ess {} : audio, isa_dma, mulaw, auconv, midibus file dev/isa/ess.c ess needs-flag -attach opl at ess with opl_ess -file dev/isa/opl_ess.c opl_ess - # Gravis UltraSound & UltraSound MAX. # Use the "flags" keyword in a config file to specify an extra DMA # channel for full-duplex operation. @@ -287,10 +281,6 @@ file dev/isa/gus.c gus needs-flag attach gus at isa with gus_isa file dev/isa/gus_isa.c gus & (gus_isa | gus_isapnp) needs-flag -# Yamaha OPL2/OPL3 FM synth -attach opl at isa with opl_isa -file dev/isa/opl_isa.c opl_isa - # Sound Forte RadioLink SF16-FMR FM Radio Card device sfr: radiobus, tc921x, pt2254a attach sfr at isa @@ -325,8 +315,6 @@ file dev/isa/pcppi.c pcppi needs-flag device spkr attach spkr at pcppi file dev/isa/spkr.c spkr needs-flag -attach midi at pcppi with midi_pcppi: midisyn -file dev/isa/midi_pcppi.c midi_pcppi # 8255A-based PC parallel ports attach lpt at isa with lpt_isa diff --git a/sys/dev/isa/midi_pcppi.c b/sys/dev/isa/midi_pcppi.c deleted file mode 100644 index f2e5573ae8b..00000000000 --- a/sys/dev/isa/midi_pcppi.c +++ /dev/null @@ -1,149 +0,0 @@ -/* $OpenBSD: midi_pcppi.c,v 1.6 2008/06/26 05:42:16 ray Exp $ */ -/* $NetBSD: midi_pcppi.c,v 1.4 1998/11/25 22:17:06 augustss Exp $ */ - -/* - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Lennart Augustsson (augustss@netbsd.org). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/errno.h> -#include <sys/device.h> -#include <sys/malloc.h> -#include <sys/proc.h> -#include <sys/conf.h> -#include <sys/selinfo.h> -#include <sys/audioio.h> -#include <sys/midiio.h> - -#include <dev/isa/pcppivar.h> - -#include <dev/audio_if.h> -#include <dev/midi_if.h> -#include <dev/midivar.h> -#include <dev/midisynvar.h> - -#define MAX_DURATION 30 /* turn off sound automagically after 30 s */ - -struct midi_pcppi_softc { - struct midi_softc sc_mididev; - midisyn sc_midisyn; -}; - -int midi_pcppi_match(struct device *, void *, void *); -void midi_pcppi_attach(struct device *, struct device *, void *); - -void midi_pcppi_on(midisyn *, u_int32_t, u_int32_t, u_int32_t); -void midi_pcppi_off(midisyn *, u_int32_t, u_int32_t, u_int32_t); -void midi_pcppi_close(midisyn *); - -struct cfattach midi_pcppi_ca = { - sizeof(struct midi_pcppi_softc), midi_pcppi_match, midi_pcppi_attach -}; - -struct midisyn_methods midi_pcppi_hw = { - 0, /* open */ - midi_pcppi_close, - 0, /* ioctl */ - 0, /* allocv */ - midi_pcppi_on, - midi_pcppi_off, - 0, - 0, - 0, - 0, - 0, - 0, -}; - -int midi_pcppi_attached = 0; /* Not very nice */ - -int -midi_pcppi_match(parent, match, aux) - struct device *parent; - void *match; - void *aux; -{ - return (!midi_pcppi_attached); -} - -void -midi_pcppi_attach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; -{ - struct midi_pcppi_softc *sc = (struct midi_pcppi_softc *)self; - struct pcppi_attach_args *pa = (struct pcppi_attach_args *)aux; - midisyn *ms; - - ms = &sc->sc_midisyn; - ms->mets = &midi_pcppi_hw; - strlcpy(ms->name, "PC speaker", sizeof ms->name); - ms->nvoice = 1; - ms->flags = MS_DOALLOC | MS_FREQXLATE; - ms->data = pa->pa_cookie; - - midi_pcppi_attached++; - - midisyn_attach(&sc->sc_mididev, ms); - midi_attach(&sc->sc_mididev, parent); -} - -void -midi_pcppi_on(ms, chan, note, vel) - midisyn *ms; - u_int32_t chan, note, vel; -{ - pcppi_tag_t t = ms->data; - - /*printf("ON %p %d\n", t, MIDISYN_FREQ_TO_HZ(note));*/ - pcppi_bell(t, MIDISYN_FREQ_TO_HZ(note), MAX_DURATION * hz, 0); -} - -void -midi_pcppi_off(ms, chan, note, vel) - midisyn *ms; - u_int32_t chan, note, vel; -{ - pcppi_tag_t t = ms->data; - - /*printf("OFF %p %d\n", t, note >> 16);*/ - pcppi_bell(t, 0, 0, 0); -} - -void -midi_pcppi_close(ms) - midisyn *ms; -{ - pcppi_tag_t t = ms->data; - - /* Make sure we are quiet. */ - pcppi_bell(t, 0, 0, 0); -} diff --git a/sys/dev/isa/opl_ess.c b/sys/dev/isa/opl_ess.c deleted file mode 100644 index ecb20988828..00000000000 --- a/sys/dev/isa/opl_ess.c +++ /dev/null @@ -1,98 +0,0 @@ -/* $OpenBSD: opl_ess.c,v 1.6 2008/06/26 05:42:16 ray Exp $ */ -/* $NetBSD: opl_ess.c,v 1.3 1998/12/08 14:26:57 augustss Exp $ */ - -/* - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * Author: Lennart Augustsson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/errno.h> -#include <sys/device.h> -#include <sys/malloc.h> -#include <sys/proc.h> -#include <sys/conf.h> -#include <sys/selinfo.h> -#include <sys/audioio.h> -#include <sys/midiio.h> - -#include <machine/bus.h> - -#include <dev/audio_if.h> -#include <dev/midi_if.h> -#include <dev/ic/oplreg.h> -#include <dev/ic/oplvar.h> - -#include <dev/isa/isavar.h> -#include <dev/isa/essvar.h> - -extern int ess_speaker_ctl(void *, int); - -int opl_ess_match(struct device *, void *, void *); -void opl_ess_attach(struct device *, struct device *, void *); - -struct cfattach opl_ess_ca = { - sizeof (struct opl_softc), opl_ess_match, opl_ess_attach -}; - -int -opl_ess_match(parent, match, aux) - struct device *parent; - void *match; - void *aux; -{ - struct audio_attach_args *aa = (struct audio_attach_args *)aux; - struct ess_softc *ssc = (struct ess_softc *)parent; - struct opl_attach_arg oaa; - - if (aa->type != AUDIODEV_TYPE_OPL) - return (0); - memset(&oaa, 0, sizeof oaa); - oaa.ioh = ssc->sc_ioh; - oaa.iot = ssc->sc_iot; - return (opl_find(&oaa)); -} - -void -opl_ess_attach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; -{ - struct ess_softc *ssc = (struct ess_softc *)parent; - struct opl_softc *sc = (struct opl_softc *)self; - - sc->ioh = ssc->sc_ioh; - sc->iot = ssc->sc_iot; - sc->offs = 0; - sc->spkrctl = ess_speaker_ctl; - sc->spkrarg = ssc; - strlcpy(sc->syn.name, "ESS ", sizeof sc->syn.name); - - opl_attach(sc); -} diff --git a/sys/dev/isa/opl_isa.c b/sys/dev/isa/opl_isa.c deleted file mode 100644 index d40ed5449cc..00000000000 --- a/sys/dev/isa/opl_isa.c +++ /dev/null @@ -1,98 +0,0 @@ -/* $OpenBSD: opl_isa.c,v 1.5 2008/06/26 05:42:16 ray Exp $ */ -/* $NetBSD: opl_isa.c,v 1.1 1998/08/26 13:33:59 augustss Exp $ */ - -/* - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * Author: Lennart Augustsson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/errno.h> -#include <sys/device.h> -#include <sys/malloc.h> -#include <sys/proc.h> -#include <sys/conf.h> -#include <sys/selinfo.h> -#include <sys/audioio.h> -#include <sys/midiio.h> - -#include <machine/bus.h> - -#include <dev/audio_if.h> -#include <dev/midi_if.h> - -#include <dev/ic/oplreg.h> -#include <dev/ic/oplvar.h> - -#include <dev/isa/isavar.h> - -#define OPL_SIZE 4 - -int opl_isa_match(struct device *, void *, void *); -void opl_isa_attach(struct device *, struct device *, void *); - -struct cfattach opl_isa_ca = { - sizeof (struct opl_softc), opl_isa_match, opl_isa_attach -}; - -int -opl_isa_match(parent, match, aux) - struct device *parent; - void *match; - void *aux; -{ - struct isa_attach_args *ia = aux; - struct opl_softc sc; - int r; - - memset(&sc, 0, sizeof sc); - sc.iot = ia->ia_iot; - if (bus_space_map(sc.iot, ia->ia_iobase, OPL_SIZE, 0, &sc.ioh)) - return (0); - r = opl_find(&sc); - bus_space_unmap(sc.iot, sc.ioh, OPL_SIZE); - return (r); -} - -void -opl_isa_attach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; -{ - struct opl_softc *sc = (struct opl_softc *)self; - struct isa_attach_args *ia = aux; - - if (bus_space_map(sc->iot, ia->ia_iobase, OPL_SIZE, 0, &sc->ioh)) { - printf("opl_isa_attach: bus_space_map failed\n"); - return; - } - sc->offs = 0; - - opl_attach(sc); -} diff --git a/sys/dev/isa/opl_sb.c b/sys/dev/isa/opl_sb.c deleted file mode 100644 index 0872caebe5b..00000000000 --- a/sys/dev/isa/opl_sb.c +++ /dev/null @@ -1,97 +0,0 @@ -/* $OpenBSD: opl_sb.c,v 1.7 2008/06/26 05:42:16 ray Exp $ */ -/* $NetBSD: opl_sb.c,v 1.4 1998/12/08 14:26:57 augustss Exp $ */ - -/* - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Lennart Augustsson (augustss@netbsd.org). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/errno.h> -#include <sys/device.h> -#include <sys/malloc.h> -#include <sys/proc.h> -#include <sys/conf.h> -#include <sys/selinfo.h> -#include <sys/audioio.h> -#include <sys/midiio.h> - -#include <machine/bus.h> - -#include <dev/audio_if.h> -#include <dev/midi_if.h> -#include <dev/ic/oplreg.h> -#include <dev/ic/oplvar.h> - -#include <dev/isa/isavar.h> -#include <dev/isa/sbdspvar.h> - -int opl_sb_match(struct device *, void *, void *); -void opl_sb_attach(struct device *, struct device *, void *); - -struct cfattach opl_sb_ca = { - sizeof (struct opl_softc), opl_sb_match, opl_sb_attach -}; - -int -opl_sb_match(parent, match, aux) - struct device *parent; - void *match; - void *aux; -{ - struct audio_attach_args *aa = (struct audio_attach_args *)aux; - struct sbdsp_softc *ssc = (struct sbdsp_softc *)parent; - struct opl_attach_arg oaa; - - if (aa->type != AUDIODEV_TYPE_OPL) - return (0); - memset(&oaa, 0, sizeof oaa); - oaa.ioh = ssc->sc_ioh; - oaa.iot = ssc->sc_iot; - return (opl_find(&oaa)); -} - -void -opl_sb_attach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; -{ - struct sbdsp_softc *ssc = (struct sbdsp_softc *)parent; - struct opl_softc *sc = (struct opl_softc *)self; - - sc->ioh = ssc->sc_ioh; - sc->iot = ssc->sc_iot; - sc->offs = 0; - sc->spkrctl = sbdsp_speaker_ctl; - sc->spkrarg = ssc; - strlcpy(sc->syn.name, "SB ", sizeof sc->syn.name); - - opl_attach(sc); -} diff --git a/sys/dev/midisyn.c b/sys/dev/midisyn.c deleted file mode 100644 index 991d3124a1b..00000000000 --- a/sys/dev/midisyn.c +++ /dev/null @@ -1,421 +0,0 @@ -/* $OpenBSD: midisyn.c,v 1.9 2008/06/26 05:42:14 ray Exp $ */ -/* $NetBSD: midisyn.c,v 1.5 1998/11/25 22:17:07 augustss Exp $ */ - -/* - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Lennart Augustsson (augustss@netbsd.org). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/param.h> -#include <sys/ioctl.h> -#include <sys/fcntl.h> -#include <sys/vnode.h> -#include <sys/selinfo.h> -#include <sys/proc.h> -#include <sys/malloc.h> -#include <sys/systm.h> -#include <sys/syslog.h> -#include <sys/kernel.h> -#include <sys/conf.h> -#include <sys/audioio.h> -#include <sys/midiio.h> -#include <sys/device.h> - -#include <dev/audio_if.h> -#include <dev/midi_if.h> -#include <dev/midivar.h> -#include <dev/midisynvar.h> - -#ifdef AUDIO_DEBUG -#define DPRINTF(x) if (midisyndebug) printf x -#define DPRINTFN(n,x) if (midisyndebug >= (n)) printf x -int midisyndebug = 0; -#else -#define DPRINTF(x) -#define DPRINTFN(n,x) -#endif - -int midisyn_findvoice(midisyn *, int, int); -void midisyn_freevoice(midisyn *, int); -int midisyn_allocvoice(midisyn *, u_int32_t, u_int32_t); -u_int32_t midisyn_note_to_freq(int); -u_int32_t midisyn_finetune(u_int32_t, int, int, int); - -int midisyn_open(void *, int, - void (*iintr)(void *, int), - void (*ointr)(void *), void *arg); -void midisyn_close(void *); -int midisyn_output(void *, int); -void midisyn_getinfo(void *, struct midi_info *); -int midisyn_ioctl(void *, u_long, caddr_t, int, struct proc *); - -struct midi_hw_if midisyn_hw_if = { - midisyn_open, - midisyn_close, - midisyn_output, - NULL, /* flush */ - midisyn_getinfo, - midisyn_ioctl, -}; - -static int midi_lengths[] = { 3,3,3,3,2,2,3,1 }; -/* Number of bytes in a MIDI command, including status */ -#define MIDI_LENGTH(d) (midi_lengths[((d) >> 4) & 7]) - -int -midisyn_open(addr, flags, iintr, ointr, arg) - void *addr; - int flags; - void (*iintr)(void *, int); - void (*ointr)(void *); - void *arg; -{ - midisyn *ms = addr; - - DPRINTF(("midisyn_open: ms=%p ms->mets=%p\n", ms, ms->mets)); - if (ms->mets->open) - return (ms->mets->open(ms, flags)); - else - return (0); -} - -void -midisyn_close(addr) - void *addr; -{ - midisyn *ms = addr; - struct midisyn_methods *fs; - int v; - - DPRINTF(("midisyn_close: ms=%p ms->mets=%p\n", ms, ms->mets)); - fs = ms->mets; - for (v = 0; v < ms->nvoice; v++) - if (ms->voices[v].inuse) { - fs->noteoff(ms, v, 0, 0); - midisyn_freevoice(ms, v); - } - if (fs->close) - fs->close(ms); -} - -void -midisyn_getinfo(addr, mi) - void *addr; - struct midi_info *mi; -{ - midisyn *ms = addr; - - mi->name = ms->name; - mi->props = 0; -} - -int -midisyn_ioctl(maddr, cmd, addr, flag, p) - void *maddr; - u_long cmd; - caddr_t addr; - int flag; - struct proc *p; -{ - midisyn *ms = maddr; - - if (ms->mets->ioctl) - return (ms->mets->ioctl(ms, cmd, addr, flag, p)); - else - return (EINVAL); -} - -int -midisyn_findvoice(ms, chan, note) - midisyn *ms; - int chan, note; -{ - u_int cn; - int v; - - if (!(ms->flags & MS_DOALLOC)) - return (chan); - cn = MS_CHANNOTE(chan, note); - for (v = 0; v < ms->nvoice; v++) - if (ms->voices[v].chan_note == cn && ms->voices[v].inuse) - return (v); - return (-1); -} - -void -midisyn_attach(sc, ms) - struct midi_softc *sc; - midisyn *ms; -{ - if (ms->flags & MS_DOALLOC) { - ms->voices = malloc(ms->nvoice * sizeof (struct voice), - M_DEVBUF, M_WAITOK | M_ZERO); - ms->seqno = 1; - if (ms->mets->allocv == 0) - ms->mets->allocv = &midisyn_allocvoice; - } - sc->hw_if = &midisyn_hw_if; - sc->hw_hdl = ms; - DPRINTF(("midisyn_attach: ms=%p\n", sc->hw_hdl)); -} - -void -midisyn_freevoice(ms, voice) - midisyn *ms; - int voice; -{ - if (!(ms->flags & MS_DOALLOC)) - return; - ms->voices[voice].inuse = 0; -} - -int -midisyn_allocvoice(ms, chan, note) - midisyn *ms; - u_int32_t chan, note; -{ - int bestv, v; - u_int bestseq, s; - - if (!(ms->flags & MS_DOALLOC)) - return (chan); - /* Find a free voice, or if no free voice is found the oldest. */ - bestv = 0; - bestseq = ms->voices[0].seqno + (ms->voices[0].inuse ? 0x40000000 : 0); - for (v = 1; v < ms->nvoice; v++) { - s = ms->voices[v].seqno; - if (ms->voices[v].inuse) - s += 0x40000000; - if (s < bestseq) { - bestseq = s; - bestv = v; - } - } - DPRINTFN(10,("midisyn_allocvoice: v=%d seq=%d cn=%x inuse=%d\n", - bestv, ms->voices[bestv].seqno, - ms->voices[bestv].chan_note, - ms->voices[bestv].inuse)); -#ifdef AUDIO_DEBUG - if (ms->voices[bestv].inuse) - DPRINTFN(1,("midisyn_allocvoice: steal %x\n", - ms->voices[bestv].chan_note)); -#endif - ms->voices[bestv].chan_note = MS_CHANNOTE(chan, note); - ms->voices[bestv].seqno = ms->seqno++; - ms->voices[bestv].inuse = 1; - return (bestv); -} - -int -midisyn_output(addr, b) - void *addr; - int b; -{ - midisyn *ms = addr; - u_int8_t status, chan; - int voice = 0; /* initialize to keep gcc quiet */ - struct midisyn_methods *fs; - u_int32_t note, vel; - - DPRINTF(("midisyn_output: ms=%p b=0x%02x\n", ms, b)); - fs = ms->mets; - if (ms->pos < 0) { - /* Doing SYSEX */ - DPRINTF(("midisyn_output: sysex 0x%02x\n", b)); - if (fs->sysex) - fs->sysex(ms, b); - if (b == MIDI_SYSEX_END) - ms->pos = 0; - return (0); - } - if (ms->pos == 0 && !MIDI_IS_STATUS(b)) - ms->pos++; /* repeat last status byte */ - ms->buf[ms->pos++] = b; - status = ms->buf[0]; - if (ms->pos < MIDI_LENGTH(status)) - return (0); - /* Decode the MIDI command */ - chan = MIDI_GET_CHAN(status); - note = ms->buf[1]; - if (ms->flags & MS_FREQXLATE) - note = midisyn_note_to_freq(note); - vel = ms->buf[2]; - switch (MIDI_GET_STATUS(status)) { - case MIDI_NOTEOFF: - voice = midisyn_findvoice(ms, chan, ms->buf[1]); - if (voice >= 0) { - fs->noteoff(ms, voice, note, vel); - midisyn_freevoice(ms, voice); - } - break; - case MIDI_NOTEON: - voice = fs->allocv(ms, chan, ms->buf[1]); - fs->noteon(ms, voice, note, vel); - break; - case MIDI_KEY_PRESSURE: - if (fs->keypres) { - voice = midisyn_findvoice(ms, voice, ms->buf[1]); - if (voice >= 0) - fs->keypres(ms, voice, note, vel); - } - break; - case MIDI_CTL_CHANGE: - if (fs->ctlchg) - fs->ctlchg(ms, chan, ms->buf[1], vel); - break; - case MIDI_PGM_CHANGE: - if (fs->pgmchg) - fs->pgmchg(ms, chan, ms->buf[1]); - break; - case MIDI_CHN_PRESSURE: - if (fs->chnpres) { - voice = midisyn_findvoice(ms, chan, ms->buf[1]); - if (voice >= 0) - fs->chnpres(ms, voice, note); - } - break; - case MIDI_PITCH_BEND: - if (fs->pitchb) { - voice = midisyn_findvoice(ms, chan, ms->buf[1]); - if (voice >= 0) - fs->pitchb(ms, chan, note, vel); - } - break; - case MIDI_SYSTEM_PREFIX: - if (fs->sysex) - fs->sysex(ms, status); - ms->pos = -1; - return (0); - } - ms->pos = 0; - return (0); -} - -/* - * Convert a MIDI note to the corresponding frequency. - * The frequency is scaled by 2^16. - */ -u_int32_t -midisyn_note_to_freq(note) - int note; -{ - int o, n, f; -#define BASE_OCTAVE 5 - static u_int32_t notes[] = { - 17145893, 18165441, 19245614, 20390018, 21602472, 22887021, - 24247954, 25689813, 27217409, 28835840, 30550508, 32367136 - }; - - - o = note / 12; - n = note % 12; - - f = notes[n]; - - if (o < BASE_OCTAVE) - f >>= (BASE_OCTAVE - o); - else if (o > BASE_OCTAVE) - f <<= (o - BASE_OCTAVE); - return (f); -} - -u_int32_t -midisyn_finetune(base_freq, bend, range, vibrato_cents) - u_int32_t base_freq; - int bend; - int range; - int vibrato_cents; -{ - static u_int16_t semitone_tuning[24] = - { -/* 0 */ 10000, 10595, 11225, 11892, 12599, 13348, 14142, 14983, -/* 8 */ 15874, 16818, 17818, 18877, 20000, 21189, 22449, 23784, -/* 16 */ 25198, 26697, 28284, 29966, 31748, 33636, 35636, 37755 - }; - static u_int16_t cent_tuning[100] = - { -/* 0 */ 10000, 10006, 10012, 10017, 10023, 10029, 10035, 10041, -/* 8 */ 10046, 10052, 10058, 10064, 10070, 10075, 10081, 10087, -/* 16 */ 10093, 10099, 10105, 10110, 10116, 10122, 10128, 10134, -/* 24 */ 10140, 10145, 10151, 10157, 10163, 10169, 10175, 10181, -/* 32 */ 10187, 10192, 10198, 10204, 10210, 10216, 10222, 10228, -/* 40 */ 10234, 10240, 10246, 10251, 10257, 10263, 10269, 10275, -/* 48 */ 10281, 10287, 10293, 10299, 10305, 10311, 10317, 10323, -/* 56 */ 10329, 10335, 10341, 10347, 10353, 10359, 10365, 10371, -/* 64 */ 10377, 10383, 10389, 10395, 10401, 10407, 10413, 10419, -/* 72 */ 10425, 10431, 10437, 10443, 10449, 10455, 10461, 10467, -/* 80 */ 10473, 10479, 10485, 10491, 10497, 10503, 10509, 10515, -/* 88 */ 10521, 10528, 10534, 10540, 10546, 10552, 10558, 10564, -/* 96 */ 10570, 10576, 10582, 10589 - }; - u_int32_t amount; - int negative, semitones, cents, multiplier; - - if (range == 0) - return base_freq; - - if (base_freq == 0) - return base_freq; - - if (range >= 8192) - range = 8192; - - bend = bend * range / 8192; - bend += vibrato_cents; - - if (bend == 0) - return base_freq; - - if (bend < 0) { - bend = -bend; - negative = 1; - } else - negative = 0; - - if (bend > range) - bend = range; - - multiplier = 1; - while (bend > 2399) { - multiplier *= 4; - bend -= 2400; - } - - semitones = bend / 100; - if (semitones > 23) - semitones = 23; - cents = bend % 100; - - amount = semitone_tuning[semitones] * multiplier * cent_tuning[cents] - / 10000; - - if (negative) - return (base_freq * 10000 / amount); /* Bend down */ - else - return (base_freq * amount / 10000); /* Bend up */ -} - diff --git a/sys/dev/midisynvar.h b/sys/dev/midisynvar.h deleted file mode 100644 index 41099a112a6..00000000000 --- a/sys/dev/midisynvar.h +++ /dev/null @@ -1,91 +0,0 @@ -/* $OpenBSD: midisynvar.h,v 1.3 2008/06/26 05:42:14 ray Exp $ */ -/* $NetBSD: midisynvar.h,v 1.3 1998/11/25 22:17:07 augustss Exp $ */ - -/* - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Lennart Augustsson (augustss@netbsd.org). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _SYS_DEV_MIDISYNVAR_H_ -#define _SYS_DEV_MIDISYNVAR_H_ - -typedef struct midisyn midisyn; - -struct midisyn_methods { - int (*open)(midisyn *, int); - void (*close)(midisyn *); - int (*ioctl)(midisyn *, u_long, caddr_t, int, struct proc *); - int (*allocv)(midisyn *, u_int32_t, u_int32_t); - void (*noteon)(midisyn *, u_int32_t, u_int32_t, u_int32_t); - void (*noteoff)(midisyn *, u_int32_t, u_int32_t, u_int32_t); - void (*keypres)(midisyn *, u_int32_t, u_int32_t, u_int32_t); - void (*ctlchg)(midisyn *, u_int32_t, u_int32_t, u_int32_t); - void (*pgmchg)(midisyn *, u_int32_t, u_int32_t); - void (*chnpres)(midisyn *, u_int32_t, u_int32_t); - void (*pitchb)(midisyn *, u_int32_t, u_int32_t, u_int32_t); - void (*sysex)(midisyn *, u_int32_t); -}; - -struct voice { - u_int chan_note; /* channel and note */ -#define MS_CHANNOTE(chan, note) ((chan) * 256 + (note)) -#define MS_GETCHAN(v) ((v)->chan_note >> 8) - u_int seqno; /* allocation index (increases with time) */ - u_char inuse; -}; - -#define MIDI_MAX_CHANS 16 - -struct midisyn { - /* Filled by synth driver */ - struct midisyn_methods *mets; - char name[32]; - int nvoice; - int flags; -#define MS_DOALLOC 1 -#define MS_FREQXLATE 2 - void *data; - - /* Used by midisyn driver */ - u_int8_t buf[3]; - int pos; - struct voice *voices; - u_int seqno; - u_int16_t pgms[MIDI_MAX_CHANS]; -}; - -#define MS_GETPGM(ms, vno) ((ms)->pgms[MS_GETCHAN(&(ms)->voices[vno])]) - -struct midi_softc; - -extern struct midi_hw_if midisyn_hw_if; - -void midisyn_attach(struct midi_softc *, midisyn *); - -#define MIDISYN_FREQ_TO_HZ(f) ((f) >> 16) - -#endif /* _SYS_DEV_MIDISYNVAR_H_ */ diff --git a/sys/dev/pci/files.pci b/sys/dev/pci/files.pci index a713c49394d..702f7950f8e 100644 --- a/sys/dev/pci/files.pci +++ b/sys/dev/pci/files.pci @@ -1,4 +1,4 @@ -# $OpenBSD: files.pci,v 1.273 2010/07/03 01:02:25 mlarkin Exp $ +# $OpenBSD: files.pci,v 1.274 2010/07/31 08:33:20 ratchov Exp $ # $NetBSD: files.pci,v 1.20 1996/09/24 17:47:15 christos Exp $ # # Config file and device description for machine-independent PCI code. @@ -116,9 +116,6 @@ device eso {}: audio, auconv, mulaw, midibus attach eso at pci file dev/pci/eso.c eso -attach opl at eso with opl_eso -file dev/pci/opl_eso.c opl_eso - # Acer Labs M5455 device auacer: audio, auconv, mulaw, ac97 attach auacer at pci @@ -180,9 +177,6 @@ device yds {}: audio, auconv, mulaw, ac97, firmload attach yds at pci file dev/pci/yds.c yds -attach opl at yds with opl_yds -file dev/pci/opl_yds.c opl_yds - # Forte Media FM801 device fms: audio, auconv, mulaw, ac97, midibus, tea5757, radiobus attach fms at pci @@ -571,9 +565,6 @@ device cmpci {}: audio, auconv, mulaw attach cmpci at pci file dev/pci/cmpci.c cmpci -attach opl at cmpci with opl_cmpci -file dev/pci/opl_cmpci.c opl_cmpci - # Initio ULTRA WIDE/ULTRA2 WIDE SCSI Controllers attach iha at pci with iha_pci file dev/pci/iha_pci.c iha_pci diff --git a/sys/dev/pci/opl_cmpci.c b/sys/dev/pci/opl_cmpci.c deleted file mode 100644 index f089786b400..00000000000 --- a/sys/dev/pci/opl_cmpci.c +++ /dev/null @@ -1,95 +0,0 @@ -/* $OpenBSD: opl_cmpci.c,v 1.5 2010/04/08 00:23:53 tedu Exp $ */ - -/* - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Lennart Augustsson (augustss@netbsd.org). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/errno.h> -#include <sys/device.h> -#include <sys/malloc.h> -#include <sys/conf.h> -#include <sys/selinfo.h> -#include <sys/audioio.h> -#include <sys/midiio.h> - -#include <machine/bus.h> - -#include <dev/audio_if.h> -#include <dev/midi_if.h> -#include <dev/ic/oplreg.h> -#include <dev/ic/oplvar.h> - -#include <dev/pci/pcireg.h> -#include <dev/pci/pcivar.h> - -#include <dev/pci/cmpcireg.h> -#include <dev/pci/cmpcivar.h> - -int opl_cmpci_match(struct device *, void *, void *); -void opl_cmpci_attach(struct device *, struct device *, void *); - -struct cfdriver opl_cmpci_cd = { - NULL, "opl_cmpci", DV_DULL -}; - -struct cfattach opl_cmpci_ca = { - sizeof (struct opl_softc), opl_cmpci_match, opl_cmpci_attach -}; - -int -opl_cmpci_match(struct device *parent, void *match, void *aux) -{ - struct audio_attach_args *aa = (struct audio_attach_args *)aux; - struct cmpci_softc *ssc = (struct cmpci_softc *)parent; - struct opl_attach_arg oaa; - - if (aa->type != AUDIODEV_TYPE_OPL) - return (0); - memset(&oaa, 0, sizeof oaa); - oaa.iot = ssc->sc_iot; - oaa.ioh = ssc->sc_ioh; - oaa.offs = CMPCI_REG_FM_BASE; - return (opl_find(&oaa)); -} - -void -opl_cmpci_attach(struct device *parent, struct device *self, void *aux) -{ - struct cmpci_softc *ssc = (struct cmpci_softc *)parent; - struct opl_softc *sc = (struct opl_softc *)self; - - sc->ioh = ssc->sc_ioh; - sc->iot = ssc->sc_iot; - sc->offs = CMPCI_REG_FM_BASE; - strlcpy(sc->syn.name, "CMPCI ", sizeof sc->syn.name); - - opl_attach(sc); -} diff --git a/sys/dev/pci/opl_eso.c b/sys/dev/pci/opl_eso.c deleted file mode 100644 index 10f88ab88ed..00000000000 --- a/sys/dev/pci/opl_eso.c +++ /dev/null @@ -1,102 +0,0 @@ -/* $OpenBSD: opl_eso.c,v 1.7 2010/04/08 00:23:53 tedu Exp $ */ -/* $NetBSD: opl_eso.c,v 1.1 1999/07/12 15:13:31 kleink Exp $ */ - -/* - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Lennart Augustsson (augustss@netbsd.org). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef __OpenBSD__ -#define HIDE -#define MATCH_ARG_2_T void * -#else -#define HIDE static -#define MATCH_ARG_2_T struct cfdata * -#endif - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/errno.h> -#include <sys/device.h> -#include <sys/malloc.h> -#include <sys/conf.h> -#include <sys/selinfo.h> -#include <sys/audioio.h> -#include <sys/midiio.h> - -#include <machine/bus.h> - -#include <dev/audio_if.h> -#include <dev/midi_if.h> -#include <dev/ic/oplreg.h> -#include <dev/ic/oplvar.h> - -#include <dev/pci/pcireg.h> -#include <dev/pci/pcivar.h> - -#include <dev/ic/mpuvar.h> -#include <dev/pci/esovar.h> - -HIDE int opl_eso_match(struct device *, MATCH_ARG_2_T, void *); -HIDE void opl_eso_attach(struct device *, struct device *, void *); - -struct cfattach opl_eso_ca = { - sizeof (struct opl_softc), opl_eso_match, opl_eso_attach -}; - -HIDE int -opl_eso_match(parent, match, aux) - struct device *parent; - MATCH_ARG_2_T match; - void *aux; -{ - struct audio_attach_args *aa = (struct audio_attach_args *)aux; - - if (aa->type != AUDIODEV_TYPE_OPL) - return (0); - return (1); -} - -HIDE void -opl_eso_attach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; -{ - struct eso_softc *esc = (struct eso_softc *)parent; - struct opl_softc *sc = (struct opl_softc *)self; - - sc->ioh = esc->sc_sb_ioh; - sc->iot = esc->sc_sb_iot; - sc->offs = 0; - strlcpy(sc->syn.name, "ESO ", sizeof sc->syn.name); - /*sc->spkrctl = 0; - sc->spkrarg = 0;*/ - - opl_attach(sc); -} diff --git a/sys/dev/pci/opl_yds.c b/sys/dev/pci/opl_yds.c deleted file mode 100644 index 926533456d1..00000000000 --- a/sys/dev/pci/opl_yds.c +++ /dev/null @@ -1,102 +0,0 @@ -/* $OpenBSD: opl_yds.c,v 1.8 2010/04/08 00:23:53 tedu Exp $ */ -/* $NetBSD$ */ - -/* - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Lennart Augustsson (augustss@netbsd.org). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/errno.h> -#include <sys/device.h> -#include <sys/malloc.h> -#include <sys/conf.h> -#include <sys/selinfo.h> -#include <sys/audioio.h> -#include <sys/midiio.h> - -#include <machine/bus.h> - -#include <dev/audio_if.h> -#include <dev/midi_if.h> -#include <dev/ic/oplreg.h> -#include <dev/ic/oplvar.h> -#include <dev/ic/ac97.h> - -#include <dev/pci/pcireg.h> -#include <dev/pci/pcivar.h> - -#include <dev/pci/ydsreg.h> -#include <dev/pci/ydsvar.h> - -int opl_yds_match(struct device *, void *, void *); -void opl_yds_attach(struct device *, struct device *, void *); - -struct cfdriver opl_yds_cd = { - NULL, "opl_yds", DV_DULL -}; - -struct cfattach opl_yds_ca = { - sizeof (struct opl_softc), opl_yds_match, opl_yds_attach -}; - -int -opl_yds_match(parent, match, aux) - struct device *parent; - void *match; - void *aux; -{ - struct audio_attach_args *aa = (struct audio_attach_args *)aux; - struct yds_softc *ssc = (struct yds_softc *)parent; - struct opl_attach_arg oaa; - - if (aa->type != AUDIODEV_TYPE_OPL) - return (0); - memset(&oaa, 0, sizeof oaa); - oaa.iot = ssc->sc_opl_iot; - oaa.ioh = ssc->sc_opl_ioh; - return (opl_find(&oaa)); -} - -void -opl_yds_attach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; -{ - struct yds_softc *ssc = (struct yds_softc *)parent; - struct opl_softc *sc = (struct opl_softc *)self; - - sc->ioh = ssc->sc_opl_ioh; - sc->iot = ssc->sc_opl_iot; - sc->offs = 0; - strlcpy(sc->syn.name, "DS-1 integrated ", sizeof sc->syn.name); - - opl_attach(sc); -} |