0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208
0209
0210
0211
0212
0213
0214
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237
0238
0239
0240
0241
0242
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252
0253
0254
0255
0256
0257
0258
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268
0269
0270
0271
0272
0273
0274
0275
0276
0277
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291
0292
0293
0294
0295
0296
0297
0298
0299
0300
0301
0302
0303
0304
0305
0306
0307
0308
0309
0310
0311
0312
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329
0330
0331
0332
0333
0334
0335
0336
0337
0338
0339
0340
0341
0342
0343
0344
0345
0346
0347
0348
0349
0350
0351
0352
0353
0354
0355
0356
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380
0381
0382
0383
0384
0385
0386
0387
0388
0389
0390 save_IFS="${IFS}"
0391 IFS="${IFS}:"
0392 gettext_dir=FAILED
0393 locale_dir=FAILED
0394 first_param="$1"
0395 for dir in $PATH
0396 do
0397 if test "$gettext_dir" = FAILED && test -f $dir/gettext \
0398 && ($dir/gettext --version >/dev/null 2>&1)
0399 then
0400 set `$dir/gettext --version 2>&1`
0401 if test "$3" = GNU
0402 then
0403 gettext_dir=$dir
0404 fi
0405 fi
0406 if test "$locale_dir" = FAILED && test -f $dir/shar \
0407 && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
0408 then
0409 locale_dir=`$dir/shar --print-text-domain-dir`
0410 fi
0411 done
0412 IFS="$save_IFS"
0413 if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
0414 then
0415 echo=echo
0416 else
0417 TEXTDOMAINDIR=$locale_dir
0418 export TEXTDOMAINDIR
0419 TEXTDOMAIN=sharutils
0420 export TEXTDOMAIN
0421 echo="$gettext_dir/gettext -s"
0422 fi
0423 touch -am 1231235999 $$.touch >/dev/null 2>&1
0424 if test ! -f 1231235999 && test -f $$.touch; then
0425 shar_touch=touch
0426 else
0427 shar_touch=:
0428 echo
0429 $echo 'WARNING: not restoring timestamps. Consider getting and'
0430 $echo "installing GNU \`touch', distributed in GNU File Utilities..."
0431 echo
0432 fi
0433 rm -f 1231235999 $$.touch
0434
0435 if mkdir _sh01426; then
0436 $echo 'x -' 'creating lock directory'
0437 else
0438 $echo 'failed to create lock directory'
0439 exit 1
0440 fi
0441
0442 if test ! -d 'MultiSound.d'; then
0443 $echo 'x -' 'creating directory' 'MultiSound.d'
0444 mkdir 'MultiSound.d'
0445 fi
0446 if test -f 'MultiSound.d/setdigital.c' && test "$first_param" != -c; then
0447 $echo 'x -' SKIPPING 'MultiSound.d/setdigital.c' '(file already exists)'
0448 else
0449 $echo 'x -' extracting 'MultiSound.d/setdigital.c' '(text)'
0450 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/setdigital.c' &&
0451 /*********************************************************************
0452 X *
0453 X * setdigital.c - sets the DIGITAL1 input for a mixer
0454 X *
0455 X * Copyright (C) 1998 Andrew Veliath
0456 X *
0457 X * This program is free software; you can redistribute it and/or modify
0458 X * it under the terms of the GNU General Public License as published by
0459 X * the Free Software Foundation; either version 2 of the License, or
0460 X * (at your option) any later version.
0461 X *
0462 X * This program is distributed in the hope that it will be useful,
0463 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
0464 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0465 X * GNU General Public License for more details.
0466 X *
0467 X * You should have received a copy of the GNU General Public License
0468 X * along with this program; if not, write to the Free Software
0469 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
0470 X *
0471 X ********************************************************************/
0472 X
0473
0474
0475
0476
0477
0478
0479
0480
0481 X
0482 int main(int argc, char *argv[])
0483 {
0484 X int fd;
0485 X unsigned long recmask, recsrc;
0486 X
0487 X if (argc != 2) {
0488 X fprintf(stderr, "usage: setdigital <mixer device>\n");
0489 X exit(1);
0490 X }
0491 X
0492 X if ((fd = open(argv[1], O_RDWR)) < 0) {
0493 X perror(argv[1]);
0494 X exit(1);
0495 X }
0496 X
0497 X if (ioctl(fd, SOUND_MIXER_READ_RECMASK, &recmask) < 0) {
0498 X fprintf(stderr, "error: ioctl read recording mask failed\n");
0499 X perror("ioctl");
0500 X close(fd);
0501 X exit(1);
0502 X }
0503 X
0504 X if (!(recmask & SOUND_MASK_DIGITAL1)) {
0505 X fprintf(stderr, "error: cannot find DIGITAL1 device in mixer\n");
0506 X close(fd);
0507 X exit(1);
0508 X }
0509 X
0510 X if (ioctl(fd, SOUND_MIXER_READ_RECSRC, &recsrc) < 0) {
0511 X fprintf(stderr, "error: ioctl read recording source failed\n");
0512 X perror("ioctl");
0513 X close(fd);
0514 X exit(1);
0515 X }
0516 X
0517 X recsrc |= SOUND_MASK_DIGITAL1;
0518 X
0519 X if (ioctl(fd, SOUND_MIXER_WRITE_RECSRC, &recsrc) < 0) {
0520 X fprintf(stderr, "error: ioctl write recording source failed\n");
0521 X perror("ioctl");
0522 X close(fd);
0523 X exit(1);
0524 X }
0525 X
0526 X close(fd);
0527 X
0528 X return 0;
0529 }
0530 SHAR_EOF
0531 $shar_touch -am 1204092598 'MultiSound.d/setdigital.c' &&
0532 chmod 0664 'MultiSound.d/setdigital.c' ||
0533 $echo 'restore of' 'MultiSound.d/setdigital.c' 'failed'
0534 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
0535 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
0536 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
0537 || $echo 'MultiSound.d/setdigital.c:' 'MD5 check failed'
0538 e87217fc3e71288102ba41fd81f71ec4 MultiSound.d/setdigital.c
0539 SHAR_EOF
0540 else
0541 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/setdigital.c'`"
0542 test 2064 -eq "$shar_count" ||
0543 $echo 'MultiSound.d/setdigital.c:' 'original size' '2064,' 'current size' "$shar_count!"
0544 fi
0545 fi
0546
0547 if test -f 'MultiSound.d/pinnaclecfg.c' && test "$first_param" != -c; then
0548 $echo 'x -' SKIPPING 'MultiSound.d/pinnaclecfg.c' '(file already exists)'
0549 else
0550 $echo 'x -' extracting 'MultiSound.d/pinnaclecfg.c' '(text)'
0551 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/pinnaclecfg.c' &&
0552 /*********************************************************************
0553 X *
0554 X * pinnaclecfg.c - Pinnacle/Fiji Device Configuration Program
0555 X *
0556 X * This is for NON-PnP mode only. For PnP mode, use isapnptools.
0557 X *
0558 X * This is Linux-specific, and must be run with root permissions.
0559 X *
0560 X * Part of the Turtle Beach MultiSound Sound Card Driver for Linux
0561 X *
0562 X * Copyright (C) 1998 Andrew Veliath
0563 X *
0564 X * This program is free software; you can redistribute it and/or modify
0565 X * it under the terms of the GNU General Public License as published by
0566 X * the Free Software Foundation; either version 2 of the License, or
0567 X * (at your option) any later version.
0568 X *
0569 X * This program is distributed in the hope that it will be useful,
0570 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
0571 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0572 X * GNU General Public License for more details.
0573 X *
0574 X * You should have received a copy of the GNU General Public License
0575 X * along with this program; if not, write to the Free Software
0576 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
0577 X *
0578 X ********************************************************************/
0579 X
0580
0581
0582
0583
0584
0585
0586
0587 X
0588
0589
0590
0591
0592
0593
0594
0595
0596
0597
0598
0599
0600
0601
0602
0603
0604
0605
0606
0607
0608
0609
0610
0611
0612 X
0613
0614
0615
0616 X
0617 typedef __u8 BYTE;
0618 typedef __u16 USHORT;
0619 typedef __u16 WORD;
0620 X
0621 static int config_port = -1;
0622 X
0623 static int msnd_write_cfg(int cfg, int reg, int value)
0624 {
0625 X outb(reg, cfg);
0626 X outb(value, cfg + 1);
0627 X if (value != inb(cfg + 1)) {
0628 X fprintf(stderr, "error: msnd_write_cfg: I/O error\n");
0629 X return -EIO;
0630 X }
0631 X return 0;
0632 }
0633 X
0634 static int msnd_read_cfg(int cfg, int reg)
0635 {
0636 X outb(reg, cfg);
0637 X return inb(cfg + 1);
0638 }
0639 X
0640 static int msnd_write_cfg_io0(int cfg, int num, WORD io)
0641 {
0642 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
0643 X return -EIO;
0644 X if (msnd_write_cfg(cfg, IREG_IO0_BASEHI, HIBYTE(io)))
0645 X return -EIO;
0646 X if (msnd_write_cfg(cfg, IREG_IO0_BASELO, LOBYTE(io)))
0647 X return -EIO;
0648 X return 0;
0649 }
0650 X
0651 static int msnd_read_cfg_io0(int cfg, int num, WORD *io)
0652 {
0653 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
0654 X return -EIO;
0655 X
0656 X *io = MAKEWORD(msnd_read_cfg(cfg, IREG_IO0_BASELO),
0657 X msnd_read_cfg(cfg, IREG_IO0_BASEHI));
0658 X
0659 X return 0;
0660 }
0661 X
0662 static int msnd_write_cfg_io1(int cfg, int num, WORD io)
0663 {
0664 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
0665 X return -EIO;
0666 X if (msnd_write_cfg(cfg, IREG_IO1_BASEHI, HIBYTE(io)))
0667 X return -EIO;
0668 X if (msnd_write_cfg(cfg, IREG_IO1_BASELO, LOBYTE(io)))
0669 X return -EIO;
0670 X return 0;
0671 }
0672 X
0673 static int msnd_read_cfg_io1(int cfg, int num, WORD *io)
0674 {
0675 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
0676 X return -EIO;
0677 X
0678 X *io = MAKEWORD(msnd_read_cfg(cfg, IREG_IO1_BASELO),
0679 X msnd_read_cfg(cfg, IREG_IO1_BASEHI));
0680 X
0681 X return 0;
0682 }
0683 X
0684 static int msnd_write_cfg_irq(int cfg, int num, WORD irq)
0685 {
0686 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
0687 X return -EIO;
0688 X if (msnd_write_cfg(cfg, IREG_IRQ_NUMBER, LOBYTE(irq)))
0689 X return -EIO;
0690 X if (msnd_write_cfg(cfg, IREG_IRQ_TYPE, IRQTYPE_EDGE))
0691 X return -EIO;
0692 X return 0;
0693 }
0694 X
0695 static int msnd_read_cfg_irq(int cfg, int num, WORD *irq)
0696 {
0697 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
0698 X return -EIO;
0699 X
0700 X *irq = msnd_read_cfg(cfg, IREG_IRQ_NUMBER);
0701 X
0702 X return 0;
0703 }
0704 X
0705 static int msnd_write_cfg_mem(int cfg, int num, int mem)
0706 {
0707 X WORD wmem;
0708 X
0709 X mem >>= 8;
0710 X mem &= 0xfff;
0711 X wmem = (WORD)mem;
0712 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
0713 X return -EIO;
0714 X if (msnd_write_cfg(cfg, IREG_MEMBASEHI, HIBYTE(wmem)))
0715 X return -EIO;
0716 X if (msnd_write_cfg(cfg, IREG_MEMBASELO, LOBYTE(wmem)))
0717 X return -EIO;
0718 X if (wmem && msnd_write_cfg(cfg, IREG_MEMCONTROL, (MEMTYPE_HIADDR | MEMTYPE_16BIT)))
0719 X return -EIO;
0720 X return 0;
0721 }
0722 X
0723 static int msnd_read_cfg_mem(int cfg, int num, int *mem)
0724 {
0725 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
0726 X return -EIO;
0727 X
0728 X *mem = MAKEWORD(msnd_read_cfg(cfg, IREG_MEMBASELO),
0729 X msnd_read_cfg(cfg, IREG_MEMBASEHI));
0730 X *mem <<= 8;
0731 X
0732 X return 0;
0733 }
0734 X
0735 static int msnd_activate_logical(int cfg, int num)
0736 {
0737 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
0738 X return -EIO;
0739 X if (msnd_write_cfg(cfg, IREG_ACTIVATE, LD_ACTIVATE))
0740 X return -EIO;
0741 X return 0;
0742 }
0743 X
0744 static int msnd_write_cfg_logical(int cfg, int num, WORD io0, WORD io1, WORD irq, int mem)
0745 {
0746 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
0747 X return -EIO;
0748 X if (msnd_write_cfg_io0(cfg, num, io0))
0749 X return -EIO;
0750 X if (msnd_write_cfg_io1(cfg, num, io1))
0751 X return -EIO;
0752 X if (msnd_write_cfg_irq(cfg, num, irq))
0753 X return -EIO;
0754 X if (msnd_write_cfg_mem(cfg, num, mem))
0755 X return -EIO;
0756 X if (msnd_activate_logical(cfg, num))
0757 X return -EIO;
0758 X return 0;
0759 }
0760 X
0761 static int msnd_read_cfg_logical(int cfg, int num, WORD *io0, WORD *io1, WORD *irq, int *mem)
0762 {
0763 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
0764 X return -EIO;
0765 X if (msnd_read_cfg_io0(cfg, num, io0))
0766 X return -EIO;
0767 X if (msnd_read_cfg_io1(cfg, num, io1))
0768 X return -EIO;
0769 X if (msnd_read_cfg_irq(cfg, num, irq))
0770 X return -EIO;
0771 X if (msnd_read_cfg_mem(cfg, num, mem))
0772 X return -EIO;
0773 X return 0;
0774 }
0775 X
0776 static void usage(void)
0777 {
0778 X fprintf(stderr,
0779 X "\n"
0780 X "pinnaclecfg 1.0\n"
0781 X "\n"
0782 X "usage: pinnaclecfg <config port> [device config]\n"
0783 X "\n"
0784 X "This is for use with the card in NON-PnP mode only.\n"
0785 X "\n"
0786 X "Available devices (not all available for Fiji):\n"
0787 X "\n"
0788 X " Device Description\n"
0789 X " -------------------------------------------------------------------\n"
0790 X " reset Reset all devices (i.e. disable)\n"
0791 X " show Display current device configurations\n"
0792 X "\n"
0793 X " dsp <io> <irq> <mem> Audio device\n"
0794 X " mpu <io> <irq> Internal Kurzweil synth\n"
0795 X " ide <io0> <io1> <irq> On-board IDE controller\n"
0796 X " joystick <io> Joystick port\n"
0797 X "\n");
0798 X exit(1);
0799 }
0800 X
0801 static int cfg_reset(void)
0802 {
0803 X int i;
0804 X
0805 X for (i = 0; i < 4; ++i)
0806 X msnd_write_cfg_logical(config_port, i, 0, 0, 0, 0);
0807 X
0808 X return 0;
0809 }
0810 X
0811 static int cfg_show(void)
0812 {
0813 X int i;
0814 X int count = 0;
0815 X
0816 X for (i = 0; i < 4; ++i) {
0817 X WORD io0, io1, irq;
0818 X int mem;
0819 X msnd_read_cfg_logical(config_port, i, &io0, &io1, &irq, &mem);
0820 X switch (i) {
0821 X case 0:
0822 X if (io0 || irq || mem) {
0823 X printf("dsp 0x%x %d 0x%x\n", io0, irq, mem);
0824 X ++count;
0825 X }
0826 X break;
0827 X case 1:
0828 X if (io0 || irq) {
0829 X printf("mpu 0x%x %d\n", io0, irq);
0830 X ++count;
0831 X }
0832 X break;
0833 X case 2:
0834 X if (io0 || io1 || irq) {
0835 X printf("ide 0x%x 0x%x %d\n", io0, io1, irq);
0836 X ++count;
0837 X }
0838 X break;
0839 X case 3:
0840 X if (io0) {
0841 X printf("joystick 0x%x\n", io0);
0842 X ++count;
0843 X }
0844 X break;
0845 X }
0846 X }
0847 X
0848 X if (count == 0)
0849 X fprintf(stderr, "no devices configured\n");
0850 X
0851 X return 0;
0852 }
0853 X
0854 static int cfg_dsp(int argc, char *argv[])
0855 {
0856 X int io, irq, mem;
0857 X
0858 X if (argc < 3 ||
0859 X sscanf(argv[0], "0x%x", &io) != 1 ||
0860 X sscanf(argv[1], "%d", &irq) != 1 ||
0861 X sscanf(argv[2], "0x%x", &mem) != 1)
0862 X usage();
0863 X
0864 X if (!(io == 0x290 ||
0865 X io == 0x260 ||
0866 X io == 0x250 ||
0867 X io == 0x240 ||
0868 X io == 0x230 ||
0869 X io == 0x220 ||
0870 X io == 0x210 ||
0871 X io == 0x3e0)) {
0872 X fprintf(stderr, "error: io must be one of "
0873 X "210, 220, 230, 240, 250, 260, 290, or 3E0\n");
0874 X usage();
0875 X }
0876 X
0877 X if (!(irq == 5 ||
0878 X irq == 7 ||
0879 X irq == 9 ||
0880 X irq == 10 ||
0881 X irq == 11 ||
0882 X irq == 12)) {
0883 X fprintf(stderr, "error: irq must be one of "
0884 X "5, 7, 9, 10, 11 or 12\n");
0885 X usage();
0886 X }
0887 X
0888 X if (!(mem == 0xb0000 ||
0889 X mem == 0xc8000 ||
0890 X mem == 0xd0000 ||
0891 X mem == 0xd8000 ||
0892 X mem == 0xe0000 ||
0893 X mem == 0xe8000)) {
0894 X fprintf(stderr, "error: mem must be one of "
0895 X "0xb0000, 0xc8000, 0xd0000, 0xd8000, 0xe0000 or 0xe8000\n");
0896 X usage();
0897 X }
0898 X
0899 X return msnd_write_cfg_logical(config_port, 0, io, 0, irq, mem);
0900 }
0901 X
0902 static int cfg_mpu(int argc, char *argv[])
0903 {
0904 X int io, irq;
0905 X
0906 X if (argc < 2 ||
0907 X sscanf(argv[0], "0x%x", &io) != 1 ||
0908 X sscanf(argv[1], "%d", &irq) != 1)
0909 X usage();
0910 X
0911 X return msnd_write_cfg_logical(config_port, 1, io, 0, irq, 0);
0912 }
0913 X
0914 static int cfg_ide(int argc, char *argv[])
0915 {
0916 X int io0, io1, irq;
0917 X
0918 X if (argc < 3 ||
0919 X sscanf(argv[0], "0x%x", &io0) != 1 ||
0920 X sscanf(argv[0], "0x%x", &io1) != 1 ||
0921 X sscanf(argv[1], "%d", &irq) != 1)
0922 X usage();
0923 X
0924 X return msnd_write_cfg_logical(config_port, 2, io0, io1, irq, 0);
0925 }
0926 X
0927 static int cfg_joystick(int argc, char *argv[])
0928 {
0929 X int io;
0930 X
0931 X if (argc < 1 ||
0932 X sscanf(argv[0], "0x%x", &io) != 1)
0933 X usage();
0934 X
0935 X return msnd_write_cfg_logical(config_port, 3, io, 0, 0, 0);
0936 }
0937 X
0938 int main(int argc, char *argv[])
0939 {
0940 X char *device;
0941 X int rv = 0;
0942 X
0943 X --argc; ++argv;
0944 X
0945 X if (argc < 2)
0946 X usage();
0947 X
0948 X sscanf(argv[0], "0x%x", &config_port);
0949 X if (config_port != 0x250 && config_port != 0x260 && config_port != 0x270) {
0950 X fprintf(stderr, "error: <config port> must be 0x250, 0x260 or 0x270\n");
0951 X exit(1);
0952 X }
0953 X if (ioperm(config_port, 2, 1)) {
0954 X perror("ioperm");
0955 X fprintf(stderr, "note: pinnaclecfg must be run as root\n");
0956 X exit(1);
0957 X }
0958 X device = argv[1];
0959 X
0960 X argc -= 2; argv += 2;
0961 X
0962 X if (strcmp(device, "reset") == 0)
0963 X rv = cfg_reset();
0964 X else if (strcmp(device, "show") == 0)
0965 X rv = cfg_show();
0966 X else if (strcmp(device, "dsp") == 0)
0967 X rv = cfg_dsp(argc, argv);
0968 X else if (strcmp(device, "mpu") == 0)
0969 X rv = cfg_mpu(argc, argv);
0970 X else if (strcmp(device, "ide") == 0)
0971 X rv = cfg_ide(argc, argv);
0972 X else if (strcmp(device, "joystick") == 0)
0973 X rv = cfg_joystick(argc, argv);
0974 X else {
0975 X fprintf(stderr, "error: unknown device %s\n", device);
0976 X usage();
0977 X }
0978 X
0979 X if (rv)
0980 X fprintf(stderr, "error: device configuration failed\n");
0981 X
0982 X return 0;
0983 }
0984 SHAR_EOF
0985 $shar_touch -am 1204092598 'MultiSound.d/pinnaclecfg.c' &&
0986 chmod 0664 'MultiSound.d/pinnaclecfg.c' ||
0987 $echo 'restore of' 'MultiSound.d/pinnaclecfg.c' 'failed'
0988 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
0989 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
0990 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
0991 || $echo 'MultiSound.d/pinnaclecfg.c:' 'MD5 check failed'
0992 366bdf27f0db767a3c7921d0a6db20fe MultiSound.d/pinnaclecfg.c
0993 SHAR_EOF
0994 else
0995 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/pinnaclecfg.c'`"
0996 test 10224 -eq "$shar_count" ||
0997 $echo 'MultiSound.d/pinnaclecfg.c:' 'original size' '10224,' 'current size' "$shar_count!"
0998 fi
0999 fi
1000
1001 if test -f 'MultiSound.d/Makefile' && test "$first_param" != -c; then
1002 $echo 'x -' SKIPPING 'MultiSound.d/Makefile' '(file already exists)'
1003 else
1004 $echo 'x -' extracting 'MultiSound.d/Makefile' '(text)'
1005 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/Makefile' &&
1006 CC = gcc
1007 CFLAGS = -O
1008 PROGS = setdigital msndreset pinnaclecfg conv
1009 X
1010 all: $(PROGS)
1011 X
1012 clean:
1013 X rm -f $(PROGS)
1014 SHAR_EOF
1015 $shar_touch -am 1204092398 'MultiSound.d/Makefile' &&
1016 chmod 0664 'MultiSound.d/Makefile' ||
1017 $echo 'restore of' 'MultiSound.d/Makefile' 'failed'
1018 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
1019 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
1020 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
1021 || $echo 'MultiSound.d/Makefile:' 'MD5 check failed'
1022 76ca8bb44e3882edcf79c97df6c81845 MultiSound.d/Makefile
1023 SHAR_EOF
1024 else
1025 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/Makefile'`"
1026 test 106 -eq "$shar_count" ||
1027 $echo 'MultiSound.d/Makefile:' 'original size' '106,' 'current size' "$shar_count!"
1028 fi
1029 fi
1030
1031 if test -f 'MultiSound.d/conv.l' && test "$first_param" != -c; then
1032 $echo 'x -' SKIPPING 'MultiSound.d/conv.l' '(file already exists)'
1033 else
1034 $echo 'x -' extracting 'MultiSound.d/conv.l' '(text)'
1035 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/conv.l' &&
1036 %%
1037 [ \n\t,\r]
1038 \;.*
1039 DB
1040 [0-9A-Fa-f]+H { int n; sscanf(yytext, "%xH", &n); printf("%c", n); }
1041 %%
1042 int yywrap() { return 1; }
1043 void main() { yylex(); }
1044 SHAR_EOF
1045 $shar_touch -am 0828231798 'MultiSound.d/conv.l' &&
1046 chmod 0664 'MultiSound.d/conv.l' ||
1047 $echo 'restore of' 'MultiSound.d/conv.l' 'failed'
1048 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
1049 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
1050 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
1051 || $echo 'MultiSound.d/conv.l:' 'MD5 check failed'
1052 d2411fc32cd71a00dcdc1f009e858dd2 MultiSound.d/conv.l
1053 SHAR_EOF
1054 else
1055 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/conv.l'`"
1056 test 146 -eq "$shar_count" ||
1057 $echo 'MultiSound.d/conv.l:' 'original size' '146,' 'current size' "$shar_count!"
1058 fi
1059 fi
1060
1061 if test -f 'MultiSound.d/msndreset.c' && test "$first_param" != -c; then
1062 $echo 'x -' SKIPPING 'MultiSound.d/msndreset.c' '(file already exists)'
1063 else
1064 $echo 'x -' extracting 'MultiSound.d/msndreset.c' '(text)'
1065 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/msndreset.c' &&
1066 /*********************************************************************
1067 X *
1068 X * msndreset.c - resets the MultiSound card
1069 X *
1070 X * Copyright (C) 1998 Andrew Veliath
1071 X *
1072 X * This program is free software; you can redistribute it and/or modify
1073 X * it under the terms of the GNU General Public License as published by
1074 X * the Free Software Foundation; either version 2 of the License, or
1075 X * (at your option) any later version.
1076 X *
1077 X * This program is distributed in the hope that it will be useful,
1078 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
1079 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1080 X * GNU General Public License for more details.
1081 X *
1082 X * You should have received a copy of the GNU General Public License
1083 X * along with this program; if not, write to the Free Software
1084 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1085 X *
1086 X ********************************************************************/
1087 X
1088
1089
1090
1091
1092
1093
1094
1095
1096 X
1097 int main(int argc, char *argv[])
1098 {
1099 X int fd;
1100 X
1101 X if (argc != 2) {
1102 X fprintf(stderr, "usage: msndreset <mixer device>\n");
1103 X exit(1);
1104 X }
1105 X
1106 X if ((fd = open(argv[1], O_RDWR)) < 0) {
1107 X perror(argv[1]);
1108 X exit(1);
1109 X }
1110 X
1111 X if (ioctl(fd, SOUND_MIXER_PRIVATE1, 0) < 0) {
1112 X fprintf(stderr, "error: msnd ioctl reset failed\n");
1113 X perror("ioctl");
1114 X close(fd);
1115 X exit(1);
1116 X }
1117 X
1118 X close(fd);
1119 X
1120 X return 0;
1121 }
1122 SHAR_EOF
1123 $shar_touch -am 1204100698 'MultiSound.d/msndreset.c' &&
1124 chmod 0664 'MultiSound.d/msndreset.c' ||
1125 $echo 'restore of' 'MultiSound.d/msndreset.c' 'failed'
1126 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
1127 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
1128 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
1129 || $echo 'MultiSound.d/msndreset.c:' 'MD5 check failed'
1130 c52f876521084e8eb25e12e01dcccb8a MultiSound.d/msndreset.c
1131 SHAR_EOF
1132 else
1133 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MultiSound.d/msndreset.c'`"
1134 test 1491 -eq "$shar_count" ||
1135 $echo 'MultiSound.d/msndreset.c:' 'original size' '1491,' 'current size' "$shar_count!"
1136 fi
1137 fi
1138 rm -fr _sh01426
1139 exit 0