1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
*** nspmod.c.orig Sat Sep 16 04:10:37 1995
--- nspmod.c Sat Mar 7 04:43:55 1998
***************
*** 1,4 ****
--- 1,5 ----
#include <stdio.h> /*(perror)*/
+ #include <sys/types.h>
#include <sys/mman.h> /*PROT_READ,MAP_xxx*/
#include <fcntl.h> /*O_RDONLY*/
#include <sys/stat.h> /*stat*/
***************
*** 35,40 ****
--- 36,42 ----
printf("NSPmod version " LIT(VERSION_MAJOR) "." LIT(VERSION_MINOR) "\n");
printf("Usage: %s [options] modfile\n", argv0);
printf("Options:\n");
+ printf(" -b # number of bits to output (8 or 16)\n");
printf(" -c # play only the channel\n");
printf(" -e show events\n");
printf(" -f # output sample rate\n");
***************
*** 59,69 ****
static OptInfo oi;
int optChar;
oi.outRate = DEF_OUTRATE;
oi.ovsFreq = -1;
/*oi.repLimit = 1;*/
! while ((optChar = getopt(argc, argv, "c:ef:il:mo:rs:v:")) > 0) {
switch (optChar) {
case 'c': oi.onlyCh = (i15x)strtol(optarg, NULL, 0) | 0x100; break;
case 'e': oi.showEvents++; break;
case 'f': oi.outRate = (u16x)strtol(optarg, NULL, 0); break;
--- 61,73 ----
static OptInfo oi;
int optChar;
+ oi.bits = 8;
oi.outRate = DEF_OUTRATE;
oi.ovsFreq = -1;
/*oi.repLimit = 1;*/
! while ((optChar = getopt(argc, argv, "b:c:ef:il:mo:rs:v:")) > 0) {
switch (optChar) {
+ case 'b': oi.bits = (i15x)strtol(optarg, NULL, 0); break;
case 'c': oi.onlyCh = (i15x)strtol(optarg, NULL, 0) | 0x100; break;
case 'e': oi.showEvents++; break;
case 'f': oi.outRate = (u16x)strtol(optarg, NULL, 0); break;
***************
*** 116,121 ****
--- 120,126 ----
lookOverFile(p, statbuf.st_size);
dacioInit();
+ dci.bits = oi.bits;
dci.speed = oi.outRate;
dci.stereo = !oi.mono;
dacioConf(&dci);
|