annotate pwplib/setup.c @ 59:25861c440f15

Possibly fix a bug in argument handling.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 09 Jul 2011 11:48:52 +0300
parents 85671798fdb3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #include "config.h"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 #include "pwplib.h"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
50
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
4 #define MAX_DESTRUCTORS 16
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 /******************** random stuff *************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 void pwplib_dummy(){}
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 #define pwp_dummy pwplib_dummy
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 void pwplib_dump_rast_plain()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 TEMPMALL(u8,tmp,pwplib.videobuf.width*pwplib.videobuf.height*2);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 u8
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 *d=tmp,
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 *parentbuf=pwplib.videobuf.d,
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 *s=parentbuf;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 int i=pwplib.videobuf.width*pwplib.videobuf.height;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 for(;i;i--)
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 #ifdef DRIVE_WIN32
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 d[0]=176;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 #else
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 d[0]='%';
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 #endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 d[1]=*s++;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 d+=2;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 pwplib.videobuf.d=tmp;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 pwplib.dump_attr();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 pwplib.videobuf.d=parentbuf;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 TEMPFREE(tmp);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 /********************* timer (unix) ************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 #define TIMERHZ 72
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 int pwp_timer_nrt()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 static int lastctr=0,framectr=0;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 if(pwplib.setup[SETUP_BPS])
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 pwplib.timer_counter++; /* kludge */
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 return (pwplib.timer_counter*TIMERHZ)/(pwplib.setup[SETUP_BPS]>>3);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 else
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 if(pwplib.timer_counter!=lastctr)
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 framectr++;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56 lastctr=pwplib.timer_counter;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 else
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 pwplib.timer_counter++;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60 return (framectr*TIMERHZ)/pwplib.setup[SETUP_FPS];
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 int pwplib_timer()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 static int base=-1;int v;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 v=pwplib.timerfunc();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 if(base==-1)base=v;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 return v-base;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 /********************* destructors, signals etc **********/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73
50
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
74 void(*pwp_destr[MAX_DESTRUCTORS + 1])();
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75
17
c60e531d19cd Some misc. cleanups and minor warning removals.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
76 void pwplib_regdestr(void(*func)())
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 {
50
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
78 static int curr = 0;
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
79 if (curr < MAX_DESTRUCTORS) {
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
80 pwp_destr[curr++] = func;
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
81 pwp_destr[curr] = NULL;
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
82 } else {
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
83 pwpwrite("* FATAL! tried to register %d destructors where %d is max.\n", curr, MAX_DESTRUCTORS);
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
84 exit(1);
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
85 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
88 void pwplib_shutdown(void)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 {
50
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
90 int i = 0;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 while(pwp_destr[i]!=NULL)
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 pwp_destr[i++]();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95 /******************** initialization *********************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
97 int pwplib_init_common(void)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 /*** base stuff ***/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 pwplib.sound=
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102 pwplib.loopflush=
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103 pwplib.player=
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104 pwplib.dump_attr=
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 pwplib.dump_rast=
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106 pwplib.prep_attr=
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107 pwplib.prep_rast=
50
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
108 pwplib_dummy;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110 pwp_destr[0]=NULL;
50
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
111
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
112 return 1;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 /***********************************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
117 static void rmarg(int *argc, char *argv[], int n)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118 {
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
119 while (n < *argc)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120 {
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
121 argv[n] = argv[n + 1];
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 n++;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 (*argc)--;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127 /*********************************************************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 #define ARGC pwplib.argc
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130 #define ARGV pwplib.argv
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
131 static void getopts(pwp_optab *opts, const int nopts)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132 {
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
133 int i;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
135 for (i = 0; i < nopts; i++)
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
136 *(opts[i].var) = opts[i].dflt;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
138 for (i = 0; i < ARGC;)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139 {
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
140 int opt, match = 0, wh = -1, lev = 0;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
142 for (opt = 0; opt < nopts; opt++)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143 {
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
144 char *s1 = opts[opt].name;
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
145 char *s0 = ARGV[i];
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
146 int ngl = 0, m = 0;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
148 while (*s0)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
149 {
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
150 if (*s0=='-')
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151 ngl=0;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152 else
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
153 if (*s0=='+')
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154 ngl=1;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155 else
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157 m++;
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
158 if (*s0=='\0' || *s1=='\0')break;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159 else
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
160 if ((*s0|32) != *s1)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162 m=0;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
163 break;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
164 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
165 s1++;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
167 s0++;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
169
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
170 if (m > match)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171 {
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
172 match = m;
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
173 lev = ngl;
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
174 wh = opt;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
175 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
176 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
178 if (wh >= 0)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
179 {
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
180 rmarg(&ARGC, ARGV, i);
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
181
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
182 switch (opts[wh].type)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
183 {
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
184 case OPT_BIN:
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
185 *((int*)(opts[wh].var)) = lev;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
186 break;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
188 case OPT_NOT:
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
189 *((int*)(opts[wh].var)) = 1 - lev;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190 break;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
191
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
192 case OPT_ONE:
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
193 *((int*)(opts[wh].var))=1;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
194
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
195 case OPT_INT:
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
196 if (ARGV[i] != NULL)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
197 {
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
198 *((int*)(opts[wh].var)) = atoi(ARGV[i]);
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
199 rmarg(&ARGC, ARGV, i);
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
200 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
201 break;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
202
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
203 case OPT_STRING:
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
204 if (ARGV[i] != NULL)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
205 {
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
206 *((char**)(opts[wh].var)) = strdup(ARGV[i]);
59
25861c440f15 Possibly fix a bug in argument handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 54
diff changeset
207 rmarg(&ARGC, ARGV, 1);
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
208 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
209 break;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
210 }
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
211 } else
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
212 i++;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
213 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
214 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
215 #undef ARGC
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
216 #undef ARGV
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
217
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
218 /************************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
219
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
220 static pwp_optab main_options[] = {
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
221 /* stuph */
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
222 { "help", OPT_ONE, (void*)0, (void*)&pwplib.setup[SETUP_WANTHELP] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
223 { "shutup", OPT_ONE, (void*)0, (void*)&pwplib.setup[SETUP_SHUTUP] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
224 { "infodelay", OPT_INT, (void*)100, (void*)&pwplib.set.infodelay },
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
225
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
226 /* general */
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
227 { "nosound", OPT_ONE, (void*)0, (void*)&pwplib.setup[SETUP_NOSOUND] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
228 { "novideo", OPT_ONE, (void*)0, (void*)&pwplib.setup[SETUP_NOVIDEO] },
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
229
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
230 /* video */
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
231 { "term", OPT_STRING, (void*)NULL, (void*)&pwplib.set.term },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
232 { "lang", OPT_STRING, (void*)NULL, (void*)&pwplib.set.lang },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
233 { "tty", OPT_BIN, (void*)0, (void*)&pwplib.setup[SETUP_TTY] }, /* obsolete? */
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
234 { "pvp", OPT_BIN, (void*)0, (void*)&pwplib.setup[SETUP_PVP] },
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
235
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
236 /* size */
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
237 { "height", OPT_INT, (void*)0, (void*)&pwplib.setup[SETUP_USERHEIGHT] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
238 { "width", OPT_INT, (void*)0, (void*)&pwplib.setup[SETUP_USERWIDTH] },
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
239
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
240 /* conversion */
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
241 { "trans", OPT_INT, (void*)-1, (void*)&pwplib.setup[SETUP_TRANS] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
242 { "colors", OPT_INT, (void*)-1, (void*)&pwplib.setup[SETUP_COLORS] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
243 { "raster", OPT_INT, (void*)-1, (void*)&pwplib.setup[SETUP_RASTER] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
244 { "halve", OPT_BIN, (void*)1, (void*)&pwplib.setup[SETUP_HALVE] },
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
245
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
246 /* tty-etc stuff */
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
247 { "fps", OPT_INT, (void*)0, (void*)&pwplib.setup[SETUP_FPS] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
248 { "bps", OPT_INT, (void*)0, (void*)&pwplib.setup[SETUP_BPS] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
249 { "minfps", OPT_INT, (void*)0, (void*)&pwplib.setup[SETUP_MINFPS] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
250 { "maxfps", OPT_INT, (void*)256, (void*)&pwplib.setup[SETUP_MAXFPS] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
251 { "lossy", OPT_BIN, (void*)0, (void*)&pwplib.setup[SETUP_LOSSY] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
252 { "fdelay", OPT_INT, (void*)0, (void*)&pwplib.set.framedelay },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
253 { "fbytes", OPT_INT, (void*)500, (void*)&pwplib.set.framebytes },
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
254
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
255 /* audio options */
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
256 { "audev", OPT_STRING, (void*)NULL, (void*)&pwplib.set.audev },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
257 { "volume", OPT_INT, (void*)32, (void*)&pwplib.setup[SETUP_VOLUME] },
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
258
21
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
259 #if (defined(DRIVE_SDL))
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
260 /* Graphical output related */
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
261 { "fs", OPT_ONE, (void*)0, (void*)&pwplib.setup[SETUP_FULLSCREEN] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
262 { "xres", OPT_INT, (void*)640, (void*)&pwplib.setup[SETUP_XRES] },
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
263 { "yres", OPT_INT, (void*)480, (void*)&pwplib.setup[SETUP_YRES] },
21
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
264 #endif
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
265
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
266 };
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
267
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
268
50
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
269 void pwplib_printhelp(void)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
270 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
271 printf(
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
272 "usage: %s [options] where options include:\n\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
273
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
274 " help this text\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
275
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
276 "\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
277
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
278 " shutup be quiet - only output the essentials\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
279 " term s set terminal type to s (e.g. xterm-color, vt100, ansi)\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
280 " lang s set locale/language to s (e.g. en, fi)\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
281 " pvp output in pwp video phormat (stdout)\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
282
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
283 "\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
284
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
285 " nosound no sound\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
286 " novideo no video output\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
287
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
288 "\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
289
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
290 " height x set buffer height (default = fullwindow)\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
291 " width x set buffer width (default = fullwindow)\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
292
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
293 "\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
294
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
295 " volume v set soft volume to v (numeric, default 32)\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
296 " colors x color configuration: 0=16x16, 1=8fg 2=8bg, 3=8x8\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
297 " 8=monochrome, 9=vtattributes\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
298 " trans n charset: 1=ibm, 2=ascii, 3=ascii-pure\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
299 " raster n raster rendering mode: 0==fg+bg 1=fgonly 2=mono\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
300 " ascii pure ascii: no colors, no attributes\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
301 " nohalve always use one character cell to represent a pixel\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
302
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
303 "\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
304
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
305 " fbytes n bytes/frame threshold (optimize frame if exceeded)\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
306 " fdelay n delay after each frame (milliseconds)\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
307
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
308 "\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
309
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
310 " bps n non-rt: fix to n bits per second, no delay\n"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
311 " fps n non-rt: fix to n frames per second, no delay\n"
21
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
312
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
313 "\n"
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
314
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
315 #if (defined(DRIVE_SDL))
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
316 " fs full screen mode (SDL)\n"
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
317 " xres x graphical x resolution (640)\n"
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
318 " yres x graphical y resolution (480)\n"
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
319
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
320 "\n"
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
321 #endif
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
322 ,
f0869ef0f2d9 Add commandline settings for fullscreen and changing horiz/vert resolution of SDL output. Also hide the mouse cursor.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
323 pwplib.argv[0]);
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
324 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
325
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
326 void pwplib_getopts()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
327 {
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
328 getopts(main_options, sizeof(main_options) / sizeof(main_options[0]));
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
329
54
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
330 if (pwplib.set.lang == NULL)
85671798fdb3 Various code cleanups, cosmetics, warning fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
331 pwplib.set.lang = pwp_get_locale();
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
332 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
333