From 1dc0115467cfaa3d3094deb4d577c2fc0cac63ef Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Mon, 28 Mar 2005 14:42:45 +0000 Subject: [PATCH] Remove the pre-NEWPCM sound drivers and the speaker-based emulations. In detail the devices css, gus, gusxvi, mpu, mss, opl, pas, sb, snd, speaker, sscape, sscape_mss, trix and uart are no longer supported. They are ISA-only devices and the more common devices are supported by NEWPCM too. speaker and pca collide with the timer use of the default kernel and have been broken for a while now. --- sys/bus/isa/i386/isa_compat.h | 66 +- sys/conf/files.amd64 | 67 +- sys/conf/files.i386 | 67 +- sys/conf/options.amd64 | 7 +- sys/conf/options.i386 | 7 +- sys/config/LINT | 54 +- sys/dev/sound/isa/i386/ad1848.c | 1868 -------- sys/dev/sound/isa/i386/ad1848_mixer.h | 142 - sys/dev/sound/isa/i386/adlib_card.c | 47 - sys/dev/sound/isa/i386/css/cs4232.c | 203 - sys/dev/sound/isa/i386/dev_table.c | 260 -- sys/dev/sound/isa/i386/dev_table.h | 601 --- sys/dev/sound/isa/i386/dmabuf.c | 1607 ------- sys/dev/sound/isa/i386/gus/gus_card.c | 189 - sys/dev/sound/isa/i386/gus/gus_hw.h | 50 - sys/dev/sound/isa/i386/gus/gus_linearvol.h | 18 - sys/dev/sound/isa/i386/gus/gus_midi.c | 275 -- sys/dev/sound/isa/i386/gus/gus_vol.c | 140 - sys/dev/sound/isa/i386/gus/gus_wave.c | 4588 -------------------- sys/dev/sound/isa/i386/midi_ctrl.h | 22 - sys/dev/sound/isa/i386/midi_synth.c | 676 --- sys/dev/sound/isa/i386/midi_synth.h | 49 - sys/dev/sound/isa/i386/midibuf.c | 432 -- sys/dev/sound/isa/i386/mpu/mpu401.c | 1644 ------- sys/dev/sound/isa/i386/opl3.c | 1138 ----- sys/dev/sound/isa/i386/opl3.h | 261 -- sys/dev/sound/isa/i386/pas2/pas2_card.c | 361 -- sys/dev/sound/isa/i386/pas2/pas2_midi.c | 285 -- sys/dev/sound/isa/i386/pas2/pas2_mixer.c | 326 -- sys/dev/sound/isa/i386/pas2/pas2_pcm.c | 449 -- sys/dev/sound/isa/i386/patmgr.c | 268 -- sys/dev/sound/isa/i386/pca/pcaudio.c | 607 --- sys/dev/sound/isa/i386/sb/sb_card.c | 67 - sys/dev/sound/isa/i386/sb/sb_defs.h | 43 - sys/dev/sound/isa/i386/sb/sb_dsp.c | 1156 ----- sys/dev/sound/isa/i386/sb/sb_midi.c | 211 - sys/dev/sound/isa/i386/sb/sb_mixer.c | 530 --- sys/dev/sound/isa/i386/sb/sb_mixer.h | 255 -- sys/dev/sound/isa/i386/sbmidi/sb16_midi.c | 312 -- sys/dev/sound/isa/i386/sbxvi/sb16_dsp.c | 562 --- sys/dev/sound/isa/i386/sequencer.c | 1824 -------- sys/dev/sound/isa/i386/sound.doc | 121 - sys/dev/sound/isa/i386/sound_calls.h | 291 -- sys/dev/sound/isa/i386/sound_config.h | 212 - sys/dev/sound/isa/i386/sound_pnp.c | 187 - sys/dev/sound/isa/i386/sound_switch.c | 500 --- sys/dev/sound/isa/i386/sound_timer.c | 345 -- sys/dev/sound/isa/i386/soundcard.c | 680 --- sys/dev/sound/isa/i386/soundvers.h | 2 - sys/dev/sound/isa/i386/spkr/spkr.c | 581 --- sys/dev/sound/isa/i386/sscape/sscape.c | 922 ---- sys/dev/sound/isa/i386/sys_timer.c | 277 -- sys/dev/sound/isa/i386/trix/trix.c | 369 -- sys/dev/sound/isa/i386/trix/trix_boot.h | 2488 ----------- sys/dev/sound/isa/i386/uart/uart6850.c | 300 -- sys/i386/conf/LINT | 54 +- 56 files changed, 7 insertions(+), 29056 deletions(-) delete mode 100644 sys/dev/sound/isa/i386/ad1848.c delete mode 100644 sys/dev/sound/isa/i386/ad1848_mixer.h delete mode 100644 sys/dev/sound/isa/i386/adlib_card.c delete mode 100644 sys/dev/sound/isa/i386/css/cs4232.c delete mode 100644 sys/dev/sound/isa/i386/dev_table.c delete mode 100644 sys/dev/sound/isa/i386/dev_table.h delete mode 100644 sys/dev/sound/isa/i386/dmabuf.c delete mode 100644 sys/dev/sound/isa/i386/gus/gus_card.c delete mode 100644 sys/dev/sound/isa/i386/gus/gus_hw.h delete mode 100644 sys/dev/sound/isa/i386/gus/gus_linearvol.h delete mode 100644 sys/dev/sound/isa/i386/gus/gus_midi.c delete mode 100644 sys/dev/sound/isa/i386/gus/gus_vol.c delete mode 100644 sys/dev/sound/isa/i386/gus/gus_wave.c delete mode 100644 sys/dev/sound/isa/i386/midi_ctrl.h delete mode 100644 sys/dev/sound/isa/i386/midi_synth.c delete mode 100644 sys/dev/sound/isa/i386/midi_synth.h delete mode 100644 sys/dev/sound/isa/i386/midibuf.c delete mode 100644 sys/dev/sound/isa/i386/mpu/mpu401.c delete mode 100644 sys/dev/sound/isa/i386/opl3.c delete mode 100644 sys/dev/sound/isa/i386/opl3.h delete mode 100644 sys/dev/sound/isa/i386/pas2/pas2_card.c delete mode 100644 sys/dev/sound/isa/i386/pas2/pas2_midi.c delete mode 100644 sys/dev/sound/isa/i386/pas2/pas2_mixer.c delete mode 100644 sys/dev/sound/isa/i386/pas2/pas2_pcm.c delete mode 100644 sys/dev/sound/isa/i386/patmgr.c delete mode 100644 sys/dev/sound/isa/i386/pca/pcaudio.c delete mode 100644 sys/dev/sound/isa/i386/sb/sb_card.c delete mode 100644 sys/dev/sound/isa/i386/sb/sb_defs.h delete mode 100644 sys/dev/sound/isa/i386/sb/sb_dsp.c delete mode 100644 sys/dev/sound/isa/i386/sb/sb_midi.c delete mode 100644 sys/dev/sound/isa/i386/sb/sb_mixer.c delete mode 100644 sys/dev/sound/isa/i386/sb/sb_mixer.h delete mode 100644 sys/dev/sound/isa/i386/sbmidi/sb16_midi.c delete mode 100644 sys/dev/sound/isa/i386/sbxvi/sb16_dsp.c delete mode 100644 sys/dev/sound/isa/i386/sequencer.c delete mode 100644 sys/dev/sound/isa/i386/sound.doc delete mode 100644 sys/dev/sound/isa/i386/sound_calls.h delete mode 100644 sys/dev/sound/isa/i386/sound_config.h delete mode 100644 sys/dev/sound/isa/i386/sound_pnp.c delete mode 100644 sys/dev/sound/isa/i386/sound_switch.c delete mode 100644 sys/dev/sound/isa/i386/sound_timer.c delete mode 100644 sys/dev/sound/isa/i386/soundcard.c delete mode 100644 sys/dev/sound/isa/i386/soundvers.h delete mode 100644 sys/dev/sound/isa/i386/spkr/spkr.c delete mode 100644 sys/dev/sound/isa/i386/sscape/sscape.c delete mode 100644 sys/dev/sound/isa/i386/sys_timer.c delete mode 100644 sys/dev/sound/isa/i386/trix/trix.c delete mode 100644 sys/dev/sound/isa/i386/trix/trix_boot.h delete mode 100644 sys/dev/sound/isa/i386/uart/uart6850.c diff --git a/sys/bus/isa/i386/isa_compat.h b/sys/bus/isa/i386/isa_compat.h index 47d5c23d28..e620b46340 100644 --- a/sys/bus/isa/i386/isa_compat.h +++ b/sys/bus/isa/i386/isa_compat.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/isa_compat.h,v 1.27.2.11 2002/10/05 18:31:48 scottl Exp $ - * $DragonFly: src/sys/bus/isa/i386/isa_compat.h,v 1.7 2005/01/31 23:44:34 joerg Exp $ + * $DragonFly: src/sys/bus/isa/i386/isa_compat.h,v 1.8 2005/03/28 14:42:44 joerg Exp $ */ #include "use_vt.h" @@ -34,18 +34,6 @@ #include "use_rdp.h" #include "use_wl.h" #include "use_pcm.h" -#include "use_pas.h" -#include "use_sb.h" -#include "use_sbxvi.h" -#include "use_sbmidi.h" -#include "use_gus.h" -#include "use_mss.h" -#include "use_css.h" -#include "use_sscape.h" -#include "use_trix.h" -#include "use_opl.h" -#include "use_mpu.h" -#include "use_uart.h" #include "use_mcd.h" #include "use_scd.h" #include "use_wt.h" @@ -74,19 +62,6 @@ extern struct isa_driver eldriver; extern struct isa_driver ledriver; extern struct isa_driver rdpdriver; extern struct isa_driver wldriver; -extern struct isa_driver pasdriver; -extern struct isa_driver sbdriver; -extern struct isa_driver sbxvidriver; -extern struct isa_driver sbmididriver; -extern struct isa_driver gusdriver; -extern struct isa_driver mssdriver; -extern struct isa_driver cssdriver; -extern struct isa_driver sscapedriver; -extern struct isa_driver trixdriver; -extern struct isa_driver sscape_mssdriver; -extern struct isa_driver opldriver; -extern struct isa_driver mpudriver; -extern struct isa_driver uartdriver; extern struct isa_driver mcddriver; extern struct isa_driver scddriver; extern struct isa_driver wtdriver; @@ -190,45 +165,6 @@ static struct old_isa_driver old_drivers[] = { /* MISC */ -#if NPAS > 0 - { INTR_TYPE_MISC, &pasdriver }, -#endif -#if NSB > 0 - { INTR_TYPE_MISC, &sbdriver }, -#endif -#if NSBXVI > 0 - { INTR_TYPE_MISC, &sbxvidriver }, -#endif -#if NSBMIDI > 0 - { INTR_TYPE_MISC, &sbmididriver }, -#endif -#if NGUS > 0 - { INTR_TYPE_MISC, &gusdriver }, -#endif -#if NMSS > 0 - { INTR_TYPE_MISC, &mssdriver }, -#endif -#if NCSS > 0 - { INTR_TYPE_MISC, &cssdriver }, -#endif -#if NSSCAPE > 0 - { INTR_TYPE_MISC, &sscapedriver }, -#endif -#if NTRIX > 0 - { INTR_TYPE_MISC, &trixdriver }, -#endif -#if NSSCAPE > 0 - { INTR_TYPE_MISC, &sscape_mssdriver }, -#endif -#if NOPL > 0 - { INTR_TYPE_MISC, &opldriver }, -#endif -#if NMPU > 0 - { INTR_TYPE_MISC, &mpudriver }, -#endif -#if NUART > 0 - { INTR_TYPE_MISC, &uartdriver }, -#endif #if NCTX > 0 { INTR_TYPE_MISC, &ctxdriver }, #endif diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index bb234c0476..89cf9b3aaa 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -2,7 +2,7 @@ # files marked standard are always included. # # $FreeBSD: src/sys/conf/files.i386,v 1.307.2.38 2003/01/02 20:41:33 kan Exp $ -# $DragonFly: src/sys/conf/Attic/files.amd64,v 1.4 2005/01/31 23:44:34 joerg Exp $ +# $DragonFly: src/sys/conf/Attic/files.amd64,v 1.5 2005/03/28 14:42:44 joerg Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -197,7 +197,6 @@ bus/mca/i386/mca_machdep.c optional mca dev/disk/mcd/mcd.c optional mcd dev/misc/mse/mse.c optional mse i386/isa/npx.c mandatory npx -dev/sound/isa/i386/pca/pcaudio.c optional pca bus/iicbus/i386/pcf.c optional pcf bus/pci/i386/pci_cfgreg.c optional pci bus/pci/i386/pcibus.c optional pci @@ -212,72 +211,8 @@ i386/isa/pmtimer.c optional acpica i386/isa/prof_machdep.c optional profiling-routine dev/serial/rc/rc.c optional rc dev/disk/scd/scd.c optional scd -dev/sound/isa/i386/ad1848.c optional css -dev/sound/isa/i386/ad1848.c optional gus -dev/sound/isa/i386/ad1848.c optional gusxvi -dev/sound/isa/i386/ad1848.c optional mss -dev/sound/isa/i386/ad1848.c optional sscape -dev/sound/isa/i386/ad1848.c optional trix -dev/sound/isa/i386/ad1848.c optional sscape_mss -dev/sound/isa/i386/adlib_card.c optional opl -dev/sound/isa/i386/adlib_card.c optional trix -dev/sound/isa/i386/audio.c optional snd \ - warning "The snd drivers are deprecated. Please see pcm/sbc/etc." -dev/sound/isa/i386/css/cs4232.c optional css -dev/sound/isa/i386/dev_table.c optional snd -dev/sound/isa/i386/dmabuf.c optional snd -dev/sound/isa/i386/gus/gus_card.c optional gus -dev/sound/isa/i386/gus/gus_midi.c optional gus -dev/sound/isa/i386/gus/gus_vol.c optional gus -dev/sound/isa/i386/gus/gus_wave.c optional gus -dev/sound/isa/i386/gus/ics2101.c optional gus -dev/sound/isa/i386/midi_synth.c optional css -dev/sound/isa/i386/midi_synth.c optional gus -dev/sound/isa/i386/midi_synth.c optional mpu -dev/sound/isa/i386/midi_synth.c optional mss -dev/sound/isa/i386/midi_synth.c optional pas -dev/sound/isa/i386/midi_synth.c optional sb -dev/sound/isa/i386/midi_synth.c optional sscape -dev/sound/isa/i386/midi_synth.c optional uart -dev/sound/isa/i386/midibuf.c optional css -dev/sound/isa/i386/midibuf.c optional gus -dev/sound/isa/i386/midibuf.c optional mpu -dev/sound/isa/i386/midibuf.c optional mss -dev/sound/isa/i386/midibuf.c optional pas -dev/sound/isa/i386/midibuf.c optional sb -dev/sound/isa/i386/midibuf.c optional sscape -dev/sound/isa/i386/midibuf.c optional uart -dev/sound/isa/i386/mpu/mpu401.c optional mpu -dev/sound/isa/i386/mpu/mpu401.c optional sscape -dev/sound/isa/i386/opl3.c optional opl -dev/sound/isa/i386/opl3.c optional trix -dev/sound/isa/i386/pas2/pas2_card.c optional pas -dev/sound/isa/i386/pas2/pas2_midi.c optional pas -dev/sound/isa/i386/pas2/pas2_mixer.c optional pas -dev/sound/isa/i386/pas2/pas2_pcm.c optional pas -dev/sound/isa/i386/patmgr.c optional snd -dev/sound/isa/i386/sbxvi/sb16_dsp.c optional sbxvi -dev/sound/isa/i386/sbmidi/sb16_midi.c optional sbmidi -dev/sound/isa/i386/sb/sb_card.c optional sb -dev/sound/isa/i386/sb/sb_dsp.c optional sb -dev/sound/isa/i386/sb/sb_midi.c optional sb -dev/sound/isa/i386/sb/sb_mixer.c optional sb -dev/sound/isa/i386/sequencer.c optional snd -dev/sound/isa/i386/sound_switch.c optional snd -dev/sound/isa/i386/sound_timer.c optional css -dev/sound/isa/i386/sound_timer.c optional gus -dev/sound/isa/i386/sound_timer.c optional mss -dev/sound/isa/i386/sound_timer.c optional mss -dev/sound/isa/i386/sound_timer.c optional sscape -dev/sound/isa/i386/sound_timer.c optional trix -dev/sound/isa/i386/soundcard.c optional snd -dev/sound/isa/i386/sscape/sscape.c optional sscape -dev/sound/isa/i386/sys_timer.c optional snd -dev/sound/isa/i386/trix/trix.c optional trix -dev/sound/isa/i386/uart/uart6850.c optional uart dev/misc/spic/spic.c optional spic dev/misc/spigot/spigot.c optional spigot -dev/sound/isa/i386/spkr/spkr.c optional speaker dev/serial/stl/stallion.c optional stl dev/misc/tw/tw.c optional tw dev/video/i386/vesa/vesa.c optional vga vesa diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index b061f06377..0193e07216 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -2,7 +2,7 @@ # files marked standard are always included. # # $FreeBSD: src/sys/conf/files.i386,v 1.307.2.38 2003/01/02 20:41:33 kan Exp $ -# $DragonFly: src/sys/conf/Attic/files.i386,v 1.28 2005/02/21 21:40:47 dillon Exp $ +# $DragonFly: src/sys/conf/Attic/files.i386,v 1.29 2005/03/28 14:42:44 joerg Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -247,7 +247,6 @@ bus/mca/i386/mca_machdep.c optional mca dev/disk/mcd/mcd.c optional mcd dev/misc/mse/mse.c optional mse i386/isa/npx.c mandatory npx -dev/sound/isa/i386/pca/pcaudio.c optional pca bus/iicbus/i386/pcf.c optional pcf bus/pci/i386/pci_cfgreg.c optional pci bus/pci/i386/pcibus.c optional pci @@ -262,72 +261,8 @@ i386/isa/pmtimer.c optional acpica pmtimer i386/isa/prof_machdep.c optional profiling-routine dev/serial/rc/rc.c optional rc dev/disk/scd/scd.c optional scd -dev/sound/isa/i386/ad1848.c optional css -dev/sound/isa/i386/ad1848.c optional gus -dev/sound/isa/i386/ad1848.c optional gusxvi -dev/sound/isa/i386/ad1848.c optional mss -dev/sound/isa/i386/ad1848.c optional sscape -dev/sound/isa/i386/ad1848.c optional trix -dev/sound/isa/i386/ad1848.c optional sscape_mss -dev/sound/isa/i386/adlib_card.c optional opl -dev/sound/isa/i386/adlib_card.c optional trix -dev/sound/isa/i386/audio.c optional snd \ - warning "The snd drivers are deprecated. Please see pcm/sbc/etc." -dev/sound/isa/i386/css/cs4232.c optional css -dev/sound/isa/i386/dev_table.c optional snd -dev/sound/isa/i386/dmabuf.c optional snd -dev/sound/isa/i386/gus/gus_card.c optional gus -dev/sound/isa/i386/gus/gus_midi.c optional gus -dev/sound/isa/i386/gus/gus_vol.c optional gus -dev/sound/isa/i386/gus/gus_wave.c optional gus -dev/sound/isa/i386/gus/ics2101.c optional gus -dev/sound/isa/i386/midi_synth.c optional css -dev/sound/isa/i386/midi_synth.c optional gus -dev/sound/isa/i386/midi_synth.c optional mpu -dev/sound/isa/i386/midi_synth.c optional mss -dev/sound/isa/i386/midi_synth.c optional pas -dev/sound/isa/i386/midi_synth.c optional sb -dev/sound/isa/i386/midi_synth.c optional sscape -dev/sound/isa/i386/midi_synth.c optional uart -dev/sound/isa/i386/midibuf.c optional css -dev/sound/isa/i386/midibuf.c optional gus -dev/sound/isa/i386/midibuf.c optional mpu -dev/sound/isa/i386/midibuf.c optional mss -dev/sound/isa/i386/midibuf.c optional pas -dev/sound/isa/i386/midibuf.c optional sb -dev/sound/isa/i386/midibuf.c optional sscape -dev/sound/isa/i386/midibuf.c optional uart -dev/sound/isa/i386/mpu/mpu401.c optional mpu -dev/sound/isa/i386/mpu/mpu401.c optional sscape -dev/sound/isa/i386/opl3.c optional opl -dev/sound/isa/i386/opl3.c optional trix -dev/sound/isa/i386/pas2/pas2_card.c optional pas -dev/sound/isa/i386/pas2/pas2_midi.c optional pas -dev/sound/isa/i386/pas2/pas2_mixer.c optional pas -dev/sound/isa/i386/pas2/pas2_pcm.c optional pas -dev/sound/isa/i386/patmgr.c optional snd -dev/sound/isa/i386/sbxvi/sb16_dsp.c optional sbxvi -dev/sound/isa/i386/sbmidi/sb16_midi.c optional sbmidi -dev/sound/isa/i386/sb/sb_card.c optional sb -dev/sound/isa/i386/sb/sb_dsp.c optional sb -dev/sound/isa/i386/sb/sb_midi.c optional sb -dev/sound/isa/i386/sb/sb_mixer.c optional sb -dev/sound/isa/i386/sequencer.c optional snd -dev/sound/isa/i386/sound_switch.c optional snd -dev/sound/isa/i386/sound_timer.c optional css -dev/sound/isa/i386/sound_timer.c optional gus -dev/sound/isa/i386/sound_timer.c optional mss -dev/sound/isa/i386/sound_timer.c optional mss -dev/sound/isa/i386/sound_timer.c optional sscape -dev/sound/isa/i386/sound_timer.c optional trix -dev/sound/isa/i386/soundcard.c optional snd -dev/sound/isa/i386/sscape/sscape.c optional sscape -dev/sound/isa/i386/sys_timer.c optional snd -dev/sound/isa/i386/trix/trix.c optional trix -dev/sound/isa/i386/uart/uart6850.c optional uart dev/misc/spic/spic.c optional spic dev/misc/spigot/spigot.c optional spigot -dev/sound/isa/i386/spkr/spkr.c optional speaker dev/serial/stl/stallion.c optional stl dev/misc/tw/tw.c optional tw dev/video/i386/vesa/vesa.c optional vga vesa diff --git a/sys/conf/options.amd64 b/sys/conf/options.amd64 index ac09a79fe8..41d5328485 100644 --- a/sys/conf/options.amd64 +++ b/sys/conf/options.amd64 @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/conf/options.i386,v 1.132.2.18 2003/03/14 21:22:35 jhb Exp $ -# $DragonFly: src/sys/conf/Attic/options.amd64,v 1.3 2005/01/31 23:44:34 joerg Exp $ +# $DragonFly: src/sys/conf/Attic/options.amd64,v 1.4 2005/03/28 14:42:44 joerg Exp $ DISABLE_PSE IDE_DELAY @@ -136,11 +136,6 @@ PCVT_SCREENSAVER opt_pcvt.h PCVT_USEKBDSEC opt_pcvt.h PCVT_VT220KEYB opt_pcvt.h -# voxware options -GUS_DMA2 opt_sound.h -GUS_DMA opt_sound.h -GUS_IRQ opt_sound.h - # Video spigot SPIGOT_UNSECURE opt_spigot.h diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 index 8c5d365ba1..34d1afc86e 100644 --- a/sys/conf/options.i386 +++ b/sys/conf/options.i386 @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/conf/options.i386,v 1.132.2.18 2003/03/14 21:22:35 jhb Exp $ -# $DragonFly: src/sys/conf/Attic/options.i386,v 1.9 2005/01/31 23:44:34 joerg Exp $ +# $DragonFly: src/sys/conf/Attic/options.i386,v 1.10 2005/03/28 14:42:44 joerg Exp $ DISABLE_PSE IDE_DELAY @@ -141,11 +141,6 @@ PCVT_SCREENSAVER opt_pcvt.h PCVT_USEKBDSEC opt_pcvt.h PCVT_VT220KEYB opt_pcvt.h -# voxware options -GUS_DMA2 opt_sound.h -GUS_DMA opt_sound.h -GUS_IRQ opt_sound.h - # Video spigot SPIGOT_UNSECURE opt_spigot.h diff --git a/sys/config/LINT b/sys/config/LINT index a354a1fe41..d7627460ab 100644 --- a/sys/config/LINT +++ b/sys/config/LINT @@ -3,7 +3,7 @@ # as much of the source tree as it can. # # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $ -# $DragonFly: src/sys/config/LINT,v 1.48 2005/02/26 12:00:55 swildner Exp $ +# $DragonFly: src/sys/config/LINT,v 1.49 2005/03/28 14:42:45 joerg Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -992,7 +992,6 @@ options SES_ENABLE_PASSTHROUGH # `xterm', among others. pseudo-device pty #Pseudo ttys -pseudo-device speaker #Play IBM BASIC-style noises out your speaker pseudo-device gzip #Exec gzipped a.out's pseudo-device vn #Vnode driver (turns a file into a device) pseudo-device md #Memory/malloc disk @@ -1456,32 +1455,6 @@ pseudo-device atm device en options NATM #native ATM -# -# Audio drivers: `snd', `sb', `pas', `gus', `pca' -# -# snd: Voxware sound support code -# sb: SoundBlaster PCM - SoundBlaster, SB Pro, SB16, ProAudioSpectrum -# sbxvi: SoundBlaster 16 -# sbmidi: SoundBlaster 16 MIDI interface -# pas: ProAudioSpectrum PCM and MIDI -# gus: Gravis Ultrasound - Ultrasound, Ultrasound 16, Ultrasound MAX -# gusxvi: Gravis Ultrasound 16-bit PCM (do not use) -# mss: Microsoft Sound System -# css: Crystal Sound System (CSS 423x PnP) -# sscape: Ensoniq Soundscape MIDI interface -# sscape_mss: Ensoniq Soundscape PCM (requires sscape) -# opl: Yamaha OPL-2 and OPL-3 FM - SB, SB Pro, SB 16, ProAudioSpectrum -# uart: stand-alone 6850 UART for MIDI -# mpu: Roland MPU-401 stand-alone card -# -# Note: It has been reported that ISA DMA with the SoundBlaster will -# lock up the machine (PR docs/5358). If this happens to you, -# turning off USWC write posting in your machine's BIOS may fix -# the problem. -# -# Beware! The addresses specified below are also hard-coded in -# src/sys/i386/isa/sound/sound_config.h. If you change the values here, you -# must also change the values in the include file. # # pcm: PCM audio through various sound cards. # @@ -1500,8 +1473,6 @@ options NATM #native ATM # # This driver will use the new PnP code if it's available. # -# pca: PCM audio through your PC speaker -# # If you have a GUS-MAX card and want to use the CS4231 codec on the # card the drqs for the gus max must be 8 bit (1, 2, or 3). # @@ -1522,25 +1493,6 @@ options NATM #native ATM # # The src/sys/i386/isa/sound/sound.doc has more information. -# Controls all "VOXWARE" driver sound devices. See Luigi's driver -# below for an alternate which may work better for some cards. -# -#device snd -#device pas0 at isa? port 0x388 irq 10 drq 6 -#device sb0 at isa? port 0x220 irq 5 drq 1 -#device sbxvi0 at isa? drq 5 -#device sbmidi0 at isa? port 0x330 -#device gus0 at isa? port 0x220 irq 12 drq 1 -##device gus0 at isa? port 0x220 irq 12 drq 1 flags 0x3 -#device mss0 at isa? port 0x530 irq 10 drq 1 -#device css0 at isa? port 0x534 irq 5 drq 1 flags 0x08 -#device sscape0 at isa? port 0x330 irq 9 drq 0 -#device trix0 at isa? port 0x330 irq 6 drq 0 -#device sscape_mss0 at isa? port 0x534 irq 5 drq 1 -#device opl0 at isa? port 0x388 -#device mpu0 at isa? port 0x330 irq 6 drq 0 -#device uart0 at isa? port 0x330 irq 5 - # The newpcm driver (use INSTEAD of snd0 and all VOXWARE drivers!). # Note that motherboard sound devices may require device PNPBIOS. # @@ -1571,10 +1523,6 @@ device pcm device sbc0 at isa? port 0x220 irq 5 drq 1 flags 0x15 device gusc0 at isa? port 0x220 irq 5 drq 1 flags 0x13 -# Not controlled by `snd' -# XXX-Hiten The pca driver needs to readded back into LINT! -# device pca0 at isa? port IO_TIMER1 - # # Miscellaneous hardware: # diff --git a/sys/dev/sound/isa/i386/ad1848.c b/sys/dev/sound/isa/i386/ad1848.c deleted file mode 100644 index 568b926e49..0000000000 --- a/sys/dev/sound/isa/i386/ad1848.c +++ /dev/null @@ -1,1868 +0,0 @@ -/* - * sound/ad1848.c - * - * Modified by Luigi Rizzo (luigi@iet.unipi.it) - * - * The low level driver for the AD1848/CS4248 codec chip which is used for - * example in the MS Sound System. - * - * The CS4231 which is used in the GUS MAX and some other cards is upwards - * compatible with AD1848 and this driver is able to drive it. - * - * CS4231A and AD1845 are upward compatible with CS4231. However the new - * features of these chips are different. - * - * CS4232 is a PnP audio chip which contains a CS4231A (and SB, MPU). CS4232A is - * an improved version of CS4232. - * - * CS4236 is also a PnP audio chip similar to the 4232 - * - * OPTi931 is another high-end 1848-type chip. It differs in the use - * of the high 16 registers and configuration stuff. Luckily, being a - * PnP device, we can avoid black magic to identify the chip and be - * sure of its identity. - * - * Copyright by Hannu Savolainen 1994, 1995 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * Modified: Riccardo Facchetti 24 Mar 1995 - Added the Audio Excel DSP 16 - * initialization routine. - * - * $FreeBSD: src/sys/i386/isa/sound/ad1848.c,v 1.30 1999/12/01 14:15:30 nyan Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/ad1848.c,v 1.3 2003/08/07 21:17:12 dillon Exp $ - */ - -#define DEB(x) -#define DEB1(x) -#include "sound_config.h" - -#if defined(CONFIG_AD1848) - -#include "ad1848_mixer.h" -#include - -#if defined(CONFIG_CS4232) -extern struct isa_driver cssdriver; -#else -extern struct isa_driver mssdriver; -#endif - -extern void IwaveStopDma(BYTE path); - -typedef struct { - int base; - int irq; - int dual_dma; /* 1, when two DMA channels allocated */ - u_char MCE_bit; - u_char saved_regs[16]; - - int speed; - u_char speed_bits; - int channels; - int audio_format; - u_char format_bits; - - u_long xfer_count; - int irq_mode; - int intr_active; - int opened; - char *chip_name; - int mode; -#define MD_1848 1 -#define MD_4231 2 -#define MD_4231A 3 -#define MD_4236 4 -#define MD_1845 5 -#define MD_MAXMODE 6 - - /* Mixer parameters */ - int recmask; - int supported_devices; - int supported_rec_devices; - u_short levels[32]; - int dev_no; - volatile u_long timer_ticks; - int timer_running; - int irq_ok; - sound_os_info *osp; -} ad1848_info; - -static int nr_ad1848_devs = 0; -static volatile char irq2dev[17] = - {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; - -static int timer_installed = -1; -static int mute_flag = 0; -static char mixer2codec[MAX_MIXER_DEV] = {0}; - -static int ad_format_mask[MD_MAXMODE /* devc->mode */ ] = -{ - /* 0 - none */ 0, - /* 1 - AD1848 */ AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW, - - /* - * AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_U16_LE | - * AFMT_IMA_ADPCM, - */ - - /* 2 - CS4231 */ AFMT_U8 | AFMT_S16_LE | AFMT_U16_LE, - - /* - * AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_U16_LE | - * AFMT_IMA_ADPCM, - */ - - /* 3 - CS4231A */ AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW, - /* 4 - AD1845 */ AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW, - /* 5 - CS4236 */ AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW, -}; - -static ad1848_info dev_info[MAX_AUDIO_DEV]; - -#define io_Index_Addr(d) ((d)->base) -#define io_Indexed_Data(d) ((d)->base+1) -#define io_Status(d) ((d)->base+2) -#define io_Polled_IO(d) ((d)->base+3) - -static int ad1848_open(int dev, int mode); -static void ad1848_close(int dev); -static int ad1848_ioctl(int dev, u_int cmd, ioctl_arg arg, int local); -static void ad1848_output_block(int dev, u_long buf, int count, int intrflag, int dma_restart); -static void ad1848_start_input(int dev, u_long buf, int count, int intrflag, int dma_restart); -static int ad1848_prepare_for_IO(int dev, int bsize, int bcount); -static void ad1848_reset(int dev); -static void ad1848_halt(int dev); -static void ad1848_halt_input(int dev); -static void ad1848_halt_output(int dev); -static void ad1848_trigger(int dev, int bits); -static int ad1848_tmr_install(int dev); -static void ad1848_tmr_reprogram(int dev); - -/* - * AD_WAIT_INIT waits if we are initializing the board and we cannot modify - * its settings - */ -#define AD_WAIT_INIT(x) {int t=x; while(t>0 && inb(devc->base) == 0x80) t-- ; } - -short ipri_to_irq(u_short ipri); - -void -adintr(unit) -{ -#if 1 - /* this isn't ideal but should work */ - ad1848_interrupt(-1); -#else - static short unit_to_irq[4] = {9, -1, -1, -1}; - struct isa_device *dev; - - if (unit_to_irq[unit] > 0) - ad1848_interrupt(unit_to_irq[unit]); - else { -#if defined(CONFIG_CS4232) - dev = find_isadev(isa_devtab_null, &cssdriver, unit); -#else - dev = find_isadev(isa_devtab_null, &mssdriver, unit); -#endif - if (!dev) - printf("ad1848: Couldn't determine unit\n"); - else { - unit_to_irq[unit] = ipri_to_irq(dev->id_irq); - ad1848_interrupt(unit_to_irq[unit]); - } - } -#endif -} - -static int -ad_read(ad1848_info * devc, int reg) -{ - u_long flags; - int x; - - AD_WAIT_INIT(900000); - flags = splhigh(); - outb(io_Index_Addr(devc), (u_char) (reg & 0xff) | devc->MCE_bit); - x = inb(io_Indexed_Data(devc)); - splx(flags); - - return x; -} - -static void -ad_write(ad1848_info * devc, int reg, u_char data) -{ - u_long flags; - - AD_WAIT_INIT(90000); - - flags = splhigh(); - outb(io_Index_Addr(devc), (u_char) (reg & 0xff) | devc->MCE_bit); - outb(io_Indexed_Data(devc), (u_char) (data & 0xff)); - splx(flags); -} - -static void -wait_for_calibration(ad1848_info * devc) -{ - int timeout = 0; - - /* - * Wait until the auto calibration process has finished. - * - * 1) Wait until the chip becomes ready (reads don't return 0x80). - * 2) Wait until the ACI bit of I11 gets on and then off. - */ - - AD_WAIT_INIT(100000); - if (inb(devc->base) & 0x80) - printf("ad1848: Auto calibration timed out(1).\n"); - - timeout = 100; - while (timeout > 0 && !(ad_read(devc, 11) & 0x20)) - timeout--; - if (!(ad_read(devc, 11) & 0x20)) - return; - - timeout = 20000; - while (timeout > 0 && ad_read(devc, 11) & 0x20) - timeout--; - if (ad_read(devc, 11) & 0x20) - printf("ad1848: Auto calibration timed out(3).\n"); -} - -static void -ad_mute(ad1848_info * devc) -{ - int i; - u_char prev; - - mute_flag = 1; - - /* - * Save old register settings and mute output channels - */ - for (i = 6; i < 8; i++) { - prev = devc->saved_regs[i] = ad_read(devc, i); - ad_write(devc, i, prev | 0x80); - } -} - -static void -ad_unmute(ad1848_info * devc) -{ - int i; - - mute_flag = 0; - /* - * Restore back old volume registers (unmute) - */ - for (i = 6; i < 8; i++) - ad_write(devc, i, devc->saved_regs[i] & ~0x80); - } - -static void -ad_enter_MCE(ad1848_info * devc) -{ - u_long flags; - - AD_WAIT_INIT(1000); - devc->MCE_bit = 0x40; - flags = splhigh(); - if ( ( inb(io_Index_Addr(devc)) & 0x40) == 0 ) - outb(io_Index_Addr(devc), devc->MCE_bit); - splx(flags); -} - -static void -ad_leave_MCE(ad1848_info * devc) -{ - u_long flags; - u_char prev; - - AD_WAIT_INIT(1000); - - flags = splhigh(); - - devc->MCE_bit = 0x00; - prev = inb(io_Index_Addr(devc)); - /* XXX the next call is redundant ? */ - outb(io_Index_Addr(devc), 0x00); /* Clear the MCE bit */ - - if ((prev & 0x40) == 0) { /* Not in MCE mode */ - splx(flags); - return; - } - outb(io_Index_Addr(devc), 0x00); /* Clear the MCE bit */ - wait_for_calibration(devc); - splx(flags); -} - - -static int -ad1848_set_recmask(ad1848_info * devc, int mask) -{ - u_char recdev; - int i, n; - - mask &= devc->supported_rec_devices; - - n = 0; - for (i = 0; i < 32; i++)/* Count selected device bits */ - if (mask & (1 << i)) - n++; - - if (n == 0) - mask = SOUND_MASK_MIC; - else if (n != 1) { /* Too many devices selected */ - mask &= ~devc->recmask; /* Filter out active settings */ - - n = 0; - for (i = 0; i < 32; i++) /* Count selected device bits */ - if (mask & (1 << i)) - n++; - - if (n != 1) - mask = SOUND_MASK_MIC; - } - switch (mask) { - case SOUND_MASK_MIC: - recdev = 2; - break; - - case SOUND_MASK_LINE: - case SOUND_MASK_LINE3: - recdev = 0; - break; - - case SOUND_MASK_CD: - case SOUND_MASK_LINE1: - recdev = 1; - break; - - case SOUND_MASK_IMIX: - recdev = 3; - break; - - default: - mask = SOUND_MASK_MIC; - recdev = 2; - } - - recdev <<= 6; - ad_write(devc, 0, (ad_read(devc, 0) & 0x3f) | recdev); - ad_write(devc, 1, (ad_read(devc, 1) & 0x3f) | recdev); - - devc->recmask = mask; - return mask; -} - -static void -change_bits(u_char *regval, int dev, int chn, int newval) -{ - u_char mask; - int shift; - - if (mix_devices[dev][chn].polarity == 1) /* Reverse */ - newval = 100 - newval; - - mask = (1 << mix_devices[dev][chn].nbits) - 1; - shift = mix_devices[dev][chn].bitpos; - newval = (int) ((newval * mask) + 50) / 100; /* Scale it */ - - *regval &= ~(mask << shift); /* Clear bits */ - *regval |= (newval & mask) << shift; /* Set new value */ -} - -static int -ad1848_mixer_get(ad1848_info * devc, int dev) -{ - if (!((1 << dev) & devc->supported_devices)) - return -(EINVAL); - - return devc->levels[dev]; -} - -#define CLMICI 0x00781601 -#define CRMICI 0x00791701 - -static int -ad1848_mixer_set(ad1848_info * devc, int dev, int value) -{ - int left = value & 0x000000ff; - int right = (value & 0x0000ff00) >> 8; - int retvol; - - int regoffs; - u_char val; - /* u_char clci, crmici, clmici, clici, crici; */ - - if (left > 100) - left = 100; - if (right > 100) - right = 100; - - if (mix_devices[dev][RIGHT_CHN].nbits == 0) /* Mono control */ - right = left; - - retvol = left | (right << 8); - - /* Scale volumes */ - left = mix_cvt[left]; - right = mix_cvt[right]; - - /* Scale it again */ - left = mix_cvt[left]; - right = mix_cvt[right]; - - if (dev > 31) - return -(EINVAL); - - if (!(devc->supported_devices & (1 << dev))) - return -(EINVAL); - - if (mix_devices[dev][LEFT_CHN].nbits == 0) - return -(EINVAL); - - devc->levels[dev] = retvol; - - /* - * Set the left channel - */ - /* IwaveCodecMode(CODEC_MODE3); Default codec mode */ - - regoffs = mix_devices[dev][LEFT_CHN].regno; - val = ad_read(devc, regoffs); - - change_bits(&val, dev, LEFT_CHN, left); - ad_write(devc, regoffs, val); - devc->saved_regs[regoffs] = val; - - /* - * Set the right channel - */ - - if (mix_devices[dev][RIGHT_CHN].nbits == 0) - return retvol; /* Was just a mono channel */ - - regoffs = mix_devices[dev][RIGHT_CHN].regno; - val = ad_read(devc, regoffs); - change_bits(&val, dev, RIGHT_CHN, right); - ad_write(devc, regoffs, val); - devc->saved_regs[regoffs] = val; - - return retvol; -} - -static void -ad1848_mixer_reset(ad1848_info * devc) -{ - int i; - - devc->recmask = 0; - if (devc->mode != MD_1848) - devc->supported_devices = MODE2_MIXER_DEVICES; - else - devc->supported_devices = MODE1_MIXER_DEVICES; - - devc->supported_rec_devices = MODE1_REC_DEVICES; - - for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) - if (devc->supported_devices & (1 << i)) - ad1848_mixer_set(devc, i, default_mixer_levels[i]); - ad1848_set_recmask(devc, SOUND_MASK_MIC); -} - -static int -ad1848_mixer_ioctl(int dev, u_int cmd, ioctl_arg arg) -{ - ad1848_info *devc; - int codec_dev = mixer2codec[dev]; - - if (!codec_dev) - return -(ENXIO); - - codec_dev--; - - devc = (ad1848_info *) audio_devs[codec_dev]->devc; - - if (((cmd >> 8) & 0xff) == 'M') { - if (cmd & IOC_IN) - switch (cmd & 0xff) { - case SOUND_MIXER_RECSRC: - return *(int *) arg = ad1848_set_recmask(devc, (*(int *) arg)); - break; - - default: - return *(int *) arg = ad1848_mixer_set(devc, cmd & 0xff, (*(int *) arg)); - } - else - switch (cmd & 0xff) { /* Return parameters */ - - case SOUND_MIXER_RECSRC: - return *(int *) arg = devc->recmask; - break; - - case SOUND_MIXER_DEVMASK: - return *(int *) arg = devc->supported_devices; - break; - - case SOUND_MIXER_STEREODEVS: - return *(int *) arg = devc->supported_devices & ~(SOUND_MASK_SPEAKER | SOUND_MASK_IMIX); - break; - - case SOUND_MIXER_RECMASK: - return *(int *) arg = devc->supported_rec_devices; - break; - - case SOUND_MIXER_CAPS: - return *(int *) arg = SOUND_CAP_EXCL_INPUT; - break; - - default: - return *(int *) arg = ad1848_mixer_get(devc, cmd & 0xff); - } - } else - return -(EINVAL); -} - -static struct audio_operations ad1848_pcm_operations[MAX_AUDIO_DEV] = -{ - { - "Generic AD1848 codec", - /* DMA_AUTOMODE | DMA_DUPLEX, */ - DMA_AUTOMODE, - AFMT_U8, /* Will be set later */ - NULL, - ad1848_open, - ad1848_close, - ad1848_output_block, - ad1848_start_input, - ad1848_ioctl, - ad1848_prepare_for_IO, - ad1848_prepare_for_IO, - ad1848_reset, - ad1848_halt, - NULL, - NULL, - ad1848_halt_input, - ad1848_halt_output, - ad1848_trigger - } -}; - -static struct mixer_operations ad1848_mixer_operations = -{ - "AD1848/CS4248/CS4231/CS4236", - ad1848_mixer_ioctl -}; - -static int -ad1848_open(int dev, int mode) -{ - ad1848_info *devc = NULL; - u_long flags; - int otherside = audio_devs[dev]->otherside; - - if (dev < 0 || dev >= num_audiodevs) - return -(ENXIO); - - if (otherside != -1) { - if (audio_devs[otherside]->busy) - return -(EBUSY); - } - if (audio_devs[dev]->busy) - return -(EBUSY); - - devc = (ad1848_info *) audio_devs[dev]->devc; - - flags = splhigh(); - if (audio_devs[dev]->busy) { - splx(flags); - return -(EBUSY); - } - devc->dual_dma = 0; - - if (audio_devs[dev]->flags & DMA_DUPLEX) { - devc->dual_dma = 1; - } - devc->intr_active = 0; - audio_devs[dev]->busy = 1; - devc->irq_mode = 0; - ad1848_trigger(dev, 0); - splx(flags); - /* - * Mute output until the playback really starts. This decreases - * clicking. - */ - ad_mute(devc); - - return 0; -} - -static void -ad1848_close(int dev) -{ - u_long flags; - ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; - int otherside = audio_devs[dev]->otherside; - - if (otherside != -1) { - if (audio_devs[otherside]->busy) - return; - } - DEB(printf("ad1848_close(void)\n")); - - flags = splhigh(); - - ad_mute(devc); - - ad_write(devc, 9, ad_read(devc, 9) & ~0x1); - outb(io_Status(devc), 0); /* Clear interrupt status */ - /* - * ad_write (devc, 15,0); ad_write (devc, 14,0); - */ - devc->irq_mode &= ~PCM_ENABLE_OUTPUT; - - devc->intr_active = 0; - ad1848_reset(dev); - - devc->opened = 0; - devc->irq_mode = 0; - audio_devs[dev]->busy = 0; - ad_unmute(devc); - splx(flags); -} - -static int -set_speed(ad1848_info * devc, int arg) -{ - /* - * The sampling speed is encoded in the least significant nible of - * I8. The LSB selects the clock source (0=24.576 MHz, 1=16.9344 Mhz) - * and other three bits select the divisor (indirectly): - * - * The available speeds are in the following table. Keep the speeds in - * the increasing order. - */ - typedef struct { - int speed; - u_char bits; - } speed_struct; - - static speed_struct speed_table[] = { - {5510, (0 << 1) | 1}, - {5510, (0 << 1) | 1}, - {6620, (7 << 1) | 1}, - {8000, (0 << 1) | 0}, - {9600, (7 << 1) | 0}, - {11025, (1 << 1) | 1}, - {16000, (1 << 1) | 0}, - {18900, (2 << 1) | 1}, - {22050, (3 << 1) | 1}, - {27420, (2 << 1) | 0}, - {32000, (3 << 1) | 0}, - {33075, (6 << 1) | 1}, - {37800, (4 << 1) | 1}, - {44100, (5 << 1) | 1}, - {48000, (6 << 1) | 0} - }; - - int i, n, selected = -1; - - n = sizeof(speed_table) / sizeof(speed_struct); - - if (devc->mode == MD_1845) { /* AD1845 has different timer than others */ - RANGE (arg, 4000, 50000) ; - - devc->speed = arg; - devc->speed_bits = speed_table[selected].bits; - return devc->speed; - } - if (arg < speed_table[0].speed) - selected = 0; - if (arg > speed_table[n - 1].speed) - selected = n - 1; - - for (i = 1 /* really */ ; selected == -1 && i < n; i++) - if (speed_table[i].speed == arg) - selected = i; - else if (speed_table[i].speed > arg) { - int diff1, diff2; - - diff1 = arg - speed_table[i - 1].speed; - diff2 = speed_table[i].speed - arg; - - if (diff1 < diff2) - selected = i - 1; - else - selected = i; - } - if (selected == -1) { - printf("ad1848: Can't find speed???\n"); - selected = 3; - } - devc->speed = speed_table[selected].speed; - devc->speed_bits = speed_table[selected].bits; - return devc->speed; -} - -static int -set_channels(ad1848_info * devc, int arg) -{ - if (arg != 1 && arg != 2) - return devc->channels; - - devc->channels = arg; - return arg; -} - -static int -set_format(ad1848_info * devc, int arg) -{ - static struct format_tbl { - int format; - u_char bits; - } format2bits[] = { - { 0, 0 } , - { AFMT_MU_LAW, 1 } , - { AFMT_A_LAW, 3 } , - { AFMT_IMA_ADPCM, 5 } , - { AFMT_U8, 0 } , - { AFMT_S16_LE, 2 } , - { AFMT_S16_BE, 6 } , - { AFMT_S8, 0 } , - { AFMT_U16_LE, 0 } , - { AFMT_U16_BE, 0 } - }; - int i, n = sizeof(format2bits) / sizeof(struct format_tbl); - - - if (!(arg & ad_format_mask[devc->mode])) - arg = AFMT_U8; - - devc->audio_format = arg; - - for (i = 0; i < n; i++) - if (format2bits[i].format == arg) { - if ((devc->format_bits = format2bits[i].bits) == 0) - return devc->audio_format = AFMT_U8; /* Was not supported */ - return arg; - } - /* Still hanging here. Something must be terribly wrong */ - devc->format_bits = 0; - return devc->audio_format = AFMT_U8; -} - -/* XXX check what is arg, (int) or *(int *) lr970705 */ -static int -ad1848_ioctl(int dev, u_int cmd, ioctl_arg arg, int local) -{ - ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; - - switch (cmd) { - case SOUND_PCM_WRITE_RATE: - if (local) - return set_speed(devc, (int) arg); - return *(int *) arg = set_speed(devc, (*(int *) arg)); - - case SOUND_PCM_READ_RATE: - if (local) - return devc->speed; - return *(int *) arg = devc->speed; - - case SNDCTL_DSP_STEREO: - if (local) - return set_channels(devc, (int) arg + 1) - 1; - return *(int *) arg = set_channels(devc, (*(int *) arg) + 1) - 1; - - case SOUND_PCM_WRITE_CHANNELS: - if (local) - return set_channels(devc, (int) arg); - return *(int *) arg = set_channels(devc, (*(int *) arg)); - - case SOUND_PCM_READ_CHANNELS: - if (local) - return devc->channels; - return *(int *) arg = devc->channels; - - case SNDCTL_DSP_SAMPLESIZE: - if (local) - return set_format(devc, (int) arg); - return *(int *) arg = set_format(devc, (*(int *) arg)); - - case SOUND_PCM_READ_BITS: - if (local) - return devc->audio_format; - return *(int *) arg = devc->audio_format; - - - case FIOASYNC: - if (local) - return 1; - return *(int *) arg = 1; - - case FIONBIO: - if (local) - return 1; - return *(int *) arg = 1; - - - default:; - } - return -(EINVAL); -} - -static void -ad1848_output_block(int dev, u_long buf, int count, int intrflag, int dma_restart) -{ - u_long flags, cnt; - ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; - - cnt = count; - if (devc->audio_format == AFMT_IMA_ADPCM) { - cnt /= 4; - } else { - if (devc->audio_format & (AFMT_S16_LE | AFMT_S16_BE)) /* 16 bit data */ - cnt >>= 1; - } - if (devc->channels > 1) - cnt >>= 1; - cnt--; - if (mute_flag) - ad_unmute(devc); - - if ( devc->irq_mode & PCM_ENABLE_OUTPUT && - audio_devs[dev]->flags & DMA_AUTOMODE && intrflag && - cnt == devc->xfer_count) { - devc->irq_mode |= PCM_ENABLE_OUTPUT; - devc->intr_active = 1; - - } - flags = splhigh(); - - if (dma_restart) { - - DMAbuf_start_dma(dev, buf, count, 1); - } - ad_write(devc, 15, (u_char) (cnt & 0xff)); - ad_write(devc, 14, (u_char) ((cnt >> 8) & 0xff)); - - devc->xfer_count = cnt; - devc->irq_mode |= PCM_ENABLE_OUTPUT; - devc->intr_active = 1; - splx(flags); -} - -static void -ad1848_start_input(int dev, u_long buf, int count, - int intrflag, int dma_restart) -{ - u_long flags, cnt; - ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; - - cnt = count; - if (devc->audio_format == AFMT_IMA_ADPCM) - cnt /= 4; - else if (devc->audio_format & (AFMT_S16_LE | AFMT_S16_BE)) /* 16 bit data */ - cnt >>= 1; - if (devc->channels > 1) - cnt >>= 1; - cnt--; - - if ( devc->irq_mode & PCM_ENABLE_INPUT && - audio_devs[dev]->flags & DMA_AUTOMODE && intrflag && - cnt == devc->xfer_count) { - devc->irq_mode |= PCM_ENABLE_INPUT; - devc->intr_active = 1; - return; /* Auto DMA mode on. No need to react */ - } - flags = splhigh(); - - if (dma_restart) { - /* ad1848_halt (dev); */ - DMAbuf_start_dma(dev, buf, count, 0); - } - if (devc->mode == MD_1848 || !devc->dual_dma) {/* Single DMA chan. mode */ - ad_write(devc, 15, (u_char) (cnt & 0xff)); - ad_write(devc, 14, (u_char) ((cnt >> 8) & 0xff)); - } else { /* Dual DMA channel mode */ - ad_write(devc, 31, (u_char) (cnt & 0xff)); - ad_write(devc, 30, (u_char) ((cnt >> 8) & 0xff)); - } - - /* ad_write (devc, 9, ad_read (devc, 9) | 0x02); *//* Capture enable */ - ad_unmute(devc); - - devc->xfer_count = cnt; - devc->irq_mode |= PCM_ENABLE_INPUT; - devc->intr_active = 1; - splx(flags); -} - -static int -ad1848_prepare_for_IO(int dev, int bsize, int bcount) -{ - u_char fs, old_fs; - u_long flags; - ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; - - if (devc->irq_mode) - return 0; - - fs = devc->speed_bits | (devc->format_bits << 5); - - if (devc->channels > 1) - fs |= 0x10; - old_fs = fs; - - flags = splhigh(); - - if (devc->mode == MD_1845) { /* Use alternate speed select regs */ - fs &= 0xf0; /* Mask off the rate select bits */ - - ad_write(devc, 22, (devc->speed >> 8) & 0xff); /* Speed MSB */ - ad_write(devc, 23, devc->speed & 0xff); /* Speed LSB */ - } - - ad_enter_MCE(devc); /* Enables changes to the format select reg */ - - ad_write(devc, 8, fs); - - /* - * Write to I8 starts resyncronization. Wait until it completes. - */ - AD_WAIT_INIT(10000); - - /* - * If mode == 2 (CS4231), set I28 also. It's the capture format - * register. - */ - if (devc->mode != MD_1848) { - ad_write(devc, 28, fs); - - /* - * Write to I28 starts resyncronization. Wait until it completes. - */ - AD_WAIT_INIT(10000); - } - - ad_write(devc, 9, ad_read(devc, 9) & ~0x08); - - ad_leave_MCE(devc); - - splx(flags); - - devc->xfer_count = 0; -#ifdef CONFIG_SEQUENCER - if (dev == timer_installed && devc->timer_running) - if ((fs & 0x01) != (old_fs & 0x01)) { - ad1848_tmr_reprogram(dev); - } -#endif - return 0; -} - -static void -ad1848_reset(int dev) -{ - ad1848_halt(dev); -} - -static void -ad1848_halt(int dev) -{ - ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; - u_long flags; - int timeout; - - flags = splhigh(); - - ad_mute(devc); - - ad_write(devc, 9, ad_read(devc, 9) & ~0x03); /* Stop DMA */ - - ad_write(devc, 14, 0); /* Clear DMA counter */ - ad_write(devc, 15, 0); /* Clear DMA counter */ - - if (devc->mode != MD_1848) { - ad_write(devc, 30, 0); /* Clear DMA counter */ - ad_write(devc, 31, 0); /* Clear DMA counter */ - } - - for (timeout = 0; timeout < 1000 && !(inb(io_Status(devc)) & 0x01); - timeout++); /* Wait for interrupt */ - - outb(io_Status(devc), 0); /* Clear interrupt status */ - - devc->irq_mode = 0; - - /* DMAbuf_reset_dma (dev); */ - splx(flags); -} - -static void -ad1848_halt_input(int dev) -{ - ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; - u_long flags; - u_char playing; - if (devc->mode == MD_1848) { - ad1848_halt(dev); - return; - } - playing = ad_read(devc, 9); - if (!(playing & 0x2)) - return; - - flags = splhigh(); - - ad_mute(devc); - ad_write(devc, 9, playing & ~0x02); /* Stop capture */ - - outb(io_Status(devc), 0); /* Clear interrupt status */ - outb(io_Status(devc), 0); /* Clear interrupt status */ - - devc->irq_mode &= ~PCM_ENABLE_INPUT; - - splx(flags); -} - -static void -ad1848_halt_output(int dev) -{ - ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; - u_long flags; - u_char playing; - - playing = ad_read(devc, 9); - if (!(playing & 0x1)) { - devc->irq_mode &= ~PCM_ENABLE_OUTPUT; - return; - } - /* IwaveStopDma(PLAYBACK); */ - if (devc->mode == MD_1848) { - ad1848_halt(dev); - return; - } - flags = splhigh(); - /* ad_mute (devc); */ - - ad_write(devc, 9, playing & ~0x1); - outb(io_Status(devc), 0); /* Clear interrupt status */ - /* - * ad_write (devc, 15,0); ad_write (devc, 14,0); - */ - devc->irq_mode &= ~PCM_ENABLE_OUTPUT; - - splx(flags); -} - -static void -ad1848_trigger(int dev, int state) -{ - ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; - u_long flags; - u_char tmp; - - flags = splhigh(); - state &= devc->irq_mode; - - tmp = ad_read(devc, 9) & ~0x03; - if (state & PCM_ENABLE_INPUT) - tmp |= 0x02; - if (state & PCM_ENABLE_OUTPUT) { - tmp |= 0x01; - } - ad_write(devc, 9, tmp); - - splx(flags); -} - - -int -ad1848_detect(int io_base, int *ad_flags, sound_os_info * osp) -{ - static int last_probe_addr=0, last_result=0; /* to avoid multiple probes*/ - int i; - ad1848_info *devc = &dev_info[nr_ad1848_devs]; - u_char tmp, tmp1, tmp2 ; - - DDB(printf("ad1848_detect(%x)\n", io_base)); - if (io_base == last_probe_addr) - return last_result; - else { - last_result = 0; /* default value for detect */ - last_probe_addr = io_base ; - } - - if (ad_flags) - *ad_flags = 0; - - if (nr_ad1848_devs >= MAX_AUDIO_DEV) { - DDB(printf("ad1848 detect error - step 0\n")); - return 0 ; - } - devc->base = io_base; - devc->irq_ok = 0; - devc->timer_running = 0; - devc->MCE_bit = 0x40; - devc->irq = 0; - devc->opened = 0; - devc->chip_name = "AD1848"; - devc->mode = MD_1848; /* AD1848 or CS4248 */ - devc->osp = osp; - - /* - * Check that the I/O address is in use. - * - * The bit 0x80 of the base I/O port is known to be 0 after the chip has - * performed its power on initialization. Just assume this has - * happened before the OS is starting. - * - * If the I/O address is unused, it typically returns 0xff. - */ - - DDB(printf("ad1848_detect() - step A\n")); - - if ((inb(devc->base) & 0x80) != 0x00) { /* Not a AD1848 */ - DDB(printf("ad1848 detect error - step A," - " inb(base) = 0x%02x, want 0XXX.XXXX\n", - inb(devc->base))); - return 0; - } - /* - * Test if it's possible to change contents of the indirect - * registers. Registers 0 and 1 are ADC volume registers. The bit - * 0x10 is read only so try to avoid using it. - */ - - DDB(printf("ad1848_detect() - step B, test indirect register\n")); - - ad_write(devc, 0, 0xaa); - ad_write(devc, 1, 0x45);/* 0x55 with bit 0x10 clear */ - tmp1 = ad_read(devc, 0) ; - tmp2 = ad_read(devc, 1) ; - if ( tmp1 != 0xaa || tmp2 != 0x45) { - DDB(printf("ad1848 detect error - step B (0x%02x/0x%02x) want 0xaa/0x45\n", tmp1, tmp2)); - return 0; - } - DDB(printf("ad1848_detect() - step C\n")); - ad_write(devc, 0, 0x45); - ad_write(devc, 1, 0xaa); - tmp1 = ad_read(devc, 0) ; - tmp2 = ad_read(devc, 1) ; - - if (tmp1 != 0x45 || tmp2 != 0xaa) { - DDB(printf("ad1848 detect error - step C (%x/%x)\n", tmp1, tmp2)); - - return 0; - } - /* - * The indirect register I12 has some read only bits. Lets try to - * change them. - */ - - DDB(printf("ad1848_detect() - step D, last 4 bits of I12 readonly\n")); - tmp = ad_read(devc, 12); - ad_write(devc, 12, (~tmp) & 0x0f); - tmp1 = ad_read(devc, 12); - - if ((tmp & 0x0f) != (tmp1 & 0x0f)) { - DDB(printf("ad1848 detect error - step D, I12 (0x%02x was 0x%02x)\n", - tmp1, tmp)); - return 0; - } - - /* - * NOTE! Last 4 bits of the reg I12 tell the chip revision. - * 0x01=RevB - * 0x0A=RevC. also CS4231/CS4231A and OPTi931 - */ - - - /* - * The original AD1848/CS4248 has just 15 indirect registers. This - * means that I0 and I16 should return the same value (etc.). Ensure - * that the Mode2 enable bit of I12 is 0. Otherwise this test fails - * with CS4231. - */ - - DDB(printf("ad1848_detect() - step F\n")); - ad_write(devc, 12, 0); /* Mode2=disabled */ - - for (i = 0; i < 16; i++) - if ((tmp1 = ad_read(devc, i)) != (tmp2 = ad_read(devc, i + 16))) { - DDB(printf("ad1848 detect warning - step F(I%d/0x%02x/0x%02x)\n", - i, tmp1, tmp2)); - /* - * note - this seems to fail on the 4232 on I11. So we just break - * rather than fail. - */ - break ; /* return 0; */ - } - /* - * Try to switch the chip to mode2 (CS4231) by setting the MODE2 bit - * (0x40). The bit 0x80 is always 1 in CS4248 and CS4231. - * - * On the OPTi931, however, I12 is readonly and only contains the - * chip revision ID (as in the CS4231A). The upper bits return 0. - */ - - DDB(printf("ad1848_detect() - step G\n")); - ad_write(devc, 12, 0x40); /* Set mode2, clear 0x80 */ - - tmp1 = ad_read(devc, 12); - if (tmp1 & 0x80) { - if (ad_flags) - *ad_flags |= AD_F_CS4248; - - devc->chip_name = "CS4248"; /* Our best knowledge just now */ - } - if ((tmp1 & 0xf0) == 0x00) { - printf("this should be an OPTi931\n"); - } else if ((tmp1 & 0xc0) == 0xC0) { - /* - * The 4231 has bit7=1 always, and bit6 we just set to 1. - * We want to check that this is really a CS4231 - * Verify that setting I0 doesn't change I16. - */ - DDB(printf("ad1848_detect() - step H\n")); - ad_write(devc, 16, 0); /* Set I16 to known value */ - - ad_write(devc, 0, 0x45); - if ((tmp1 = ad_read(devc, 16)) != 0x45) { /* No change -> CS4231? */ - - ad_write(devc, 0, 0xaa); - if ((tmp1 = ad_read(devc, 16)) == 0xaa) { /* Rotten bits? */ - DDB(printf("ad1848 detect error - step H(%x)\n", tmp1)); - return 0; - } - /* - * Verify that some bits of I25 are read only. - */ - - DDB(printf("ad1848_detect() - step I\n")); - tmp1 = ad_read(devc, 25); /* Original bits */ - ad_write(devc, 25, ~tmp1); /* Invert all bits */ - if ((ad_read(devc, 25) & 0xe7) == (tmp1 & 0xe7)) { - int id; - - /* - * It's at least CS4231 - */ - devc->chip_name = "CS4231"; - devc->mode = MD_4231; - - /* - * It could be an AD1845 or CS4231A as well. - * CS4231 and AD1845 report the same revision info in I25 - * while the CS4231A reports different. - */ - - DDB(printf("ad1848_detect() - step I\n")); - id = ad_read(devc, 25) & 0xe7; - /* - * b7-b5 = version number; - * 100 : all CS4231 - * 101 : CS4231A - * - * b2-b0 = chip id; - */ - switch (id) { - - case 0xa0: - devc->chip_name = "CS4231A"; - devc->mode = MD_4231A; - break; - - case 0xa2: - devc->chip_name = "CS4232"; - devc->mode = MD_4231A; - break; - - case 0xb2: - /* strange: the 4231 data sheet says b4-b3 are XX - * so this should be the same as 0xa2 - */ - devc->chip_name = "CS4232A"; - devc->mode = MD_4231A; - break; - - case 0x80: - /* - * It must be a CS4231 or AD1845. The register I23 - * of CS4231 is undefined and it appears to be read - * only. AD1845 uses I23 for setting sample rate. - * Assume the chip is AD1845 if I23 is changeable. - */ - - tmp = ad_read(devc, 23); - - ad_write(devc, 23, ~tmp); - if (ad_read(devc, 23) != tmp) { /* AD1845 ? */ - devc->chip_name = "AD1845"; - devc->mode = MD_1845; - } - ad_write(devc, 23, tmp); /* Restore */ - break; - - case 0x83: /* CS4236 */ - case 0x03: /* Mutant CS4236 on Intel PR440fx board */ - devc->chip_name = "CS4236"; - devc->mode = MD_4236; - break; - - default: /* Assume CS4231 */ - printf("unknown id 0x%02x, assuming CS4231\n", id); - devc->mode = MD_4231; - - } - } - ad_write(devc, 25, tmp1); /* Restore bits */ - - DDB(printf("ad1848_detect() - step K\n")); - } - } - DDB(printf("ad1848_detect() - step L\n")); - - if (ad_flags) { - if (devc->mode != MD_1848) - *ad_flags |= AD_F_CS4231; - } - DDB(printf("ad1848_detect() - Detected OK\n")); - return (last_result = 1); -} - -void -ad1848_init(char *name, int io_base, int irq, - int dma_playback, int dma_capture, int share_dma, sound_os_info * osp) -{ - - /* - * NOTE! If irq < 0, there is another driver which has allocated the - * IRQ so that this driver doesn't need to allocate/deallocate it. - * The actually used IRQ is ABS(irq). - */ - - /* - * Initial values for the indirect registers of CS4248/AD1848. - */ - static int init_values[] = { - 0xa8, /* MIXOUTL: src:mic, +20dB, gain +12dB */ - 0xa8, /* MIXOUTR: src:mic, +20dB, gain +12dB */ - 0x08, /* CDL Input: mute, +6dB */ - 0x08, /* CDR Input: mute, +6dB */ - 0x08, /* FML Input: mute, +6dB */ - 0x08, /* FMR Input: mute, +6dB */ - 0x80, /* DAC-L Input: enable, 0dB */ - 0x80, /* DAC-R Input: enable, 0dB */ - /* 0xa8, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, */ - 0x00, /* 8bit, lin, uns, mono, 8KHz */ - 0x0c, /* dma-cap, dma-pb, autocal, single dma, disable cap/pb */ - 0x02, /* int enable */ - 0x00, /* clear error status */ - 0x8a, /* rev. id (low bytes readonly) */ - 0x00, - 0x00, /* playback upper base count */ - 0x00, /* playback lower base count */ - - /* Positions 16 to 31 just for CS4231 and newer devices */ - /* I16-I17: alt. feature enable on the 4231, but AUXL Input - * on the OPTi931 (where the features are set elsewhere - */ - 0x81, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }; - int i, my_dev; - - ad1848_info *devc = &dev_info[nr_ad1848_devs]; - - if (!ad1848_detect(io_base, NULL, osp)) - return; - - devc->irq = (irq > 0) ? irq : 0; - devc->opened = 0; - devc->timer_ticks = 0; - devc->osp = osp; - - if (nr_ad1848_devs != 0) { - bcopy((char *) &ad1848_pcm_operations[0], - (char *) &ad1848_pcm_operations[nr_ad1848_devs], - sizeof(struct audio_operations)); - } - for (i = 0; i < 16; i++) - ad_write(devc, i, init_values[i]); - - ad_mute(devc); /* Initialize some variables */ - ad_unmute(devc); /* Leave it unmuted now */ - - if (devc->mode > MD_1848) { - if (dma_capture == dma_playback || - dma_capture == -1 || dma_playback == -1) { - ad_write(devc, 9, ad_read(devc, 9) | 0x04); /* Single DMA mode */ - ad1848_pcm_operations[nr_ad1848_devs].flags &= ~DMA_DUPLEX; - } else { - ad_write(devc, 9, ad_read(devc, 9) & ~0x04); /* Dual DMA mode */ - ad1848_pcm_operations[nr_ad1848_devs].flags |= DMA_DUPLEX; - } - - ad_write(devc, 12, ad_read(devc, 12) | 0x40); /* Mode2 = enabled */ - for (i = 16; i < 32; i++) - ad_write(devc, i, init_values[i]); - - if (devc->mode == MD_4231A) { - /* Enable full * calibration */ - ad_write(devc, 9, init_values[9] | 0x18); - } - - if (devc->mode == MD_1845) { - /* Alternate freq select enabled */ - ad_write(devc, 27, init_values[27] | 0x08); - } - } else { - ad1848_pcm_operations[nr_ad1848_devs].flags &= ~DMA_DUPLEX; - ad_write(devc, 9, ad_read(devc, 9) | 0x04); /* Single DMA mode */ - } - - outb(io_Status(devc), 0); /* Clear pending interrupts */ - - if (name != NULL && name[0] != 0) - snprintf(ad1848_pcm_operations[nr_ad1848_devs].name, - sizeof(ad1848_pcm_operations[nr_ad1848_devs].name), - "%s (%s)", name, devc->chip_name); - else - snprintf(ad1848_pcm_operations[nr_ad1848_devs].name, - sizeof(ad1848_pcm_operations[nr_ad1848_devs].name), - "Generic audio codec (%s)", devc->chip_name); - - conf_printf2(ad1848_pcm_operations[nr_ad1848_devs].name, - devc->base, devc->irq, dma_playback, dma_capture); - - - /* ad1848_pcm_operations[nr_ad1848_devs].flags |= DMA_AUTOMODE ; */ - - if (num_audiodevs < MAX_AUDIO_DEV) { - audio_devs[my_dev = num_audiodevs++] = - &ad1848_pcm_operations[nr_ad1848_devs]; - if (irq > 0) { - audio_devs[my_dev]->devc = devc; - irq2dev[irq] = my_dev; - if (snd_set_irq_handler(devc->irq, ad1848_interrupt, devc->osp)<0) { - printf("ad1848: IRQ in use\n"); - } -#ifdef NO_IRQ_TEST - if (devc->mode != MD_1848) { - int x; - u_char tmp = ad_read(devc, 16); - - devc->timer_ticks = 0; - - ad_write(devc, 21, 0x00); /* Timer msb */ - ad_write(devc, 20, 0x10); /* Timer lsb */ - - ad_write(devc, 16, tmp | 0x40); /* Enable timer */ - for (x = 0; x < 100000 && devc->timer_ticks == 0; x++); - ad_write(devc, 16, tmp & ~0x40); /* Disable timer */ - - if (devc->timer_ticks == 0) - printf("[IRQ conflict???]"); - else - devc->irq_ok = 1; - - } else - devc->irq_ok = 1; /* Couldn't test. assume it's OK */ -#else - devc->irq_ok = 1; -#endif - } else if (irq < 0) - irq2dev[-irq] = devc->dev_no = my_dev; - - audio_devs[my_dev]->otherside = -1 ; - audio_devs[my_dev]->flags |= DMA_AUTOMODE; - audio_devs[my_dev]->dmachan1 = dma_playback; - audio_devs[my_dev]->dmachan2 = dma_capture; - audio_devs[my_dev]->buffsize = DSP_BUFFSIZE; - audio_devs[my_dev]->devc = devc; - audio_devs[my_dev]->format_mask = ad_format_mask[devc->mode]; - nr_ad1848_devs++; - -#ifdef CONFIG_SEQUENCER - if (devc->mode != MD_1848 && devc->irq_ok) - ad1848_tmr_install(my_dev); -#endif - - /* - * Toggle the MCE bit. It completes the initialization phase. - */ - - ad_enter_MCE(devc); /* In case the bit was off */ - ad_leave_MCE(devc); - - if (num_mixers < MAX_MIXER_DEV) { - mixer2codec[num_mixers] = my_dev + 1; - audio_devs[my_dev]->mixer_dev = num_mixers; - mixer_devs[num_mixers++] = &ad1848_mixer_operations; - ad1848_mixer_reset(devc); - } - } else - printf("AD1848: Too many PCM devices available\n"); -} - -void -ad1848_interrupt(int irq) -{ - u_char status; - ad1848_info *devc; - int dev; - - if (irq < 0 || irq > 15) - dev = -1; - else - dev = irq2dev[irq]; - - if (dev < 0 || dev >= num_audiodevs) { - for (irq = 0; irq < 17; irq++) - if (irq2dev[irq] != -1) - break; - - if (irq > 15) { - printf("ad1848.c: Bogus interrupt %d\n", irq); - return; - } - dev = irq2dev[irq]; - } - devc = (ad1848_info *) audio_devs[dev]->devc; - - status = inb(io_Status(devc)); - - if (status & 0x01) { /* we have an interrupt */ - int alt_stat = 0xff ; - - if (devc->mode != MD_1848) { - /* - * high-end devices have full-duplex dma and timer. - * the exact reason for the interrupt is in reg. I24. - * For old devices, we fake the interrupt bits, and - * determine the real reason basing on the device mode. - */ - alt_stat = ad_read(devc, 24); - if (alt_stat & 0x40) { /* Timer interrupt */ - devc->timer_ticks++; -#ifdef CONFIG_SEQUENCER - if (timer_installed == dev && devc->timer_running) - sound_timer_interrupt(); -#endif - } - } - - outb(io_Status(devc), 0); /* Clear interrupt status */ - - if (audio_devs[dev]->busy) { - - if (devc->irq_mode & PCM_ENABLE_OUTPUT && alt_stat & 0x10) - DMAbuf_outputintr(dev, 1); - - if (devc->irq_mode & PCM_ENABLE_INPUT && alt_stat & 0x20) - DMAbuf_inputintr(dev); - } - } -} - -/* - * Some extra code for the MS Sound System - */ - -#ifdef amancio -void -check_opl3(int base, struct address_info * hw_config) -{ - - if (!opl3_detect(base, hw_config->osp)) - return; - - opl3_init(0, base, hw_config->osp); -} -#endif - -/* - * this is the probe routine. Note, it is not necessary to - * go through this for PnP devices, since they are already - * indentified precisely using their PnP id. - * - */ - -int -probe_mss(struct address_info * hw_config) -{ - u_char tmp; - - DDB(printf("Entered probe_mss(io 0x%x, type %d)\n", - hw_config->io_base, hw_config->card_subtype)); - - if (hw_config->card_subtype == 1) { /* Has no IRQ/DMA registers */ - /* check_opl3(0x388, hw_config); */ - goto probe_ms_end; - } - -#if defined(CONFIG_AEDSP16) && defined(AEDSP16_MSS) - /* - * Initialize Audio Excel DSP 16 to MSS: before any operation we must - * enable MSS I/O ports. - */ - InitAEDSP16_MSS(hw_config); -#endif - - /* - * Check if the IO port returns valid signature. The original MS - * Sound system returns 0x04 while some cards (AudioTriX Pro for - * example) return 0x00 or 0x0f. - */ - - if ((tmp = inb(hw_config->io_base + 3)) == 0xff) { /* Bus float */ - DDB(printf("I/O address inactive (%x), force type 1\n", tmp)); - hw_config->card_subtype = 1 ; - goto probe_ms_end; - } - - if ((tmp & 0x3f) != 0x04 && - (tmp & 0x3f) != 0x0f && - (tmp & 0x3f) != 0x00) { - DDB(printf("No MSS signature detected on port 0x%x (0x%x)\n", - hw_config->io_base, inb(hw_config->io_base + 3))); - return 0; - } - if (hw_config->irq > 11) { - printf("MSS: Bad IRQ %d\n", hw_config->irq); - return 0; - } - if (hw_config->dma != 0 && hw_config->dma != 1 && hw_config->dma != 3) { - printf("MSS: Bad DMA %d\n", hw_config->dma); - return 0; - } - /* - * Check that DMA0 is not in use with a 8 bit board. - */ - - if (hw_config->dma == 0 && inb(hw_config->io_base + 3) & 0x80) { - printf("MSS: Can't use DMA0 with a 8 bit card/slot\n"); - return 0; - } - if (hw_config->irq > 7 && hw_config->irq != 9 && - inb(hw_config->io_base + 3) & 0x80) { - printf("MSS: Can't use IRQ%d with a 8 bit card/slot\n", hw_config->irq); - return 0; - } -probe_ms_end: - return ad1848_detect(hw_config->io_base + 4, NULL, hw_config->osp); -} - -void -attach_mss(struct address_info * hw_config) -{ - -#if 0 - /* - * XXX do we really need to detect it again ? - lr970712 - */ - if (!ad1848_detect(hw_config->io_base + 4, NULL, hw_config->osp)) - return ; -#endif - - if (hw_config->card_subtype == 1) { /* Has no IRQ/DMA registers */ - ad1848_init("MS Sound System1", hw_config->io_base + 4, - hw_config->irq, - hw_config->dma, - hw_config->dma2, 0, hw_config->osp); - } else { - /* - * Set the IRQ and DMA addresses. - */ -#ifdef PC98 - static char interrupt_bits[13] = { - -1, -1, -1, 0x08, -1, 0x10, -1, -1, -1, -1, 0x18, -1, 0x20 - }; -#else - static char interrupt_bits[12] = { - -1, -1, -1, -1, -1, -1, -1, 0x08, -1, 0x10, 0x18, 0x20 - }; -#endif - static char dma_bits[4] = { - 1, 2, 0, 3 - }; - - int config_port = hw_config->io_base + 0; - int version_port = hw_config->io_base + 3; - char bits = interrupt_bits[hw_config->irq]; - - if (bits == -1) - return ; - -#ifndef PC98 - outb(config_port, bits | 0x40); - if ((inb(version_port) & 0x40) == 0) - printf("[IRQ Conflict?]"); -#endif - - /* Write IRQ+DMA setup */ - outb(config_port, bits | dma_bits[hw_config->dma]); - - ad1848_init("MS Sound System0", hw_config->io_base + 4, - hw_config->irq, - hw_config->dma, - hw_config->dma, 0, hw_config->osp); - } - return ; -} - -/* - * WSS compatible PnP codec support. - * XXX I doubt it works now - lr970712 - */ - -int -probe_pnp_ad1848(struct address_info * hw_config) -{ - return ad1848_detect(hw_config->io_base, NULL, hw_config->osp); -} - -void -attach_pnp_ad1848(struct address_info * hw_config) -{ - - ad1848_init(hw_config->name, hw_config->io_base, - hw_config->irq, - hw_config->dma, - hw_config->dma2, 0, hw_config->osp); -} - -#ifdef CONFIG_SEQUENCER -/* - * Timer stuff (for /dev/music). - */ - -static u_int current_interval = 0; - -static u_int -ad1848_tmr_start(int dev, u_int usecs) -{ - u_long flags; - ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; - u_long xtal_nsecs; /* nanoseconds per xtal oscillaror tick */ - u_long divider; - - flags = splhigh(); - - /* - * Length of the timer interval (in nanoseconds) depends on the - * selected crystal oscillator. Check this from bit 0x01 of I8. - * - * AD1845 has just one oscillator which has cycle time of 10.050 us - * (when a 24.576 MHz xtal oscillator is used). - * - * Convert requested interval to nanoseconds before computing the timer - * divider. - */ - - if (devc->mode == MD_1845) - xtal_nsecs = 10050; - else if (ad_read(devc, 8) & 0x01) - xtal_nsecs = 9920; - else - xtal_nsecs = 9969; - - divider = (usecs * 1000 + xtal_nsecs / 2) / xtal_nsecs; - - if (divider < 100) /* Don't allow shorter intervals than about 1ms */ - divider = 100; - - if (divider > 65535) /* Overflow check */ - divider = 65535; - - ad_write(devc, 21, (divider >> 8) & 0xff); /* Set upper bits */ - ad_write(devc, 20, divider & 0xff); /* Set lower bits */ - ad_write(devc, 16, ad_read(devc, 16) | 0x40); /* Start the timer */ - devc->timer_running = 1; - splx(flags); - - return current_interval = (divider * xtal_nsecs + 500) / 1000; -} - -static void -ad1848_tmr_reprogram(int dev) -{ - /* - * Audio driver has changed sampling rate so that a different xtal - * oscillator was selected. We have to reprogram the timer rate. - */ - - ad1848_tmr_start(dev, current_interval); - sound_timer_syncinterval(current_interval); -} - -static void -ad1848_tmr_disable(int dev) -{ - u_long flags; - ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; - - flags = splhigh(); - ad_write(devc, 16, ad_read(devc, 16) & ~0x40); - devc->timer_running = 0; - splx(flags); -} - -static void -ad1848_tmr_restart(int dev) -{ - u_long flags; - ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; - - if (current_interval == 0) - return; - - flags = splhigh(); - ad_write(devc, 16, ad_read(devc, 16) | 0x40); - devc->timer_running = 1; - splx(flags); -} - -static struct sound_lowlev_timer ad1848_tmr = { - 0, - ad1848_tmr_start, - ad1848_tmr_disable, - ad1848_tmr_restart -}; - -static int -ad1848_tmr_install(int dev) -{ - if (timer_installed != -1) - return 0; /* Don't install another timer */ - - timer_installed = ad1848_tmr.dev = dev; - sound_timer_init(&ad1848_tmr, audio_devs[dev]->name); - - return 1; -} -#endif -#endif diff --git a/sys/dev/sound/isa/i386/ad1848_mixer.h b/sys/dev/sound/isa/i386/ad1848_mixer.h deleted file mode 100644 index 7a1d3230ec..0000000000 --- a/sys/dev/sound/isa/i386/ad1848_mixer.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * sound/ad1848_mixer.h - * - * Definitions for the mixer of AD1848 and compatible codecs. - * - * Copyright by Hannu Savolainen 1994 - * - * 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 AUTHOR 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 AUTHOR 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 AD1848 codec has generic input lines called Line, Aux1 and Aux2. - * Soundcard manufacturers have connected actual inputs (CD, synth, line, - * etc) to these inputs in different order. Therefore it's difficult - * to assign mixer channels to to these inputs correctly. The following - * contains two alternative mappings. The first one is for GUS MAX and - * the second is just a generic one (line1, line2 and line3). - * (Actually this is not a mapping but rather some kind of interleaving - * solution). - */ -#define GUSMAX_MIXER -#ifdef GUSMAX_MIXER -#define MODE1_REC_DEVICES (SOUND_MASK_LINE | SOUND_MASK_MIC | \ - SOUND_MASK_CD|SOUND_MASK_IMIX) - -#define MODE1_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_MIC | \ - SOUND_MASK_CD | \ - SOUND_MASK_IGAIN | \ - SOUND_MASK_PCM|SOUND_MASK_IMIX) - -#define MODE2_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_LINE | SOUND_MASK_MIC | \ - SOUND_MASK_CD | SOUND_MASK_SPEAKER | \ - SOUND_MASK_IGAIN | \ - SOUND_MASK_PCM | SOUND_MASK_IMIX) -#else /* Generic mapping */ -#define MODE1_REC_DEVICES (SOUND_MASK_LINE3 | SOUND_MASK_MIC | \ - SOUND_MASK_LINE1|SOUND_MASK_IMIX) - -#define MODE1_MIXER_DEVICES (SOUND_MASK_LINE1 | SOUND_MASK_MIC | \ - SOUND_MASK_LINE2 | \ - SOUND_MASK_IGAIN | \ - SOUND_MASK_PCM | SOUND_MASK_IMIX) - -#define MODE2_MIXER_DEVICES (SOUND_MASK_LINE1 | SOUND_MASK_LINE2 | SOUND_MASK_MIC | \ - SOUND_MASK_LINE3 | SOUND_MASK_SPEAKER | \ - SOUND_MASK_IGAIN | \ - SOUND_MASK_PCM | SOUND_MASK_IMIX) -#endif - -struct mixer_def { - unsigned int regno: 7; - unsigned int polarity:1; /* 0=normal, 1=reversed */ - unsigned int bitpos:4; - unsigned int nbits:4; -}; - -static char mix_cvt[101] = { - 0, 0,3,7,10,13,16,19,21,23,26,28,30,32,34,35,37,39,40,42, - 43,45,46,47,49,50,51,52,53,55,56,57,58,59,60,61,62,63,64,65, - 65,66,67,68,69,70,70,71,72,73,73,74,75,75,76,77,77,78,79,79, - 80,81,81,82,82,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90, - 91,91,92,92,93,93,94,94,95,95,96,96,96,97,97,98,98,98,99,99, - 100 -}; - -typedef struct mixer_def mixer_ent; - -/* - * Most of the mixer entries work in backwards. Setting the polarity field - * makes them to work correctly. - * - * The channel numbering used by individual soundcards is not fixed. Some - * cards have assigned different meanings for the AUX1, AUX2 and LINE inputs. - * The current version doesn't try to compensate this. - */ - -#define MIX_ENT(name, reg_l, pola_l, pos_l, len_l, reg_r, pola_r, pos_r, len_r) \ - {{reg_l, pola_l, pos_l, len_l}, {reg_r, pola_r, pos_r, len_r}} - -mixer_ent mix_devices[32][2] = { /* As used in GUS MAX */ -MIX_ENT(SOUND_MIXER_VOLUME, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_BASS, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_TREBLE, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_SYNTH, 4, 1, 0, 5, 5, 1, 0, 5), -MIX_ENT(SOUND_MIXER_PCM, 6, 1, 0, 6, 7, 1, 0, 6), -MIX_ENT(SOUND_MIXER_SPEAKER, 26, 1, 0, 4, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_LINE, 18, 1, 0, 5, 19, 1, 0, 5), -MIX_ENT(SOUND_MIXER_MIC, 0, 0, 5, 1, 1, 0, 5, 1), -MIX_ENT(SOUND_MIXER_CD, 2, 1, 0, 5, 3, 1, 0, 5), -MIX_ENT(SOUND_MIXER_IMIX, 13, 1, 2, 6, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_ALTPCM, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_RECLEV, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_IGAIN, 0, 0, 0, 4, 1, 0, 0, 4), -MIX_ENT(SOUND_MIXER_OGAIN, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_LINE1, 2, 1, 0, 5, 3, 1, 0, 5), -MIX_ENT(SOUND_MIXER_LINE2, 4, 1, 0, 5, 5, 1, 0, 5), -MIX_ENT(SOUND_MIXER_LINE3, 18, 1, 0, 5, 19, 1, 0, 5) -}; - -static unsigned short default_mixer_levels[SOUND_MIXER_NRDEVICES] = -{ - 0x5a5a, /* Master Volume */ - 0x3232, /* Bass */ - 0x3232, /* Treble */ - 0x4b4b, /* FM */ - 0x4040, /* PCM */ - 0x4b4b, /* PC Speaker */ - /* 0x2020, Ext Line */ - 0x0000, /* Ext Line */ - 0x4040, /* Mic */ - 0x4b4b, /* CD */ - 0x0000, /* Recording monitor */ - 0x4b4b, /* SB PCM */ - 0x4b4b, /* Recording level */ - 0x2525, /* Input gain */ - 0x0000, /* Output gain */ - /* 0x4040, Line1 */ - 0x0000, /* Line1 */ - 0x0000, /* Line2 */ - 0x1515, /* Line3 (usually line in)*/ -}; - -#define LEFT_CHN 0 -#define RIGHT_CHN 1 - diff --git a/sys/dev/sound/isa/i386/adlib_card.c b/sys/dev/sound/isa/i386/adlib_card.c deleted file mode 100644 index f2710f3c8b..0000000000 --- a/sys/dev/sound/isa/i386/adlib_card.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * sound/adlib_card.c - * - * Detection routine for the AdLib card. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/adlib_card.c,v 1.2 2003/08/07 21:17:12 dillon Exp $ - */ - -#include "sound_config.h" - -#if defined(CONFIG_YM3812) - -void -attach_adlib_card(struct address_info * hw_config) -{ - opl3_init(hw_config->io_base, hw_config->osp); -} - -int -probe_adlib(struct address_info * hw_config) -{ - return opl3_detect(hw_config->io_base, hw_config->osp); -} - -#endif diff --git a/sys/dev/sound/isa/i386/css/cs4232.c b/sys/dev/sound/isa/i386/css/cs4232.c deleted file mode 100644 index dadea8c8c2..0000000000 --- a/sys/dev/sound/isa/i386/css/cs4232.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - * sound/cs4232.c - * - * The low level driver for Crystal CS4232 based cards. The CS4232 is a PnP - * compatible chip which contains a CS4231A codec, SB emulation, a MPU401 - * compatible MIDI port, joystick and synthesizer and IDE CD-ROM interfaces. - * This is just a temporary driver until full PnP support gets inplemented. - * Just the WSS codec, FM synth and the MIDI ports are supported. Other - * interfaces are left uninitialized. - * - * Copyright by Hannu Savolainen 1995 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/sound/cs4232.c,v 1.6 2000/01/24 08:16:15 bde Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/css/Attic/cs4232.c,v 1.2 2003/06/17 04:28:38 dillon Exp $ - */ - -#include - -#if defined(CONFIG_CS4232) - -#define KEY_PORT 0x279 /* Same as LPT1 status port */ -#define CSN_NUM 0x99 /* Just a random number */ - -#define CS_OUT(a) outb( KEY_PORT, a) -#define CS_OUT2(a, b) {CS_OUT(a);CS_OUT(b);} -#define CS_OUT3(a, b, c) {CS_OUT(a);CS_OUT(b);CS_OUT(c);} - -static int mpu_base = 0, mpu_irq = 0; - -int -probe_cs4232_mpu(struct address_info * hw_config) -{ - /* - * Just write down the config values. - */ - - mpu_base = hw_config->io_base; - mpu_irq = hw_config->irq; - return 0; -} - -void -attach_cs4232_mpu(struct address_info * hw_config) -{ -} - -static unsigned char crystal_key[] = /* A 32 byte magic key sequence */ -{ - 0x96, 0x35, 0x9a, 0xcd, 0xe6, 0xf3, 0x79, 0xbc, - 0x5e, 0xaf, 0x57, 0x2b, 0x15, 0x8a, 0xc5, 0xe2, - 0xf1, 0xf8, 0x7c, 0x3e, 0x9f, 0x4f, 0x27, 0x13, - 0x09, 0x84, 0x42, 0xa1, 0xd0, 0x68, 0x34, 0x1a -}; - -int -probe_cs4232(struct address_info * hw_config) -{ - int i; - int base = hw_config->io_base, irq = hw_config->irq; - int dma1 = hw_config->dma, dma2 = hw_config->dma2; - - /* - * Verify that the I/O port range is free. - */ - - if (0) { - printf("cs4232.c: I/O port 0x%03x not free\n", base); - return 0; - } - /* - * This version of the driver doesn't use the PnP method when - * configuring the card but a simplified method defined by Crystal. - * This means that just one CS4232 compatible device can exist on the - * system. Also this method conflicts with possible PnP support in - * the OS. For this reason driver is just a temporary kludge. - */ - - /* - * Wake up the card by sending a 32 byte Crystal key to the key port. - */ - for (i = 0; i < 32; i++) - CS_OUT(crystal_key[i]); - - /* - * Now set the CSN (Card Select Number). - */ - - CS_OUT2(0x06, CSN_NUM); - - /* - * Ensure that there is no other codec using the same address. - */ - - CS_OUT2(0x15, 0x00); /* Select logical device 0 (WSS/SB/FM) */ - CS_OUT2(0x33, 0x00); /* Inactivate logical dev 0 */ - - /* - * Then set some config bytes. First logical device 0 - */ - - CS_OUT2(0x15, 0x00); /* Select logical device 0 (WSS/SB/FM) */ - CS_OUT3(0x47, (base >> 8) & 0xff, base & 0xff); /* WSSbase */ - - if (0) /* Not free */ - CS_OUT3(0x48, 0x00, 0x00) /* FMbase off */ - else - CS_OUT3(0x48, 0x03, 0x88); /* FMbase 0x388 */ - - CS_OUT3(0x42, 0x00, 0x00); /* SBbase off */ - CS_OUT2(0x22, irq); /* SB+WSS IRQ */ - CS_OUT2(0x2a, dma1); /* SB+WSS DMA */ - - if (dma2 != -1) - CS_OUT2(0x25, dma2) /* WSS DMA2 */ - else - CS_OUT2(0x25, 4); /* No WSS DMA2 */ - - CS_OUT2(0x33, 0x01); /* Activate logical dev 0 */ - - /* - * Initialize logical device 3 (MPU) - */ - -#if (defined(CONFIG_MPU401) || defined(CONFIG_MPU_EMU)) && defined(CONFIG_MIDI) - if (mpu_base != 0 && mpu_irq != 0) { - CS_OUT2(0x15, 0x03); /* Select logical device 3 (MPU) */ - CS_OUT3(0x47, (mpu_base >> 8) & 0xff, mpu_base & 0xff); /* MPUbase */ - CS_OUT2(0x22, mpu_irq); /* MPU IRQ */ - CS_OUT2(0x33, 0x01); /* Activate logical dev 3 */ - } -#endif - - /* - * Finally activate the chip - */ - CS_OUT(0x79); - - /* - * Then try to detect the codec part of the chip - */ - - return ad1848_detect(hw_config->io_base, NULL, hw_config->osp); -} - -void -attach_cs4232(struct address_info * hw_config) -{ - int base = hw_config->io_base, irq = hw_config->irq; - int dma1 = hw_config->dma, dma2 = hw_config->dma2; - - if (dma2 == -1) - dma2 = dma1; - - ad1848_init("CS4232", base, - irq, - dma1, /* Playback DMA */ - dma2, /* Capture DMA */ - 0, - hw_config->osp); - -#if (defined(CONFIG_MPU401) || defined(CONFIG_MPU_EMU)) && defined(CONFIG_MIDI) - if (mpu_base != 0 && mpu_irq != 0) { - static struct address_info hw_config2 = - {0}; /* Ensure it's initialized */ - - hw_config2.io_base = mpu_base; - hw_config2.irq = mpu_irq; - hw_config2.dma = -1; - hw_config2.dma2 = -1; - hw_config2.always_detect = 0; - hw_config2.name = NULL; - hw_config2.card_subtype = 0; - hw_config2.osp = hw_config->osp; - - if (probe_mpu401(&hw_config2)) - attach_mpu401(&hw_config2); - else - mpu_base = mpu_irq = 0; - } -#endif -} - -#endif diff --git a/sys/dev/sound/isa/i386/dev_table.c b/sys/dev/sound/isa/i386/dev_table.c deleted file mode 100644 index cfa21c7326..0000000000 --- a/sys/dev/sound/isa/i386/dev_table.c +++ /dev/null @@ -1,260 +0,0 @@ -/* - * sound/dev_table.c - * - * Device call tables. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/sound/dev_table.c,v 1.18 1999/12/20 18:04:59 eivind Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/dev_table.c,v 1.3 2003/08/07 21:17:12 dillon Exp $ - */ - -#define _DEV_TABLE_C_ -#include "sound_config.h" - -#if NSND > 0 - -int sound_started = 0; - -int sndtable_get_cardcount(void); -int snd_find_driver(int type); -static void sndtable_init(void); -int sndtable_probe(int unit, struct address_info * hw_config); -int sndtable_init_card(int unit, struct address_info * hw_config); -static void start_services(void); -static void start_cards(void); -struct address_info *sound_getconf(int card_type); - -int -snd_find_driver(int type) -{ - int i, n = num_sound_drivers; - - for (i = 0; i < n; i++) - if (sound_drivers[i].card_type == type) - return i; - - return -1; -} - -static void -start_services() -{ - int soundcards_installed; - - if (!(soundcards_installed = sndtable_get_cardcount())) - return ; /* No cards detected */ - -#ifdef CONFIG_AUDIO - if (num_audiodevs) /* Audio devices present */ - DMAbuf_init(); -#endif - -#ifdef CONFIG_MIDI - if (num_midis) - /* MIDIbuf_init(0) */; -#endif - -#ifdef CONFIG_SEQUENCER - if (num_midis + num_synths) - sequencer_init(); -#endif -} - -static void -start_cards() -{ - int drv, i, n = num_sound_cards; - struct card_info *ci = snd_installed_cards ; - - sound_started = 1; - if (trace_init) - printf("Sound initialization started\n"); - - /* - * Check the number of cards actually defined in the table - */ - - for (i = 0; i < n && snd_installed_cards[i].card_type; i++) - num_sound_cards = i + 1; - - for (i = 0; i < n && ci->card_type; ci++, i++) - if (ci->enabled) { - if ((drv = snd_find_driver(ci->card_type)) == -1) { - ci->enabled = 0; /* Mark as not detected */ - continue; - } - ci->config.card_subtype = sound_drivers[drv].card_subtype; - - if (sound_drivers[drv].probe(&(ci->config))) - sound_drivers[drv].attach(&(ci->config)); - else - ci->enabled = 0; /* Mark as not detected */ - } - if (trace_init) - printf("Sound initialization complete\n"); -} - -static void -sndtable_init() -{ - start_cards(); -} - -/* - * sndtable_probe probes a specific device. unit is the voxware unit number. - */ - -int -sndtable_probe(int unit, struct address_info * hw_config) -{ - int i, sel = -1, n = num_sound_cards; - struct card_info *ci = snd_installed_cards ; - - DDB(printf("-- sndtable_probe(%d)\n", unit)); - - - /* - * for some reason unit 0 always succeeds ? - */ - if (!unit) - return TRUE; - - sound_started = 1; - - for (i=0; icard_type; ci++, i++) - if ( (ci->enabled) && (ci->card_type == unit) ) { - /* DDB(printf("-- found card %d\n", i) ); */ - sel = i; /* and break */ - } - - /* - * not found. Creates a new entry in the table for this unit. - */ - if (sel == -1 && num_sound_cards < max_sound_cards) { - int i; - - i = sel = (num_sound_cards++); - DDB(printf("-- installing card %d\n", i) ); - - ci = &snd_installed_cards[sel] ; - ci->card_type = unit; - ci->enabled = 1; - } - /* DDB(printf("-- installed card %d\n", sel) ); */ - if (sel != -1) { - int drv; - - ci->config.io_base = hw_config->io_base; - ci->config.irq = hw_config->irq; - ci->config.dma = hw_config->dma; - ci->config.dma2 = hw_config->dma2; - ci->config.name = hw_config->name; - ci->config.always_detect = hw_config->always_detect; - ci->config.card_subtype = hw_config->card_subtype; - ci->config.osp = hw_config->osp; - - if ((drv = snd_find_driver(ci->card_type)) == -1) { - ci->enabled = 0; - DDB(printf("Failed to find driver\n")); - return FALSE; - } - DDB(printf("-- Driver name '%s' probe 0x%08x\n", - sound_drivers[drv].name, sound_drivers[drv].probe)); - - hw_config->card_subtype = - ci->config.card_subtype = sound_drivers[drv].card_subtype; - - if (sound_drivers[drv].probe(hw_config)) { - DDB(printf("-- Hardware probed OK\n")); - return TRUE; - } - DDB(printf("-- Failed to find hardware\n")); - ci->enabled = 0; /* mark as not detected */ - return FALSE; - } - return FALSE; -} - -int -sndtable_init_card(int unit, struct address_info * hw_config) -{ - int i, n = num_sound_cards; - struct card_info *ci = snd_installed_cards ; - - DDB(printf("sndtable_init_card(%d) entered\n", unit)); - - if (!unit) { - sndtable_init() ; - return TRUE; - } - for (i = 0; i < n && ci->card_type; ci++, i++) - if (ci->card_type == unit) { - int drv; - - ci->config.io_base = hw_config->io_base; - ci->config.irq = hw_config->irq; - ci->config.dma = hw_config->dma; - ci->config.dma2 = hw_config->dma2; - ci->config.name = hw_config->name; - ci->config.always_detect = hw_config->always_detect; - ci->config.card_subtype = hw_config->card_subtype; - ci->config.osp = hw_config->osp; - - if ((drv = snd_find_driver(ci->card_type)) == -1) - ci->enabled = 0; /* Mark not fnd */ - else { - DDB(printf("Located card - calling attach routine\n")); - sound_drivers[drv].attach(hw_config) ; - DDB(printf("attach routine finished\n")); - } - start_services(); - return TRUE; - } - DDB(printf("sndtable_init_card: No card defined with type=%d, num cards: %d\n", - unit, num_sound_cards)); - return FALSE; -} - -int -sndtable_get_cardcount(void) -{ - return num_audiodevs + num_mixers + num_synths + num_midis; -} - -struct address_info * -sound_getconf(int card_type) -{ - int j, ptr = -1, n = num_sound_cards; - - for (j = 0; j < n && ptr == -1 && snd_installed_cards[j].card_type; j++) - if (snd_installed_cards[j].card_type == card_type) - ptr = j; - - if (ptr == -1) - return (struct address_info *) NULL; - - return &snd_installed_cards[ptr].config; -} - -#endif diff --git a/sys/dev/sound/isa/i386/dev_table.h b/sys/dev/sound/isa/i386/dev_table.h deleted file mode 100644 index 28fc5adcff..0000000000 --- a/sys/dev/sound/isa/i386/dev_table.h +++ /dev/null @@ -1,601 +0,0 @@ -/* - * dev_table.h - * - * Global definitions for device call tables - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/dev_table.h,v 1.2 2005/01/31 23:44:35 joerg Exp $ - */ - -#ifndef _DEV_TABLE_H_ -#define _DEV_TABLE_H_ - -/* - * NOTE! NOTE! NOTE! NOTE! - * - * If you modify this file, please check the dev_table.c also. - * - * NOTE! NOTE! NOTE! NOTE! - */ - -extern int sound_started; - -struct driver_info { - char *driver_id; - int card_subtype; /* Driver specific. Usually 0 */ - int card_type; /* From soundcard.h */ - char *name; - void (*attach) (struct address_info * hw_config); - int (*probe) (struct address_info * hw_config); -}; - -struct card_info { - int card_type; /* Link (search key) to the driver list */ - struct address_info config; - int enabled; -}; - -typedef struct pnp_sounddev { - int id; - void (*setup) (void *dev); - char *driver_name; -} pnp_sounddev; - -/* - * Device specific parameters (used only by dmabuf.c) - */ -#define MAX_SUB_BUFFERS (32*MAX_REALTIME_FACTOR) - -#define DMODE_NONE 0 -#define DMODE_OUTPUT 1 -#define DMODE_INPUT 2 - -struct dma_buffparms { - int dma_mode; /* DMODE_INPUT, DMODE_OUTPUT or DMODE_NONE */ - - char *raw_buf; /* Pointers to raw buffers */ - u_long raw_buf_phys; - - /* - * Device state tables - */ - - u_long flags; -#define DMA_BUSY 0x00000001 -#define DMA_RESTART 0x00000002 -#define DMA_ACTIVE 0x00000004 -#define DMA_STARTED 0x00000008 -#define DMA_ALLOC_DONE 0x00000020 - - int open_mode; - - /* - * Queue parameters. - */ - int qlen; - int qhead; - int qtail; - - int nbufs; - int counts[MAX_SUB_BUFFERS]; - int subdivision; - - int fragment_size; - int max_fragments; - - int bytes_in_use; - - int underrun_count; - int byte_counter; - - int mapping_flags; -#define DMA_MAP_MAPPED 0x00000001 - char neutral_byte; - int dma_chan; -}; - -/* - * Structure for use with various microcontrollers and DSP processors in the - * recent soundcards. - */ -typedef struct coproc_operations { - char name[32]; - int (*open) (void *devc, int sub_device); - void (*close) (void *devc, int sub_device); - int (*ioctl) (void *devc, u_int cmd, ioctl_arg arg, int local); - void (*reset) (void *devc); - - void *devc; /* Driver specific info */ -} coproc_operations; - -struct audio_operations { - char name[32]; - int flags; -#define NOTHING_SPECIAL 0 -#define NEEDS_RESTART 1 -#define DMA_AUTOMODE 2 -#define DMA_DUPLEX 4 -#define DMA_DISABLE 8 - int format_mask; /* Bitmask for supported audio formats */ - void *devc; /* Driver specific info */ - int (*open) (int dev, int mode); - void (*close) (int dev); - void (*output_block) (int dev, unsigned long buf, - int count, int intrflag, int dma_restart); - void (*start_input) (int dev, unsigned long buf, - int count, int intrflag, int dma_restart); - int (*ioctl) (int dev, u_int cmd, ioctl_arg arg, int local); - int (*prepare_for_input) (int dev, int bufsize, int nbufs); - int (*prepare_for_output) (int dev, int bufsize, int nbufs); - void (*reset) (int dev); - void (*halt_xfer) (int dev); - int (*local_qlen) (int dev); - void (*copy_from_user) (int dev, char *localbuf, int localoffs, - snd_rw_buf * userbuf, int useroffs, int len); - void (*halt_input) (int dev); - void (*halt_output) (int dev); - void (*trigger) (int dev, int bits); - long buffsize; - int dmachan1, dmachan2; - struct dma_buffparms *dmap_in, *dmap_out; - struct coproc_operations *coproc; - int mixer_dev; - int enable_bits; - int open_mode; - int go; - int otherside; - int busy; -}; - -struct mixer_operations { - char name[32]; - int (*ioctl) (int dev, unsigned int cmd, ioctl_arg arg); -}; - -struct synth_operations { - struct synth_info *info; - int midi_dev; - int synth_type; - int synth_subtype; - - int (*open) (int dev, int mode); - void (*close) (int dev); - int (*ioctl) (int dev, unsigned int cmd, ioctl_arg arg); - int (*kill_note) (int dev, int voice, int note, int velocity); - int (*start_note) (int dev, int voice, int note, int velocity); - int (*set_instr) (int dev, int voice, int instr); - void (*reset) (int dev); - void (*hw_control) (int dev, unsigned char *event); - int (*load_patch) (int dev, int format, snd_rw_buf * addr, - int offs, int count, int pmgr_flag); - void (*aftertouch) (int dev, int voice, int pressure); - void (*controller) (int dev, int voice, int ctrl_num, int value); - void (*panning) (int dev, int voice, int value); - void (*volume_method) (int dev, int mode); - int (*pmgr_interface) (int dev, struct patmgr_info * info); - void (*bender) (int dev, int chn, int value); - int (*alloc_voice) (int dev, int chn, int note, struct voice_alloc_info * alloc); - void (*setup_voice) (int dev, int voice, int chn); - int (*send_sysex) (int dev, unsigned char *bytes, int len); - - struct voice_alloc_info alloc; - struct channel_info chn_info[16]; -}; - -struct midi_input_info { /* MIDI input scanner variables */ -#define MI_MAX 10 - int m_busy; - unsigned char m_buf[MI_MAX]; - unsigned char m_prev_status; /* For running status */ - int m_ptr; -#define MST_INIT 0 -#define MST_DATA 1 -#define MST_SYSEX 2 - int m_state; - int m_left; -}; - -struct midi_operations { - struct midi_info info; - struct synth_operations *converter; - struct midi_input_info in_info; - int (*open) (int dev, int mode, - void (*inputintr) (int dev, unsigned char data), - void (*outputintr) (int dev) ); - void (*close) (int dev); - int (*ioctl) (int dev, unsigned int cmd, ioctl_arg arg); - int (*putc) (int dev, unsigned char data); - int (*start_read) (int dev); - int (*end_read) (int dev); - void (*kick) (int dev); - int (*command) (int dev, unsigned char *data); - int (*buffer_status) (int dev); - int (*prefix_cmd) (int dev, unsigned char status); - struct coproc_operations *coproc; -}; - -struct sound_lowlev_timer { - int dev; - u_int (*tmr_start) (int dev, unsigned int usecs); - void (*tmr_disable) (int dev); - void (*tmr_restart) (int dev); -}; - -struct sound_timer_operations { - struct sound_timer_info info; - int priority; - int devlink; - int (*open) (int dev, int mode); - void (*close) (int dev); - int (*event) (int dev, unsigned char *ev); - u_long (*get_time) (int dev); - int (*ioctl) (int dev, unsigned int cmd, ioctl_arg arg); - void (*arm_timer) (int dev, long time); -}; - -#ifdef _DEV_TABLE_C_ -struct audio_operations *audio_devs[MAX_AUDIO_DEV] = {NULL}; -int num_audiodevs = 0; -struct mixer_operations *mixer_devs[MAX_MIXER_DEV] = {NULL}; -int num_mixers = 0; -struct synth_operations *synth_devs[MAX_SYNTH_DEV + MAX_MIDI_DEV] = {NULL}; -int num_synths = 0; -struct midi_operations *midi_devs[MAX_MIDI_DEV] = {NULL}; -int num_midis = 0; - -#ifdef CONFIG_SEQUENCER -extern struct sound_timer_operations default_sound_timer; -struct sound_timer_operations *sound_timer_devs[MAX_TIMER_DEV] = - {&default_sound_timer, NULL}; -int num_sound_timers = 1; -#else -struct sound_timer_operations *sound_timer_devs[MAX_TIMER_DEV] = {NULL}; -int num_sound_timers = 0; -#endif - -/* - * List of low level drivers compiled into the kernel. - * - * remember, each entry contains: - - char *driver_id; - int card_subtype; (Driver specific. Usually 0) - int card_type; (From soundcard.h) - char *name; - void (*attach) (struct address_info * hw_config); - int (*probe) (struct address_info * hw_config); - * - */ - -struct driver_info sound_drivers[] = { - -#ifdef CONFIG_PSS - {"PSSECHO", 0, SNDCARD_PSS, "Echo Personal Sound System PSS (ESC614)", - attach_pss, probe_pss}, - {"PSSMPU", 0, SNDCARD_PSS_MPU, "PSS-MPU", - attach_pss_mpu, probe_pss_mpu}, - {"PSSMSS", 0, SNDCARD_PSS_MSS, "PSS-MSS", - attach_pss_mss, probe_pss_mss}, -#endif - -#ifdef CONFIG_MSS - /* XXX changed type from 0 to 1 -lr 970705 */ - {"MSS", 1, SNDCARD_MSS, "MS Sound System", - attach_mss, probe_mss}, - /* MSS without IRQ/DMA config registers (for DEC Alphas) */ - {"PCXBJ", 1, SNDCARD_PSEUDO_MSS, "MS Sound System (AXP)", - attach_mss, probe_mss}, -#endif - -#ifdef CONFIG_MAD16 - {"MAD16", 0, SNDCARD_MAD16, "MAD16/Mozart (MSS)", - attach_mad16, probe_mad16}, - {"MAD16MPU", 0, SNDCARD_MAD16_MPU, "MAD16/Mozart (MPU)", - attach_mad16_mpu, probe_mad16_mpu}, -#endif - -#ifdef CONFIG_CS4232 - {"CS4232", 0, SNDCARD_CS4232, "CS4232", - attach_cs4232, probe_cs4232}, - {"CS4232MPU", 0, SNDCARD_CS4232_MPU, "CS4232 MIDI", - attach_cs4232_mpu, probe_cs4232_mpu}, -#endif - -#ifdef CONFIG_YM3812 - {"OPL3", 0, SNDCARD_ADLIB, "OPL-2/OPL-3 FM", - attach_adlib_card, probe_adlib}, -#endif - -#ifdef CONFIG_PAS - {"PAS16", 0, SNDCARD_PAS, "ProAudioSpectrum", - attach_pas_card, probe_pas}, -#endif - -#if defined(CONFIG_MPU401) && defined(CONFIG_MIDI) - {"MPU401", 0, SNDCARD_MPU401, "Roland MPU-401", - attach_mpu401, probe_mpu401}, -#endif - -#if defined(CONFIG_MAUI) - {"MAUI", 0, SNDCARD_MAUI, "TB Maui", - attach_maui, probe_maui}, -#endif - -#if defined(CONFIG_UART6850) && defined(CONFIG_MIDI) - {"MIDI6850", 0, SNDCARD_UART6850, "6860 UART Midi", - attach_uart6850, probe_uart6850}, -#endif - -#ifdef CONFIG_SB - {"SBLAST", 0, SNDCARD_SB, "SoundBlaster", - attach_sb_card, probe_sb}, -#endif - -#if defined(CONFIG_SB) && defined(CONFIG_SB16) -#ifdef CONFIG_AUDIO - {"SB16", 0, SNDCARD_SB16, "SoundBlaster16", - sb16_dsp_init, sb16_dsp_detect}, -#endif -#ifdef CONFIG_MIDI - {"SB16MIDI", 0, SNDCARD_SB16MIDI, "SB16 MIDI", - attach_sb16midi, probe_sb16midi}, -#endif -#endif - -#ifdef CONFIG_GUS16 - {"GUS16", 0, SNDCARD_GUS16, "Ultrasound 16-bit opt.", - attach_gus_db16, probe_gus_db16}, -#endif - -#ifdef CONFIG_GUS - {"GUS", 0, SNDCARD_GUS, "Gravis Ultrasound", - attach_gus_card, probe_gus}, -#endif - -#ifdef CONFIG_SSCAPE - {"SSCAPE", 0, SNDCARD_SSCAPE, "Ensoniq Soundscape", - attach_sscape, probe_sscape}, - {"SSCAPEMSS", 0, SNDCARD_SSCAPE_MSS, "MS Sound System (SoundScape)", - attach_ss_mss, probe_ss_mss}, -#endif - -#if NTRIX > 0 - {"TRXPRO", 0, SNDCARD_TRXPRO, "MediaTriX AudioTriX Pro", - attach_trix_wss, probe_trix_wss}, - {"TRXPROSB", 0, SNDCARD_TRXPRO_SB, "AudioTriX (SB mode)", - attach_trix_sb, probe_trix_sb}, - {"TRXPROMPU", 0, SNDCARD_TRXPRO_MPU, "AudioTriX MIDI", - attach_trix_mpu, probe_trix_mpu}, -#endif - -#ifdef CONFIG_PNP - {"AD1848", 0, 500, "PnP MSS", - attach_pnp_ad1848, probe_pnp_ad1848}, -#endif - -#ifdef CONFIG_NSS - {"NSS", 0, SNDCARD_NSS, "NEC PC-9801-86 Sound System", - attach_nss, probe_nss}, -#endif - - {NULL, 0, 0, "*?*", NULL, NULL} -}; - -int num_sound_drivers = -sizeof(sound_drivers) / sizeof(struct driver_info); -int max_sound_drivers = -sizeof(sound_drivers) / sizeof(struct driver_info); - -#define FULL_SOUND - -#ifndef FULL_SOUND -/* - * List of devices actually configured in the system. - * - * Note! The detection order is significant. Don't change it. - * - * remember, the list contains - * - * int card_type; (Link (search key) to the driver list) - * struct address_info config; - * io_base, irq, dma, dma2, - * always_detect, char *name, struct... *osp - * int enabled; - * void *for_driver_use; - * - */ - -struct card_info snd_installed_cards[] = { -#ifdef CONFIG_PSS - {SNDCARD_PSS, {PSS_BASE, 0, -1, -1}, SND_DEFAULT_ENABLE}, -#ifdef PSS_MPU_BASE - {SNDCARD_PSS_MPU, {PSS_MPU_BASE, PSS_MPU_IRQ, 0, -1}, SND_DEFAULT_ENABLE}, -#endif -#ifdef PSS_MSS_BASE - {SNDCARD_PSS_MSS, {PSS_MSS_BASE, PSS_MSS_IRQ, PSS_MSS_DMA, -1}, SND_DEFAULT_ENABLE}, -#endif -#endif /* config PSS */ - -#if NTRIX > 0 - {SNDCARD_TRXPRO, {TRIX_BASE, TRIX_IRQ, TRIX_DMA, TRIX_DMA2}, SND_DEFAULT_ENABLE}, -#ifdef TRIX_SB_BASE - {SNDCARD_TRXPRO_SB, {TRIX_SB_BASE, TRIX_SB_IRQ, TRIX_SB_DMA, -1}, SND_DEFAULT_ENABLE}, -#endif -#ifdef TRIX_MPU_BASE - {SNDCARD_TRXPRO_MPU, {TRIX_MPU_BASE, TRIX_MPU_IRQ, 0, -1}, SND_DEFAULT_ENABLE}, -#endif -#endif /* NTRIX > 0 */ - -#ifdef CONFIG_SSCAPE - {SNDCARD_SSCAPE, {SSCAPE_BASE, SSCAPE_IRQ, SSCAPE_DMA, -1}, SND_DEFAULT_ENABLE}, - {SNDCARD_SSCAPE_MSS, {SSCAPE_MSS_BASE, SSCAPE_MSS_IRQ, SSCAPE_MSS_DMA, -1}, SND_DEFAULT_ENABLE}, -#endif - -#ifdef CONFIG_MAD16 - {SNDCARD_MAD16, {MAD16_BASE, MAD16_IRQ, MAD16_DMA, MAD16_DMA2}, SND_DEFAULT_ENABLE}, -#ifdef MAD16_MPU_BASE - {SNDCARD_MAD16_MPU, {MAD16_MPU_BASE, MAD16_MPU_IRQ, 0, -1}, SND_DEFAULT_ENABLE}, -#endif -#endif /* CONFIG_MAD16 */ - -#ifdef CONFIG_CS4232 -#ifdef CS4232_MPU_BASE - {SNDCARD_CS4232_MPU, {CS4232_MPU_BASE, CS4232_MPU_IRQ, 0, -1}, SND_DEFAULT_ENABLE}, -#endif - {SNDCARD_CS4232, {CS4232_BASE, CS4232_IRQ, CS4232_DMA, CS4232_DMA2}, SND_DEFAULT_ENABLE}, -#endif - -#ifdef CONFIG_MSS -#ifdef PSEUDO_MSS - {SNDCARD_MSS, {MSS_BASE, MSS_IRQ, MSS_DMA, -1}, SND_DEFAULT_ENABLE}, -#else - {SNDCARD_PSEUDO_MSS, {MSS_BASE, MSS_IRQ, MSS_DMA, -1}, SND_DEFAULT_ENABLE}, -#endif -#ifdef MSS2_BASE - {SNDCARD_MSS, {MSS2_BASE, MSS2_IRQ, MSS2_DMA, -1}, SND_DEFAULT_ENABLE}, -#endif -#endif /* CONFIG_MSS */ - -#ifdef CONFIG_PAS - {SNDCARD_PAS, {PAS_BASE, PAS_IRQ, PAS_DMA, -1}, SND_DEFAULT_ENABLE}, -#endif - -#ifdef CONFIG_SB -#ifndef SBC_DMA -#define SBC_DMA 1 -#endif - {SNDCARD_SB, {SBC_BASE, SBC_IRQ, SBC_DMA, -1}, SND_DEFAULT_ENABLE}, -#endif - -#if defined(CONFIG_MAUI) - {SNDCARD_MAUI, {MAUI_BASE, MAUI_IRQ, 0, -1}, SND_DEFAULT_ENABLE}, -#endif - -#if defined(CONFIG_MPU401) && defined(CONFIG_MIDI) - {SNDCARD_MPU401, {MPU_BASE, MPU_IRQ, 0, -1}, SND_DEFAULT_ENABLE}, -#ifdef MPU2_BASE - {SNDCARD_MPU401, {MPU2_BASE, MPU2_IRQ, 0, -1}, SND_DEFAULT_ENABLE}, -#endif -#ifdef MPU3_BASE - {SNDCARD_MPU401, {MPU3_BASE, MPU2_IRQ, 0, -1}, SND_DEFAULT_ENABLE}, -#endif -#endif - -#if defined(CONFIG_UART6850) && defined(CONFIG_MIDI) - {SNDCARD_UART6850, {U6850_BASE, U6850_IRQ, 0, -1}, SND_DEFAULT_ENABLE}, -#endif - -#if defined(CONFIG_SB) && defined(CONFIG_SB16) -#ifdef CONFIG_AUDIO - {SNDCARD_SB16, {SBC_BASE, SBC_IRQ, SB16_DMA, -1}, SND_DEFAULT_ENABLE}, -#endif -#ifdef CONFIG_MIDI - {SNDCARD_SB16MIDI, {SB16MIDI_BASE, SBC_IRQ, 0, -1}, SND_DEFAULT_ENABLE}, -#endif -#ifdef CONFIG_AWE32 - {SNDCARD_AWE32,{AWE32_BASE, 0, 0, -1}, SND_DEFAULT_ENABLE}, -#endif -#endif - -#ifdef CONFIG_GUS -#ifdef CONFIG_GUS16 - {SNDCARD_GUS16, {GUS16_BASE, GUS16_IRQ, GUS16_DMA, -1}, SND_DEFAULT_ENABLE}, -#endif - {SNDCARD_GUS, {GUS_BASE, GUS_IRQ, GUS_DMA, GUS_DMA2}, SND_DEFAULT_ENABLE}, -#endif - -#ifdef CONFIG_YM3812 - {SNDCARD_ADLIB, {FM_MONO, 0, 0, -1}, SND_DEFAULT_ENABLE}, -#endif - -#ifdef CONFIG_NSS - {SNDCARD_NSS, {NSS_BASE, NSS_IRQ, 0, -1}, SND_DEFAULT_ENABLE}, -#endif - /* Define some expansion space */ - {0, {0}, 0}, - {0, {0}, 0}, - {0, {0}, 0}, - {0, {0}, 0}, - {0, {0}, 0} -}; - -int num_sound_cards = sizeof(snd_installed_cards) / sizeof(struct card_info); -int max_sound_cards = sizeof(snd_installed_cards) / sizeof(struct card_info); - -#else -int num_sound_cards = 0; -struct card_info snd_installed_cards[20] = {{0}}; -int max_sound_cards = 20; -#endif - -#ifdef MODULE -int trace_init = 0; -#else -int trace_init = 1; -#endif - -#else -extern struct audio_operations *audio_devs[MAX_AUDIO_DEV]; -extern int num_audiodevs; -extern struct mixer_operations *mixer_devs[MAX_MIXER_DEV]; -extern int num_mixers; -extern struct synth_operations *synth_devs[MAX_SYNTH_DEV + MAX_MIDI_DEV]; -extern int num_synths; -extern struct midi_operations *midi_devs[MAX_MIDI_DEV]; -extern int num_midis; -extern struct sound_timer_operations *sound_timer_devs[MAX_TIMER_DEV]; -extern int num_sound_timers; - -extern struct driver_info sound_drivers[]; -extern int num_sound_drivers; -extern int max_sound_drivers; -extern struct card_info snd_installed_cards[]; -extern int num_sound_cards; -extern int max_sound_cards; - -extern int trace_init; - -void sndtable_init(void); -int sndtable_get_cardcount(void); -struct address_info *sound_getconf(int card_type); -void sound_chconf(int card_type, int ioaddr, int irq, int dma); -int snd_find_driver(int type); -int sndtable_identify_card(char *name); -void sound_setup(char *str, int *ints); - -int sound_alloc_dmap(int dev, struct dma_buffparms * dmap, int chan); -void sound_free_dmap(int dev, struct dma_buffparms * dmap); -extern int soud_map_buffer(int dev, struct dma_buffparms * dmap, buffmem_desc * info); -void install_pnp_sounddrv(struct pnp_sounddev * drv); -int sndtable_probe(int unit, struct address_info * hw_config); -int sndtable_init_card(int unit, struct address_info * hw_config); -void sound_timer_init(struct sound_lowlev_timer * t, char *name); -int -sound_start_dma(int dev, struct dma_buffparms * dmap, int chan, - unsigned long physaddr, - int count, int dma_mode, int autoinit); -void sound_dma_intr(int dev, struct dma_buffparms * dmap, int chan); - -#endif /* _DEV_TABLE_C_ */ -#endif /* _DEV_TABLE_H_ */ diff --git a/sys/dev/sound/isa/i386/dmabuf.c b/sys/dev/sound/isa/i386/dmabuf.c deleted file mode 100644 index ee3359793a..0000000000 --- a/sys/dev/sound/isa/i386/dmabuf.c +++ /dev/null @@ -1,1607 +0,0 @@ -/* - * sound/dmabuf.c - * - * The DMA buffer manager for digitized voice applications - * - * Copyright by Hannu Savolainen 1993, 1994, 1995 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/sound/dmabuf.c,v 1.38.2.2 2000/08/08 19:49:54 peter Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/dmabuf.c,v 1.3 2003/08/07 21:17:12 dillon Exp $ - */ - -#include "sound_config.h" - -#include - -#include - -#if defined(CONFIG_AUDIO) || defined(CONFIG_GUS) -#ifdef ALLOW_POLL - -int -DMAbuf_poll(int dev, struct fileinfo * file, int events, select_table * wait); -#endif; - -static void -reorganize_buffers(int dev, struct dma_buffparms * dmap); - -static int *in_sleeper[MAX_AUDIO_DEV] = {NULL}; -static volatile struct snd_wait in_sleep_flag[MAX_AUDIO_DEV] = {{0}}; -static int *out_sleeper[MAX_AUDIO_DEV] = {NULL}; -static volatile struct snd_wait out_sleep_flag[MAX_AUDIO_DEV] = {{0}}; - -static int ndmaps = 0; - -#define MAX_DMAP (MAX_AUDIO_DEV*2) - -static struct dma_buffparms dmaps[MAX_DMAP] = {{0}}; -/* - * Primitive way to allocate such a large array. Needs dynamic run-time - * alloction. - */ - -static int space_in_queue(int dev); - -static void dma_reset_output(int dev); -static void dma_reset_input(int dev); - -static void -reorganize_buffers(int dev, struct dma_buffparms * dmap) -{ - /* - * This routine breaks the physical device buffers to logical ones. - */ - - struct audio_operations *dsp_dev = audio_devs[dev]; - u_int sr, nc; - int bsz, sz, n, i; - - if (dmap->fragment_size == 0) { - /* Compute the fragment size using the default algorithm */ - - sr = dsp_dev->ioctl(dev, SOUND_PCM_READ_RATE, 0, 1); - nc = dsp_dev->ioctl(dev, SOUND_PCM_READ_CHANNELS, 0, 1); - sz = dsp_dev->ioctl(dev, SOUND_PCM_READ_BITS, 0, 1); - - if (sz == 8) - dmap->neutral_byte = 254; - else - dmap->neutral_byte = 0x00; - - if (sr < 1 || nc < 1 || sz < 1) { - printf("Warning: Invalid PCM parameters[%d] sr=%d, nc=%d, sz=%d\n", - dev, sr, nc, sz); - sr = DSP_DEFAULT_SPEED; - nc = 1; - sz = 8; - } - sz = sr * nc * sz; - - sz /= 8; /* #bits -> #bytes */ - - /* - * Compute a buffer size for time not exeeding 1 second. - * Usually this algorithm gives a buffer size for 0.5 to 1.0 - * seconds of sound (using the current speed, sample size and - * #channels). - */ - - bsz = dsp_dev->buffsize; - while (bsz > sz) - bsz /= 2; - - if (bsz == dsp_dev->buffsize) - bsz /= 2; /* Needs at least 2 buffers */ - - if (dmap->subdivision == 0) /* Not already set */ - dmap->subdivision = 1; /* Init to default value */ - else - bsz /= dmap->subdivision; - - if (bsz < 16) - bsz = 16; /* Just a sanity check */ - - dmap->fragment_size = bsz; - } else { - /* - * The process has specified the buffer sice with - * SNDCTL_DSP_SETFRAGMENT or the buffer sice computation has - * already been done. - */ - - if (dmap->fragment_size > (audio_devs[dev]->buffsize / 2)) - dmap->fragment_size = (audio_devs[dev]->buffsize / 2); - bsz = dmap->fragment_size; - } - - bsz &= ~0x03; /* Force size which is multiple of 4 bytes */ -#ifdef OS_DMA_ALIGN_CHECK - OS_DMA_ALIGN_CHECK(bsz); -#endif - - n = dsp_dev->buffsize / bsz; - - if (n > MAX_SUB_BUFFERS) - n = MAX_SUB_BUFFERS; - - if (n > dmap->max_fragments) - n = dmap->max_fragments; - dmap->nbufs = n; - dmap->bytes_in_use = n * bsz; - - for (i = 0; i < dmap->nbufs; i++) { - dmap->counts[i] = 0; - } - - if (dmap->raw_buf) - fillw (dmap->neutral_byte, dmap->raw_buf, - dmap->bytes_in_use/2); - - dmap->flags |= DMA_ALLOC_DONE; - -} - -static void -dma_init_buffers(int dev, struct dma_buffparms * dmap) -{ - if (dmap == audio_devs[dev]->dmap_out) { - out_sleep_flag[dev].aborting = 0; - out_sleep_flag[dev].mode = WK_NONE; - } else { - in_sleep_flag[dev].aborting = 0; - in_sleep_flag[dev].mode = WK_NONE; - } - - dmap->flags = DMA_BUSY; /* Other flags off */ - dmap->qlen = dmap->qhead = dmap->qtail = 0; - dmap->nbufs = 1; - dmap->bytes_in_use = audio_devs[dev]->buffsize; - - dmap->dma_mode = DMODE_NONE; - dmap->mapping_flags = 0; - dmap->neutral_byte = 0x00; -} - -static int -open_dmap(int dev, int mode, struct dma_buffparms * dmap, int chan) -{ - if (dmap->flags & DMA_BUSY) - return -(EBUSY); - -#ifdef RUNTIME_DMA_ALLOC - { - int err; - - if ((err = sound_alloc_dmap(dev, dmap, chan)) < 0) - return err; - } -#endif - - if (dmap->raw_buf == NULL) - return -(ENOSPC); /* Memory allocation failed during boot */ - - if (0) { - printf("Unable to grab(2) DMA%d for the audio driver\n", chan); - return -(EBUSY); - } - dmap->open_mode = mode; - dmap->subdivision = dmap->underrun_count = 0; - dmap->fragment_size = 0; - dmap->max_fragments = 65536; /* Just a large value */ - dmap->byte_counter = 0; - isa_dma_acquire(chan); - dmap->dma_chan = chan; - dma_init_buffers(dev, dmap); - - return 0; -} - -static void -close_dmap(int dev, struct dma_buffparms * dmap, int chan) -{ - if (dmap->flags & DMA_BUSY) - dmap->dma_mode = DMODE_NONE; - dmap->flags &= ~DMA_BUSY; - isa_dma_release(dmap->dma_chan); -#ifdef RUNTIME_DMA_ALLOC - sound_free_dmap(dev, dmap); -#endif -} - -int -DMAbuf_open(int dev, int mode) -{ - int retval; - struct dma_buffparms *dmap_in = NULL; - struct dma_buffparms *dmap_out = NULL; - - if (dev >= num_audiodevs) { - printf("PCM device %d not installed.\n", dev); - return -(ENXIO); - } - if (!audio_devs[dev]) { - printf("PCM device %d not initialized\n", dev); - return -(ENXIO); - } - if (!(audio_devs[dev]->flags & DMA_DUPLEX)) { - audio_devs[dev]->dmap_in = audio_devs[dev]->dmap_out; - audio_devs[dev]->dmachan2 = audio_devs[dev]->dmachan1; - } - if ((retval = audio_devs[dev]->open(dev, mode)) < 0) - return retval; - - dmap_out = audio_devs[dev]->dmap_out; - dmap_in = audio_devs[dev]->dmap_in; - - if ((retval = open_dmap(dev, mode, dmap_out, audio_devs[dev]->dmachan1)) < 0) { - audio_devs[dev]->close(dev); - return retval; - } - audio_devs[dev]->enable_bits = mode; - - if (audio_devs[dev]->flags & DMA_DUPLEX && dmap_out != dmap_in) { - if ((retval = open_dmap(dev, mode, dmap_in, audio_devs[dev]->dmachan2)) < 0) { - audio_devs[dev]->close(dev); - close_dmap(dev, dmap_out, audio_devs[dev]->dmachan1); - return retval; - } - } - audio_devs[dev]->open_mode = mode; - audio_devs[dev]->go = 1; - - in_sleep_flag[dev].aborting = 0; - in_sleep_flag[dev].mode = WK_NONE; - - out_sleep_flag[dev].aborting = 0; - out_sleep_flag[dev].mode = WK_NONE; - - audio_devs[dev]->ioctl(dev, SOUND_PCM_WRITE_BITS, (ioctl_arg) 8, 1); - audio_devs[dev]->ioctl(dev, SOUND_PCM_WRITE_CHANNELS, (ioctl_arg) 1, 1); - audio_devs[dev]->ioctl(dev, SOUND_PCM_WRITE_RATE, (ioctl_arg) DSP_DEFAULT_SPEED, 1); - - return 0; -} - -static void -dma_reset(int dev) -{ - u_long flags; - - flags = splhigh(); - audio_devs[dev]->reset(dev); - splx(flags); - - dma_reset_output(dev); - - if (audio_devs[dev]->flags & DMA_DUPLEX) - dma_reset_input(dev); -} - -static void -dma_reset_output(int dev) -{ - u_long flags; - - flags = splhigh(); - if (!(audio_devs[dev]->flags & DMA_DUPLEX) || - !audio_devs[dev]->halt_output) - audio_devs[dev]->reset(dev); - else - audio_devs[dev]->halt_output(dev); - splx(flags); - - dma_init_buffers(dev, audio_devs[dev]->dmap_out); - reorganize_buffers(dev, audio_devs[dev]->dmap_out); -} - -static void -dma_reset_input(int dev) -{ - u_long flags; - - flags = splhigh(); - if (!(audio_devs[dev]->flags & DMA_DUPLEX) || - !audio_devs[dev]->halt_input) - audio_devs[dev]->reset(dev); - else - audio_devs[dev]->halt_input(dev); - splx(flags); - - dma_init_buffers(dev, audio_devs[dev]->dmap_in); - reorganize_buffers(dev, audio_devs[dev]->dmap_in); -} - -static int -dma_sync(int dev) -{ - u_long flags; - - if (!audio_devs[dev]->go && (!audio_devs[dev]->enable_bits & PCM_ENABLE_OUTPUT)) - return 0; - - if (audio_devs[dev]->dmap_out->dma_mode == DMODE_OUTPUT) { - flags = splhigh(); - - out_sleep_flag[dev].aborting = 0; -#ifdef ALLOW_BUFFER_MAPPING - if(audio_devs[dev]->dmap_out->mapping_flags & DMA_MAP_MAPPED && - audio_devs[dev]->dmap_out->qlen) { - splx(flags); - - return audio_devs[dev]->dmap_out->qlen; - } - -#endif - while (!PROCESS_ABORTING (out_sleep_flag[dev]) - && audio_devs[dev]->dmap_out->qlen){ - int chn; - - out_sleeper[dev] = &chn; - DO_SLEEP1(chn, out_sleep_flag[dev], 10 * hz); - if (TIMED_OUT (out_sleep_flag[dev]) ) { - - splx(flags); - - return audio_devs[dev]->dmap_out->qlen; - - } - } - - - splx(flags); - - /* - * Some devices such as GUS have huge amount of on board RAM - * for the audio data. We have to wait until the device has - * finished playing. - */ - - flags = splhigh(); - if (audio_devs[dev]->local_qlen) { /* Device has hidden buffers */ - while (!(PROCESS_ABORTING (out_sleep_flag[dev])) - && audio_devs[dev]->local_qlen(dev)) { - int chn; - out_sleeper[dev] = &chn; - DO_SLEEP(chn, out_sleep_flag[dev], 10 * hz); - - } - } - splx(flags); - } - return audio_devs[dev]->dmap_out->qlen; -} - -int -DMAbuf_release(int dev, int mode) -{ - u_long flags; - - if (!((out_sleep_flag[dev].aborting)) - && (audio_devs[dev]->dmap_out->dma_mode == DMODE_OUTPUT)) { - dma_sync(dev); - } - flags = splhigh(); - - audio_devs[dev]->close(dev); - - close_dmap(dev, audio_devs[dev]->dmap_out, audio_devs[dev]->dmachan1); - - if (audio_devs[dev]->flags & DMA_DUPLEX) - close_dmap(dev, audio_devs[dev]->dmap_in, audio_devs[dev]->dmachan2); - audio_devs[dev]->open_mode = 0; - - splx(flags); - - return 0; -} - -static int -activate_recording(int dev, struct dma_buffparms * dmap) -{ - if (!(audio_devs[dev]->enable_bits & PCM_ENABLE_INPUT)) - return 0; - - if (dmap->flags & DMA_RESTART) { - dma_reset_input(dev); - dmap->flags &= ~DMA_RESTART; - } - if (dmap->dma_mode == DMODE_OUTPUT) { /* Direction change */ - dma_sync(dev); - dma_reset(dev); - dmap->dma_mode = DMODE_NONE; - } - if (!(dmap->flags & DMA_ALLOC_DONE)) - reorganize_buffers(dev, dmap); - - if (!dmap->dma_mode) { - int err; - - if ((err = audio_devs[dev]->prepare_for_input(dev, - dmap->fragment_size, dmap->nbufs)) < 0) { - return err; - } - dmap->dma_mode = DMODE_INPUT; - } - if (!(dmap->flags & DMA_ACTIVE)) { - audio_devs[dev]->start_input(dev, - dmap->raw_buf_phys + dmap->qtail * dmap->fragment_size, - dmap->fragment_size, 0, - !(audio_devs[dev]->flags & DMA_AUTOMODE) || - !(dmap->flags & DMA_STARTED)); - dmap->flags |= DMA_ACTIVE | DMA_STARTED; - if (audio_devs[dev]->trigger) - audio_devs[dev]->trigger(dev, - audio_devs[dev]->enable_bits * audio_devs[dev]->go); - } - return 0; -} - -int -DMAbuf_getrdbuffer(int dev, char **buf, int *len, int dontblock) -{ - u_long flags; - int err = EIO; - struct dma_buffparms *dmap = audio_devs[dev]->dmap_in; - - flags = splhigh(); -#ifdef ALLOW_BUFFER_MAPPING - if (audio_devs[dev]->dmap_in->mapping_flags & DMA_MAP_MAPPED) { - printf("Sound: Can't read from mmapped device (1)\n"); - return -(EINVAL); - } else -#endif - if (!dmap->qlen) { - int timeout; - - if ((err = activate_recording(dev, dmap)) < 0) { - splx(flags); - return err; - } - /* Wait for the next block */ - - if (dontblock) { - splx(flags); - return -(EAGAIN); - } - if (!(audio_devs[dev]->enable_bits & PCM_ENABLE_INPUT) & - audio_devs[dev]->go) { - splx(flags); - return -(EAGAIN); - } - if (!audio_devs[dev]->go) - timeout = 0; - else - timeout = 2 * hz; - - { - int chn; - - in_sleeper[dev] = &chn; - DO_SLEEP(chn, in_sleep_flag[dev], timeout); - - }; - /* XXX note -- nobody seems to set the mode to WK_TIMEOUT - lr */ - if ((in_sleep_flag[dev].mode & WK_TIMEOUT)) { - /* XXX hey, we are in splhigh here ? lr 970705 */ - printf("Sound: DMA (input) timed out - IRQ/DRQ config error?\n"); - err = EIO; - audio_devs[dev]->reset(dev); - in_sleep_flag[dev].aborting = 1; - } else - err = EINTR; - } - splx(flags); - - if (!dmap->qlen) - return -(err); - - *buf = &dmap->raw_buf[dmap->qhead * dmap->fragment_size + dmap->counts[dmap->qhead]]; - *len = dmap->fragment_size - dmap->counts[dmap->qhead]; - - return dmap->qhead; -} - -int -DMAbuf_rmchars(int dev, int buff_no, int c) -{ - struct dma_buffparms *dmap = audio_devs[dev]->dmap_in; - - int p = dmap->counts[dmap->qhead] + c; - -#ifdef ALLOW_BUFFER_MAPPING - if (audio_devs[dev]->dmap_in->mapping_flags & DMA_MAP_MAPPED) { - printf("Sound: Can't read from mmapped device (2)\n"); - return -(EINVAL); - } else -#endif - if (p >= dmap->fragment_size) { /* This buffer is completely empty */ - dmap->counts[dmap->qhead] = 0; - if (dmap->qlen <= 0 || dmap->qlen > dmap->nbufs) - printf("\nSound: Audio queue1 corrupted for dev%d (%d/%d)\n", - dev, dmap->qlen, dmap->nbufs); - dmap->qlen--; - dmap->qhead = (dmap->qhead + 1) % dmap->nbufs; - } else - dmap->counts[dmap->qhead] = p; - - return 0; -} - -static int -dma_subdivide(int dev, struct dma_buffparms * dmap, ioctl_arg arg, int fact) -{ - if (fact == 0) { - fact = dmap->subdivision; - if (fact == 0) - fact = 1; - return *(int *) arg = fact; - } - if (dmap->subdivision != 0 || dmap->fragment_size)/* Loo late to change */ - return -(EINVAL); - - if (fact > MAX_REALTIME_FACTOR) - return -(EINVAL); - - if (fact != 1 && fact != 2 && fact != 4 && fact != 8 && fact != 16) - return -(EINVAL); - - dmap->subdivision = fact; - return *(int *) arg = fact; -} - -static int -dma_set_fragment(int dev, struct dma_buffparms * dmap, ioctl_arg arg, int fact) -{ - int bytes, count; - - if (fact == 0) - return -(EIO); - - if (dmap->subdivision != 0 || dmap->fragment_size)/* Loo late to change */ - return -(EINVAL); - - bytes = fact & 0xffff; - count = (fact >> 16) & 0xffff; - - if (count == 0) - count = MAX_SUB_BUFFERS; - -#if amancio - if (bytes < 4 || bytes > 17) /* <16 || > 128k */ - return -(EINVAL); -#endif - - if (count < 2) - return -(EINVAL); - -#ifdef OS_DMA_MINBITS - if (bytes < OS_DMA_MINBITS) - bytes = OS_DMA_MINBITS; -#endif - - dmap->fragment_size = (1 << bytes); - - dmap->max_fragments = count; - - if (dmap->fragment_size > audio_devs[dev]->buffsize) - dmap->fragment_size = audio_devs[dev]->buffsize; - - if (dmap->fragment_size == audio_devs[dev]->buffsize && - audio_devs[dev]->flags & DMA_AUTOMODE) - dmap->fragment_size /= 2; /* Needs at least 2 buffers */ - - dmap->subdivision = 1; /* Disable SNDCTL_DSP_SUBDIVIDE */ - return *(int *) arg = bytes | (count << 16); -} - -static int -get_buffer_pointer(int dev, int chan, struct dma_buffparms * dmap) -{ - int pos; - u_long flags; - - flags = splhigh(); - - if (!(dmap->flags & DMA_ACTIVE)) - pos = 0; - else - { - pos = isa_dmastatus(chan); - } - - splx(flags); - - pos = dmap->bytes_in_use - pos ; - if (audio_devs[dev]->flags & DMA_AUTOMODE) - return pos; - else - { - pos = dmap->fragment_size - pos; - if (pos < 0) - return 0; - return pos; - } - - -} - -int -DMAbuf_ioctl(int dev, u_int cmd, ioctl_arg arg, int local) -{ - struct dma_buffparms *dmap_out = audio_devs[dev]->dmap_out; - struct dma_buffparms *dmap_in = audio_devs[dev]->dmap_in; - - switch (cmd) { - - - case SNDCTL_DSP_RESET: - dma_reset(dev); - return 0; - break; - - case SNDCTL_DSP_SYNC: - dma_sync(dev); - dma_reset(dev); - return 0; - break; - - case SNDCTL_DSP_GETBLKSIZE: - if (!(dmap_out->flags & DMA_ALLOC_DONE)) - reorganize_buffers(dev, dmap_out); - - return *(int *) arg = dmap_out->fragment_size; - break; - - case SNDCTL_DSP_SETBLKSIZE: - { - int size = (*(int *) arg); - - if (!(dmap_out->flags & DMA_ALLOC_DONE) && size) { - if ((size >> 16) > 0 ) - dmap_out->fragment_size = size >> 16; - else { - dmap_out->fragment_size = size; - } - dmap_out->max_fragments = 8888; - - size &= 0xffff; - - if (audio_devs[dev]->flags & DMA_DUPLEX) { - dmap_in->fragment_size = size; - dmap_in->max_fragments = 8888; - } - return 0; - - } else - return -(EINVAL); /* Too late to change */ - - } - break; - - case SNDCTL_DSP_SUBDIVIDE: - { - int fact = (*(int *) arg); - int ret; - - ret = dma_subdivide(dev, dmap_out, arg, fact); - if (ret < 0) - return ret; - - if (audio_devs[dev]->flags & DMA_DUPLEX) - ret = dma_subdivide(dev, dmap_in, arg, fact); - - return ret; - } - break; - - case SNDCTL_DSP_SETFRAGMENT: - { - int fact = (*(int *) arg); - int ret; - - ret = dma_set_fragment(dev, dmap_out, arg, fact); - if (ret < 0) - return ret; - - if (audio_devs[dev]->flags & DMA_DUPLEX) - ret = dma_set_fragment(dev, dmap_in, arg, fact); - - return ret; - } - break; - - case SNDCTL_DSP_GETISPACE: - case SNDCTL_DSP_GETOSPACE: - if (!local) - return -(EINVAL); - else { - struct dma_buffparms *dmap = dmap_out; - - audio_buf_info *info = (audio_buf_info *) arg; - - if (cmd == SNDCTL_DSP_GETISPACE && audio_devs[dev]->flags & DMA_DUPLEX) - dmap = dmap_in; - -#ifdef ALLOW_BUFFER_MAPPING - if (dmap->mapping_flags & DMA_MAP_MAPPED) - return -(EINVAL); -#endif - - if (!(dmap->flags & DMA_ALLOC_DONE)) - reorganize_buffers(dev, dmap); - - info->fragstotal = dmap->nbufs; - - if (cmd == SNDCTL_DSP_GETISPACE) - info->fragments = dmap->qlen; - else { - if (!space_in_queue(dev)) - info->fragments = 0; - else { - info->fragments = dmap->nbufs - dmap->qlen; - if (audio_devs[dev]->local_qlen) { - int tmp = audio_devs[dev]->local_qlen(dev); - - if (tmp & info->fragments) - tmp--; /* This buffer has been counted twice */ - info->fragments -= tmp; - } - } - } - - if (info->fragments < 0) - info->fragments = 0; - else if (info->fragments > dmap->nbufs) - info->fragments = dmap->nbufs; - - info->fragsize = dmap->fragment_size; - info->bytes = info->fragments * dmap->fragment_size; - - if (cmd == SNDCTL_DSP_GETISPACE && dmap->qlen) - info->bytes -= dmap->counts[dmap->qhead]; - } - return 0; - - case SNDCTL_DSP_SETTRIGGER: - { - u_long flags; - - int bits = (*(int *) arg) & audio_devs[dev]->open_mode; - int changed; - - if (audio_devs[dev]->trigger == NULL) - return -(EINVAL); - - if (!(audio_devs[dev]->flags & DMA_DUPLEX)) - if ((bits & PCM_ENABLE_INPUT) && (bits & PCM_ENABLE_OUTPUT)) { - printf("Sound: Device doesn't have full duplex capability\n"); - return -(EINVAL); - } - flags = splhigh(); - changed = audio_devs[dev]->enable_bits ^ bits; - - if ((changed & bits) & PCM_ENABLE_INPUT && audio_devs[dev]->go) { - if (!(dmap_in->flags & DMA_ALLOC_DONE)) - reorganize_buffers(dev, dmap_in); - activate_recording(dev, dmap_in); - } -#ifdef ALLOW_BUFFER_MAPPING - if ((changed & bits) & PCM_ENABLE_OUTPUT && - dmap_out->mapping_flags & DMA_MAP_MAPPED && - audio_devs[dev]->go) { - if (!(dmap_out->flags & DMA_ALLOC_DONE)) - reorganize_buffers(dev, dmap_out); - - audio_devs[dev]->prepare_for_output (dev, - dmap_out->fragment_size, dmap_out->nbufs); - - dmap_out->counts[dmap_out->qhead] = dmap_out->fragment_size; - DMAbuf_start_output(dev, 0, dmap_out->fragment_size); - dmap_out->dma_mode = DMODE_OUTPUT; - } -#endif - - audio_devs[dev]->enable_bits = bits; - if (changed && audio_devs[dev]->trigger) - audio_devs[dev]->trigger(dev, bits * audio_devs[dev]->go); - splx(flags); - } - case SNDCTL_DSP_GETTRIGGER: - return *(int *) arg = audio_devs[dev]->enable_bits; - break; - - case SNDCTL_DSP_SETSYNCRO: - - if (!audio_devs[dev]->trigger) - return -(EINVAL); - - audio_devs[dev]->trigger(dev, 0); - audio_devs[dev]->go = 0; - return 0; - break; - - case SNDCTL_DSP_GETIPTR: - { - count_info info; - u_long flags; - - flags = splhigh(); - info.bytes = audio_devs[dev]->dmap_in->byte_counter; - info.ptr = get_buffer_pointer(dev, audio_devs[dev]->dmachan2, audio_devs[dev]->dmap_in); - info.blocks = audio_devs[dev]->dmap_in->qlen; - info.bytes += info.ptr; - - bcopy((char *) &info, &(((char *) arg)[0]), sizeof(info)); - -#ifdef ALLOW_BUFFER_MAPPING - if (audio_devs[dev]->dmap_in->mapping_flags & DMA_MAP_MAPPED) - audio_devs[dev]->dmap_in->qlen = 0; /* Ack interrupts */ -#endif - splx(flags); - return 0; - } - break; - - case SNDCTL_DSP_GETOPTR: - { - count_info info; - u_long flags; - - flags = splhigh(); - info.bytes = audio_devs[dev]->dmap_out->byte_counter; - info.ptr = get_buffer_pointer(dev, audio_devs[dev]->dmachan1, audio_devs[dev]->dmap_out); - info.blocks = audio_devs[dev]->dmap_out->qlen; - info.bytes += info.ptr; - bcopy((char *) &info, &(((char *) arg)[0]), sizeof(info)); - -#ifdef ALLOW_BUFFER_MAPPING - if (audio_devs[dev]->dmap_out->mapping_flags & DMA_MAP_MAPPED) - audio_devs[dev]->dmap_out->qlen = 0; /* Ack interrupts */ -#endif - splx(flags); - return 0; - } - break; - - default: - return audio_devs[dev]->ioctl(dev, cmd, arg, local); - } -} - -/* - * DMAbuf_start_devices() is called by the /dev/music driver to start one or - * more audio devices at desired moment. - */ - -void -DMAbuf_start_devices(u_int devmask) -{ - int dev; - - for (dev = 0; dev < num_audiodevs; dev++) - if (devmask & (1 << dev)) - if (audio_devs[dev]->open_mode != 0) - if (!audio_devs[dev]->go) { - /* OK to start the device */ - audio_devs[dev]->go = 1; - - if (audio_devs[dev]->trigger) - audio_devs[dev]->trigger(dev, - audio_devs[dev]->enable_bits * audio_devs[dev]->go); - } -} - -static int -space_in_queue(int dev) -{ - int len, max, tmp; - struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; - if (dmap->qlen >= dmap->nbufs) /* No space at all */ - return 0; - - /* - * Verify that there are no more pending buffers than the limit - * defined by the process. - */ - - max = dmap->max_fragments; - len = dmap->qlen; - - if (audio_devs[dev]->local_qlen) { - tmp = audio_devs[dev]->local_qlen(dev); - if (tmp & len) - tmp--; /* This buffer has been counted twice */ - len += tmp; - } - - if (len >= max) - return 0; - return 1; -} - -int -DMAbuf_getwrbuffer(int dev, char **buf, int *size, int dontblock) -{ - u_long flags; - int abort, err = EIO; - struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; - -#ifdef ALLOW_BUFFER_MAPPING - if (audio_devs[dev]->dmap_out->mapping_flags & DMA_MAP_MAPPED) { - printf("Sound: Can't write to mmapped device (3)\n"); - return -(EINVAL); - } -#endif - - if (dmap->dma_mode == DMODE_INPUT) { /* Direction change */ - dma_reset(dev); - dmap->dma_mode = DMODE_NONE; - } else if (dmap->flags & DMA_RESTART) { /* Restart buffering */ - dma_sync(dev); - dma_reset_output(dev); - } - dmap->flags &= ~DMA_RESTART; - - if (!(dmap->flags & DMA_ALLOC_DONE)) - reorganize_buffers(dev, dmap); - - if (!dmap->dma_mode) { - int err; - - dmap->dma_mode = DMODE_OUTPUT; - if ((err = audio_devs[dev]->prepare_for_output(dev, - dmap->fragment_size, dmap->nbufs)) < 0) - return err; - } - flags = splhigh(); - - abort = 0; - while (!space_in_queue(dev) && !abort) { - int timeout; - - if (dontblock) { - splx(flags); - return -(EAGAIN); - } - if (!(audio_devs[dev]->enable_bits & PCM_ENABLE_OUTPUT) && - audio_devs[dev]->go) { - splx(flags); - return -(EAGAIN); - } - /* - * Wait for free space - */ - if (!audio_devs[dev]->go) - timeout = 0; - else - timeout = 2 * hz; - - { - int chn; - - out_sleep_flag[dev].mode = WK_SLEEP; - out_sleeper[dev] = &chn; - DO_SLEEP2(chn, out_sleep_flag[dev], timeout); - - if ((out_sleep_flag[dev].mode & WK_TIMEOUT)) { - printf("Sound: DMA (output) timed out - IRQ/DRQ config error?\n"); - err = EIO; - abort = 1; - out_sleep_flag[dev].aborting = 1; - audio_devs[dev]->reset(dev); - } else if ((out_sleep_flag[dev].aborting) || - CURSIG(curproc)) { - err = EINTR; - abort = 1; - } - } - } - splx(flags); - - if (!space_in_queue(dev)) { - return -(err); /* Caught a signal ? */ - } - *buf = dmap->raw_buf + dmap->qtail * dmap->fragment_size; - *size = dmap->fragment_size; - dmap->counts[dmap->qtail] = 0; - return dmap->qtail; -} - -int -DMAbuf_start_output(int dev, int buff_no, int l) -{ - struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; - - /* - * Bypass buffering if using mmaped access - */ - -#ifdef ALLOW_BUFFER_MAPPING - if (audio_devs[dev]->dmap_out->mapping_flags & DMA_MAP_MAPPED) { - l = dmap->fragment_size; - dmap->counts[dmap->qtail] = l; - dmap->flags &= ~DMA_RESTART; - dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; - } else -#else - if (dmap != NULL) -#endif - { - - if (buff_no != dmap->qtail) - printf("Sound warning: DMA buffers out of sync %d != %d\n", buff_no, dmap->qtail); - - dmap->qlen++; - if (dmap->qlen <= 0 || dmap->qlen > dmap->nbufs) - printf("\nSound: Audio queue2 corrupted for dev%d (%d/%d)\n", - dev, dmap->qlen, dmap->nbufs); - - dmap->counts[dmap->qtail] = l; - - if ((l != dmap->fragment_size) && - ((audio_devs[dev]->flags & DMA_AUTOMODE) && - audio_devs[dev]->flags & NEEDS_RESTART)) - dmap->flags |= DMA_RESTART; - else - dmap->flags &= ~DMA_RESTART; - - dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; - } - if (!(dmap->flags & DMA_ACTIVE)) { - dmap->flags |= DMA_ACTIVE; - audio_devs[dev]->output_block(dev, dmap->raw_buf_phys + - dmap->qhead * dmap->fragment_size, - dmap->counts[dmap->qhead], 0, - !(audio_devs[dev]->flags & DMA_AUTOMODE) || - !(dmap->flags & DMA_STARTED)); - dmap->flags |= DMA_STARTED; - if (audio_devs[dev]->trigger) - audio_devs[dev]->trigger(dev, - audio_devs[dev]->enable_bits * audio_devs[dev]->go); - } - return 0; -} - -int -DMAbuf_start_dma(int dev, u_long physaddr, int count, int dma_mode) -{ - int chan; - struct dma_buffparms *dmap; - - if (dma_mode == 1) { - chan = audio_devs[dev]->dmachan1; - dmap = audio_devs[dev]->dmap_out; - - } else { - chan = audio_devs[dev]->dmachan2; - dmap = audio_devs[dev]->dmap_in; - } - - /* - * The count must be one less than the actual size. This is handled - * by set_dma_addr() - */ - -#ifndef PSEUDO_DMA_AUTOINIT - if (audio_devs[dev]->flags & DMA_AUTOMODE) { - /* Auto restart mode. Transfer the whole buffer */ - isa_dmastart(ISADMA_RAW | ((dma_mode == 0) ? ISADMA_READ : ISADMA_WRITE), - (caddr_t) (void *) (uintptr_t) dmap->raw_buf_phys, - dmap->bytes_in_use, chan); - - } else -#endif - { - isa_dmastart((dma_mode == 0) ? ISADMA_READ : ISADMA_WRITE, - (caddr_t) (void *) (uintptr_t) physaddr, count, chan); - } - return count; -} - -void -DMAbuf_init() -{ - int dev; - - /* - * NOTE! This routine could be called several times. - * XXX is it ok to make it run only the first time ? -- lr970710 - */ - - for (dev = 0; dev < num_audiodevs; dev++) - if (audio_devs[dev]->dmap_out == NULL) { - audio_devs[dev]->dmap_out = - audio_devs[dev]->dmap_in = &dmaps[ndmaps++]; - - if (audio_devs[dev]->flags & DMA_DUPLEX) - audio_devs[dev]->dmap_in = &dmaps[ndmaps++]; - } -} - -void -DMAbuf_outputintr(int dev, int event_type) -{ - /* - * Event types: 0 = DMA transfer done. Device still has more data in - * the local buffer. 1 = DMA transfer done. Device doesn't have local - * buffer or it's empty now. 2 = No DMA transfer but the device has - * now more space in its local buffer. - */ - - u_long flags; - struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; - dmap->byte_counter += dmap->counts[dmap->qhead]; -#ifdef OS_DMA_INTR - sound_dma_intr(dev, audio_devs[dev]->dmap_out, audio_devs[dev]->dmachan1); -#endif -#ifdef ALLOW_BUFFER_MAPPING - if (dmap->mapping_flags & DMA_MAP_MAPPED) { - /* mmapped access */ - - dmap->qhead = (dmap->qhead + 1) % dmap->nbufs; - dmap->qlen++; /* Yes increment it (don't decrement) */ - dmap->flags &= ~DMA_ACTIVE; - dmap->counts[dmap->qhead] = dmap->fragment_size; - - if (!(audio_devs[dev]->flags & DMA_AUTOMODE)) { - audio_devs[dev]->output_block(dev, dmap->raw_buf_phys + - dmap->qhead * dmap->fragment_size, - dmap->counts[dmap->qhead], 1, - !(audio_devs[dev]->flags & DMA_AUTOMODE)); - if (audio_devs[dev]->trigger) - audio_devs[dev]->trigger(dev, - audio_devs[dev]->enable_bits * audio_devs[dev]->go); - } -#ifdef PSEUDO_DMA_AUTOINIT - else { - DMAbuf_start_dma(dev, dmap->raw_buf_phys + - dmap->qhead * dmap->fragment_size, - dmap->counts[dmap->qhead], 1); - } -#endif - dmap->flags |= DMA_ACTIVE; - - } else -#endif - if (event_type != 2) { - if (dmap->qlen <= 0 || dmap->qlen > dmap->nbufs) { - printf("\nSound: Audio queue3 corrupted for dev%d (%d/%d)\n", - dev, dmap->qlen, dmap->nbufs); - return; - } - if (!(audio_devs[dev]->flags & DMA_DISABLE)) - isa_dmadone(0, 0, 0, audio_devs[dev]->dmachan1); - - dmap->qlen--; - dmap->qhead = (dmap->qhead + 1) % dmap->nbufs; - dmap->flags &= ~DMA_ACTIVE; - if (dmap->qlen) { - /* if (!(audio_devs[dev]->flags & NEEDS_RESTART)) */ - { - audio_devs[dev]->output_block(dev, dmap->raw_buf_phys + - dmap->qhead * dmap->fragment_size, - dmap->counts[dmap->qhead], 1, - !(audio_devs[dev]->flags & DMA_AUTOMODE)); - if (audio_devs[dev]->trigger) - audio_devs[dev]->trigger(dev, - audio_devs[dev]->enable_bits * audio_devs[dev]->go); - } - -#ifdef PSEUDO_DMA_AUTOINIT - /* else */ - { - DMAbuf_start_dma(dev, dmap->raw_buf_phys + - dmap->qhead * dmap->fragment_size, - dmap->counts[dmap->qhead], 1); - } -#endif - dmap->flags |= DMA_ACTIVE; - } else if (event_type == 1) { - dmap->underrun_count++; - if ((audio_devs[dev]->flags & DMA_DUPLEX) && - audio_devs[dev]->halt_output) - audio_devs[dev]->halt_output(dev); - else - audio_devs[dev]->halt_xfer(dev); - - if ((audio_devs[dev]->flags & DMA_AUTOMODE) && - audio_devs[dev]->flags & NEEDS_RESTART) - dmap->flags |= DMA_RESTART; - else - dmap->flags &= ~DMA_RESTART; - } - } /* event_type != 2 */ - flags = splhigh(); - - if ((out_sleep_flag[dev].mode & WK_SLEEP)) { - out_sleep_flag[dev].mode = WK_WAKEUP; - wakeup(out_sleeper[dev]); - } - - if(selinfo[dev].si_pid) { - selwakeup(&selinfo[dev]); - } - - splx(flags); -} - -void -DMAbuf_inputintr(int dev) -{ - u_long flags; - struct dma_buffparms *dmap = audio_devs[dev]->dmap_in; - - dmap->byte_counter += dmap->fragment_size; - -#ifdef OS_DMA_INTR - sound_dma_intr(dev, audio_devs[dev]->dmap_in, audio_devs[dev]->dmachan2); -#endif - if (!(audio_devs[dev]->flags & DMA_DISABLE)) - isa_dmadone(0, 0, 0, audio_devs[dev]->dmachan2); - -#ifdef ALLOW_BUFFER_MAPPING - if (dmap->mapping_flags & DMA_MAP_MAPPED) { - dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; - dmap->qlen++; - - if (!(audio_devs[dev]->flags & NEEDS_RESTART)) { - audio_devs[dev]->start_input(dev, dmap->raw_buf_phys + - dmap->qtail * dmap->fragment_size, - dmap->fragment_size, 1, - !(audio_devs[dev]->flags & DMA_AUTOMODE)); - if (audio_devs[dev]->trigger) - audio_devs[dev]->trigger(dev, - audio_devs[dev]->enable_bits * audio_devs[dev]->go); - } -#ifdef PSEUDO_DMA_AUTOINIT - else { - DMAbuf_start_dma(dev, dmap->raw_buf_phys + - dmap->qtail * dmap->fragment_size, - dmap->counts[dmap->qtail], 0); - } -#endif - - dmap->flags |= DMA_ACTIVE; - } else -#endif - if (dmap->qlen == (dmap->nbufs - 1)) { - /* printf ("Sound: Recording overrun\n"); */ - dmap->underrun_count++; - if ((audio_devs[dev]->flags & DMA_DUPLEX) && - audio_devs[dev]->halt_input) - audio_devs[dev]->halt_input(dev); - else - audio_devs[dev]->halt_xfer(dev); - - dmap->flags &= ~DMA_ACTIVE; - if (audio_devs[dev]->flags & DMA_AUTOMODE) - dmap->flags |= DMA_RESTART; - else - dmap->flags &= ~DMA_RESTART; - } else { - dmap->qlen++; - if (dmap->qlen <= 0 || dmap->qlen > dmap->nbufs) - printf("\nSound: Audio queue4 corrupted for dev%d (%d/%d)\n", - dev, dmap->qlen, dmap->nbufs); - dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; - - /* if (!(audio_devs[dev]->flags & DMA_AUTOMODE)) */ - { - audio_devs[dev]->start_input(dev, dmap->raw_buf_phys + - dmap->qtail * dmap->fragment_size, - dmap->fragment_size, 1, - !(audio_devs[dev]->flags & DMA_AUTOMODE)); - if (audio_devs[dev]->trigger) - audio_devs[dev]->trigger(dev, - audio_devs[dev]->enable_bits * audio_devs[dev]->go); - } -#ifdef PSEUDO_DMA_AUTOINIT - /* else */ - { - DMAbuf_start_dma(dev, dmap->raw_buf_phys + - dmap->qtail * dmap->fragment_size, - dmap->counts[dmap->qtail], 0); - } -#endif - - dmap->flags |= DMA_ACTIVE; - } - - flags = splhigh(); - if ((in_sleep_flag[dev].mode & WK_SLEEP)) { - in_sleep_flag[dev].mode = WK_WAKEUP; - wakeup(in_sleeper[dev]); - } - if (selinfo[dev].si_pid) - selwakeup(&selinfo[dev]); - splx(flags); -} - -int -DMAbuf_open_dma(int dev) -{ - int err; - u_long flags; - flags = splhigh(); - - if ((err = open_dmap(dev, OPEN_READWRITE, audio_devs[dev]->dmap_out, - audio_devs[dev]->dmachan1)) < 0) { - splx(flags); - return -(EBUSY); - } - dma_init_buffers(dev, audio_devs[dev]->dmap_out); - /* audio_devs[dev]->dmap_out->flags |= DMA_ALLOC_DONE; */ - audio_devs[dev]->dmap_out->fragment_size = audio_devs[dev]->buffsize; - /* reorganize_buffers (dev, audio_devs[dev]->dmap_out); */ - - if (audio_devs[dev]->flags & DMA_DUPLEX) { - if ((err = open_dmap(dev, OPEN_READWRITE, - audio_devs[dev]->dmap_in, audio_devs[dev]->dmachan2)) < 0) { - printf("Unable to grab DMA%d for the audio driver\n", - audio_devs[dev]->dmachan2); - close_dmap(dev, audio_devs[dev]->dmap_out, - audio_devs[dev]->dmachan1); - splx(flags); - return -(EBUSY); - } - dma_init_buffers(dev, audio_devs[dev]->dmap_in); - /* audio_devs[dev]->dmap_in->flags |= DMA_ALLOC_DONE; */ - audio_devs[dev]->dmap_in->fragment_size = audio_devs[dev]->buffsize; - /* reorganize_buffers (dev, audio_devs[dev]->dmap_in); */ - } else { - audio_devs[dev]->dmap_in = audio_devs[dev]->dmap_out; - audio_devs[dev]->dmachan2 = audio_devs[dev]->dmachan1; - } - - splx(flags); - return 0; -} - -void -DMAbuf_close_dma(int dev) -{ - DMAbuf_reset_dma(dev); - close_dmap(dev, audio_devs[dev]->dmap_out, audio_devs[dev]->dmachan1); - - if (audio_devs[dev]->flags & DMA_DUPLEX) - close_dmap(dev, audio_devs[dev]->dmap_in, audio_devs[dev]->dmachan2); - -} - -void -DMAbuf_reset_dma(int dev) -{ -} - -#ifdef ALLOW_POLL - -int -DMAbuf_poll(int dev, struct fileinfo * file, int events, select_table * wait) -{ - struct dma_buffparms *dmap; - u_long flags; - int revents = 0; - - dmap = audio_devs[dev]->dmap_in; - - if (events & (POLLIN | POLLRDNORM)) { - if (dmap->dma_mode != DMODE_INPUT) { - if ((audio_devs[dev]->flags & DMA_DUPLEX) && !dmap->qlen && - audio_devs[dev]->enable_bits & PCM_ENABLE_INPUT && - audio_devs[dev]->go) { - u_long flags; - - flags = splhigh(); - - activate_recording(dev, dmap); - splx(flags); - - } - return 0; - } - if (!dmap->qlen) { - flags = splhigh(); - - selrecord(wait, &selinfo[dev]); - - splx(flags); - - return 0; - } else - revents |= events & (POLLIN | POLLRDNORM); - - } - - if (events & (POLLOUT | POLLWRNORM)) { - - dmap = audio_devs[dev]->dmap_out; - if (dmap->dma_mode == DMODE_INPUT) - return 0; - - if (dmap->dma_mode == DMODE_NONE) - return ( events & (POLLOUT | POLLWRNORM)); - - if (dmap->mapping_flags & DMA_MAP_MAPPED) { - - if(dmap->qlen) - return 1; - flags = splhigh(); - selrecord(wait, &selinfo[dev]); - - splx(flags); - - return 0; - - } - if (!space_in_queue(dev)) { - flags = splhigh(); - selrecord(wait, &selinfo[dev]); - splx(flags); - - } else - revents |= events & (POLLOUT | POLLWRNORM); - - - } - - return (revents); -} - - -#ifdef amancio -int -DMAbuf_select(int dev, struct fileinfo * file, int sel_type, select_table * wait) -{ - struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; - struct dma_buffparms *dmapin = audio_devs[dev]->dmap_in; - u_long flags; - - switch (sel_type) { - case FREAD: - if (dmapin->dma_mode != DMODE_INPUT) - return 0; - - if (!dmap->qlen) { - flags = splhigh(); - selrecord(wait, &selinfo[dev]); - splx(flags); - - return 0; - } - return 1; - break; - - case FWRITE: - if (dmap->dma_mode == DMODE_INPUT) - return 0; - - if (dmap->dma_mode == DMODE_NONE) - return 1; - - if (!space_in_queue(dev)) { - flags = splhigh(); - - selrecord(wait, &selinfo[dev]); - splx(flags); - - return 0; - } - return 1; - break; - - } - - return 0; -} - -#endif /* ALLOW_POLL */ -#endif - -#else /* CONFIG_AUDIO */ -/* - * Stub versions if audio services not included - */ - -int -DMAbuf_open(int dev, int mode) -{ - return -(ENXIO); -} - -int -DMAbuf_release(int dev, int mode) -{ - return 0; -} - -int -DMAbuf_getwrbuffer(int dev, char **buf, int *size, int dontblock) -{ - return -(EIO); -} - -int -DMAbuf_getrdbuffer(int dev, char **buf, int *len, int dontblock) -{ - return -(EIO); -} - -int -DMAbuf_rmchars(int dev, int buff_no, int c) -{ - return -(EIO); -} - -int -DMAbuf_start_output(int dev, int buff_no, int l) -{ - return -(EIO); -} - -int -DMAbuf_ioctl(int dev, u_int cmd, ioctl_arg arg, int local) -{ - return -(EIO); -} - -void -DMAbuf_init() -{ -} - -int -DMAbuf_start_dma(int dev, u_long physaddr, int count, int dma_mode) -{ - return -(EIO); -} - -int -DMAbuf_open_dma(int dev) -{ - return -(ENXIO); -} - -void -DMAbuf_close_dma(int dev) -{ - return; -} - -void -DMAbuf_reset_dma(int dev) -{ - return; -} - -void -DMAbuf_inputintr(int dev) -{ - return; -} - -void -DMAbuf_outputintr(int dev, int underrun_flag) -{ - return; -} -#endif /* CONFIG_AUDIO */ diff --git a/sys/dev/sound/isa/i386/gus/gus_card.c b/sys/dev/sound/isa/i386/gus/gus_card.c deleted file mode 100644 index 74082e92d2..0000000000 --- a/sys/dev/sound/isa/i386/gus/gus_card.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * sound/gus_card.c - * - * Detection routine for the Gravis Ultrasound. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/gus/Attic/gus_card.c,v 1.2 2003/08/07 21:17:12 dillon Exp $ - */ - -#include - -#if defined(CONFIG_GUS) - -#include "gus_hw.h" -#include - -int gus_base, gus_irq, gus_dma; -extern int gus_wave_volume; -extern int gus_pcm_volume; -extern int have_gus_max; -extern int gus_timer_enabled; - -static sound_os_info *gus_osp; - -#ifndef NOGUSPNP -int IwaveOpen(char voices, char mode, struct address_info * hw); -#endif - -void -attach_gus_card(struct address_info * hw_config) -{ - int io_addr; - - gus_osp = hw_config->osp; - - snd_set_irq_handler(hw_config->irq, gusintr, hw_config->osp); - - if (gus_wave_detect(hw_config->io_base)) { - /* Try first the default */ - gus_wave_init(hw_config); - - /* 0x10c-> is MAX */ - - if (hw_config->dma2 != -1 && hw_config->dma2 != hw_config->dma) - if (0) - printf("gus_card.c: Can't allocate DMA channel2\n"); -#ifdef CONFIG_MIDI - gus_midi_init(); -#endif - return ; - } -#ifndef EXCLUDE_GUS_IODETECT - - /* - * Look at the possible base addresses (0x2X0, X=1, 2, 3, 4, 5, 6) - */ - - for (io_addr = 0x210; io_addr <= 0x260; io_addr += 0x10) - if ( (io_addr != hw_config->io_base) /* Already tested */ - && (gus_wave_detect(io_addr)) ) { - hw_config->io_base = io_addr; - - printf(" WARNING! GUS found at %x, config was %x ", - io_addr, hw_config->io_base); - gus_wave_init(hw_config); - /* 0x10c-> is MAX */ - if (hw_config->dma2 != -1 && hw_config->dma2 != hw_config->dma) - if (0) - printf("gus_card.c: Can't allocate DMA channel2\n"); -#ifdef CONFIG_MIDI - gus_midi_init(); -#endif - return ; - } -#endif -} - -int -probe_gus(struct address_info * hw_config) -{ - int io_addr; - - gus_osp = hw_config->osp; -#ifndef NOGUSPNP - IwaveOpen((char) 32, (char) GUS_MODE, hw_config); -#endif - if (gus_wave_detect(hw_config->io_base)) - return 1; - printf("oops I didnt find gus \n"); -#undef EXCLUDE_GUS_IODETECT -#ifndef EXCLUDE_GUS_IODETECT - - /* - * Look at the possible base addresses (0x2X0, X=1, 2, 3, 4, 5, 6) - */ - for (io_addr = 0x210; io_addr <= 0x260; io_addr += 0x10) - if ( (io_addr != hw_config->io_base) /* Already tested */ - && (gus_wave_detect(io_addr)) ) { - hw_config->io_base = io_addr; - return 1; - } -#endif - - return 0; -} - -void -gusintr(int irq) -{ - u_char src; - -#ifdef CONFIG_GUSMAX - if (have_gus_max) - ad1848_interrupt(irq); -#endif - - for (;;) { - if (!(src = inb(u_IrqStatus))) - return; - - if (src & DMA_TC_IRQ) - guswave_dma_irq(); -#ifdef CONFIG_MIDI - if (src & (MIDI_TX_IRQ | MIDI_RX_IRQ)) - gus_midi_interrupt(0); -#endif - if (src & (GF1_TIMER1_IRQ | GF1_TIMER2_IRQ)) { -#ifdef CONFIG_SEQUENCER - if (gus_timer_enabled) - sound_timer_interrupt(); - gus_write8(0x45, 0); /* Ack IRQ */ - gus_timer_command(4, 0x80); /* Reset IRQ flags */ -#else - gus_write8(0x45, 0); /* Stop timers */ -#endif - } - if (src & (WAVETABLE_IRQ | ENVELOPE_IRQ)) - gus_voice_irq(); - } -} - -#endif - -/* - * Some extra code for the 16 bit sampling option - */ -#if defined(CONFIG_GUS16) - -int -probe_gus_db16(struct address_info * hw_config) -{ - return ad1848_detect(hw_config->io_base, NULL, hw_config->osp); -} - -void -attach_gus_db16(struct address_info * hw_config) -{ - gus_pcm_volume = 100; - gus_wave_volume = 90; - - ad1848_init("GUS 16 bit sampling", hw_config->io_base, - hw_config->irq, - hw_config->dma, - hw_config->dma, 0, - hw_config->osp); -} - -#endif diff --git a/sys/dev/sound/isa/i386/gus/gus_hw.h b/sys/dev/sound/isa/i386/gus/gus_hw.h deleted file mode 100644 index f97a0b8670..0000000000 --- a/sys/dev/sound/isa/i386/gus/gus_hw.h +++ /dev/null @@ -1,50 +0,0 @@ - -/* - * I/O addresses - */ - -#define u_Base (gus_base + 0x000) -#define u_Mixer u_Base -#define u_Status (gus_base + 0x006) -#define u_TimerControl (gus_base + 0x008) -#define u_TimerData (gus_base + 0x009) -#define u_IRQDMAControl (gus_base + 0x00b) -#define u_MidiControl (gus_base + 0x100) -#define MIDI_RESET 0x03 -#define MIDI_ENABLE_XMIT 0x20 -#define MIDI_ENABLE_RCV 0x80 -#define u_MidiStatus u_MidiControl -#define MIDI_RCV_FULL 0x01 -#define MIDI_XMIT_EMPTY 0x02 -#define MIDI_FRAME_ERR 0x10 -#define MIDI_OVERRUN 0x20 -#define MIDI_IRQ_PEND 0x80 -#define u_MidiData (gus_base + 0x101) -#define u_Voice (gus_base + 0x102) -#define u_Command (gus_base + 0x103) -#define u_DataLo (gus_base + 0x104) -#define u_DataHi (gus_base + 0x105) -#define u_MixData (gus_base + 0x106) /* Rev. 3.7+ mixing */ -#define u_MixSelect (gus_base + 0x506) /* registers. */ -#define u_IrqStatus u_Status -# define MIDI_TX_IRQ 0x01 /* pending MIDI xmit IRQ */ -# define MIDI_RX_IRQ 0x02 /* pending MIDI recv IRQ */ -# define GF1_TIMER1_IRQ 0x04 /* general purpose timer */ -# define GF1_TIMER2_IRQ 0x08 /* general purpose timer */ -# define WAVETABLE_IRQ 0x20 /* pending wavetable IRQ */ -# define ENVELOPE_IRQ 0x40 /* pending volume envelope IRQ */ -# define DMA_TC_IRQ 0x80 /* pending dma tc IRQ */ - -#define ICS2101 1 -# define ICS_MIXDEVS 6 -# define DEV_MIC 0 -# define DEV_LINE 1 -# define DEV_CD 2 -# define DEV_GF1 3 -# define DEV_UNUSED 4 -# define DEV_VOL 5 - -# define CHN_LEFT 0 -# define CHN_RIGHT 1 -#define CS4231 2 -#define u_DRAMIO (gus_base + 0x107) diff --git a/sys/dev/sound/isa/i386/gus/gus_linearvol.h b/sys/dev/sound/isa/i386/gus/gus_linearvol.h deleted file mode 100644 index 7ad0c30d4f..0000000000 --- a/sys/dev/sound/isa/i386/gus/gus_linearvol.h +++ /dev/null @@ -1,18 +0,0 @@ -static unsigned short gus_linearvol[128] = { - 0x0000, 0x08ff, 0x09ff, 0x0a80, 0x0aff, 0x0b40, 0x0b80, 0x0bc0, - 0x0bff, 0x0c20, 0x0c40, 0x0c60, 0x0c80, 0x0ca0, 0x0cc0, 0x0ce0, - 0x0cff, 0x0d10, 0x0d20, 0x0d30, 0x0d40, 0x0d50, 0x0d60, 0x0d70, - 0x0d80, 0x0d90, 0x0da0, 0x0db0, 0x0dc0, 0x0dd0, 0x0de0, 0x0df0, - 0x0dff, 0x0e08, 0x0e10, 0x0e18, 0x0e20, 0x0e28, 0x0e30, 0x0e38, - 0x0e40, 0x0e48, 0x0e50, 0x0e58, 0x0e60, 0x0e68, 0x0e70, 0x0e78, - 0x0e80, 0x0e88, 0x0e90, 0x0e98, 0x0ea0, 0x0ea8, 0x0eb0, 0x0eb8, - 0x0ec0, 0x0ec8, 0x0ed0, 0x0ed8, 0x0ee0, 0x0ee8, 0x0ef0, 0x0ef8, - 0x0eff, 0x0f04, 0x0f08, 0x0f0c, 0x0f10, 0x0f14, 0x0f18, 0x0f1c, - 0x0f20, 0x0f24, 0x0f28, 0x0f2c, 0x0f30, 0x0f34, 0x0f38, 0x0f3c, - 0x0f40, 0x0f44, 0x0f48, 0x0f4c, 0x0f50, 0x0f54, 0x0f58, 0x0f5c, - 0x0f60, 0x0f64, 0x0f68, 0x0f6c, 0x0f70, 0x0f74, 0x0f78, 0x0f7c, - 0x0f80, 0x0f84, 0x0f88, 0x0f8c, 0x0f90, 0x0f94, 0x0f98, 0x0f9c, - 0x0fa0, 0x0fa4, 0x0fa8, 0x0fac, 0x0fb0, 0x0fb4, 0x0fb8, 0x0fbc, - 0x0fc0, 0x0fc4, 0x0fc8, 0x0fcc, 0x0fd0, 0x0fd4, 0x0fd8, 0x0fdc, - 0x0fe0, 0x0fe4, 0x0fe8, 0x0fec, 0x0ff0, 0x0ff4, 0x0ff8, 0x0ffc -}; diff --git a/sys/dev/sound/isa/i386/gus/gus_midi.c b/sys/dev/sound/isa/i386/gus/gus_midi.c deleted file mode 100644 index d93a1a11bf..0000000000 --- a/sys/dev/sound/isa/i386/gus/gus_midi.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * sound/gus2_midi.c - * - * The low level driver for the GUS Midi Interface. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/gus/Attic/gus_midi.c,v 1.2 2003/08/07 21:17:12 dillon Exp $ - */ - -#include - -#if defined(CONFIG_GUS) && defined(CONFIG_MIDI) -#include "gus_hw.h" - -static int midi_busy = 0, input_opened = 0; -static int my_dev; -static int output_used = 0; -static volatile unsigned char gus_midi_control; - -static void (*midi_input_intr) (int dev, unsigned char data); - -static unsigned char tmp_queue[256]; -static volatile int qlen; -static volatile unsigned char qhead, qtail; -extern int gus_base, gus_irq, gus_dma; -extern sound_os_info *gus_osp; - -#define GUS_MIDI_STATUS() inb( u_MidiStatus) - -static int -gus_midi_open(int dev, int mode, - void (*input) (int dev, unsigned char data), - void (*output) (int dev) -) -{ - - if (midi_busy) { - printf("GUS: Midi busy\n"); - return -(EBUSY); - } - outb(u_MidiControl, MIDI_RESET); - gus_delay(); - - gus_midi_control = 0; - input_opened = 0; - - if (mode == OPEN_READ || mode == OPEN_READWRITE) { - gus_midi_control |= MIDI_ENABLE_RCV; - input_opened = 1; - } - if (mode == OPEN_WRITE || mode == OPEN_READWRITE) { - gus_midi_control |= MIDI_ENABLE_XMIT; - } - outb(u_MidiControl, gus_midi_control); /* Enable */ - - midi_busy = 1; - qlen = qhead = qtail = output_used = 0; - midi_input_intr = input; - - return 0; -} - -static int -dump_to_midi(unsigned char midi_byte) -{ - unsigned long flags; - int ok = 0; - - output_used = 1; - - flags = splhigh(); - - if (GUS_MIDI_STATUS() & MIDI_XMIT_EMPTY) { - ok = 1; - outb(u_MidiData, midi_byte); - } else { - /* - * Enable Midi xmit interrupts (again) - */ - gus_midi_control |= MIDI_ENABLE_XMIT; - outb(u_MidiControl, gus_midi_control); - } - - splx(flags); - return ok; -} - -static void -gus_midi_close(int dev) -{ - /* - * Reset FIFO pointers, disable intrs - */ - - outb(u_MidiControl, MIDI_RESET); - midi_busy = 0; -} - -static int -gus_midi_out(int dev, unsigned char midi_byte) -{ - - unsigned long flags; - - /* - * Drain the local queue first - */ - - flags = splhigh(); - - while (qlen && dump_to_midi(tmp_queue[qhead])) { - qlen--; - qhead++; - } - - splx(flags); - - /* - * Output the byte if the local queue is empty. - */ - - if (!qlen) - if (dump_to_midi(midi_byte)) - return 1; /* OK */ - - /* - * Put to the local queue - */ - - if (qlen >= 256) - return 0; /* Local queue full */ - - flags = splhigh(); - - tmp_queue[qtail] = midi_byte; - qlen++; - qtail++; - - splx(flags); - - return 1; -} - -static int -gus_midi_start_read(int dev) -{ - return 0; -} - -static int -gus_midi_end_read(int dev) -{ - return 0; -} - -static int -gus_midi_ioctl(int dev, unsigned cmd, ioctl_arg arg) -{ - return -(EINVAL); -} - -static void -gus_midi_kick(int dev) -{ -} - -static int -gus_midi_buffer_status(int dev) -{ - unsigned long flags; - - if (!output_used) - return 0; - - flags = splhigh(); - - if (qlen && dump_to_midi(tmp_queue[qhead])) { - qlen--; - qhead++; - } - splx(flags); - - return (qlen > 0) | !(GUS_MIDI_STATUS() & MIDI_XMIT_EMPTY); -} - -#define MIDI_SYNTH_NAME "Gravis Ultrasound Midi" -#define MIDI_SYNTH_CAPS SYNTH_CAP_INPUT -#include - -static struct midi_operations gus_midi_operations = -{ - {"Gravis UltraSound Midi", 0, 0, SNDCARD_GUS}, - &std_midi_synth, - {0}, - gus_midi_open, - gus_midi_close, - gus_midi_ioctl, - gus_midi_out, - gus_midi_start_read, - gus_midi_end_read, - gus_midi_kick, - NULL, /* command */ - gus_midi_buffer_status, - NULL -}; - -void -gus_midi_init() -{ - if (num_midis >= MAX_MIDI_DEV) { - printf("Sound: Too many midi devices detected\n"); - return; - } - outb(u_MidiControl, MIDI_RESET); - - std_midi_synth.midi_dev = my_dev = num_midis; - midi_devs[num_midis++] = &gus_midi_operations; - return; -} - -void -gus_midi_interrupt(int dummy) -{ - unsigned char stat, data; - unsigned long flags; - - flags = splhigh(); - - stat = GUS_MIDI_STATUS(); - - if (stat & MIDI_RCV_FULL) { - data = inb(u_MidiData); - if (input_opened) - midi_input_intr(my_dev, data); - } - if (stat & MIDI_XMIT_EMPTY) { - while (qlen && dump_to_midi(tmp_queue[qhead])) { - qlen--; - qhead++; - } - - if (!qlen) { - /* - * Disable Midi output interrupts, since no data in - * the buffer - */ - gus_midi_control &= ~MIDI_ENABLE_XMIT; - outb(u_MidiControl, gus_midi_control); - } - } - splx(flags); -} - -#endif diff --git a/sys/dev/sound/isa/i386/gus/gus_vol.c b/sys/dev/sound/isa/i386/gus/gus_vol.c deleted file mode 100644 index aa9cf3d723..0000000000 --- a/sys/dev/sound/isa/i386/gus/gus_vol.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * gus_vol.c - Compute volume for GUS. - * - * Greg Lee 1993. - * - * $DragonFly: src/sys/dev/sound/isa/i386/gus/Attic/gus_vol.c,v 1.2 2003/08/07 21:17:12 dillon Exp $ - */ -#include - -#ifdef CONFIG_GUS -#include "gus_linearvol.h" - -#define GUS_VOLUME gus_wave_volume - - -extern int gus_wave_volume; -unsigned short gus_adagio_vol(int vel, int mainv, int xpn, int voicev); -unsigned short gus_linear_vol(int vol, int mainvol); - -/* - * Calculate gus volume from note velocity, main volume, expression, and - * intrinsic patch volume given in patch library. Expression is multiplied - * in, so it emphasizes differences in note velocity, while main volume is - * added in -- I don't know whether this is right, but it seems reasonable to - * me. (In the previous stage, main volume controller messages were changed - * to expression controller messages, if they were found to be used for - * dynamic volume adjustments, so here, main volume can be assumed to be - * constant throughout a song.) - * - * Intrinsic patch volume is added in, but if over 64 is also multiplied in, so - * we can give a big boost to very weak voices like nylon guitar and the - * basses. The normal value is 64. Strings are assigned lower values. - */ -unsigned short -gus_adagio_vol(int vel, int mainv, int xpn, int voicev) -{ - int i, m, n, x; - - /* - * A voice volume of 64 is considered neutral, so adjust the main - * volume if something other than this neutral value was assigned in - * the patch library. - */ - x = 256 + 6 * (voicev - 64); - - /* - * Boost expression by voice volume above neutral. - */ - if (voicev > 65) - xpn += voicev - 64; - xpn += (voicev - 64) / 2; - - /* - * Combine multiplicative and level components. - */ - x = vel * xpn * 6 + (voicev / 4) * x; - -#ifdef GUS_VOLUME - /* - * Further adjustment by installation-specific master volume control - * (default 60). - */ - x = (x * GUS_VOLUME * GUS_VOLUME) / 10000; -#endif - -#ifdef GUS_USE_CHN_MAIN_VOLUME - /* - * Experimental support for the channel main volume - */ - - mainv = (mainv / 2) + 64; /* Scale to 64 to 127 */ - x = (x * mainv * mainv) / 16384; -#endif - - if (x < 2) - return (0); - else if (x >= 65535) - return ((15 << 8) | 255); - - /* - * Convert to gus's logarithmic form with 4 bit exponent i and 8 bit - * mantissa m. - */ - n = x; - i = 7; - if (n < 128) { - while (i > 0 && n < (1 << i)) - i--; - } else - while (n > 255) { - n >>= 1; - i++; - } - /* - * Mantissa is part of linear volume not expressed in exponent. - * (This is not quite like real logs -- I wonder if it's right.) - */ - m = x - (1 << i); - - /* - * Adjust mantissa to 8 bits. - */ - if (m > 0) { - if (i > 8) - m >>= i - 8; - else if (i < 8) - m <<= 8 - i; - } - return ((i << 8) + m); -} - -/* - * Volume-values are interpreted as linear values. Volume is based on the - * value supplied with SEQ_START_NOTE(), channel main volume (if compiled in) - * and the volume set by the mixer-device (default 60%). - */ - -unsigned short -gus_linear_vol(int vol, int mainvol) -{ - int mixer_mainvol; - - RANGE (vol, 0, 127) ; - -#ifdef GUS_VOLUME - mixer_mainvol = GUS_VOLUME; -#else - mixer_mainvol = 100; -#endif - -#ifdef GUS_USE_CHN_MAIN_VOLUME - RANGE (mainvol, 0, 127); -#else - mainvol = 127; -#endif - - return gus_linearvol[(((vol * mainvol) / 127) * mixer_mainvol) / 100]; -} - -#endif diff --git a/sys/dev/sound/isa/i386/gus/gus_wave.c b/sys/dev/sound/isa/i386/gus/gus_wave.c deleted file mode 100644 index 547b25cfb0..0000000000 --- a/sys/dev/sound/isa/i386/gus/gus_wave.c +++ /dev/null @@ -1,4588 +0,0 @@ -/* - * sound/gus_wave.c - * - * Driver for the Gravis UltraSound wave table synth. - * - * Copyright by Hannu Savolainen 1993, 1994 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/sound/gus_wave.c,v 1.32 1999/12/20 18:05:00 eivind Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/gus/Attic/gus_wave.c,v 1.3 2003/08/07 21:17:12 dillon Exp $ - */ - -#include - -#include -#include -#include "gus_hw.h" -#include -#include - -/* PnP stuff */ -#define GUS_PNP_ID 0x100561e - -#define MAX_CARDS 8 -#define MAX_GUS_PNP 12 - - -/* Static ports */ -#define PADDRESS 0x279 -#define PWRITE_DATA 0xa79 -#define SET_CSN 0x06 -#define PSTATUS 0x05 - -/* PnP Registers. Write to ADDRESS and then use WRITE/READ_DATA */ -#define SET_RD_DATA 0x00 -#define SERIAL_ISOLATION 0x01 -#define WAKE 0x03 - -#if defined(CONFIG_GUS) - -static IWAVE iw; -#define ENTER_CRITICAL - -#define LEAVE_CRITICAL - -#define MAX_SAMPLE 150 -#define MAX_PATCH 256 - - -static u_int gus_pnp_found[MAX_GUS_PNP] = - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - -struct voice_info { - u_long orig_freq; - u_long current_freq; - u_long mode; - int bender; - int bender_range; - int panning; - int midi_volume; - u_int initial_volume; - u_int current_volume; - int loop_irq_mode, loop_irq_parm; -#define LMODE_FINISH 1 -#define LMODE_PCM 2 -#define LMODE_PCM_STOP 3 - int volume_irq_mode, volume_irq_parm; -#define VMODE_HALT 1 -#define VMODE_ENVELOPE 2 -#define VMODE_START_NOTE 3 - - int env_phase; - u_char env_rate[6]; - u_char env_offset[6]; - - /* - * Volume computation parameters for gus_adagio_vol() - */ - int main_vol, expression_vol, patch_vol; - - /* Variables for "Ultraclick" removal */ - int dev_pending, note_pending, volume_pending, sample_pending; - char kill_pending; - long offset_pending; - -}; - -static struct voice_alloc_info *voice_alloc; - -extern int gus_base; -extern int gus_irq, gus_dma; -static int gus_dma2 = -1; -static int dual_dma_mode = 0; -static long gus_mem_size = 0; -static long free_mem_ptr = 0; -static int gus_no_dma = 0; -static int nr_voices = 0; -static int gus_devnum = 0; -static int volume_base, volume_scale, volume_method; -static int gus_recmask = SOUND_MASK_MIC; -static int recording_active = 0; -static int only_read_access = 0; -static int only_8_bits = 0; - -int gus_wave_volume = 60; -static int gus_pcm_volume = 80; -int have_gus_max = 0; -static int gus_line_vol = 100, gus_mic_vol = 0; -static u_char mix_image = 0x00; - -int gus_timer_enabled = 0; -/* - * Current version of this driver doesn't allow synth and PCM functions at - * the same time. The active_device specifies the active driver - */ -static int active_device = 0; - -#define GUS_DEV_WAVE 1 /* Wave table synth */ -#define GUS_DEV_PCM_DONE 2 /* PCM device, transfer done */ -#define GUS_DEV_PCM_CONTINUE 3 /* PCM device, transfer done ch. 1/2 */ - -static int gus_sampling_speed; -static int gus_sampling_channels; -static int gus_sampling_bits; - -static int *dram_sleeper = NULL; -static volatile struct snd_wait dram_sleep_flag = -{0}; - -/* - * Variables and buffers for PCM output - */ -#define MAX_PCM_BUFFERS (32*MAX_REALTIME_FACTOR) /* Don't change */ - -static int pcm_bsize, pcm_nblk, pcm_banksize; -static int pcm_datasize[MAX_PCM_BUFFERS]; -static volatile int pcm_head, pcm_tail, pcm_qlen; -static volatile int pcm_active; -static volatile int dma_active; -static int pcm_opened = 0; -static int pcm_current_dev; -static int pcm_current_block; -static u_long pcm_current_buf; -static int pcm_current_count; -static int pcm_current_intrflag; - -extern sound_os_info *gus_osp; - -static struct voice_info voices[32]; - -static int freq_div_table[] = -{ - 44100, /* 14 */ - 41160, /* 15 */ - 38587, /* 16 */ - 36317, /* 17 */ - 34300, /* 18 */ - 32494, /* 19 */ - 30870, /* 20 */ - 29400, /* 21 */ - 28063, /* 22 */ - 26843, /* 23 */ - 25725, /* 24 */ - 24696, /* 25 */ - 23746, /* 26 */ - 22866, /* 27 */ - 22050, /* 28 */ - 21289, /* 29 */ - 20580, /* 30 */ - 19916, /* 31 */ - 19293 /* 32 */ -}; - -static struct patch_info *samples; -static struct patch_info *dbg_samples; -static int dbg_samplep; - -static long sample_ptrs[MAX_SAMPLE + 1]; -static int sample_map[32]; -static int free_sample; -static int mixer_type = 0; - - -static int patch_table[MAX_PATCH]; -static int patch_map[32]; - -static struct synth_info gus_info = -{"Gravis UltraSound", 0, SYNTH_TYPE_SAMPLE, SAMPLE_TYPE_GUS, 0, 16, 0, MAX_PATCH}; - -static void gus_default_mixer_init(void); - -static int guswave_start_note2(int dev, int voice, int note_num, int volume); -static void gus_poke(long addr, u_char data); -static void compute_and_set_volume(int voice, int volume, int ramp_time); -extern u_short gus_adagio_vol(int vel, int mainv, int xpn, int voicev); -extern u_short gus_linear_vol(int vol, int mainvol); -static void compute_volume(int voice, int volume); -static void do_volume_irq(int voice); -static void set_input_volumes(void); -static void gus_tmr_install(int io_base); - -static void SEND(int d, int r); -static int get_serial(int rd_port, u_char *data); -static void send_Initiation_LFSR(void); -static int isolation_protocol(int rd_port); - - -#define INSTANT_RAMP -1 /* Instant change. No ramping */ -#define FAST_RAMP 0 /* Fastest possible ramp */ - - -/* Crystal Select */ -#define CODEC_XTAL2 0x01 /* 16.9344 crystal */ -#define CODEC_XTAL1 0x00 /* 24.576 crystal */ -/************************************************************************/ - -/************************************************************************/ -/* Definitions for CONFIG_1 register */ -#define CODEC_CFIG1I_DEFAULT 0x03 | 0x8 -#define CODEC_CAPTURE_PIO 0x80 /* Capture PIO enable */ -#define CODEC_PLAYBACK_PIO 0x40 /* Playback PIO enable */ -#define CODEC_AUTOCALIB 0x08 /* auto calibrate */ -#define CODEC_SINGLE_DMA 0x04 /* Use single DMA channel */ -#define CODEC_RE 0x02 /* Capture enable */ -#define CODEC_PE 0x01 /* playback enable */ -/************************************************************************/ - -/************************************************************************/ -/* Definitions for CONFIG_2 register */ -#define CODEC_CFIG2I_DEFAULT 0x81 -#define CODEC_OFVS 0x80 /* Output Full Scale Voltage */ -#define CODEC_TE 0x40 /* Timer Enable */ -#define CODEC_RSCD 0x20 /* Recors Sample Counter Disable */ -#define CODEC_PSCD 0x10 /* Playback Sample Counter Disable */ -#define CODEC_DAOF 0x01 /* D/A Ouput Force Enable */ -/************************************************************************/ - -/************************************************************************/ -/* Definitions for CONFIG_3 register */ -/* #define CODEC_CFIG3I_DEFAULT 0xe0 0x02 when synth DACs are working */ - -#define CODEC_CFIG3I_DEFAULT 0xc0 /* 0x02 when synth DACs are working */ -#define CODEC_RPIE 0x80 /* Record FIFO IRQ Enable */ -#define CODEC_PPIE 0x40 /* Playback FIFO IRQ Enable */ -#define CODEC_FT_MASK 0x30 /* FIFO Threshold Select */ -#define CODEC_PVFM 0x04 /* Playback Variable Frequency Mode */ -#define CODEC_SYNA 0x02 /* AUX1/Synth Signal Select */ -/************************************************************************/ - -/************************************************************************/ -/* Definitions for EXTERNAL_CONTROL register */ -#define CODEC_CEXTI_DEFAULT 0x00 -#define CODEC_IRQ_ENABLE 0x02 /* interrupt enable */ -#define CODEC_GPOUT1 0x80 /* external control #1 */ -#define CODEC_GPOUT0 0x40 /* external control #0 */ -/************************************************************************/ - -/************************************************************************/ -/* Definitions for MODE_SELECT_ID register */ -#define CODEC_MODE_DEFAULT 0x40 -#define CODEC_MODE_MASK 0x60 -#define CODEC_ID_BIT4 0x80 -#define CODEC_ID_BIT3_0 0x0F -/************************************************************************/ -#define CONFIG_1 0x09 -#define EXTERNAL_CONTROL 0x0a/* Pin control */ -#define STATUS_2 0x0b/* Test and initialization */ -#define MODE_SELECT_ID 0x0c/* Miscellaneaous information */ -#define LOOPBACK 0x0d/* Digital Mix */ -#define UPPER_PLAY_COUNT 0x0e/* Playback Upper Base Count */ -#define LOWER_PLAY_COUNT 0x0f/* Playback Lower Base Count */ -#define CONFIG_2 0x10 -#define CONFIG_3 0x11 - - -#define IWL_CODEC_OUT(reg, val) \ - { outb(iwl_codec_base, reg); outb(iwl_codec_data, val); } - -#define IWL_CODEC_IN(reg, val) \ - { outb(iwl_codec_base, reg); val = inb(iwl_codec_data); } - - -static u_char gus_look8(int reg); - -static void gus_write16(int reg, u_int data); - -static u_short gus_read16(int reg); - -static void gus_write_addr(int reg, u_long address, int is16bit); -static void IwaveLineLevel(char level, char index); -static void IwaveInputSource(BYTE index, BYTE source); -static void IwavePnpGetCfg(void); -static void IwavePnpDevice(BYTE dev); -static void IwavePnpSetCfg(void); -static void IwavePnpKey(void); -static BYTE IwavePnpIsol(PORT * pnpread); -static void IwavePnpPeek(PORT pnprdp, WORD bytes, BYTE * data); -static void IwavePnpActivate(BYTE dev, BYTE bool); -static void IwavePnpWake(BYTE csn); -static BYTE IwavePnpPing(DWORD VendorID); -static WORD IwaveMemSize(void); -static BYTE IwaveMemPeek(ADDRESS addr); -static void IwaveMemPoke(ADDRESS addr, BYTE datum); -static void IwaveMemCfg(DWORD * lpbanks); -static void IwaveCodecIrq(BYTE mode); -static WORD IwaveRegPeek(DWORD reg_mnem); - -static void IwaveRegPoke(DWORD reg_mnem, WORD datum); -static void IwaveCodecMode(char mode); -static void IwaveLineMute(BYTE mute, BYTE inx); -static void Iwaveinitcodec(void); -int IwaveOpen(char voices, char mode, struct address_info * hw); - - -static void -reset_sample_memory(void) -{ - int i; - - for (i = 0; i <= MAX_SAMPLE; i++) - sample_ptrs[i] = -1; - for (i = 0; i < 32; i++) - sample_map[i] = -1; - for (i = 0; i < 32; i++) - patch_map[i] = -1; - - gus_poke(0, 0); /* Put a silent sample to the beginning */ - gus_poke(1, 0); - free_mem_ptr = 2; - - free_sample = 0; - - for (i = 0; i < MAX_PATCH; i++) - patch_table[i] = -1; -} - -void -gus_delay(void) -{ - int i; - - for (i = 0; i < 7; i++) - inb(u_DRAMIO); -} - -static void -gus_poke(long addr, u_char data) -{ /* Writes a byte to the DRAM */ - u_long flags; - - flags = splhigh(); - outb(u_Command, 0x43); - outb(u_DataLo, addr & 0xff); - outb(u_DataHi, (addr >> 8) & 0xff); - - outb(u_Command, 0x44); - outb(u_DataHi, (addr >> 16) & 0xff); - outb(u_DRAMIO, data); - splx(flags); -} - -static u_char -gus_peek(long addr) -{ /* Reads a byte from the DRAM */ - u_long flags; - u_char tmp; - - flags = splhigh(); - outb(u_Command, 0x43); - outb(u_DataLo, addr & 0xff); - outb(u_DataHi, (addr >> 8) & 0xff); - - outb(u_Command, 0x44); - outb(u_DataHi, (addr >> 16) & 0xff); - tmp = inb(u_DRAMIO); - splx(flags); - - return tmp; -} - -void -gus_write8(int reg, u_int data) -{ /* Writes to an indirect register (8 bit) */ - u_long flags; - - flags = splhigh(); - outb(u_Command, reg); - outb(u_DataHi, (u_char) (data & 0xff)); - splx(flags); -} - -u_char -gus_read8(int reg) -{ /* Reads from an indirect register (8 bit). Offset 0x80. */ - u_long flags; - u_char val; - - flags = splhigh(); - outb(u_Command, reg | 0x80); - val = inb(u_DataHi); - splx(flags); - - return val; -} - -static u_char -gus_look8(int reg) -{ /* Reads from an indirect register (8 bit). No additional offset. */ - u_long flags; - u_char val; - - flags = splhigh(); - outb(u_Command, reg); - val = inb(u_DataHi); - splx(flags); - - return val; -} - -static void -gus_write16(int reg, u_int data) -{ /* Writes to an indirect register (16 bit) */ - u_long flags; - - flags = splhigh(); - - outb(u_Command, reg); - - outb(u_DataLo, (u_char) (data & 0xff)); - outb(u_DataHi, (u_char) ((data >> 8) & 0xff)); - - splx(flags); -} - -static u_short -gus_read16(int reg) -{ /* Reads from an indirect register (16 bit). Offset 0x80. */ - u_long flags; - u_char hi, lo; - - flags = splhigh(); - - outb(u_Command, reg | 0x80); - - lo = inb(u_DataLo); - hi = inb(u_DataHi); - - splx(flags); - - return ((hi << 8) & 0xff00) | lo; -} - -static void -gus_write_addr(int reg, u_long address, int is16bit) -{ /* Writes an 24 bit memory address */ - u_long hold_address; - u_long flags; - - flags = splhigh(); - if (is16bit) { - /* - * Special processing required for 16 bit patches - */ - - hold_address = address; - address = address >> 1; - address &= 0x0001ffffL; - address |= (hold_address & 0x000c0000L); - } - gus_write16(reg, (u_short) ((address >> 7) & 0xffff)); - gus_write16(reg + 1, (u_short) ((address << 9) & 0xffff)); - /* - * Could writing twice fix problems with GUS_VOICE_POS() ? Lets try... - */ - gus_delay(); - gus_write16(reg, (u_short) ((address >> 7) & 0xffff)); - gus_write16(reg + 1, (u_short) ((address << 9) & 0xffff)); - splx(flags); -} - -static void -gus_select_voice(int voice) -{ - if (voice < 0 || voice > 31) - return; - - outb(u_Voice, voice); -} - -static void -gus_select_max_voices(int nvoices) -{ - if (nvoices < 14) - nvoices = 14; - if (nvoices > 32) - nvoices = 32; - - voice_alloc->max_voice = nr_voices = nvoices; - - gus_write8(0x0e, (nvoices - 1) | 0xc0); -} - -static void -gus_voice_on(u_int mode) -{ - gus_write8(0x00, (u_char) (mode & 0xfc)); - gus_delay(); - gus_write8(0x00, (u_char) (mode & 0xfc)); -} - -static void -gus_voice_off(void) -{ - gus_write8(0x00, gus_read8(0x00) | 0x03); -} - -static void -gus_voice_mode(u_int m) -{ - u_char mode = (u_char) (m & 0xff); - - gus_write8(0x00, (gus_read8(0x00) & 0x03) | - (mode & 0xfc)); /* Don't touch last two bits */ - gus_delay(); - gus_write8(0x00, (gus_read8(0x00) & 0x03) | (mode & 0xfc)); -} - -static void -gus_voice_freq(u_long freq) -{ - u_long divisor = freq_div_table[nr_voices - 14]; - u_short fc; - - fc = (u_short) (((freq << 9) + (divisor >> 1)) / divisor); - fc = fc << 1; - - gus_write16(0x01, fc); -} - -static void -gus_voice_volume(u_int vol) -{ - gus_write8(0x0d, 0x03); /* Stop ramp before setting volume */ - gus_write16(0x09, (u_short) (vol << 4)); -} - -static void -gus_voice_balance(u_int balance) -{ - gus_write8(0x0c, (u_char) (balance & 0xff)); -} - -static void -gus_ramp_range(u_int low, u_int high) -{ - gus_write8(0x07, (u_char) ((low >> 4) & 0xff)); - gus_write8(0x08, (u_char) ((high >> 4) & 0xff)); -} - -static void -gus_ramp_rate(u_int scale, u_int rate) -{ - gus_write8(0x06, (u_char) (((scale & 0x03) << 6) | (rate & 0x3f))); -} - -static void -gus_rampon(u_int m) -{ - u_char mode = (u_char) (m & 0xff); - - gus_write8(0x0d, mode & 0xfc); - gus_delay(); - gus_write8(0x0d, mode & 0xfc); -} - -static void -gus_ramp_mode(u_int m) -{ - u_char mode = (u_char) (m & 0xff); - - gus_write8(0x0d, (gus_read8(0x0d) & 0x03) | - (mode & 0xfc)); /* Leave the last 2 bits alone */ - gus_delay(); - gus_write8(0x0d, (gus_read8(0x0d) & 0x03) | (mode & 0xfc)); -} - -static void -gus_rampoff(void) -{ - gus_write8(0x0d, 0x03); -} - -static void -gus_set_voice_pos(int voice, long position) -{ - int sample_no; - - if ((sample_no = sample_map[voice]) != -1) { - if (position < samples[sample_no].len) { - if (voices[voice].volume_irq_mode == VMODE_START_NOTE) - voices[voice].offset_pending = position; - else - gus_write_addr(0x0a, sample_ptrs[sample_no] + position, - samples[sample_no].mode & WAVE_16_BITS); - } - } -} - -static void -gus_voice_init(int voice) -{ - u_long flags; - - flags = splhigh(); - gus_select_voice(voice); - gus_voice_volume(0); - gus_voice_off(); - gus_write_addr(0x0a, 0, 0); /* Set current position to 0 */ - gus_write8(0x00, 0x03); /* Voice off */ - gus_write8(0x0d, 0x03); /* Ramping off */ - voice_alloc->map[voice] = 0; - voice_alloc->alloc_times[voice] = 0; - splx(flags); - -} - -static void -gus_voice_init2(int voice) -{ - voices[voice].panning = 0; - voices[voice].mode = 0; - voices[voice].orig_freq = 20000; - voices[voice].current_freq = 20000; - voices[voice].bender = 0; - voices[voice].bender_range = 200; - voices[voice].initial_volume = 0; - voices[voice].current_volume = 0; - voices[voice].loop_irq_mode = 0; - voices[voice].loop_irq_parm = 0; - voices[voice].volume_irq_mode = 0; - voices[voice].volume_irq_parm = 0; - voices[voice].env_phase = 0; - voices[voice].main_vol = 127; - voices[voice].patch_vol = 127; - voices[voice].expression_vol = 127; - voices[voice].sample_pending = -1; -} - -static void -step_envelope(int voice) -{ - u_int vol, prev_vol, phase; - u_char rate; - long int flags; - - if (voices[voice].mode & WAVE_SUSTAIN_ON && voices[voice].env_phase == 2) { - flags = splhigh(); - gus_select_voice(voice); - gus_rampoff(); - splx(flags); - return; - /* - * Sustain phase begins. Continue envelope after receiving - * note off. - */ - } - if (voices[voice].env_phase >= 5) { /* Envelope finished. Shoot - * the voice down */ - gus_voice_init(voice); - return; - } - prev_vol = voices[voice].current_volume; - phase = ++voices[voice].env_phase; - compute_volume(voice, voices[voice].midi_volume); - vol = voices[voice].initial_volume * voices[voice].env_offset[phase] / 255; - rate = voices[voice].env_rate[phase]; - - flags = splhigh(); - gus_select_voice(voice); - gus_voice_volume(prev_vol); - gus_write8(0x06, rate); /* Ramping rate */ - - voices[voice].volume_irq_mode = VMODE_ENVELOPE; - - if (((vol - prev_vol) / 64) == 0) { /* No significant volume - * change */ - splx(flags); - step_envelope(voice); /* Continue the envelope on the next - * step */ - return; - } - if (vol > prev_vol) { - if (vol >= (4096 - 64)) - vol = 4096 - 65; - gus_ramp_range(0, vol); - gus_rampon(0x20); /* Increasing volume, with IRQ */ - } else { - if (vol <= 64) - vol = 65; - gus_ramp_range(vol, 4030); - gus_rampon(0x60); /* Decreasing volume, with IRQ */ - } - voices[voice].current_volume = vol; - splx(flags); -} - -static void -init_envelope(int voice) -{ - voices[voice].env_phase = -1; - voices[voice].current_volume = 64; - - step_envelope(voice); -} - -static void -start_release(int voice, long int flags) -{ - if (gus_read8(0x00) & 0x03) - return; /* Voice already stopped */ - - voices[voice].env_phase = 2; /* Will be incremented by - * step_envelope */ - - voices[voice].current_volume = - voices[voice].initial_volume = - gus_read16(0x09) >> 4; /* Get current volume */ - - voices[voice].mode &= ~WAVE_SUSTAIN_ON; - gus_rampoff(); - splx(flags); - step_envelope(voice); -} - -static void -gus_voice_fade(int voice) -{ - int instr_no = sample_map[voice], is16bits; - long int flags; - - flags = splhigh(); - gus_select_voice(voice); - - if (instr_no < 0 || instr_no > MAX_SAMPLE) { - gus_write8(0x00, 0x03); /* Hard stop */ - voice_alloc->map[voice] = 0; - splx(flags); - return; - } - is16bits = (samples[instr_no].mode & WAVE_16_BITS) ? 1 : 0; /* 8 or 16 bits */ - - if (voices[voice].mode & WAVE_ENVELOPES) { - start_release(voice, flags); - return; - } - /* - * Ramp the volume down but not too quickly. - */ - if ((int) (gus_read16(0x09) >> 4) < 100) { /* Get current volume */ - gus_voice_off(); - gus_rampoff(); - gus_voice_init(voice); - return; - } - gus_ramp_range(65, 4030); - gus_ramp_rate(2, 4); - gus_rampon(0x40 | 0x20);/* Down, once, with IRQ */ - voices[voice].volume_irq_mode = VMODE_HALT; - splx(flags); -} - -static void -gus_reset(void) -{ - int i; - - gus_select_max_voices(24); - volume_base = 3071; - volume_scale = 4; - volume_method = VOL_METHOD_ADAGIO; - - for (i = 0; i < 32; i++) { - gus_voice_init(i); /* Turn voice off */ - gus_voice_init2(i); - } - - inb(u_Status); /* Touch the status register */ - - gus_look8(0x41); /* Clear any pending DMA IRQs */ - gus_look8(0x49); /* Clear any pending sample IRQs */ - - gus_read8(0x0f); /* Clear pending IRQs */ - -} - -static void -gus_initialize(void) -{ - u_long flags; - u_char dma_image, irq_image, tmp; - - static u_char gus_irq_map[16] = - {0, 0, 0, 3, 0, 2, 0, 4, 0, 1, 0, 5, 6, 0, 0, 7}; - - static u_char gus_dma_map[8] = - {0, 1, 0, 2, 0, 3, 4, 5}; - - flags = splhigh(); - gus_write8(0x4c, 0); /* Reset GF1 */ - gus_delay(); - gus_delay(); - - gus_write8(0x4c, 1); /* Release Reset */ - gus_delay(); - gus_delay(); - - /* - * Clear all interrupts - */ - - gus_write8(0x41, 0); /* DMA control */ - gus_write8(0x45, 0); /* Timer control */ - gus_write8(0x49, 0); /* Sample control */ - - gus_select_max_voices(24); - - inb(u_Status); /* Touch the status register */ - - gus_look8(0x41); /* Clear any pending DMA IRQs */ - gus_look8(0x49); /* Clear any pending sample IRQs */ - gus_read8(0x0f); /* Clear pending IRQs */ - - gus_reset(); /* Resets all voices */ - - gus_look8(0x41); /* Clear any pending DMA IRQs */ - gus_look8(0x49); /* Clear any pending sample IRQs */ - gus_read8(0x0f); /* Clear pending IRQs */ - - gus_write8(0x4c, 7); /* Master reset | DAC enable | IRQ enable */ - - /* - * Set up for Digital ASIC - */ - - outb(gus_base + 0x0f, 0x05); - - mix_image |= 0x02; /* Disable line out (for a moment) */ - outb(u_Mixer, mix_image); - - outb(u_IRQDMAControl, 0x00); - - outb(gus_base + 0x0f, 0x00); - - /* - * Now set up the DMA and IRQ interface - * - * The GUS supports two IRQs and two DMAs. - * - * Just one DMA channel is used. This prevents simultaneous ADC and DAC. - * Adding this support requires significant changes to the dmabuf.c, - * dsp.c and audio.c also. - */ - - irq_image = 0; - tmp = gus_irq_map[gus_irq]; - if (!tmp) - printf("Warning! GUS IRQ not selected\n"); - irq_image |= tmp; - irq_image |= 0x40; /* Combine IRQ1 (GF1) and IRQ2 (Midi) */ - - dual_dma_mode = 1; - if (gus_dma2 == gus_dma || gus_dma2 == -1) { - dual_dma_mode = 0; - dma_image = 0x40; /* Combine DMA1 (DRAM) and IRQ2 (ADC) */ - - tmp = gus_dma_map[gus_dma]; - if (!tmp) - printf("Warning! GUS DMA not selected\n"); - - dma_image |= tmp; - } else - /* Setup dual DMA channel mode for GUS MAX */ - { - dma_image = gus_dma_map[gus_dma]; - if (!dma_image) - printf("Warning! GUS DMA not selected\n"); - - tmp = gus_dma_map[gus_dma2] << 3; - if (!tmp) { - printf("Warning! Invalid GUS MAX DMA\n"); - tmp = 0x40; /* Combine DMA channels */ - dual_dma_mode = 0; - } - dma_image |= tmp; - } - - /* - * For some reason the IRQ and DMA addresses must be written twice - */ - - /* - * Doing it first time - */ - - outb(u_Mixer, mix_image); /* Select DMA control */ - outb(u_IRQDMAControl, dma_image | 0x80); /* Set DMA address */ - - outb(u_Mixer, mix_image | 0x40); /* Select IRQ control */ - outb(u_IRQDMAControl, irq_image); /* Set IRQ address */ - - /* - * Doing it second time - */ - - outb(u_Mixer, mix_image); /* Select DMA control */ - outb(u_IRQDMAControl, dma_image); /* Set DMA address */ - - outb(u_Mixer, mix_image | 0x40); /* Select IRQ control */ - outb(u_IRQDMAControl, irq_image); /* Set IRQ address */ - - gus_select_voice(0); /* This disables writes to IRQ/DMA reg */ - - mix_image &= ~0x02; /* Enable line out */ - mix_image |= 0x08; /* Enable IRQ */ - outb(u_Mixer, mix_image); /* Turn mixer channels on Note! Mic - * in is left off. */ - - gus_select_voice(0); /* This disables writes to IRQ/DMA reg */ - - gusintr(0); /* Serve pending interrupts */ - splx(flags); -} - -int -gus_wave_detect(int baseaddr) -{ - u_long i; - u_long loc; - gus_base = baseaddr; - - gus_write8(0x4c, 0); /* Reset GF1 */ - gus_delay(); - gus_delay(); - - gus_write8(0x4c, 1); /* Release Reset */ - gus_delay(); - gus_delay(); - - /* See if there is first block there.... */ - gus_poke(0L, 0xaa); - if (gus_peek(0L) != 0xaa) - return (0); - - /* Now zero it out so that I can check for mirroring .. */ - gus_poke(0L, 0x00); - for (i = 1L; i < 1024L; i++) { - int n, failed; - - /* check for mirroring ... */ - if (gus_peek(0L) != 0) - break; - loc = i << 10; - - for (n = loc - 1, failed = 0; n <= loc; n++) { - gus_poke(loc, 0xaa); - if (gus_peek(loc) != 0xaa) - failed = 1; - - gus_poke(loc, 0x55); - if (gus_peek(loc) != 0x55) - failed = 1; - } - - if (failed) - break; - } - gus_mem_size = i << 10; - return 1; -} - -static int -guswave_ioctl(int dev, - u_int cmd, ioctl_arg arg) -{ - - switch (cmd) { - case SNDCTL_SYNTH_INFO: - gus_info.nr_voices = nr_voices; - bcopy(&gus_info, &(((char *) arg)[0]), sizeof(gus_info)); - return 0; - break; - - case SNDCTL_SEQ_RESETSAMPLES: - reset_sample_memory(); - return 0; - break; - - case SNDCTL_SEQ_PERCMODE: - return 0; - break; - - case SNDCTL_SYNTH_MEMAVL: - return gus_mem_size - free_mem_ptr - 32; - - default: - return -(EINVAL); - } -} - -static int -guswave_set_instr(int dev, int voice, int instr_no) -{ - int sample_no; - - if (instr_no < 0 || instr_no > MAX_PATCH) - return -(EINVAL); - - if (voice < 0 || voice > 31) - return -(EINVAL); - - if (voices[voice].volume_irq_mode == VMODE_START_NOTE) { - voices[voice].sample_pending = instr_no; - return 0; - } - sample_no = patch_table[instr_no]; - patch_map[voice] = -1; - - if (sample_no < 0) { - printf("GUS: Undefined patch %d for voice %d\n", instr_no, voice); - return -(EINVAL); /* Patch not defined */ - } - if (sample_ptrs[sample_no] == -1) { /* Sample not loaded */ - printf("GUS: Sample #%d not loaded for patch %d (voice %d)\n", - sample_no, instr_no, voice); - return -(EINVAL); - } - sample_map[voice] = sample_no; - patch_map[voice] = instr_no; - return 0; -} - -static int -guswave_kill_note(int dev, int voice, int note, int velocity) -{ - u_long flags; - - flags = splhigh(); - /* voice_alloc->map[voice] = 0xffff; */ - if (voices[voice].volume_irq_mode == VMODE_START_NOTE) { - voices[voice].kill_pending = 1; - splx(flags); - } else { - splx(flags); - gus_voice_fade(voice); - } - - splx(flags); - return 0; -} - -static void -guswave_aftertouch(int dev, int voice, int pressure) -{ -} - -static void -guswave_panning(int dev, int voice, int value) -{ - if (voice >= 0 || voice < 32) - voices[voice].panning = value; -} - -static void -guswave_volume_method(int dev, int mode) -{ - if (mode == VOL_METHOD_LINEAR || mode == VOL_METHOD_ADAGIO) - volume_method = mode; -} - -static void -compute_volume(int voice, int volume) -{ - if (volume < 128) - voices[voice].midi_volume = volume; - - switch (volume_method) { - case VOL_METHOD_ADAGIO: - voices[voice].initial_volume = - gus_adagio_vol(voices[voice].midi_volume, voices[voice].main_vol, - voices[voice].expression_vol, voices[voice].patch_vol); - break; - - case VOL_METHOD_LINEAR:/* Totally ignores patch-volume and expression */ - voices[voice].initial_volume = - gus_linear_vol(volume, voices[voice].main_vol); - break; - - default: - voices[voice].initial_volume = volume_base + - (voices[voice].midi_volume * volume_scale); - } - - if (voices[voice].initial_volume > 4030) - voices[voice].initial_volume = 4030; -} - -static void -compute_and_set_volume(int voice, int volume, int ramp_time) -{ - int curr, target, rate; - u_long flags; - - compute_volume(voice, volume); - voices[voice].current_volume = voices[voice].initial_volume; - - flags = splhigh(); - /* - * CAUTION! Interrupts disabled. Enable them before returning - */ - - gus_select_voice(voice); - - curr = gus_read16(0x09) >> 4; - target = voices[voice].initial_volume; - - if (ramp_time == INSTANT_RAMP) { - gus_rampoff(); - gus_voice_volume(target); - splx(flags); - return; - } - if (ramp_time == FAST_RAMP) - rate = 63; - else - rate = 16; - gus_ramp_rate(0, rate); - - if ((target - curr) / 64 == 0) { /* Close enough to target. */ - gus_rampoff(); - gus_voice_volume(target); - splx(flags); - return; - } - if (target > curr) { - if (target > (4095 - 65)) - target = 4095 - 65; - gus_ramp_range(curr, target); - gus_rampon(0x00); /* Ramp up, once, no IRQ */ - } else { - if (target < 65) - target = 65; - - gus_ramp_range(target, curr); - gus_rampon(0x40); /* Ramp down, once, no irq */ - } - splx(flags); -} - -static void -dynamic_volume_change(int voice) -{ - u_char status; - u_long flags; - - flags = splhigh(); - gus_select_voice(voice); - status = gus_read8(0x00); /* Get voice status */ - splx(flags); - - if (status & 0x03) - return; /* Voice was not running */ - - if (!(voices[voice].mode & WAVE_ENVELOPES)) { - compute_and_set_volume(voice, voices[voice].midi_volume, 1); - return; - } - /* - * Voice is running and has envelopes. - */ - - flags = splhigh(); - gus_select_voice(voice); - status = gus_read8(0x0d); /* Ramping status */ - splx(flags); - - if (status & 0x03) { /* Sustain phase? */ - compute_and_set_volume(voice, voices[voice].midi_volume, 1); - return; - } - if (voices[voice].env_phase < 0) - return; - - compute_volume(voice, voices[voice].midi_volume); - -} - -static void -guswave_controller(int dev, int voice, int ctrl_num, int value) -{ - u_long flags; - u_long freq; - - if (voice < 0 || voice > 31) - return; - - switch (ctrl_num) { - case CTRL_PITCH_BENDER: - voices[voice].bender = value; - - if (voices[voice].volume_irq_mode != VMODE_START_NOTE) { - freq = compute_finetune(voices[voice].orig_freq, value, - voices[voice].bender_range); - voices[voice].current_freq = freq; - - flags = splhigh(); - gus_select_voice(voice); - gus_voice_freq(freq); - splx(flags); - } - break; - - case CTRL_PITCH_BENDER_RANGE: - voices[voice].bender_range = value; - break; - case CTL_EXPRESSION: - value /= 128; - case CTRL_EXPRESSION: - if (volume_method == VOL_METHOD_ADAGIO) { - voices[voice].expression_vol = value; - if (voices[voice].volume_irq_mode != VMODE_START_NOTE) - dynamic_volume_change(voice); - } - break; - - case CTL_PAN: - voices[voice].panning = (value * 2) - 128; - break; - - case CTL_MAIN_VOLUME: - value = (value * 100) / 16383; - - case CTRL_MAIN_VOLUME: - voices[voice].main_vol = value; - if (voices[voice].volume_irq_mode != VMODE_START_NOTE) - dynamic_volume_change(voice); - break; - - default: - break; - } -} - -static int -guswave_start_note2(int dev, int voice, int note_num, int volume) -{ - int sample, best_sample, best_delta, delta_freq; - int is16bits, samplep, patch, pan; - u_long note_freq, base_note, freq, flags; - u_char mode = 0; - - if (voice < 0 || voice > 31) { - printf("GUS: Invalid voice\n"); - return -(EINVAL); - } - if (note_num == 255) { - if (voices[voice].mode & WAVE_ENVELOPES) { - voices[voice].midi_volume = volume; - dynamic_volume_change(voice); - return 0; - } - compute_and_set_volume(voice, volume, 1); - return 0; - } - if ((patch = patch_map[voice]) == -1) - return -(EINVAL); - if ((samplep = patch_table[patch]) == -1) - return -(EINVAL); - note_freq = note_to_freq(note_num); - - /* - * Find a sample within a patch so that the note_freq is between - * low_note and high_note. - */ - sample = -1; - - best_sample = samplep; - best_delta = 1000000; - while (samplep >= 0 && sample == -1) { - dbg_samples = samples; - dbg_samplep = samplep; - - delta_freq = note_freq - samples[samplep].base_note; - if (delta_freq < 0) - delta_freq = -delta_freq; - if (delta_freq < best_delta) { - best_sample = samplep; - best_delta = delta_freq; - } - if (samples[samplep].low_note <= note_freq && - note_freq <= samples[samplep].high_note) - sample = samplep; - else - samplep = samples[samplep].key; /* Follow link */ - } - if (sample == -1) - sample = best_sample; - - if (sample == -1) { - printf("GUS: Patch %d not defined for note %d\n", patch, note_num); - return 0; /* Should play default patch ??? */ - } - is16bits = (samples[sample].mode & WAVE_16_BITS) ? 1 : 0; - voices[voice].mode = samples[sample].mode; - voices[voice].patch_vol = samples[sample].volume; - - if (voices[voice].mode & WAVE_ENVELOPES) { - int i; - - for (i = 0; i < 6; i++) { - voices[voice].env_rate[i] = samples[sample].env_rate[i]; - voices[voice].env_offset[i] = samples[sample].env_offset[i]; - } - } - sample_map[voice] = sample; - - base_note = samples[sample].base_note / 100; /* Try to avoid overflows */ - note_freq /= 100; - - freq = samples[sample].base_freq * note_freq / base_note; - - voices[voice].orig_freq = freq; - - /* - * Since the pitch bender may have been set before playing the note, - * we have to calculate the bending now. - */ - - freq = compute_finetune(voices[voice].orig_freq, voices[voice].bender, - voices[voice].bender_range); - voices[voice].current_freq = freq; - - pan = (samples[sample].panning + voices[voice].panning) / 32; - pan += 7; - if (pan < 0) - pan = 0; - if (pan > 15) - pan = 15; - - if (samples[sample].mode & WAVE_16_BITS) { - mode |= 0x04; /* 16 bits */ - if ((sample_ptrs[sample] >> 18) != - ((sample_ptrs[sample] + samples[sample].len) >> 18)) - printf("GUS: Sample address error\n"); - } - /* - * CAUTION! Interrupts disabled. Don't return before enabling - */ - - flags = splhigh(); - gus_select_voice(voice); - gus_voice_off(); - gus_rampoff(); - - splx(flags); - - if (voices[voice].mode & WAVE_ENVELOPES) { - compute_volume(voice, volume); - init_envelope(voice); - } else { - compute_and_set_volume(voice, volume, 0); - } - - flags = splhigh(); - gus_select_voice(voice); - - if (samples[sample].mode & WAVE_LOOP_BACK) - gus_write_addr(0x0a, sample_ptrs[sample] + samples[sample].len - - voices[voice].offset_pending, is16bits); /* start=end */ - else - gus_write_addr(0x0a, sample_ptrs[sample] + voices[voice].offset_pending, - is16bits); /* Sample start=begin */ - - if (samples[sample].mode & WAVE_LOOPING) { - mode |= 0x08; - - if (samples[sample].mode & WAVE_BIDIR_LOOP) - mode |= 0x10; - - if (samples[sample].mode & WAVE_LOOP_BACK) { - gus_write_addr(0x0a, - sample_ptrs[sample] + samples[sample].loop_end - - voices[voice].offset_pending, is16bits); - mode |= 0x40; - } - gus_write_addr(0x02, sample_ptrs[sample] + samples[sample].loop_start, - is16bits); /* Loop start location */ - gus_write_addr(0x04, sample_ptrs[sample] + samples[sample].loop_end, - is16bits); /* Loop end location */ - } else { - mode |= 0x20; /* Loop IRQ at the end */ - voices[voice].loop_irq_mode = LMODE_FINISH; /* Ramp down at the end */ - voices[voice].loop_irq_parm = 1; - gus_write_addr(0x02, sample_ptrs[sample], - is16bits); /* Loop start location */ - gus_write_addr(0x04, sample_ptrs[sample] + samples[sample].len - 1, - is16bits); /* Loop end location */ - } - gus_voice_freq(freq); - gus_voice_balance(pan); - gus_voice_on(mode); - splx(flags); - - return 0; -} - -/* - * New guswave_start_note by Andrew J. Robinson attempts to minimize clicking - * when the note playing on the voice is changed. It uses volume ramping. - */ - -static int -guswave_start_note(int dev, int voice, int note_num, int volume) -{ - long int flags; - int mode; - int ret_val = 0; - - flags = splhigh(); - if (note_num == 255) { - if (voices[voice].volume_irq_mode == VMODE_START_NOTE) { - voices[voice].volume_pending = volume; - } else { - ret_val = guswave_start_note2(dev, voice, note_num, volume); - } - } else { - gus_select_voice(voice); - mode = gus_read8(0x00); - if (mode & 0x20) - gus_write8(0x00, mode & 0xdf); /* No interrupt! */ - - voices[voice].offset_pending = 0; - voices[voice].kill_pending = 0; - voices[voice].volume_irq_mode = 0; - voices[voice].loop_irq_mode = 0; - - if (voices[voice].sample_pending >= 0) { - splx(flags); /* Run temporarily with interrupts - * enabled */ - guswave_set_instr(voices[voice].dev_pending, voice, - voices[voice].sample_pending); - voices[voice].sample_pending = -1; - flags = splhigh(); - gus_select_voice(voice); /* Reselect the voice - * (just to be sure) */ - } - if ((mode & 0x01) || (int) ((gus_read16(0x09) >> 4) < 2065)) { - ret_val = guswave_start_note2(dev, voice, note_num, volume); - } else { - voices[voice].dev_pending = dev; - voices[voice].note_pending = note_num; - voices[voice].volume_pending = volume; - voices[voice].volume_irq_mode = VMODE_START_NOTE; - - gus_rampoff(); - gus_ramp_range(2000, 4065); - gus_ramp_rate(0, 63); /* Fastest possible rate */ - gus_rampon(0x20 | 0x40); /* Ramp down, once, irq */ - } - } - splx(flags); - return ret_val; -} - -static void -guswave_reset(int dev) -{ - int i; - - for (i = 0; i < 32; i++) { - gus_voice_init(i); - gus_voice_init2(i); - } -} - -static int -guswave_open(int dev, int mode) -{ - int err; - int otherside = audio_devs[dev]->otherside; - - if (otherside != -1) { - if (audio_devs[otherside]->busy) - return -(EBUSY); - } - if (audio_devs[dev]->busy) - return -(EBUSY); - - gus_initialize(); - voice_alloc->timestamp = 0; - - if ((err = DMAbuf_open_dma(gus_devnum)) < 0) { - printf("GUS: Loading saples without DMA\n"); - gus_no_dma = 1; /* Upload samples using PIO */ - } else - gus_no_dma = 0; - - dram_sleep_flag.aborting = 0; - dram_sleep_flag.mode = WK_NONE; - active_device = GUS_DEV_WAVE; - - audio_devs[dev]->busy = 1; - gus_reset(); - - return 0; -} - -static void -guswave_close(int dev) -{ - int otherside = audio_devs[dev]->otherside; - - if (otherside != -1) { - if (audio_devs[otherside]->busy) - return; - } - audio_devs[dev]->busy = 0; - - active_device = 0; - gus_reset(); - - if (!gus_no_dma) - DMAbuf_close_dma(gus_devnum); -} - -static int -guswave_load_patch(int dev, int format, snd_rw_buf * addr, - int offs, int count, int pmgr_flag) -{ - struct patch_info patch; - int instr; - long sizeof_patch; - - u_long blk_size, blk_end, left, src_offs, target; - - sizeof_patch = offsetof(struct patch_info, data); /* Header size */ - - if (format != GUS_PATCH) { - printf("GUS Error: Invalid patch format (key) 0x%x\n", format); - return -(EINVAL); - } - if (count < sizeof_patch) { - printf("GUS Error: Patch header too short\n"); - return -(EINVAL); - } - count -= sizeof_patch; - - if (free_sample >= MAX_SAMPLE) { - printf("GUS: Sample table full\n"); - return -(ENOSPC); - } - /* - * Copy the header from user space but ignore the first bytes which - * have been transferred already. - */ - - if (uiomove(&((char *) &patch)[offs], sizeof_patch - offs, addr)) { - printf("audio: Bad copyin()!\n"); - }; - - instr = patch.instr_no; - - if (instr < 0 || instr > MAX_PATCH) { - printf("GUS: Invalid patch number %d\n", instr); - return -(EINVAL); - } - if (count < patch.len) { - printf("GUS Warning: Patch record too short (%d<%d)\n", - count, (int) patch.len); - patch.len = count; - } - if (patch.len <= 0 || patch.len > gus_mem_size) { - printf("GUS: Invalid sample length %d\n", (int) patch.len); - return -(EINVAL); - } - if (patch.mode & WAVE_LOOPING) { - if (patch.loop_start < 0 || patch.loop_start >= patch.len) { - printf("GUS: Invalid loop start\n"); - return -(EINVAL); - } - if (patch.loop_end < patch.loop_start || patch.loop_end > patch.len) { - printf("GUS: Invalid loop end\n"); - return -(EINVAL); - } - } - free_mem_ptr = (free_mem_ptr + 31) & ~31; /* 32 byte alignment */ - -#define GUS_BANK_SIZE (256*1024) - - if (patch.mode & WAVE_16_BITS) { - /* - * 16 bit samples must fit one 256k bank. - */ - if (patch.len >= GUS_BANK_SIZE) { - printf("GUS: Sample (16 bit) too long %d\n", (int) patch.len); - return -(ENOSPC); - } - if ((free_mem_ptr / GUS_BANK_SIZE) != - ((free_mem_ptr + patch.len) / GUS_BANK_SIZE)) { - u_long tmp_mem = /* Aligning to 256K */ - ((free_mem_ptr / GUS_BANK_SIZE) + 1) * GUS_BANK_SIZE; - - if ((tmp_mem + patch.len) > gus_mem_size) - return -(ENOSPC); - - free_mem_ptr = tmp_mem; /* This leaves unusable memory */ - } - } - if ((free_mem_ptr + patch.len) > gus_mem_size) - return -(ENOSPC); - - sample_ptrs[free_sample] = free_mem_ptr; - - /* - * Tremolo is not possible with envelopes - */ - - if (patch.mode & WAVE_ENVELOPES) - patch.mode &= ~WAVE_TREMOLO; - - bcopy(&patch, (char *) &samples[free_sample], sizeof_patch); - - /* - * Link this_one sample to the list of samples for patch 'instr'. - */ - - samples[free_sample].key = patch_table[instr]; - patch_table[instr] = free_sample; - - /* - * Use DMA to transfer the wave data to the DRAM - */ - - left = patch.len; - src_offs = 0; - target = free_mem_ptr; - - while (left) { /* Not completely transferred yet */ - /* blk_size = audio_devs[gus_devnum]->buffsize; */ - blk_size = audio_devs[gus_devnum]->dmap_out->bytes_in_use; - if (blk_size > left) - blk_size = left; - - /* - * DMA cannot cross 256k bank boundaries. Check for that. - */ - blk_end = target + blk_size; - - if ((target >> 18) != (blk_end >> 18)) { /* Split the block */ - blk_end &= ~(256 * 1024 - 1); - blk_size = blk_end - target; - } - if (gus_no_dma) { - /* - * For some reason the DMA is not possible. We have - * to use PIO. - */ - long i; - u_char data; - - for (i = 0; i < blk_size; i++) { - uiomove((char *) &(data), 1, addr); - if (patch.mode & WAVE_UNSIGNED) - if (!(patch.mode & WAVE_16_BITS) || (i & 0x01)) - data ^= 0x80; /* Convert to signed */ - gus_poke(target + i, data); - } - } else { - u_long address, hold_address; - u_char dma_command; - u_long flags; - - /* - * OK, move now. First in and then out. - */ - - if (uiomove(audio_devs[gus_devnum]->dmap_out->raw_buf, blk_size, addr)) { - printf("audio: Bad copyin()!\n"); - }; - - flags = splhigh(); - /******** INTERRUPTS DISABLED NOW ********/ - gus_write8(0x41, 0); /* Disable GF1 DMA */ - DMAbuf_start_dma(gus_devnum, - audio_devs[gus_devnum]->dmap_out->raw_buf_phys, - blk_size, 1); - - /* - * Set the DRAM address for the wave data - */ - - address = target; - - if (audio_devs[gus_devnum]->dmachan1 > 3) { - hold_address = address; - address = address >> 1; - address &= 0x0001ffffL; - address |= (hold_address & 0x000c0000L); - } - gus_write16(0x42, (address >> 4) & 0xffff); /* DRAM DMA address */ - - /* - * Start the DMA transfer - */ - - dma_command = 0x21; /* IRQ enable, DMA start */ - if (patch.mode & WAVE_UNSIGNED) - dma_command |= 0x80; /* Invert MSB */ - if (patch.mode & WAVE_16_BITS) - dma_command |= 0x40; /* 16 bit _DATA_ */ - if (audio_devs[gus_devnum]->dmachan1 > 3) - dma_command |= 0x04; /* 16 bit DMA _channel_ */ - - gus_write8(0x41, dma_command); /* Lets bo luteet (=bugs) */ - - /* - * Sleep here until the DRAM DMA done interrupt is - * served - */ - active_device = GUS_DEV_WAVE; - - - { - int chn; - - dram_sleep_flag.mode = WK_SLEEP; - dram_sleeper = &chn; - DO_SLEEP(chn, dram_sleep_flag, hz); - - }; - if ((dram_sleep_flag.mode & WK_TIMEOUT)) - printf("GUS: DMA Transfer timed out\n"); - splx(flags); - } - - /* - * Now the next part - */ - - left -= blk_size; - src_offs += blk_size; - target += blk_size; - - gus_write8(0x41, 0); /* Stop DMA */ - } - - free_mem_ptr += patch.len; - - if (!pmgr_flag) - pmgr_inform(dev, PM_E_PATCH_LOADED, instr, free_sample, 0, 0); - free_sample++; - return 0; -} - -static void -guswave_hw_control(int dev, u_char *event) -{ - int voice, cmd; - u_short p1, p2; - u_long plong, flags; - - cmd = event[2]; - voice = event[3]; - p1 = *(u_short *) &event[4]; - p2 = *(u_short *) &event[6]; - plong = *(u_long *) &event[4]; - - if ((voices[voice].volume_irq_mode == VMODE_START_NOTE) && - (cmd != _GUS_VOICESAMPLE) && (cmd != _GUS_VOICE_POS)) - do_volume_irq(voice); - - switch (cmd) { - - case _GUS_NUMVOICES: - flags = splhigh(); - gus_select_voice(voice); - gus_select_max_voices(p1); - splx(flags); - break; - - case _GUS_VOICESAMPLE: - guswave_set_instr(dev, voice, p1); - break; - - case _GUS_VOICEON: - flags = splhigh(); - gus_select_voice(voice); - p1 &= ~0x20; /* Don't allow interrupts */ - gus_voice_on(p1); - splx(flags); - break; - - case _GUS_VOICEOFF: - flags = splhigh(); - gus_select_voice(voice); - gus_voice_off(); - splx(flags); - break; - - case _GUS_VOICEFADE: - gus_voice_fade(voice); - break; - - case _GUS_VOICEMODE: - flags = splhigh(); - gus_select_voice(voice); - p1 &= ~0x20; /* Don't allow interrupts */ - gus_voice_mode(p1); - splx(flags); - break; - - case _GUS_VOICEBALA: - flags = splhigh(); - gus_select_voice(voice); - gus_voice_balance(p1); - splx(flags); - break; - - case _GUS_VOICEFREQ: - flags = splhigh(); - gus_select_voice(voice); - gus_voice_freq(plong); - splx(flags); - break; - - case _GUS_VOICEVOL: - flags = splhigh(); - gus_select_voice(voice); - gus_voice_volume(p1); - splx(flags); - break; - - case _GUS_VOICEVOL2: /* Just update the software voice level */ - voices[voice].initial_volume = - voices[voice].current_volume = p1; - break; - - case _GUS_RAMPRANGE: - if (voices[voice].mode & WAVE_ENVELOPES) - break; /* NO-NO */ - flags = splhigh(); - gus_select_voice(voice); - gus_ramp_range(p1, p2); - splx(flags); - break; - - case _GUS_RAMPRATE: - if (voices[voice].mode & WAVE_ENVELOPES) - break; /* NJET-NJET */ - flags = splhigh(); - gus_select_voice(voice); - gus_ramp_rate(p1, p2); - splx(flags); - break; - - case _GUS_RAMPMODE: - if (voices[voice].mode & WAVE_ENVELOPES) - break; /* NO-NO */ - flags = splhigh(); - gus_select_voice(voice); - p1 &= ~0x20; /* Don't allow interrupts */ - gus_ramp_mode(p1); - splx(flags); - break; - - case _GUS_RAMPON: - if (voices[voice].mode & WAVE_ENVELOPES) - break; /* EI-EI */ - flags = splhigh(); - gus_select_voice(voice); - p1 &= ~0x20; /* Don't allow interrupts */ - gus_rampon(p1); - splx(flags); - break; - - case _GUS_RAMPOFF: - if (voices[voice].mode & WAVE_ENVELOPES) - break; /* NEJ-NEJ */ - flags = splhigh(); - gus_select_voice(voice); - gus_rampoff(); - splx(flags); - break; - - case _GUS_VOLUME_SCALE: - volume_base = p1; - volume_scale = p2; - break; - - case _GUS_VOICE_POS: - flags = splhigh(); - gus_select_voice(voice); - gus_set_voice_pos(voice, plong); - splx(flags); - break; - - default:; - } -} - -static int -gus_sampling_set_speed(int speed) -{ - - if (speed <= 0) - speed = gus_sampling_speed; - - RANGE(speed, 4000, 44100); - gus_sampling_speed = speed; - - if (only_read_access) { - /* Compute nearest valid recording speed and return it */ - - speed = (9878400 / (gus_sampling_speed + 2)) / 16; - speed = (9878400 / (speed * 16)) - 2; - } - return speed; -} - -static int -gus_sampling_set_channels(int channels) -{ - if (!channels) - return gus_sampling_channels; - RANGE(channels, 1, 2); - gus_sampling_channels = channels; - return channels; -} - -static int -gus_sampling_set_bits(int bits) -{ - if (!bits) - return gus_sampling_bits; - - if (bits != 8 && bits != 16) - bits = 8; - - if (only_8_bits) - bits = 8; - - gus_sampling_bits = bits; - return bits; -} - -static int -gus_sampling_ioctl(int dev, u_int cmd, ioctl_arg arg, int local) -{ - switch (cmd) { - case SOUND_PCM_WRITE_RATE: - if (local) - return gus_sampling_set_speed((int) arg); - return *(int *) arg = gus_sampling_set_speed((*(int *) arg)); - break; - - case SOUND_PCM_READ_RATE: - if (local) - return gus_sampling_speed; - return *(int *) arg = gus_sampling_speed; - break; - - case SNDCTL_DSP_STEREO: - if (local) - return gus_sampling_set_channels((int) arg + 1) - 1; - return *(int *) arg = gus_sampling_set_channels((*(int *) arg) + 1) - 1; - break; - - case SOUND_PCM_WRITE_CHANNELS: - if (local) - return gus_sampling_set_channels((int) arg); - return *(int *) arg = gus_sampling_set_channels((*(int *) arg)); - break; - - case SOUND_PCM_READ_CHANNELS: - if (local) - return gus_sampling_channels; - return *(int *) arg = gus_sampling_channels; - break; - - case SNDCTL_DSP_SETFMT: - if (local) - return gus_sampling_set_bits((int) arg); - return *(int *) arg = gus_sampling_set_bits((*(int *) arg)); - break; - - case SOUND_PCM_READ_BITS: - if (local) - return gus_sampling_bits; - return *(int *) arg = gus_sampling_bits; - - case SOUND_PCM_WRITE_FILTER: /* NOT POSSIBLE */ - return *(int *) arg = -(EINVAL); - break; - - case SOUND_PCM_READ_FILTER: - return *(int *) arg = -(EINVAL); - break; - - } - return -(EINVAL); -} - -static void -gus_sampling_reset(int dev) -{ - if (recording_active) { - gus_write8(0x49, 0x00); /* Halt recording */ - set_input_volumes(); - } -} - -static int -gus_sampling_open(int dev, int mode) -{ - - int otherside = audio_devs[dev]->otherside; - if (otherside != -1) { - if (audio_devs[otherside]->busy) - return -(EBUSY); - } - if (audio_devs[dev]->busy) - return -(EBUSY); - - - gus_initialize(); - - active_device = 0; - - gus_reset(); - reset_sample_memory(); - gus_select_max_voices(14); - - pcm_active = 0; - dma_active = 0; - pcm_opened = 1; - audio_devs[dev]->busy = 1; - - if (mode & OPEN_READ) { - recording_active = 1; - set_input_volumes(); - } - only_read_access = !(mode & OPEN_WRITE); - only_8_bits = mode & OPEN_READ; - if (only_8_bits) - audio_devs[dev]->format_mask = AFMT_U8; - else - audio_devs[dev]->format_mask = AFMT_U8 | AFMT_S16_LE; - - return 0; -} - -static void -gus_sampling_close(int dev) -{ - int otherside = audio_devs[dev]->otherside; - audio_devs[dev]->busy = 0; - - if (otherside != -1) { - if (audio_devs[otherside]->busy) - return; - } - gus_reset(); - - pcm_opened = 0; - active_device = 0; - - if (recording_active) { - gus_write8(0x49, 0x00); /* Halt recording */ - set_input_volumes(); - } - recording_active = 0; -} - -static void -gus_sampling_update_volume(void) -{ - u_long flags; - int voice; - - if (pcm_active && pcm_opened) - for (voice = 0; voice < gus_sampling_channels; voice++) { - flags = splhigh(); - gus_select_voice(voice); - gus_rampoff(); - gus_voice_volume(1530 + (25 * gus_pcm_volume)); - gus_ramp_range(65, 1530 + (25 * gus_pcm_volume)); - splx(flags); - } -} - -static void -play_next_pcm_block(void) -{ - u_long flags; - int speed = gus_sampling_speed; - int this_one, is16bits, chn; - u_long dram_loc; - u_char mode[2], ramp_mode[2]; - - if (!pcm_qlen) - return; - - this_one = pcm_head; - - for (chn = 0; chn < gus_sampling_channels; chn++) { - mode[chn] = 0x00; - ramp_mode[chn] = 0x03; /* Ramping and rollover off */ - - if (chn == 0) { - mode[chn] |= 0x20; /* Loop IRQ */ - voices[chn].loop_irq_mode = LMODE_PCM; - } - if (gus_sampling_bits != 8) { - is16bits = 1; - mode[chn] |= 0x04; /* 16 bit data */ - } else - is16bits = 0; - - dram_loc = this_one * pcm_bsize; - dram_loc += chn * pcm_banksize; - - if (this_one == (pcm_nblk - 1)) { /* Last fragment of the - * DRAM buffer */ - mode[chn] |= 0x08; /* Enable loop */ - ramp_mode[chn] = 0x03; /* Disable rollover bit */ - } else { - if (chn == 0) - ramp_mode[chn] = 0x04; /* Enable rollover bit */ - } - - flags = splhigh(); - gus_select_voice(chn); - gus_voice_freq(speed); - - if (gus_sampling_channels == 1) - gus_voice_balance(7); /* mono */ - else if (chn == 0) - gus_voice_balance(0); /* left */ - else - gus_voice_balance(15); /* right */ - - if (!pcm_active) { /* Playback not already active */ - /* - * The playback was not started yet (or there has - * been a pause). Start the voice (again) and ask for - * a rollover irq at the end of this_one block. If - * this_one one is last of the buffers, use just the - * normal loop with irq. - */ - - gus_voice_off(); - gus_rampoff(); - gus_voice_volume(1530 + (25 * gus_pcm_volume)); - gus_ramp_range(65, 1530 + (25 * gus_pcm_volume)); - - gus_write_addr(0x0a, dram_loc, is16bits); /* Starting position */ - gus_write_addr(0x02, chn * pcm_banksize, is16bits); /* Loop start */ - - if (chn != 0) - gus_write_addr(0x04, pcm_banksize + (pcm_bsize * pcm_nblk) - 1, - is16bits); /* Loop end location */ - } - if (chn == 0) - gus_write_addr(0x04, dram_loc + pcm_datasize[this_one] - 1, - is16bits); /* Loop end location */ - else - mode[chn] |= 0x08; /* Enable looping */ - - if (pcm_datasize[this_one] != pcm_bsize) { - /* - * Incompletely filled block. Possibly the last one. - */ - if (chn == 0) { - mode[chn] &= ~0x08; /* Disable looping */ - mode[chn] |= 0x20; /* Enable IRQ at the end */ - voices[0].loop_irq_mode = LMODE_PCM_STOP; - ramp_mode[chn] = 0x03; /* No rollover bit */ - } else { - gus_write_addr(0x04, dram_loc + pcm_datasize[this_one], - is16bits); /* Loop end location */ - mode[chn] &= ~0x08; /* Disable looping */ - } - } - splx(flags); - } - - for (chn = 0; chn < gus_sampling_channels; chn++) { - flags = splhigh(); - gus_select_voice(chn); - gus_write8(0x0d, ramp_mode[chn]); - gus_voice_on(mode[chn]); - splx(flags); - } - - pcm_active = 1; -} - -static void -gus_transfer_output_block(int dev, u_long buf, - int total_count, int intrflag, int chn) -{ - /* - * This routine transfers one block of audio data to the DRAM. In - * mono mode it's called just once. When in stereo mode, this_one - * routine is called once for both channels. - * - * The left/mono channel data is transferred to the beginning of dram - * and the right data to the area pointed by gus_page_size. - */ - - int this_one, count; - u_long flags; - u_char dma_command; - u_long address, hold_address; - - flags = splhigh(); - - count = total_count / gus_sampling_channels; - - if (chn == 0) { - if (pcm_qlen >= pcm_nblk) - printf("GUS Warning: PCM buffers out of sync\n"); - - this_one = pcm_current_block = pcm_tail; - pcm_qlen++; - pcm_tail = (pcm_tail + 1) % pcm_nblk; - pcm_datasize[this_one] = count; - } else - this_one = pcm_current_block; - - gus_write8(0x41, 0); /* Disable GF1 DMA */ - DMAbuf_start_dma(dev, buf + (chn * count), count, 1); - - address = this_one * pcm_bsize; - address += chn * pcm_banksize; - - if (audio_devs[dev]->dmachan1 > 3) { - hold_address = address; - address = address >> 1; - address &= 0x0001ffffL; - address |= (hold_address & 0x000c0000L); - } - gus_write16(0x42, (address >> 4) & 0xffff); /* DRAM DMA address */ - - dma_command = 0x21; /* IRQ enable, DMA start */ - - if (gus_sampling_bits != 8) - dma_command |= 0x40; /* 16 bit _DATA_ */ - else - dma_command |= 0x80; /* Invert MSB */ - - if (audio_devs[dev]->dmachan1 > 3) - dma_command |= 0x04; /* 16 bit DMA channel */ - - gus_write8(0x41, dma_command); /* Kickstart */ - - if (chn == (gus_sampling_channels - 1)) { /* Last channel */ - /* - * Last (right or mono) channel data - */ - dma_active = 1; /* DMA started. There is a unacknowledged - * buffer */ - active_device = GUS_DEV_PCM_DONE; - if (!pcm_active && (pcm_qlen > 0 || count < pcm_bsize)) { - play_next_pcm_block(); - } - } else { - /* - * Left channel data. The right channel is transferred after - * DMA interrupt - */ - active_device = GUS_DEV_PCM_CONTINUE; - } - - splx(flags); -} - -static void -gus_sampling_output_block(int dev, u_long buf, int total_count, - int intrflag, int restart_dma) -{ - pcm_current_buf = buf; - pcm_current_count = total_count; - pcm_current_intrflag = intrflag; - pcm_current_dev = dev; - gus_transfer_output_block(dev, buf, total_count, intrflag, 0); -} - -static void -gus_sampling_start_input(int dev, u_long buf, int count, - int intrflag, int restart_dma) -{ - u_long flags; - u_char mode; - - flags = splhigh(); - - DMAbuf_start_dma(dev, buf, count, 0); - - mode = 0xa0; /* DMA IRQ enabled, invert MSB */ - - if (audio_devs[dev]->dmachan2 > 3) - mode |= 0x04; /* 16 bit DMA channel */ - if (gus_sampling_channels > 1) - mode |= 0x02; /* Stereo */ - mode |= 0x01; /* DMA enable */ - - gus_write8(0x49, mode); - - splx(flags); -} - -static int -gus_sampling_prepare_for_input(int dev, int bsize, int bcount) -{ - u_int rate; - - rate = (9878400 / (gus_sampling_speed + 2)) / 16; - - gus_write8(0x48, rate & 0xff); /* Set sampling rate */ - - if (gus_sampling_bits != 8) { - printf("GUS Error: 16 bit recording not supported\n"); - return -(EINVAL); - } - return 0; -} - -static int -gus_sampling_prepare_for_output(int dev, int bsize, int bcount) -{ - int i; - - long mem_ptr, mem_size; - - mem_ptr = 0; - mem_size = gus_mem_size / gus_sampling_channels; - - if (mem_size > (256 * 1024)) - mem_size = 256 * 1024; - - pcm_bsize = bsize / gus_sampling_channels; - pcm_head = pcm_tail = pcm_qlen = 0; - - pcm_nblk = MAX_PCM_BUFFERS; - if ((pcm_bsize * pcm_nblk) > mem_size) - pcm_nblk = mem_size / pcm_bsize; - - for (i = 0; i < pcm_nblk; i++) - pcm_datasize[i] = 0; - - pcm_banksize = pcm_nblk * pcm_bsize; - - if (gus_sampling_bits != 8 && pcm_banksize == (256 * 1024)) - pcm_nblk--; - - return 0; -} - -static int -gus_local_qlen(int dev) -{ - return pcm_qlen; -} - -static void -gus_copy_from_user(int dev, char *localbuf, int localoffs, - snd_rw_buf * userbuf, int useroffs, int len) -{ - if (gus_sampling_channels == 1) { - - if (uiomove(&localbuf[localoffs], len, userbuf)) { - printf("audio: Bad copyin()!\n"); - }; - } else if (gus_sampling_bits == 8) { - int in_left = useroffs; - int in_right = useroffs + 1; - char *out_left, *out_right; - int i; - - len /= 2; - localoffs /= 2; - out_left = &localbuf[localoffs]; - out_right = out_left + pcm_bsize; - - for (i = 0; i < len; i++) { - uiomove((char *) &(*out_left++), 1, userbuf); - in_left += 2; - uiomove((char *) &(*out_right++), 1, userbuf); - in_right += 2; - } - } else { - int in_left = useroffs; - int in_right = useroffs + 2; - short *out_left, *out_right; - int i; - - len /= 4; - localoffs /= 2; - - out_left = (short *) &localbuf[localoffs]; - out_right = out_left + (pcm_bsize / 2); - - for (i = 0; i < len; i++) { - uiomove((char *) &(*out_left++), 2, userbuf); - in_left += 2; - uiomove((char *) &(*out_right++), 2, userbuf); - in_right += 2; - } - } -} - -static struct audio_operations gus_sampling_operations = -{ - "Gravis UltraSound", - NEEDS_RESTART, - AFMT_U8 | AFMT_S16_LE, - NULL, - gus_sampling_open, - gus_sampling_close, - gus_sampling_output_block, - gus_sampling_start_input, - gus_sampling_ioctl, - gus_sampling_prepare_for_input, - gus_sampling_prepare_for_output, - gus_sampling_reset, - gus_sampling_reset, - gus_local_qlen, - gus_copy_from_user -}; - -static void -guswave_setup_voice(int dev, int voice, int chn) -{ - struct channel_info *info = - &synth_devs[dev]->chn_info[chn]; - - guswave_set_instr(dev, voice, info->pgm_num); - - voices[voice].expression_vol = - info->controllers[CTL_EXPRESSION]; /* Just msb */ - voices[voice].main_vol = - (info->controllers[CTL_MAIN_VOLUME] * 100) / 128; - voices[voice].panning = - (info->controllers[CTL_PAN] * 2) - 128; - voices[voice].bender = info->bender_value; -} - -static void -guswave_bender(int dev, int voice, int value) -{ - int freq; - u_long flags; - - voices[voice].bender = value - 8192; - freq = compute_finetune(voices[voice].orig_freq, value - 8192, - voices[voice].bender_range); - voices[voice].current_freq = freq; - - flags = splhigh(); - gus_select_voice(voice); - gus_voice_freq(freq); - splx(flags); -} - -static int -guswave_patchmgr(int dev, struct patmgr_info * rec) -{ - int i, n; - - switch (rec->command) { - case PM_GET_DEVTYPE: - rec->parm1 = PMTYPE_WAVE; - return 0; - break; - - case PM_GET_NRPGM: - rec->parm1 = MAX_PATCH; - return 0; - break; - - case PM_GET_PGMMAP: - rec->parm1 = MAX_PATCH; - - for (i = 0; i < MAX_PATCH; i++) { - int ptr = patch_table[i]; - - rec->data.data8[i] = 0; - - while (ptr >= 0 && ptr < free_sample) { - rec->data.data8[i]++; - ptr = samples[ptr].key; /* Follow link */ - } - } - return 0; - break; - - case PM_GET_PGM_PATCHES: - { - int ptr = patch_table[rec->parm1]; - - n = 0; - - while (ptr >= 0 && ptr < free_sample) { - rec->data.data32[n++] = ptr; - ptr = samples[ptr].key; /* Follow link */ - } - } - rec->parm1 = n; - return 0; - break; - - case PM_GET_PATCH: - { - int ptr = rec->parm1; - struct patch_info *pat; - - if (ptr < 0 || ptr >= free_sample) - return -(EINVAL); - - bcopy((char *) &samples[ptr], rec->data.data8, sizeof(struct patch_info)); - - pat = (struct patch_info *) rec->data.data8; - - pat->key = GUS_PATCH; /* Restore patch type */ - rec->parm1 = sample_ptrs[ptr]; /* DRAM location */ - rec->parm2 = sizeof(struct patch_info); - } - return 0; - break; - - case PM_SET_PATCH: - { - int ptr = rec->parm1; - struct patch_info *pat; - - if (ptr < 0 || ptr >= free_sample) - return -(EINVAL); - - pat = (struct patch_info *) rec->data.data8; - - if (pat->len > samples[ptr].len) /* Cannot expand sample */ - return -(EINVAL); - - pat->key = samples[ptr].key; /* Ensure the link is - * correct */ - - bcopy(rec->data.data8, (char *) &samples[ptr], sizeof(struct patch_info)); - - pat->key = GUS_PATCH; - } - return 0; - break; - - case PM_READ_PATCH: /* Returns a block of wave data from the DRAM */ - { - int sample = rec->parm1; - int n; - long offs = rec->parm2; - int l = rec->parm3; - - if (sample < 0 || sample >= free_sample) - return -(EINVAL); - - if (offs < 0 || offs >= samples[sample].len) - return -(EINVAL); /* Invalid offset */ - - n = samples[sample].len - offs; /* Num of bytes left */ - - if (l > n) - l = n; - - if (l > sizeof(rec->data.data8)) - l = sizeof(rec->data.data8); - - if (l <= 0) - return -(EINVAL); /* Was there a bug? */ - - offs += sample_ptrs[sample]; /* Begin offsess + - * offset to DRAM */ - - for (n = 0; n < l; n++) - rec->data.data8[n] = gus_peek(offs++); - rec->parm1 = n; /* Nr of bytes copied */ - } - return 0; - break; - - case PM_WRITE_PATCH: /* Writes a block of wave data to the DRAM */ - { - int sample = rec->parm1; - int n; - long offs = rec->parm2; - int l = rec->parm3; - - if (sample < 0 || sample >= free_sample) - return -(EINVAL); - - if (offs < 0 || offs >= samples[sample].len) - return -(EINVAL); /* Invalid offset */ - - n = samples[sample].len - offs; /* Nr of bytes left */ - - if (l > n) - l = n; - - if (l > sizeof(rec->data.data8)) - l = sizeof(rec->data.data8); - - if (l <= 0) - return -(EINVAL); /* Was there a bug? */ - - offs += sample_ptrs[sample]; /* Begin offsess + - * offset to DRAM */ - - for (n = 0; n < l; n++) - gus_poke(offs++, rec->data.data8[n]); - rec->parm1 = n; /* Nr of bytes copied */ - } - return 0; - break; - - default: - return -(EINVAL); - } -} - -static int -guswave_alloc(int dev, int chn, int note, struct voice_alloc_info * alloc) -{ - int i, p, best = -1, best_time = 0x7fffffff; - - p = alloc->ptr; - /* - * First look for a completely stopped voice - */ - - for (i = 0; i < alloc->max_voice; i++) { - if (alloc->map[p] == 0) { - alloc->ptr = p; - return p; - } - if (alloc->alloc_times[p] < best_time) { - best = p; - best_time = alloc->alloc_times[p]; - } - p = (p + 1) % alloc->max_voice; - } - - /* - * Then look for a releasing voice - */ - - for (i = 0; i < alloc->max_voice; i++) { - if (alloc->map[p] == 0xffff) { - alloc->ptr = p; - return p; - } - p = (p + 1) % alloc->max_voice; - } - - if (best >= 0) - p = best; - - alloc->ptr = p; - return p; -} - -static struct synth_operations guswave_operations = -{ - &gus_info, - 0, - SYNTH_TYPE_SAMPLE, - SAMPLE_TYPE_GUS, - guswave_open, - guswave_close, - guswave_ioctl, - guswave_kill_note, - guswave_start_note, - guswave_set_instr, - guswave_reset, - guswave_hw_control, - guswave_load_patch, - guswave_aftertouch, - guswave_controller, - guswave_panning, - guswave_volume_method, - guswave_patchmgr, - guswave_bender, - guswave_alloc, - guswave_setup_voice -}; - -static void -set_input_volumes(void) -{ - u_long flags; - u_char mask = 0xff & ~0x06; /* Just line out enabled */ - - if (have_gus_max) /* Don't disturb GUS MAX */ - return; - - flags = splhigh(); - - /* - * Enable channels having vol > 10% Note! bit 0x01 means the line in - * DISABLED while 0x04 means the mic in ENABLED. - */ - if (gus_line_vol > 10) - mask &= ~0x01; - if (gus_mic_vol > 10) - mask |= 0x04; - - if (recording_active) { - /* - * Disable channel, if not selected for recording - */ - if (!(gus_recmask & SOUND_MASK_LINE)) - mask |= 0x01; - if (!(gus_recmask & SOUND_MASK_MIC)) - mask &= ~0x04; - } - mix_image &= ~0x07; - mix_image |= mask & 0x07; - outb(u_Mixer, mix_image); - - splx(flags); -} - -int -gus_default_mixer_ioctl(int dev, u_int cmd, ioctl_arg arg) -{ - -#define MIX_DEVS (SOUND_MASK_MIC|SOUND_MASK_LINE| \ - SOUND_MASK_SYNTH|SOUND_MASK_PCM) - - if (((cmd >> 8) & 0xff) == 'M') { - if (cmd & IOC_IN) - switch (cmd & 0xff) { - case SOUND_MIXER_RECSRC: - gus_recmask = (*(int *) arg) & MIX_DEVS; - if (!(gus_recmask & (SOUND_MASK_MIC | SOUND_MASK_LINE))) - gus_recmask = SOUND_MASK_MIC; - /* - * Note! Input volumes are updated during - * next open for recording - */ - return *(int *) arg = gus_recmask; - break; - - case SOUND_MIXER_MIC: - { - int vol = (*(int *) arg) & 0xff; - - if (vol < 0) - vol = 0; - if (vol > 100) - vol = 100; - gus_mic_vol = vol; - set_input_volumes(); - return *(int *) arg = vol | (vol << 8); - } - break; - - case SOUND_MIXER_LINE: - { - int vol = (*(int *) arg) & 0xff; - - if (vol < 0) - vol = 0; - if (vol > 100) - vol = 100; - gus_line_vol = vol; - set_input_volumes(); - return *(int *) arg = vol | (vol << 8); - } - break; - - case SOUND_MIXER_PCM: - gus_pcm_volume = (*(int *) arg) & 0xff; - RANGE (gus_pcm_volume, 0, 100); - gus_sampling_update_volume(); - return *(int *) arg = gus_pcm_volume | (gus_pcm_volume << 8); - break; - - case SOUND_MIXER_SYNTH: - { - int voice; - - gus_wave_volume = (*(int *) arg) & 0xff; - - RANGE (gus_wave_volume , 0, 100); - - if (active_device == GUS_DEV_WAVE) - for (voice = 0; voice < nr_voices; voice++) - dynamic_volume_change(voice); /* Apply the new vol */ - - return *(int *) arg = gus_wave_volume | (gus_wave_volume << 8); - } - break; - - default: - return -(EINVAL); - } - else - switch (cmd & 0xff) { /* Return parameters */ - - case SOUND_MIXER_RECSRC: - return *(int *) arg = gus_recmask; - break; - - case SOUND_MIXER_DEVMASK: - return *(int *) arg = MIX_DEVS; - break; - - case SOUND_MIXER_STEREODEVS: - return *(int *) arg = 0; - break; - - case SOUND_MIXER_RECMASK: - return *(int *) arg = SOUND_MASK_MIC | SOUND_MASK_LINE; - break; - - case SOUND_MIXER_CAPS: - return *(int *) arg = 0; - break; - - case SOUND_MIXER_MIC: - return *(int *) arg = gus_mic_vol | (gus_mic_vol << 8); - break; - - case SOUND_MIXER_LINE: - return *(int *) arg = gus_line_vol | (gus_line_vol << 8); - break; - - case SOUND_MIXER_PCM: - return *(int *) arg = gus_pcm_volume | (gus_pcm_volume << 8); - break; - - case SOUND_MIXER_SYNTH: - return *(int *) arg = gus_wave_volume | (gus_wave_volume << 8); - break; - - default: - return -(EINVAL); - } -} else - return -(EINVAL); -} - -static struct mixer_operations gus_mixer_operations = {"Gravis Ultrasound", gus_default_mixer_ioctl}; - -static void -gus_default_mixer_init() -{ -if (num_mixers < MAX_MIXER_DEV) /* Don't install if there is another - * mixer */ - mixer_devs[num_mixers++] = &gus_mixer_operations; - -if (have_gus_max) { - /* - * Enable all mixer channels on the GF1 side. Otherwise - * recording will not be possible using GUS MAX. - */ - mix_image &= ~0x07; - mix_image |= 0x04; /* All channels enabled */ - outb(u_Mixer, mix_image); -} -} - -/* start of pnp code */ - -static void -SEND(int d, int r) -{ -outb(PADDRESS, d); -outb(PWRITE_DATA, r); -} - - - - -/* - * Get the device's serial number. Returns 1 if the serial is valid. - */ -static int -get_serial(int rd_port, u_char *data) -{ - int i, bit, valid = 0, sum = 0x6a; - - bzero(data, sizeof(char) * 9); - - for (i = 0; i < 72; i++) { - bit = inb((rd_port << 2) | 0x3) == 0x55; - DELAY(250); /* Delay 250 usec */ - - /* Can't Short Circuit the next evaluation, so 'and' is last */ - bit = (inb((rd_port << 2) | 0x3) == 0xaa) && bit; - DELAY(250); /* Delay 250 usec */ - - valid = valid || bit; - - if (i < 64) - sum = (sum >> 1) | - (((sum ^ (sum >> 1) ^ bit) << 7) & 0xff); - - data[i / 8] = (data[i / 8] >> 1) | (bit ? 0x80 : 0); - } - valid = valid && (data[8] == sum); - - return valid; -} - -static void -send_Initiation_LFSR() -{ - int cur, i; - - /* Reset the LSFR */ - outb(PADDRESS, 0); - outb(PADDRESS, 0); - - cur = 0x6a; - outb(PADDRESS, cur); - - for (i = 1; i < 32; i++) { - cur = (cur >> 1) | (((cur ^ (cur >> 1)) << 7) & 0xff); - outb(PADDRESS, cur); - } -} - - - -static int -isolation_protocol(int rd_port) -{ - int csn; - u_char data[9]; - - send_Initiation_LFSR(); - - /* Reset CSN for All Cards */ - SEND(0x02, 0x04); - - for (csn = 1; (csn < MAX_CARDS); csn++) { - /* Wake up cards without a CSN */ - - SEND(WAKE, 0); - SEND(SET_RD_DATA, rd_port); - outb(PADDRESS, SERIAL_ISOLATION); - DELAY(1000); /* Delay 1 msec */ - if (get_serial(rd_port, data)) { - printf("Board Vendor ID: %c%c%c%02x%02x", - ((data[0] & 0x7c) >> 2) + 64, - (((data[0] & 0x03) << 3) | ((data[1] & 0xe0) >> 5)) + 64, - (data[1] & 0x1f) + 64, data[2], data[3]); - printf(" Board Serial Number: %08x\n", *(int *) &(data[4])); - - SEND(SET_CSN, csn); /* Move this out of this - * function XXX */ - outb(PADDRESS, PSTATUS); - - - return rd_port; - } else - break; - } - - return 0; -} - - - -/* - * ######################################################################## - * - * FUNCTION : IwaveInputSource - * - * PROFILE: This function allows the calling program to select among any of - * several possible sources to the ADC's. The possible input sources and - * their corresponding symbolic constants are: - Line (LINE_IN) - Aux1 - * (AUX1_IN) - Microphone (MIC_IN) - Mixer (MIX_IN) - * - * Set the first argument to either LEFT_SOURCE or RIGHT_SOURCE. Always use the - * symbolic contants for the arguments. - * - * ######################################################################## - */ -static void -IwaveInputSource(BYTE index, BYTE source) -{ - BYTE reg; - - ENTER_CRITICAL; - reg = inb(iw.pcodar) & 0xE0; - outb(iw.pcodar, reg | index); /* select register CLICI or CRICI */ - reg = inb(iw.cdatap) & ~MIX_IN; - source &= MIX_IN; - outb(iw.cdatap, (BYTE) (reg | source)); - LEAVE_CRITICAL; -} -static void -IwavePnpGetCfg(void) -{ - WORD val; - - - ENTER_CRITICAL; - IwavePnpDevice(AUDIO); - outb(_PIDXR, 0x60); /* select P2X0HI */ - val = ((WORD) inb(iw.pnprdp)) << 8; /* get P2XR[9:8] */ - outb(_PIDXR, 0x61); /* select P2XRLI */ - iw.p2xr = val + (WORD) inb(iw.pnprdp); /* get P2XR[7:4] */ - - outb(_PIDXR, 0x62); /* select P3X0HI */ - val = ((WORD) inb(iw.pnprdp)) << 8; /* get P3XR[9:8] */ - outb(_PIDXR, 0x63); /* select P3X0LI */ - iw.p3xr = val + (WORD) inb(iw.pnprdp); /* get P3XR[7:3] */ - - outb(_PIDXR, 0x64); /* select PHCAI */ - val = ((WORD) inb(iw.pnprdp)) << 8; /* get PCODAR[9:8] */ - outb(_PIDXR, 0x65); /* select PLCAI */ - iw.pcodar = val + (WORD) inb(iw.pnprdp); /* get PCODAR[7:2] */ - - outb(_PIDXR, 0x70); /* select PUI1SI */ - iw.synth_irq = (WORD) (inb(iw.pnprdp) & 0x0F); /* Synth IRQ number */ - - outb(_PIDXR, 0x72); /* select PUI2SI */ - iw.midi_irq = (WORD) (inb(iw.pnprdp) & 0x0F); /* MIDI IRQ number */ - - outb(_PIDXR, 0x74); /* select PUD1SI */ - iw.dma1_chan = inb(iw.pnprdp) & 0x07; /* DMA1 chan (LMC/Codec Rec) */ - - outb(_PIDXR, 0x75); /* select PUD2SI */ - iw.dma2_chan = inb(iw.pnprdp) & 0x07; /* DMA2 chan (codec play) */ - - - IwavePnpDevice(EXT); /* select external device */ - outb(_PIDXR, 0x60); /* select PRAHI */ - val = ((WORD) inb(iw.pnprdp)) << 8; /* get PCDRAR[9:8] */ - outb(_PIDXR, 0x61); /* select PRALI */ - iw.pcdrar = val + (WORD) inb(iw.pnprdp); /* get PCDRAR[7:4] */ - outb(_PIDXR, 0x62); /* select PATAHI */ - val = ((WORD) inb(iw.pnprdp)) << 8; /* get PATAAR[9:8] */ - outb(_PIDXR, 0x63); /* select PATALI */ - iw.pataar = val + (WORD) inb(iw.pnprdp); /* get PATAAR[7:1] */ - - outb(_PIDXR, 0x70); /* select PRISI */ - iw.ext_irq = (WORD) (inb(iw.pnprdp) & 0x0F); /* Ext Dev IRQ number */ - - outb(_PIDXR, 0x74); /* select PRDSI */ - iw.ext_chan = inb(iw.pnprdp) & 0x07; /* Ext Dev DMA channel */ - - IwavePnpDevice(MPU401); /* Select MPU401 Device */ - outb(_PIDXR, 0x60); /* select P401HI */ - val = ((WORD) inb(iw.pnprdp)) << 8; /* get P401AR[9:8] */ - outb(_PIDXR, 0x61); /* select P401LI */ - iw.p401ar = val + (WORD) inb(iw.pnprdp); /* get P401AR[7:1] */ - - outb(_PIDXR, 0x70); /* select PMISI */ - iw.mpu_irq = (WORD) (inb(iw.pnprdp) & 0x0F); /* MPU401 Dev IRQ number */ - - IwavePnpDevice(GAME); /* Select GAME logical Device */ - outb(_PIDXR, 0x60); /* select P201HI */ - val = ((WORD) inb(iw.pnprdp)) << 8; /* get P201AR[9:8] */ - outb(_PIDXR, 0x61); /* select P201LI */ - iw.p201ar = val + (WORD) inb(iw.pnprdp); /* get P201AR[7:6] */ - - IwavePnpDevice(EMULATION); /* Select SB and ADLIB Device */ - outb(_PIDXR, 0x60); /* select P388HI */ - val = ((WORD) inb(iw.pnprdp)) << 8; /* get P388AR[9:8] */ - outb(_PIDXR, 0x61); /* select P388LI */ - iw.p388ar = val + inb(iw.pnprdp); /* get P388AR[7:6] */ - outb(_PIDXR, 0x70); /* select PSBISI */ - iw.emul_irq = (WORD) (inb(iw.pnprdp) & 0x0F); /* emulation Dev IRQ - * number */ - LEAVE_CRITICAL; -} - -static void -IwavePnpSetCfg(void) -{ - ENTER_CRITICAL; - IwavePnpDevice(AUDIO); /* select audio device */ - outb(_PIDXR, 0x60); /* select P2X0HI */ - outb(_PNPWRP, (BYTE) (iw.p2xr >> 8)); /* set P2XR[9:8] */ - outb(_PIDXR, 0x61); /* select P2X0LI */ - outb(_PNPWRP, (BYTE) iw.p2xr); /* set P2XR[7:4] */ - /* P2XR[3:0]=0 */ - outb(_PIDXR, 0x62); /* select P3X0HI */ - outb(_PNPWRP, (BYTE) (iw.p3xr >> 8)); /* set P3XR[9:8] */ - outb(_PIDXR, 0x63); /* select P3X0LI */ - outb(_PNPWRP, (BYTE) (iw.p3xr)); /* set P3XR[7:3] */ - /* P3XR[2:0]=0 */ - outb(_PIDXR, 0x64); /* select PHCAI */ - outb(_PNPWRP, (BYTE) (iw.pcodar >> 8)); /* set PCODAR[9:8] */ - outb(_PIDXR, 0x65); /* select PLCAI */ - outb(_PNPWRP, (BYTE) iw.pcodar); /* set PCODAR[7:2] */ - - outb(_PIDXR, 0x70); /* select PUI1SI */ - outb(_PNPWRP, (BYTE) (iw.synth_irq & 0x0F)); /* Synth IRQ number */ - outb(_PIDXR, 0x72); /* select PUI2SI */ - outb(_PNPWRP, (BYTE) (iw.midi_irq & 0x0F)); /* MIDI IRQ number */ - - outb(_PIDXR, 0x74); /* select PUD1SI */ - outb(_PNPWRP, (BYTE) (iw.dma1_chan & 0x07)); /* DMA channel 1 */ - outb(_PIDXR, 0x75); /* select PUD2SI */ - outb(_PNPWRP, (BYTE) (iw.dma2_chan & 0x07)); /* DMA channel 2 */ - - IwavePnpDevice(EXT); - outb(_PIDXR, 0x60); /* select PRAHI */ - outb(_PNPWRP, (BYTE) (iw.pcdrar >> 8)); /* set PCDRAR[9:8] */ - outb(_PIDXR, 0x61); /* select PRALI */ - outb(_PNPWRP, (BYTE) iw.pcdrar); /* set PCDRAR[7:3] */ - /* PCDRAR[2:0]=0 */ - outb(_PIDXR, 0x62); /* select PATAHI */ - outb(_PNPWRP, (BYTE) (iw.pataar >> 8)); /* set PATAAR[9:8] */ - outb(_PIDXR, 0x63); /* select PATALI */ - outb(_PNPWRP, (BYTE) iw.pataar); /* set PATAAR[7:1] */ - /* PATAAR[0]=0 */ - outb(_PIDXR, 0x70); /* select PRISI */ - outb(_PNPWRP, (BYTE) (iw.ext_irq & 0x0F)); /* Ext Dev IRQ number */ - outb(_PIDXR, 0x74); /* select PRDSI */ - outb(_PNPWRP, (BYTE) (iw.ext_chan & 0x07)); /* Ext Dev DMA channel */ - - IwavePnpDevice(GAME); - outb(_PIDXR, 0x60); /* select P201HI */ - outb(_PNPWRP, (BYTE) (iw.p201ar >> 8)); /* set P201RAR[9:8] */ - outb(_PIDXR, 0x61); /* select P201LI */ - outb(_PNPWRP, (BYTE) iw.p201ar); /* set P201AR[7:6] */ - - IwavePnpDevice(EMULATION); - outb(_PIDXR, 0x60); /* select P388HI */ - outb(_PNPWRP, (BYTE) (iw.p388ar >> 8)); /* set P388AR[9:8] */ - outb(_PIDXR, 0x61); /* select P388LI */ - outb(_PNPWRP, (BYTE) iw.p388ar); /* set P388AR[7:6] */ - - outb(_PIDXR, 0x70); /* select PSBISI */ - outb(_PNPWRP, (BYTE) (iw.emul_irq & 0x0F)); /* emulation IRQ number */ - - IwavePnpDevice(MPU401); - outb(_PIDXR, 0x60); /* select P401HI */ - outb(_PNPWRP, (BYTE) (iw.p401ar >> 8)); /* set P401AR[9:8] */ - outb(_PIDXR, 0x61); /* select P401LI */ - outb(_PNPWRP, (BYTE) iw.p401ar); /* set P401AR[7:1] */ - - outb(_PIDXR, 0x70); /* select PMISI */ - outb(_PNPWRP, (BYTE) (iw.mpu_irq & 0x0F)); /* MPU emulation IRQ - * number */ - LEAVE_CRITICAL; -} - -/* ######################################################################## */ -/* FILE: iwpnp.c */ -/* */ -/* REMARKS: This file contains the definitions for the InterWave's DDK */ -/* functions dedicated to the configuration of the InterWave */ -/* PNP logic. */ -/* */ -/* UPDATE: 4/07/95 */ -/* ######################################################################## */ -/* */ -/* FUNCTION: IwavePnpKey */ -/* */ -/* PROFILE: This function issues the initiation key that places the PNP */ -/* logic into configuration mode. The PNP logic is quiescent at */ -/* power up and must be enabled by software. This function will */ -/* do 32 I/O writes to the PIDXR (0x0279). The function will */ -/* first reset the LFSR to its initial value by a sequence of two */ -/* write cycles of 0x00 to PIDXR before issuing the key. */ -/* */ -/* ######################################################################## */ -static void -IwavePnpKey(void) -{ - /* send_Initiation_LFSR(); */ - - BYTE code = 0x6A; - BYTE msb; - BYTE i; - - /* ############################################### */ - /* Reset Linear Feedback Shift Reg. */ - /* ############################################### */ - outb(0x279, 0x00); - outb(0x279, 0x00); - - outb(0x279, code); /* Initial value */ - - for (i = 1; i < 32; i++) { - msb = ((code & 0x01) ^ ((code & 0x02) >> 1)) << 7; - code = (code >> 1) | msb; - outb(0x279, code); - } - -} - -static BYTE -IwavePnpIsol(PORT * pnpread) -{ - int num_pnp_devs; - int rd_port = 0; - printf("Checking for GUS Plug-n-Play ...\n"); - - /* Try various READ_DATA ports from 0x203-0x3ff */ - for (rd_port = 0x80; (rd_port < 0xff); rd_port += 0x10) { - if (0) - printf("Trying Read_Port at %x\n", - (rd_port << 2) | 0x3); - - num_pnp_devs = isolation_protocol(rd_port); - if (num_pnp_devs) { - *pnpread = rd_port << 2 | 0x3; - break; - } - } - if (!num_pnp_devs) { - printf("No Plug-n-Play devices were found\n"); - return 0; - } - return 1; -} - -/* ######################################################################## */ -/* */ -/* FUNCTION: IwavePnpPeek */ -/* */ -/* PROFILE: This function will return the number of specified bytes of */ -/* resource data from the serial EEPROM. The function will NOT */ -/* reset the serial EEPROM logic to allow reading the entire */ -/* EEPROM by issuing repeated calls. The caller must supply a */ -/* pointer to where the data are to be stored. */ -/* It is assumed that the InterWave is not in either "sleep" */ -/* or "wait for key" states. Note that on the first call, if */ -/* the caller means to read from the beggining of data the */ -/* serial EEPROM logic must be reset. For this, the caller */ -/* should issue a WAKE[CSN] command */ -/* */ -/* ######################################################################## */ -static void -IwavePnpPeek(PORT pnprdp, WORD bytes, BYTE * data) -{ - WORD i; - BYTE datum; - - for (i = 1; i <= bytes; i++) { - outb(_PIDXR, 0x05); /* select PRESSI */ - - while (TRUE) { /* wait til new data byte is ready */ - if (inb(pnprdp) & PNP_DATA_RDY) - break; /* new resource byte ready */ - } - outb(_PIDXR, 0x04); /* select PRESDI */ - datum = inb(pnprdp); /* read resource byte */ - if (data != NULL) - *(data++) = datum; /* store it */ - } -} -/* ######################################################################## */ -/* */ -/* FUNCTION: IwavePnpActivate */ -/* */ -/* PROFILE: This function will activate or de-activate the audio device */ -/* or the external device on the InterWave. Set the "dev" arg */ -/* to AUDIO for the audio device or EXT for the external device. */ -/* Set "bool" to ON or OFF to turn the device on or off the ISA */ -/* bus. Notice that for a logical device to work, it must be */ -/* activated. */ -/* */ -/* ######################################################################## */ -static void -IwavePnpActivate(BYTE dev, BYTE bool) -{ - IwavePnpDevice(dev); /* select audio device */ - ENTER_CRITICAL; - outb(_PIDXR, ACTIVATE_DEV); /* select Activate Register */ - outb(_PNPWRP, bool); /* write register */ - LEAVE_CRITICAL; - -} -/* ######################################################################## */ -/* */ -/* FUNCTION: IwavePnpDevice */ -/* */ -/* PROFILE: This function allows the caller to select between five */ -/* logical devices available on the InterWave.It is assumed */ -/* that the PNP state machine is in configuration mode. */ -/* */ -/* ######################################################################## */ -static void -IwavePnpDevice(BYTE dev) -{ - ENTER_CRITICAL; - outb(_PIDXR, _PLDNI); /* select PLDNI */ - outb(_PNPWRP, dev); /* write PLDNI */ - LEAVE_CRITICAL; -} -/* ######################################################################## */ -/* */ -/* FUNCTION: IwavePnpWake */ -/* */ -/* PROFILE: This function issues a WAKE[CSN] command to the InterWave. If */ -/* the CSN matches the PNP state machine will enter the */ -/* configuration state. Otherwise it will enter the sleep mode. */ -/* */ -/* It is assumed that the PNP state machine is not in the */ -/* "wait for key" state. */ -/* */ -/* ######################################################################## */ -static void -IwavePnpWake(BYTE csn) -{ - ENTER_CRITICAL; - outb(_PIDXR, _PWAKEI); /* select PWAKEI */ - outb(_PNPWRP, csn); /* write csn */ - LEAVE_CRITICAL; -} -/* ######################################################################## */ -/* */ -/* - * FUNCTION: IwavePnpPing - */ -/* */ -/* PROFILE: This function allows the caller to detect an InterWave based */ -/* adapter board and will return its asigned CSN so that an */ -/* an application can access its PnP interface and determine the */ -/* borad's current configuration. In conducting its search for */ -/* the InterWave IC, the function will use the first 32 bits of */ -/* the Serial Identifier called the vendor ID in the PnP ISA */ -/* spec. The last 4 bits in the Vendor ID represent a revision */ -/* number for the particular product and will not be included */ -/* in the search. The function will return the Vendor ID and the */ -/* calling application should check the revision bits to make */ -/* sure they are compatible with the board. */ -/* */ -/* ######################################################################## */ -static BYTE -IwavePnpPing(DWORD VendorID) -{ - BYTE csn; - - VendorID &= (0xFFFFFFF0); /* reset 4 least significant bits */ - IwavePnpKey(); /* Key to access PnP Interface */ - while (iw.pnprdp <= 0x23F) { - for (csn = 1; csn <= 10; csn++) { - IwavePnpWake(csn); /* Select card */ - IwavePnpPeek(iw.pnprdp, 4, (BYTE *) & iw.vendor); /* get vendor ID */ - - - if (((iw.vendor) & 0xFFFFFFF0) == VendorID) { /* If IDs match, - * InterWave is found */ - - outb(_PIDXR, 0x02); /* Place all cards in - * wait-for-key state */ - outb(0x0A79, 0x02); - return (csn); - } - } - iw.pnprdp += 0x04; - } - outb(_PIDXR, 0x02); /* Place all cards in wait-for-key state */ - outb(0x0A79, 0x02); - return (FALSE); /* InterWave IC not found */ -} - -/* end of pnp code */ - -static WORD -IwaveMemSize(void) -{ - BYTE datum = 0x55; - ADDRESS local = 0L; - - outb(iw.igidxr, _LMCI); - outb(iw.i8dp, inb(iw.i8dp) & 0xFD); /* DRAM I/O cycles selected */ - - while (TRUE) { - IwaveMemPoke(local, datum); - IwaveMemPoke(local + 1L, datum + 1); - if (IwaveMemPeek(local) != datum || IwaveMemPeek(local + 1L) != (datum + 1) || IwaveMemPeek(0L) != 0x55) - break; - local += RAM_STEP; - datum++; - } - return ((WORD) (local >> 10)); -} - -static BYTE -IwaveMemPeek(ADDRESS addr) -{ - PORT p3xr; - - p3xr = iw.p3xr; - - - outb(iw.igidxr, 0x43); /* Select LMALI */ - outw(iw.i16dp, (WORD) addr); /* Lower 16 bits of LM */ - outb(iw.igidxr, 0x44); /* Select LMAHI */ - outb(iw.i8dp, (BYTE) (addr >> 16)); /* Upper 8 bits of LM */ - return (inb(iw.lmbdr)); /* return byte from LMBDR */ -} - - -static void -IwaveMemPoke(ADDRESS addr, BYTE datum) -{ - PORT p3xr; - p3xr = iw.p3xr; - - - outb(iw.igidxr, 0x43); /* Select LMALI */ - outw(iw.i16dp, (WORD) addr); /* Lower 16 bits of LM */ - outb(iw.igidxr, 0x44); /* Select LMAHI */ - outb(iw.i8dp, (BYTE) (addr >> 16)); /* Upper 8 bits of LM */ - outb(iw.lmbdr, datum); /* Write byte to LMBDR */ -} - -/* ######################################################################## */ -/* */ -/* FUNCTION: IwaveMemCfg */ -/* */ -/* PROFILE : This function determines the amount of DRAM from its */ -/* configuration accross all banks. It sets the configuration */ -/* into register LMCFI and stores the total amount of DRAM */ -/* into iw.size_mem (Kbytes). */ -/* */ -/* The function first places the IC in enhanced mode to allow */ -/* full access to all DRAM locations. Then it selects full */ -/* addressing span (LMCFI[3:0]=0x0C). Finally, it determines */ -/* the amount of DRAM in each bank and from this the actual */ -/* configuration. */ -/* */ -/* Note that if a configuration other than one indicated in */ -/* the manual is implemented, this function will select */ -/* full addressing span (LMCFI[3:0]=0xC). */ -/* */ -/* ######################################################################## */ -static void -IwaveMemCfg(DWORD * lpbanks) -{ - DWORD bank[4] = {0L, 0L, 0L, 0L}; - DWORD addr = 0L, base = 0L, cnt = 0L; - BYTE i, reg, ram = FALSE; - WORD lmcfi; - /* */ - ENTER_CRITICAL; - outb(iw.igidxr, 0x99); - reg = inb(iw.i8dp); /* image of sgmi */ - outb(iw.igidxr, 0x19); - outb(iw.i8dp, (BYTE) (reg | 0x01)); /* enable enhaced mode */ - outb(iw.igidxr, _LMCFI);/* select LM Conf Reg */ - lmcfi = inw(iw.i16dp) & 0xFFF0; - outw(iw.i16dp, lmcfi | 0x000C); /* max addr span */ - /* */ - /* Clear every RAM_STEPth location */ - /* */ - while (addr < RAM_MAX) { - IwaveMemPoke(addr, 0x00); - addr += RAM_STEP; - } - /* */ - /* Determine amount of RAM in each bank */ - /* */ - for (i = 0; i < 4; i++) { - IwaveMemPoke(base, 0xAA); /* mark start of bank */ - IwaveMemPoke(base + 1L, 0x55); - if ((IwaveMemPeek(base) == 0xAA) && (IwaveMemPeek(base + 1L) == 0x55)) - ram = TRUE; - if (ram) { - while (cnt < BANK_MAX) { - bank[i] += RAM_STEP; - cnt += RAM_STEP; - addr = base + cnt; - if (IwaveMemPeek(addr) == 0xAA) - break; - } - } - if (lpbanks != NULL) { - *lpbanks = bank[i]; - lpbanks++; - } - bank[i] = bank[i] >> 10; - base += BANK_MAX; - cnt = 0L; - ram = FALSE; - } - /* */ - iw.flags &= ~DRAM_HOLES; - outb(iw.igidxr, _LMCFI); - if (bank[0] == 256 && bank[1] == 0 && bank[2] == 0 && bank[3] == 0) - outw(iw.i16dp, lmcfi); - else if (bank[0] == 256 && bank[1] == 256 && bank[2] == 0 && bank[3] == 0) - outw(iw.i16dp, lmcfi | 0x01); - else if (bank[0] == 256 && bank[1] == 256 && bank[2] == 256 && bank[3] == 256) - outw(iw.i16dp, lmcfi | 0x02); - else if (bank[0] == 256 && bank[1] == 1024 && bank[2] == 0 && bank[3] == 0) - outw(iw.i16dp, lmcfi | 0x03); - else if (bank[0] == 256 && bank[1] == 1024 && bank[2] == 1024 && bank[3] == 1024) - outw(iw.i16dp, lmcfi | 0x04); - else if (bank[0] == 256 && bank[1] == 256 && bank[2] == 1024 && bank[3] == 0) - outw(iw.i16dp, lmcfi | 0x05); - else if (bank[0] == 256 && bank[1] == 256 && bank[2] == 1024 && bank[3] == 1024) - outw(iw.i16dp, lmcfi | 0x06); - else if (bank[0] == 1024 && bank[1] == 0 && bank[2] == 0 && bank[3] == 0) - outw(iw.i16dp, lmcfi | 0x07); - else if (bank[0] == 1024 && bank[1] == 1024 && bank[2] == 0 && bank[3] == 0) - outw(iw.i16dp, lmcfi | 0x08); - else if (bank[0] == 1024 && bank[1] == 1024 && bank[2] == 1024 && bank[3] == 1024) - outw(iw.i16dp, lmcfi | 0x09); - else if (bank[0] == 4096 && bank[1] == 0 && bank[2] == 0 && bank[3] == 0) - outw(iw.i16dp, lmcfi | 0x0A); - else if (bank[0] == 4096 && bank[1] == 4096 && bank[2] == 0 && bank[3] == 0) - outw(iw.i16dp, lmcfi | 0x0B); - else /* Flag the non-contiguous config of memory */ - iw.flags |= DRAM_HOLES; - /* */ - outb(iw.igidxr, 0x19); /* restore sgmi */ - outb(iw.i8dp, reg); - LEAVE_CRITICAL; -} - - -/* ######################################################################## */ -/**/ -/* FUNCTION: IwaveCodecIrq */ -/**/ -/* PROFILE: This function disables or enables the Codec Interrupts. To */ -/* enable interrupts set CEXTI[2] high thus causing all interrupt */ -/* sources (CSR3I[6:4]) to pass onto the IRQ pin. To disable */ -/* interrupts set CEXTI[1]=0. To enable Code IRQs issue this call: */ -/**/ -/* IwaveCodecIrq(CODEC_IRQ_ENABLE). To disable IRQs issue the call */ -/**/ -/* IwaveCodeIrq(~CODEC_IRQ_ENABLE). */ -/**/ -/* ######################################################################## */ -static void -IwaveCodecIrq(BYTE mode) -{ - BYTE reg; - - ENTER_CRITICAL; - reg = inb(iw.pcodar) & 0xE0; - outb(iw.pcodar, reg | _CSR3I); /* select CSR3I */ - outb(iw.cdatap, 0x00); /* clear all interrupts */ - outb(iw.pcodar + 0x02, 0x00); /* clear CSR1R */ - outb(iw.pcodar, reg | _CEXTI); /* select CEXTI */ - reg = inb(iw.cdatap); - if (mode == CODEC_IRQ_ENABLE) /* enable Codec Irqs */ - outb(iw.cdatap, (BYTE) (reg | CODEC_IRQ_ENABLE)); - else /* disable Codec Irqs */ - outb(iw.cdatap, (BYTE) (reg & ~CODEC_IRQ_ENABLE)); - LEAVE_CRITICAL; -} - - -/* ######################################################################### */ -/**/ -/* FUNCTION: IwaveRegPeek */ -/**/ -/* PROFILE : This function returns the value stored in any readable */ -/* InterWave register. It takes as input a pointer to a */ -/* structure containing the addresses of the relocatable I/O */ -/* space as well as a register mnemonic. To correctly use this */ -/* function, the programmer must use the mnemonics defined in */ -/* "iwdefs.h". These mnemonics contain coded information used */ -/* by the function to properly access the desired register. */ -/**/ -/* An attempt to read from a write-only register will return */ -/* meaningless data. */ -/**/ -/* ######################################################################### */ -static WORD -IwaveRegPeek(DWORD reg_mnem) -{ - BYTE index, val; - WORD reg_id, offset; - - offset = (WORD) ((BYTE) reg_mnem); - reg_id = (WORD) (reg_mnem >> 16); - index = (BYTE) (reg_mnem >> 8); - - /* ################################################### */ - /* Logic to read registers in P2XR block & GMCR */ - /* ################################################### */ - - if (reg_id >= 0x0001 && reg_id <= 0x001A) { /* UMCR to GMCR */ - if (reg_id <= 0x000E) /* UMCR to USRR */ - return ((WORD) inb(iw.p2xr + offset)); - - if (reg_id == 0x0019) - return ((WORD) inb(iw.p201ar)); - - else { /* GUS Hidden registers or GMCR */ - BYTE iveri; - - outb(iw.igidxr, 0x5B); /* select IVERI */ - iveri = inb(iw.i8dp); /* read IVERI */ - outb(iw.i8dp, (BYTE) (iveri | 0x09)); /* set IVERI[3,0] */ - if (reg_id == 0x001A) { /* GMCR */ - val = inb(iw.p3xr); - outb(iw.i8dp, iveri); /* restore IVERI */ - return ((WORD) val); - } - val = inb(iw.p2xr + 0x0F); /* read URCR */ - val = (val & 0xF8) | index; /* value for URCR[2:0] */ - outb(iw.p2xr + 0x0F, val); /* set URCR[2:0] */ - - if (reg_mnem == UDCI || reg_mnem == UICI) { - val = inb(iw.p2xr); - if (reg_mnem == UDCI) - outb(iw.p2xr, (BYTE) (val & 0xBF)); - else - outb(iw.p2xr, (BYTE) (val | 0x40)); - } - val = inb(iw.p2xr + 0x0B); - outb(iw.igidxr, 0x5B); /* select IVERI */ - outb(iw.i8dp, iveri); /* restore IVERI */ - return ((WORD) val); /* read register */ - } - } - /* ################################################### */ - /* Logic to read registers in P3XR block */ - /* ################################################### */ - - if (reg_id >= 0x001B && reg_id <= 0x005C) { /* GMSR to LMBDR */ - if (reg_id == 0x005C) /* LMBDR */ - return ((WORD) inb(iw.lmbdr)); - - if (reg_id >= 0x001B && reg_id <= 0x0021) /* GMSR to I8DP */ - if (offset == 0x04) - return (inw(iw.i16dp)); - else - return ((WORD) inb(iw.p3xr + offset)); - else { /* indexed registers */ - - if (reg_id <= 0x003F) - index |= 0x80; /* adjust for reading */ - - outb(iw.igidxr, index); /* select register */ - - if (offset == 0x04) - return (inw(iw.i16dp)); - else - return ((WORD) inb(iw.i8dp)); - } - } - /* #################################################### */ - /* Logic to read registers in PCODAR block */ - /* #################################################### */ - - if (reg_id >= 0x005D && reg_id <= 0x0081) { /* CIDXR to CLRCTI */ - if (reg_id <= 0x0061) - return ((WORD) inb(iw.pcodar + offset)); /* CRDR */ - - else { /* indexed registers */ - BYTE cidxr; - - cidxr = inb(iw.pcodar); - cidxr = (cidxr & 0xE0) + index; - outb(iw.pcodar, cidxr); /* select register */ - return ((WORD) inb(iw.cdatap)); - } - } - /* ##################################################### */ - /* Logic to read the PnP registers */ - /* ##################################################### */ - if (reg_id >= 0x0082 && reg_id <= 0x00B7) { /* PCSNBR to PMITI */ - if (reg_id == 0x0085) - return ((WORD) inb(iw.pnprdp)); - - if (reg_id < 0x0085) - return ((WORD) inb((WORD) reg_mnem)); - - else { /* indexed registers */ - if (reg_id >= 0x008E && reg_id <= 0x00B7) { - outb(0x0279, 0x07); /* select PLDNI */ - outb(0xA79, (BYTE) offset); /* select logical dev */ - } - outb(0x0279, index); /* select the register */ - return ((WORD) inb(iw.pnprdp)); - } - } - return 0; -} -/* ######################################################################### */ -/**/ -/* FUNCTION: IwaveRegPoke */ -/**/ -/* PROFILE : This function writes a value to any writable */ -/* InterWave register. It takes as input a pointer to a */ -/* structure containing the addresses of the relocatable I/O */ -/* space as well as a register mnemonic. To correctly use this */ -/* function, the programmer must use the mnemonics defined in */ -/* "iwdefs.h". These mnemonics contain coded information used */ -/* by the function to properly access the desired register. */ -/**/ -/* This function does not guard against writing to read-only */ -/* registers. It is the programmer's responsibility to ensure */ -/* that the writes are to valid registers. */ -/**/ -/* ######################################################################### */ -static void -IwaveRegPoke(DWORD reg_mnem, WORD datum) -{ - BYTE index; - BYTE val; - WORD reg_id; - WORD offset; - - offset = (WORD) ((BYTE) reg_mnem); - reg_id = (WORD) (reg_mnem >> 16); - index = (BYTE) (reg_mnem >> 8); - - - /* ####################################################### */ - /* Logic to write to registers in P2XR block */ - /* ####################################################### */ - if (reg_id >= 0x0001 && reg_id <= 0x0019) { /* UMCR to GGCR */ - if (reg_id <= 0x000E) { /* UMCR to USRR */ - outb(iw.p2xr + offset, (BYTE) datum); - return; - } - if (reg_id == 0x0019) { - outb(iw.p201ar, (BYTE) datum); - return; - } else { /* GUS Hidden registers */ - - BYTE iveri; - - outb(iw.igidxr, 0x5B); /* select IVERI */ - iveri = inb(iw.i8dp); /* read IVERI */ - outb(iw.i8dp, (BYTE) (iveri | 0x09)); /* set IVERI[3,0] */ - val = inb(iw.p2xr + 0x0F); /* read URCR */ - val = (val & 0xF8) | index; /* value for URCR[2:0] */ - outb(iw.p2xr + 0x0F, val); /* set URCR[2:0] */ - - if (reg_mnem == UDCI || reg_mnem == UICI) { - val = inb(iw.p2xr); /* read UMCR */ - if (reg_mnem == UDCI) - outb(iw.p2xr, (BYTE) (val & 0xBF)); /* set UMCR[6]=0 */ - else - outb(iw.p2xr, (BYTE) (val | 0x40)); /* set UMCR[6]=1 */ - } - outb(iw.p2xr + 0x0B, (BYTE) datum); /* write register */ - outb(iw.igidxr, 0x5B); /* select IVERI */ - outb(iw.i8dp, iveri); /* restore IVERI */ - return; - } - } - /* ############################################################# */ - /* Logic to write to registers in P3XR block */ - /* ############################################################# */ - - if (reg_id >= 0x001A && reg_id <= 0x005C) { /* GMCR to LMBDR */ - - if (reg_id == 0x005C) { /* LMBDR */ - outb(iw.lmbdr, (BYTE) datum); - return; - } - if (reg_id == 0x001B) /* GMSR */ - return; - - if (reg_id >= 0x001A && reg_id <= 0x0021) /* GMCR to I8DP */ - if (offset == 0x04) - outw(iw.i16dp, datum); - else - outb(iw.p3xr + offset, (BYTE) datum); - else { /* indexed registers */ - outb(iw.igidxr, index); /* select register */ - - if (offset == 0x04) - outw(iw.i16dp, datum); - else - outb(iw.i8dp, (BYTE) datum); - } - } - /* /################################################### */ - /* Logic to write to registers in PCODAR block */ - /* ################################################### */ - - if (reg_id >= 0x005C && reg_id <= 0x0081) { /* CIDXR to CLRCTI */ - if (reg_id <= 0x0061) - outb(iw.pcodar + offset, (BYTE) datum); - - else { /* one of the indexed registers */ - BYTE cidxr; - - cidxr = inb(iw.pcodar); - cidxr = (cidxr & 0xE0) + index; - outb(iw.pcodar, cidxr); /* select register */ - outb(iw.cdatap, (BYTE) datum); - } - } - /* ###################################################### */ - /* Logic to write to the PnP registers */ - /* ###################################################### */ - if (reg_id >= 0x0082 && reg_id <= 0x00B7) { - if (reg_id == 0x0085) { - outb(iw.pnprdp, (BYTE) datum); - return; - } - if (reg_id < 0x0085) - outb((WORD) reg_mnem, (BYTE) datum); - - else { /* one of the indexed registers */ - if (reg_id >= 0x008E && reg_id <= 0x00B7) { - outb(0x0279, 0x07); /* select PLDNI */ - outb(0xA79, (BYTE) offset); /* select logical dev */ - } - outb(0x0279, index); /* select the register */ - outb(0xA79, (BYTE) datum); - } - } -} - - -static void -IwaveLineLevel(char level, char index) -{ - char reg; - - level &= 0x1F; - - ENTER_CRITICAL; - reg = inb(iw.pcodar) & 0xE0; - outb(iw.pcodar, reg | index); /* select register */ - outb(iw.cdatap, (BYTE) ((inb(iw.cdatap) & 0x80) | level)); /* set level */ - LEAVE_CRITICAL; -} - -static void -IwaveCodecMode(char mode) -{ - char reg; - - ENTER_CRITICAL; - reg = inb(iw.pcodar) & 0xE0; - outb(iw.pcodar, reg | _CMODEI); /* select CMODEI */ - outb(iw.cdatap, mode); - LEAVE_CRITICAL; - iw.cmode = mode; -} - -static void -IwaveLineMute(BYTE mute, BYTE inx) -{ - BYTE reg; - - ENTER_CRITICAL; - reg = inb(iw.pcodar) & 0xE0; - outb(iw.pcodar, reg | inx); /* select register */ - if (mute == ON) - outb(iw.cdatap, (BYTE) (inb(iw.cdatap) | 0x80)); /* mute */ - else - outb(iw.cdatap, (BYTE) (inb(iw.cdatap) & 0x7F)); /* unmute */ - LEAVE_CRITICAL; -} - -static void -Iwaveinitcodec() -{ - - u_short iwl_codec_base = iw.pcodar; - u_short iwl_codec_data = iw.pcodar + 1; - u_short foo; - - - - /* - * Set the CEXTI register foo = CODEC_CEXTI_DEFAULT; - * IWL_CODEC_OUT(EXTERNAL_CONTROL, foo); - */ - /* - * Disable Interrupts iwl_codec_disable_irqs(); - */ - - /* Set the CODEC to Operate in Mode 3 */ - IWL_CODEC_OUT(MODE_SELECT_ID, 0x6C); - foo = inb(iwl_codec_data); - - /* Set the configuration registers to their default values */ - foo = CODEC_CFIG1I_DEFAULT; - IWL_CODEC_OUT(CONFIG_1 | CODEC_MCE, foo); - outb(iwl_codec_base, CONFIG_1); - foo = CODEC_CFIG2I_DEFAULT; - IWL_CODEC_OUT(CONFIG_2, foo); - - foo = CODEC_CFIG3I_DEFAULT; - IWL_CODEC_OUT(CONFIG_3, foo); - -} - - - -int -IwaveOpen(char voices, char mode, struct address_info * hw) -{ - - u_long flags; - u_char tmp; - - flags = splhigh(); - - iw.pnprdp = 0; - if (IwavePnpIsol(&iw.pnprdp)) { - - iw.vendor = GUS_PNP_ID; - - iw.csn = IwavePnpPing(iw.vendor); - - IwavePnpKey(); - - IwavePnpWake(iw.csn); - - IwavePnpGetCfg(); - IwavePnpKey(); - - IwavePnpWake(iw.csn); - } - if (hw->irq > 0) { - /* I see the user wants to set the GUS PnP */ - /* Okay lets do it */ - iw.csn = 1; - iw.p2xr = hw->io_base; - iw.p3xr = hw->io_base + 0x100; - iw.pcodar = hw->io_base + 0x10c; - - iw.synth_irq = hw->irq; - - iw.midi_irq = hw->irq; - - iw.dma1_chan = hw->dma; - - if (hw->dma2 == -1) { - iw.dma2_chan = hw->dma; - } else { - iw.dma2_chan = hw->dma2; - } - - - } else { - - /* tell the os what we are doing 8) */ - hw->io_base = iw.p2xr; - hw->irq = iw.synth_irq; - /* - * iw.dma1_chan = 1; iw.dma2_chan = 3 ; - */ - hw->dma = iw.dma1_chan; - hw->dma2 = iw.dma2_chan; - - - } - - if (iw.csn > 0 && iw.csn < MAX_GUS_PNP) { - gus_pnp_found[iw.csn] = hw->io_base; - - } - iw.cdatap = iw.pcodar + 1; - iw.csr1r = iw.pcodar + 2; - iw.cxdr = iw.pcodar + 3;/* CPDR or CRDR */ - iw.gmxr = iw.p3xr; - iw.gmxdr = iw.p3xr + 1; /* GMTDR or GMRDR */ - iw.svsr = iw.p3xr + 2; - iw.igidxr = iw.p3xr + 3; - iw.i16dp = iw.p3xr + 4; - iw.i8dp = iw.p3xr + 5; - iw.lmbdr = iw.p3xr + 7; - iw.voices = voices; - - if (iw.pnprdp > 0 && iw.csn > 0) { - IwavePnpSetCfg(); - IwavePnpActivate(AUDIO, ON); - IwavePnpActivate(EXT, ON); - } - /* IwavePnpActivate(EMULATION,ON); */ - - - /* reset */ - outb(iw.igidxr, _URSTI);/* Pull reset */ - outb(iw.i8dp, 0x00); - DELAY(1000 * 30); - - outb(iw.i8dp, 0x01); /* Release reset */ - DELAY(1000 * 30); - - /* end of reset */ - - - IwaveMemCfg(NULL); - - - tmp = IwaveRegPeek(IDECI); - - IwaveRegPoke(IDECI, tmp | 0x18); - - IwaveCodecMode(CODEC_MODE2); /* Default codec mode */ - IwaveRegPoke(ICMPTI, 0); - - outb(iw.igidxr, 0x99); - tmp = inb(iw.i8dp); - outb(iw.igidxr, 0x19); - outb(iw.i8dp, tmp); - - - - IwaveCodecIrq(~CODEC_IRQ_ENABLE); - - Iwaveinitcodec(); - - outb(iw.p2xr, 0x0c); /* Disable line in, mic and line out */ - - IwaveRegPoke(CLCI, 0x3f << 2); - - IwaveLineLevel(0, _CLOAI); - IwaveLineLevel(0, _CROAI); - - IwaveLineMute(OFF, _CLOAI); - IwaveLineMute(OFF, _CROAI); - - IwaveLineLevel(0, _CLLICI); - IwaveLineLevel(0, _CRLICI); - IwaveLineMute(OFF, _CLLICI); - IwaveLineMute(OFF, _CRLICI); - - IwaveLineLevel(0, _CLDACI); - IwaveLineLevel(0, _CRDACI); - IwaveLineMute(ON, _CLDACI); - IwaveLineMute(ON, _CRDACI); - - IwaveLineLevel(0, _CLLICI); - IwaveLineLevel(0, _CRLICI); - IwaveLineMute(ON, _CLLICI); - IwaveLineMute(ON, _CRLICI); - - - IwaveInputSource(LEFT_SOURCE, MIC_IN); - IwaveInputSource(RIGHT_SOURCE, MIC_IN); - - outb(iw.pcodar, 0x9 | 0x40); - outb(iw.cdatap, 0); - IwaveCodecIrq(CODEC_IRQ_ENABLE); - outb(iw.pcodar, _CFIG3I | 0x20); - - - outb(iw.cdatap, 0xC2); /* Enable Mode 3 IRQs & Synth */ - - outb(iw.igidxr, _URSTI); - outb(iw.i8dp, GF1_SET | GF1_OUT_ENABLE | GF1_IRQ_ENABLE); - DELAY(1000 * 30); - iw.size_mem = IwaveMemSize(); /* Bytes of RAM in this mode */ - outb(iw.p2xr, 0xc); /* enable output */ - IwaveRegPoke(CLCI, 0x3f << 2); - - IwaveCodecIrq(CODEC_IRQ_ENABLE); - splx(flags); - - DELAY(1000 * 100); - IwaveRegPoke(CPDFI, 0); - - return (TRUE); -} - - -void -gus_wave_init(struct address_info * hw_config) -{ - u_long flags; - u_char val, gus_pnp_seen = 0; - char *model_num = "2.4"; - int gus_type = 0x24; /* 2.4 */ - int irq = hw_config->irq, dma = hw_config->dma, dma2 = hw_config->dma2; - int otherside = -1, i; - - if (irq < 0 || irq > 15) { - printf("ERROR! Invalid IRQ#%d. GUS Disabled", irq); - return; - } - if (dma < 0 || dma > 7) { - printf("ERROR! Invalid DMA#%d. GUS Disabled", dma); - return; - } - for (i = 0; i < MAX_GUS_PNP; i++) { - if (gus_pnp_found[i] != 0 && gus_pnp_found[i] == hw_config->io_base) - gus_pnp_seen = 1; - } -#ifdef NOGUSPNP - gus_pnp_seen = 0; -#endif - - gus_irq = irq; - gus_dma = dma; - gus_dma2 = dma2; - - if (gus_dma2 == -1) - gus_dma2 = dma; - - /* - * Try to identify the GUS model. - * - * Versions < 3.6 don't have the digital ASIC. Try to probe it first. - */ - - flags = splhigh(); - outb(gus_base + 0x0f, 0x20); - val = inb(gus_base + 0x0f); - splx(flags); - - if (val != 0xff && (val & 0x06)) { /* Should be 0x02?? */ - /* - * It has the digital ASIC so the card is at least v3.4. Next - * try to detect the true model. - */ - - val = inb(u_MixSelect); - - /* - * Value 255 means pre-3.7 which don't have mixer. Values 5 - * thru 9 mean v3.7 which has a ICS2101 mixer. 10 and above - * is GUS MAX which has the CS4231 codec/mixer. - * - */ - - if (gus_pnp_seen) - val = 66; - - if (val == 255 || val < 5) { - model_num = "3.4"; - gus_type = 0x34; - } else if (val < 10) { - model_num = "3.7"; - gus_type = 0x37; - mixer_type = ICS2101; - } else { - if (gus_pnp_seen) - model_num = "PNP"; - else - model_num = "MAX"; - - gus_type = 0x40; - mixer_type = CS4231; -#ifdef CONFIG_GUSMAX - { - u_char max_config = 0x40; /* Codec enable */ - - if (gus_dma2 == -1) - gus_dma2 = gus_dma; - - if (gus_dma > 3) - max_config |= 0x10; /* 16 bit capture DMA */ - - if (gus_dma2 > 3) - max_config |= 0x20; /* 16 bit playback DMA */ - - max_config |= (gus_base >> 4) & 0x0f; /* Extract the X from - * 2X0 */ - - outb(gus_base + 0x106, max_config); /* UltraMax control */ - } - - if (ad1848_detect(gus_base + 0x10c, NULL, hw_config->osp)) { - - gus_mic_vol = gus_line_vol = gus_pcm_volume = 100; - gus_wave_volume = 90; - have_gus_max = 1; - if (gus_pnp_seen) { - - ad1848_init("GUS PNP", gus_base + 0x10c, - -irq, - gus_dma2, /* Playback DMA */ - gus_dma, /* Capture DMA */ - 1, /* Share DMA channels with GF1 */ - hw_config->osp); - - - } else { - ad1848_init("GUS MAX", gus_base + 0x10c, - -irq, - gus_dma2, /* Playback DMA */ - gus_dma, /* Capture DMA */ - 1, /* Share DMA channels with GF1 */ - hw_config->osp); - } - otherside = num_audiodevs - 1; - - } else - printf("[Where's the CS4231?]"); -#else - printf("\n\n\nGUS MAX support was not compiled in!!!\n\n\n\n"); -#endif - } - } else { - /* - * ASIC not detected so the card must be 2.2 or 2.4. There - * could still be the 16-bit/mixer daughter card. - */ - } - - if (gus_pnp_seen) { - snprintf(gus_info.name, sizeof(gus_info.name), - "Gravis %s (%dk)", model_num, (int) gus_mem_size / 1024); - } else { - snprintf(gus_info.name, sizeof(gus_info.name), - "Gravis UltraSound %s (%dk)", model_num, (int) gus_mem_size / 1024); - } - conf_printf(gus_info.name, hw_config); - - if (num_synths >= MAX_SYNTH_DEV) - printf("GUS Error: Too many synthesizers\n"); - else { - voice_alloc = &guswave_operations.alloc; - synth_devs[num_synths++] = &guswave_operations; -#ifdef CONFIG_SEQUENCER - gus_tmr_install(gus_base + 8); -#endif - } - samples = (struct patch_info *) malloc((MAX_SAMPLE + 1) * sizeof(*samples), M_DEVBUF, M_NOWAIT); - if (!samples) - panic("SOUND: Cannot allocate memory\n"); - - reset_sample_memory(); - - gus_initialize(); - - if (num_audiodevs < MAX_AUDIO_DEV) { - audio_devs[gus_devnum = num_audiodevs++] = &gus_sampling_operations; - audio_devs[gus_devnum]->otherside = otherside; - audio_devs[gus_devnum]->dmachan1 = dma; - audio_devs[gus_devnum]->dmachan2 = dma2; - audio_devs[gus_devnum]->buffsize = DSP_BUFFSIZE; - if (otherside != -1) { - /* - * glue logic to prevent people from opening the gus - * max via the gf1 and the cs4231 side . Only the gf1 - * or the cs4231 are allowed to be open - */ - - audio_devs[otherside]->otherside = gus_devnum; - } - if (dma2 != dma && dma2 != -1) - audio_devs[gus_devnum]->flags |= DMA_DUPLEX; - } else - printf("GUS: Too many PCM devices available\n"); - - /* - * Mixer dependent initialization. - */ - - switch (mixer_type) { - case ICS2101: - gus_mic_vol = gus_line_vol = gus_pcm_volume = 100; - gus_wave_volume = 90; - ics2101_mixer_init(); - return; - - case CS4231: - /* Initialized elsewhere (ad1848.c) */ - default: - gus_default_mixer_init(); - return; - } -} - -static void -do_loop_irq(int voice) -{ - u_char tmp; - int mode, parm; - u_long flags; - - flags = splhigh(); - gus_select_voice(voice); - - tmp = gus_read8(0x00); - tmp &= ~0x20; /* Disable wave IRQ for this_one voice */ - gus_write8(0x00, tmp); - - if (tmp & 0x03) /* Voice stopped */ - voice_alloc->map[voice] = 0; - - mode = voices[voice].loop_irq_mode; - voices[voice].loop_irq_mode = 0; - parm = voices[voice].loop_irq_parm; - - switch (mode) { - - case LMODE_FINISH: /* Final loop finished, shoot volume down */ - - if ((int) (gus_read16(0x09) >> 4) < 100) { /* Get current volume */ - gus_voice_off(); - gus_rampoff(); - gus_voice_init(voice); - break; - } - gus_ramp_range(65, 4065); - gus_ramp_rate(0, 63); /* Fastest possible rate */ - gus_rampon(0x20 | 0x40); /* Ramp down, once, irq */ - voices[voice].volume_irq_mode = VMODE_HALT; - break; - - case LMODE_PCM_STOP: - pcm_active = 0; /* Signal to the play_next_pcm_block routine */ - case LMODE_PCM: - { - int flag; /* 0 or 2 */ - - pcm_qlen--; - pcm_head = (pcm_head + 1) % pcm_nblk; - if (pcm_qlen && pcm_active) { - play_next_pcm_block(); - } else {/* Underrun. Just stop the voice */ - gus_select_voice(0); /* Left channel */ - gus_voice_off(); - gus_rampoff(); - gus_select_voice(1); /* Right channel */ - gus_voice_off(); - gus_rampoff(); - pcm_active = 0; - } - - /* - * If the queue was full before this interrupt, the - * DMA transfer was suspended. Let it continue now. - */ - if (dma_active) { - if (pcm_qlen == 0) - flag = 1; /* Underflow */ - else - flag = 0; - dma_active = 0; - } else - flag = 2; /* Just notify the dmabuf.c */ - DMAbuf_outputintr(gus_devnum, flag); - } - break; - - default:; - } - splx(flags); -} - -static void -do_volume_irq(int voice) -{ - u_char tmp; - int mode, parm; - u_long flags; - - flags = splhigh(); - - gus_select_voice(voice); - - tmp = gus_read8(0x0d); - tmp &= ~0x20; /* Disable volume ramp IRQ */ - gus_write8(0x0d, tmp); - - mode = voices[voice].volume_irq_mode; - voices[voice].volume_irq_mode = 0; - parm = voices[voice].volume_irq_parm; - - switch (mode) { - case VMODE_HALT: /* Decay phase finished */ - splx(flags); - gus_voice_init(voice); - break; - - case VMODE_ENVELOPE: - gus_rampoff(); - splx(flags); - step_envelope(voice); - break; - - case VMODE_START_NOTE: - splx(flags); - guswave_start_note2(voices[voice].dev_pending, voice, - voices[voice].note_pending, voices[voice].volume_pending); - if (voices[voice].kill_pending) - guswave_kill_note(voices[voice].dev_pending, voice, - voices[voice].note_pending, 0); - - if (voices[voice].sample_pending >= 0) { - guswave_set_instr(voices[voice].dev_pending, voice, - voices[voice].sample_pending); - voices[voice].sample_pending = -1; - } - break; - - default:; - } -} - -void -gus_voice_irq(void) -{ - u_long wave_ignore = 0, volume_ignore = 0; - u_long voice_bit; - - u_char src, voice; - - while (1) { - src = gus_read8(0x0f); /* Get source info */ - voice = src & 0x1f; - src &= 0xc0; - - if (src == (0x80 | 0x40)) - return; /* No interrupt */ - - voice_bit = 1 << voice; - - if (!(src & 0x80)) /* Wave IRQ pending */ - if (!(wave_ignore & voice_bit) && (int) voice < nr_voices) { /* Not done yet */ - wave_ignore |= voice_bit; - do_loop_irq(voice); - } - if (!(src & 0x40)) /* Volume IRQ pending */ - if (!(volume_ignore & voice_bit) && (int) voice < nr_voices) { /* Not done yet */ - volume_ignore |= voice_bit; - do_volume_irq(voice); - } - } -} - -void -guswave_dma_irq(void) -{ - u_char status; - - status = gus_look8(0x41); /* Get DMA IRQ Status */ - if (status & 0x40) /* DMA interrupt pending */ - switch (active_device) { - case GUS_DEV_WAVE: - if ((dram_sleep_flag.mode & WK_SLEEP)) { - dram_sleep_flag.mode = WK_WAKEUP; - wakeup(dram_sleeper); - }; - break; - - case GUS_DEV_PCM_CONTINUE: /* Left channel data transferred */ - gus_transfer_output_block(pcm_current_dev, pcm_current_buf, - pcm_current_count, pcm_current_intrflag, 1); - break; - - case GUS_DEV_PCM_DONE: /* Right or mono channel data transferred */ - if (pcm_qlen < pcm_nblk) { - int flag = (1 - dma_active) * 2; /* 0 or 2 */ - - if (pcm_qlen == 0) - flag = 1; /* Underrun */ - dma_active = 0; - DMAbuf_outputintr(gus_devnum, flag); - } - break; - - default:; - } - - status = gus_look8(0x49); /* Get Sampling IRQ Status */ - if (status & 0x40) { /* Sampling Irq pending */ - DMAbuf_inputintr(gus_devnum); - } -} - -#ifdef CONFIG_SEQUENCER -/* - * Timer stuff - */ - -static volatile int select_addr, data_addr; -static volatile int curr_timer = 0; - -void -gus_timer_command(u_int addr, u_int val) -{ - int i; - - outb(select_addr, (u_char) (addr & 0xff)); - - for (i = 0; i < 2; i++) - inb(select_addr); - - outb(data_addr, (u_char) (val & 0xff)); - - for (i = 0; i < 2; i++) - inb(select_addr); -} - -static void -arm_timer(int timer, u_int interval) -{ - curr_timer = timer; - - if (timer == 1) { - gus_write8(0x46, 256 - interval); /* Set counter for timer 1 */ - gus_write8(0x45, 0x04); /* Enable timer 1 IRQ */ - gus_timer_command(0x04, 0x01); /* Start timer 1 */ - } else { - gus_write8(0x47, 256 - interval); /* Set counter for timer 2 */ - gus_write8(0x45, 0x08); /* Enable timer 2 IRQ */ - gus_timer_command(0x04, 0x02); /* Start timer 2 */ - } - - gus_timer_enabled = 0; -} - -static u_int -gus_tmr_start(int dev, u_int usecs_per_tick) -{ - int timer_no, resolution; - int divisor; - - if (usecs_per_tick > (256 * 80)) { - timer_no = 2; - resolution = 320; /* usec */ - } else { - timer_no = 1; - resolution = 80;/* usec */ - } - - divisor = (usecs_per_tick + (resolution / 2)) / resolution; - - arm_timer(timer_no, divisor); - - return divisor * resolution; -} - -static void -gus_tmr_disable(int dev) -{ - gus_write8(0x45, 0); /* Disable both timers */ - gus_timer_enabled = 0; -} - -static void -gus_tmr_restart(int dev) -{ - if (curr_timer == 1) - gus_write8(0x45, 0x04); /* Start timer 1 again */ - else - gus_write8(0x45, 0x08); /* Start timer 2 again */ -} - -static struct sound_lowlev_timer gus_tmr = -{ - 0, - gus_tmr_start, - gus_tmr_disable, - gus_tmr_restart -}; - -static void -gus_tmr_install(int io_base) -{ - select_addr = io_base; - data_addr = io_base + 1; - - sound_timer_init(&gus_tmr, "GUS"); -} -#endif -#endif diff --git a/sys/dev/sound/isa/i386/midi_ctrl.h b/sys/dev/sound/isa/i386/midi_ctrl.h deleted file mode 100644 index 8b68c7d91d..0000000000 --- a/sys/dev/sound/isa/i386/midi_ctrl.h +++ /dev/null @@ -1,22 +0,0 @@ -static unsigned char ctrl_def_values[128] = -{ - 0x40,0x40,0x40,0x40, 0x40,0x40,0x40,0x40, /* 0 to 7 */ - 0x40,0x40,0x40,0x40, 0x40,0x40,0x40,0x40, /* 8 to 15 */ - 0x40,0x40,0x40,0x40, 0x40,0x40,0x40,0x40, /* 16 to 23 */ - 0x40,0x40,0x40,0x40, 0x40,0x40,0x40,0x40, /* 24 to 31 */ - - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 32 to 39 */ - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 40 to 47 */ - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 48 to 55 */ - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 56 to 63 */ - - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 64 to 71 */ - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 72 to 79 */ - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 80 to 87 */ - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 88 to 95 */ - - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 96 to 103 */ - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 104 to 111 */ - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 112 to 119 */ - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 120 to 127 */ -}; diff --git a/sys/dev/sound/isa/i386/midi_synth.c b/sys/dev/sound/isa/i386/midi_synth.c deleted file mode 100644 index 58f7087a70..0000000000 --- a/sys/dev/sound/isa/i386/midi_synth.c +++ /dev/null @@ -1,676 +0,0 @@ -/* - * sound/midi_synth.c - * - * High level midi sequencer manager for dumb MIDI interfaces. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/midi_synth.c,v 1.2 2003/08/07 21:17:12 dillon Exp $ - */ - -#define USE_SEQ_MACROS -#define USE_SIMPLE_MACROS - -#include - -#include "sound_config.h" - -#if defined(CONFIGURE_SOUNDCARD) /* && defined(CONFIG_MIDI) */ - -#define _MIDI_SYNTH_C_ - -static int *sysex_sleeper = NULL; -static volatile struct snd_wait sysex_sleep_flag = {0}; - -#include "midi_synth.h" - -static int midi2synth[MAX_MIDI_DEV]; -static int sysex_state[MAX_MIDI_DEV] = -{0}; -static unsigned char prev_out_status[MAX_MIDI_DEV]; - -#ifndef CONFIG_SEQUENCER -#define STORE(cmd) -#else -#define STORE(cmd) { \ - int len; \ - unsigned char obuf[8]; \ - cmd; \ - seq_input_event(obuf, len); \ -} -#endif - -#define _seqbuf obuf -#define _seqbufptr 0 -#define _SEQ_ADVBUF(x) len=x - -void -do_midi_msg(int synthno, unsigned char *msg, int mlen) -{ - switch (msg[0] & 0xf0) { - case 0x90: - if (msg[2] != 0) { - STORE(SEQ_START_NOTE(synthno, msg[0] & 0x0f, msg[1], msg[2])); - break; - } - msg[2] = 64; - - case 0x80: - STORE(SEQ_STOP_NOTE(synthno, msg[0] & 0x0f, msg[1], msg[2])); - break; - - case 0xA0: - STORE(SEQ_KEY_PRESSURE(synthno, msg[0] & 0x0f, msg[1], msg[2])); - break; - - case 0xB0: - STORE(SEQ_CONTROL(synthno, msg[0] & 0x0f, msg[1], msg[2])); - break; - - case 0xC0: - STORE(SEQ_SET_PATCH(synthno, msg[0] & 0x0f, msg[1])); - break; - - case 0xD0: - STORE(SEQ_CHN_PRESSURE(synthno, msg[0] & 0x0f, msg[1])); - break; - - case 0xE0: - STORE(SEQ_BENDER(synthno, msg[0] & 0x0f, - (msg[1] % 0x7f) | ((msg[2] & 0x7f) << 7))); - break; - - default: - /* - * printf ("MPU: Unknown midi channel message %02x\n", - * msg[0]); - */ - ; - } -} - -static void -midi_outc(int midi_dev, int data) -{ - int timeout; - - for (timeout = 0; timeout < 32000; timeout++) - if (midi_devs[midi_dev]->putc(midi_dev, (unsigned char) (data & 0xff))) { - if (data & 0x80) /* Status byte */ - prev_out_status[midi_dev] = - (unsigned char) (data & 0xff); /* Store for running - * status */ - return; /* Mission complete */ - } - /* - * Sorry! No space on buffers. - */ - printf("Midi send timed out\n"); -} - -static int -prefix_cmd(int midi_dev, unsigned char status) -{ - if ((char *) midi_devs[midi_dev]->prefix_cmd == NULL) - return 1; - - return midi_devs[midi_dev]->prefix_cmd(midi_dev, status); -} - -static void -midi_synth_input(int orig_dev, unsigned char data) -{ - int dev; - struct midi_input_info *inc; - - static unsigned char len_tab[] = /* # of data bytes following a status */ - { - 2, /* 8x */ - 2, /* 9x */ - 2, /* Ax */ - 2, /* Bx */ - 1, /* Cx */ - 1, /* Dx */ - 2, /* Ex */ - 0 /* Fx */ - }; - - if (orig_dev < 0 || orig_dev > num_midis) - return; - - if (data == 0xfe) /* Ignore active sensing */ - return; - - dev = midi2synth[orig_dev]; - inc = &midi_devs[orig_dev]->in_info; - - switch (inc->m_state) { - case MST_INIT: - if (data & 0x80) { /* MIDI status byte */ - if ((data & 0xf0) == 0xf0) { /* Common message */ - switch (data) { - case 0xf0: /* Sysex */ - inc->m_state = MST_SYSEX; - break; /* Sysex */ - - case 0xf1: /* MTC quarter frame */ - case 0xf3: /* Song select */ - inc->m_state = MST_DATA; - inc->m_ptr = 1; - inc->m_left = 1; - inc->m_buf[0] = data; - break; - - case 0xf2: /* Song position pointer */ - inc->m_state = MST_DATA; - inc->m_ptr = 1; - inc->m_left = 2; - inc->m_buf[0] = data; - break; - - default: - inc->m_buf[0] = data; - inc->m_ptr = 1; - do_midi_msg(dev, inc->m_buf, inc->m_ptr); - inc->m_ptr = 0; - inc->m_left = 0; - } - } else { - inc->m_state = MST_DATA; - inc->m_ptr = 1; - inc->m_left = len_tab[(data >> 4) - 8]; - inc->m_buf[0] = inc->m_prev_status = data; - } - } else if (inc->m_prev_status & 0x80) { /* Ignore if no previous - * status (yet) *//* Data byte (use running status) */ - inc->m_state = MST_DATA; - inc->m_ptr = 2; - inc->m_left = len_tab[(data >> 4) - 8] - 1; - inc->m_buf[0] = inc->m_prev_status; - inc->m_buf[1] = data; - } - break; /* MST_INIT */ - - case MST_DATA: - inc->m_buf[inc->m_ptr++] = data; - if (--inc->m_left <= 0) { - inc->m_state = MST_INIT; - do_midi_msg(dev, inc->m_buf, inc->m_ptr); - inc->m_ptr = 0; - } - break; /* MST_DATA */ - - case MST_SYSEX: - if (data == 0xf7) { /* Sysex end */ - inc->m_state = MST_INIT; - inc->m_left = 0; - inc->m_ptr = 0; - } - break; /* MST_SYSEX */ - - default: - printf("MIDI%d: Unexpected state %d (%02x)\n", orig_dev, inc->m_state, - (int) data); - inc->m_state = MST_INIT; - } -} - -static void -leave_sysex(int dev) -{ - int orig_dev = synth_devs[dev]->midi_dev; - int timeout = 0; - - if (!sysex_state[dev]) - return; - - sysex_state[dev] = 0; - - while (!midi_devs[orig_dev]->putc(orig_dev, 0xf7) && timeout < 1000) - timeout++; - - sysex_state[dev] = 0; -} - -static void -midi_synth_output(int dev) -{ - /* - * Currently NOP - */ -} - -int -midi_synth_ioctl(int dev, unsigned int cmd, ioctl_arg arg) -{ - /* - * int orig_dev = synth_devs[dev]->midi_dev; - */ - - switch (cmd) { - - case SNDCTL_SYNTH_INFO: - bcopy(synth_devs[dev]->info, &(((char *) arg)[0]), sizeof(struct synth_info)); - return 0; - break; - - case SNDCTL_SYNTH_MEMAVL: - return 0x7fffffff; - break; - - default: - return -(EINVAL); - } -} - -int -midi_synth_kill_note(int dev, int channel, int note, int velocity) -{ - int orig_dev = synth_devs[dev]->midi_dev; - int msg, chn; - - if (note < 0 || note > 127) - return 0; - if (channel < 0 || channel > 15) - return 0; - RANGE (velocity, 0, 127 ) ; - leave_sysex(dev); - - msg = prev_out_status[orig_dev] & 0xf0; - chn = prev_out_status[orig_dev] & 0x0f; - - if (chn == channel && ((msg == 0x90 && velocity == 64) || msg == 0x80)) { /* Use running status */ - if (!prefix_cmd(orig_dev, note)) - return 0; - - midi_outc(orig_dev, note); - - if (msg == 0x90)/* Running status = Note on */ - midi_outc(orig_dev, 0); /* Note on with velocity 0 == note off */ - else - midi_outc(orig_dev, velocity); - } else { - if (velocity == 64) { - if (!prefix_cmd(orig_dev, 0x90 | (channel & 0x0f))) - return 0; - midi_outc(orig_dev, 0x90 | (channel & 0x0f)); /* Note on */ - midi_outc(orig_dev, note); - midi_outc(orig_dev, 0); /* Zero G */ - } else { - if (!prefix_cmd(orig_dev, 0x80 | (channel & 0x0f))) - return 0; - midi_outc(orig_dev, 0x80 | (channel & 0x0f)); /* Note off */ - midi_outc(orig_dev, note); - midi_outc(orig_dev, velocity); - } - } - - return 0; -} - -int -midi_synth_set_instr(int dev, int channel, int instr_no) -{ - int orig_dev = synth_devs[dev]->midi_dev; - - if (instr_no < 0 || instr_no > 127) - return 0; - if (channel < 0 || channel > 15) - return 0; - - leave_sysex(dev); - - if (!prefix_cmd(orig_dev, 0xc0 | (channel & 0x0f))) - return 0; - midi_outc(orig_dev, 0xc0 | (channel & 0x0f)); /* Program change */ - midi_outc(orig_dev, instr_no); - - return 0; -} - -int -midi_synth_start_note(int dev, int channel, int note, int velocity) -{ - int orig_dev = synth_devs[dev]->midi_dev; - int msg, chn; - - if (note < 0 || note > 127) - return 0; - if (channel < 0 || channel > 15) - return 0; - RANGE (velocity, 0, 127 ); - leave_sysex(dev); - - msg = prev_out_status[orig_dev] & 0xf0; - chn = prev_out_status[orig_dev] & 0x0f; - - if (chn == channel && msg == 0x90) { /* Use running status */ - if (!prefix_cmd(orig_dev, note)) - return 0; - midi_outc(orig_dev, note); - midi_outc(orig_dev, velocity); - } else { - if (!prefix_cmd(orig_dev, 0x90 | (channel & 0x0f))) - return 0; - midi_outc(orig_dev, 0x90 | (channel & 0x0f)); /* Note on */ - midi_outc(orig_dev, note); - midi_outc(orig_dev, velocity); - } - return 0; -} - -void -midi_synth_reset(int dev) -{ - - leave_sysex(dev); -} - -int -midi_synth_open(int dev, int mode) -{ - int orig_dev = synth_devs[dev]->midi_dev; - int err; - unsigned long flags; - struct midi_input_info *inc; - - if (orig_dev < 0 || orig_dev > num_midis) - return -(ENXIO); - - midi2synth[orig_dev] = dev; - sysex_state[dev] = 0; - prev_out_status[orig_dev] = 0; - - if ((err = midi_devs[orig_dev]->open(orig_dev, mode, - midi_synth_input, midi_synth_output)) < 0) - return err; - - inc = &midi_devs[orig_dev]->in_info; - - flags = splhigh(); - inc->m_busy = 0; - inc->m_state = MST_INIT; - inc->m_ptr = 0; - inc->m_left = 0; - inc->m_prev_status = 0x00; - splx(flags); - - sysex_sleep_flag.aborting = 0; - sysex_sleep_flag.mode = WK_NONE; - - return 1; -} - -void -midi_synth_close(int dev) -{ - int orig_dev = synth_devs[dev]->midi_dev; - - leave_sysex(dev); - - /* - * Shut up the synths by sending just single active sensing message. - */ - midi_devs[orig_dev]->putc(orig_dev, 0xfe); - - midi_devs[orig_dev]->close(orig_dev); -} - -void -midi_synth_hw_control(int dev, unsigned char *event) -{ -} - -int -midi_synth_load_patch(int dev, int format, snd_rw_buf * addr, - int offs, int count, int pmgr_flag) -{ - int orig_dev = synth_devs[dev]->midi_dev; - - struct sysex_info sysex; - int i; - unsigned long left, src_offs, eox_seen = 0; - int first_byte = 1; - int hdr_size = offsetof(struct sysex_info, data); - - leave_sysex(dev); - - if (!prefix_cmd(orig_dev, 0xf0)) - return 0; - - if (format != SYSEX_PATCH) { - printf("MIDI Error: Invalid patch format (key) 0x%x\n", format); - return -(EINVAL); - } - if (count < hdr_size) { - printf("MIDI Error: Patch header too short\n"); - return -(EINVAL); - } - count -= hdr_size; - - /* - * Copy the header from user space but ignore the first bytes which - * have been transferred already. - */ - - - if (uiomove(&((char *) &sysex)[offs], hdr_size - offs, addr)) { - printf("sb: Bad copyin()!\n"); - }; - - if (count < sysex.len) { - printf("MIDI Warning: Sysex record too short (%d<%d)\n", - count, (int) sysex.len); - sysex.len = count; - } - left = sysex.len; - src_offs = 0; - - sysex_sleep_flag.aborting = 0; - sysex_sleep_flag.mode = WK_NONE; - - for (i = 0; i < left && !(sysex_sleep_flag.aborting); i++) { - unsigned char data; - - uiomove((char *) &(data), 1, addr); - - eox_seen = (i > 0 && data & 0x80); /* End of sysex */ - - if (eox_seen && data != 0xf7) - data = 0xf7; - - if (i == 0) { - if (data != 0xf0) { - printf("Error: Sysex start missing\n"); - return -(EINVAL); - } - } - while (!midi_devs[orig_dev]->putc(orig_dev, - (unsigned char) (data & 0xff)) && - !(sysex_sleep_flag.aborting)) { - int chn; - - - sysex_sleeper = &chn; - DO_SLEEP(chn, sysex_sleep_flag, 1); - - }; /* Wait for timeout */ - - if (!first_byte && data & 0x80) - return 0; - first_byte = 0; - } - - if (!eox_seen) - midi_outc(orig_dev, 0xf7); - return 0; -} - -void -midi_synth_panning(int dev, int channel, int pressure) -{ -} - -void -midi_synth_aftertouch(int dev, int channel, int pressure) -{ - int orig_dev = synth_devs[dev]->midi_dev; - int msg, chn; - - if (pressure < 0 || pressure > 127) - return; - if (channel < 0 || channel > 15) - return; - - leave_sysex(dev); - - msg = prev_out_status[orig_dev] & 0xf0; - chn = prev_out_status[orig_dev] & 0x0f; - - if (msg != 0xd0 || chn != channel) { /* Test for running status */ - if (!prefix_cmd(orig_dev, 0xd0 | (channel & 0x0f))) - return; - midi_outc(orig_dev, 0xd0 | (channel & 0x0f)); /* Channel pressure */ - } else if (!prefix_cmd(orig_dev, pressure)) - return; - - midi_outc(orig_dev, pressure); -} - -void -midi_synth_controller(int dev, int channel, int ctrl_num, int value) -{ - int orig_dev = synth_devs[dev]->midi_dev; - int chn, msg; - - if (ctrl_num < 1 || ctrl_num > 127) - return; /* NOTE! Controller # 0 ignored */ - if (channel < 0 || channel > 15) - return; - - leave_sysex(dev); - - msg = prev_out_status[orig_dev] & 0xf0; - chn = prev_out_status[orig_dev] & 0x0f; - - if (msg != 0xb0 || chn != channel) { - if (!prefix_cmd(orig_dev, 0xb0 | (channel & 0x0f))) - return; - midi_outc(orig_dev, 0xb0 | (channel & 0x0f)); - } else if (!prefix_cmd(orig_dev, ctrl_num)) - return; - - midi_outc(orig_dev, ctrl_num); - midi_outc(orig_dev, value & 0x7f); -} - -int -midi_synth_patchmgr(int dev, struct patmgr_info * rec) -{ - return -(EINVAL); -} - -void -midi_synth_bender(int dev, int channel, int value) -{ - int orig_dev = synth_devs[dev]->midi_dev; - int msg, prev_chn; - - if (channel < 0 || channel > 15) - return; - - if (value < 0 || value > 16383) - return; - - leave_sysex(dev); - - msg = prev_out_status[orig_dev] & 0xf0; - prev_chn = prev_out_status[orig_dev] & 0x0f; - - if (msg != 0xd0 || prev_chn != channel) { /* Test for running status */ - if (!prefix_cmd(orig_dev, 0xe0 | (channel & 0x0f))) - return; - midi_outc(orig_dev, 0xe0 | (channel & 0x0f)); - } else if (!prefix_cmd(orig_dev, value & 0x7f)) - return; - - midi_outc(orig_dev, value & 0x7f); - midi_outc(orig_dev, (value >> 7) & 0x7f); -} - -void -midi_synth_setup_voice(int dev, int voice, int channel) -{ -} - -int -midi_synth_send_sysex(int dev, unsigned char *bytes, int len) -{ - int orig_dev = synth_devs[dev]->midi_dev; - int i; - - for (i = 0; i < len; i++) { - switch (bytes[i]) { - case 0xf0: /* Start sysex */ - if (!prefix_cmd(orig_dev, 0xf0)) - return 0; - sysex_state[dev] = 1; - break; - - case 0xf7: /* End sysex */ - if (!sysex_state[dev]) /* Orphan sysex end */ - return 0; - sysex_state[dev] = 0; - break; - - default: - if (!sysex_state[dev]) - return 0; - - if (bytes[i] & 0x80) { /* Error. Another message before sysex end */ - bytes[i] = 0xf7; /* Sysex end */ - sysex_state[dev] = 0; - } - } - - if (!midi_devs[orig_dev]->putc(orig_dev, bytes[i])) { - /* - * Hardware leve buffer is full. Abort the sysex message. - */ - - int timeout = 0; - - bytes[i] = 0xf7; - sysex_state[dev] = 0; - - while (!midi_devs[orig_dev]->putc(orig_dev, bytes[i]) && - timeout < 1000) - timeout++; - } - if (!sysex_state[dev]) - return 0; - } - - return 0; -} -#endif diff --git a/sys/dev/sound/isa/i386/midi_synth.h b/sys/dev/sound/isa/i386/midi_synth.h deleted file mode 100644 index 80e627be4c..0000000000 --- a/sys/dev/sound/isa/i386/midi_synth.h +++ /dev/null @@ -1,49 +0,0 @@ -int midi_synth_ioctl (int dev, - unsigned int cmd, ioctl_arg arg); -int midi_synth_kill_note (int dev, int channel, int note, int velocity); -int midi_synth_set_instr (int dev, int channel, int instr_no); -int midi_synth_start_note (int dev, int channel, int note, int volume); -void midi_synth_reset (int dev); -int midi_synth_open (int dev, int mode); -void midi_synth_close (int dev); -void midi_synth_hw_control (int dev, unsigned char *event); -int midi_synth_load_patch (int dev, int format, snd_rw_buf * addr, - int offs, int count, int pmgr_flag); -void midi_synth_panning (int dev, int channel, int pressure); -void midi_synth_aftertouch (int dev, int channel, int pressure); -void midi_synth_controller (int dev, int channel, int ctrl_num, int value); -int midi_synth_patchmgr (int dev, struct patmgr_info *rec); -void midi_synth_bender (int dev, int chn, int value); -void midi_synth_setup_voice (int dev, int voice, int chn); -int midi_synth_send_sysex(int dev, unsigned char *bytes,int len); - -#ifndef _MIDI_SYNTH_C_ -static struct synth_info std_synth_info = -{MIDI_SYNTH_NAME, 0, SYNTH_TYPE_MIDI, 0, 0, 128, 0, 128, MIDI_SYNTH_CAPS}; - -static struct synth_operations std_midi_synth = -{ - &std_synth_info, - 0, - SYNTH_TYPE_MIDI, - 0, - midi_synth_open, - midi_synth_close, - midi_synth_ioctl, - midi_synth_kill_note, - midi_synth_start_note, - midi_synth_set_instr, - midi_synth_reset, - midi_synth_hw_control, - midi_synth_load_patch, - midi_synth_aftertouch, - midi_synth_controller, - midi_synth_panning, - NULL, - midi_synth_patchmgr, - midi_synth_bender, - NULL, /* alloc_voice */ - midi_synth_setup_voice, - midi_synth_send_sysex -}; -#endif diff --git a/sys/dev/sound/isa/i386/midibuf.c b/sys/dev/sound/isa/i386/midibuf.c deleted file mode 100644 index 3942d9ed72..0000000000 --- a/sys/dev/sound/isa/i386/midibuf.c +++ /dev/null @@ -1,432 +0,0 @@ -/* - * sound/midibuf.c - * - * Device file manager for /dev/midi# - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/midibuf.c,v 1.2 2003/08/07 21:17:12 dillon Exp $ - */ - -#include "sound_config.h" - - -#if defined(CONFIG_MIDI) - -#include - -/* - * Don't make MAX_QUEUE_SIZE larger than 4000 - */ - -#define MAX_QUEUE_SIZE 4000 -int -MIDIbuf_poll (int dev, struct fileinfo *file, int events, select_table * wait); - -static void -drain_midi_queue(int dev); - -static int *midi_sleeper[MAX_MIDI_DEV] = {NULL}; -static volatile struct snd_wait midi_sleep_flag[MAX_MIDI_DEV] = { {0}}; -static int *input_sleeper[MAX_MIDI_DEV] = {NULL}; -static volatile struct snd_wait input_sleep_flag[MAX_MIDI_DEV] = { {0}}; - -struct midi_buf { - int len, head, tail; - u_char queue[MAX_QUEUE_SIZE]; -}; - -struct midi_parms { - int prech_timeout; /* Timeout before the first ch */ -}; - -static struct midi_buf *midi_out_buf[MAX_MIDI_DEV] = {NULL}; -static struct midi_buf *midi_in_buf[MAX_MIDI_DEV] = {NULL}; -static struct midi_parms parms[MAX_MIDI_DEV]; - -static void midi_poll(void *dummy); - -static volatile int open_devs = 0; - -#define DATA_AVAIL(q) (q->len) -#define SPACE_AVAIL(q) (MAX_QUEUE_SIZE - q->len) - -#define QUEUE_BYTE(q, data) \ - if (SPACE_AVAIL(q)) { \ - u_long flags; \ - flags = splhigh(); \ - q->queue[q->tail] = (data); \ - q->len++; q->tail = (q->tail+1) % MAX_QUEUE_SIZE; \ - splx(flags); \ - } - -#define REMOVE_BYTE(q, data) \ - if (DATA_AVAIL(q)) { \ - u_long flags; \ - flags = splhigh(); \ - data = q->queue[q->head]; \ - q->len--; q->head = (q->head+1) % MAX_QUEUE_SIZE; \ - splx(flags); \ - } - -static void -drain_midi_queue(int dev) -{ - - /* - * Give the Midi driver time to drain its output queues - */ - - if (midi_devs[dev]->buffer_status != NULL) - while (!(PROCESS_ABORTING (midi_sleep_flag[dev])) && - midi_devs[dev]->buffer_status(dev)) { - int chn; - - midi_sleeper[dev] = &chn; - DO_SLEEP(chn, midi_sleep_flag[dev], hz / 10); - - }; -} - -static void -midi_input_intr(int dev, u_char data) -{ - if (midi_in_buf[dev] == NULL) - return; - - if (data == 0xfe) /* Active sensing */ - return; /* Ignore */ - - if (SPACE_AVAIL(midi_in_buf[dev])) { - QUEUE_BYTE(midi_in_buf[dev], data); - if ((input_sleep_flag[dev].mode & WK_SLEEP)) { - input_sleep_flag[dev].mode = WK_WAKEUP; - wakeup(input_sleeper[dev]); - }; - } -} - -static void -midi_output_intr(int dev) -{ - /* - * Currently NOP - */ -} - -static void -midi_poll(void *dummy) -{ - u_long flags; - int dev; - - flags = splhigh(); - if (open_devs) { - for (dev = 0; dev < num_midis; dev++) - if (midi_out_buf[dev] != NULL) { - while (DATA_AVAIL(midi_out_buf[dev]) && - midi_devs[dev]->putc(dev, - midi_out_buf[dev]->queue[midi_out_buf[dev]->head])) { - midi_out_buf[dev]->head = (midi_out_buf[dev]->head + 1) % MAX_QUEUE_SIZE; - midi_out_buf[dev]->len--; - } - - if (DATA_AVAIL(midi_out_buf[dev]) < 100 && - (midi_sleep_flag[dev].mode & WK_SLEEP)) { - midi_sleep_flag[dev].mode = WK_WAKEUP; - wakeup(midi_sleeper[dev]); - }; - } - timeout( midi_poll, 0, 1);; /* Come back later */ - } - splx(flags); -} - -int -MIDIbuf_open(int dev, struct fileinfo * file) -{ - int mode, err; - - dev = dev >> 4; - mode = file->mode & O_ACCMODE; - - if (num_midis > MAX_MIDI_DEV) { - printf("Sound: FATAL ERROR: Too many midi interfaces\n"); - num_midis = MAX_MIDI_DEV; - } - if (dev < 0 || dev >= num_midis) { - printf("Sound: Nonexistent MIDI interface %d\n", dev); - return -(ENXIO); - } - /* - * Interrupts disabled. Be careful - */ - - if ((err = midi_devs[dev]->open(dev, mode, - midi_input_intr, midi_output_intr)) < 0) { - return err; - } - parms[dev].prech_timeout = 0; - - midi_in_buf[dev] = (struct midi_buf *) malloc(sizeof(struct midi_buf), M_TEMP, M_WAITOK); - - if (midi_in_buf[dev] == NULL) { - printf("midi: Can't allocate buffer\n"); - midi_devs[dev]->close(dev); - return -(EIO); - } - midi_in_buf[dev]->len = midi_in_buf[dev]->head = midi_in_buf[dev]->tail = 0; - - midi_out_buf[dev] = (struct midi_buf *) malloc(sizeof(struct midi_buf), M_TEMP, M_WAITOK); - - if (midi_out_buf[dev] == NULL) { - printf("midi: Can't allocate buffer\n"); - midi_devs[dev]->close(dev); - free(midi_in_buf[dev], M_TEMP); - midi_in_buf[dev] = NULL; - return -(EIO); - } - midi_out_buf[dev]->len = midi_out_buf[dev]->head = midi_out_buf[dev]->tail = 0; - open_devs++; - - { - midi_sleep_flag[dev].aborting = 0; - midi_sleep_flag[dev].mode = WK_NONE; - }; - { - input_sleep_flag[dev].aborting = 0; - input_sleep_flag[dev].mode = WK_NONE; - }; - - if (open_devs < 2) { /* This was first open */ - { - }; - - timeout( midi_poll, 0, 1);; /* Start polling */ - } - return err; -} - -void -MIDIbuf_release(int dev, struct fileinfo * file) -{ - int mode; - u_long flags; - - dev = dev >> 4; - mode = file->mode & O_ACCMODE; - - if (dev < 0 || dev >= num_midis) - return; - - flags = splhigh(); - - /* - * Wait until the queue is empty - */ - - if (mode != OPEN_READ) { - midi_devs[dev]->putc(dev, 0xfe); /* Active sensing to - * shut the devices */ - - while (!(PROCESS_ABORTING (midi_sleep_flag[dev])) && - DATA_AVAIL(midi_out_buf[dev])) { - int chn; - midi_sleeper[dev] = &chn; - DO_SLEEP(chn, midi_sleep_flag[dev], 0); - - }; /* Sync */ - - drain_midi_queue(dev); /* Ensure the output queues are empty */ - } - splx(flags); - - midi_devs[dev]->close(dev); - - free(midi_in_buf[dev], M_TEMP); - free(midi_out_buf[dev], M_TEMP); - midi_in_buf[dev] = NULL; - midi_out_buf[dev] = NULL; - if (open_devs < 2) { - }; - open_devs--; -} - -int -MIDIbuf_write(int dev, struct fileinfo * file, snd_rw_buf * buf, int count) -{ - u_long flags; - int c, n, i; - u_char tmp_data; - - dev = dev >> 4; - - if (!count) - return 0; - - flags = splhigh(); - - c = 0; - - while (c < count) { - n = SPACE_AVAIL(midi_out_buf[dev]); - - if (n == 0) { /* No space just now. We have to sleep */ - - { - int chn; - - midi_sleeper[dev] = &chn; - DO_SLEEP(chn, midi_sleep_flag[dev], 0); - }; - - if (PROCESS_ABORTING(midi_sleep_flag[dev])) { - splx(flags); - return -(EINTR); - } - n = SPACE_AVAIL(midi_out_buf[dev]); - } - if (n > (count - c)) - n = count - c; - - for (i = 0; i < n; i++) { - - if (uiomove((char *) &tmp_data, 1, buf)) { - printf("sb: Bad copyin()!\n"); - }; - QUEUE_BYTE(midi_out_buf[dev], tmp_data); - c++; - } - } - - splx(flags); - - return c; -} - - -int -MIDIbuf_read(int dev, struct fileinfo * file, snd_rw_buf * buf, int count) -{ - int n, c = 0; - u_long flags; - u_char tmp_data; - - dev = dev >> 4; - - flags = splhigh(); - - if (!DATA_AVAIL(midi_in_buf[dev])) { /* No data yet, wait */ - - { - int chn; - - - input_sleeper[dev] = &chn; - DO_SLEEP(chn, input_sleep_flag[dev], - parms[dev].prech_timeout); - - }; - if (PROCESS_ABORTING(input_sleep_flag[dev])) - c = -(EINTR); /* The user is getting restless */ - } - if (c == 0 && DATA_AVAIL(midi_in_buf[dev])) { /* Got some bytes */ - n = DATA_AVAIL(midi_in_buf[dev]); - if (n > count) - n = count; - c = 0; - - while (c < n) { - REMOVE_BYTE(midi_in_buf[dev], tmp_data); - - if (uiomove((char *) &tmp_data, 1, buf)) { - printf("sb: Bad copyout()!\n"); - }; - c++; - } - } - splx(flags); - - return c; -} - -int -MIDIbuf_ioctl(int dev, struct fileinfo * file, u_int cmd, ioctl_arg arg) -{ - int val; - - dev = dev >> 4; - - if (((cmd >> 8) & 0xff) == 'C') { - if (midi_devs[dev]->coproc) /* Coprocessor ioctl */ - return midi_devs[dev]->coproc->ioctl(midi_devs[dev]->coproc->devc, cmd, arg, 0); - else - printf("/dev/midi%d: No coprocessor for this device\n", dev); - - return -(ENXIO); - } else - switch (cmd) { - - case SNDCTL_MIDI_PRETIME: - val = (int) (*(int *) arg); - if (val < 0) - val = 0; - - val = (hz * val) / 10; - parms[dev].prech_timeout = val; - return *(int *) arg = val; - break; - - default: - return midi_devs[dev]->ioctl(dev, cmd, arg); - } -} - -#ifdef ALLOW_POLL -int -MIDIbuf_poll (int dev, struct fileinfo *file, int events, select_table * wait) -{ - int revents = 0; - - dev = dev >> 4; - - if (events & (POLLIN | POLLRDNORM)) - if (!DATA_AVAIL (midi_in_buf[dev])) - selrecord(wait, &selinfo[dev]); - else - revents |= events & (POLLIN | POLLRDNORM); - - if (events & (POLLOUT | POLLWRNORM)) - if (SPACE_AVAIL (midi_out_buf[dev])) - selrecord(wait, &selinfo[dev]); - else - revents |= events & (POLLOUT | POLLWRNORM); - - return revents; -} - -#endif /* ALLOW_SELECT */ - - - -#endif diff --git a/sys/dev/sound/isa/i386/mpu/mpu401.c b/sys/dev/sound/isa/i386/mpu/mpu401.c deleted file mode 100644 index 2858ef3236..0000000000 --- a/sys/dev/sound/isa/i386/mpu/mpu401.c +++ /dev/null @@ -1,1644 +0,0 @@ -/* - * sound/mpu401.c - * - * The low level driver for Roland MPU-401 compatible Midi cards. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * Modified: Riccardo Facchetti 24 Mar 1995 - Added the Audio Excel DSP 16 - * initialization routine. - */ - -#define USE_SEQ_MACROS -#define USE_SIMPLE_MACROS - -#include - -#if (defined(CONFIG_MPU401) || defined(CONFIG_MPU_EMU)) && defined(CONFIG_MIDI) -#include - -static int init_sequence[20]; /* NOTE! pos 0 = len, start pos 1. */ - -#ifdef CONFIG_SEQUENCER -static int timer_mode = TMR_INTERNAL, timer_caps = TMR_INTERNAL; - -#endif - -struct mpu_config { - int base; /* I/O base */ - int irq; - int opened; /* Open mode */ - int devno; - int synthno; - int uart_mode; - int initialized; - int mode; -#define MODE_MIDI 1 -#define MODE_SYNTH 2 - u_char version, revision; - u_int capabilities; -#define MPU_CAP_INTLG 0x10000000 -#define MPU_CAP_SYNC 0x00000010 -#define MPU_CAP_FSK 0x00000020 -#define MPU_CAP_CLS 0x00000040 -#define MPU_CAP_SMPTE 0x00000080 -#define MPU_CAP_2PORT 0x00000001 - int timer_flag; - -#define MBUF_MAX 10 -#define BUFTEST(dc) if (dc->m_ptr >= MBUF_MAX || dc->m_ptr < 0) \ - {printf("MPU: Invalid buffer pointer %d/%d, s=%d\n", dc->m_ptr, dc->m_left, dc->m_state);dc->m_ptr--;} - int m_busy; - u_char m_buf[MBUF_MAX]; - int m_ptr; - int m_state; - int m_left; - u_char last_status; - void (*inputintr) (int dev, u_char data); - int shared_irq; - sound_os_info *osp; -}; - -#ifdef PC98 -#define DATAPORT(base) (base) -#define COMDPORT(base) (base+2) -#define STATPORT(base) (base+2) -#else -#define DATAPORT(base) (base) -#define COMDPORT(base) (base+1) -#define STATPORT(base) (base+1) -#endif /* PC98 */ - -#define mpu401_status(devc) inb( STATPORT((devc)->base)) -#define input_avail(devc) (!(mpu401_status(devc)&INPUT_AVAIL)) -#define output_ready(devc) (!(mpu401_status(devc)&OUTPUT_READY)) -#define write_command(devc, cmd) outb( COMDPORT((devc)->base), cmd) -#define read_data(devc) inb( DATAPORT((devc)->base)) - -#define write_data(devc, byte) outb( DATAPORT((devc)->base), byte) - -#define OUTPUT_READY 0x40 -#define INPUT_AVAIL 0x80 -#define MPU_ACK 0xFE -#define MPU_RESET 0xFF -#define UART_MODE_ON 0x3F - -static struct mpu_config dev_conf[MAX_MIDI_DEV] = { {0}}; - -static int n_mpu_devs = 0; -static volatile int irq2dev[17] = - {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; - -static int reset_mpu401(struct mpu_config * devc); -static void set_uart_mode(int dev, struct mpu_config * devc, int arg); - -static void mpu_timer_init(int midi_dev); -static void mpu_timer_interrupt(void); -static void timer_ext_event(struct mpu_config * devc, int event, int parm); - -static struct synth_info mpu_synth_info_proto = -{"MPU-401 MIDI interface", 0, SYNTH_TYPE_MIDI, 0, 0, 128, 0, 128, SYNTH_CAP_INPUT}; - -static struct synth_info mpu_synth_info[MAX_MIDI_DEV]; - -/* - * States for the input scanner - */ - -#define ST_INIT 0 /* Ready for timing byte or msg */ -#define ST_TIMED 1 /* Leading timing byte rcvd */ -#define ST_DATABYTE 2 /* Waiting for (nr_left) data bytes */ - -#define ST_SYSMSG 100 /* System message (sysx etc). */ -#define ST_SYSEX 101 /* System exclusive msg */ -#define ST_MTC 102 /* Midi Time Code (MTC) qframe msg */ -#define ST_SONGSEL 103 /* Song select */ -#define ST_SONGPOS 104 /* Song position pointer */ - -static u_char len_tab[] =/* # of data bytes following a status */ -{ - 2, /* 8x */ - 2, /* 9x */ - 2, /* Ax */ - 2, /* Bx */ - 1, /* Cx */ - 1, /* Dx */ - 2, /* Ex */ - 0 /* Fx */ -}; - -#ifndef CONFIG_SEQUENCER -#define STORE(cmd) -#else -#define STORE(cmd) \ -{ \ - int len; \ - u_char obuf[8]; \ - cmd; \ - seq_input_event(obuf, len); \ -} -#endif - -#define _seqbuf obuf -#define _seqbufptr 0 -#define _SEQ_ADVBUF(x) len=x - -static int -mpu_input_scanner(struct mpu_config * devc, u_char midic) -{ - - switch (devc->m_state) { - case ST_INIT: - switch (midic) { - case 0xf8: - /* Timer overflow */ - break; - - case 0xfc: - printf(""); - break; - - case 0xfd: - if (devc->timer_flag) - mpu_timer_interrupt(); - break; - - case 0xfe: - return MPU_ACK; - break; - - case 0xf0: - case 0xf1: - case 0xf2: - case 0xf3: - case 0xf4: - case 0xf5: - case 0xf6: - case 0xf7: - printf("", midic & 0x0f); - break; - - case 0xf9: - printf(""); - break; - - case 0xff: - devc->m_state = ST_SYSMSG; - break; - - default: - if (midic <= 0xef) { - /* printf("mpu time: %d ", midic); */ - devc->m_state = ST_TIMED; - } else - printf(" ", midic); - } - break; - - case ST_TIMED: - { - int msg = ((int) (midic & 0xf0) >> 4); - - devc->m_state = ST_DATABYTE; - - if (msg < 8) { /* Data byte */ - /* printf("midi msg (running status) "); */ - msg = ((int) (devc->last_status & 0xf0) >> 4); - msg -= 8; - devc->m_left = len_tab[msg] - 1; - - devc->m_ptr = 2; - devc->m_buf[0] = devc->last_status; - devc->m_buf[1] = midic; - - if (devc->m_left <= 0) { - devc->m_state = ST_INIT; - do_midi_msg(devc->synthno, devc->m_buf, devc->m_ptr); - devc->m_ptr = 0; - } - } else if (msg == 0xf) { /* MPU MARK */ - devc->m_state = ST_INIT; - - switch (midic) { - case 0xf8: - /* printf("NOP "); */ - break; - - case 0xf9: - /* printf("meas end "); */ - break; - - case 0xfc: - /* printf("data end "); */ - break; - - default: - printf("Unknown MPU mark %02x\n", midic); - } - } else { - devc->last_status = midic; - /* printf ("midi msg "); */ - msg -= 8; - devc->m_left = len_tab[msg]; - - devc->m_ptr = 1; - devc->m_buf[0] = midic; - - if (devc->m_left <= 0) { - devc->m_state = ST_INIT; - do_midi_msg(devc->synthno, devc->m_buf, devc->m_ptr); - devc->m_ptr = 0; - } - } - } - break; - - case ST_SYSMSG: - switch (midic) { - case 0xf0: - printf(""); - devc->m_state = ST_SYSEX; - break; - - case 0xf1: - devc->m_state = ST_MTC; - break; - - case 0xf2: - devc->m_state = ST_SONGPOS; - devc->m_ptr = 0; - break; - - case 0xf3: - devc->m_state = ST_SONGSEL; - break; - - case 0xf6: - /* printf("tune_request\n"); */ - devc->m_state = ST_INIT; - /* XXX do we need a break here ? - lr 970710 */ - - /* - * Real time messages - */ - case 0xf8: - /* midi clock */ - devc->m_state = ST_INIT; - timer_ext_event(devc, TMR_CLOCK, 0); - break; - - case 0xfA: - devc->m_state = ST_INIT; - timer_ext_event(devc, TMR_START, 0); - break; - - case 0xFB: - devc->m_state = ST_INIT; - timer_ext_event(devc, TMR_CONTINUE, 0); - break; - - case 0xFC: - devc->m_state = ST_INIT; - timer_ext_event(devc, TMR_STOP, 0); - break; - - case 0xFE: - /* active sensing */ - devc->m_state = ST_INIT; - break; - - case 0xff: - /* printf("midi hard reset"); */ - devc->m_state = ST_INIT; - break; - - default: - printf("unknown MIDI sysmsg %0x\n", midic); - devc->m_state = ST_INIT; - } - break; - - case ST_MTC: - devc->m_state = ST_INIT; - printf("MTC frame %x02\n", midic); - break; - - case ST_SYSEX: - if (midic == 0xf7) { - printf(""); - devc->m_state = ST_INIT; - } else - printf("%02x ", midic); - break; - - case ST_SONGPOS: - BUFTEST(devc); - devc->m_buf[devc->m_ptr++] = midic; - if (devc->m_ptr == 2) { - devc->m_state = ST_INIT; - devc->m_ptr = 0; - timer_ext_event(devc, TMR_SPP, - ((devc->m_buf[1] & 0x7f) << 7) | (devc->m_buf[0] & 0x7f)); - } - break; - - case ST_DATABYTE: - BUFTEST(devc); - devc->m_buf[devc->m_ptr++] = midic; - if ((--devc->m_left) <= 0) { - devc->m_state = ST_INIT; - do_midi_msg(devc->synthno, devc->m_buf, devc->m_ptr); - devc->m_ptr = 0; - } - break; - - default: - printf("Bad state %d ", devc->m_state); - devc->m_state = ST_INIT; - } - - return 1; -} - -static void -mpu401_input_loop(struct mpu_config * devc) -{ - u_long flags; - int n, busy; - - flags = splhigh(); - busy = devc->m_busy; - devc->m_busy = 1; - splx(flags); - - if (busy) /* Already inside the scanner */ - return; - - n = 50; - - while (input_avail(devc) && n-- > 0) { - u_char c = read_data(devc); - - if (devc->mode == MODE_SYNTH) { - mpu_input_scanner(devc, c); - } else if (devc->opened & OPEN_READ && devc->inputintr != NULL) - devc->inputintr(devc->devno, c); - } - - devc->m_busy = 0; -} - -void -mpuintr(int irq) -{ - struct mpu_config *devc; - int dev; - - /* - * FreeBSD (and some others) pass unit number to the interrupt - * handler. In this case we have to scan the table for first handler. - */ - - if (irq < 1 || irq > 15) { - dev = -1; - } else - dev = irq2dev[irq]; - - if (dev == -1) { - int origirq = irq; - - for (irq = 0; irq <= 16; irq++) - if (irq2dev[irq] != -1) - break; - if (irq > 15) { - printf("MPU-401: Bogus interrupt #%d?\n", origirq); - return; - } - dev = irq2dev[irq]; - devc = &dev_conf[dev]; - } else - devc = &dev_conf[dev]; - - if (input_avail(devc)) - if (devc->base != 0 && (devc->opened & OPEN_READ || devc->mode == MODE_SYNTH)) - mpu401_input_loop(devc); - else { - /* Dummy read (just to acknowledge the interrupt) */ - read_data(devc); - } - -} - -static int -mpu401_open(int dev, int mode, - void (*input) (int dev, u_char data), void (*output) (int dev)) -{ - int err; - struct mpu_config *devc; - - if (dev < 0 || dev >= num_midis) - return -(ENXIO); - - devc = &dev_conf[dev]; - - if (devc->opened) { - printf("MPU-401: Midi busy\n"); - return -(EBUSY); - } - /* - * Verify that the device is really running. Some devices (such as - * Ensoniq SoundScape don't work before the on board processor (OBP) - * is initialized by downloading its microcode. - */ - - if (!devc->initialized) { - if (mpu401_status(devc) == 0xff) { /* Bus float */ - printf("MPU-401: Device not initialized properly\n"); - return -(EIO); - } - reset_mpu401(devc); - } - irq2dev[devc->irq] = dev; - - if (midi_devs[dev]->coproc) - if ((err = midi_devs[dev]->coproc-> - open(midi_devs[dev]->coproc->devc, COPR_MIDI)) < 0) { - printf("MPU-401: Can't access coprocessor device\n"); - - return err; - } - set_uart_mode(dev, devc, 1); - devc->mode = MODE_MIDI; - devc->synthno = 0; - - mpu401_input_loop(devc); - - devc->inputintr = input; - devc->opened = mode; - - return 0; -} - -static void -mpu401_close(int dev) -{ - struct mpu_config *devc; - - devc = &dev_conf[dev]; - - if (devc->uart_mode) - reset_mpu401(devc); /* This disables the UART mode */ - devc->mode = 0; - - devc->inputintr = NULL; - - if (midi_devs[dev]->coproc) - midi_devs[dev]->coproc->close(midi_devs[dev]->coproc->devc, COPR_MIDI); - devc->opened = 0; -} - -static int -mpu401_out(int dev, u_char midi_byte) -{ - int timeout; - u_long flags; - - struct mpu_config *devc; - - devc = &dev_conf[dev]; - - /* - * Sometimes it takes about 13000 loops before the output becomes - * ready (After reset). Normally it takes just about 10 loops. - */ - -#ifdef PC98 - for (timeout = 23000; timeout > 0 && !output_ready(devc); timeout--); -#else - for (timeout = 3000; timeout > 0 && !output_ready(devc); timeout--); -#endif - - flags = splhigh(); - if (!output_ready(devc)) { - printf("MPU-401: Send data timeout\n"); - splx(flags); - return 0; - } - write_data(devc, midi_byte); - splx(flags); - return 1; -} - -static int -mpu401_command(int dev, mpu_command_rec * cmd) -{ - int i, timeout, ok; - int ret = 0; - u_long flags; - struct mpu_config *devc; - - devc = &dev_conf[dev]; - - if (devc->uart_mode) { /* Not possible in UART mode */ - printf("MPU-401 commands not possible in the UART mode\n"); - return -(EINVAL); - } - /* - * Test for input since pending input seems to block the output. - */ - if (input_avail(devc)) - mpu401_input_loop(devc); - - /* - * Sometimes it takes about 30000 loops before the output becomes - * ready (After reset). Normally it takes just about 10 loops. - */ - -#ifdef PC98 - timeout = 50000; -#else - timeout = 30000; -#endif -retry: - if (timeout-- <= 0) { - printf("MPU-401: Command (0x%x) timeout\n", (int) cmd->cmd); - return -(EIO); - } - flags = splhigh(); - - if (!output_ready(devc)) { - splx(flags); - goto retry; - } - write_command(devc, cmd->cmd); - ok = 0; - for (timeout = 50000; timeout > 0 && !ok; timeout--) - if (input_avail(devc)) - if (devc->opened && devc->mode == MODE_SYNTH) { - if (mpu_input_scanner(devc, read_data(devc)) == MPU_ACK) - ok = 1; - } else {/* Device is not currently open. Use simplier method */ - if (read_data(devc) == MPU_ACK) - ok = 1; - } - - if (!ok) { - splx(flags); - /* printf ("MPU: No ACK to command (0x%x)\n", (int) cmd->cmd); */ - return -(EIO); - } - if (cmd->nr_args) - for (i = 0; i < cmd->nr_args; i++) { - for (timeout = 3000; timeout > 0 && !output_ready(devc); timeout--); - if (!mpu401_out(dev, cmd->data[i])) { - splx(flags); - printf("MPU: Command (0x%x), parm send failed.\n", (int) cmd->cmd); - return -(EIO); - } - } - - ret = 0; - cmd->data[0] = 0; - - if (cmd->nr_returns) - for (i = 0; i < cmd->nr_returns; i++) { - ok = 0; - for (timeout = 5000; timeout > 0 && !ok; timeout--) - if (input_avail(devc)) { - cmd->data[i] = read_data(devc); - ok = 1; - } - if (!ok) { - splx(flags); - /* printf ("MPU: No response(%d) to command (0x%x)\n", - * i, (int) cmd->cmd); - */ - return -(EIO); - } - } - - splx(flags); - - return ret; -} - -static int -mpu_cmd(int dev, int cmd, int data) -{ - int ret; - - static mpu_command_rec rec; - - rec.cmd = cmd & 0xff; - rec.nr_args = ((cmd & 0xf0) == 0xE0); - rec.nr_returns = ((cmd & 0xf0) == 0xA0); - rec.data[0] = data & 0xff; - - if ((ret = mpu401_command(dev, &rec)) < 0) { - return ret; - } - return (u_char) rec.data[0]; -} - -static int -mpu401_prefix_cmd(int dev, u_char status) -{ - struct mpu_config *devc = &dev_conf[dev]; - - if (devc->uart_mode) - return 1; - - if (status < 0xf0) { - if (mpu_cmd(dev, 0xD0, 0) < 0) { - return 0; - } - return 1; - } - switch (status) { - case 0xF0: - if (mpu_cmd(dev, 0xDF, 0) < 0) { - return 0; - } - return 1; - break; - - default: - return 0; - } - -} - -static int -mpu401_start_read(int dev) -{ - return 0; -} - -static int -mpu401_end_read(int dev) -{ - return 0; -} - -static int -mpu401_ioctl(int dev, u_int cmd, ioctl_arg arg) -{ - struct mpu_config *devc; - - devc = &dev_conf[dev]; - - switch (cmd) { - case 1: - bcopy(&(((char *) arg)[0]), (char *) init_sequence, sizeof(init_sequence)); - return 0; - break; - - case SNDCTL_MIDI_MPUMODE: - if (!(devc->capabilities & MPU_CAP_INTLG)) { /* No intelligent mode */ - printf("MPU-401: Intelligent mode not supported by the HW\n"); - return -(EINVAL); - } - set_uart_mode(dev, devc, !(*(int *) arg)); - return 0; - break; - - case SNDCTL_MIDI_MPUCMD: - { - int ret; - mpu_command_rec rec; - - bcopy(&(((char *) arg)[0]), (char *) &rec, sizeof(rec)); - - if ((ret = mpu401_command(dev, &rec)) < 0) - return ret; - bcopy((char *) &rec, &(((char *) arg)[0]), sizeof(rec)); - return 0; - } - break; - - default: - return -(EINVAL); - } -} - -static void -mpu401_kick(int dev) -{ -} - -static int -mpu401_buffer_status(int dev) -{ - return 0; /* No data in buffers */ -} - -static int -mpu_synth_ioctl(int dev, - u_int cmd, ioctl_arg arg) -{ - int midi_dev; - struct mpu_config *devc; - - midi_dev = synth_devs[dev]->midi_dev; - - if (midi_dev < 0 || midi_dev > num_midis) - return -(ENXIO); - - devc = &dev_conf[midi_dev]; - - switch (cmd) { - - case SNDCTL_SYNTH_INFO: - bcopy(&mpu_synth_info[midi_dev], &(((char *) arg)[0]), sizeof(struct synth_info)); - return 0; - break; - - case SNDCTL_SYNTH_MEMAVL: - return 0x7fffffff; - break; - - default: - return -(EINVAL); - } -} - -static int -mpu_synth_open(int dev, int mode) -{ - int midi_dev, err; - struct mpu_config *devc; - - midi_dev = synth_devs[dev]->midi_dev; - - if (midi_dev < 0 || midi_dev > num_midis) { - return -(ENXIO); - } - devc = &dev_conf[midi_dev]; - - /* - * Verify that the device is really running. Some devices (such as - * Ensoniq SoundScape don't work before the on board processor (OBP) - * is initialized by downloading its microcode. - */ - - if (!devc->initialized) { - if (mpu401_status(devc) == 0xff) { /* Bus float */ - printf("MPU-401: Device not initialized properly\n"); - return -(EIO); - } - reset_mpu401(devc); - } - if (devc->opened) { - printf("MPU-401: Midi busy\n"); - return -(EBUSY); - } - devc->mode = MODE_SYNTH; - devc->synthno = dev; - - devc->inputintr = NULL; - irq2dev[devc->irq] = midi_dev; - - if (midi_devs[midi_dev]->coproc) - if ((err = midi_devs[midi_dev]->coproc-> - open(midi_devs[midi_dev]->coproc->devc, COPR_MIDI)) < 0) { - printf("MPU-401: Can't access coprocessor device\n"); - - return err; - } - devc->opened = mode; - reset_mpu401(devc); - - if (mode & OPEN_READ) { - mpu_cmd(midi_dev, 0x8B, 0); /* Enable data in stop mode */ - mpu_cmd(midi_dev, 0x34, 0); /* Return timing bytes in stop mode */ - } - return 0; -} - -static void -mpu_synth_close(int dev) -{ - int midi_dev; - struct mpu_config *devc; - - midi_dev = synth_devs[dev]->midi_dev; - - devc = &dev_conf[midi_dev]; - mpu_cmd(midi_dev, 0x15, 0); /* Stop recording, playback and MIDI */ - mpu_cmd(midi_dev, 0x8a, 0); /* Disable data in stopped mode */ - - devc->inputintr = NULL; - - if (midi_devs[midi_dev]->coproc) - midi_devs[midi_dev]->coproc->close(midi_devs[midi_dev]->coproc->devc, COPR_MIDI); - devc->opened = 0; - devc->mode = 0; -} - -#define MIDI_SYNTH_NAME "MPU-401 UART Midi" -#define MIDI_SYNTH_CAPS SYNTH_CAP_INPUT -#include - -static struct synth_operations mpu401_synth_proto = -{ - NULL, - 0, - SYNTH_TYPE_MIDI, - 0, - mpu_synth_open, - mpu_synth_close, - mpu_synth_ioctl, - midi_synth_kill_note, - midi_synth_start_note, - midi_synth_set_instr, - midi_synth_reset, - midi_synth_hw_control, - midi_synth_load_patch, - midi_synth_aftertouch, - midi_synth_controller, - midi_synth_panning, - NULL, - midi_synth_patchmgr, - midi_synth_bender, - NULL, /* alloc */ - midi_synth_setup_voice, - midi_synth_send_sysex -}; - -static struct synth_operations *mpu401_synth_operations[MAX_MIDI_DEV]; - -static struct midi_operations mpu401_midi_proto = -{ - {"MPU-401 Midi", 0, MIDI_CAP_MPU401, SNDCARD_MPU401}, - NULL, - {0}, - mpu401_open, - mpu401_close, - mpu401_ioctl, - mpu401_out, - mpu401_start_read, - mpu401_end_read, - mpu401_kick, - NULL, - mpu401_buffer_status, - mpu401_prefix_cmd -}; - -static struct midi_operations mpu401_midi_operations[MAX_MIDI_DEV]; - -static void -mpu401_chk_version(struct mpu_config * devc) -{ - int tmp; - - devc->version = devc->revision = 0; - - if ((tmp = mpu_cmd(num_midis, 0xAC, 0)) < 0) - return; - - if ((tmp & 0xf0) > 0x20)/* Why is it larger than 2.x ??? */ - return; - - devc->version = tmp; - - if ((tmp = mpu_cmd(num_midis, 0xAD, 0)) < 0) { - devc->version = 0; - return; - } - devc->revision = tmp; -} - -void -attach_mpu401(struct address_info * hw_config) -{ - u_long flags; - char revision_char; - - struct mpu_config *devc; - - if (num_midis >= MAX_MIDI_DEV) { - printf("MPU-401: Too many midi devices detected\n"); - return ; - } - devc = &dev_conf[num_midis]; - - devc->base = hw_config->io_base; - devc->osp = hw_config->osp; - devc->irq = hw_config->irq; - devc->opened = 0; - devc->uart_mode = 0; - devc->initialized = 0; - devc->version = 0; - devc->revision = 0; - devc->capabilities = 0; - devc->timer_flag = 0; - devc->m_busy = 0; - devc->m_state = ST_INIT; - devc->shared_irq = hw_config->always_detect; - devc->irq = hw_config->irq; - - if (devc->irq < 0) { - devc->irq *= -1; - devc->shared_irq = 1; - } - irq2dev[devc->irq] = num_midis; - - if (!hw_config->always_detect) { - /* Verify the hardware again */ - if (!reset_mpu401(devc)) - return ; - - if (!devc->shared_irq) - if (snd_set_irq_handler(devc->irq, mpuintr, devc->osp) < 0) { - return ; - } - flags = splhigh(); - mpu401_chk_version(devc); - if (devc->version == 0) - mpu401_chk_version(devc); - splx(flags); - }; - - if (devc->version != 0) - if (mpu_cmd(num_midis, 0xC5, 0) >= 0) /* Set timebase OK */ - if (mpu_cmd(num_midis, 0xE0, 120) >= 0) /* Set tempo OK */ - devc->capabilities |= MPU_CAP_INTLG; /* Supports intelligent - * mode */ - - mpu401_synth_operations[num_midis] = (struct synth_operations *) malloc(sizeof(struct synth_operations), M_DEVBUF, M_NOWAIT); - - if (!mpu401_synth_operations[num_midis]) - panic("SOUND: Cannot allocate memory\n"); - - if (mpu401_synth_operations[num_midis] == NULL) { - printf("mpu401: Can't allocate memory\n"); - return ; - } - if (!(devc->capabilities & MPU_CAP_INTLG)) { /* No intelligent mode */ - bcopy((char *) &std_midi_synth, (char *) mpu401_synth_operations[num_midis], sizeof(struct synth_operations)); - } else { - bcopy((char *) &mpu401_synth_proto, (char *) mpu401_synth_operations[num_midis], sizeof(struct synth_operations)); - } - - bcopy((char *) &mpu401_midi_proto, (char *) &mpu401_midi_operations[num_midis], sizeof(struct midi_operations)); - - mpu401_midi_operations[num_midis].converter = - mpu401_synth_operations[num_midis]; - - bcopy((char *) &mpu_synth_info_proto, (char *) &mpu_synth_info[num_midis], sizeof(struct synth_info)); - - n_mpu_devs++; - - if (devc->version == 0x20 && devc->revision >= 0x07) { /* MusicQuest interface */ - int ports = (devc->revision & 0x08) ? 32 : 16; - - devc->capabilities |= MPU_CAP_SYNC | MPU_CAP_SMPTE | - MPU_CAP_CLS | MPU_CAP_2PORT; - - revision_char = (devc->revision == 0x7f) ? 'M' : ' '; - snprintf(mpu_synth_info[num_midis].name, - sizeof(mpu_synth_info[num_midis].name), - "MQX-%d%c MIDI Interface #%d", - ports, - revision_char, - n_mpu_devs); - } else { - - revision_char = devc->revision ? devc->revision + '@' : ' '; - if ((int) devc->revision > ('Z' - '@')) - revision_char = '+'; - - devc->capabilities |= MPU_CAP_SYNC | MPU_CAP_FSK; - - snprintf(mpu_synth_info[num_midis].name, - sizeof(mpu_synth_info[num_midis].name), - "MPU-401 %d.%d%c Midi interface", - (int) (devc->version & 0xf0) >> 4, - devc->version & 0x0f, - revision_char); - } - - strcpy(mpu401_midi_operations[num_midis].info.name, - mpu_synth_info[num_midis].name); - - conf_printf(mpu_synth_info[num_midis].name, hw_config); - - mpu401_synth_operations[num_midis]->midi_dev = devc->devno = num_midis; - mpu401_synth_operations[devc->devno]->info = - &mpu_synth_info[devc->devno]; - - if (devc->capabilities & MPU_CAP_INTLG) /* Intelligent mode */ - mpu_timer_init(num_midis); - - irq2dev[devc->irq] = num_midis; - midi_devs[num_midis++] = &mpu401_midi_operations[devc->devno]; - return ; -} - -static int -reset_mpu401(struct mpu_config * devc) -{ - u_long flags; - int ok, timeout, n; - int timeout_limit; - - /* - * Send the RESET command. Try again if no success at the first time. - * (If the device is in the UART mode, it will not ack the reset - * cmd). - */ - - ok = 0; - - timeout_limit = devc->initialized ? 30000 : 100000; - devc->initialized = 1; - - for (n = 0; n < 2 && !ok; n++) { - for (timeout = timeout_limit; timeout > 0 && !ok; timeout--) - ok = output_ready(devc); - - write_command(devc, MPU_RESET); /* Send MPU-401 RESET Command */ - - /* - * Wait at least 25 msec. This method is not accurate so - * let's make the loop bit longer. Cannot sleep since this is - * called during boot. - */ - - for (timeout = timeout_limit * 2; timeout > 0 && !ok; timeout--) { - flags = splhigh(); - if ( (input_avail(devc)) && (read_data(devc) == MPU_ACK) ) - ok = 1; - splx(flags); - } - - } - - devc->m_state = ST_INIT; - devc->m_ptr = 0; - devc->m_left = 0; - devc->last_status = 0; - devc->uart_mode = 0; - - return ok; -} - -static void -set_uart_mode(int dev, struct mpu_config * devc, int arg) -{ - if (!arg && (devc->capabilities & MPU_CAP_INTLG)) - return; - if ((devc->uart_mode == 0) == (arg == 0)) - return; /* Already set */ - reset_mpu401(devc); /* This exits the uart mode */ - - if (arg && (mpu_cmd(dev, UART_MODE_ON, 0) < 0) ) { - printf("MPU%d: Can't enter UART mode\n", devc->devno); - devc->uart_mode = 0; - return; - } - devc->uart_mode = arg; -} - -int -probe_mpu401(struct address_info * hw_config) -{ - int ok = 0; - struct mpu_config tmp_devc; - - tmp_devc.base = hw_config->io_base; - tmp_devc.irq = hw_config->irq; - tmp_devc.initialized = 0; - tmp_devc.opened = 0; - tmp_devc.osp = hw_config->osp; - -#if defined(CONFIG_AEDSP16) && defined(AEDSP16_MPU401) - /* - * Initialize Audio Excel DSP 16 to MPU-401, before any operation. - */ - InitAEDSP16_MPU401(hw_config); -#endif - - if (hw_config->always_detect) - return 1; - - if (mpu401_status(&tmp_devc) == 0xff) { - DDB(printf("MPU401: Port %x looks dead.\n", hw_config->io_base)); - return 0; /* Just bus float? */ - } - ok = reset_mpu401(&tmp_devc); - - if (!ok) { - DDB(printf("MPU401: Reset failed on port %x\n", hw_config->io_base)); - } - return ok; -} - - -/* - * Timer stuff - */ - -#if defined(CONFIG_SEQUENCER) - -static volatile int timer_initialized = 0, timer_open = 0, tmr_running = 0; -static volatile int curr_tempo, curr_timebase, hw_timebase; -static int max_timebase = 8; /* 8*24=192 ppqn */ -static volatile u_long next_event_time; -static volatile u_long curr_ticks, curr_clocks; -static u_long prev_event_time; -static int metronome_mode; - -static u_long -clocks2ticks(u_long clocks) -{ - /* - * The MPU-401 supports just a limited set of possible timebase - * values. Since the applications require more choices, the driver - * has to program the HW to do its best and to convert between the - * HW and actual timebases. - */ - - return ((clocks * curr_timebase) + (hw_timebase / 2)) / hw_timebase; -} - -static void -set_timebase(int midi_dev, int val) -{ - int hw_val; - - if (val < 48) - val = 48; - if (val > 1000) - val = 1000; - - hw_val = val; - hw_val = (hw_val + 12) / 24; - if (hw_val > max_timebase) - hw_val = max_timebase; - - if (mpu_cmd(midi_dev, 0xC0 | (hw_val & 0x0f), 0) < 0) { - printf("MPU: Can't set HW timebase to %d\n", hw_val * 24); - return; - } - hw_timebase = hw_val * 24; - curr_timebase = val; -} - -static void -tmr_reset(void) -{ - u_long flags; - - flags = splhigh(); - next_event_time = 0xffffffff; - prev_event_time = 0; - curr_ticks = curr_clocks = 0; - splx(flags); -} - -static void -set_timer_mode(int midi_dev) -{ - if (timer_mode & TMR_MODE_CLS) - mpu_cmd(midi_dev, 0x3c, 0); /* Use CLS sync */ - else if (timer_mode & TMR_MODE_SMPTE) - mpu_cmd(midi_dev, 0x3d, 0); /* Use SMPTE sync */ - - if (timer_mode & TMR_INTERNAL) - mpu_cmd(midi_dev, 0x80, 0); /* Use MIDI sync */ - else { - if (timer_mode & (TMR_MODE_MIDI | TMR_MODE_CLS)) { - mpu_cmd(midi_dev, 0x82, 0); /* Use MIDI sync */ - mpu_cmd(midi_dev, 0x91, 0); /* Enable ext MIDI ctrl */ - } else if (timer_mode & TMR_MODE_FSK) - mpu_cmd(midi_dev, 0x81, 0); /* Use FSK sync */ - } -} - -static void -stop_metronome(int midi_dev) -{ - mpu_cmd(midi_dev, 0x84, 0); /* Disable metronome */ -} - -static void -setup_metronome(int midi_dev) -{ - int numerator, denominator; - int clks_per_click, num_32nds_per_beat; - int beats_per_measure; - - numerator = ((u_int) metronome_mode >> 24) & 0xff; - denominator = ((u_int) metronome_mode >> 16) & 0xff; - clks_per_click = ((u_int) metronome_mode >> 8) & 0xff; - num_32nds_per_beat = (u_int) metronome_mode & 0xff; - beats_per_measure = (numerator * 4) >> denominator; - - if (!metronome_mode) - mpu_cmd(midi_dev, 0x84, 0); /* Disable metronome */ - else { - mpu_cmd(midi_dev, 0xE4, clks_per_click); - mpu_cmd(midi_dev, 0xE6, beats_per_measure); - mpu_cmd(midi_dev, 0x83, 0); /* Enable metronome without - * accents */ - } -} - -static int -mpu_start_timer(int midi_dev) -{ - tmr_reset(); - set_timer_mode(midi_dev); - - if (tmr_running) - return TIMER_NOT_ARMED; /* Already running */ - - if (timer_mode & TMR_INTERNAL) { - mpu_cmd(midi_dev, 0x02, 0); /* Send MIDI start */ - tmr_running = 1; - return TIMER_NOT_ARMED; - } else { - mpu_cmd(midi_dev, 0x35, 0); /* Enable mode messages to PC */ - mpu_cmd(midi_dev, 0x38, 0); /* Enable sys common messages to PC */ - mpu_cmd(midi_dev, 0x39, 0); /* Enable real time messages to PC */ - mpu_cmd(midi_dev, 0x97, 0); /* Enable system exclusive - * messages to PC */ - } - - return TIMER_ARMED; -} - -static int -mpu_timer_open(int dev, int mode) -{ - int midi_dev = sound_timer_devs[dev]->devlink; - - if (timer_open) - return -(EBUSY); - - tmr_reset(); - curr_tempo = 50; - mpu_cmd(midi_dev, 0xE0, 50); - curr_timebase = hw_timebase = 120; - set_timebase(midi_dev, 120); - timer_open = 1; - metronome_mode = 0; - set_timer_mode(midi_dev); - - mpu_cmd(midi_dev, 0xe7, 0x04); /* Send all clocks to host */ - mpu_cmd(midi_dev, 0x95, 0); /* Enable clock to host */ - - return 0; -} - -static void -mpu_timer_close(int dev) -{ - int midi_dev = sound_timer_devs[dev]->devlink; - - timer_open = tmr_running = 0; - mpu_cmd(midi_dev, 0x15, 0); /* Stop all */ - mpu_cmd(midi_dev, 0x94, 0); /* Disable clock to host */ - mpu_cmd(midi_dev, 0x8c, 0); /* Disable measure end messages to - * host */ - stop_metronome(midi_dev); -} - -static int -mpu_timer_event(int dev, u_char *event) -{ - u_char command = event[1]; - u_long parm = *(u_int *) &event[4]; - int midi_dev = sound_timer_devs[dev]->devlink; - - switch (command) { - case TMR_WAIT_REL: - parm += prev_event_time; - case TMR_WAIT_ABS: - if (parm > 0) { - long time; - - if (parm <= curr_ticks) /* It's the time */ - return TIMER_NOT_ARMED; - - time = parm; - next_event_time = prev_event_time = time; - - return TIMER_ARMED; - } - break; - - case TMR_START: - if (tmr_running) - break; - return mpu_start_timer(midi_dev); - break; - - case TMR_STOP: - mpu_cmd(midi_dev, 0x01, 0); /* Send MIDI stop */ - stop_metronome(midi_dev); - tmr_running = 0; - break; - - case TMR_CONTINUE: - if (tmr_running) - break; - mpu_cmd(midi_dev, 0x03, 0); /* Send MIDI continue */ - setup_metronome(midi_dev); - tmr_running = 1; - break; - - case TMR_TEMPO: - if (parm) { - if (parm < 8) - parm = 8; - if (parm > 250) - parm = 250; - - if (mpu_cmd(midi_dev, 0xE0, parm) < 0) - printf("MPU: Can't set tempo to %d\n", (int) parm); - curr_tempo = parm; - } - break; - - case TMR_ECHO: - seq_copy_to_input(event, 8); - break; - - case TMR_TIMESIG: - if (metronome_mode) { /* Metronome enabled */ - metronome_mode = parm; - setup_metronome(midi_dev); - } - break; - - default:; - } - - return TIMER_NOT_ARMED; -} - -static u_long -mpu_timer_get_time(int dev) -{ - if (!timer_open) - return 0; - - return curr_ticks; -} - -static int -mpu_timer_ioctl(int dev, u_int command, ioctl_arg arg) -{ - int midi_dev = sound_timer_devs[dev]->devlink; - - switch (command) { - case SNDCTL_TMR_SOURCE: - { - int parm = (int) (*(int *) arg) & timer_caps; - - if (parm != 0) { - timer_mode = parm; - - if (timer_mode & TMR_MODE_CLS) - mpu_cmd(midi_dev, 0x3c, 0); /* Use CLS sync */ - else if (timer_mode & TMR_MODE_SMPTE) - mpu_cmd(midi_dev, 0x3d, 0); /* Use SMPTE sync */ - } - return *(int *) arg = timer_mode; - } - break; - - case SNDCTL_TMR_START: - mpu_start_timer(midi_dev); - return 0; - break; - - case SNDCTL_TMR_STOP: - tmr_running = 0; - mpu_cmd(midi_dev, 0x01, 0); /* Send MIDI stop */ - stop_metronome(midi_dev); - return 0; - break; - - case SNDCTL_TMR_CONTINUE: - if (tmr_running) - return 0; - tmr_running = 1; - mpu_cmd(midi_dev, 0x03, 0); /* Send MIDI continue */ - return 0; - break; - - case SNDCTL_TMR_TIMEBASE: - { - int val = (int) (*(int *) arg); - - if (val) - set_timebase(midi_dev, val); - - return *(int *) arg = curr_timebase; - } - break; - - case SNDCTL_TMR_TEMPO: - { - int val = (int) (*(int *) arg); - int ret; - - if (val) { - RANGE (val, 8 , 250 ); - if ((ret = mpu_cmd(midi_dev, 0xE0, val)) < 0) { - printf("MPU: Can't set tempo to %d\n", (int) val); - return ret; - } - curr_tempo = val; - } - return *(int *) arg = curr_tempo; - } - break; - - case SNDCTL_SEQ_CTRLRATE: - if ((*(int *) arg) != 0) /* Can't change */ - return -(EINVAL); - - return *(int *) arg = ((curr_tempo * curr_timebase) + 30) / 60; - break; - - case SNDCTL_TMR_METRONOME: - metronome_mode = (int) (*(int *) arg); - setup_metronome(midi_dev); - return 0; - break; - - default:; - } - - return -(EINVAL); -} - -static void -mpu_timer_arm(int dev, long time) -{ - if (time < 0) - time = curr_ticks + 1; - else if (time <= curr_ticks) /* It's the time */ - return; - - next_event_time = prev_event_time = time; - - return; -} - -static struct sound_timer_operations mpu_timer = -{ - {"MPU-401 Timer", 0}, - 10, /* Priority */ - 0, /* Local device link */ - mpu_timer_open, - mpu_timer_close, - mpu_timer_event, - mpu_timer_get_time, - mpu_timer_ioctl, - mpu_timer_arm -}; - -static void -mpu_timer_interrupt(void) -{ - - if (!timer_open) - return; - - if (!tmr_running) - return; - - curr_clocks++; - curr_ticks = clocks2ticks(curr_clocks); - - if (curr_ticks >= next_event_time) { - next_event_time = 0xffffffff; - sequencer_timer(0); - } -} - -static void -timer_ext_event(struct mpu_config * devc, int event, int parm) -{ - int midi_dev = devc->devno; - - if (!devc->timer_flag) - return; - - switch (event) { - case TMR_CLOCK: - printf(""); - break; - - case TMR_START: - printf("Ext MIDI start\n"); - if (!tmr_running) - if (timer_mode & TMR_EXTERNAL) { - tmr_running = 1; - setup_metronome(midi_dev); - next_event_time = 0; - STORE(SEQ_START_TIMER()); - } - break; - - case TMR_STOP: - printf("Ext MIDI stop\n"); - if (timer_mode & TMR_EXTERNAL) { - tmr_running = 0; - stop_metronome(midi_dev); - STORE(SEQ_STOP_TIMER()); - } - break; - - case TMR_CONTINUE: - printf("Ext MIDI continue\n"); - if (timer_mode & TMR_EXTERNAL) { - tmr_running = 1; - setup_metronome(midi_dev); - STORE(SEQ_CONTINUE_TIMER()); - } - break; - - case TMR_SPP: - printf("Songpos: %d\n", parm); - if (timer_mode & TMR_EXTERNAL) { - STORE(SEQ_SONGPOS(parm)); - } - break; - } -} - -static void -mpu_timer_init(int midi_dev) -{ - struct mpu_config *devc; - int n; - - devc = &dev_conf[midi_dev]; - - if (timer_initialized) - return; /* There is already a similar timer */ - - timer_initialized = 1; - - mpu_timer.devlink = midi_dev; - dev_conf[midi_dev].timer_flag = 1; - - if (num_sound_timers >= MAX_TIMER_DEV) - n = 0; /* Overwrite the system timer */ - else - n = num_sound_timers++; - sound_timer_devs[n] = &mpu_timer; - - if (devc->version < 0x20) /* Original MPU-401 */ - timer_caps = TMR_INTERNAL | TMR_EXTERNAL | TMR_MODE_FSK | TMR_MODE_MIDI; - else { - /* - * The version number 2.0 is used (at least) by the - * MusicQuest cards and the Roland Super-MPU. - * - * MusicQuest has given a special meaning to the bits of the - * revision number. The Super-MPU returns 0. - */ - - if (devc->revision) - timer_caps |= TMR_EXTERNAL | TMR_MODE_MIDI; - - if (devc->revision & 0x02) - timer_caps |= TMR_MODE_CLS; - - - if (devc->revision & 0x40) - max_timebase = 10; /* Has the 216 and 240 ppqn modes */ - } - timer_mode = (TMR_INTERNAL | TMR_MODE_MIDI) & timer_caps; -} - -#endif - -#endif diff --git a/sys/dev/sound/isa/i386/opl3.c b/sys/dev/sound/isa/i386/opl3.c deleted file mode 100644 index bd75e52f36..0000000000 --- a/sys/dev/sound/isa/i386/opl3.c +++ /dev/null @@ -1,1138 +0,0 @@ -/* - * sound/opl3.c - * - * A low level driver for Yamaha YM3812 and OPL-3 -chips - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/sound/opl3.c,v 1.20 1999/12/27 04:37:18 tanimura Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/opl3.c,v 1.3 2003/08/07 21:17:12 dillon Exp $ - * - */ - -/* - * Major improvements to the FM handling 30AUG92 by Rob Hooft, - */ -/* - * hooft@chem.ruu.nl - */ -#include "sound_config.h" - - -#if defined(CONFIG_YM3812) - -#include "opl3.h" -#include - -#define MAX_VOICE 18 -#define OFFS_4OP 11 - -struct voice_info { - u_char keyon_byte; - long bender; - long bender_range; - u_long orig_freq; - u_long current_freq; - int volume; - int mode; -}; - -typedef struct opl_devinfo { - int left_io, right_io; - int nr_voice; - int lv_map[MAX_VOICE]; - - struct voice_info voc[MAX_VOICE]; - struct voice_alloc_info *v_alloc; - struct channel_info *chn_info; - - struct sbi_instrument i_map[SBFM_MAXINSTR]; - struct sbi_instrument *act_i[MAX_VOICE]; - - struct synth_info fm_info; - - int busy; - int model; - u_char cmask; - - int is_opl4; - sound_os_info *osp; -} - opl_devinfo; - -static struct opl_devinfo *devc = NULL; - - -static int detected_model; - -static int store_instr(int instr_no, struct sbi_instrument * instr); -static void freq_to_fnum(int freq, int *block, int *fnum); -static void opl3_command(int io_addr, u_int addr, u_int val); -static int opl3_kill_note(int dev, int voice, int note, int velocity); - -void -enable_opl3_mode(int left, int right, int both) -{ - /* NOP */ -} - -static void -enter_4op_mode(void) -{ - int i; - static int v4op[MAX_VOICE] = - {0, 1, 2, 9, 10, 11, 6, 7, 8, 15, 16, 17}; - - devc->cmask = 0x3f; /* Connect all possible 4 OP voice operators */ - opl3_command(devc->right_io, CONNECTION_SELECT_REGISTER, 0x3f); - - for (i = 0; i < 3; i++) - pv_map[i].voice_mode = 4; - for (i = 3; i < 6; i++) - pv_map[i].voice_mode = 0; - - for (i = 9; i < 12; i++) - pv_map[i].voice_mode = 4; - for (i = 12; i < 15; i++) - pv_map[i].voice_mode = 0; - - for (i = 0; i < 12; i++) - devc->lv_map[i] = v4op[i]; - devc->v_alloc->max_voice = devc->nr_voice = 12; -} - -static int -opl3_ioctl(int dev, - u_int cmd, ioctl_arg arg) -{ - switch (cmd) { - - case SNDCTL_FM_LOAD_INSTR: - { - struct sbi_instrument ins; - - bcopy(&(((char *) arg)[0]), (char *) &ins, sizeof(ins)); - - if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR) { - printf("FM Error: Invalid instrument number %d\n", ins.channel); - return -(EINVAL); - } - pmgr_inform(dev, PM_E_PATCH_LOADED, ins.channel, 0, 0, 0); - return store_instr(ins.channel, &ins); - } - break; - - case SNDCTL_SYNTH_INFO: - devc->fm_info.nr_voices = (devc->nr_voice == 12) ? 6 : devc->nr_voice; - bcopy(&devc->fm_info, &(((char *) arg)[0]), sizeof(devc->fm_info)); - return 0; - break; - - case SNDCTL_SYNTH_MEMAVL: - return 0x7fffffff; - break; - - case SNDCTL_FM_4OP_ENABLE: - if (devc->model == 2) - enter_4op_mode(); - return 0; - break; - - default: - return -(EINVAL); - } - -} - -int -opl3_detect(int ioaddr, sound_os_info * osp) -{ - /* - * This function returns 1 if the FM chip is present at the given - * I/O port The detection algorithm plays with the timer built in the - * FM chip and looks for a change in the status register. - * - * Note! The timers of the FM chip are not connected to AdLib (and - * compatible) boards. - * - * Note2! The chip is initialized if detected. - */ - - u_char stat1, stat2, signature; - int i; - - if (devc != NULL) - return 0; - - devc = (struct opl_devinfo *) malloc(sizeof(*devc), M_DEVBUF, M_NOWAIT); - if (!devc) - panic("SOUND: Cannot allocate memory\n"); - - if (devc == NULL) { - printf("OPL3: Can't allocate memory for device control structure\n"); - return 0; - } - devc->osp = osp; - - /* Reset timers 1 and 2 */ - opl3_command(ioaddr, TIMER_CONTROL_REGISTER, TIMER1_MASK | TIMER2_MASK); - - /* Reset the IRQ of the FM chip */ - opl3_command(ioaddr, TIMER_CONTROL_REGISTER, IRQ_RESET); - - signature = stat1 = inb(ioaddr); /* Status register */ - - if ((stat1 & 0xE0) != 0x00) { - return 0; /* Should be 0x00 */ - } - opl3_command(ioaddr, TIMER1_REGISTER, 0xff); /* Set timer1 to 0xff */ - - opl3_command(ioaddr, TIMER_CONTROL_REGISTER, - TIMER2_MASK | TIMER1_START); /* Unmask and start timer 1 */ - - - DELAY(150); /* Now we have to delay at least 80 usec */ - - stat2 = inb(ioaddr); /* Read status after timers have expired */ - - /* - * Stop the timers - */ - - /* Reset timers 1 and 2 */ - opl3_command(ioaddr, TIMER_CONTROL_REGISTER, TIMER1_MASK | TIMER2_MASK); - /* Reset the IRQ of the FM chip */ - opl3_command(ioaddr, TIMER_CONTROL_REGISTER, IRQ_RESET); - - if ((stat2 & 0xE0) != 0xc0) { - return 0; /* There is no YM3812 */ - } - /* - * There is a FM chicp in this address. Detect the type (OPL2 to - * OPL4) - */ - - if (signature == 0x06) {/* OPL2 */ - detected_model = 2; - } else if (signature == 0x00) { /* OPL3 or OPL4 */ - u_char tmp; - - detected_model = 3; - - /* - * Detect availability of OPL4 (_experimental_). Works - * propably only after a cold boot. In addition the OPL4 port - * of the chip may not be connected to the PC bus at all. - */ - - opl3_command(ioaddr + 2, OPL3_MODE_REGISTER, 0x00); - opl3_command(ioaddr + 2, OPL3_MODE_REGISTER, OPL3_ENABLE | OPL4_ENABLE); - - if ((tmp = inb(ioaddr)) == 0x02) { /* Have a OPL4 */ - detected_model = 4; - } - if (!0) { /* OPL4 port is free */ /* XXX check here lr970711 */ - int tmp; - - outb(ioaddr - 8, 0x02); /* Select OPL4 ID register */ - DELAY(10); - tmp = inb(ioaddr - 7); /* Read it */ - DELAY(10); - - if (tmp == 0x20) { /* OPL4 should return 0x20 here */ - detected_model = 4; - - outb(ioaddr - 8, 0xF8); /* Select OPL4 FM mixer control */ - DELAY(10); - outb(ioaddr - 7, 0x1B); /* Write value */ - DELAY(10); - } else - detected_model = 3; - } - opl3_command(ioaddr + 2, OPL3_MODE_REGISTER, 0); - - } - for (i = 0; i < 9; i++) - opl3_command(ioaddr, KEYON_BLOCK + i, 0); /* Note off */ - - opl3_command(ioaddr, TEST_REGISTER, ENABLE_WAVE_SELECT); - opl3_command(ioaddr, PERCUSSION_REGISTER, 0x00); /* Melodic mode. */ - - return 1; -} - -static int -opl3_kill_note(int dev, int voice, int note, int velocity) -{ - struct physical_voice_info *map; - - if (voice < 0 || voice >= devc->nr_voice) - return 0; - - devc->v_alloc->map[voice] = 0; - - map = &pv_map[devc->lv_map[voice]]; - - DEB(printf("Kill note %d\n", voice)); - - if (map->voice_mode == 0) - return 0; - - opl3_command(map->ioaddr, KEYON_BLOCK + map->voice_num, - devc->voc[voice].keyon_byte & ~0x20); - - devc->voc[voice].keyon_byte = 0; - devc->voc[voice].bender = 0; - devc->voc[voice].volume = 64; - devc->voc[voice].bender_range = 200; /* 200 cents = 2 semitones */ - devc->voc[voice].orig_freq = 0; - devc->voc[voice].current_freq = 0; - devc->voc[voice].mode = 0; - - return 0; -} - -#define HIHAT 0 -#define CYMBAL 1 -#define TOMTOM 2 -#define SNARE 3 -#define BDRUM 4 -#define UNDEFINED TOMTOM -#define DEFAULT TOMTOM - -static int -store_instr(int instr_no, struct sbi_instrument * instr) -{ - - if (instr->key !=FM_PATCH && (instr->key !=OPL3_PATCH || devc->model != 2)) - printf("FM warning: Invalid patch format field (key) 0x%x\n", - instr->key); - bcopy((char *) instr, (char *) &(devc->i_map[instr_no]), sizeof(*instr)); - - return 0; -} - -static int -opl3_set_instr(int dev, int voice, int instr_no) -{ - if (voice < 0 || voice >= devc->nr_voice) - return 0; - - if (instr_no < 0 || instr_no >= SBFM_MAXINSTR) - return 0; - - devc->act_i[voice] = &devc->i_map[instr_no]; - return 0; -} - -/* - * The next table looks magical, but it certainly is not. Its values have - * been calculated as table[i]=8*log(i/64)/log(2) with an obvious exception - * for i=0. This log-table converts a linear volume-scaling (0..127) to a - * logarithmic scaling as present in the FM-synthesizer chips. so : Volume - * 64 = 0 db = relative volume 0 and: Volume 32 = -6 db = relative - * volume -8 it was implemented as a table because it is only 128 bytes and - * it saves a lot of log() calculations. (RH) - */ -static char fm_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}; - -static void -calc_vol(u_char *regbyte, int volume, int main_vol) -{ - int level = (~*regbyte & 0x3f); - - if (main_vol > 127) - main_vol = 127; - - volume = (volume * main_vol) / 127; - - if (level) - level += fm_volume_table[volume]; - - RANGE (level, 0, 0x3f ); - - *regbyte = (*regbyte & 0xc0) | (~level & 0x3f); -} - -static void -set_voice_volume(int voice, int volume, int main_vol) -{ - u_char vol1, vol2, vol3, vol4; - struct sbi_instrument *instr; - struct physical_voice_info *map; - - if (voice < 0 || voice >= devc->nr_voice) - return; - - map = &pv_map[devc->lv_map[voice]]; - - instr = devc->act_i[voice]; - - if (!instr) - instr = &devc->i_map[0]; - - if (instr->channel < 0) - return; - - if (devc->voc[voice].mode == 0) - return; - - if (devc->voc[voice].mode == 2) { - - vol1 = instr->operators[2]; - vol2 = instr->operators[3]; - - if ((instr->operators[10] & 0x01)) { - calc_vol(&vol1, volume, main_vol); - } - calc_vol(&vol2, volume, main_vol); - - opl3_command(map->ioaddr, KSL_LEVEL + map->op[0], vol1); - opl3_command(map->ioaddr, KSL_LEVEL + map->op[1], vol2); - } else { /* 4 OP voice */ - int connection; - - vol1 = instr->operators[2]; - vol2 = instr->operators[3]; - vol3 = instr->operators[OFFS_4OP + 2]; - vol4 = instr->operators[OFFS_4OP + 3]; - - /* - * The connection method for 4 OP devc->voc is defined by the - * rightmost bits at the offsets 10 and 10+OFFS_4OP - */ - - connection = ((instr->operators[10] & 0x01) << 1) | (instr->operators[10 + OFFS_4OP] & 0x01); - - switch (connection) { - case 0: - calc_vol(&vol4, volume, main_vol); - break; - - case 1: - calc_vol(&vol2, volume, main_vol); - calc_vol(&vol4, volume, main_vol); - break; - - case 2: - calc_vol(&vol1, volume, main_vol); - calc_vol(&vol4, volume, main_vol); - break; - - case 3: - calc_vol(&vol1, volume, main_vol); - calc_vol(&vol3, volume, main_vol); - calc_vol(&vol4, volume, main_vol); - break; - - default:; - } - - opl3_command(map->ioaddr, KSL_LEVEL + map->op[0], vol1); - opl3_command(map->ioaddr, KSL_LEVEL + map->op[1], vol2); - opl3_command(map->ioaddr, KSL_LEVEL + map->op[2], vol3); - opl3_command(map->ioaddr, KSL_LEVEL + map->op[3], vol4); - } -} - -static int -opl3_start_note(int dev, int voice, int note, int volume) -{ - u_char data, fpc; - int block, fnum, freq, voice_mode; - struct sbi_instrument *instr; - struct physical_voice_info *map; - - if (voice < 0 || voice >= devc->nr_voice) - return 0; - - map = &pv_map[devc->lv_map[voice]]; - - if (map->voice_mode == 0) - return 0; - - if (note == 255) { /* Just change the volume */ - set_voice_volume(voice, volume, devc->voc[voice].volume); - return 0; - } - /* - * Kill previous note before playing - */ - opl3_command(map->ioaddr, KSL_LEVEL + map->op[1], 0xff); /* Carrier volume to min */ - opl3_command(map->ioaddr, KSL_LEVEL + map->op[0], 0xff); /* Modulator volume to */ - - if (map->voice_mode == 4) { - opl3_command(map->ioaddr, KSL_LEVEL + map->op[2], 0xff); - opl3_command(map->ioaddr, KSL_LEVEL + map->op[3], 0xff); - } - opl3_command(map->ioaddr, KEYON_BLOCK + map->voice_num, 0x00); /* Note off */ - - instr = devc->act_i[voice]; - - if (!instr) - instr = &devc->i_map[0]; - - if (instr->channel < 0) { - printf( "OPL3: Initializing voice %d with undefined instrument\n", - voice); - return 0; - } - if (map->voice_mode == 2 && instr->key == OPL3_PATCH) - return 0; /* Cannot play */ - - voice_mode = map->voice_mode; - - if (voice_mode == 4) { - int voice_shift; - - voice_shift = (map->ioaddr == devc->left_io) ? 0 : 3; - voice_shift += map->voice_num; - - if (instr->key != OPL3_PATCH) { /* Just 2 OP patch */ - voice_mode = 2; - devc->cmask &= ~(1 << voice_shift); - } else - devc->cmask |= (1 << voice_shift); - - opl3_command(devc->right_io, CONNECTION_SELECT_REGISTER, devc->cmask); - } - /* - * Set Sound Characteristics - */ - opl3_command(map->ioaddr, AM_VIB + map->op[0], instr->operators[0]); - opl3_command(map->ioaddr, AM_VIB + map->op[1], instr->operators[1]); - - /* - * Set Attack/Decay - */ - opl3_command(map->ioaddr, ATTACK_DECAY + map->op[0], instr->operators[4]); - opl3_command(map->ioaddr, ATTACK_DECAY + map->op[1], instr->operators[5]); - - /* - * Set Sustain/Release - */ - opl3_command(map->ioaddr,SUSTAIN_RELEASE + map->op[0], instr->operators[6]); - opl3_command(map->ioaddr,SUSTAIN_RELEASE + map->op[1], instr->operators[7]); - - /* - * Set Wave Select - */ - opl3_command(map->ioaddr, WAVE_SELECT + map->op[0], instr->operators[8]); - opl3_command(map->ioaddr, WAVE_SELECT + map->op[1], instr->operators[9]); - - /* - * Set Feedback/Connection - */ - fpc = instr->operators[10]; - if (!(fpc & 0x30)) - fpc |= 0x30; /* Ensure that at least one chn is enabled */ - opl3_command(map->ioaddr, FEEDBACK_CONNECTION + map->voice_num, fpc); - - /* - * If the voice is a 4 OP one, initialize the operators 3 and 4 also - */ - - if (voice_mode == 4) { - - /* - * Set Sound Characteristics - */ - opl3_command(map->ioaddr, AM_VIB + map->op[2], - instr->operators[OFFS_4OP + 0]); - opl3_command(map->ioaddr, AM_VIB + map->op[3], - instr->operators[OFFS_4OP + 1]); - - /* - * Set Attack/Decay - */ - opl3_command(map->ioaddr, ATTACK_DECAY + map->op[2], - instr->operators[OFFS_4OP + 4]); - opl3_command(map->ioaddr, ATTACK_DECAY + map->op[3], - instr->operators[OFFS_4OP + 5]); - - /* - * Set Sustain/Release - */ - opl3_command(map->ioaddr, SUSTAIN_RELEASE + map->op[2], - instr->operators[OFFS_4OP + 6]); - opl3_command(map->ioaddr, SUSTAIN_RELEASE + map->op[3], - instr->operators[OFFS_4OP + 7]); - - /* - * Set Wave Select - */ - opl3_command(map->ioaddr, WAVE_SELECT + map->op[2], - instr->operators[OFFS_4OP + 8]); - opl3_command(map->ioaddr, WAVE_SELECT + map->op[3], - instr->operators[OFFS_4OP + 9]); - - /* - * Set Feedback/Connection - */ - fpc = instr->operators[OFFS_4OP + 10]; - if (!(fpc & 0x30)) - fpc |= 0x30; /* Ensure that at least one chn is enabled */ - opl3_command(map->ioaddr,FEEDBACK_CONNECTION + map->voice_num + 3, fpc); - } - devc->voc[voice].mode = voice_mode; - - set_voice_volume(voice, volume, devc->voc[voice].volume); - - freq = devc->voc[voice].orig_freq = note_to_freq(note) / 1000; - - /* - * Since the pitch bender may have been set before playing the note, - * we have to calculate the bending now. - */ - - freq = compute_finetune(devc->voc[voice].orig_freq, - devc->voc[voice].bender, devc->voc[voice].bender_range); - devc->voc[voice].current_freq = freq; - - freq_to_fnum(freq, &block, &fnum); - - /* - * Play note - */ - - data = fnum & 0xff; /* Least significant bits of fnumber */ - opl3_command(map->ioaddr, FNUM_LOW + map->voice_num, data); - - data = 0x20 | ((block & 0x7) << 2) | ((fnum >> 8) & 0x3); - devc->voc[voice].keyon_byte = data; - opl3_command(map->ioaddr, KEYON_BLOCK + map->voice_num, data); - if (voice_mode == 4) - opl3_command(map->ioaddr, KEYON_BLOCK + map->voice_num + 3, data); - - return 0; -} - -static void -freq_to_fnum(int freq, int *block, int *fnum) -{ - int f, octave; - - /* - * Converts the note frequency to block and fnum values for the FM - * chip - */ - /* - * First try to compute the block -value (octave) where the note - * belongs - */ - - f = freq; - - octave = 5; - - if (f == 0) - octave = 0; - else if (f < 261) { - while (f < 261) { - octave--; - f <<= 1; - } - } else if (f > 493) { - while (f > 493) { - octave++; - f >>= 1; - } - } - if (octave > 7) - octave = 7; - - *fnum = freq * (1 << (20 - octave)) / 49716; - *block = octave; -} - -static void -opl3_command(int io_addr, u_int addr, u_int val) -{ - int i; - - /* - * The original 2-OP synth requires a quite long delay after writing - * to a register. The OPL-3 survives with just two INBs - */ - - outb(io_addr, (u_char) (addr & 0xff)); - - if (!devc->model != 2) - DELAY(10); - else - for (i = 0; i < 2; i++) - inb(io_addr); - -#ifdef PC98 - outb(io_addr + 0x100, (u_char) (val & 0xff)); -#else - outb(io_addr + 1, (u_char) (val & 0xff)); -#endif - if (devc->model != 2) - DELAY(30); - else - for (i = 0; i < 2; i++) - inb(io_addr); -} - -static void -opl3_reset(int dev) -{ - int i; - - for (i = 0; i < 18; i++) - devc->lv_map[i] = i; - - for (i = 0; i < devc->nr_voice; i++) { - opl3_command(pv_map[devc->lv_map[i]].ioaddr, - KSL_LEVEL + pv_map[devc->lv_map[i]].op[0], 0xff); - - opl3_command(pv_map[devc->lv_map[i]].ioaddr, - KSL_LEVEL + pv_map[devc->lv_map[i]].op[1], 0xff); - - if (pv_map[devc->lv_map[i]].voice_mode == 4) { - opl3_command(pv_map[devc->lv_map[i]].ioaddr, - KSL_LEVEL + pv_map[devc->lv_map[i]].op[2], 0xff); - - opl3_command(pv_map[devc->lv_map[i]].ioaddr, - KSL_LEVEL + pv_map[devc->lv_map[i]].op[3], 0xff); - } - opl3_kill_note(dev, i, 0, 64); - } - - if (devc->model == 2) { - devc->v_alloc->max_voice = devc->nr_voice = 18; - - for (i = 0; i < 18; i++) - pv_map[i].voice_mode = 2; - - } -} - -static int -opl3_open(int dev, int mode) -{ - int i; - - if (devc->busy) - return -(EBUSY); - devc->busy = 1; - - devc->v_alloc->max_voice = devc->nr_voice = (devc->model == 2) ? 18 : 9; - devc->v_alloc->timestamp = 0; - - for (i = 0; i < 18; i++) { - devc->v_alloc->map[i] = 0; - devc->v_alloc->alloc_times[i] = 0; - } - - devc->cmask = 0x00; /* Just 2 OP mode */ - if (devc->model == 2) - opl3_command(devc->right_io, CONNECTION_SELECT_REGISTER, devc->cmask); - return 0; -} - -static void -opl3_close(int dev) -{ - devc->busy = 0; - devc->v_alloc->max_voice = devc->nr_voice = (devc->model == 2) ? 18 : 9; - - devc->fm_info.nr_drums = 0; - devc->fm_info.perc_mode = 0; - - opl3_reset(dev); -} - -static void -opl3_hw_control(int dev, u_char *event) -{ -} - -static int -opl3_load_patch(int dev, int format, snd_rw_buf * addr, - int offs, int count, int pmgr_flag) -{ - struct sbi_instrument ins; - - if (count < sizeof(ins)) { - printf("FM Error: Patch record too short\n"); - return -(EINVAL); - } - if (uiomove(&((char *) &ins)[offs], sizeof(ins) - offs, addr)) { - printf("sb: Bad copyin()!\n"); - }; - - if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR) { - printf("FM Error: Invalid instrument number %d\n", ins.channel); - return -(EINVAL); - } - ins.key = format; - - return store_instr(ins.channel, &ins); -} - -static void -opl3_panning(int dev, int voice, int pressure) -{ -} - -static void -opl3_volume_method(int dev, int mode) -{ -} - -#define SET_VIBRATO(cell) { \ - tmp = instr->operators[(cell-1)+(((cell-1)/2)*OFFS_4OP)]; \ - if (pressure > 110) \ - tmp |= 0x40; /* Vibrato on */ \ - opl3_command (map->ioaddr, AM_VIB + map->op[cell-1], tmp);} - -static void -opl3_aftertouch(int dev, int voice, int pressure) -{ - int tmp; - struct sbi_instrument *instr; - struct physical_voice_info *map; - - if (voice < 0 || voice >= devc->nr_voice) - return; - - map = &pv_map[devc->lv_map[voice]]; - - DEB(printf("Aftertouch %d\n", voice)); - - if (map->voice_mode == 0) - return; - - /* - * Adjust the amount of vibrato depending the pressure - */ - - instr = devc->act_i[voice]; - - if (!instr) - instr = &devc->i_map[0]; - - if (devc->voc[voice].mode == 4) { - int connection = ((instr->operators[10] & 0x01) << 1) | (instr->operators[10 + OFFS_4OP] & 0x01); - - switch (connection) { - case 0: - SET_VIBRATO(4); - break; - - case 1: - SET_VIBRATO(2); - SET_VIBRATO(4); - break; - - case 2: - SET_VIBRATO(1); - SET_VIBRATO(4); - break; - - case 3: - SET_VIBRATO(1); - SET_VIBRATO(3); - SET_VIBRATO(4); - break; - - } - /* - * Not implemented yet - */ - } else { - SET_VIBRATO(1); - - if ((instr->operators[10] & 0x01)) /* Additive synthesis */ - SET_VIBRATO(2); - } -} - -#undef SET_VIBRATO - -static void -bend_pitch(int dev, int voice, int value) -{ - u_char data; - int block, fnum, freq; - struct physical_voice_info *map; - - map = &pv_map[devc->lv_map[voice]]; - - if (map->voice_mode == 0) - return; - - devc->voc[voice].bender = value; - if (!value) - return; - if (!(devc->voc[voice].keyon_byte & 0x20)) - return; /* Not keyed on */ - - freq = compute_finetune(devc->voc[voice].orig_freq, devc->voc[voice].bender, devc->voc[voice].bender_range); - devc->voc[voice].current_freq = freq; - - freq_to_fnum(freq, &block, &fnum); - - data = fnum & 0xff; /* Least significant bits of fnumber */ - opl3_command(map->ioaddr, FNUM_LOW + map->voice_num, data); - - data = 0x20 | ((block & 0x7) << 2) | ((fnum >> 8) & 0x3); - /* KEYON|OCTAVE|MS bits of f-num */ - devc->voc[voice].keyon_byte = data; - opl3_command(map->ioaddr, KEYON_BLOCK + map->voice_num, data); -} - -static void -opl3_controller(int dev, int voice, int ctrl_num, int value) -{ - if (voice < 0 || voice >= devc->nr_voice) - return; - - switch (ctrl_num) { - case CTRL_PITCH_BENDER: - bend_pitch(dev, voice, value); - break; - - case CTRL_PITCH_BENDER_RANGE: - devc->voc[voice].bender_range = value; - break; - - case CTL_MAIN_VOLUME: - devc->voc[voice].volume = value / 128; - break; - } -} - -static int -opl3_patchmgr(int dev, struct patmgr_info * rec) -{ - return -(EINVAL); -} - -static void -opl3_bender(int dev, int voice, int value) -{ - if (voice < 0 || voice >= devc->nr_voice) - return; - - bend_pitch(dev, voice, value - 8192); -} - -static int -opl3_alloc_voice(int dev, int chn, int note, struct voice_alloc_info * alloc) -{ - int i, p, best, first, avail, best_time = 0x7fffffff; - struct sbi_instrument *instr; - int is4op; - int instr_no; - - if (chn < 0 || chn > 15) - instr_no = 0; - else - instr_no = devc->chn_info[chn].pgm_num; - - instr = &devc->i_map[instr_no]; - if (instr->channel < 0 || /* Instrument not loaded */ - devc->nr_voice != 12) /* Not in 4 OP mode */ - is4op = 0; - else if (devc->nr_voice == 12) /* 4 OP mode */ - is4op = (instr->key == OPL3_PATCH); - else - is4op = 0; - - if (is4op) { - first = p = 0; - avail = 6; - } else { - if (devc->nr_voice == 12) /* 4 OP mode. Use the '2 OP - * only' operators first */ - first = p = 6; - else - first = p = 0; - avail = devc->nr_voice; - } - - /* - * Now try to find a free voice - */ - best = first; - - for (i = 0; i < avail; i++) { - if (alloc->map[p] == 0) { - return p; - } - if (alloc->alloc_times[p] < best_time) { /* Find oldest playing note */ - best_time = alloc->alloc_times[p]; - best = p; - } - p = (p + 1) % avail; - } - - /* - * Insert some kind of priority mechanism here. - */ - - if (best < 0) - best = 0; - if (best > devc->nr_voice) - best -= devc->nr_voice; - - return best; /* All devc->voc in use. Select the first - * one. */ -} - -static void -opl3_setup_voice(int dev, int voice, int chn) -{ - struct channel_info *info = - &synth_devs[dev]->chn_info[chn]; - - opl3_set_instr(dev, voice, info->pgm_num); - - devc->voc[voice].bender = info->bender_value; - devc->voc[voice].volume = info->controllers[CTL_MAIN_VOLUME]; -} - -static struct synth_operations opl3_operations = -{ - NULL, - 0, - SYNTH_TYPE_FM, - FM_TYPE_ADLIB, - opl3_open, - opl3_close, - opl3_ioctl, - opl3_kill_note, - opl3_start_note, - opl3_set_instr, - opl3_reset, - opl3_hw_control, - opl3_load_patch, - opl3_aftertouch, - opl3_controller, - opl3_panning, - opl3_volume_method, - opl3_patchmgr, - opl3_bender, - opl3_alloc_voice, - opl3_setup_voice -}; - -void -opl3_init(int ioaddr, sound_os_info * osp) -{ - int i; - - if (num_synths >= MAX_SYNTH_DEV) { - printf("OPL3 Error: Too many synthesizers\n"); - return ; - } - if (devc == NULL) { - printf("OPL3: Device control structure not initialized.\n"); - return ; - } - bzero((char *) devc, sizeof(*devc)); - devc->osp = osp; - - devc->nr_voice = 9; - strcpy(devc->fm_info.name, "OPL2-"); - - devc->fm_info.device = 0; - devc->fm_info.synth_type = SYNTH_TYPE_FM; - devc->fm_info.synth_subtype = FM_TYPE_ADLIB; - devc->fm_info.perc_mode = 0; - devc->fm_info.nr_voices = 9; - devc->fm_info.nr_drums = 0; - devc->fm_info.instr_bank_size = SBFM_MAXINSTR; - devc->fm_info.capabilities = 0; - devc->left_io = ioaddr; - devc->right_io = ioaddr + 2; - - if (detected_model <= 2) - devc->model = 1; - else { - devc->model = 2; - if (detected_model == 4) - devc->is_opl4 = 1; - } - - opl3_operations.info = &devc->fm_info; - - synth_devs[num_synths++] = &opl3_operations; - devc->v_alloc = &opl3_operations.alloc; - devc->chn_info = &opl3_operations.chn_info[0]; - - if (devc->model == 2) { - if (devc->is_opl4) - conf_printf2("Yamaha OPL4/OPL3 FM", ioaddr, 0, -1, -1); - else - conf_printf2("Yamaha OPL3 FM", ioaddr, 0, -1, -1); - - devc->v_alloc->max_voice = devc->nr_voice = 18; - devc->fm_info.nr_drums = 0; - devc->fm_info.capabilities |= SYNTH_CAP_OPL3; - strcpy(devc->fm_info.name, "Yamaha OPL-3"); - - for (i = 0; i < 18; i++) - if (pv_map[i].ioaddr == USE_LEFT) - pv_map[i].ioaddr = devc->left_io; - else - pv_map[i].ioaddr = devc->right_io; - - opl3_command(devc->right_io, OPL3_MODE_REGISTER, OPL3_ENABLE); - opl3_command(devc->right_io, CONNECTION_SELECT_REGISTER, 0x00); - } else { - conf_printf2("Yamaha OPL2 FM", ioaddr, 0, -1, -1); - devc->v_alloc->max_voice = devc->nr_voice = 9; - devc->fm_info.nr_drums = 0; - - for (i = 0; i < 18; i++) - pv_map[i].ioaddr = devc->left_io; - }; - - for (i = 0; i < SBFM_MAXINSTR; i++) - devc->i_map[i].channel = -1; - - return ; -} - -#endif diff --git a/sys/dev/sound/isa/i386/opl3.h b/sys/dev/sound/isa/i386/opl3.h deleted file mode 100644 index afa8d16459..0000000000 --- a/sys/dev/sound/isa/i386/opl3.h +++ /dev/null @@ -1,261 +0,0 @@ -/* - * opl3.h - Definitions of the OPL-3 registers - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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 OPL-3 mode is switched on by writing 0x01, to the offset 5 - * of the right side. - * - * Another special register at the right side is at offset 4. It contains - * a bit mask defining which voices are used as 4 OP voices. - * - * The percussive mode is implemented in the left side only. - * - * With the above exeptions the both sides can be operated independently. - * - * A 4 OP voice can be created by setting the corresponding - * bit at offset 4 of the right side. - * - * For example setting the rightmost bit (0x01) changes the - * first voice on the right side to the 4 OP mode. The fourth - * voice is made inaccessible. - * - * If a voice is set to the 2 OP mode, it works like 2 OP modes - * of the original YM3812 (AdLib). In addition the voice can - * be connected the left, right or both stereo channels. It can - * even be left unconnected. This works with 4 OP voices also. - * - * The stereo connection bits are located in the FEEDBACK_CONNECTION - * register of the voice (0xC0-0xC8). In 4 OP voices these bits are - * in the second half of the voice. - */ - -/* - * Register numbers for the global registers - */ - -#define TEST_REGISTER 0x01 -#define ENABLE_WAVE_SELECT 0x20 - -#define TIMER1_REGISTER 0x02 -#define TIMER2_REGISTER 0x03 -#define TIMER_CONTROL_REGISTER 0x04 /* Left side */ -#define IRQ_RESET 0x80 -#define TIMER1_MASK 0x40 -#define TIMER2_MASK 0x20 -#define TIMER1_START 0x01 -#define TIMER2_START 0x02 - -#define CONNECTION_SELECT_REGISTER 0x04 /* Right side */ -#define RIGHT_4OP_0 0x01 -#define RIGHT_4OP_1 0x02 -#define RIGHT_4OP_2 0x04 -#define LEFT_4OP_0 0x08 -#define LEFT_4OP_1 0x10 -#define LEFT_4OP_2 0x20 - -#define OPL3_MODE_REGISTER 0x05 /* Right side */ -#define OPL3_ENABLE 0x01 -#define OPL4_ENABLE 0x02 - -#define KBD_SPLIT_REGISTER 0x08 /* Left side */ -#define COMPOSITE_SINE_WAVE_MODE 0x80 /* Don't use with OPL-3? */ -#define KEYBOARD_SPLIT 0x40 - -#define PERCUSSION_REGISTER 0xbd /* Left side only */ -#define TREMOLO_DEPTH 0x80 -#define VIBRATO_DEPTH 0x40 -#define PERCUSSION_ENABLE 0x20 -#define BASSDRUM_ON 0x10 -#define SNAREDRUM_ON 0x08 -#define TOMTOM_ON 0x04 -#define CYMBAL_ON 0x02 -#define HIHAT_ON 0x01 - -/* - * Offsets to the register banks for operators. To get the - * register number just add the operator offset to the bank offset - * - * AM/VIB/EG/KSR/Multiple (0x20 to 0x35) - */ -#define AM_VIB 0x20 -#define TREMOLO_ON 0x80 -#define VIBRATO_ON 0x40 -#define SUSTAIN_ON 0x20 -#define KSR 0x10 /* Key scaling rate */ -#define MULTIPLE_MASK 0x0f /* Frequency multiplier */ - - /* - * KSL/Total level (0x40 to 0x55) - */ -#define KSL_LEVEL 0x40 -#define KSL_MASK 0xc0 /* Envelope scaling bits */ -#define TOTAL_LEVEL_MASK 0x3f /* Strength (volume) of OP */ - -/* - * Attack / Decay rate (0x60 to 0x75) - */ -#define ATTACK_DECAY 0x60 -#define ATTACK_MASK 0xf0 -#define DECAY_MASK 0x0f - -/* - * Sustain level / Release rate (0x80 to 0x95) - */ -#define SUSTAIN_RELEASE 0x80 -#define SUSTAIN_MASK 0xf0 -#define RELEASE_MASK 0x0f - -/* - * Wave select (0xE0 to 0xF5) - */ -#define WAVE_SELECT 0xe0 - -/* - * Offsets to the register banks for voices. Just add to the - * voice number to get the register number. - * - * F-Number low bits (0xA0 to 0xA8). - */ -#define FNUM_LOW 0xa0 - -/* - * F-number high bits / Key on / Block (octave) (0xB0 to 0xB8) - */ -#define KEYON_BLOCK 0xb0 -#define KEYON_BIT 0x20 -#define BLOCKNUM_MASK 0x1c -#define FNUM_HIGH_MASK 0x03 - -/* - * Feedback / Connection (0xc0 to 0xc8) - * - * These registers have two new bits when the OPL-3 mode - * is selected. These bits controls connecting the voice - * to the stereo channels. For 4 OP voices this bit is - * defined in the second half of the voice (add 3 to the - * register offset). - * - * For 4 OP voices the connection bit is used in the - * both halfs (gives 4 ways to connect the operators). - */ -#define FEEDBACK_CONNECTION 0xc0 -#define FEEDBACK_MASK 0x0e /* Valid just for 1st OP of a voice */ -#define CONNECTION_BIT 0x01 -/* - * In the 4 OP mode there is four possible configurations how the - * operators can be connected together (in 2 OP modes there is just - * AM or FM). The 4 OP connection mode is defined by the rightmost - * bit of the FEEDBACK_CONNECTION (0xC0-0xC8) on the both halfs. - * - * First half Second half Mode - * - * +---+ - * v | - * 0 0 >+-1-+--2--3--4--> - * - * - * - * +---+ - * | | - * 0 1 >+-1-+--2-+ - * |-> - * >--3----4-+ - * - * +---+ - * | | - * 1 0 >+-1-+-----+ - * |-> - * >--2--3--4-+ - * - * +---+ - * | | - * 1 1 >+-1-+--+ - * | - * >--2--3-+-> - * | - * >--4----+ - */ -#define STEREO_BITS 0x30 /* OPL-3 only */ -#define VOICE_TO_LEFT 0x10 -#define VOICE_TO_RIGHT 0x20 - -/* - * Definition table for the physical voices - */ - -struct physical_voice_info { - unsigned char voice_num; - unsigned char voice_mode; /* 0=unavailable, 2=2 OP, 4=4 OP */ - unsigned short ioaddr; /* I/O port (left or right side) */ - unsigned char op[4]; /* Operator offsets */ - }; - -/* - * There is 18 possible 2 OP voices - * (9 in the left and 9 in the right). - * The first OP is the modulator and 2nd is the carrier. - * - * The first three voices in the both sides may be connected - * with another voice to a 4 OP voice. For example voice 0 - * can be connected with voice 3. The operators of voice 3 are - * used as operators 3 and 4 of the new 4 OP voice. - * In this case the 2 OP voice number 0 is the 'first half' and - * voice 3 is the second. - */ - -#define USE_LEFT 0 -#define USE_RIGHT 1 - -static struct physical_voice_info pv_map[18] = -{ -/* No Mode Side OP1 OP2 OP3 OP4 */ -/* --------------------------------------------------- */ - { 0, 2, USE_LEFT, {0x00, 0x03, 0x08, 0x0b}}, - { 1, 2, USE_LEFT, {0x01, 0x04, 0x09, 0x0c}}, - { 2, 2, USE_LEFT, {0x02, 0x05, 0x0a, 0x0d}}, - - { 3, 2, USE_LEFT, {0x08, 0x0b, 0x00, 0x00}}, - { 4, 2, USE_LEFT, {0x09, 0x0c, 0x00, 0x00}}, - { 5, 2, USE_LEFT, {0x0a, 0x0d, 0x00, 0x00}}, - - { 6, 2, USE_LEFT, {0x10, 0x13, 0x00, 0x00}}, /* Used by percussive voices */ - { 7, 2, USE_LEFT, {0x11, 0x14, 0x00, 0x00}}, /* if the percussive mode */ - { 8, 2, USE_LEFT, {0x12, 0x15, 0x00, 0x00}}, /* is selected */ - - { 0, 2, USE_RIGHT, {0x00, 0x03, 0x08, 0x0b}}, - { 1, 2, USE_RIGHT, {0x01, 0x04, 0x09, 0x0c}}, - { 2, 2, USE_RIGHT, {0x02, 0x05, 0x0a, 0x0d}}, - - { 3, 2, USE_RIGHT, {0x08, 0x0b, 0x00, 0x00}}, - { 4, 2, USE_RIGHT, {0x09, 0x0c, 0x00, 0x00}}, - { 5, 2, USE_RIGHT, {0x0a, 0x0d, 0x00, 0x00}}, - - { 6, 2, USE_RIGHT, {0x10, 0x13, 0x00, 0x00}}, - { 7, 2, USE_RIGHT, {0x11, 0x14, 0x00, 0x00}}, - { 8, 2, USE_RIGHT, {0x12, 0x15, 0x00, 0x00}} -}; diff --git a/sys/dev/sound/isa/i386/pas2/pas2_card.c b/sys/dev/sound/isa/i386/pas2/pas2_card.c deleted file mode 100644 index dc78afa5ce..0000000000 --- a/sys/dev/sound/isa/i386/pas2/pas2_card.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * sound/pas2_card.c - * - * Detection routine for the Pro Audio Spectrum cards. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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 - -#if defined(CONFIG_PAS) -#define _PAS2_CARD_C_ - -#define DEFINE_TRANSLATIONS -#include - -/* - * The Address Translation code is used to convert I/O register addresses to - * be relative to the given base -register - */ - -int translat_code; -static int pas_intr_mask = 0; -static int pas_irq = 0; - -static sound_os_info *pas_osp; - -char pas_model; -static char *pas_model_names[] = -{"", "Pro AudioSpectrum+", "CDPC", "Pro AudioSpectrum 16", "Pro AudioSpectrum 16D"}; - -/* - * pas_read() and pas_write() are equivalents of inb and outb - */ -/* - * These routines perform the I/O address translation required - */ -/* - * to support other than the default base address - */ -extern void mix_write(u_char data, int ioaddr); - -u_char -pas_read(int ioaddr) -{ - return inb(ioaddr ^ translat_code); -} - -void -pas_write(u_char data, int ioaddr) -{ - outb(ioaddr ^ translat_code, data); -} - -static void -pas2_msg(char *foo) -{ - printf(" PAS2: %s.\n", foo); -} - -/******************* Begin of the Interrupt Handler ********************/ - -void -pasintr(int irq) -{ - int status; - - status = pas_read(INTERRUPT_STATUS); - pas_write(status, INTERRUPT_STATUS); /* Clear interrupt */ - - if (status & I_S_PCM_SAMPLE_BUFFER_IRQ) { -#ifdef CONFIG_AUDIO - pas_pcm_interrupt(status, 1); -#endif - status &= ~I_S_PCM_SAMPLE_BUFFER_IRQ; - } - if (status & I_S_MIDI_IRQ) { -#ifdef CONFIG_MIDI - pas_midi_interrupt(); -#endif - status &= ~I_S_MIDI_IRQ; - } -} - -int -pas_set_intr(int mask) -{ - if (!mask) - return 0; - - pas_intr_mask |= mask; - - pas_write(pas_intr_mask, INTERRUPT_MASK); - return 0; -} - -int -pas_remove_intr(int mask) -{ - if (!mask) - return 0; - - pas_intr_mask &= ~mask; - pas_write(pas_intr_mask, INTERRUPT_MASK); - - return 0; -} - -/******************* End of the Interrupt handler **********************/ - -/******************* Begin of the Initialization Code ******************/ - -static int -config_pas_hw(struct address_info * hw_config) -{ - char ok = 1; - u_int int_ptrs; /* scsi/sound interrupt pointers */ - - pas_irq = hw_config->irq; - - pas_write(0x00, INTERRUPT_MASK); - - pas_write(0x36, SAMPLE_COUNTER_CONTROL); /* Local timer control * - * register */ - - pas_write(0x36, SAMPLE_RATE_TIMER); /* Sample rate timer (16 bit) */ - pas_write(0, SAMPLE_RATE_TIMER); - - pas_write(0x74, SAMPLE_COUNTER_CONTROL); /* Local timer control * - * register */ - - pas_write(0x74, SAMPLE_BUFFER_COUNTER); /* Sample count register (16 * - * bit) */ - pas_write(0, SAMPLE_BUFFER_COUNTER); - - pas_write(F_F_PCM_BUFFER_COUNTER | F_F_PCM_RATE_COUNTER | F_F_MIXER_UNMUTE | 1, FILTER_FREQUENCY); - pas_write(P_C_PCM_DMA_ENABLE | P_C_PCM_MONO | P_C_PCM_DAC_MODE | P_C_MIXER_CROSS_L_TO_L | P_C_MIXER_CROSS_R_TO_R, PCM_CONTROL); - pas_write(S_M_PCM_RESET | S_M_FM_RESET | S_M_SB_RESET | S_M_MIXER_RESET /* | S_M_OPL3_DUAL_MONO */ , SERIAL_MIXER); - - pas_write(I_C_1_BOOT_RESET_ENABLE -#ifdef PAS_JOYSTICK_ENABLE - | I_C_1_JOYSTICK_ENABLE -#endif - ,IO_CONFIGURATION_1); - - if (pas_irq < 0 || pas_irq > 15) { - printf("PAS2: Invalid IRQ %d", pas_irq); - ok = 0; - } else { - int_ptrs = pas_read(IO_CONFIGURATION_3); - int_ptrs |= I_C_3_PCM_IRQ_translate[pas_irq] & 0xf; - pas_write(int_ptrs, IO_CONFIGURATION_3); - if (!I_C_3_PCM_IRQ_translate[pas_irq]) { - printf("PAS2: Invalid IRQ %d", pas_irq); - ok = 0; - } else { - if (snd_set_irq_handler(pas_irq, pasintr, hw_config->osp) < 0) - ok = 0; - } - } - - if (hw_config->dma < 0 || hw_config->dma > 7) { - printf("PAS2: Invalid DMA selection %d", hw_config->dma); - ok = 0; - } else { - pas_write(I_C_2_PCM_DMA_translate[hw_config->dma], IO_CONFIGURATION_2); - if (!I_C_2_PCM_DMA_translate[hw_config->dma]) { - printf("PAS2: Invalid DMA selection %d", hw_config->dma); - ok = 0; - } else { - if (0) { - printf("pas2_card.c: Can't allocate DMA channel\n"); - ok = 0; - } - } - } - - /* - * This fixes the timing problems of the PAS due to the Symphony - * chipset as per Media Vision. Only define this if your PAS doesn't - * work correctly. - */ -#ifdef SYMPHONY_PAS - outb(0xa8, 0x05); - outb(0xa9, 0x60); -#endif - -#ifdef BROKEN_BUS_CLOCK - pas_write(S_C_1_PCS_ENABLE | S_C_1_PCS_STEREO | S_C_1_PCS_REALSOUND | S_C_1_FM_EMULATE_CLOCK, SYSTEM_CONFIGURATION_1); -#else - /* - * pas_write(S_C_1_PCS_ENABLE, SYSTEM_CONFIGURATION_1); - */ - pas_write(S_C_1_PCS_ENABLE | S_C_1_PCS_STEREO | S_C_1_PCS_REALSOUND, SYSTEM_CONFIGURATION_1); -#endif - pas_write(0x18, SYSTEM_CONFIGURATION_3); /* ??? */ - - pas_write(F_F_MIXER_UNMUTE | 0x01, FILTER_FREQUENCY); /* Sets mute off and * - * selects filter rate * - * of 17.897 kHz */ - pas_write(8, PRESCALE_DIVIDER); - - mix_write(P_M_MV508_ADDRESS | 5, PARALLEL_MIXER); - mix_write(5, PARALLEL_MIXER); - -#if defined(CONFIG_SB_EMULATION) && defined(CONFIG_SB) - - { - struct address_info *sb_config; - - if ((sb_config = sound_getconf(SNDCARD_SB))) { - u_char irq_dma; - - /* - * Turn on Sound Blaster compatibility - */ - /* - * bit 1 = SB emulation - */ - /* - * bit 0 = MPU401 emulation (CDPC only :-( ) - */ - pas_write(0x02, COMPATIBILITY_ENABLE); - - /* - * "Emulation address" - */ - pas_write((sb_config->io_base >> 4) & 0x0f, EMULATION_ADDRESS); - - if (!E_C_SB_DMA_translate[sb_config->dma]) - printf("\n\nPAS16 Warning: Invalid SB DMA %d\n\n", - sb_config->dma); - - if (!E_C_SB_IRQ_translate[sb_config->irq]) - printf("\n\nPAS16 Warning: Invalid SB IRQ %d\n\n", - sb_config->irq); - - irq_dma = E_C_SB_DMA_translate[sb_config->dma] | - E_C_SB_IRQ_translate[sb_config->irq]; - - pas_write(irq_dma, EMULATION_CONFIGURATION); - } - } -#else - pas_write(0x00, COMPATIBILITY_ENABLE); -#endif - - if (!ok) - pas2_msg("Driver not enabled"); - - return ok; -} - -static int -detect_pas_hw(struct address_info * hw_config) -{ - u_char board_id, foo; - - /* - * WARNING: Setting an option like W:1 or so that disables warm boot - * reset of the card will screw up this detect code something fierce. - * Adding code to handle this means possibly interfering with other - * cards on the bus if you have something on base port 0x388. SO be - * forewarned. - */ - - outb(MASTER_DECODE, 0xBC); /* Talk to first board */ - outb(MASTER_DECODE, hw_config->io_base >> 2); /* Set base address */ - translat_code = PAS_DEFAULT_BASE ^ hw_config->io_base; - pas_write(1, WAIT_STATE); /* One wait-state */ - - board_id = pas_read(INTERRUPT_MASK); - - if (board_id == 0xff) - return 0; - - /* - * We probably have a PAS-series board, now check for a PAS2-series - * board by trying to change the board revision bits. PAS2-series - * hardware won't let you do this - the bits are read-only. - */ - - foo = board_id ^ 0xe0; - - pas_write(foo, INTERRUPT_MASK); - foo = inb(INTERRUPT_MASK); - pas_write(board_id, INTERRUPT_MASK); - - if (board_id != foo) /* Not a PAS2 */ - return 0; - - pas_model = pas_read(CHIP_REV); - - return pas_model; -} - -void -attach_pas_card(struct address_info * hw_config) -{ - pas_irq = hw_config->irq; - pas_osp = hw_config->osp; - - if (detect_pas_hw(hw_config)) { - - if ((pas_model = pas_read(CHIP_REV))) { - char temp[100]; - - snprintf(temp, sizeof(temp), - "%s rev %d", pas_model_names[(int) pas_model], - pas_read(BOARD_REV_ID)); - conf_printf(temp, hw_config); - } - if (config_pas_hw(hw_config)) { - -#ifdef CONFIG_AUDIO - pas_pcm_init(hw_config); -#endif - -#if defined(CONFIG_SB_EMULATION) && defined(CONFIG_SB) - - sb_dsp_disable_midi(); /* The SB emulation don't - * support * midi */ -#endif - - -#ifdef CONFIG_MIDI - pas_midi_init(); -#endif - pas_init_mixer(); - } - } -} - -int -probe_pas(struct address_info * hw_config) -{ - pas_osp = hw_config->osp; - return detect_pas_hw(hw_config); -} - -#endif diff --git a/sys/dev/sound/isa/i386/pas2/pas2_midi.c b/sys/dev/sound/isa/i386/pas2/pas2_midi.c deleted file mode 100644 index 006b7d4c80..0000000000 --- a/sys/dev/sound/isa/i386/pas2/pas2_midi.c +++ /dev/null @@ -1,285 +0,0 @@ -/* - * sound/pas2_midi.c - * - * The low level driver for the PAS Midi Interface. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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 - -#if defined(CONFIG_PAS) && defined(CONFIG_MIDI) -#include - -static int midi_busy = 0, input_opened = 0; -static int my_dev; -static volatile int ofifo_bytes = 0; - -static u_char tmp_queue[256]; -static volatile int qlen; -static volatile u_char qhead, qtail; - -static void (*midi_input_intr) (int dev, u_char data); - -static int -pas_midi_open(int dev, int mode, - void (*input) (int dev, u_char data), - void (*output) (int dev) -) -{ - int err; - u_long flags; - u_char ctrl; - - - if (midi_busy) { - printf("PAS2: Midi busy\n"); - return -(EBUSY); - } - /* - * Reset input and output FIFO pointers - */ - pas_write(M_C_RESET_INPUT_FIFO | M_C_RESET_OUTPUT_FIFO, - MIDI_CONTROL); - - flags = splhigh(); - - if ((err = pas_set_intr(I_M_MIDI_IRQ_ENABLE)) < 0) - return err; - - /* - * Enable input available and output FIFO empty interrupts - */ - - ctrl = 0; - input_opened = 0; - midi_input_intr = input; - - if (mode == OPEN_READ || mode == OPEN_READWRITE) { - ctrl |= M_C_ENA_INPUT_IRQ; /* Enable input */ - input_opened = 1; - } - if (mode == OPEN_WRITE || mode == OPEN_READWRITE) { - ctrl |= M_C_ENA_OUTPUT_IRQ | /* Enable output */ - M_C_ENA_OUTPUT_HALF_IRQ; - } - pas_write(ctrl, - MIDI_CONTROL); - - /* - * Acknowledge any pending interrupts - */ - - pas_write(0xff, MIDI_STATUS); - ofifo_bytes = 0; - - splx(flags); - - midi_busy = 1; - qlen = qhead = qtail = 0; - return 0; -} - -static void -pas_midi_close(int dev) -{ - - /* - * Reset FIFO pointers, disable intrs - */ - pas_write(M_C_RESET_INPUT_FIFO | M_C_RESET_OUTPUT_FIFO, MIDI_CONTROL); - - pas_remove_intr(I_M_MIDI_IRQ_ENABLE); - midi_busy = 0; -} - -static int -dump_to_midi(u_char midi_byte) -{ - int fifo_space, x; - - fifo_space = ((x = pas_read(MIDI_FIFO_STATUS)) >> 4) & 0x0f; - - if (fifo_space == 15 || (fifo_space < 2 && ofifo_bytes > 13)) { /* Fifo full */ - return 0; /* Upper layer will call again */ - } - ofifo_bytes++; - - pas_write(midi_byte, MIDI_DATA); - - return 1; -} - -static int -pas_midi_out(int dev, u_char midi_byte) -{ - - u_long flags; - - /* - * Drain the local queue first - */ - - flags = splhigh(); - - while (qlen && dump_to_midi(tmp_queue[qhead])) { - qlen--; - qhead++; - } - - splx(flags); - - /* - * Output the byte if the local queue is empty. - */ - - if (!qlen) - if (dump_to_midi(midi_byte)) - return 1; /* OK */ - - /* - * Put to the local queue - */ - - if (qlen >= 256) - return 0; /* Local queue full */ - - flags = splhigh(); - - tmp_queue[qtail] = midi_byte; - qlen++; - qtail++; - - splx(flags); - - return 1; -} - -static int -pas_midi_start_read(int dev) -{ - return 0; -} - -static int -pas_midi_end_read(int dev) -{ - return 0; -} - -static int -pas_midi_ioctl(int dev, u_int cmd, ioctl_arg arg) -{ - return -(EINVAL); -} - -static void -pas_midi_kick(int dev) -{ - ofifo_bytes = 0; -} - -static int -pas_buffer_status(int dev) -{ - return qlen; -} - -#define MIDI_SYNTH_NAME "Pro Audio Spectrum Midi" -#define MIDI_SYNTH_CAPS SYNTH_CAP_INPUT -#include - -static struct midi_operations pas_midi_operations = -{ - {"Pro Audio Spectrum", 0, 0, SNDCARD_PAS}, - &std_midi_synth, - {0}, - pas_midi_open, - pas_midi_close, - pas_midi_ioctl, - pas_midi_out, - pas_midi_start_read, - pas_midi_end_read, - pas_midi_kick, - NULL, /* command */ - pas_buffer_status, - NULL -}; - -void -pas_midi_init() -{ - if (num_midis >= MAX_MIDI_DEV) { - printf("Sound: Too many midi devices detected\n"); - return; - } - std_midi_synth.midi_dev = my_dev = num_midis; - midi_devs[num_midis++] = &pas_midi_operations; - return; -} - -void -pas_midi_interrupt(void) -{ - u_char stat; - int i, incount; - u_long flags; - - stat = pas_read(MIDI_STATUS); - - if (stat & M_S_INPUT_AVAIL) { /* Input byte available */ - incount = pas_read(MIDI_FIFO_STATUS) & 0x0f; /* Input FIFO count */ - if (!incount) - incount = 16; - - for (i = 0; i < incount; i++) - if (input_opened) { - midi_input_intr(my_dev, pas_read(MIDI_DATA)); - } else - pas_read(MIDI_DATA); /* Flush */ - } - if (stat & (M_S_OUTPUT_EMPTY | M_S_OUTPUT_HALF_EMPTY)) { - if (!(stat & M_S_OUTPUT_EMPTY)) { - ofifo_bytes = 8; - } else { - ofifo_bytes = 0; - } - - flags = splhigh(); - - while (qlen && dump_to_midi(tmp_queue[qhead])) { - qlen--; - qhead++; - } - - splx(flags); - } - if (stat & M_S_OUTPUT_OVERRUN) { - printf("MIDI output overrun %x,%x,%d \n", pas_read(MIDI_FIFO_STATUS), stat, ofifo_bytes); - ofifo_bytes = 100; - } - pas_write(stat, MIDI_STATUS); /* Acknowledge interrupts */ -} - -#endif diff --git a/sys/dev/sound/isa/i386/pas2/pas2_mixer.c b/sys/dev/sound/isa/i386/pas2/pas2_mixer.c deleted file mode 100644 index 001cc19e18..0000000000 --- a/sys/dev/sound/isa/i386/pas2/pas2_mixer.c +++ /dev/null @@ -1,326 +0,0 @@ -/* - * sound/pas2_mixer.c - * - * Mixer routines for the Pro Audio Spectrum cards. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/sound/pas2_mixer.c,v 1.22 1999/12/20 18:05:00 eivind Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/pas2/Attic/pas2_mixer.c,v 1.2 2003/06/17 04:28:38 dillon Exp $ - */ - -#define _PAS2_MIXER_C_ - -#include - -#if defined(CONFIG_PAS) - -#include - -#define TRACE(what) /* (what) */ - -extern int translat_code; -extern char pas_model; -extern sound_os_info *pas_osp; - -static int rec_devices = (SOUND_MASK_MIC); /* Default recording source */ -static int mode_control = 0; - -#define POSSIBLE_RECORDING_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_SPEAKER | SOUND_MASK_LINE | SOUND_MASK_MIC | \ - SOUND_MASK_CD | SOUND_MASK_ALTPCM) - -#define SUPPORTED_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_SPEAKER | SOUND_MASK_LINE | SOUND_MASK_MIC | \ - SOUND_MASK_CD | SOUND_MASK_ALTPCM | SOUND_MASK_IMIX | \ - SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE | SOUND_MASK_RECLEV | \ - SOUND_MASK_MUTE | SOUND_MASK_ENHANCE | SOUND_MASK_LOUD) - -static u_short levels[SOUND_MIXER_NRDEVICES] = -{ - 0x3232, /* Master Volume */ - 0x3232, /* Bass */ - 0x3232, /* Treble */ - 0x5050, /* FM */ - 0x4b4b, /* PCM */ - 0x3232, /* PC Speaker */ - 0x4b4b, /* Ext Line */ - 0x4b4b, /* Mic */ - 0x4b4b, /* CD */ - 0x6464, /* Recording monitor */ - 0x4b4b, /* SB PCM */ - 0x6464 /* Recording level */ -}; - -void mix_write(u_char data, int ioaddr); - -void -mix_write(u_char data, int ioaddr) -{ - /* - * The Revision D cards have a problem with their MVA508 interface. - * The kludge-o-rama fix is to make a 16-bit quantity with identical - * LSB and MSBs out of the output byte and to do a 16-bit out to the - * mixer port - 1. We need to do this because it isn't timing problem - * but chip access sequence problem. - */ - - if (pas_model == PAS_16D) { - outw((ioaddr ^ translat_code) - 1, data | (data << 8)); - outb(0, 0x80); - } else - pas_write(data, ioaddr); -} - -static int -mixer_output(int right_vol, int left_vol, int div, int bits, - int mixer) -{ /* Input or output mixer */ - int left = left_vol * div / 100; - int right = right_vol * div / 100; - - - if (bits & P_M_MV508_MIXER) { /* Select input or output mixer */ - left |= mixer; - right |= mixer; - } - if (bits == P_M_MV508_BASS || bits == P_M_MV508_TREBLE) { /* Bass and treble are - * mono devices */ - mix_write(P_M_MV508_ADDRESS | bits, PARALLEL_MIXER); - mix_write(left, PARALLEL_MIXER); - right_vol = left_vol; - } else { - mix_write(P_M_MV508_ADDRESS | P_M_MV508_LEFT | bits, PARALLEL_MIXER); - mix_write(left, PARALLEL_MIXER); - mix_write(P_M_MV508_ADDRESS | P_M_MV508_RIGHT | bits, PARALLEL_MIXER); - mix_write(right, PARALLEL_MIXER); - } - - return (left_vol | (right_vol << 8)); -} - -static void -set_mode(int new_mode) -{ - mix_write(P_M_MV508_ADDRESS | P_M_MV508_MODE, PARALLEL_MIXER); - mix_write(new_mode, PARALLEL_MIXER); - - mode_control = new_mode; -} - -static int -pas_mixer_set(int whichDev, u_int level) -{ - int left, right, devmask, changed, i, mixer = 0; - - TRACE(printf("static int pas_mixer_set(int whichDev = %d, u_int level = %X)\n", whichDev, level)); - - left = level & 0x7f; - right = (level & 0x7f00) >> 8; - - if (whichDev < SOUND_MIXER_NRDEVICES) { - if ((1 << whichDev) & rec_devices) - mixer = P_M_MV508_INPUTMIX; - else - mixer = P_M_MV508_OUTPUTMIX; - } - switch (whichDev) { - case SOUND_MIXER_VOLUME: /* Master volume (0-63) */ - levels[whichDev] = mixer_output(right, left, 63, P_M_MV508_MASTER_A, 0); - break; - - /* - * Note! Bass and Treble are mono devices. Will use just the - * left channel. - */ - case SOUND_MIXER_BASS: /* Bass (0-12) */ - levels[whichDev] = mixer_output(right, left, 12, P_M_MV508_BASS, 0); - break; - case SOUND_MIXER_TREBLE: /* Treble (0-12) */ - levels[whichDev] = mixer_output(right, left, 12, P_M_MV508_TREBLE, 0); - break; - - case SOUND_MIXER_SYNTH:/* Internal synthesizer (0-31) */ - levels[whichDev] = mixer_output(right, left, 31, P_M_MV508_MIXER | P_M_MV508_FM, mixer); - break; - case SOUND_MIXER_PCM: /* PAS PCM (0-31) */ - levels[whichDev] = mixer_output(right, left, 31, P_M_MV508_MIXER | P_M_MV508_PCM, mixer); - break; - case SOUND_MIXER_ALTPCM: /* SB PCM (0-31) */ - levels[whichDev] = mixer_output(right, left, 31, P_M_MV508_MIXER | P_M_MV508_SB, mixer); - break; - case SOUND_MIXER_SPEAKER: /* PC speaker (0-31) */ - levels[whichDev] = mixer_output(right, left, 31, P_M_MV508_MIXER | P_M_MV508_SPEAKER, mixer); - break; - case SOUND_MIXER_LINE: /* External line (0-31) */ - levels[whichDev] = mixer_output(right, left, 31, P_M_MV508_MIXER | P_M_MV508_LINE, mixer); - break; - case SOUND_MIXER_CD: /* CD (0-31) */ - levels[whichDev] = mixer_output(right, left, 31, P_M_MV508_MIXER | P_M_MV508_CDROM, mixer); - break; - case SOUND_MIXER_MIC: /* External microphone (0-31) */ - levels[whichDev] = mixer_output(right, left, 31, P_M_MV508_MIXER | P_M_MV508_MIC, mixer); - break; - case SOUND_MIXER_IMIX: /* Recording monitor (0-31) (Output mixer - * only) */ - levels[whichDev] = mixer_output(right, left, 31, P_M_MV508_MIXER | P_M_MV508_IMIXER, - P_M_MV508_OUTPUTMIX); - break; - case SOUND_MIXER_RECLEV: /* Recording level (0-15) */ - levels[whichDev] = mixer_output(right, left, 15, P_M_MV508_MASTER_B, 0); - break; - - case SOUND_MIXER_MUTE: - return 0; - break; - - case SOUND_MIXER_ENHANCE: - i = 0; - level &= 0x7f; - if (level) - i = (level / 20) - 1; - - mode_control &= ~P_M_MV508_ENHANCE_BITS; - mode_control |= P_M_MV508_ENHANCE_BITS; - set_mode(mode_control); - - if (i) - i = (i + 1) * 20; - return i; - break; - - case SOUND_MIXER_LOUD: - mode_control &= ~P_M_MV508_LOUDNESS; - if (level) - mode_control |= P_M_MV508_LOUDNESS; - set_mode(mode_control); - return !!level; /* 0 or 1 */ - break; - - case SOUND_MIXER_RECSRC: - devmask = level & POSSIBLE_RECORDING_DEVICES; - - changed = devmask ^ rec_devices; - rec_devices = devmask; - - for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) - if (changed & (1 << i)) { - pas_mixer_set(i, levels[i]); - } - return rec_devices; - break; - - default: - return -(EINVAL); - } - - return (levels[whichDev]); -} - -/*****/ - -static void -pas_mixer_reset(void) -{ - int foo; - - TRACE(printf("pas2_mixer.c: void pas_mixer_reset(void)\n")); - - for (foo = 0; foo < SOUND_MIXER_NRDEVICES; foo++) - pas_mixer_set(foo, levels[foo]); - - set_mode(P_M_MV508_LOUDNESS | P_M_MV508_ENHANCE_40); -} - -static int -pas_mixer_ioctl(int dev, u_int cmd, ioctl_arg arg) -{ - TRACE(printf("pas2_mixer.c: int pas_mixer_ioctl(u_int cmd = %X, u_int arg = %X)\n", cmd, arg)); - - if (((cmd >> 8) & 0xff) == 'M') { - if (cmd & IOC_IN) - return *(int *) arg = pas_mixer_set(cmd & 0xff, (*(int *) arg)); - else { /* Read parameters */ - - switch (cmd & 0xff) { - - case SOUND_MIXER_RECSRC: - return *(int *) arg = rec_devices; - break; - - case SOUND_MIXER_STEREODEVS: - return *(int *) arg = SUPPORTED_MIXER_DEVICES & ~(SOUND_MASK_BASS | SOUND_MASK_TREBLE); - break; - - case SOUND_MIXER_DEVMASK: - return *(int *) arg = SUPPORTED_MIXER_DEVICES; - break; - - case SOUND_MIXER_RECMASK: - return *(int *) arg = POSSIBLE_RECORDING_DEVICES & SUPPORTED_MIXER_DEVICES; - break; - - case SOUND_MIXER_CAPS: - return *(int *) arg = 0; /* No special - * capabilities */ - break; - - case SOUND_MIXER_MUTE: - return *(int *) arg = 0; /* No mute yet */ - break; - - case SOUND_MIXER_ENHANCE: - if (!(mode_control & P_M_MV508_ENHANCE_BITS)) - return *(int *) arg = 0; - return *(int *) arg = ((mode_control & P_M_MV508_ENHANCE_BITS) + 1) * 20; - break; - - case SOUND_MIXER_LOUD: - if (mode_control & P_M_MV508_LOUDNESS) - return *(int *) arg = 1; - return *(int *) arg = 0; - break; - - default: - return *(int *) arg = levels[cmd & 0xff]; - } - } - } - return -(EINVAL); -} - -static struct mixer_operations pas_mixer_operations = -{ - "Pro Audio Spectrum 16", - pas_mixer_ioctl -}; - -int -pas_init_mixer(void) -{ - pas_mixer_reset(); - - if (num_mixers < MAX_MIXER_DEV) - mixer_devs[num_mixers++] = &pas_mixer_operations; - return 1; -} - -#endif diff --git a/sys/dev/sound/isa/i386/pas2/pas2_pcm.c b/sys/dev/sound/isa/i386/pas2/pas2_pcm.c deleted file mode 100644 index f2fc95c32d..0000000000 --- a/sys/dev/sound/isa/i386/pas2/pas2_pcm.c +++ /dev/null @@ -1,449 +0,0 @@ -#define _PAS2_PCM_C_ -/* - * sound/pas2_pcm.c - * - * The low level driver for the Pro Audio Spectrum ADC/DAC. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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 - -#if defined(CONFIG_PAS) && defined(CONFIG_AUDIO) -#include - - -#define TRACE(WHAT) /* * * (WHAT) */ - -#define PAS_PCM_INTRBITS (0x08) -/* - * Sample buffer timer interrupt enable - */ - -#define PCM_NON 0 -#define PCM_DAC 1 -#define PCM_ADC 2 - -static u_long pcm_speed = 0; /* sampling rate */ -static u_char pcm_channels = 1; /* channels (1 or 2) */ -static u_char pcm_bits = 8; /* bits/sample (8 or 16) */ -static u_char pcm_filter = 0; /* filter FLAG */ -static u_char pcm_mode = PCM_NON; -static u_long pcm_count = 0; -static u_short pcm_bitsok = 8; /* mask of OK bits */ -static int my_devnum = 0; -static int open_mode = 0; - -static int -pcm_set_speed(int arg) -{ - int foo, tmp; - u_long flags; - - if (arg > 44100) - arg = 44100; - if (arg < 5000) - arg = 5000; - - foo = (1193180 + (arg / 2)) / arg; - arg = 1193180 / foo; - - if (pcm_channels & 2) - foo = foo >> 1; - - pcm_speed = arg; - - tmp = pas_read(FILTER_FREQUENCY); - - /* - * Set anti-aliasing filters according to sample rate. You reall - * *NEED* to enable this feature for all normal recording unless you - * want to experiment with aliasing effects. These filters apply to - * the selected "recording" source. I (pfw) don't know the encoding - * of these 5 bits. The values shown come from the SDK found on - * ftp.uwp.edu:/pub/msdos/proaudio/. - */ -#if !defined NO_AUTO_FILTER_SET - tmp &= 0xe0; - if (pcm_speed >= 2 * 17897) - tmp |= 0x21; - else if (pcm_speed >= 2 * 15909) - tmp |= 0x22; - else if (pcm_speed >= 2 * 11931) - tmp |= 0x29; - else if (pcm_speed >= 2 * 8948) - tmp |= 0x31; - else if (pcm_speed >= 2 * 5965) - tmp |= 0x39; - else if (pcm_speed >= 2 * 2982) - tmp |= 0x24; - pcm_filter = tmp; -#endif - - flags = splhigh(); - - pas_write(tmp & ~(F_F_PCM_RATE_COUNTER | F_F_PCM_BUFFER_COUNTER), FILTER_FREQUENCY); - pas_write(S_C_C_SAMPLE_RATE | S_C_C_LSB_THEN_MSB | S_C_C_SQUARE_WAVE, SAMPLE_COUNTER_CONTROL); - pas_write(foo & 0xff, SAMPLE_RATE_TIMER); - pas_write((foo >> 8) & 0xff, SAMPLE_RATE_TIMER); - pas_write(tmp, FILTER_FREQUENCY); - - splx(flags); - - return pcm_speed; -} - -static int -pcm_set_channels(int arg) -{ - - if ((arg != 1) && (arg != 2)) - return pcm_channels; - - if (arg != pcm_channels) { - pas_write(pas_read(PCM_CONTROL) ^ P_C_PCM_MONO, PCM_CONTROL); - - pcm_channels = arg; - pcm_set_speed(pcm_speed); /* The speed must be - * reinitialized */ - } - return pcm_channels; -} - -static int -pcm_set_bits(int arg) -{ - if ((arg & pcm_bitsok) != arg) - return pcm_bits; - - if (arg != pcm_bits) { - pas_write(pas_read(SYSTEM_CONFIGURATION_2) ^ S_C_2_PCM_16_BIT, SYSTEM_CONFIGURATION_2); - - pcm_bits = arg; - } - return pcm_bits; -} - -static int -pas_pcm_ioctl(int dev, u_int cmd, ioctl_arg arg, int local) -{ - TRACE(printf("pas2_pcm.c: static int pas_pcm_ioctl(u_int cmd = %X, u_int arg = %X)\n", cmd, arg)); - - switch (cmd) { - case SOUND_PCM_WRITE_RATE: - if (local) - return pcm_set_speed((int) arg); - return *(int *) arg = pcm_set_speed((*(int *) arg)); - break; - - case SOUND_PCM_READ_RATE: - if (local) - return pcm_speed; - return *(int *) arg = pcm_speed; - break; - - case SNDCTL_DSP_STEREO: - if (local) - return pcm_set_channels((int) arg + 1) - 1; - return *(int *) arg = pcm_set_channels((*(int *) arg) + 1) - 1; - break; - - case SOUND_PCM_WRITE_CHANNELS: - if (local) - return pcm_set_channels((int) arg); - return *(int *) arg = pcm_set_channels((*(int *) arg)); - break; - - case SOUND_PCM_READ_CHANNELS: - if (local) - return pcm_channels; - return *(int *) arg = pcm_channels; - break; - - case SNDCTL_DSP_SETFMT: - if (local) - return pcm_set_bits((int) arg); - return *(int *) arg = pcm_set_bits((*(int *) arg)); - break; - - case SOUND_PCM_READ_BITS: - if (local) - return pcm_bits; - return *(int *) arg = pcm_bits; - - case SOUND_PCM_WRITE_FILTER: /* NOT YET IMPLEMENTED */ - if ((*(int *) arg) > 1) - return -(EINVAL); - pcm_filter = (*(int *) arg); - break; - - case SOUND_PCM_READ_FILTER: - return *(int *) arg = pcm_filter; - break; - - default: - return -(EINVAL); - } - - return -(EINVAL); -} - -static void -pas_pcm_reset(int dev) -{ - TRACE(printf("pas2_pcm.c: static void pas_pcm_reset(void)\n")); - - pas_write(pas_read(PCM_CONTROL) & ~P_C_PCM_ENABLE, PCM_CONTROL); -} - -static int -pas_pcm_open(int dev, int mode) -{ - int err; - - TRACE(printf("pas2_pcm.c: static int pas_pcm_open(int mode = %X)\n", mode)); - - if ((err = pas_set_intr(PAS_PCM_INTRBITS)) < 0) - return err; - - - pcm_count = 0; - open_mode = mode; - - return 0; -} - -static void -pas_pcm_close(int dev) -{ - u_long flags; - - TRACE(printf("pas2_pcm.c: static void pas_pcm_close(void)\n")); - - flags = splhigh(); - - pas_pcm_reset(dev); - pas_remove_intr(PAS_PCM_INTRBITS); - pcm_mode = PCM_NON; - - open_mode = 0; - - splx(flags); -} - -static void -pas_pcm_output_block(int dev, u_long buf, int count, - int intrflag, int restart_dma) -{ - u_long flags, cnt; - - TRACE(printf("pas2_pcm.c: static void pas_pcm_output_block(char *buf = %P, int count = %X)\n", buf, count)); - - cnt = count; - if (audio_devs[dev]->dmachan1 > 3) - cnt >>= 1; - - if (audio_devs[dev]->flags & DMA_AUTOMODE && - intrflag && - cnt == pcm_count) - return; /* Auto mode on. No need to react */ - - flags = splhigh(); - - pas_write(pas_read(PCM_CONTROL) & ~P_C_PCM_ENABLE, - PCM_CONTROL); - - if (restart_dma) - DMAbuf_start_dma(dev, buf, count, 1); - - if (audio_devs[dev]->dmachan1 > 3) - count >>= 1; - - if (count != pcm_count) { - pas_write(pas_read(FILTER_FREQUENCY) & ~F_F_PCM_BUFFER_COUNTER, FILTER_FREQUENCY); - pas_write(S_C_C_SAMPLE_BUFFER | S_C_C_LSB_THEN_MSB | S_C_C_SQUARE_WAVE, SAMPLE_COUNTER_CONTROL); - pas_write(count & 0xff, SAMPLE_BUFFER_COUNTER); - pas_write((count >> 8) & 0xff, SAMPLE_BUFFER_COUNTER); - pas_write(pas_read(FILTER_FREQUENCY) | F_F_PCM_BUFFER_COUNTER, FILTER_FREQUENCY); - - pcm_count = count; - } - pas_write(pas_read(FILTER_FREQUENCY) | F_F_PCM_BUFFER_COUNTER | F_F_PCM_RATE_COUNTER, FILTER_FREQUENCY); -#ifdef NO_TRIGGER - pas_write(pas_read(PCM_CONTROL) | P_C_PCM_ENABLE | P_C_PCM_DAC_MODE, PCM_CONTROL); -#endif - - pcm_mode = PCM_DAC; - - splx(flags); -} - -static void -pas_pcm_start_input(int dev, u_long buf, int count, - int intrflag, int restart_dma) -{ - u_long flags; - int cnt; - - TRACE(printf("pas2_pcm.c: static void pas_pcm_start_input(char *buf = %P, int count = %X)\n", buf, count)); - - cnt = count; - if (audio_devs[dev]->dmachan1 > 3) - cnt >>= 1; - - if (audio_devs[my_devnum]->flags & DMA_AUTOMODE && - intrflag && - cnt == pcm_count) - return; /* Auto mode on. No need to react */ - - flags = splhigh(); - - if (restart_dma) - DMAbuf_start_dma(dev, buf, count, 0); - - if (audio_devs[dev]->dmachan1 > 3) - count >>= 1; - - if (count != pcm_count) { - pas_write(pas_read(FILTER_FREQUENCY) & ~F_F_PCM_BUFFER_COUNTER, FILTER_FREQUENCY); - pas_write(S_C_C_SAMPLE_BUFFER | S_C_C_LSB_THEN_MSB | S_C_C_SQUARE_WAVE, SAMPLE_COUNTER_CONTROL); - pas_write(count & 0xff, SAMPLE_BUFFER_COUNTER); - pas_write((count >> 8) & 0xff, SAMPLE_BUFFER_COUNTER); - pas_write(pas_read(FILTER_FREQUENCY) | F_F_PCM_BUFFER_COUNTER, FILTER_FREQUENCY); - - pcm_count = count; - } - pas_write(pas_read(FILTER_FREQUENCY) | F_F_PCM_BUFFER_COUNTER | F_F_PCM_RATE_COUNTER, FILTER_FREQUENCY); -#ifdef NO_TRIGGER - pas_write((pas_read(PCM_CONTROL) | P_C_PCM_ENABLE) & ~P_C_PCM_DAC_MODE, PCM_CONTROL); -#endif - - pcm_mode = PCM_ADC; - - splx(flags); -} -#ifndef NO_TRIGGER -static void -pas_audio_trigger (int dev, int state) -{ - unsigned long flags; - - flags = splhigh(); - - state &= open_mode; - - if (state & PCM_ENABLE_OUTPUT) - pas_write (pas_read (0xF8A) | 0x40 | 0x10, 0xF8A); - else if (state & PCM_ENABLE_INPUT) - pas_write ((pas_read (0xF8A) | 0x40) & ~0x10, 0xF8A); - else - pas_write (pas_read (0xF8A) & ~0x40, 0xF8A); - - splx(flags); -} -#endif - -static int -pas_pcm_prepare_for_input(int dev, int bsize, int bcount) -{ - return 0; -} -static int -pas_pcm_prepare_for_output(int dev, int bsize, int bcount) -{ - return 0; -} - -static struct audio_operations pas_pcm_operations = -{ - "Pro Audio Spectrum", - DMA_AUTOMODE, - AFMT_U8 | AFMT_S16_LE, - NULL, - pas_pcm_open, - pas_pcm_close, - pas_pcm_output_block, - pas_pcm_start_input, - pas_pcm_ioctl, - pas_pcm_prepare_for_input, - pas_pcm_prepare_for_output, - pas_pcm_reset, - pas_pcm_reset, - NULL, - NULL, - NULL, - NULL, - pas_audio_trigger -}; - -void -pas_pcm_init(struct address_info * hw_config) -{ - pcm_bitsok = 8; - if (pas_read(OPERATION_MODE_1) & O_M_1_PCM_TYPE) - pcm_bitsok |= 16; - - pcm_set_speed(DSP_DEFAULT_SPEED); - - if (num_audiodevs < MAX_AUDIO_DEV) { - audio_devs[my_devnum = num_audiodevs++] = &pas_pcm_operations; - audio_devs[my_devnum]->dmachan1 = hw_config->dma; - audio_devs[my_devnum]->buffsize = DSP_BUFFSIZE; - } else - printf("PAS2: Too many PCM devices available\n"); - - return; -} - -void -pas_pcm_interrupt(u_char status, int cause) -{ - if (cause == 1) { /* PCM buffer done */ - /* - * Halt the PCM first. Otherwise we don't have time to start - * a new block before the PCM chip proceeds to the next - * sample - */ - - if (!(audio_devs[my_devnum]->flags & DMA_AUTOMODE)) { - pas_write(pas_read(PCM_CONTROL) & ~P_C_PCM_ENABLE, - PCM_CONTROL); - } - switch (pcm_mode) { - - case PCM_DAC: - DMAbuf_outputintr(my_devnum, 1); - break; - - case PCM_ADC: - DMAbuf_inputintr(my_devnum); - break; - - default: - printf("PAS: Unexpected PCM interrupt\n"); - } - } -} - -#endif diff --git a/sys/dev/sound/isa/i386/patmgr.c b/sys/dev/sound/isa/i386/patmgr.c deleted file mode 100644 index f4a8025763..0000000000 --- a/sys/dev/sound/isa/i386/patmgr.c +++ /dev/null @@ -1,268 +0,0 @@ -/* - * sound/patmgr.c - * - * The patch maneger interface for the /dev/sequencer - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/patmgr.c,v 1.2 2003/08/07 21:17:12 dillon Exp $ - */ - -#define PATMGR_C -#include "sound_config.h" - -#if defined(CONFIG_SEQUENCER) - -static int *server_procs[MAX_SYNTH_DEV] = {NULL}; -static volatile struct snd_wait server_wait_flag[MAX_SYNTH_DEV] = { {0}}; - -static struct patmgr_info *mbox[MAX_SYNTH_DEV] = {NULL}; -static volatile int msg_direction[MAX_SYNTH_DEV] = {0}; - -static int pmgr_opened[MAX_SYNTH_DEV] = {0}; - -#define A_TO_S 1 -#define S_TO_A 2 - -static int *appl_proc = NULL; -static volatile struct snd_wait appl_wait_flag = -{0}; - -int -pmgr_open(int dev) -{ - if (dev < 0 || dev >= num_synths) - return -(ENXIO); - - if (pmgr_opened[dev]) - return -(EBUSY); - pmgr_opened[dev] = 1; - - server_wait_flag[dev].aborting = 0; - server_wait_flag[dev].mode = WK_NONE; - - return 0; -} - -void -pmgr_release(int dev) -{ - - if (mbox[dev]) { /* Killed in action. Inform the client */ - - mbox[dev]->key = PM_ERROR; - mbox[dev]->parm1 = -(EIO); - - if ((appl_wait_flag.mode & WK_SLEEP)) { - appl_wait_flag.mode = WK_WAKEUP; - wakeup(appl_proc); - }; - } - pmgr_opened[dev] = 0; -} - -int -pmgr_read(int dev, struct fileinfo * file, snd_rw_buf * buf, int count) -{ - u_long flags; - int ok = 0; - - if (count != sizeof(struct patmgr_info)) { - printf("PATMGR%d: Invalid read count\n", dev); - return -(EIO); - } - while (!ok && !(server_wait_flag[dev].aborting)) { - flags = splhigh(); - - while (!(mbox[dev] && msg_direction[dev] == A_TO_S) && - !(server_wait_flag[dev].aborting)) { - - int chn; - server_procs[dev] = &chn; - DO_SLEEP(chn, server_wait_flag[dev], 0); - - } - - if (mbox[dev] && msg_direction[dev] == A_TO_S) { - - if (uiomove((char *) mbox[dev], count, buf)) { - printf("sb: Bad copyout()!\n"); - }; - msg_direction[dev] = 0; - ok = 1; - } - splx(flags); - - } - - if (!ok) - return -(EINTR); - return count; -} - -int -pmgr_write(int dev, struct fileinfo * file, snd_rw_buf * buf, int count) -{ - u_long flags; - - if (count < 4) { - printf("PATMGR%d: Write count < 4\n", dev); - return -(EIO); - } - if (uiomove((char *) mbox[dev], 4, buf)) { - printf("sb: Bad copyin()!\n"); - }; - - if (*(u_char *) mbox[dev] == SEQ_FULLSIZE) { - int tmp_dev; - - tmp_dev = ((u_short *) mbox[dev])[2]; - if (tmp_dev != dev) - return -(ENXIO); - - return synth_devs[dev]->load_patch(dev, *(u_short *) mbox[dev], - buf, 4, count, 1); - } - if (count != sizeof(struct patmgr_info)) { - printf("PATMGR%d: Invalid write count\n", dev); - return -(EIO); - } - /* - * If everything went OK, there should be a preallocated buffer in - * the mailbox and a client waiting. - */ - - flags = splhigh(); - - if (mbox[dev] && !msg_direction[dev]) { - - if (uiomove(&((char *) mbox[dev])[4], count - 4, buf)) { - printf("sb: Bad copyin()!\n"); - }; - msg_direction[dev] = S_TO_A; - - if ((appl_wait_flag.mode & WK_SLEEP)) { - appl_wait_flag.mode = WK_WAKEUP; - wakeup(appl_proc); - } - } - splx(flags); - - return count; -} - -int -pmgr_access(int dev, struct patmgr_info * rec) -{ - u_long flags; - int err = 0; - - flags = splhigh(); - - if (mbox[dev]) - printf(" PATMGR: Server %d mbox full. Why?\n", dev); - else { - int chn; - - rec->key = PM_K_COMMAND; - mbox[dev] = rec; - msg_direction[dev] = A_TO_S; - - if ((server_wait_flag[dev].mode & WK_SLEEP)) { - server_wait_flag[dev].mode = WK_WAKEUP; - wakeup(server_procs[dev]); - } - - - appl_proc = &chn; - DO_SLEEP(chn, appl_wait_flag, 0); - - if (msg_direction[dev] != S_TO_A) { - rec->key = PM_ERROR; - rec->parm1 = -(EIO); - } else if (rec->key == PM_ERROR) { - err = rec->parm1; - if (err > 0) - err = -err; - } - mbox[dev] = NULL; - msg_direction[dev] = 0; - } - - splx(flags); - - return err; -} - -int -pmgr_inform(int dev, int event, u_long p1, u_long p2, u_long p3, u_long p4) -{ - u_long flags; - int err = 0; - - struct patmgr_info *tmp_mbox; - - if (!pmgr_opened[dev]) - return 0; - - tmp_mbox = (struct patmgr_info *) malloc(sizeof(struct patmgr_info), M_TEMP, M_WAITOK); - - if (tmp_mbox == NULL) { - printf("pmgr: Couldn't allocate memory for a message\n"); - return 0; - } - flags = splhigh(); - - if (mbox[dev]) - printf(" PATMGR: Server %d mbox full. Why?\n", dev); - else { - int chn; - - mbox[dev] = tmp_mbox; - mbox[dev]->key = PM_K_EVENT; - mbox[dev]->command = event; - mbox[dev]->parm1 = p1; - mbox[dev]->parm2 = p2; - mbox[dev]->parm3 = p3; - msg_direction[dev] = A_TO_S; - - if ((server_wait_flag[dev].mode & WK_SLEEP)) { - server_wait_flag[dev].mode = WK_WAKEUP; - wakeup(server_procs[dev]); - } - - - appl_proc = &chn; - DO_SLEEP(chn, appl_wait_flag, 0); - - mbox[dev] = NULL; - msg_direction[dev] = 0; - } - - splx(flags); - free(tmp_mbox, M_TEMP); - - return err; -} - -#endif diff --git a/sys/dev/sound/isa/i386/pca/pcaudio.c b/sys/dev/sound/isa/i386/pca/pcaudio.c deleted file mode 100644 index 8f84bef30b..0000000000 --- a/sys/dev/sound/isa/i386/pca/pcaudio.c +++ /dev/null @@ -1,607 +0,0 @@ -/*- - * Copyright (c) 1994-1998 Søren Schmidt - * All rights reserved. - * - * 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, - * without modification, immediately at the beginning of the file. - * 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. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/pcaudio.c,v 1.58 2000/01/25 21:58:43 dfr Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/pca/Attic/pcaudio.c,v 1.11 2004/08/02 23:20:29 dillon Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#define BUF_SIZE 8192 -#define SAMPLE_RATE 8000 -#define INTERRUPT_RATE 16000 - -static struct pca_status { - char open; /* device open */ - char queries; /* did others try opening */ - unsigned char *buf[3]; /* triple buffering */ - unsigned char *buffer; /* current buffer ptr */ - unsigned in_use[3]; /* buffers fill */ - unsigned index; /* index in current buffer */ - unsigned counter; /* sample counter */ - unsigned scale; /* sample counter scale */ - unsigned sample_rate; /* sample rate */ - unsigned processed; /* samples processed */ - unsigned volume; /* volume for pc-speaker */ - char encoding; /* Ulaw, Alaw or linear */ - u_char current; /* current buffer */ - unsigned char oldval; /* old timer port value */ - char timer_on; /* is playback running */ - struct selinfo wsel; /* select/poll status */ -} pca_status; - -static char buffer1[BUF_SIZE]; -static char buffer2[BUF_SIZE]; -static char buffer3[BUF_SIZE]; -static char volume_table[256]; - -static unsigned char ulaw_dsp[] = { - 3, 7, 11, 15, 19, 23, 27, 31, - 35, 39, 43, 47, 51, 55, 59, 63, - 66, 68, 70, 72, 74, 76, 78, 80, - 82, 84, 86, 88, 90, 92, 94, 96, - 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, - 113, 114, 114, 115, 115, 116, 116, 117, - 117, 118, 118, 119, 119, 120, 120, 121, - 121, 121, 122, 122, 122, 122, 123, 123, - 123, 123, 124, 124, 124, 124, 125, 125, - 125, 125, 125, 125, 126, 126, 126, 126, - 126, 126, 126, 126, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 253, 249, 245, 241, 237, 233, 229, 225, - 221, 217, 213, 209, 205, 201, 197, 193, - 190, 188, 186, 184, 182, 180, 178, 176, - 174, 172, 170, 168, 166, 164, 162, 160, - 158, 157, 156, 155, 154, 153, 152, 151, - 150, 149, 148, 147, 146, 145, 144, 143, - 143, 142, 142, 141, 141, 140, 140, 139, - 139, 138, 138, 137, 137, 136, 136, 135, - 135, 135, 134, 134, 134, 134, 133, 133, - 133, 133, 132, 132, 132, 132, 131, 131, - 131, 131, 131, 131, 130, 130, 130, 130, - 130, 130, 130, 130, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 129, 129, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, -}; - -static unsigned char alaw_linear[] = { - 45, 214, 122, 133, 0, 255, 107, 149, - 86, 171, 126, 129, 0, 255, 117, 138, - 13, 246, 120, 135, 0, 255, 99, 157, - 70, 187, 124, 131, 0, 255, 113, 142, - 61, 198, 123, 132, 0, 255, 111, 145, - 94, 163, 127, 128, 0, 255, 119, 136, - 29, 230, 121, 134, 0, 255, 103, 153, - 78, 179, 125, 130, 0, 255, 115, 140, - 37, 222, 122, 133, 0, 255, 105, 151, - 82, 175, 126, 129, 0, 255, 116, 139, - 5, 254, 120, 135, 0, 255, 97, 159, - 66, 191, 124, 131, 0, 255, 112, 143, - 53, 206, 123, 132, 0, 255, 109, 147, - 90, 167, 127, 128, 0, 255, 118, 137, - 21, 238, 121, 134, 0, 255, 101, 155, - 74, 183, 125, 130, 0, 255, 114, 141, - 49, 210, 123, 133, 0, 255, 108, 148, - 88, 169, 127, 129, 0, 255, 118, 138, - 17, 242, 121, 135, 0, 255, 100, 156, - 72, 185, 125, 131, 0, 255, 114, 142, - 64, 194, 124, 132, 0, 255, 112, 144, - 96, 161, 128, 128, 1, 255, 120, 136, - 33, 226, 122, 134, 0, 255, 104, 152, - 80, 177, 126, 130, 0, 255, 116, 140, - 41, 218, 122, 133, 0, 255, 106, 150, - 84, 173, 126, 129, 0, 255, 117, 139, - 9, 250, 120, 135, 0, 255, 98, 158, - 68, 189, 124, 131, 0, 255, 113, 143, - 57, 202, 123, 132, 0, 255, 110, 146, - 92, 165, 127, 128, 0, 255, 119, 137, - 25, 234, 121, 134, 0, 255, 102, 154, - 76, 181, 125, 130, 0, 255, 115, 141, -}; - -static int pca_sleep = 0; -static int pca_initialized = 0; - -static void pcaintr(struct intrframe *frame); - -static d_open_t pcaopen; -static d_close_t pcaclose; -static d_write_t pcawrite; -static d_ioctl_t pcaioctl; -static d_poll_t pcapoll; - -#define CDEV_MAJOR 24 -static struct cdevsw pca_cdevsw = { - /* name */ "pca", - /* maj */ CDEV_MAJOR, - /* flags */ 0, - /* port */ NULL, - /* clone */ NULL, - - /* open */ pcaopen, - /* close */ pcaclose, - /* read */ noread, - /* write */ pcawrite, - /* ioctl */ pcaioctl, - /* poll */ pcapoll, - /* mmap */ nommap, - /* strategy */ nostrategy, - /* dump */ nodump, - /* psize */ nopsize -}; - -static void pca_continue (void); -static void pca_init (void); -static void pca_pause (void); - -static void -conv(const unsigned char *table, unsigned char *buff, unsigned n) -{ - unsigned i; - - for (i = 0; i < n; i++) - buff[i] = table[buff[i]]; -} - - -static void -pca_volume(int volume) -{ - int i, j; - - for (i=0; i<256; i++) { - j = ((i-128)*volume)/25; -/* XXX - j = ((i-128)*volume)/100; -*/ - if (j<-128) - j = -128; - if (j>127) - j = 127; - volume_table[i] = (((255-(j + 128))/4)+1); - } -} - - -static void -pca_init(void) -{ - pca_status.open = 0; - pca_status.queries = 0; - pca_status.timer_on = 0; - pca_status.buf[0] = (unsigned char *)&buffer1[0]; - pca_status.buf[1] = (unsigned char *)&buffer2[0]; - pca_status.buf[2] = (unsigned char *)&buffer3[0]; - pca_status.buffer = pca_status.buf[0]; - pca_status.in_use[0] = pca_status.in_use[1] = pca_status.in_use[2] = 0; - pca_status.current = 0; - pca_status.sample_rate = SAMPLE_RATE; - pca_status.scale = (pca_status.sample_rate << 8) / INTERRUPT_RATE; - pca_status.encoding = AUDIO_ENCODING_ULAW; - pca_status.volume = 100; - - pca_volume(pca_status.volume); -} - - -static int -pca_start(void) -{ - return(-1); -#if 0 - int x = splhigh(); - int rv = 0; - - /* use the first buffer */ - pca_status.current = 0; - pca_status.index = 0; - pca_status.counter = 0; - pca_status.buffer = pca_status.buf[pca_status.current]; - pca_status.oldval = inb(IO_PPI) | 0x03; - /* acquire the timers */ - if (acquire_timer2(TIMER_LSB|TIMER_ONESHOT)) - rv = -1; - else if (acquire_timer0(INTERRUPT_RATE, pcaintr)) { - release_timer2(); - rv = -1; - } else - pca_status.timer_on = 1; - - splx(x); - return rv; -#endif -} - - -static void -pca_stop(void) -{ -#if 0 - int x = splhigh(); - - /* release the timers */ - release_timer0(); - release_timer2(); - /* reset the buffer */ - pca_status.in_use[0] = pca_status.in_use[1] = pca_status.in_use[2] = 0; - pca_status.index = 0; - pca_status.counter = 0; - pca_status.current = 0; - pca_status.buffer = pca_status.buf[pca_status.current]; - pca_status.timer_on = 0; - splx(x); -#endif -} - - -static void -pca_pause(void) -{ -#if 0 - int x = splhigh(); - - release_timer0(); - release_timer2(); - pca_status.timer_on = 0; - splx(x); -#endif -} - - -static void -pca_continue(void) -{ -#if 0 - int x = splhigh(); - - pca_status.oldval = inb(IO_PPI) | 0x03; - acquire_timer2(TIMER_LSB|TIMER_ONESHOT); - acquire_timer0(INTERRUPT_RATE, pcaintr); - pca_status.timer_on = 1; - splx(x); -#endif -} - - -static int -pca_wait(void) -{ - int error, x; - - if (!pca_status.timer_on) - return 0; - - while (pca_status.in_use[0] || pca_status.in_use[1] || - pca_status.in_use[2]) { - x = spltty(); - pca_sleep = 1; - error = tsleep(&pca_sleep, PCATCH, "pca_drain", 0); - pca_sleep = 0; - splx(x); - if (error != 0 && error != ERESTART) { - pca_stop(); - return error; - } - } - return 0; -} - - -static struct isa_pnp_id pca_ids[] = { - {0x0008d041, "AT-style speaker sound"}, /* PNP0800 */ - {0} -}; - -static int -pcaprobe(device_t dev) -{ - int error; - - /* Check isapnp ids */ - error = ISA_PNP_PROBE(device_get_parent(dev), dev, pca_ids); - if (error == ENXIO) - return ENXIO; - return 0; -} - - -static int -pcaattach(device_t dev) -{ - pca_init(); - cdevsw_add(&pca_cdevsw, 0, 0); - make_dev(&pca_cdevsw, 0, 0, 0, 0600, "pcaudio"); - make_dev(&pca_cdevsw, 128, 0, 0, 0600, "pcaudioctl"); - return 0; -} - -static device_method_t pca_methods[] = { - DEVMETHOD(device_probe, pcaprobe), - DEVMETHOD(device_attach, pcaattach), - { 0, 0 } -}; - -static driver_t pca_driver = { - "pca", - pca_methods, - 1 -}; - -static devclass_t pca_devclass; - -DRIVER_MODULE(pca, isa, pca_driver, pca_devclass, 0, 0); - - -static int -pcaopen(dev_t dev, int flags, int fmt, struct thread *td) -{ - /* audioctl device can always be opened */ - if (minor(dev) == 128) - return 0; - if (minor(dev) > 0) - return ENXIO; - - if (!pca_initialized) { - pca_init(); - pca_initialized = 1; - } - - /* audio device can only be open by one process */ - if (pca_status.open) { - pca_status.queries = 1; - return EBUSY; - } - pca_status.buffer = pca_status.buf[0]; - pca_status.in_use[0] = pca_status.in_use[1] = pca_status.in_use[2] = 0; - pca_status.timer_on = 0; - pca_status.open = 1; - pca_status.processed = 0; - return 0; -} - - -static int -pcaclose(dev_t dev, int flags, int fmt, struct thread *td) -{ - /* audioctl device can always be closed */ - if (minor(dev) == 128) - return 0; - if (minor(dev) > 0) - return ENXIO; - /* audio device close drains all output and restores timers */ - pca_wait(); - pca_stop(); - pca_status.open = 0; - return 0; -} - - -static int -pcawrite(dev_t dev, struct uio *uio, int flag) -{ - int count, error, which, x; - - /* only audio device can be written */ - if (minor(dev) > 0) - return ENXIO; - - while ((count = min(BUF_SIZE, uio->uio_resid)) > 0) { - if (pca_status.in_use[0] && pca_status.in_use[1] && - pca_status.in_use[2]) { - if (flag & IO_NDELAY) - return EWOULDBLOCK; - x = spltty(); - pca_sleep = 1; - error = tsleep(&pca_sleep, PCATCH, "pca_wait", 0); - pca_sleep = 0; - splx(x); - if (error != 0 && error != ERESTART) { - pca_stop(); - return error; - } - } - if (!pca_status.in_use[0]) - which = 0; - else if (!pca_status.in_use[1]) - which = 1; - else - which = 2; - if (count && !pca_status.in_use[which]) { - uiomove(pca_status.buf[which], count, uio); - pca_status.processed += count; - switch (pca_status.encoding) { - case AUDIO_ENCODING_ULAW: - conv(ulaw_dsp, pca_status.buf[which], count); - break; - - case AUDIO_ENCODING_ALAW: - conv(alaw_linear, pca_status.buf[which], count); - break; - - case AUDIO_ENCODING_RAW: - break; - } - pca_status.in_use[which] = count; - if (!pca_status.timer_on) - if (pca_start()) - return EBUSY; - } - } - return 0; -} - - -static int -pcaioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) -{ - audio_info_t *auptr; - - switch(cmd) { - - case AUDIO_GETINFO: - auptr = (audio_info_t *)data; - auptr->play.sample_rate = pca_status.sample_rate; - auptr->play.channels = 1; - auptr->play.precision = 8; - auptr->play.encoding = pca_status.encoding; - - auptr->play.gain = pca_status.volume; - auptr->play.port = 0; - - auptr->play.samples = pca_status.processed; - auptr->play.eof = 0; - auptr->play.pause = !pca_status.timer_on; - auptr->play.error = 0; - auptr->play.waiting = pca_status.queries; - - auptr->play.open = pca_status.open; - auptr->play.active = pca_status.timer_on; - return 0; - - case AUDIO_SETINFO: - auptr = (audio_info_t *)data; - if (auptr->play.sample_rate != (unsigned int)~0) { - pca_status.sample_rate = auptr->play.sample_rate; - pca_status.scale = - (pca_status.sample_rate << 8) / INTERRUPT_RATE; - } - if (auptr->play.encoding != (unsigned int)~0) { - pca_status.encoding = auptr->play.encoding; - } - if (auptr->play.gain != (unsigned int)~0) { - pca_status.volume = auptr->play.gain; - pca_volume(pca_status.volume); - } - if (auptr->play.pause != (unsigned char)~0) { - if (auptr->play.pause) - pca_pause(); - else - pca_continue(); - } - - return 0; - - case AUDIO_DRAIN: - case AUDIO_COMPAT_DRAIN: - return pca_wait(); - - case AUDIO_FLUSH: - case AUDIO_COMPAT_FLUSH: - pca_stop(); - return 0; - case FIONBIO: - return 0; - } - return ENXIO; -} - - -static void -pcaintr(struct intrframe *frame) -{ - if (pca_status.index < pca_status.in_use[pca_status.current]) { - cpu_disable_intr(); - __asm__("outb %0,$0x61\n" - "andb $0xFE,%0\n" - "outb %0,$0x61" - : : "a" ((char)pca_status.oldval) ); - __asm__("xlatb\n" - "outb %0,$0x42" - : : "a" ((char)pca_status.buffer[pca_status.index]), - "b" (volume_table) ); - cpu_enable_intr(); - pca_status.counter += pca_status.scale; - pca_status.index = (pca_status.counter >> 8); - } - if (pca_status.index >= pca_status.in_use[pca_status.current]) { - pca_status.index = pca_status.counter = 0; - pca_status.in_use[pca_status.current] = 0; - pca_status.current++; - if (pca_status.current > 2) - pca_status.current = 0; - pca_status.buffer = pca_status.buf[pca_status.current]; - if (pca_sleep) - wakeup(&pca_sleep); - if (pca_status.wsel.si_pid) { - selwakeup((struct selinfo *)&pca_status.wsel.si_pid); - pca_status.wsel.si_pid = 0; - pca_status.wsel.si_flags = 0; - } - } -} - - -static int -pcapoll(dev_t dev, int events, struct thread *td) -{ - int s; - struct proc *p; - struct proc *p1; - int revents = 0; - - p = td->td_proc; - KKASSERT(p); - - s = spltty(); - - if (events & (POLLOUT | POLLWRNORM)) { - if (!pca_status.in_use[0] || !pca_status.in_use[1] || - !pca_status.in_use[2]) - revents |= events & (POLLOUT | POLLWRNORM); - else { - if (pca_status.wsel.si_pid && - (p1=pfind(pca_status.wsel.si_pid)) - && p1->p_wchan == (caddr_t)&selwait) - pca_status.wsel.si_flags = SI_COLL; - else - pca_status.wsel.si_pid = p->p_pid; - } - } - splx(s); - return (revents); -} diff --git a/sys/dev/sound/isa/i386/sb/sb_card.c b/sys/dev/sound/isa/i386/sb/sb_card.c deleted file mode 100644 index 37da6b4a59..0000000000 --- a/sys/dev/sound/isa/i386/sb/sb_card.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * sound/sb_card.c - * - * Detection routine for the SoundBlaster cards. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * Modified: Riccardo Facchetti 24 Mar 1995 - Added the Audio Excel DSP 16 - * initialization routine. - * - * Major code cleanup - Luigi Rizzo (luigi@iet.unipi.it) 970711 - */ - -#include - -#if NSB > 0 -#include - -void -attach_sb_card(struct address_info * hw_config) -{ -#if defined(CONFIG_AUDIO) || defined(CONFIG_MIDI) - -#if 0 - /* why do a detect during the attach ? XXX */ - if (!sb_dsp_detect(hw_config)) - return ; -#endif - sb_dsp_init(hw_config); -#endif - - return ; -} - -int -probe_sb(struct address_info * hw_config) -{ - -#if defined(CONFIG_AEDSP16) && defined(AEDSP16_SBPRO) - /* - * Initialize Audio Excel DSP 16 to SBPRO. - */ - InitAEDSP16_SBPRO(hw_config); -#endif - return sb_dsp_detect(hw_config); -} -#endif diff --git a/sys/dev/sound/isa/i386/sb/sb_defs.h b/sys/dev/sound/isa/i386/sb/sb_defs.h deleted file mode 100644 index e21c7c86e9..0000000000 --- a/sys/dev/sound/isa/i386/sb/sb_defs.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifdef PC98 -#define DSP_RESET (sbc_base + 0x600) -#define DSP_READ (sbc_base + 0xA00) -#define DSP_WRITE (sbc_base + 0xC00) -#define DSP_COMMAND (sbc_base + 0xC00) -#define DSP_STATUS (sbc_base + 0xC00) -#define DSP_DATA_AVAIL (sbc_base + 0xE00) -#define DSP_DATA_AVL16 (sbc_base + 0xF00) -#define MIXER_ADDR (sbc_base + 0x400) -#define MIXER_DATA (sbc_base + 0x500) -#define OPL3_LEFT (sbc_base + 0x000) -#define OPL3_RIGHT (sbc_base + 0x200) -#define OPL3_BOTH (sbc_base + 0x800) -#else -#define DSP_RESET (sbc_base + 0x6) -#define DSP_READ (sbc_base + 0xA) -#define DSP_WRITE (sbc_base + 0xC) -#define DSP_COMMAND (sbc_base + 0xC) -#define DSP_STATUS (sbc_base + 0xC) -#define DSP_DATA_AVAIL (sbc_base + 0xE) -#define DSP_DATA_AVL16 (sbc_base + 0xF) -#define MIXER_ADDR (sbc_base + 0x4) -#define MIXER_DATA (sbc_base + 0x5) -#define OPL3_LEFT (sbc_base + 0x0) -#define OPL3_RIGHT (sbc_base + 0x2) -#define OPL3_BOTH (sbc_base + 0x8) -#endif -/* DSP Commands */ - -#define DSP_CMD_SPKON 0xD1 -#define DSP_CMD_SPKOFF 0xD3 -#define DSP_CMD_DMAON 0xD0 -#define DSP_CMD_DMAOFF 0xD4 - -#define IMODE_NONE 0 -#define IMODE_OUTPUT 1 -#define IMODE_INPUT 2 -#define IMODE_INIT 3 -#define IMODE_MIDI 4 - -#define NORMAL_MIDI 0 -#define UART_MIDI 1 - diff --git a/sys/dev/sound/isa/i386/sb/sb_dsp.c b/sys/dev/sound/isa/i386/sb/sb_dsp.c deleted file mode 100644 index 3b1bbc17d6..0000000000 --- a/sys/dev/sound/isa/i386/sb/sb_dsp.c +++ /dev/null @@ -1,1156 +0,0 @@ -/* - * sound/sb_dsp.c - * - * The low level driver for the SoundBlaster DSP chip (SB1.0 to 2.1, SB Pro). - * - * Copyright by Hannu Savolainen 1994 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * Modified: Hunyue Yau Jan 6 1994 Added code to support Sound Galaxy NX - * Pro - * - * JRA Gibson April 1995 Code added for MV ProSonic/Jazz 16 in 16 bit mode - * - * $FreeBSD: src/sys/i386/isa/sound/sb_dsp.c,v 1.42 1999/12/27 04:37:19 tanimura Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/sb/Attic/sb_dsp.c,v 1.3 2003/08/07 21:17:12 dillon Exp $ - */ - -#include - -#if (NSB > 0) - -#ifdef SM_WAVE -#define JAZZ16 -#endif - -#include -#include "sb_mixer.h" -#include - -#undef SB_TEST_IRQ - -/* - * XXX note -- only one sb-like device is supported until these - * variables are put in a struct sb_unit[] array - */ - - - -int sbc_base = 0; -static int sbc_irq = 0; -static int open_mode = 0; /* Read, write or both */ -int Jazz16_detected = 0; -int sb_no_recording = 0; -static int dsp_count = 0; -static int trigger_bits; - -/* - * The DSP channel can be used either for input or output. Variable - * 'sb_irq_mode' will be set when the program calls read or write first time - * after open. Current version doesn't support mode changes without closing - * and reopening the device. Support for this feature may be implemented in a - * future version of this driver. - */ - -int sb_dsp_ok = 0; /* Set to 1 after successful init */ -static int midi_disabled = 0; -int sb_dsp_highspeed = 0; -int sbc_major = 1, sbc_minor = 0; /* DSP version */ -static int dsp_stereo = 0; -static int dsp_current_speed = DSP_DEFAULT_SPEED; -static int sb16 = 0; - -int sb_midi_mode = NORMAL_MIDI; -int sb_midi_busy = 0; /* 1 if the process has output to * * - * MIDI */ -int sb_dsp_busy = 0; - -volatile int sb_irq_mode = IMODE_NONE; /* or IMODE_INPUT or IMODE_OUTPUT */ - -static int dma8 = 1; - -#ifdef JAZZ16 /* 16 bit support for JAZZ16 */ - -static int dsp_16bit = 0; -static int dma16 = 5; - -static int dsp_set_bits(int arg); -static int initialize_ProSonic16(void); -#endif /* end of 16 bit support for JAZZ16 */ - -int sb_duplex_midi = 0; -static int my_dev = 0; - -volatile int sb_intr_active = 0; - -static int dsp_speed(int); -static int dsp_set_stereo(int mode); -static void sb_dsp_reset(int dev); -sound_os_info *sb_osp = NULL; - -#if defined(CONFIG_MIDI) || defined(CONFIG_AUDIO) -static void dsp_speaker(char state); - -/* - * Common code for the midi and pcm functions - */ - -int -sb_dsp_command(u_char val) -{ - int i; - u_long limit; - - limit = get_time() + hz / 10; /* The timeout is 0.1 secods */ - - /* - * Note! the i<500000 is an emergency exit. The sb_dsp_command() is - * sometimes called while interrupts are disabled. This means that - * the timer is disabled also. However the timeout situation is a - * abnormal condition. Normally the DSP should be ready to accept - * commands after just couple of loops. - */ - - for (i = 0; i < 500000 && get_time() < limit; i++) { - if ((inb(DSP_STATUS) & 0x80) == 0) { - outb(DSP_COMMAND, val); - return 1; - } - } - - printf("SoundBlaster: DSP Command(0x%02x) timeout. IRQ conflict ?\n", val); - return 0; -} - -void -sbintr(int irq) -{ - int status; - -#ifdef CONFIG_SBPRO - if (sb16) { - u_char src = sb_getmixer(IRQ_STAT); /* Interrupt source register */ -#ifdef CONFIG_SB16 - if (src & 3) - sb16_dsp_interrupt(irq); -#ifdef CONFIG_MIDI - if (src & 4) - sb16midiintr(irq); /* SB MPU401 interrupt */ -#endif /* CONFIG_MIDI */ -#endif /* CONFIG_SB16 */ - if (!(src & 1)) - return; /* Not a DSP interupt */ - } -#endif /* CONFIG_SBPRO */ - - status = inb(DSP_DATA_AVAIL); /* Clear interrupt */ - - if (sb_intr_active) - switch (sb_irq_mode) { - case IMODE_OUTPUT: - sb_intr_active = 0; - DMAbuf_outputintr(my_dev, 1); - break; - - case IMODE_INPUT: - sb_intr_active = 0; - DMAbuf_inputintr(my_dev); - /* - * A complete buffer has been input. Let's start new one - */ - break; - - case IMODE_INIT: - sb_intr_active = 0; - break; - - case IMODE_MIDI: -#ifdef CONFIG_MIDI - sb_midi_interrupt(irq); -#endif - break; - - default: - printf("SoundBlaster: Unexpected interrupt\n"); - } -} - - -int -sb_reset_dsp(void) -{ - int loopc; - - outb(DSP_RESET, 1); - DELAY(10); - outb(DSP_RESET, 0); - DELAY(30); - - - for (loopc = 0; loopc < 100 && !(inb(DSP_DATA_AVAIL) & 0x80); loopc++) - DELAY(10); - - if (inb(DSP_READ) != 0xAA) { - printf("sb_reset_dsp failed\n"); - return 0; /* Sorry */ - } - - return 1; -} - -#endif - -#ifdef CONFIG_AUDIO - -static void -dsp_speaker(char state) -{ - if (state) - sb_dsp_command(DSP_CMD_SPKON); - else - sb_dsp_command(DSP_CMD_SPKOFF); -} - -static int -dsp_speed(int speed) -{ - u_char tconst; - u_long flags; - int max_speed = 44100; - - if (speed < 4000) - speed = 4000; - - /* - * Older SB models don't support higher speeds than 22050. - */ - - if (sbc_major < 2 || (sbc_major == 2 && sbc_minor == 0)) - max_speed = 22050; - - /* - * SB models earlier than SB Pro have low limit for the input speed. - */ - if (open_mode != OPEN_WRITE) { /* Recording is possible */ - if (sbc_major < 3) { /* Limited input speed with these cards */ - if (sbc_major == 2 && sbc_minor > 0) - max_speed = 15000; - else - max_speed = 13000; - } - } - if (speed > max_speed) - speed = max_speed; /* Invalid speed */ - - /* - * Logitech SoundMan Games and Jazz16 cards can support 44.1kHz - * stereo - */ -#if !defined (SM_GAMES) - /* - * Max. stereo speed is 22050 - */ - if (dsp_stereo && speed > 22050 && Jazz16_detected == 0) - speed = 22050; -#endif - - if ((speed > 22050) && sb_midi_busy) { - printf("SB Warning: High speed DSP not possible simultaneously with MIDI output\n"); - speed = 22050; - } - if (dsp_stereo) - speed *= 2; - - /* - * Now the speed should be valid - */ - - if (speed > 22050) { /* High speed mode */ - int tmp; - - tconst = (u_char) ((65536 - ((256000000 + speed / 2) / speed)) >> 8); - sb_dsp_highspeed = 1; - - flags = splhigh(); - if (sb_dsp_command(DSP_CMD_TCONST)) - sb_dsp_command(tconst); - splx(flags); - - tmp = 65536 - (tconst << 8); - speed = (256000000 + tmp / 2) / tmp; - } else { - int tmp; - - sb_dsp_highspeed = 0; - tconst = (256 - ((1000000 + speed / 2) / speed)) & 0xff; - - flags = splhigh(); - if (sb_dsp_command(DSP_CMD_TCONST)) /* Set time constant */ - sb_dsp_command(tconst); - splx(flags); - - tmp = 256 - tconst; - speed = (1000000 + tmp / 2) / tmp; - } - - if (dsp_stereo) - speed /= 2; - - dsp_current_speed = speed; - return speed; -} - -static int -dsp_set_stereo(int mode) -{ - dsp_stereo = 0; - -#ifndef CONFIG_SBPRO - return 0; -#else - if (sbc_major < 3 || sb16) - return 0; /* Sorry no stereo */ - - if (mode && sb_midi_busy) { - printf("SB Warning: Stereo DSP not possible simultaneously with MIDI output\n"); - return 0; - } - dsp_stereo = !!mode; - return dsp_stereo; -#endif -} - -static void -sb_dsp_output_block(int dev, u_long buf, int count, - int intrflag, int restart_dma) -{ - u_long flags; - - if (!sb_irq_mode) - dsp_speaker(ON); - - DMAbuf_start_dma(dev, buf, count, 1); - - sb_irq_mode = 0; - - if (audio_devs[dev]->dmachan1 > 3) - count >>= 1; - count--; - dsp_count = count; - - sb_irq_mode = IMODE_OUTPUT; - if (sb_dsp_highspeed) { - flags = splhigh(); - if (sb_dsp_command(DSP_CMD_HSSIZE)) { /* High speed size */ - sb_dsp_command((u_char) (dsp_count & 0xff)); - sb_dsp_command((u_char) ((dsp_count >> 8) & 0xff)); - sb_dsp_command(DSP_CMD_HSDAC); /* High speed 8 bit DAC */ - } else - printf("SB Error: Unable to start (high speed) DAC\n"); - splx(flags); - } else { - flags = splhigh(); - if (sb_dsp_command(DSP_CMD_DAC8)) { /* 8-bit DAC (DMA) */ - sb_dsp_command((u_char) (dsp_count & 0xff)); - sb_dsp_command((u_char) ((dsp_count >> 8) & 0xff)); - } else - printf("SB Error: Unable to start DAC\n"); - splx(flags); - } - sb_intr_active = 1; -} - -static void -sb_dsp_start_input(int dev, u_long buf, int count, int intrflag, - int restart_dma) -{ - u_long flags; - - if (sb_no_recording) { - printf("SB Error: This device doesn't support recording\n"); - return; - } - /* - * Start a DMA input to the buffer pointed by dmaqtail - */ - - if (!sb_irq_mode) - dsp_speaker(OFF); - - DMAbuf_start_dma(dev, buf, count, 0); - sb_irq_mode = 0; - - if (audio_devs[dev]->dmachan1 > 3) - count >>= 1; - count--; - dsp_count = count; - - sb_irq_mode = IMODE_INPUT; - if (sb_dsp_highspeed) { - flags = splhigh(); - if (sb_dsp_command(DSP_CMD_HSSIZE)) { /* High speed size */ - sb_dsp_command((u_char) (dsp_count & 0xff)); - sb_dsp_command((u_char) ((dsp_count >> 8) & 0xff)); - sb_dsp_command(DSP_CMD_HSADC); /* High speed 8 bit ADC */ - } else - printf("SB Error: Unable to start (high speed) ADC\n"); - splx(flags); - } else { - flags = splhigh(); - if (sb_dsp_command(DSP_CMD_ADC8)) { /* 8-bit ADC (DMA) */ - sb_dsp_command((u_char) (dsp_count & 0xff)); - sb_dsp_command((u_char) ((dsp_count >> 8) & 0xff)); - } else - printf("SB Error: Unable to start ADC\n"); - splx(flags); - } - - sb_intr_active = 1; -} - -static void -sb_dsp_trigger(int dev, int bits) -{ - if (bits == trigger_bits) - return; - - if (!bits) - sb_dsp_command(0xd0); /* Halt DMA */ - else if (bits & sb_irq_mode) - sb_dsp_command(0xd4); /* Continue DMA */ - - trigger_bits = bits; -} - -static void -dsp_cleanup(void) -{ - sb_intr_active = 0; -} - -static int -sb_dsp_prepare_for_input(int dev, int bsize, int bcount) -{ - int fudge = -1; - struct dma_buffparms *dmap = audio_devs[dev]->dmap_in; - - dsp_cleanup(); - dsp_speaker(OFF); - - if (sbc_major == 3) { /* SB Pro */ -#ifdef JAZZ16 - /* - * Select correct dma channel for 16/8 bit acccess - */ - audio_devs[my_dev]->dmachan1 = dsp_16bit ? dma16 : dma8; - if (dsp_stereo) - sb_dsp_command(dsp_16bit ? 0xac : 0xa8); - else - sb_dsp_command(dsp_16bit ? 0xa4 : 0xa0); -#else - /* - * 8 bit only cards use this - */ - if (dsp_stereo) - sb_dsp_command(0xa8); - else - sb_dsp_command(0xa0); -#endif - dsp_speed(dsp_current_speed); /* Speed must be recalculated - * if #channels * changes */ - } - - fudge = audio_devs[my_dev]->dmachan1; - if (dmap->dma_chan != fudge ) { - isa_dma_release( dmap->dma_chan); - isa_dma_acquire(fudge); - dmap->dma_chan = fudge; - } - - trigger_bits = 0; - sb_dsp_command(DSP_CMD_DMAHALT); /* Halt DMA */ - return 0; -} - -static int -sb_dsp_prepare_for_output(int dev, int bsize, int bcount) -{ - - int fudge; - struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; - - dsp_cleanup(); - dsp_speaker(ON); - -#ifdef CONFIG_SBPRO - if (sbc_major == 3) { /* SB Pro */ -#ifdef JAZZ16 - /* - * 16 bit specific instructions - */ - audio_devs[my_dev]->dmachan1 = dsp_16bit ? dma16 : dma8; - - if (Jazz16_detected != 2) /* SM Wave */ - sb_mixer_set_stereo(dsp_stereo); - if (dsp_stereo) - sb_dsp_command(dsp_16bit ? 0xac : 0xa8); - else - sb_dsp_command(dsp_16bit ? 0xa4 : 0xa0); -#else - sb_mixer_set_stereo(dsp_stereo); -#endif - dsp_speed(dsp_current_speed); /* Speed must be recalculated - * if #channels * changes */ - } -#endif - fudge = audio_devs[my_dev]->dmachan1; - - if (dmap->dma_chan != fudge ) { - isa_dma_release( dmap->dma_chan); - isa_dma_acquire(fudge); - dmap->dma_chan = fudge; - } - - trigger_bits = 0; - sb_dsp_command(DSP_CMD_DMAHALT); /* Halt DMA */ - return 0; -} - -static void -sb_dsp_halt_xfer(int dev) -{ -} - -static int -sb_dsp_open(int dev, int mode) -{ - if (!sb_dsp_ok) { - printf("SB Error: SoundBlaster board not installed\n"); - return -(ENXIO); - } - if (sb_no_recording && mode & OPEN_READ) { - printf("SB Warning: Recording not supported by this device\n"); - } - if (sb_intr_active || (sb_midi_busy && sb_midi_mode == UART_MIDI)) { - printf("SB: PCM not possible during MIDI input\n"); - return -(EBUSY); - } - /* - * Allocate 8 bit dma - */ -#ifdef JAZZ16 - audio_devs[my_dev]->dmachan1 = dma8; - /* - * Allocate 16 bit dma - */ - if (Jazz16_detected != 0) - if (dma16 != dma8) { - if (0) { - return -(EBUSY); - } - } -#endif - - sb_irq_mode = IMODE_NONE; - - sb_dsp_busy = 1; - open_mode = mode; - - - return 0; -} - -static void -sb_dsp_close(int dev) -{ -#ifdef JAZZ16 - /* - * Release 16 bit dma channel - */ - if (Jazz16_detected) { - audio_devs[my_dev]->dmachan1 = dma8; - - } -#endif - - dsp_cleanup(); - dsp_speaker(OFF); - sb_dsp_busy = 0; - sb_dsp_highspeed = 0; - open_mode = 0; - -} - -#ifdef JAZZ16 -/* - * Function dsp_set_bits() only required for 16 bit cards - */ -static int -dsp_set_bits(int arg) -{ - if (arg) - if (Jazz16_detected == 0) - dsp_16bit = 0; - else - switch (arg) { - case 8: - dsp_16bit = 0; - break; - case 16: - dsp_16bit = 1; - break; - default: - dsp_16bit = 0; - } - return dsp_16bit ? 16 : 8; -} - -#endif /* ifdef JAZZ16 */ - -static int -sb_dsp_ioctl(int dev, u_int cmd, ioctl_arg arg, int local) -{ - switch (cmd) { - case SOUND_PCM_WRITE_RATE: - if (local) - return dsp_speed((int) arg); - return *(int *) arg = dsp_speed((*(int *) arg)); - break; - - case SOUND_PCM_READ_RATE: - if (local) - return dsp_current_speed; - return *(int *) arg = dsp_current_speed; - break; - - case SOUND_PCM_WRITE_CHANNELS: - if (local) - return dsp_set_stereo((int) arg - 1) + 1; - return *(int *) arg = dsp_set_stereo((*(int *) arg) - 1) + 1; - break; - - case SOUND_PCM_READ_CHANNELS: - if (local) - return dsp_stereo + 1; - return *(int *) arg = dsp_stereo + 1; - break; - - case SNDCTL_DSP_STEREO: - if (local) - return dsp_set_stereo((int) arg); - return *(int *) arg = dsp_set_stereo((*(int *) arg)); - break; - -#ifdef JAZZ16 - /* - * Word size specific cases here. - * SNDCTL_DSP_SETFMT=SOUND_PCM_WRITE_BITS - */ - case SNDCTL_DSP_SETFMT: - if (local) - return dsp_set_bits((int) arg); - return *(int *) arg = dsp_set_bits((*(int *) arg)); - break; - - case SOUND_PCM_READ_BITS: - if (local) - return dsp_16bit ? 16 : 8; - return *(int *) arg = dsp_16bit ? 16 : 8; - break; -#else - case SOUND_PCM_WRITE_BITS: - case SOUND_PCM_READ_BITS: - if (local) - return 8; - return *(int *) (int) arg = 8; /* Only 8 bits/sample supported */ - break; -#endif /* ifdef JAZZ16 */ - - case SOUND_PCM_WRITE_FILTER: - case SOUND_PCM_READ_FILTER: - return -(EINVAL); - break; - - default:; - } - - return -(EINVAL); -} - -static void -sb_dsp_reset(int dev) -{ - u_long flags; - - flags = splhigh(); - - sb_reset_dsp(); - dsp_speed(dsp_current_speed); - dsp_cleanup(); - - splx(flags); -} - -#endif - - -#ifdef JAZZ16 - -/* - * Initialization of a Media Vision ProSonic 16 Soundcard. The function - * initializes a ProSonic 16 like PROS.EXE does for DOS. It sets the base - * address, the DMA-channels, interrupts and enables the joystickport. - * - * Also used by Jazz 16 (same card, different name) - * - * written 1994 by Rainer Vranken E-Mail: - * rvranken@polaris.informatik.uni-essen.de - */ - -u_int -get_sb_byte(void) -{ - int i; - - for (i = 1000; i; i--) - if (inb(DSP_DATA_AVAIL) & 0x80) { - return inb(DSP_READ); - } - return 0xffff; -} - -#ifdef SM_WAVE -/* - * Logitech Soundman Wave detection and initialization by Hannu Savolainen. - * - * There is a microcontroller (8031) in the SM Wave card for MIDI emulation. - * it's located at address MPU_BASE+4. MPU_BASE+7 is a SM Wave specific - * control register for MC reset, SCSI, OPL4 and DSP (future expansion) - * address decoding. Otherwise the SM Wave is just a ordinary MV Jazz16 based - * soundcard. - */ - -static void -smw_putmem(int base, int addr, u_char val) -{ - u_long flags; - - flags = splhigh(); - - outb(base + 1, addr & 0xff); /* Low address bits */ - outb(base + 2, addr >> 8); /* High address bits */ - outb(base, val); /* Data */ - - splx(flags); -} - -static u_char -smw_getmem(int base, int addr) -{ - u_long flags; - u_char val; - - flags = splhigh(); - - outb(base + 1, addr & 0xff); /* Low address bits */ - outb(base + 2, addr >> 8); /* High address bits */ - val = inb(base); /* Data */ - - splx(flags); - return val; -} - -#ifdef SMW_MIDI0001_INCLUDED -#include -#else -u_char *smw_ucode = NULL; -int smw_ucodeLen = 0; - -#endif - -static int -initialize_smw(int mpu_base) -{ - - int mp_base = mpu_base + 4; /* Microcontroller base */ - int i; - u_char control; - - - /* - * Reset the microcontroller so that the RAM can be accessed - */ - - control = inb(mpu_base + 7); - outb(mpu_base + 7, control | 3); /* Set last two bits to 1 (?) */ - outb(mpu_base + 7, (control & 0xfe) | 2); /* xxxxxxx0 resets the mc */ - DELAY(3000); /* Wait at least 1ms */ - - outb(mpu_base + 7, control & 0xfc); /* xxxxxx00 enables RAM */ - - /* - * Detect microcontroller by probing the 8k RAM area - */ - smw_putmem(mp_base, 0, 0x00); - smw_putmem(mp_base, 1, 0xff); - DELAY(10); - - if (smw_getmem(mp_base, 0) != 0x00 || smw_getmem(mp_base, 1) != 0xff) { - printf("\nSM Wave: No microcontroller RAM detected (%02x, %02x)\n", - smw_getmem(mp_base, 0), smw_getmem(mp_base, 1)); - return 0; /* No RAM */ - } - /* - * There is RAM so assume it's really a SM Wave - */ - - if (smw_ucodeLen > 0) { - if (smw_ucodeLen != 8192) { - printf("\nSM Wave: Invalid microcode (MIDI0001.BIN) length\n"); - return 1; - } - /* - * Download microcode - */ - - for (i = 0; i < 8192; i++) - smw_putmem(mp_base, i, smw_ucode[i]); - - /* - * Verify microcode - */ - - for (i = 0; i < 8192; i++) - if (smw_getmem(mp_base, i) != smw_ucode[i]) { - printf("SM Wave: Microcode verification failed\n"); - return 0; - } - } - control = 0; -#ifdef SMW_SCSI_IRQ - /* - * Set the SCSI interrupt (IRQ2/9, IRQ3 or IRQ10). The SCSI interrupt - * is disabled by default. - * - * Btw the Zilog 5380 SCSI controller is located at MPU base + 0x10. - */ - { - static u_char scsi_irq_bits[] = - {0, 0, 3, 1, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 0}; - - control |= scsi_irq_bits[SMW_SCSI_IRQ] << 6; - } -#endif - -#ifdef SMW_OPL4_ENABLE - /* - * Make the OPL4 chip visible on the PC bus at 0x380. - * - * There is no need to enable this feature since VoxWare doesn't support - * OPL4 yet. Also there is no RAM in SM Wave so enabling OPL4 is - * pretty useless. - */ - control |= 0x10; /* Uses IRQ12 if bit 0x20 == 0 */ - /* control |= 0x20; Uncomment this if you want to use IRQ7 */ -#endif - - outb(mpu_base + 7, control | 0x03); /* xxxxxx11 restarts */ - return 1; -} - -#endif - -static int -initialize_ProSonic16(void) -{ - int x; - static u_char int_translat[16] = - {0, 0, 2, 3, 0, 1, 0, 4, 0, 2, 5, 0, 0, 0, 0, 6}, - dma_translat[8] = - {0, 1, 0, 2, 0, 3, 0, 4}; - - struct address_info *mpu_config; - - int mpu_base, mpu_irq; - - if ((mpu_config = sound_getconf(SNDCARD_MPU401))) { - mpu_base = mpu_config->io_base; - mpu_irq = mpu_config->irq; - } else { - mpu_base = mpu_irq = 0; - } - - outb(0x201, 0xAF); /* ProSonic/Jazz16 wakeup */ - DELAY(15000); /* wait at least 10 milliseconds */ - outb(0x201, 0x50); - outb(0x201, (sbc_base & 0x70) | ((mpu_base & 0x30) >> 4)); - - if (sb_reset_dsp()) { /* OK. We have at least a SB */ - - /* Check the version number of ProSonic (I guess) */ - - if (!sb_dsp_command(0xFA)) - return 1; - if (get_sb_byte() != 0x12) - return 1; - - if (sb_dsp_command(0xFB) && /* set DMA-channels and Interrupts */ - sb_dsp_command((dma_translat[JAZZ_DMA16]<<4)|dma_translat[dma8]) && - sb_dsp_command((int_translat[mpu_irq]<<4)|int_translat[sbc_irq])) { - Jazz16_detected = 1; - if (mpu_base == 0) - printf("Jazz16: No MPU401 devices configured - MIDI port not initialized\n"); - -#ifdef SM_WAVE - if (mpu_base != 0) - if (initialize_smw(mpu_base)) - Jazz16_detected = 2; -#endif - sb_dsp_disable_midi(); - } - return 1; /* There was at least a SB */ - } - return 0; /* No SB or ProSonic16 detected */ -} - -#endif /* ifdef JAZZ16 */ - -int -sb_dsp_detect(struct address_info * hw_config) -{ - sbc_base = hw_config->io_base; - sbc_irq = hw_config->irq; - sb_osp = hw_config->osp; - - - if (sb_dsp_ok) - return 0; /* Already initialized */ - dma8 = hw_config->dma; - -#ifdef JAZZ16 - dma16 = JAZZ_DMA16; - - if (!initialize_ProSonic16()) - return 0; -#else - if (!sb_reset_dsp()) - return 0; -#endif -#ifdef PC98 - switch (sbc_irq) { - case 3: - sb_setmixer (IRQ_NR, 1); - break; - case 5: - sb_setmixer (IRQ_NR, 8); - break; - case 10: - sb_setmixer (IRQ_NR, 2); - break; - } - switch (hw_config->dma) { - case 0: - sb_setmixer (DMA_NR, 1); - break; - case 3: - sb_setmixer (DMA_NR, 2); - break; - } -#endif - - return 1; /* Detected */ -} - -#ifdef CONFIG_AUDIO -static struct audio_operations sb_dsp_operations = -{ - "SoundBlaster", - NOTHING_SPECIAL, - AFMT_U8, /* Just 8 bits. Poor old SB */ - NULL, - sb_dsp_open, - sb_dsp_close, - sb_dsp_output_block, - sb_dsp_start_input, - sb_dsp_ioctl, - sb_dsp_prepare_for_input, - sb_dsp_prepare_for_output, - sb_dsp_reset, - sb_dsp_halt_xfer, - NULL, /* local_qlen */ - NULL, /* copy_from_user */ - NULL, - NULL, - sb_dsp_trigger -}; - -#endif - -void -sb_dsp_init(struct address_info * hw_config) -{ - int i; - char *fmt = NULL ; - -#ifdef CONFIG_SBPRO - int mixer_type = 0; - -#endif - - sb_osp = hw_config->osp; - sbc_major = sbc_minor = 0; - sb_dsp_command(DSP_CMD_GETVER); /* Get version */ - - for (i = 10000; i; i--) { /* perhaps wait longer on a fast machine ? */ - if (inb(DSP_DATA_AVAIL) & 0x80) { /* wait for Data Ready */ - if (sbc_major == 0) - sbc_major = inb(DSP_READ); - else { - sbc_minor = inb(DSP_READ); - break; - } - } else - DELAY(20); - } - - if (sbc_major == 0) { - printf("\n\nFailed to get SB version (%x) - possible I/O conflict\n\n", - inb(DSP_DATA_AVAIL)); - sbc_major = 1; - } - if (sbc_major == 2 || sbc_major == 3) - sb_duplex_midi = 1; - - if (sbc_major == 4) - sb16 = 1; - - if (sbc_major == 3 && sbc_minor == 1) { - int ess_major = 0, ess_minor = 0; - - /* - * Try to detect ESS chips. - */ - - sb_dsp_command(DSP_CMD_GETID); /* Return identification bytes. */ - - for (i = 1000; i; i--) { - if (inb(DSP_DATA_AVAIL) & 0x80) { /* wait for Data Ready */ - if (ess_major == 0) - ess_major = inb(DSP_READ); - else { - ess_minor = inb(DSP_READ); - break; - } - } - } - - if (ess_major == 0x48 && (ess_minor & 0xf0) == 0x80) - printf("Hmm... Could this be an ESS488 based card (rev %d)\n", - ess_minor & 0x0f); - else if (ess_major == 0x68 && (ess_minor & 0xf0) == 0x80) - printf("Hmm... Could this be an ESS688 based card (rev %d)\n", - ess_minor & 0x0f); - } - if (snd_set_irq_handler(sbc_irq, sbintr, sb_osp) < 0) - printf("sb_dsp: Can't allocate IRQ\n");; - -#ifdef CONFIG_SBPRO - if (sbc_major >= 3) - mixer_type = sb_mixer_init(sbc_major); -#else - if (sbc_major >= 3) - printf("\nNOTE! SB Pro support required with your soundcard!\n"); -#endif - - -#ifdef CONFIG_AUDIO - if (sbc_major >= 3) { - if (Jazz16_detected) { - if (Jazz16_detected == 2) - fmt = "SoundMan Wave %d.%d"; - else - fmt = "MV Jazz16 %d.%d"; - sb_dsp_operations.format_mask |= AFMT_S16_LE; /* 16 bits */ - } else -#ifdef __SGNXPRO__ - if (mixer_type == 2) - fmt = "Sound Galaxy NX Pro %d.%d" ; - else -#endif /* __SGNXPRO__ */ - if (sbc_major == 4) - fmt = "SoundBlaster 16 %d.%d"; - else - fmt = "SoundBlaster Pro %d.%d"; - } else { - fmt = "SoundBlaster %d.%d" ; - } - - snprintf(sb_dsp_operations.name, sizeof(sb_dsp_operations.name), - fmt, sbc_major, sbc_minor); - conf_printf(sb_dsp_operations.name, hw_config); - -#if defined(CONFIG_SB16) && defined(CONFIG_SBPRO) - if (!sb16) { /* There is a better driver for SB16 */ -#endif /* CONFIG_SB16 && CONFIG_SBPRO */ - if (num_audiodevs < MAX_AUDIO_DEV) { - audio_devs[my_dev = num_audiodevs++] = &sb_dsp_operations; - audio_devs[my_dev]->buffsize = DSP_BUFFSIZE; - dma8 = audio_devs[my_dev]->dmachan1 = hw_config->dma; - audio_devs[my_dev]->dmachan2 = -1; -#ifdef JAZZ16 - /* - * Allocate 16 bit dma - */ - if (Jazz16_detected != 0) - if (dma16 != dma8) { - if (0) { - printf("Jazz16: Can't allocate 16 bit DMA channel\n"); - } - } -#endif /* JAZZ16 */ - } else - printf("SB: Too many DSP devices available\n"); -#if defined(CONFIG_SB16) && defined(CONFIG_SBPRO) - } -#endif /* CONFIG_SB16 && CONFIG_SBPRO */ -#else - conf_printf("SoundBlaster (configured without audio support)", hw_config); -#endif - -#ifdef CONFIG_MIDI - if (!midi_disabled && !sb16) { - /* - * Midi don't work in the SB emulation mode of PAS, - * SB16 has better midi interface - */ - sb_midi_init(sbc_major); - } -#endif /* CONFIG_MIDI */ - sb_dsp_ok = 1; -} - -void -sb_dsp_disable_midi(void) -{ - midi_disabled = 1; -} -#endif diff --git a/sys/dev/sound/isa/i386/sb/sb_midi.c b/sys/dev/sound/isa/i386/sb/sb_midi.c deleted file mode 100644 index 3d773bedee..0000000000 --- a/sys/dev/sound/isa/i386/sb/sb_midi.c +++ /dev/null @@ -1,211 +0,0 @@ -/* - * sound/sb_dsp.c - * - * The low level driver for the SoundBlaster DS chips. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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 - -#if (NSND > 0) && defined(CONFIG_SB) && defined(CONFIG_MIDI) - -#include -#undef SB_TEST_IRQ - -/* - * The DSP channel can be used either for input or output. Variable - * 'sb_irq_mode' will be set when the program calls read or write first time - * after open. Current version doesn't support mode changes without closing - * and reopening the device. Support for this feature may be implemented in a - * future version of this driver. - */ - -extern int sb_dsp_ok; /* Set to 1 atfer successful initialization */ -extern int sbc_base; - -extern int sb_midi_mode; -extern int sb_midi_busy; /* 1 if the process has output to MIDI */ -extern int sb_dsp_busy; -extern int sb_dsp_highspeed; - -extern volatile int sb_irq_mode; -extern int sb_duplex_midi; -extern int sb_intr_active; -static int input_opened = 0; -static int my_dev; - -extern sound_os_info *sb_osp; - -static void (*midi_input_intr) (int dev, u_char data); - -static int -sb_midi_open(int dev, int mode, void (*input) (int dev, u_char data), - void (*output) (int dev)) -{ - int ret; - - if (!sb_dsp_ok) { - printf("SB Error: MIDI hardware not installed\n"); - return -(ENXIO); - } - if (sb_midi_busy) - return -(EBUSY); - - if (mode != OPEN_WRITE && !sb_duplex_midi) { - if (num_midis == 1) - printf("SoundBlaster: Midi input not currently supported\n"); - return -(EPERM); - } - sb_midi_mode = NORMAL_MIDI; - if (mode != OPEN_WRITE) { - if (sb_dsp_busy || sb_intr_active) - return -(EBUSY); - sb_midi_mode = UART_MIDI; - } - if (sb_dsp_highspeed) { - printf("SB Error: Midi output not possible during stereo or high speed audio\n"); - return -(EBUSY); - } - if (sb_midi_mode == UART_MIDI) { - sb_irq_mode = IMODE_MIDI; - - sb_reset_dsp(); - - if (!sb_dsp_command(0x35)) - return -(EIO); /* Enter the UART mode */ - sb_intr_active = 1; - - input_opened = 1; - midi_input_intr = input; - } - sb_midi_busy = 1; - - return 0; -} - -static void -sb_midi_close(int dev) -{ - if (sb_midi_mode == UART_MIDI) { - sb_reset_dsp(); /* The only way to kill the UART mode */ - } - sb_intr_active = 0; - sb_midi_busy = 0; - input_opened = 0; -} - -static int -sb_midi_out(int dev, u_char midi_byte) -{ - u_long flags; - - if (sb_midi_mode == NORMAL_MIDI) { - flags = splhigh(); - if (sb_dsp_command(0x38)) - sb_dsp_command(midi_byte); - else - printf("SB Error: Unable to send a MIDI byte\n"); - splx(flags); - } else - sb_dsp_command(midi_byte); /* UART write */ - - return 1; -} - -static int -sb_midi_start_read(int dev) -{ - if (sb_midi_mode != UART_MIDI) { - printf("SoundBlaster: MIDI input not implemented.\n"); - return -(EPERM); - } - return 0; -} - -static int -sb_midi_end_read(int dev) -{ - if (sb_midi_mode == UART_MIDI) { - sb_reset_dsp(); - sb_intr_active = 0; - } - return 0; -} - -static int -sb_midi_ioctl(int dev, u_int cmd, ioctl_arg arg) -{ - return -(EPERM); -} - -void -sb_midi_interrupt(int dummy) -{ - u_long flags; - u_char data; - - flags = splhigh(); - - data = inb(DSP_READ); - if (input_opened) - midi_input_intr(my_dev, data); - - splx(flags); -} - -#define MIDI_SYNTH_NAME "SoundBlaster Midi" -#define MIDI_SYNTH_CAPS 0 -#include - -static struct midi_operations sb_midi_operations = -{ - {"SoundBlaster", 0, 0, SNDCARD_SB}, - &std_midi_synth, - {0}, - sb_midi_open, - sb_midi_close, - sb_midi_ioctl, - sb_midi_out, - sb_midi_start_read, - sb_midi_end_read, - NULL, /* Kick */ - NULL, /* command */ - NULL, /* buffer_status */ - NULL -}; - -void -sb_midi_init(int model) -{ - if (num_midis >= MAX_MIDI_DEV) { - printf("Sound: Too many midi devices detected\n"); - return; - } - std_midi_synth.midi_dev = num_midis; - my_dev = num_midis; - midi_devs[num_midis++] = &sb_midi_operations; -} - -#endif diff --git a/sys/dev/sound/isa/i386/sb/sb_mixer.c b/sys/dev/sound/isa/i386/sb/sb_mixer.c deleted file mode 100644 index dd2bf375ea..0000000000 --- a/sys/dev/sound/isa/i386/sb/sb_mixer.c +++ /dev/null @@ -1,530 +0,0 @@ -/* - * sound/sb_mixer.c - * - * The low level mixer driver for the SoundBlaster Pro and SB16 cards. - * - * Copyright by Hannu Savolainen 1994 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * Modified: Hunyue Yau Jan 6 1994 Added code to support the Sound Galaxy - * NX Pro mixer. - * - * $DragonFly: src/sys/dev/sound/isa/i386/sb/Attic/sb_mixer.c,v 1.2 2003/08/07 21:17:12 dillon Exp $ - */ - -#include - -#if (NSB > 0) && defined(CONFIG_SBPRO) -#define __SB_MIXER_C__ - -#include -#include "sb_mixer.h" -#undef SB_TEST_IRQ - -extern int sbc_base; -extern int Jazz16_detected; -extern sound_os_info *sb_osp; - -static int mixer_initialized = 0; - -static int supported_rec_devices; -static int supported_devices; -static int recmask = 0; -static int mixer_model; -static int mixer_caps; -static mixer_tab *iomap; - -void -sb_setmixer(u_int port, u_int value) -{ - u_long flags; - - flags = splhigh(); /* XXX ouch... */ - outb(MIXER_ADDR, (u_char) (port & 0xff)); /* Select register */ - DELAY(10); - outb(MIXER_DATA, (u_char) (value & 0xff)); - DELAY(10); - splx(flags); -} - -int -sb_getmixer(u_int port) -{ - int val; - u_long flags; - - flags = splhigh(); - outb(MIXER_ADDR, (u_char) (port & 0xff)); /* Select register */ - DELAY(10); - val = inb(MIXER_DATA); - DELAY(10); - splx(flags); - - return val; -} - -void -sb_mixer_set_stereo(int mode) -{ - if (!mixer_initialized) - return; - - sb_setmixer(OUT_FILTER, ((sb_getmixer(OUT_FILTER) & ~STEREO_DAC) - | (mode ? STEREO_DAC : MONO_DAC))); -} - -/* - * Returns: - * 0 No mixer detected. - * 1 Only a plain Sound Blaster Pro style mixer detected. - * 2 The Sound Galaxy NX Pro mixer detected. - */ -static int -detect_mixer(void) -{ - -#ifdef __SGNXPRO__ - int oldbass, oldtreble; - extern int sbc_major; -#endif - int retcode = 1; - - /* - * Detect the mixer by changing parameters of two volume channels. If - * the values read back match with the values written, the mixer is - * there (is it?) - */ - sb_setmixer(FM_VOL, 0xff); - sb_setmixer(VOC_VOL, 0x33); - - if (sb_getmixer(FM_VOL) != 0xff) - return 0; /* No match */ - if (sb_getmixer(VOC_VOL) != 0x33) - return 0; - -#ifdef __SGNXPRO__ - /* - * Attempt to detect the SG NX Pro by check for valid bass/treble - * registers. - */ - oldbass = sb_getmixer(BASS_LVL); - oldtreble = sb_getmixer(TREBLE_LVL); - - sb_setmixer(BASS_LVL, 0xaa); - sb_setmixer(TREBLE_LVL, 0x55); - - if ((sb_getmixer(BASS_LVL) != 0xaa) || - (sb_getmixer(TREBLE_LVL) != 0x55)) { - retcode = 1; /* 1 == Only SB Pro detected */ - } else - retcode = 2; /* 2 == SG NX Pro detected */ - /* - * Restore register in either case since SG NX Pro has EEPROM with - * 'preferred' values stored. - */ - sb_setmixer(BASS_LVL, oldbass); - sb_setmixer(TREBLE_LVL, oldtreble); - - /* - * If the SB version is 3.X (SB Pro), assume we have a SG NX Pro 16. - * In this case it's good idea to disable the Disney Sound Source - * compatibility mode. It's useless and just causes noise every time - * the LPT-port is accessed. - * - * Also place the card into WSS mode. - */ - if (sbc_major == 3) { - outb(sbc_base + 0x1c, 0x01); - outb(sbc_base + 0x1a, 0x00); - } -#endif - return retcode; -} - -static void -change_bits(u_char *regval, int dev, int chn, int newval) -{ - u_char mask; - int shift; - - mask = (1 << (*iomap)[dev][chn].nbits) - 1; - newval = (int) ((newval * mask) + 50) / 100; /* Scale it */ - - shift = (*iomap)[dev][chn].bitoffs - (*iomap)[dev][LEFT_CHN].nbits + 1; - - *regval &= ~(mask << shift); /* Filter out the previous value */ - *regval |= (newval & mask) << shift; /* Set the new value */ -} - -static int -sb_mixer_get(int dev) -{ - if (!((1 << dev) & supported_devices)) - return -(EINVAL); - - return levels[dev]; -} - -#ifdef JAZZ16 -static char smw_mix_regs[] =/* Left mixer registers */ -{ - 0x0b, /* SOUND_MIXER_VOLUME */ - 0x0d, /* SOUND_MIXER_BASS */ - 0x0d, /* SOUND_MIXER_TREBLE */ - 0x05, /* SOUND_MIXER_SYNTH */ - 0x09, /* SOUND_MIXER_PCM */ - 0x00, /* SOUND_MIXER_SPEAKER */ - 0x03, /* SOUND_MIXER_LINE */ - 0x01, /* SOUND_MIXER_MIC */ - 0x07, /* SOUND_MIXER_CD */ - 0x00, /* SOUND_MIXER_IMIX */ - 0x00, /* SOUND_MIXER_ALTPCM */ - 0x00, /* SOUND_MIXER_RECLEV */ - 0x00, /* SOUND_MIXER_IGAIN */ - 0x00, /* SOUND_MIXER_OGAIN */ - 0x00, /* SOUND_MIXER_LINE1 */ - 0x00, /* SOUND_MIXER_LINE2 */ - 0x00 /* SOUND_MIXER_LINE3 */ -}; - -static void -smw_mixer_init(void) -{ - int i; - - sb_setmixer(0x00, 0x18);/* Mute unused (Telephone) line */ - sb_setmixer(0x10, 0x38);/* Config register 2 */ - - supported_devices = 0; - for (i = 0; i < sizeof(smw_mix_regs); i++) - if (smw_mix_regs[i] != 0) - supported_devices |= (1 << i); - - supported_rec_devices = supported_devices & - ~(SOUND_MASK_BASS | SOUND_MASK_TREBLE | SOUND_MASK_PCM | - SOUND_MASK_VOLUME); -} - -static int -smw_mixer_set(int dev, int value) -{ - int left = value & 0x000000ff; - int right = (value & 0x0000ff00) >> 8; - int reg, val; - - if (left > 100) - left = 100; - if (right > 100) - right = 100; - - if (dev > 31) - return -(EINVAL); - - if (!(supported_devices & (1 << dev))) /* Not supported */ - return -(EINVAL); - - switch (dev) { - case SOUND_MIXER_VOLUME: - sb_setmixer(0x0b, 96 - (96 * left / 100)); /* 96=mute, 0=max */ - sb_setmixer(0x0c, 96 - (96 * right / 100)); - break; - - case SOUND_MIXER_BASS: - case SOUND_MIXER_TREBLE: - levels[dev] = left | (right << 8); - - /* Set left bass and treble values */ - val = ((levels[SOUND_MIXER_TREBLE] & 0xff) * 16 / 100) << 4; - val |= ((levels[SOUND_MIXER_BASS] & 0xff) * 16 / 100) & 0x0f; - sb_setmixer(0x0d, val); - - /* Set right bass and treble values */ - val = (((levels[SOUND_MIXER_TREBLE] >> 8) & 0xff) * 16 / 100) << 4; - val |= (((levels[SOUND_MIXER_BASS] >> 8) & 0xff) * 16 / 100) & 0x0f; - sb_setmixer(0x0e, val); - break; - - default: - reg = smw_mix_regs[dev]; - if (reg == 0) - return -(EINVAL); - sb_setmixer(reg, (24 - (24 * left / 100)) | 0x20); /* 24=mute, 0=max */ - sb_setmixer(reg + 1, (24 - (24 * right / 100)) | 0x40); - } - - levels[dev] = left | (right << 8); - return left | (right << 8); -} - -#endif - -static int -sb_mixer_set(int dev, int value) -{ - int left = value & 0x000000ff; - int right = (value & 0x0000ff00) >> 8; - - int regoffs; - u_char val; - -#ifdef JAZZ16 - if (Jazz16_detected == 2) - return smw_mixer_set(dev, value); -#endif - - if (left > 100) - left = 100; - if (right > 100) - right = 100; - - if (dev > 31) - return -(EINVAL); - - if (!(supported_devices & (1 << dev))) /* Not supported */ - return -(EINVAL); - - regoffs = (*iomap)[dev][LEFT_CHN].regno; - - if (regoffs == 0) - return -(EINVAL); - - val = sb_getmixer(regoffs); - change_bits(&val, dev, LEFT_CHN, left); - - levels[dev] = left | (left << 8); - - if ((*iomap)[dev][RIGHT_CHN].regno != regoffs) { /* Change register */ - sb_setmixer(regoffs, val); /* Save the old one */ - regoffs = (*iomap)[dev][RIGHT_CHN].regno; - - if (regoffs == 0) - return left | (left << 8); /* Just left channel present */ - - val = sb_getmixer(regoffs); /* Read the new one */ - } - change_bits(&val, dev, RIGHT_CHN, right); - - sb_setmixer(regoffs, val); - - levels[dev] = left | (right << 8); - return left | (right << 8); -} - -static void -set_recsrc(int src) -{ - sb_setmixer(RECORD_SRC, (sb_getmixer(RECORD_SRC) & ~7) | (src & 0x7)); -} - -static int -set_recmask(int mask) -{ - int devmask, i; - u_char regimageL, regimageR; - - devmask = mask & supported_rec_devices; - - switch (mixer_model) { - case 3: - - if (devmask != SOUND_MASK_MIC && devmask != SOUND_MASK_LINE && - devmask != SOUND_MASK_CD) { - /* - * More than one devices selected. Drop the previous - * selection - */ - devmask &= ~recmask; - } - if (devmask != SOUND_MASK_MIC && devmask != SOUND_MASK_LINE && - devmask != SOUND_MASK_CD) { - /* More than one devices selected. Default to mic */ - devmask = SOUND_MASK_MIC; - } - if (devmask ^ recmask) { /* Input source changed */ - switch (devmask) { - - case SOUND_MASK_MIC: - set_recsrc(SRC_MIC); - break; - - case SOUND_MASK_LINE: - set_recsrc(SRC_LINE); - break; - - case SOUND_MASK_CD: - set_recsrc(SRC_CD); - break; - - default: - set_recsrc(SRC_MIC); - } - } - break; - - case 4: - if (!devmask) - devmask = SOUND_MASK_MIC; - - regimageL = regimageR = 0; - for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) - if ((1 << i) & devmask) { - regimageL |= sb16_recmasks_L[i]; - regimageR |= sb16_recmasks_R[i]; - } - sb_setmixer(SB16_IMASK_L, regimageL); - sb_setmixer(SB16_IMASK_R, regimageR); - break; - } - - recmask = devmask; - return recmask; -} - -static int -sb_mixer_ioctl(int dev, u_int cmd, ioctl_arg arg) -{ - if (((cmd >> 8) & 0xff) == 'M') { - if (cmd & IOC_IN) - switch (cmd & 0xff) { - case SOUND_MIXER_RECSRC: - return *(int *) arg = set_recmask((*(int *) arg)); - break; - - default: - return *(int *) arg = sb_mixer_set(cmd & 0xff, (*(int *) arg)); - } - else - switch (cmd & 0xff) { /* Return parameters */ - - case SOUND_MIXER_RECSRC: - return *(int *) arg = recmask; - break; - - case SOUND_MIXER_DEVMASK: - return *(int *) arg = supported_devices; - break; - - case SOUND_MIXER_STEREODEVS: - if (Jazz16_detected) - return *(int *) arg = supported_devices; - else - return *(int *) arg = supported_devices & ~(SOUND_MASK_MIC | SOUND_MASK_SPEAKER); - break; - - case SOUND_MIXER_RECMASK: - return *(int *) arg = supported_rec_devices; - break; - - case SOUND_MIXER_CAPS: - return *(int *) arg = mixer_caps; - break; - - default: - return *(int *) arg = sb_mixer_get(cmd & 0xff); - } - } else - return -(EINVAL); -} - -static struct mixer_operations sb_mixer_operations = -{ - "SoundBlaster", - sb_mixer_ioctl -}; - -static void -sb_mixer_reset(void) -{ - int i; - - for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) - sb_mixer_set(i, levels[i]); - set_recmask(SOUND_MASK_MIC); -} - -/* - * Returns a code depending on whether a SG NX Pro was detected. 1 == Plain - * SB Pro 2 == SG NX Pro detected. 3 == SB16 - * - * Used to update message. - */ -int -sb_mixer_init(int major_model) -{ - int mixer_type = 0; - - sb_setmixer(0x00, 0); /* Reset mixer */ - - if (!(mixer_type = detect_mixer())) - return 0; /* No mixer. Why? */ - - mixer_initialized = 1; - mixer_model = major_model; - - switch (major_model) { - case 3: - mixer_caps = SOUND_CAP_EXCL_INPUT; - -#ifdef JAZZ16 - if (Jazz16_detected == 2) { /* SM Wave */ - supported_devices = 0; - supported_rec_devices = 0; - iomap = &sbpro_mix; - smw_mixer_init(); - mixer_type = 1; - } else -#endif -#ifdef __SGNXPRO__ - if (mixer_type == 2) { /* A SGNXPRO was detected */ - supported_devices = SGNXPRO_MIXER_DEVICES; - supported_rec_devices = SGNXPRO_RECORDING_DEVICES; - iomap = &sgnxpro_mix; - } else -#endif - { - supported_devices = SBPRO_MIXER_DEVICES; - supported_rec_devices = SBPRO_RECORDING_DEVICES; - iomap = &sbpro_mix; - mixer_type = 1; - } - break; - - case 4: - mixer_caps = 0; - supported_devices = SB16_MIXER_DEVICES; - supported_rec_devices = SB16_RECORDING_DEVICES; - iomap = &sb16_mix; - mixer_type = 3; - break; - - default: - printf("SB Warning: Unsupported mixer type\n"); - return 0; - } - - if (num_mixers < MAX_MIXER_DEV) - mixer_devs[num_mixers++] = &sb_mixer_operations; - sb_mixer_reset(); - return mixer_type; -} - -#endif diff --git a/sys/dev/sound/isa/i386/sb/sb_mixer.h b/sys/dev/sound/isa/i386/sb/sb_mixer.h deleted file mode 100644 index 155d6c78f4..0000000000 --- a/sys/dev/sound/isa/i386/sb/sb_mixer.h +++ /dev/null @@ -1,255 +0,0 @@ -/* - * sound/sb_mixer.h - * - * Definitions for the SB Pro and SB16 mixers - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * Modified: Hunyue Yau Jan 6 1994 Added defines for the Sound Galaxy NX Pro - * mixer. - * - */ - -#define SBPRO_RECORDING_DEVICES (SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD) - -/* Same as SB Pro, unless I find otherwise */ -#define SGNXPRO_RECORDING_DEVICES SBPRO_RECORDING_DEVICES - -#define SBPRO_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_LINE | SOUND_MASK_MIC | \ - SOUND_MASK_CD | SOUND_MASK_VOLUME) - -/* - * SG NX Pro has treble and bass settings on the mixer. The 'speaker' channel - * is the COVOX/DisneySoundSource emulation volume control on the mixer. It - * does NOT control speaker volume. Should have own mask eventually? - */ -#define SGNXPRO_MIXER_DEVICES (SBPRO_MIXER_DEVICES|SOUND_MASK_BASS| \ - SOUND_MASK_TREBLE|SOUND_MASK_SPEAKER ) - -#define SB16_RECORDING_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_LINE | SOUND_MASK_MIC | \ - SOUND_MASK_CD) - -#define SB16_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_SPEAKER | SOUND_MASK_LINE | SOUND_MASK_MIC | \ - SOUND_MASK_CD | \ - SOUND_MASK_IGAIN | SOUND_MASK_OGAIN | \ - SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE) - -/* - * Mixer registers - * - * NOTE! RECORD_SRC == IN_FILTER - */ - -/* - * Mixer registers of SB Pro - */ -#define VOC_VOL 0x04 -#define MIC_VOL 0x0A -#define MIC_MIX 0x0A -#define RECORD_SRC 0x0C -#define IN_FILTER 0x0C -#define OUT_FILTER 0x0E -#define MASTER_VOL 0x22 -#define FM_VOL 0x26 -#define CD_VOL 0x28 -#define LINE_VOL 0x2E -#define IRQ_NR 0x80 -#define DMA_NR 0x81 -#define IRQ_STAT 0x82 -#define OPSW 0x3c - -/* - * Additional registers on the SG NX Pro - */ -#define COVOX_VOL 0x42 -#define TREBLE_LVL 0x44 -#define BASS_LVL 0x46 - -#define FREQ_HI (1 << 3)/* Use High-frequency ANFI filters */ -#define FREQ_LOW 0 /* Use Low-frequency ANFI filters */ -#define FILT_ON 0 /* Yes, 0 to turn it on, 1 for off */ -#define FILT_OFF (1 << 5) - -#define MONO_DAC 0x00 -#define STEREO_DAC 0x02 - -/* - * Mixer registers of SB16 - */ -#define SB16_IMASK_L 0x3d -#define SB16_IMASK_R 0x3e - -#define LEFT_CHN 0 -#define RIGHT_CHN 1 - -struct mixer_def { - unsigned int regno:8; - unsigned int bitoffs:4; - unsigned int nbits:4; -}; - - -typedef struct mixer_def mixer_tab[32][2]; -typedef struct mixer_def mixer_ent; - -#define MIX_ENT(name, reg_l, bit_l, len_l, reg_r, bit_r, len_r) \ - {{reg_l, bit_l, len_l}, {reg_r, bit_r, len_r}} - -#ifdef __SB_MIXER_C__ -mixer_tab sbpro_mix = { - MIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4), - MIX_ENT(SOUND_MIXER_BASS, 0x00, 0, 0, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_TREBLE, 0x00, 0, 0, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_SYNTH, 0x26, 7, 4, 0x26, 3, 4), - MIX_ENT(SOUND_MIXER_PCM, 0x04, 7, 4, 0x04, 3, 4), - MIX_ENT(SOUND_MIXER_SPEAKER, 0x00, 0, 0, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_LINE, 0x2e, 7, 4, 0x2e, 3, 4), - MIX_ENT(SOUND_MIXER_MIC, 0x0a, 2, 3, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_CD, 0x28, 7, 4, 0x28, 3, 4), - MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0) -}; - -#ifdef __SGNXPRO__ -mixer_tab sgnxpro_mix = { - MIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4), - MIX_ENT(SOUND_MIXER_BASS, 0x46, 2, 3, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_TREBLE, 0x44, 2, 3, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_SYNTH, 0x26, 7, 4, 0x26, 3, 4), - MIX_ENT(SOUND_MIXER_PCM, 0x04, 7, 4, 0x04, 3, 4), - MIX_ENT(SOUND_MIXER_SPEAKER, 0x42, 2, 3, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_LINE, 0x2e, 7, 4, 0x2e, 3, 4), - MIX_ENT(SOUND_MIXER_MIC, 0x0a, 2, 3, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_CD, 0x28, 7, 4, 0x28, 3, 4), - MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_IGAIN, 0x00, 0, 0, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_OGAIN, 0x00, 0, 0, 0x00, 0, 0) -}; -#endif - -mixer_tab sb16_mix = { - MIX_ENT(SOUND_MIXER_VOLUME, 0x30, 7, 5, 0x31, 7, 5), - MIX_ENT(SOUND_MIXER_BASS, 0x46, 7, 4, 0x47, 7, 4), - MIX_ENT(SOUND_MIXER_TREBLE, 0x44, 7, 4, 0x45, 7, 4), - MIX_ENT(SOUND_MIXER_SYNTH, 0x34, 7, 5, 0x35, 7, 5), - MIX_ENT(SOUND_MIXER_PCM, 0x32, 7, 5, 0x33, 7, 5), - MIX_ENT(SOUND_MIXER_SPEAKER, 0x3b, 7, 2, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_LINE, 0x38, 7, 5, 0x39, 7, 5), - MIX_ENT(SOUND_MIXER_MIC, 0x3a, 7, 5, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_CD, 0x36, 7, 5, 0x37, 7, 5), - MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0), - MIX_ENT(SOUND_MIXER_RECLEV, 0x3f, 7, 2, 0x40, 7, 2), /* Obsolete. Use IGAIN */ - MIX_ENT(SOUND_MIXER_IGAIN, 0x3f, 7, 2, 0x40, 7, 2), - MIX_ENT(SOUND_MIXER_OGAIN, 0x41, 7, 2, 0x42, 7, 2) -}; - -#ifdef SM_GAMES /* Master volume is lower and PCM & FM - * volumes higher than with SB Pro. This - * improves the sound quality */ - -static unsigned short levels[SOUND_MIXER_NRDEVICES] = -{ - 0x2020, /* Master Volume */ - 0x4b4b, /* Bass */ - 0x4b4b, /* Treble */ - 0x6464, /* FM */ - 0x6464, /* PCM */ - 0x4b4b, /* PC Speaker */ - 0x4b4b, /* Ext Line */ - 0x0000, /* Mic */ - 0x4b4b, /* CD */ - 0x4b4b, /* Recording monitor */ - 0x4b4b, /* SB PCM */ - 0x4b4b, /* Recording level */ - 0x4b4b, /* Input gain */ -0x4b4b}; /* Output gain */ - -#else /* If the user selected just plain SB Pro */ - -static unsigned short levels[SOUND_MIXER_NRDEVICES] = -{ - 0x5a5a, /* Master Volume */ - 0x4b4b, /* Bass */ - 0x4b4b, /* Treble */ - 0x4b4b, /* FM */ - 0x4b4b, /* PCM */ - 0x4b4b, /* PC Speaker */ - 0x4b4b, /* Ext Line */ - 0x1010, /* Mic */ - 0x4b4b, /* CD */ - 0x4b4b, /* Recording monitor */ - 0x4b4b, /* SB PCM */ - 0x4b4b, /* Recording level */ - 0x4b4b, /* Input gain */ -0x4b4b}; /* Output gain */ -#endif /* SM_GAMES */ - -static unsigned char sb16_recmasks_L[SOUND_MIXER_NRDEVICES] = -{ - 0x00, /* SOUND_MIXER_VOLUME */ - 0x00, /* SOUND_MIXER_BASS */ - 0x00, /* SOUND_MIXER_TREBLE */ - 0x40, /* SOUND_MIXER_SYNTH */ - 0x00, /* SOUND_MIXER_PCM */ - 0x00, /* SOUND_MIXER_SPEAKER */ - 0x10, /* SOUND_MIXER_LINE */ - 0x01, /* SOUND_MIXER_MIC */ - 0x04, /* SOUND_MIXER_CD */ - 0x00, /* SOUND_MIXER_IMIX */ - 0x00, /* SOUND_MIXER_ALTPCM */ - 0x00, /* SOUND_MIXER_RECLEV */ - 0x00, /* SOUND_MIXER_IGAIN */ - 0x00 /* SOUND_MIXER_OGAIN */ -}; - -static unsigned char sb16_recmasks_R[SOUND_MIXER_NRDEVICES] = -{ - 0x00, /* SOUND_MIXER_VOLUME */ - 0x00, /* SOUND_MIXER_BASS */ - 0x00, /* SOUND_MIXER_TREBLE */ - 0x20, /* SOUND_MIXER_SYNTH */ - 0x00, /* SOUND_MIXER_PCM */ - 0x00, /* SOUND_MIXER_SPEAKER */ - 0x08, /* SOUND_MIXER_LINE */ - 0x01, /* SOUND_MIXER_MIC */ - 0x02, /* SOUND_MIXER_CD */ - 0x00, /* SOUND_MIXER_IMIX */ - 0x00, /* SOUND_MIXER_ALTPCM */ - 0x00, /* SOUND_MIXER_RECLEV */ - 0x00, /* SOUND_MIXER_IGAIN */ - 0x00 /* SOUND_MIXER_OGAIN */ -}; - -/* - * Recording sources (SB Pro) - */ - -#define SRC_MIC 1 /* Select Microphone recording source */ -#define SRC_CD 3 /* Select CD recording source */ -#define SRC_LINE 7 /* Use Line-in for recording source */ - -#endif diff --git a/sys/dev/sound/isa/i386/sbmidi/sb16_midi.c b/sys/dev/sound/isa/i386/sbmidi/sb16_midi.c deleted file mode 100644 index 7b757a7ec1..0000000000 --- a/sys/dev/sound/isa/i386/sbmidi/sb16_midi.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * sound/sb16_midi.c - * - * The low level driver for the MPU-401 UART emulation of the SB16. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/sound/sb16_midi.c,v 1.20 1999/12/27 04:37:18 tanimura Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/sbmidi/Attic/sb16_midi.c,v 1.3 2003/08/07 21:17:12 dillon Exp $ - * - */ - -#include "use_sb.h" - -#include -#include - -#if defined(CONFIG_SB) && defined(CONFIG_SB16) && defined(CONFIG_MIDI) - -#ifdef PC98 -#define DATAPORT (sb16midi_base) -#define COMDPORT (sb16midi_base+0x100) -#define STATPORT (sb16midi_base+0x100) -#else -#define DATAPORT (sb16midi_base) -#define COMDPORT (sb16midi_base+1) -#define STATPORT (sb16midi_base+1) -#endif - -extern sound_os_info *sb_osp; - -#define sb16midi_status() inb( STATPORT) -#define input_avail() (!(sb16midi_status()&INPUT_AVAIL)) -#define output_ready() (!(sb16midi_status()&OUTPUT_READY)) -#define sb16midi_cmd(cmd) outb( COMDPORT, cmd) -#define sb16midi_read() inb( DATAPORT) -#define sb16midi_write(byte) outb( DATAPORT, byte) - -#define OUTPUT_READY 0x40 -#define INPUT_AVAIL 0x80 -#define MPU_ACK 0xFE -#define MPU_RESET 0xFF -#define UART_MODE_ON 0x3F - -static int sb16midi_opened = 0; -#ifdef PC98 -static int sb16midi_base = 0x80d2; -#else -static int sb16midi_base = 0x330; -#endif -static int sb16midi_detected = 0; -static int my_dev; -extern int sbc_base; - -static int reset_sb16midi(void); -static void (*midi_input_intr) (int dev, u_char data); -static volatile u_char input_byte; - -static void -sb16midi_input_loop(void) -{ - while (input_avail()) { - u_char c = sb16midi_read(); - - if (c == MPU_ACK) - input_byte = c; - else if (sb16midi_opened & OPEN_READ && midi_input_intr) - midi_input_intr(my_dev, c); - } -} - -void -sb16midiintr(int unit) -{ - if (input_avail()) - sb16midi_input_loop(); -} - -static int -sb16midi_open(int dev, int mode, - void (*input) (int dev, u_char data), - void (*output) (int dev) -) -{ - if (sb16midi_opened) { - return -(EBUSY); - } - sb16midi_input_loop(); - - midi_input_intr = input; - sb16midi_opened = mode; - - return 0; -} - -static void -sb16midi_close(int dev) -{ - sb16midi_opened = 0; -} - -static int -sb16midi_out(int dev, u_char midi_byte) -{ - int timeout; - u_long flags; - - /* - * Test for input since pending input seems to block the output. - */ - - flags = splhigh(); - - if (input_avail()) - sb16midi_input_loop(); - - splx(flags); - - /* - * Sometimes it takes about 13000 loops before the output becomes - * ready (After reset). Normally it takes just about 10 loops. - */ - - for (timeout = 30000; timeout > 0 && !output_ready(); timeout--); /* Wait */ - - if (!output_ready()) { - printf("MPU-401: Timeout\n"); - return 0; - } - sb16midi_write(midi_byte); - return 1; -} - -static int -sb16midi_start_read(int dev) -{ - return 0; -} - -static int -sb16midi_end_read(int dev) -{ - return 0; -} - -static int -sb16midi_ioctl(int dev, u_int cmd, ioctl_arg arg) -{ - return -(EINVAL); -} - -static void -sb16midi_kick(int dev) -{ -} - -static int -sb16midi_buffer_status(int dev) -{ - return 0; /* No data in buffers */ -} - -#define MIDI_SYNTH_NAME "SoundBlaster 16 Midi" -#define MIDI_SYNTH_CAPS SYNTH_CAP_INPUT -#include - -static struct midi_operations sb16midi_operations = -{ - {"SoundBlaster 16 Midi", 0, 0, SNDCARD_SB16MIDI}, - &std_midi_synth, - {0}, - sb16midi_open, - sb16midi_close, - sb16midi_ioctl, - sb16midi_out, - sb16midi_start_read, - sb16midi_end_read, - sb16midi_kick, - NULL, - sb16midi_buffer_status, - NULL -}; - - -void -attach_sb16midi(struct address_info * hw_config) -{ - int ok, timeout; - u_long flags; - - sb16midi_base = hw_config->io_base; - - if (!sb16midi_detected) - return; - - flags = splhigh(); - for (timeout = 30000; timeout < 0 && !output_ready(); timeout--); /* Wait */ - input_byte = 0; - sb16midi_cmd(UART_MODE_ON); - - ok = 0; - for (timeout = 50000; timeout > 0 && !ok; timeout--) - if (input_byte == MPU_ACK) - ok = 1; - else if (input_avail()) - if (sb16midi_read() == MPU_ACK) - ok = 1; - - splx(flags); - - if (num_midis >= MAX_MIDI_DEV) { - printf("Sound: Too many midi devices detected\n"); - return; - } - - conf_printf("SoundBlaster MPU-401", hw_config); - std_midi_synth.midi_dev = my_dev = num_midis; - midi_devs[num_midis++] = &sb16midi_operations; - return; -} - -static int -reset_sb16midi(void) -{ - int ok, timeout, n; - - /* - * Send the RESET command. Try again if no success at the first time. - */ - - if (inb(STATPORT) == 0xff) - return 0; - - ok = 0; - - /* flags = splhigh(); */ - - for (n = 0; n < 2 && !ok; n++) { - for (timeout = 30000; timeout < 0 && !output_ready(); timeout--); /* Wait */ - input_byte = 0; - sb16midi_cmd(MPU_RESET); /* Send MPU-401 RESET Command */ - - /* - * Wait at least 25 msec. This method is not accurate so - * let's make the loop bit longer. Cannot sleep since this is - * called during boot. - */ - - for (timeout = 50000; timeout > 0 && !ok; timeout--) - if (input_byte == MPU_ACK) /* Interrupt */ - ok = 1; - else if (input_avail()) - if (sb16midi_read() == MPU_ACK) - ok = 1; - - } - - sb16midi_opened = 0; - if (ok) - sb16midi_input_loop(); /* Flush input before enabling - * interrupts */ - - /* splx(flags); */ - - return ok; -} - - -int -probe_sb16midi(struct address_info * hw_config) -{ - int ok = 0; - struct address_info *sb_config; - - if (sbc_major < 4) - return 0; /* Not a SB16 */ - - if (!(sb_config = sound_getconf(SNDCARD_SB))) { - printf("SB16 Error: Plain SB not configured\n"); - return 0; - } - - sb16midi_base = hw_config->io_base; - - ok = reset_sb16midi(); - - sb16midi_detected = ok; - return ok; -} - -#endif - diff --git a/sys/dev/sound/isa/i386/sbxvi/sb16_dsp.c b/sys/dev/sound/isa/i386/sbxvi/sb16_dsp.c deleted file mode 100644 index 0bfc8d09ea..0000000000 --- a/sys/dev/sound/isa/i386/sbxvi/sb16_dsp.c +++ /dev/null @@ -1,562 +0,0 @@ -/* - * sound/sb16_dsp.c - * - * The low level driver for the SoundBlaster DSP chip. - * - * (C) 1993 J. Schubert (jsb@sth.ruhr-uni-bochum.de) - * - * based on SB-driver by (C) Hannu Savolainen - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/sound/sb16_dsp.c,v 1.33 1999/12/27 04:37:18 tanimura Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/sbxvi/Attic/sb16_dsp.c,v 1.3 2003/08/07 21:17:12 dillon Exp $ - * - */ - -#define DEB(x) -#define DEB1(x) -#include "use_sb.h" - -#include -#include -#include - -#if defined(CONFIG_SB16) && (NSB > 0) && defined(CONFIG_AUDIO) && defined(CONFIG_SBPRO) - -extern sound_os_info *sb_osp; -extern int sbc_base; - -static int sb16_dsp_ok = 0; -static int dsp_16bit = 0; -static int dsp_stereo = 0; -static int dsp_current_speed = 8000; -static int dsp_busy = 0; -static int dma16, dma8; - - -static int trigger_bits = 0; -static u_long dsp_count = 0; - -static int irq_mode = IMODE_NONE; -static int my_dev = 0; - -static volatile int intr_active = 0; - -static int sb16_dsp_open(int dev, int mode); -static void sb16_dsp_close(int dev); -static void sb16_dsp_output_block(int dev, u_long buf, int count, int intrflag, int dma_restart); -static void sb16_dsp_start_input(int dev, u_long buf, int count, int intrflag, int dma_restart); -static int sb16_dsp_ioctl(int dev, u_int cmd, ioctl_arg arg, int local); -static int sb16_dsp_prepare_for_input(int dev, int bsize, int bcount); -static int sb16_dsp_prepare_for_output(int dev, int bsize, int bcount); -static void sb16_dsp_reset(int dev); -static void sb16_dsp_halt(int dev); -static void sb16_dsp_trigger(int dev, int bits); -static int dsp_set_speed(int); -static int dsp_set_stereo(int); -static void dsp_cleanup(void); - -static struct audio_operations sb16_dsp_operations = -{ - "SoundBlaster 16", - DMA_AUTOMODE, - AFMT_U8 | AFMT_S16_LE, - NULL, - sb16_dsp_open, - sb16_dsp_close, - sb16_dsp_output_block, - sb16_dsp_start_input, - sb16_dsp_ioctl, - sb16_dsp_prepare_for_input, - sb16_dsp_prepare_for_output, - sb16_dsp_reset, - sb16_dsp_halt, - NULL, - NULL, - NULL, - NULL, - sb16_dsp_trigger -}; - -static int -sb_dsp_command01(u_char val) -{ - int i = 1 << 16; - - while (--i & (!inb(DSP_STATUS) & 0x80)); - if (!i) - printf("SB16 sb_dsp_command01 Timeout\n"); - return sb_dsp_command(val); -} - -static int -dsp_set_speed(int mode) -{ - DEB(printf("dsp_set_speed(%d)\n", mode)); - if (mode) { - RANGE (mode, 5000, 44100); - dsp_current_speed = mode; - } - return mode; -} - -static int -dsp_set_stereo(int mode) -{ - DEB(printf("dsp_set_stereo(%d)\n", mode)); - dsp_stereo = mode; - return mode; -} - -static int -dsp_set_bits(int arg) -{ - DEB(printf("dsp_set_bits(%d)\n", arg)); - - if (arg) - dsp_16bit = (arg == 16) ? 1 : 0 ; - return dsp_16bit ? 16 : 8; -} - -static int -sb16_dsp_ioctl(int dev, u_int cmd, ioctl_arg arg, int local) -{ - switch (cmd) { - case SOUND_PCM_WRITE_RATE: - if (local) - return dsp_set_speed((int) arg); - return *(int *) arg = dsp_set_speed((*(int *) arg)); - - case SOUND_PCM_READ_RATE: - if (local) - return dsp_current_speed; - return *(int *) arg = dsp_current_speed; - - case SNDCTL_DSP_STEREO: - if (local) - return dsp_set_stereo((int) arg); - return *(int *) arg = dsp_set_stereo((*(int *) arg)); - - case SOUND_PCM_WRITE_CHANNELS: - if (local) - return dsp_set_stereo((int) arg - 1) + 1; - return *(int *) arg = dsp_set_stereo((*(int *) arg) - 1) + 1; - - case SOUND_PCM_READ_CHANNELS: - if (local) - return dsp_stereo + 1; - return *(int *) arg = dsp_stereo + 1; - - case SNDCTL_DSP_SETFMT: - if (local) - return dsp_set_bits((int) arg); - return *(int *) arg = dsp_set_bits((*(int *) arg)); - - case SOUND_PCM_READ_BITS: - if (local) - return dsp_16bit ? 16 : 8; - return *(int *) arg = dsp_16bit ? 16 : 8; - - case SOUND_PCM_WRITE_FILTER: /* NOT YET IMPLEMENTED */ - if ((*(int *) arg) > 1) - return *(int *) arg = -(EINVAL); - - case FIOASYNC: - if (local) - return 1; - return *(int *) arg = 1; - - case FIONBIO: - if (local) - return 1; - return *(int *) arg = 1; - - default: - return -(EINVAL); - } - - return -(EINVAL); -} - -static int -sb16_dsp_open(int dev, int mode) -{ - DEB(printf("sb16_dsp_open()\n")); - - if (!sb16_dsp_ok) { - printf("SB16 Error: SoundBlaster board not installed\n"); - return -(ENXIO); - } - if (intr_active) - return -(EBUSY); - - sb_reset_dsp(); - - - irq_mode = IMODE_NONE; - dsp_busy = 1; - trigger_bits = 0; - - return 0; -} - -static void -sb16_dsp_close(int dev) -{ - u_long flags; - - DEB(printf("sb16_dsp_close()\n")); - sb_dsp_command01(0xd9); - sb_dsp_command01(0xd5); - - flags = splhigh(); - - audio_devs[dev]->dmachan1 = dma8; - - dsp_cleanup(); - dsp_busy = 0; - - - splx(flags); -} - -static void -sb16_dsp_output_block(int dev, u_long buf, int count, int intrflag, int dma_restart) -{ - u_long flags, cnt; - - - cnt = count; - if (dsp_16bit) - cnt >>= 1; - cnt--; - - if (audio_devs[dev]->flags & DMA_AUTOMODE && intrflag && cnt==dsp_count) { - irq_mode = IMODE_OUTPUT; - intr_active = 1; - return; /* Auto mode on. No need to react */ - } - flags = splhigh(); - - if (dma_restart) { - - sb16_dsp_halt(dev); - DMAbuf_start_dma(dev, buf, count, 1); - } - - - sb_dsp_command(0x41); - sb_dsp_command((u_char) ((dsp_current_speed >> 8) & 0xff)); - sb_dsp_command((u_char) (dsp_current_speed & 0xff)); - sb_dsp_command((u_char) (dsp_16bit ? 0xb6 : 0xc6)); - dsp_count = cnt; - sb_dsp_command((u_char) ((dsp_stereo ? 0x20 : 0) + - (dsp_16bit ? 0x10 : 0))); - sb_dsp_command((u_char) (cnt & 0xff)); - sb_dsp_command((u_char) (cnt >> 8)); - - irq_mode = IMODE_OUTPUT; - intr_active = 1; - splx(flags); -} - -static void -sb16_dsp_start_input(int dev, u_long buf, int count, int intrflag, int dma_restart) -{ - u_long flags, cnt; - - cnt = count; - if (dsp_16bit) - cnt >>= 1; - cnt--; - - if (audio_devs[dev]->flags & DMA_AUTOMODE && intrflag && cnt == dsp_count) { - irq_mode = IMODE_INPUT; - intr_active = 1; - return; /* Auto mode on. No need to react */ - } - flags = splhigh(); - - if (dma_restart) { - sb_reset_dsp(); - DMAbuf_start_dma(dev, buf, count, 0); - } - sb_dsp_command(0x42); - sb_dsp_command((u_char) ((dsp_current_speed >> 8) & 0xff)); - sb_dsp_command((u_char) (dsp_current_speed & 0xff)); - sb_dsp_command((u_char) (dsp_16bit ? 0xbe : 0xce)); - dsp_count = cnt; - sb_dsp_command((u_char) ((dsp_stereo ? 0x20 : 0) + - (dsp_16bit ? 0x10 : 0))); - sb_dsp_command01((u_char) (cnt & 0xff)); - sb_dsp_command((u_char) (cnt >> 8)); - - irq_mode = IMODE_INPUT; - intr_active = 1; - splx(flags); -} - -static int -sb16_dsp_prepare_for_input(int dev, int bsize, int bcount) -{ - int fudge; - struct dma_buffparms *dmap = audio_devs[dev]->dmap_in; - - audio_devs[my_dev]->dmachan2 = dsp_16bit ? dma16 : dma8; - - - fudge = audio_devs[my_dev]->dmachan2 ; - - if (dmap->dma_chan != fudge ) { - isa_dma_release( dmap->dma_chan); - isa_dma_acquire(fudge); - dmap->dma_chan = fudge; - } - - dsp_count = 0; - dsp_cleanup(); - if (dsp_16bit) - sb_dsp_command(0xd5); /* Halt DMA until trigger() is called */ - else - sb_dsp_command(0xd0); /* Halt DMA until trigger() is called */ - - trigger_bits = 0; - return 0; -} - -static int -sb16_dsp_prepare_for_output(int dev, int bsize, int bcount) -{ - int fudge = dsp_16bit ? dma16 : dma8; - struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; - - if (dmap->dma_chan != fudge ) { - isa_dma_release( dmap->dma_chan); - isa_dma_acquire(fudge); - dmap->dma_chan = fudge; - } - - audio_devs[my_dev]->dmachan1 = fudge; - - dsp_count = 0; - dsp_cleanup(); - if (dsp_16bit) - sb_dsp_command(0xd5); /* Halt DMA until trigger() is called */ - else - sb_dsp_command(0xd0); /* Halt DMA until trigger() is called */ - - trigger_bits = 0; - return 0; -} - -static void -sb16_dsp_trigger(int dev, int bits) -{ - if (bits != 0) - bits = 1; - - if (bits == trigger_bits) /* No change */ - return; - - trigger_bits = bits; - - if (!bits) - sb_dsp_command(0xd0); /* Halt DMA */ - else if (bits & irq_mode) { - if (dsp_16bit) - sb_dsp_command(0xd6); /* Continue 16bit DMA */ - else - sb_dsp_command(0xd4); /* Continue 8bit DMA */ - } -} - -static void -dsp_cleanup(void) -{ - irq_mode = IMODE_NONE; - intr_active = 0; -} - -static void -sb16_dsp_reset(int dev) -{ - u_long flags; - - flags = splhigh(); - - sb_reset_dsp(); - dsp_cleanup(); - - splx(flags); -} - -static void -sb16_dsp_halt(int dev) -{ - - if (dsp_16bit) { - sb_dsp_command01(0xd9); - sb_dsp_command01(0xd5); - } else { - sb_dsp_command01(0xda); - sb_dsp_command01(0xd0); - } - - -} - -static void -set_irq_hw(int level) -{ - int ival; - - switch (level) { -#ifdef PC98 - case 5: - ival = 8; - break; - case 3: - ival = 1; - break; - case 10: - ival = 2; - break; -#else - case 5: - ival = 2; - break; - case 7: - ival = 4; - break; - case 9: - ival = 1; - break; - case 10: - ival = 8; - break; -#endif - default: - printf("SB16_IRQ_LEVEL %d does not exist\n", level); - return; - } - sb_setmixer(IRQ_NR, ival); -} - -void -sb16_dsp_init(struct address_info * hw_config) -{ - if (sbc_major < 4) - return; /* Not a SB16 */ - - snprintf(sb16_dsp_operations.name, sizeof(sb16_dsp_operations.name), - "SoundBlaster 16 %d.%d", sbc_major, sbc_minor); - - conf_printf(sb16_dsp_operations.name, hw_config); - - if (num_audiodevs < MAX_AUDIO_DEV) { - audio_devs[my_dev = num_audiodevs++] = &sb16_dsp_operations; - audio_devs[my_dev]->dmachan1 = dma8; - audio_devs[my_dev]->buffsize = DSP_BUFFSIZE; - - } else - printf("SB: Too many DSP devices available\n"); - sb16_dsp_ok = 1; - return; -} - -int -sb16_dsp_detect(struct address_info * hw_config) -{ - struct address_info *sb_config; - - if (sb16_dsp_ok) - return 1; /* Can't drive two cards */ - - if (!(sb_config = sound_getconf(SNDCARD_SB))) { - printf("SB16 Error: Plain SB not configured\n"); - return 0; - } - /* - * sb_setmixer(OPSW,0xf); if(sb_getmixer(OPSW)!=0xf) return 0; - */ - - if (!sb_reset_dsp()) - return 0; - - if (sbc_major < 4) /* Set by the plain SB driver */ - return 0; /* Not a SB16 */ - -#ifdef PC98 - hw_config->dma = sb_config->dma; -#else - if (hw_config->dma < 4) - if (hw_config->dma != sb_config->dma) { - printf("SB16 Error: Invalid DMA channel %d/%d\n", - sb_config->dma, hw_config->dma); - return 0; - } -#endif - dma16 = hw_config->dma; - dma8 = sb_config->dma; - /* hw_config->irq = 0; sb_config->irq; - hw_config->io_base = sb_config->io_base; - */ - set_irq_hw(sb_config->irq); - -#ifdef PC98 - sb_setmixer (DMA_NR, hw_config->dma == 0 ? 1 : 2); -#else - sb_setmixer(DMA_NR, (1 << hw_config->dma) | (1 << sb_config->dma)); -#endif - - DEB(printf("SoundBlaster 16: IRQ %d DMA %d OK\n", - sb_config->irq, hw_config->dma)); - - /* - * dsp_showmessage(0xe3,99); - */ - sb16_dsp_ok = 1; - return 1; -} - -void -sb16_dsp_interrupt(int unused) -{ - int data; - - data = inb(DSP_DATA_AVL16); /* Interrupt acknowledge */ - - if (intr_active) - switch (irq_mode) { - case IMODE_OUTPUT: - DMAbuf_outputintr(my_dev, 1); - break; - - case IMODE_INPUT: - DMAbuf_inputintr(my_dev); - break; - - default: - printf("SoundBlaster: Unexpected interrupt\n"); - } -} -#endif diff --git a/sys/dev/sound/isa/i386/sequencer.c b/sys/dev/sound/isa/i386/sequencer.c deleted file mode 100644 index a21456d880..0000000000 --- a/sys/dev/sound/isa/i386/sequencer.c +++ /dev/null @@ -1,1824 +0,0 @@ -/* - * sound/sequencer.c - * - * The sequencer personality manager. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/sound/sequencer.c,v 1.25.2.1 2001/06/10 02:02:05 dd Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/sequencer.c,v 1.4 2004/09/18 20:25:17 dillon Exp $ - */ - -#define SEQUENCER_C -#include "sound_config.h" - -#if NSND > 0 - -#ifdef CONFIG_SEQUENCER - -#include - -#include "midi_ctrl.h" - -static void seq_drain_midi_queues(void); -int -sequencer_poll (int dev, struct fileinfo *file, int events, select_table * wait); -static int sequencer_ok = 0; -static struct sound_timer_operations *tmr; -static int tmr_no = -1; /* Currently selected timer */ -static int pending_timer = -1; /* For timer change operation */ - -/* - * Local counts for number of synth and MIDI devices. These are initialized - * by the sequencer_open. - */ -static int max_mididev = 0; -static int max_synthdev = 0; - -/* - * The seq_mode gives the operating mode of the sequencer: 1 = level1 (the - * default) 2 = level2 (extended capabilites) - */ - -#define SEQ_1 1 -#define SEQ_2 2 -static int seq_mode = SEQ_1; - -static int *seq_sleeper = NULL; -static volatile struct snd_wait seq_sleep_flag = {0}; -static int *midi_sleeper = NULL; -static volatile struct snd_wait midi_sleep_flag = {0}; - -static int midi_opened[MAX_MIDI_DEV] = {0}; -static int midi_written[MAX_MIDI_DEV] = {0}; - -static u_long prev_input_time = 0; -static int prev_event_time; -static u_long seq_time = 0; - -#include - -#define EV_SZ 8 -#define IEV_SZ 8 -static u_char *queue = NULL; -static u_char *iqueue = NULL; - -static volatile int qhead = 0, qtail = 0, qlen = 0; -static volatile int iqhead = 0, iqtail = 0, iqlen = 0; -static volatile int seq_playing = 0; -static volatile int sequencer_busy = 0; -static int output_treshold; -static int pre_event_timeout; -static u_int synth_open_mask; - -static int seq_queue(u_char *note, char nonblock); -static void seq_startplay(void); -static int seq_sync(void); -static void seq_reset(void); -static int pmgr_present[MAX_SYNTH_DEV] = -{0}; -static struct callout sequencertimeout_ch; - -#if MAX_SYNTH_DEV > 15 -#error Too many synthesizer devices enabled. -#endif - -/* - * sound_timer stuff -- originally in soundcard.c - * - * A negative value means a relative timeout in |count| ticks. - * A positive value is used for what ? - * - * In any case, this is only used in sequencer.c - */ - -static int timer_running = 0; - -void -request_sound_timer(int count) -{ - static int current = 0; - int tmp = count; - - if ((sequencertimeout_ch.c_flags & CALLOUT_DID_INIT) == 0) - callout_init(&sequencertimeout_ch); - - if (count < 0) { - callout_reset(&sequencertimeout_ch, -count, sequencer_timer, NULL); - } else { - if (count < current) - current = 0; /* Timer restarted */ - - count = count - current; - current = tmp; - if (!count) - count = 1; - callout_reset(&sequencertimeout_ch, count, sequencer_timer, NULL); - } - timer_running = 1; -} - -void -sound_stop_timer(void) -{ - if (timer_running) - callout_stop(&sequencertimeout_ch); - timer_running = 0; -} - -int -sequencer_read(int dev, struct fileinfo * file, snd_rw_buf * buf, int count) -{ - int c = count, p = 0; - int ev_len; - u_long flags; - - dev = dev >> 4; - - ev_len = seq_mode == SEQ_1 ? 4 : 8; - - if (dev) /* Patch manager device */ - return pmgr_read(dev - 1, file, buf, count); - - flags = splhigh(); - if (!iqlen) { - int chn; - - - midi_sleeper = &chn; - DO_SLEEP(chn, midi_sleep_flag, pre_event_timeout); - - if (!iqlen) { - splx(flags); - return 0; - } - } - while (iqlen && c >= ev_len) { - - if (uiomove((char *) &iqueue[iqhead * IEV_SZ], ev_len, buf)) - printf("sb: Bad copyout()!\n"); - p += ev_len; - c -= ev_len; - - iqhead = (iqhead + 1) % SEQ_MAX_QUEUE; - iqlen--; - } - splx(flags); - - return count - c; -} - -static void -sequencer_midi_output(int dev) -{ - /* - * Currently NOP - */ -} - -void -seq_copy_to_input(u_char *event, int len) -{ - u_long flags; - - /* - * Verify that the len is valid for the current mode. - */ - - if (len != 4 && len != 8) - return; - if ((seq_mode == SEQ_1) != (len == 4)) - return; - - if (iqlen >= (SEQ_MAX_QUEUE - 1)) - return; /* Overflow */ - - flags = splhigh(); - bcopy(event, &iqueue[iqtail * IEV_SZ], len); - iqlen++; - iqtail = (iqtail + 1) % SEQ_MAX_QUEUE; - - if ((midi_sleep_flag.mode & WK_SLEEP)) { - midi_sleep_flag.mode = WK_WAKEUP; - wakeup(midi_sleeper); - } - splx(flags); -} - -static void -sequencer_midi_input(int dev, u_char data) -{ - u_int tstamp; - u_char event[4]; - - if (data == 0xfe) /* Ignore active sensing */ - return; - - tstamp = get_time() - seq_time; - if (tstamp != prev_input_time) { - tstamp = (tstamp << 8) | SEQ_WAIT; - - seq_copy_to_input((u_char *) &tstamp, 4); - prev_input_time = tstamp; - } - event[0] = SEQ_MIDIPUTC; - event[1] = data; - event[2] = dev; - event[3] = 0; - - seq_copy_to_input(event, 4); -} - -void -seq_input_event(u_char *event, int len) -{ - u_long this_time; - - if (seq_mode == SEQ_2) - this_time = tmr->get_time(tmr_no); - else - this_time = get_time() - seq_time; - - if (this_time != prev_input_time) { - u_char tmp_event[8]; - - tmp_event[0] = EV_TIMING; - tmp_event[1] = TMR_WAIT_ABS; - tmp_event[2] = 0; - tmp_event[3] = 0; - *(u_long *) &tmp_event[4] = this_time; - - seq_copy_to_input(tmp_event, 8); - prev_input_time = this_time; - } - seq_copy_to_input(event, len); -} - -int -sequencer_write(int dev, struct fileinfo * file, snd_rw_buf * buf, int count) -{ - u_char event[EV_SZ], ev_code; - int p = 0, c, ev_size; - int err; - int mode = file->mode & O_ACCMODE; - - dev = dev >> 4; - - DEB(printf("sequencer_write(dev=%d, count=%d)\n", dev, count)); - - if (mode == OPEN_READ) - return -(EIO); - - if (dev) - return pmgr_write(dev - 1, file, buf, count); - - c = count; - - while (c >= 4) { - - if (uiomove((char *) event, 4, buf)) - printf("sb: Bad copyin()!\n"); - ev_code = event[0]; - - if (ev_code == SEQ_FULLSIZE) { - int err; - - dev = *(u_short *) &event[2]; - if (dev < 0 || dev >= max_synthdev) - return -(ENXIO); - - if (!(synth_open_mask & (1 << dev))) - return -(ENXIO); - - err = synth_devs[dev]->load_patch(dev, - *(short *) &event[0], buf, p + 4, c, 0); - if (err < 0) - return err; - - return err; - } - if (ev_code >= 128) { - if (seq_mode == SEQ_2 && ev_code == SEQ_EXTENDED) { - printf("Sequencer: Invalid level 2 event %x\n", ev_code); - return -(EINVAL); - } - ev_size = 8; - - if (c < ev_size) { - if (!seq_playing) - seq_startplay(); - return count - c; - } - if (uiomove((char *) &event[4], 4, buf)) - printf("sb: Bad copyin()!\n"); - } else { - if (seq_mode == SEQ_2) { - printf("Sequencer: 4 byte event in level 2 mode\n"); - return -(EINVAL); - } - ev_size = 4; - } - - if (event[0] == SEQ_MIDIPUTC) { - - if (!midi_opened[event[2]]) { - int mode; - int dev = event[2]; - - if (dev >= max_mididev) { - printf("Sequencer Error: Nonexistent MIDI device %d\n",dev); - return -(ENXIO); - } - mode = file->mode & O_ACCMODE; - - if ((err = midi_devs[dev]->open(dev, mode, - sequencer_midi_input, sequencer_midi_output)) < 0) { - seq_reset(); - printf("Sequencer Error: Unable to open Midi #%d\n", dev); - return err; - } - midi_opened[dev] = 1; - } - } - if (!seq_queue(event, 0)) { - int processed = count - c; - - if (!seq_playing) - seq_startplay(); - - return processed; - } - p += ev_size; - c -= ev_size; - } - - if (!seq_playing) - seq_startplay(); - - return count; /* This will "eat" chunks shorter than 4 bytes - * (if written alone) Should we really do that ? - */ -} - -static int -seq_queue(u_char *note, char nonblock) -{ - - /* - * Test if there is space in the queue - */ - - if (qlen >= SEQ_MAX_QUEUE) - if (!seq_playing) - seq_startplay(); /* Give chance to drain the queue */ - - if (!nonblock && qlen >= SEQ_MAX_QUEUE && - !(seq_sleep_flag.mode & WK_SLEEP)) { - /* - * Sleep until there is enough space on the queue - */ - - int chn; - - - seq_sleeper = &chn; - DO_SLEEP(chn, seq_sleep_flag, 0); - - } - if (qlen >= SEQ_MAX_QUEUE) - return 0; /* To be sure */ - bcopy(note, &queue[qtail * EV_SZ], EV_SZ); - - qtail = (qtail + 1) % SEQ_MAX_QUEUE; - qlen++; - - return 1; -} - -static int -extended_event(u_char *q) -{ - int dev = q[2]; - - if (dev < 0 || dev >= max_synthdev) - return -(ENXIO); - - if (!(synth_open_mask & (1 << dev))) - return -(ENXIO); - - switch (q[1]) { - case SEQ_NOTEOFF: - synth_devs[dev]->kill_note(dev, q[3], q[4], q[5]); - break; - - case SEQ_NOTEON: - if (q[4] > 127 && q[4] != 255) - return 0; - - synth_devs[dev]->start_note(dev, q[3], q[4], q[5]); - break; - - case SEQ_PGMCHANGE: - synth_devs[dev]->set_instr(dev, q[3], q[4]); - break; - - case SEQ_AFTERTOUCH: - synth_devs[dev]->aftertouch(dev, q[3], q[4]); - break; - - case SEQ_BALANCE: - synth_devs[dev]->panning(dev, q[3], (char) q[4]); - break; - - case SEQ_CONTROLLER: - synth_devs[dev]->controller(dev, q[3], q[4], *(short *) &q[5]); - break; - - case SEQ_VOLMODE: - if (synth_devs[dev]->volume_method != NULL) - synth_devs[dev]->volume_method(dev, q[3]); - break; - - default: - return -(EINVAL); - } - - return 0; -} - -static int -find_voice(int dev, int chn, int note) -{ - u_short key; - int i; - - key = (chn << 8) | (note + 1); - - for (i = 0; i < synth_devs[dev]->alloc.max_voice; i++) - if (synth_devs[dev]->alloc.map[i] == key) - return i; - - return -1; -} - -static int -alloc_voice(int dev, int chn, int note) -{ - u_short key; - int voice; - - key = (chn << 8) | (note + 1); - - voice = synth_devs[dev]->alloc_voice(dev, chn, note, - &synth_devs[dev]->alloc); - synth_devs[dev]->alloc.map[voice] = key; - synth_devs[dev]->alloc.alloc_times[voice] = - synth_devs[dev]->alloc.timestamp++; - return voice; -} - -static void -seq_chn_voice_event(u_char *event) -{ - u_char dev = event[1]; - u_char cmd = event[2]; - u_char chn = event[3]; - u_char note = event[4]; - u_char parm = event[5]; - int voice = -1; - - if ((int) dev > max_synthdev) - return; - if (!(synth_open_mask & (1 << dev))) - return; - if (!synth_devs[dev]) - return; - - if (seq_mode == SEQ_2) { - if (synth_devs[dev]->alloc_voice) - voice = find_voice(dev, chn, note); - - if (cmd == MIDI_NOTEON && parm == 0) { - cmd = MIDI_NOTEOFF; - parm = 64; - } - } - switch (cmd) { - case MIDI_NOTEON: - if (note > 127 && note != 255) /* Not a seq2 feature */ - return; - - if (voice == -1 && seq_mode == SEQ_2 && synth_devs[dev]->alloc_voice) { - /* Internal synthesizer (FM, GUS, etc) */ - voice = alloc_voice(dev, chn, note); - } - if (voice == -1) - voice = chn; - - if (seq_mode == SEQ_2 && (int) dev < num_synths) { - /* - * The MIDI channel 10 is a percussive channel. Use - * the note number to select the proper patch (128 to - * 255) to play. - */ - - if (chn == 9) { - synth_devs[dev]->set_instr(dev, voice, 128 + note); - note = 60; /* Middle C */ - - } - } - if (seq_mode == SEQ_2) - synth_devs[dev]->setup_voice(dev, voice, chn); - synth_devs[dev]->start_note(dev, voice, note, parm); - break; - - case MIDI_NOTEOFF: - if (voice == -1) - voice = chn; - synth_devs[dev]->kill_note(dev, voice, note, parm); - break; - - case MIDI_KEY_PRESSURE: - if (voice == -1) - voice = chn; - synth_devs[dev]->aftertouch(dev, voice, parm); - break; - - default:; - } -} - -static void -seq_chn_common_event(u_char *event) -{ - u_char dev = event[1]; - u_char cmd = event[2]; - u_char chn = event[3]; - u_char p1 = event[4]; - - /* u_char p2 = event[5]; */ - u_short w14 = *(short *) &event[6]; - - if ((int) dev > max_synthdev) - return; - if (!(synth_open_mask & (1 << dev))) - return; - if (!synth_devs[dev]) - return; - - switch (cmd) { - case MIDI_PGM_CHANGE: - if (seq_mode == SEQ_2) { - synth_devs[dev]->chn_info[chn].pgm_num = p1; - if ((int) dev >= num_synths) - synth_devs[dev]->set_instr(dev, chn, p1); - } else - synth_devs[dev]->set_instr(dev, chn, p1); - - break; - - case MIDI_CTL_CHANGE: - if (seq_mode == SEQ_2) { - if (chn > 15 || p1 > 127) - break; - - synth_devs[dev]->chn_info[chn].controllers[p1] = w14 & 0x7f; - - if (p1 < 32) /* Setting MSB should clear LSB to 0 */ - synth_devs[dev]->chn_info[chn].controllers[p1 + 32] = 0; - - if ((int) dev < num_synths) { - int val = w14 & 0x7f; - int i, key; - - if (p1 < 64) { /* Combine MSB and LSB */ - val = ((synth_devs[dev]-> - chn_info[chn].controllers[p1 & ~32] & 0x7f) << 7) - | (synth_devs[dev]-> - chn_info[chn].controllers[p1 | 32] & 0x7f); - p1 &= ~32; - } - /* Handle all playing notes on this channel */ - - key = ((int) chn << 8); - - for (i = 0; i < synth_devs[dev]->alloc.max_voice; i++) - if ((synth_devs[dev]->alloc.map[i] & 0xff00) == key) - synth_devs[dev]->controller(dev, i, p1, val); - } else - synth_devs[dev]->controller(dev, chn, p1, w14); - } else /* Mode 1 */ - synth_devs[dev]->controller(dev, chn, p1, w14); - break; - - case MIDI_PITCH_BEND: - if (seq_mode == SEQ_2) { - synth_devs[dev]->chn_info[chn].bender_value = w14; - - if ((int) dev < num_synths) { /* Handle all playing - * notes on this channel */ - int i, key; - - key = (chn << 8); - - for (i = 0; i < synth_devs[dev]->alloc.max_voice; i++) - if ((synth_devs[dev]->alloc.map[i] & 0xff00) == key) - synth_devs[dev]->bender(dev, i, w14); - } else - synth_devs[dev]->bender(dev, chn, w14); - } else /* MODE 1 */ - synth_devs[dev]->bender(dev, chn, w14); - break; - - default:; - } -} - -static int -seq_timing_event(u_char *event) -{ - u_char cmd = event[1]; - u_int parm = *(int *) &event[4]; - - if (seq_mode == SEQ_2) { - int ret; - - if ((ret = tmr->event(tmr_no, event)) == TIMER_ARMED) { - if ((SEQ_MAX_QUEUE - qlen) >= output_treshold) { - u_long flags; - - flags = splhigh(); - if ((seq_sleep_flag.mode & WK_SLEEP)) { - seq_sleep_flag.mode = WK_WAKEUP; - wakeup(seq_sleeper); - } - splx(flags); - } - } - return ret; - } - switch (cmd) { - case TMR_WAIT_REL: - parm += prev_event_time; - - /* - * NOTE! No break here. Execution of TMR_WAIT_REL continues - * in the next case (TMR_WAIT_ABS) - */ - - case TMR_WAIT_ABS: - if (parm > 0) { - long time; - - seq_playing = 1; - time = parm; - prev_event_time = time; - - request_sound_timer(time); - - if ((SEQ_MAX_QUEUE - qlen) >= output_treshold) { - u_long flags; - - flags = splhigh(); - if ((seq_sleep_flag.mode & WK_SLEEP)) { - seq_sleep_flag.mode = WK_WAKEUP; - wakeup(seq_sleeper); - } - splx(flags); - } - return TIMER_ARMED; - } - break; - - case TMR_START: - seq_time = get_time(); - prev_input_time = 0; - prev_event_time = 0; - break; - - case TMR_STOP: - break; - - case TMR_CONTINUE: - break; - - case TMR_TEMPO: - break; - - case TMR_ECHO: - if (seq_mode == SEQ_2) - seq_copy_to_input(event, 8); - else { - parm = (parm << 8 | SEQ_ECHO); - seq_copy_to_input((u_char *) &parm, 4); - } - break; - - default:; - } - - return TIMER_NOT_ARMED; -} - -static void -seq_local_event(u_char *event) -{ - u_char cmd = event[1]; - u_int parm = *((u_int *) &event[4]); - - switch (cmd) { - case LOCL_STARTAUDIO: -#ifdef CONFIG_AUDIO - DMAbuf_start_devices(parm); -#endif - break; - - default:; - } -} - -static void -seq_sysex_message(u_char *event) -{ - int dev = event[1]; - int i, l = 0; - u_char *buf = &event[2]; - - if ((int) dev > max_synthdev) - return; - if (!(synth_open_mask & (1 << dev))) - return; - if (!synth_devs[dev]) - return; - if (!synth_devs[dev]->send_sysex) - return; - - l = 0; - for (i = 0; i < 6 && buf[i] != 0xff; i++) - l = i + 1; - - if (l > 0) - synth_devs[dev]->send_sysex(dev, buf, l); -} - -static int -play_event(u_char *q) -{ - /* - * NOTE! This routine returns 0 = normal event played. 1 = Timer - * armed. Suspend playback until timer callback. 2 = MIDI output - * buffer full. Restore queue and suspend until timer - */ - u_long *delay; - - switch (q[0]) { - case SEQ_NOTEOFF: - if (synth_open_mask & (1 << 0)) - if (synth_devs[0]) - synth_devs[0]->kill_note(0, q[1], 255, q[3]); - break; - - case SEQ_NOTEON: - if (q[4] < 128 || q[4] == 255) - if (synth_open_mask & (1 << 0)) - if (synth_devs[0]) - synth_devs[0]->start_note(0, q[1], q[2], q[3]); - break; - - case SEQ_WAIT: - delay = (u_long *) q; /* Bytes 1 to 3 are - * containing the * delay in - * get_time() */ - *delay = (*delay >> 8) & 0xffffff; - - if (*delay > 0) { - long time; - - seq_playing = 1; - time = *delay; - prev_event_time = time; - - request_sound_timer(time); - - if ((SEQ_MAX_QUEUE - qlen) >= output_treshold) { - u_long flags; - - flags = splhigh(); - if ((seq_sleep_flag.mode & WK_SLEEP)) { - seq_sleep_flag.mode = WK_WAKEUP; - wakeup(seq_sleeper); - } - splx(flags); - } - /* - * The timer is now active and will reinvoke this - * function after the timer expires. Return to the - * caller now. - */ - return 1; - } - break; - - case SEQ_PGMCHANGE: - if (synth_open_mask & (1 << 0)) - if (synth_devs[0]) - synth_devs[0]->set_instr(0, q[1], q[2]); - break; - - case SEQ_SYNCTIMER: /* Reset timer */ - seq_time = get_time(); - prev_input_time = 0; - prev_event_time = 0; - break; - - case SEQ_MIDIPUTC: /* Put a midi character */ - if (midi_opened[q[2]]) { - int dev; - - dev = q[2]; - - if (!midi_devs[dev]->putc(dev, q[1])) { - /* - * Output FIFO is full. Wait one timer cycle and try again. - */ - - seq_playing = 1; - request_sound_timer(-1); - return 2; - } else - midi_written[dev] = 1; - } - break; - - case SEQ_ECHO: - seq_copy_to_input(q, 4); /* Echo back to the process */ - break; - - case SEQ_PRIVATE: - if ((int) q[1] < max_synthdev) - synth_devs[q[1]]->hw_control(q[1], q); - break; - - case SEQ_EXTENDED: - extended_event(q); - break; - - case EV_CHN_VOICE: - seq_chn_voice_event(q); - break; - - case EV_CHN_COMMON: - seq_chn_common_event(q); - break; - - case EV_TIMING: - if (seq_timing_event(q) == TIMER_ARMED) { - return 1; - } - break; - - case EV_SEQ_LOCAL: - seq_local_event(q); - break; - - case EV_SYSEX: - seq_sysex_message(q); - break; - - default:; - } - - return 0; -} - -static void -seq_startplay(void) -{ - u_long flags; - int this_one, action; - - while (qlen > 0) { - - flags = splhigh(); - qhead = ((this_one = qhead) + 1) % SEQ_MAX_QUEUE; - qlen--; - splx(flags); - - seq_playing = 1; - - if ((action = play_event(&queue[this_one * EV_SZ]))) { - /* - * Suspend playback. Next timer routine invokes this routine again - */ - if (action == 2) { - qlen++; - qhead = this_one; - } - return; - } - } - - seq_playing = 0; - - if ((SEQ_MAX_QUEUE - qlen) >= output_treshold) { - u_long flags; - - flags = splhigh(); - if ((seq_sleep_flag.mode & WK_SLEEP)) { - seq_sleep_flag.mode = WK_WAKEUP; - wakeup(seq_sleeper); - } - splx(flags); - } -} - -static void -reset_controllers(int dev, u_char *controller, int update_dev) -{ - - int i; - - for (i = 0; i < 128; i++) - controller[i] = ctrl_def_values[i]; -} - -static void -setup_mode2(void) -{ - int dev; - - max_synthdev = num_synths; - - for (dev = 0; dev < num_midis; dev++) - if (midi_devs[dev]->converter != NULL) - synth_devs[max_synthdev++] = midi_devs[dev]->converter; - for (dev = 0; dev < max_synthdev; dev++) { - int chn; - - for (chn = 0; chn < 16; chn++) { - synth_devs[dev]->chn_info[chn].pgm_num = 0; - reset_controllers(dev, - synth_devs[dev]->chn_info[chn].controllers, 0); - synth_devs[dev]->chn_info[chn].bender_value = (1<<7); /* Neutral */ - } - } - - max_mididev = 0; - seq_mode = SEQ_2; -} - -int -sequencer_open(int dev, struct fileinfo * file) -{ - int retval, mode, i; - int level, tmp; - u_long flags; - - level = ((dev & 0x0f) == SND_DEV_SEQ2) ? 2 : 1; - - dev = dev >> 4; - mode = file->mode & O_ACCMODE; - - DEB(printf("sequencer_open(dev=%d)\n", dev)); - - if (!sequencer_ok) { - printf("Soundcard: Sequencer not initialized\n"); - return -(ENXIO); - } - if (dev) { /* Patch manager device */ - int err; - - printf("Patch manager interface is currently broken. Sorry\n"); - return -(ENXIO); - - dev--; - - if (dev >= MAX_SYNTH_DEV) - return -(ENXIO); - if (pmgr_present[dev]) - return -(EBUSY); - if ((err = pmgr_open(dev)) < 0) - return err; - - pmgr_present[dev] = 1; - return err; - } - flags = splhigh(); - if (sequencer_busy) { - printf("Sequencer busy\n"); - splx(flags); - return -(EBUSY); - } - sequencer_busy = 1; - splx(flags); - - max_mididev = num_midis; - max_synthdev = num_synths; - pre_event_timeout = 0; - seq_mode = SEQ_1; - - if (pending_timer != -1) { - tmr_no = pending_timer; - pending_timer = -1; - } - if (tmr_no == -1) { /* Not selected yet */ - int i, best; - - best = -1; - for (i = 0; i < num_sound_timers; i++) - if (sound_timer_devs[i]->priority > best) { - tmr_no = i; - best = sound_timer_devs[i]->priority; - } - if (tmr_no == -1) /* Should not be */ - tmr_no = 0; - } - tmr = sound_timer_devs[tmr_no]; - - if (level == 2) { - if (tmr == NULL) { - printf("sequencer: No timer for level 2\n"); - sequencer_busy = 0; - return -(ENXIO); - } - setup_mode2(); - } - if (seq_mode == SEQ_1 && (mode == OPEN_READ || mode == OPEN_READWRITE)) - if (!max_mididev) { - printf("Sequencer: No Midi devices. Input not possible\n"); - sequencer_busy = 0; - return -(ENXIO); - } - if (!max_synthdev && !max_mididev) - return -(ENXIO); - - synth_open_mask = 0; - - for (i = 0; i < max_mididev; i++) { - midi_opened[i] = 0; - midi_written[i] = 0; - } - - /* - * if (mode == OPEN_WRITE || mode == OPEN_READWRITE) - */ - for (i = 0; i < max_synthdev; i++) /* Open synth devices */ - if ((tmp = synth_devs[i]->open(i, mode)) < 0) { - printf("Sequencer: Warning! Cannot open synth device #%d (%d)\n", - i, tmp); - if (synth_devs[i]->midi_dev) - printf("(Maps to MIDI dev #%d)\n", synth_devs[i]->midi_dev); - } else { - synth_open_mask |= (1 << i); - if (synth_devs[i]->midi_dev) /* Is a midi interface */ - midi_opened[synth_devs[i]->midi_dev] = 1; - } - - seq_time = get_time(); - prev_input_time = 0; - prev_event_time = 0; - - if (seq_mode == SEQ_1 && (mode == OPEN_READ || mode == OPEN_READWRITE)) { - /* Initialize midi input devices */ - for (i = 0; i < max_mididev; i++) - if (!midi_opened[i]) { - if ((retval = midi_devs[i]->open(i, mode, - sequencer_midi_input, sequencer_midi_output)) >= 0) - midi_opened[i] = 1; - } - } - if (seq_mode == SEQ_2) { - tmr->open(tmr_no, seq_mode); - } - seq_sleep_flag.aborting = 0; - seq_sleep_flag.mode = WK_NONE; - midi_sleep_flag.aborting = 0; - midi_sleep_flag.mode = WK_NONE; - output_treshold = SEQ_MAX_QUEUE / 2; - - for (i = 0; i < num_synths; i++) - if (pmgr_present[i]) - pmgr_inform(i, PM_E_OPENED, 0, 0, 0, 0); - - return 0; -} - -static void -seq_drain_midi_queues(void) -{ - int i, n; - - /* - * Give the Midi drivers time to drain their output queues - */ - - n = 1; - - while (!(seq_sleep_flag.aborting) && n) { - n = 0; - - for (i = 0; i < max_mididev; i++) - if (midi_opened[i] && midi_written[i]) - if (midi_devs[i]->buffer_status != NULL) - if (midi_devs[i]->buffer_status(i)) - n++; - - /* - * Let's have a delay - */ - if (n) { - int chn; - - seq_sleeper = &chn; - DO_SLEEP(chn, seq_sleep_flag, hz / 10); - - } - } -} - -void -sequencer_release(int dev, struct fileinfo * file) -{ - int i; - int mode = file->mode & O_ACCMODE; - - dev = dev >> 4; - - DEB(printf("sequencer_release(dev=%d)\n", dev)); - - if (dev) { /* Patch manager device */ - dev--; - pmgr_release(dev); - pmgr_present[dev] = 0; - return; - } - /* - * Wait until the queue is empty (if we don't have nonblock) - */ - - if (mode != OPEN_READ && !0) - while (!(seq_sleep_flag.aborting) && qlen) { - seq_sync(); - } - - if (mode != OPEN_READ) - seq_drain_midi_queues(); /* Ensure the output queues are empty */ - seq_reset(); - if (mode != OPEN_READ) - seq_drain_midi_queues(); /* Flush the all notes off messages */ - - for (i = 0; i < max_synthdev; i++) - if (synth_open_mask & (1 << i)) /* Actually opened */ - if (synth_devs[i]) { - synth_devs[i]->close(i); - - if (synth_devs[i]->midi_dev) - midi_opened[synth_devs[i]->midi_dev] = 0; - } - for (i = 0; i < num_synths; i++) - if (pmgr_present[i]) - pmgr_inform(i, PM_E_CLOSED, 0, 0, 0, 0); - - for (i = 0; i < max_mididev; i++) - if (midi_opened[i]) - midi_devs[i]->close(i); - - if (seq_mode == SEQ_2) - tmr->close(tmr_no); - - sequencer_busy = 0; -} - -static int -seq_sync(void) -{ - u_long flags; - - if (qlen && !seq_playing && !(seq_sleep_flag.aborting)) - seq_startplay(); - - flags = splhigh(); - if (qlen && !(seq_sleep_flag.mode & WK_SLEEP)) { - int chn; - - seq_sleeper = &chn; - DO_SLEEP(chn, seq_sleep_flag, 0); - - } - splx(flags); - - return qlen; -} - -static void -midi_outc(int dev, u_char data) -{ - /* - * NOTE! Calls sleep(). Don't call this from interrupt. - */ - - int n; - u_long flags; - - /* - * This routine sends one byte to the Midi channel. If the output - * Fifo is full, it waits until there is space in the queue - */ - - n = 3 * hz; /* Timeout */ - - flags = splhigh(); - while (n && !midi_devs[dev]->putc(dev, data)) { - int chn; - seq_sleeper = &chn; - DO_SLEEP(chn, seq_sleep_flag, 4); - - n--; - } - splx(flags); -} - -static void -seq_reset(void) -{ - /* - * NOTE! Calls sleep(). Don't call this from interrupt. - */ - - int i; - int chn; - u_long flags; - - sound_stop_timer(); - seq_time = get_time(); - prev_input_time = 0; - prev_event_time = 0; - - qlen = qhead = qtail = 0; - iqlen = iqhead = iqtail = 0; - - for (i = 0; i < max_synthdev; i++) - if (synth_open_mask & (1 << i)) - if (synth_devs[i]) - synth_devs[i]->reset(i); - - if (seq_mode == SEQ_2) { - for (chn = 0; chn < 16; chn++) - for (i = 0; i < max_synthdev; i++) - if ( (synth_open_mask & (1 << i)) && (synth_devs[i]) ) { - synth_devs[i]->controller(i, chn,123,0);/* All notes off */ - synth_devs[i]->controller(i, chn,121,0);/* Reset all ctl */ - synth_devs[i]->bender(i, chn, 1 << 13); /* Bender off */ - } - - } else { /* seq_mode == SEQ_1 */ - for (i = 0; i < max_mididev; i++) - if (midi_written[i]) { - /* Midi used. Some notes may still be playing */ - /* - * Sending just a ACTIVE SENSING message - * should be enough to stop all playing - * notes. Since there are devices not - * recognizing the active sensing, we have to - * send some all notes off messages also. - */ - midi_outc(i, 0xfe); - - for (chn = 0; chn < 16; chn++) { - midi_outc(i, (u_char) (0xb0 + (chn & 0x0f))); /* control change */ - midi_outc(i, 0x7b); /* All notes off */ - midi_outc(i, 0); /* Dummy parameter */ - } - - midi_devs[i]->close(i); - - midi_written[i] = 0; - midi_opened[i] = 0; - } - } - - seq_playing = 0; - - flags = splhigh(); - if ((seq_sleep_flag.mode & WK_SLEEP)) { - seq_sleep_flag.mode = WK_WAKEUP; - wakeup(seq_sleeper); - } - splx(flags); - -} - -static void -seq_panic(void) -{ - /* - * This routine is called by the application in case the user wants - * to reset the system to the default state. - */ - - seq_reset(); - - /* - * Since some of the devices don't recognize the active sensing and - * all notes off messages, we have to shut all notes manually. - * - * TO BE IMPLEMENTED LATER - */ - - /* - * Also return the controllers to their default states - */ -} - -int -sequencer_ioctl(int dev, struct fileinfo * file, - u_int cmd, ioctl_arg arg) -{ - int midi_dev, orig_dev; - int mode = file->mode & O_ACCMODE; - - orig_dev = dev = dev >> 4; - - switch (cmd) { - case SNDCTL_TMR_TIMEBASE: - case SNDCTL_TMR_TEMPO: - case SNDCTL_TMR_START: - case SNDCTL_TMR_STOP: - case SNDCTL_TMR_CONTINUE: - case SNDCTL_TMR_METRONOME: - case SNDCTL_TMR_SOURCE: - if (dev) /* Patch manager */ - return -(EIO); - - if (seq_mode != SEQ_2) - return -(EINVAL); - return tmr->ioctl(tmr_no, cmd, arg); - break; - - case SNDCTL_TMR_SELECT: - if (dev) /* Patch manager */ - return -(EIO); - - if (seq_mode != SEQ_2) - return -(EINVAL); - pending_timer = (*(int *) arg); - - if (pending_timer < 0 || pending_timer >= num_sound_timers) { - pending_timer = -1; - return -(EINVAL); - } - return *(int *) arg = pending_timer; - break; - - case SNDCTL_SEQ_PANIC: - seq_panic(); - break; - - case SNDCTL_SEQ_SYNC: - if (dev) /* Patch manager */ - return -(EIO); - - if (mode == OPEN_READ) - return 0; - while (qlen && !(seq_sleep_flag.aborting)) - seq_sync(); - if (qlen) - return -(EINTR); - else - return 0; - break; - - case SNDCTL_SEQ_RESET: - if (dev) /* Patch manager */ - return -(EIO); - - seq_reset(); - return 0; - break; - - case SNDCTL_SEQ_TESTMIDI: - if (dev) /* Patch manager */ - return -(EIO); - - midi_dev = (*(int *) arg); - if (midi_dev >= max_mididev) - return -(ENXIO); - - if (!midi_opened[midi_dev]) { - int err, mode; - - mode = file->mode & O_ACCMODE; - if ((err = midi_devs[midi_dev]->open(midi_dev, mode, - sequencer_midi_input, sequencer_midi_output)) < 0) - return err; - } - midi_opened[midi_dev] = 1; - - return 0; - break; - - case SNDCTL_SEQ_GETINCOUNT: - if (dev) /* Patch manager */ - return -(EIO); - - if (mode == OPEN_WRITE) - return 0; - return *(int *) arg = iqlen; - break; - - case SNDCTL_SEQ_GETOUTCOUNT: - - if (mode == OPEN_READ) - return 0; - return *(int *) arg = SEQ_MAX_QUEUE - qlen; - break; - - case SNDCTL_SEQ_CTRLRATE: - if (dev) /* Patch manager */ - return -(EIO); - - /* - * If *arg == 0, just return the current rate - */ - if (seq_mode == SEQ_2) - return tmr->ioctl(tmr_no, cmd, arg); - - if ((*(int *) arg) != 0) - return -(EINVAL); - - return *(int *) arg = hz; - break; - - case SNDCTL_SEQ_RESETSAMPLES: - { - int err; - - dev = (*(int *) arg); - if (dev < 0 || dev >= num_synths) - return -(ENXIO); - if (!(synth_open_mask & (1 << dev)) && !orig_dev) - return -(EBUSY); - if (!orig_dev && pmgr_present[dev]) - pmgr_inform(dev, PM_E_PATCH_RESET, 0, 0, 0, 0); - - err = synth_devs[dev]->ioctl(dev, cmd, arg); - return err; - } - break; - - case SNDCTL_SEQ_NRSYNTHS: - return *(int *) arg = max_synthdev; - break; - - case SNDCTL_SEQ_NRMIDIS: - return *(int *) arg = max_mididev; - break; - - case SNDCTL_SYNTH_MEMAVL: - { - int dev = (*(int *) arg); - - if (dev < 0 || dev >= num_synths) - return -(ENXIO); - - if (!(synth_open_mask & (1 << dev)) && !orig_dev) - return -(EBUSY); - - return *(int *) arg = synth_devs[dev]->ioctl(dev, cmd, arg); - } - break; - - case SNDCTL_FM_4OP_ENABLE: - { - int dev = (*(int *) arg); - - if (dev < 0 || dev >= num_synths) - return -(ENXIO); - - if (!(synth_open_mask & (1 << dev))) - return -(ENXIO); - - synth_devs[dev]->ioctl(dev, cmd, arg); - return 0; - } - break; - - case SNDCTL_SYNTH_INFO: - { - struct synth_info inf; - int dev; - - bcopy(&(((char *) arg)[0]), (char *) &inf, sizeof(inf)); - dev = inf.device; - - if (dev < 0 || dev >= max_synthdev) - return -(ENXIO); - - if (!(synth_open_mask & (1 << dev)) && !orig_dev) - return -(EBUSY); - - return synth_devs[dev]->ioctl(dev, cmd, arg); - } - break; - - case SNDCTL_SEQ_OUTOFBAND: - { - struct seq_event_rec event; - u_long flags; - - bcopy(&(((char *) arg)[0]), (char *) &event, sizeof(event)); - - flags = splhigh(); - play_event(event.arr); - splx(flags); - - return 0; - } - break; - - case SNDCTL_MIDI_INFO: - { - struct midi_info inf; - int dev; - - bcopy(&(((char *) arg)[0]), (char *) &inf, sizeof(inf)); - dev = inf.device; - - if (dev < 0 || dev >= max_mididev) - return -(ENXIO); - - bcopy((char *) &(midi_devs[dev]->info), &(((char *) arg)[0]), sizeof(inf)); - return 0; - } - break; - - case SNDCTL_PMGR_IFACE: - { - struct patmgr_info *inf; - int dev, err; - - if ((inf = (struct patmgr_info *) malloc(sizeof(*inf), M_TEMP, M_WAITOK)) == NULL) { - printf("patmgr: Can't allocate memory for a message\n"); - return -(EIO); - } - bcopy(&(((char *) arg)[0]), (char *) inf, sizeof(*inf)); - dev = inf->device; - - if (dev < 0 || dev >= num_synths) { - free(inf, M_TEMP); - return -(ENXIO); - } - if (!synth_devs[dev]->pmgr_interface) { - free(inf, M_TEMP); - return -(ENXIO); - } - if ((err = synth_devs[dev]->pmgr_interface(dev, inf)) == -1) { - free(inf, M_TEMP); - return err; - } - bcopy((char *) inf, &(((char *) arg)[0]), sizeof(*inf)); - free(inf, M_TEMP); - return 0; - } - break; - - case SNDCTL_PMGR_ACCESS: - { - struct patmgr_info *inf; - int dev, err; - - if ((inf = (struct patmgr_info *) malloc(sizeof(*inf), M_TEMP, M_WAITOK)) == NULL) { - printf("patmgr: Can't allocate memory for a message\n"); - return -(EIO); - } - bcopy(&(((char *) arg)[0]), (char *) inf, sizeof(*inf)); - dev = inf->device; - - if (dev < 0 || dev >= num_synths) { - free(inf, M_TEMP); - return -(ENXIO); - } - if (!pmgr_present[dev]) { - free(inf, M_TEMP); - return -(ESRCH); - } - if ((err = pmgr_access(dev, inf)) < 0) { - free(inf, M_TEMP); - return err; - } - bcopy((char *) inf, &(((char *) arg)[0]), sizeof(*inf)); - free(inf, M_TEMP); - return 0; - } - break; - - case SNDCTL_SEQ_THRESHOLD: - { - int tmp = (*(int *) arg); - - if (dev)/* Patch manager */ - return -(EIO); - - if (tmp < 1) - tmp = 1; - if (tmp >= SEQ_MAX_QUEUE) - tmp = SEQ_MAX_QUEUE - 1; - output_treshold = tmp; - return 0; - } - break; - - case SNDCTL_MIDI_PRETIME: - { - int val = (*(int *) arg); - - if (val < 0) - val = 0; - - val = (hz * val) / 10; - pre_event_timeout = val; - return *(int *) arg = val; - } - break; - - default: - if (dev) /* Patch manager */ - return -(EIO); - - if (mode == OPEN_READ) - return -(EIO); - - if (!synth_devs[0]) - return -(ENXIO); - if (!(synth_open_mask & (1 << 0))) - return -(ENXIO); - return synth_devs[0]->ioctl(0, cmd, arg); - break; - } - - return -(EINVAL); -} - -#ifdef ALLOW_POLL -int -sequencer_poll (int dev, struct fileinfo *file, int events, select_table * wait) -{ - unsigned long flags; - int revents = 0; - - dev = dev >> 4; - flags = splhigh(); - - - if (events & (POLLIN | POLLRDNORM)) { - if (!iqlen) - selrecord(wait, &selinfo[dev]); - else { - revents |= events & (POLLIN | POLLRDNORM); - midi_sleep_flag.mode &= ~WK_SLEEP; - } - } - if (events & (POLLOUT | POLLWRNORM)) { - if (qlen >= SEQ_MAX_QUEUE) - selrecord(wait, &selinfo[dev]); - else { - revents |= events & (POLLOUT | POLLWRNORM); - seq_sleep_flag.mode &= ~WK_SLEEP; - } - } - splx(flags); - - return (revents); -} - -#endif - - -void -sequencer_timer(void *dummy) -{ - seq_startplay(); -} - -int -note_to_freq(int note_num) -{ - - /* - * This routine converts a midi note to a frequency (multiplied by - * 1000) - */ - - int note, octave, note_freq; - int notes[] = - { - 261632, 277189, 293671, 311132, 329632, 349232, - 369998, 391998, 415306, 440000, 466162, 493880 - }; - -#define BASE_OCTAVE 5 - - octave = note_num / 12; - note = note_num % 12; - - note_freq = notes[note]; - - if (octave < BASE_OCTAVE) - note_freq >>= (BASE_OCTAVE - octave); - else if (octave > BASE_OCTAVE) - note_freq <<= (octave - BASE_OCTAVE); - - /* - * note_freq >>= 1; - */ - - return note_freq; -} - -u_long -compute_finetune(u_long base_freq, int bend, int range) -{ - u_long amount; - int negative, semitones, cents, multiplier = 1; - - if (!bend) - return base_freq; - if (!range) - return base_freq; - - if (!base_freq) - return base_freq; - - if (range >= 8192) - range = 8192; - - bend = bend * range / 8192; - if (!bend) - return base_freq; - - negative = bend < 0 ? 1 : 0; - - if (bend < 0) - bend *= -1; - if (bend > range) - bend = range; - - /* - * if (bend > 2399) bend = 2399; - */ - while (bend > 2399) { - multiplier *= 4; - bend -= 2400; - } - - semitones = bend / 100; - cents = bend % 100; - - amount = (int) (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 */ -} - - -void -sequencer_init() -{ - - sequencer_ok = 1; - - queue = (u_char *) malloc(SEQ_MAX_QUEUE * EV_SZ, M_DEVBUF, M_NOWAIT); - if (!queue) - panic("SOUND: Cannot allocate memory\n"); - - iqueue = (u_char *) malloc(SEQ_MAX_QUEUE * IEV_SZ, M_DEVBUF, M_NOWAIT); - if (!iqueue) - panic("SOUND: Cannot allocate memory\n"); -} - -#endif -#endif diff --git a/sys/dev/sound/isa/i386/sound.doc b/sys/dev/sound/isa/i386/sound.doc deleted file mode 100644 index 33fa01ec6c..0000000000 --- a/sys/dev/sound/isa/i386/sound.doc +++ /dev/null @@ -1,121 +0,0 @@ -$FreeBSD: src/sys/i386/isa/sound/sound.doc,v 1.12 1999/08/28 00:45:20 peter Exp $ -$DragonFly: src/sys/dev/sound/isa/i386/Attic/sound.doc,v 1.2 2003/06/17 04:28:38 dillon Exp $ - -Instructions on using audio on a FreeBSD 2.1 (or 2.0-current) system. -See also /sys/i386/conf/LINT. - -To enable sound driver support, the controller sound code must be included -in your config file: - -# SB = SoundBlaster; PAS = ProAudioSpectrum; GUS = Gravis UltraSound -# Controls all sound devices -controller snd0 - -Uncomment one or more of these device entries, depending on what type of -sound card you have: - -# ProAudioSpectrum PCM and Midi - for PAS -#device pas0 at isa? port 0x388 irq 10 drq 6 - -# SoundBlaster DSP driver - for SB, SB Pro, SB16, PAS(emulating SB) -#device sb0 at isa? port 0x220 irq 7 drq 1 - -# SoundBlaster 16 DSP driver - for SB16 - requires sb0 device -#device sbxvi0 at isa? drq 5 - -# SoundBlaster 16 MIDI - for SB16 - requires sb0 device -#device sbmidi0 at isa? port 0x300 - -# Gravis UltraSound - for GUS, GUS16, GUSMAX -# For cards that use 2 DMA Channels: -# drq = Write DMA Channel, flags = Read DMA Channel -#device gus0 at isa? port 0x220 irq 11 drq 1 flags 0x3 - -# Gravis UltraSound 16 bit option - for GUS16 - requires gus0 -#device gusxvi0 at isa? port 0x530 irq 7 drq 3 - -# MS Sound System (AD1848 Based Boards) -#device mss0 at isa? port 0x530 irq 10 drq 1 - -# Yamaha OPL-2/OPL-3 FM - for SB, SB Pro, SB16, PAS -#device opl0 at isa? port 0x388 - -# MPU-401 - for MPU-401 standalone card -#device mpu0 at isa? port 0x330 irq 6 drq 0 - -# 6850 UART Midi -#device uart0 at isa? port 0x330 irq 5 - -You may add one or more of the following depending on what you do and don't -want compiled into your kernel. Note: Excluding things with EXCLUDE_... -is NOT recommended unless you really know what you're doing. - -#options EXCLUDE_AUDIO # NO digital audio support -#options EXCLUDE_SEQUENCER # NO sequencer support -#options EXCLUDE_MIDI # NO MIDI support whatsoever -#options EXCLUDE_SBPRO # EXCLUDE SB Pro support -#options EXCLUDE_SB_EMULATION # NO PAS SB emulation support -#options EXCLUDE_GUS_IODETECT # NO GUS io detection -#options EXCLUDE_PRO_MIDI # NO PAS MIDI support - -Other Options: - -#options SYMPHONY_PAS - Adds some code to make pas work with Symphony chipsets. Only use - this if your pas doesn't work and you have a Symphony chipset. - -#options BROKEN_BUS_CLOCK - Some systems with the OPTI chipset and a PAS will require you to - use this option. Symptoms are that you will hear a lot of clicking and - popping sounds, like a geiger counter, coming out of the PAS even when - it is not playing anything. - -#options MOZART_PORT - Adds support for Mozart (OAK OTI-601). (Part of the MSS driver) - -#options OPTI_MAD16_PORT - Adds support for the OPTI MAD16 Chip. (Part of the MSS driver) - If your soundcard has a chip labeled "OPTi 82C929" then try this. - -#options __SGNXPRO__ - Adds support for the SG NX Pro mixer. (Part of the SB driver) - -#options JAZZ16 - Adds support for the MV Jazz16 (ProSonic etc). (Part of the SB Driver) - -#options SM_WAVE - Adds support for the SoundMan Wave (Part of the SB Driver) - Note: You will need to do some work to get this to work. - See i386/isa/sound/configure.c - -#options SM_GAMES - Adds support for the Logitech SoundMan Games (Part of the SB Driver) - -#options PAS_JOYSTICK_ENABLE - Enables the gameport on the ProAudio Spectrum - -NOTE: The MPU-401 driver may or may not work, and is unfortunately -unverifiable since no one I know has one. If you can test this, -please let me know! Also note that you will have to change these -settings if your soundcard is set for a non-standard address or IRQ. -Please check your documentation (or verify with any provided DOS utilities -that may have come with your card) and set the IRQ or address fields -accordingly. - - -Also: You can configure more then one card on a single DMA using -the conflicts keyword in your configuration file. This is useful for boards -with more then one type of emulation. - - -Probing problems: Since the SB16 uses the same IRQ and addresses for -the different drivers, some of the snd drivers will not be probed because -the kernel thinks there is a conflict. This can be worked-around by -using the "conflicts" keyword on the sb16's device line. - - -For further information, contact multimedia@freebsd.org - - - Jordan Hubbard (jkh@freefall.cdrom.com) - - Steven Wallace (swallace@freefall.cdrom.com) - - Sujal Patel (smpatel@wam.umd.edu) diff --git a/sys/dev/sound/isa/i386/sound_calls.h b/sys/dev/sound/isa/i386/sound_calls.h deleted file mode 100644 index 7ef2595c73..0000000000 --- a/sys/dev/sound/isa/i386/sound_calls.h +++ /dev/null @@ -1,291 +0,0 @@ -/* $DragonFly: src/sys/dev/sound/isa/i386/Attic/sound_calls.h,v 1.2 2005/01/31 23:44:35 joerg Exp $ */ - -/* - * DMA buffer calls - */ - -int DMAbuf_open(int dev, int mode); -int DMAbuf_release(int dev, int mode); -int DMAbuf_getwrbuffer(int dev, char **buf, int *size, int dontblock); -int DMAbuf_getrdbuffer(int dev, char **buf, int *len, int dontblock); -int DMAbuf_rmchars(int dev, int buff_no, int c); -int DMAbuf_start_output(int dev, int buff_no, int l); -int DMAbuf_ioctl(int dev, u_int cmd, ioctl_arg arg, int local); -void DMAbuf_init(void); -int DMAbuf_start_dma (int dev, u_long physaddr, int count, int dma_mode); -int DMAbuf_open_dma (int dev); -void DMAbuf_close_dma (int dev); -void DMAbuf_reset_dma (int dev); -void DMAbuf_inputintr(int dev); -void DMAbuf_outputintr(int dev, int underflow_flag); -void DMAbuf_start_devices(u_int devmask); -#ifdef ALLOW_POLL -int DMAbuf_select(int dev, struct fileinfo *file, int sel_type, select_table * wait); -#endif - -/* - * System calls for /dev/dsp and /dev/audio - */ - -int audio_read (int dev, struct fileinfo *file, snd_rw_buf *buf, int count); -int audio_write (int dev, struct fileinfo *file, snd_rw_buf *buf, int count); -int audio_open (int dev, struct fileinfo *file); -void audio_release (int dev, struct fileinfo *file); -int audio_ioctl (int dev, struct fileinfo *file, - u_int cmd, ioctl_arg arg); -int audio_lseek (int dev, struct fileinfo *file, off_t offset, int orig); -/* long audio_init (void); */ - -#ifdef ALLOW_SELECT -int audio_poll(int dev, struct fileinfo *file, int events, select_table * wait); -#endif - -/* - * System calls for the /dev/sequencer - */ - -int sequencer_read (int dev, struct fileinfo *file, snd_rw_buf *buf, int count); -int sequencer_write (int dev, struct fileinfo *file, snd_rw_buf *buf, int count); -int sequencer_open (int dev, struct fileinfo *file); -void sequencer_release (int dev, struct fileinfo *file); -int sequencer_ioctl (int dev, struct fileinfo *file, - u_int cmd, ioctl_arg arg); -int sequencer_lseek (int dev, struct fileinfo *file, off_t offset, int orig); -void sequencer_init (void); -void sequencer_timer(void *dummy); -int note_to_freq(int note_num); -u_long compute_finetune(u_long base_freq, int bend, int range); -void seq_input_event(u_char *event, int len); -void seq_copy_to_input (u_char *event, int len); - - -/* - * System calls for the /dev/midi - */ - -int MIDIbuf_read (int dev, struct fileinfo *file, snd_rw_buf *buf, int count); -int MIDIbuf_write (int dev, struct fileinfo *file, snd_rw_buf *buf, int count); -int MIDIbuf_open (int dev, struct fileinfo *file); -void MIDIbuf_release (int dev, struct fileinfo *file); -int MIDIbuf_ioctl (int dev, struct fileinfo *file, - u_int cmd, ioctl_arg arg); -int MIDIbuf_lseek (int dev, struct fileinfo *file, off_t offset, int orig); -void MIDIbuf_bytes_received(int dev, u_char *buf, int count); - -/* - * - * Misc calls from various sources - */ - -/* From soundcard.c */ -void soundcard_init(void); -void tenmicrosec(int); -void request_sound_timer (int count); -void sound_stop_timer(void); -int snd_ioctl_return(int *addr, int value); -int snd_set_irq_handler (int int_lvl, void(*hndlr)(int), sound_os_info *osp); -void sound_dma_malloc(int dev); -void sound_dma_free(int dev); -void conf_printf(char *name, struct address_info *hw_config); -void conf_printf2(char *name, int base, int irq, int dma, int dma2); - -/* From sound_switch.c */ -int sound_read_sw (int dev, struct fileinfo *file, snd_rw_buf *buf, int count); -int sound_write_sw (int dev, struct fileinfo *file, snd_rw_buf *buf, int count); -int sound_open_sw (int dev, struct fileinfo *file); -void sound_release_sw (int dev, struct fileinfo *file); -int sound_ioctl_sw (int dev, struct fileinfo *file, u_int cmd, ioctl_arg arg); - -/* From sb_dsp.c */ -int sb_dsp_detect (struct address_info *hw_config); -void sb_dsp_init (struct address_info *hw_config); -void sb_dsp_disable_midi(void); -int sb_dsp_command (u_char val); -ointhand2_t sbintr; -int sb_reset_dsp (void); - -/* From sb16_dsp.c */ -void sb16_dsp_interrupt (int irq); -void sb16_dsp_init(struct address_info *hw_config); -int sb16_dsp_detect(struct address_info *hw_config); - -/* From sb16_midi.c */ -void sb16midiintr (int unit); -void attach_sb16midi(struct address_info * hw_config); -int probe_sb16midi(struct address_info *hw_config); -void sb_midi_interrupt(int dummy); - -/* From sb_midi.c */ -void sb_midi_init(int model); - -/* From sb_mixer.c */ -void sb_setmixer (u_int port, u_int value); -int sb_getmixer (u_int port); -void sb_mixer_set_stereo(int mode); -int sb_mixer_init(int major_model); - -/* From opl3.c */ -int opl3_detect (int ioaddr, sound_os_info *osp); -void opl3_init(int ioaddr, sound_os_info *osp); - -/* From sb_card.c */ -void attach_sb_card(struct address_info *hw_config); -int probe_sb(struct address_info *hw_config); - -/* From adlib_card.c */ -void attach_adlib_card(struct address_info *hw_config); -int probe_adlib(struct address_info *hw_config); - -/* From pas_card.c */ -void attach_pas_card(struct address_info *hw_config); -int probe_pas(struct address_info *hw_config); -ointhand2_t pasintr; -int pas_set_intr(int mask); -int pas_remove_intr(int mask); -u_char pas_read(int ioaddr); -void pas_write(u_char data, int ioaddr); - -/* From pas_audio.c */ -void pas_pcm_interrupt(u_char status, int cause); -void pas_pcm_init(struct address_info *hw_config); - -/* From pas_mixer.c */ -int pas_init_mixer(void); - -/* From pas_midi.c */ -void pas_midi_init(void); -void pas_midi_interrupt(void); - -/* From gus_card.c */ -void attach_gus_card(struct address_info * hw_config); -int probe_gus(struct address_info *hw_config); -int gus_set_midi_irq(int num); -ointhand2_t gusintr; -void attach_gus_db16(struct address_info * hw_config); -int probe_gus_db16(struct address_info *hw_config); - -/* From gus_wave.c */ -int gus_wave_detect(int baseaddr); -void gus_wave_init(struct address_info *hw_config); -void gus_voice_irq(void); -u_char gus_read8 (int reg); -void gus_write8(int reg, u_int data); -void guswave_dma_irq(void); -void gus_delay(void); -int gus_default_mixer_ioctl (int dev, u_int cmd, ioctl_arg arg); -void gus_timer_command (u_int addr, u_int val); - -/* From gus_midi.c */ -void gus_midi_init(void); -void gus_midi_interrupt(int dummy); - -/* From mpu401.c */ -void attach_mpu401(struct address_info * hw_config); -int probe_mpu401(struct address_info *hw_config); -ointhand2_t mpuintr; - -/* From uart6850.c */ -void attach_uart6850(struct address_info * hw_config); -ointhand2_t m6850intr; -int probe_uart6850(struct address_info *hw_config); - -/* From opl3.c */ -void enable_opl3_mode(int left, int right, int both); - -/* From patmgr.c */ -int pmgr_open(int dev); -void pmgr_release(int dev); -int pmgr_read (int dev, struct fileinfo *file, snd_rw_buf * buf, int count); -int pmgr_write (int dev, struct fileinfo *file, snd_rw_buf * buf, int count); -int pmgr_access(int dev, struct patmgr_info *rec); -int pmgr_inform(int dev, int event, u_long parm1, u_long parm2, - u_long parm3, u_long parm4); - -/* From ics2101.c */ -void ics2101_mixer_init(void); - -/* From sound_timer.c */ -void sound_timer_interrupt(void); -void sound_timer_syncinterval(u_int new_usecs); - -/* From ad1848.c */ -void ad1848_init (char *name, int io_base, int irq, int dma_playback, int dma_capture, int share_dma, sound_os_info *osp); -ointhand2_t adintr; - -int ad1848_detect (int io_base, int *flags, sound_os_info *osp); -#define AD_F_CS4231 0x0001 /* Returned if a CS4232 (or compatible) detected */ -#define AD_F_CS4248 0x0001 /* Returned if a CS4248 (or compatible) detected */ - -void ad1848_interrupt (int irq); -void attach_mss(struct address_info * hw_config); -int probe_mss(struct address_info *hw_config); -void attach_pnp_ad1848(struct address_info * hw_config); -int probe_pnp_ad1848(struct address_info *hw_config); - -/* From pss.c */ -int probe_pss (struct address_info *hw_config); -void attach_pss (struct address_info *hw_config); -int probe_pss_mpu (struct address_info *hw_config); -void attach_pss_mpu (struct address_info *hw_config); -int probe_pss_mss (struct address_info *hw_config); -void attach_pss_mss (struct address_info *hw_config); - -/* From sscape.c */ -int probe_sscape (struct address_info *hw_config); -void attach_sscape (struct address_info *hw_config); -int probe_ss_mss(struct address_info *hw_config); -void attach_ss_mss(struct address_info * hw_config); -ointhand2_t sscapeintr; - -int pss_read (int dev, struct fileinfo *file, snd_rw_buf *buf, int count); -int pss_write (int dev, struct fileinfo *file, snd_rw_buf *buf, int count); -int pss_open (int dev, struct fileinfo *file); -void pss_release (int dev, struct fileinfo *file); -int pss_ioctl (int dev, struct fileinfo *file, - u_int cmd, ioctl_arg arg); -int pss_lseek (int dev, struct fileinfo *file, off_t offset, int orig); -void pss_init(void); - -/* From aedsp16.c */ -int InitAEDSP16_SBPRO(struct address_info *hw_config); -int InitAEDSP16_MSS(struct address_info *hw_config); -int InitAEDSP16_MPU401(struct address_info *hw_config); - -/* From midi_synth.c */ -void do_midi_msg (int synthno, u_char *msg, int mlen); - -/* From trix.c */ -void attach_trix_wss (struct address_info *hw_config); -int probe_trix_wss (struct address_info *hw_config); -void attach_trix_sb (struct address_info *hw_config); -int probe_trix_sb (struct address_info *hw_config); -void attach_trix_mpu (struct address_info *hw_config); -int probe_trix_mpu (struct address_info *hw_config); - -/* From mad16.c */ -void attach_mad16 (struct address_info *hw_config); -int probe_mad16 (struct address_info *hw_config); -void attach_mad16_mpu (struct address_info *hw_config); -int probe_mad16_mpu (struct address_info *hw_config); -int mad16_sb_dsp_detect (struct address_info *hw_config); -void mad16_sb_dsp_init (struct address_info *hw_config); - -/* From cs4232.c */ - -int probe_cs4232 (struct address_info *hw_config); -void attach_cs4232 (struct address_info *hw_config); -int probe_cs4232_mpu (struct address_info *hw_config); -void attach_cs4232_mpu (struct address_info *hw_config); - -/* From maui.c */ -void attach_maui(struct address_info * hw_config); -int probe_maui(struct address_info *hw_config); - -/* From sound_pnp.c */ -void sound_pnp_init(void); -void sound_pnp_disconnect(void); - -/* From pcm86.c */ -void attach_nss(struct address_info * hw_config); -int probe_nss(struct address_info *hw_config); -ointhand2_t nssintr; diff --git a/sys/dev/sound/isa/i386/sound_config.h b/sys/dev/sound/isa/i386/sound_config.h deleted file mode 100644 index 14e9f54119..0000000000 --- a/sys/dev/sound/isa/i386/sound_config.h +++ /dev/null @@ -1,212 +0,0 @@ -/* sound_config.h - * - * A driver for Soundcards, misc configuration parameters. - * - * Copyright by Hannu Savolainen 1995 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/sound/sound_config.h,v 1.20 1999/12/27 04:37:19 tanimura Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/sound_config.h,v 1.3 2003/08/07 21:17:12 dillon Exp $ - * - */ - -/* - * many variables should be reduced to a range. Here define a macro - */ - -#define RANGE(var, low, high) (var) = \ - ((var)<(low)?(low) : (var)>(high)?(high) : (var)) - -#undef CONFIGURE_SOUNDCARD -#undef DYNAMIC_BUFFER - -#include - -#define CONFIGURE_SOUNDCARD -#define DYNAMIC_BUFFER -#undef LOADABLE_SOUNDCARD - -#include -#include "soundvers.h" - -#if defined(ISC) || defined(SCO) || defined(SVR42) -#define GENERIC_SYSV -#endif - -#ifndef SND_DEFAULT_ENABLE -#define SND_DEFAULT_ENABLE 1 -#endif - -#ifdef CONFIGURE_SOUNDCARD - -#ifndef MAX_REALTIME_FACTOR -#define MAX_REALTIME_FACTOR 4 -#endif - -/************* PCM DMA buffer sizes *******************/ - -/* If you are using high playback or recording speeds, the default buffersize - is too small. DSP_BUFFSIZE must be 64k or less. - - A rule of thumb is 64k for PAS16, 32k for PAS+, 16k for SB Pro and - 4k for SB. - - If you change the DSP_BUFFSIZE, don't modify this file. - Use the make config command instead. Seems to allow only 4K, 16K, - 32K, 64K. - */ - -#ifndef DSP_BUFFSIZE -#define DSP_BUFFSIZE (32760) -#endif - -#ifndef DSP_BUFFCOUNT -#define DSP_BUFFCOUNT 1 /* 1 is recommended. */ -#endif - -#define DMA_AUTOINIT 0x10 /* XXX never used */ - -#ifdef PC98 -#define FM_MONO 0x28d2 -#else -#define FM_MONO 0x388 /* This is the I/O address used by AdLib */ -#endif - -#ifndef AWE32_BASE -#define AWE32_BASE 0x620 /* Default = 0x620-3, 0xA20-3, 0xE20-3 */ -#endif - -#ifndef PAS_BASE -#define PAS_BASE 0x388 -#endif - -#ifdef JAZZ16 -#ifndef JAZZ_DMA16 -#define JAZZ_DMA16 5 -#endif -#endif - -/* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the - driver. (There is no need to alter this) */ -#define SEQ_MAX_QUEUE 1024 - -#define SBFM_MAXINSTR (256) /* Size of the FM Instrument bank */ -/* 128 instruments for general MIDI setup and 16 unassigned */ - -/* - * Minor numbers for the sound driver. - * - * Unfortunately Creative called the codec chip of SB as a DSP. For this - * reason the /dev/dsp is reserved for digitized audio use. There is a - * device for true DSP processors but it will be called something else. - * In v3.0 it's /dev/sndproc but this could be a temporary solution. - */ - -#define SND_NDEVS 256 /* Number of supported devices */ - -#define SND_DEV_CTL 0 /* Control port /dev/mixer */ -#define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM - synthesizer and MIDI output) */ -#define SND_DEV_MIDIN 2 /* Raw midi access */ -#define SND_DEV_DSP 3 /* Digitized voice /dev/dsp */ -#define SND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */ -#define SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */ -#define SND_DEV_STATUS 6 /* /dev/sndstat */ -/* #7 not in use now. Was in 2.4. Free for use after v3.0. */ -#define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */ -#define SND_DEV_SNDPROC 9 /* /dev/sndproc for programmable devices */ -#define SND_DEV_PSS SND_DEV_SNDPROC - -#define DSP_DEFAULT_SPEED 8000 - -#define ON 1 -#define OFF 0 - -#define MAX_AUDIO_DEV 5 -#define MAX_MIXER_DEV 5 -#define MAX_SYNTH_DEV 3 -#define MAX_MIDI_DEV 6 -#define MAX_TIMER_DEV 3 - -struct fileinfo { - int mode; /* Open mode */ - int flags; - int dummy; /* Reference to file-flags. OS-dependent. */ -}; - -struct address_info { - int io_base; - int irq; - int dma; - int dma2; - int always_detect; /* 1=Trust me, it's there */ - char *name; - sound_os_info *osp; /* OS specific info */ - int card_subtype; /* Driver specific. Usually 0 */ -}; - -#define SYNTH_MAX_VOICES 32 - -struct voice_alloc_info { - int max_voice; - int used_voices; - int ptr; /* For device specific use */ - unsigned short map[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */ - int timestamp; - int alloc_times[SYNTH_MAX_VOICES]; -}; - -struct channel_info { - int pgm_num; - int bender_value; - unsigned char controllers[128]; -}; - -/* - * Process wakeup reasons - */ -#define WK_NONE 0x00 -#define WK_WAKEUP 0x01 -#define WK_TIMEOUT 0x02 -#define WK_SIGNAL 0x04 -#define WK_SLEEP 0x08 - -#define OPEN_READ PCM_ENABLE_INPUT -#define OPEN_WRITE PCM_ENABLE_OUTPUT -#define OPEN_READWRITE (OPEN_READ|OPEN_WRITE) - -#include "sound_calls.h" -#include "dev_table.h" - -#ifndef DEB -#define DEB(x) -#endif -#ifndef DDB -/* #define DDB(x) x XXX */ -#define DDB(x) -#endif - -#define TIMER_ARMED 121234 -#define TIMER_NOT_ARMED 1 - -#endif diff --git a/sys/dev/sound/isa/i386/sound_pnp.c b/sys/dev/sound/isa/i386/sound_pnp.c deleted file mode 100644 index 52f213e64c..0000000000 --- a/sys/dev/sound/isa/i386/sound_pnp.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - * sound/sound_pnp.c - * - * PnP soundcard support (Linux spesific) - * - * Copyright by Hannu Savolainen 1995 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/sound_pnp.c,v 1.2 2003/08/07 21:17:12 dillon Exp $ - */ -#include "sound_config.h" - -/* - * XXX check what to use in place of CONFIG_PNP - */ -#if (NSND > 0) && defined(CONFIG_PNP) - -#include - -static struct pnp_sounddev *pnp_devs[20] = { NULL }; - -static int max_pnpdevs = 20; -static int nr_pnpdevs = 0; -static int pnp_sig = 0; - -void -install_pnp_sounddrv(struct pnp_sounddev * drv) -{ - if (nr_pnpdevs < max_pnpdevs) { - pnp_devs[nr_pnpdevs++] = drv; - } else - printf("Sound: More than 20 PnP drivers defined\n"); -} - -void -cs4232_pnp(void *parm) -{ - struct pnp_dev *dev = (struct pnp_dev *) parm; - char *name; - - int portmask = 0x00, irqmask = 0x01, dmamask = 0x03; - int opl3_driver, wss_driver; - - printf("CS4232 driver waking up\n"); - - if (dev->card && dev->card->name) - name = dev->card->name; - else - name = "PnP WSS"; - - if ((wss_driver = sndtable_identify_card("AD1848"))) - portmask |= 0x01; /* MSS */ - else - printf("Sound: MSS/WSS device detected but no driver enabled\n"); - - if ((opl3_driver = sndtable_identify_card("OPL3"))) - portmask |= 0x02; /* OPL3 */ - else - printf("Sound: OPL3/4 device detected but no driver enabled\n"); - - printf("WSS driver %d, OPL3 driver %d\n", wss_driver, opl3_driver); - - if (!portmask) /* No drivers available */ - return; - - if (!pnp_allocate_device(pnp_sig, dev, portmask, irqmask, dmamask, 0x00)) - printf("Device activation failed\n"); - else { - struct address_info hw_config; - int wss_base, opl3_base; - int irq; - int dma1, dma2; - - printf("Device activation OK\n"); - wss_base = pnp_get_port(dev, 0); - opl3_base = pnp_get_port(dev, 1); - irq = pnp_get_irq(dev, 0); - dma1 = pnp_get_dma(dev, 0); - dma2 = pnp_get_dma(dev, 1); - - printf("I/O0 %03x\n", wss_base); - printf("I/O1 %03x\n", opl3_base); - printf("IRQ %d\n", irq); - printf("DMA0 %d\n", dma1); - printf("DMA1 %d\n", dma2); - - if (opl3_base && opl3_driver) { - hw_config.io_base = opl3_base; - hw_config.irq = 0; - hw_config.dma = -1; - hw_config.dma2 = -1; - hw_config.always_detect = 0; - hw_config.name = ""; - hw_config.osp = NULL; - hw_config.card_subtype = 0; - - if (sndtable_probe(opl3_driver, &hw_config)) - sndtable_init_card(opl3_driver, &hw_config); - - } - if (wss_base && wss_driver) { - hw_config.io_base = wss_base; - hw_config.irq = irq; - hw_config.dma = dma1; - hw_config.dma2 = (dma2 == NO_DMA) ? dma1 : dma2; - hw_config.always_detect = 0; - hw_config.name = name; - hw_config.osp = NULL; - hw_config.card_subtype = 0; - - if (sndtable_probe(wss_driver, &hw_config)) - sndtable_init_card(wss_driver, &hw_config); - - } - } -} - -static int -pnp_activate(int id, struct pnp_dev * dev) -{ - int i; - - for (i = 0; i < nr_pnpdevs; i++) - if (pnp_devs[i]->id == id) { - - printf("PnP dev: %08x, %s\n", id, pnp_devid2asc(id)); - - pnp_devs[i]->setup((void *) dev); - return 1; - } - return 0; -} - -void -sound_pnp_init(void) -{ - static struct pnp_sounddev cs4232_dev = - {PNP_DEVID('C', 'S', 'C', 0x0000), cs4232_pnp, "CS4232"}; - - struct pnp_dev *dev; - - install_pnp_sounddrv(&cs4232_dev); - - dev = NULL; - - if ((pnp_sig = pnp_connect("sound")) == -1) { - printf("Sound: Can't connect to kernel PnP services.\n"); - return; - } - while ((dev = pnp_get_next_device(pnp_sig, dev)) != NULL) { - if (!pnp_activate(dev->key, dev)) { - /* Scan all compatible devices */ - - int i; - - for (i = 0; i < dev->ncompat; i++) - if (pnp_activate(dev->compat_keys[i], dev)) - break; - } - } -} - -void -sound_pnp_disconnect(void) -{ - pnp_disconnect(pnp_sig); -} -#endif diff --git a/sys/dev/sound/isa/i386/sound_switch.c b/sys/dev/sound/isa/i386/sound_switch.c deleted file mode 100644 index 80bfd82fe5..0000000000 --- a/sys/dev/sound/isa/i386/sound_switch.c +++ /dev/null @@ -1,500 +0,0 @@ -/* - * sound/sound_switch.c - * - * The system call switch - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/sound_switch.c,v 1.2 2003/08/07 21:17:12 dillon Exp $ - */ - -#include "sound_config.h" - -#if NSND > 0 - -#define SNDSTAT_BUF_SIZE 4000 - -/* - * /dev/sndstatus -device - */ -static char *status_buf = NULL; -static int status_len, status_ptr; -static int status_busy = 0; - -static int -put_status(char *s) -{ - int l = strlen(s); - - if (status_len + l >= SNDSTAT_BUF_SIZE) - return 0; - - bcopy(s, &status_buf[status_len], l); - status_len += l; - - return 1; -} - -/* - * in principle, we never overflow the buffer. But... if radix=2 ... - * and if smaller... lr970711 - */ - -static int -put_status_int(u_int val, int radix) -{ - int l, v; - static char hx[] = "0123456789abcdef"; - char buf[33]; /* int is 32 bit+null, in base 2 */ - - if (radix < 2 || radix > 16) /* better than panic */ - return put_status("???"); - - if (!val) - return put_status("0"); - - l = 0; - buf[10] = 0; - - while (val) { - v = val % radix; - val = val / radix; - - buf[9 - l] = hx[v]; - l++; - } - - if (status_len + l >= SNDSTAT_BUF_SIZE) - return 0; - - bcopy(&buf[10 - l], &status_buf[status_len], l); - status_len += l; - - return 1; -} - -static void -init_status(void) -{ - /* - * Write the status information to the status_buf and update - * status_len. There is a limit of SNDSTAT_BUF_SIZE bytes for the data. - * put_status handles this and returns 0 in case of failure. Since - * it never oveflows the buffer, we do not care to check. - */ - - int i; - - status_ptr = 0; - -#ifdef SOUND_UNAME_A - put_status("VoxWare Sound Driver:" SOUND_VERSION_STRING - " (" SOUND_CONFIG_DATE " " SOUND_CONFIG_BY ",\n" - SOUND_UNAME_A ")\n"); -#else - put_status("VoxWare Sound Driver:" SOUND_VERSION_STRING - " (" SOUND_CONFIG_DATE " " SOUND_CONFIG_BY "@" - SOUND_CONFIG_HOST "." SOUND_CONFIG_DOMAIN ")\n"); -#endif - - put_status("Config options: ") ; - /* put_status_int(SELECTED_SOUND_OPTIONS, 16) ; */ - put_status("\n\nInstalled drivers: \n") ; - - for (i = 0; i < num_sound_drivers; i++) - if (sound_drivers[i].card_type != 0) { - put_status("Type ") ; - put_status_int(sound_drivers[i].card_type, 10); - put_status(": ") ; - put_status(sound_drivers[i].name) ; - put_status("\n") ; - } - put_status("\n\nCard config: \n") ; - - for (i = 0; i < num_sound_cards; i++) - if (snd_installed_cards[i].card_type != 0) { - int drv, tmp; - - if (!snd_installed_cards[i].enabled) - put_status("(") ; - - if ((drv = snd_find_driver(snd_installed_cards[i].card_type)) != -1) - put_status(sound_drivers[drv].name) ; - - put_status(" at 0x") ; - put_status_int(snd_installed_cards[i].config.io_base, 16); - - put_status(" irq ") ; - tmp = snd_installed_cards[i].config.irq; - if (tmp < 0) - tmp = -tmp; - put_status_int(tmp, 10) ; - - if (snd_installed_cards[i].config.dma != -1) { - put_status(" drq ") ; - put_status_int(snd_installed_cards[i].config.dma, 10) ; - if (snd_installed_cards[i].config.dma2 != -1) { - put_status(",") ; - put_status_int(snd_installed_cards[i].config.dma2, 10) ; - } - } - if (!snd_installed_cards[i].enabled) - put_status(")") ; - - put_status("\n") ; - } - if (!sound_started) { - put_status("\n\n***** Sound driver not started *****\n\n"); - return; - } -#ifndef CONFIG_AUDIO - put_status("\nAudio devices: NOT ENABLED IN CONFIG\n") ; -#else - put_status("\nAudio devices:\n") ; - - for (i = 0; i < num_audiodevs; i++) { - put_status_int(i, 10) ; - put_status(": ") ; - put_status(audio_devs[i]->name) ; - - if (audio_devs[i]->flags & DMA_DUPLEX) - put_status(" (DUPLEX)") ; - - put_status("\n") ; - } -#endif - -#ifndef CONFIG_SEQUENCER - put_status("\nSynth devices: NOT ENABLED IN CONFIG\n"); -#else - put_status("\nSynth devices:\n") ; - - for (i = 0; i < num_synths; i++) { - put_status_int(i, 10) ; - put_status(": ") ; - put_status(synth_devs[i]->info->name) ; - put_status("\n") ; - } -#endif - -#ifndef CONFIG_MIDI - put_status("\nMidi devices: NOT ENABLED IN CONFIG\n") ; -#else - put_status("\nMidi devices:\n") ; - - for (i = 0; i < num_midis; i++) { - put_status_int(i, 10) ; - put_status(": ") ; - put_status(midi_devs[i]->info.name) ; - put_status("\n") ; - } -#endif - - put_status("\nTimers:\n"); - - for (i = 0; i < num_sound_timers; i++) { - put_status_int(i, 10); - put_status(": "); - put_status(sound_timer_devs[i]->info.name); - put_status("\n"); - } - - put_status("\nMixers:\n"); - - for (i = 0; i < num_mixers; i++) { - put_status_int(i, 10); - put_status(": "); - put_status(mixer_devs[i]->name); - put_status("\n"); - } -} - -static int -read_status(snd_rw_buf * buf, int count) -{ - /* - * Return at most 'count' bytes from the status_buf. - */ - int l, c; - - l = count; - c = status_len - status_ptr; - - if (l > c) - l = c; - if (l <= 0) - return 0; - - - if (uiomove(&status_buf[status_ptr], l, buf)) { - printf("sb: Bad copyout()!\n"); - }; - status_ptr += l; - - return l; -} - -int -sound_read_sw(int dev, struct fileinfo * file, snd_rw_buf * buf, int count) -{ - DEB(printf("sound_read_sw(dev=%d, count=%d)\n", dev, count)); - - switch (dev & 0x0f) { - case SND_DEV_STATUS: - return read_status(buf, count); - break; - -#ifdef CONFIG_AUDIO - case SND_DEV_DSP: - case SND_DEV_DSP16: - case SND_DEV_AUDIO: - return audio_read(dev, file, buf, count); - break; -#endif - -#ifdef CONFIG_SEQUENCER - case SND_DEV_SEQ: - case SND_DEV_SEQ2: - return sequencer_read(dev, file, buf, count); - break; -#endif - -#ifdef CONFIG_MIDI - case SND_DEV_MIDIN: - return MIDIbuf_read(dev, file, buf, count); -#endif - - default: - printf("Sound: Undefined minor device %d\n", dev); - } - - return -(EPERM); -} - -int -sound_write_sw(int dev, struct fileinfo * file, snd_rw_buf * buf, int count) -{ - - DEB(printf("sound_write_sw(dev=%d, count=%d)\n", dev, count)); - - switch (dev & 0x0f) { - -#ifdef CONFIG_SEQUENCER - case SND_DEV_SEQ: - case SND_DEV_SEQ2: - return sequencer_write(dev, file, buf, count); - break; -#endif - -#ifdef CONFIG_AUDIO - case SND_DEV_DSP: - case SND_DEV_DSP16: - case SND_DEV_AUDIO: - return audio_write(dev, file, buf, count); - break; -#endif - -#ifdef CONFIG_MIDI - case SND_DEV_MIDIN: - return MIDIbuf_write(dev, file, buf, count); -#endif - - default: - return -(EPERM); - } - - return count; -} - -int -sound_open_sw(int dev, struct fileinfo * file) -{ - int retval; - - DEB(printf("sound_open_sw(dev=%d)\n", dev)); - - if ((dev >= SND_NDEVS) || (dev < 0)) { - printf("Invalid minor device %d\n", dev); - return -(ENXIO); - } - switch (dev & 0x0f) { - case SND_DEV_STATUS: - if (status_busy) - return -(EBUSY); - status_busy = 1; - if ((status_buf = (char *) malloc(SNDSTAT_BUF_SIZE, M_TEMP, M_WAITOK)) == NULL) - return -(EIO); - status_len = status_ptr = 0; - init_status(); - break; - - case SND_DEV_CTL: - return 0; - break; - -#ifdef CONFIG_SEQUENCER - case SND_DEV_SEQ: - case SND_DEV_SEQ2: - if ((retval = sequencer_open(dev, file)) < 0) - return retval; - break; -#endif - -#ifdef CONFIG_MIDI - case SND_DEV_MIDIN: - if ((retval = MIDIbuf_open(dev, file)) < 0) - return retval; - break; -#endif - -#ifdef CONFIG_AUDIO - case SND_DEV_DSP: - case SND_DEV_DSP16: - case SND_DEV_AUDIO: - if ((retval = audio_open(dev, file)) < 0) - return retval; - break; -#endif - - default: - printf("Invalid minor device %d\n", dev); - return -(ENXIO); - } - - return 0; -} - -void -sound_release_sw(int dev, struct fileinfo * file) -{ - - DEB(printf("sound_release_sw(dev=%d)\n", dev)); - - switch (dev & 0x0f) { - case SND_DEV_STATUS: - if (status_buf) - free(status_buf, M_TEMP); - status_buf = NULL; - status_busy = 0; - break; - - case SND_DEV_CTL: - break; - -#ifdef CONFIG_SEQUENCER - case SND_DEV_SEQ: - case SND_DEV_SEQ2: - sequencer_release(dev, file); - break; -#endif - -#ifdef CONFIG_MIDI - case SND_DEV_MIDIN: - MIDIbuf_release(dev, file); - break; -#endif - -#ifdef CONFIG_AUDIO - case SND_DEV_DSP: - case SND_DEV_DSP16: - case SND_DEV_AUDIO: - audio_release(dev, file); - break; -#endif - - default: - printf("Sound error: Releasing unknown device 0x%02x\n", dev); - } -} - -int -sound_ioctl_sw(int dev, struct fileinfo * file, u_int cmd, ioctl_arg arg) -{ - DEB(printf("sound_ioctl_sw(dev=%d, cmd=0x%x, arg=0x%x)\n", dev, cmd, arg)); - - if (((cmd >> 8) & 0xff) == 'M' && num_mixers > 0) /* Mixer ioctl */ - if ((dev & 0x0f) != SND_DEV_CTL) { - int dtype = dev & 0x0f; - int mixdev; - - switch (dtype) { -#ifdef CONFIG_AUDIO - case SND_DEV_DSP: - case SND_DEV_DSP16: - case SND_DEV_AUDIO: - mixdev = audio_devs[dev >> 4]->mixer_dev; - if (mixdev < 0 || mixdev >= num_mixers) - return -(ENXIO); - return mixer_devs[mixdev]->ioctl(mixdev, cmd, arg); - break; -#endif - - default: - return mixer_devs[0]->ioctl(0, cmd, arg); - } - } - switch (dev & 0x0f) { - - case SND_DEV_CTL: - - if (!num_mixers) - return -(ENXIO); - - dev = dev >> 4; - - if (dev >= num_mixers) - return -(ENXIO); - - return mixer_devs[dev]->ioctl(dev, cmd, arg); - break; - -#ifdef CONFIG_SEQUENCER - case SND_DEV_SEQ: - case SND_DEV_SEQ2: - return sequencer_ioctl(dev, file, cmd, arg); - break; -#endif - -#ifdef CONFIG_AUDIO - case SND_DEV_DSP: - case SND_DEV_DSP16: - case SND_DEV_AUDIO: - return audio_ioctl(dev, file, cmd, arg); - break; -#endif - -#ifdef CONFIG_MIDI - case SND_DEV_MIDIN: - return MIDIbuf_ioctl(dev, file, cmd, arg); - break; -#endif - - default: - return -(EPERM); - break; - } - - return -(EPERM); -} - -#endif diff --git a/sys/dev/sound/isa/i386/sound_timer.c b/sys/dev/sound/isa/i386/sound_timer.c deleted file mode 100644 index 32a265186c..0000000000 --- a/sys/dev/sound/isa/i386/sound_timer.c +++ /dev/null @@ -1,345 +0,0 @@ -/* - * sound/sound_timer.c - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/sound_timer.c,v 1.2 2003/08/07 21:17:12 dillon Exp $ - */ - -#define SEQUENCER_C -#include "sound_config.h" - -#if NSND > 0 - -#if defined(CONFIG_SEQUENCER) - -static volatile int initialized = 0, opened = 0, tmr_running = 0; -static volatile time_t tmr_offs, tmr_ctr; -static volatile u_long ticks_offs; -static volatile int curr_tempo, curr_timebase; -static volatile u_long curr_ticks; -static volatile u_long next_event_time; -static u_long prev_event_time; -static volatile u_long usecs_per_tmr; /* Length of the current interval */ - -static struct sound_lowlev_timer *tmr = NULL; - -static u_long -tmr2ticks(int tmr_value) -{ - /* - * Convert timer ticks to MIDI ticks - */ - - u_long tmp; - u_long scale; - - tmp = tmr_value * usecs_per_tmr; /* Convert to usecs */ - - scale = (60 * 1000000) / (curr_tempo * curr_timebase); /* usecs per MIDI tick */ - - return (tmp + (scale / 2)) / scale; -} - -static void -reprogram_timer(void) -{ - u_long usecs_per_tick; - - usecs_per_tick = (60 * 1000000) / (curr_tempo * curr_timebase); - - /* - * Don't kill the system by setting too high timer rate - */ - if (usecs_per_tick < 2000) - usecs_per_tick = 2000; - - usecs_per_tmr = tmr->tmr_start(tmr->dev, usecs_per_tick); -} - -void -sound_timer_syncinterval(u_int new_usecs) -{ - /* - * This routine is called by the hardware level if the clock - * frequency has changed for some reason. - */ - tmr_offs = tmr_ctr; - ticks_offs += tmr2ticks(tmr_ctr); - tmr_ctr = 0; - - usecs_per_tmr = new_usecs; -} - -static void -tmr_reset(void) -{ - u_long flags; - - flags = splhigh(); - tmr_offs = 0; - ticks_offs = 0; - tmr_ctr = 0; - next_event_time = 0xffffffff; - prev_event_time = 0; - curr_ticks = 0; - splx(flags); -} - -static int -timer_open(int dev, int mode) -{ - if (opened) - return -(EBUSY); - - tmr_reset(); - curr_tempo = 60; - curr_timebase = hz; - opened = 1; - reprogram_timer(); - - return 0; -} - -static void -timer_close(int dev) -{ - opened = tmr_running = 0; - tmr->tmr_disable(tmr->dev); -} - -static int -timer_event(int dev, u_char *event) -{ - u_char cmd = event[1]; - u_long parm = *(int *) &event[4]; - - switch (cmd) { - case TMR_WAIT_REL: - parm += prev_event_time; - case TMR_WAIT_ABS: - if (parm > 0) { - long time; - - if (parm <= curr_ticks) /* It's the time */ - return TIMER_NOT_ARMED; - - time = parm; - next_event_time = prev_event_time = time; - - return TIMER_ARMED; - } - break; - - case TMR_START: - tmr_reset(); - tmr_running = 1; - reprogram_timer(); - break; - - case TMR_STOP: - tmr_running = 0; - break; - - case TMR_CONTINUE: - tmr_running = 1; - reprogram_timer(); - break; - - case TMR_TEMPO: - if (parm) { - if (parm < 8) - parm = 8; - if (parm > 250) - parm = 250; - tmr_offs = tmr_ctr; - ticks_offs += tmr2ticks(tmr_ctr); - tmr_ctr = 0; - curr_tempo = parm; - reprogram_timer(); - } - break; - - case TMR_ECHO: - seq_copy_to_input(event, 8); - break; - - default:; - } - - return TIMER_NOT_ARMED; -} - -static u_long -timer_get_time(int dev) -{ - if (!opened) - return 0; - - return curr_ticks; -} - -static int -timer_ioctl(int dev, u_int cmd, ioctl_arg arg) -{ - switch (cmd) { - case SNDCTL_TMR_SOURCE: - return *(int *) arg = TMR_INTERNAL; - break; - - case SNDCTL_TMR_START: - tmr_reset(); - tmr_running = 1; - return 0; - break; - - case SNDCTL_TMR_STOP: - tmr_running = 0; - return 0; - break; - - case SNDCTL_TMR_CONTINUE: - tmr_running = 1; - return 0; - break; - - case SNDCTL_TMR_TIMEBASE: - { - int val = (*(int *) arg); - - if (val) { - if (val < 1) - val = 1; - if (val > 1000) - val = 1000; - curr_timebase = val; - } - return *(int *) arg = curr_timebase; - } - break; - - case SNDCTL_TMR_TEMPO: - { - int val = (*(int *) arg); - - if (val) { - if (val < 8) - val = 8; - if (val > 250) - val = 250; - tmr_offs = tmr_ctr; - ticks_offs += tmr2ticks(tmr_ctr); - tmr_ctr = 0; - curr_tempo = val; - reprogram_timer(); - } - return *(int *) arg = curr_tempo; - } - break; - - case SNDCTL_SEQ_CTRLRATE: - if ((*(int *) arg) != 0) /* Can't change */ - return -(EINVAL); - - return *(int *) arg = ((curr_tempo * curr_timebase) + 30) / 60; - break; - - case SNDCTL_TMR_METRONOME: - /* NOP */ - break; - - default:; - } - - return -(EINVAL); -} - -static void -timer_arm(int dev, long time) -{ - if (time < 0) - time = curr_ticks + 1; - else if (time <= curr_ticks) /* It's the time */ - return; - - next_event_time = prev_event_time = time; - - return; -} - -static struct sound_timer_operations sound_timer = -{ - {"GUS Timer", 0}, - 1, /* Priority */ - 0, /* Local device link */ - timer_open, - timer_close, - timer_event, - timer_get_time, - timer_ioctl, - timer_arm -}; - -void -sound_timer_interrupt(void) -{ - if (!opened) - return; - - tmr->tmr_restart(tmr->dev); - - if (!tmr_running) - return; - - tmr_ctr++; - curr_ticks = ticks_offs + tmr2ticks(tmr_ctr); - - if (curr_ticks >= next_event_time) { - next_event_time = 0xffffffff; - sequencer_timer(0); - } -} - -void -sound_timer_init(struct sound_lowlev_timer * t, char *name) -{ - int n; - - if (initialized || t == NULL) - return; /* There is already a similar timer */ - - initialized = 1; - tmr = t; - - if (num_sound_timers >= MAX_TIMER_DEV) - n = 0; /* Overwrite the system timer */ - else - n = num_sound_timers++; - - snprintf(sound_timer.info.name, sizeof(sound_timer.info.name), "%s", name); - - sound_timer_devs[n] = &sound_timer; -} - -#endif -#endif diff --git a/sys/dev/sound/isa/i386/soundcard.c b/sys/dev/sound/isa/i386/soundcard.c deleted file mode 100644 index 086f1208cb..0000000000 --- a/sys/dev/sound/isa/i386/soundcard.c +++ /dev/null @@ -1,680 +0,0 @@ -/* - * sound/386bsd/soundcard.c - * - * Soundcard driver for 386BSD. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/sound/soundcard.c,v 1.87 1999/12/20 18:05:01 eivind Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/soundcard.c,v 1.8 2005/01/31 23:44:35 joerg Exp $ - * - */ -#include "use_snd.h" -#include "sound_config.h" -#if NSND > 0 /* from "snd.h" */ -#include "use_uart.h" - -#include -#include -#include -#include - -#include - - -/* -** Register definitions for DMA controller 1 (channels 0..3): -*/ -#define DMA1_CHN(c) (IO_DMA1 + 1*(2*(c))) /* addr reg for channel c */ -#define DMA1_SMSK (IO_DMA1 + 1*10) /* single mask register */ -#define DMA1_MODE (IO_DMA1 + 1*11) /* mode register */ -#define DMA1_FFC (IO_DMA1 + 1*12) /* clear first/last FF */ - -/* -** Register definitions for DMA controller 2 (channels 4..7): -*/ -#define DMA2_CHN(c) (IO_DMA2 + 2*(2*(c))) /* addr reg for channel c */ -#define DMA2_SMSK (IO_DMA2 + 2*10) /* single mask register */ -#define DMA2_MODE (IO_DMA2 + 2*11) /* mode register */ -#define DMA2_FFC (IO_DMA2 + 2*12) /* clear first/last FF */ - - -#define FIX_RETURN(ret) {if ((ret)<0) return -(ret); else return 0;} - -static int soundcards_installed = 0; /* Number of installed soundcards */ -static int soundcard_configured = 0; - -static struct fileinfo files[SND_NDEVS]; -struct selinfo selinfo[SND_NDEVS >> 4]; - -int -MIDIbuf_poll (int dev, struct fileinfo *file, int events, select_table * wait); - -int -audio_poll(int dev, struct fileinfo * file, int events, select_table * wait); - -int -sequencer_poll (int dev, struct fileinfo *file, int events, select_table * wait); - -static int sndprobe (struct isa_device *); -static int sndattach (struct isa_device *); - -static d_open_t sndopen; -static d_close_t sndclose; -static d_ioctl_t sndioctl; -static d_read_t sndread; -static d_write_t sndwrite; -static d_poll_t sndpoll; -static d_mmap_t sndmmap; - -static char driver_name[] = "snd"; - -#define CDEV_MAJOR 30 -static struct cdevsw snd_cdevsw = { - /* name */ driver_name, - /* maj */ CDEV_MAJOR, - /* flags */ 0, - /* port */ NULL, - /* clone */ NULL, - - /* open */ sndopen, - /* close */ sndclose, - /* read */ sndread, - /* write */ sndwrite, - /* ioctl */ sndioctl, - /* poll */ sndpoll, - /* mmap */ sndmmap, - /* strategy */ nostrategy, - /* dump */ nodump, - /* psize */ nopsize -}; - - - - -static void sound_mem_init(void); - -/* - * for each "device XXX" entry in the config file, we have - * a struct isa_driver which is linked into isa_devtab_null[] - * - * XXX It is a bit stupid to call the generic routine so many times and - * switch then to the specific one, but the alternative way would be - * to replicate some code in the probe/attach routines. - */ - -struct isa_driver opldriver = {sndprobe, sndattach, "opl"}; -struct isa_driver trixdriver = {sndprobe, sndattach, "trix"}; -struct isa_driver trixsbdriver = {sndprobe, sndattach, "trixsb"}; -struct isa_driver sbdriver = {sndprobe, sndattach, "sb"}; -struct isa_driver sbxvidriver = {sndprobe, sndattach, "sbxvi"}; -struct isa_driver sbmididriver = {sndprobe, sndattach, "sbmidi"}; -struct isa_driver pasdriver = {sndprobe, sndattach, "pas"}; -struct isa_driver mpudriver = {sndprobe, sndattach, "mpu"}; -struct isa_driver gusdriver = {sndprobe, sndattach, "gus"}; -struct isa_driver gusxvidriver = {sndprobe, sndattach, "gusxvi"}; -struct isa_driver gusmaxdriver = {sndprobe, sndattach, "gusmax"}; -struct isa_driver uartdriver = {sndprobe, sndattach, "uart"}; -struct isa_driver mssdriver = {sndprobe, sndattach, "mss"}; -struct isa_driver cssdriver = {sndprobe, sndattach, "css"}; -struct isa_driver sscapedriver = {sndprobe, sndattach, "sscape"}; -struct isa_driver sscape_mssdriver = {sndprobe, sndattach, "sscape_mss"}; -struct isa_driver nssdriver = {sndprobe, sndattach, "nss"}; - -short ipri_to_irq(u_short ipri); - -static ointhand2_t sndintr; - -u_long -get_time(void) -{ - struct timeval timecopy; - - getmicrotime(&timecopy); - return timecopy.tv_usec / (1000000 / hz) + - (u_long) timecopy.tv_sec * hz; -} - -static int -sndmmap( dev_t dev, vm_offset_t offset, int nprot ) -{ - struct dma_buffparms * dmap; - u_int min = minor(dev) >> 4; - - if (min > 0 ) return (-1); - - dmap = audio_devs[min]->dmap_out; - - if (nprot & PROT_EXEC) - return( -1 ); - dmap->mapping_flags |= DMA_MAP_MAPPED ; - return( i386_btop(vtophys(dmap->raw_buf) + offset) ); -} - - -static int -sndread(dev_t dev, struct uio * buf, int flag) -{ - int count = buf->uio_resid; - u_int min = minor(dev); - - FIX_RETURN(sound_read_sw(min, &files[min], buf, count)); -} - - -static int -sndwrite(dev_t dev, struct uio * buf, int flag) -{ - int count = buf->uio_resid; - u_int min = minor(dev); - - FIX_RETURN(sound_write_sw(min, &files[min], buf, count)); -} - -static int -sndopen(dev_t dev, int flags, int mode, struct proc * p) -{ - int retval; - struct fileinfo tmp_file; - u_int min = minor(dev); - - if (!soundcard_configured && min) { - printf("SoundCard Error: soundcard system has not been configured\n"); - return ENODEV ; - } - tmp_file.mode = 0; - - if (flags & FREAD && flags & FWRITE) - tmp_file.mode = OPEN_READWRITE; - else if (flags & FREAD) - tmp_file.mode = OPEN_READ; - else if (flags & FWRITE) - tmp_file.mode = OPEN_WRITE; - - selinfo[min >> 4].si_pid = 0; - selinfo[min >> 4].si_flags = 0; - if ((retval = sound_open_sw(min, &tmp_file)) < 0) - FIX_RETURN(retval); - - bcopy((char *) &tmp_file, (char *) &files[min], sizeof(tmp_file)); - - FIX_RETURN(retval); -} - - -static int -sndclose(dev_t dev, int flags, int mode, struct proc * p) -{ - u_int min = minor(dev); - - sound_release_sw(min, &files[min]); - return 0 ; -} - -static int -sndioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p) -{ - u_int min = minor(dev); - FIX_RETURN(sound_ioctl_sw(min, &files[min], cmd, arg)); -} - -int -sndpoll(dev_t dev, int events, struct proc * p) -{ - u_int min = minor(dev); - - /* printf ("snd_select(dev=%d, rw=%d, pid=%d)\n", min, rw, p->p_pid); */ -#ifdef ALLOW_POLL - switch (min & 0x0f) { -#ifdef CONFIG_SEQUENCER - case SND_DEV_SEQ: - case SND_DEV_SEQ2: - return sequencer_poll(min, &files[min], events, p); - break; -#endif - -#ifdef CONFIG_MIDI - case SND_DEV_MIDIN: - return MIDIbuf_poll(min, &files[min], events, p); - break; -#endif - -#ifdef CONFIG_AUDIO - case SND_DEV_DSP: - case SND_DEV_DSP16: - case SND_DEV_AUDIO: - - return audio_poll(min, &files[min], events, p); - break; -#endif - - default: - return 0; - } - -#endif /* ALLOW_POLL */ - DEB(printf("sound_ioctl(min=%d, cmd=0x%x, arg=0x%x)\n", min, cmd, arg)); - - return 0 ; -} - -/* XXX this should become ffs(ipri), perhaps -1 lr 970705 */ -short -ipri_to_irq(u_short ipri) -{ - /* - * Converts the ipri (bitmask) to the corresponding irq number - */ - int irq; - - for (irq = 0; irq < 16; irq++) - if (ipri == (1 << irq)) - return irq; - - return -1; /* Invalid argument */ -} - -static int -driver_to_voxunit(struct isa_driver * driver) -{ - /* - * converts a sound driver pointer into the equivalent VoxWare device - * unit number - */ - if (driver == &opldriver) - return (SNDCARD_ADLIB); - else if (driver == &sbdriver) - return (SNDCARD_SB); - else if (driver == &pasdriver) - return (SNDCARD_PAS); - else if (driver == &gusdriver) - return (SNDCARD_GUS); - else if (driver == &mpudriver) - return (SNDCARD_MPU401); - else if (driver == &sbxvidriver) - return (SNDCARD_SB16); - else if (driver == &sbmididriver) - return (SNDCARD_SB16MIDI); - else if (driver == &uartdriver) - return (SNDCARD_UART6850); - else if (driver == &gusdriver) - return (SNDCARD_GUS16); - else if (driver == &mssdriver) - return (SNDCARD_MSS); - else if (driver == &cssdriver) - return (SNDCARD_CS4232); - else if (driver == &sscapedriver) - return(SNDCARD_SSCAPE); - else if (driver == &sscape_mssdriver) - return(SNDCARD_SSCAPE_MSS); - else if (driver == &trixdriver) - return (SNDCARD_TRXPRO); - else if (driver == &trixsbdriver) - return (SNDCARD_TRXPRO_SB); - else if (driver == &nssdriver) - return (SNDCARD_NSS); - else - return (0); -} - -/* - * very dirty: tmp_osp is allocated in sndprobe, and used at the next - * call in sndattach - */ - -static sound_os_info *temp_osp; - -/* - * sndprobe is called for each isa_device. From here, a voxware unit - * number is determined, and the appropriate probe routine is selected. - * The parameters from the config line are passed to the hw_config struct. - */ - -static int -sndprobe(struct isa_device * dev) -{ - struct address_info hw_config; - int unit; - - temp_osp = (sound_os_info *)malloc(sizeof(sound_os_info), - M_DEVBUF, M_NOWAIT); - if (!temp_osp) - panic("SOUND: Cannot allocate memory\n"); - - /* - * get config info from the kernel config. These may be overridden - * by the local autoconfiguration routines though (e.g. pnp stuff). - */ - - hw_config.io_base = dev->id_iobase; - hw_config.irq = ipri_to_irq(dev->id_irq); - hw_config.dma = dev->id_drq; - - /* - * misuse the flags field for read dma. Note that, to use 0 as - * read dma channel, one of the high bits should be set. lr970705 XXX - */ - - if (dev->id_flags != 0) - hw_config.dma2 = dev->id_flags & 0x7; - else - hw_config.dma2 = -1; - - hw_config.always_detect = 0; - hw_config.name = NULL; - hw_config.card_subtype = 0; - - temp_osp->unit = dev->id_unit; - hw_config.osp = temp_osp; - unit = driver_to_voxunit(dev->id_driver); - - if (sndtable_probe(unit, &hw_config)) { - dev->id_iobase = hw_config.io_base; - dev->id_irq = hw_config.irq == -1 ? 0 : (1 << hw_config.irq); - dev->id_drq = hw_config.dma; - - if (hw_config.dma != hw_config.dma2 && ( hw_config.dma2 != -1)) - dev->id_flags = hw_config.dma2 | 0x100; /* XXX lr */ - else - dev->id_flags = 0; - return TRUE; - } - return 0; -} - -static int -sndattach(struct isa_device * dev) -{ - int unit; - static int midi_initialized = 0; - static int seq_initialized = 0; - struct address_info hw_config; - char *dname; - - /* - * Associate interrupt handlers with devices. XXX this may be incomplete. - */ - dname = dev->id_driver->name; -#if defined(CONFIG_AD1848) - if (strcmp(dname, "css") == 0 || strcmp(dname, "gusxvi") == 0 || - strcmp(dname, "mss") == 0) - dev->id_ointr = adintr; -#endif -#ifdef CONFIG_GUS - if (strcmp(dname, "gus") == 0) - dev->id_ointr = gusintr; -#endif -#ifdef CONFIG_PAS - if (strcmp(dname, "pas") == 0) - dev->id_ointr = pasintr; -#endif -#if NSB > 0 && (defined(CONFIG_MIDI) || defined(CONFIG_AUDIO)) - if (strcmp(dname, "sb") == 0) - dev->id_ointr = sbintr; -#endif - if (strcmp(dname, "sscape_mss") == 0) - dev->id_ointr = sndintr; -#if NSSCAPE > 0 - if (strcmp(dname, "sscape") == 0 || strcmp(dname, "trix") == 0) - dev->id_ointr = sscapeintr; -#endif -#if NUART > 0 - if (strcmp(dname, "uart0") == 0) - dev->id_ointr = m6850intr; -#endif -#if NMPU > 0 && defined(CONFIG_MIDI) - if (strcmp(dname, "mpu") == 0) - dev->id_ointr = mpuintr; -#endif -#if NNSS > 0 - if (strcmp(dname, "nss") == 0) - dev->id_ointr = nssintr; -#endif - - unit = driver_to_voxunit(dev->id_driver); - hw_config.io_base = dev->id_iobase; - hw_config.irq = ipri_to_irq(dev->id_irq); - hw_config.dma = dev->id_drq; - - /* misuse the flags field for read dma */ - if (dev->id_flags != 0) - hw_config.dma2 = dev->id_flags & 0x7; - else - hw_config.dma2 = -1; - - hw_config.card_subtype = 0; - hw_config.osp = temp_osp; - - if (!unit) - return FALSE; - - if (!(sndtable_init_card(unit, &hw_config))) { /* init card */ - printf(" "); - return FALSE; - } - /* - * Init the high level sound driver - */ - - if (!(soundcards_installed = sndtable_get_cardcount())) { - DDB(printf("No drivers actually installed\n")); - return FALSE; /* No cards detected */ - } - printf("\n"); - -#ifdef CONFIG_AUDIO - if (num_audiodevs) { /* Audio devices present */ - DMAbuf_init(); - sound_mem_init(); - } - soundcard_configured = 1; -#endif - - if (num_midis && !midi_initialized) - midi_initialized = 1; - - if ((num_midis + num_synths) && !seq_initialized) { - seq_initialized = 1; - sequencer_init(); - } - - cdevsw_add(&snd_cdevsw, 0xf0, dev->id_unit << 4); -#define GID_SND GID_GAMES -#define UID_SND UID_ROOT -#define PERM_SND 0660 - /* - * make links to first successfully probed device, don't do it if - * duplicate creation of same node failed (ie. bad cookie returned) - */ - if (dev->id_driver == &opldriver){ - make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_SEQ, - UID_SND, GID_SND, PERM_SND, "sequencer%r", dev->id_unit); - } else if (dev->id_driver == &mpudriver || - dev->id_driver == &sbmididriver || - dev->id_driver == &uartdriver){ - make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_MIDIN, - UID_SND, GID_SND, PERM_SND, "midi%r", dev->id_unit); - } else { - make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP, - UID_SND, GID_SND, PERM_SND, "dsp%r", dev->id_unit); - make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP16, - UID_SND, GID_SND, PERM_SND, "dspW%r", dev->id_unit); - make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_AUDIO, - UID_SND, GID_SND, PERM_SND, "audio%r", dev->id_unit); - make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_CTL, - UID_SND, GID_SND, PERM_SND, "mixer%r", dev->id_unit); - make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_STATUS, - UID_SND, GID_SND, PERM_SND, "sndstat%r", dev->id_unit); - } - return TRUE; -} - - -#ifdef CONFIG_AUDIO - -static void -alloc_dmap(int dev, int chan, struct dma_buffparms * dmap) -{ - char *tmpbuf; - int i; - - tmpbuf = contigmalloc(audio_devs[dev]->buffsize, M_DEVBUF, M_NOWAIT, - 0ul, 0xfffffful, 1ul, chan & 4 ? 0x20000ul : 0x10000ul); - if (tmpbuf == NULL) - printf("soundcard buffer alloc failed \n"); - - if (tmpbuf == NULL) { - printf("snd: Unable to allocate %d bytes of buffer\n", - 2 * (int) audio_devs[dev]->buffsize); - return; - } - dmap->raw_buf = tmpbuf; - /* - * Use virtual address as the physical address, since isa_dmastart - * performs the phys address computation. - */ - - dmap->raw_buf_phys = (uintptr_t) tmpbuf; - for (i = 0; i < audio_devs[dev]->buffsize; i++) *tmpbuf++ = 0x80; - -} - -static void -sound_mem_init(void) -{ - int dev; - static u_long dsp_init_mask = 0; - - for (dev = 0; dev < num_audiodevs; dev++) /* Enumerate devices */ - if (!(dsp_init_mask & (1 << dev))) /* Not already done */ - if (audio_devs[dev]->dmachan1 >= 0) { - dsp_init_mask |= (1 << dev); - audio_devs[dev]->buffsize = DSP_BUFFSIZE; - /* Now allocate the buffers */ - alloc_dmap(dev, audio_devs[dev]->dmachan1, - audio_devs[dev]->dmap_out); - if (audio_devs[dev]->flags & DMA_DUPLEX) - alloc_dmap(dev, audio_devs[dev]->dmachan2, - audio_devs[dev]->dmap_in); - } /* for dev */ -} - -#endif - - -int -snd_ioctl_return(int *addr, int value) -{ - if (value < 0) - return value; /* Error */ - suword(addr, value); - return 0; -} - -#define MAX_UNIT 50 -typedef void (*irq_proc_t) (int irq); -static irq_proc_t irq_proc[MAX_UNIT] = {NULL}; -static int irq_irq[MAX_UNIT] = {0}; - -int -snd_set_irq_handler(int int_lvl, void (*hndlr) (int), sound_os_info * osp) -{ - if (osp->unit >= MAX_UNIT) { - printf("Sound error: Unit number too high (%d)\n", osp->unit); - return 0; - } - irq_proc[osp->unit] = hndlr; - irq_irq[osp->unit] = int_lvl; - return 1; -} - -static void -sndintr(int unit) -{ - if ( (unit >= MAX_UNIT) || (irq_proc[unit] == NULL) ) - return; - - irq_proc[unit] (irq_irq[unit]); /* Call the installed handler */ -} - -void -conf_printf(char *name, struct address_info * hw_config) -{ - if (!trace_init) - return; - - printf("snd0: <%s> ", name); -#if 0 - if (hw_config->io_base != -1 ) - printf("at 0x%03x", hw_config->io_base); - - if (hw_config->irq != -1 ) - printf(" irq %d", hw_config->irq); - - if (hw_config->dma != -1 || hw_config->dma2 != -1) { - printf(" dma %d", hw_config->dma); - if (hw_config->dma2 != -1) - printf(",%d", hw_config->dma2); - } -#endif - -} - -void -conf_printf2(char *name, int base, int irq, int dma, int dma2) -{ - if (!trace_init) - return; - - printf("snd0: <%s> ", name); -#if 0 - if (hw_config->io_base != -1 ) - printf("at 0x%03x", hw_config->io_base); - - if (irq) - printf(" irq %d", irq); - - if (dma != -1 || dma2 != -1) { - printf(" dma %d", dma); - if (dma2 != -1) - printf(",%d", dma2); - } -#endif - -} - - -void tenmicrosec (int j) -{ - int i, k; - for (k = 0; k < j/10 ; k++) { - for (i = 0; i < 16; i++) - inb (0x80); - } -} - -#endif /* NSND > 0 */ - - - - diff --git a/sys/dev/sound/isa/i386/soundvers.h b/sys/dev/sound/isa/i386/soundvers.h deleted file mode 100644 index 66ca10db2b..0000000000 --- a/sys/dev/sound/isa/i386/soundvers.h +++ /dev/null @@ -1,2 +0,0 @@ -#define SOUND_VERSION_STRING "3.5-alpha15-970902" -#define SOUND_INTERNAL_VERSION 0x030518 diff --git a/sys/dev/sound/isa/i386/spkr/spkr.c b/sys/dev/sound/isa/i386/spkr/spkr.c deleted file mode 100644 index f349cdc3cf..0000000000 --- a/sys/dev/sound/isa/i386/spkr/spkr.c +++ /dev/null @@ -1,581 +0,0 @@ -/* - * spkr.c -- device driver for console speaker - * - * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 - * modified for FreeBSD by Andrew A. Chernov - * - * $FreeBSD: src/sys/i386/isa/spkr.c,v 1.45 2000/01/29 16:00:32 peter Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/spkr/Attic/spkr.c,v 1.12 2005/01/04 05:27:47 cpressey Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static d_open_t spkropen; -static d_close_t spkrclose; -static d_write_t spkrwrite; -static d_ioctl_t spkrioctl; - -#define CDEV_MAJOR 26 -static struct cdevsw spkr_cdevsw = { - /* name */ "spkr", - /* maj */ CDEV_MAJOR, - /* flags */ 0, - /* port */ NULL, - /* clone */ NULL, - - /* open */ spkropen, - /* close */ spkrclose, - /* read */ noread, - /* write */ spkrwrite, - /* ioctl */ spkrioctl, - /* poll */ nopoll, - /* mmap */ nommap, - /* strategy */ nostrategy, - /* dump */ nodump, - /* psize */ nopsize -}; - -/**************** MACHINE DEPENDENT PART STARTS HERE ************************* - * - * This section defines a function tone() which causes a tone of given - * frequency and duration from the ISA console speaker. - * Another function endtone() is defined to force sound off, and there is - * also a rest() entry point to do pauses. - * - * Audible sound is generated using the Programmable Interval Timer (PIT) and - * Programmable Peripheral Interface (PPI) attached to the ISA speaker. The - * PPI controls whether sound is passed through at all; the PIT's channel 2 is - * used to generate clicks (a square wave) of whatever frequency is desired. - */ - -/* - * PPI control values. - * XXX should be in a header and used in clock.c. - */ -#define PPI_SPKR 0x03 /* turn these PPI bits on to pass sound */ - -static char endtone, endrest; - -static void tone (unsigned int thz, unsigned int ticks); -static void rest (int ticks); -static void playinit (void); -static void playtone (int pitch, int value, int sustain); -static int abs (int n); -static void playstring (char *cp, size_t slen); - -/* emit tone of frequency thz for given number of ticks */ -static void -tone(thz, ticks) - unsigned int thz, ticks; -{ - unsigned int divisor; - - if (thz <= 0) - return; - - divisor = cputimer_freq / thz; - -#ifdef DEBUG - (void) printf("tone: thz=%d ticks=%d\n", thz, ticks); -#endif /* DEBUG */ - - /* set timer to generate clicks at given frequency in Hertz */ - - if (acquire_timer2(TIMER_SEL2 | TIMER_SQWAVE | TIMER_16BIT)) { - /* enter list of waiting procs ??? */ - return; - } - clock_lock(); - outb(TIMER_CNTR2, (divisor & 0xff)); /* send lo byte */ - outb(TIMER_CNTR2, (divisor >> 8)); /* send hi byte */ - clock_unlock(); - - /* turn the speaker on */ - outb(IO_PPI, inb(IO_PPI) | PPI_SPKR); - - /* - * Set timeout to endtone function, then give up the timeslice. - * This is so other processes can execute while the tone is being - * emitted. - */ - if (ticks > 0) - tsleep((caddr_t)&endtone, PCATCH, "spkrtn", ticks); - outb(IO_PPI, inb(IO_PPI) & ~PPI_SPKR); - release_timer2(); -} - -/* rest for given number of ticks */ -static void -rest(ticks) - int ticks; -{ - /* - * Set timeout to endrest function, then give up the timeslice. - * This is so other processes can execute while the rest is being - * waited out. - */ -#ifdef DEBUG - (void) printf("rest: %d\n", ticks); -#endif /* DEBUG */ - if (ticks > 0) - tsleep((caddr_t)&endrest, PCATCH, "spkrrs", ticks); -} - -/**************** PLAY STRING INTERPRETER BEGINS HERE ********************** - * - * Play string interpretation is modelled on IBM BASIC 2.0's PLAY statement; - * M[LNS] are missing; the ~ synonym and the _ slur mark and the octave- - * tracking facility are added. - * Requires tone(), rest(), and endtone(). String play is not interruptible - * except possibly at physical block boundaries. - */ - -typedef int bool; -#define TRUE 1 -#define FALSE 0 - -#define dtoi(c) ((c) - '0') - -static int octave; /* currently selected octave */ -static int whole; /* whole-note time at current tempo, in ticks */ -static int value; /* whole divisor for note time, quarter note = 1 */ -static int fill; /* controls spacing of notes */ -static bool octtrack; /* octave-tracking on? */ -static bool octprefix; /* override current octave-tracking state? */ - -/* - * Magic number avoidance... - */ -#define SECS_PER_MIN 60 /* seconds per minute */ -#define WHOLE_NOTE 4 /* quarter notes per whole note */ -#define MIN_VALUE 64 /* the most we can divide a note by */ -#define DFLT_VALUE 4 /* default value (quarter-note) */ -#define FILLTIME 8 /* for articulation, break note in parts */ -#define STACCATO 6 /* 6/8 = 3/4 of note is filled */ -#define NORMAL 7 /* 7/8ths of note interval is filled */ -#define LEGATO 8 /* all of note interval is filled */ -#define DFLT_OCTAVE 4 /* default octave */ -#define MIN_TEMPO 32 /* minimum tempo */ -#define DFLT_TEMPO 120 /* default tempo */ -#define MAX_TEMPO 255 /* max tempo */ -#define NUM_MULT 3 /* numerator of dot multiplier */ -#define DENOM_MULT 2 /* denominator of dot multiplier */ - -/* letter to half-tone: A B C D E F G */ -static int notetab[8] = {9, 11, 0, 2, 4, 5, 7}; - -/* - * This is the American Standard A440 Equal-Tempered scale with frequencies - * rounded to nearest integer. Thank Goddess for the good ol' CRC Handbook... - * our octave 0 is standard octave 2. - */ -#define OCTAVE_NOTES 12 /* semitones per octave */ -static int pitchtab[] = -{ -/* C C# D D# E F F# G G# A A# B*/ -/* 0 */ 65, 69, 73, 78, 82, 87, 93, 98, 103, 110, 117, 123, -/* 1 */ 131, 139, 147, 156, 165, 175, 185, 196, 208, 220, 233, 247, -/* 2 */ 262, 277, 294, 311, 330, 349, 370, 392, 415, 440, 466, 494, -/* 3 */ 523, 554, 587, 622, 659, 698, 740, 784, 831, 880, 932, 988, -/* 4 */ 1047, 1109, 1175, 1245, 1319, 1397, 1480, 1568, 1661, 1760, 1865, 1975, -/* 5 */ 2093, 2217, 2349, 2489, 2637, 2794, 2960, 3136, 3322, 3520, 3729, 3951, -/* 6 */ 4186, 4435, 4698, 4978, 5274, 5588, 5920, 6272, 6644, 7040, 7459, 7902, -}; - -static void -playinit() -{ - octave = DFLT_OCTAVE; - whole = (hz * SECS_PER_MIN * WHOLE_NOTE) / DFLT_TEMPO; - fill = NORMAL; - value = DFLT_VALUE; - octtrack = FALSE; - octprefix = TRUE; /* act as though there was an initial O(n) */ -} - -/* play tone of proper duration for current rhythm signature */ -static void -playtone(pitch, value, sustain) - int pitch, value, sustain; -{ - int sound, silence, snum = 1, sdenom = 1; - - /* this weirdness avoids floating-point arithmetic */ - for (; sustain; sustain--) - { - /* See the BUGS section in the man page for discussion */ - snum *= NUM_MULT; - sdenom *= DENOM_MULT; - } - - if (value == 0 || sdenom == 0) - return; - - if (pitch == -1) - rest(whole * snum / (value * sdenom)); - else - { - sound = (whole * snum) / (value * sdenom) - - (whole * (FILLTIME - fill)) / (value * FILLTIME); - silence = whole * (FILLTIME-fill) * snum / (FILLTIME * value * sdenom); - -#ifdef DEBUG - (void) printf("playtone: pitch %d for %d ticks, rest for %d ticks\n", - pitch, sound, silence); -#endif /* DEBUG */ - - tone(pitchtab[pitch], sound); - if (fill != LEGATO) - rest(silence); - } -} - -static int -abs(n) - int n; -{ - if (n < 0) - return(-n); - else - return(n); -} - -/* interpret and play an item from a notation string */ -static void -playstring(cp, slen) - char *cp; - size_t slen; -{ - int pitch, oldfill, lastpitch = OCTAVE_NOTES * DFLT_OCTAVE; - -#define GETNUM(cp, v) for(v=0; isdigit(cp[1]) && slen > 0; ) \ - {v = v * 10 + (*++cp - '0'); slen--;} - for (; slen--; cp++) - { - int sustain, timeval, tempo; - char c = toupper(*cp); - -#ifdef DEBUG - (void) printf("playstring: %c (%x)\n", c, c); -#endif /* DEBUG */ - - switch (c) - { - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': - - /* compute pitch */ - pitch = notetab[c - 'A'] + octave * OCTAVE_NOTES; - - /* this may be followed by an accidental sign */ - if (cp[1] == '#' || cp[1] == '+') - { - ++pitch; - ++cp; - slen--; - } - else if (cp[1] == '-') - { - --pitch; - ++cp; - slen--; - } - - /* - * If octave-tracking mode is on, and there has been no octave- - * setting prefix, find the version of the current letter note - * closest to the last regardless of octave. - */ - if (octtrack && !octprefix) - { - if (abs(pitch-lastpitch) > abs(pitch+OCTAVE_NOTES-lastpitch)) - { - ++octave; - pitch += OCTAVE_NOTES; - } - - if (abs(pitch-lastpitch) > abs((pitch-OCTAVE_NOTES)-lastpitch)) - { - --octave; - pitch -= OCTAVE_NOTES; - } - } - octprefix = FALSE; - lastpitch = pitch; - - /* ...which may in turn be followed by an override time value */ - GETNUM(cp, timeval); - if (timeval <= 0 || timeval > MIN_VALUE) - timeval = value; - - /* ...and/or sustain dots */ - for (sustain = 0; cp[1] == '.'; cp++) - { - slen--; - sustain++; - } - - /* ...and/or a slur mark */ - oldfill = fill; - if (cp[1] == '_') - { - fill = LEGATO; - ++cp; - slen--; - } - - /* time to emit the actual tone */ - playtone(pitch, timeval, sustain); - - fill = oldfill; - break; - - case 'O': - if (cp[1] == 'N' || cp[1] == 'n') - { - octprefix = octtrack = FALSE; - ++cp; - slen--; - } - else if (cp[1] == 'L' || cp[1] == 'l') - { - octtrack = TRUE; - ++cp; - slen--; - } - else - { - GETNUM(cp, octave); - if (octave >= sizeof(pitchtab) / sizeof(pitchtab[0]) / OCTAVE_NOTES) - octave = DFLT_OCTAVE; - octprefix = TRUE; - } - break; - - case '>': - if (octave < sizeof(pitchtab) / sizeof(pitchtab[0]) / OCTAVE_NOTES - 1) - octave++; - octprefix = TRUE; - break; - - case '<': - if (octave > 0) - octave--; - octprefix = TRUE; - break; - - case 'N': - GETNUM(cp, pitch); - for (sustain = 0; cp[1] == '.'; cp++) - { - slen--; - sustain++; - } - oldfill = fill; - if (cp[1] == '_') - { - fill = LEGATO; - ++cp; - slen--; - } - playtone(pitch - 1, value, sustain); - fill = oldfill; - break; - - case 'L': - GETNUM(cp, value); - if (value <= 0 || value > MIN_VALUE) - value = DFLT_VALUE; - break; - - case 'P': - case '~': - /* this may be followed by an override time value */ - GETNUM(cp, timeval); - if (timeval <= 0 || timeval > MIN_VALUE) - timeval = value; - for (sustain = 0; cp[1] == '.'; cp++) - { - slen--; - sustain++; - } - playtone(-1, timeval, sustain); - break; - - case 'T': - GETNUM(cp, tempo); - if (tempo < MIN_TEMPO || tempo > MAX_TEMPO) - tempo = DFLT_TEMPO; - whole = (hz * SECS_PER_MIN * WHOLE_NOTE) / tempo; - break; - - case 'M': - if (cp[1] == 'N' || cp[1] == 'n') - { - fill = NORMAL; - ++cp; - slen--; - } - else if (cp[1] == 'L' || cp[1] == 'l') - { - fill = LEGATO; - ++cp; - slen--; - } - else if (cp[1] == 'S' || cp[1] == 's') - { - fill = STACCATO; - ++cp; - slen--; - } - break; - } - } -} - -/******************* UNIX DRIVER HOOKS BEGIN HERE ************************** - * - * This section implements driver hooks to run playstring() and the tone(), - * endtone(), and rest() functions defined above. - */ - -static int spkr_active = FALSE; /* exclusion flag */ -static struct buf *spkr_inbuf; /* incoming buf */ - -int -spkropen(dev_t dev, int flags, int fmt, struct thread *td) -{ -#ifdef DEBUG - (void) printf("spkropen: entering with dev = %s\n", devtoname(dev)); -#endif /* DEBUG */ - - if (minor(dev) != 0) - return(ENXIO); - else if (spkr_active) - return(EBUSY); - else - { -#ifdef DEBUG - (void) printf("spkropen: about to perform play initialization\n"); -#endif /* DEBUG */ - playinit(); - spkr_inbuf = geteblk(DEV_BSIZE); - spkr_active = TRUE; - return(0); - } -} - -int -spkrwrite(dev, uio, ioflag) - dev_t dev; - struct uio *uio; - int ioflag; -{ -#ifdef DEBUG - printf("spkrwrite: entering with dev = %s, count = %d\n", - devtoname(dev), uio->uio_resid); -#endif /* DEBUG */ - - if (minor(dev) != 0) - return(ENXIO); - else if (uio->uio_resid > (DEV_BSIZE - 1)) /* prevent system crashes */ - return(E2BIG); - else - { - unsigned n; - char *cp; - int error; - - n = uio->uio_resid; - cp = spkr_inbuf->b_data; - error = uiomove(cp, n, uio); - if (!error) { - cp[n] = '\0'; - playstring(cp, n); - } - return(error); - } -} - -int -spkrclose(dev_t dev, int flags, int fmt, struct thread *td) -{ -#ifdef DEBUG - (void) printf("spkrclose: entering with dev = %s\n", devtoname(dev)); -#endif /* DEBUG */ - - if (minor(dev) != 0) - return(ENXIO); - else - { - wakeup((caddr_t)&endtone); - wakeup((caddr_t)&endrest); - brelse(spkr_inbuf); - spkr_active = FALSE; - return(0); - } -} - -int -spkrioctl(dev_t dev, unsigned long cmd, caddr_t cmdarg, int flags, struct thread*td) -{ -#ifdef DEBUG - (void) printf("spkrioctl: entering with dev = %s, cmd = %lx\n", - devtoname(dev), cmd); -#endif /* DEBUG */ - - if (minor(dev) != 0) - return(ENXIO); - else if (cmd == SPKRTONE) - { - tone_t *tp = (tone_t *)cmdarg; - - if (tp->frequency == 0) - rest(tp->duration); - else - tone(tp->frequency, tp->duration); - return 0; - } - else if (cmd == SPKRTUNE) - { - tone_t *tp = (tone_t *)(*(caddr_t *)cmdarg); - tone_t ttp; - int error; - - for (; ; tp++) { - error = copyin(tp, &ttp, sizeof(tone_t)); - if (error) - return(error); - if (ttp.duration == 0) - break; - if (ttp.frequency == 0) - rest(ttp.duration); - else - tone(ttp.frequency, ttp.duration); - } - return(0); - } - return(EINVAL); -} - -static void -spkr_drvinit(void *unused) -{ - cdevsw_add(&spkr_cdevsw, 0, 0); - make_dev(&spkr_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "speaker"); -} - -SYSINIT(spkrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spkr_drvinit,NULL) - - -/* spkr.c ends here */ diff --git a/sys/dev/sound/isa/i386/sscape/sscape.c b/sys/dev/sound/isa/i386/sscape/sscape.c deleted file mode 100644 index 446d79c992..0000000000 --- a/sys/dev/sound/isa/i386/sscape/sscape.c +++ /dev/null @@ -1,922 +0,0 @@ -/* - * sound/sscape.c - * - * Low level driver for Ensoniq Soundscape - * - * Copyright by Hannu Savolainen 1994 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/sys/i386/isa/sound/sscape.c,v 1.9 1999/12/20 18:05:01 eivind Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/sscape/Attic/sscape.c,v 1.2 2003/06/17 04:28:38 dillon Exp $ - */ - -#include - -#if NSSCAPE > 0 - -#include - -#define EXCLUDE_NATIVE_PCM - -/* - * I/O ports - */ -#define MIDI_DATA 0 -#define MIDI_CTRL 1 -#define HOST_CTRL 2 -#define TX_READY 0x02 -#define RX_READY 0x01 -#define HOST_DATA 3 -#define ODIE_ADDR 4 -#define ODIE_DATA 5 - -/* - * Indirect registers - */ -#define GA_INTSTAT_REG 0 -#define GA_INTENA_REG 1 -#define GA_DMAA_REG 2 -#define GA_DMAB_REG 3 -#define GA_INTCFG_REG 4 -#define GA_DMACFG_REG 5 -#define GA_CDCFG_REG 6 -#define GA_SMCFGA_REG 7 -#define GA_SMCFGB_REG 8 -#define GA_HMCTL_REG 9 - -/* - * DMA channel identifiers (A and B) - */ -#define SSCAPE_DMA_A 0 -#define SSCAPE_DMA_B 1 - -#define PORT(name) (devc->base+name) - -/* - * Host commands recognized by the OBP microcode - */ -#define CMD_GEN_HOST_ACK 0x80 -#define CMD_GEN_MPU_ACK 0x81 -#define CMD_GET_BOARD_TYPE 0x82 -#define CMD_SET_CONTROL 0x88 -#define CMD_GET_CONTROL 0x89 -#define CTL_MASTER_VOL 0 -#define CTL_MIC_MODE 2 -#define CTL_SYNTH_VOL 4 -#define CTL_WAVE_VOL 7 -#define CMD_SET_MT32 0x96 -#define CMD_GET_MT32 0x97 -#define CMD_SET_EXTMIDI 0x9b -#define CMD_GET_EXTMIDI 0x9c - -#define CMD_ACK 0x80 - -typedef struct sscape_info { - int base, irq, dma; - int ok; /* Properly detected */ - int failed; - int dma_allocated; - int my_audiodev; - int opened; - sound_os_info *osp; -} - - sscape_info; -static struct sscape_info dev_info = -{0}; -static struct sscape_info *devc = &dev_info; - -static int *sscape_sleeper = NULL; -static volatile struct snd_wait sscape_sleep_flag = -{0}; - -/* Some older cards have assigned interrupt bits differently than new ones */ -static char valid_interrupts_old[] = -{9, 7, 5, 15}; - -static char valid_interrupts_new[] = -{9, 5, 7, 10}; - -static char *valid_interrupts = valid_interrupts_new; - -#ifdef REVEAL_SPEA -static char old_hardware = 1; - -#else -static char old_hardware = 0; - -#endif - -static u_char -sscape_read(struct sscape_info * devc, int reg) -{ - u_long flags; - u_char val; - - flags = splhigh(); - outb(PORT(ODIE_ADDR), reg); - val = inb(PORT(ODIE_DATA)); - splx(flags); - return val; -} - -static void -sscape_write(struct sscape_info * devc, int reg, int data) -{ - u_long flags; - - flags = splhigh(); - outb(PORT(ODIE_ADDR), reg); - outb(PORT(ODIE_DATA), data); - splx(flags); -} - -static void -host_open(struct sscape_info * devc) -{ - outb(PORT(HOST_CTRL), 0x00); /* Put the board to the host mode */ -} - -static void -host_close(struct sscape_info * devc) -{ - outb(PORT(HOST_CTRL), 0x03); /* Put the board to the MIDI mode */ -} - -static int -host_write(struct sscape_info * devc, u_char *data, int count) -{ - u_long flags; - int i, timeout_val; - - flags = splhigh(); - - /* - * Send the command and data bytes - */ - - for (i = 0; i < count; i++) { - for (timeout_val = 10000; timeout_val > 0; timeout_val--) - if (inb(PORT(HOST_CTRL)) & TX_READY) - break; - - if (timeout_val <= 0) { - splx(flags); - return 0; - } - outb(PORT(HOST_DATA), data[i]); - } - - - splx(flags); - - return 1; -} - -static int -host_read(struct sscape_info * devc) -{ - u_long flags; - int timeout_val; - u_char data; - - flags = splhigh(); - - /* - * Read a byte - */ - - for (timeout_val = 10000; timeout_val > 0; timeout_val--) - if (inb(PORT(HOST_CTRL)) & RX_READY) - break; - - if (timeout_val <= 0) { - splx(flags); - return -1; - } - data = inb(PORT(HOST_DATA)); - - splx(flags); - - return data; -} - -static int -host_command1(struct sscape_info * devc, int cmd) -{ - u_char buf[10]; - - buf[0] = (u_char) (cmd & 0xff); - - return host_write(devc, buf, 1); -} - -static int -host_command2(struct sscape_info * devc, int cmd, int parm1) -{ - u_char buf[10]; - - buf[0] = (u_char) (cmd & 0xff); - buf[1] = (u_char) (parm1 & 0xff); - - return host_write(devc, buf, 2); -} - -static int -host_command3(struct sscape_info * devc, int cmd, int parm1, int parm2) -{ - u_char buf[10]; - - buf[0] = (u_char) (cmd & 0xff); - buf[1] = (u_char) (parm1 & 0xff); - buf[2] = (u_char) (parm2 & 0xff); - - return host_write(devc, buf, 3); -} - -static void -set_mt32(struct sscape_info * devc, int value) -{ - host_open(devc); - host_command2(devc, CMD_SET_MT32, - value ? 1 : 0); - if (host_read(devc) != CMD_ACK) { - printf("SNDSCAPE: Setting MT32 mode failed\n"); - } - host_close(devc); -} - -static void -set_control(struct sscape_info * devc, int ctrl, int value) -{ - host_open(devc); - host_command3(devc, CMD_SET_CONTROL, ctrl, value); - if (host_read(devc) != CMD_ACK) { - printf("SNDSCAPE: Setting control (%d) failed\n", ctrl); - } - host_close(devc); -} - -static int -get_board_type(struct sscape_info * devc) -{ - int tmp; - - host_open(devc); - if (!host_command1(devc, CMD_GET_BOARD_TYPE)) - tmp = -1; - else - tmp = host_read(devc); - host_close(devc); - return tmp; -} - -void -sscapeintr(int irq) -{ - u_char bits, tmp; - - bits = sscape_read(devc, GA_INTSTAT_REG); - DEB(printf("sscapeintr(0x%02x)\n", bits)); - if ((sscape_sleep_flag.mode & WK_SLEEP)) { - sscape_sleep_flag.mode = WK_WAKEUP; - wakeup(sscape_sleeper); - } - if (bits & 0x02) { /* Host interface interrupt */ - printf("SSCAPE: Host interrupt, data=%02x\n", host_read(devc)); - } -#if (defined(CONFIG_MPU401) || defined(CONFIG_MPU_EMU)) && defined(CONFIG_MIDI) - if (bits & 0x01) { - static int debug = 0; - - mpuintr(irq); - if (debug++ > 10) { /* Temporary debugging hack */ - sscape_write(devc, GA_INTENA_REG, 0x00); /* Disable all interr. */ - } - } -#endif - - /* - * Acknowledge interrupts (toggle the interrupt bits) - */ - - tmp = sscape_read(devc, GA_INTENA_REG); - sscape_write(devc, GA_INTENA_REG, (~bits & 0x0e) | (tmp & 0xf1)); -} - - -static void -do_dma(struct sscape_info * devc, int dma_chan, u_long buf, int blk_size, int mode) -{ - u_char temp; - - if (dma_chan != SSCAPE_DMA_A) { - printf("SSCAPE: Tried to use DMA channel != A. Why?\n"); - return; - } - DMAbuf_start_dma(devc->my_audiodev, buf, blk_size, mode); - - temp = devc->dma << 4; /* Setup DMA channel select bits */ - if (devc->dma <= 3) - temp |= 0x80; /* 8 bit DMA channel */ - - temp |= 1; /* Trigger DMA */ - sscape_write(devc, GA_DMAA_REG, temp); - temp &= 0xfe; /* Clear DMA trigger */ - sscape_write(devc, GA_DMAA_REG, temp); -} - -static int -verify_mpu(struct sscape_info * devc) -{ - /* - * The SoundScape board could be in three modes (MPU, 8250 and host). - * If the card is not in the MPU mode, enabling the MPU driver will - * cause infinite loop (the driver believes that there is always some - * received data in the buffer. - * - * Detect this by looking if there are more than 10 received MIDI bytes - * (0x00) in the buffer. - */ - - int i; - - for (i = 0; i < 10; i++) { - if (inb(devc->base + HOST_CTRL) & 0x80) - return 1; - - if (inb(devc->base) != 0x00) - return 1; - } - - printf("SoundScape: The device is not in the MPU-401 mode\n"); - return 0; -} - -static int -sscape_coproc_open(void *dev_info, int sub_device) -{ - if (sub_device == COPR_MIDI) { - set_mt32(devc, 0); - if (!verify_mpu(devc)) - return -(EIO); - } - sscape_sleep_flag.aborting = 0; - sscape_sleep_flag.mode = WK_NONE; - return 0; -} - -static void -sscape_coproc_close(void *dev_info, int sub_device) -{ - struct sscape_info *devc = dev_info; - u_long flags; - - flags = splhigh(); - if (devc->dma_allocated) { - sscape_write(devc, GA_DMAA_REG, 0x20); /* DMA channel disabled */ -#ifdef CONFIG_NATIVE_PCM -#endif - devc->dma_allocated = 0; - } - sscape_sleep_flag.aborting = 0; - sscape_sleep_flag.mode = WK_NONE; - splx(flags); - - return; -} - -static void -sscape_coproc_reset(void *dev_info) -{ -} - -static int -sscape_download_boot(struct sscape_info * devc, u_char *block, int size, int flag) -{ - u_long flags; - u_char temp; - int done, timeout_val; - - if (flag & CPF_FIRST) { - /* - * First block. Have to allocate DMA and to reset the board - * before continuing. - */ - - flags = splhigh(); - if (devc->dma_allocated == 0) { - devc->dma_allocated = 1; - } - splx(flags); - - sscape_write(devc, GA_HMCTL_REG, - (temp = sscape_read(devc, GA_HMCTL_REG)) & 0x3f); /* Reset */ - - for (timeout_val = 10000; timeout_val > 0; timeout_val--) - sscape_read(devc, GA_HMCTL_REG); /* Delay */ - - /* Take board out of reset */ - sscape_write(devc, GA_HMCTL_REG, - (temp = sscape_read(devc, GA_HMCTL_REG)) | 0x80); - } - /* - * Transfer one code block using DMA - */ - bcopy(block, audio_devs[devc->my_audiodev]->dmap_out->raw_buf, size); - - flags = splhigh(); - /******** INTERRUPTS DISABLED NOW ********/ - do_dma(devc, SSCAPE_DMA_A, - audio_devs[devc->my_audiodev]->dmap_out->raw_buf_phys, - size, 1); - - /* - * Wait until transfer completes. - */ - sscape_sleep_flag.aborting = 0; - sscape_sleep_flag.mode = WK_NONE; - done = 0; - timeout_val = 100; - while (!done && timeout_val-- > 0) { - int chn; - sscape_sleeper = &chn; - DO_SLEEP(chn, sscape_sleep_flag, 1); - - done = 1; - } - - splx(flags); - if (!done) - return 0; - - if (flag & CPF_LAST) { - /* - * Take the board out of reset - */ - outb(PORT(HOST_CTRL), 0x00); - outb(PORT(MIDI_CTRL), 0x00); - - temp = sscape_read(devc, GA_HMCTL_REG); - temp |= 0x40; - sscape_write(devc, GA_HMCTL_REG, temp); /* Kickstart the board */ - - /* - * Wait until the ODB wakes up - */ - - flags = splhigh(); - done = 0; - timeout_val = 5 * hz; - while (!done && timeout_val-- > 0) { - int chn; - - sscape_sleeper = &chn; - DO_SLEEP(chn, sscape_sleep_flag, 1); - - if (inb(PORT(HOST_DATA)) == 0xff) /* OBP startup acknowledge */ - done = 1; - } - splx(flags); - if (!done) { - printf("SoundScape: The OBP didn't respond after code download\n"); - return 0; - } - flags = splhigh(); - done = 0; - timeout_val = 5 * hz; - while (!done && timeout_val-- > 0) { - int chn; - - sscape_sleeper = &chn; - DO_SLEEP(chn, sscape_sleep_flag, 1); - - if (inb(PORT(HOST_DATA)) == 0xfe) /* Host startup acknowledge */ - done = 1; - } - splx(flags); - if (!done) { - printf("SoundScape: OBP Initialization failed.\n"); - return 0; - } - printf("SoundScape board of type %d initialized OK\n", - get_board_type(devc)); - - set_control(devc, CTL_MASTER_VOL, 100); - set_control(devc, CTL_SYNTH_VOL, 100); - -#ifdef SSCAPE_DEBUG3 - /* - * Temporary debugging aid. Print contents of the registers - * after downloading the code. - */ - { - int i; - - for (i = 0; i < 13; i++) - printf("I%d = %02x (new value)\n", i, sscape_read(devc, i)); - } -#endif - - } - return 1; -} - -static int -download_boot_block(void *dev_info, copr_buffer * buf) -{ - if (buf->len <= 0 || buf->len > sizeof(buf->data)) - return -(EINVAL); - - if (!sscape_download_boot(devc, buf->data, buf->len, buf->flags)) { - printf("SSCAPE: Unable to load microcode block to the OBP.\n"); - return -(EIO); - } - return 0; -} - -static int -sscape_coproc_ioctl(void *dev_info, u_int cmd, ioctl_arg arg, int local) -{ - - switch (cmd) { - case SNDCTL_COPR_RESET: - sscape_coproc_reset(dev_info); - return 0; - break; - - case SNDCTL_COPR_LOAD: - { - copr_buffer *buf; - int err; - - buf = (copr_buffer *) malloc(sizeof(copr_buffer), M_TEMP, M_WAITOK); - if (buf == NULL) - return -(ENOSPC); - bcopy(&(((char *) arg)[0]), (char *) buf, sizeof(*buf)); - err = download_boot_block(dev_info, buf); - free(buf, M_TEMP); - return err; - } - break; - - default: - return -(EINVAL); - } - -} - -static coproc_operations sscape_coproc_operations = -{ - "SoundScape M68K", - sscape_coproc_open, - sscape_coproc_close, - sscape_coproc_ioctl, - sscape_coproc_reset, - &dev_info -}; - -#if !defined(EXCLUDE_NATIVE_PCM) && defined(CONFIG_AUDIO) -static struct audio_operations sscape_audio_operations = -{ - "Not functional", - 0, - AFMT_U8 | AFMT_S16_LE, - NULL, - sscape_audio_open, - sscape_audio_close, - sscape_audio_output_block, - sscape_audio_start_input, - sscape_audio_ioctl, - sscape_audio_prepare_for_input, - sscape_audio_prepare_for_output, - sscape_audio_reset, - sscape_audio_halt, - NULL, - NULL -}; -#endif /* !defined(EXCLUDE_NATIVE_PCM) && defined(CONFIG_AUDIO) */ - -static int sscape_detected = 0; - -void -attach_sscape(struct address_info * hw_config) -{ -#ifndef SSCAPE_REGS - /* - * Config register values for Spea/V7 Media FX and Ensoniq S-2000. - * These values are card dependent. If you have another SoundScape - * based card, you have to find the correct values. Do the following: - * - Compile this driver with SSCAPE_DEBUG1 defined. - Shut down and - * power off your machine. - Boot with DOS so that the SSINIT.EXE - * program is run. - Warm boot to {Linux|SYSV|BSD} and write down the - * lines displayed when detecting the SoundScape. - Modify the - * following list to use the values printed during boot. Undefine the - * SSCAPE_DEBUG1 - */ -#define SSCAPE_REGS { \ -/* I0 */ 0x00, \ - 0xf0, /* Note! Ignored. Set always to 0xf0 */ \ - 0x20, /* Note! Ignored. Set always to 0x20 */ \ - 0x20, /* Note! Ignored. Set always to 0x20 */ \ - 0xf5, /* Ignored */ \ - 0x10, \ - 0x00, \ - 0x2e, /* I7 MEM config A. Likely to vary between models */ \ - 0x00, /* I8 MEM config B. Likely to vary between models */ \ -/* I9 */ 0x40 /* Ignored */ \ - } -#endif - - u_long flags; - static u_char regs[10] = SSCAPE_REGS; - - int i, irq_bits = 0xff; - - if (sscape_detected != hw_config->io_base) - return; - - if (old_hardware) { - valid_interrupts = valid_interrupts_old; - conf_printf("Ensoniq Soundscape (old)", hw_config); - } else - conf_printf("Ensoniq Soundscape", hw_config); - - for (i = 0; i < sizeof(valid_interrupts); i++) - if (hw_config->irq == valid_interrupts[i]) { - irq_bits = i; - break; - } - if (hw_config->irq > 15 || (regs[4] = irq_bits == 0xff)) { - printf("Invalid IRQ%d\n", hw_config->irq); - return; - } - flags = splhigh(); - - for (i = 1; i < 10; i++) - switch (i) { - case 1: /* Host interrupt enable */ - sscape_write(devc, i, 0xf0); /* All interrupts enabled */ - break; - - case 2: /* DMA A status/trigger register */ - case 3: /* DMA B status/trigger register */ - sscape_write(devc, i, 0x20); /* DMA channel disabled */ - break; - - case 4: /* Host interrupt config reg */ - sscape_write(devc, i, 0xf0 | (irq_bits << 2) | irq_bits); - break; - - case 5: /* Don't destroy CD-ROM DMA config bits (0xc0) */ - sscape_write(devc, i, (regs[i] & 0x3f) | - (sscape_read(devc, i) & 0xc0)); - break; - - case 6: /* CD-ROM config. Don't touch. */ - break; - - case 9: /* Master control reg. Don't modify CR-ROM - * bits. Disable SB emul */ - sscape_write(devc, i, (sscape_read(devc, i) & 0xf0) | 0x00); - break; - - default: - sscape_write(devc, i, regs[i]); - } - - splx(flags); - -#ifdef SSCAPE_DEBUG2 - /* - * Temporary debugging aid. Print contents of the registers after - * changing them. - */ - { - int i; - - for (i = 0; i < 13; i++) - printf("I%d = %02x (new value)\n", i, sscape_read(devc, i)); - } -#endif - -#if defined(CONFIG_MIDI) && defined(CONFIG_MPU_EMU) - if (probe_mpu401(hw_config)) - hw_config->always_detect = 1; - { - int prev_devs; - - prev_devs = num_midis; - attach_mpu401(hw_config); - - if (num_midis == (prev_devs + 1)) /* The MPU driver - * installed itself */ - midi_devs[prev_devs]->coproc = &sscape_coproc_operations; - } -#endif - -#ifndef EXCLUDE_NATIVE_PCM - /* Not supported yet */ - -#ifdef CONFIG_AUDIO - if (num_audiodevs < MAX_AUDIO_DEV) { - int my_dev; - - audio_devs[my_dev = num_audiodevs++] = &sscape_audio_operations; - audio_devs[my_dev]->dmachan1 = hw_config->dma; - audio_devs[my_dev]->buffsize = DSP_BUFFSIZE; - audio_devs[my_dev]->devc = devc; - devc->my_audiodev = my_dev; - devc->opened = 0; - audio_devs[my_dev]->coproc = &sscape_coproc_operations; - if (snd_set_irq_handler(hw_config->irq, sscapeintr, devc->osp) < 0) - printf("Error: Can't allocate IRQ for SoundScape\n"); - sscape_write(devc, GA_INTENA_REG, 0x80); /* Master IRQ enable */ - } else - printf("SoundScape: More than enough audio devices detected\n"); -#endif -#endif - devc->ok = 1; - devc->failed = 0; - return; -} - -int -probe_sscape(struct address_info * hw_config) -{ - u_char save; - - devc->failed = 1; - devc->base = hw_config->io_base; - devc->irq = hw_config->irq; - devc->dma = hw_config->dma; - devc->osp = hw_config->osp; - - if (sscape_detected != 0 && sscape_detected != hw_config->io_base) - return 0; - - /* - * First check that the address register of "ODIE" is there and that - * it has exactly 4 writeable bits. First 4 bits - */ - if ((save = inb(PORT(ODIE_ADDR))) & 0xf0) - return 0; - - outb(PORT(ODIE_ADDR), 0x00); - if (inb(PORT(ODIE_ADDR)) != 0x00) - return 0; - - outb(PORT(ODIE_ADDR), 0xff); - if (inb(PORT(ODIE_ADDR)) != 0x0f) - return 0; - - outb(PORT(ODIE_ADDR), save); - - /* - * Now verify that some indirect registers return zero on some bits. - * This may break the driver with some future revisions of "ODIE" - * but... - */ - - if (sscape_read(devc, 0) & 0x0c) - return 0; - - if (sscape_read(devc, 1) & 0x0f) - return 0; - - if (sscape_read(devc, 5) & 0x0f) - return 0; - -#ifdef SSCAPE_DEBUG1 - /* - * Temporary debugging aid. Print contents of the registers before - * changing them. - */ - { - int i; - - for (i = 0; i < 13; i++) - printf("I%d = %02x (old value)\n", i, sscape_read(devc, i)); - } -#endif - - if (old_hardware) { /* Check that it's really an old Spea/Reveal card. */ - u_char tmp; - int cc; - - if (!((tmp = sscape_read(devc, GA_HMCTL_REG)) & 0xc0)) { - sscape_write(devc, GA_HMCTL_REG, tmp | 0x80); - for (cc = 0; cc < 200000; ++cc) - inb(devc->base + ODIE_ADDR); - } else - old_hardware = 0; - } - if (0) { - printf("sscape.c: Can't allocate DMA channel\n"); - return 0; - } - sscape_detected = hw_config->io_base; - - return 1; -} - -int -probe_ss_mss(struct address_info * hw_config) -{ - int i, irq_bits = 0xff; - - if (devc->failed) - return 0; - - if (devc->ok == 0) { - printf("SoundScape: Invalid initialization order.\n"); - return 0; - } - for (i = 0; i < sizeof(valid_interrupts); i++) - if (hw_config->irq == valid_interrupts[i]) { - irq_bits = i; - break; - } - if (hw_config->irq > 15 || irq_bits == 0xff) { - printf("SoundScape: Invalid MSS IRQ%d\n", hw_config->irq); - return 0; - } - return ad1848_detect(hw_config->io_base, NULL, hw_config->osp); -} - -void -attach_ss_mss(struct address_info * hw_config) -{ - /* - * This routine configures the SoundScape card for use with the Win - * Sound System driver. The AD1848 codec interface uses the CD-ROM - * config registers of the "ODIE". - */ - - int i, irq_bits = 0xff; - -#ifndef CONFIG_NATIVE_PCM - int prev_devs = num_audiodevs; -#endif - - /* - * Setup the DMA polarity. - */ - sscape_write(devc, GA_DMACFG_REG, 0x50); - - /* - * Take the gate-arry off of the DMA channel. - */ - sscape_write(devc, GA_DMAB_REG, 0x20); - - /* - * Init the AD1848 (CD-ROM) config reg. - */ - - for (i = 0; i < sizeof(valid_interrupts); i++) - if (hw_config->irq == valid_interrupts[i]) { - irq_bits = i; - break; - } - sscape_write(devc, GA_CDCFG_REG, 0x89 | (hw_config->dma << 4) | - (irq_bits << 1)); - - if (hw_config->irq == devc->irq) - printf("SoundScape: Warning! WSS mode can't share IRQ with MIDI\n"); - - ad1848_init("SoundScape", hw_config->io_base, - hw_config->irq, - hw_config->dma, - hw_config->dma, - 0, - devc->osp); - -#ifndef CONFIG_NATIVE_PCM - /* Check if the AD1848 driver installed itself */ - if (num_audiodevs == (prev_devs + 1)) - audio_devs[prev_devs]->coproc = &sscape_coproc_operations; -#endif - - return; -} - -#endif diff --git a/sys/dev/sound/isa/i386/sys_timer.c b/sys/dev/sound/isa/i386/sys_timer.c deleted file mode 100644 index ea629d6258..0000000000 --- a/sys/dev/sound/isa/i386/sys_timer.c +++ /dev/null @@ -1,277 +0,0 @@ -/* - * sound/sys_timer.c - * - * The default timer for the Level 2 sequencer interface. - * Uses the (100hz) timer of kernel. - * - * Copyright by Hannu Savolainen 1993 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/Attic/sys_timer.c,v 1.2 2003/08/07 21:17:12 dillon Exp $ - */ - -#define SEQUENCER_C -#include "sound_config.h" - -#if NSND > 0 - -#if defined(CONFIG_SEQUENCER) - -static volatile int opened = 0, tmr_running = 0; -static volatile time_t tmr_offs, tmr_ctr; -static volatile u_long ticks_offs; -static volatile int curr_tempo, curr_timebase; -static volatile u_long curr_ticks; -static volatile u_long next_event_time; -static u_long prev_event_time; - -static void poll_def_tmr(void *dummy); - -static u_long -tmr2ticks(int tmr_value) -{ - /* - * Convert system timer ticks (hz) to MIDI ticks (divide # of MIDI - * ticks/minute by # of system ticks/minute). - */ - - return ((tmr_value * curr_tempo * curr_timebase) + (30 * hz)) / (60 * hz); -} - -static void -poll_def_tmr(void *dummy) -{ - - if (opened) { - - timeout( poll_def_tmr, 0, 1);; - - if (tmr_running) { - tmr_ctr++; - curr_ticks = ticks_offs + tmr2ticks(tmr_ctr); - - if (curr_ticks >= next_event_time) { - next_event_time = 0xffffffff; - sequencer_timer(0); - } - } - } -} - -static void -tmr_reset(void) -{ - u_long flags; - - flags = splhigh(); - tmr_offs = 0; - ticks_offs = 0; - tmr_ctr = 0; - next_event_time = 0xffffffff; - prev_event_time = 0; - curr_ticks = 0; - splx(flags); -} - -static int -def_tmr_open(int dev, int mode) -{ - if (opened) - return -(EBUSY); - - tmr_reset(); - curr_tempo = 60; - curr_timebase = hz; - opened = 1; - - timeout( poll_def_tmr, 0, 1);; - - return 0; -} - -static void -def_tmr_close(int dev) -{ - opened = tmr_running = 0; -} - -static int -def_tmr_event(int dev, u_char *event) -{ - u_char cmd = event[1]; - u_long parm = *(int *) &event[4]; - - switch (cmd) { - case TMR_WAIT_REL: - parm += prev_event_time; - case TMR_WAIT_ABS: - if (parm > 0) { - long time; - - if (parm <= curr_ticks) /* It's the time */ - return TIMER_NOT_ARMED; - - time = parm; - next_event_time = prev_event_time = time; - - return TIMER_ARMED; - } - break; - - case TMR_START: - tmr_reset(); - tmr_running = 1; - break; - - case TMR_STOP: - tmr_running = 0; - break; - - case TMR_CONTINUE: - tmr_running = 1; - break; - - case TMR_TEMPO: - if (parm) { - RANGE (parm, 8, 360) ; - tmr_offs = tmr_ctr; - ticks_offs += tmr2ticks(tmr_ctr); - tmr_ctr = 0; - curr_tempo = parm; - } - break; - - case TMR_ECHO: - seq_copy_to_input(event, 8); - break; - - default:; - } - - return TIMER_NOT_ARMED; -} - -static u_long -def_tmr_get_time(int dev) -{ - if (!opened) - return 0; - - return curr_ticks; -} - -static int -def_tmr_ioctl(int dev, u_int cmd, ioctl_arg arg) -{ - switch (cmd) { - case SNDCTL_TMR_SOURCE: - return *(int *) arg = TMR_INTERNAL; - break; - - case SNDCTL_TMR_START: - tmr_reset(); - tmr_running = 1; - return 0; - break; - - case SNDCTL_TMR_STOP: - tmr_running = 0; - return 0; - break; - - case SNDCTL_TMR_CONTINUE: - tmr_running = 1; - return 0; - break; - - case SNDCTL_TMR_TIMEBASE: - { - int val = (*(int *) arg); - - if (val) { - RANGE (val, 1, 1000) ; - curr_timebase = val; - } - return *(int *) arg = curr_timebase; - } - break; - - case SNDCTL_TMR_TEMPO: - { - int val = (*(int *) arg); - - if (val) { - RANGE (val, 8, 250) ; - tmr_offs = tmr_ctr; - ticks_offs += tmr2ticks(tmr_ctr); - tmr_ctr = 0; - curr_tempo = val; - } - return *(int *) arg = curr_tempo; - } - break; - - case SNDCTL_SEQ_CTRLRATE: - if ((*(int *) arg) != 0) /* Can't change */ - return -(EINVAL); - - return *(int *) arg = ((curr_tempo * curr_timebase) + 30) / 60; - break; - - case SNDCTL_TMR_METRONOME: - /* NOP */ - break; - - default:; - } - - return -(EINVAL); -} - -static void -def_tmr_arm(int dev, long time) -{ - if (time < 0) - time = curr_ticks + 1; - else if (time <= curr_ticks) /* It's the time */ - return; - - next_event_time = prev_event_time = time; - - return; -} - -struct sound_timer_operations default_sound_timer = -{ - {"System clock", 0}, - 0, /* Priority */ - 0, /* Local device link */ - def_tmr_open, - def_tmr_close, - def_tmr_event, - def_tmr_get_time, - def_tmr_ioctl, - def_tmr_arm -}; - -#endif -#endif /* NSND > 0 */ diff --git a/sys/dev/sound/isa/i386/trix/trix.c b/sys/dev/sound/isa/i386/trix/trix.c deleted file mode 100644 index a6ce463dca..0000000000 --- a/sys/dev/sound/isa/i386/trix/trix.c +++ /dev/null @@ -1,369 +0,0 @@ -/* - * sound/trix.c - * - * Low level driver for the MediaTriX AudioTriX Pro (MT-0002-PC Control Chip) - * - * Copyright by Hannu Savolainen 1995 - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/trix/Attic/trix.c,v 1.2 2003/08/07 21:17:13 dillon Exp $ - */ - -#include - -#if NTRIX > 0 - -#ifdef INCLUDE_TRIX_BOOT -#include "trix_boot.h" -#endif - -#if (NSB > 0) -extern int sb_no_recording; -#endif - -static int kilroy_was_here = 0; /* Don't detect twice */ -static int sb_initialized = 0; - -static sound_os_info *trix_osp = NULL; - -static u_char -trix_read(int addr) -{ - outb(0x390, (u_char) addr); /* MT-0002-PC ASIC address */ - return inb(0x391); /* MT-0002-PC ASIC data */ -} - -static void -trix_write(int addr, int data) -{ - outb(0x390, (u_char) addr); /* MT-0002-PC ASIC address */ - outb(0x391, (u_char) data); /* MT-0002-PC ASIC data */ -} - -static void -download_boot(int base) -{ -#ifdef INCLUDE_TRIX_BOOT - int i = 0, n = sizeof(trix_boot); - - trix_write(0xf8, 0x00); /* ??????? */ - outb(base + 6, 0x01); /* Clear the internal data pointer */ - outb(base + 6, 0x00); /* Restart */ - - /* - * Write the boot code to the RAM upload/download register. Each - * write increments the internal data pointer. - */ - outb(base + 6, 0x01); /* Clear the internal data pointer */ - outb(0x390, 0x1A); /* Select RAM download/upload port */ - - for (i = 0; i < n; i++) - outb(0x391, trix_boot[i]); - for (i = n; i < 10016; i++) /* Clear up to first 16 bytes of data RAM */ - outb(0x391, 0x00); - outb(base + 6, 0x00); /* Reset */ - outb(0x390, 0x50); /* ?????? */ -#endif - -} - -static int -trix_set_wss_port(struct address_info * hw_config) -{ - u_char addr_bits; - - if (0) { - printf("AudioTriX: Config port I/O conflict\n"); - return 0; - } - if (kilroy_was_here) /* Already initialized */ - return 0; - - if (trix_read(0x15) != 0x71) { /* No asic signature */ - DDB(printf("No AudioTriX ASIC signature found\n")); - return 0; - } - - kilroy_was_here = 1; - - /* - * Reset some registers. - */ - - trix_write(0x13, 0); - trix_write(0x14, 0); - - /* - * Configure the ASIC to place the codec to the proper I/O location - */ - - switch (hw_config->io_base) { - case 0x530: - addr_bits = 0; - break; - case 0x604: - addr_bits = 1; - break; - case 0xE80: - addr_bits = 2; - break; - case 0xF40: - addr_bits = 3; - break; - default: - return 0; - } - - trix_write(0x19, (trix_read(0x19) & 0x03) | addr_bits); - return 1; -} - -/* - * Probe and attach routines for the Windows Sound System mode of AudioTriX - * Pro - */ - -int -probe_trix_wss(struct address_info * hw_config) -{ - /* - * Check if the IO port returns valid signature. The original MS - * Sound system returns 0x04 while some cards (AudioTriX Pro for - * example) return 0x00. - */ - - if (0) { - printf("AudioTriX: MSS I/O port conflict\n"); - return 0; - } - trix_osp = hw_config->osp; - - if (!trix_set_wss_port(hw_config)) - return 0; - - if ((inb(hw_config->io_base + 3) & 0x3f) != 0x00) { - DDB(printf("No MSS signature detected on port 0x%x\n", - hw_config->io_base)); - return 0; - } - if (hw_config->irq > 11) { - printf("AudioTriX: Bad WSS IRQ %d\n", hw_config->irq); - return 0; - } - if (hw_config->dma != 0 && hw_config->dma != 1 && hw_config->dma != 3) { - printf("AudioTriX: Bad WSS DMA %d\n", hw_config->dma); - return 0; - } - if (hw_config->dma2 != -1) - if (hw_config->dma2 != 0 && hw_config->dma2 != 1 && hw_config->dma2 != 3) { - printf("AudioTriX: Bad capture DMA %d\n", hw_config->dma2); - return 0; - } - /* - * Check that DMA0 is not in use with a 8 bit board. - */ - - if (hw_config->dma == 0 && inb(hw_config->io_base + 3) & 0x80) { - printf("AudioTriX: Can't use DMA0 with a 8 bit card\n"); - return 0; - } - if (hw_config->irq > 7 && hw_config->irq != 9 && inb(hw_config->io_base + 3) & 0x80) { - printf("AudioTriX: Can't use IRQ%d with a 8 bit card\n", hw_config->irq); - return 0; - } - return ad1848_detect(hw_config->io_base + 4, NULL, hw_config->osp); -} - -void -attach_trix_wss(struct address_info * hw_config) -{ - static u_char interrupt_bits[12] = - {-1, -1, -1, -1, -1, -1, -1, 0x08, -1, 0x10, 0x18, 0x20}; - char bits; - - static u_char dma_bits[4] = - {1, 2, 0, 3}; - - int config_port = hw_config->io_base + 0, - version_port = hw_config->io_base + 3; - int dma1 = hw_config->dma, dma2 = hw_config->dma2; - - trix_osp = hw_config->osp; - - if (!kilroy_was_here) { - DDB(printf("AudioTriX: Attach called but not probed yet???\n")); - return ; - } - /* - * Set the IRQ and DMA addresses. - */ - - bits = interrupt_bits[hw_config->irq]; - if (bits == -1) { - printf("AudioTriX: Bad IRQ (%d)\n", hw_config->irq); - return ; - } - outb(config_port, bits | 0x40); - if ((inb(version_port) & 0x40) == 0) - printf("[IRQ Conflict?]"); - - if (hw_config->dma2 == -1) { /* Single DMA mode */ - bits |= dma_bits[dma1]; - dma2 = dma1; - } else { - u_char tmp; - - tmp = trix_read(0x13) & ~30; - trix_write(0x13, tmp | 0x80 | (dma1 << 4)); - - tmp = trix_read(0x14) & ~30; - trix_write(0x14, tmp | 0x80 | (dma2 << 4)); - } - - outb(config_port, bits);/* Write IRQ+DMA setup */ - - ad1848_init("AudioTriX Pro", hw_config->io_base + 4, - hw_config->irq, - dma1, - dma2, - 0, - hw_config->osp); - return ; -} - -int -probe_trix_sb(struct address_info * hw_config) -{ - int tmp; - u_char conf; - static char irq_translate[] = {-1, -1, -1, 0, 1, 2, -1, 3}; - -#ifndef INCLUDE_TRIX_BOOT - return 0; /* No boot code -> no fun */ -#endif - if (!kilroy_was_here) - return 0; /* AudioTriX Pro has not been detected earlier */ - - if (sb_initialized) - return 0; - - if ((hw_config->io_base & 0xffffff8f) != 0x200) - return 0; - - tmp = hw_config->irq; - if (tmp > 7) - return 0; - if (irq_translate[tmp] == -1) - return 0; - - tmp = hw_config->dma; - if (tmp != 1 && tmp != 3) - return 0; - - conf = 0x84; /* DMA and IRQ enable */ - conf |= hw_config->io_base & 0x70; /* I/O address bits */ - conf |= irq_translate[hw_config->irq]; - if (hw_config->dma == 3) - conf |= 0x08; - trix_write(0x1b, conf); - - download_boot(hw_config->io_base); - sb_initialized = 1; - - return 1; -} - -void -attach_trix_sb(struct address_info * hw_config) -{ -#if (NSB > 0) - sb_dsp_disable_midi(); - sb_no_recording = 1; -#endif - conf_printf("AudioTriX (SB)", hw_config); -} - -void -attach_trix_mpu(struct address_info * hw_config) -{ -#if (defined(CONFIG_MPU401) || defined(CONFIG_MPU_EMU)) && defined(CONFIG_MIDI) - attach_mpu401(hw_config); -#endif -} - -int -probe_trix_mpu(struct address_info * hw_config) -{ -#if (defined(CONFIG_MPU401) || defined(CONFIG_MPU_EMU)) && defined(CONFIG_MIDI) - u_char conf; - static char irq_bits[] = {-1, -1, -1, 1, 2, 3, -1, 4, -1, 5}; - - if (!kilroy_was_here) { - DDB(printf("Trix: WSS and SB modes must be initialized before MPU\n")); - return 0; /* AudioTriX Pro has not been detected earlier */ - } - if (!sb_initialized) { - DDB(printf("Trix: SB mode must be initialized before MPU\n")); - return 0; - } - if (mpu_initialized) { - DDB(printf("Trix: MPU mode already initialized\n")); - return 0; - } - if (hw_config->irq > 9) { - printf("AudioTriX: Bad MPU IRQ %d\n", hw_config->irq); - return 0; - } - if (irq_bits[hw_config->irq] == -1) { - printf("AudioTriX: Bad MPU IRQ %d\n", hw_config->irq); - return 0; - } - switch (hw_config->io_base) { - case 0x330: - conf = 0x00; - break; - case 0x370: - conf = 0x04; - break; - case 0x3b0: - conf = 0x08; - break; - case 0x3f0: - conf = 0x0c; - break; - default: - return 0; /* Invalid port */ - } - - conf |= irq_bits[hw_config->irq] << 4; - - trix_write(0x19, (trix_read(0x19) & 0x83) | conf); - - mpu_initialized = 1; - - return probe_mpu401(hw_config); -#else - return 0; -#endif -} - -#endif diff --git a/sys/dev/sound/isa/i386/trix/trix_boot.h b/sys/dev/sound/isa/i386/trix/trix_boot.h deleted file mode 100644 index d6bd16aff3..0000000000 --- a/sys/dev/sound/isa/i386/trix/trix_boot.h +++ /dev/null @@ -1,2488 +0,0 @@ -/* - * Computer generated file. Do not edit. - */ -static unsigned char trix_boot[] = { -0x80,0x2e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x40,0xe1,0x00,0x00, -0x00,0x00,0x00,0x02,0x44,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x02,0x44,0xcb,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x74,0x00,0xa2,0xe3,0x92,0xd3,0xa2,0xe4,0x92,0xd4,0x75,0x81,0x45,0x12,0x3d,0x2e, -0xd2,0xaa,0xd2,0xaf,0x12,0x04,0xb9,0x7e,0x97,0x7f,0x54,0x90,0x00,0x00,0x02,0x0e, -0x14,0x80,0xfe,0x12,0x00,0x5c,0x12,0x03,0xc7,0x02,0x00,0x74,0xd0,0x00,0xd0,0x01, -0xc0,0x02,0xc0,0x03,0xc0,0x01,0xc0,0x00,0x8b,0x82,0x8a,0x83,0xe0,0xcc,0xfa,0xa3, -0xe0,0xcd,0xfb,0x22,0xd0,0x82,0xd0,0x83,0xf5,0xf0,0xea,0xf0,0xa3,0xeb,0xf0,0xe5, -0xf0,0x22,0xeb,0x33,0xe4,0x95,0xe0,0xfa,0xed,0x33,0xe4,0x95,0xe0,0xfc,0xec,0x33, -0xea,0x6c,0x13,0xc0,0xe0,0x12,0x03,0xcf,0xd0,0xf0,0x60,0x0c,0x30,0xf6,0x02,0xaa, -0xf0,0xea,0x33,0xb3,0xe4,0xfa,0x33,0xfb,0x22,0x7a,0x00,0x7c,0x00,0x12,0x03,0xcf, -0x60,0x05,0xb3,0xe4,0xfa,0x33,0xfb,0x22,0xeb,0x33,0xe4,0x95,0xe0,0xfa,0xed,0x33, -0xe4,0x95,0xe0,0xfc,0xec,0x33,0xea,0x6c,0x13,0xc0,0xe0,0x12,0x03,0xcf,0xd0,0xe0, -0x30,0xe6,0x01,0xfa,0xe4,0xca,0x23,0x54,0x01,0xfb,0x22,0x7a,0x00,0x7c,0x00,0x12, -0x03,0xcf,0xe4,0xfa,0x33,0xfb,0x22,0xeb,0x33,0xe4,0x95,0xe0,0xfa,0xed,0x33,0xe4, -0x95,0xe0,0xfc,0xec,0x33,0xea,0x6c,0x13,0xc0,0xe0,0x12,0x03,0xcf,0xd0,0xe0,0x30, -0xe6,0x01,0xfa,0xe4,0xca,0xf4,0x23,0x54,0x01,0xfb,0x22,0x7a,0x00,0x7c,0x00,0x12, -0x03,0xcf,0xe4,0xfa,0xb3,0x33,0xfb,0x22,0x7a,0x00,0x7c,0x00,0x12,0x03,0xcf,0x0b, -0x60,0x04,0xe4,0xfa,0x33,0xfb,0xeb,0x22,0x7a,0x00,0x7c,0x00,0x12,0x03,0xcf,0x0b, -0x60,0x03,0xe4,0xfa,0xfb,0xeb,0x22,0x7a,0x00,0x7c,0x00,0x12,0x03,0xcf,0x60,0x04, -0xe4,0xfa,0x04,0xfb,0xeb,0x22,0xd0,0x83,0xd0,0x82,0xe4,0x93,0xf5,0xf0,0xa3,0xe4, -0x93,0xa3,0xc0,0x82,0xc0,0x83,0xb8,0x03,0x0a,0xc0,0x04,0xc0,0x05,0xc0,0x00,0x78, -0x04,0x80,0x08,0xc0,0x02,0xc0,0x03,0xc0,0x00,0x78,0x02,0xa6,0xf0,0x08,0xf6,0x12, -0x03,0xd8,0xd0,0x00,0xb8,0x03,0x05,0xd0,0x05,0xd0,0x04,0x22,0x8b,0x05,0x8a,0x04, -0xd0,0x03,0xd0,0x02,0x22,0xd0,0x83,0xd0,0x82,0x12,0x02,0x14,0x80,0x0e,0xd0,0x83, -0xd0,0x82,0x12,0x02,0x14,0xc3,0xe4,0x99,0xf9,0xe4,0x98,0xf8,0xc0,0x82,0xc0,0x83, -0x8a,0x83,0x8b,0x82,0xc0,0x82,0xc0,0x83,0x80,0x28,0x78,0x00,0x79,0x01,0x80,0x04, -0x78,0xff,0x79,0xff,0xd0,0x83,0xd0,0x82,0xe4,0x93,0xa3,0xc0,0x82,0xc0,0x83,0x8a, -0x83,0x8b,0x82,0xb4,0x01,0x05,0xe0,0x29,0xfb,0xf0,0x22,0xc0,0x82,0xc0,0x83,0xb4, -0x02,0x13,0xe0,0xfa,0xa3,0xe0,0x29,0xfb,0xea,0x38,0xfa,0xd0,0x83,0xd0,0x82,0xf0, -0xa3,0xeb,0xf0,0x4a,0x22,0x75,0xf0,0x04,0xc0,0x00,0x78,0x02,0xe0,0xf6,0x08,0xa3, -0xd5,0xf0,0xf9,0x29,0xfd,0xd0,0x00,0xec,0x38,0xfc,0xeb,0x38,0xfb,0xea,0x38,0xfa, -0xd0,0x83,0xd0,0x82,0x75,0xf0,0x04,0x78,0x02,0xe6,0xf0,0xa3,0x08,0xd5,0xf0,0xf9, -0x4c,0x4b,0x4a,0x22,0xe4,0x93,0xf8,0xa3,0xe4,0x93,0xf9,0xa3,0x22,0xd0,0x83,0xd0, -0x82,0x12,0x02,0x14,0x80,0x0e,0xd0,0x83,0xd0,0x82,0x12,0x02,0x14,0xc3,0xe4,0x99, -0xf9,0xe4,0x98,0xf8,0xc0,0x82,0xc0,0x83,0x8a,0x83,0x8b,0x82,0xc0,0x82,0xc0,0x83, -0x80,0x2a,0x78,0x00,0x79,0x01,0x80,0x04,0x78,0xff,0x79,0xff,0xd0,0x83,0xd0,0x82, -0xe4,0x93,0xa3,0xc0,0x82,0xc0,0x83,0x8a,0x83,0x8b,0x82,0xb4,0x01,0x07,0xe0,0x29, -0xf0,0xc3,0x99,0xfb,0x22,0xc0,0x82,0xc0,0x83,0xb4,0x02,0x19,0xe0,0xfa,0xa3,0xe0, -0x29,0xfb,0xea,0x38,0xfa,0xd0,0x83,0xd0,0x82,0xf0,0xa3,0xeb,0xf0,0xc3,0x99,0xfb, -0xea,0x98,0xfa,0x4b,0x22,0x75,0xf0,0x04,0xc0,0x00,0x78,0x02,0xe0,0xf6,0x08,0xa3, -0xd5,0xf0,0xf9,0x29,0xfd,0xd0,0x00,0xec,0x38,0xfc,0xeb,0x38,0xfb,0xea,0x38,0xfa, -0xd0,0x83,0xd0,0x82,0x75,0xf0,0x04,0xc0,0x00,0x78,0x02,0xe6,0xf0,0xa3,0x08,0xd5, -0xf0,0xf9,0xd0,0x00,0xc3,0x99,0xfd,0xec,0x98,0xfc,0xeb,0x98,0xfb,0xea,0x98,0xfa, -0x4b,0x4c,0x4d,0x22,0xeb,0x60,0x11,0x24,0xf0,0x50,0x04,0xe4,0xfa,0xfb,0x22,0xec, -0xc3,0x13,0xfc,0xed,0x13,0xfd,0xdb,0xf7,0x8c,0x02,0x8d,0x03,0xea,0x4b,0x22,0xeb, -0x60,0x11,0x24,0xf0,0x50,0x04,0xe4,0xfa,0xfb,0x22,0xed,0xc3,0x33,0xfd,0xec,0x33, -0xfc,0xdb,0xf7,0x8c,0x02,0x8d,0x03,0xea,0x4b,0x22,0xea,0x5c,0xfa,0xeb,0x5d,0xfb, -0x4a,0x22,0xea,0x4c,0xfa,0xeb,0x4d,0xfb,0x4a,0x22,0x8a,0x83,0x8b,0x82,0xed,0xf0, -0xfb,0x22,0x8a,0x83,0x8b,0x82,0xec,0xf0,0xfa,0xa3,0xed,0xf0,0xfb,0x4a,0x22,0xc0, -0x03,0xc0,0x02,0x12,0x05,0xf9,0xd0,0x83,0xd0,0x82,0x78,0x04,0x79,0x02,0xe7,0xf0, -0x09,0xa3,0xd8,0xfa,0x4c,0x4b,0x4a,0x22,0x78,0x03,0x79,0x01,0x80,0x08,0x79,0x02, -0x80,0x02,0x79,0x04,0x78,0x02,0xd0,0x83,0xd0,0x82,0xe4,0x93,0x2b,0xf5,0xf0,0xa3, -0xe4,0x93,0x3a,0x80,0x27,0x78,0x03,0x79,0x01,0x80,0x14,0x78,0x05,0x79,0x01,0x80, -0x0e,0x79,0x02,0x80,0x08,0x78,0x04,0x79,0x02,0x80,0x04,0x79,0x04,0x78,0x02,0xd0, -0x83,0xd0,0x82,0xe4,0x93,0x2f,0xf5,0xf0,0xa3,0xe4,0x93,0x3e,0xa3,0xc0,0x82,0xc0, -0x83,0xf5,0x83,0x85,0xf0,0x82,0x75,0xf0,0x00,0xe0,0xf6,0x42,0xf0,0x08,0xa3,0xd9, -0xf8,0xe5,0xf0,0x22,0x78,0x03,0x79,0x01,0x80,0x08,0x79,0x02,0x80,0x02,0x79,0x04, -0x78,0x02,0xd0,0x83,0xd0,0x82,0xe4,0x93,0x2f,0xf5,0xf0,0xa3,0xe4,0x93,0x3e,0xa3, -0xc0,0x82,0xc0,0x83,0xf5,0x83,0x85,0xf0,0x82,0x75,0xf0,0x00,0xe6,0xf0,0xa3,0x08, -0x42,0xf0,0xd9,0xf8,0xe5,0xf0,0x22,0xeb,0x2d,0xfb,0xea,0x3c,0xfa,0x4b,0x22,0xed, -0xc3,0x9b,0xfb,0xec,0x9a,0xfa,0x4b,0x22,0xeb,0x8c,0xf0,0xa4,0xca,0x8d,0xf0,0xa4, -0x2a,0xfa,0xeb,0x8d,0xf0,0xa4,0xfb,0xe5,0xf0,0x2a,0xfa,0x4b,0x22,0x79,0x00,0xea, -0x30,0xe7,0x07,0x79,0x01,0x78,0x03,0x12,0x04,0x5f,0xec,0x30,0xe7,0x08,0x63,0x01, -0x01,0x78,0x05,0x12,0x04,0x5f,0xc0,0x01,0x12,0x04,0x25,0xd0,0x01,0xb9,0x01,0x05, -0x78,0x05,0x12,0x04,0x5f,0x8c,0x02,0x8d,0x03,0xea,0x4b,0x22,0xe4,0xc3,0x9b,0xfb, -0xe4,0x9a,0xfa,0x4b,0x22,0xbb,0x00,0x04,0xba,0x00,0x01,0x22,0x78,0x00,0x79,0x00, -0x74,0x10,0xc0,0xe0,0xc3,0xed,0x33,0xfd,0xec,0x33,0xfc,0xe9,0x33,0xf9,0xe8,0x33, -0xf8,0xc3,0xe9,0x9b,0xf5,0xf0,0xe8,0x9a,0x40,0x0b,0xf8,0xa9,0xf0,0xed,0x24,0x01, -0xfd,0xec,0x34,0x00,0xfc,0xd0,0xe0,0x14,0xc0,0xe0,0x70,0xd8,0xd0,0xe0,0x22,0xe4, -0xc3,0x96,0xf6,0x18,0xe4,0x96,0xf6,0x22,0xd0,0x83,0xd0,0x82,0xe4,0x93,0xf8,0xa3, -0xe4,0x93,0xf9,0xa3,0xe4,0x93,0xfc,0xa3,0xe4,0x93,0xfd,0xa3,0xc3,0xeb,0x99,0xf9, -0xea,0x98,0xf8,0x20,0xe7,0x08,0xc3,0xed,0x9b,0xec,0x9a,0x30,0xe7,0x0d,0xe4,0x93, -0xf5,0xf0,0xa3,0xe4,0x93,0xa3,0xc0,0xe0,0xc0,0xf0,0x22,0xa3,0xa3,0xe9,0x29,0x50, -0x02,0x05,0x83,0x25,0x82,0xf5,0x82,0xe5,0x83,0x38,0x28,0xf5,0x83,0xe4,0x93,0xf5, -0xf0,0xa3,0xe4,0x93,0xc0,0xe0,0xc0,0xf0,0x22,0x90,0x46,0xc2,0xaa,0x83,0xab,0x82, -0x90,0x42,0x80,0x12,0x05,0x14,0x90,0x9b,0x15,0xaa,0x83,0xab,0x82,0x90,0x9b,0x15, -0x12,0x05,0x1f,0x60,0x2c,0xc0,0x02,0xc0,0x03,0xc0,0x82,0xc0,0x83,0x78,0x02,0x79, -0x04,0xe4,0x93,0xf6,0xa3,0x08,0xd9,0xf9,0x8b,0x82,0x8a,0x83,0x8c,0x02,0x8d,0x03, -0x12,0x05,0x14,0xd0,0x83,0xd0,0x82,0xd0,0x03,0xd0,0x02,0xa3,0xa3,0xa3,0xa3,0x80, -0xcf,0x12,0x05,0x28,0x9b,0x15,0x4c,0x83,0x46,0xc2,0x12,0x05,0x28,0x9b,0x15,0x9b, -0x15,0x95,0x54,0x22,0x12,0x05,0x1f,0x70,0x01,0x22,0xe4,0xf0,0xa3,0x80,0xf5,0xeb, -0x65,0x82,0x70,0x03,0xea,0x65,0x83,0x22,0xd0,0x83,0xd0,0x82,0x78,0x02,0x79,0x06, -0xe4,0x93,0xf6,0xa3,0x08,0xd9,0xf9,0xc0,0x82,0xc0,0x83,0x8d,0x82,0x8c,0x83,0x12, -0x05,0x1f,0x60,0x13,0xe4,0x93,0xa3,0xad,0x82,0xac,0x83,0x8f,0x82,0x8e,0x83,0xf0, -0xa3,0xaf,0x82,0xae,0x83,0x80,0xe4,0x22,0x60,0x19,0xc0,0x00,0xc0,0x01,0xc0,0x83, -0xc0,0x82,0xf8,0x54,0x01,0x24,0x02,0xf9,0x12,0x06,0x00,0xd0,0x82,0xd0,0x83,0xd0, -0x01,0xd0,0x00,0xef,0x25,0x82,0xfd,0xee,0x35,0x83,0xfc,0xc3,0xef,0x99,0xf5,0x82, -0xff,0xee,0x98,0xfe,0xf5,0x83,0xd0,0x02,0xd0,0x03,0xd0,0xe0,0xf0,0xa3,0xd0,0xe0, -0xf0,0xa3,0xec,0xf0,0xa3,0xed,0xf0,0xc0,0x03,0xc0,0x02,0x22,0x8e,0x83,0x8f,0x82, -0xe0,0xf5,0xf0,0xa3,0xe0,0xc0,0xe0,0xc0,0xf0,0xa3,0xe0,0xfe,0xa3,0xe0,0xff,0x22, -0xd0,0x01,0xd0,0x00,0xd0,0xe0,0xd0,0xf0,0xc0,0x00,0xc0,0x01,0xc0,0xf0,0xc0,0xe0, -0x22,0x78,0x01,0x79,0x03,0x02,0x06,0x00,0x78,0x01,0x79,0x05,0x02,0x06,0x00,0x78, -0x02,0x79,0x02,0x02,0x06,0x00,0x78,0x02,0x79,0x04,0x02,0x06,0x00,0x78,0x01,0x79, -0x03,0x02,0x06,0x13,0x78,0x01,0x79,0x05,0x02,0x06,0x13,0x78,0x02,0x79,0x02,0x02, -0x06,0x13,0x78,0x02,0x79,0x04,0x02,0x06,0x13,0x78,0x04,0x79,0x02,0x02,0x06,0x13, -0xef,0xc3,0x98,0xff,0xee,0x94,0x00,0xfe,0x8f,0x82,0x8e,0x83,0xe7,0xf0,0xa3,0x09, -0xd8,0xfa,0x22,0xc0,0xe0,0x8f,0x82,0x8e,0x83,0xe0,0xf7,0xa3,0x09,0xd8,0xfa,0xae, -0x83,0xaf,0x82,0xd0,0xe0,0x22,0x74,0x02,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x12, -0x03,0x61,0x04,0x00,0x90,0x42,0x80,0xea,0xf0,0xeb,0xa3,0xf0,0x7b,0x00,0x12,0x05, -0xc1,0x7b,0x05,0x12,0x05,0xc1,0x7b,0x01,0x90,0x00,0x03,0x12,0x0d,0x73,0x7b,0x02, -0x12,0x05,0xc1,0x7b,0x05,0x12,0x05,0xc1,0x7b,0x01,0x90,0x00,0x03,0x12,0x0d,0x73, -0x90,0x00,0x00,0x12,0x0d,0xed,0x7b,0xf9,0x90,0x42,0x0c,0xeb,0xf0,0x90,0x42,0x0c, -0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00,0x12,0x01,0x3b,0x60, -0x1a,0x7b,0x00,0x12,0x05,0xc1,0x90,0x42,0x0c,0xe0,0xfb,0x90,0x00,0x02,0x12,0x0c, -0xe7,0x7b,0x0c,0x7a,0x42,0x12,0x02,0x48,0x01,0x80,0xd2,0x7b,0x1b,0x12,0x05,0xc1, -0x7b,0xf8,0x90,0x00,0x02,0x12,0x0c,0xe7,0x7b,0x01,0x7a,0x00,0x02,0x05,0x9c,0xe4, -0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04, -0x12,0x05,0x58,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x7b,0x20,0xeb,0x2d,0xfb,0x90, -0x42,0x0d,0xeb,0xf0,0x7b,0x82,0x7a,0x42,0x8b,0x05,0x8a,0x04,0x90,0x42,0x0d,0xe0, -0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x8b,0x05,0x7b,0xfe, -0xeb,0x5d,0xfb,0x8b,0x05,0x12,0x03,0x55,0x05,0x00,0xeb,0x4d,0xfb,0x12,0x05,0xc1, -0x90,0x42,0x0d,0xe0,0xfb,0x90,0x00,0x02,0x12,0x0c,0xe7,0x7b,0xe8,0x8b,0x05,0x7b, -0x0d,0x7a,0x42,0x8a,0x83,0x8b,0x82,0xe0,0x2d,0xf0,0xfb,0x12,0x03,0x55,0x06,0x00, -0x12,0x05,0xc1,0x90,0x42,0x0d,0xe0,0xfb,0x90,0x00,0x02,0x12,0x0c,0xe7,0x02,0x05, -0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x7b,0x00,0x7a,0x00,0x90,0x42, -0x0f,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x0f,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05, -0x8a,0x04,0x7b,0xe8,0x7a,0x03,0x12,0x00,0xc4,0x60,0x1a,0x90,0x00,0x00,0x12,0x0d, -0xed,0x8b,0x05,0x7b,0x02,0xeb,0x5d,0x70,0x02,0x80,0x0a,0x7b,0x0f,0x7a,0x42,0x12, -0x02,0x42,0x02,0x80,0xd1,0x12,0x03,0x55,0x04,0x00,0x7a,0x00,0x8b,0x05,0x8a,0x04, -0x7b,0x80,0x7a,0x00,0x12,0x03,0xc7,0x90,0x42,0x0e,0xeb,0xf0,0x74,0x05,0x2f,0xfb, -0xe4,0x3e,0xfa,0x12,0x02,0x42,0x02,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x8b,0x05,0x7b, -0x3f,0xeb,0x5d,0xfb,0x12,0x05,0xc1,0x90,0x42,0x0e,0xe0,0xfb,0x90,0x00,0x02,0x12, -0x0c,0xe7,0x7b,0x18,0x8b,0x05,0x7b,0x0e,0x7a,0x42,0x8a,0x83,0x8b,0x82,0xe0,0x2d, -0xf0,0xfb,0x74,0x05,0x2f,0xfb,0xe4,0x3e,0xfa,0x12,0x02,0x42,0x02,0x8a,0x83,0x8b, -0x82,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x42,0x0e,0xe0,0xfb,0x90,0x00,0x02,0x12,0x0c, -0xe7,0x7b,0x18,0x8b,0x05,0x7b,0x0e,0x7a,0x42,0x8a,0x83,0x8b,0x82,0xe0,0x2d,0xf0, -0xfb,0x74,0x05,0x2f,0xfb,0xe4,0x3e,0xfa,0x12,0x02,0x42,0x02,0x8a,0x83,0x8b,0x82, -0xe0,0xfb,0x12,0x05,0xc1,0x90,0x42,0x0e,0xe0,0xfb,0x90,0x00,0x02,0x12,0x0c,0xe7, -0x7b,0x18,0x8b,0x05,0x7b,0x0e,0x7a,0x42,0x8a,0x83,0x8b,0x82,0xe0,0x2d,0xf0,0xfb, -0x74,0x05,0x2f,0xfb,0xe4,0x3e,0xfa,0x12,0x02,0x42,0x02,0x8a,0x83,0x8b,0x82,0xe0, -0xfb,0x12,0x05,0xc1,0x90,0x42,0x0e,0xe0,0xfb,0x90,0x00,0x02,0x12,0x0c,0xe7,0x7b, -0x18,0x8b,0x05,0x7b,0x0e,0x7a,0x42,0x8a,0x83,0x8b,0x82,0xe0,0x2d,0xf0,0xfb,0x74, -0x05,0x2f,0xfb,0xe4,0x3e,0xfa,0x12,0x02,0x42,0x02,0x8a,0x83,0x8b,0x82,0xe0,0xfb, -0x8b,0x05,0x7b,0x07,0xeb,0x5d,0xfb,0x12,0x05,0xc1,0x90,0x42,0x0e,0xe0,0xfb,0x90, -0x00,0x02,0x12,0x0c,0xe7,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05, -0x58,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x7b,0x50,0xeb,0x2d,0xfb,0x90,0x42,0x11, -0xeb,0xf0,0x12,0x03,0x55,0x05,0x00,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0x01,0x12, -0x02,0xdf,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x06,0x00,0x12,0x05,0xd6,0x8b,0x05, -0x7b,0x01,0xeb,0x5d,0xfb,0x12,0x05,0xf2,0x7a,0x00,0x12,0x03,0x02,0x12,0x05,0xc1, -0x90,0x42,0x11,0xe0,0xfb,0x90,0x00,0x02,0x12,0x0c,0xe7,0x02,0x05,0x9c,0x74,0x01, -0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x7b,0x68, -0xeb,0x2d,0xfb,0x90,0x42,0x12,0xeb,0xf0,0x7b,0x82,0x7a,0x42,0x8b,0x05,0x8a,0x04, -0x90,0x42,0x12,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb, -0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0x30,0x7a,0xff,0x12,0x02,0xfa,0x8b,0x05,0x8a, -0x04,0x12,0x03,0x55,0x05,0x00,0x12,0x05,0xd6,0x8b,0x05,0x7b,0x0f,0xeb,0x5d,0xfb, -0x12,0x05,0xf2,0x7a,0x00,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x80,0x7a,0x00, -0x12,0x03,0x02,0x12,0x05,0xf2,0x12,0x03,0x02,0x12,0x05,0xc1,0x90,0x42,0x12,0xe0, -0xfb,0x90,0x00,0x02,0x12,0x0c,0xe7,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04, -0x12,0x05,0x58,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x7b,0x68,0xeb,0x2d,0xfb,0x90, -0x42,0x13,0xeb,0xf0,0x7b,0x82,0x7a,0x42,0x8b,0x05,0x8a,0x04,0x90,0x42,0x13,0xe0, -0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05, -0x8a,0x04,0x7b,0x7f,0x7a,0xff,0x12,0x02,0xfa,0x12,0x05,0xc1,0x90,0x42,0x13,0xe0, -0xfb,0x90,0x00,0x02,0x12,0x0c,0xe7,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04, -0x12,0x05,0x58,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x7b,0x38,0xeb,0x2d,0xfb,0x90, -0x42,0x14,0xeb,0xf0,0x7b,0x82,0x7a,0x42,0x8b,0x05,0x8a,0x04,0x90,0x42,0x14,0xe0, -0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05, -0x8a,0x04,0x7b,0x08,0x7a,0xff,0x12,0x02,0xfa,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55, -0x05,0x00,0x7a,0x00,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x12,0x02,0xdf, -0x12,0x05,0xf2,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0xf0,0x7a,0x00,0x12,0x02, -0xfa,0x12,0x05,0xf2,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x12,0x03,0x61,0x08,0x00, -0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x07,0x12,0x02,0xc4,0x12,0x05,0xf2,0x12, -0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x07,0x7a,0x00,0x12,0x02,0xfa,0x12,0x05,0xf2, -0x12,0x03,0x02,0x12,0x05,0xf2,0x12,0x03,0x02,0x12,0x05,0xc1,0x90,0x42,0x14,0xe0, -0xfb,0x90,0x00,0x02,0x12,0x0c,0xe7,0x7b,0xe8,0x8b,0x05,0x7b,0x14,0x7a,0x42,0x8a, -0x83,0x8b,0x82,0xe0,0x2d,0xf0,0xfb,0x7b,0x82,0x7a,0x42,0x8b,0x05,0x8a,0x04,0x90, -0x42,0x14,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a, -0x00,0x8b,0x05,0x8a,0x04,0x7b,0x01,0x7a,0xff,0x12,0x02,0xfa,0x8b,0x05,0x8a,0x04, -0x12,0x03,0x61,0x06,0x00,0x7a,0x00,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x01, -0x12,0x02,0xdf,0x12,0x05,0xf2,0x12,0x03,0x02,0x12,0x05,0xc1,0x90,0x42,0x14,0xe0, -0xfb,0x90,0x00,0x02,0x12,0x0c,0xe7,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04, -0x12,0x05,0x58,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x7b,0x68,0xeb,0x2d,0xfb,0x90, -0x42,0x15,0xeb,0xf0,0x7b,0x82,0x7a,0x42,0x8b,0x05,0x8a,0x04,0x90,0x42,0x15,0xe0, -0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x8b,0x05,0x7b,0xf0, -0xeb,0x5d,0xfb,0x8b,0x05,0x12,0x03,0x55,0x05,0x00,0x12,0x05,0xc8,0x8b,0x05,0x7b, -0x0f,0xeb,0x5d,0xfb,0x12,0x05,0xe4,0xeb,0x4d,0xfb,0x12,0x05,0xc1,0x90,0x42,0x15, -0xe0,0xfb,0x90,0x00,0x02,0x12,0x0c,0xe7,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79, -0x04,0x12,0x05,0x58,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x7b,0x68,0xeb,0x2d,0xfb, -0x90,0x42,0x16,0xeb,0xf0,0x7b,0x82,0x7a,0x42,0x8b,0x05,0x8a,0x04,0x90,0x42,0x16, -0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x8b,0x05,0x7b, -0xbf,0xeb,0x5d,0xfb,0x8b,0x05,0x12,0x03,0x55,0x05,0x00,0x8d,0x03,0x60,0x0d,0x8b, -0x05,0x7b,0x40,0x90,0x42,0x17,0xeb,0xf0,0x8d,0x03,0x80,0x0b,0x8b,0x05,0x7b,0x00, -0x90,0x42,0x17,0xeb,0xf0,0x8d,0x03,0x8b,0x05,0x90,0x42,0x17,0xe0,0xfb,0xeb,0x4d, -0xfb,0x12,0x05,0xc1,0x90,0x42,0x16,0xe0,0xfb,0x90,0x00,0x02,0x12,0x0c,0xe7,0x02, -0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x12,0x03,0x55,0x04,0x00, -0x8b,0x05,0x7b,0x68,0xeb,0x2d,0xfb,0x90,0x42,0x18,0xeb,0xf0,0x7b,0x82,0x7a,0x42, -0x8b,0x05,0x8a,0x04,0x90,0x42,0x18,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83, -0x8b,0x82,0xe0,0xfb,0x8b,0x05,0x7b,0xdf,0xeb,0x5d,0xfb,0x8b,0x05,0x12,0x03,0x55, -0x05,0x00,0x8d,0x03,0x60,0x0d,0x8b,0x05,0x7b,0x20,0x90,0x42,0x19,0xeb,0xf0,0x8d, -0x03,0x80,0x0b,0x8b,0x05,0x7b,0x00,0x90,0x42,0x19,0xeb,0xf0,0x8d,0x03,0x8b,0x05, -0x90,0x42,0x19,0xe0,0xfb,0xeb,0x4d,0xfb,0x12,0x05,0xc1,0x90,0x42,0x18,0xe0,0xfb, -0x90,0x00,0x02,0x12,0x0c,0xe7,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12, -0x05,0x58,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x7b,0x68,0xeb,0x2d,0xfb,0x90,0x42, -0x1a,0xeb,0xf0,0x7b,0x82,0x7a,0x42,0x8b,0x05,0x8a,0x04,0x90,0x42,0x1a,0xe0,0xfb, -0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x8b,0x05,0x7b,0xef,0xeb, -0x5d,0xfb,0x8b,0x05,0x12,0x03,0x55,0x05,0x00,0x8d,0x03,0x60,0x0d,0x8b,0x05,0x7b, -0x10,0x90,0x42,0x1b,0xeb,0xf0,0x8d,0x03,0x80,0x0b,0x8b,0x05,0x7b,0x00,0x90,0x42, -0x1b,0xeb,0xf0,0x8d,0x03,0x8b,0x05,0x90,0x42,0x1b,0xe0,0xfb,0xeb,0x4d,0xfb,0x12, -0x05,0xc1,0x90,0x42,0x1a,0xe0,0xfb,0x90,0x00,0x02,0x12,0x0c,0xe7,0x02,0x05,0x9c, -0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x12,0x03,0x55,0x04,0x00,0x8b,0x05, -0x7b,0x38,0xeb,0x2d,0xfb,0x90,0x42,0x1c,0xeb,0xf0,0x7b,0x82,0x7a,0x42,0x8b,0x05, -0x8a,0x04,0x90,0x42,0x1c,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82, -0xe0,0xfb,0x8b,0x05,0x7b,0xf7,0xeb,0x5d,0xfb,0x8b,0x05,0x12,0x03,0x55,0x05,0x00, -0x8d,0x03,0x60,0x0d,0x8b,0x05,0x7b,0x08,0x90,0x42,0x1d,0xeb,0xf0,0x8d,0x03,0x80, -0x0b,0x8b,0x05,0x7b,0x00,0x90,0x42,0x1d,0xeb,0xf0,0x8d,0x03,0x8b,0x05,0x90,0x42, -0x1d,0xe0,0xfb,0xeb,0x4d,0xfb,0x12,0x05,0xc1,0x90,0x42,0x1c,0xe0,0xfb,0x90,0x00, -0x02,0x12,0x0c,0xe7,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58, -0xc2,0xb4,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x90,0x46,0xc2,0xe0,0xfa,0xa3,0xe0, -0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x7a,0x00,0x12,0x03,0xc7,0x12, -0x05,0xe4,0x12,0x03,0x0a,0x12,0x03,0x55,0x05,0x00,0x8b,0x05,0x90,0x46,0xc2,0xe0, -0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x05,0x7a,0x00,0x12, -0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x12,0x03,0x55,0x04,0x00,0x7a,0x00,0x8b, -0x05,0x8a,0x04,0x7b,0x00,0x7a,0x01,0x12,0x00,0xc4,0x60,0x22,0x12,0x03,0x55,0x05, -0x00,0x8b,0x05,0x7b,0x82,0x7a,0x42,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x12,0x03, -0x55,0x05,0x00,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0xd2,0xb4, -0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0xc2,0xb4,0x12,0x03, -0x55,0x04,0x00,0x60,0x09,0x7b,0x02,0x90,0x42,0x20,0xeb,0xf0,0x80,0x07,0x7b,0x00, -0x90,0x42,0x20,0xeb,0xf0,0x90,0x42,0x20,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04, -0x90,0x46,0xc2,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0xc7,0x90,0x42,0x1e,0xea,0xf0, -0xeb,0xa3,0xf0,0x12,0x03,0x55,0x05,0x00,0x8b,0x05,0x90,0x42,0x1e,0xe0,0xfa,0xa3, -0xe0,0xfb,0x12,0x03,0x0a,0x12,0x03,0x55,0x06,0x00,0x8b,0x05,0x90,0x42,0x1e,0xe0, -0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x01,0x7a,0x00,0x12, -0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0xd2,0xb4,0x02,0x05,0x9c,0xe4,0x78,0x00, -0x79,0x04,0x12,0x05,0x58,0xc2,0xb4,0x90,0x46,0xc2,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a, -0x83,0x8b,0x82,0xe0,0xfb,0x90,0x42,0x21,0xeb,0xf0,0xd2,0xb4,0x90,0x42,0x21,0xe0, -0xfb,0x02,0x05,0x9c,0xe4,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x90,0x00,0x00,0x12, -0x0e,0x2f,0x90,0x00,0x00,0x12,0x42,0x7e,0x7b,0x00,0x7a,0x00,0x02,0x05,0x9c,0xe4, -0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x90,0x00,0x00,0x12,0x1a,0xf2,0x02,0x05,0x9c, -0xe4,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0xab,0x87,0x90,0x42,0x22,0xeb,0xf0,0x7b, -0x7f,0x8b,0x05,0x7b,0x22,0x7a,0x42,0x8a,0x83,0x8b,0x82,0xe0,0x5d,0xf0,0xfb,0x90, -0x42,0x22,0xe0,0xfb,0x8b,0x87,0xab,0x89,0x90,0x42,0x22,0xeb,0xf0,0x90,0x42,0x22, -0xe0,0xfb,0x8b,0x05,0x7b,0x0f,0xeb,0x5d,0xfb,0x8b,0x05,0x7b,0x20,0xeb,0x4d,0xfb, -0x90,0x42,0x22,0xeb,0xf0,0x90,0x42,0x22,0xe0,0xfb,0x8b,0x89,0x7b,0xfe,0x8b,0x8d, -0x7b,0x00,0x8b,0x8b,0xd2,0x8e,0xc2,0x9f,0xd2,0x9e,0xc2,0x9d,0xd2,0x9c,0xd2,0xac, -0x7b,0x00,0x7a,0x00,0x02,0x05,0x9c,0xe4,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x90, -0x43,0x84,0xe0,0xfb,0x8b,0x05,0x7b,0x0f,0xeb,0x5d,0xfb,0x90,0x42,0x27,0xeb,0xf0, -0x90,0x43,0x85,0xe0,0xfb,0x90,0x42,0x28,0xeb,0xf0,0x90,0x43,0x86,0xe0,0xfb,0x90, -0x42,0x29,0xeb,0xf0,0x7b,0x87,0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0, -0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05, -0x8a,0x04,0x7b,0x07,0x12,0x02,0xdf,0x8b,0x05,0x8a,0x04,0x7b,0x97,0x7a,0x43,0x12, -0x05,0xd6,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7, -0x12,0x05,0xf2,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x90,0x42, -0x23,0xea,0xf0,0xeb,0xa3,0xf0,0x7b,0xa7,0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42, -0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00, -0x8b,0x05,0x8a,0x04,0x7b,0x07,0x12,0x02,0xdf,0x8b,0x05,0x8a,0x04,0x7b,0xb7,0x7a, -0x43,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12, -0x03,0xc7,0x12,0x05,0xf2,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7, -0x90,0x42,0x25,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x28,0xe0,0xfb,0x7a,0x00,0x12, -0x04,0x68,0x00,0x06,0x00,0x7f,0x15,0x60,0x10,0x7c,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x11,0x72,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x12,0x68,0x13,0x4e, -0x14,0x34,0x14,0x78,0x14,0xbc,0x15,0x00,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60, -0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x60,0x15,0x44, -0x15,0x60,0x15,0x52,0x15,0x52,0x15,0x52,0x15,0x52,0x15,0x52,0x7b,0xc7,0x7a,0x43, -0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83, -0x8b,0x82,0xe0,0x60,0x6e,0x7b,0x87,0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27, -0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b, -0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00,0x12,0x01,0x3b,0x60,0x45,0x7b,0x97,0x7a,0x43, -0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83, -0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00,0x12,0x01, -0x3b,0x60,0x1e,0x90,0x42,0x29,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x42,0x23,0xe0,0xfa, -0xa3,0xe0,0xfb,0x12,0x05,0xcf,0x90,0x42,0x27,0xe0,0xfb,0x90,0x00,0x04,0x12,0x28, -0xf4,0x80,0x6c,0x7b,0xa7,0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb, -0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a, -0x04,0x7b,0xff,0x7a,0x00,0x12,0x01,0x3b,0x60,0x45,0x7b,0xb7,0x7a,0x43,0x8b,0x05, -0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82, -0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00,0x12,0x01,0x3b,0x60, -0x1e,0x90,0x42,0x29,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x42,0x25,0xe0,0xfa,0xa3,0xe0, -0xfb,0x12,0x05,0xc1,0x90,0x42,0x27,0xe0,0xfb,0x90,0x00,0x03,0x12,0x33,0xda,0x02, -0x16,0x7b,0x7b,0xc7,0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a, -0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0x60,0x6e,0x7b,0x87,0x7a,0x43,0x8b, -0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b, -0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00,0x12,0x01,0x3b, -0x60,0x45,0x7b,0x97,0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a, -0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04, -0x7b,0xff,0x7a,0x00,0x12,0x01,0x3b,0x60,0x1e,0x90,0x42,0x29,0xe0,0xfb,0x12,0x05, -0xc1,0x90,0x42,0x23,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x42,0x27,0xe0, -0xfb,0x90,0x00,0x03,0x12,0x33,0xb6,0x80,0x6c,0x7b,0xa7,0x7a,0x43,0x8b,0x05,0x8a, -0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0, -0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00,0x12,0x01,0x3b,0x60,0x45, -0x7b,0xb7,0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12, -0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff, -0x7a,0x00,0x12,0x01,0x3b,0x60,0x1e,0x90,0x42,0x29,0xe0,0xfb,0x12,0x05,0xc1,0x90, -0x42,0x25,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x42,0x27,0xe0,0xfb,0x90, -0x00,0x03,0x12,0x33,0xe6,0x02,0x16,0x7b,0x7b,0xc7,0x7a,0x43,0x8b,0x05,0x8a,0x04, -0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0x60, -0x66,0x7b,0x87,0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00, -0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b, -0xff,0x7a,0x00,0x12,0x01,0x3b,0x60,0x3d,0x7b,0x97,0x7a,0x43,0x8b,0x05,0x8a,0x04, -0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb, -0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00,0x12,0x01,0x3b,0x60,0x16,0x90, -0x42,0x23,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x42,0x27,0xe0,0xfb,0x90, -0x00,0x02,0x12,0x33,0xc2,0x80,0x64,0x7b,0xa7,0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90, -0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a, -0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00,0x12,0x01,0x3b,0x60,0x3d,0x7b,0xb7, -0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7, -0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00, -0x12,0x01,0x3b,0x60,0x16,0x90,0x42,0x25,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc1, -0x90,0x42,0x27,0xe0,0xfb,0x90,0x00,0x02,0x12,0x33,0xf2,0x02,0x16,0x7b,0x7b,0xc7, -0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7, -0x8a,0x83,0x8b,0x82,0xe0,0x60,0x66,0x7b,0x87,0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90, -0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a, -0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00,0x12,0x01,0x3b,0x60,0x3d,0x7b,0x97, -0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7, -0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00, -0x12,0x01,0x3b,0x60,0x16,0x90,0x42,0x23,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc1, -0x90,0x42,0x27,0xe0,0xfb,0x90,0x00,0x02,0x12,0x33,0xce,0x80,0x64,0x7b,0xa7,0x7a, -0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a, -0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00,0x12, -0x01,0x3b,0x60,0x3d,0x7b,0xb7,0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0, -0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05, -0x8a,0x04,0x7b,0xff,0x7a,0x00,0x12,0x01,0x3b,0x60,0x16,0x90,0x42,0x25,0xe0,0xfa, -0xa3,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x42,0x27,0xe0,0xfb,0x90,0x00,0x02,0x12,0x33, -0xfe,0x02,0x16,0x7b,0x90,0x42,0x29,0xe0,0xfb,0x8b,0x05,0x7b,0xb7,0x7a,0x43,0x12, -0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7, -0x12,0x05,0xe4,0x12,0x03,0x0a,0x7b,0x00,0x8b,0x05,0x7b,0xc7,0x7a,0x43,0x12,0x05, -0xc8,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x12, -0x05,0xe4,0x12,0x03,0x0a,0x02,0x16,0x7b,0x90,0x42,0x29,0xe0,0xfb,0x8b,0x05,0x7b, -0xa7,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a, -0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x7b,0x00,0x8b,0x05,0x7b,0xc7, -0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00, -0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x02,0x16,0x7b,0x90,0x42,0x29,0xe0, -0xfb,0x8b,0x05,0x7b,0x97,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90,0x42, -0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x7b,0x01, -0x8b,0x05,0x7b,0xc7,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27, -0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x02,0x16,0x7b, -0x90,0x42,0x29,0xe0,0xfb,0x8b,0x05,0x7b,0x87,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05, -0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12, -0x03,0x0a,0x7b,0x01,0x8b,0x05,0x7b,0xc7,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a, -0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03, -0x0a,0x02,0x16,0x7b,0x90,0x42,0x27,0xe0,0xfb,0x90,0x00,0x01,0x12,0x32,0x3e,0x02, -0x16,0x7b,0x90,0x42,0x27,0xe0,0xfb,0x90,0x00,0x01,0x12,0x31,0x8a,0x02,0x16,0x7b, -0x90,0x42,0x28,0xe0,0xfb,0x8b,0x05,0x7b,0x20,0x12,0x00,0xdb,0x60,0x66,0x90,0x42, -0x29,0xe0,0xfb,0x8b,0x05,0x7b,0xd7,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04, -0x90,0x42,0x27,0xe0,0xfb,0x7a,0x00,0x78,0x03,0x12,0x01,0x46,0x00,0x20,0x12,0x03, -0xc7,0x12,0x05,0xe4,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90,0x42,0x28,0xe0,0xfb, -0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x90,0x42,0x29,0xe0,0xfb, -0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0x07,0x12,0x02,0xdf,0x12,0x05,0xcf,0x90,0x42, -0x28,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x42,0x27,0xe0,0xfb,0x90,0x00,0x04,0x12,0x34, -0xed,0x02,0x16,0x7b,0x90,0x42,0x28,0xe0,0xfb,0x8b,0x05,0x7b,0x40,0x12,0x00,0xdb, -0x60,0x6e,0x7b,0xe0,0x8b,0x05,0x7b,0x28,0x7a,0x42,0x8a,0x83,0x8b,0x82,0xe0,0x2d, -0xf0,0xfb,0x7b,0xd7,0x7a,0x43,0x8b,0x05,0x8a,0x04,0x90,0x42,0x27,0xe0,0xfb,0x7a, -0x00,0x78,0x03,0x12,0x01,0x46,0x00,0x20,0x12,0x03,0xc7,0x8b,0x05,0x8a,0x04,0x90, -0x42,0x28,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a, -0x00,0x8b,0x05,0x8a,0x04,0x7b,0x07,0x12,0x02,0xdf,0x8b,0x05,0x8a,0x04,0x90,0x42, -0x29,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xcf,0x90,0x42,0x28,0xe0,0xfb, -0x12,0x05,0xc1,0x90,0x42,0x27,0xe0,0xfb,0x90,0x00,0x04,0x12,0x34,0xed,0x80,0x2b, -0x90,0x43,0x85,0xe0,0xfb,0x8b,0x05,0x7b,0x60,0x12,0x00,0xdb,0x60,0x1d,0x90,0x42, -0x29,0xe0,0xfb,0x7a,0x00,0x12,0x05,0xcf,0x90,0x42,0x28,0xe0,0xfb,0x12,0x05,0xc1, -0x90,0x42,0x27,0xe0,0xfb,0x90,0x00,0x04,0x12,0x34,0xed,0x02,0x05,0x9c,0x74,0x01, -0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x90,0x43,0x83,0xe0,0xfb,0x8b,0x05,0x7b,0x00, -0x12,0x01,0x28,0x60,0x03,0x02,0x05,0x9c,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x7b, -0x85,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x82,0x7a,0x43,0x12,0x02, -0x42,0x01,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x90,0x43,0x83, -0xe0,0xfb,0x8b,0x05,0x90,0x43,0x82,0xe0,0xfb,0x12,0x01,0x37,0x60,0x03,0x02,0x05, -0x9c,0x7b,0x00,0x90,0x43,0x82,0xeb,0xf0,0x90,0x43,0x84,0xe0,0xfb,0x7a,0x00,0x8b, -0x05,0x8a,0x04,0x7b,0xf0,0x7a,0x00,0x12,0x02,0xfa,0x12,0x04,0x68,0x00,0x80,0x00, -0xe0,0x18,0xae,0x17,0xb5,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18, -0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18, -0xae,0x18,0xae,0x17,0xda,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18, -0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18, -0xae,0x18,0xae,0x18,0x2e,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18, -0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18, -0xae,0x18,0xae,0x18,0x52,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18, -0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18, -0xae,0x18,0xae,0x18,0x5a,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18, -0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18, -0xae,0x18,0xae,0x18,0x76,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18, -0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18,0xae,0x18, -0xae,0x18,0xae,0x18,0x92,0x90,0x43,0x86,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x43,0x85, -0xe0,0xfb,0x12,0x05,0xc1,0x90,0x43,0x84,0xe0,0xfb,0x8b,0x05,0x7b,0x0f,0xeb,0x5d, -0xfb,0x90,0x00,0x03,0x12,0x26,0xe4,0x02,0x18,0xae,0x90,0x43,0x86,0xe0,0xfb,0x8b, -0x05,0x7b,0x00,0x12,0x01,0x28,0x60,0x21,0x7b,0x40,0x12,0x05,0xc1,0x90,0x43,0x85, -0xe0,0xfb,0x12,0x05,0xc1,0x90,0x43,0x84,0xe0,0xfb,0x8b,0x05,0x7b,0x0f,0xeb,0x5d, -0xfb,0x90,0x00,0x03,0x12,0x26,0xe4,0x80,0x22,0x90,0x43,0x86,0xe0,0xfb,0x12,0x05, -0xc1,0x90,0x43,0x85,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x43,0x84,0xe0,0xfb,0x8b,0x05, -0x7b,0x0f,0xeb,0x5d,0xfb,0x90,0x00,0x03,0x12,0x21,0x57,0x02,0x18,0xae,0x90,0x43, -0x86,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x43,0x85,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x43, -0x84,0xe0,0xfb,0x8b,0x05,0x7b,0x0f,0xeb,0x5d,0xfb,0x90,0x00,0x03,0x12,0x27,0xd2, -0x80,0x5c,0x90,0x00,0x00,0x12,0x0e,0xa7,0x80,0x54,0x90,0x43,0x85,0xe0,0xfb,0x12, -0x05,0xc1,0x90,0x43,0x84,0xe0,0xfb,0x8b,0x05,0x7b,0x0f,0xeb,0x5d,0xfb,0x90,0x00, -0x02,0x12,0x27,0xea,0x80,0x38,0x90,0x43,0x85,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x43, -0x84,0xe0,0xfb,0x8b,0x05,0x7b,0x0f,0xeb,0x5d,0xfb,0x90,0x00,0x02,0x12,0x27,0xde, -0x80,0x1c,0x90,0x43,0x86,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x43,0x84,0xe0,0xfb,0x8b, -0x05,0x7b,0x0f,0xeb,0x5d,0xfb,0x90,0x00,0x02,0x12,0x3b,0xc3,0x80,0x00,0x02,0x05, -0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x12,0x03,0x55,0x04,0x00,0x7a, -0x00,0x12,0x04,0x68,0x00,0xf0,0x00,0xff,0x19,0x56,0x18,0xea,0x19,0x1a,0x19,0x31, -0x19,0x1a,0x19,0x03,0x19,0x03,0x19,0x03,0x18,0xfb,0x19,0x56,0x19,0x56,0x19,0x56, -0x19,0x56,0x19,0x56,0x19,0x56,0x19,0x56,0x19,0x48,0x7b,0x01,0x90,0x45,0xd7,0xeb, -0xf0,0x7b,0xf0,0x90,0x00,0x01,0x12,0x2a,0x68,0x80,0x5b,0x7b,0xf7,0x90,0x00,0x01, -0x12,0x2a,0x68,0x7b,0x00,0x90,0x43,0x84,0xeb,0xf0,0x7b,0x00,0x90,0x43,0x83,0xeb, -0xf0,0x7b,0x00,0x90,0x43,0x82,0xeb,0xf0,0x80,0x3c,0x7b,0x00,0x90,0x43,0x84,0xeb, -0xf0,0x7b,0x01,0x90,0x43,0x83,0xeb,0xf0,0x7b,0x00,0x90,0x43,0x82,0xeb,0xf0,0x80, -0x25,0x7b,0x00,0x90,0x43,0x84,0xeb,0xf0,0x7b,0x02,0x90,0x43,0x83,0xeb,0xf0,0x7b, -0x00,0x90,0x43,0x82,0xeb,0xf0,0x80,0x0e,0x90,0x46,0xc4,0xe0,0x60,0x06,0x90,0x00, -0x00,0x12,0x1a,0xf2,0x80,0x00,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12, -0x05,0x58,0x12,0x03,0x55,0x04,0x00,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0x80,0x7a, -0x00,0x12,0x00,0xf3,0x60,0x1b,0x12,0x03,0x55,0x04,0x00,0x7a,0x00,0x8b,0x05,0x8a, -0x04,0x7b,0xf8,0x7a,0x00,0x12,0x00,0xc4,0x60,0x07,0x7b,0x00,0x90,0x45,0xd7,0xeb, -0xf0,0x12,0x03,0x55,0x04,0x00,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xf0,0x7a,0x00, -0x12,0x02,0xfa,0x12,0x04,0x68,0x00,0x80,0x00,0xf0,0x1a,0xcf,0x1a,0x8e,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0x8e,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0x8e,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0x8e,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xa8,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xa8,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0x8e,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf, -0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xcf,0x1a,0xc2,0x12,0x03, -0x55,0x04,0x00,0x90,0x43,0x84,0xeb,0xf0,0x7b,0x00,0x90,0x43,0x82,0xeb,0xf0,0x7b, -0x02,0x90,0x43,0x83,0xeb,0xf0,0x80,0x47,0x12,0x03,0x55,0x04,0x00,0x90,0x43,0x84, -0xeb,0xf0,0x7b,0x00,0x90,0x43,0x82,0xeb,0xf0,0x7b,0x01,0x90,0x43,0x83,0xeb,0xf0, -0x80,0x2d,0x12,0x03,0x55,0x04,0x00,0x90,0x00,0x01,0x12,0x18,0xb1,0x80,0x20,0x90, -0x45,0xd7,0xe0,0x60,0x0d,0x12,0x03,0x55,0x04,0x00,0x90,0x00,0x01,0x12,0x2a,0x68, -0x80,0x0b,0x12,0x03,0x55,0x04,0x00,0x90,0x00,0x01,0x12,0x16,0x7e,0x80,0x00,0x02, -0x05,0x9c,0xe4,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x90,0x00,0x00,0x12,0x2a,0x57, -0x7b,0x00,0x90,0x43,0x82,0xeb,0xf0,0x7b,0x00,0x90,0x43,0x83,0xeb,0xf0,0x7b,0x00, -0x90,0x43,0x84,0xeb,0xf0,0x7b,0x00,0x90,0x45,0xd7,0xeb,0xf0,0x7b,0x00,0x7a,0x00, -0x90,0x42,0x2a,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x2a,0xe0,0xfa,0xa3,0xe0,0xfb, -0x8b,0x05,0x8a,0x04,0x7b,0x10,0x7a,0x00,0x12,0x00,0xc4,0x70,0x03,0x02,0x1c,0x52, -0x7b,0xff,0x8b,0x05,0x7b,0x87,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90, -0x42,0x2a,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a, -0x7b,0xff,0x8b,0x05,0x7b,0x97,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90, -0x42,0x2a,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a, -0x7b,0xff,0x8b,0x05,0x7b,0xa7,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90, -0x42,0x2a,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a, -0x7b,0xff,0x8b,0x05,0x7b,0xb7,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90, -0x42,0x2a,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a, -0x7b,0x00,0x8b,0x05,0x7b,0xc7,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90, -0x42,0x2a,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a, -0x7b,0x00,0x7a,0x00,0x90,0x42,0x2c,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x2c,0xe0, -0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x20,0x7a,0x00,0x12,0x00,0xc4,0x60, -0x46,0x7b,0x00,0x8b,0x05,0x7b,0xd7,0x7a,0x43,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04, -0x90,0x42,0x2a,0xe0,0xfa,0xa3,0xe0,0xfb,0x78,0x03,0x12,0x01,0x46,0x00,0x20,0x12, -0x03,0xc7,0x12,0x05,0xe4,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90,0x42,0x2c,0xe0, -0xfa,0xa3,0xe0,0xfb,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x7b,0x2c,0x7a, -0x42,0x12,0x02,0x42,0x02,0x80,0xa5,0x7b,0x2a,0x7a,0x42,0x12,0x02,0x42,0x02,0x02, -0x1b,0x28,0x02,0x05,0x9c,0x74,0x02,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x12,0x03, -0x61,0x04,0x00,0x12,0x03,0x38,0x04,0x00,0x8b,0x05,0x7b,0x04,0x7c,0x00,0x12,0x02, -0xc4,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xf8,0x7a,0xff,0x12,0x03,0xc7,0x90,0x42, -0x2e,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x2e,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05, -0x8a,0x04,0x7b,0x0c,0x7a,0x00,0x12,0x03,0xd8,0x8b,0x05,0x8a,0x04,0x12,0x03,0x61, -0x04,0x00,0x12,0x03,0x38,0x05,0x00,0x12,0x05,0xd6,0x8b,0x05,0x7b,0x7f,0xeb,0x5d, -0xfb,0x12,0x05,0xf2,0x7a,0x00,0x12,0x03,0xcf,0x90,0x42,0x2e,0xea,0xf0,0xeb,0xa3, -0xf0,0x90,0x42,0x2e,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x80,0x7a, -0x00,0x12,0x03,0xd8,0x8b,0x05,0x8a,0x04,0x12,0x03,0x61,0x04,0x00,0x12,0x03,0x38, -0x07,0x00,0x12,0x05,0xd6,0x8b,0x05,0x7b,0x7f,0xeb,0x5d,0xfb,0x12,0x05,0xf2,0x7a, -0x00,0x12,0x03,0xc7,0x8b,0x05,0x8a,0x04,0x7b,0xc0,0x7a,0xff,0x12,0x03,0xc7,0x90, -0x42,0x2e,0xea,0xf0,0xeb,0xa3,0xf0,0x7b,0x00,0x7a,0x36,0x8b,0x05,0x8a,0x04,0x7b, -0x2e,0x7a,0x42,0x12,0x00,0x53,0x90,0x42,0x2e,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05, -0x8a,0x04,0x12,0x03,0x61,0x04,0x00,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x08, -0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xf2,0x12,0x03,0x12,0x02,0x05,0x9c,0xe4,0x78, -0x00,0x79,0x04,0x12,0x05,0x58,0x7b,0x14,0x7a,0x00,0x90,0x00,0x02,0x12,0x06,0x26, -0x90,0x88,0x43,0xe0,0x70,0x03,0x02,0x1e,0x84,0x7b,0x00,0x90,0x88,0x43,0xeb,0xf0, -0x7b,0x00,0x7a,0x00,0x90,0x42,0x34,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x34,0xe0, -0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x80,0x7a,0x00,0x12,0x00,0xc4,0x70, -0x03,0x02,0x1e,0x84,0x7b,0xc1,0x7a,0x4a,0x8b,0x05,0x8a,0x04,0x90,0x42,0x34,0xe0, -0xfa,0xa3,0xe0,0xfb,0xeb,0x2b,0xfb,0xea,0x3a,0xfa,0x12,0x03,0xc7,0x8a,0x83,0x8b, -0x82,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x42,0x3e,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42, -0x3e,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x00,0x7a,0x00,0x12,0x01, -0x3b,0x60,0x0e,0x90,0x42,0x3e,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x00,0x02,0x12,0x1c, -0x55,0x7b,0xb3,0x7a,0x7f,0x8b,0x05,0x8a,0x04,0x90,0x42,0x34,0xe0,0xfa,0xa3,0xe0, -0xfb,0xeb,0x2b,0xfb,0xea,0x3a,0xfa,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfa, -0xa3,0xe0,0xfb,0x90,0x42,0x3c,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x3c,0xe0,0xfa, -0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x7a,0x00,0x12,0x03,0xc7,0x90,0x42, -0x3a,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x3c,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83, -0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x90,0x42,0x36,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42, -0x36,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x00,0x7a,0x00,0x12,0x00, -0x8e,0x60,0x36,0x90,0x42,0x3a,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x3e,0x02,0x00, -0x90,0x42,0x3e,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x3e,0xe0,0xfa,0xa3,0xe0,0xfb, -0x90,0x00,0x02,0x12,0x1c,0x55,0x7b,0x36,0x7a,0x42,0x12,0x02,0x48,0x02,0x7b,0x3a, -0x7a,0x42,0x12,0x02,0x1d,0x00,0x04,0x80,0xb5,0x7b,0x34,0x7a,0x42,0x12,0x02,0x42, -0x02,0x02,0x1d,0x6c,0x7b,0x00,0x7a,0x00,0x90,0x42,0x34,0xea,0xf0,0xeb,0xa3,0xf0, -0x90,0x42,0x34,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x10,0x7a,0x00, -0x12,0x00,0xc4,0x70,0x03,0x02,0x1f,0x26,0x90,0x42,0x34,0xe0,0xfa,0xa3,0xe0,0xfb, -0x8b,0x05,0x7b,0xe0,0x7a,0x45,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90,0x42,0x34, -0xe0,0xfa,0xa3,0xe0,0xfb,0x78,0x03,0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x12, -0x05,0xe4,0x12,0x03,0x0a,0x7b,0x00,0x8b,0x05,0x7b,0xe0,0x7a,0x45,0x12,0x05,0xc8, -0x8b,0x05,0x8a,0x04,0x90,0x42,0x34,0xe0,0xfa,0xa3,0xe0,0xfb,0x78,0x03,0x12,0x01, -0x46,0x00,0x0e,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04, -0x7b,0x01,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x90,0x42,0x34, -0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x00,0x01,0x12,0x32,0x3e,0x7b,0x34,0x7a,0x42,0x12, -0x02,0x42,0x02,0x02,0x1e,0x90,0x7b,0x00,0x7a,0x00,0x90,0x42,0x34,0xea,0xf0,0xeb, -0xa3,0xf0,0x90,0x42,0x34,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x18, -0x7a,0x00,0x12,0x00,0xc4,0x70,0x03,0x02,0x20,0xf4,0x7b,0xff,0x8b,0x05,0x7b,0x02, -0x7a,0x00,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90,0x42,0x34,0xe0,0xfa,0xa3,0xe0, -0xfb,0x78,0x03,0x12,0x01,0x46,0x00,0x0a,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x05, -0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x01,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12, -0x03,0x0a,0x7b,0x80,0x8b,0x05,0x7b,0x02,0x7a,0x00,0x12,0x05,0xc8,0x8b,0x05,0x8a, -0x04,0x90,0x42,0x34,0xe0,0xfa,0xa3,0xe0,0xfb,0x78,0x03,0x12,0x01,0x46,0x00,0x0a, -0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x02,0x7a, -0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x7b,0x00,0x7a,0x00,0x8b,0x05, -0x8a,0x04,0x7b,0x02,0x7a,0x00,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x90,0x42,0x34, -0xe0,0xfa,0xa3,0xe0,0xfb,0x78,0x03,0x12,0x01,0x46,0x00,0x0a,0x12,0x03,0xc7,0x12, -0x05,0xf2,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x7a,0x00,0x12,0x03,0xc7, -0x12,0x05,0xf2,0x12,0x03,0x12,0x90,0x42,0x34,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05, -0x7b,0x02,0x7a,0x00,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x90,0x42,0x34,0xe0,0xfa, -0xa3,0xe0,0xfb,0x78,0x03,0x12,0x01,0x46,0x00,0x0a,0x12,0x03,0xc7,0x12,0x05,0xe4, -0x12,0x03,0x0a,0x7b,0x02,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x90,0x42,0x34,0xe0,0xfa, -0xa3,0xe0,0xfb,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0xff,0x12,0x03, -0xc7,0x12,0x05,0xf2,0x78,0x03,0x12,0x01,0x46,0x00,0x0a,0x12,0x03,0xc7,0x8b,0x05, -0x8a,0x04,0x7b,0x02,0x7a,0x00,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x90,0x42,0x34, -0xe0,0xfa,0xa3,0xe0,0xfb,0x78,0x03,0x12,0x01,0x46,0x00,0x0a,0x12,0x03,0xc7,0x12, -0x05,0xf2,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x06,0x7a,0x00,0x12,0x03,0xc7, -0x12,0x05,0xf2,0x12,0x03,0x12,0x7b,0x02,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x90,0x42, -0x34,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x01,0x7a, -0x00,0x12,0x03,0xc7,0x12,0x05,0xf2,0x78,0x03,0x12,0x01,0x46,0x00,0x0a,0x12,0x03, -0xc7,0x8b,0x05,0x8a,0x04,0x7b,0x02,0x7a,0x00,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04, -0x90,0x42,0x34,0xe0,0xfa,0xa3,0xe0,0xfb,0x78,0x03,0x12,0x01,0x46,0x00,0x0a,0x12, -0x03,0xc7,0x12,0x05,0xf2,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x08,0x7a,0x00, -0x12,0x03,0xc7,0x12,0x05,0xf2,0x12,0x03,0x12,0x7b,0x34,0x7a,0x42,0x12,0x02,0x42, -0x02,0x02,0x1f,0x32,0x7b,0x00,0x7a,0x00,0x90,0x00,0x08,0xea,0xf0,0xeb,0xa3,0xf0, -0x7b,0x00,0x7a,0x00,0x90,0x00,0xf0,0xea,0xf0,0xeb,0xa3,0xf0,0x7b,0x02,0x7a,0x00, -0x90,0x45,0xd8,0xea,0xf0,0xeb,0xa3,0xf0,0x7b,0xe8,0x7a,0x00,0x90,0x45,0xda,0xea, -0xf0,0xeb,0xa3,0xf0,0x7b,0x00,0x7a,0x00,0x90,0x45,0xde,0xea,0xf0,0xeb,0xa3,0xf0, -0x90,0x45,0xdc,0xea,0xf0,0xeb,0xa3,0xf0,0x7b,0x12,0x90,0x46,0xc0,0xeb,0xf0,0x7b, -0x01,0x7a,0x00,0x02,0x05,0x9c,0xe4,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x90,0x00, -0x00,0x12,0x06,0xaf,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58, -0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x7b,0x09,0x12,0x01,0x28,0x60,0x16,0x12,0x03, -0x55,0x06,0x00,0x12,0x05,0xc1,0x12,0x03,0x55,0x06,0x00,0x90,0x00,0x02,0x12,0x24, -0x93,0x02,0x05,0x9c,0x7b,0xe0,0x7a,0x45,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x04, -0x00,0x7a,0x00,0x78,0x03,0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x90,0x42,0x42, -0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x42,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38, -0x01,0x00,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xff,0x7a,0x00,0x12,0x01,0x2c,0x60, -0x03,0x02,0x05,0x9c,0x7b,0xb3,0x7a,0x7f,0x8b,0x05,0x8a,0x04,0x90,0x42,0x42,0xe0, -0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x01,0x00,0x7a,0x00,0xeb,0x2b,0xfb,0xea,0x3a, -0xfa,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x42,0x48, -0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x48,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a, -0x04,0x7b,0x04,0x7a,0x00,0x12,0x03,0xc7,0x90,0x42,0x46,0xea,0xf0,0xeb,0xa3,0xf0, -0x90,0x42,0x48,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x90,0x42, -0x44,0xeb,0xf0,0x90,0x42,0x44,0xe0,0xfb,0x8b,0x05,0x7b,0x00,0x12,0x00,0x82,0x70, -0x03,0x02,0x24,0x90,0x90,0x42,0x46,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83,0x8b,0x82, -0xe0,0xfb,0x8b,0x05,0x12,0x03,0x55,0x05,0x00,0x12,0x00,0xa9,0x70,0x19,0x90,0x42, -0x46,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x01,0x00,0x8b,0x05,0x12,0x03,0x55, -0x05,0x00,0x12,0x00,0xdb,0x60,0x03,0x02,0x24,0x7c,0x90,0x42,0x46,0xe0,0xfa,0xa3, -0xe0,0xfb,0x12,0x03,0x3e,0x02,0x00,0x90,0x42,0x4a,0xea,0xf0,0xeb,0xa3,0xf0,0x90, -0x00,0x00,0x12,0x3a,0xeb,0x90,0x42,0x40,0xea,0xf0,0xeb,0xa3,0xf0,0x8b,0x05,0x8a, -0x04,0x7b,0x00,0x7a,0x00,0x12,0x01,0x2c,0x60,0x03,0x02,0x05,0x9c,0x90,0x42,0x40, -0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x02,0x00,0x8b,0x05,0x7b,0x80,0x12,0x01, -0x37,0x60,0x14,0x90,0x42,0x40,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83,0x8b,0x82,0xe0, -0xfb,0x90,0x00,0x01,0x12,0x39,0xf6,0x90,0x42,0x40,0xe0,0xfa,0xa3,0xe0,0xfb,0x12, -0x03,0x3e,0x04,0x00,0x8b,0x05,0x8a,0x04,0x90,0x42,0x4a,0xe0,0xfa,0xa3,0xe0,0xfb, -0x12,0x01,0x3b,0x60,0x63,0x90,0x42,0x4a,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38, -0x03,0x00,0x12,0x05,0xc1,0x90,0x42,0x4a,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38, -0x04,0x00,0x8b,0x05,0x7b,0x01,0xeb,0x5d,0xfb,0x12,0x05,0xc1,0x90,0x42,0x40,0xe0, -0xfa,0xa3,0xe0,0xfb,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x90,0x00,0x03,0x12,0x39,0x8b, -0x90,0x42,0x4a,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x90,0x42,0x40,0xe0, -0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x7a,0x00,0x12, -0x03,0xc7,0x12,0x05,0xf2,0x12,0x03,0x12,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x90, -0x42,0x40,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x01, -0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x12,0x03,0x55,0x05,0x00, -0x8b,0x05,0x90,0x42,0x40,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a, -0x04,0x7b,0x02,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x12,0x03, -0x55,0x06,0x00,0x8b,0x05,0x90,0x42,0x40,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8, -0x8b,0x05,0x8a,0x04,0x7b,0x03,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03, -0x0a,0x90,0x42,0x42,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x0d,0x00,0x8b,0x05, -0x7b,0x01,0xeb,0x5d,0xfb,0x12,0x05,0xc1,0x90,0x42,0x40,0xe0,0xfa,0xa3,0xe0,0xfb, -0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x90,0x00,0x02,0x12,0x3a,0x0d,0x90,0x42,0x40,0xe0, -0xfa,0xa3,0xe0,0xfb,0x90,0x00,0x02,0x12,0x3b,0x2b,0x90,0x42,0x40,0xe0,0xfa,0xa3, -0xe0,0xfb,0x90,0x00,0x02,0x12,0x2d,0x5b,0x90,0x42,0x4a,0xe0,0xfa,0xa3,0xe0,0xfb, -0x8b,0x05,0x8a,0x04,0x7b,0x0b,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xcf,0x90,0x42, -0x40,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x90,0x00,0x03,0x12, -0x38,0xd9,0x90,0x42,0x4a,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83,0x8b,0x82,0xe0,0xfb, -0x8b,0x05,0x7b,0x04,0x7c,0x00,0x12,0x02,0xc4,0x90,0x42,0x45,0xeb,0xf0,0x90,0x42, -0x45,0xe0,0xfb,0x8b,0x05,0x7b,0x00,0x12,0x01,0x28,0x60,0x12,0x90,0x42,0x42,0xe0, -0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x09,0x00,0x90,0x42,0x45,0xeb,0xf0,0x90,0x42, -0x45,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x42,0x40,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83, -0x8b,0x82,0xe0,0xfb,0x90,0x00,0x02,0x12,0x39,0xd9,0x80,0x14,0x7b,0x44,0x7a,0x42, -0x12,0x02,0x48,0x01,0x7b,0x46,0x7a,0x42,0x12,0x02,0x1d,0x00,0x04,0x02,0x22,0x23, -0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x7b,0xc1,0x7a,0x4a, -0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x04,0x00,0x7a,0x00,0xeb,0x2b,0xfb,0xea,0x3a, -0xfa,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x42,0x51, -0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x51,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a, -0x04,0x7b,0x00,0x7a,0x00,0x12,0x01,0x2c,0x60,0x03,0x02,0x05,0x9c,0x7b,0x5e,0x7a, -0x46,0x90,0x42,0x4e,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x00,0x00,0x12,0x3a,0xeb,0x90, -0x42,0x4c,0xea,0xf0,0xeb,0xa3,0xf0,0x8b,0x05,0x8a,0x04,0x7b,0x00,0x7a,0x00,0x12, -0x01,0x2c,0x60,0x03,0x02,0x05,0x9c,0x90,0x42,0x4c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12, -0x03,0x38,0x02,0x00,0x8b,0x05,0x7b,0x80,0x12,0x01,0x37,0x60,0x14,0x90,0x42,0x4c, -0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x90,0x00,0x01,0x12,0x39, -0xf6,0x90,0x42,0x4c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x3e,0x04,0x00,0x8b,0x05, -0x8a,0x04,0x90,0x42,0x51,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x01,0x3b,0x60,0x63,0x90, -0x42,0x51,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x03,0x00,0x12,0x05,0xc1,0x90, -0x42,0x51,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x04,0x00,0x8b,0x05,0x7b,0x01, -0xeb,0x5d,0xfb,0x12,0x05,0xc1,0x90,0x42,0x4c,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83, -0x8b,0x82,0xe0,0xfb,0x90,0x00,0x03,0x12,0x39,0x8b,0x90,0x42,0x51,0xe0,0xfa,0xa3, -0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x90,0x42,0x4c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05, -0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xf2,0x12, -0x03,0x12,0x7b,0x09,0x8b,0x05,0x90,0x42,0x4c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05, -0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x01,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12, -0x03,0x0a,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x90,0x42,0x4c,0xe0,0xfa,0xa3,0xe0, -0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x02,0x7a,0x00,0x12,0x03,0xc7,0x12, -0x05,0xe4,0x12,0x03,0x0a,0x12,0x03,0x55,0x05,0x00,0x8b,0x05,0x90,0x42,0x4c,0xe0, -0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x03,0x7a,0x00,0x12, -0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x90,0x42,0x4e,0xe0,0xfa,0xa3,0xe0,0xfb, -0x12,0x03,0x38,0x0d,0x00,0x8b,0x05,0x7b,0x01,0xeb,0x5d,0xfb,0x12,0x05,0xc1,0x90, -0x42,0x4c,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x90,0x00,0x02, -0x12,0x3a,0x0d,0x90,0x42,0x4c,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x00,0x02,0x12,0x3b, -0x2b,0x90,0x42,0x4c,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x00,0x02,0x12,0x2d,0x5b,0x90, -0x42,0x51,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x0b,0x7a,0x00,0x12, -0x03,0xc7,0x12,0x05,0xcf,0x90,0x42,0x4c,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83,0x8b, -0x82,0xe0,0xfb,0x90,0x00,0x03,0x12,0x38,0xd9,0x90,0x42,0x51,0xe0,0xfa,0xa3,0xe0, -0xfb,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x8b,0x05,0x7b,0x04,0x7c,0x00,0x12,0x02,0xc4, -0x90,0x42,0x50,0xeb,0xf0,0x90,0x42,0x50,0xe0,0xfb,0x8b,0x05,0x7b,0x00,0x12,0x01, -0x28,0x60,0x12,0x90,0x42,0x4e,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x09,0x00, -0x90,0x42,0x50,0xeb,0xf0,0x90,0x42,0x50,0xe0,0xfb,0x12,0x05,0xc1,0x90,0x42,0x4c, -0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x90,0x00,0x02,0x12,0x39, -0xd9,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x7b,0xe0,0x7a, -0x45,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x04,0x00,0x7a,0x00,0x78,0x03,0x12,0x01, -0x46,0x00,0x0e,0x12,0x03,0xc7,0x12,0x03,0x38,0x0d,0x00,0x8b,0x05,0x7b,0x00,0xeb, -0x5d,0xfb,0x90,0x42,0x57,0xeb,0xf0,0x90,0x45,0xdc,0xe0,0xfa,0xa3,0xe0,0xfb,0x90, -0x42,0x53,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x53,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b, -0x05,0x8a,0x04,0x7b,0x00,0x7a,0x00,0x12,0x01,0x3b,0x70,0x03,0x02,0x27,0xcf,0x90, -0x42,0x53,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x3e,0x08,0x00,0x90,0x42,0x55,0xea, -0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x53,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x01, -0x00,0x8b,0x05,0x12,0x03,0x55,0x04,0x00,0x12,0x01,0x28,0x60,0x4f,0x90,0x42,0x53, -0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x02,0x00,0x8b,0x05,0x12,0x03,0x55,0x05, -0x00,0x12,0x01,0x28,0x60,0x36,0x90,0x42,0x57,0xe0,0x60,0x22,0x7b,0x81,0x8b,0x05, -0x90,0x42,0x53,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b, -0x02,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x80,0x0e,0x90,0x42, -0x53,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x00,0x02,0x12,0x31,0x2c,0x90,0x42,0x55,0xe0, -0xfa,0xa3,0xe0,0xfb,0x90,0x42,0x53,0xea,0xf0,0xeb,0xa3,0xf0,0x02,0x27,0x27,0x02, -0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x02,0x05,0x9c,0x74,0x01, -0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04, -0x12,0x05,0x58,0x90,0x42,0x00,0xe0,0x60,0x4f,0x7b,0xd4,0x7a,0x94,0x8b,0x05,0x8a, -0x04,0x12,0x03,0x55,0x05,0x00,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0, -0xfb,0x8b,0x05,0x7b,0xe0,0x7a,0x45,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x12,0x03, -0x55,0x05,0x00,0x7a,0x00,0x78,0x03,0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x12, -0x05,0xe4,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x01,0x7a,0x00,0x12,0x03,0xc7, -0x12,0x05,0xe4,0x12,0x03,0x0a,0x80,0x3a,0x12,0x03,0x55,0x05,0x00,0x8b,0x05,0x7b, -0xe0,0x7a,0x45,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x05,0x00,0x7a, -0x00,0x78,0x03,0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x05, -0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x01,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12, -0x03,0x0a,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x12,0x03, -0x55,0x04,0x00,0x8b,0x05,0x7b,0x09,0x12,0x01,0x28,0x60,0x03,0x02,0x05,0x9c,0x7b, -0xe0,0x7a,0x45,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x04,0x00,0x7a,0x00,0x78,0x03, -0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x90,0x42,0x58,0xea,0xf0,0xeb,0xa3,0xf0, -0x12,0x03,0x55,0x05,0x00,0x8b,0x05,0x90,0x42,0x58,0xe0,0xfa,0xa3,0xe0,0xfb,0x12, -0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4, -0x12,0x03,0x0a,0x90,0x42,0x58,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x00,0x02,0x12,0x3b, -0xe5,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x12,0x03,0x55, -0x04,0x00,0x8b,0x05,0x7b,0x09,0x12,0x01,0x28,0x60,0x03,0x02,0x05,0x9c,0x12,0x03, -0x61,0x05,0x00,0x12,0x04,0x68,0x00,0x00,0x00,0x02,0x2a,0x54,0x29,0x22,0x29,0x74, -0x29,0xe2,0x12,0x03,0x55,0x07,0x00,0x8b,0x05,0x7b,0x0c,0x12,0x00,0xa9,0x60,0x07, -0x7b,0x0c,0x12,0x03,0x94,0x07,0x00,0x12,0x03,0x55,0x07,0x00,0x8b,0x05,0x7b,0xe0, -0x7a,0x45,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x05,0x00,0x7a,0x00, -0x78,0x03,0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x05,0xc8, -0x8b,0x05,0x8a,0x04,0x7b,0x05,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03, -0x0a,0x02,0x2a,0x54,0x7b,0xe0,0x7a,0x45,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x04, -0x00,0x7a,0x00,0x78,0x03,0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x90,0x42,0x5a, -0xea,0xf0,0xeb,0xa3,0xf0,0x12,0x03,0x55,0x07,0x00,0xeb,0x33,0xe4,0x95,0xe0,0xfa, -0x8b,0x05,0x8a,0x04,0x7b,0xc0,0x7a,0xff,0x12,0x03,0xc7,0x8b,0x05,0x8a,0x04,0x7b, -0x01,0x12,0x02,0xdf,0x8b,0x05,0x90,0x42,0x5a,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05, -0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x08,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12, -0x03,0x0a,0x90,0x42,0x5a,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x00,0x02,0x12,0x3b,0xe5, -0x80,0x72,0x7b,0xe0,0x7a,0x45,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x04,0x00,0x7a, -0x00,0x78,0x03,0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x90,0x42,0x5a,0xea,0xf0, -0xeb,0xa3,0xf0,0x12,0x03,0x55,0x07,0x00,0xeb,0x33,0xe4,0x95,0xe0,0xfa,0x8b,0x05, -0x8a,0x04,0x7b,0xc0,0x7a,0xff,0x12,0x03,0xc7,0x8b,0x05,0x8a,0x04,0x7b,0x80,0x7a, -0x00,0x12,0x03,0xd8,0x8b,0x05,0x8a,0x04,0x90,0x42,0x5a,0xe0,0xfa,0xa3,0xe0,0xfb, -0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x06,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05, -0xf2,0x12,0x03,0x12,0x90,0x42,0x5a,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x00,0x02,0x12, -0x3b,0xe5,0x80,0x00,0x02,0x05,0x9c,0xe4,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x90, -0x00,0x00,0x12,0x1d,0x3e,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05, -0x58,0x12,0x03,0x55,0x04,0x00,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0xf0,0x7a,0x00, -0x12,0x01,0x2c,0x60,0x09,0x7b,0x01,0x90,0x46,0xc1,0xeb,0xf0,0x80,0x5b,0x90,0x46, -0xc1,0xe0,0xfb,0x8b,0x05,0x7b,0x02,0x12,0x01,0x28,0x60,0x0a,0x7b,0xc1,0x7a,0x46, -0x12,0x02,0x42,0x01,0x80,0x43,0x90,0x46,0xc1,0xe0,0xfb,0x8b,0x05,0x7b,0x05,0x12, -0x01,0x18,0x60,0x35,0x7b,0x44,0x7a,0x88,0x8b,0x05,0x8a,0x04,0x90,0x46,0xc1,0xe0, -0xfb,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x8b,0x05,0x12,0x03, -0x55,0x04,0x00,0x12,0x01,0x28,0x60,0x0a,0x7b,0xc1,0x7a,0x46,0x12,0x02,0x42,0x01, -0x80,0x07,0x7b,0xe7,0x90,0x46,0xc1,0xeb,0xf0,0x90,0x46,0xc1,0xe0,0xfb,0x8b,0x05, -0x7b,0x06,0x12,0x01,0x28,0x60,0x06,0x90,0x00,0x00,0x12,0x1a,0xf2,0x02,0x05,0x9c, -0x74,0x02,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x12,0x03,0x61,0x04,0x00,0x8a,0x83, -0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x12,0x03,0x61,0x06,0x00,0x12, -0x00,0x8e,0x60,0x26,0x12,0x03,0x61,0x04,0x00,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x7a, -0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04, -0x7b,0x80,0x7a,0xff,0x12,0x03,0xc7,0x02,0x05,0x9c,0x7b,0x00,0x7a,0x00,0x90,0x42, -0x5c,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x5c,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05, -0x8a,0x04,0x7b,0x03,0x7a,0x00,0x12,0x00,0xc4,0x70,0x03,0x02,0x2d,0x2a,0x12,0x03, -0x61,0x04,0x00,0x8b,0x05,0x8a,0x04,0x90,0x42,0x5c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12, -0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x01,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xf2, -0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x12, -0x03,0x61,0x06,0x00,0x12,0x00,0x8e,0x70,0x03,0x02,0x2d,0x1f,0x12,0x03,0x61,0x04, -0x00,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x7a,0x00,0x12,0x03,0xc7,0x8b,0x05,0x8a,0x04, -0x90,0x42,0x5c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0, -0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x7b,0x80,0x7a,0xff,0x12,0x03,0xc7,0x8b,0x05, -0x8a,0x04,0x12,0x03,0x61,0x04,0x00,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x90,0x42, -0x5c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0xc7,0x12,0x05,0xf2,0x8a,0x83,0x8b,0x82, -0xe0,0xfb,0x7a,0x00,0x12,0x04,0x1c,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x12,0x03, -0x61,0x08,0x00,0x12,0x03,0xc7,0x12,0x05,0xf2,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04, -0x12,0x03,0x61,0x06,0x00,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x7a,0x00, -0x12,0x03,0xc7,0x12,0x05,0xf2,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x90,0x42,0x5c, -0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x01,0x7a,0x00, -0x12,0x03,0xc7,0x12,0x05,0xf2,0x12,0x03,0xc7,0x12,0x05,0xf2,0x8a,0x83,0x8b,0x82, -0xe0,0xfb,0x7a,0x00,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x12,0x03,0x61,0x08,0x00, -0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05, -0xf2,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x90,0x42,0x5c,0xe0,0xfa,0xa3,0xe0,0xfb, -0x12,0x03,0xc7,0x12,0x05,0xf2,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x12,0x03, -0xcf,0x12,0x05,0xf2,0x12,0x03,0xd8,0x12,0x05,0xf2,0x12,0x05,0xd6,0x8b,0x05,0x8a, -0x04,0x12,0x03,0x61,0x06,0x00,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x90,0x42,0x5c, -0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x01,0x7a,0x00, -0x12,0x03,0xc7,0x12,0x05,0xf2,0x12,0x03,0xc7,0x12,0x05,0xf2,0x8a,0x83,0x8b,0x82, -0xe0,0xfb,0x7a,0x00,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x12,0x03,0x61,0x08,0x00, -0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x90,0x42,0x5c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12, -0x03,0xc7,0x12,0x05,0xf2,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x12,0x03,0xcf, -0x12,0x05,0xf2,0x12,0x03,0xed,0x12,0x05,0xf2,0x12,0x03,0xc7,0x02,0x05,0x9c,0x7b, -0x5c,0x7a,0x42,0x12,0x02,0x42,0x02,0x02,0x2b,0x56,0x12,0x03,0x61,0x04,0x00,0x8b, -0x05,0x8a,0x04,0x7b,0x04,0x7a,0x00,0x12,0x03,0xc7,0x8b,0x05,0x8a,0x04,0x7b,0x03, -0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x8b,0x05,0x8a, -0x04,0x7b,0x80,0x7a,0xff,0x12,0x03,0xc7,0x02,0x05,0x9c,0x74,0x02,0x78,0x00,0x79, -0x04,0x12,0x05,0x58,0x12,0x03,0x61,0x04,0x00,0x12,0x03,0x3e,0x04,0x00,0x12,0x03, -0x38,0x02,0x00,0x90,0x42,0x5e,0xeb,0xf0,0x7b,0x00,0x7a,0x00,0x90,0x42,0x61,0xea, -0xf0,0xeb,0xa3,0xf0,0x7b,0xb3,0x7a,0x80,0x8b,0x05,0x8a,0x04,0x90,0x42,0x5e,0xe0, -0xfb,0x12,0x05,0xd6,0x8b,0x05,0x7b,0x04,0x7c,0x00,0x12,0x02,0xc4,0x12,0x05,0xf2, -0x7a,0x00,0xeb,0x2b,0xfb,0xea,0x3a,0xfa,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0, -0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x12,0x03,0x61,0x04,0x00,0x12,0x03,0x38, -0x03,0x00,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x7a,0x00,0x90, -0x42,0x5f,0xea,0xf0,0xeb,0xa3,0xf0,0x12,0x03,0x61,0x04,0x00,0x12,0x03,0x38,0x01, -0x00,0x8b,0x05,0x7b,0x09,0x12,0x01,0x37,0x70,0x03,0x02,0x2e,0x7b,0x12,0x03,0x61, -0x04,0x00,0x12,0x03,0x3e,0x04,0x00,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x8b,0x05,0x7b, -0x0f,0xeb,0x5d,0xfb,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x90,0x42,0x5e,0xe0,0xfb,0x12, -0x05,0xd6,0x8b,0x05,0x7b,0x0f,0xeb,0x5d,0xfb,0x12,0x05,0xf2,0x7a,0x00,0x12,0x05, -0xd6,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x12,0x02,0xdf,0x12,0x05,0xf2,0x12,0x03,0xc7, -0x8b,0x05,0x8a,0x04,0x7b,0x5f,0x7a,0x42,0x12,0x00,0x53,0x12,0x03,0x61,0x04,0x00, -0x12,0x03,0x38,0x02,0x00,0x7a,0x00,0x12,0x05,0xcf,0x7b,0xcb,0x7a,0x80,0x8b,0x05, -0x8a,0x04,0x12,0x03,0x61,0x06,0x00,0x12,0x03,0x3e,0x04,0x00,0x12,0x03,0x38,0x10, -0x00,0x7a,0x00,0x78,0x03,0x12,0x01,0x46,0x00,0x08,0x12,0x03,0xc7,0x90,0x00,0x04, -0x12,0x2b,0x00,0x90,0x42,0x61,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x5f,0xe0,0xfa, -0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x7e,0x7a,0x00,0x12,0x00,0x8e,0x60,0x0c, -0x7b,0x7e,0x7a,0x00,0x90,0x42,0x5f,0xea,0xf0,0xeb,0xa3,0xf0,0x12,0x03,0x61,0x04, -0x00,0x12,0x03,0x3e,0x04,0x00,0x12,0x03,0x38,0x0a,0x00,0x8b,0x05,0x7b,0x01,0x7c, -0x00,0x12,0x02,0xc4,0x7a,0x00,0x12,0x04,0x1c,0x8b,0x05,0x8a,0x04,0x7b,0x7f,0x7a, -0x00,0x12,0x03,0xc7,0x90,0x42,0x63,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x61,0xe0, -0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x63,0x7a,0x42,0x12,0x00,0x53,0x90, -0x42,0x63,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x7f,0x7a,0x00,0x12, -0x00,0x8e,0x60,0x0c,0x7b,0x7f,0x7a,0x00,0x90,0x42,0x63,0xea,0xf0,0xeb,0xa3,0xf0, -0x90,0x42,0x63,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x01,0x7a,0x00, -0x12,0x00,0xc4,0x60,0x0c,0x7b,0x01,0x7a,0x00,0x90,0x42,0x63,0xea,0xf0,0xeb,0xa3, -0xf0,0x7b,0x7f,0x7a,0x00,0x8b,0x05,0x8a,0x04,0x90,0x42,0x5f,0xe0,0xfa,0xa3,0xe0, -0xfb,0x12,0x03,0xcf,0x8b,0x05,0x8a,0x04,0x90,0x42,0x63,0xe0,0xfa,0xa3,0xe0,0xfb, -0x12,0x03,0xd8,0x8b,0x05,0x8a,0x04,0x7b,0x7f,0x7a,0x00,0x12,0x03,0xed,0x90,0x42, -0x63,0xea,0xf0,0xeb,0xa3,0xf0,0x7b,0xe0,0x7a,0x45,0x8b,0x05,0x8a,0x04,0x12,0x03, -0x61,0x04,0x00,0x12,0x03,0x38,0x01,0x00,0x7a,0x00,0x78,0x03,0x12,0x01,0x46,0x00, -0x0e,0x12,0x03,0xc7,0x12,0x03,0x38,0x0c,0x00,0x7a,0x00,0x12,0x04,0x1c,0x8b,0x05, -0x8a,0x04,0x7b,0x7f,0x7a,0x00,0x12,0x03,0xc7,0x8b,0x05,0x8a,0x04,0x90,0x42,0x63, -0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0xd8,0x8b,0x05,0x8a,0x04,0x7b,0x7f,0x7a,0x00, -0x12,0x03,0xed,0x90,0x42,0x63,0xea,0xf0,0xeb,0xa3,0xf0,0x7b,0x7f,0x7a,0x00,0x8b, -0x05,0x8a,0x04,0x90,0x42,0x63,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0xcf,0x90,0x42, -0x63,0xea,0xf0,0xeb,0xa3,0xf0,0x12,0x03,0x61,0x04,0x00,0x12,0x03,0x38,0x01,0x00, -0x8b,0x05,0x7b,0x09,0x12,0x01,0x28,0x60,0x12,0x90,0x46,0xc0,0xe0,0xfb,0x7a,0x00, -0x8b,0x05,0x8a,0x04,0x7b,0x63,0x7a,0x42,0x12,0x00,0x53,0x90,0x42,0x63,0xe0,0xfa, -0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x7e,0x7a,0x00,0x12,0x00,0x8e,0x60,0x0c, -0x7b,0x7e,0x7a,0x00,0x90,0x42,0x63,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x63,0xe0, -0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x00,0x7a,0x00,0x12,0x00,0xc4,0x60, -0x0c,0x7b,0x00,0x7a,0x00,0x90,0x42,0x63,0xea,0xf0,0xeb,0xa3,0xf0,0x7b,0x01,0x12, -0x05,0xc1,0x90,0x42,0x63,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc1,0x12,0x03,0x61, -0x06,0x00,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x90,0x00,0x03,0x12,0x39,0xbc,0x02,0x05, -0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x7b,0x4a,0x7a,0x88,0x8b,0x05, -0x8a,0x04,0x7b,0xe0,0x7a,0x45,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55, -0x06,0x00,0x7a,0x00,0x78,0x03,0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x12,0x05, -0xf2,0x12,0x03,0x38,0x03,0x00,0x7a,0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0, -0xfb,0x8b,0x05,0x7b,0xe0,0x7a,0x45,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x12,0x03, -0x55,0x05,0x00,0x7a,0x00,0x78,0x03,0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x12, -0x05,0xe4,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x0c,0x7a,0x00,0x12,0x03,0xc7, -0x12,0x05,0xe4,0x12,0x03,0x0a,0x90,0x45,0xdc,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x42, -0x65,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x65,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05, -0x8a,0x04,0x7b,0x00,0x7a,0x00,0x12,0x01,0x3b,0x60,0x3e,0x90,0x42,0x65,0xe0,0xfa, -0xa3,0xe0,0xfb,0x12,0x03,0x38,0x01,0x00,0x8b,0x05,0x12,0x03,0x55,0x04,0x00,0x12, -0x01,0x28,0x60,0x0e,0x90,0x42,0x65,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x00,0x02,0x12, -0x2d,0x5b,0x90,0x42,0x65,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x3e,0x08,0x00,0x90, -0x42,0x65,0xea,0xf0,0xeb,0xa3,0xf0,0x80,0xad,0x02,0x05,0x9c,0x74,0x02,0x78,0x00, -0x79,0x04,0x12,0x05,0x58,0x12,0x03,0x61,0x04,0x00,0x8a,0x83,0x8b,0x82,0xe0,0xfb, -0x90,0x00,0x01,0x12,0x39,0xf6,0x7b,0x80,0x8b,0x05,0x12,0x03,0x61,0x04,0x00,0x12, -0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x02,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4, -0x12,0x03,0x0a,0x12,0x03,0x61,0x04,0x00,0x12,0x05,0xcf,0x7b,0xdc,0x7a,0x45,0x90, -0x00,0x04,0x12,0x3a,0x87,0x12,0x03,0x61,0x04,0x00,0x12,0x05,0xcf,0x7b,0xd8,0x7a, -0x45,0x90,0x00,0x04,0x12,0x3a,0x30,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04, -0x12,0x05,0x58,0x90,0x45,0xdc,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x42,0x67,0xea,0xf0, -0xeb,0xa3,0xf0,0x90,0x42,0x67,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b, -0x00,0x7a,0x00,0x12,0x01,0x3b,0x60,0x4e,0x90,0x42,0x67,0xe0,0xfa,0xa3,0xe0,0xfb, -0x12,0x03,0x3e,0x08,0x00,0x90,0x42,0x69,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x67, -0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x01,0x00,0x8b,0x05,0x12,0x03,0x55,0x04, -0x00,0x12,0x01,0x28,0x60,0x0e,0x90,0x42,0x67,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x00, -0x02,0x12,0x31,0x2c,0x90,0x42,0x69,0xe0,0xfa,0xa3,0xe0,0xfb,0x90,0x42,0x67,0xea, -0xf0,0xeb,0xa3,0xf0,0x80,0x9d,0x02,0x05,0x9c,0xe4,0x78,0x00,0x79,0x04,0x12,0x05, -0x58,0x7b,0x00,0x90,0x42,0x6b,0xeb,0xf0,0x90,0x42,0x6b,0xe0,0xfb,0x8b,0x05,0x7b, -0x10,0x12,0x00,0xdb,0x60,0x15,0x90,0x42,0x6b,0xe0,0xfb,0x90,0x00,0x01,0x12,0x31, -0x8a,0x7b,0x6b,0x7a,0x42,0x12,0x02,0x42,0x01,0x80,0xdd,0x02,0x05,0x9c,0x74,0x01, -0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x7b,0xe0,0x7a,0x45,0x8b,0x05,0x8a,0x04,0x12, -0x03,0x55,0x04,0x00,0x7a,0x00,0x78,0x03,0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7, -0x90,0x42,0x6c,0xea,0xf0,0xeb,0xa3,0xf0,0x7b,0x00,0x8b,0x05,0x90,0x42,0x6c,0xe0, -0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x02,0x7a,0x00,0x12, -0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x7b,0x64,0x8b,0x05,0x90,0x42,0x6c,0xe0, -0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x03,0x7a,0x00,0x12, -0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x7b,0x40,0x8b,0x05,0x90,0x42,0x6c,0xe0, -0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x04,0x7a,0x00,0x12, -0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x7b,0x02,0x8b,0x05,0x90,0x42,0x6c,0xe0, -0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x05,0x7a,0x00,0x12, -0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x7b,0x00,0x7a,0x00,0x8b,0x05,0x8a,0x04, -0x90,0x42,0x6c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xd6,0x8b,0x05,0x8a,0x04,0x7b, -0x06,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xf2,0x12,0x03,0x12,0x7b,0x00,0x8b,0x05, -0x90,0x42,0x6c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b, -0x08,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x7b,0x00,0x8b,0x05, -0x90,0x42,0x6c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b, -0x09,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x7b,0x00,0x8b,0x05, -0x90,0x42,0x6c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b, -0x0d,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x7b,0x00,0x7a,0x00, -0x8b,0x05,0x8a,0x04,0x90,0x42,0x6c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xd6,0x8b, -0x05,0x8a,0x04,0x7b,0x0a,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xf2,0x12,0x03,0x12, -0x90,0x88,0xae,0xe0,0xfb,0x8b,0x05,0x90,0x42,0x6c,0xe0,0xfa,0xa3,0xe0,0xfb,0x12, -0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x0c,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4, -0x12,0x03,0x0a,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x02, -0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x02,0x05,0x9c,0x74,0x01, -0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04, -0x12,0x05,0x58,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x02, -0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x02,0x05,0x9c,0x74,0x01, -0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x02,0x05,0x9c,0x74,0x01,0x78,0x00,0x79,0x04, -0x12,0x05,0x58,0x7b,0x33,0x7a,0x88,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x05,0x00, -0x12,0x05,0xd6,0x8b,0x05,0x7b,0x03,0x7c,0x00,0x12,0x02,0xc4,0x12,0x05,0xf2,0x7a, -0x00,0x12,0x03,0xc7,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x90,0x42,0x70,0xeb,0xf0,0x90, -0x42,0x70,0xe0,0xfb,0x8b,0x05,0x7b,0xe0,0x7a,0x45,0x12,0x05,0xc8,0x8b,0x05,0x8a, -0x04,0x12,0x03,0x55,0x05,0x00,0x7a,0x00,0x78,0x03,0x12,0x01,0x46,0x00,0x0e,0x12, -0x03,0xc7,0x12,0x05,0xe4,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b,0x09,0x7a,0x00, -0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x90,0x45,0xdc,0xe0,0xfa,0xa3,0xe0, -0xfb,0x90,0x42,0x6e,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x6e,0xe0,0xfa,0xa3,0xe0, -0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x00,0x7a,0x00,0x12,0x01,0x3b,0x60,0x4c,0x90,0x42, -0x6e,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x01,0x00,0x8b,0x05,0x12,0x03,0x55, -0x04,0x00,0x12,0x01,0x28,0x60,0x1c,0x90,0x42,0x70,0xe0,0xfb,0x12,0x05,0xc1,0x90, -0x42,0x6e,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x90,0x00,0x02, -0x12,0x0a,0xaa,0x90,0x42,0x6e,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x3e,0x08,0x00, -0x90,0x42,0x6e,0xea,0xf0,0xeb,0xa3,0xf0,0x80,0x9f,0x02,0x05,0x9c,0x74,0x01,0x78, -0x00,0x79,0x04,0x12,0x05,0x58,0x12,0x03,0x55,0x05,0x00,0x7a,0x00,0x12,0x04,0x68, -0x00,0x07,0x00,0x5b,0x36,0x9b,0x35,0xb0,0x36,0x9b,0x36,0x9b,0x36,0x33,0x36,0x9b, -0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b, -0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b, -0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b, -0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b, -0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b, -0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b, -0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x61,0x36,0x9b,0x36,0x9b,0x36,0x9b, -0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b, -0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b, -0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x9b,0x36,0x86, -0x7b,0xe0,0x7a,0x45,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x04,0x00,0x7a,0x00,0x78, -0x03,0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x8b,0x05,0x8a,0x04,0x7b,0x03,0x7a, -0x00,0x12,0x03,0xc7,0x90,0x42,0x71,0xea,0xf0,0xeb,0xa3,0xf0,0x12,0x03,0x61,0x06, -0x00,0x8b,0x05,0x8a,0x04,0x7b,0x07,0x12,0x02,0xc4,0x8b,0x05,0x8a,0x04,0x7b,0x7c, -0x7a,0x00,0x12,0x02,0xfa,0x90,0x42,0x73,0xeb,0xf0,0x90,0x42,0x71,0xe0,0xfa,0xa3, -0xe0,0xfb,0x8a,0x83,0x8b,0x82,0xe0,0xfb,0x8b,0x05,0x90,0x42,0x73,0xe0,0xfb,0x12, -0x01,0x37,0x60,0x1d,0x90,0x42,0x73,0xe0,0xfb,0x8b,0x05,0x90,0x42,0x71,0xe0,0xfa, -0xa3,0xe0,0xfb,0x12,0x03,0x0a,0x12,0x03,0x55,0x04,0x00,0x90,0x00,0x01,0x12,0x30, -0x51,0x80,0x68,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x7b,0x09,0x12,0x01,0x28,0x60, -0x02,0x80,0x58,0x12,0x03,0x61,0x06,0x00,0x8b,0x05,0x8a,0x04,0x7b,0x07,0x12,0x02, -0xc4,0x12,0x05,0xc1,0x12,0x03,0x55,0x05,0x00,0x90,0x00,0x02,0x12,0x34,0x0a,0x80, -0x3a,0x12,0x03,0x55,0x04,0x00,0x8b,0x05,0x7b,0x09,0x12,0x01,0x28,0x60,0x02,0x80, -0x2a,0x12,0x03,0x61,0x06,0x00,0x12,0x05,0xc1,0x12,0x03,0x55,0x05,0x00,0x90,0x00, -0x02,0x12,0x37,0xa0,0x80,0x15,0x12,0x03,0x61,0x06,0x00,0x12,0x05,0xc1,0x12,0x03, -0x55,0x05,0x00,0x90,0x00,0x02,0x12,0x36,0x9e,0x80,0x00,0x02,0x05,0x9c,0x74,0x01, -0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x12,0x03,0x55,0x05,0x00,0x8b,0x05,0x7b,0x40, -0x12,0x01,0x0b,0x60,0x09,0x7b,0x01,0x90,0x42,0x79,0xeb,0xf0,0x80,0x07,0x7b,0x00, -0x90,0x42,0x79,0xeb,0xf0,0x90,0x42,0x79,0xe0,0xfb,0x90,0x42,0x76,0xeb,0xf0,0x7b, -0xe0,0x7a,0x45,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x04,0x00,0x7a,0x00,0x78,0x03, -0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x90,0x42,0x77,0xea,0xf0,0xeb,0xa3,0xf0, -0x90,0x42,0x77,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x0d,0x00,0x8b,0x05,0x7b, -0xfe,0xeb,0x5d,0xfb,0x8b,0x05,0x90,0x42,0x76,0xe0,0xfb,0xeb,0x4d,0xfb,0x8b,0x05, -0x90,0x42,0x77,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a,0x04,0x7b, -0x0d,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x90,0x45,0xdc,0xe0, -0xfa,0xa3,0xe0,0xfb,0x90,0x42,0x74,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x74,0xe0, -0xfa,0xa3,0xe0,0xfb,0x8b,0x05,0x8a,0x04,0x7b,0x00,0x7a,0x00,0x12,0x01,0x3b,0x60, -0x4c,0x90,0x42,0x74,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x01,0x00,0x8b,0x05, -0x12,0x03,0x55,0x04,0x00,0x12,0x01,0x28,0x60,0x1c,0x90,0x42,0x76,0xe0,0xfb,0x12, -0x05,0xc1,0x90,0x42,0x74,0xe0,0xfa,0xa3,0xe0,0xfb,0x8a,0x83,0x8b,0x82,0xe0,0xfb, -0x90,0x00,0x02,0x12,0x3a,0x0d,0x90,0x42,0x74,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03, -0x3e,0x08,0x00,0x90,0x42,0x74,0xea,0xf0,0xeb,0xa3,0xf0,0x80,0x9f,0x02,0x05,0x9c, -0x74,0x01,0x78,0x00,0x79,0x04,0x12,0x05,0x58,0x12,0x03,0x55,0x05,0x00,0x8b,0x05, -0x7b,0x40,0x12,0x01,0x0b,0x60,0x09,0x7b,0x00,0x90,0x42,0x7f,0xeb,0xf0,0x80,0x07, -0x7b,0x00,0x90,0x42,0x7f,0xeb,0xf0,0x90,0x42,0x7f,0xe0,0xfb,0x90,0x42,0x7a,0xeb, -0xf0,0x7b,0xe0,0x7a,0x45,0x8b,0x05,0x8a,0x04,0x12,0x03,0x55,0x04,0x00,0x7a,0x00, -0x78,0x03,0x12,0x01,0x46,0x00,0x0e,0x12,0x03,0xc7,0x90,0x42,0x7b,0xea,0xf0,0xeb, -0xa3,0xf0,0x90,0x42,0x7b,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x0d,0x00,0x8b, -0x05,0x7b,0xff,0xeb,0x5d,0xfb,0x8b,0x05,0x90,0x42,0x7a,0xe0,0xfb,0xeb,0x4d,0xfb, -0x8b,0x05,0x90,0x42,0x7b,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x05,0xc8,0x8b,0x05,0x8a, -0x04,0x7b,0x0d,0x7a,0x00,0x12,0x03,0xc7,0x12,0x05,0xe4,0x12,0x03,0x0a,0x90,0x42, -0x7a,0xe0,0x60,0x03,0x02,0x38,0xb0,0x90,0x45,0xdc,0xe0,0xfa,0xa3,0xe0,0xfb,0x90, -0x42,0x7d,0xea,0xf0,0xeb,0xa3,0xf0,0x90,0x42,0x7d,0xe0,0xfa,0xa3,0xe0,0xfb,0x8b, -0x05,0x8a,0x04,0x7b,0x00,0x7a,0x00,0x12,0x01,0x3b,0x60,0x54,0x90,0x42,0x7d,0xe0, -0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38,0x01,0x00,0x8b,0x05,0x12,0x03,0x55,0x04,0x00, -0x12,0x01,0x28,0x60,0x24,0x90,0x42,0x7d,0xe0,0xfa,0xa3,0xe0,0xfb,0x12,0x03,0x38, -0x02,0x00,0x8b,0x05,0x7b,0x81,0x12,0x01,0x28,0x60,0x0e,0x90,0x42,0x7d,0xe0,0xfa, -0xa3,0xe0,0xfb,0x90,0x00,0x02,0x12,0x31,0x2c,0x90,0x42,0x7d,0xe0,0xfa,0xa3,0xe0, -0xfb,0x12,0x03,0x3e,0x08,0x00,0x90,0x42,0x7d,0xea,0xf0,0xeb,0xa3,0xf0,0x80,0x97, -0x02,0x05,0x9c,0x8b,0xf0,0x12,0x05,0xdd,0xa9,0x03,0xa8,0xf0,0x80,0x00,0xc2,0xb4, -0x90,0xff,0xc4,0xe8,0xf0,0xa3,0xe9,0x00,0xf0,0x74,0x82,0x28,0xf5,0x82,0x74,0x42, -0x34,0x00,0xf5,0x83,0xe9,0xf0,0xd2,0xb4,0x22,0xc2,0xb4,0x7c,0x03,0x7d,0xe8,0x90, -0xff,0xc0,0xe0,0x30,0xe1,0x04,0xdd,0xf7,0xdc,0xf5,0xd2,0xb4,0x12,0x05,0xf2,0xeb, -0x24,0x80,0xf5,0xf0,0xa8,0xf0,0x8c,0x83,0x8d,0x82,0xe0,0xa3,0xac,0x83,0xad,0x82, -0x54,0x3f,0xf9,0x12,0x38,0xbe,0xe5,0xf0,0x24,0x18,0xf5,0xf0,0x7a,0x03,0xa8,0xf0, -0x8c,0x83,0x8d,0x82,0xe0,0xa3,0xac,0x83,0xad,0x82,0xf9,0x12,0x38,0xbe,0xe5,0xf0, -0x24,0x18,0xf5,0xf0,0xda,0xe8,0xa8,0xf0,0x8c,0x83,0x8d,0x82,0xe0,0xa3,0xac,0x83, -0xad,0x82,0x54,0x07,0xf9,0x02,0x38,0xbe,0x22,0xc0,0x03,0x12,0x05,0xe4,0x12,0x05, -0xeb,0xd0,0x00,0xa9,0x05,0x80,0x00,0xe8,0x24,0x38,0xfc,0x74,0x82,0x2c,0xf5,0x82, -0x74,0x42,0x34,0x00,0xf5,0x83,0xe0,0x54,0x08,0xfd,0xe9,0x54,0x0f,0xc4,0x4d,0xfd, -0xeb,0x33,0xea,0x33,0x54,0x07,0x4d,0xf9,0xa8,0x04,0x12,0x38,0xbe,0xec,0xc3,0x94, -0x18,0xfc,0x24,0x82,0xf5,0x82,0x74,0x42,0x34,0x00,0xf5,0x83,0xe0,0x54,0x01,0xfd, -0xeb,0xc3,0x33,0x4d,0xa8,0x04,0xf9,0x02,0x38,0xbe,0x22,0x12,0x05,0xe4,0xc0,0x05, -0x12,0x05,0xe4,0xaa,0x05,0xd0,0x01,0xa8,0x03,0x80,0x00,0xe8,0x24,0x20,0xf8,0x74, -0x82,0x28,0xf5,0x82,0x74,0x42,0x34,0x00,0xf5,0x83,0xe0,0x54,0xfe,0x49,0xf9,0x12, -0x38,0xbe,0xe8,0x24,0xe8,0xf8,0xa9,0x02,0x02,0x38,0xbe,0x22,0x12,0x05,0xe4,0xc0, -0x05,0x12,0x05,0xe4,0xaa,0x05,0xd0,0x01,0xa8,0x03,0x80,0x00,0xe8,0x24,0x50,0xf8, -0xea,0x13,0xe9,0x33,0xf9,0x02,0x38,0xbe,0x22,0x12,0x05,0xe4,0xeb,0x24,0x68,0xf8, -0x74,0x82,0x28,0xf5,0x82,0x74,0x42,0x34,0x00,0xf5,0x83,0xe0,0x54,0x30,0x44,0x80, -0x4d,0xf9,0x02,0x38,0xbe,0x22,0xeb,0x24,0x68,0xf8,0x74,0x82,0x28,0xf5,0x82,0x74, -0x42,0x34,0x00,0xf5,0x83,0xe0,0x54,0x7f,0xf9,0x02,0x38,0xbe,0x22,0x12,0x05,0xe4, -0x80,0x00,0xeb,0x24,0x38,0xf8,0x74,0x82,0x28,0xf5,0x82,0x74,0x42,0x34,0x00,0xf5, -0x83,0xe0,0xbd,0x00,0x05,0x54,0xf7,0x02,0x3a,0x2c,0x44,0x08,0xf9,0x02,0x38,0xbe, -0x12,0x05,0xf2,0xac,0x05,0x02,0x3a,0x38,0x75,0xa0,0x00,0xeb,0x24,0x01,0xf5,0x82, -0xea,0x34,0x00,0xf5,0x83,0xe0,0x70,0x1f,0xec,0xf0,0xe5,0x82,0x24,0x02,0xf5,0x82, -0xe5,0x83,0x34,0x00,0xf5,0x83,0xec,0xf0,0xec,0x24,0x07,0xf8,0xe4,0xf2,0xec,0x24, -0x09,0xf8,0xe4,0xf2,0x02,0x3a,0x86,0xeb,0x24,0x03,0xf5,0x82,0xea,0x34,0x00,0xf5, -0x83,0xe0,0xf9,0x24,0x09,0xf8,0xec,0xf2,0xec,0x24,0x09,0xf8,0xe4,0xf2,0xec,0x24, -0x07,0xf8,0xe9,0xf2,0xec,0xf0,0x22,0x12,0x05,0xf2,0xac,0x05,0x02,0x3a,0x8f,0x75, -0xa0,0x00,0xec,0x24,0x09,0xf8,0xe2,0x70,0x13,0xeb,0x24,0x03,0xf5,0x82,0xea,0x34, -0x00,0xf5,0x83,0xec,0x24,0x07,0xf8,0xe2,0xf0,0x02,0x3a,0xbe,0xec,0x24,0x07,0xf8, -0xe2,0xf5,0xf0,0xec,0x24,0x09,0xf8,0xe2,0x24,0x07,0xf8,0xe5,0xf0,0xf2,0xec,0x24, -0x07,0xf8,0xe2,0x70,0x13,0xeb,0x24,0x01,0xf5,0x82,0xea,0x34,0x00,0xf5,0x83,0xec, -0x24,0x09,0xf8,0xe2,0xf0,0x02,0x3a,0xea,0xec,0x24,0x09,0xf8,0xe2,0xf5,0xf0,0xec, -0x24,0x07,0xf8,0xe2,0x24,0x09,0xf8,0xe5,0xf0,0xf2,0x22,0x90,0x45,0xd9,0xe0,0x60, -0x16,0xf5,0x25,0x7a,0x45,0x7b,0xd8,0xfc,0x12,0x3a,0x8f,0x7a,0x45,0x7b,0xdc,0xac, -0x25,0x12,0x3a,0x38,0x02,0x3b,0x26,0x90,0x45,0xdd,0xe0,0x60,0x16,0xf5,0x25,0x7a, -0x45,0x7b,0xdc,0xfc,0x12,0x3a,0x8f,0x7a,0x45,0x7b,0xdc,0xac,0x25,0x12,0x3a,0x38, -0x02,0x3b,0x26,0x75,0x25,0x00,0x7a,0x00,0xab,0x25,0x22,0x75,0xa0,0x00,0xeb,0x24, -0x02,0xf8,0xe2,0xc3,0x13,0xfc,0xe4,0x92,0xe7,0xfd,0xeb,0x24,0x05,0xf8,0xe2,0x24, -0x05,0x92,0xd5,0xf5,0x82,0xeb,0x24,0x04,0xf8,0xe2,0xa2,0xd5,0x34,0x00,0xf5,0x83, -0xe0,0x30,0xe7,0x04,0x7c,0x1e,0x7d,0x00,0xe5,0x82,0x24,0x03,0xf5,0x82,0xe5,0x83, -0x34,0x00,0xf5,0x83,0xe0,0xf9,0xa3,0xe0,0x2d,0xfd,0xe9,0x3c,0xfc,0xeb,0x24,0x01, -0xf8,0xe2,0x75,0xf0,0x0e,0xa4,0x24,0xea,0xf5,0x82,0xe5,0xf0,0x34,0x45,0xf5,0x83, -0xe0,0xf9,0xa3,0xe0,0x2d,0xfd,0xe9,0x3c,0xfc,0xed,0xc3,0x94,0x00,0xec,0x94,0x60, -0x40,0x04,0x7c,0x5f,0x7d,0xff,0xed,0x33,0xec,0x33,0x75,0xf0,0x0c,0x84,0x94,0x08, -0xfa,0xed,0xc3,0x33,0x24,0xca,0xf5,0x82,0xe5,0xf0,0x34,0x88,0xf5,0x83,0xe0,0xfc, -0xa3,0xe0,0xfd,0xeb,0x24,0x00,0xf8,0xe2,0xf8,0xa9,0x02,0xaa,0x04,0xab,0x05,0x12, -0x39,0x47,0x22,0x12,0x05,0xe4,0x80,0x00,0xbb,0x09,0x01,0x22,0xeb,0x75,0xf0,0x0e, -0xa4,0x24,0xe4,0xf5,0x82,0xe5,0xf0,0x34,0x45,0xf5,0x83,0xed,0xf0,0xa9,0x03,0xaa, -0x83,0xab,0x82,0x80,0x12,0x8b,0x82,0x8a,0x83,0xe0,0xf9,0x80,0x00,0x74,0x04,0x2b, -0xf5,0x82,0xea,0x34,0x00,0xf5,0x83,0xe0,0x24,0xc0,0xc3,0x33,0x92,0xd5,0x50,0x02, -0xf4,0x04,0xfb,0x89,0x24,0xe5,0x82,0x24,0x01,0xf5,0x82,0xe5,0x83,0x34,0x00,0xf5, -0x83,0xe0,0x8b,0xf0,0xa4,0x30,0xd5,0x0a,0xf4,0x24,0x01,0xc5,0xf0,0xf4,0x34,0x00, -0xc5,0xf0,0xaa,0xf0,0xfb,0x74,0x01,0x25,0x82,0xf5,0x82,0xe5,0x83,0x34,0x00,0xf5, -0x83,0xe0,0xfc,0xa3,0xe0,0xfd,0x74,0x01,0x25,0x82,0xf5,0x82,0xe5,0x83,0x34,0x00, -0xf5,0x83,0xe0,0xa2,0xe7,0x92,0xd5,0x2d,0xfd,0xec,0x75,0xf0,0x00,0x30,0xd5,0x03, -0x75,0xf0,0xff,0x35,0xf0,0xfc,0xed,0x2b,0xfd,0xec,0x3a,0xfc,0xe5,0x82,0x24,0x02, -0xf5,0x82,0xe5,0x83,0x34,0x00,0xf5,0x83,0xec,0xf0,0xa3,0xed,0xf0,0x90,0x45,0xdd, -0xe0,0xf5,0x23,0x75,0xa0,0x00,0x60,0x16,0x24,0x01,0xf8,0xe2,0xb5,0x24,0x05,0xab, -0x23,0x12,0x3b,0x2b,0xe5,0x23,0x24,0x09,0xf8,0xe2,0xf5,0x23,0x80,0xe5,0x22,0x75, -0xa0,0x00,0xeb,0x24,0x04,0xf8,0xe2,0xf5,0xf0,0xe8,0x04,0xf8,0xe2,0x24,0x0a,0xf5, -0x82,0xe5,0xf0,0x34,0x00,0xf5,0x83,0xc0,0x83,0xc0,0x82,0xe0,0xc3,0x13,0xfa,0x79, -0x00,0xeb,0x24,0x01,0xf8,0xe2,0xfc,0x75,0xf0,0x0e,0xa4,0x24,0xec,0xf5,0x82,0xe5, -0xf0,0x34,0x45,0xf5,0x83,0xe0,0x2a,0xfa,0xe9,0x34,0x00,0xf9,0xd0,0xe0,0x24,0xf8, -0xf5,0x82,0xd0,0xe0,0x34,0xff,0xf5,0x83,0xe0,0xc4,0x54,0x0f,0xc3,0x33,0x24,0xb3, -0xf5,0x82,0x74,0x80,0x34,0x00,0xf5,0x83,0xe0,0xf5,0xf0,0xa3,0xe0,0xf5,0x82,0x85, -0xf0,0x83,0xeb,0x24,0x03,0xf8,0xe2,0x25,0x82,0xf5,0x82,0xe5,0x83,0x34,0x00,0xf5, -0x83,0xe0,0x2a,0xfa,0xe9,0x34,0x00,0xf9,0xbc,0x09,0x0a,0x90,0x46,0xc0,0xe0,0x2a, -0xfa,0xe9,0x34,0x00,0xf9,0xc3,0xea,0x94,0x7e,0xe9,0x94,0x00,0x40,0x02,0x7a,0x7e, -0xeb,0x24,0x00,0xf8,0xe2,0xf8,0xa9,0x02,0x7a,0x01,0x12,0x39,0xcc,0x22,0x74,0xaa, -0x90,0xff,0xe1,0xf0,0x12,0x40,0x19,0x12,0x4c,0x48,0x22,0x12,0x40,0x3d,0xc3,0x33, -0x40,0x05,0x90,0x3d,0x59,0x80,0x03,0x90,0x3e,0x59,0xf5,0xf0,0x93,0xc5,0xf0,0xa3, -0x93,0x85,0xf0,0x83,0xf5,0x82,0xe4,0x73,0x22,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x3f,0x5f,0x40,0x16,0x40,0x16,0x40, -0x16,0x3f,0x67,0x40,0x16,0x3f,0x6d,0x3f,0x73,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x3f,0x79,0x40,0x16,0x40,0x16,0x40, -0x16,0x3f,0x81,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x3f,0x87,0x3f,0x8f,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x3f,0x92,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x3f,0x98,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x3f,0x9e,0x3f,0xa4,0x3f,0xaa,0x3f,0xb0,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x3f,0x59,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x3f,0xb6,0x3f,0xc1,0x40,0x16,0x3f, -0xc4,0x3f,0xc7,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x3f,0xcc,0x3f,0xd6,0x3f,0xe3,0x40, -0x16,0x3f,0xf5,0x40,0x16,0x40,0x16,0x40,0x16,0x3f,0xfd,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x05,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x0e,0x40,0x16,0x40,0x16,0x40, -0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x40,0x16,0x12,0x40,0xb7,0x02,0x3d,0x58,0x12, -0x40,0x2a,0xf5,0x90,0x02,0x3d,0x58,0x12,0x40,0xa7,0x02,0x3d,0x58,0x12,0x40,0x9f, -0x02,0x3d,0x58,0x12,0x40,0x9f,0x02,0x3d,0x58,0x74,0x00,0x12,0x40,0x42,0x02,0x3d, -0x58,0x12,0x40,0xaf,0x02,0x3d,0x58,0x74,0xf8,0x12,0x40,0x42,0x02,0x3d,0x58,0x02, -0x3d,0x58,0x12,0x40,0x2a,0x02,0x3d,0x58,0x12,0x40,0xbf,0x02,0x3d,0x58,0x12,0x40, -0x87,0x02,0x3d,0x58,0x12,0x40,0x93,0x02,0x3d,0x58,0x12,0x40,0x9f,0x02,0x3d,0x58, -0x12,0x40,0x9f,0x02,0x3d,0x58,0xc2,0xa9,0x74,0x00,0x90,0xff,0xe4,0xf0,0x02,0x3d, -0x58,0x02,0x3d,0x58,0x02,0x3d,0x58,0xd2,0xa9,0x02,0x3d,0x58,0x12,0x40,0x2a,0xf4, -0x12,0x40,0x42,0x02,0x3d,0x58,0x74,0x01,0x12,0x40,0x42,0x74,0x05,0x12,0x40,0x42, -0x02,0x3d,0x58,0x12,0x40,0x2a,0x12,0x4c,0x4e,0x12,0x40,0x42,0x74,0x01,0x90,0xff, -0xe4,0xf0,0x02,0x3d,0x58,0x12,0x40,0x2a,0xf5,0x26,0x02,0x3d,0x58,0xe5,0x26,0x12, -0x40,0x42,0x02,0x3d,0x58,0x74,0x01,0x90,0xff,0xe5,0xf0,0x02,0x3d,0x58,0x74,0x00, -0x12,0x40,0x42,0x02,0x3d,0x58,0x02,0x3d,0x58,0xe5,0x89,0x54,0xf0,0x44,0x02,0xf5, -0x89,0x75,0x8c,0x83,0x75,0x8a,0x83,0xd2,0x8c,0x22,0x90,0xff,0xe2,0x75,0x27,0x00, -0x75,0x28,0x00,0xe0,0x20,0xe0,0x06,0xd5,0x27,0xf9,0xd5,0x28,0xf6,0x90,0xff,0xe0, -0xe0,0x22,0xc0,0xe0,0x90,0xff,0xe3,0x75,0x27,0x00,0x75,0x28,0x00,0xe0,0x30,0xe0, -0x06,0xd5,0x27,0xf9,0xd5,0x28,0xf6,0xd0,0xe0,0x90,0xff,0xe1,0xf0,0x22,0x12,0x40, -0x2a,0xf5,0x2a,0x12,0x40,0x2a,0xf5,0x29,0x30,0x08,0x14,0xc2,0x09,0xe5,0x2a,0x20, -0xe0,0x02,0xd2,0x09,0xe5,0x29,0xc3,0x13,0xf5,0x29,0xe5,0x2a,0x13,0xf5,0x2a,0xe4, -0x90,0xff,0xe4,0xf0,0xd2,0xa9,0x22,0xc2,0x00,0xc2,0x07,0xd2,0x01,0xd2,0x05,0xc2, -0x06,0x80,0xcb,0xc2,0x00,0xc2,0x07,0xd2,0x01,0xd2,0x05,0xd2,0x06,0x80,0xbf,0xc2, -0x00,0xc2,0x07,0xd2,0x01,0x80,0xb7,0xc2,0x00,0xc2,0x07,0xc2,0x01,0x80,0xaf,0xd2, -0x00,0xc2,0x07,0xc2,0x01,0x80,0xa7,0xc2,0x00,0xc2,0x01,0xd2,0x07,0x80,0x9f,0x12, -0x40,0x2a,0xc2,0x08,0xb4,0xce,0x00,0x40,0x04,0xc3,0x33,0xd2,0x08,0xc3,0x94,0x80, -0x40,0x06,0xc2,0x03,0x33,0x02,0x40,0xdc,0x24,0x80,0xd2,0x03,0xf5,0x8c,0xf5,0x8a, -0x22,0x30,0x03,0x07,0xb2,0x04,0x20,0x04,0x02,0x80,0x76,0x30,0x00,0x03,0x02,0x42, -0x4b,0x20,0x01,0x6e,0xc0,0xd0,0xc0,0x83,0xc0,0x82,0xc0,0xe0,0x20,0x07,0x43,0x30, -0x08,0x21,0x30,0x09,0x05,0xc2,0x09,0x02,0x41,0x23,0x74,0x01,0x90,0xff,0xe4,0xf0, -0x90,0xff,0xd2,0x75,0x27,0x00,0x75,0x28,0x00,0xe0,0x30,0xe4,0x06,0xd5,0x27,0xf9, -0xd5,0x28,0xf6,0x74,0x01,0x90,0xff,0xe4,0xf0,0x90,0xff,0xd2,0x75,0x27,0x00,0x75, -0x28,0x00,0xe0,0x30,0xe4,0x06,0xd5,0x27,0xf9,0xd5,0x28,0xf6,0x90,0xff,0xe4,0xe0, -0xf5,0x90,0xe5,0x2a,0xc3,0x94,0x01,0xf5,0x2a,0xe5,0x29,0x94,0x00,0xf5,0x29,0x50, -0x08,0xc2,0xa9,0x74,0x01,0x90,0xff,0xe5,0xf0,0xd0,0xe0,0xd0,0x82,0xd0,0x83,0xd0, -0xd0,0x32,0xc0,0xd0,0xc0,0x82,0xc0,0x83,0xc0,0xe0,0x30,0x05,0x36,0x74,0x01,0x90, -0xff,0xe4,0xf0,0x90,0xff,0xd2,0x75,0x27,0x00,0x75,0x28,0x00,0xe0,0x30,0xe4,0x06, -0xd5,0x27,0xf9,0xd5,0x28,0xf6,0x90,0xff,0xe4,0xe0,0xf5,0x2b,0xe5,0x2a,0xc3,0x94, -0x01,0xf5,0x2a,0xe5,0x29,0x94,0x00,0xf5,0x29,0x50,0x08,0xc2,0xa9,0x74,0x01,0x90, -0xff,0xe5,0xf0,0x30,0x06,0x0e,0x85,0x2b,0x2c,0x75,0x2d,0x01,0x85,0x2b,0x90,0xc2, -0x06,0x02,0x42,0x3a,0xb2,0x05,0xe5,0x2b,0xc4,0xf5,0x2b,0x85,0x2d,0x2f,0xe5,0x2d, -0xc3,0x33,0xf5,0x2e,0xe5,0x2b,0x30,0xe0,0x06,0xe5,0x2f,0x25,0x2e,0xf5,0x2f,0xe5, -0x2e,0xc3,0x33,0xf5,0x2e,0xe5,0x2b,0x30,0xe1,0x06,0xe5,0x2f,0x25,0x2e,0xf5,0x2f, -0xe5,0x2e,0xc3,0x33,0xf5,0x2e,0xe5,0x2b,0x30,0xe2,0x06,0xe5,0x2f,0x25,0x2e,0xf5, -0x2f,0xe5,0x2b,0x30,0xe3,0x11,0xe5,0x2f,0xc3,0x13,0xc3,0xc5,0x2c,0x95,0x2c,0x50, -0x02,0x74,0x00,0xf5,0x2c,0x80,0x0c,0xe5,0x2f,0xc3,0x13,0x25,0x2c,0x50,0x02,0x74, -0xff,0xf5,0x2c,0xe5,0x2b,0x54,0x07,0x24,0x29,0x83,0x30,0xe0,0x06,0xe5,0x2d,0xc3, -0x13,0x80,0x07,0x30,0xe1,0x11,0xe5,0x2d,0xc3,0x33,0x70,0x02,0x74,0x01,0xb4,0x09, -0x00,0x40,0x02,0x74,0x08,0xf5,0x2d,0x85,0x2c,0x90,0xd0,0xe0,0xd0,0x83,0xd0,0x82, -0xd0,0xd0,0x32,0x01,0x00,0x00,0x00,0x00,0x02,0x02,0x02,0xc0,0xd0,0xc0,0x83,0xc0, -0x82,0xc0,0xe0,0x90,0xff,0xe1,0xe4,0xf0,0x74,0x01,0x90,0xff,0xe4,0xf0,0xe5,0x2a, -0xc3,0x94,0x01,0xf5,0x2a,0xe5,0x29,0x94,0x00,0xf5,0x29,0x50,0x08,0xc2,0xa9,0x74, -0x01,0x90,0xff,0xe5,0xf0,0xd0,0xe0,0xd0,0x82,0xd0,0x83,0xd0,0xd0,0x32,0x90,0x01, -0x00,0xe4,0xf0,0xa3,0xf0,0xe4,0xf5,0x30,0xf5,0x31,0xf5,0x32,0xf5,0x33,0xe4,0xf5, -0x34,0xf5,0x35,0xf5,0x36,0xf5,0x37,0xe4,0xf5,0x3c,0xf5,0x3d,0xf5,0x3e,0xf5,0x3f, -0xe4,0xf5,0x38,0xf5,0x39,0xf5,0x3a,0xf5,0x3b,0xc2,0x14,0xc2,0x15,0xc2,0x16,0x90, -0x42,0x08,0xe0,0xb4,0x41,0x07,0xa3,0xe0,0xb4,0x50,0x02,0x80,0x1d,0x90,0x42,0x08, -0x74,0x41,0xf0,0xa3,0x74,0x50,0xf0,0x90,0x42,0x01,0x74,0x0a,0xf0,0xc2,0x10,0xd2, -0x11,0xc2,0x12,0xd2,0x13,0x90,0x42,0x00,0xe4,0xf0,0xe4,0x90,0x42,0x02,0xf0,0x90, -0x42,0x03,0xf0,0x90,0x00,0x00,0x12,0x0e,0x40,0x90,0xff,0xd0,0xe0,0x90,0xff,0xd1, -0xe0,0x90,0xff,0xe0,0xe0,0x90,0xff,0xe4,0xe0,0xd2,0xaa,0xd2,0xaf,0x30,0x16,0x18, -0xc2,0x16,0x90,0x00,0x00,0x12,0x32,0x09,0xc2,0xaf,0x85,0x3a,0x38,0x85,0x3b,0x39, -0x85,0x32,0x30,0x85,0x33,0x31,0xd2,0xaf,0x30,0x11,0x36,0x90,0xff,0xd2,0xe0,0x30, -0xe6,0x2f,0xe5,0x3d,0xb5,0x3f,0x08,0xe5,0x3c,0xb5,0x3e,0x03,0xc3,0x80,0x1c,0xe5, -0x3c,0x24,0x00,0xf5,0x82,0x74,0x32,0x35,0x3d,0xf5,0x83,0xe5,0x3c,0x24,0x01,0xf5, -0x3c,0xe5,0x3d,0x34,0x00,0x54,0x0f,0xf5,0x3d,0xe0,0xd3,0x50,0x04,0x90,0xff,0xd0, -0xf0,0xe5,0x39,0xb5,0x3b,0x08,0xe5,0x38,0xb5,0x3a,0x03,0xc3,0x80,0x1c,0xe5,0x38, -0x24,0x00,0xf5,0x82,0x74,0x22,0x35,0x39,0xf5,0x83,0xe5,0x38,0x24,0x01,0xf5,0x38, -0xe5,0x39,0x34,0x00,0x54,0x0f,0xf5,0x39,0xe0,0xd3,0x50,0x14,0x30,0x13,0x0b,0xc0, -0xe0,0xfb,0x90,0x00,0x01,0x12,0x19,0x59,0xd0,0xe0,0x30,0x12,0x03,0x12,0x44,0x00, -0xe5,0x31,0xb5,0x33,0x08,0xe5,0x30,0xb5,0x32,0x03,0xc3,0x80,0x1c,0xe5,0x30,0x24, -0x00,0xf5,0x82,0x74,0x02,0x35,0x31,0xf5,0x83,0xe5,0x30,0x24,0x01,0xf5,0x30,0xe5, -0x31,0x34,0x00,0x54,0x0f,0xf5,0x31,0xe0,0xd3,0x50,0x42,0x30,0x10,0x0b,0xc0,0xe0, -0xfb,0x90,0x00,0x01,0x12,0x19,0x59,0xd0,0xe0,0x30,0x11,0x31,0xf5,0xf0,0xe5,0x3e, -0x24,0x01,0xf5,0x42,0xe5,0x3f,0x34,0x00,0x54,0x0f,0xf5,0x43,0xb5,0x3d,0x08,0xe5, -0x42,0xb5,0x3c,0x03,0xd3,0x80,0x16,0x74,0x00,0x25,0x3e,0xf5,0x82,0x74,0x32,0x35, -0x3f,0xf5,0x83,0xe5,0xf0,0xf0,0x85,0x42,0x3e,0x85,0x43,0x3f,0xc3,0x02,0x42,0xfd, -0xc2,0xaf,0x20,0x14,0x06,0xf5,0x99,0xd2,0x14,0x80,0x31,0xf5,0xf0,0xe5,0x36,0x24, -0x01,0xf5,0x42,0xe5,0x37,0x34,0x00,0x54,0x0f,0xf5,0x43,0xb5,0x35,0x08,0xe5,0x42, -0xb5,0x34,0x03,0xd3,0x80,0x16,0x74,0x00,0x25,0x36,0xf5,0x82,0x74,0x12,0x35,0x37, -0xf5,0x83,0xe5,0xf0,0xf0,0x85,0x42,0x36,0x85,0x43,0x37,0xc3,0xd2,0xaf,0x22,0xc0, -0xd0,0xc0,0xe0,0xc0,0xf0,0xc0,0x83,0xc0,0x82,0x90,0xff,0xd2,0xe0,0x20,0xe4,0x12, -0x90,0xff,0xe2,0xe0,0x20,0xe0,0x06,0x90,0xff,0xe4,0xe0,0x80,0x63,0x12,0x3d,0x3b, -0x80,0x5e,0x30,0xe7,0x4f,0x90,0xff,0xd0,0xe0,0xf5,0xf0,0xe5,0x3a,0x24,0x01,0xf5, -0x40,0xe5,0x3b,0x34,0x00,0x54,0x0f,0xf5,0x41,0xb5,0x39,0x08,0xe5,0x40,0xb5,0x38, -0x03,0xd3,0x80,0x16,0x74,0x00,0x25,0x3a,0xf5,0x82,0x74,0x22,0x35,0x3b,0xf5,0x83, -0xe5,0xf0,0xf0,0x85,0x40,0x3a,0x85,0x41,0x3b,0xc3,0x50,0x24,0xd2,0x16,0x85,0x3a, -0x38,0x85,0x3b,0x39,0x90,0x42,0x0b,0xe0,0x24,0x01,0xf0,0x90,0x42,0x0a,0xe0,0x34, -0x00,0xf0,0x80,0x0c,0x30,0xe5,0x09,0x90,0xff,0xd1,0xe0,0xf5,0xf0,0x12,0x45,0x50, -0xd0,0x82,0xd0,0x83,0xd0,0xf0,0xd0,0xe0,0xd0,0xd0,0x32,0xc0,0xd0,0xc0,0xe0,0xc0, -0xf0,0xc0,0x83,0xc0,0x82,0x30,0x99,0x35,0xc2,0x99,0xe5,0x35,0xb5,0x37,0x08,0xe5, -0x34,0xb5,0x36,0x03,0xc3,0x80,0x1c,0xe5,0x34,0x24,0x00,0xf5,0x82,0x74,0x12,0x35, -0x35,0xf5,0x83,0xe5,0x34,0x24,0x01,0xf5,0x34,0xe5,0x35,0x34,0x00,0x54,0x0f,0xf5, -0x35,0xe0,0xd3,0x50,0x06,0xf5,0x99,0xd2,0x14,0x80,0x02,0xc2,0x14,0x30,0x98,0x35, -0xe5,0x99,0xc2,0x98,0xf5,0xf0,0xe5,0x32,0x24,0x01,0xf5,0x40,0xe5,0x33,0x34,0x00, -0x54,0x0f,0xf5,0x41,0xb5,0x31,0x08,0xe5,0x40,0xb5,0x30,0x03,0xd3,0x80,0x16,0x74, -0x00,0x25,0x32,0xf5,0x82,0x74,0x02,0x35,0x33,0xf5,0x83,0xe5,0xf0,0xf0,0x85,0x40, -0x32,0x85,0x41,0x33,0xc3,0xd0,0x82,0xd0,0x83,0xd0,0xf0,0xd0,0xe0,0xd0,0xd0,0x32, -0x20,0x15,0x06,0x90,0xff,0xd0,0x74,0xfe,0xf0,0x90,0x42,0x03,0xe0,0xb4,0x00,0x4e, -0x90,0x42,0x02,0xe0,0x70,0x1b,0xe5,0xf0,0xb4,0x3f,0x05,0xd2,0x15,0x02,0x47,0x47, -0xb4,0xff,0x05,0xc2,0x15,0x02,0x47,0x47,0xb4,0xb9,0x05,0xd2,0x16,0x02,0x47,0x47, -0xe0,0x24,0xca,0xf5,0x82,0x74,0x94,0x34,0x00,0xf5,0x83,0xe0,0xc3,0x95,0xf0,0x60, -0x08,0x90,0x42,0x02,0xe4,0xf0,0x02,0x47,0x47,0x90,0x42,0x02,0xe0,0x04,0xf0,0x24, -0xf8,0x70,0x08,0xe4,0xf0,0x90,0x42,0x03,0x74,0x01,0xf0,0x02,0x47,0x47,0xb4,0x01, -0x74,0x90,0x42,0x03,0xe5,0xf0,0xb4,0x00,0x06,0x74,0x02,0xf0,0x02,0x47,0x47,0xb4, -0x01,0x06,0x74,0x03,0xf0,0x02,0x47,0x47,0xb4,0x02,0x06,0x74,0x04,0xf0,0x02,0x47, -0x47,0xb4,0x03,0x1d,0x90,0x42,0x0a,0x74,0x00,0xf0,0xa3,0xf0,0x90,0x42,0x04,0x74, -0x42,0xf0,0xa3,0x74,0x01,0xf0,0x90,0x42,0x06,0xe4,0xf0,0xa3,0x04,0xf0,0x02,0x46, -0xb7,0xb4,0x04,0x15,0x90,0x42,0x04,0x74,0x42,0xf0,0xa3,0x74,0x00,0xf0,0x90,0x42, -0x06,0xe4,0xf0,0xa3,0x04,0xf0,0x02,0x46,0xb7,0xb4,0x05,0x16,0x90,0x42,0x04,0x74, -0x94,0xf0,0xa3,0x74,0xca,0xf0,0x90,0x42,0x06,0xe4,0xf0,0xa3,0x74,0x0a,0xf0,0x02, -0x46,0xb7,0x02,0x47,0x42,0xb4,0x02,0x27,0xc2,0x10,0xc2,0x11,0xc2,0x12,0xc2,0x13, -0xe5,0xf0,0x54,0x0f,0x90,0x42,0x01,0xf0,0x30,0xe0,0x02,0xd2,0x10,0x30,0xe1,0x02, -0xd2,0x11,0x30,0xe2,0x02,0xd2,0x12,0x30,0xe3,0x02,0xd2,0x13,0x02,0x47,0x42,0xb4, -0x03,0x10,0xe5,0xf0,0x70,0x03,0xe4,0x80,0x02,0x74,0x01,0x90,0x42,0x00,0xf0,0x02, -0x47,0x42,0xb4,0x04,0x0f,0xe5,0xf0,0x90,0x42,0x04,0xf0,0x90,0x42,0x03,0x74,0x05, -0xf0,0x02,0x47,0x47,0xb4,0x05,0x0f,0xe5,0xf0,0x90,0x42,0x05,0xf0,0x90,0x42,0x03, -0x74,0x06,0xf0,0x02,0x47,0x47,0xb4,0x06,0x0f,0xe5,0xf0,0x90,0x42,0x06,0xf0,0x90, -0x42,0x03,0x74,0x07,0xf0,0x02,0x47,0x47,0xb4,0x07,0x0f,0xe5,0xf0,0x90,0x42,0x07, -0xf0,0x90,0x42,0x03,0x74,0x08,0xf0,0x02,0x47,0x47,0xb4,0x08,0x07,0xe5,0xf0,0x60, -0x06,0x02,0x47,0x09,0x02,0x47,0x42,0xc0,0x00,0xc0,0x01,0xc0,0x02,0xc0,0x03,0x90, -0x42,0x06,0xe0,0x04,0xf8,0xa3,0xe0,0x04,0xf9,0x90,0x42,0x04,0xe0,0xc0,0xe0,0xa3, -0xe0,0xc0,0xe0,0x02,0x46,0xf6,0x7a,0xc4,0x7b,0x51,0x90,0xff,0xd2,0xe0,0x20,0xe6, -0x07,0xdb,0xfa,0xda,0xf8,0x02,0x46,0xfa,0xd0,0x82,0xd0,0x83,0xe0,0xa3,0xc0,0x83, -0xc0,0x82,0x90,0xff,0xd0,0xf0,0xd9,0xde,0xd8,0xdc,0xd0,0xe0,0xd0,0xe0,0xd0,0x03, -0xd0,0x02,0xd0,0x01,0xd0,0x00,0x02,0x47,0x42,0xc0,0x00,0xc0,0x01,0xc0,0x02,0xc0, -0x03,0x90,0x42,0x07,0xe0,0x04,0xf9,0x90,0x42,0x05,0xe0,0xf8,0x80,0x17,0x7a,0xc4, -0x7b,0x51,0x90,0xff,0xd2,0xe0,0x20,0xe6,0x06,0xdb,0xfa,0xda,0xf8,0x80,0x08,0xe6, -0x08,0x90,0xff,0xd0,0xf0,0xd9,0xe7,0xd0,0x03,0xd0,0x02,0xd0,0x01,0xd0,0x00,0x02, -0x47,0x42,0x90,0x42,0x03,0xe4,0xf0,0x22,0xa5,0x69,0x5a,0x96,0xa4,0x68,0x5b,0x97, -0xa7,0x6b,0x58,0x94,0xa6,0x6a,0x59,0x95,0xa1,0x6d,0x5e,0x92,0xa0,0x6c,0x5f,0x93, -0xa3,0x6f,0x5c,0x90,0xa2,0x6e,0x5d,0x91,0xad,0x61,0x52,0x9e,0xac,0x60,0x53,0x9f, -0xaf,0x63,0x50,0x9c,0xae,0x62,0x51,0x9d,0xa9,0x65,0x56,0x9a,0xa8,0x64,0x57,0x9b, -0xab,0x67,0x54,0x98,0xaa,0x66,0x55,0x99,0xb5,0x79,0x4a,0x86,0xb4,0x78,0x4b,0x87, -0xb7,0x7b,0x48,0x84,0xb6,0x7a,0x49,0x85,0xb1,0x7d,0x4e,0x82,0xb0,0x7c,0x4f,0x83, -0xb3,0x7f,0x4c,0x80,0xb2,0x7e,0x4d,0x81,0xbd,0x71,0x42,0x8e,0xbc,0x70,0x43,0x8f, -0xbf,0x73,0x40,0x8c,0xbe,0x72,0x41,0x8d,0xb9,0x75,0x46,0x8a,0xb8,0x74,0x47,0x8b, -0xbb,0x77,0x44,0x88,0xba,0x76,0x45,0x89,0x85,0x49,0x7a,0xb6,0x84,0x48,0x7b,0xb7, -0x87,0x4b,0x78,0xb4,0x86,0x4a,0x79,0xb5,0x81,0x4d,0x7e,0xb2,0x80,0x4c,0x7f,0xb3, -0x83,0x4f,0x7c,0xb0,0x82,0x4e,0x7d,0xb1,0x8d,0x41,0x72,0xbe,0x8c,0x40,0x73,0xbf, -0x8f,0x43,0x70,0xbc,0x8e,0x42,0x71,0xbd,0x89,0x45,0x76,0xba,0x88,0x44,0x77,0xbb, -0x8b,0x47,0x74,0xb8,0x8a,0x46,0x75,0xb9,0x95,0x59,0x6a,0xa6,0x94,0x58,0x6b,0xa7, -0x97,0x5b,0x68,0xa4,0x96,0x5a,0x69,0xa5,0x91,0x5d,0x6e,0xa2,0x90,0x5c,0x6f,0xa3, -0x93,0x5f,0x6c,0xa0,0x92,0x5e,0x6d,0xa1,0x9d,0x51,0x62,0xae,0x9c,0x50,0x63,0xaf, -0x9f,0x53,0x60,0xac,0x9e,0x52,0x61,0xad,0x99,0x55,0x66,0xaa,0x98,0x54,0x67,0xab, -0x9b,0x57,0x64,0xa8,0x9a,0x56,0x65,0xa9,0xe5,0x29,0x1a,0xd6,0xe4,0x28,0x1b,0xd7, -0xe7,0x2b,0x18,0xd4,0xe6,0x2a,0x19,0xd5,0xe1,0x2d,0x1e,0xd2,0xe0,0x2c,0x1f,0xd3, -0xe3,0x2f,0x1c,0xd0,0xe2,0x2e,0x1d,0xd1,0xed,0x21,0x12,0xde,0xec,0x20,0x13,0xdf, -0xef,0x23,0x10,0xdc,0xee,0x22,0x11,0xdd,0xe9,0x25,0x16,0xda,0xe8,0x24,0x17,0xdb, -0xeb,0x27,0x14,0xd8,0xea,0x26,0x15,0xd9,0xf5,0x39,0x0a,0xc6,0xf4,0x38,0x0b,0xc7, -0xf7,0x3b,0x08,0xc4,0xf6,0x3a,0x09,0xc5,0xf1,0x3d,0x0e,0xc2,0xf0,0x3c,0x0f,0xc3, -0xf3,0x3f,0x0c,0xc0,0xf2,0x3e,0x0d,0xc1,0xfd,0x31,0x02,0xce,0xfc,0x30,0x03,0xcf, -0xff,0x33,0x00,0xcc,0xfe,0x32,0x01,0xcd,0xf9,0x35,0x06,0xca,0xf8,0x34,0x07,0xcb, -0xfb,0x37,0x04,0xc8,0xfa,0x36,0x05,0xc9,0xc5,0x09,0x3a,0xf6,0xc4,0x08,0x3b,0xf7, -0xc7,0x0b,0x38,0xf4,0xc6,0x0a,0x39,0xf5,0xc1,0x0d,0x3e,0xf2,0xc0,0x0c,0x3f,0xf3, -0xc3,0x0f,0x3c,0xf0,0xc2,0x0e,0x3d,0xf1,0xcd,0x01,0x32,0xfe,0xcc,0x00,0x33,0xff, -0xcf,0x03,0x30,0xfc,0xce,0x02,0x31,0xfd,0xc9,0x05,0x36,0xfa,0xc8,0x04,0x37,0xfb, -0xcb,0x07,0x34,0xf8,0xca,0x06,0x35,0xf9,0xd5,0x19,0x2a,0xe6,0xd4,0x18,0x2b,0xe7, -0xd7,0x1b,0x28,0xe4,0xd6,0x1a,0x29,0xe5,0xd1,0x1d,0x2e,0xe2,0xd0,0x1c,0x2f,0xe3, -0xd3,0x1f,0x2c,0xe0,0xd2,0x1e,0x2d,0xe1,0xdd,0x11,0x22,0xee,0xdc,0x10,0x23,0xef, -0xdf,0x13,0x20,0xec,0xde,0x12,0x21,0xed,0xd9,0x15,0x26,0xea,0xd8,0x14,0x27,0xeb, -0xdb,0x17,0x24,0xe8,0xda,0x16,0x25,0xe9,0x25,0xe9,0xda,0x16,0x24,0xe8,0xdb,0x17, -0x27,0xeb,0xd8,0x14,0x26,0xea,0xd9,0x15,0x21,0xed,0xde,0x12,0x20,0xec,0xdf,0x13, -0x23,0xef,0xdc,0x10,0x22,0xee,0xdd,0x11,0x2d,0xe1,0xd2,0x1e,0x2c,0xe0,0xd3,0x1f, -0x2f,0xe3,0xd0,0x1c,0x2e,0xe2,0xd1,0x1d,0x29,0xe5,0xd6,0x1a,0x28,0xe4,0xd7,0x1b, -0x2b,0xe7,0xd4,0x18,0x2a,0xe6,0xd5,0x19,0x35,0xf9,0xca,0x06,0x34,0xf8,0xcb,0x07, -0x37,0xfb,0xc8,0x04,0x36,0xfa,0xc9,0x05,0x31,0xfd,0xce,0x02,0x30,0xfc,0xcf,0x03, -0x33,0xff,0xcc,0x00,0x32,0xfe,0xcd,0x01,0x3d,0xf1,0xc2,0x0e,0x3c,0xf0,0xc3,0x0f, -0x3f,0xf3,0xc0,0x0c,0x3e,0xf2,0xc1,0x0d,0x39,0xf5,0xc6,0x0a,0x38,0xf4,0xc7,0x0b, -0x3b,0xf7,0xc4,0x08,0x3a,0xf6,0xc5,0x09,0x05,0xc9,0xfa,0x36,0x04,0xc8,0xfb,0x37, -0x07,0xcb,0xf8,0x34,0x06,0xca,0xf9,0x35,0x01,0xcd,0xfe,0x32,0x00,0xcc,0xff,0x33, -0x03,0xcf,0xfc,0x30,0x02,0xce,0xfd,0x31,0x0d,0xc1,0xf2,0x3e,0x0c,0xc0,0xf3,0x3f, -0x0f,0xc3,0xf0,0x3c,0x0e,0xc2,0xf1,0x3d,0x09,0xc5,0xf6,0x3a,0x08,0xc4,0xf7,0x3b, -0x0b,0xc7,0xf4,0x38,0x0a,0xc6,0xf5,0x39,0x15,0xd9,0xea,0x26,0x14,0xd8,0xeb,0x27, -0x17,0xdb,0xe8,0x24,0x16,0xda,0xe9,0x25,0x11,0xdd,0xee,0x22,0x10,0xdc,0xef,0x23, -0x13,0xdf,0xec,0x20,0x12,0xde,0xed,0x21,0x1d,0xd1,0xe2,0x2e,0x1c,0xd0,0xe3,0x2f, -0x1f,0xd3,0xe0,0x2c,0x1e,0xd2,0xe1,0x2d,0x19,0xd5,0xe6,0x2a,0x18,0xd4,0xe7,0x2b, -0x1b,0xd7,0xe4,0x28,0x1a,0xd6,0xe5,0x29,0x65,0xa9,0x9a,0x56,0x64,0xa8,0x9b,0x57, -0x67,0xab,0x98,0x54,0x66,0xaa,0x99,0x55,0x61,0xad,0x9e,0x52,0x60,0xac,0x9f,0x53, -0x63,0xaf,0x9c,0x50,0x62,0xae,0x9d,0x51,0x6d,0xa1,0x92,0x5e,0x6c,0xa0,0x93,0x5f, -0x6f,0xa3,0x90,0x5c,0x6e,0xa2,0x91,0x5d,0x69,0xa5,0x96,0x5a,0x68,0xa4,0x97,0x5b, -0x6b,0xa7,0x94,0x58,0x6a,0xa6,0x95,0x59,0x75,0xb9,0x8a,0x46,0x74,0xb8,0x8b,0x47, -0x77,0xbb,0x88,0x44,0x76,0xba,0x89,0x45,0x71,0xbd,0x8e,0x42,0x70,0xbc,0x8f,0x43, -0x73,0xbf,0x8c,0x40,0x72,0xbe,0x8d,0x41,0x7d,0xb1,0x82,0x4e,0x7c,0xb0,0x83,0x4f, -0x7f,0xb3,0x80,0x4c,0x7e,0xb2,0x81,0x4d,0x79,0xb5,0x86,0x4a,0x78,0xb4,0x87,0x4b, -0x7b,0xb7,0x84,0x48,0x7a,0xb6,0x85,0x49,0x45,0x89,0xba,0x76,0x44,0x88,0xbb,0x77, -0x47,0x8b,0xb8,0x74,0x46,0x8a,0xb9,0x75,0x41,0x8d,0xbe,0x72,0x40,0x8c,0xbf,0x73, -0x43,0x8f,0xbc,0x70,0x42,0x8e,0xbd,0x71,0x4d,0x81,0xb2,0x7e,0x4c,0x80,0xb3,0x7f, -0x4f,0x83,0xb0,0x7c,0x4e,0x82,0xb1,0x7d,0x49,0x85,0xb6,0x7a,0x48,0x84,0xb7,0x7b, -0x4b,0x87,0xb4,0x78,0x4a,0x86,0xb5,0x79,0x55,0x99,0xaa,0x66,0x54,0x98,0xab,0x67, -0x57,0x9b,0xa8,0x64,0x56,0x9a,0xa9,0x65,0x51,0x9d,0xae,0x62,0x50,0x9c,0xaf,0x63, -0x53,0x9f,0xac,0x60,0x52,0x9e,0xad,0x61,0x5d,0x91,0xa2,0x6e,0x5c,0x90,0xa3,0x6f, -0x5f,0x93,0xa0,0x6c,0x5e,0x92,0xa1,0x6d,0x59,0x95,0xa6,0x6a,0x58,0x94,0xa7,0x6b, -0x5b,0x97,0xa4,0x68,0x5a,0x96,0xa5,0x69,0x40,0x41,0x3e,0x3f,0x3c,0x3d,0x3a,0x3b, -0x48,0x49,0x46,0x47,0x44,0x45,0x42,0x43,0x30,0x31,0x2e,0x2f,0x2c,0x2d,0x2a,0x2b, -0x38,0x39,0x36,0x37,0x34,0x35,0x32,0x33,0x60,0x61,0x5e,0x5f,0x5c,0x5d,0x5a,0x5b, -0x68,0x69,0x66,0x67,0x64,0x65,0x62,0x63,0x50,0x51,0x4e,0x4f,0x4c,0x4d,0x4a,0x4b, -0x58,0x59,0x56,0x57,0x54,0x55,0x52,0x53,0x80,0x81,0x7e,0x7f,0x7c,0x7d,0x7a,0x7b, -0x88,0x89,0x86,0x87,0x84,0x85,0x82,0x83,0x70,0x71,0x6e,0x6f,0x6c,0x6d,0x6a,0x6b, -0x78,0x79,0x76,0x77,0x74,0x75,0x72,0x73,0xa0,0xa1,0x9e,0x9f,0x9c,0x9d,0x9a,0x9b, -0xa8,0xa9,0xa6,0xa7,0xa4,0xa5,0xa2,0xa3,0x90,0x91,0x8e,0x8f,0x8c,0x8d,0x8a,0x8b, -0x98,0x99,0x96,0x97,0x94,0x95,0x92,0x93,0xc0,0xc1,0xbe,0xbf,0xbc,0xbd,0xba,0xbb, -0xc8,0xc9,0xc6,0xc7,0xc4,0xc5,0xc2,0xc3,0xb0,0xb1,0xae,0xaf,0xac,0xad,0xaa,0xab, -0xb8,0xb9,0xb6,0xb7,0xb4,0xb5,0xb2,0xb3,0xe0,0xe1,0xde,0xdf,0xdc,0xdd,0xda,0xdb, -0xe8,0xe9,0xe6,0xe7,0xe4,0xe5,0xe2,0xe3,0xd0,0xd1,0xce,0xcf,0xcc,0xcd,0xca,0xcb, -0xd8,0xd9,0xd6,0xd7,0xd4,0xd5,0xd2,0xd3,0x00,0x01,0xfe,0xff,0xfc,0xfd,0xfa,0xfb, -0x08,0x09,0x06,0x07,0x04,0x05,0x02,0x03,0xf0,0xf1,0xee,0xef,0xec,0xed,0xea,0xeb, -0xf8,0xf9,0xf6,0xf7,0xf4,0xf5,0xf2,0xf3,0x20,0x21,0x1e,0x1f,0x1c,0x1d,0x1a,0x1b, -0x28,0x29,0x26,0x27,0x24,0x25,0x22,0x23,0x10,0x11,0x0e,0x0f,0x0c,0x0d,0x0a,0x0b, -0x18,0x19,0x16,0x17,0x14,0x15,0x12,0x13,0x75,0x44,0x00,0xd2,0x02,0x22,0x30,0x02, -0x0b,0x90,0x4b,0x48,0x93,0xc2,0x02,0xf5,0x45,0x02,0x4c,0x82,0x75,0xf0,0x00,0xc3, -0x33,0xc5,0xf0,0x33,0xc5,0xf0,0xc3,0x33,0xc5,0xf0,0x33,0xc5,0xf0,0x24,0x48,0xf5, -0x82,0xe5,0xf0,0x34,0x47,0xf5,0x83,0xe5,0x44,0x54,0x03,0x93,0x25,0x45,0xf5,0x45, -0x05,0x44,0x22,0xff,0xc0,0x01,0x30,0x10,0x00,0xcb,0x80,0xba,0x3c,0x3d,0x00,0x00, -0x0b,0x38,0xc9,0x1c,0x0c,0xa0,0x00,0x00,0x00,0x20,0xc4,0x82,0xcf,0x3c,0x42,0x00, -0x00,0x1f,0x00,0x97,0x19,0x09,0xa0,0x00,0x00,0x00,0x28,0xc4,0x86,0xd1,0x3c,0x7f, -0x00,0x00,0x15,0x00,0x61,0x01,0x07,0xa0,0x00,0x00,0x00,0x20,0xc4,0x82,0xd0,0x3c, -0x42,0x00,0x00,0x15,0x00,0xf7,0x19,0x09,0xa0,0x00,0x00,0x00,0x28,0xc4,0x86,0xd0, -0x3c,0x42,0x00,0x00,0x15,0x00,0x81,0x01,0x07,0xa0,0x00,0x00,0x00,0x00,0xc3,0x80, -0xc7,0x3c,0x6f,0x00,0x00,0x15,0x00,0xf0,0x00,0x09,0xa0,0x00,0x00,0x00,0x00,0xd1, -0x82,0xcc,0x3c,0x0a,0x00,0x00,0x29,0x00,0xf0,0x05,0x05,0xa0,0x00,0x00,0x00,0x00, -0xd2,0x82,0xbe,0x3c,0x77,0x00,0x00,0x33,0x00,0xf0,0x00,0x09,0xa0,0x00,0x00,0x00, -0x00,0x11,0x82,0xce,0x3c,0x42,0x00,0x00,0x15,0x00,0xf0,0x16,0x06,0xa0,0x00,0x00, -0x00,0x00,0xd2,0x82,0xca,0x3c,0x74,0x00,0x00,0x29,0x00,0xf0,0x00,0x06,0xa0,0x00, -0x00,0x00,0x00,0x11,0x82,0xcc,0x3c,0x42,0x00,0x00,0x15,0x00,0xf0,0x16,0x06,0xa0, -0x00,0x00,0x00,0x00,0x11,0x82,0xca,0x3c,0x52,0x00,0x00,0x15,0x00,0xf0,0x00,0x06, -0xa0,0x00,0x00,0x00,0x00,0xd2,0x82,0xca,0x3c,0x74,0x00,0x00,0x29,0x00,0xf0,0x00, -0x06,0xa0,0x00,0x00,0x00,0x00,0xd1,0x82,0xca,0x3c,0x0a,0x00,0x00,0x29,0x00,0xf0, -0x05,0x05,0xa0,0x00,0xf0,0x00,0x00,0x0a,0x82,0xca,0x3c,0x73,0x00,0x00,0x29,0x00, -0xf0,0x00,0x09,0xa0,0x00,0x00,0x00,0x00,0xd1,0x82,0xc8,0x3c,0x0a,0x00,0x00,0x23, -0x00,0xf0,0x07,0x07,0xa0,0x00,0xc0,0x00,0x00,0xc8,0x82,0xcb,0x3c,0x52,0x00,0x00, -0x29,0x00,0xf6,0x16,0x06,0xa0,0x00,0x20,0x00,0x00,0x79,0x82,0xbc,0x3c,0x50,0x00, -0x00,0x1f,0x00,0xf5,0x19,0x09,0xa0,0x00,0xd0,0x00,0x00,0xc8,0x82,0xc8,0x3c,0x52, -0x00,0x00,0x29,0x00,0xf6,0x16,0x06,0xa0,0x00,0x20,0x00,0x00,0x7b,0x82,0xbd,0x3c, -0x57,0x00,0x00,0x29,0x00,0xf0,0x00,0x09,0xa0,0x00,0xe0,0x00,0x00,0xc8,0x82,0xc2, -0x3c,0x52,0x00,0x00,0x29,0x00,0xf6,0x16,0x06,0xa0,0x00,0x20,0x00,0x00,0x7a,0x82, -0xc0,0x3c,0x7a,0x00,0x00,0x29,0x00,0xf0,0x00,0x05,0xa0,0x00,0x20,0x00,0x00,0xc7, -0x82,0xc3,0x3c,0x01,0x00,0x00,0x1f,0x00,0xf6,0x17,0x07,0xa0,0x00,0x30,0x00,0x00, -0xc7,0x82,0xc0,0x3c,0x52,0x00,0x00,0x1f,0x00,0xf6,0x17,0x07,0xa0,0x00,0x20,0x00, -0x00,0x31,0x88,0xca,0x3c,0x6b,0x00,0x00,0x15,0x00,0xf0,0x05,0x05,0xa0,0x00,0x40, -0x00,0x00,0xc7,0x82,0xbc,0x3c,0x52,0x00,0x00,0x1f,0x00,0xf6,0x17,0x07,0xa0,0x00, -0xe0,0x00,0x00,0x2e,0x84,0xca,0x3c,0x67,0x00,0x00,0x15,0x00,0xf0,0x05,0x05,0xa0, -0x00,0xe0,0x00,0x00,0x7a,0x84,0xd4,0x3c,0x01,0x00,0x00,0x15,0x00,0xf2,0x15,0x05, -0xa0,0x00,0xd0,0x00,0x00,0x21,0x84,0xc9,0x3c,0x6a,0x00,0x00,0x29,0x00,0xf0,0x05, -0x05,0xa0,0x00,0x10,0x00,0x00,0x25,0x82,0xc4,0x3c,0x6b,0x00,0x00,0x1f,0x00,0xf0, -0x00,0x09,0xa0,0x00,0xf0,0x00,0x00,0x31,0x86,0xc3,0x3c,0x67,0x00,0x00,0x15,0x00, -0xf5,0x16,0x06,0xa0,0x00,0x20,0x00,0x00,0x1d,0x80,0xca,0x3c,0x6b,0x00,0x00,0x1f, -0x00,0xf0,0x00,0x09,0xa0,0x00,0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20, -0x59,0x41,0x4d,0x41,0x48,0x41,0x00,0xe0,0x00,0x00,0x31,0x88,0xc8,0x3c,0x67,0x00, -0x00,0x15,0x00,0xf4,0x16,0x06,0xa0,0x00,0xc0,0x00,0x00,0x9d,0x84,0xc9,0x3c,0x0a, -0x00,0x00,0x1f,0x00,0xf4,0x17,0x07,0xa0,0x00,0xe0,0x00,0x00,0x2e,0x84,0xc8,0x3c, -0x73,0x00,0x00,0x15,0x00,0xf0,0x06,0x06,0xa0,0x00,0x40,0x00,0x00,0x1c,0x82,0xc7, -0x3c,0x61,0x00,0x00,0x15,0x00,0xf0,0x00,0x09,0xa0,0x00,0x40,0x00,0x00,0x1c,0x82, -0xc8,0x3c,0x43,0x00,0x00,0x15,0x00,0xf0,0x00,0x09,0xa0,0x00,0xbd,0x91,0x90,0x87, -0x8e,0x97,0x99,0x98,0xe0,0xa7,0xbf,0xb3,0xbf,0xb8,0xbf,0xf6,0x00,0xd0,0x00,0x00, -0x1e,0x82,0xca,0x3c,0x72,0x00,0x00,0x15,0x00,0xf0,0x00,0x09,0xa0,0x00,0xd0,0x00, -0x00,0x1f,0x82,0xca,0x3c,0x63,0x00,0x00,0x15,0x00,0xf0,0x00,0x09,0xa0,0x00,0xe0, -0x00,0x00,0x1f,0x82,0xcd,0x3c,0x4f,0x00,0x00,0x15,0x00,0xf0,0x00,0x09,0xa0,0x00, -0x20,0x00,0x00,0x9c,0x82,0xc9,0x3c,0x6e,0x00,0x00,0x15,0x00,0xf0,0x00,0x09,0xa0, -0x00,0x20,0x00,0x00,0x9c,0x82,0xcd,0x3c,0x70,0x00,0x00,0x15,0x00,0xf0,0x00,0x09, -0xa0,0x00,0xc0,0x00,0x00,0x0b,0x80,0xc7,0x3c,0x43,0x00,0x00,0x15,0x00,0xf0,0x00, -0x09,0xa0,0x00,0xc0,0x00,0x00,0x0b,0x80,0xcb,0x3c,0x13,0x00,0x00,0x15,0x00,0xf0, -0x00,0x09,0xa0,0x00,0xc0,0x00,0x00,0x2f,0x82,0xc7,0x3c,0x73,0x00,0x00,0x29,0x00, -0xf0,0x00,0x09,0xa0,0x00,0xc0,0x00,0x00,0x30,0x82,0xc8,0x3c,0x79,0x00,0x00,0x29, -0x00,0xf0,0x00,0x09,0xa0,0x00,0x40,0x00,0x08,0x44,0x83,0xc9,0x3c,0x67,0x00,0x00, -0x15,0x00,0xf0,0x00,0x0b,0xa0,0x00,0x40,0x00,0x08,0x44,0x85,0xcc,0x3c,0x4f,0x00, -0x00,0x15,0x00,0xf0,0x00,0x0b,0xa0,0x00,0x30,0x00,0x00,0x24,0x82,0xba,0x3c,0x48, -0x00,0x00,0x1f,0x00,0xf0,0x00,0x09,0xa0,0x00,0x30,0x00,0x08,0x24,0x84,0xcc,0x3c, -0x70,0x00,0x00,0x33,0x00,0xf0,0x00,0x09,0xa0,0x00,0x20,0x00,0x00,0x20,0x80,0xcd, -0x3c,0x61,0x00,0x00,0x1f,0x00,0xf0,0x00,0x09,0xa0,0x00,0x40,0x00,0x00,0x2c,0x80, -0xca,0x3c,0x72,0x00,0x00,0x15,0x00,0xf0,0x00,0x09,0xa0,0x00,0x40,0x00,0x00,0x2c, -0x80,0xd0,0x3c,0x5c,0x00,0x00,0x15,0x00,0xf0,0x00,0x09,0xa0,0x00,0xe0,0x00,0x00, -0x22,0x82,0xcc,0x3c,0x61,0x00,0x00,0x15,0x00,0xf0,0x00,0x09,0xa0,0x00,0xe0,0x00, -0x00,0x23,0x82,0xcc,0x3c,0x73,0x00,0x00,0x15,0x00,0xf0,0x00,0x09,0xa0,0x00,0xc0, -0x00,0x00,0x32,0x80,0xca,0x3c,0x7c,0x00,0x00,0x29,0x00,0xf0,0x08,0x09,0xa0,0x00, -0xc0,0x00,0x00,0x32,0x84,0xca,0x3c,0x61,0x00,0x00,0x29,0x00,0xf0,0x00,0x09,0xa0, -0x00,0xf0,0x00,0x00,0x2f,0x82,0xbe,0x3c,0x6f,0x00,0x00,0x29,0x00,0xf0,0x00,0x09, -0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x46,0xc5,0x46,0xd6,0x46,0xe7,0x46,0xf8,0x47,0x09,0x00,0x00,0x47,0x1a, -0x47,0x2b,0x47,0x3c,0x47,0x4d,0x00,0x00,0x47,0x6f,0x47,0x80,0x47,0x91,0x47,0xa2, -0x47,0xb3,0x47,0xc4,0x47,0xd5,0x47,0xe6,0x47,0xf7,0x48,0x08,0x48,0x19,0x48,0x2a, -0x48,0x3b,0x48,0x4c,0x48,0x5d,0x48,0x6e,0x48,0x7f,0x48,0x90,0x48,0xa1,0x48,0xb2, -0x48,0xc3,0x48,0xd4,0x48,0xf6,0x49,0x07,0x49,0x18,0x49,0x29,0x49,0x3a,0x49,0x5c, -0x49,0x6d,0x49,0x7e,0x49,0x8f,0x49,0xa0,0x49,0xb1,0x49,0xc2,0x49,0xd3,0x49,0xe4, -0x49,0xf5,0x4a,0x06,0x4a,0x17,0x4a,0x28,0x4a,0x39,0x4a,0x4a,0x4a,0x5b,0x4a,0x6c, -0x4a,0x7d,0x4a,0x8e,0x4a,0x9f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d, -0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d, -0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0xff,0x27,0x28,0x29,0x2a,0x2b,0x2a,0x2d, -0x2a,0x2f,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d, -0x3e,0x3f,0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x47,0x49,0x49,0x4b,0x4c,0x4d, -0x4e,0x4e,0x50,0x50,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d, -0x5e,0x5f,0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d, -0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d, -0x7e,0x7f,0x00,0x10,0x00,0x2c,0x81,0x32,0x3c,0x72,0x00,0x00,0x37,0x20,0xf2,0x13, -0x08,0xa0,0x00,0x00,0x10,0x00,0x2d,0x81,0x37,0x3c,0x60,0x00,0x00,0x37,0x20,0xf2, -0x14,0x08,0xa0,0x00,0x00,0x10,0x00,0x2e,0x81,0x3e,0x3c,0x4b,0x00,0x00,0x37,0x20, -0xf2,0x14,0x08,0xa0,0x00,0x00,0x10,0x00,0x2f,0x81,0x43,0x3c,0x6a,0x00,0x00,0x37, -0x20,0xf2,0x14,0x08,0xa0,0x00,0x0a,0x10,0x00,0x30,0x81,0x4b,0x3c,0x64,0x00,0x00, -0x37,0x20,0xf2,0x14,0x08,0xa0,0x00,0x0a,0x10,0x00,0x31,0x81,0x50,0x3c,0x69,0x00, -0x00,0x37,0x20,0xf2,0x14,0x08,0xa0,0x00,0x04,0x10,0x00,0x32,0x81,0x54,0x3c,0x6c, -0x00,0x00,0x37,0x20,0xf2,0x14,0x08,0xa0,0x00,0x03,0x10,0x00,0x33,0x81,0x5c,0x3c, -0x61,0x00,0x00,0x37,0x20,0xf2,0x14,0x18,0xa0,0x00,0x07,0x10,0x00,0x34,0x81,0x61, -0x3c,0x64,0x00,0x00,0x37,0x20,0xf3,0x14,0x18,0xa0,0x00,0x00,0x10,0x00,0x35,0x81, -0x5d,0x3c,0x3b,0x00,0x00,0x37,0x20,0xf4,0x15,0x08,0xa0,0x00,0x00,0x10,0x00,0x2c, -0x81,0x32,0x3c,0x72,0x00,0x00,0x37,0x20,0xf2,0x13,0x08,0xa0,0x01,0x00,0x10,0x00, -0x2d,0x81,0x37,0x3c,0x60,0x00,0x00,0x37,0x20,0xf2,0x14,0x08,0xa0,0x01,0x00,0x10, -0x00,0x2e,0x81,0x3e,0x3c,0x4b,0x00,0x00,0x37,0x20,0xf2,0x14,0x08,0xa0,0x01,0x00, -0x10,0x00,0x2f,0x81,0x43,0x3c,0x6a,0x00,0x00,0x37,0x20,0xf2,0x14,0x08,0xa0,0x01, -0x0a,0x10,0x00,0x30,0x81,0x4b,0x3c,0x64,0x00,0x00,0x37,0x20,0xf2,0x14,0x08,0xa0, -0x01,0x0a,0x10,0x00,0x31,0x81,0x50,0x3c,0x69,0x00,0x00,0x37,0x20,0xf2,0x14,0x08, -0xa0,0x01,0x04,0x10,0x00,0x32,0x81,0x54,0x3c,0x6c,0x00,0x00,0x37,0x20,0xf2,0x14, -0x08,0xa0,0x01,0x07,0x10,0x00,0x33,0x81,0x5c,0x3c,0x61,0x00,0x00,0x37,0x20,0xf2, -0x14,0x18,0xa0,0x01,0x0a,0x10,0x00,0x34,0x81,0x61,0x3c,0x64,0x00,0x00,0x37,0x20, -0xf3,0x14,0x18,0xa0,0x01,0x00,0x10,0x00,0x35,0x81,0x5d,0x3c,0x3b,0x00,0x00,0x37, -0x20,0xf4,0x15,0x08,0xa0,0x01,0x10,0x10,0x00,0x2c,0x81,0x32,0x3c,0x74,0x00,0x00, -0x51,0x20,0xf2,0x13,0x07,0xa0,0x02,0x10,0x10,0x00,0x2d,0x81,0x37,0x3c,0x62,0x00, -0x00,0x51,0x20,0xf2,0x14,0x07,0xa0,0x02,0x10,0x10,0x00,0x2e,0x81,0x3e,0x3c,0x4d, -0x00,0x00,0x51,0x20,0xf2,0x14,0x07,0xa0,0x02,0x10,0x10,0x00,0x2f,0x81,0x43,0x3c, -0x6c,0x00,0x00,0x51,0x20,0xf2,0x14,0x07,0xa0,0x02,0x10,0x10,0x00,0x30,0x81,0x4b, -0x3c,0x66,0x00,0x00,0x51,0x20,0xf2,0x14,0x07,0xa0,0x02,0x10,0x10,0x00,0x31,0x81, -0x50,0x3c,0x6b,0x00,0x00,0x51,0x20,0xf2,0x14,0x07,0xa0,0x02,0x10,0x10,0x00,0x32, -0x81,0x54,0x3c,0x6e,0x00,0x00,0x51,0x20,0xf2,0x14,0x07,0xa0,0x02,0x10,0x10,0x00, -0x33,0x81,0x5c,0x3c,0x63,0x00,0x00,0x51,0x20,0xf2,0x14,0x17,0xa0,0x02,0x10,0x10, -0x00,0x34,0x81,0x61,0x3c,0x66,0x00,0x00,0x51,0x20,0xf3,0x14,0x17,0xa0,0x02,0x10, -0x10,0x00,0x35,0x81,0x5d,0x3c,0x3d,0x00,0x00,0x51,0x20,0xf4,0x15,0x07,0xa0,0x02, -0xf0,0x10,0x00,0x6c,0x80,0x3a,0x2e,0x27,0x00,0x00,0x3d,0x28,0xf4,0x23,0x18,0xa0, -0x03,0x00,0x10,0x00,0x2c,0x81,0x32,0x3c,0x72,0x00,0x00,0x4b,0x20,0xf2,0x13,0x08, -0xa0,0x04,0x00,0x10,0x00,0x2d,0x81,0x37,0x3c,0x60,0x00,0x00,0x4b,0x20,0xf2,0x14, -0x08,0xa0,0x04,0x00,0x10,0x00,0x2e,0x81,0x3e,0x3c,0x4b,0x00,0x00,0x4b,0x20,0xf2, -0x14,0x08,0xa0,0x04,0x00,0x10,0x00,0x2f,0x81,0x43,0x3c,0x6a,0x00,0x00,0x4b,0x20, -0xf2,0x14,0x08,0xa0,0x04,0x0a,0x10,0x00,0x30,0x81,0x4b,0x3c,0x64,0x00,0x00,0x4b, -0x20,0xf2,0x14,0x08,0xa0,0x04,0x0a,0x10,0x00,0x31,0x81,0x50,0x3c,0x69,0x00,0x00, -0x4b,0x20,0xf2,0x14,0x08,0xa0,0x04,0x04,0x10,0x00,0x32,0x81,0x54,0x3c,0x6c,0x00, -0x00,0x4b,0x20,0xf2,0x14,0x08,0xa0,0x04,0x03,0x10,0x00,0x33,0x81,0x5c,0x3c,0x61, -0x00,0x00,0x4b,0x20,0xf2,0x14,0x18,0xa0,0x04,0x07,0x10,0x00,0x34,0x81,0x61,0x3c, -0x64,0x00,0x00,0x4b,0x20,0xf3,0x14,0x18,0xa0,0x04,0x00,0x10,0x00,0x35,0x81,0x5d, -0x3c,0x3b,0x00,0x00,0x4b,0x20,0xf4,0x15,0x08,0xa0,0x04,0x00,0x10,0x00,0x2c,0x81, -0x32,0x3c,0x7e,0x00,0x00,0x4b,0x20,0xf2,0x13,0x08,0xa0,0x04,0x00,0x10,0x00,0x2d, -0x81,0x37,0x3c,0x53,0x00,0x00,0x4b,0x20,0xf2,0x14,0x08,0xa0,0x04,0x00,0x10,0x00, -0x2e,0x81,0x3e,0x3c,0x58,0x00,0x00,0x4b,0x20,0xf2,0x14,0x08,0xa0,0x04,0x00,0x10, -0x00,0x2f,0x81,0x43,0x3c,0x5b,0x00,0x00,0x4b,0x20,0xf2,0x14,0x08,0xa0,0x04,0x0a, -0x10,0x00,0x30,0x81,0x4b,0x3c,0x72,0x00,0x00,0x4b,0x20,0xf2,0x14,0x08,0xa0,0x04, -0x0a,0x10,0x00,0x31,0x81,0x50,0x3c,0x5b,0x00,0x00,0x4b,0x20,0xf2,0x14,0x08,0xa0, -0x04,0x04,0x10,0x00,0x32,0x81,0x54,0x3c,0x79,0x00,0x00,0x4b,0x20,0xf2,0x14,0x08, -0xa0,0x04,0x07,0x10,0x00,0x33,0x81,0x5c,0x3c,0x5a,0x00,0x00,0x4b,0x20,0xf2,0x14, -0x18,0xa0,0x04,0x01,0x10,0x00,0x34,0x81,0x61,0x3c,0x71,0x00,0x00,0x4b,0x20,0xf3, -0x14,0x18,0xa0,0x04,0x00,0x10,0x00,0x35,0x81,0x5d,0x3c,0x2f,0x00,0x00,0x4b,0x20, -0xf4,0x15,0x08,0xa0,0x04,0x00,0x10,0x00,0x0b,0xa0,0x51,0x3c,0x6a,0x00,0x00,0xd7, -0x38,0xf0,0x00,0x0c,0xa0,0x05,0x00,0x12,0x00,0x6c,0x80,0x3a,0x3c,0x27,0x00,0x00, -0x4f,0x22,0xf4,0x23,0x19,0xa0,0x06,0x00,0x10,0x00,0x2c,0x81,0x32,0x3c,0x74,0x00, -0x00,0x5d,0x1b,0xf2,0x13,0x08,0xa0,0x07,0x00,0x10,0x00,0x2d,0x81,0x37,0x3c,0x62, -0x00,0x00,0x5d,0x1b,0xf2,0x14,0x08,0xa0,0x07,0x00,0x10,0x00,0x2e,0x81,0x3e,0x3c, -0x4d,0x00,0x00,0x5d,0x1b,0xf2,0x14,0x08,0xa0,0x07,0x00,0x10,0x00,0x2f,0x81,0x43, -0x3c,0x6c,0x00,0x00,0x5d,0x1b,0xf2,0x14,0x08,0xa0,0x07,0x0a,0x10,0x00,0x30,0x81, -0x4b,0x3c,0x66,0x00,0x00,0x5d,0x1b,0xf2,0x14,0x08,0xa0,0x07,0x0a,0x10,0x00,0x31, -0x81,0x50,0x3c,0x6b,0x00,0x00,0x5d,0x1b,0xf2,0x14,0x08,0xa0,0x07,0x04,0x10,0x00, -0x32,0x81,0x54,0x3c,0x6e,0x00,0x00,0x5d,0x1b,0xf2,0x14,0x08,0xa0,0x07,0x03,0x10, -0x00,0x33,0x81,0x5c,0x3c,0x63,0x00,0x00,0x5d,0x1b,0xf2,0x14,0x18,0xa0,0x07,0x07, -0x10,0x00,0x34,0x81,0x61,0x3c,0x66,0x00,0x00,0x5d,0x1b,0xf3,0x14,0x18,0xa0,0x07, -0x00,0x10,0x00,0x35,0x81,0x5d,0x3c,0x3d,0x00,0x00,0x5d,0x1b,0xf4,0x15,0x08,0xa0, -0x07,0x00,0x10,0x00,0x2c,0x81,0x32,0x68,0x70,0x00,0x00,0x5d,0x18,0xf2,0x13,0x08, -0xa0,0x04,0x00,0x10,0x00,0x2d,0x81,0x37,0x68,0x5e,0x00,0x00,0x5d,0x18,0xf2,0x14, -0x08,0xa0,0x04,0x00,0x10,0x00,0x2e,0x81,0x3e,0x68,0x49,0x00,0x00,0x5d,0x18,0xf2, -0x14,0x08,0xa0,0x04,0x00,0x10,0x00,0x2f,0x81,0x43,0x68,0x68,0x00,0x00,0x5d,0x18, -0xf2,0x14,0x08,0xa0,0x04,0x0a,0x10,0x00,0x30,0x81,0x4b,0x68,0x62,0x00,0x00,0x5d, -0x18,0xf2,0x14,0x08,0xa0,0x04,0x0a,0x10,0x00,0x31,0x81,0x50,0x68,0x67,0x00,0x00, -0x5d,0x18,0xf2,0x14,0x08,0xa0,0x04,0x04,0x10,0x00,0x32,0x81,0x54,0x68,0x6a,0x00, -0x00,0x5d,0x18,0xf2,0x14,0x08,0xa0,0x04,0x07,0x10,0x00,0x33,0x81,0x5c,0x68,0x5f, -0x00,0x00,0x5d,0x18,0xf2,0x14,0x18,0xa0,0x04,0x0a,0x10,0x00,0x34,0x81,0x61,0x68, -0x62,0x00,0x00,0x5d,0x18,0xf3,0x14,0x18,0xa0,0x04,0x00,0x10,0x00,0x35,0x81,0x5d, -0x68,0x39,0x00,0x00,0x5d,0x18,0xf4,0x15,0x08,0xa0,0x04,0x00,0x10,0x00,0x80,0x80, -0x44,0x3c,0x66,0x00,0x00,0x4d,0x20,0xf5,0x24,0x19,0xa0,0x08,0x00,0x10,0x00,0x81, -0x80,0x4a,0x3c,0x78,0x00,0x00,0x4d,0x20,0xf5,0x25,0x09,0xa0,0x08,0x00,0x10,0x00, -0x82,0x80,0x50,0x3c,0x66,0x00,0x00,0x4d,0x20,0xf5,0x25,0x09,0xa0,0x08,0x00,0x10, -0x00,0x83,0x80,0x56,0x3c,0x5b,0x00,0x00,0x4d,0x20,0xf5,0x25,0x19,0xa0,0x08,0x00, -0x10,0x00,0x84,0x80,0x62,0x3c,0x5b,0x00,0x00,0x4d,0x20,0xf5,0x25,0x29,0xa0,0x08, -0x00,0x10,0x00,0x27,0x90,0x51,0x3c,0x51,0x00,0x00,0x2d,0x28,0xf5,0x13,0x2b,0xa0, -0x09,0x00,0x10,0x00,0x28,0x90,0x5d,0x3c,0x67,0x00,0x00,0x2d,0x28,0xf5,0x13,0x3b, -0xa0,0x09,0x00,0x10,0x00,0x2b,0x80,0x52,0x3c,0x03,0x00,0x00,0x23,0x20,0xf4,0x15, -0x07,0xa3,0x0a,0x00,0x10,0x00,0xf3,0x60,0x52,0x3c,0x5d,0x00,0x00,0x3d,0x28,0xf6, -0x25,0x25,0xa0,0x0b,0x00,0x10,0x00,0xf3,0x80,0x52,0x3c,0x62,0x00,0x00,0x49,0x20, -0xa6,0x25,0x25,0xa0,0x0c,0x00,0x10,0x00,0x01,0x81,0x47,0x75,0x65,0x00,0x00,0x55, -0x20,0xd4,0x14,0x16,0xa0,0x0d,0x00,0x10,0x70,0x01,0x81,0x47,0x3c,0x6a,0x00,0x00, -0x3f,0x28,0xf4,0x14,0x16,0xa4,0x0e,0x00,0x10,0x00,0xf4,0x80,0x47,0x3c,0x6a,0x00, -0x00,0x3b,0x38,0xf7,0x47,0x08,0xa0,0x0f,0x00,0x10,0x00,0xf5,0x80,0x53,0x3c,0x51, -0x00,0x00,0x3b,0x38,0xf7,0x47,0x08,0xa0,0x0f,0x00,0x10,0x00,0xf5,0x80,0x53,0x3c, -0x51,0x00,0x00,0x3b,0x38,0xf7,0x48,0x08,0xa0,0x0f,0x00,0x10,0x00,0xf5,0x80,0x53, -0x3c,0x52,0x00,0x00,0x3b,0x38,0xf7,0x48,0x18,0xa0,0x0f,0x00,0x10,0x00,0x36,0x81, -0x5e,0x3c,0x01,0x00,0x00,0x2d,0x38,0xf0,0x06,0x36,0xa0,0x10,0x00,0x10,0x10,0xff, -0x80,0x4d,0x3c,0x5f,0x00,0x00,0x01,0x21,0xf4,0xa3,0x25,0xa1,0x11,0x00,0x14,0x00, -0x3f,0x80,0x4b,0x3c,0x4c,0x00,0x00,0x43,0x29,0xf5,0x16,0x07,0xa0,0x12,0x0e,0x13, -0x00,0x40,0x80,0x4b,0x3c,0x4c,0x00,0x00,0x6b,0x2a,0xf5,0x16,0x07,0xa0,0x13,0x04, -0x12,0x01,0x8e,0x80,0x4a,0x3c,0x6a,0x00,0x00,0x3d,0x3a,0xf0,0x00,0x0a,0xa0,0x14, -0x00,0x13,0x00,0x8c,0x80,0x3d,0x3c,0x6e,0x00,0x00,0x41,0x3b,0xf0,0x00,0x09,0xa0, -0x15,0x00,0x13,0x00,0x8d,0x80,0x55,0x3c,0x68,0x00,0x00,0x41,0x3b,0xf0,0x00,0x09, -0xa0,0x15,0x00,0x10,0x00,0x28,0x81,0x39,0x3c,0x6e,0x00,0x00,0x33,0x39,0xf0,0x00, -0x0a,0xa0,0x16,0x00,0x10,0x00,0x29,0x81,0x45,0x3c,0x70,0x00,0x00,0x33,0x39,0xf0, -0x00,0x0a,0xa0,0x16,0x00,0x10,0x00,0x2a,0x81,0x51,0x3c,0x6a,0x00,0x00,0x33,0x39, -0xf0,0x00,0x0a,0xa0,0x16,0x00,0x10,0x00,0x2b,0x81,0x5d,0x3c,0x65,0x00,0x00,0x33, -0x39,0xf0,0x00,0x0a,0xa0,0x16,0x00,0x10,0x00,0x27,0x71,0x5d,0x3c,0x67,0x00,0x00, -0x33,0x39,0xf0,0x00,0x0a,0xa0,0x16,0x00,0x10,0x00,0x87,0x80,0x32,0x3c,0x6a,0x00, -0x00,0x3b,0x11,0xf0,0x00,0x09,0xa0,0x17,0x00,0x10,0x00,0x88,0x80,0x3a,0x3c,0x78, -0x00,0x00,0x3b,0x11,0xf0,0x00,0x09,0xa0,0x17,0x00,0x10,0x00,0x89,0x80,0x42,0x3c, -0x74,0x00,0x00,0x3b,0x11,0xf0,0x00,0x09,0xa0,0x17,0x00,0x10,0x00,0x8a,0x80,0x4a, -0x3c,0x78,0x00,0x00,0x3b,0x11,0xf0,0x00,0x09,0xa0,0x17,0x00,0x10,0x00,0x8b,0x80, -0x51,0x3c,0x0e,0x00,0x00,0x3b,0x11,0xf0,0x00,0x09,0xa0,0x17,0x06,0x10,0x00,0xac, -0x80,0x40,0x3c,0x02,0x00,0x00,0x3f,0x38,0xf0,0x00,0x09,0xa1,0x18,0x00,0x10,0x00, -0xad,0x80,0x58,0x3c,0x01,0x00,0x00,0x3f,0x38,0xf0,0x00,0x09,0xa1,0x18,0x00,0x10, -0x00,0x06,0x80,0x4b,0x3c,0x65,0x00,0x00,0x5b,0x22,0x90,0x00,0x09,0xa0,0x19,0x00, -0x10,0x00,0x07,0x80,0x60,0x3c,0x3a,0x00,0x00,0x5b,0x22,0x90,0x00,0x09,0xa0,0x19, -0x00,0x10,0x00,0x70,0x80,0x4a,0x63,0x67,0x00,0x00,0x75,0x23,0xa0,0x00,0x09,0xa0, -0x1a,0x00,0x1c,0x00,0x70,0x80,0x4a,0x3c,0x78,0x00,0x00,0x51,0x30,0xa0,0x00,0x09, -0xa2,0x1b,0x00,0x10,0x00,0xac,0x80,0x40,0x3c,0x05,0x00,0x00,0x51,0x38,0xf0,0x00, -0x09,0xa0,0x1c,0x00,0x10,0x00,0xad,0x80,0x58,0x3c,0x04,0x00,0x00,0x51,0x38,0xf0, -0x00,0x09,0xa0,0x1c,0x00,0x10,0x00,0x41,0xa0,0x42,0x6b,0x5f,0x00,0x00,0x95,0x3a, -0x75,0x20,0x0a,0xa0,0x1d,0x05,0x10,0x00,0xb3,0x80,0x36,0x3c,0x74,0x00,0x00,0x35, -0x28,0xf5,0x34,0x09,0xa0,0x1e,0x0c,0x10,0x00,0xb7,0x80,0x41,0x3c,0x7f,0x00,0x00, -0x35,0x28,0xf5,0x34,0x09,0xa0,0x1e,0x00,0x10,0x00,0xb5,0x80,0x48,0x3c,0x6d,0x00, -0x00,0x35,0x28,0xf6,0x34,0x09,0xa0,0x1e,0x00,0x10,0x00,0xb4,0x80,0x4e,0x3c,0x74, -0x00,0x00,0x35,0x28,0xf6,0x35,0x09,0xa0,0x1e,0x00,0x10,0x00,0xb6,0x80,0x57,0x3c, -0x63,0x00,0x00,0x35,0x28,0xf6,0x35,0x19,0xa0,0x1e,0x00,0x13,0x00,0x0c,0x80,0x36, -0x3c,0x59,0x00,0x00,0x43,0x28,0xf0,0x04,0x19,0xa0,0x1f,0x00,0x13,0x00,0x0d,0x80, -0x42,0x3c,0x62,0x00,0x00,0x43,0x28,0xf0,0x05,0x09,0xa0,0x1f,0x00,0x13,0x00,0x0e, -0x80,0x4a,0x3c,0x5b,0x00,0x00,0x43,0x28,0xf5,0x94,0x09,0xa0,0x1f,0x00,0x13,0x00, -0x0f,0x80,0x56,0x3c,0x5b,0x00,0x00,0x43,0x28,0xf6,0x95,0x09,0xa0,0x1f,0x00,0x10, -0x00,0x5a,0x80,0x37,0x3c,0x70,0x00,0x00,0x35,0x28,0xf6,0x34,0x09,0xa0,0x20,0x00, -0x10,0x00,0x5b,0x80,0x46,0x3c,0x61,0x00,0x00,0x35,0x28,0xf6,0x34,0x09,0xa0,0x20, -0x00,0x10,0x00,0x5c,0x80,0x53,0x3c,0x52,0x00,0x00,0x35,0x28,0xf6,0x34,0x09,0xa0, -0x20,0x00,0x15,0x20,0x61,0x80,0x35,0x3c,0x4d,0x00,0x00,0x4b,0x29,0xf5,0x54,0x0a, -0xa0,0x21,0x00,0x15,0x20,0x60,0x80,0x3a,0x3c,0x62,0x00,0x00,0x4b,0x29,0xf5,0x54, -0x0a,0xa0,0x21,0x00,0x15,0x20,0x63,0x80,0x3f,0x3c,0x44,0x00,0x00,0x41,0x29,0xf5, -0x55,0x0a,0xa0,0x21,0x00,0x15,0x20,0x62,0x80,0x48,0x3c,0x53,0x00,0x00,0x4b,0x29, -0xf5,0x55,0x0a,0xa0,0x21,0x00,0x15,0x20,0x65,0x80,0x4d,0x3c,0x3b,0x00,0x00,0x4b, -0x29,0xf5,0x55,0x1a,0xa0,0x21,0x00,0x15,0x20,0x64,0x80,0x52,0x3c,0x31,0x00,0x00, -0x4b,0x29,0xf5,0x55,0x1a,0xa0,0x21,0x00,0x15,0x20,0x66,0x80,0x59,0x3c,0x5e,0x00, -0x00,0x4b,0x29,0xf5,0x55,0x2a,0xa0,0x21,0x00,0x15,0x20,0x67,0x80,0x62,0x3c,0x5b, -0x00,0x00,0x4b,0x29,0xf6,0x56,0x0a,0xa0,0x21,0x00,0x10,0x00,0x68,0x80,0x4a,0x3c, -0x78,0x00,0x00,0x33,0x28,0xf6,0x15,0x09,0xa0,0x22,0x00,0x13,0x00,0xa5,0x80,0x39, -0x3c,0x7d,0x00,0x00,0x3f,0x29,0xf2,0x11,0x09,0xa0,0x23,0x00,0x13,0x00,0xa6,0x80, -0x42,0x3c,0x74,0x00,0x00,0x3f,0x29,0xf2,0x11,0x09,0xa0,0x23,0x00,0x12,0x00,0x51, -0x80,0x36,0x3c,0x50,0x00,0x00,0x43,0x21,0xa2,0x12,0x0a,0xa0,0x24,0x00,0x12,0x00, -0x52,0x80,0x3a,0x3c,0x61,0x00,0x00,0x43,0x21,0xa2,0x12,0x0a,0xa0,0x24,0x00,0x12, -0x00,0x53,0x80,0x3e,0x3c,0x78,0x00,0x00,0x43,0x21,0xa2,0x12,0x0a,0xa0,0x24,0x00, -0x12,0x00,0x54,0x80,0x42,0x3c,0x4f,0x00,0x00,0x43,0x21,0xa2,0x12,0x0a,0xa0,0x24, -0x00,0x12,0x00,0x55,0x80,0x46,0x3c,0x61,0x00,0x00,0x43,0x21,0xa2,0x12,0x0a,0xa0, -0x24,0x00,0x12,0x00,0x56,0x80,0x4a,0x3c,0x78,0x00,0x00,0x43,0x21,0xa2,0x12,0x0a, -0xa0,0x24,0x00,0x12,0x00,0x57,0x80,0x4e,0x3c,0x74,0x00,0x00,0x43,0x21,0xa2,0x12, -0x0a,0xa0,0x24,0x00,0x12,0x00,0x58,0x80,0x52,0x3c,0x61,0x00,0x00,0x43,0x21,0xa2, -0x12,0x0a,0xa0,0x24,0x00,0x12,0x00,0x59,0x80,0x56,0x3c,0x20,0x00,0x00,0x43,0x21, -0xa2,0x12,0x0a,0xa0,0x24,0x00,0x10,0x00,0x5e,0x90,0x4d,0x3c,0x3b,0x00,0x00,0x31, -0x28,0xf4,0x24,0x09,0xa0,0x25,0x00,0x10,0x00,0x5d,0x90,0x52,0x3c,0x32,0x00,0x00, -0x1d,0x28,0xf4,0x24,0x09,0xa0,0x25,0x00,0x10,0x00,0x5f,0x90,0x57,0x3c,0x63,0x00, -0x00,0x31,0x28,0xf4,0x24,0x09,0xa0,0x25,0x00,0x10,0x00,0x04,0x80,0x2d,0x3c,0x35, -0x00,0x00,0x1d,0x18,0xf5,0x15,0x09,0xa0,0x26,0x00,0x10,0x00,0x05,0x80,0x47,0x3c, -0x52,0x00,0x00,0x1d,0x18,0xf5,0x15,0x09,0xa0,0x26,0x00,0x10,0x00,0x4a,0x80,0x28, -0x3c,0x7a,0x00,0x00,0x21,0x18,0xf6,0x14,0x09,0xa0,0x27,0x00,0x10,0x00,0x4b,0x80, -0x2d,0x3c,0x72,0x00,0x00,0x21,0x18,0xf6,0x14,0x09,0xa0,0x27,0x00,0x10,0x00,0x4c, -0x80,0x32,0x3c,0x73,0x00,0x00,0x21,0x18,0xf6,0x14,0x09,0xa0,0x27,0x00,0x10,0x00, -0x4d,0x80,0x37,0x3c,0x79,0x00,0x00,0x21,0x18,0xf6,0x14,0x09,0xa0,0x27,0x00,0x12, -0x00,0x4f,0x90,0x3a,0x3c,0x52,0x00,0x00,0x33,0x18,0xf3,0x90,0x0a,0xa0,0x28,0x05, -0x12,0x00,0x50,0x90,0x3f,0x3c,0x56,0x00,0x00,0x33,0x18,0xf3,0x90,0x1a,0xa0,0x28, -0x00,0x12,0x00,0x6b,0x90,0x44,0x3c,0x3e,0x00,0x00,0x33,0x18,0xf3,0x90,0x2a,0xa0, -0x28,0x00,0x12,0x00,0x69,0x90,0x49,0x3c,0x4f,0x00,0x00,0x33,0x18,0xf5,0xb0,0x0a, -0xa0,0x28,0x00,0x12,0x00,0x6a,0x90,0x4e,0x3c,0x51,0x00,0x00,0x33,0x18,0xf5,0xb0, -0x0a,0xa0,0x28,0x00,0x10,0x00,0x4e,0x80,0x43,0x3c,0x71,0x00,0x00,0x2d,0x10,0xf3, -0x63,0x19,0xa0,0x29,0x00,0x12,0x00,0xa3,0x90,0x3d,0x3c,0x76,0x00,0x00,0x21,0x19, -0xf5,0x32,0x1a,0xa0,0x2a,0x00,0x10,0x00,0xa2,0x90,0x44,0x3c,0x66,0x00,0x00,0x25, -0x20,0xb0,0x03,0x09,0xa0,0x2b,0x00,0x12,0x00,0xbe,0x90,0x3e,0x3c,0x6a,0x00,0x00, -0x47,0x39,0xf4,0x14,0x09,0xa0,0x2c,0x00,0x12,0x00,0x17,0x81,0x2d,0x3c,0x67,0x00, -0x00,0x35,0x39,0xf3,0x50,0x08,0xa0,0x2d,0x00,0x13,0x00,0x05,0x81,0x44,0x3c,0x66, -0x00,0x00,0x33,0x3b,0xf3,0x20,0x09,0xa0,0x2e,0x00,0x13,0x00,0x02,0x81,0x47,0x3c, -0x52,0x00,0x00,0x33,0x3b,0xf3,0x20,0x09,0xa0,0x2e,0x00,0x13,0x00,0x06,0x81,0x4c, -0x3c,0x64,0x00,0x00,0x33,0x3b,0xf3,0x20,0x09,0xa0,0x2e,0x00,0x13,0x00,0x07,0x81, -0x4c,0x3c,0x01,0x00,0x00,0x33,0x3b,0xf3,0x20,0x09,0xa0,0x2e,0x00,0x13,0x00,0x08, -0x81,0x50,0x3c,0x3c,0x00,0x00,0x33,0x3b,0xf3,0x20,0x09,0xa0,0x2e,0x00,0x13,0x00, -0x0a,0x81,0x55,0x3c,0x4d,0x00,0x00,0x33,0x3b,0xf3,0x20,0x09,0xa0,0x2e,0x00,0x13, -0x00,0x0b,0x81,0x57,0x3c,0x64,0x00,0x00,0x33,0x3b,0xf3,0x20,0x09,0xa0,0x2e,0x00, -0x13,0x00,0x0c,0x81,0x58,0x3c,0x22,0x00,0x00,0x33,0x3b,0xf3,0x20,0x09,0xa0,0x2e, -0x00,0x13,0x00,0x0d,0x81,0x5b,0x3c,0x36,0x00,0x00,0x33,0x3b,0xf3,0x20,0x09,0xa0, -0x2e,0x00,0x13,0x00,0x09,0x81,0x5e,0x3c,0x61,0x00,0x00,0x33,0x3b,0xf3,0x20,0x09, -0xa0,0x2e,0x00,0x12,0x00,0x03,0x81,0x3f,0x3c,0x54,0x00,0x00,0x3b,0x3b,0xa3,0x20, -0x09,0xa0,0x2f,0x00,0x12,0x00,0x04,0x81,0x41,0x3c,0x5e,0x00,0x00,0x3b,0x3b,0xa3, -0x20,0x09,0xa0,0x2f,0x00,0x12,0x00,0x05,0x81,0x44,0x3c,0x66,0x00,0x00,0x3b,0x3b, -0xa3,0x20,0x09,0xa0,0x2f,0x00,0x12,0x00,0x02,0x81,0x47,0x3c,0x52,0x00,0x00,0x35, -0x3b,0xa3,0x20,0x09,0xa0,0x2f,0x00,0x12,0x00,0x06,0x81,0x4c,0x3c,0x64,0x00,0x00, -0x3b,0x3b,0xa3,0x20,0x09,0xa0,0x2f,0x00,0x12,0x00,0x07,0x81,0x4c,0x3c,0x01,0x00, -0x00,0x3b,0x3b,0xa3,0x20,0x09,0xa0,0x2f,0x00,0x12,0x00,0x08,0x81,0x50,0x3c,0x3c, -0x00,0x00,0x2f,0x3b,0xa3,0x20,0x09,0xa0,0x2f,0x00,0x12,0x00,0x0a,0x81,0x55,0x3c, -0x4d,0x00,0x00,0x35,0x3b,0xa3,0x20,0x09,0xa0,0x2f,0x00,0x12,0x00,0x0b,0x81,0x57, -0x3c,0x64,0x00,0x00,0x2f,0x3b,0xa3,0x20,0x09,0xa0,0x2f,0x00,0x12,0x00,0x0c,0x81, -0x58,0x3c,0x22,0x00,0x00,0x35,0x3b,0xa3,0x20,0x09,0xa0,0x2f,0x00,0x12,0x00,0x0d, -0x81,0x5b,0x3c,0x36,0x00,0x00,0x2f,0x3b,0xa3,0x20,0x09,0xa0,0x2f,0x00,0x12,0x00, -0x09,0x81,0x5e,0x3c,0x61,0x00,0x00,0x2f,0x3b,0xa3,0x20,0x09,0xa0,0x2f,0x00,0x13, -0x00,0x12,0x91,0x45,0x3c,0x51,0x00,0x00,0x3f,0x33,0xa0,0x00,0x08,0xa0,0x30,0x00, -0x13,0x00,0x13,0x91,0x4b,0x3c,0x44,0x00,0x00,0x3f,0x33,0xa0,0x00,0x08,0xa0,0x30, -0x00,0x13,0x00,0x15,0x91,0x56,0x3c,0x5a,0x00,0x00,0x3f,0x33,0xa0,0x00,0x18,0xa0, -0x30,0x00,0x13,0x00,0x16,0x91,0x59,0x3c,0x5e,0x00,0x00,0x3f,0x33,0xa0,0x00,0x18, -0xa0,0x30,0x00,0x13,0x00,0x14,0x91,0x5f,0x3c,0x52,0x00,0x00,0x3f,0x33,0xa0,0x00, -0x18,0xa0,0x30,0x00,0x13,0x00,0x10,0x81,0x30,0x3c,0x61,0x00,0x00,0x3d,0x19,0x90, -0x00,0x09,0xa0,0x31,0x00,0x13,0x00,0x11,0x81,0x3c,0x3c,0x52,0x00,0x00,0x3d,0x19, -0x90,0x00,0x09,0xa0,0x31,0x0a,0x12,0x00,0xb0,0x80,0x46,0x3c,0x0a,0x00,0x00,0x21, -0x38,0xf0,0x00,0x07,0xa6,0x32,0x05,0x12,0x00,0x35,0x80,0x4c,0x3c,0x03,0x00,0x00, -0x21,0x38,0xf0,0x00,0x07,0xa6,0x32,0x05,0x12,0x00,0x33,0x80,0x54,0x3c,0x79,0x00, -0x00,0x21,0x38,0xf0,0x00,0x07,0xa6,0x32,0x05,0x12,0x00,0x34,0x80,0x57,0x3c,0x01, -0x00,0x00,0x21,0x38,0xf0,0x00,0x07,0xa6,0x32,0x00,0x12,0x00,0xaf,0x80,0x65,0x3c, -0x68,0x00,0x00,0x21,0x38,0xf0,0x00,0x07,0xa6,0x32,0x00,0x10,0x00,0xb8,0x80,0x3c, -0x3c,0x6a,0x00,0x00,0x43,0x28,0xf0,0x00,0x05,0xa0,0x33,0x00,0x10,0x00,0xb9,0x80, -0x45,0x3c,0x67,0x00,0x00,0x43,0x28,0xf0,0x00,0x05,0xa0,0x33,0x00,0x10,0x00,0xbb, -0x80,0x4c,0x3c,0x72,0x00,0x00,0x43,0x28,0xf0,0x00,0x05,0xa0,0x33,0x00,0x10,0x00, -0xba,0x80,0x53,0x3c,0x6d,0x00,0x00,0x3d,0x28,0xf0,0x00,0x05,0xa0,0x33,0x00,0x10, -0x00,0xbc,0x80,0x5a,0x3c,0x70,0x00,0x00,0x43,0x28,0xf0,0x00,0x05,0xa0,0x33,0x00, -0x10,0x00,0x7e,0x80,0x4f,0x3c,0x5c,0x00,0x00,0x2d,0x29,0xf5,0x25,0x07,0xa0,0x34, -0x00,0x10,0x00,0x7f,0x80,0x5a,0x3c,0x4f,0x00,0x00,0x2d,0x29,0xf5,0x25,0x07,0xa0, -0x34,0x00,0x10,0x70,0x00,0x81,0x39,0x3c,0x6a,0x00,0x00,0x15,0x28,0xf0,0x05,0x16, -0xa0,0x35,0x00,0x10,0x00,0x3c,0x81,0x46,0x3c,0x06,0x00,0x00,0x37,0x20,0x80,0x00, -0x07,0xa0,0x36,0x00,0x10,0x00,0x3e,0x81,0x4c,0x3c,0x03,0x00,0x00,0x37,0x20,0x80, -0x00,0x07,0xa0,0x36,0x00,0x10,0x00,0x3d,0x81,0x54,0x3c,0x72,0x00,0x00,0x37,0x20, -0x80,0x00,0x07,0xa0,0x36,0x00,0x10,0x00,0x3f,0x81,0x57,0x3c,0x05,0x00,0x00,0x41, -0x20,0x80,0x00,0x07,0xa0,0x36,0x00,0x10,0x00,0x40,0x81,0x65,0x3c,0x76,0x00,0x00, -0x41,0x20,0x80,0x00,0x07,0xa0,0x36,0x0a,0x10,0x00,0xb0,0x80,0x46,0x3c,0x0a,0x00, -0x00,0x41,0x19,0xf0,0x00,0x07,0xa0,0x37,0x05,0x10,0x00,0x35,0x80,0x4c,0x3c,0x03, -0x00,0x00,0x41,0x19,0xf0,0x00,0x07,0xa0,0x37,0x05,0x10,0x00,0x33,0x80,0x54,0x3c, -0x79,0x00,0x00,0x41,0x19,0xf0,0x00,0x07,0xa0,0x37,0x05,0x10,0x00,0x34,0x80,0x57, -0x3c,0x01,0x00,0x00,0x41,0x19,0xf0,0x00,0x07,0xa0,0x37,0x00,0x10,0x00,0xaf,0x80, -0x65,0x3c,0x68,0x00,0x00,0x41,0x19,0xf0,0x00,0x07,0xa0,0x37,0xe0,0x10,0x00,0x02, -0x90,0x49,0x3c,0x5d,0x00,0x00,0x59,0x20,0x93,0x22,0x06,0xa0,0x38,0x20,0x10,0x00, -0xae,0x70,0x47,0x3a,0x7d,0x00,0x00,0x39,0x20,0x70,0x01,0x06,0xa0,0x39,0x50,0x10, -0x00,0x02,0x90,0x55,0x3c,0x61,0x00,0x00,0x4b,0x19,0x70,0x00,0x06,0xa0,0x3a,0xb0, -0x10,0x00,0x02,0x90,0x55,0x79,0x55,0x00,0x00,0x4b,0x19,0x70,0x00,0x06,0xa0,0x3b, -0x00,0x10,0x00,0x18,0x80,0x45,0x3c,0x52,0x00,0x00,0x3d,0x1a,0x70,0x00,0x08,0xa0, -0x3c,0x00,0x10,0x00,0x19,0x80,0x4a,0x3c,0x52,0x00,0x00,0x3d,0x1a,0x70,0x00,0x08, -0xa0,0x3c,0x00,0x10,0x00,0x1a,0x80,0x51,0x3c,0x56,0x00,0x00,0x3d,0x1a,0x70,0x00, -0x08,0xa0,0x3c,0x00,0x10,0x00,0x1b,0x80,0x5b,0x3c,0x55,0x00,0x00,0x3d,0x1a,0x70, -0x00,0x08,0xa0,0x3c,0x00,0x10,0x00,0x29,0x80,0x50,0x3c,0x4c,0x00,0x00,0x19,0x20, -0xf7,0x20,0x08,0xa0,0x3d,0x00,0x10,0x00,0x2a,0x80,0x51,0x3c,0x5a,0x00,0x00,0x3d, -0x19,0x85,0x21,0x07,0xa0,0x3e,0x00,0x10,0x00,0x49,0x70,0x3e,0x3c,0x6a,0x00,0x00, -0x01,0x30,0x80,0x05,0x05,0xa0,0x3f,0x00,0x12,0x00,0xf6,0x80,0x47,0x3c,0x22,0x00, -0x00,0x29,0x32,0xf3,0x20,0x0a,0xa0,0x40,0x00,0x12,0x00,0xf8,0x80,0x4e,0x3c,0x76, -0x00,0x00,0x29,0x32,0xf3,0x20,0x0a,0xa0,0x40,0x00,0x12,0x00,0xf7,0x80,0x54,0x3c, -0x6e,0x00,0x00,0x29,0x32,0xf3,0x20,0x0a,0xa0,0x40,0x00,0x12,0x00,0xfa,0x80,0x5a, -0x3c,0x52,0x00,0x00,0x29,0x32,0xf3,0x20,0x0a,0xa0,0x40,0x00,0x12,0x00,0xf9,0x80, -0x5f,0x3c,0x22,0x00,0x00,0x29,0x32,0xf3,0x20,0x0a,0xa0,0x40,0x00,0x12,0x00,0xfb, -0x80,0x66,0x3c,0x52,0x00,0x00,0x29,0x32,0xf3,0x20,0x0a,0xa0,0x40,0x00,0x13,0x00, -0xf0,0x80,0x45,0x3c,0x7d,0x00,0x00,0x29,0x21,0xf0,0x00,0x09,0xa0,0x41,0x00,0x13, -0x00,0xf1,0x80,0x4a,0x3c,0x02,0x00,0x00,0x29,0x21,0xf0,0x00,0x09,0xa0,0x41,0x00, -0x13,0x00,0xf2,0x80,0x50,0x3c,0x3c,0x00,0x00,0x29,0x21,0xf0,0x00,0x09,0xa0,0x41, -0x00,0x13,0x00,0x85,0x80,0x35,0x3c,0x78,0x00,0x00,0x21,0x21,0xf5,0x10,0x09,0xa0, -0x42,0x00,0x13,0x00,0x86,0x80,0x3d,0x3c,0x3e,0x00,0x00,0x21,0x21,0xf5,0x10,0x09, -0xa0,0x42,0x00,0x15,0x00,0xb1,0x80,0x4c,0x3c,0x67,0x00,0x00,0x33,0x28,0xf3,0xf0, -0x0a,0xa1,0x43,0x00,0x15,0x00,0xb2,0x80,0x58,0x3c,0x67,0x00,0x00,0x33,0x28,0x83, -0xf0,0x0a,0xa1,0x43,0x00,0x13,0x00,0x7c,0x80,0x50,0x3c,0x68,0x00,0x00,0x2f,0x1a, -0xf0,0x00,0x09,0xa0,0x44,0x00,0x13,0x00,0x7d,0x80,0x57,0x3c,0x28,0x00,0x00,0x2f, -0x1a,0xf0,0x00,0x09,0xa0,0x44,0x00,0x1a,0x00,0xfc,0x80,0x4a,0x3c,0x57,0x00,0x00, -0x29,0x28,0xf0,0x00,0x0a,0xa0,0x45,0x00,0x1a,0x00,0xfd,0x80,0x56,0x3c,0x66,0x00, -0x00,0x29,0x28,0xf0,0x00,0x0a,0xa0,0x45,0xf0,0x14,0x00,0xd3,0x80,0x25,0x3c,0x49, -0xfc,0x04,0x41,0x18,0xa5,0x11,0x08,0xa0,0x46,0xf0,0x14,0x00,0xda,0x80,0x2b,0x3c, -0x52,0xfc,0x04,0x41,0x18,0xa5,0x11,0x08,0xa0,0x46,0xf0,0x14,0x00,0xd4,0x80,0x31, -0x3c,0x49,0xfc,0x04,0x41,0x18,0xa5,0x11,0x08,0xa0,0x46,0xf0,0x14,0x00,0xdb,0x80, -0x37,0x3c,0x44,0xfc,0x04,0x41,0x18,0xa5,0x11,0x08,0xa0,0x46,0xf0,0x14,0x00,0xd5, -0x80,0x3d,0x3c,0x5d,0xfc,0x04,0x41,0x18,0xa5,0x11,0x08,0xa0,0x46,0xf0,0x14,0x00, -0xdc,0x80,0x43,0x3c,0x4c,0xfc,0x04,0x41,0x18,0xa5,0x11,0x08,0xa0,0x46,0xf0,0x14, -0x00,0xd6,0x80,0x49,0x3c,0x50,0xfc,0x04,0x41,0x18,0xa5,0x11,0x08,0xa0,0x46,0xf0, -0x14,0x00,0xdd,0x80,0x4f,0x3c,0x60,0xfc,0x04,0x41,0x18,0xa5,0x11,0x08,0xa0,0x46, -0xf0,0x14,0x00,0xd7,0x80,0x54,0x3c,0x07,0xfc,0x04,0x41,0x18,0xa5,0x11,0x08,0xa0, -0x46,0xf0,0x14,0x00,0xde,0x80,0x5b,0x3c,0x3a,0xfc,0x04,0x41,0x18,0xa5,0x11,0x08, -0xa0,0x46,0xf0,0x14,0x00,0xd8,0x80,0x61,0x3c,0x50,0xfc,0x04,0x41,0x18,0xa5,0x11, -0x08,0xa0,0x46,0xf0,0x14,0x00,0xd9,0x80,0x6d,0x3c,0x50,0xfc,0x04,0x41,0x18,0xa5, -0x11,0x08,0xa0,0x46,0x10,0x12,0x00,0x18,0x81,0x25,0x79,0x57,0xfc,0x04,0x41,0x19, -0x85,0x23,0x08,0xa0,0x47,0x10,0x12,0x00,0x19,0x81,0x2b,0x79,0x5c,0xfc,0x04,0x41, -0x19,0x85,0x23,0x08,0xa0,0x47,0x10,0x12,0x00,0x1a,0x81,0x31,0x79,0x55,0xfc,0x04, -0x41,0x19,0x85,0x23,0x08,0xa0,0x47,0x10,0x12,0x00,0x1b,0x81,0x37,0x79,0x5c,0xfc, -0x04,0x41,0x19,0x85,0x23,0x08,0xa0,0x47,0x10,0x12,0x00,0x1c,0x81,0x3d,0x79,0x62, -0xfc,0x04,0x41,0x19,0x85,0x23,0x08,0xa0,0x47,0x10,0x12,0x00,0x1d,0x81,0x43,0x79, -0x65,0xfc,0x04,0x41,0x19,0x85,0x23,0x08,0xa0,0x47,0x10,0x12,0x00,0x1e,0x81,0x49, -0x79,0x70,0xfc,0x04,0x41,0x19,0x85,0x23,0x08,0xa0,0x47,0x10,0x12,0x00,0x1f,0x81, -0x4f,0x79,0x65,0xfc,0x04,0x41,0x19,0x85,0x23,0x08,0xa0,0x47,0x10,0x12,0x00,0x20, -0x81,0x54,0x79,0x0c,0xfc,0x04,0x41,0x19,0x85,0x23,0x08,0xa0,0x47,0x10,0x12,0x00, -0x21,0x81,0x5b,0x79,0x3e,0xfc,0x04,0x41,0x19,0x85,0x23,0x08,0xa0,0x47,0x10,0x12, -0x00,0x22,0x81,0x61,0x79,0x55,0xfc,0x04,0x41,0x19,0x85,0x23,0x08,0xa0,0x47,0x10, -0x12,0x00,0x23,0x81,0x6d,0x79,0x55,0xfc,0x04,0x41,0x19,0x85,0x23,0x08,0xa0,0x47, -0x30,0x10,0x00,0x18,0x81,0x25,0x3c,0x59,0x00,0x00,0x51,0x26,0x85,0x23,0x08,0xa0, -0x48,0x30,0x10,0x00,0x19,0x81,0x2b,0x3c,0x5e,0x00,0x00,0x51,0x26,0x85,0x23,0x08, -0xa0,0x48,0x30,0x10,0x00,0x1a,0x81,0x31,0x3c,0x57,0x00,0x00,0x51,0x26,0x85,0x23, -0x08,0xa0,0x48,0x30,0x10,0x00,0x1b,0x81,0x37,0x3c,0x5e,0x00,0x00,0x51,0x26,0x85, -0x23,0x08,0xa0,0x48,0x30,0x10,0x00,0x1c,0x81,0x3d,0x3c,0x64,0x00,0x00,0x51,0x26, -0x85,0x23,0x08,0xa0,0x48,0x30,0x10,0x00,0x1d,0x81,0x43,0x3c,0x67,0x00,0x00,0x51, -0x26,0x85,0x23,0x08,0xa0,0x48,0x30,0x10,0x00,0x1e,0x81,0x49,0x3c,0x72,0x00,0x00, -0x51,0x26,0x85,0x23,0x08,0xa0,0x48,0x30,0x10,0x00,0x1f,0x81,0x4f,0x3c,0x67,0x00, -0x00,0x51,0x26,0x85,0x23,0x08,0xa0,0x48,0x30,0x10,0x00,0x20,0x81,0x54,0x3c,0x0e, -0x00,0x00,0x51,0x26,0x85,0x23,0x08,0xa0,0x48,0x30,0x10,0x00,0x21,0x81,0x5b,0x3c, -0x40,0x00,0x00,0x51,0x26,0x85,0x23,0x08,0xa0,0x48,0x30,0x10,0x00,0x22,0x81,0x61, -0x3c,0x57,0x00,0x00,0x51,0x26,0x85,0x23,0x08,0xa0,0x48,0x30,0x10,0x00,0x23,0x81, -0x6d,0x3c,0x57,0x00,0x00,0x51,0x26,0x85,0x23,0x08,0xa0,0x48,0xd0,0x10,0x00,0x24, -0x71,0x40,0x79,0x02,0x00,0x00,0x15,0x22,0x85,0x23,0x08,0xa0,0x49,0x00,0x12,0x00, -0xe3,0x80,0x4b,0x3c,0x44,0x00,0x00,0x37,0x21,0xf5,0x20,0x0a,0xa0,0x4a,0x00,0x12, -0x00,0xe4,0x80,0x51,0x3c,0x67,0x00,0x00,0x37,0x21,0xf5,0x20,0x0a,0xa0,0x4a,0x00, -0x12,0x00,0xe5,0x80,0x57,0x3c,0x24,0x00,0x00,0x29,0x21,0xf5,0x20,0x0a,0xa0,0x4a, -0x00,0x12,0x00,0xe6,0x80,0x5c,0x3c,0x12,0x00,0x00,0x29,0x21,0xf5,0x20,0x0a,0xa0, -0x4a,0x00,0x12,0x00,0xe7,0x80,0x63,0x3c,0x62,0x00,0x00,0x29,0x21,0xf5,0x20,0x0a, -0xa0,0x4a,0x00,0x12,0x00,0xe8,0x80,0x5e,0x3c,0x02,0x00,0x00,0x37,0x21,0xf5,0x20, -0x0a,0xa0,0x4a,0x00,0x12,0x00,0x92,0x80,0x3c,0x3c,0x7c,0x00,0x00,0x41,0x19,0xf5, -0x20,0x0b,0xa0,0x4b,0x00,0x12,0x00,0x96,0x80,0x3f,0x3c,0x74,0x00,0x00,0x41,0x19, -0xf5,0x20,0x0b,0xa0,0x4b,0x00,0x12,0x00,0x99,0x80,0x42,0x3c,0x06,0x00,0x00,0x41, -0x19,0xf5,0x20,0x0b,0xa0,0x4b,0x00,0x12,0x00,0x8f,0x80,0x44,0x3c,0x14,0x00,0x00, -0x41,0x19,0xf5,0x20,0x0b,0xa0,0x4b,0x00,0x12,0x00,0x93,0x80,0x47,0x3c,0x22,0x00, -0x00,0x41,0x19,0xf5,0x20,0x0b,0xa0,0x4b,0x00,0x12,0x00,0x97,0x80,0x4a,0x3c,0x21, -0x00,0x00,0x41,0x19,0xf5,0x20,0x0b,0xa0,0x4b,0x00,0x12,0x00,0x9a,0x80,0x4e,0x3c, -0x75,0x00,0x00,0x41,0x19,0xf5,0x20,0x0b,0xa0,0x4b,0x00,0x12,0x00,0x90,0x80,0x51, -0x3c,0x69,0x00,0x00,0x41,0x19,0xf5,0x20,0x0b,0xa0,0x4b,0x00,0x12,0x00,0x94,0x80, -0x54,0x3c,0x6f,0x00,0x00,0x41,0x19,0xf5,0x20,0x0b,0xa0,0x4b,0x00,0x12,0x00,0x98, -0x80,0x57,0x3c,0x66,0x00,0x00,0x41,0x19,0xf5,0x20,0x0b,0xa0,0x4b,0x00,0x12,0x00, -0x9b,0x80,0x59,0x3c,0x19,0x00,0x00,0x41,0x19,0xf5,0x20,0x0b,0xa0,0x4b,0x00,0x12, -0x00,0x91,0x80,0x5c,0x3c,0x68,0x00,0x00,0x41,0x19,0xf5,0x20,0x0b,0xa0,0x4b,0x00, -0x12,0x00,0x95,0x80,0x5e,0x3c,0x04,0x00,0x00,0x41,0x19,0xf5,0x20,0x0b,0xa0,0x4b, -0x00,0x12,0x00,0xe9,0x80,0x3b,0x3c,0x5d,0x00,0x00,0x43,0x19,0xf4,0x10,0x0b,0xa0, -0x4c,0x00,0x12,0x00,0xea,0x80,0x3f,0x3c,0x55,0x00,0x00,0x43,0x19,0xf4,0x10,0x0b, -0xa0,0x4c,0x00,0x12,0x00,0xeb,0x80,0x45,0x3c,0x7d,0x00,0x00,0x43,0x19,0xf4,0x10, -0x0b,0xa0,0x4c,0x00,0x12,0x00,0xed,0x80,0x4b,0x3c,0x05,0x00,0x00,0x43,0x19,0xf4, -0x10,0x0b,0xa0,0x4c,0x00,0x12,0x00,0xec,0x80,0x53,0x3c,0x52,0x00,0x00,0x43,0x19, -0xf4,0x10,0x0b,0xa0,0x4c,0x00,0x12,0x00,0xee,0x80,0x59,0x3c,0x5e,0x00,0x00,0x43, -0x19,0xf4,0x10,0x0b,0xa0,0x4c,0x00,0x12,0x00,0xef,0x80,0x61,0x3c,0x4d,0x00,0x00, -0x43,0x19,0xf4,0x10,0x0b,0xa0,0x4c,0x00,0x12,0x00,0xdf,0x80,0x38,0x3c,0x7a,0x00, -0x00,0x31,0x19,0xf0,0x00,0x0a,0xa0,0x4d,0x00,0x12,0x00,0xe1,0x80,0x41,0x3c,0x70, -0x00,0x00,0x31,0x19,0xf0,0x00,0x0a,0xa0,0x4d,0x00,0x12,0x00,0xe2,0x80,0x44,0x3c, -0x7a,0x00,0x00,0x31,0x19,0xf0,0x00,0x0a,0xa0,0x4d,0x00,0x12,0x00,0xe0,0x80,0x49, -0x3c,0x15,0x00,0x00,0x31,0x19,0xf0,0x00,0x0a,0xa0,0x4d,0x00,0x12,0x00,0x42,0x80, -0x49,0x3c,0x4d,0x00,0x00,0x19,0x39,0xf4,0x10,0x0a,0xa0,0x4e,0x00,0x12,0x00,0x44, -0x80,0x4f,0x3c,0x36,0x00,0x00,0x23,0x39,0xf4,0x10,0x0a,0xa0,0x4e,0x00,0x12,0x00, -0x43,0x80,0x55,0x3c,0x4c,0x00,0x00,0x23,0x39,0xf4,0x10,0x0a,0xa0,0x4e,0x00,0x12, -0x00,0x46,0x80,0x5b,0x3c,0x36,0x00,0x00,0x23,0x39,0xf4,0x10,0x0a,0xa0,0x4e,0x00, -0x12,0x00,0x45,0x80,0x61,0x3c,0x4c,0x00,0x00,0x23,0x39,0xf4,0x10,0x0a,0xa0,0x4e, -0x00,0x12,0x00,0x47,0x80,0x67,0x3c,0x36,0x00,0x00,0x19,0x39,0xf4,0x10,0x0a,0xa0, -0x4e,0x00,0x12,0x00,0x3c,0x80,0x44,0x3c,0x2a,0x00,0x00,0x3b,0x31,0xf0,0x00,0x09, -0xa0,0x4f,0x00,0x12,0x00,0x3b,0x80,0x4a,0x3c,0x03,0x00,0x00,0x3b,0x31,0xf0,0x00, -0x09,0xa0,0x4f,0x00,0x12,0x00,0x3d,0x80,0x50,0x3c,0x14,0x00,0x00,0x3b,0x31,0xf0, -0x00,0x09,0xa0,0x4f,0x00,0x13,0x00,0x38,0x80,0x2f,0x3c,0x59,0x00,0x00,0x39,0x31, -0xf0,0x00,0x0b,0xa0,0x50,0x00,0x13,0x00,0x3a,0x80,0x35,0x3c,0x5e,0x00,0x00,0x39, -0x31,0xf0,0x00,0x0b,0xa0,0x50,0x00,0x13,0x00,0x39,0x80,0x3b,0x3c,0x5e,0x00,0x00, -0x39,0x31,0xf0,0x00,0x0b,0xa0,0x50,0x00,0x13,0x00,0x9e,0x80,0x3e,0x3c,0x4c,0x00, -0x00,0x37,0x29,0xf3,0x20,0x0a,0xa0,0x51,0x00,0x13,0x00,0xa0,0x80,0x44,0x3c,0x66, -0x00,0x00,0x37,0x29,0xf3,0x20,0x0a,0xa0,0x51,0x00,0x13,0x00,0x9f,0x80,0x4b,0x3c, -0x64,0x00,0x00,0x37,0x29,0xf3,0x20,0x0a,0xa0,0x51,0x00,0x13,0x00,0xa1,0x80,0x55, -0x3c,0x4d,0x00,0x00,0x37,0x29,0xf3,0x20,0x0a,0xa0,0x51,0x00,0x10,0x00,0x71,0x80, -0x46,0x3c,0x03,0x00,0x00,0x19,0x38,0xf0,0x00,0x0a,0xa2,0x52,0x00,0x10,0x00,0x72, -0x80,0x52,0x3c,0x32,0x00,0x00,0x19,0x38,0xf0,0x00,0x0a,0xa2,0x52,0x00,0x10,0x00, -0x73,0x80,0x5e,0x3c,0x03,0x00,0x00,0x19,0x38,0xf0,0x00,0x0a,0xa2,0x52,0x00,0x10, -0x00,0x74,0x80,0x5c,0x3c,0x65,0x00,0x00,0x19,0x38,0xf0,0x00,0x0a,0xa2,0x52,0x00, -0x10,0x00,0x75,0x80,0x61,0x3c,0x4d,0x00,0x00,0x19,0x38,0xf0,0x00,0x0a,0xa2,0x52, -0x00,0x16,0x00,0x71,0x80,0x46,0x3c,0x03,0x00,0x00,0x23,0x38,0xf0,0x00,0x0a,0xa2, -0x53,0x00,0x16,0x00,0x72,0x80,0x52,0x3c,0x32,0x00,0x00,0x23,0x38,0xf0,0x00,0x0a, -0xa2,0x53,0x00,0x16,0x00,0x73,0x80,0x5e,0x3c,0x03,0x00,0x00,0x19,0x38,0xf0,0x00, -0x0a,0xa2,0x53,0x00,0x10,0x00,0xbd,0x80,0x46,0x3c,0x61,0x00,0x00,0x13,0x30,0x70, -0x00,0x09,0xa1,0x54,0x00,0x10,0x00,0x77,0x80,0x5a,0x3c,0x77,0x00,0x00,0x21,0x38, -0xf0,0x00,0x09,0xa3,0x55,0x00,0x13,0x00,0x77,0x80,0x5a,0x3c,0x77,0x00,0x00,0x37, -0x38,0xf0,0x00,0x09,0xa1,0x56,0x0e,0x10,0x01,0x25,0x81,0x52,0x3c,0x6d,0xfa,0x12, -0x7f,0x00,0xf0,0x00,0x09,0xa0,0x57,0x00,0x10,0x00,0xab,0x80,0x48,0x3c,0x04,0x00, -0x00,0x29,0x30,0xf0,0x00,0x0a,0xa3,0x58,0x00,0x12,0x00,0x76,0x80,0x4f,0x3c,0x44, -0x00,0x00,0x5d,0x28,0x70,0x00,0x09,0xa2,0x59,0x00,0x10,0x00,0xaa,0x80,0x5e,0x3c, -0x03,0xfb,0x01,0x2d,0x2c,0x70,0x00,0x0a,0xa0,0x5a,0x00,0x10,0x00,0xaa,0x80,0x5e, -0x3c,0x03,0x00,0x00,0x31,0x29,0x90,0x00,0x0a,0xa1,0x5b,0x30,0x10,0x00,0xcc,0x90, -0x2b,0x3c,0x3d,0x00,0x00,0x53,0x38,0xc6,0x21,0x09,0xa0,0x5c,0x30,0x10,0x00,0xcd, -0x80,0x37,0x3c,0x41,0x00,0x00,0x53,0x38,0xc6,0x21,0x09,0xa0,0x5c,0x30,0x10,0x00, -0xca,0x80,0x43,0x3c,0x40,0x00,0x00,0x53,0x38,0xc6,0x21,0x09,0xa0,0x5c,0x30,0x10, -0x00,0xcf,0x80,0x4f,0x3c,0x41,0x00,0x00,0x53,0x38,0xc6,0x21,0x09,0xa0,0x5c,0x30, -0x10,0x00,0xce,0x80,0x5b,0x3c,0x40,0x00,0x00,0x53,0x38,0xc6,0x21,0x09,0xa0,0x5c, -0x30,0x10,0x00,0xcb,0x80,0x67,0x3c,0x40,0x00,0x00,0x53,0x38,0xc6,0x21,0x09,0xa0, -0x5c,0xd0,0x10,0x00,0xcc,0x90,0x2b,0x79,0x34,0x00,0x00,0x53,0x08,0xc6,0x21,0x09, -0xa0,0x5d,0xd0,0x10,0x00,0xcd,0x80,0x37,0x79,0x38,0x00,0x00,0x53,0x08,0xc6,0x21, -0x09,0xa0,0x5d,0xd0,0x10,0x00,0xca,0x80,0x43,0x79,0x37,0x00,0x00,0x53,0x08,0xc6, -0x21,0x09,0xa0,0x5d,0xd0,0x10,0x00,0xcf,0x80,0x4f,0x79,0x38,0x00,0x00,0x53,0x08, -0xc6,0x21,0x09,0xa0,0x5d,0xd0,0x10,0x00,0xce,0x80,0x5b,0x79,0x37,0x00,0x00,0x53, -0x08,0xc6,0x21,0x09,0xa0,0x5d,0xd0,0x10,0x00,0xcb,0x80,0x67,0x79,0x37,0x00,0x00, -0x53,0x08,0xc6,0x21,0x09,0xa0,0x5d,0x00,0x10,0x00,0x18,0x81,0x25,0x3c,0x54,0x00, -0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x19,0x81,0x2b,0x3c,0x59, -0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x1a,0x81,0x31,0x3c, -0x52,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x1b,0x81,0x37, -0x3c,0x59,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x1c,0x81, -0x3d,0x3c,0x5f,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x1d, -0x81,0x43,0x3c,0x62,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00, -0x1e,0x81,0x49,0x3c,0x6d,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10, -0x00,0x1f,0x81,0x4f,0x3c,0x62,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00, -0x10,0x00,0x20,0x81,0x54,0x3c,0x09,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e, -0x00,0x10,0x00,0x21,0x81,0x5b,0x3c,0x3b,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0, -0x5e,0x00,0x10,0x00,0x22,0x81,0x61,0x3c,0x52,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a, -0xa0,0x5e,0x00,0x10,0x00,0x23,0x81,0x6d,0x3c,0x52,0x00,0x00,0x37,0x30,0xf2,0x22, -0x0a,0xa0,0x5e,0x00,0x10,0x00,0x18,0x81,0x25,0x3c,0x4a,0x00,0x00,0x37,0x30,0xf2, -0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x19,0x81,0x2b,0x3c,0x4f,0x00,0x00,0x37,0x30, -0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x1a,0x81,0x31,0x3c,0x48,0x00,0x00,0x37, -0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x1b,0x81,0x37,0x3c,0x4f,0x00,0x00, -0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x1c,0x81,0x3d,0x3c,0x55,0x00, -0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x1d,0x81,0x43,0x3c,0x58, -0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x1e,0x81,0x49,0x3c, -0x63,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x1f,0x81,0x4f, -0x3c,0x58,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x20,0x81, -0x55,0x3c,0x7f,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00,0x21, -0x81,0x5b,0x3c,0x31,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10,0x00, -0x22,0x81,0x61,0x3c,0x48,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00,0x10, -0x00,0x23,0x81,0x6d,0x3c,0x48,0x00,0x00,0x37,0x30,0xf2,0x22,0x0a,0xa0,0x5e,0x00, -0x10,0x00,0xaa,0x80,0x5e,0x3c,0x03,0x00,0x00,0x3d,0x28,0x90,0x00,0x0a,0xa2,0x5f, -0x00,0x10,0x00,0x76,0x80,0x4f,0x79,0x44,0x00,0x00,0x49,0x28,0xb0,0x00,0x09,0xa2, -0x60,0x00,0x12,0x00,0x3a,0x71,0x43,0x3c,0x11,0x00,0x00,0x33,0x2a,0xf0,0x00,0x09, -0xa1,0x61,0x00,0x10,0x00,0xfe,0x80,0x4f,0x79,0x0c,0x00,0x00,0x41,0x28,0xf3,0x00, -0x17,0xa0,0x62,0x00,0x12,0x00,0xa5,0x80,0x38,0x3c,0x02,0x00,0x00,0x45,0x33,0xf2, -0x11,0x09,0xa0,0x63,0x00,0x12,0x00,0xa6,0x80,0x42,0x3c,0x79,0x00,0x00,0x45,0x33, -0xf2,0x11,0x09,0xa0,0x63,0x00,0x13,0x00,0x18,0x81,0x25,0x79,0x4a,0x00,0x00,0x5b, -0x2a,0xf2,0x22,0x0e,0xa0,0x64,0x00,0x13,0x00,0x19,0x81,0x2b,0x79,0x4f,0x00,0x00, -0x5b,0x2a,0xf2,0x22,0x0e,0xa0,0x64,0x00,0x13,0x00,0x1a,0x81,0x31,0x79,0x48,0x00, -0x00,0x5b,0x2a,0xf2,0x22,0x0e,0xa0,0x64,0x00,0x13,0x00,0x1b,0x81,0x37,0x79,0x4f, -0x00,0x00,0x5b,0x2a,0xf2,0x22,0x0e,0xa0,0x64,0x00,0x13,0x00,0x1c,0x81,0x3d,0x79, -0x55,0x00,0x00,0x5b,0x2a,0xf2,0x22,0x0e,0xa0,0x64,0x00,0x13,0x00,0x1d,0x81,0x43, -0x79,0x58,0x00,0x00,0x5b,0x2a,0xf2,0x22,0x0e,0xa0,0x64,0x00,0x13,0x00,0x1e,0x81, -0x49,0x79,0x63,0x00,0x00,0x5b,0x2a,0xf2,0x22,0x0e,0xa0,0x64,0x00,0x13,0x00,0x1f, -0x81,0x4f,0x79,0x58,0x00,0x00,0x5b,0x2a,0xf2,0x22,0x0e,0xa0,0x64,0x00,0x13,0x00, -0x20,0x81,0x55,0x79,0x7f,0x00,0x00,0x5b,0x2a,0xf2,0x22,0x0e,0xa0,0x64,0x00,0x13, -0x00,0x21,0x81,0x5b,0x79,0x31,0x00,0x00,0x5b,0x2a,0xf2,0x22,0x0e,0xa0,0x64,0x00, -0x13,0x00,0x22,0x81,0x61,0x79,0x48,0x00,0x00,0x5b,0x2a,0xf2,0x22,0x0e,0xa0,0x64, -0x00,0x13,0x00,0x23,0x81,0x6d,0x79,0x48,0x00,0x00,0x5b,0x2a,0xf2,0x22,0x0e,0xa0, -0x64,0x00,0x10,0x00,0xaa,0x80,0x5e,0x3c,0x0b,0x00,0x00,0x73,0x2e,0x90,0x00,0x0a, -0xa0,0x65,0x00,0x10,0x00,0x2a,0x80,0x51,0x79,0x52,0x00,0x00,0x27,0x29,0xf0,0x05, -0x0a,0xa0,0x66,0x00,0x10,0x00,0x18,0x81,0x2a,0x3c,0x54,0x00,0x00,0x2f,0x32,0xf5, -0x20,0x08,0xa0,0x67,0x00,0x10,0x00,0x19,0x81,0x30,0x3c,0x59,0x00,0x00,0x2f,0x32, -0xf5,0x20,0x08,0xa0,0x67,0x00,0x10,0x00,0x1a,0x81,0x36,0x3c,0x52,0x00,0x00,0x2f, -0x32,0xf5,0x20,0x08,0xa0,0x67,0x00,0x10,0x00,0x1b,0x81,0x3c,0x3c,0x59,0x00,0x00, -0x2f,0x32,0xf5,0x20,0x08,0xa0,0x67,0x00,0x10,0x00,0x1c,0x81,0x42,0x3c,0x5f,0x00, -0x00,0x2f,0x32,0xf5,0x20,0x08,0xa0,0x67,0x00,0x10,0x00,0x1d,0x81,0x48,0x3c,0x62, -0x00,0x00,0x2f,0x32,0xf5,0x20,0x08,0xa0,0x67,0x00,0x10,0x00,0x1e,0x81,0x4e,0x3c, -0x6d,0x00,0x00,0x2f,0x32,0xf5,0x20,0x08,0xa0,0x67,0x00,0x10,0x00,0x1f,0x81,0x54, -0x3c,0x62,0x00,0x00,0x2f,0x32,0xf5,0x20,0x08,0xa0,0x67,0x00,0x10,0x00,0x20,0x81, -0x59,0x3c,0x09,0x00,0x00,0x2f,0x32,0xf5,0x20,0x08,0xa0,0x67,0x00,0x10,0x00,0x21, -0x81,0x60,0x3c,0x3b,0x00,0x00,0x2f,0x32,0xf5,0x20,0x08,0xa0,0x67,0x00,0x10,0x00, -0x22,0x81,0x66,0x3c,0x52,0x00,0x00,0x2f,0x32,0xf5,0x20,0x08,0xa0,0x67,0x00,0x10, -0x00,0x23,0x81,0x72,0x3c,0x52,0x00,0x00,0x2f,0x32,0xf5,0x20,0x08,0xa0,0x67,0x00, -0x10,0x00,0x02,0x90,0x55,0x79,0x57,0x00,0x00,0x47,0x31,0xb3,0x20,0x0b,0xa0,0x68, -0x00,0x10,0x00,0x17,0x81,0x2d,0x3c,0x6d,0x00,0x00,0x43,0x29,0xf1,0x50,0x08,0xa0, -0x69,0x00,0x10,0x00,0x18,0x81,0x25,0x79,0x49,0x00,0x00,0x43,0x2a,0xf2,0x20,0x0a, -0xa0,0x6a,0x00,0x10,0x00,0x19,0x81,0x2b,0x79,0x4e,0x00,0x00,0x43,0x2a,0xf2,0x20, -0x0a,0xa0,0x6a,0x00,0x10,0x00,0x1a,0x81,0x31,0x79,0x47,0x00,0x00,0x43,0x2a,0xf2, -0x20,0x0a,0xa0,0x6a,0x00,0x10,0x00,0x1b,0x81,0x37,0x79,0x4e,0x00,0x00,0x43,0x2a, -0xf2,0x20,0x0a,0xa0,0x6a,0x00,0x10,0x00,0x1c,0x81,0x3d,0x79,0x54,0x00,0x00,0x43, -0x2a,0xf2,0x20,0x0a,0xa0,0x6a,0x00,0x10,0x00,0x1d,0x81,0x43,0x79,0x57,0x00,0x00, -0x43,0x2a,0xf2,0x20,0x0a,0xa0,0x6a,0x00,0x10,0x00,0x1e,0x81,0x49,0x79,0x62,0x00, -0x00,0x43,0x2a,0xf2,0x20,0x0a,0xa0,0x6a,0x00,0x10,0x00,0x1f,0x81,0x4f,0x79,0x57, -0x00,0x00,0x43,0x2a,0xf2,0x20,0x0a,0xa0,0x6a,0x00,0x10,0x00,0x20,0x81,0x55,0x79, -0x7e,0x00,0x00,0x43,0x2a,0xf2,0x20,0x0a,0xa0,0x6a,0x00,0x10,0x00,0x21,0x81,0x5b, -0x79,0x30,0x00,0x00,0x43,0x2a,0xf2,0x20,0x0a,0xa0,0x6a,0x00,0x10,0x00,0x22,0x81, -0x61,0x79,0x47,0x00,0x00,0x43,0x2a,0xf2,0x20,0x0a,0xa0,0x6a,0x00,0x10,0x00,0x23, -0x81,0x6d,0x79,0x47,0x00,0x00,0x43,0x2a,0xf2,0x20,0x0a,0xa0,0x6a,0x00,0x12,0x00, -0x02,0x90,0x55,0x3c,0x55,0x00,0x00,0x5b,0x24,0x80,0x01,0x05,0xa0,0x6b,0x00,0x12, -0x30,0xf3,0x80,0x4b,0x3c,0x5d,0x00,0x00,0x73,0x23,0xa2,0x14,0x06,0xa1,0x6c,0x20, -0x10,0x30,0x4e,0x80,0x43,0x3c,0x7a,0x00,0x00,0x6d,0x2a,0x34,0x23,0x05,0xa2,0x6d, -0xe0,0x10,0x00,0x29,0x80,0x50,0x3c,0x37,0x00,0x00,0x41,0x22,0x31,0x23,0x06,0xa0, -0x6e,0x00,0x15,0x10,0x18,0x81,0x25,0x3c,0x57,0x00,0x00,0x45,0x23,0xf0,0x20,0x07, -0xa1,0x6f,0x00,0x15,0x10,0x19,0x81,0x2b,0x3c,0x5c,0x00,0x00,0x45,0x23,0xf0,0x20, -0x07,0xa1,0x6f,0x00,0x15,0x10,0x1a,0x81,0x31,0x3c,0x55,0x00,0x00,0x45,0x23,0xf0, -0x20,0x07,0xa1,0x6f,0x00,0x15,0x10,0x1b,0x81,0x37,0x3c,0x5c,0x00,0x00,0x45,0x23, -0xf0,0x20,0x07,0xa1,0x6f,0x00,0x15,0x10,0x1c,0x81,0x3d,0x3c,0x62,0x00,0x00,0x45, -0x23,0xf0,0x20,0x07,0xa1,0x6f,0x00,0x15,0x10,0x1d,0x81,0x43,0x3c,0x65,0x00,0x00, -0x45,0x23,0xf0,0x20,0x07,0xa1,0x6f,0x00,0x15,0x10,0x1e,0x81,0x49,0x3c,0x70,0x00, -0x00,0x45,0x23,0xf0,0x20,0x07,0xa1,0x6f,0x00,0x15,0x10,0x1f,0x81,0x4f,0x3c,0x65, -0x00,0x00,0x45,0x23,0xf0,0x20,0x07,0xa1,0x6f,0x00,0x15,0x00,0x20,0x81,0x54,0x3c, -0x0c,0x00,0x00,0x45,0x23,0xf0,0x20,0x07,0xa1,0x6f,0x00,0x15,0x10,0x21,0x81,0x5b, -0x3c,0x3e,0x00,0x00,0x45,0x23,0xf0,0x20,0x07,0xa1,0x6f,0x00,0x15,0x10,0x22,0x81, -0x61,0x3c,0x55,0x00,0x00,0x45,0x23,0xf0,0x20,0x07,0xa1,0x6f,0x00,0x15,0x10,0x23, -0x81,0x6d,0x3c,0x55,0x00,0x00,0x45,0x23,0xf0,0x20,0x07,0xa1,0x6f,0x00,0x12,0x30, -0x24,0x71,0x41,0x3c,0x78,0x00,0x00,0x45,0x22,0xe2,0x21,0x08,0xa0,0x70,0x00,0x10, -0x00,0x18,0x80,0x45,0x3c,0x52,0x00,0x00,0x4f,0x25,0x70,0x00,0x06,0xa0,0x71,0x00, -0x10,0x00,0x19,0x80,0x4a,0x3c,0x52,0x00,0x00,0x4f,0x25,0x70,0x00,0x06,0xa0,0x71, -0x00,0x10,0x00,0x1a,0x80,0x51,0x3c,0x56,0x00,0x00,0x4f,0x25,0x70,0x00,0x06,0xa0, -0x71,0x00,0x10,0x00,0x1b,0x80,0x5b,0x3c,0x55,0x00,0x00,0x4f,0x25,0x70,0x00,0x06, -0xa0,0x71,0x00,0x10,0x00,0x2a,0x80,0x51,0x79,0x5a,0x00,0x00,0x57,0x24,0x65,0x21, -0x06,0xa0,0x72,0xf0,0x10,0x00,0x01,0x81,0x47,0x3c,0x76,0x00,0x00,0x41,0x19,0x44, -0x14,0x16,0xa0,0x73,0x10,0x10,0x00,0xaa,0x80,0x5f,0x79,0x78,0x00,0x00,0x6b,0x19, -0x40,0x00,0x06,0xa0,0x74,0x00,0x10,0x00,0x0c,0x80,0x36,0x3c,0x5f,0x00,0x00,0x51, -0x0a,0x60,0x01,0x06,0xa0,0x75,0x00,0x10,0x00,0x0d,0x80,0x42,0x3c,0x68,0x00,0x00, -0x51,0x0a,0x60,0x01,0x06,0xa0,0x75,0x00,0x10,0x00,0x0e,0x80,0x4a,0x3c,0x61,0x00, -0x00,0x51,0x0a,0x60,0x01,0x06,0xa0,0x75,0x00,0x10,0x00,0x0f,0x80,0x56,0x3c,0x61, -0x00,0x00,0x51,0x0a,0x60,0x01,0x06,0xa0,0x75,0x00,0x10,0x00,0x3f,0x80,0x4b,0x79, -0x40,0x00,0x00,0x59,0x31,0x65,0x12,0x07,0xa0,0x76,0x00,0x10,0x00,0x24,0x71,0x40, -0x3c,0x06,0x00,0x00,0x59,0x1a,0x85,0x23,0x08,0xa0,0x77,0x00,0x10,0x00,0x2a,0x80, -0x51,0x79,0x4f,0x00,0x00,0x3f,0x1b,0xc0,0x05,0x06,0xa0,0x78,0x00,0x10,0x70,0xd3, -0x80,0x25,0x3c,0x4c,0x00,0x00,0x29,0x19,0x33,0x11,0x06,0xa0,0x79,0x00,0x10,0x70, -0xda,0x80,0x2b,0x3c,0x55,0x00,0x00,0x29,0x19,0x33,0x11,0x06,0xa0,0x79,0x00,0x10, -0x70,0xd4,0x80,0x31,0x3c,0x4c,0x00,0x00,0x29,0x19,0x33,0x11,0x06,0xa0,0x79,0x00, -0x10,0x70,0xdb,0x80,0x37,0x3c,0x47,0x00,0x00,0x29,0x19,0x33,0x11,0x06,0xa0,0x79, -0x00,0x10,0x70,0xd5,0x80,0x3d,0x3c,0x60,0x00,0x00,0x29,0x19,0x33,0x11,0x06,0xa0, -0x79,0x00,0x10,0x70,0xdc,0x80,0x43,0x3c,0x4f,0x00,0x00,0x29,0x19,0x33,0x11,0x06, -0xa0,0x79,0x00,0x10,0x70,0xd6,0x80,0x49,0x3c,0x53,0x00,0x00,0x29,0x19,0x33,0x11, -0x06,0xa0,0x79,0x00,0x10,0x70,0xdd,0x80,0x4f,0x3c,0x63,0x00,0x00,0x29,0x19,0x33, -0x11,0x06,0xa0,0x79,0x00,0x10,0x70,0xd7,0x80,0x54,0x3c,0x0a,0x00,0x00,0x29,0x19, -0x33,0x11,0x06,0xa0,0x79,0x00,0x10,0x70,0xde,0x80,0x5b,0x3c,0x3d,0x00,0x00,0x29, -0x19,0x33,0x11,0x06,0xa0,0x79,0x00,0x10,0x70,0xd8,0x80,0x61,0x3c,0x53,0x00,0x00, -0x29,0x19,0x33,0x11,0x06,0xa0,0x79,0x00,0x10,0x70,0xd9,0x80,0x6d,0x3c,0x53,0x00, -0x00,0x29,0x19,0x33,0x11,0x06,0xa0,0x79,0x00,0x10,0x70,0xd3,0x80,0x25,0x3c,0x40, -0x00,0x00,0x29,0x18,0x33,0x11,0x06,0xa0,0x7a,0x00,0x10,0x70,0xda,0x80,0x2b,0x3c, -0x49,0x00,0x00,0x29,0x18,0x33,0x11,0x06,0xa0,0x7a,0x00,0x10,0x70,0xd4,0x80,0x31, -0x3c,0x40,0x00,0x00,0x29,0x18,0x33,0x11,0x06,0xa0,0x7a,0x00,0x10,0x70,0xdb,0x80, -0x37,0x3c,0x3b,0x00,0x00,0x29,0x18,0x33,0x11,0x06,0xa0,0x7a,0x00,0x10,0x70,0xd5, -0x80,0x3d,0x3c,0x54,0x00,0x00,0x29,0x18,0x33,0x11,0x06,0xa0,0x7a,0x00,0x10,0x70, -0xdc,0x80,0x43,0x3c,0x43,0x00,0x00,0x29,0x18,0x33,0x11,0x06,0xa0,0x7a,0x00,0x10, -0x70,0xd6,0x80,0x49,0x3c,0x47,0x00,0x00,0x29,0x18,0x33,0x11,0x06,0xa0,0x7a,0x00, -0x10,0x70,0xdd,0x80,0x4f,0x3c,0x57,0x00,0x00,0x29,0x18,0x33,0x11,0x06,0xa0,0x7a, -0x00,0x10,0x70,0xd7,0x80,0x55,0x3c,0x7e,0x00,0x00,0x29,0x18,0x33,0x11,0x06,0xa0, -0x7a,0x00,0x10,0x70,0xde,0x80,0x5b,0x3c,0x31,0x00,0x00,0x29,0x18,0x33,0x11,0x06, -0xa0,0x7a,0x00,0x10,0x70,0xd8,0x80,0x61,0x3c,0x47,0x00,0x00,0x29,0x18,0x33,0x11, -0x06,0xa0,0x7a,0x00,0x10,0x70,0xd9,0x80,0x6d,0x3c,0x47,0x00,0x00,0x29,0x18,0x33, -0x11,0x06,0xa0,0x7a,0x00,0x10,0x00,0x4e,0x80,0x43,0x3c,0x71,0xfd,0x01,0x33,0x22, -0xa3,0x63,0x17,0xa0,0x7b,0x00,0x10,0x30,0x43,0x61,0x47,0x5b,0x7d,0x2b,0x2a,0x91, -0x2a,0xf0,0x05,0x05,0x20,0x7c,0x00,0x10,0x00,0x02,0x90,0x55,0x3c,0x55,0x00,0x00, -0x49,0x2a,0x60,0x01,0x05,0xa0,0x7d,0x00,0x10,0x30,0xf3,0x70,0x57,0x79,0x48,0x00, -0x00,0x57,0x2d,0x52,0x14,0x06,0xa2,0x7e,0x00,0x10,0x00,0xf3,0x70,0x52,0x3c,0x62, -0x00,0x00,0x47,0x33,0xf6,0x25,0x25,0xa0,0x7f,0x00,0x10,0x00,0x6d,0x80,0x32,0x3c, -0x5e,0x00,0x00,0x53,0x3b,0x85,0x24,0x06,0xa0,0x80,0x00,0x10,0x00,0x6e,0x80,0x3e, -0x3c,0x65,0x00,0x00,0x53,0x3b,0x85,0x24,0x06,0xa0,0x80,0x09,0x10,0x00,0x6f,0x80, -0x4a,0x3c,0x73,0x00,0x00,0x53,0x3b,0x85,0x24,0x06,0xa0,0x80,0x00,0x12,0x00,0x02, -0x90,0x55,0x3c,0x5d,0x00,0x00,0x37,0x32,0x73,0x22,0x06,0xa1,0x81,0x05,0x12,0x00, -0xb3,0x80,0x36,0x79,0x74,0x00,0x00,0x3d,0x32,0xf5,0x34,0x07,0xa2,0x82,0x0c,0x12, -0x00,0xb7,0x80,0x41,0x79,0x7f,0x00,0x00,0x3d,0x32,0xf5,0x34,0x07,0xa2,0x82,0x00, -0x12,0x00,0xb5,0x80,0x48,0x79,0x6d,0x00,0x00,0x3d,0x32,0xf6,0x34,0x07,0xa2,0x82, -0x00,0x12,0x00,0xb4,0x80,0x4e,0x79,0x74,0x00,0x00,0x3d,0x32,0xf6,0x35,0x07,0xa2, -0x82,0x00,0x12,0x00,0xb6,0x80,0x57,0x79,0x63,0x00,0x00,0x3d,0x32,0xf6,0x35,0x17, -0xa2,0x82,0x00,0x10,0x00,0x37,0x91,0x4f,0x3c,0x65,0x00,0x00,0x41,0x2a,0xf5,0x18, -0x08,0xa0,0x83,0x00,0x10,0x00,0x2a,0x80,0x51,0x79,0x59,0x00,0x00,0x37,0x29,0xc0, -0x05,0x05,0xa0,0x84,0xf0,0x10,0x00,0x02,0x90,0x55,0x3c,0x55,0x00,0x00,0x35,0x2a, -0x30,0x00,0x05,0xa0,0x85,0x10,0x10,0x30,0x09,0x70,0x44,0x52,0x52,0xef,0x01,0xc3, -0x0c,0x20,0x00,0x06,0x20,0x86,0x00,0x10,0x00,0x2a,0x80,0x51,0x3c,0x5f,0x00,0x00, -0x51,0x2b,0xf5,0x21,0x06,0xa0,0x87,0x00,0x10,0x00,0x24,0x71,0x41,0x79,0x7b,0x00, -0x00,0x51,0x2b,0x85,0x23,0x07,0xa0,0x88,0x00,0x10,0x30,0x0c,0x80,0x36,0x3c,0x5c, -0x00,0x00,0x01,0x2b,0x90,0x05,0x06,0xa3,0x89,0x00,0x10,0x30,0x0d,0x80,0x42,0x3c, -0x65,0x00,0x00,0x01,0x2b,0x90,0x05,0x06,0xa3,0x89,0x00,0x10,0x30,0x0e,0x80,0x4a, -0x3c,0x5e,0x00,0x00,0x01,0x2b,0x90,0x05,0x06,0xa3,0x89,0x00,0x10,0x30,0x0f,0x80, -0x56,0x3c,0x5e,0x00,0x00,0x01,0x2b,0x90,0x05,0x06,0xa3,0x89,0x00,0x10,0x00,0x02, -0x90,0x55,0x3c,0x52,0x00,0x00,0x01,0x22,0x80,0x01,0x05,0xa0,0x8a,0x00,0x10,0x00, -0x0f,0x81,0x4a,0x3c,0x78,0x00,0x00,0x01,0x32,0xf4,0x15,0x16,0xa1,0x8b,0x00,0x10, -0x00,0x13,0x80,0x40,0x3c,0x75,0x00,0x00,0x23,0x38,0xf0,0x05,0x09,0xa0,0x8c,0x00, -0x10,0x00,0x14,0x80,0x45,0x3c,0x51,0x00,0x00,0x23,0x38,0xf0,0x05,0x09,0xa0,0x8c, -0x00,0x10,0x00,0x12,0x80,0x49,0x3c,0x68,0x00,0x00,0x23,0x38,0xf0,0x05,0x09,0xa0, -0x8c,0x00,0x10,0x00,0x15,0x80,0x50,0x3c,0x66,0x00,0x00,0x23,0x38,0xf0,0x05,0x09, -0xa0,0x8c,0x00,0x10,0x00,0x17,0x80,0x57,0x3c,0x25,0x00,0x00,0x23,0x38,0xf0,0x05, -0x09,0xa0,0x8c,0x00,0x10,0x00,0x16,0x80,0x5f,0x3c,0x20,0x00,0x00,0x23,0x38,0xf0, -0x05,0x09,0xa0,0x8c,0x00,0x10,0x20,0x0e,0x81,0x52,0x3c,0x09,0x00,0x00,0x07,0x28, -0xf7,0x35,0x45,0xa2,0x8d,0x00,0x12,0x00,0xa9,0x80,0x4c,0x3c,0x01,0x00,0x00,0x39, -0x20,0xf0,0x04,0x07,0xa0,0x8e,0x00,0x10,0x00,0x37,0x81,0x4f,0x3c,0x65,0x00,0x00, -0x31,0x38,0xf5,0x18,0x08,0xa0,0x8f,0x00,0x12,0x20,0xa4,0x80,0x30,0x3c,0x43,0x00, -0x00,0x1f,0x1c,0xf0,0x00,0x09,0xa0,0x90,0x00,0x10,0x20,0xa7,0x80,0x30,0x61,0x40, -0x00,0x00,0x1f,0x19,0xf0,0x00,0x09,0xa0,0x91,0x00,0x10,0x20,0xa8,0x80,0x4f,0x61, -0x31,0x00,0x00,0x1f,0x19,0xf0,0x00,0x09,0xa0,0x91,0x00,0x12,0x00,0x05,0x81,0x44, -0x3c,0x66,0x00,0x00,0x35,0x31,0xf3,0x20,0x09,0xa0,0x92,0x00,0x12,0x00,0x02,0x81, -0x47,0x3c,0x52,0x00,0x00,0x35,0x31,0xf3,0x20,0x09,0xa0,0x92,0x00,0x12,0x00,0x06, -0x81,0x4c,0x3c,0x64,0x00,0x00,0x35,0x31,0xf3,0x20,0x09,0xa0,0x92,0x00,0x12,0x00, -0x07,0x81,0x4c,0x3c,0x01,0x00,0x00,0x35,0x31,0xf3,0x20,0x09,0xa0,0x92,0x00,0x12, -0x00,0x08,0x81,0x50,0x3c,0x3c,0x00,0x00,0x35,0x31,0xf3,0x20,0x09,0xa0,0x92,0x00, -0x12,0x00,0x0a,0x81,0x55,0x3c,0x4d,0x00,0x00,0x35,0x31,0xf3,0x20,0x09,0xa0,0x92, -0x00,0x12,0x00,0x0b,0x81,0x57,0x3c,0x64,0x00,0x00,0x35,0x31,0xf3,0x20,0x09,0xa0, -0x92,0x00,0x12,0x00,0x0c,0x81,0x58,0x3c,0x22,0x00,0x00,0x35,0x31,0xf3,0x20,0x09, -0xa0,0x92,0x00,0x12,0x00,0x0d,0x81,0x5b,0x3c,0x36,0x00,0x00,0x35,0x31,0xf3,0x20, -0x09,0xa0,0x92,0x00,0x12,0x00,0x09,0x81,0x5e,0x3c,0x61,0x00,0x00,0x35,0x31,0xf3, -0x20,0x09,0xa0,0x92,0x00,0x13,0x00,0x41,0x90,0x42,0x3c,0x62,0x00,0x00,0x3b,0x31, -0x95,0x20,0x09,0xa0,0x93,0x00,0x10,0x00,0xf3,0x70,0x52,0x3c,0x5d,0x00,0x00,0x37, -0x3b,0xd6,0x25,0x25,0xa0,0x94,0x00,0x10,0x00,0x37,0x91,0x4c,0x6e,0x65,0x00,0x00, -0x99,0x3b,0xf5,0x18,0x08,0xa0,0x95,0x00,0x10,0x00,0x0b,0x80,0x59,0x3c,0x6a,0x00, -0x00,0x2d,0x38,0xf0,0x00,0x09,0xa0,0x96,0x00,0x10,0x00,0xfe,0x80,0x4f,0x3c,0x16, -0x00,0x00,0x35,0x38,0xf3,0x06,0x17,0xa1,0x04,0x00,0x10,0x00,0x00,0xa1,0x39,0x74, -0x42,0x00,0x00,0xab,0x38,0xb0,0x05,0x16,0xa1,0x04,0x07,0x10,0x00,0x2c,0x80,0x55, -0x3c,0x53,0x00,0x00,0x2b,0x00,0xf0,0x00,0x09,0x50,0x04,0x00,0x10,0x10,0x3e,0x50, -0x3f,0x3c,0x6a,0x00,0x00,0x21,0x38,0xf0,0x04,0x04,0x50,0x04,0x00,0x10,0x00,0xc7, -0x80,0x3a,0x3c,0x52,0x00,0x00,0x1b,0x38,0xf0,0x05,0x01,0x50,0x04,0x00,0x10,0x00, -0x26,0x80,0x4e,0x3c,0x7a,0x00,0x00,0x2f,0x38,0xf0,0x04,0x04,0x50,0x04,0x00,0x10, -0x00,0x31,0x80,0x4c,0x3c,0x6a,0x00,0x00,0x01,0x38,0x3a,0xf0,0x09,0x50,0x04,0x00, -0x10,0x00,0x38,0x81,0x43,0x3c,0x52,0x00,0x00,0x5f,0x38,0xf0,0x00,0x09,0xa0,0x04, -0x0e,0x10,0x01,0x25,0x81,0x4b,0x3c,0x6d,0x00,0x00,0x2f,0x38,0xf0,0x00,0x09,0xa0, -0x04,0xe0,0x10,0x00,0x08,0x80,0x55,0x3c,0x55,0x00,0x00,0x01,0x00,0x20,0x03,0x04, -0x20,0x04,0x24,0x10,0x01,0x37,0x80,0x4a,0x3c,0x6a,0x00,0x00,0x01,0x00,0x20,0x04, -0x05,0x20,0x04,0xc0,0x10,0x00,0x09,0x70,0x37,0xba,0x52,0xbf,0x50,0x3d,0x0f,0x22, -0x12,0x07,0x08,0x04,0x40,0x10,0x00,0x09,0x70,0x46,0xbc,0x52,0x0f,0x32,0x51,0x15, -0x72,0x12,0x07,0x08,0x04,0x00,0x10,0x00,0x03,0x80,0x50,0x3c,0x52,0x00,0x00,0x31, -0x00,0xf0,0x00,0x0f,0x10,0x04,0xe0,0x10,0x00,0x01,0x80,0x55,0x3c,0x55,0x00,0x00, -0x1f,0x08,0x30,0x01,0x07,0x10,0x04,0x24,0x10,0x04,0x37,0x80,0x4a,0x3c,0x6a,0x00, -0x00,0x89,0x00,0x30,0x01,0x07,0x10,0x04,0xa0,0x10,0x00,0x36,0x80,0x49,0x3c,0x01, -0xf1,0x02,0x3b,0x0f,0x40,0x01,0x07,0x20,0x04,0x60,0x10,0x00,0x36,0x80,0x4e,0x3e, -0x70,0xf9,0x02,0x39,0x07,0x40,0x01,0x07,0x08,0x04,0x00,0x10,0x10,0x39,0x81,0x56, -0x3c,0x6a,0x00,0x00,0x0f,0x38,0xf0,0x03,0x03,0x20,0x04,0x00,0x15,0x20,0x67,0x80, -0x62,0x3c,0x5b,0x00,0x00,0x01,0x32,0xf4,0x15,0x16,0xa1,0x8b,0x7f,0x7d,0x7c,0x7a, -0x78,0x77,0x75,0x73,0x71,0x70,0x6e,0x6c,0x6b,0x69,0x67,0x66,0x64,0x62,0x60,0x5e, -0x5c,0x5b,0x59,0x57,0x55,0x53,0x51,0x4f,0x4d,0x4c,0x4a,0x48,0x46,0x45,0x44,0x43, -0x42,0x41,0x3f,0x3e,0x3d,0x3c,0x3b,0x3a,0x39,0x38,0x37,0x36,0x34,0x33,0x32,0x31, -0x30,0x2f,0x2e,0x2d,0x2c,0x2b,0x2a,0x28,0x27,0x26,0x25,0x24,0x23,0x22,0x22,0x21, -0x20,0x20,0x1f,0x1e,0x1e,0x1d,0x1c,0x1c,0x1b,0x1a,0x1a,0x19,0x18,0x18,0x17,0x17, -0x16,0x15,0x15,0x14,0x13,0x13,0x12,0x11,0x11,0x10,0x0f,0x0f,0x0e,0x0e,0x0d,0x0d, -0x0c,0x0c,0x0b,0x0b,0x0a,0x0a,0x09,0x09,0x09,0x08,0x08,0x07,0x07,0x06,0x06,0x05, -0x05,0x05,0x04,0x04,0x03,0x03,0x02,0x02,0x01,0x01,0x00,0x00,0x7f,0x7e,0x7e,0x7d, -0x7c,0x7c,0x7b,0x7b,0x7a,0x79,0x79,0x78,0x77,0x77,0x76,0x76,0x75,0x74,0x72,0x71, -0x70,0x6f,0x6d,0x6c,0x6b,0x6a,0x68,0x67,0x66,0x65,0x63,0x62,0x61,0x60,0x5e,0x5d, -0x5c,0x5a,0x59,0x58,0x56,0x55,0x54,0x53,0x51,0x50,0x4f,0x4d,0x4c,0x4b,0x49,0x48, -0x47,0x45,0x44,0x43,0x41,0x40,0x3f,0x3e,0x3c,0x3b,0x3a,0x38,0x37,0x36,0x35,0x34, -0x33,0x32,0x32,0x31,0x30,0x2f,0x2e,0x2d,0x2c,0x2b,0x2a,0x29,0x28,0x28,0x27,0x26, -0x25,0x24,0x23,0x22,0x21,0x20,0x1f,0x1f,0x1e,0x1d,0x1c,0x1b,0x1a,0x19,0x18,0x17, -0x17,0x16,0x15,0x14,0x13,0x12,0x12,0x11,0x10,0x0f,0x0e,0x0d,0x0d,0x0c,0x0b,0x0a, -0x09,0x08,0x08,0x07,0x06,0x05,0x04,0x03,0x03,0x02,0x01,0x00,0x7f,0x7d,0x7c,0x7a, -0x78,0x77,0x75,0x73,0x71,0x70,0x6e,0x6c,0x6b,0x69,0x67,0x66,0x64,0x62,0x5f,0x5d, -0x5b,0x58,0x56,0x54,0x51,0x4f,0x4d,0x4b,0x48,0x46,0x44,0x41,0x3f,0x3e,0x3d,0x3c, -0x3a,0x39,0x38,0x37,0x36,0x35,0x34,0x33,0x31,0x30,0x2f,0x2e,0x2d,0x2c,0x2b,0x2a, -0x28,0x27,0x26,0x25,0x24,0x23,0x22,0x21,0x1f,0x1e,0x1d,0x1c,0x1b,0x1a,0x1a,0x19, -0x19,0x18,0x18,0x17,0x16,0x16,0x15,0x15,0x14,0x14,0x13,0x13,0x12,0x11,0x11,0x10, -0x10,0x0f,0x0f,0x0e,0x0d,0x0d,0x0c,0x0c,0x0b,0x0b,0x0a,0x0a,0x09,0x09,0x08,0x08, -0x08,0x08,0x07,0x07,0x07,0x06,0x06,0x06,0x06,0x05,0x05,0x05,0x04,0x04,0x04,0x03, -0x03,0x03,0x03,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x00,0x00,0x7f,0x7e,0x7d,0x7c, -0x7b,0x7a,0x79,0x78,0x77,0x77,0x76,0x75,0x74,0x73,0x72,0x71,0x70,0x6f,0x6d,0x6c, -0x6b,0x69,0x68,0x67,0x65,0x64,0x63,0x62,0x60,0x5f,0x5e,0x5c,0x5b,0x59,0x57,0x55, -0x53,0x52,0x50,0x4e,0x4c,0x4a,0x48,0x46,0x44,0x43,0x41,0x3f,0x3d,0x3b,0x39,0x37, -0x35,0x34,0x32,0x30,0x2e,0x2c,0x2a,0x28,0x26,0x25,0x23,0x21,0x1f,0x1e,0x1e,0x1d, -0x1c,0x1c,0x1b,0x1a,0x1a,0x19,0x18,0x18,0x17,0x16,0x16,0x15,0x14,0x14,0x13,0x13, -0x12,0x11,0x11,0x10,0x0f,0x0f,0x0e,0x0d,0x0d,0x0c,0x0b,0x0b,0x0a,0x0a,0x09,0x09, -0x09,0x08,0x08,0x08,0x07,0x07,0x07,0x06,0x06,0x06,0x05,0x05,0x05,0x05,0x04,0x04, -0x04,0x03,0x03,0x03,0x02,0x02,0x02,0x01,0x01,0x01,0x00,0x00,0x7f,0x7f,0x7f,0x7f, -0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f, -0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f, -0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f, -0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f, -0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f, -0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f, -0x0b,0x0b,0x0a,0x0a,0x0a,0x09,0x09,0x08,0x08,0x08,0x07,0x07,0x06,0x06,0x05,0x05, -0x05,0x04,0x04,0x03,0x03,0x03,0x02,0x02,0x01,0x01,0x00,0x00,0x7f,0x7d,0x7c,0x7a, -0x78,0x77,0x75,0x74,0x72,0x70,0x6f,0x6d,0x6b,0x6a,0x68,0x67,0x65,0x63,0x61,0x5f, -0x5d,0x5c,0x5a,0x58,0x56,0x54,0x52,0x50,0x4e,0x4d,0x4b,0x49,0x47,0x46,0x45,0x44, -0x43,0x42,0x40,0x3f,0x3e,0x3d,0x3c,0x3b,0x3a,0x39,0x38,0x37,0x35,0x34,0x33,0x32, -0x31,0x30,0x2f,0x2e,0x2d,0x2c,0x2b,0x29,0x28,0x27,0x26,0x25,0x24,0x23,0x23,0x22, -0x21,0x21,0x20,0x1f,0x1f,0x1e,0x1d,0x1d,0x1c,0x1b,0x1b,0x1a,0x19,0x19,0x18,0x18, -0x17,0x16,0x16,0x15,0x15,0x14,0x13,0x13,0x12,0x11,0x11,0x10,0x0f,0x0d,0x0c,0x0c, -0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f, -0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7c,0x79,0x77, -0x74,0x71,0x6e,0x6c,0x69,0x65,0x62,0x5e,0x5b,0x57,0x54,0x50,0x4d,0x4b,0x48,0x46, -0x44,0x42,0x3f,0x3d,0x3b,0x3a,0x39,0x38,0x36,0x35,0x34,0x33,0x32,0x31,0x30,0x2f, -0x2e,0x2d,0x2c,0x2b,0x2a,0x29,0x28,0x27,0x26,0x26,0x25,0x24,0x23,0x22,0x21,0x20, -0x1f,0x1f,0x1e,0x1d,0x1c,0x1b,0x1a,0x19,0x18,0x18,0x17,0x16,0x15,0x14,0x14,0x13, -0x12,0x12,0x11,0x11,0x10,0x0f,0x0f,0x0e,0x0e,0x0d,0x0d,0x0d,0x0d,0x0c,0x0c,0x0b, -0x0b,0x0b,0x0a,0x0a,0x09,0x09,0x08,0x08,0x08,0x07,0x07,0x07,0x07,0x06,0x06,0x06, -0x06,0x05,0x05,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x03,0x03,0x03,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x7f,0x7c,0x7a,0x78, -0x76,0x74,0x72,0x70,0x6d,0x6a,0x68,0x65,0x63,0x60,0x5d,0x5b,0x58,0x56,0x53,0x51, -0x4f,0x4d,0x4a,0x48,0x46,0x44,0x43,0x41,0x3f,0x3d,0x3c,0x3a,0x38,0x37,0x36,0x35, -0x34,0x33,0x32,0x31,0x30,0x2f,0x2e,0x2d,0x2b,0x2b,0x2a,0x29,0x28,0x27,0x26,0x25, -0x23,0x23,0x22,0x21,0x20,0x1f,0x1e,0x1d,0x1b,0x1b,0x1a,0x19,0x18,0x17,0x17,0x16, -0x15,0x15,0x14,0x14,0x13,0x12,0x12,0x11,0x11,0x10,0x10,0x10,0x0f,0x0e,0x0e,0x0d, -0x0d,0x0d,0x0c,0x0c,0x0b,0x0b,0x0a,0x0a,0x09,0x09,0x08,0x08,0x08,0x07,0x07,0x07, -0x07,0x06,0x06,0x05,0x05,0x05,0x05,0x05,0x05,0x04,0x04,0x04,0x03,0x03,0x03,0x02, -0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00, -0x14,0x27,0x4c,0x41,0x28,0x2d,0x4c,0x52,0x2e,0x33,0x4c,0x63,0x34,0x39,0x4c,0x74, -0x3a,0x3f,0x4c,0x85,0x40,0x45,0x4c,0x96,0x46,0x4b,0x4c,0xa7,0x4c,0x52,0x4c,0xb8, -0x53,0x58,0x4c,0xc9,0x59,0x6d,0x4c,0xda,0x0a,0x00,0x00,0x00,0x14,0x2d,0x4c,0xeb, -0x2e,0x33,0x4c,0xfc,0x34,0x39,0x4d,0x0d,0x3a,0x3f,0x4d,0x1e,0x40,0x45,0x4d,0x2f, -0x46,0x4b,0x4d,0x40,0x4c,0x52,0x4d,0x51,0x53,0x58,0x4d,0x62,0x59,0x5e,0x4d,0x73, -0x5f,0x6d,0x4d,0x84,0x0b,0x00,0x00,0x00,0x14,0x2d,0x4d,0x95,0x2e,0x33,0x4d,0xa6, -0x34,0x39,0x4d,0xb7,0x3a,0x3f,0x4d,0xc8,0x40,0x45,0x4d,0xd9,0x46,0x4b,0x4d,0xea, -0x4c,0x52,0x4d,0xfb,0x53,0x58,0x4e,0x0c,0x59,0x5e,0x4e,0x1d,0x5f,0x6d,0x4e,0x2e, -0x00,0x7f,0x4e,0x3f,0x14,0x00,0x00,0x00,0x14,0x27,0x4e,0x50,0x28,0x2d,0x4e,0x61, -0x2e,0x33,0x4e,0x72,0x34,0x39,0x4e,0x83,0x3a,0x3f,0x4e,0x94,0x40,0x45,0x4e,0xa5, -0x46,0x4b,0x4e,0xb6,0x4c,0x52,0x4e,0xc7,0x53,0x58,0x4e,0xd8,0x59,0x6d,0x4e,0xe9, -0x14,0x27,0x4e,0xfa,0x28,0x2d,0x4f,0x0b,0x2e,0x33,0x4f,0x1c,0x34,0x39,0x4f,0x2d, -0x3a,0x3f,0x4f,0x3e,0x40,0x45,0x4f,0x4f,0x46,0x4b,0x4f,0x60,0x4c,0x52,0x4f,0x71, -0x53,0x58,0x4f,0x82,0x59,0x6d,0x4f,0x93,0x02,0x00,0x00,0x00,0x00,0x7f,0x4f,0xb5, -0x15,0x6c,0x4f,0xa4,0x14,0x00,0x00,0x00,0x14,0x27,0x4f,0xc6,0x28,0x2d,0x4f,0xd7, -0x2e,0x33,0x4f,0xe8,0x34,0x39,0x4f,0xf9,0x3a,0x3f,0x50,0x0a,0x40,0x45,0x50,0x1b, -0x46,0x4b,0x50,0x2c,0x4c,0x52,0x50,0x3d,0x53,0x58,0x50,0x4e,0x59,0x6d,0x50,0x5f, -0x14,0x2d,0x50,0x70,0x2e,0x33,0x50,0x81,0x34,0x39,0x50,0x92,0x3a,0x3f,0x50,0xa3, -0x40,0x45,0x50,0xb4,0x46,0x4b,0x50,0xc5,0x4c,0x52,0x50,0xd6,0x53,0x58,0x50,0xe7, -0x59,0x5e,0x50,0xf8,0x5f,0x6d,0x51,0x09,0x05,0x00,0x00,0x00,0x15,0x39,0x51,0x1a, -0x3a,0x3f,0x51,0x2b,0x40,0x45,0x51,0x3c,0x46,0x4d,0x51,0x4d,0x4e,0x6c,0x51,0x5e, -0x02,0x00,0x00,0x00,0x15,0x51,0x51,0x6f,0x52,0x6c,0x51,0x80,0x01,0x00,0x00,0x00, -0x15,0x6c,0x51,0x91,0x01,0x00,0x00,0x00,0x15,0x6c,0x51,0xa2,0x02,0x00,0x00,0x00, -0x15,0x6c,0x51,0xb3,0x15,0x6c,0x51,0xc4,0x01,0x00,0x00,0x00,0x15,0x6c,0x51,0xd5, -0x04,0x00,0x00,0x00,0x15,0x3f,0x51,0xe6,0x40,0x4c,0x51,0xf7,0x4d,0x5a,0x52,0x08, -0x5b,0x7f,0x52,0x19,0x01,0x00,0x00,0x00,0x00,0x7f,0x52,0x2a,0x01,0x00,0x00,0x00, -0x01,0x7f,0x52,0x3b,0x02,0x00,0x00,0x00,0x00,0x7f,0x52,0x4c,0x00,0x7f,0x52,0x5d, -0x01,0x00,0x00,0x00,0x01,0x7f,0x52,0x6e,0x02,0x00,0x00,0x00,0x15,0x3b,0x52,0x7f, -0x3c,0x6c,0x52,0x90,0x05,0x00,0x00,0x00,0x15,0x30,0x52,0xa1,0x31,0x3c,0x52,0xb2, -0x3d,0x48,0x52,0xc3,0x49,0x54,0x52,0xd4,0x55,0x6c,0x52,0xe5,0x05,0x00,0x00,0x00, -0x15,0x29,0x52,0xf6,0x2a,0x30,0x53,0x07,0x31,0x38,0x53,0x18,0x39,0x41,0x53,0x29, -0x42,0x6c,0x53,0x3a,0x02,0x00,0x00,0x00,0x00,0x53,0x53,0x4b,0x54,0x7f,0x53,0x5c, -0x03,0x00,0x00,0x00,0x15,0x4c,0x53,0x6d,0x4d,0x6c,0x53,0x7e,0x15,0x6c,0x53,0x8f, -0x01,0x00,0x00,0x00,0x15,0x6c,0x53,0xa0,0x03,0x00,0x00,0x00,0x00,0x53,0x53,0xb1, -0x54,0x7f,0x53,0xc2,0x15,0x6c,0x53,0xd3,0x05,0x00,0x00,0x00,0x15,0x2f,0x53,0xe4, -0x30,0x36,0x53,0xf5,0x37,0x3c,0x54,0x06,0x3d,0x43,0x54,0x17,0x44,0x60,0x54,0x28, -0x04,0x00,0x00,0x00,0x15,0x31,0x54,0x39,0x32,0x38,0x54,0x4a,0x39,0x47,0x54,0x5b, -0x48,0x6c,0x54,0x6c,0x03,0x00,0x00,0x00,0x15,0x31,0x54,0x7d,0x32,0x3f,0x54,0x8e, -0x40,0x6c,0x54,0x9f,0x08,0x00,0x00,0x00,0x15,0x2c,0x54,0xb0,0x2d,0x31,0x54,0xc1, -0x32,0x38,0x54,0xd2,0x39,0x3f,0x54,0xe3,0x40,0x44,0x54,0xf4,0x45,0x4b,0x55,0x05, -0x4c,0x54,0x55,0x16,0x55,0x6c,0x55,0x27,0x01,0x00,0x00,0x00,0x01,0x7f,0x55,0x38, -0x02,0x00,0x00,0x00,0x00,0x40,0x55,0x49,0x41,0x7f,0x55,0x5a,0x09,0x00,0x00,0x00, -0x15,0x2a,0x55,0x6b,0x2b,0x2e,0x55,0x7c,0x2f,0x32,0x55,0x8d,0x33,0x36,0x55,0x9e, -0x37,0x3a,0x55,0xaf,0x3b,0x3e,0x55,0xc0,0x3f,0x42,0x55,0xd1,0x43,0x46,0x55,0xe2, -0x47,0x6c,0x55,0xf3,0x03,0x00,0x00,0x00,0x15,0x44,0x56,0x04,0x45,0x49,0x56,0x15, -0x4a,0x6c,0x56,0x26,0x02,0x00,0x00,0x00,0x15,0x30,0x56,0x37,0x31,0x6c,0x56,0x48, -0x04,0x00,0x00,0x00,0x01,0x20,0x56,0x59,0x21,0x25,0x56,0x6a,0x26,0x2a,0x56,0x7b, -0x2b,0x7f,0x56,0x8c,0x05,0x00,0x00,0x00,0x15,0x23,0x56,0x9d,0x24,0x2a,0x56,0xae, -0x2b,0x2f,0x56,0xbf,0x30,0x47,0x56,0xd0,0x48,0x6c,0x56,0xe1,0x01,0x00,0x00,0x00, -0x01,0x7f,0x56,0xf2,0x01,0x00,0x00,0x00,0x15,0x6c,0x57,0x03,0x01,0x00,0x00,0x00, -0x01,0x7f,0x57,0x14,0x01,0x00,0x00,0x00,0x15,0x6c,0x57,0x25,0x01,0x00,0x00,0x00, -0x00,0x7f,0x57,0x36,0x0a,0x00,0x00,0x00,0x15,0x3a,0x57,0x47,0x3b,0x3f,0x57,0x58, -0x40,0x41,0x57,0x69,0x42,0x44,0x57,0x7a,0x45,0x47,0x57,0x8b,0x48,0x4a,0x57,0x9c, -0x4b,0x4c,0x57,0xad,0x4d,0x4e,0x57,0xbe,0x4f,0x51,0x57,0xcf,0x52,0x6c,0x57,0xe0, -0x0c,0x00,0x00,0x00,0x15,0x32,0x57,0xf1,0x33,0x35,0x58,0x02,0x36,0x38,0x58,0x13, -0x39,0x3d,0x58,0x24,0x3e,0x3f,0x58,0x35,0x40,0x42,0x58,0x46,0x43,0x45,0x58,0x57, -0x46,0x48,0x58,0x68,0x49,0x4a,0x58,0x79,0x4b,0x4c,0x58,0x8a,0x4d,0x4f,0x58,0x9b, -0x50,0x6c,0x58,0xac,0x05,0x00,0x00,0x00,0x15,0x2d,0x58,0xbd,0x2e,0x37,0x58,0xce, -0x38,0x3e,0x58,0xdf,0x3f,0x44,0x58,0xf0,0x45,0x6c,0x59,0x01,0x02,0x00,0x00,0x00, -0x15,0x29,0x59,0x12,0x2a,0x6c,0x59,0x23,0x05,0x00,0x00,0x00,0x15,0x3b,0x59,0x34, -0x3c,0x41,0x59,0x45,0x42,0x47,0x59,0x56,0x48,0x52,0x59,0x67,0x53,0x6c,0x59,0x78, -0x05,0x00,0x00,0x00,0x15,0x32,0x59,0x89,0x33,0x3b,0x59,0x9a,0x3c,0x42,0x59,0xab, -0x43,0x48,0x59,0xbc,0x49,0x6c,0x59,0xcd,0x02,0x00,0x00,0x00,0x15,0x46,0x59,0xde, -0x47,0x6c,0x59,0xef,0x01,0x00,0x00,0x00,0x15,0x6c,0x5a,0x00,0x05,0x00,0x00,0x00, -0x15,0x3b,0x5a,0x11,0x3c,0x41,0x5a,0x22,0x42,0x47,0x5a,0x33,0x48,0x52,0x5a,0x44, -0x53,0x6c,0x5a,0x55,0x05,0x00,0x00,0x00,0x15,0x3b,0x5a,0x66,0x3c,0x41,0x5a,0x77, -0x42,0x47,0x5a,0x88,0x48,0x52,0x5a,0x99,0x53,0x6c,0x5a,0xaa,0x02,0x00,0x00,0x00, -0x05,0x71,0x5a,0xbb,0x15,0x6c,0x5a,0xcc,0x02,0x00,0x00,0x00,0x15,0x6c,0x5a,0xdd, -0x15,0x6c,0x5a,0xee,0x04,0x00,0x00,0x00,0x15,0x3a,0x5a,0xff,0x3b,0x40,0x5b,0x10, -0x41,0x47,0x5b,0x21,0x48,0x6c,0x5b,0x32,0x01,0x00,0x00,0x00,0x15,0x6c,0x5b,0x43, -0x01,0x00,0x00,0x00,0x15,0x6c,0x5b,0x54,0x01,0x00,0x00,0x00,0x15,0x6c,0x5b,0x65, -0x06,0x00,0x00,0x00,0x15,0x3c,0x5b,0x76,0x3d,0x43,0x5b,0x87,0x44,0x48,0x5b,0x98, -0x49,0x4e,0x5b,0xa9,0x4f,0x55,0x5b,0xba,0x56,0x6c,0x5b,0xcb,0x03,0x00,0x00,0x00, -0x15,0x3a,0x5b,0xdc,0x3b,0x3f,0x5b,0xed,0x40,0x6c,0x5b,0xfe,0x02,0x00,0x00,0x00, -0x15,0x2d,0x5c,0x0f,0x2e,0x6c,0x5c,0x20,0x02,0x00,0x00,0x00,0x15,0x45,0x5c,0x31, -0x46,0x6c,0x5c,0x42,0x02,0x00,0x00,0x00,0x15,0x49,0x5c,0x53,0x4a,0x6c,0x5c,0x64, -0x02,0x00,0x00,0x00,0x15,0x42,0x5c,0x75,0x43,0x6c,0x5c,0x86,0x18,0x00,0x00,0x00, -0x01,0x27,0x5c,0x97,0x28,0x2d,0x5c,0xa8,0x2e,0x33,0x5c,0xb9,0x34,0x39,0x5c,0xca, -0x3a,0x3f,0x5c,0xdb,0x40,0x45,0x5c,0xec,0x46,0x4b,0x5c,0xfd,0x4c,0x51,0x5d,0x0e, -0x52,0x57,0x5d,0x1f,0x58,0x5d,0x5d,0x30,0x5e,0x63,0x5d,0x41,0x64,0x7f,0x5d,0x52, -0x01,0x27,0x5d,0x63,0x28,0x2d,0x5d,0x74,0x2e,0x33,0x5d,0x85,0x34,0x39,0x5d,0x96, -0x3a,0x3f,0x5d,0xa7,0x40,0x45,0x5d,0xb8,0x46,0x4b,0x5d,0xc9,0x4c,0x51,0x5d,0xda, -0x52,0x57,0x5d,0xeb,0x58,0x5d,0x5d,0xfc,0x5e,0x64,0x5e,0x0d,0x65,0x7f,0x5e,0x1e, -0x0d,0x00,0x00,0x00,0x01,0x27,0x5e,0x2f,0x28,0x2d,0x5e,0x40,0x2e,0x33,0x5e,0x51, -0x34,0x39,0x5e,0x62,0x3a,0x3f,0x5e,0x73,0x40,0x45,0x5e,0x84,0x46,0x4b,0x5e,0x95, -0x4c,0x51,0x5e,0xa6,0x52,0x57,0x5e,0xb7,0x58,0x5d,0x5e,0xc8,0x5e,0x64,0x5e,0xd9, -0x65,0x7f,0x5e,0xea,0x00,0x7f,0x5e,0xfb,0x06,0x00,0x00,0x00,0x15,0x3f,0x5f,0x0c, -0x40,0x45,0x5f,0x1d,0x46,0x4b,0x5f,0x2e,0x4c,0x51,0x5f,0x3f,0x52,0x59,0x5f,0x50, -0x59,0x6c,0x5f,0x61,0x0d,0x00,0x00,0x00,0x15,0x32,0x5f,0x72,0x33,0x35,0x5f,0x83, -0x36,0x3a,0x5f,0x94,0x3b,0x3b,0x5f,0xa5,0x3c,0x3e,0x5f,0xb6,0x3f,0x41,0x5f,0xc7, -0x42,0x44,0x5f,0xd8,0x45,0x47,0x5f,0xe9,0x48,0x4a,0x5f,0xfa,0x4b,0x4d,0x60,0x0b, -0x4e,0x50,0x60,0x1c,0x51,0x53,0x60,0x2d,0x54,0x6c,0x60,0x3e,0x07,0x00,0x00,0x00, -0x24,0x30,0x60,0x4f,0x31,0x34,0x60,0x60,0x35,0x3a,0x60,0x71,0x3b,0x41,0x60,0x82, -0x42,0x47,0x60,0x93,0x48,0x51,0x60,0xa4,0x52,0x6c,0x60,0xb5,0x04,0x00,0x00,0x00, -0x15,0x2d,0x60,0xc6,0x2e,0x34,0x60,0xd7,0x35,0x39,0x60,0xe8,0x3a,0x6c,0x60,0xf9, -0x06,0x00,0x00,0x00,0x15,0x3c,0x61,0x0a,0x3d,0x43,0x61,0x1b,0x44,0x49,0x61,0x2c, -0x4a,0x4f,0x61,0x3d,0x50,0x55,0x61,0x4e,0x56,0x6c,0x61,0x5f,0x03,0x00,0x00,0x00, -0x15,0x38,0x61,0x70,0x39,0x3e,0x61,0x81,0x3f,0x6c,0x61,0x92,0x03,0x00,0x00,0x00, -0x15,0x22,0x61,0xa3,0x23,0x2e,0x61,0xb4,0x2f,0x6c,0x61,0xc5,0x04,0x00,0x00,0x00, -0x15,0x3b,0x61,0xd6,0x3c,0x41,0x61,0xe7,0x42,0x4a,0x61,0xf8,0x4b,0x6c,0x62,0x09, -0x05,0x00,0x00,0x00,0x15,0x40,0x62,0x1a,0x41,0x4d,0x62,0x2b,0x4e,0x53,0x62,0x3c, -0x54,0x5f,0x62,0x4d,0x60,0x6c,0x62,0x5e,0x03,0x00,0x00,0x00,0x15,0x40,0x62,0x6f, -0x41,0x4d,0x62,0x80,0x4e,0x6c,0x62,0x91,0x01,0x00,0x00,0x00,0x15,0x6f,0x62,0xa2, -0x01,0x00,0x00,0x00,0x15,0x6c,0x62,0xb3,0x02,0x00,0x00,0x00,0x15,0x6c,0x62,0xc4, -0x01,0x7f,0x62,0xd5,0x02,0x00,0x00,0x00,0x00,0x7f,0x62,0xe6,0x15,0x6c,0x62,0xf7, -0x01,0x00,0x00,0x00,0x00,0x7f,0x63,0x08,0x01,0x00,0x00,0x00,0x00,0x7f,0x63,0x19, -0x0c,0x00,0x00,0x00,0x01,0x2a,0x63,0x2a,0x2b,0x36,0x63,0x3b,0x37,0x42,0x63,0x4c, -0x43,0x4e,0x63,0x5d,0x4f,0x5a,0x63,0x6e,0x5b,0x7f,0x63,0x7f,0x01,0x2a,0x63,0x90, -0x2b,0x36,0x63,0xa1,0x37,0x42,0x63,0xb2,0x43,0x4e,0x63,0xc3,0x4f,0x5a,0x63,0xd4, -0x5b,0x7f,0x63,0xe5,0x18,0x00,0x00,0x00,0x01,0x27,0x63,0xf6,0x28,0x2d,0x64,0x07, -0x2e,0x33,0x64,0x18,0x34,0x39,0x64,0x29,0x3a,0x3f,0x64,0x3a,0x40,0x45,0x64,0x4b, -0x46,0x4b,0x64,0x5c,0x4c,0x51,0x64,0x6d,0x52,0x57,0x64,0x7e,0x58,0x5d,0x64,0x8f, -0x5e,0x66,0x64,0xa0,0x67,0x7f,0x64,0xb1,0x01,0x27,0x64,0xc2,0x28,0x2d,0x64,0xd3, -0x2e,0x33,0x64,0xe4,0x34,0x39,0x64,0xf5,0x3a,0x3f,0x65,0x06,0x40,0x45,0x65,0x17, -0x46,0x4b,0x65,0x28,0x4c,0x51,0x65,0x39,0x52,0x57,0x65,0x4a,0x58,0x5d,0x65,0x5b, -0x5e,0x66,0x65,0x6c,0x67,0x7f,0x65,0x7d,0x02,0x00,0x00,0x00,0x00,0x7f,0x65,0x8e, -0x15,0x6c,0x65,0x9f,0x02,0x00,0x00,0x00,0x00,0x7f,0x65,0xb0,0x01,0x7f,0x65,0xc1, -0x0e,0x00,0x00,0x00,0x00,0x40,0x65,0xd2,0x41,0x7f,0x65,0xe3,0x01,0x27,0x65,0xf4, -0x28,0x2d,0x66,0x05,0x2e,0x33,0x66,0x16,0x34,0x39,0x66,0x27,0x3a,0x3f,0x66,0x38, -0x40,0x45,0x66,0x49,0x46,0x4b,0x66,0x5a,0x4c,0x51,0x66,0x6b,0x52,0x57,0x66,0x7c, -0x58,0x5d,0x66,0x8d,0x5e,0x66,0x66,0x9e,0x67,0x7f,0x66,0xaf,0x02,0x00,0x00,0x00, -0x00,0x7f,0x66,0xc0,0x15,0x6c,0x66,0xd1,0x0d,0x00,0x00,0x00,0x01,0x27,0x66,0xe2, -0x28,0x2d,0x66,0xf3,0x2e,0x33,0x67,0x04,0x34,0x39,0x67,0x15,0x3a,0x3f,0x67,0x26, -0x40,0x45,0x67,0x37,0x46,0x4b,0x67,0x48,0x4c,0x51,0x67,0x59,0x52,0x57,0x67,0x6a, -0x58,0x5d,0x67,0x7b,0x5e,0x64,0x67,0x8c,0x65,0x7f,0x67,0x9d,0x05,0x71,0x67,0xae, -0x0d,0x00,0x00,0x00,0x00,0x7f,0x67,0xbf,0x01,0x27,0x67,0xd0,0x28,0x2d,0x67,0xe1, -0x2e,0x33,0x67,0xf2,0x34,0x39,0x68,0x03,0x3a,0x3f,0x68,0x14,0x40,0x45,0x68,0x25, -0x46,0x4b,0x68,0x36,0x4c,0x51,0x68,0x47,0x52,0x57,0x68,0x58,0x58,0x5d,0x68,0x69, -0x5e,0x66,0x68,0x7a,0x67,0x7f,0x68,0x8b,0x02,0x00,0x00,0x00,0x15,0x6c,0x68,0x9c, -0x15,0x6c,0x68,0xad,0x02,0x00,0x00,0x00,0x15,0x6c,0x68,0xbe,0x15,0x6c,0x68,0xcf, -0x0d,0x00,0x00,0x00,0x01,0x27,0x68,0xe0,0x28,0x2d,0x68,0xf1,0x2e,0x33,0x69,0x02, -0x34,0x39,0x69,0x13,0x3a,0x3f,0x69,0x24,0x40,0x45,0x69,0x35,0x46,0x4b,0x69,0x46, -0x4c,0x51,0x69,0x57,0x52,0x57,0x69,0x68,0x58,0x5d,0x69,0x79,0x5e,0x66,0x69,0x8a, -0x67,0x7f,0x69,0x9b,0x00,0x7f,0x69,0xac,0x05,0x00,0x00,0x00,0x15,0x3a,0x69,0xbd, -0x3b,0x40,0x69,0xce,0x41,0x47,0x69,0xdf,0x48,0x6c,0x69,0xf0,0x15,0x6c,0x6a,0x01, -0x02,0x00,0x00,0x00,0x15,0x6c,0x6a,0x12,0x00,0x7f,0x6a,0x23,0x05,0x00,0x00,0x00, -0x15,0x31,0x6a,0x34,0x32,0x38,0x6a,0x45,0x39,0x47,0x6a,0x56,0x48,0x6c,0x6a,0x67, -0x00,0x7f,0x6a,0x78,0x02,0x00,0x00,0x00,0x00,0x7f,0x6a,0x89,0x15,0x6c,0x6a,0x9a, -0x18,0x00,0x00,0x00,0x01,0x27,0x6a,0xab,0x28,0x2d,0x6a,0xbc,0x2e,0x33,0x6a,0xcd, -0x34,0x39,0x6a,0xde,0x3a,0x3f,0x6a,0xef,0x40,0x45,0x6b,0x00,0x46,0x4b,0x6b,0x11, -0x4c,0x51,0x6b,0x22,0x52,0x57,0x6b,0x33,0x58,0x5d,0x6b,0x44,0x5e,0x63,0x6b,0x55, -0x64,0x7f,0x6b,0x66,0x01,0x27,0x6b,0x77,0x28,0x2d,0x6b,0x88,0x2e,0x33,0x6b,0x99, -0x34,0x39,0x6b,0xaa,0x3a,0x3f,0x6b,0xbb,0x40,0x45,0x6b,0xcc,0x46,0x4b,0x6b,0xdd, -0x4c,0x51,0x6b,0xee,0x52,0x57,0x6b,0xff,0x58,0x5d,0x6c,0x10,0x5e,0x63,0x6c,0x21, -0x64,0x7f,0x6c,0x32,0x02,0x00,0x00,0x00,0x01,0x7f,0x6c,0x43,0x00,0x7f,0x6c,0x54, -0x02,0x00,0x00,0x00,0x15,0x6c,0x6c,0x65,0x15,0x6c,0x6c,0x76,0x04,0x00,0x00,0x00, -0x15,0x6c,0x6c,0x87,0x15,0x2c,0x6c,0x98,0x2d,0x36,0x6c,0xa9,0x37,0x6c,0x6c,0xba, -0x06,0x00,0x00,0x00,0x05,0x71,0x6c,0xcb,0x15,0x2f,0x6c,0xdc,0x30,0x36,0x6c,0xed, -0x37,0x3c,0x6c,0xfe,0x3d,0x43,0x6d,0x0f,0x44,0x60,0x6d,0x20,0x02,0x00,0x00,0x00, -0x00,0x7f,0x6d,0x31,0x15,0x6c,0x6d,0x42,0x02,0x00,0x00,0x00,0x15,0x6c,0x6d,0x53, -0x15,0x6c,0x6d,0x64,0x02,0x00,0x00,0x00,0x15,0x6c,0x6d,0x75,0x00,0x7f,0x6d,0x86, -0x05,0x00,0x00,0x00,0x15,0x31,0x6d,0x97,0x32,0x38,0x6d,0xa8,0x39,0x47,0x6d,0xb9, -0x48,0x6c,0x6d,0xca,0x15,0x6c,0x6d,0xdb,0x02,0x00,0x00,0x00,0x00,0x83,0x6d,0xec, -0x84,0x7f,0x70,0xfa,0x06,0x00,0x00,0x00,0x15,0x34,0x6d,0xfd,0x35,0x38,0x6e,0x0e, -0x39,0x3c,0x6e,0x1f,0x3d,0x44,0x6e,0x30,0x45,0x4c,0x6e,0x41,0x4d,0x6d,0x6e,0x52, -0x01,0x00,0x00,0x00,0x15,0x6c,0x6e,0x63,0x01,0x00,0x00,0x00,0x00,0x7f,0x6e,0x74, -0x01,0x00,0x00,0x00,0x00,0x7f,0x6e,0x85,0x03,0x00,0x00,0x00,0x15,0x39,0x6e,0x96, -0x15,0x39,0x6e,0xa7,0x3a,0x6c,0x6e,0xb8,0x0a,0x00,0x00,0x00,0x15,0x3a,0x6e,0xc9, -0x3b,0x3f,0x6e,0xda,0x40,0x41,0x6e,0xeb,0x42,0x44,0x6e,0xfc,0x45,0x47,0x6f,0x0d, -0x48,0x4a,0x6f,0x1e,0x4b,0x4c,0x6f,0x2f,0x4d,0x4e,0x6f,0x40,0x4f,0x51,0x6f,0x51, -0x52,0x6c,0x6f,0x62,0x01,0x00,0x00,0x00,0x15,0x6c,0x6f,0x73,0x02,0x00,0x00,0x00, -0x15,0x6c,0x6f,0x84,0x00,0x7f,0x6f,0x95,0x01,0x00,0x00,0x00,0x15,0x6c,0x6f,0xa6, -0x02,0x00,0x00,0x00,0x01,0x7f,0x6f,0xb7,0x15,0x6c,0x6f,0xc8,0x01,0x00,0x00,0x00, -0x15,0x6c,0x6f,0xd9,0x01,0x00,0x00,0x00,0x13,0x6c,0x6f,0xea,0x01,0x00,0x00,0x00, -0x15,0x6c,0x6f,0xfb,0x01,0x00,0x00,0x00,0x15,0x6c,0x70,0x0c,0x01,0x00,0x00,0x00, -0x15,0x6c,0x70,0x1d,0x01,0x00,0x00,0x00,0x15,0x6c,0x70,0x2e,0x01,0x00,0x00,0x00, -0x01,0x7f,0x70,0x3f,0x02,0x00,0x00,0x00,0x15,0x6c,0x70,0x50,0x01,0x7f,0x70,0x61, -0x02,0x00,0x00,0x00,0x15,0x6c,0x70,0x72,0x15,0x6c,0x70,0x83,0x01,0x00,0x00,0x00, -0x15,0x6c,0x70,0x94,0x02,0x00,0x00,0x00,0x0c,0x7f,0x70,0xa5,0x01,0x7f,0x70,0xb6, -0x02,0x00,0x00,0x00,0x15,0x6c,0x70,0xc7,0x15,0x6c,0x70,0xd8,0x01,0x00,0x00,0x00, -0x15,0x6c,0x70,0xe9,0x75,0x0b,0x75,0x37,0x75,0x63,0x75,0x93,0x75,0xe7,0x75,0xf3, -0x76,0x47,0x76,0x5f,0x76,0x6b,0x76,0x73,0x76,0x7b,0x76,0x87,0x76,0x8f,0x76,0xa3, -0x76,0xab,0x76,0xb3,0x76,0xbf,0x76,0xc7,0x76,0xd3,0x76,0xeb,0x77,0x03,0x77,0x0f, -0x77,0x1f,0x77,0x27,0x77,0x37,0x77,0x4f,0x77,0x63,0x77,0x73,0x77,0x97,0x77,0x9f, -0x77,0xab,0x77,0xd3,0x77,0xe3,0x77,0xef,0x78,0x03,0x78,0x1b,0x78,0x23,0x78,0x2b, -0x78,0x33,0x78,0x3b,0x78,0x43,0x78,0x6f,0x78,0xa3,0x78,0xbb,0x78,0xc7,0x78,0xdf, -0x78,0xf7,0x79,0x03,0x79,0x0b,0x79,0x23,0x79,0x3b,0x79,0x47,0x79,0x53,0x79,0x67, -0x79,0x6f,0x79,0x77,0x79,0x7f,0x79,0x9b,0x79,0xab,0x79,0xb7,0x79,0xc3,0x79,0xcf, -0x79,0xdb,0x7a,0x3f,0x7a,0x77,0x7a,0x93,0x7a,0xcb,0x7a,0xeb,0x7a,0xff,0x7b,0x1b, -0x7b,0x2b,0x7b,0x3b,0x7b,0x4f,0x7b,0x67,0x7b,0x77,0x7b,0x7f,0x7b,0x87,0x7b,0x93, -0x7b,0x9f,0x7b,0xa7,0x7b,0xaf,0x7b,0xe3,0x7c,0x47,0x7c,0x53,0x7c,0x5f,0x7c,0x9b, -0x7c,0xa7,0x7c,0xdf,0x7d,0x17,0x7d,0x23,0x7d,0x2f,0x7d,0x67,0x7d,0x7f,0x7d,0x8b, -0x7d,0xa3,0x7d,0xaf,0x7e,0x13,0x7e,0x1f,0x7e,0x2b,0x7e,0x3f,0x7e,0x5b,0x7e,0x67, -0x7e,0x73,0x7e,0x7f,0x7e,0x97,0x7e,0xa3,0x7e,0xbf,0x7e,0xc7,0x7e,0xcf,0x7e,0xd7, -0x7e,0xe7,0x7f,0x13,0x7f,0x1b,0x7f,0x27,0x7f,0x2f,0x7f,0x3b,0x7f,0x43,0x7f,0x4b, -0x7f,0x53,0x7f,0x5b,0x7f,0x63,0x7f,0x6b,0x7f,0x73,0x7f,0x7f,0x7f,0x8b,0x7f,0x93, -0x7f,0x9f,0x7f,0xab,0x71,0x0b,0x71,0x8b,0x72,0x0b,0x72,0x8b,0x73,0x0b,0x73,0x8b, -0x74,0x0b,0x74,0x8b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2f,0x40,0x4d,0x5c, -0x80,0x80,0x79,0x73,0x30,0x3c,0x54,0x60,0x6c,0x80,0x76,0x6c,0x40,0x40,0x40,0x69, -0x80,0x80,0x80,0x39,0x40,0x40,0x40,0x69,0x80,0x80,0x80,0x4f,0x18,0x1a,0x3c,0x54, -0x6b,0x76,0x76,0x76,0x1d,0x35,0x48,0x53,0x73,0x80,0x80,0x73,0x40,0x40,0x4c,0x5c, -0x80,0x80,0x7d,0x69,0x40,0x40,0x57,0x6c,0x80,0x80,0x6f,0x4f,0x40,0x40,0x4a,0x6b, -0x80,0x80,0x7b,0x61,0x1c,0x40,0x5a,0x6b,0x61,0x80,0x65,0x38,0x28,0x40,0x58,0x70, -0x67,0x75,0x81,0x79,0x18,0x24,0x3c,0x54,0x8a,0x6e,0x82,0x7d,0x1c,0x32,0x40,0x65, -0x59,0x80,0x80,0x65,0x1a,0x33,0x5a,0x69,0x4f,0x80,0x80,0x67,0x40,0x40,0x54,0x69, -0x80,0x80,0x7b,0x65,0x40,0x40,0x53,0x68,0x80,0x80,0x7d,0x63,0x1b,0x3c,0x56,0x6c, -0x5f,0x80,0x7d,0x77,0x24,0x30,0x48,0x54,0x72,0x78,0x78,0x70,0x40,0x40,0x5e,0x6d, -0x80,0x80,0x6f,0x2d,0x40,0x40,0x5d,0x6c,0x80,0x80,0x75,0x2b,0x40,0x40,0x54,0x71, -0x80,0x80,0x5f,0x35,0x40,0x40,0x49,0x6a,0x80,0x80,0x79,0x5b,0x40,0x40,0x5a,0x73, -0x80,0x80,0x7b,0x49,0x40,0x40,0x5a,0x68,0x80,0x80,0x6b,0x4d,0x40,0x40,0x56,0x74, -0x80,0x80,0x75,0x5d,0x2b,0x40,0x5d,0x74,0x76,0x80,0x6b,0x53,0x40,0x40,0x5b,0x6e, -0x76,0x80,0x61,0x3e,0x40,0x40,0x5b,0x62,0x80,0x80,0x65,0x1f,0x40,0x40,0x5b,0x68, -0x80,0x80,0x7b,0x63,0x40,0x40,0x5b,0x6a,0x80,0x80,0x79,0x63,0x40,0x40,0x57,0x60, -0x80,0x80,0x7a,0x49,0x40,0x4d,0x58,0x67,0x80,0x80,0x7a,0x4b,0x40,0x4e,0x5a,0x67, -0x80,0x80,0x79,0x5f,0x40,0x4d,0x5d,0x6f,0x80,0x80,0x79,0x4d,0x40,0x40,0x4e,0x6d, -0x80,0x80,0x6a,0x4c,0x40,0x4e,0x58,0x6e,0x80,0x80,0x7b,0x31,0x40,0x40,0x58,0x69, -0x80,0x80,0x7c,0x29,0x18,0x3c,0x48,0x54,0x8d,0x87,0x9a,0x7a,0x1f,0x25,0x40,0x54, -0x8b,0x80,0x75,0x4b,0x1c,0x28,0x40,0x68,0x8b,0x80,0x80,0x2e,0x40,0x40,0x56,0x67, -0x80,0x80,0x6f,0x4f,0x40,0x40,0x50,0x61,0x80,0x80,0x59,0x2d,0x40,0x40,0x4e,0x67, -0x80,0x80,0x6c,0x2a,0x40,0x40,0x50,0x64,0x80,0x80,0x63,0x21,0x40,0x40,0x54,0x66, -0x80,0x80,0x71,0x45,0x40,0x40,0x5c,0x6c,0x80,0x80,0x6f,0x4b,0x40,0x40,0x5a,0x6d, -0x80,0x80,0x73,0x29,0x40,0x40,0x56,0x6a,0x80,0x80,0x65,0x27,0x18,0x30,0x48,0x54, -0x86,0x86,0x7d,0x69,0x40,0x40,0x44,0x67,0x80,0x80,0x79,0x29,0x40,0x40,0x5e,0x77, -0x80,0x80,0x73,0x62,0x40,0x40,0x52,0x63,0x80,0x80,0x73,0x61,0x40,0x40,0x54,0x65, -0x80,0x80,0x79,0x63,0x24,0x3c,0x48,0x54,0x7b,0x79,0x6c,0x48,0x40,0x40,0x5e,0x70, -0x80,0x80,0x7b,0x72,0x40,0x40,0x61,0x70,0x80,0x80,0x7b,0x71,0x20,0x40,0x5a,0x75, -0x80,0x80,0x71,0x2b,0x2b,0x40,0x5d,0x75,0x80,0x80,0x71,0x24,0x40,0x40,0x51,0x63, -0x80,0x80,0x6d,0x3d,0x40,0x40,0x52,0x5f,0x80,0x80,0x73,0x51,0x40,0x40,0x56,0x69, -0x80,0x80,0x6b,0x37,0x40,0x4e,0x63,0x75,0x80,0x80,0x76,0x4e,0x40,0x4c,0x5b,0x68, -0x80,0x80,0x77,0x63,0x24,0x30,0x48,0x54,0x6b,0x72,0x78,0x75,0x40,0x40,0x54,0x66, -0x80,0x80,0x7f,0x5f,0x40,0x40,0x52,0x60,0x80,0x80,0x77,0x23,0x40,0x40,0x52,0x68, -0x80,0x80,0x75,0x43,0x40,0x40,0x56,0x67,0x80,0x80,0x78,0x49,0x40,0x4d,0x5b,0x67, -0x80,0x80,0x78,0x32,0x40,0x55,0x5b,0x66,0x80,0x7d,0x6f,0x07,0x40,0x4c,0x57,0x6c, -0x80,0x80,0x77,0x2d,0x40,0x4c,0x54,0x67,0x80,0x80,0x77,0x4b,0x2d,0x40,0x50,0x5d, -0x6d,0x80,0x76,0x24,0x40,0x40,0x4f,0x5b,0x80,0x80,0x75,0x3f,0x40,0x40,0x40,0x73, -0x80,0x80,0x80,0x29,0x40,0x40,0x55,0x70,0x80,0x80,0x7a,0x07,0x40,0x40,0x53,0x6f, -0x80,0x80,0x7b,0x11,0x40,0x40,0x56,0x62,0x80,0x80,0x80,0x0d,0x2d,0x39,0x4d,0x69, -0x71,0x80,0x7b,0x68,0x40,0x40,0x5e,0x6f,0x80,0x80,0x71,0x47,0x40,0x40,0x4e,0x5f, -0x80,0x80,0x79,0x42,0x40,0x40,0x55,0x66,0x80,0x80,0x6b,0x43,0x25,0x40,0x58,0x65, -0x69,0x80,0x79,0x73,0x40,0x40,0x55,0x61,0x80,0x80,0x7b,0x63,0x18,0x3c,0x48,0x54, -0x72,0x63,0x5f,0x63,0x29,0x40,0x5c,0x67,0x6e,0x80,0x7a,0x58,0x2d,0x40,0x59,0x68, -0x73,0x80,0x75,0x59,0x40,0x40,0x5f,0x75,0x80,0x80,0x73,0x64,0x40,0x40,0x55,0x6e, -0x80,0x80,0x73,0x49,0x40,0x40,0x48,0x5a,0x80,0x80,0x73,0x5f,0x1c,0x40,0x5e,0x67, -0x5f,0x80,0x77,0x61,0x1c,0x40,0x5b,0x67,0x71,0x80,0x73,0x5b,0x40,0x40,0x5c,0x6f, -0x80,0x80,0x73,0x57,0x40,0x40,0x5e,0x6f,0x80,0x80,0x71,0x49,0x40,0x4c,0x5b,0x6c, -0x80,0x80,0x76,0x58,0x40,0x40,0x5e,0x6b,0x80,0x80,0x73,0x57,0x40,0x40,0x5c,0x72, -0x80,0x80,0x6f,0x4e,0x40,0x40,0x59,0x6c,0x80,0x80,0x71,0x59,0x40,0x40,0x5c,0x6e, -0x80,0x80,0x71,0x45,0x40,0x40,0x58,0x6d,0x80,0x80,0x71,0x54,0x40,0x40,0x63,0x74, -0x80,0x80,0x6e,0x51,0x40,0x4e,0x5f,0x6c,0x80,0x80,0x6d,0x59,0x40,0x4c,0x5d,0x72, -0x80,0x80,0x71,0x56,0x40,0x40,0x56,0x69,0x80,0x80,0x6d,0x4f,0x40,0x40,0x5c,0x6f, -0x80,0x80,0x6b,0x49,0x18,0x30,0x48,0x54,0x8c,0x7a,0x7a,0x78,0x40,0x4c,0x5d,0x74, -0x80,0x80,0x77,0x55,0x40,0x40,0x60,0x71,0x80,0x80,0x71,0x53,0x33,0x4c,0x5a,0x6d, -0x74,0x80,0x77,0x62,0x40,0x40,0x5d,0x6d,0x80,0x80,0x70,0x4b,0x40,0x40,0x5c,0x6b, -0x80,0x80,0x6c,0x47,0x30,0x3c,0x48,0x54,0x78,0x73,0x72,0x71,0x30,0x3c,0x48,0x54, -0x78,0x73,0x72,0x71,0x18,0x30,0x3c,0x54,0x8b,0x88,0x8a,0x82,0x18,0x30,0x3c,0x54, -0x8b,0x88,0x8a,0x82,0x40,0x40,0x5c,0x6c,0x80,0x80,0x73,0x5a,0x40,0x40,0x58,0x71, -0x80,0x80,0x73,0x5c,0x40,0x40,0x5c,0x6b,0x80,0x80,0x73,0x61,0x40,0x40,0x5b,0x6c, -0x80,0x80,0x71,0x4e,0x40,0x40,0x5d,0x6e,0x80,0x80,0x73,0x4e,0x40,0x40,0x64,0x71, -0x80,0x80,0x71,0x4b,0x24,0x3c,0x48,0x54,0x5a,0x6e,0x79,0x76,0x40,0x40,0x60,0x73, -0x80,0x80,0x65,0x4d,0x40,0x4c,0x5b,0x6b,0x80,0x80,0x75,0x5d,0x40,0x48,0x5c,0x6b, -0x80,0x80,0x75,0x61,0x40,0x49,0x60,0x6f,0x80,0x80,0x75,0x65,0x40,0x51,0x63,0x72, -0x7e,0x80,0x76,0x62,0x40,0x40,0x5f,0x75,0x80,0x80,0x75,0x63,0x40,0x40,0x5a,0x70, -0x80,0x80,0x75,0x5b,0x40,0x40,0x63,0x76,0x80,0x80,0x77,0x55,0x40,0x40,0x5f,0x70, -0x80,0x80,0x73,0x55,0x40,0x40,0x5a,0x6a,0x80,0x80,0x6c,0x4d,0x40,0x40,0x55,0x6c, -0x80,0x80,0x75,0x4a,0x40,0x40,0x5c,0x73,0x80,0x80,0x71,0x5d,0x40,0x40,0x5b,0x6f, -0x80,0x80,0x74,0x51,0x40,0x40,0x63,0x75,0x80,0x80,0x75,0x58,0x40,0x40,0x5f,0x74, -0x80,0x80,0x73,0x55,0x24,0x3c,0x48,0x54,0x6e,0x6a,0x5d,0x64,0x24,0x3c,0x48,0x54, -0x6e,0x6a,0x5d,0x64,0x24,0x30,0x48,0x54,0x73,0x78,0x7d,0x76,0x40,0x40,0x54,0x68, -0x80,0x80,0x80,0x4f,0x24,0x3c,0x48,0x54,0x7b,0x7f,0x83,0x6e,0x40,0x40,0x54,0x67, -0x80,0x80,0x67,0x42,0x40,0x40,0x55,0x68,0x80,0x80,0x77,0x57,0x24,0x3c,0x48,0x54, -0x77,0x7e,0x7a,0x68,0x24,0x3c,0x48,0x54,0x77,0x7e,0x7a,0x68,0x18,0x24,0x3c,0x54, -0x67,0x5e,0x79,0x84,0x40,0x40,0x54,0x63,0x80,0x80,0x73,0x2f,0x40,0x40,0x54,0x6c, -0x80,0x80,0x71,0x2b,0x40,0x40,0x4e,0x5f,0x80,0x80,0x69,0x47,0x40,0x40,0x48,0x6c, -0x80,0x80,0x80,0x8c,0x40,0x40,0x5e,0x72,0x80,0x80,0x75,0x67,0x40,0x40,0x60,0x71, -0x80,0x80,0x75,0x61,0x40,0x40,0x60,0x6a,0x80,0x80,0x7b,0x31,0x40,0x40,0x59,0x73, -0x80,0x80,0x7b,0x6b,0x40,0x40,0x55,0x60,0x80,0x80,0x7b,0x31,0x40,0x40,0x5e,0x6f, -0x80,0x80,0x67,0x53,0x40,0x40,0x54,0x6a,0x80,0x80,0x6f,0x43,0x40,0x40,0x5c,0x73, -0x80,0x80,0x75,0x52,0x40,0x40,0x59,0x75,0x80,0x80,0x71,0x52,0x40,0x40,0x5f,0x75, -0x80,0x80,0x75,0x5d,0x40,0x40,0x60,0x79,0x80,0x80,0x71,0x59,0x40,0x40,0x65,0x75, -0x80,0x80,0x77,0x5b,0x40,0x40,0x61,0x73,0x80,0x80,0x79,0x5f,0x40,0x40,0x58,0x69, -0x80,0x80,0x75,0x57,0x40,0x40,0x55,0x66,0x80,0x80,0x6b,0x51,0x40,0x40,0x51,0x66, -0x80,0x80,0x6d,0x53,0x40,0x40,0x55,0x6a,0x80,0x80,0x71,0x61,0x40,0x40,0x54,0x62, -0x80,0x80,0x79,0x61,0x40,0x40,0x5b,0x6c,0x80,0x80,0x75,0x65,0x40,0x40,0x60,0x70, -0x80,0x80,0x73,0x59,0x40,0x40,0x61,0x6d,0x80,0x80,0x77,0x63,0x40,0x40,0x59,0x6a, -0x80,0x80,0x73,0x5d,0x40,0x40,0x51,0x69,0x80,0x80,0x79,0x69,0x40,0x40,0x57,0x69, -0x80,0x80,0x73,0x61,0x40,0x40,0x56,0x67,0x80,0x80,0x75,0x6b,0x40,0x40,0x5b,0x6d, -0x80,0x80,0x77,0x69,0x40,0x40,0x5c,0x69,0x80,0x80,0x75,0x65,0x40,0x40,0x5b,0x6c, -0x80,0x80,0x71,0x5b,0x40,0x49,0x56,0x62,0x80,0x80,0x6f,0x21,0x40,0x55,0x62,0x6e, -0x80,0x80,0x6f,0x25,0x40,0x40,0x5d,0x70,0x80,0x80,0x73,0x59,0x40,0x40,0x5e,0x76, -0x80,0x80,0x69,0x29,0x40,0x41,0x41,0x42,0x80,0x80,0x80,0x00,0x41,0x42,0x55,0x66, -0x00,0x80,0x75,0x55,0x40,0x40,0x57,0x68,0x80,0x80,0x73,0x49,0x40,0x40,0x52,0x68, -0x80,0x80,0x65,0x47,0x40,0x40,0x56,0x66,0x80,0x80,0x71,0x43,0x40,0x40,0x54,0x63, -0x80,0x80,0x71,0x4f,0x40,0x40,0x51,0x69,0x80,0x80,0x65,0x3d,0x40,0x40,0x53,0x68, -0x80,0x80,0x67,0x3f,0x40,0x40,0x55,0x67,0x80,0x80,0x65,0x35,0x40,0x40,0x55,0x68, -0x80,0x80,0x5d,0x39,0x40,0x40,0x59,0x72,0x80,0x80,0x6b,0x47,0x40,0x40,0x59,0x71, -0x80,0x80,0x6b,0x47,0x40,0x53,0x5b,0x6d,0x80,0x80,0x65,0x45,0x40,0x52,0x5c,0x73, -0x80,0x80,0x75,0x61,0x40,0x51,0x5f,0x6b,0x80,0x80,0x65,0x51,0x40,0x4d,0x60,0x6d, -0x80,0x80,0x6d,0x59,0x40,0x40,0x5a,0x6b,0x80,0x80,0x71,0x60,0x40,0x40,0x5a,0x72, -0x80,0x80,0x73,0x61,0x40,0x40,0x5b,0x6f,0x80,0x80,0x69,0x43,0x40,0x40,0x5a,0x6a, -0x80,0x80,0x77,0x57,0x40,0x49,0x54,0x60,0x80,0x80,0x79,0x4b,0x40,0x40,0x4f,0x67, -0x80,0x80,0x7a,0x4b,0x40,0x40,0x56,0x68,0x80,0x80,0x77,0x59,0x40,0x40,0x4d,0x54, -0x80,0x80,0x79,0x4d,0x40,0x40,0x5b,0x60,0x80,0x80,0x71,0x2c,0x40,0x5b,0x60,0x65, -0x00,0x00,0x80,0x64,0x40,0x40,0x55,0x62,0x80,0x80,0x6b,0x43,0x40,0x40,0x53,0x65, -0x80,0x80,0x6d,0x57,0x40,0x40,0x52,0x66,0x80,0x80,0x71,0x63,0x40,0x40,0x52,0x68, -0x80,0x80,0x69,0x53,0x40,0x40,0x5c,0x6e,0x80,0x80,0x73,0x4f,0x40,0x40,0x54,0x66, -0x80,0x80,0x6f,0x4f,0x40,0x4f,0x5d,0x6e,0x80,0x80,0x6d,0x4f,0x40,0x40,0x5b,0x6f, -0x80,0x80,0x73,0x55,0x40,0x40,0x55,0x66,0x80,0x80,0x71,0x5d,0x40,0x40,0x54,0x69, -0x80,0x80,0x73,0x5a,0x40,0x40,0x40,0x4c,0x80,0x80,0x82,0x02,0x35,0x41,0x59,0x6b, -0x00,0x80,0x67,0x2f,0x40,0x40,0x62,0x71,0x80,0x80,0x73,0x53,0x40,0x40,0x62,0x73, -0x80,0x80,0x73,0x57,0x40,0x40,0x5a,0x6d,0x80,0x80,0x77,0x63,0x40,0x40,0x5c,0x6d, -0x80,0x80,0x75,0x67,0x40,0x40,0x66,0x6f,0x80,0x80,0x71,0x4d,0x40,0x40,0x66,0x6e, -0x80,0x80,0x65,0x37,0x40,0x40,0x61,0x6d,0x80,0x80,0x73,0x5d,0x40,0x40,0x5e,0x6c, -0x80,0x80,0x6f,0x57,0x40,0x40,0x5f,0x6f,0x80,0x80,0x6d,0x4f,0x40,0x40,0x5b,0x72, -0x80,0x80,0x71,0x57,0x40,0x40,0x63,0x72,0x80,0x80,0x75,0x48,0x40,0x56,0x69,0x77, -0x80,0x80,0x6c,0x51,0x40,0x4f,0x64,0x74,0x80,0x80,0x6b,0x53,0x1e,0x2a,0x36,0x37, -0x80,0x80,0x80,0x00,0x40,0x40,0x5a,0x69,0x80,0x80,0x6c,0x4b,0x40,0x40,0x55,0x68, -0x80,0x80,0x71,0x4d,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x00,0x00,0x01,0x02,0x03, -0x04,0x05,0x06,0x07,0x01,0xf0,0x7e,0x00,0x09,0x01,0xf7,0x7f,0x7f,0x7f,0x7f,0x7f, -0x7f,0x7f,0x7f,0x7f,0x7a,0x75,0x71,0x6d,0x69,0x66,0x62,0x5f,0x5d,0x5a,0x58,0x55, -0x53,0x51,0x4f,0x4d,0x4b,0x49,0x47,0x46,0x44,0x42,0x41,0x3f,0x3e,0x3d,0x3b,0x3a, -0x39,0x37,0x36,0x35,0x34,0x33,0x32,0x31,0x30,0x2f,0x2e,0x2d,0x2c,0x2b,0x2a,0x29, -0x28,0x27,0x26,0x25,0x25,0x24,0x23,0x22,0x21,0x21,0x20,0x1f,0x1f,0x1e,0x1d,0x1c, -0x1c,0x1b,0x1a,0x1a,0x19,0x19,0x18,0x17,0x17,0x16,0x15,0x15,0x14,0x14,0x13,0x13, -0x12,0x12,0x11,0x10,0x10,0x0f,0x0f,0x0e,0x0e,0x0d,0x0d,0x0c,0x0c,0x0c,0x0b,0x0b, -0x0a,0x0a,0x09,0x09,0x08,0x08,0x07,0x07,0x07,0x06,0x06,0x05,0x05,0x05,0x04,0x04, -0x03,0x03,0x03,0x02,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x01,0x00,0x01,0x00,0x02,0x00,0x02,0x00,0x03,0x00,0x03,0x00,0x04,0x00, -0x04,0x00,0x05,0x00,0x05,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x07,0x00,0x07,0x00, -0x08,0x00,0x08,0x00,0x09,0x00,0x09,0x00,0x0a,0x00,0x0a,0x00,0x0b,0x00,0x0b,0x00, -0x0c,0x00,0x0c,0x00,0x0d,0x00,0x0d,0x00,0x0d,0x00,0x0e,0x00,0x0e,0x00,0x0f,0x00, -0x0f,0x00,0x10,0x00,0x10,0x00,0x11,0x00,0x11,0x00,0x12,0x00,0x12,0x00,0x13,0x00, -0x13,0x00,0x14,0x00,0x14,0x00,0x15,0x00,0x15,0x00,0x15,0x00,0x16,0x00,0x16,0x00, -0x17,0x00,0x17,0x00,0x18,0x00,0x18,0x00,0x19,0x00,0x19,0x00,0x1a,0x00,0x1a,0x00, -0x1b,0x00,0x1b,0x00,0x1c,0x00,0x1c,0x00,0x1d,0x00,0x1d,0x00,0x1e,0x00,0x1e,0x00, -0x1e,0x00,0x1f,0x00,0x1f,0x00,0x20,0x00,0x20,0x00,0x21,0x00,0x21,0x00,0x22,0x00, -0x22,0x00,0x23,0x00,0x23,0x00,0x24,0x00,0x24,0x00,0x25,0x00,0x25,0x00,0x26,0x00, -0x26,0x00,0x27,0x00,0x27,0x00,0x28,0x00,0x28,0x00,0x29,0x00,0x29,0x00,0x29,0x00, -0x2a,0x00,0x2a,0x00,0x2b,0x00,0x2b,0x00,0x2c,0x00,0x2c,0x00,0x2d,0x00,0x2d,0x00, -0x2e,0x00,0x2e,0x00,0x2f,0x00,0x2f,0x00,0x30,0x00,0x30,0x00,0x31,0x00,0x31,0x00, -0x32,0x00,0x32,0x00,0x33,0x00,0x33,0x00,0x34,0x00,0x34,0x00,0x35,0x00,0x35,0x00, -0x36,0x00,0x36,0x00,0x37,0x00,0x37,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x39,0x00, -0x39,0x00,0x3a,0x00,0x3a,0x00,0x3b,0x00,0x3b,0x00,0x3c,0x00,0x3c,0x00,0x3d,0x00, -0x3d,0x00,0x3e,0x00,0x3e,0x00,0x3f,0x00,0x3f,0x00,0x40,0x00,0x40,0x00,0x41,0x00, -0x41,0x00,0x42,0x00,0x42,0x00,0x43,0x00,0x43,0x00,0x44,0x00,0x44,0x00,0x45,0x00, -0x45,0x00,0x46,0x00,0x46,0x00,0x47,0x00,0x47,0x00,0x48,0x00,0x48,0x00,0x49,0x00, -0x49,0x00,0x4a,0x00,0x4a,0x00,0x4b,0x00,0x4b,0x00,0x4c,0x00,0x4c,0x00,0x4d,0x00, -0x4d,0x00,0x4e,0x00,0x4e,0x00,0x4f,0x00,0x4f,0x00,0x50,0x00,0x50,0x00,0x51,0x00, -0x51,0x00,0x52,0x00,0x52,0x00,0x53,0x00,0x53,0x00,0x54,0x00,0x54,0x00,0x55,0x00, -0x55,0x00,0x56,0x00,0x56,0x00,0x57,0x00,0x57,0x00,0x58,0x00,0x58,0x00,0x59,0x00, -0x59,0x00,0x5a,0x00,0x5a,0x00,0x5b,0x00,0x5b,0x00,0x5c,0x00,0x5c,0x00,0x5d,0x00, -0x5d,0x00,0x5e,0x00,0x5e,0x00,0x5f,0x00,0x5f,0x00,0x60,0x00,0x60,0x00,0x61,0x00, -0x61,0x00,0x62,0x00,0x62,0x00,0x63,0x00,0x63,0x00,0x64,0x00,0x64,0x00,0x65,0x00, -0x65,0x00,0x66,0x00,0x66,0x00,0x67,0x00,0x67,0x00,0x68,0x00,0x68,0x00,0x69,0x00, -0x69,0x00,0x6a,0x00,0x6a,0x00,0x6b,0x00,0x6b,0x00,0x6c,0x00,0x6c,0x00,0x6d,0x00, -0x6d,0x00,0x6e,0x00,0x6e,0x00,0x6f,0x00,0x6f,0x00,0x70,0x00,0x71,0x00,0x71,0x00, -0x72,0x00,0x72,0x00,0x73,0x00,0x73,0x00,0x74,0x00,0x74,0x00,0x75,0x00,0x75,0x00, -0x76,0x00,0x76,0x00,0x77,0x00,0x77,0x00,0x78,0x00,0x78,0x00,0x79,0x00,0x79,0x00, -0x7a,0x00,0x7a,0x00,0x7b,0x00,0x7b,0x00,0x7c,0x00,0x7c,0x00,0x7d,0x00,0x7d,0x00, -0x7e,0x00,0x7e,0x00,0x7f,0x00,0x7f,0x00,0x80,0x00,0x81,0x00,0x81,0x00,0x82,0x00, -0x82,0x00,0x83,0x00,0x83,0x00,0x84,0x00,0x84,0x00,0x85,0x00,0x85,0x00,0x86,0x00, -0x86,0x00,0x87,0x00,0x87,0x00,0x88,0x00,0x88,0x00,0x89,0x00,0x89,0x00,0x8a,0x00, -0x8a,0x00,0x8b,0x00,0x8c,0x00,0x8c,0x00,0x8d,0x00,0x8d,0x00,0x8e,0x00,0x8e,0x00, -0x8f,0x00,0x8f,0x00,0x90,0x00,0x90,0x00,0x91,0x00,0x91,0x00,0x92,0x00,0x92,0x00, -0x93,0x00,0x93,0x00,0x94,0x00,0x94,0x00,0x95,0x00,0x96,0x00,0x96,0x00,0x97,0x00, -0x97,0x00,0x98,0x00,0x98,0x00,0x99,0x00,0x99,0x00,0x9a,0x00,0x9a,0x00,0x9b,0x00, -0x9b,0x00,0x9c,0x00,0x9c,0x00,0x9d,0x00,0x9e,0x00,0x9e,0x00,0x9f,0x00,0x9f,0x00, -0xa0,0x00,0xa0,0x00,0xa1,0x00,0xa1,0x00,0xa2,0x00,0xa2,0x00,0xa3,0x00,0xa3,0x00, -0xa4,0x00,0xa4,0x00,0xa5,0x00,0xa6,0x00,0xa6,0x00,0xa7,0x00,0xa7,0x00,0xa8,0x00, -0xa8,0x00,0xa9,0x00,0xa9,0x00,0xaa,0x00,0xaa,0x00,0xab,0x00,0xab,0x00,0xac,0x00, -0xad,0x00,0xad,0x00,0xae,0x00,0xae,0x00,0xaf,0x00,0xaf,0x00,0xb0,0x00,0xb0,0x00, -0xb1,0x00,0xb1,0x00,0xb2,0x00,0xb3,0x00,0xb3,0x00,0xb4,0x00,0xb4,0x00,0xb5,0x00, -0xb5,0x00,0xb6,0x00,0xb6,0x00,0xb7,0x00,0xb7,0x00,0xb8,0x00,0xb8,0x00,0xb9,0x00, -0xba,0x00,0xba,0x00,0xbb,0x00,0xbb,0x00,0xbc,0x00,0xbc,0x00,0xbd,0x00,0xbd,0x00, -0xbe,0x00,0xbf,0x00,0xbf,0x00,0xc0,0x00,0xc0,0x00,0xc1,0x00,0xc1,0x00,0xc2,0x00, -0xc2,0x00,0xc3,0x00,0xc3,0x00,0xc4,0x00,0xc5,0x00,0xc5,0x00,0xc6,0x00,0xc6,0x00, -0xc7,0x00,0xc7,0x00,0xc8,0x00,0xc8,0x00,0xc9,0x00,0xca,0x00,0xca,0x00,0xcb,0x00, -0xcb,0x00,0xcc,0x00,0xcc,0x00,0xcd,0x00,0xcd,0x00,0xce,0x00,0xcf,0x00,0xcf,0x00, -0xd0,0x00,0xd0,0x00,0xd1,0x00,0xd1,0x00,0xd2,0x00,0xd2,0x00,0xd3,0x00,0xd4,0x00, -0xd4,0x00,0xd5,0x00,0xd5,0x00,0xd6,0x00,0xd6,0x00,0xd7,0x00,0xd7,0x00,0xd8,0x00, -0xd9,0x00,0xd9,0x00,0xda,0x00,0xda,0x00,0xdb,0x00,0xdb,0x00,0xdc,0x00,0xdc,0x00, -0xdd,0x00,0xde,0x00,0xde,0x00,0xdf,0x00,0xdf,0x00,0xe0,0x00,0xe0,0x00,0xe1,0x00, -0xe2,0x00,0xe2,0x00,0xe3,0x00,0xe3,0x00,0xe4,0x00,0xe4,0x00,0xe5,0x00,0xe5,0x00, -0xe6,0x00,0xe7,0x00,0xe7,0x00,0xe8,0x00,0xe8,0x00,0xe9,0x00,0xe9,0x00,0xea,0x00, -0xeb,0x00,0xeb,0x00,0xec,0x00,0xec,0x00,0xed,0x00,0xed,0x00,0xee,0x00,0xef,0x00, -0xef,0x00,0xf0,0x00,0xf0,0x00,0xf1,0x00,0xf1,0x00,0xf2,0x00,0xf3,0x00,0xf3,0x00, -0xf4,0x00,0xf4,0x00,0xf5,0x00,0xf5,0x00,0xf6,0x00,0xf7,0x00,0xf7,0x00,0xf8,0x00, -0xf8,0x00,0xf9,0x00,0xf9,0x00,0xfa,0x00,0xfb,0x00,0xfb,0x00,0xfc,0x00,0xfc,0x00, -0xfd,0x00,0xfd,0x00,0xfe,0x00,0xff,0x00,0xff,0x01,0x00,0x01,0x00,0x01,0x01,0x01, -0x02,0x01,0x02,0x01,0x03,0x01,0x03,0x01,0x04,0x01,0x04,0x01,0x05,0x01,0x06,0x01, -0x06,0x01,0x07,0x01,0x07,0x01,0x08,0x01,0x08,0x01,0x09,0x01,0x0a,0x01,0x0a,0x01, -0x0b,0x01,0x0b,0x01,0x0c,0x01,0x0d,0x01,0x0d,0x01,0x0e,0x01,0x0e,0x01,0x0f,0x01, -0x0f,0x01,0x10,0x01,0x11,0x01,0x11,0x01,0x12,0x01,0x12,0x01,0x13,0x01,0x14,0x01, -0x14,0x01,0x15,0x01,0x15,0x01,0x16,0x01,0x17,0x01,0x17,0x01,0x18,0x01,0x18,0x01, -0x19,0x01,0x19,0x01,0x1a,0x01,0x1b,0x01,0x1b,0x01,0x1c,0x01,0x1c,0x01,0x1d,0x01, -0x1e,0x01,0x1e,0x01,0x1f,0x01,0x1f,0x01,0x20,0x01,0x21,0x01,0x21,0x01,0x22,0x01, -0x22,0x01,0x23,0x01,0x24,0x01,0x24,0x01,0x25,0x01,0x25,0x01,0x26,0x01,0x27,0x01, -0x27,0x01,0x28,0x01,0x28,0x01,0x29,0x01,0x29,0x01,0x2a,0x01,0x2b,0x01,0x2b,0x01, -0x2c,0x01,0x2c,0x01,0x2d,0x01,0x2e,0x01,0x2e,0x01,0x2f,0x01,0x2f,0x01,0x30,0x01, -0x31,0x01,0x31,0x01,0x32,0x01,0x32,0x01,0x33,0x01,0x34,0x01,0x34,0x01,0x35,0x01, -0x35,0x01,0x36,0x01,0x37,0x01,0x37,0x01,0x38,0x01,0x38,0x01,0x39,0x01,0x3a,0x01, -0x3a,0x01,0x3b,0x01,0x3c,0x01,0x3c,0x01,0x3d,0x01,0x3d,0x01,0x3e,0x01,0x3f,0x01, -0x3f,0x01,0x40,0x01,0x40,0x01,0x41,0x01,0x42,0x01,0x42,0x01,0x43,0x01,0x43,0x01, -0x44,0x01,0x45,0x01,0x45,0x01,0x46,0x01,0x46,0x01,0x47,0x01,0x48,0x01,0x48,0x01, -0x49,0x01,0x49,0x01,0x4a,0x01,0x4b,0x01,0x4b,0x01,0x4c,0x01,0x4d,0x01,0x4d,0x01, -0x4e,0x01,0x4e,0x01,0x4f,0x01,0x50,0x01,0x50,0x01,0x51,0x01,0x51,0x01,0x52,0x01, -0x53,0x01,0x53,0x01,0x54,0x01,0x55,0x01,0x55,0x01,0x56,0x01,0x56,0x01,0x57,0x01, -0x58,0x01,0x58,0x01,0x59,0x01,0x59,0x01,0x5a,0x01,0x5b,0x01,0x5b,0x01,0x5c,0x01, -0x5d,0x01,0x5d,0x01,0x5e,0x01,0x5e,0x01,0x5f,0x01,0x60,0x01,0x60,0x01,0x61,0x01, -0x62,0x01,0x62,0x01,0x63,0x01,0x63,0x01,0x64,0x01,0x65,0x01,0x65,0x01,0x66,0x01, -0x67,0x01,0x67,0x01,0x68,0x01,0x68,0x01,0x69,0x01,0x6a,0x01,0x6a,0x01,0x6b,0x01, -0x6c,0x01,0x6c,0x01,0x6d,0x01,0x6d,0x01,0x6e,0x01,0x6f,0x01,0x6f,0x01,0x70,0x01, -0x71,0x01,0x71,0x01,0x72,0x01,0x72,0x01,0x73,0x01,0x74,0x01,0x74,0x01,0x75,0x01, -0x76,0x01,0x76,0x01,0x77,0x01,0x77,0x01,0x78,0x01,0x79,0x01,0x79,0x01,0x7a,0x01, -0x7b,0x01,0x7b,0x01,0x7c,0x01,0x7d,0x01,0x7d,0x01,0x7e,0x01,0x7e,0x01,0x7f,0x01, -0x80,0x01,0x80,0x01,0x81,0x01,0x82,0x01,0x82,0x01,0x83,0x01,0x84,0x01,0x84,0x01, -0x85,0x01,0x85,0x01,0x86,0x01,0x87,0x01,0x87,0x01,0x88,0x01,0x89,0x01,0x89,0x01, -0x8a,0x01,0x8b,0x01,0x8b,0x01,0x8c,0x01,0x8c,0x01,0x8d,0x01,0x8e,0x01,0x8e,0x01, -0x8f,0x01,0x90,0x01,0x90,0x01,0x91,0x01,0x92,0x01,0x92,0x01,0x93,0x01,0x94,0x01, -0x94,0x01,0x95,0x01,0x95,0x01,0x96,0x01,0x97,0x01,0x97,0x01,0x98,0x01,0x99,0x01, -0x99,0x01,0x9a,0x01,0x9b,0x01,0x9b,0x01,0x9c,0x01,0x9d,0x01,0x9d,0x01,0x9e,0x01, -0x9f,0x01,0x9f,0x01,0xa0,0x01,0xa0,0x01,0xa1,0x01,0xa2,0x01,0xa2,0x01,0xa3,0x01, -0xa4,0x01,0xa4,0x01,0xa5,0x01,0xa6,0x01,0xa6,0x01,0xa7,0x01,0xa8,0x01,0xa8,0x01, -0xa9,0x01,0xaa,0x01,0xaa,0x01,0xab,0x01,0xac,0x01,0xac,0x01,0xad,0x01,0xae,0x01, -0xae,0x01,0xaf,0x01,0xb0,0x01,0xb0,0x01,0xb1,0x01,0xb1,0x01,0xb2,0x01,0xb3,0x01, -0xb3,0x01,0xb4,0x01,0xb5,0x01,0xb5,0x01,0xb6,0x01,0xb7,0x01,0xb7,0x01,0xb8,0x01, -0xb9,0x01,0xb9,0x01,0xba,0x01,0xbb,0x01,0xbb,0x01,0xbc,0x01,0xbd,0x01,0xbd,0x01, -0xbe,0x01,0xbf,0x01,0xbf,0x01,0xc0,0x01,0xc1,0x01,0xc1,0x01,0xc2,0x01,0xc3,0x01, -0xc3,0x01,0xc4,0x01,0xc5,0x01,0xc5,0x01,0xc6,0x01,0xc7,0x01,0xc7,0x01,0xc8,0x01, -0xc9,0x01,0xc9,0x01,0xca,0x01,0xcb,0x01,0xcb,0x01,0xcc,0x01,0xcd,0x01,0xcd,0x01, -0xce,0x01,0xcf,0x01,0xcf,0x01,0xd0,0x01,0xd1,0x01,0xd1,0x01,0xd2,0x01,0xd3,0x01, -0xd3,0x01,0xd4,0x01,0xd5,0x01,0xd5,0x01,0xd6,0x01,0xd7,0x01,0xd7,0x01,0xd8,0x01, -0xd9,0x01,0xda,0x01,0xda,0x01,0xdb,0x01,0xdc,0x01,0xdc,0x01,0xdd,0x01,0xde,0x01, -0xde,0x01,0xdf,0x01,0xe0,0x01,0xe0,0x01,0xe1,0x01,0xe2,0x01,0xe2,0x01,0xe3,0x01, -0xe4,0x01,0xe4,0x01,0xe5,0x01,0xe6,0x01,0xe6,0x01,0xe7,0x01,0xe8,0x01,0xe8,0x01, -0xe9,0x01,0xea,0x01,0xeb,0x01,0xeb,0x01,0xec,0x01,0xed,0x01,0xed,0x01,0xee,0x01, -0xef,0x01,0xef,0x01,0xf0,0x01,0xf1,0x01,0xf1,0x01,0xf2,0x01,0xf3,0x01,0xf3,0x01, -0xf4,0x01,0xf5,0x01,0xf5,0x01,0xf6,0x01,0xf7,0x01,0xf8,0x01,0xf8,0x01,0xf9,0x01, -0xfa,0x01,0xfa,0x01,0xfb,0x01,0xfc,0x01,0xfc,0x01,0xfd,0x01,0xfe,0x01,0xfe,0x01, -0xff,0x02,0x00,0x02,0x01,0x02,0x01,0x02,0x02,0x02,0x03,0x02,0x03,0x02,0x04,0x02, -0x05,0x02,0x05,0x02,0x06,0x02,0x07,0x02,0x07,0x02,0x08,0x02,0x09,0x02,0x0a,0x02, -0x0a,0x02,0x0b,0x02,0x0c,0x02,0x0c,0x02,0x0d,0x02,0x0e,0x02,0x0e,0x02,0x0f,0x02, -0x10,0x02,0x11,0x02,0x11,0x02,0x12,0x02,0x13,0x02,0x13,0x02,0x14,0x02,0x15,0x02, -0x15,0x02,0x16,0x02,0x17,0x02,0x18,0x02,0x18,0x02,0x19,0x02,0x1a,0x02,0x1a,0x02, -0x1b,0x02,0x1c,0x02,0x1d,0x02,0x1d,0x02,0x1e,0x02,0x1f,0x02,0x1f,0x02,0x20,0x02, -0x21,0x02,0x21,0x02,0x22,0x02,0x23,0x02,0x24,0x02,0x24,0x02,0x25,0x02,0x26,0x02, -0x26,0x02,0x27,0x02,0x28,0x02,0x29,0x02,0x29,0x02,0x2a,0x02,0x2b,0x02,0x2b,0x02, -0x2c,0x02,0x2d,0x02,0x2e,0x02,0x2e,0x02,0x2f,0x02,0x30,0x02,0x30,0x02,0x31,0x02, -0x32,0x02,0x33,0x02,0x33,0x02,0x34,0x02,0x35,0x02,0x35,0x02,0x36,0x02,0x37,0x02, -0x38,0x02,0x38,0x02,0x39,0x02,0x3a,0x02,0x3a,0x02,0x3b,0x02,0x3c,0x02,0x3d,0x02, -0x3d,0x02,0x3e,0x02,0x3f,0x02,0x40,0x02,0x40,0x02,0x41,0x02,0x42,0x02,0x42,0x02, -0x43,0x02,0x44,0x02,0x45,0x02,0x45,0x02,0x46,0x02,0x47,0x02,0x47,0x02,0x48,0x02, -0x49,0x02,0x4a,0x02,0x4a,0x02,0x4b,0x02,0x4c,0x02,0x4d,0x02,0x4d,0x02,0x4e,0x02, -0x4f,0x02,0x4f,0x02,0x50,0x02,0x51,0x02,0x52,0x02,0x52,0x02,0x53,0x02,0x54,0x02, -0x55,0x02,0x55,0x02,0x56,0x02,0x57,0x02,0x58,0x02,0x58,0x02,0x59,0x02,0x5a,0x02, -0x5a,0x02,0x5b,0x02,0x5c,0x02,0x5d,0x02,0x5d,0x02,0x5e,0x02,0x5f,0x02,0x60,0x02, -0x60,0x02,0x61,0x02,0x62,0x02,0x63,0x02,0x63,0x02,0x64,0x02,0x65,0x02,0x66,0x02, -0x66,0x02,0x67,0x02,0x68,0x02,0x68,0x02,0x69,0x02,0x6a,0x02,0x6b,0x02,0x6b,0x02, -0x6c,0x02,0x6d,0x02,0x6e,0x02,0x6e,0x02,0x6f,0x02,0x70,0x02,0x71,0x02,0x71,0x02, -0x72,0x02,0x73,0x02,0x74,0x02,0x74,0x02,0x75,0x02,0x76,0x02,0x77,0x02,0x77,0x02, -0x78,0x02,0x79,0x02,0x7a,0x02,0x7a,0x02,0x7b,0x02,0x7c,0x02,0x7d,0x02,0x7d,0x02, -0x7e,0x02,0x7f,0x02,0x80,0x02,0x80,0x02,0x81,0x02,0x82,0x02,0x83,0x02,0x83,0x02, -0x84,0x02,0x85,0x02,0x86,0x02,0x86,0x02,0x87,0x02,0x88,0x02,0x89,0x02,0x89,0x02, -0x8a,0x02,0x8b,0x02,0x8c,0x02,0x8c,0x02,0x8d,0x02,0x8e,0x02,0x8f,0x02,0x8f,0x02, -0x90,0x02,0x91,0x02,0x92,0x02,0x92,0x02,0x93,0x02,0x94,0x02,0x95,0x02,0x96,0x02, -0x96,0x02,0x97,0x02,0x98,0x02,0x99,0x02,0x99,0x02,0x9a,0x02,0x9b,0x02,0x9c,0x02, -0x9c,0x02,0x9d,0x02,0x9e,0x02,0x9f,0x02,0x9f,0x02,0xa0,0x02,0xa1,0x02,0xa2,0x02, -0xa2,0x02,0xa3,0x02,0xa4,0x02,0xa5,0x02,0xa6,0x02,0xa6,0x02,0xa7,0x02,0xa8,0x02, -0xa9,0x02,0xa9,0x02,0xaa,0x02,0xab,0x02,0xac,0x02,0xac,0x02,0xad,0x02,0xae,0x02, -0xaf,0x02,0xb0,0x02,0xb0,0x02,0xb1,0x02,0xb2,0x02,0xb3,0x02,0xb3,0x02,0xb4,0x02, -0xb5,0x02,0xb6,0x02,0xb7,0x02,0xb7,0x02,0xb8,0x02,0xb9,0x02,0xba,0x02,0xba,0x02, -0xbb,0x02,0xbc,0x02,0xbd,0x02,0xbe,0x02,0xbe,0x02,0xbf,0x02,0xc0,0x02,0xc1,0x02, -0xc1,0x02,0xc2,0x02,0xc3,0x02,0xc4,0x02,0xc5,0x02,0xc5,0x02,0xc6,0x02,0xc7,0x02, -0xc8,0x02,0xc8,0x02,0xc9,0x02,0xca,0x02,0xcb,0x02,0xcc,0x02,0xcc,0x02,0xcd,0x02, -0xce,0x02,0xcf,0x02,0xd0,0x02,0xd0,0x02,0xd1,0x02,0xd2,0x02,0xd3,0x02,0xd3,0x02, -0xd4,0x02,0xd5,0x02,0xd6,0x02,0xd7,0x02,0xd7,0x02,0xd8,0x02,0xd9,0x02,0xda,0x02, -0xdb,0x02,0xdb,0x02,0xdc,0x02,0xdd,0x02,0xde,0x02,0xdf,0x02,0xdf,0x02,0xe0,0x02, -0xe1,0x02,0xe2,0x02,0xe3,0x02,0xe3,0x02,0xe4,0x02,0xe5,0x02,0xe6,0x02,0xe7,0x02, -0xe7,0x02,0xe8,0x02,0xe9,0x02,0xea,0x02,0xeb,0x02,0xeb,0x02,0xec,0x02,0xed,0x02, -0xee,0x02,0xef,0x02,0xef,0x02,0xf0,0x02,0xf1,0x02,0xf2,0x02,0xf3,0x02,0xf3,0x02, -0xf4,0x02,0xf5,0x02,0xf6,0x02,0xf7,0x02,0xf7,0x02,0xf8,0x02,0xf9,0x02,0xfa,0x02, -0xfb,0x02,0xfb,0x02,0xfc,0x02,0xfd,0x02,0xfe,0x02,0xff,0x02,0xff,0x03,0x00,0x03, -0x01,0x03,0x02,0x03,0x03,0x03,0x03,0x03,0x04,0x03,0x05,0x03,0x06,0x03,0x07,0x03, -0x08,0x03,0x08,0x03,0x09,0x03,0x0a,0x03,0x0b,0x03,0x0c,0x03,0x0c,0x03,0x0d,0x03, -0x0e,0x03,0x0f,0x03,0x10,0x03,0x10,0x03,0x11,0x03,0x12,0x03,0x13,0x03,0x14,0x03, -0x15,0x03,0x15,0x03,0x16,0x03,0x17,0x03,0x18,0x03,0x19,0x03,0x19,0x03,0x1a,0x03, -0x1b,0x03,0x1c,0x03,0x1d,0x03,0x1e,0x03,0x1e,0x03,0x1f,0x03,0x20,0x03,0x21,0x03, -0x22,0x03,0x23,0x03,0x23,0x03,0x24,0x03,0x25,0x03,0x26,0x03,0x27,0x03,0x27,0x03, -0x28,0x03,0x29,0x03,0x2a,0x03,0x2b,0x03,0x2c,0x03,0x2c,0x03,0x2d,0x03,0x2e,0x03, -0x2f,0x03,0x30,0x03,0x31,0x03,0x31,0x03,0x32,0x03,0x33,0x03,0x34,0x03,0x35,0x03, -0x36,0x03,0x36,0x03,0x37,0x03,0x38,0x03,0x39,0x03,0x3a,0x03,0x3b,0x03,0x3b,0x03, -0x3c,0x03,0x3d,0x03,0x3e,0x03,0x3f,0x03,0x40,0x03,0x40,0x03,0x41,0x03,0x42,0x03, -0x43,0x03,0x44,0x03,0x45,0x03,0x45,0x03,0x46,0x03,0x47,0x03,0x48,0x03,0x49,0x03, -0x4a,0x03,0x4b,0x03,0x4b,0x03,0x4c,0x03,0x4d,0x03,0x4e,0x03,0x4f,0x03,0x50,0x03, -0x50,0x03,0x51,0x03,0x52,0x03,0x53,0x03,0x54,0x03,0x55,0x03,0x56,0x03,0x56,0x03, -0x57,0x03,0x58,0x03,0x59,0x03,0x5a,0x03,0x5b,0x03,0x5b,0x03,0x5c,0x03,0x5d,0x03, -0x5e,0x03,0x5f,0x03,0x60,0x03,0x61,0x03,0x61,0x03,0x62,0x03,0x63,0x03,0x64,0x03, -0x65,0x03,0x66,0x03,0x67,0x03,0x67,0x03,0x68,0x03,0x69,0x03,0x6a,0x03,0x6b,0x03, -0x6c,0x03,0x6d,0x03,0x6d,0x03,0x6e,0x03,0x6f,0x03,0x70,0x03,0x71,0x03,0x72,0x03, -0x73,0x03,0x73,0x03,0x74,0x03,0x75,0x03,0x76,0x03,0x77,0x03,0x78,0x03,0x79,0x03, -0x79,0x03,0x7a,0x03,0x7b,0x03,0x7c,0x03,0x7d,0x03,0x7e,0x03,0x7f,0x03,0x80,0x03, -0x80,0x03,0x81,0x03,0x82,0x03,0x83,0x03,0x84,0x03,0x85,0x03,0x86,0x03,0x86,0x03, -0x87,0x03,0x88,0x03,0x89,0x03,0x8a,0x03,0x8b,0x03,0x8c,0x03,0x8d,0x03,0x8d,0x03, -0x8e,0x03,0x8f,0x03,0x90,0x03,0x91,0x03,0x92,0x03,0x93,0x03,0x94,0x03,0x94,0x03, -0x95,0x03,0x96,0x03,0x97,0x03,0x98,0x03,0x99,0x03,0x9a,0x03,0x9b,0x03,0x9b,0x03, -0x9c,0x03,0x9d,0x03,0x9e,0x03,0x9f,0x03,0xa0,0x03,0xa1,0x03,0xa2,0x03,0xa2,0x03, -0xa3,0x03,0xa4,0x03,0xa5,0x03,0xa6,0x03,0xa7,0x03,0xa8,0x03,0xa9,0x03,0xaa,0x03, -0xaa,0x03,0xab,0x03,0xac,0x03,0xad,0x03,0xae,0x03,0xaf,0x03,0xb0,0x03,0xb1,0x03, -0xb2,0x03,0xb2,0x03,0xb3,0x03,0xb4,0x03,0xb5,0x03,0xb6,0x03,0xb7,0x03,0xb8,0x03, -0xb9,0x03,0xba,0x03,0xba,0x03,0xbb,0x03,0xbc,0x03,0xbd,0x03,0xbe,0x03,0xbf,0x03, -0xc0,0x03,0xc1,0x03,0xc2,0x03,0xc3,0x03,0xc3,0x03,0xc4,0x03,0xc5,0x03,0xc6,0x03, -0xc7,0x03,0xc8,0x03,0xc9,0x03,0xca,0x03,0xcb,0x03,0xcb,0x03,0xcc,0x03,0xcd,0x03, -0xce,0x03,0xcf,0x03,0xd0,0x03,0xd1,0x03,0xd2,0x03,0xd3,0x03,0xd4,0x03,0xd5,0x03, -0xd5,0x03,0xd6,0x03,0xd7,0x03,0xd8,0x03,0xd9,0x03,0xda,0x03,0xdb,0x03,0xdc,0x03, -0xdd,0x03,0xde,0x03,0xde,0x03,0xdf,0x03,0xe0,0x03,0xe1,0x03,0xe2,0x03,0xe3,0x03, -0xe4,0x03,0xe5,0x03,0xe6,0x03,0xe7,0x03,0xe8,0x03,0xe9,0x03,0xe9,0x03,0xea,0x03, -0xeb,0x03,0xec,0x03,0xed,0x03,0xee,0x03,0xef,0x03,0xf0,0x03,0xf1,0x03,0xf2,0x03, -0xf3,0x03,0xf4,0x03,0xf4,0x03,0xf5,0x03,0xf6,0x03,0xf7,0x03,0xf8,0x03,0xf9,0x03, -0xfa,0x03,0xfb,0x03,0xfc,0x03,0xfd,0x03,0xfe,0x03,0xff,0x54,0x52,0x49,0x58,0x2d, -0x50,0x52,0x4f,0x01,0x0a,0x00,0x01,0x02,0x03,0x04,0x05,0x04,0x03,0x10,0x10,0x48, -0x12,0x13,0x14,0x15,0x17,0x06,0x06,0x06,0x06,0x07,0x07,0x08,0x08,0x3e,0x3f,0x3e, -0x3f,0x27,0x27,0x51,0x26,0x58,0x5e,0x36,0x5c,0x61,0x63,0x62,0x6d,0x66,0x60,0x44, -0x5d,0x50,0x51,0x09,0x50,0x30,0x30,0x31,0x2d,0x28,0x29,0x2a,0x2a,0x2b,0x2e,0x2e, -0x18,0x19,0x1a,0x1b,0x68,0x20,0x21,0x22,0x22,0x24,0x25,0x23,0x20,0x49,0x49,0x48, -0x48,0x4a,0x4b,0x40,0x41,0x42,0x43,0x47,0x47,0x44,0x45,0x46,0x16,0x38,0x38,0x39, -0x39,0x3c,0x3c,0x3a,0x3d,0x3e,0x0b,0x62,0x2e,0x64,0x09,0x0e,0x0d,0x0c,0x6b,0x56, -0x52,0x4e,0x4e,0x4b,0x5e,0x2f,0x75,0x76,0x76,0x76,0x74,0x73,0x77,0x73,0x09,0x37, -0x7c,0x7b,0x7d,0x70,0x52 -}; - diff --git a/sys/dev/sound/isa/i386/uart/uart6850.c b/sys/dev/sound/isa/i386/uart/uart6850.c deleted file mode 100644 index 066fb8d357..0000000000 --- a/sys/dev/sound/isa/i386/uart/uart6850.c +++ /dev/null @@ -1,300 +0,0 @@ -/* - * sound/uart6850.c - * - * Copyright by Hannu Savolainen 1993 - * - * Mon Nov 22 22:38:35 MET 1993 marco@driq.home.usn.nl: added 6850 support, used - * with COVOX SoundMaster II and custom cards. - * - * 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 AUTHOR 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 AUTHOR 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. - * - * $DragonFly: src/sys/dev/sound/isa/i386/uart/Attic/uart6850.c,v 1.2 2004/09/19 16:51:03 joerg Exp $ - */ - -#include -#include -#include - -#if NSND > 0 - -#if 1 -/* #if defined(CONFIG_UART6850) && defined(CONFIG_MIDI) */ - -#define DATAPORT (uart6850_base) /* * * Midi6850 Data I/O Port on IBM */ -#define COMDPORT (uart6850_base+1) /* * * Midi6850 Command Port on IBM */ -#define STATPORT (uart6850_base+1) /* * * Midi6850 Status Port on IBM */ - -#define uart6850_status() inb( STATPORT) -#define input_avail() (uart6850_status()&INPUT_AVAIL) -#define output_ready() (uart6850_status()&OUTPUT_READY) -#define uart6850_cmd(cmd) outb( COMDPORT, cmd) -#define uart6850_read() inb( DATAPORT) -#define uart6850_write(byte) outb( DATAPORT, byte) - -#define OUTPUT_READY 0x02 /* * * Mask for Data Read Ready Bit */ -#define INPUT_AVAIL 0x01 /* * * Mask for Data Send Ready Bit */ - -#define UART_RESET 0x95 /* * * 6850 Total Reset Command */ -#define UART_MODE_ON 0x03 /* * * 6850 Send/Receive UART Mode */ - -static int uart6850_opened = 0; -static int uart6850_base = 0x330; -static int uart6850_irq; -static int uart6850_detected = 0; -static int my_dev; - -static int reset_uart6850(void); -static void (*midi_input_intr) (int dev, u_char data); -static void poll_uart6850(void *dummy); - -static sound_os_info *uart6850_osp; - -static struct callout uart6850_ch; -SYSINIT(uart6850, SI_SUB_DRIVERS, SI_ORDER_ANY, callout_init, &uart6850_ch); - -static void -uart6850_input_loop(void) -{ - int count; - - count = 10; - - while (count) /* Not timed out */ - if (input_avail()) { - u_char c = uart6850_read(); - - count = 100; - - if (uart6850_opened & OPEN_READ) - midi_input_intr(my_dev, c); - } else - while (!input_avail() && count) - count--; -} - -void -m6850intr(int irq) -{ - if (input_avail()) - uart6850_input_loop(); -} - -/* - * It looks like there is no input interrupts in the UART mode. Let's try - * polling. - */ - -static void -poll_uart6850(void * dummy) -{ - u_long flags; - - if (!(uart6850_opened & OPEN_READ)) - return; /* Device has been closed */ - - flags = splhigh(); - - if (input_avail()) - uart6850_input_loop(); - - callout_reset(&uart6850_ch, 1, poll_uart6850, NULL); /* Come back later */ - - splx(flags); -} - -static int -uart6850_open(int dev, int mode, - void (*input) (int dev, u_char data), - void (*output) (int dev) -) -{ - if (uart6850_opened) { - printf("Midi6850: Midi busy\n"); - return -(EBUSY); - } - uart6850_cmd(UART_RESET); - - uart6850_input_loop(); - - midi_input_intr = input; - uart6850_opened = mode; - poll_uart6850(0); /* Enable input polling */ - - return 0; -} - -static void -uart6850_close(int dev) -{ - uart6850_cmd(UART_MODE_ON); - - uart6850_opened = 0; -} - -static int -uart6850_out(int dev, u_char midi_byte) -{ - int timeout; - u_long flags; - - /* - * Test for input since pending input seems to block the output. - */ - - flags = splhigh(); - - if (input_avail()) - uart6850_input_loop(); - - splx(flags); - - /* - * Sometimes it takes about 13000 loops before the output becomes - * ready (After reset). Normally it takes just about 10 loops. - */ - - for (timeout = 30000; timeout > 0 && !output_ready(); timeout--); /* Wait */ - - if (!output_ready()) { - printf("Midi6850: Timeout\n"); - return 0; - } - uart6850_write(midi_byte); - return 1; -} - -static int -uart6850_command(int dev, u_char *midi_byte) -{ - return 1; -} - -static int -uart6850_start_read(int dev) -{ - return 0; -} - -static int -uart6850_end_read(int dev) -{ - return 0; -} - -static int -uart6850_ioctl(int dev, u_int cmd, ioctl_arg arg) -{ - return -(EINVAL); -} - -static void -uart6850_kick(int dev) -{ -} - -static int -uart6850_buffer_status(int dev) -{ - return 0; /* No data in buffers */ -} - -#define MIDI_SYNTH_NAME "6850 UART Midi" -#define MIDI_SYNTH_CAPS SYNTH_CAP_INPUT -#include - -static struct midi_operations uart6850_operations = -{ - {"6850 UART", 0, 0, SNDCARD_UART6850}, - &std_midi_synth, - {0}, - uart6850_open, - uart6850_close, - uart6850_ioctl, - uart6850_out, - uart6850_start_read, - uart6850_end_read, - uart6850_kick, - uart6850_command, - uart6850_buffer_status -}; - - -void -attach_uart6850(struct address_info * hw_config) -{ - int ok, timeout; - u_long flags; - - if (num_midis >= MAX_MIDI_DEV) { - printf("Sound: Too many midi devices detected\n"); - return ; - } - uart6850_base = hw_config->io_base; - uart6850_osp = hw_config->osp; - uart6850_irq = hw_config->irq; - - if (!uart6850_detected) - return ; - - flags = splhigh(); - - for (timeout = 30000; timeout < 0 && !output_ready(); timeout--); /* Wait */ - uart6850_cmd(UART_MODE_ON); - - ok = 1; - - splx(flags); - - conf_printf("6850 Midi Interface", hw_config); - - std_midi_synth.midi_dev = my_dev = num_midis; - midi_devs[num_midis++] = &uart6850_operations; - return ; -} - -static int -reset_uart6850(void) -{ - uart6850_read(); - return 1; /* OK */ -} - - -int -probe_uart6850(struct address_info * hw_config) -{ - int ok = 0; - - uart6850_osp = hw_config->osp; - uart6850_base = hw_config->io_base; - uart6850_irq = hw_config->irq; - - if (snd_set_irq_handler(uart6850_irq, m6850intr, uart6850_osp) < 0) - return 0; - - ok = reset_uart6850(); - - uart6850_detected = ok; - return ok; -} - -#endif -#endif diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT index 8236a9afac..da933d7bcd 100644 --- a/sys/i386/conf/LINT +++ b/sys/i386/conf/LINT @@ -3,7 +3,7 @@ # as much of the source tree as it can. # # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $ -# $DragonFly: src/sys/i386/conf/Attic/LINT,v 1.48 2005/02/26 12:00:55 swildner Exp $ +# $DragonFly: src/sys/i386/conf/Attic/LINT,v 1.49 2005/03/28 14:42:45 joerg Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -992,7 +992,6 @@ options SES_ENABLE_PASSTHROUGH # `xterm', among others. pseudo-device pty #Pseudo ttys -pseudo-device speaker #Play IBM BASIC-style noises out your speaker pseudo-device gzip #Exec gzipped a.out's pseudo-device vn #Vnode driver (turns a file into a device) pseudo-device md #Memory/malloc disk @@ -1456,32 +1455,6 @@ pseudo-device atm device en options NATM #native ATM -# -# Audio drivers: `snd', `sb', `pas', `gus', `pca' -# -# snd: Voxware sound support code -# sb: SoundBlaster PCM - SoundBlaster, SB Pro, SB16, ProAudioSpectrum -# sbxvi: SoundBlaster 16 -# sbmidi: SoundBlaster 16 MIDI interface -# pas: ProAudioSpectrum PCM and MIDI -# gus: Gravis Ultrasound - Ultrasound, Ultrasound 16, Ultrasound MAX -# gusxvi: Gravis Ultrasound 16-bit PCM (do not use) -# mss: Microsoft Sound System -# css: Crystal Sound System (CSS 423x PnP) -# sscape: Ensoniq Soundscape MIDI interface -# sscape_mss: Ensoniq Soundscape PCM (requires sscape) -# opl: Yamaha OPL-2 and OPL-3 FM - SB, SB Pro, SB 16, ProAudioSpectrum -# uart: stand-alone 6850 UART for MIDI -# mpu: Roland MPU-401 stand-alone card -# -# Note: It has been reported that ISA DMA with the SoundBlaster will -# lock up the machine (PR docs/5358). If this happens to you, -# turning off USWC write posting in your machine's BIOS may fix -# the problem. -# -# Beware! The addresses specified below are also hard-coded in -# src/sys/i386/isa/sound/sound_config.h. If you change the values here, you -# must also change the values in the include file. # # pcm: PCM audio through various sound cards. # @@ -1500,8 +1473,6 @@ options NATM #native ATM # # This driver will use the new PnP code if it's available. # -# pca: PCM audio through your PC speaker -# # If you have a GUS-MAX card and want to use the CS4231 codec on the # card the drqs for the gus max must be 8 bit (1, 2, or 3). # @@ -1522,25 +1493,6 @@ options NATM #native ATM # # The src/sys/i386/isa/sound/sound.doc has more information. -# Controls all "VOXWARE" driver sound devices. See Luigi's driver -# below for an alternate which may work better for some cards. -# -#device snd -#device pas0 at isa? port 0x388 irq 10 drq 6 -#device sb0 at isa? port 0x220 irq 5 drq 1 -#device sbxvi0 at isa? drq 5 -#device sbmidi0 at isa? port 0x330 -#device gus0 at isa? port 0x220 irq 12 drq 1 -##device gus0 at isa? port 0x220 irq 12 drq 1 flags 0x3 -#device mss0 at isa? port 0x530 irq 10 drq 1 -#device css0 at isa? port 0x534 irq 5 drq 1 flags 0x08 -#device sscape0 at isa? port 0x330 irq 9 drq 0 -#device trix0 at isa? port 0x330 irq 6 drq 0 -#device sscape_mss0 at isa? port 0x534 irq 5 drq 1 -#device opl0 at isa? port 0x388 -#device mpu0 at isa? port 0x330 irq 6 drq 0 -#device uart0 at isa? port 0x330 irq 5 - # The newpcm driver (use INSTEAD of snd0 and all VOXWARE drivers!). # Note that motherboard sound devices may require device PNPBIOS. # @@ -1571,10 +1523,6 @@ device pcm device sbc0 at isa? port 0x220 irq 5 drq 1 flags 0x15 device gusc0 at isa? port 0x220 irq 5 drq 1 flags 0x13 -# Not controlled by `snd' -# XXX-Hiten The pca driver needs to readded back into LINT! -# device pca0 at isa? port IO_TIMER1 - # # Miscellaneous hardware: # -- 2.41.0