diff options
113 files changed, 10637 insertions, 4420 deletions
diff --git a/apps/plugins/pdbox/PDa/extra/OSCroute.c b/apps/plugins/pdbox/PDa/extra/OSCroute.c index 24860d0b79..34af5aab4b 100644 --- a/apps/plugins/pdbox/PDa/extra/OSCroute.c +++ b/apps/plugins/pdbox/PDa/extra/OSCroute.c | |||
@@ -42,6 +42,10 @@ The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl | |||
42 | 42 | ||
43 | */ | 43 | */ |
44 | 44 | ||
45 | #ifdef ROCKBOX | ||
46 | #include "plugin.h" | ||
47 | #include "pdbox.h" | ||
48 | #else /* ROCKBOX */ | ||
45 | #ifdef WIN32 | 49 | #ifdef WIN32 |
46 | #include <stdlib.h> | 50 | #include <stdlib.h> |
47 | #include <string.h> | 51 | #include <string.h> |
@@ -52,6 +56,7 @@ The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl | |||
52 | #ifdef UNIX | 56 | #ifdef UNIX |
53 | #include <stdio.h> | 57 | #include <stdio.h> |
54 | #endif | 58 | #endif |
59 | #endif /* ROCKBOX */ | ||
55 | 60 | ||
56 | /* structure definition of your object */ | 61 | /* structure definition of your object */ |
57 | 62 | ||
@@ -114,6 +119,9 @@ static void StrCopyUntilSlash(char *target, const char *source); | |||
114 | // free | 119 | // free |
115 | static void OSCroute_free(t_OSCroute *x) | 120 | static void OSCroute_free(t_OSCroute *x) |
116 | { | 121 | { |
122 | #ifdef ROCKBOX | ||
123 | (void) x; | ||
124 | #endif | ||
117 | // freebytes(x->x_vec, x->x_nelement * sizeof(*x->x_vec)); | 125 | // freebytes(x->x_vec, x->x_nelement * sizeof(*x->x_vec)); |
118 | } | 126 | } |
119 | 127 | ||
@@ -154,7 +162,9 @@ void OSCroute_setup(void) { | |||
154 | 162 | ||
155 | void *OSCroute_new(t_symbol *s, int argc, t_atom *argv) | 163 | void *OSCroute_new(t_symbol *s, int argc, t_atom *argv) |
156 | { | 164 | { |
157 | 165 | #ifdef ROCKBOX | |
166 | (void) s; | ||
167 | #endif | ||
158 | t_OSCroute *x = (t_OSCroute *)pd_new(OSCroute_class); // get memory for a new object & initialize | 168 | t_OSCroute *x = (t_OSCroute *)pd_new(OSCroute_class); // get memory for a new object & initialize |
159 | 169 | ||
160 | int i; //{{raf}} n not used | 170 | int i; //{{raf}} n not used |
@@ -236,6 +246,9 @@ void *OSCroute_new(t_symbol *s, int argc, t_atom *argv) | |||
236 | 246 | ||
237 | 247 | ||
238 | void OSCroute_version (t_OSCroute *x) { | 248 | void OSCroute_version (t_OSCroute *x) { |
249 | #ifdef ROCKBOX | ||
250 | (void) x; | ||
251 | #endif | ||
239 | // EnterCallback(); | 252 | // EnterCallback(); |
240 | post("OSCroute Version " OSC_ROUTE_VERSION | 253 | post("OSCroute Version " OSC_ROUTE_VERSION |
241 | ", by Matt Wright. pd jdl, win32: raf.\nOSCroute Compiled " __TIME__ " " __DATE__); | 254 | ", by Matt Wright. pd jdl, win32: raf.\nOSCroute Compiled " __TIME__ " " __DATE__); |
@@ -248,15 +261,27 @@ void OSCroute_version (t_OSCroute *x) { | |||
248 | 261 | ||
249 | void OSCroute_assist (t_OSCroute *x, void *box, long msg, long arg, | 262 | void OSCroute_assist (t_OSCroute *x, void *box, long msg, long arg, |
250 | char *dstString) { | 263 | char *dstString) { |
264 | #ifdef ROCKBOX | ||
265 | (void) box; | ||
266 | #endif | ||
251 | // EnterCallback(); | 267 | // EnterCallback(); |
252 | 268 | ||
253 | if (msg==ASSIST_INLET) { | 269 | if (msg==ASSIST_INLET) { |
270 | #ifdef ROCKBOX | ||
271 | strcpy(dstString, "Incoming OSC messages"); | ||
272 | #else | ||
254 | sprintf(dstString, "Incoming OSC messages"); | 273 | sprintf(dstString, "Incoming OSC messages"); |
274 | #endif | ||
255 | } else if (msg==ASSIST_OUTLET) { | 275 | } else if (msg==ASSIST_OUTLET) { |
256 | if (arg < 0 || arg >= x->x_num) { | 276 | if (arg < 0 || arg >= x->x_num) { |
257 | post("* OSCroute_assist: No outlet corresponds to arg %ld!", arg); | 277 | post("* OSCroute_assist: No outlet corresponds to arg %ld!", arg); |
258 | } else { | 278 | } else { |
279 | #ifdef ROCKBOX | ||
280 | strcpy(dstString, "subaddress + args for prefix "); | ||
281 | strcat(dstString, x->x_prefixes[arg]); | ||
282 | #else | ||
259 | sprintf(dstString, "subaddress + args for prefix %s", x->x_prefixes[arg]); | 283 | sprintf(dstString, "subaddress + args for prefix %s", x->x_prefixes[arg]); |
284 | #endif | ||
260 | } | 285 | } |
261 | } else { | 286 | } else { |
262 | post("* OSCroute_assist: unrecognized message %ld", msg); | 287 | post("* OSCroute_assist: unrecognized message %ld", msg); |
@@ -266,6 +291,9 @@ void OSCroute_assist (t_OSCroute *x, void *box, long msg, long arg, | |||
266 | } | 291 | } |
267 | 292 | ||
268 | void OSCroute_list(t_OSCroute *x, t_symbol *s, int argc, t_atom *argv) { | 293 | void OSCroute_list(t_OSCroute *x, t_symbol *s, int argc, t_atom *argv) { |
294 | #ifdef ROCKBOX | ||
295 | (void) s; | ||
296 | #endif | ||
269 | // EnterCallback(); | 297 | // EnterCallback(); |
270 | if (argc > 0 && argv[0].a_type == A_SYMBOL) { | 298 | if (argc > 0 && argv[0].a_type == A_SYMBOL) { |
271 | /* Ignore the fact that this is a "list" */ | 299 | /* Ignore the fact that this is a "list" */ |
diff --git a/apps/plugins/pdbox/PDa/extra/bandpass.c b/apps/plugins/pdbox/PDa/extra/bandpass.c index 127a1eee06..50a0b42e86 100644 --- a/apps/plugins/pdbox/PDa/extra/bandpass.c +++ b/apps/plugins/pdbox/PDa/extra/bandpass.c | |||
@@ -1,87 +1,95 @@ | |||
1 | 1 | ||
2 | /* (C) Guenter Geiger <geiger@epy.co.at> */ | 2 | /* (C) Guenter Geiger <geiger@epy.co.at> */ |
3 | 3 | ||
4 | 4 | ||
5 | /* | 5 | /* |
6 | 6 | ||
7 | These filter coefficients computations are taken from | 7 | These filter coefficients computations are taken from |
8 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt | 8 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt |
9 | 9 | ||
10 | written by Robert Bristow-Johnson | 10 | written by Robert Bristow-Johnson |
11 | 11 | ||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "m_pd.h" | 14 | #ifdef ROCKBOX |
15 | #ifdef NT | 15 | #include "plugin.h" |
16 | #pragma warning( disable : 4244 ) | 16 | #include "pdbox.h" |
17 | #pragma warning( disable : 4305 ) | 17 | #include "m_pd.h" |
18 | #endif | 18 | #include "math.h" |
19 | #include <math.h> | 19 | #include "filters.h" |
20 | #include "filters.h" | 20 | #else /* ROCKBOX */ |
21 | 21 | #include "m_pd.h" | |
22 | /* ------------------- bandpass ----------------------------*/ | 22 | #ifdef NT |
23 | 23 | #pragma warning( disable : 4244 ) | |
24 | static t_class *bandpass_class; | 24 | #pragma warning( disable : 4305 ) |
25 | 25 | #endif | |
26 | void bandpass_bang(t_rbjfilter *x) | 26 | #include <math.h> |
27 | { | 27 | #include "filters.h" |
28 | t_atom at[5]; | 28 | #endif /* ROCKBOX */ |
29 | t_float omega = e_omega(x->x_freq,x->x_rate); | 29 | |
30 | t_float alpha = e_alpha(x->x_bw* 0.01,omega); | 30 | /* ------------------- bandpass ----------------------------*/ |
31 | t_float b1 = 0.; | 31 | |
32 | t_float b0 = alpha; | 32 | static t_class *bandpass_class; |
33 | t_float b2 = -alpha; | 33 | |
34 | t_float a0 = 1 + alpha; | 34 | void bandpass_bang(t_rbjfilter *x) |
35 | t_float a1 = -2.*cos(omega); | 35 | { |
36 | t_float a2 = 1 - alpha; | 36 | t_atom at[5]; |
37 | 37 | t_float omega = e_omega(x->x_freq,x->x_rate); | |
38 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw); */ | 38 | t_float alpha = e_alpha(x->x_bw* 0.01,omega); |
39 | 39 | t_float b1 = 0.; | |
40 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { | 40 | t_float b0 = alpha; |
41 | post("bandpass: filter unstable -> resetting"); | 41 | t_float b2 = -alpha; |
42 | a0=1.;a1=0.;a2=0.; | 42 | t_float a0 = 1 + alpha; |
43 | b0=1.;b1=0.;b2=0.; | 43 | t_float a1 = -2.*cos(omega); |
44 | } | 44 | t_float a2 = 1 - alpha; |
45 | 45 | ||
46 | SETFLOAT(at,-a1/a0); | 46 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw); */ |
47 | SETFLOAT(at+1,-a2/a0); | 47 | |
48 | SETFLOAT(at+2,b0/a0); | 48 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { |
49 | SETFLOAT(at+3,b1/a0); | 49 | post("bandpass: filter unstable -> resetting"); |
50 | SETFLOAT(at+4,b2/a0); | 50 | a0=1.;a1=0.;a2=0.; |
51 | 51 | b0=1.;b1=0.;b2=0.; | |
52 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); | 52 | } |
53 | } | 53 | |
54 | 54 | SETFLOAT(at,-a1/a0); | |
55 | 55 | SETFLOAT(at+1,-a2/a0); | |
56 | void bandpass_float(t_rbjfilter *x,t_floatarg f) | 56 | SETFLOAT(at+2,b0/a0); |
57 | { | 57 | SETFLOAT(at+3,b1/a0); |
58 | x->x_freq = f; | 58 | SETFLOAT(at+4,b2/a0); |
59 | bandpass_bang(x); | 59 | |
60 | } | 60 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); |
61 | 61 | } | |
62 | 62 | ||
63 | static void *bandpass_new(t_floatarg f,t_floatarg bw) | 63 | |
64 | { | 64 | void bandpass_float(t_rbjfilter *x,t_floatarg f) |
65 | t_rbjfilter *x = (t_rbjfilter *)pd_new(bandpass_class); | 65 | { |
66 | 66 | x->x_freq = f; | |
67 | x->x_rate = 44100.0; | 67 | bandpass_bang(x); |
68 | outlet_new(&x->x_obj,&s_float); | 68 | } |
69 | /* floatinlet_new(&x->x_obj, &x->x_gain); */ | 69 | |
70 | floatinlet_new(&x->x_obj, &x->x_bw); | 70 | |
71 | if (f > 0.) x->x_freq = f; | 71 | static void *bandpass_new(t_floatarg f,t_floatarg bw) |
72 | if (bw > 0.) x->x_bw = bw; | 72 | { |
73 | return (x); | 73 | t_rbjfilter *x = (t_rbjfilter *)pd_new(bandpass_class); |
74 | } | 74 | |
75 | 75 | x->x_rate = 44100.0; | |
76 | 76 | outlet_new(&x->x_obj,&s_float); | |
77 | void bandpass_setup(void) | 77 | /* floatinlet_new(&x->x_obj, &x->x_gain); */ |
78 | { | 78 | floatinlet_new(&x->x_obj, &x->x_bw); |
79 | bandpass_class = class_new(gensym("bandpass"), (t_newmethod)bandpass_new, 0, | 79 | if (f > 0.) x->x_freq = f; |
80 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,0); | 80 | if (bw > 0.) x->x_bw = bw; |
81 | class_addbang(bandpass_class,bandpass_bang); | 81 | return (x); |
82 | class_addfloat(bandpass_class,bandpass_float); | 82 | } |
83 | } | 83 | |
84 | 84 | ||
85 | 85 | void bandpass_setup(void) | |
86 | 86 | { | |
87 | bandpass_class = class_new(gensym("bandpass"), (t_newmethod)bandpass_new, 0, | ||
88 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,0); | ||
89 | class_addbang(bandpass_class,bandpass_bang); | ||
90 | class_addfloat(bandpass_class,bandpass_float); | ||
91 | } | ||
92 | |||
93 | |||
94 | |||
87 | 95 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/dumpOSC.c b/apps/plugins/pdbox/PDa/extra/dumpOSC.c index 28b0d8223e..4e80de18a0 100644 --- a/apps/plugins/pdbox/PDa/extra/dumpOSC.c +++ b/apps/plugins/pdbox/PDa/extra/dumpOSC.c | |||
@@ -1,1000 +1,1000 @@ | |||
1 | /* | 1 | /* |
2 | Written by Matt Wright and Adrian Freed, The Center for New Music and | 2 | Written by Matt Wright and Adrian Freed, The Center for New Music and |
3 | Audio Technologies, University of California, Berkeley. Copyright (c) | 3 | Audio Technologies, University of California, Berkeley. Copyright (c) |
4 | 1992,93,94,95,96,97,98,99,2000,01,02,03,04 The Regents of the University of | 4 | 1992,93,94,95,96,97,98,99,2000,01,02,03,04 The Regents of the University of |
5 | California (Regents). | 5 | California (Regents). |
6 | 6 | ||
7 | Permission to use, copy, modify, distribute, and distribute modified versions | 7 | Permission to use, copy, modify, distribute, and distribute modified versions |
8 | of this software and its documentation without fee and without a signed | 8 | of this software and its documentation without fee and without a signed |
9 | licensing agreement, is hereby granted, provided that the above copyright | 9 | licensing agreement, is hereby granted, provided that the above copyright |
10 | notice, this paragraph and the following two paragraphs appear in all copies, | 10 | notice, this paragraph and the following two paragraphs appear in all copies, |
11 | modifications, and distributions. | 11 | modifications, and distributions. |
12 | 12 | ||
13 | IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, | 13 | IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, |
14 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING | 14 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING |
15 | OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS | 15 | OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS |
16 | BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 16 | BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
17 | 17 | ||
18 | REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | 18 | REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
19 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 19 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
20 | PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED | 20 | PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED |
21 | HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE | 21 | HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE |
22 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 22 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
23 | 23 | ||
24 | 24 | ||
25 | The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl | 25 | The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl |
26 | */ | 26 | */ |
27 | 27 | ||
28 | 28 | ||
29 | /* | 29 | /* |
30 | 30 | ||
31 | dumpOSC.c | 31 | dumpOSC.c |
32 | server that displays OpenSoundControl messages sent to it | 32 | server that displays OpenSoundControl messages sent to it |
33 | for debugging client udp and UNIX protocol | 33 | for debugging client udp and UNIX protocol |
34 | 34 | ||
35 | by Matt Wright, 6/3/97 | 35 | by Matt Wright, 6/3/97 |
36 | modified from dumpSC.c, by Matt Wright and Adrian Freed | 36 | modified from dumpSC.c, by Matt Wright and Adrian Freed |
37 | 37 | ||
38 | version 0.2: Added "-silent" option a.k.a. "-quiet" | 38 | version 0.2: Added "-silent" option a.k.a. "-quiet" |
39 | 39 | ||
40 | version 0.3: Incorporated patches from Nicola Bernardini to make | 40 | version 0.3: Incorporated patches from Nicola Bernardini to make |
41 | things Linux-friendly. Also added ntohl() in the right places | 41 | things Linux-friendly. Also added ntohl() in the right places |
42 | to support little-endian architectures. | 42 | to support little-endian architectures. |
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | compile: | 46 | compile: |
47 | cc -o dumpOSC dumpOSC.c | 47 | cc -o dumpOSC dumpOSC.c |
48 | 48 | ||
49 | to-do: | 49 | to-do: |
50 | 50 | ||
51 | More robustness in saying exactly what's wrong with ill-formed | 51 | More robustness in saying exactly what's wrong with ill-formed |
52 | messages. (If they don't make sense, show exactly what was | 52 | messages. (If they don't make sense, show exactly what was |
53 | received.) | 53 | received.) |
54 | 54 | ||
55 | Time-based features: print time-received for each packet | 55 | Time-based features: print time-received for each packet |
56 | 56 | ||
57 | Clean up to separate OSC parsing code from socket/select stuff | 57 | Clean up to separate OSC parsing code from socket/select stuff |
58 | 58 | ||
59 | pd: branched from http://www.cnmat.berkeley.edu/OpenSoundControl/src/dumpOSC/dumpOSC.c | 59 | pd: branched from http://www.cnmat.berkeley.edu/OpenSoundControl/src/dumpOSC/dumpOSC.c |
60 | ------------- | 60 | ------------- |
61 | -- added pd functions | 61 | -- added pd functions |
62 | -- socket is made differently than original via pd mechanisms | 62 | -- socket is made differently than original via pd mechanisms |
63 | -- tweaks for Win32 www.zeggz.com/raf 13-April-2002 | 63 | -- tweaks for Win32 www.zeggz.com/raf 13-April-2002 |
64 | -- the OSX changes from cnmat didnt make it here yet but this compiles | 64 | -- the OSX changes from cnmat didnt make it here yet but this compiles |
65 | on OSX anyway. | 65 | on OSX anyway. |
66 | 66 | ||
67 | */ | 67 | */ |
68 | 68 | ||
69 | #if HAVE_CONFIG_H | 69 | #if HAVE_CONFIG_H |
70 | #include <config.h> | 70 | #include <config.h> |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | #include "m_pd.h" | 73 | #include "m_pd.h" |
74 | //#include "m_imp.h" | 74 | //#include "m_imp.h" |
75 | #include "s_stuff.h" | 75 | #include "s_stuff.h" |
76 | 76 | ||
77 | /* declarations */ | 77 | /* declarations */ |
78 | 78 | ||
79 | // typedef void (*t_fdpollfn)(void *ptr, int fd); | 79 | // typedef void (*t_fdpollfn)(void *ptr, int fd); |
80 | void sys_addpollfn(int fd, t_fdpollfn fn, void *ptr); | 80 | void sys_addpollfn(int fd, t_fdpollfn fn, void *ptr); |
81 | 81 | ||
82 | 82 | ||
83 | #if defined(__sgi) || defined(__linux) || defined(WIN32) || defined(__APPLE__) | 83 | #if defined(__sgi) || defined(__linux) || defined(WIN32) || defined(__APPLE__) |
84 | 84 | ||
85 | #ifdef WIN32 | 85 | #ifdef WIN32 |
86 | #include "OSC-common.h" | 86 | #include "OSC-common.h" |
87 | #include <winsock2.h> | 87 | #include <winsock2.h> |
88 | #include <string.h> | 88 | #include <string.h> |
89 | #include <stdlib.h> | 89 | #include <stdlib.h> |
90 | #include <fcntl.h> | 90 | #include <fcntl.h> |
91 | #include <sys/types.h> | 91 | #include <sys/types.h> |
92 | #include <sys/stat.h> | 92 | #include <sys/stat.h> |
93 | #include <ctype.h> | 93 | #include <ctype.h> |
94 | #include <signal.h> | 94 | #include <signal.h> |
95 | #else | 95 | #else |
96 | #include <stdio.h> | 96 | #include <stdio.h> |
97 | #include <string.h> | 97 | #include <string.h> |
98 | #include <stdlib.h> | 98 | #include <stdlib.h> |
99 | #include <unistd.h> | 99 | #include <unistd.h> |
100 | #include <fcntl.h> | 100 | #include <fcntl.h> |
101 | #include <sys/types.h> | 101 | #include <sys/types.h> |
102 | #include <sys/stat.h> | 102 | #include <sys/stat.h> |
103 | #include <netinet/in.h> | 103 | #include <netinet/in.h> |
104 | #include <rpc/rpc.h> | 104 | #include <rpc/rpc.h> |
105 | #include <sys/socket.h> | 105 | #include <sys/socket.h> |
106 | #include <sys/un.h> | 106 | #include <sys/un.h> |
107 | #include <sys/times.h> | 107 | #include <sys/times.h> |
108 | #include <sys/param.h> | 108 | #include <sys/param.h> |
109 | #include <sys/time.h> | 109 | #include <sys/time.h> |
110 | #include <sys/ioctl.h> | 110 | #include <sys/ioctl.h> |
111 | #include <ctype.h> | 111 | #include <ctype.h> |
112 | #include <arpa/inet.h> | 112 | #include <arpa/inet.h> |
113 | #include <netdb.h> | 113 | #include <netdb.h> |
114 | #include <pwd.h> | 114 | #include <pwd.h> |
115 | #include <signal.h> | 115 | #include <signal.h> |
116 | #include <grp.h> | 116 | #include <grp.h> |
117 | #include <sys/file.h> | 117 | #include <sys/file.h> |
118 | //#include <sys/prctl.h> | 118 | //#include <sys/prctl.h> |
119 | 119 | ||
120 | #ifdef NEED_SCHEDCTL_AND_LOCK | 120 | #ifdef NEED_SCHEDCTL_AND_LOCK |
121 | #include <sys/schedctl.h> | 121 | #include <sys/schedctl.h> |
122 | #include <sys/lock.h> | 122 | #include <sys/lock.h> |
123 | #endif | 123 | #endif |
124 | #endif | 124 | #endif |
125 | 125 | ||
126 | 126 | ||
127 | char *htm_error_string; | 127 | char *htm_error_string; |
128 | typedef int Boolean; | 128 | typedef int Boolean; |
129 | typedef void *OBJ; | 129 | typedef void *OBJ; |
130 | 130 | ||
131 | typedef struct ClientAddressStruct { | 131 | typedef struct ClientAddressStruct { |
132 | struct sockaddr_in cl_addr; | 132 | struct sockaddr_in cl_addr; |
133 | int clilen; | 133 | int clilen; |
134 | int sockfd; | 134 | int sockfd; |
135 | } *ClientAddr; | 135 | } *ClientAddr; |
136 | 136 | ||
137 | typedef unsigned long long osc_time_t; | 137 | typedef unsigned long long osc_time_t; |
138 | 138 | ||
139 | Boolean ShowBytes = FALSE; | 139 | Boolean ShowBytes = FALSE; |
140 | Boolean Silent = FALSE; | 140 | Boolean Silent = FALSE; |
141 | 141 | ||
142 | /* Declarations */ | 142 | /* Declarations */ |
143 | #ifndef WIN32 | 143 | #ifndef WIN32 |
144 | static int unixinitudp(int chan); | 144 | static int unixinitudp(int chan); |
145 | #endif | 145 | #endif |
146 | 146 | ||
147 | static int initudp(int chan); | 147 | static int initudp(int chan); |
148 | static void closeudp(int sockfd); | 148 | static void closeudp(int sockfd); |
149 | Boolean ClientReply(int packetsize, void *packet, int socketfd, | 149 | Boolean ClientReply(int packetsize, void *packet, int socketfd, |
150 | void *clientaddresspointer, int clientaddressbufferlength); | 150 | void *clientaddresspointer, int clientaddressbufferlength); |
151 | void sgi_CleanExit(void); | 151 | void sgi_CleanExit(void); |
152 | Boolean sgi_HaveToQuit(void); | 152 | Boolean sgi_HaveToQuit(void); |
153 | int RegisterPollingDevice(int fd, void (*callbackfunction)(int , void *), void *dummy); | 153 | int RegisterPollingDevice(int fd, void (*callbackfunction)(int , void *), void *dummy); |
154 | static void catch_sigint(); | 154 | static void catch_sigint(); |
155 | static int Synthmessage(char *m, int n, void *clientdesc, int clientdesclength, int fd) ; | 155 | static int Synthmessage(char *m, int n, void *clientdesc, int clientdesclength, int fd) ; |
156 | char *DataAfterAlignedString(char *string, char *boundary) ; | 156 | char *DataAfterAlignedString(char *string, char *boundary) ; |
157 | Boolean IsNiceString(char *string, char *boundary) ; | 157 | Boolean IsNiceString(char *string, char *boundary) ; |
158 | void complain(char *s, ...); | 158 | void complain(char *s, ...); |
159 | 159 | ||
160 | #define MAXMESG 32768 | 160 | #define MAXMESG 32768 |
161 | static char mbuf[MAXMESG]; | 161 | static char mbuf[MAXMESG]; |
162 | 162 | ||
163 | /* ----------------------------- dumpOSC ------------------------- */ | 163 | /* ----------------------------- dumpOSC ------------------------- */ |
164 | 164 | ||
165 | #define MAXOUTAT 50 | 165 | #define MAXOUTAT 50 |
166 | 166 | ||
167 | static t_class *dumpOSC_class; | 167 | static t_class *dumpOSC_class; |
168 | 168 | ||
169 | typedef struct _dumpOSC | 169 | typedef struct _dumpOSC |
170 | { | 170 | { |
171 | t_object x_obj; | 171 | t_object x_obj; |
172 | t_outlet *x_msgout; | 172 | t_outlet *x_msgout; |
173 | t_outlet *x_connectout; | 173 | t_outlet *x_connectout; |
174 | t_atom x_outat[MAXOUTAT]; | 174 | t_atom x_outat[MAXOUTAT]; |
175 | int x_outatc; | 175 | int x_outatc; |
176 | t_binbuf *x_b; | 176 | t_binbuf *x_b; |
177 | int x_connectsocket; | 177 | int x_connectsocket; |
178 | int x_nconnections; | 178 | int x_nconnections; |
179 | int x_udp; | 179 | int x_udp; |
180 | struct sockaddr_in x_server; | 180 | struct sockaddr_in x_server; |
181 | int x_clilen; | 181 | int x_clilen; |
182 | } t_dumpOSC; | 182 | } t_dumpOSC; |
183 | 183 | ||
184 | void dumpOSC_ParsePacket(t_dumpOSC *x, char *buf, int n, ClientAddr returnAddr); | 184 | void dumpOSC_ParsePacket(t_dumpOSC *x, char *buf, int n, ClientAddr returnAddr); |
185 | Boolean dumpOSC_SendReply(char *buf, int n, void *clientDesc, int clientDescLenght, int fd); | 185 | Boolean dumpOSC_SendReply(char *buf, int n, void *clientDesc, int clientDescLenght, int fd); |
186 | static void dumpOSC_Smessage(t_dumpOSC *x, char *address, void *v, int n, ClientAddr returnAddr); | 186 | static void dumpOSC_Smessage(t_dumpOSC *x, char *address, void *v, int n, ClientAddr returnAddr); |
187 | static void dumpOSC_PrintTypeTaggedArgs(t_dumpOSC *x, void *v, int n); | 187 | static void dumpOSC_PrintTypeTaggedArgs(t_dumpOSC *x, void *v, int n); |
188 | static void dumpOSC_PrintHeuristicallyTypeGuessedArgs(t_dumpOSC *x, void *v, int n, int skipComma); | 188 | static void dumpOSC_PrintHeuristicallyTypeGuessedArgs(t_dumpOSC *x, void *v, int n, int skipComma); |
189 | 189 | ||
190 | static void dumpOSC_read(t_dumpOSC *x, int sockfd) { | 190 | static void dumpOSC_read(t_dumpOSC *x, int sockfd) { |
191 | int clilen = x->x_clilen; | 191 | int clilen = x->x_clilen; |
192 | int n; | 192 | int n; |
193 | struct ClientAddressStruct ras; | 193 | struct ClientAddressStruct ras; |
194 | ClientAddr ra = &ras; | 194 | ClientAddr ra = &ras; |
195 | 195 | ||
196 | //catchupflag= FALSE; | 196 | //catchupflag= FALSE; |
197 | 197 | ||
198 | /* if (ShowBytes) { */ | 198 | /* if (ShowBytes) { */ |
199 | /* int i; */ | 199 | /* int i; */ |
200 | /* printf("%d byte message:\n", n); */ | 200 | /* printf("%d byte message:\n", n); */ |
201 | /* for (i = 0; i < n; ++i) { */ | 201 | /* for (i = 0; i < n; ++i) { */ |
202 | /* printf(" %x (%c)\t", m[i], m[i]); */ | 202 | /* printf(" %x (%c)\t", m[i], m[i]); */ |
203 | /* if (i%4 == 3) printf("\n"); */ | 203 | /* if (i%4 == 3) printf("\n"); */ |
204 | /* } */ | 204 | /* } */ |
205 | /* printf("\n"); */ | 205 | /* printf("\n"); */ |
206 | /* } */ | 206 | /* } */ |
207 | 207 | ||
208 | // return catchupflag; | 208 | // return catchupflag; |
209 | //struct sockaddr_in x->x_server; | 209 | //struct sockaddr_in x->x_server; |
210 | //while( (n = recvfrom(sockfd, mbuf, MAXMESG, 0, &cl_addr, &clilen)) >0) | 210 | //while( (n = recvfrom(sockfd, mbuf, MAXMESG, 0, &cl_addr, &clilen)) >0) |
211 | // while(( | 211 | // while(( |
212 | 212 | ||
213 | #ifdef WIN32 | 213 | #ifdef WIN32 |
214 | if ((n = recvfrom(sockfd, mbuf, MAXMESG, 0, (SOCKADDR*)&x->x_server, &clilen)) >0) | 214 | if ((n = recvfrom(sockfd, mbuf, MAXMESG, 0, (SOCKADDR*)&x->x_server, &clilen)) >0) |
215 | #else | 215 | #else |
216 | if ((n = recvfrom(sockfd, mbuf, MAXMESG, 0, (struct sockaddr *)&x->x_server, &clilen)) >0) | 216 | if ((n = recvfrom(sockfd, mbuf, MAXMESG, 0, (struct sockaddr *)&x->x_server, &clilen)) >0) |
217 | #endif | 217 | #endif |
218 | { | 218 | { |
219 | //int r; | 219 | //int r; |
220 | ras.cl_addr = *((struct sockaddr_in *) &x->x_server); | 220 | ras.cl_addr = *((struct sockaddr_in *) &x->x_server); |
221 | ras.clilen = x->x_clilen; | 221 | ras.clilen = x->x_clilen; |
222 | ras.sockfd = x->x_connectsocket; | 222 | ras.sockfd = x->x_connectsocket; |
223 | 223 | ||
224 | #ifdef DEBUG | 224 | #ifdef DEBUG |
225 | printf("dumpOSC_read: received UDP packet of length %d\n", n); | 225 | printf("dumpOSC_read: received UDP packet of length %d\n", n); |
226 | #endif | 226 | #endif |
227 | 227 | ||
228 | if(!dumpOSC_SendReply(mbuf, n, &x->x_server, clilen, sockfd)) | 228 | if(!dumpOSC_SendReply(mbuf, n, &x->x_server, clilen, sockfd)) |
229 | { | 229 | { |
230 | dumpOSC_ParsePacket(x, mbuf, n, ra); | 230 | dumpOSC_ParsePacket(x, mbuf, n, ra); |
231 | } | 231 | } |
232 | //r = Synthmessage(mbuf, n, &x->x_server, clilen, sockfd); | 232 | //r = Synthmessage(mbuf, n, &x->x_server, clilen, sockfd); |
233 | //post ("%d", r); | 233 | //post ("%d", r); |
234 | //outlet_anything(x->x_msgout, at[msg].a_w.w_symbol, | 234 | //outlet_anything(x->x_msgout, at[msg].a_w.w_symbol, |
235 | // emsg-msg-1, at + msg + 1); | 235 | // emsg-msg-1, at + msg + 1); |
236 | // outlet_list(x->x_msgout, 0, n, mbuf); | 236 | // outlet_list(x->x_msgout, 0, n, mbuf); |
237 | //if( sgi_HaveToQuit()) goto out; | 237 | //if( sgi_HaveToQuit()) goto out; |
238 | //if(r>0) goto back; | 238 | //if(r>0) goto back; |
239 | //clilen = maxclilen; | 239 | //clilen = maxclilen; |
240 | } | 240 | } |
241 | } | 241 | } |
242 | 242 | ||
243 | static void *dumpOSC_new(t_symbol *compatflag, | 243 | static void *dumpOSC_new(t_symbol *compatflag, |
244 | t_floatarg fportno) { | 244 | t_floatarg fportno) { |
245 | t_dumpOSC *x; | 245 | t_dumpOSC *x; |
246 | struct sockaddr_in server; | 246 | struct sockaddr_in server; |
247 | int clilen=sizeof(server); | 247 | int clilen=sizeof(server); |
248 | int sockfd; | 248 | int sockfd; |
249 | int portno=fportno; | 249 | int portno=fportno; |
250 | int udp = 1; | 250 | int udp = 1; |
251 | 251 | ||
252 | //x->x_b = binbuf_new(); | 252 | //x->x_b = binbuf_new(); |
253 | //x->x_outat = binbuf_getvec(x->x_b); | 253 | //x->x_outat = binbuf_getvec(x->x_b); |
254 | 254 | ||
255 | //{{raf}} pointer not valid yet...moving this down | 255 | //{{raf}} pointer not valid yet...moving this down |
256 | //x->x_outatc = 0; {{raf}} | 256 | //x->x_outatc = 0; {{raf}} |
257 | 257 | ||
258 | /* create a socket */ | 258 | /* create a socket */ |
259 | if ((sockfd = socket(AF_INET, (udp ? SOCK_DGRAM : SOCK_STREAM), 0)) == -1) | 259 | if ((sockfd = socket(AF_INET, (udp ? SOCK_DGRAM : SOCK_STREAM), 0)) == -1) |
260 | { | 260 | { |
261 | sys_sockerror("socket"); | 261 | sys_sockerror("socket"); |
262 | return (0); | 262 | return (0); |
263 | } | 263 | } |
264 | 264 | ||
265 | server.sin_family = AF_INET; | 265 | server.sin_family = AF_INET; |
266 | server.sin_addr.s_addr = INADDR_ANY; | 266 | server.sin_addr.s_addr = INADDR_ANY; |
267 | /* assign server port number */ | 267 | /* assign server port number */ |
268 | server.sin_port = htons((u_short)portno); | 268 | server.sin_port = htons((u_short)portno); |
269 | /* name the socket */ | 269 | /* name the socket */ |
270 | if (bind(sockfd, (struct sockaddr *)&server, sizeof(server)) < 0) | 270 | if (bind(sockfd, (struct sockaddr *)&server, sizeof(server)) < 0) |
271 | { | 271 | { |
272 | sys_sockerror("bind"); | 272 | sys_sockerror("bind"); |
273 | sys_closesocket(sockfd); | 273 | sys_closesocket(sockfd); |
274 | return (0); | 274 | return (0); |
275 | } | 275 | } |
276 | 276 | ||
277 | x = (t_dumpOSC *)pd_new(dumpOSC_class); | 277 | x = (t_dumpOSC *)pd_new(dumpOSC_class); |
278 | x->x_outatc = 0; // {{raf}} now pointer is valid (less invalid) | 278 | x->x_outatc = 0; // {{raf}} now pointer is valid (less invalid) |
279 | 279 | ||
280 | x->x_msgout = outlet_new(&x->x_obj, &s_anything); | 280 | x->x_msgout = outlet_new(&x->x_obj, &s_anything); |
281 | 281 | ||
282 | // if (udp) /* datagram protocol */ | 282 | // if (udp) /* datagram protocol */ |
283 | { | 283 | { |
284 | 284 | ||
285 | sys_addpollfn(sockfd, (t_fdpollfn)dumpOSC_read, x); | 285 | sys_addpollfn(sockfd, (t_fdpollfn)dumpOSC_read, x); |
286 | x->x_connectout = 0; | 286 | x->x_connectout = 0; |
287 | } | 287 | } |
288 | // else /* streaming protocol */ | 288 | // else /* streaming protocol */ |
289 | /* { */ | 289 | /* { */ |
290 | /* if (listen(sockfd, 5) < 0) */ | 290 | /* if (listen(sockfd, 5) < 0) */ |
291 | /* { */ | 291 | /* { */ |
292 | /* sys_sockerror("listen"); */ | 292 | /* sys_sockerror("listen"); */ |
293 | /* sys_closesocket(sockfd); */ | 293 | /* sys_closesocket(sockfd); */ |
294 | /* sockfd = -1; */ | 294 | /* sockfd = -1; */ |
295 | /* } */ | 295 | /* } */ |
296 | /* else */ | 296 | /* else */ |
297 | /* { */ | 297 | /* { */ |
298 | /* sys_addpollfn(sockfd, (t_fdpollfn)dumpOSC_connectpoll, x); */ | 298 | /* sys_addpollfn(sockfd, (t_fdpollfn)dumpOSC_connectpoll, x); */ |
299 | /* x->x_connectout = outlet_new(&x->x_obj, &s_float); */ | 299 | /* x->x_connectout = outlet_new(&x->x_obj, &s_float); */ |
300 | /* } */ | 300 | /* } */ |
301 | /* } */ | 301 | /* } */ |
302 | 302 | ||
303 | x->x_connectsocket = sockfd; | 303 | x->x_connectsocket = sockfd; |
304 | x->x_server = server; | 304 | x->x_server = server; |
305 | x->x_clilen = clilen; | 305 | x->x_clilen = clilen; |
306 | x->x_nconnections = 0; | 306 | x->x_nconnections = 0; |
307 | x->x_udp = udp; | 307 | x->x_udp = udp; |
308 | 308 | ||
309 | return (x); | 309 | return (x); |
310 | } | 310 | } |
311 | 311 | ||
312 | static void dumpOSC_free(t_dumpOSC *x) | 312 | static void dumpOSC_free(t_dumpOSC *x) |
313 | { | 313 | { |
314 | /* LATER make me clean up open connections */ | 314 | /* LATER make me clean up open connections */ |
315 | if (x->x_connectsocket >= 0) | 315 | if (x->x_connectsocket >= 0) |
316 | { | 316 | { |
317 | sys_rmpollfn(x->x_connectsocket); | 317 | sys_rmpollfn(x->x_connectsocket); |
318 | sys_closesocket(x->x_connectsocket); | 318 | sys_closesocket(x->x_connectsocket); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | #ifdef WIN32 | 322 | #ifdef WIN32 |
323 | OSC_API void dumpOSC_setup(void) | 323 | OSC_API void dumpOSC_setup(void) |
324 | #else | 324 | #else |
325 | void dumpOSC_setup(void) | 325 | void dumpOSC_setup(void) |
326 | #endif | 326 | #endif |
327 | { | 327 | { |
328 | dumpOSC_class = class_new(gensym("dumpOSC"), | 328 | dumpOSC_class = class_new(gensym("dumpOSC"), |
329 | (t_newmethod)dumpOSC_new, (t_method)dumpOSC_free, | 329 | (t_newmethod)dumpOSC_new, (t_method)dumpOSC_free, |
330 | sizeof(t_dumpOSC), CLASS_NOINLET, A_DEFFLOAT, A_DEFFLOAT, | 330 | sizeof(t_dumpOSC), CLASS_NOINLET, A_DEFFLOAT, A_DEFFLOAT, |
331 | A_DEFSYM, 0); | 331 | A_DEFSYM, 0); |
332 | class_sethelpsymbol(dumpOSC_class, gensym("dumpOSC-help.pd")); | 332 | class_sethelpsymbol(dumpOSC_class, gensym("dumpOSC-help.pd")); |
333 | } | 333 | } |
334 | 334 | ||
335 | 335 | ||
336 | #ifndef WIN32 | 336 | #ifndef WIN32 |
337 | #define UNIXDG_PATH "/tmp/htm" | 337 | #define UNIXDG_PATH "/tmp/htm" |
338 | #define UNIXDG_TMP "/tmp/htm.XXXXXX" | 338 | #define UNIXDG_TMP "/tmp/htm.XXXXXX" |
339 | static int unixinitudp(int chan) | 339 | static int unixinitudp(int chan) |
340 | { | 340 | { |
341 | struct sockaddr_un serv_addr; | 341 | struct sockaddr_un serv_addr; |
342 | int sockfd; | 342 | int sockfd; |
343 | 343 | ||
344 | if((sockfd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) | 344 | if((sockfd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) |
345 | return sockfd; | 345 | return sockfd; |
346 | 346 | ||
347 | bzero((char *)&serv_addr, sizeof(serv_addr)); | 347 | bzero((char *)&serv_addr, sizeof(serv_addr)); |
348 | serv_addr.sun_family = AF_UNIX; | 348 | serv_addr.sun_family = AF_UNIX; |
349 | strcpy(serv_addr.sun_path, UNIXDG_PATH); | 349 | strcpy(serv_addr.sun_path, UNIXDG_PATH); |
350 | sprintf(serv_addr.sun_path+strlen(serv_addr.sun_path), "%d", chan); | 350 | sprintf(serv_addr.sun_path+strlen(serv_addr.sun_path), "%d", chan); |
351 | unlink(serv_addr.sun_path); | 351 | unlink(serv_addr.sun_path); |
352 | if(bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr.sun_family)+strlen(serv_addr.sun_path)) < 0) | 352 | if(bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr.sun_family)+strlen(serv_addr.sun_path)) < 0) |
353 | { | 353 | { |
354 | perror("unable to bind\n"); | 354 | perror("unable to bind\n"); |
355 | return -1; | 355 | return -1; |
356 | } | 356 | } |
357 | 357 | ||
358 | fcntl(sockfd, F_SETFL, FNDELAY); | 358 | fcntl(sockfd, F_SETFL, FNDELAY); |
359 | return sockfd; | 359 | return sockfd; |
360 | } | 360 | } |
361 | #endif // #ifndef WIN32 | 361 | #endif // #ifndef WIN32 |
362 | 362 | ||
363 | 363 | ||
364 | 364 | ||
365 | static int initudp(int chan) | 365 | static int initudp(int chan) |
366 | { | 366 | { |
367 | 367 | ||
368 | #ifdef WIN32 | 368 | #ifdef WIN32 |
369 | struct sockaddr_in serv_addr; | 369 | struct sockaddr_in serv_addr; |
370 | unsigned int sockfd; | 370 | unsigned int sockfd; |
371 | ULONG nonBlocking = (ULONG) TRUE; | 371 | ULONG nonBlocking = (ULONG) TRUE; |
372 | 372 | ||
373 | if( (sockfd = socket(AF_INET, SOCK_DGRAM, 0)) != INVALID_SOCKET ) { | 373 | if( (sockfd = socket(AF_INET, SOCK_DGRAM, 0)) != INVALID_SOCKET ) { |
374 | ZeroMemory((char *)&serv_addr, sizeof(serv_addr)); | 374 | ZeroMemory((char *)&serv_addr, sizeof(serv_addr)); |
375 | serv_addr.sin_family = AF_INET; | 375 | serv_addr.sin_family = AF_INET; |
376 | serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); | 376 | serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); |
377 | serv_addr.sin_port = htons(chan); | 377 | serv_addr.sin_port = htons(chan); |
378 | if(bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) >= 0) { | 378 | if(bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) >= 0) { |
379 | // set for non-blocking mode | 379 | // set for non-blocking mode |
380 | if(ioctlsocket(sockfd, FIONBIO, &nonBlocking) == SOCKET_ERROR) { | 380 | if(ioctlsocket(sockfd, FIONBIO, &nonBlocking) == SOCKET_ERROR) { |
381 | perror("unable to set non-blocking\n"); | 381 | perror("unable to set non-blocking\n"); |
382 | return -1; | 382 | return -1; |
383 | } | 383 | } |
384 | } | 384 | } |
385 | else { perror("unable to bind\n"); return -1; } | 385 | else { perror("unable to bind\n"); return -1; } |
386 | } | 386 | } |
387 | return (sockfd == INVALID_SOCKET ? -1 : (int)sockfd); | 387 | return (sockfd == INVALID_SOCKET ? -1 : (int)sockfd); |
388 | #else | 388 | #else |
389 | struct sockaddr_in serv_addr; | 389 | struct sockaddr_in serv_addr; |
390 | int sockfd; | 390 | int sockfd; |
391 | 391 | ||
392 | if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) | 392 | if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) |
393 | return sockfd; | 393 | return sockfd; |
394 | 394 | ||
395 | bzero((char *)&serv_addr, sizeof(serv_addr)); | 395 | bzero((char *)&serv_addr, sizeof(serv_addr)); |
396 | serv_addr.sin_family = AF_INET; | 396 | serv_addr.sin_family = AF_INET; |
397 | serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); | 397 | serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); |
398 | serv_addr.sin_port = htons(chan); | 398 | serv_addr.sin_port = htons(chan); |
399 | 399 | ||
400 | if(bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) | 400 | if(bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) |
401 | { | 401 | { |
402 | perror("unable to bind\n"); | 402 | perror("unable to bind\n"); |
403 | return -1; | 403 | return -1; |
404 | } | 404 | } |
405 | 405 | ||
406 | fcntl(sockfd, F_SETFL, FNDELAY); | 406 | fcntl(sockfd, F_SETFL, FNDELAY); |
407 | return sockfd; | 407 | return sockfd; |
408 | #endif | 408 | #endif |
409 | } | 409 | } |
410 | 410 | ||
411 | 411 | ||
412 | 412 | ||
413 | 413 | ||
414 | 414 | ||
415 | 415 | ||
416 | 416 | ||
417 | 417 | ||
418 | static void closeudp(int sockfd) { | 418 | static void closeudp(int sockfd) { |
419 | #ifdef WIN32 | 419 | #ifdef WIN32 |
420 | closesocket(sockfd); | 420 | closesocket(sockfd); |
421 | #else | 421 | #else |
422 | close(sockfd); | 422 | close(sockfd); |
423 | #endif | 423 | #endif |
424 | } | 424 | } |
425 | 425 | ||
426 | static Boolean catchupflag=FALSE; | 426 | static Boolean catchupflag=FALSE; |
427 | Boolean ClientReply(int packetsize, void *packet, int socketfd, | 427 | Boolean ClientReply(int packetsize, void *packet, int socketfd, |
428 | void *clientaddresspointer, int clientaddressbufferlength) | 428 | void *clientaddresspointer, int clientaddressbufferlength) |
429 | { | 429 | { |
430 | if(!clientaddresspointer) return FALSE; | 430 | if(!clientaddresspointer) return FALSE; |
431 | catchupflag= TRUE; | 431 | catchupflag= TRUE; |
432 | return packetsize==sendto(socketfd, packet, packetsize, 0, clientaddresspointer, clientaddressbufferlength); | 432 | return packetsize==sendto(socketfd, packet, packetsize, 0, clientaddresspointer, clientaddressbufferlength); |
433 | } | 433 | } |
434 | 434 | ||
435 | static Boolean exitflag= FALSE; | 435 | static Boolean exitflag= FALSE; |
436 | void sgi_CleanExit(void) { | 436 | void sgi_CleanExit(void) { |
437 | exitflag = TRUE; | 437 | exitflag = TRUE; |
438 | } | 438 | } |
439 | 439 | ||
440 | Boolean sgi_HaveToQuit(void) { | 440 | Boolean sgi_HaveToQuit(void) { |
441 | return exitflag; | 441 | return exitflag; |
442 | } | 442 | } |
443 | 443 | ||
444 | 444 | ||
445 | /* file descriptor poll table */ | 445 | /* file descriptor poll table */ |
446 | static int npolldevs =0; | 446 | static int npolldevs =0; |
447 | typedef struct polldev | 447 | typedef struct polldev |
448 | { | 448 | { |
449 | int fd; | 449 | int fd; |
450 | void (*callbackfunction)(int , void *); | 450 | void (*callbackfunction)(int , void *); |
451 | void *dummy; | 451 | void *dummy; |
452 | } polldev; | 452 | } polldev; |
453 | #define TABMAX 8 | 453 | #define TABMAX 8 |
454 | static polldev polldevs[TABMAX]; | 454 | static polldev polldevs[TABMAX]; |
455 | 455 | ||
456 | 456 | ||
457 | /* Register a device (referred to by a file descriptor that the caller | 457 | /* Register a device (referred to by a file descriptor that the caller |
458 | should have already successfully obtained from a system call) to be | 458 | should have already successfully obtained from a system call) to be |
459 | polled as real-time constraints allowed. | 459 | polled as real-time constraints allowed. |
460 | 460 | ||
461 | When a select(2) call indicates activity on the file descriptor, the | 461 | When a select(2) call indicates activity on the file descriptor, the |
462 | callback function is called with the file descripter as first | 462 | callback function is called with the file descripter as first |
463 | argument and the given dummy argument (presumably a pointer to the | 463 | argument and the given dummy argument (presumably a pointer to the |
464 | instance variables associated with the device). | 464 | instance variables associated with the device). |
465 | */ | 465 | */ |
466 | int RegisterPollingDevice(int fd, void (*callbackfunction)(int , void *), void *dummy) | 466 | int RegisterPollingDevice(int fd, void (*callbackfunction)(int , void *), void *dummy) |
467 | { | 467 | { |
468 | if(npolldevs<TABMAX) | 468 | if(npolldevs<TABMAX) |
469 | { | 469 | { |
470 | polldevs[npolldevs].fd = fd; | 470 | polldevs[npolldevs].fd = fd; |
471 | polldevs[npolldevs].callbackfunction = callbackfunction; | 471 | polldevs[npolldevs].callbackfunction = callbackfunction; |
472 | polldevs[npolldevs].dummy = dummy; | 472 | polldevs[npolldevs].dummy = dummy; |
473 | } | 473 | } |
474 | else return -1; | 474 | else return -1; |
475 | return npolldevs++; | 475 | return npolldevs++; |
476 | } | 476 | } |
477 | 477 | ||
478 | static int caught_sigint; | 478 | static int caught_sigint; |
479 | 479 | ||
480 | static void catch_sigint() { | 480 | static void catch_sigint() { |
481 | caught_sigint = 1; | 481 | caught_sigint = 1; |
482 | } | 482 | } |
483 | static int sockfd, usockfd; | 483 | static int sockfd, usockfd; |
484 | 484 | ||
485 | 485 | ||
486 | void PrintClientAddr(ClientAddr CA) { | 486 | void PrintClientAddr(ClientAddr CA) { |
487 | unsigned long addr = CA->cl_addr.sin_addr.s_addr; | 487 | unsigned long addr = CA->cl_addr.sin_addr.s_addr; |
488 | printf("Client address %p:\n", CA); | 488 | printf("Client address %p:\n", CA); |
489 | printf(" clilen %d, sockfd %d\n", CA->clilen, CA->sockfd); | 489 | printf(" clilen %d, sockfd %d\n", CA->clilen, CA->sockfd); |
490 | printf(" sin_family %d, sin_port %d\n", CA->cl_addr.sin_family, | 490 | printf(" sin_family %d, sin_port %d\n", CA->cl_addr.sin_family, |
491 | CA->cl_addr.sin_port); | 491 | CA->cl_addr.sin_port); |
492 | printf(" address: (%x) %s\n", addr, inet_ntoa(CA->cl_addr.sin_addr)); | 492 | printf(" address: (%x) %s\n", addr, inet_ntoa(CA->cl_addr.sin_addr)); |
493 | 493 | ||
494 | printf(" sin_zero = \"%c%c%c%c%c%c%c%c\"\n", | 494 | printf(" sin_zero = \"%c%c%c%c%c%c%c%c\"\n", |
495 | CA->cl_addr.sin_zero[0], | 495 | CA->cl_addr.sin_zero[0], |
496 | CA->cl_addr.sin_zero[1], | 496 | CA->cl_addr.sin_zero[1], |
497 | CA->cl_addr.sin_zero[2], | 497 | CA->cl_addr.sin_zero[2], |
498 | CA->cl_addr.sin_zero[3], | 498 | CA->cl_addr.sin_zero[3], |
499 | CA->cl_addr.sin_zero[4], | 499 | CA->cl_addr.sin_zero[4], |
500 | CA->cl_addr.sin_zero[5], | 500 | CA->cl_addr.sin_zero[5], |
501 | CA->cl_addr.sin_zero[6], | 501 | CA->cl_addr.sin_zero[6], |
502 | CA->cl_addr.sin_zero[7]); | 502 | CA->cl_addr.sin_zero[7]); |
503 | 503 | ||
504 | printf("\n"); | 504 | printf("\n"); |
505 | } | 505 | } |
506 | 506 | ||
507 | //******************* | 507 | //******************* |
508 | 508 | ||
509 | void WriteTime(char* dst, osc_time_t osctime) | 509 | void WriteTime(char* dst, osc_time_t osctime) |
510 | { | 510 | { |
511 | *(int32_t*)dst = htonl((int32_t)(osctime >> 32)); | 511 | *(int32_t*)dst = htonl((int32_t)(osctime >> 32)); |
512 | *(int32_t*)(dst+4) = htonl((int32_t)osctime); | 512 | *(int32_t*)(dst+4) = htonl((int32_t)osctime); |
513 | } | 513 | } |
514 | 514 | ||
515 | void WriteMode(char* dst) | 515 | void WriteMode(char* dst) |
516 | { | 516 | { |
517 | *(int32_t*)dst = htonl(0); | 517 | *(int32_t*)dst = htonl(0); |
518 | } | 518 | } |
519 | 519 | ||
520 | osc_time_t ReadTime(const char* src) | 520 | osc_time_t ReadTime(const char* src) |
521 | { | 521 | { |
522 | osc_time_t osctime = ntohl(*(int32_t*)src); | 522 | osc_time_t osctime = ntohl(*(int32_t*)src); |
523 | return (osctime << 32) + ntohl(*(int32_t*)(src+4)); | 523 | return (osctime << 32) + ntohl(*(int32_t*)(src+4)); |
524 | } | 524 | } |
525 | 525 | ||
526 | double TimeToSeconds(osc_time_t osctime) | 526 | double TimeToSeconds(osc_time_t osctime) |
527 | { | 527 | { |
528 | return (double)osctime * 2.3283064365386962890625e-10 /* 1/2^32 */; | 528 | return (double)osctime * 2.3283064365386962890625e-10 /* 1/2^32 */; |
529 | } | 529 | } |
530 | 530 | ||
531 | int timeRound(double x) | 531 | int timeRound(double x) |
532 | { | 532 | { |
533 | return x >= 0.0 ? x+0.5 : x-0.5; | 533 | return x >= 0.0 ? x+0.5 : x-0.5; |
534 | } | 534 | } |
535 | /* | 535 | /* |
536 | void WriteLogicalTime(char* dst) | 536 | void WriteLogicalTime(char* dst) |
537 | { | 537 | { |
538 | static double startTime = -1.0; | 538 | static double startTime = -1.0; |
539 | double sTime; | 539 | double sTime; |
540 | 540 | ||
541 | // Initialisierung der Startzeit. | 541 | // Initialisierung der Startzeit. |
542 | // Knnte effizienter (ohne 'if') auch irgendwo vorher passieren. | 542 | // Knnte effizienter (ohne 'if') auch irgendwo vorher passieren. |
543 | // Knnte wahrscheinlich auch 0.0 sein. | 543 | // Knnte wahrscheinlich auch 0.0 sein. |
544 | if (startTime < 0.0) { | 544 | if (startTime < 0.0) { |
545 | startTime = clock_getlogicaltime(); | 545 | startTime = clock_getlogicaltime(); |
546 | } | 546 | } |
547 | 547 | ||
548 | sTime = clock_gettimesince(startTime) * 0.001; | 548 | sTime = clock_gettimesince(startTime) * 0.001; |
549 | *(int32_t*)dst = hton'K l((int32_t)sTime); | 549 | *(int32_t*)dst = hton'K l((int32_t)sTime); |
550 | *(int32_t*)(dst+4) = htonl((int32_t)(4294967296.0 * sTime)); | 550 | *(int32_t*)(dst+4) = htonl((int32_t)(4294967296.0 * sTime)); |
551 | } | 551 | } |
552 | */ | 552 | */ |
553 | 553 | ||
554 | void WriteLogicalTime(char* dst) | 554 | void WriteLogicalTime(char* dst) |
555 | { | 555 | { |
556 | double sTime = clock_gettimesince(19230720) / 1000.0; | 556 | double sTime = clock_gettimesince(19230720) / 1000.0; |
557 | double tau = sTime - timeRound(sTime); | 557 | double tau = sTime - timeRound(sTime); |
558 | 558 | ||
559 | //fprintf(stderr, "sSec = %f tau = %f\n", sTime, tau); | 559 | //fprintf(stderr, "sSec = %f tau = %f\n", sTime, tau); |
560 | 560 | ||
561 | *(int32_t*)dst = htonl((int32_t)(sTime)); | 561 | *(int32_t*)dst = htonl((int32_t)(sTime)); |
562 | *(int32_t*)(dst+4) = htonl((int32_t)(4294967296 * tau)); | 562 | *(int32_t*)(dst+4) = htonl((int32_t)(4294967296 * tau)); |
563 | } | 563 | } |
564 | 564 | ||
565 | Boolean dumpOSC_SendReply(char *buf, int n, void *clientDesc, int clientDescLenght, int fd) | 565 | Boolean dumpOSC_SendReply(char *buf, int n, void *clientDesc, int clientDescLenght, int fd) |
566 | { | 566 | { |
567 | if((n == 24) && (strcmp(buf, "#time") == 0)) | 567 | if((n == 24) && (strcmp(buf, "#time") == 0)) |
568 | { | 568 | { |
569 | osc_time_t t0, t1, t2; | 569 | osc_time_t t0, t1, t2; |
570 | double dt0, dt1, dt2; | 570 | double dt0, dt1, dt2; |
571 | 571 | ||
572 | WriteMode(buf+6); | 572 | WriteMode(buf+6); |
573 | 573 | ||
574 | t0 = ReadTime(buf+8); | 574 | t0 = ReadTime(buf+8); |
575 | 575 | ||
576 | WriteLogicalTime(buf+16); | 576 | WriteLogicalTime(buf+16); |
577 | t1 = ReadTime(buf+16); // reverse | 577 | t1 = ReadTime(buf+16); // reverse |
578 | dt0 = TimeToSeconds(t0); // client time | 578 | dt0 = TimeToSeconds(t0); // client time |
579 | dt1 = TimeToSeconds(t1); // server time | 579 | dt1 = TimeToSeconds(t1); // server time |
580 | 580 | ||
581 | // fprintf(stderr, "%f\t%f\t%f\n", dt0, dt1, dt0 - dt1); | 581 | // fprintf(stderr, "%f\t%f\t%f\n", dt0, dt1, dt0 - dt1); |
582 | 582 | ||
583 | sendto(fd, buf, n, 0, (struct sockaddr *)clientDesc, clientDescLenght); | 583 | sendto(fd, buf, n, 0, (struct sockaddr *)clientDesc, clientDescLenght); |
584 | return TRUE; | 584 | return TRUE; |
585 | } | 585 | } |
586 | else | 586 | else |
587 | { | 587 | { |
588 | return FALSE; | 588 | return FALSE; |
589 | } | 589 | } |
590 | } | 590 | } |
591 | 591 | ||
592 | //********************** | 592 | //********************** |
593 | 593 | ||
594 | void dumpOSC_ParsePacket(t_dumpOSC *x, char *buf, int n, ClientAddr returnAddr) { | 594 | void dumpOSC_ParsePacket(t_dumpOSC *x, char *buf, int n, ClientAddr returnAddr) { |
595 | // t_dumpOSC *x; | 595 | // t_dumpOSC *x; |
596 | int size, messageLen, i; | 596 | int size, messageLen, i; |
597 | char *messageName; | 597 | char *messageName; |
598 | char *args; | 598 | char *args; |
599 | 599 | ||
600 | //#ifdef PRINTADDRS | 600 | //#ifdef PRINTADDRS |
601 | #ifdef DEBUG | 601 | #ifdef DEBUG |
602 | //PrintClientAddr(returnAddr); | 602 | //PrintClientAddr(returnAddr); |
603 | #endif | 603 | #endif |
604 | 604 | ||
605 | 605 | ||
606 | if ((n%4) != 0) { | 606 | if ((n%4) != 0) { |
607 | complain("SynthControl packet size (%d) not a multiple of 4 bytes: dropping", n); | 607 | complain("SynthControl packet size (%d) not a multiple of 4 bytes: dropping", n); |
608 | return; | 608 | return; |
609 | } | 609 | } |
610 | 610 | ||
611 | if ((n >= 8) && (strncmp(buf, "#bundle", 8) == 0)) { | 611 | if ((n >= 8) && (strncmp(buf, "#bundle", 8) == 0)) { |
612 | /* This is a bundle message. */ | 612 | /* This is a bundle message. */ |
613 | #ifdef DEBUG | 613 | #ifdef DEBUG |
614 | printf("dumpOSC_ParsePacket: bundle msg: bundles not yet supported\n"); | 614 | printf("dumpOSC_ParsePacket: bundle msg: bundles not yet supported\n"); |
615 | #endif | 615 | #endif |
616 | 616 | ||
617 | if (n < 16) { | 617 | if (n < 16) { |
618 | complain("Bundle message too small (%d bytes) for time tag", n); | 618 | complain("Bundle message too small (%d bytes) for time tag", n); |
619 | return; | 619 | return; |
620 | } | 620 | } |
621 | 621 | ||
622 | /* Print the time tag */ | 622 | /* Print the time tag */ |
623 | #ifdef DEBUG | 623 | #ifdef DEBUG |
624 | printf("[ %lx%08lx\n", ntohl(*((unsigned long *)(buf+8))), ntohl(*((unsigned long *)(buf+12)))); | 624 | printf("[ %lx%08lx\n", ntohl(*((unsigned long *)(buf+8))), ntohl(*((unsigned long *)(buf+12)))); |
625 | #endif | 625 | #endif |
626 | 626 | ||
627 | /* Note: if we wanted to actually use the time tag as a little-endian | 627 | /* Note: if we wanted to actually use the time tag as a little-endian |
628 | 64-bit int, we'd have to word-swap the two 32-bit halves of it */ | 628 | 64-bit int, we'd have to word-swap the two 32-bit halves of it */ |
629 | 629 | ||
630 | i = 16; /* Skip "#group\0" and time tag */ | 630 | i = 16; /* Skip "#group\0" and time tag */ |
631 | 631 | ||
632 | while(i<n) { | 632 | while(i<n) { |
633 | size = ntohl(*((int *) (buf + i))); | 633 | size = ntohl(*((int *) (buf + i))); |
634 | if ((size % 4) != 0) { | 634 | if ((size % 4) != 0) { |
635 | complain("Bad size count %d in bundle (not a multiple of 4)", size); | 635 | complain("Bad size count %d in bundle (not a multiple of 4)", size); |
636 | return; | 636 | return; |
637 | } | 637 | } |
638 | if ((size + i + 4) > n) { | 638 | if ((size + i + 4) > n) { |
639 | complain("Bad size count %d in bundle (only %d bytes left in entire bundle)", | 639 | complain("Bad size count %d in bundle (only %d bytes left in entire bundle)", |
640 | size, n-i-4); | 640 | size, n-i-4); |
641 | return; | 641 | return; |
642 | } | 642 | } |
643 | 643 | ||
644 | /* Recursively handle element of bundle */ | 644 | /* Recursively handle element of bundle */ |
645 | dumpOSC_ParsePacket(x, buf+i+4, size, returnAddr); | 645 | dumpOSC_ParsePacket(x, buf+i+4, size, returnAddr); |
646 | i += 4 + size; | 646 | i += 4 + size; |
647 | } | 647 | } |
648 | 648 | ||
649 | if (i != n) { | 649 | if (i != n) { |
650 | complain("This can't happen"); | 650 | complain("This can't happen"); |
651 | } | 651 | } |
652 | #ifdef DEBUG | 652 | #ifdef DEBUG |
653 | printf("]\n"); | 653 | printf("]\n"); |
654 | #endif | 654 | #endif |
655 | 655 | ||
656 | } | 656 | } |
657 | else if ((n == 24) && (strcmp(buf, "#time") == 0)) | 657 | else if ((n == 24) && (strcmp(buf, "#time") == 0)) |
658 | { | 658 | { |
659 | complain("Time message: %s\n :).\n", htm_error_string); | 659 | complain("Time message: %s\n :).\n", htm_error_string); |
660 | return; | 660 | return; |
661 | 661 | ||
662 | } | 662 | } |
663 | else | 663 | else |
664 | { | 664 | { |
665 | /* This is not a bundle message */ | 665 | /* This is not a bundle message */ |
666 | 666 | ||
667 | messageName = buf; | 667 | messageName = buf; |
668 | args = DataAfterAlignedString(messageName, buf+n); | 668 | args = DataAfterAlignedString(messageName, buf+n); |
669 | if (args == 0) { | 669 | if (args == 0) { |
670 | complain("Bad message name string: %s\nDropping entire message.\n", | 670 | complain("Bad message name string: %s\nDropping entire message.\n", |
671 | htm_error_string); | 671 | htm_error_string); |
672 | return; | 672 | return; |
673 | } | 673 | } |
674 | messageLen = args-messageName; | 674 | messageLen = args-messageName; |
675 | dumpOSC_Smessage(x, messageName, (void *)args, n-messageLen, returnAddr); | 675 | dumpOSC_Smessage(x, messageName, (void *)args, n-messageLen, returnAddr); |
676 | } | 676 | } |
677 | } | 677 | } |
678 | 678 | ||
679 | #define SMALLEST_POSITIVE_FLOAT 0.000001f | 679 | #define SMALLEST_POSITIVE_FLOAT 0.000001f |
680 | 680 | ||
681 | static void dumpOSC_Smessage(t_dumpOSC *x, char *address, void *v, int n, ClientAddr returnAddr) { | 681 | static void dumpOSC_Smessage(t_dumpOSC *x, char *address, void *v, int n, ClientAddr returnAddr) { |
682 | char *chars = v; | 682 | char *chars = v; |
683 | t_atom at; | 683 | t_atom at; |
684 | //t_atom myargv[50]; | 684 | //t_atom myargv[50]; |
685 | 685 | ||
686 | int myargc = x->x_outatc; | 686 | int myargc = x->x_outatc; |
687 | t_atom* mya = x->x_outat; | 687 | t_atom* mya = x->x_outat; |
688 | int myi; | 688 | int myi; |
689 | 689 | ||
690 | #ifdef DEBUG | 690 | #ifdef DEBUG |
691 | printf("%s ", address); | 691 | printf("%s ", address); |
692 | #endif | 692 | #endif |
693 | 693 | ||
694 | // ztoln+cvt from envgen.c, ggee-0.18 .. | 694 | // ztoln+cvt from envgen.c, ggee-0.18 .. |
695 | // outlet_anything's 'symbol' gets set to address | 695 | // outlet_anything's 'symbol' gets set to address |
696 | // so we dont need to append address to the atomlist | 696 | // so we dont need to append address to the atomlist |
697 | /* | 697 | /* |
698 | SETSYMBOL(mya,gensym(address));myargc++; | 698 | SETSYMBOL(mya,gensym(address));myargc++; |
699 | x->x_outatc = myargc; | 699 | x->x_outatc = myargc; |
700 | */ | 700 | */ |
701 | 701 | ||
702 | if (n != 0) { | 702 | if (n != 0) { |
703 | if (chars[0] == ',') { | 703 | if (chars[0] == ',') { |
704 | if (chars[1] != ',') { | 704 | if (chars[1] != ',') { |
705 | /* This message begins with a type-tag string */ | 705 | /* This message begins with a type-tag string */ |
706 | dumpOSC_PrintTypeTaggedArgs(x, v, n); | 706 | dumpOSC_PrintTypeTaggedArgs(x, v, n); |
707 | } else { | 707 | } else { |
708 | /* Double comma means an escaped real comma, not a type string */ | 708 | /* Double comma means an escaped real comma, not a type string */ |
709 | dumpOSC_PrintHeuristicallyTypeGuessedArgs(x, v, n, 1); | 709 | dumpOSC_PrintHeuristicallyTypeGuessedArgs(x, v, n, 1); |
710 | } | 710 | } |
711 | } else { | 711 | } else { |
712 | dumpOSC_PrintHeuristicallyTypeGuessedArgs(x, v, n, 0); | 712 | dumpOSC_PrintHeuristicallyTypeGuessedArgs(x, v, n, 0); |
713 | } | 713 | } |
714 | } | 714 | } |
715 | 715 | ||
716 | outlet_anything(x->x_msgout,gensym(address),x->x_outatc,(t_atom*)&x->x_outat); | 716 | outlet_anything(x->x_msgout,gensym(address),x->x_outatc,(t_atom*)&x->x_outat); |
717 | x->x_outatc = 0; | 717 | x->x_outatc = 0; |
718 | #ifdef DEBUG | 718 | #ifdef DEBUG |
719 | printf("\n"); | 719 | printf("\n"); |
720 | #endif | 720 | #endif |
721 | fflush(stdout); /* Added for Sami 5/21/98 */ | 721 | fflush(stdout); /* Added for Sami 5/21/98 */ |
722 | } | 722 | } |
723 | 723 | ||
724 | static void dumpOSC_PrintTypeTaggedArgs(t_dumpOSC *x, void *v, int n) { | 724 | static void dumpOSC_PrintTypeTaggedArgs(t_dumpOSC *x, void *v, int n) { |
725 | char *typeTags, *thisType; | 725 | char *typeTags, *thisType; |
726 | char *p; | 726 | char *p; |
727 | 727 | ||
728 | int myargc = x->x_outatc; | 728 | int myargc = x->x_outatc; |
729 | t_atom* mya = x->x_outat; | 729 | t_atom* mya = x->x_outat; |
730 | int myi; | 730 | int myi; |
731 | 731 | ||
732 | typeTags = v; | 732 | typeTags = v; |
733 | 733 | ||
734 | if (!IsNiceString(typeTags, typeTags+n)) { | 734 | if (!IsNiceString(typeTags, typeTags+n)) { |
735 | /* No null-termination, so maybe it wasn't a type tag | 735 | /* No null-termination, so maybe it wasn't a type tag |
736 | string after all */ | 736 | string after all */ |
737 | dumpOSC_PrintHeuristicallyTypeGuessedArgs(x, v, n, 0); | 737 | dumpOSC_PrintHeuristicallyTypeGuessedArgs(x, v, n, 0); |
738 | return; | 738 | return; |
739 | } | 739 | } |
740 | 740 | ||
741 | p = DataAfterAlignedString(typeTags, typeTags+n); | 741 | p = DataAfterAlignedString(typeTags, typeTags+n); |
742 | 742 | ||
743 | 743 | ||
744 | for (thisType = typeTags + 1; *thisType != 0; ++thisType) { | 744 | for (thisType = typeTags + 1; *thisType != 0; ++thisType) { |
745 | switch (*thisType) { | 745 | switch (*thisType) { |
746 | case 'i': case 'r': case 'm': case 'c': | 746 | case 'i': case 'r': case 'm': case 'c': |
747 | #ifdef DEBUG | 747 | #ifdef DEBUG |
748 | //post("integer: %d", ntohl(*((int *) p))); | 748 | //post("integer: %d", ntohl(*((int *) p))); |
749 | #endif | 749 | #endif |
750 | /* Martin Peach fix for negative floats: | 750 | /* Martin Peach fix for negative floats: |
751 | * was: SETFLOAT(mya+myargc,ntohl(*((int *) p))); | 751 | * was: SETFLOAT(mya+myargc,ntohl(*((int *) p))); |
752 | * now is: | 752 | * now is: |
753 | */ | 753 | */ |
754 | SETFLOAT(mya+myargc,(signed)ntohl(*((int *) p))); | 754 | SETFLOAT(mya+myargc,(signed)ntohl(*((int *) p))); |
755 | myargc++; | 755 | myargc++; |
756 | 756 | ||
757 | p += 4; | 757 | p += 4; |
758 | break; | 758 | break; |
759 | 759 | ||
760 | case 'f': { | 760 | case 'f': { |
761 | int i = ntohl(*((int *) p)); | 761 | int i = ntohl(*((int *) p)); |
762 | float *floatp = ((float *) (&i)); | 762 | float *floatp = ((float *) (&i)); |
763 | #ifdef DEBUG | 763 | #ifdef DEBUG |
764 | post("float: %f", *floatp); | 764 | post("float: %f", *floatp); |
765 | #endif | 765 | #endif |
766 | SETFLOAT(mya+myargc,*floatp); | 766 | SETFLOAT(mya+myargc,*floatp); |
767 | myargc++; | 767 | myargc++; |
768 | 768 | ||
769 | p += 4; | 769 | p += 4; |
770 | } | 770 | } |
771 | break; | 771 | break; |
772 | 772 | ||
773 | case 'h': case 't': | 773 | case 'h': case 't': |
774 | #ifdef DEBUG | 774 | #ifdef DEBUG |
775 | printf("[A 64-bit int] "); | 775 | printf("[A 64-bit int] "); |
776 | #endif | 776 | #endif |
777 | post("[A 64-bit int] not implemented"); | 777 | post("[A 64-bit int] not implemented"); |
778 | 778 | ||
779 | p += 8; | 779 | p += 8; |
780 | break; | 780 | break; |
781 | 781 | ||
782 | case 'd': | 782 | case 'd': |
783 | #ifdef DEBUG | 783 | #ifdef DEBUG |
784 | printf("[A 64-bit float] "); | 784 | printf("[A 64-bit float] "); |
785 | #endif | 785 | #endif |
786 | post("[A 64-bit float] not implemented"); | 786 | post("[A 64-bit float] not implemented"); |
787 | 787 | ||
788 | p += 8; | 788 | p += 8; |
789 | break; | 789 | break; |
790 | 790 | ||
791 | case 's': case 'S': | 791 | case 's': case 'S': |
792 | if (!IsNiceString(p, typeTags+n)) { | 792 | if (!IsNiceString(p, typeTags+n)) { |
793 | post("Type tag said this arg is a string but it's not!\n"); | 793 | post("Type tag said this arg is a string but it's not!\n"); |
794 | return; | 794 | return; |
795 | } else { | 795 | } else { |
796 | #ifdef DEBUG | 796 | #ifdef DEBUG |
797 | post("string: \"%s\"", p); | 797 | post("string: \"%s\"", p); |
798 | #endif | 798 | #endif |
799 | SETSYMBOL(mya+myargc,gensym(p)); | 799 | SETSYMBOL(mya+myargc,gensym(p)); |
800 | myargc++; | 800 | myargc++; |
801 | //outlet_list(x->x_msgout, 0,sizeof(p), p); | 801 | //outlet_list(x->x_msgout, 0,sizeof(p), p); |
802 | //outlet_anything(x->x_msgout, 0, sizeof(p), p); | 802 | //outlet_anything(x->x_msgout, 0, sizeof(p), p); |
803 | p = DataAfterAlignedString(p, typeTags+n); | 803 | p = DataAfterAlignedString(p, typeTags+n); |
804 | // append to output vector .. | 804 | // append to output vector .. |
805 | } | 805 | } |
806 | break; | 806 | break; |
807 | 807 | ||
808 | case 'T': | 808 | case 'T': |
809 | #ifdef DEBUG | 809 | #ifdef DEBUG |
810 | printf("[True] "); | 810 | printf("[True] "); |
811 | #endif | 811 | #endif |
812 | SETFLOAT(mya+myargc,1.); | 812 | SETFLOAT(mya+myargc,1.); |
813 | myargc++; | 813 | myargc++; |
814 | break; | 814 | break; |
815 | case 'F': | 815 | case 'F': |
816 | #ifdef DEBUG | 816 | #ifdef DEBUG |
817 | printf("[False] "); | 817 | printf("[False] "); |
818 | #endif | 818 | #endif |
819 | SETFLOAT(mya+myargc,0.); | 819 | SETFLOAT(mya+myargc,0.); |
820 | myargc++; | 820 | myargc++; |
821 | break; | 821 | break; |
822 | case 'N': | 822 | case 'N': |
823 | #ifdef DEBUG | 823 | #ifdef DEBUG |
824 | printf("[Nil]"); | 824 | printf("[Nil]"); |
825 | #endif | 825 | #endif |
826 | post("sendOSC: [Nil] not implemented"); | 826 | post("sendOSC: [Nil] not implemented"); |
827 | break; | 827 | break; |
828 | case 'I': | 828 | case 'I': |
829 | #ifdef DEBUG | 829 | #ifdef DEBUG |
830 | printf("[Infinitum]"); | 830 | printf("[Infinitum]"); |
831 | #endif | 831 | #endif |
832 | post("sendOSC: [Infinitum] not implemented"); | 832 | post("sendOSC: [Infinitum] not implemented"); |
833 | break; | 833 | break; |
834 | 834 | ||
835 | default: | 835 | default: |
836 | post("sendOSC: [Unrecognized type tag %c]", *thisType); | 836 | post("sendOSC: [Unrecognized type tag %c]", *thisType); |
837 | // return; | 837 | // return; |
838 | } | 838 | } |
839 | } | 839 | } |
840 | x->x_outatc = myargc; | 840 | x->x_outatc = myargc; |
841 | } | 841 | } |
842 | 842 | ||
843 | static void dumpOSC_PrintHeuristicallyTypeGuessedArgs(t_dumpOSC *x, void *v, int n, int skipComma) { | 843 | static void dumpOSC_PrintHeuristicallyTypeGuessedArgs(t_dumpOSC *x, void *v, int n, int skipComma) { |
844 | int i, thisi; | 844 | int i, thisi; |
845 | float thisf; | 845 | float thisf; |
846 | int *ints; | 846 | int *ints; |
847 | char *chars; | 847 | char *chars; |
848 | char *string, *nextString; | 848 | char *string, *nextString; |
849 | 849 | ||
850 | int myargc= x->x_outatc; | 850 | int myargc= x->x_outatc; |
851 | t_atom* mya = x->x_outat; | 851 | t_atom* mya = x->x_outat; |
852 | int myi; | 852 | int myi; |
853 | 853 | ||
854 | 854 | ||
855 | /* Go through the arguments 32 bits at a time */ | 855 | /* Go through the arguments 32 bits at a time */ |
856 | ints = v; | 856 | ints = v; |
857 | chars = v; | 857 | chars = v; |
858 | 858 | ||
859 | for (i = 0; i<n/4; ) { | 859 | for (i = 0; i<n/4; ) { |
860 | string = &chars[i*4]; | 860 | string = &chars[i*4]; |
861 | thisi = ntohl(ints[i]); | 861 | thisi = ntohl(ints[i]); |
862 | /* Reinterpret the (potentially byte-reversed) thisi as a float */ | 862 | /* Reinterpret the (potentially byte-reversed) thisi as a float */ |
863 | thisf = *(((float *) (&thisi))); | 863 | thisf = *(((float *) (&thisi))); |
864 | 864 | ||
865 | if (thisi >= -1000 && thisi <= 1000000) { | 865 | if (thisi >= -1000 && thisi <= 1000000) { |
866 | #ifdef DEBUG | 866 | #ifdef DEBUG |
867 | printf("%d ", thisi); | 867 | printf("%d ", thisi); |
868 | #endif | 868 | #endif |
869 | // append to output vector .. | 869 | // append to output vector .. |
870 | SETFLOAT(mya+myargc,(t_float) (thisi)); | 870 | SETFLOAT(mya+myargc,(t_float) (thisi)); |
871 | myargc++; | 871 | myargc++; |
872 | // outlet_float(x->x_msgout, thisi); | 872 | // outlet_float(x->x_msgout, thisi); |
873 | i++; | 873 | i++; |
874 | } else if (thisf >= -1000.f && thisf <= 1000000.f && | 874 | } else if (thisf >= -1000.f && thisf <= 1000000.f && |
875 | (thisf <=0.0f || thisf >= SMALLEST_POSITIVE_FLOAT)) { | 875 | (thisf <=0.0f || thisf >= SMALLEST_POSITIVE_FLOAT)) { |
876 | #ifdef DEBUG | 876 | #ifdef DEBUG |
877 | printf("%f ", thisf); | 877 | printf("%f ", thisf); |
878 | #endif | 878 | #endif |
879 | // append to output vector .. | 879 | // append to output vector .. |
880 | SETFLOAT(mya+myargc,thisf); | 880 | SETFLOAT(mya+myargc,thisf); |
881 | myargc++; | 881 | myargc++; |
882 | //outlet_float(x->x_msgout, thisf); | 882 | //outlet_float(x->x_msgout, thisf); |
883 | i++; | 883 | i++; |
884 | } else if (IsNiceString(string, chars+n)) { | 884 | } else if (IsNiceString(string, chars+n)) { |
885 | nextString = DataAfterAlignedString(string, chars+n); | 885 | nextString = DataAfterAlignedString(string, chars+n); |
886 | #ifdef DEBUG | 886 | #ifdef DEBUG |
887 | printf("\"%s\" ", (i == 0 && skipComma) ? string +1 : string); | 887 | printf("\"%s\" ", (i == 0 && skipComma) ? string +1 : string); |
888 | #endif | 888 | #endif |
889 | // append to output vector .. | 889 | // append to output vector .. |
890 | SETSYMBOL(mya+myargc,gensym(string)); | 890 | SETSYMBOL(mya+myargc,gensym(string)); |
891 | myargc++; | 891 | myargc++; |
892 | //outlet_symbol(x->x_msgout, gensym((i == 0 && skipComma) ? string +1 : string)); | 892 | //outlet_symbol(x->x_msgout, gensym((i == 0 && skipComma) ? string +1 : string)); |
893 | i += (nextString-string) / 4; | 893 | i += (nextString-string) / 4; |
894 | } else { | 894 | } else { |
895 | // unhandled .. ;) | 895 | // unhandled .. ;) |
896 | #ifdef DEBUG | 896 | #ifdef DEBUG |
897 | printf("0x%x xx", ints[i]); | 897 | printf("0x%x xx", ints[i]); |
898 | #endif | 898 | #endif |
899 | i++; | 899 | i++; |
900 | } | 900 | } |
901 | x->x_outatc = myargc; | 901 | x->x_outatc = myargc; |
902 | } | 902 | } |
903 | } | 903 | } |
904 | 904 | ||
905 | 905 | ||
906 | #define STRING_ALIGN_PAD 4 | 906 | #define STRING_ALIGN_PAD 4 |
907 | 907 | ||
908 | char *DataAfterAlignedString(char *string, char *boundary) | 908 | char *DataAfterAlignedString(char *string, char *boundary) |
909 | { | 909 | { |
910 | /* The argument is a block of data beginning with a string. The | 910 | /* The argument is a block of data beginning with a string. The |
911 | string has (presumably) been padded with extra null characters | 911 | string has (presumably) been padded with extra null characters |
912 | so that the overall length is a multiple of STRING_ALIGN_PAD | 912 | so that the overall length is a multiple of STRING_ALIGN_PAD |
913 | bytes. Return a pointer to the next byte after the null | 913 | bytes. Return a pointer to the next byte after the null |
914 | byte(s). The boundary argument points to the character after | 914 | byte(s). The boundary argument points to the character after |
915 | the last valid character in the buffer---if the string hasn't | 915 | the last valid character in the buffer---if the string hasn't |
916 | ended by there, something's wrong. | 916 | ended by there, something's wrong. |
917 | 917 | ||
918 | If the data looks wrong, return 0, and set htm_error_string */ | 918 | If the data looks wrong, return 0, and set htm_error_string */ |
919 | 919 | ||
920 | int i; | 920 | int i; |
921 | 921 | ||
922 | if ((boundary - string) %4 != 0) { | 922 | if ((boundary - string) %4 != 0) { |
923 | fprintf(stderr, "Internal error: DataAfterAlignedString: bad boundary\n"); | 923 | fprintf(stderr, "Internal error: DataAfterAlignedString: bad boundary\n"); |
924 | return 0; | 924 | return 0; |
925 | } | 925 | } |
926 | 926 | ||
927 | for (i = 0; string[i] != '\0'; i++) { | 927 | for (i = 0; string[i] != '\0'; i++) { |
928 | if (string + i >= boundary) { | 928 | if (string + i >= boundary) { |
929 | htm_error_string = "DataAfterAlignedString: Unreasonably long string"; | 929 | htm_error_string = "DataAfterAlignedString: Unreasonably long string"; |
930 | return 0; | 930 | return 0; |
931 | } | 931 | } |
932 | } | 932 | } |
933 | 933 | ||
934 | /* Now string[i] is the first null character */ | 934 | /* Now string[i] is the first null character */ |
935 | i++; | 935 | i++; |
936 | 936 | ||
937 | for (; (i % STRING_ALIGN_PAD) != 0; i++) { | 937 | for (; (i % STRING_ALIGN_PAD) != 0; i++) { |
938 | if (string + i >= boundary) { | 938 | if (string + i >= boundary) { |
939 | htm_error_string = "DataAfterAlignedString: Unreasonably long string"; | 939 | htm_error_string = "DataAfterAlignedString: Unreasonably long string"; |
940 | return 0; | 940 | return 0; |
941 | } | 941 | } |
942 | if (string[i] != '\0') { | 942 | if (string[i] != '\0') { |
943 | htm_error_string = "DataAfterAlignedString: Incorrectly padded string."; | 943 | htm_error_string = "DataAfterAlignedString: Incorrectly padded string."; |
944 | return 0; | 944 | return 0; |
945 | } | 945 | } |
946 | } | 946 | } |
947 | 947 | ||
948 | return string+i; | 948 | return string+i; |
949 | } | 949 | } |
950 | 950 | ||
951 | Boolean IsNiceString(char *string, char *boundary) | 951 | Boolean IsNiceString(char *string, char *boundary) |
952 | { | 952 | { |
953 | /* Arguments same as DataAfterAlignedString(). Is the given "string" | 953 | /* Arguments same as DataAfterAlignedString(). Is the given "string" |
954 | really a string? I.e., is it a sequence of isprint() characters | 954 | really a string? I.e., is it a sequence of isprint() characters |
955 | terminated with 1-4 null characters to align on a 4-byte boundary? */ | 955 | terminated with 1-4 null characters to align on a 4-byte boundary? */ |
956 | 956 | ||
957 | int i; | 957 | int i; |
958 | 958 | ||
959 | if ((boundary - string) %4 != 0) { | 959 | if ((boundary - string) %4 != 0) { |
960 | fprintf(stderr, "Internal error: IsNiceString: bad boundary\n"); | 960 | fprintf(stderr, "Internal error: IsNiceString: bad boundary\n"); |
961 | return 0; | 961 | return 0; |
962 | } | 962 | } |
963 | 963 | ||
964 | for (i = 0; string[i] != '\0'; i++) { | 964 | for (i = 0; string[i] != '\0'; i++) { |
965 | if (!isprint(string[i])) return FALSE; | 965 | if (!isprint(string[i])) return FALSE; |
966 | if (string + i >= boundary) return FALSE; | 966 | if (string + i >= boundary) return FALSE; |
967 | } | 967 | } |
968 | 968 | ||
969 | /* If we made it this far, it's a null-terminated sequence of printing characters | 969 | /* If we made it this far, it's a null-terminated sequence of printing characters |
970 | in the given boundary. Now we just make sure it's null padded... */ | 970 | in the given boundary. Now we just make sure it's null padded... */ |
971 | 971 | ||
972 | /* Now string[i] is the first null character */ | 972 | /* Now string[i] is the first null character */ |
973 | i++; | 973 | i++; |
974 | for (; (i % STRING_ALIGN_PAD) != 0; i++) { | 974 | for (; (i % STRING_ALIGN_PAD) != 0; i++) { |
975 | if (string[i] != '\0') return FALSE; | 975 | if (string[i] != '\0') return FALSE; |
976 | } | 976 | } |
977 | 977 | ||
978 | return TRUE; | 978 | return TRUE; |
979 | } | 979 | } |
980 | 980 | ||
981 | 981 | ||
982 | 982 | ||
983 | 983 | ||
984 | 984 | ||
985 | 985 | ||
986 | 986 | ||
987 | 987 | ||
988 | 988 | ||
989 | #include <stdarg.h> | 989 | #include <stdarg.h> |
990 | void complain(char *s, ...) { | 990 | void complain(char *s, ...) { |
991 | va_list ap; | 991 | va_list ap; |
992 | va_start(ap, s); | 992 | va_start(ap, s); |
993 | fprintf(stderr, "*** ERROR: "); | 993 | fprintf(stderr, "*** ERROR: "); |
994 | vfprintf(stderr, s, ap); | 994 | vfprintf(stderr, s, ap); |
995 | fprintf(stderr, "\n"); | 995 | fprintf(stderr, "\n"); |
996 | va_end(ap); | 996 | va_end(ap); |
997 | } | 997 | } |
998 | 998 | ||
999 | #endif /* __sgi or LINUX or WIN32 */ | 999 | #endif /* __sgi or LINUX or WIN32 */ |
1000 | 1000 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/equalizer.c b/apps/plugins/pdbox/PDa/extra/equalizer.c index 743832302b..18f84ee3b3 100644 --- a/apps/plugins/pdbox/PDa/extra/equalizer.c +++ b/apps/plugins/pdbox/PDa/extra/equalizer.c | |||
@@ -1,86 +1,93 @@ | |||
1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ | 1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ |
2 | 2 | ||
3 | 3 | ||
4 | /* | 4 | /* |
5 | 5 | ||
6 | These filter coefficients computations are taken from | 6 | These filter coefficients computations are taken from |
7 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt | 7 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt |
8 | 8 | ||
9 | written by Robert Bristow-Johnson | 9 | written by Robert Bristow-Johnson |
10 | 10 | ||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include "m_pd.h" | 13 | #ifdef ROCKBOX |
14 | #ifdef NT | 14 | #include "plugin.h" |
15 | #pragma warning( disable : 4244 ) | 15 | #include "pdbox.h" |
16 | #pragma warning( disable : 4305 ) | 16 | #include "m_pd.h" |
17 | #endif | 17 | #include "math.h" |
18 | #include <math.h> | 18 | #include "filters.h" |
19 | #include "filters.h" | 19 | #else /* ROCKBOX */ |
20 | 20 | #include "m_pd.h" | |
21 | 21 | #ifdef NT | |
22 | 22 | #pragma warning( disable : 4244 ) | |
23 | /* ------------------- equ ----------------------------*/ | 23 | #pragma warning( disable : 4305 ) |
24 | static t_class *equ_class; | 24 | #endif |
25 | 25 | #include <math.h> | |
26 | void equ_bang(t_rbjfilter *x) | 26 | #include "filters.h" |
27 | { | 27 | #endif /* ROCKBOX */ |
28 | t_atom at[5]; | 28 | |
29 | t_float omega = e_omega(x->x_freq,x->x_rate); | 29 | |
30 | t_float alpha = e_alpha(x->x_bw*0.01,omega); | 30 | /* ------------------- equ ----------------------------*/ |
31 | t_float b0 = 1 + alpha*e_A(x->x_gain); | 31 | static t_class *equ_class; |
32 | t_float b1 = -2.*cos(omega); | 32 | |
33 | t_float b2 = 1 - alpha*e_A(x->x_gain); | 33 | void equ_bang(t_rbjfilter *x) |
34 | t_float a0 = 1 + alpha/e_A(x->x_gain); | 34 | { |
35 | t_float a1 = -2.*cos(omega); | 35 | t_atom at[5]; |
36 | t_float a2 = 1 - alpha/e_A(x->x_gain); | 36 | t_float omega = e_omega(x->x_freq,x->x_rate); |
37 | 37 | t_float alpha = e_alpha(x->x_bw*0.01,omega); | |
38 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw);*/ | 38 | t_float b0 = 1 + alpha*e_A(x->x_gain); |
39 | 39 | t_float b1 = -2.*cos(omega); | |
40 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { | 40 | t_float b2 = 1 - alpha*e_A(x->x_gain); |
41 | post("equ: filter unstable -> resetting"); | 41 | t_float a0 = 1 + alpha/e_A(x->x_gain); |
42 | a0=1.;a1=0.;a2=0.; | 42 | t_float a1 = -2.*cos(omega); |
43 | b0=1.;b1=0.;b2=0.; | 43 | t_float a2 = 1 - alpha/e_A(x->x_gain); |
44 | } | 44 | |
45 | 45 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw);*/ | |
46 | SETFLOAT(at,-a1/a0); | 46 | |
47 | SETFLOAT(at+1,-a2/a0); | 47 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { |
48 | SETFLOAT(at+2,b0/a0); | 48 | post("equ: filter unstable -> resetting"); |
49 | SETFLOAT(at+3,b1/a0); | 49 | a0=1.;a1=0.;a2=0.; |
50 | SETFLOAT(at+4,b2/a0); | 50 | b0=1.;b1=0.;b2=0.; |
51 | 51 | } | |
52 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); | 52 | |
53 | } | 53 | SETFLOAT(at,-a1/a0); |
54 | 54 | SETFLOAT(at+1,-a2/a0); | |
55 | 55 | SETFLOAT(at+2,b0/a0); | |
56 | void equ_float(t_rbjfilter *x,t_floatarg f) | 56 | SETFLOAT(at+3,b1/a0); |
57 | { | 57 | SETFLOAT(at+4,b2/a0); |
58 | x->x_freq = f; | 58 | |
59 | equ_bang(x); | 59 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); |
60 | } | 60 | } |
61 | 61 | ||
62 | 62 | ||
63 | static void *equ_new(t_floatarg f,t_floatarg g,t_floatarg bw) | 63 | void equ_float(t_rbjfilter *x,t_floatarg f) |
64 | { | 64 | { |
65 | t_rbjfilter *x = (t_rbjfilter *)pd_new(equ_class); | 65 | x->x_freq = f; |
66 | 66 | equ_bang(x); | |
67 | x->x_rate = 44100.0; | 67 | } |
68 | outlet_new(&x->x_obj,&s_float); | 68 | |
69 | floatinlet_new(&x->x_obj, &x->x_gain); | 69 | |
70 | floatinlet_new(&x->x_obj, &x->x_bw); | 70 | static void *equ_new(t_floatarg f,t_floatarg g,t_floatarg bw) |
71 | if (f > 0.) x->x_freq = f; | 71 | { |
72 | if (bw > 0.) x->x_bw = bw; | 72 | t_rbjfilter *x = (t_rbjfilter *)pd_new(equ_class); |
73 | if (g != 0.) x->x_gain = g; | 73 | |
74 | return (x); | 74 | x->x_rate = 44100.0; |
75 | } | 75 | outlet_new(&x->x_obj,&s_float); |
76 | 76 | floatinlet_new(&x->x_obj, &x->x_gain); | |
77 | 77 | floatinlet_new(&x->x_obj, &x->x_bw); | |
78 | void equalizer_setup(void) | 78 | if (f > 0.) x->x_freq = f; |
79 | { | 79 | if (bw > 0.) x->x_bw = bw; |
80 | equ_class = class_new(gensym("equalizer"), (t_newmethod)equ_new, 0, | 80 | if (g != 0.) x->x_gain = g; |
81 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,A_DEFFLOAT,0); | 81 | return (x); |
82 | class_addbang(equ_class,equ_bang); | 82 | } |
83 | class_addfloat(equ_class,equ_float); | 83 | |
84 | } | 84 | |
85 | 85 | void equalizer_setup(void) | |
86 | { | ||
87 | equ_class = class_new(gensym("equalizer"), (t_newmethod)equ_new, 0, | ||
88 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,A_DEFFLOAT,0); | ||
89 | class_addbang(equ_class,equ_bang); | ||
90 | class_addfloat(equ_class,equ_float); | ||
91 | } | ||
92 | |||
86 | 93 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/filters.h b/apps/plugins/pdbox/PDa/extra/filters.h index 8a91f75073..2eaf2b09f9 100644 --- a/apps/plugins/pdbox/PDa/extra/filters.h +++ b/apps/plugins/pdbox/PDa/extra/filters.h | |||
@@ -1,75 +1,82 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | These filter coefficients computations are taken from | 3 | These filter coefficients computations are taken from |
4 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt | 4 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt |
5 | 5 | ||
6 | written by Robert Bristow-Johnson | 6 | written by Robert Bristow-Johnson |
7 | 7 | ||
8 | */ | 8 | */ |
9 | 9 | ||
10 | 10 | ||
11 | #ifndef __GGEE_FILTERS_H__ | 11 | #ifndef __GGEE_FILTERS_H__ |
12 | #define __GGEE_FILTERS_H__ | 12 | #define __GGEE_FILTERS_H__ |
13 | 13 | ||
14 | 14 | #ifdef ROCKBOX | |
15 | 15 | #include "math.h" | |
16 | #ifndef M_PI | 16 | #else |
17 | #define M_PI 3.141593f | 17 | #include <math.h> |
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | 20 | #ifndef M_PI | |
21 | #include <math.h> | 21 | #define M_PI 3.141593f |
22 | #define LN2 0.69314718 | 22 | #endif |
23 | #define e_A(g) (pow(10,(g/40.))) | 23 | |
24 | #define e_omega(f,r) (2.0*M_PI*f/r) | 24 | #define LN2 0.69314718 |
25 | #define e_alpha(bw,omega) (sin(omega)*sinh(LN2/2. * bw * omega/sin(omega))) | 25 | #define e_A(g) (pow(10,(g/40.))) |
26 | #define e_beta(a,S) (sqrt((a*a + 1)/(S) - (a-1)*(a-1))) | 26 | #define e_omega(f,r) (2.0*M_PI*f/r) |
27 | 27 | #define e_alpha(bw,omega) (sin(omega)*sinh(LN2/2. * bw * omega/sin(omega))) | |
28 | 28 | #define e_beta(a,S) (sqrt((a*a + 1)/(S) - (a-1)*(a-1))) | |
29 | 29 | ||
30 | 30 | ||
31 | typedef struct _rbjfilter | 31 | |
32 | { | 32 | |
33 | t_object x_obj; | 33 | typedef struct _rbjfilter |
34 | t_float x_rate; | 34 | { |
35 | t_float x_freq; | 35 | t_object x_obj; |
36 | t_float x_gain; | 36 | t_float x_rate; |
37 | t_float x_bw; | 37 | t_float x_freq; |
38 | } t_rbjfilter; | 38 | t_float x_gain; |
39 | 39 | t_float x_bw; | |
40 | 40 | } t_rbjfilter; | |
41 | static int check_stability(t_float fb1, | 41 | |
42 | t_float fb2, | 42 | |
43 | t_float ff1, | 43 | static int check_stability(t_float fb1, |
44 | t_float ff2, | 44 | t_float fb2, |
45 | t_float ff3) | 45 | t_float ff1, |
46 | { | 46 | t_float ff2, |
47 | float discriminant = fb1 * fb1 + 4 * fb2; | 47 | t_float ff3) |
48 | 48 | { | |
49 | if (discriminant < 0) /* imaginary roots -- resonant filter */ | 49 | #ifdef ROCKBOX |
50 | { | 50 | (void) ff1; |
51 | /* they're conjugates so we just check that the product | 51 | (void) ff2; |
52 | is less than one */ | 52 | (void) ff3; |
53 | if (fb2 >= -1.0f) goto stable; | 53 | #endif |
54 | } | 54 | float discriminant = fb1 * fb1 + 4 * fb2; |
55 | else /* real roots */ | 55 | |
56 | { | 56 | if (discriminant < 0) /* imaginary roots -- resonant filter */ |
57 | /* check that the parabola 1 - fb1 x - fb2 x^2 has a | 57 | { |
58 | vertex between -1 and 1, and that it's nonnegative | 58 | /* they're conjugates so we just check that the product |
59 | at both ends, which implies both roots are in [1-,1]. */ | 59 | is less than one */ |
60 | if (fb1 <= 2.0f && fb1 >= -2.0f && | 60 | if (fb2 >= -1.0f) goto stable; |
61 | 1.0f - fb1 -fb2 >= 0 && 1.0f + fb1 - fb2 >= 0) | 61 | } |
62 | goto stable; | 62 | else /* real roots */ |
63 | } | 63 | { |
64 | return 0; | 64 | /* check that the parabola 1 - fb1 x - fb2 x^2 has a |
65 | stable: | 65 | vertex between -1 and 1, and that it's nonnegative |
66 | return 1; | 66 | at both ends, which implies both roots are in [1-,1]. */ |
67 | } | 67 | if (fb1 <= 2.0f && fb1 >= -2.0f && |
68 | 68 | 1.0f - fb1 -fb2 >= 0 && 1.0f + fb1 - fb2 >= 0) | |
69 | 69 | goto stable; | |
70 | 70 | } | |
71 | 71 | return 0; | |
72 | 72 | stable: | |
73 | 73 | return 1; | |
74 | #endif | 74 | } |
75 | |||
76 | |||
77 | |||
78 | |||
79 | |||
80 | |||
81 | #endif | ||
75 | 82 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/gcanvas.c b/apps/plugins/pdbox/PDa/extra/gcanvas.c index 9e3f934299..09c120632e 100644 --- a/apps/plugins/pdbox/PDa/extra/gcanvas.c +++ b/apps/plugins/pdbox/PDa/extra/gcanvas.c | |||
@@ -1,379 +1,452 @@ | |||
1 | /* (C) Guenter Geiger <geiger@xdv.org> */ | 1 | /* (C) Guenter Geiger <geiger@xdv.org> */ |
2 | 2 | ||
3 | 3 | ||
4 | #include "m_pd.h" | 4 | #include "m_pd.h" |
5 | #include "g_canvas.h" | 5 | #include "g_canvas.h" |
6 | 6 | ||
7 | /* ------------------------ gcanvas ----------------------------- */ | 7 | /* ------------------------ gcanvas ----------------------------- */ |
8 | 8 | ||
9 | 9 | ||
10 | #define BACKGROUNDCOLOR "grey" | 10 | #define BACKGROUNDCOLOR "grey" |
11 | 11 | ||
12 | #define DEFAULTSIZE 80 | 12 | #define DEFAULTSIZE 80 |
13 | 13 | ||
14 | static t_class *gcanvas_class; | 14 | static t_class *gcanvas_class; |
15 | 15 | ||
16 | typedef struct _gcanvas | 16 | typedef struct _gcanvas |
17 | { | 17 | { |
18 | t_object x_obj; | 18 | t_object x_obj; |
19 | t_glist * x_glist; | 19 | t_glist * x_glist; |
20 | t_outlet* out2; | 20 | t_outlet* out2; |
21 | t_outlet* out3; | 21 | t_outlet* out3; |
22 | int x_width; | 22 | int x_width; |
23 | int x_height; | 23 | int x_height; |
24 | int x; | 24 | int x; |
25 | int y; | 25 | int y; |
26 | int x_xgrid; | 26 | int x_xgrid; |
27 | int x_ygrid; | 27 | int x_ygrid; |
28 | } t_gcanvas; | 28 | } t_gcanvas; |
29 | 29 | ||
30 | 30 | ||
31 | static void rectangle(void* cv,void* o,char c,int x, int y,int w,int h,char* color) { | 31 | static void rectangle(void* cv,void* o,char c,int x, int y,int w,int h,char* color) { |
32 | sys_vgui(".x%x.c create rectangle \ | 32 | #ifdef ROCKBOX |
33 | %d %d %d %d -tags %x%c -fill %s\n",cv,x,y,x+w,y+h,o,c,color); | 33 | (void) cv; |
34 | } | 34 | (void) o; |
35 | 35 | (void) c; | |
36 | static void move_object(void* cv,void* o,char c,int x, int y,int w,int h) { | 36 | (void) x; |
37 | sys_vgui(".x%x.c coords %x%c %d %d %d %d\n", | 37 | (void) y; |
38 | cv,o,c,x,y,x+w,y+h); | 38 | (void) w; |
39 | 39 | (void) h; | |
40 | } | 40 | (void) color; |
41 | 41 | #else /* ROCKBOX */ | |
42 | static void color_object(void* cv,void* o,char c,char* color) { | 42 | sys_vgui(".x%x.c create rectangle \ |
43 | sys_vgui(".x%x.c itemconfigure %x%c -fill %s\n", cv, | 43 | %d %d %d %d -tags %x%c -fill %s\n",cv,x,y,x+w,y+h,o,c,color); |
44 | o, c,color); | 44 | #endif /* ROCKBOX */ |
45 | } | 45 | } |
46 | 46 | ||
47 | static void delete_object(void* cv,void* o,char c) { | 47 | static void move_object(void* cv,void* o,char c,int x, int y,int w,int h) { |
48 | sys_vgui(".x%x.c delete %x%c\n", | 48 | #ifdef ROCKBOX |
49 | cv, o,c); | 49 | (void) cv; |
50 | } | 50 | (void) o; |
51 | 51 | (void) c; | |
52 | static void line(void* cv,void* o,char c,int x,int y,int w,int h,char* color) { | 52 | (void) x; |
53 | sys_vgui(".x%x.c create line \ | 53 | (void) y; |
54 | %d %d %d %d -tags %x%c -fill %s\n",cv,x,y,x+w,y+h,o,c,color); | 54 | (void) w; |
55 | } | 55 | (void) h; |
56 | 56 | #else /* ROCKBOX */ | |
57 | 57 | sys_vgui(".x%x.c coords %x%c %d %d %d %d\n", | |
58 | /* widget helper functions */ | 58 | cv,o,c,x,y,x+w,y+h); |
59 | 59 | #endif /* ROCKBOX */ | |
60 | void gcanvas_drawme(t_gcanvas *x, t_glist *glist, int firsttime) | 60 | } |
61 | { | 61 | |
62 | int i; | 62 | static void color_object(void* cv,void* o,char c,char* color) { |
63 | if (firsttime) { | 63 | #ifdef ROCKBOX |
64 | rectangle(glist_getcanvas(glist),x,'a', | 64 | (void) cv; |
65 | x->x_obj.te_xpix, x->x_obj.te_ypix, | 65 | (void) o; |
66 | x->x_width, x->x_height,BACKGROUNDCOLOR); | 66 | (void) c; |
67 | for (i=1;i<x->x_xgrid;i++) | 67 | (void) color; |
68 | line(glist_getcanvas(glist),x,'b'+ i, | 68 | #else /* ROCKBOX */ |
69 | x->x_obj.te_xpix + x->x_width*i/x->x_xgrid, | 69 | sys_vgui(".x%x.c itemconfigure %x%c -fill %s\n", cv, |
70 | x->x_obj.te_ypix, | 70 | o, c,color); |
71 | 0, x->x_height,"red"); | 71 | #endif /* ROCKBOX */ |
72 | for (i=1;i<x->x_ygrid;i++) | 72 | } |
73 | line(glist_getcanvas(glist),x,'B'+ i, | 73 | |
74 | x->x_obj.te_xpix, | 74 | static void delete_object(void* cv,void* o,char c) { |
75 | x->x_obj.te_ypix + x->x_height*i/x->x_ygrid, | 75 | #ifdef ROCKBOX |
76 | x->x_width, 0,"blue"); | 76 | (void) cv; |
77 | } | 77 | (void) o; |
78 | else { | 78 | (void) c; |
79 | move_object( | 79 | #else /* ROCKBOX */ |
80 | glist_getcanvas(glist),x,'a', | 80 | sys_vgui(".x%x.c delete %x%c\n", |
81 | x->x_obj.te_xpix, x->x_obj.te_ypix, | 81 | cv, o,c); |
82 | x->x_width, x->x_height); | 82 | #endif /* ROCKBOX */ |
83 | for (i=1;i<x->x_xgrid;i++) | 83 | } |
84 | move_object(glist_getcanvas(glist),x,'b'+ i, | 84 | |
85 | x->x_obj.te_xpix + x->x_width*i/x->x_xgrid, | 85 | static void line(void* cv,void* o,char c,int x,int y,int w,int h,char* color) { |
86 | x->x_obj.te_ypix, | 86 | #ifdef ROCKBOX |
87 | 0, x->x_height); | 87 | (void) cv; |
88 | for (i=1;i<x->x_ygrid;i++) | 88 | (void) o; |
89 | move_object(glist_getcanvas(glist),x,'B'+ i, | 89 | (void) c; |
90 | x->x_obj.te_xpix, | 90 | (void) x; |
91 | x->x_obj.te_ypix + x->x_height*i/x->x_ygrid, | 91 | (void) y; |
92 | x->x_width, 0); | 92 | (void) w; |
93 | } | 93 | (void) h; |
94 | 94 | (void) color; | |
95 | { | 95 | #else /* ROCKBOX */ |
96 | /* outlets */ | 96 | sys_vgui(".x%x.c create line \ |
97 | int n = 3; | 97 | %d %d %d %d -tags %x%c -fill %s\n",cv,x,y,x+w,y+h,o,c,color); |
98 | int nplus, i; | 98 | #endif /* ROCKBOX */ |
99 | nplus = (n == 1 ? 1 : n-1); | 99 | } |
100 | for (i = 0; i < n; i++) | 100 | |
101 | { | 101 | |
102 | int onset = x->x_obj.te_xpix + (x->x_width - IOWIDTH) * i / nplus; | 102 | /* widget helper functions */ |
103 | if (firsttime) | 103 | |
104 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xo%d\n", | 104 | void gcanvas_drawme(t_gcanvas *x, t_glist *glist, int firsttime) |
105 | glist_getcanvas(glist), | 105 | { |
106 | onset, x->x_obj.te_ypix + x->x_height - 1, | 106 | int i; |
107 | onset + IOWIDTH, x->x_obj.te_ypix + x->x_height, | 107 | if (firsttime) { |
108 | x, i); | 108 | rectangle(glist_getcanvas(glist),x,'a', |
109 | else | 109 | x->x_obj.te_xpix, x->x_obj.te_ypix, |
110 | sys_vgui(".x%x.c coords %xo%d %d %d %d %d\n", | 110 | x->x_width, x->x_height,BACKGROUNDCOLOR); |
111 | glist_getcanvas(glist), x, i, | 111 | for (i=1;i<x->x_xgrid;i++) |
112 | onset, x->x_obj.te_ypix + x->x_height - 1, | 112 | line(glist_getcanvas(glist),x,'b'+ i, |
113 | onset + IOWIDTH, x->x_obj.te_ypix + x->x_height); | 113 | x->x_obj.te_xpix + x->x_width*i/x->x_xgrid, |
114 | } | 114 | x->x_obj.te_ypix, |
115 | /* inlets */ | 115 | 0, x->x_height,"red"); |
116 | n = 0; | 116 | for (i=1;i<x->x_ygrid;i++) |
117 | nplus = (n == 1 ? 1 : n-1); | 117 | line(glist_getcanvas(glist),x,'B'+ i, |
118 | for (i = 0; i < n; i++) | 118 | x->x_obj.te_xpix, |
119 | { | 119 | x->x_obj.te_ypix + x->x_height*i/x->x_ygrid, |
120 | int onset = x->x_obj.te_xpix + (x->x_width - IOWIDTH) * i / nplus; | 120 | x->x_width, 0,"blue"); |
121 | if (firsttime) | 121 | } |
122 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xi%d\n", | 122 | else { |
123 | glist_getcanvas(glist), | 123 | move_object( |
124 | onset, x->x_obj.te_ypix, | 124 | glist_getcanvas(glist),x,'a', |
125 | onset + IOWIDTH, x->x_obj.te_ypix + 1, | 125 | x->x_obj.te_xpix, x->x_obj.te_ypix, |
126 | x, i); | 126 | x->x_width, x->x_height); |
127 | else | 127 | for (i=1;i<x->x_xgrid;i++) |
128 | sys_vgui(".x%x.c coords %xi%d %d %d %d %d\n", | 128 | move_object(glist_getcanvas(glist),x,'b'+ i, |
129 | glist_getcanvas(glist), x, i, | 129 | x->x_obj.te_xpix + x->x_width*i/x->x_xgrid, |
130 | onset, x->x_obj.te_ypix, | 130 | x->x_obj.te_ypix, |
131 | onset + IOWIDTH, x->x_obj.te_ypix + 1); | 131 | 0, x->x_height); |
132 | 132 | for (i=1;i<x->x_ygrid;i++) | |
133 | } | 133 | move_object(glist_getcanvas(glist),x,'B'+ i, |
134 | } | 134 | x->x_obj.te_xpix, |
135 | 135 | x->x_obj.te_ypix + x->x_height*i/x->x_ygrid, | |
136 | } | 136 | x->x_width, 0); |
137 | 137 | } | |
138 | 138 | ||
139 | 139 | { | |
140 | 140 | /* outlets */ | |
141 | void gcanvas_erase(t_gcanvas* x,t_glist* glist) | 141 | int n = 3; |
142 | { | 142 | int nplus, i; |
143 | int n,i; | 143 | nplus = (n == 1 ? 1 : n-1); |
144 | delete_object(glist_getcanvas(glist),x,'a'); | 144 | for (i = 0; i < n; i++) |
145 | for (i=1;i<x->x_xgrid;i++) | 145 | { |
146 | delete_object(glist_getcanvas(glist),x,'b'+ i); | 146 | #ifndef ROCKBOX |
147 | for (i=1;i<x->x_ygrid;i++) | 147 | int onset = x->x_obj.te_xpix + (x->x_width - IOWIDTH) * i / nplus; |
148 | delete_object(glist_getcanvas(glist),x,'B'+ i); | 148 | if (firsttime) |
149 | 149 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xo%d\n", | |
150 | n = 2; | 150 | glist_getcanvas(glist), |
151 | while (n--) { | 151 | onset, x->x_obj.te_ypix + x->x_height - 1, |
152 | sys_vgui(".x%x.c delete %xo%d\n",glist_getcanvas(glist),x,n); | 152 | onset + IOWIDTH, x->x_obj.te_ypix + x->x_height, |
153 | } | 153 | x, i); |
154 | } | 154 | else |
155 | 155 | sys_vgui(".x%x.c coords %xo%d %d %d %d %d\n", | |
156 | 156 | glist_getcanvas(glist), x, i, | |
157 | 157 | onset, x->x_obj.te_ypix + x->x_height - 1, | |
158 | /* ------------------------ gcanvas widgetbehaviour----------------------------- */ | 158 | onset + IOWIDTH, x->x_obj.te_ypix + x->x_height); |
159 | 159 | #endif /* ROCKBOX */ | |
160 | 160 | } | |
161 | static void gcanvas_getrect(t_gobj *z, t_glist *owner, | 161 | /* inlets */ |
162 | int *xp1, int *yp1, int *xp2, int *yp2) | 162 | n = 0; |
163 | { | 163 | nplus = (n == 1 ? 1 : n-1); |
164 | int width, height; | 164 | for (i = 0; i < n; i++) |
165 | t_gcanvas* s = (t_gcanvas*)z; | 165 | { |
166 | 166 | #ifndef ROCKBOX | |
167 | 167 | int onset = x->x_obj.te_xpix + (x->x_width - IOWIDTH) * i / nplus; | |
168 | width = s->x_width; | 168 | if (firsttime) |
169 | height = s->x_height; | 169 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xi%d\n", |
170 | *xp1 = s->x_obj.te_xpix; | 170 | glist_getcanvas(glist), |
171 | *yp1 = s->x_obj.te_ypix; | 171 | onset, x->x_obj.te_ypix, |
172 | *xp2 = s->x_obj.te_xpix + width; | 172 | onset + IOWIDTH, x->x_obj.te_ypix + 1, |
173 | *yp2 = s->x_obj.te_ypix + height; | 173 | x, i); |
174 | } | 174 | else |
175 | 175 | sys_vgui(".x%x.c coords %xi%d %d %d %d %d\n", | |
176 | static void gcanvas_displace(t_gobj *z, t_glist *glist, | 176 | glist_getcanvas(glist), x, i, |
177 | int dx, int dy) | 177 | onset, x->x_obj.te_ypix, |
178 | { | 178 | onset + IOWIDTH, x->x_obj.te_ypix + 1); |
179 | t_gcanvas *x = (t_gcanvas *)z; | 179 | #endif /* ROCKBOX */ |
180 | x->x_obj.te_xpix += dx; | 180 | } |
181 | x->x_obj.te_ypix += dy; | 181 | } |
182 | gcanvas_drawme(x, glist, 0); | 182 | |
183 | canvas_fixlinesfor(glist_getcanvas(glist),(t_text*) x); | 183 | } |
184 | } | 184 | |
185 | 185 | ||
186 | static void gcanvas_select(t_gobj *z, t_glist *glist, int state) | 186 | |
187 | { | 187 | |
188 | t_gcanvas *x = (t_gcanvas *)z; | 188 | void gcanvas_erase(t_gcanvas* x,t_glist* glist) |
189 | color_object(glist,x,'a',state ? "blue" : BACKGROUNDCOLOR); | 189 | { |
190 | } | 190 | int n,i; |
191 | 191 | delete_object(glist_getcanvas(glist),x,'a'); | |
192 | 192 | for (i=1;i<x->x_xgrid;i++) | |
193 | static void gcanvas_activate(t_gobj *z, t_glist *glist, int state) | 193 | delete_object(glist_getcanvas(glist),x,'b'+ i); |
194 | { | 194 | for (i=1;i<x->x_ygrid;i++) |
195 | /* t_text *x = (t_text *)z; | 195 | delete_object(glist_getcanvas(glist),x,'B'+ i); |
196 | t_rtext *y = glist_findrtext(glist, x); | 196 | |
197 | if (z->g_pd != gatom_class) rtext_activate(y, state);*/ | 197 | n = 2; |
198 | } | 198 | while (n--) { |
199 | 199 | #ifndef ROCKBOX | |
200 | static void gcanvas_delete(t_gobj *z, t_glist *glist) | 200 | sys_vgui(".x%x.c delete %xo%d\n",glist_getcanvas(glist),x,n); |
201 | { | 201 | #endif |
202 | t_text *x = (t_text *)z; | 202 | } |
203 | canvas_deletelinesfor(glist_getcanvas(glist), x); | 203 | } |
204 | } | 204 | |
205 | 205 | ||
206 | 206 | ||
207 | static void gcanvas_vis(t_gobj *z, t_glist *glist, int vis) | 207 | /* ------------------------ gcanvas widgetbehaviour----------------------------- */ |
208 | { | 208 | |
209 | t_gcanvas* s = (t_gcanvas*)z; | 209 | |
210 | if (vis) | 210 | static void gcanvas_getrect(t_gobj *z, t_glist *owner, |
211 | gcanvas_drawme(s, glist, 1); | 211 | int *xp1, int *yp1, int *xp2, int *yp2) |
212 | else | 212 | { |
213 | gcanvas_erase(s,glist); | 213 | #ifdef ROCKBOX |
214 | } | 214 | (void) owner; |
215 | 215 | #endif | |
216 | /* can we use the normal text save function ?? */ | 216 | int width, height; |
217 | 217 | t_gcanvas* s = (t_gcanvas*)z; | |
218 | static void gcanvas_save(t_gobj *z, t_binbuf *b) | 218 | |
219 | { | 219 | |
220 | t_gcanvas *x = (t_gcanvas *)z; | 220 | width = s->x_width; |
221 | binbuf_addv(b, "ssiisiiii", gensym("#X"),gensym("obj"), | 221 | height = s->x_height; |
222 | (t_int)x->x_obj.te_xpix, (t_int)x->x_obj.te_ypix, | 222 | *xp1 = s->x_obj.te_xpix; |
223 | gensym("gcanvas"),x->x_width,x->x_height, | 223 | *yp1 = s->x_obj.te_ypix; |
224 | x->x_xgrid, | 224 | *xp2 = s->x_obj.te_xpix + width; |
225 | x->x_ygrid); | 225 | *yp2 = s->x_obj.te_ypix + height; |
226 | binbuf_addv(b, ";"); | 226 | } |
227 | } | 227 | |
228 | 228 | static void gcanvas_displace(t_gobj *z, t_glist *glist, | |
229 | 229 | int dx, int dy) | |
230 | t_widgetbehavior gcanvas_widgetbehavior; | 230 | { |
231 | 231 | t_gcanvas *x = (t_gcanvas *)z; | |
232 | static void gcanvas_motion(t_gcanvas *x, t_floatarg dx, t_floatarg dy) | 232 | x->x_obj.te_xpix += dx; |
233 | { | 233 | x->x_obj.te_ypix += dy; |
234 | x->x += dx; | 234 | gcanvas_drawme(x, glist, 0); |
235 | x->y += dy; | 235 | canvas_fixlinesfor(glist_getcanvas(glist),(t_text*) x); |
236 | outlet_float(x->out2,x->y); | 236 | } |
237 | outlet_float(x->x_obj.ob_outlet,x->x); | 237 | |
238 | } | 238 | static void gcanvas_select(t_gobj *z, t_glist *glist, int state) |
239 | 239 | { | |
240 | void gcanvas_key(t_gcanvas *x, t_floatarg f) | 240 | t_gcanvas *x = (t_gcanvas *)z; |
241 | { | 241 | color_object(glist,x,'a',state ? "blue" : BACKGROUNDCOLOR); |
242 | post("key"); | 242 | } |
243 | } | 243 | |
244 | 244 | ||
245 | 245 | static void gcanvas_activate(t_gobj *z, t_glist *glist, int state) | |
246 | static void gcanvas_click(t_gcanvas *x, | 246 | { |
247 | t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, | 247 | #ifdef ROCKBOX |
248 | t_floatarg doit,int up) | 248 | (void) z; |
249 | { | 249 | (void) glist; |
250 | glist_grab(x->x_glist, &x->x_obj.te_g, (t_glistmotionfn) gcanvas_motion, | 250 | (void) state; |
251 | (t_glistkeyfn) NULL, xpos, ypos); | 251 | #endif |
252 | 252 | /* t_text *x = (t_text *)z; | |
253 | x->x = xpos - x->x_obj.te_xpix; | 253 | t_rtext *y = glist_findrtext(glist, x); |
254 | x->y = ypos - x->x_obj.te_ypix; | 254 | if (z->g_pd != gatom_class) rtext_activate(y, state);*/ |
255 | outlet_float(x->out2,x->y); | 255 | } |
256 | outlet_float(x->x_obj.ob_outlet,x->x); | 256 | |
257 | outlet_float(x->out3,0); | 257 | static void gcanvas_delete(t_gobj *z, t_glist *glist) |
258 | } | 258 | { |
259 | 259 | t_text *x = (t_text *)z; | |
260 | static int gcanvas_newclick(t_gobj *z, struct _glist *glist, | 260 | canvas_deletelinesfor(glist_getcanvas(glist), x); |
261 | int xpix, int ypix, int shift, int alt, int dbl, int doit) | 261 | } |
262 | { | 262 | |
263 | if (doit) | 263 | |
264 | gcanvas_click((t_gcanvas *)z, (t_floatarg)xpix, (t_floatarg)ypix, | 264 | static void gcanvas_vis(t_gobj *z, t_glist *glist, int vis) |
265 | (t_floatarg)shift, 0, (t_floatarg)alt,dbl); | 265 | { |
266 | 266 | t_gcanvas* s = (t_gcanvas*)z; | |
267 | if (dbl) outlet_float(((t_gcanvas*)z)->out3,1); | 267 | if (vis) |
268 | return (1); | 268 | gcanvas_drawme(s, glist, 1); |
269 | } | 269 | else |
270 | 270 | gcanvas_erase(s,glist); | |
271 | void gcanvas_size(t_gcanvas* x,t_floatarg w,t_floatarg h) { | 271 | } |
272 | x->x_width = w; | 272 | |
273 | x->x_height = h; | 273 | /* can we use the normal text save function ?? */ |
274 | gcanvas_drawme(x, x->x_glist, 0); | 274 | |
275 | } | 275 | static void gcanvas_save(t_gobj *z, t_binbuf *b) |
276 | 276 | { | |
277 | static void gcanvas_setwidget(void) | 277 | t_gcanvas *x = (t_gcanvas *)z; |
278 | { | 278 | binbuf_addv(b, "ssiisiiii", gensym("#X"),gensym("obj"), |
279 | gcanvas_widgetbehavior.w_getrectfn = gcanvas_getrect; | 279 | (t_int)x->x_obj.te_xpix, (t_int)x->x_obj.te_ypix, |
280 | gcanvas_widgetbehavior.w_displacefn = gcanvas_displace; | 280 | gensym("gcanvas"),x->x_width,x->x_height, |
281 | gcanvas_widgetbehavior.w_selectfn = gcanvas_select; | 281 | x->x_xgrid, |
282 | gcanvas_widgetbehavior.w_activatefn = gcanvas_activate; | 282 | x->x_ygrid); |
283 | gcanvas_widgetbehavior.w_deletefn = gcanvas_delete; | 283 | binbuf_addv(b, ";"); |
284 | gcanvas_widgetbehavior.w_visfn = gcanvas_vis; | 284 | } |
285 | gcanvas_widgetbehavior.w_clickfn = gcanvas_newclick; | 285 | |
286 | class_setsavefn(gcanvas_class,gcanvas_save); | 286 | |
287 | } | 287 | t_widgetbehavior gcanvas_widgetbehavior; |
288 | 288 | ||
289 | 289 | static void gcanvas_motion(t_gcanvas *x, t_floatarg dx, t_floatarg dy) | |
290 | static void *gcanvas_new(t_symbol* s,t_int ac,t_atom* at) | 290 | { |
291 | { | 291 | x->x += dx; |
292 | t_gcanvas *x = (t_gcanvas *)pd_new(gcanvas_class); | 292 | x->y += dy; |
293 | 293 | outlet_float(x->out2,x->y); | |
294 | x->x_glist = (t_glist*) canvas_getcurrent(); | 294 | outlet_float(x->x_obj.ob_outlet,x->x); |
295 | 295 | } | |
296 | 296 | ||
297 | /* Fetch the width */ | 297 | void gcanvas_key(t_gcanvas *x, t_floatarg f) |
298 | 298 | { | |
299 | x->x_width = DEFAULTSIZE; | 299 | #ifdef ROCKBOX |
300 | if (ac-- > 0) { | 300 | (void) x; |
301 | if (at->a_type != A_FLOAT) | 301 | (void) f; |
302 | error("gcanvas: wrong argument type"); | 302 | #endif |
303 | else | 303 | post("key"); |
304 | x->x_width = atom_getfloat(at++); | 304 | } |
305 | 305 | ||
306 | if (x->x_width < 0 || x->x_width > 2000) { | 306 | |
307 | error("gcanvas: unallowed width %f",x->x_width); | 307 | static void gcanvas_click(t_gcanvas *x, |
308 | x->x_width = DEFAULTSIZE; | 308 | t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, |
309 | } | 309 | t_floatarg doit,int up) |
310 | } | 310 | { |
311 | 311 | #ifdef ROCKBOX | |
312 | /* Fetch the height */ | 312 | (void) shift; |
313 | 313 | (void) ctrl; | |
314 | x->x_height = DEFAULTSIZE; | 314 | (void) doit; |
315 | if (ac-- > 0) { | 315 | (void) up; |
316 | if (at->a_type != A_FLOAT) | 316 | #endif |
317 | error("gcanvas: wrong argument type"); | 317 | glist_grab(x->x_glist, &x->x_obj.te_g, (t_glistmotionfn) gcanvas_motion, |
318 | else | 318 | (t_glistkeyfn) NULL, xpos, ypos); |
319 | x->x_height = atom_getfloat(at++); | 319 | |
320 | 320 | x->x = xpos - x->x_obj.te_xpix; | |
321 | if (x->x_height < 0 || x->x_height > 2000) { | 321 | x->y = ypos - x->x_obj.te_ypix; |
322 | error("gcanvas: unallowed height %f",x->x_height); | 322 | outlet_float(x->out2,x->y); |
323 | x->x_width = DEFAULTSIZE; | 323 | outlet_float(x->x_obj.ob_outlet,x->x); |
324 | } | 324 | outlet_float(x->out3,0); |
325 | } | 325 | } |
326 | 326 | ||
327 | /* Fetch the xgrid */ | 327 | static int gcanvas_newclick(t_gobj *z, struct _glist *glist, |
328 | 328 | int xpix, int ypix, int shift, int alt, int dbl, int doit) | |
329 | x->x_xgrid = 0; | 329 | { |
330 | if (ac-- > 0) { | 330 | #ifdef ROCKBOX |
331 | if (at->a_type != A_FLOAT) | 331 | (void) glist; |
332 | error("gcanvas: wrong argument type"); | 332 | #endif |
333 | else | 333 | if (doit) |
334 | x->x_xgrid = atom_getfloat(at++); | 334 | gcanvas_click((t_gcanvas *)z, (t_floatarg)xpix, (t_floatarg)ypix, |
335 | 335 | (t_floatarg)shift, 0, (t_floatarg)alt,dbl); | |
336 | if (x->x_xgrid < 0 || x->x_xgrid > x->x_width/2) { | 336 | |
337 | error("gcanvas: unallowed xgrid %f",x->x_xgrid); | 337 | if (dbl) outlet_float(((t_gcanvas*)z)->out3,1); |
338 | x->x_xgrid = 0; | 338 | return (1); |
339 | } | 339 | } |
340 | } | 340 | |
341 | 341 | void gcanvas_size(t_gcanvas* x,t_floatarg w,t_floatarg h) { | |
342 | /* Fetch the ygrid */ | 342 | x->x_width = w; |
343 | 343 | x->x_height = h; | |
344 | x->x_ygrid = 0; | 344 | gcanvas_drawme(x, x->x_glist, 0); |
345 | if (ac-- > 0) { | 345 | } |
346 | if (at->a_type != A_FLOAT) | 346 | |
347 | error("gcanvas: wrong argument type"); | 347 | static void gcanvas_setwidget(void) |
348 | else | 348 | { |
349 | x->x_ygrid = atom_getfloat(at++); | 349 | gcanvas_widgetbehavior.w_getrectfn = gcanvas_getrect; |
350 | 350 | gcanvas_widgetbehavior.w_displacefn = gcanvas_displace; | |
351 | if (x->x_ygrid < 0 || x->x_ygrid > x->x_height/2) { | 351 | gcanvas_widgetbehavior.w_selectfn = gcanvas_select; |
352 | error("gcanvas: unallowed xgrid %f",x->x_ygrid); | 352 | gcanvas_widgetbehavior.w_activatefn = gcanvas_activate; |
353 | x->x_ygrid = 0; | 353 | gcanvas_widgetbehavior.w_deletefn = gcanvas_delete; |
354 | } | 354 | gcanvas_widgetbehavior.w_visfn = gcanvas_vis; |
355 | } | 355 | gcanvas_widgetbehavior.w_clickfn = gcanvas_newclick; |
356 | 356 | class_setsavefn(gcanvas_class,gcanvas_save); | |
357 | outlet_new(&x->x_obj, &s_float); | 357 | } |
358 | x->out2 = outlet_new(&x->x_obj, &s_float); | 358 | |
359 | x->out3 = outlet_new(&x->x_obj, &s_float); | 359 | |
360 | return (x); | 360 | static void *gcanvas_new(t_symbol* s,t_int ac,t_atom* at) |
361 | } | 361 | { |
362 | 362 | #ifdef ROCKBOX | |
363 | 363 | (void) s; | |
364 | 364 | #endif | |
365 | void gcanvas_setup(void) | 365 | t_gcanvas *x = (t_gcanvas *)pd_new(gcanvas_class); |
366 | { | 366 | |
367 | gcanvas_class = class_new(gensym("gcanvas"), (t_newmethod)gcanvas_new, 0, | 367 | x->x_glist = (t_glist*) canvas_getcurrent(); |
368 | sizeof(t_gcanvas),0, A_GIMME,0); | 368 | |
369 | 369 | ||
370 | class_addmethod(gcanvas_class, (t_method)gcanvas_click, gensym("click"), | 370 | /* Fetch the width */ |
371 | A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); | 371 | |
372 | class_addmethod(gcanvas_class, (t_method)gcanvas_size, gensym("size"), | 372 | x->x_width = DEFAULTSIZE; |
373 | A_FLOAT, A_FLOAT, 0); | 373 | if (ac-- > 0) { |
374 | 374 | if (at->a_type != A_FLOAT) | |
375 | gcanvas_setwidget(); | 375 | error("gcanvas: wrong argument type"); |
376 | class_setwidget(gcanvas_class,&gcanvas_widgetbehavior); | 376 | else |
377 | } | 377 | x->x_width = atom_getfloat(at++); |
378 | 378 | ||
379 | if (x->x_width < 0 || x->x_width > 2000) { | ||
380 | error("gcanvas: unallowed width %f",x->x_width); | ||
381 | x->x_width = DEFAULTSIZE; | ||
382 | } | ||
383 | } | ||
384 | |||
385 | /* Fetch the height */ | ||
386 | |||
387 | x->x_height = DEFAULTSIZE; | ||
388 | if (ac-- > 0) { | ||
389 | if (at->a_type != A_FLOAT) | ||
390 | error("gcanvas: wrong argument type"); | ||
391 | else | ||
392 | x->x_height = atom_getfloat(at++); | ||
393 | |||
394 | if (x->x_height < 0 || x->x_height > 2000) { | ||
395 | error("gcanvas: unallowed height %f",x->x_height); | ||
396 | x->x_width = DEFAULTSIZE; | ||
397 | } | ||
398 | } | ||
399 | |||
400 | /* Fetch the xgrid */ | ||
401 | |||
402 | x->x_xgrid = 0; | ||
403 | if (ac-- > 0) { | ||
404 | if (at->a_type != A_FLOAT) | ||
405 | error("gcanvas: wrong argument type"); | ||
406 | else | ||
407 | x->x_xgrid = atom_getfloat(at++); | ||
408 | |||
409 | if (x->x_xgrid < 0 || x->x_xgrid > x->x_width/2) { | ||
410 | error("gcanvas: unallowed xgrid %f",x->x_xgrid); | ||
411 | x->x_xgrid = 0; | ||
412 | } | ||
413 | } | ||
414 | |||
415 | /* Fetch the ygrid */ | ||
416 | |||
417 | x->x_ygrid = 0; | ||
418 | if (ac-- > 0) { | ||
419 | if (at->a_type != A_FLOAT) | ||
420 | error("gcanvas: wrong argument type"); | ||
421 | else | ||
422 | x->x_ygrid = atom_getfloat(at++); | ||
423 | |||
424 | if (x->x_ygrid < 0 || x->x_ygrid > x->x_height/2) { | ||
425 | error("gcanvas: unallowed xgrid %f",x->x_ygrid); | ||
426 | x->x_ygrid = 0; | ||
427 | } | ||
428 | } | ||
429 | |||
430 | outlet_new(&x->x_obj, &s_float); | ||
431 | x->out2 = outlet_new(&x->x_obj, &s_float); | ||
432 | x->out3 = outlet_new(&x->x_obj, &s_float); | ||
433 | return (x); | ||
434 | } | ||
435 | |||
436 | |||
437 | |||
438 | void gcanvas_setup(void) | ||
439 | { | ||
440 | gcanvas_class = class_new(gensym("gcanvas"), (t_newmethod)gcanvas_new, 0, | ||
441 | sizeof(t_gcanvas),0, A_GIMME,0); | ||
442 | |||
443 | class_addmethod(gcanvas_class, (t_method)gcanvas_click, gensym("click"), | ||
444 | A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); | ||
445 | class_addmethod(gcanvas_class, (t_method)gcanvas_size, gensym("size"), | ||
446 | A_FLOAT, A_FLOAT, 0); | ||
447 | |||
448 | gcanvas_setwidget(); | ||
449 | class_setwidget(gcanvas_class,&gcanvas_widgetbehavior); | ||
450 | } | ||
451 | |||
379 | 452 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/highpass.c b/apps/plugins/pdbox/PDa/extra/highpass.c index f97ca233f3..05e8a06d59 100644 --- a/apps/plugins/pdbox/PDa/extra/highpass.c +++ b/apps/plugins/pdbox/PDa/extra/highpass.c | |||
@@ -1,85 +1,94 @@ | |||
1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ | 1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ |
2 | 2 | ||
3 | 3 | ||
4 | /* | 4 | /* |
5 | 5 | ||
6 | These filter coefficients computations are taken from | 6 | These filter coefficients computations are taken from |
7 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt | 7 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt |
8 | 8 | ||
9 | written by Robert Bristow-Johnson | 9 | written by Robert Bristow-Johnson |
10 | 10 | ||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include "m_pd.h" | 13 | |
14 | #ifdef NT | 14 | #ifdef ROCKBOX |
15 | #pragma warning( disable : 4244 ) | 15 | #include "plugin.h" |
16 | #pragma warning( disable : 4305 ) | 16 | #include "pdbox.h" |
17 | #endif | 17 | #include "m_pd.h" |
18 | #include <math.h> | 18 | #include "math.h" |
19 | #include "filters.h" | 19 | #include "filters.h" |
20 | 20 | #else /* ROCKBOX */ | |
21 | 21 | #include "m_pd.h" | |
22 | /* ------------------- highpass ----------------------------*/ | 22 | #ifdef NT |
23 | 23 | #pragma warning( disable : 4244 ) | |
24 | static t_class *highpass_class; | 24 | #pragma warning( disable : 4305 ) |
25 | 25 | #endif | |
26 | void highpass_bang(t_rbjfilter *x) | 26 | #include <math.h> |
27 | { | 27 | #include "filters.h" |
28 | t_atom at[5]; | 28 | #endif /* ROCKBOX */ |
29 | t_float omega = e_omega(x->x_freq,x->x_rate); | 29 | |
30 | t_float alpha = e_alpha(x->x_bw* 0.01,omega); | 30 | |
31 | t_float b1 = -(1 + cos(omega)); | 31 | /* ------------------- highpass ----------------------------*/ |
32 | t_float b0 = -b1/2.; | 32 | |
33 | t_float b2 = b0; | 33 | static t_class *highpass_class; |
34 | t_float a0 = 1 + alpha; | 34 | |
35 | t_float a1 = -2.*cos(omega); | 35 | void highpass_bang(t_rbjfilter *x) |
36 | t_float a2 = 1 - alpha; | 36 | { |
37 | 37 | t_atom at[5]; | |
38 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw); */ | 38 | t_float omega = e_omega(x->x_freq,x->x_rate); |
39 | 39 | t_float alpha = e_alpha(x->x_bw* 0.01,omega); | |
40 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { | 40 | t_float b1 = -(1 + cos(omega)); |
41 | post("highpass: filter unstable -> resetting"); | 41 | t_float b0 = -b1/2.; |
42 | a0=1.;a1=0.;a2=0.; | 42 | t_float b2 = b0; |
43 | b0=1.;b1=0.;b2=0.; | 43 | t_float a0 = 1 + alpha; |
44 | } | 44 | t_float a1 = -2.*cos(omega); |
45 | 45 | t_float a2 = 1 - alpha; | |
46 | SETFLOAT(at,-a1/a0); | 46 | |
47 | SETFLOAT(at+1,-a2/a0); | 47 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw); */ |
48 | SETFLOAT(at+2,b0/a0); | 48 | |
49 | SETFLOAT(at+3,b1/a0); | 49 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { |
50 | SETFLOAT(at+4,b2/a0); | 50 | post("highpass: filter unstable -> resetting"); |
51 | 51 | a0=1.;a1=0.;a2=0.; | |
52 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); | 52 | b0=1.;b1=0.;b2=0.; |
53 | } | 53 | } |
54 | 54 | ||
55 | 55 | SETFLOAT(at,-a1/a0); | |
56 | void highpass_float(t_rbjfilter *x,t_floatarg f) | 56 | SETFLOAT(at+1,-a2/a0); |
57 | { | 57 | SETFLOAT(at+2,b0/a0); |
58 | x->x_freq = f; | 58 | SETFLOAT(at+3,b1/a0); |
59 | highpass_bang(x); | 59 | SETFLOAT(at+4,b2/a0); |
60 | } | 60 | |
61 | 61 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); | |
62 | 62 | } | |
63 | static void *highpass_new(t_floatarg f,t_floatarg bw) | 63 | |
64 | { | 64 | |
65 | t_rbjfilter *x = (t_rbjfilter *)pd_new(highpass_class); | 65 | void highpass_float(t_rbjfilter *x,t_floatarg f) |
66 | 66 | { | |
67 | x->x_rate = 44100.0; | 67 | x->x_freq = f; |
68 | outlet_new(&x->x_obj,&s_float); | 68 | highpass_bang(x); |
69 | /* floatinlet_new(&x->x_obj, &x->x_gain); */ | 69 | } |
70 | floatinlet_new(&x->x_obj, &x->x_bw); | 70 | |
71 | if (f > 0.) x->x_freq = f; | 71 | |
72 | if (bw > 0.) x->x_bw = bw; | 72 | static void *highpass_new(t_floatarg f,t_floatarg bw) |
73 | return (x); | 73 | { |
74 | } | 74 | t_rbjfilter *x = (t_rbjfilter *)pd_new(highpass_class); |
75 | 75 | ||
76 | 76 | x->x_rate = 44100.0; | |
77 | void highpass_setup(void) | 77 | outlet_new(&x->x_obj,&s_float); |
78 | { | 78 | /* floatinlet_new(&x->x_obj, &x->x_gain); */ |
79 | highpass_class = class_new(gensym("highpass"), (t_newmethod)highpass_new, 0, | 79 | floatinlet_new(&x->x_obj, &x->x_bw); |
80 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,0); | 80 | if (f > 0.) x->x_freq = f; |
81 | class_addbang(highpass_class,highpass_bang); | 81 | if (bw > 0.) x->x_bw = bw; |
82 | class_addfloat(highpass_class,highpass_float); | 82 | return (x); |
83 | } | 83 | } |
84 | 84 | ||
85 | |||
86 | void highpass_setup(void) | ||
87 | { | ||
88 | highpass_class = class_new(gensym("highpass"), (t_newmethod)highpass_new, 0, | ||
89 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,0); | ||
90 | class_addbang(highpass_class,highpass_bang); | ||
91 | class_addfloat(highpass_class,highpass_float); | ||
92 | } | ||
93 | |||
85 | 94 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/highshelf.c b/apps/plugins/pdbox/PDa/extra/highshelf.c index 74db29178a..b058a2a2e6 100644 --- a/apps/plugins/pdbox/PDa/extra/highshelf.c +++ b/apps/plugins/pdbox/PDa/extra/highshelf.c | |||
@@ -1,90 +1,98 @@ | |||
1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ | 1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ |
2 | 2 | ||
3 | 3 | ||
4 | /* | 4 | /* |
5 | 5 | ||
6 | These filter coefficients computations are taken from | 6 | These filter coefficients computations are taken from |
7 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt | 7 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt |
8 | 8 | ||
9 | written by Robert Bristow-Johnson | 9 | written by Robert Bristow-Johnson |
10 | 10 | ||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include "m_pd.h" | 13 | #ifdef ROCKBOX |
14 | #ifdef NT | 14 | #include "plugin.h" |
15 | #pragma warning( disable : 4244 ) | 15 | #include "pdbox.h" |
16 | #pragma warning( disable : 4305 ) | 16 | #include "m_pd.h" |
17 | #endif | 17 | #include "math.h" |
18 | #include <math.h> | 18 | #include "filters.h" |
19 | #include "filters.h" | 19 | #else /* ROCKBOX */ |
20 | 20 | #include "m_pd.h" | |
21 | 21 | #ifdef NT | |
22 | /* ------------------- highshelf ----------------------------*/ | 22 | #pragma warning( disable : 4244 ) |
23 | 23 | #pragma warning( disable : 4305 ) | |
24 | static t_class *highshelf_class; | 24 | #endif |
25 | 25 | #include <math.h> | |
26 | void highshelf_bang(t_rbjfilter *x) | 26 | #include "filters.h" |
27 | { | 27 | #endif /* ROCKBOX */ |
28 | t_atom at[5]; | 28 | |
29 | t_float omega = e_omega(x->x_freq,x->x_rate); | 29 | |
30 | t_float A = e_A(x->x_gain); | 30 | /* ------------------- highshelf ----------------------------*/ |
31 | t_float cs = cos(omega); | 31 | |
32 | t_float sn = sin(omega); | 32 | static t_class *highshelf_class; |
33 | t_float beta = e_beta(A,x->x_bw* 0.01); | 33 | |
34 | 34 | void highshelf_bang(t_rbjfilter *x) | |
35 | t_float b0 = A*((A+1) + (A-1)*cs + beta*sn); | 35 | { |
36 | t_float b1 =-2.*A*((A-1) + (A+1)*cs); | 36 | t_atom at[5]; |
37 | t_float b2 = A*((A+1) + (A-1)*cs - beta*sn); | 37 | t_float omega = e_omega(x->x_freq,x->x_rate); |
38 | t_float a0 = ((A+1) - (A-1)*cs + beta*sn); | 38 | t_float A = e_A(x->x_gain); |
39 | t_float a1 = 2.*((A-1) - (A+1)*cs); | 39 | t_float cs = cos(omega); |
40 | t_float a2 = ((A+1) - (A-1)*cs - beta*sn); | 40 | t_float sn = sin(omega); |
41 | 41 | t_float beta = e_beta(A,x->x_bw* 0.01); | |
42 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw);*/ | 42 | |
43 | 43 | t_float b0 = A*((A+1) + (A-1)*cs + beta*sn); | |
44 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { | 44 | t_float b1 =-2.*A*((A-1) + (A+1)*cs); |
45 | post("highshelf: filter unstable -> resetting"); | 45 | t_float b2 = A*((A+1) + (A-1)*cs - beta*sn); |
46 | a0=1.;a1=0.;a2=0.; | 46 | t_float a0 = ((A+1) - (A-1)*cs + beta*sn); |
47 | b0=1.;b1=0.;b2=0.; | 47 | t_float a1 = 2.*((A-1) - (A+1)*cs); |
48 | } | 48 | t_float a2 = ((A+1) - (A-1)*cs - beta*sn); |
49 | 49 | ||
50 | SETFLOAT(at,-a1/a0); | 50 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw);*/ |
51 | SETFLOAT(at+1,-a2/a0); | 51 | |
52 | SETFLOAT(at+2,b0/a0); | 52 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { |
53 | SETFLOAT(at+3,b1/a0); | 53 | post("highshelf: filter unstable -> resetting"); |
54 | SETFLOAT(at+4,b2/a0); | 54 | a0=1.;a1=0.;a2=0.; |
55 | 55 | b0=1.;b1=0.;b2=0.; | |
56 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); | 56 | } |
57 | } | 57 | |
58 | 58 | SETFLOAT(at,-a1/a0); | |
59 | 59 | SETFLOAT(at+1,-a2/a0); | |
60 | void highshelf_float(t_rbjfilter *x,t_floatarg f) | 60 | SETFLOAT(at+2,b0/a0); |
61 | { | 61 | SETFLOAT(at+3,b1/a0); |
62 | x->x_freq = f; | 62 | SETFLOAT(at+4,b2/a0); |
63 | highshelf_bang(x); | 63 | |
64 | } | 64 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); |
65 | 65 | } | |
66 | 66 | ||
67 | static void *highshelf_new(t_floatarg f,t_floatarg g,t_floatarg bw) | 67 | |
68 | { | 68 | void highshelf_float(t_rbjfilter *x,t_floatarg f) |
69 | t_rbjfilter *x = (t_rbjfilter *)pd_new(highshelf_class); | 69 | { |
70 | 70 | x->x_freq = f; | |
71 | x->x_rate = 44100.0; | 71 | highshelf_bang(x); |
72 | outlet_new(&x->x_obj,&s_float); | 72 | } |
73 | floatinlet_new(&x->x_obj, &x->x_gain); | 73 | |
74 | floatinlet_new(&x->x_obj, &x->x_bw); | 74 | |
75 | if (f > 0.) x->x_freq = f; | 75 | static void *highshelf_new(t_floatarg f,t_floatarg g,t_floatarg bw) |
76 | if (bw > 0.) x->x_bw = bw; | 76 | { |
77 | if (g != 0.) x->x_gain = g; | 77 | t_rbjfilter *x = (t_rbjfilter *)pd_new(highshelf_class); |
78 | return (x); | 78 | |
79 | } | 79 | x->x_rate = 44100.0; |
80 | 80 | outlet_new(&x->x_obj,&s_float); | |
81 | 81 | floatinlet_new(&x->x_obj, &x->x_gain); | |
82 | void highshelf_setup(void) | 82 | floatinlet_new(&x->x_obj, &x->x_bw); |
83 | { | 83 | if (f > 0.) x->x_freq = f; |
84 | highshelf_class = class_new(gensym("highshelf"), (t_newmethod)highshelf_new, 0, | 84 | if (bw > 0.) x->x_bw = bw; |
85 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,A_DEFFLOAT,0); | 85 | if (g != 0.) x->x_gain = g; |
86 | class_addbang(highshelf_class,highshelf_bang); | 86 | return (x); |
87 | class_addfloat(highshelf_class,highshelf_float); | 87 | } |
88 | } | 88 | |
89 | 89 | ||
90 | void highshelf_setup(void) | ||
91 | { | ||
92 | highshelf_class = class_new(gensym("highshelf"), (t_newmethod)highshelf_new, 0, | ||
93 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,A_DEFFLOAT,0); | ||
94 | class_addbang(highshelf_class,highshelf_bang); | ||
95 | class_addfloat(highshelf_class,highshelf_float); | ||
96 | } | ||
97 | |||
90 | 98 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/hlshelf.c b/apps/plugins/pdbox/PDa/extra/hlshelf.c index 242a2e625f..49f413f9ca 100644 --- a/apps/plugins/pdbox/PDa/extra/hlshelf.c +++ b/apps/plugins/pdbox/PDa/extra/hlshelf.c | |||
@@ -1,226 +1,242 @@ | |||
1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ | 1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ |
2 | 2 | ||
3 | 3 | ||
4 | #include <m_pd.h> | 4 | #ifdef ROCKBOX |
5 | #include <math.h> | 5 | #include "plugin.h" |
6 | 6 | #include "pdbox.h" | |
7 | #ifdef NT | 7 | #include "m_pd.h" |
8 | #pragma warning( disable : 4244 ) | 8 | #include "math.h" |
9 | #pragma warning( disable : 4305 ) | 9 | #else /* ROCKBOX */ |
10 | #endif | 10 | #include <m_pd.h> |
11 | 11 | #include <math.h> | |
12 | /* ------------------------ hlshelf ----------------------------- */ | 12 | |
13 | 13 | #ifdef NT | |
14 | 14 | #pragma warning( disable : 4244 ) | |
15 | #ifndef M_PI | 15 | #pragma warning( disable : 4305 ) |
16 | #define M_PI 3.141593f | 16 | #endif |
17 | #endif | 17 | #endif /* ROCKBOX */ |
18 | 18 | ||
19 | #define SRATE 44100.0 | 19 | /* ------------------------ hlshelf ----------------------------- */ |
20 | #define MAX_GAIN 120.0f | 20 | |
21 | 21 | ||
22 | static t_class *hlshelf_class; | 22 | #ifndef M_PI |
23 | 23 | #define M_PI 3.141593f | |
24 | 24 | #endif | |
25 | typedef struct _hlshelf | 25 | |
26 | { | 26 | #define SRATE 44100.0 |
27 | t_object x_obj; | 27 | #define MAX_GAIN 120.0f |
28 | float s_rate; | 28 | |
29 | float s_gain0; | 29 | static t_class *hlshelf_class; |
30 | float s_gain1; | 30 | |
31 | float s_gain2; | 31 | |
32 | float s_ltransfq; | 32 | typedef struct _hlshelf |
33 | float s_htransfq; | 33 | { |
34 | float s_lradians; | 34 | t_object x_obj; |
35 | float s_hradians; | 35 | float s_rate; |
36 | } t_hlshelf; | 36 | float s_gain0; |
37 | 37 | float s_gain1; | |
38 | 38 | float s_gain2; | |
39 | int hlshelf_check_stability(t_float fb1, | 39 | float s_ltransfq; |
40 | t_float fb2, | 40 | float s_htransfq; |
41 | t_float ff1, | 41 | float s_lradians; |
42 | t_float ff2, | 42 | float s_hradians; |
43 | t_float ff3) | 43 | } t_hlshelf; |
44 | { | 44 | |
45 | float discriminant = fb1 * fb1 + 4 * fb2; | 45 | |
46 | 46 | int hlshelf_check_stability(t_float fb1, | |
47 | if (discriminant < 0) /* imaginary roots -- resonant filter */ | 47 | t_float fb2, |
48 | { | 48 | t_float ff1, |
49 | /* they're conjugates so we just check that the product | 49 | t_float ff2, |
50 | is less than one */ | 50 | t_float ff3) |
51 | if (fb2 >= -1.0f) goto stable; | 51 | { |
52 | } | 52 | #ifdef ROCKBOX |
53 | else /* real roots */ | 53 | (void) ff1; |
54 | { | 54 | (void) ff2; |
55 | /* check that the parabola 1 - fb1 x - fb2 x^2 has a | 55 | (void) ff3; |
56 | vertex between -1 and 1, and that it's nonnegative | 56 | #endif |
57 | at both ends, which implies both roots are in [1-,1]. */ | 57 | float discriminant = fb1 * fb1 + 4 * fb2; |
58 | if (fb1 <= 2.0f && fb1 >= -2.0f && | 58 | |
59 | 1.0f - fb1 -fb2 >= 0 && 1.0f + fb1 - fb2 >= 0) | 59 | if (discriminant < 0) /* imaginary roots -- resonant filter */ |
60 | goto stable; | 60 | { |
61 | } | 61 | /* they're conjugates so we just check that the product |
62 | return 0; | 62 | is less than one */ |
63 | stable: | 63 | if (fb2 >= -1.0f) goto stable; |
64 | return 1; | 64 | } |
65 | } | 65 | else /* real roots */ |
66 | 66 | { | |
67 | 67 | /* check that the parabola 1 - fb1 x - fb2 x^2 has a | |
68 | void hlshelf_check(t_hlshelf *x) | 68 | vertex between -1 and 1, and that it's nonnegative |
69 | { | 69 | at both ends, which implies both roots are in [1-,1]. */ |
70 | 70 | if (fb1 <= 2.0f && fb1 >= -2.0f && | |
71 | if(x->s_gain0 - x->s_gain1 > MAX_GAIN) { | 71 | 1.0f - fb1 -fb2 >= 0 && 1.0f + fb1 - fb2 >= 0) |
72 | x->s_gain0 = x->s_gain1 + MAX_GAIN; | 72 | goto stable; |
73 | post("setting gain0 to %f",x->s_gain0); | 73 | } |
74 | } | 74 | return 0; |
75 | 75 | stable: | |
76 | 76 | return 1; | |
77 | if(x->s_gain1 > MAX_GAIN) { | 77 | } |
78 | x->s_gain1 = MAX_GAIN; | 78 | |
79 | post("setting gain1 to %f",x->s_gain1); | 79 | |
80 | } | 80 | void hlshelf_check(t_hlshelf *x) |
81 | 81 | { | |
82 | if(x->s_gain2 - x->s_gain1 > MAX_GAIN) { | 82 | |
83 | x->s_gain2 = x->s_gain1 + MAX_GAIN; | 83 | if(x->s_gain0 - x->s_gain1 > MAX_GAIN) { |
84 | post("setting gain2 to %f",x->s_gain2); | 84 | x->s_gain0 = x->s_gain1 + MAX_GAIN; |
85 | } | 85 | post("setting gain0 to %f",x->s_gain0); |
86 | 86 | } | |
87 | /* constrain: 0 <= x->s_ltransfq < x->s_htransfq. */ | 87 | |
88 | x->s_ltransfq = (x->s_ltransfq < x->s_htransfq) ? x->s_ltransfq : x->s_htransfq - 0.5f; | 88 | |
89 | 89 | if(x->s_gain1 > MAX_GAIN) { | |
90 | if (x->s_ltransfq < 0) x->s_ltransfq = 0.0f; | 90 | x->s_gain1 = MAX_GAIN; |
91 | 91 | post("setting gain1 to %f",x->s_gain1); | |
92 | x->s_lradians = M_PI * x->s_ltransfq / x->s_rate; | 92 | } |
93 | x->s_hradians= M_PI * (0.5f - (x->s_htransfq / x->s_rate)); | 93 | |
94 | 94 | if(x->s_gain2 - x->s_gain1 > MAX_GAIN) { | |
95 | } | 95 | x->s_gain2 = x->s_gain1 + MAX_GAIN; |
96 | 96 | post("setting gain2 to %f",x->s_gain2); | |
97 | 97 | } | |
98 | void hlshelf_bang(t_hlshelf *x) | 98 | |
99 | { | 99 | /* constrain: 0 <= x->s_ltransfq < x->s_htransfq. */ |
100 | t_atom at[6]; | 100 | x->s_ltransfq = (x->s_ltransfq < x->s_htransfq) ? x->s_ltransfq : x->s_htransfq - 0.5f; |
101 | float c0, c1, c2, d0, d1, d2; /* output coefs */ | 101 | |
102 | float a1, a2, b1, b2, g1, g2; /* temp coefs */ | 102 | if (x->s_ltransfq < 0) x->s_ltransfq = 0.0f; |
103 | double xf; | 103 | |
104 | 104 | x->s_lradians = M_PI * x->s_ltransfq / x->s_rate; | |
105 | hlshelf_check(x); | 105 | x->s_hradians= M_PI * (0.5f - (x->s_htransfq / x->s_rate)); |
106 | 106 | ||
107 | /* low shelf */ | 107 | } |
108 | xf = 0.5 * 0.115129255 * (double)(x->s_gain0 - x->s_gain1); /* ln(10) / 20 = 0.115129255 */ | 108 | |
109 | if(xf < -200.) /* exp(x) -> 0 */ | 109 | |
110 | { | 110 | void hlshelf_bang(t_hlshelf *x) |
111 | a1 = 1.0f; | 111 | { |
112 | b1 = -1.0f; | 112 | t_atom at[6]; |
113 | g1 = 0.0f; | 113 | float c0, c1, c2, d0, d1, d2; /* output coefs */ |
114 | } | 114 | float a1, a2, b1, b2, g1, g2; /* temp coefs */ |
115 | else | 115 | double xf; |
116 | { | 116 | |
117 | double t = tan(x->s_lradians); | 117 | hlshelf_check(x); |
118 | double e = exp(xf); | 118 | |
119 | double r = t / e; | 119 | /* low shelf */ |
120 | double kr = t * e; | 120 | xf = 0.5 * 0.115129255 * (double)(x->s_gain0 - x->s_gain1); /* ln(10) / 20 = 0.115129255 */ |
121 | 121 | if(xf < -200.) /* exp(x) -> 0 */ | |
122 | a1 = (r - 1) / (r + 1); | 122 | { |
123 | b1 = (kr - 1) / (kr + 1); | 123 | a1 = 1.0f; |
124 | g1 = (kr + 1) / (r + 1); | 124 | b1 = -1.0f; |
125 | } | 125 | g1 = 0.0f; |
126 | 126 | } | |
127 | /* high shelf */ | 127 | else |
128 | xf = 0.5 * 0.115129255 * (double)(x->s_gain2 - x->s_gain1); /* ln(10) / 20 = 0.115129255 */ | 128 | { |
129 | if(xf < -200.) /* exp(x) -> 0 */ | 129 | double t = tan(x->s_lradians); |
130 | { | 130 | double e = exp(xf); |
131 | a2 = -1.0f; | 131 | double r = t / e; |
132 | b2 = 1.0f; | 132 | double kr = t * e; |
133 | g2 = 0.0f; | 133 | |
134 | } | 134 | a1 = (r - 1) / (r + 1); |
135 | else | 135 | b1 = (kr - 1) / (kr + 1); |
136 | { | 136 | g1 = (kr + 1) / (r + 1); |
137 | double t = tan(x->s_hradians); | 137 | } |
138 | double e = exp(xf); | 138 | |
139 | double r = t / e; | 139 | /* high shelf */ |
140 | double kr = t * e; | 140 | xf = 0.5 * 0.115129255 * (double)(x->s_gain2 - x->s_gain1); /* ln(10) / 20 = 0.115129255 */ |
141 | 141 | if(xf < -200.) /* exp(x) -> 0 */ | |
142 | a2 = (1 - r) / (1 + r); | 142 | { |
143 | b2 = (1 - kr) / (1 + kr); | 143 | a2 = -1.0f; |
144 | g2 = (1 + kr) / (1 + r); | 144 | b2 = 1.0f; |
145 | } | 145 | g2 = 0.0f; |
146 | 146 | } | |
147 | /* form product */ | 147 | else |
148 | c0 = g1 * g2 * (float)(exp((double)(x->s_gain1) * 0.05f * 2.302585093f)); ; | 148 | { |
149 | c1 = a1 + a2; | 149 | double t = tan(x->s_hradians); |
150 | c2 = a1 * a2; | 150 | double e = exp(xf); |
151 | d0 = 1.0f; | 151 | double r = t / e; |
152 | d1 = b1 + b2; | 152 | double kr = t * e; |
153 | d2 = b1 * b2; | 153 | |
154 | 154 | a2 = (1 - r) / (1 + r); | |
155 | if (!hlshelf_check_stability(-c1/d0,-c2/d0,d0/d0,d1/d0,d2/d0)) { | 155 | b2 = (1 - kr) / (1 + kr); |
156 | post("hlshelf: filter unstable -> resetting"); | 156 | g2 = (1 + kr) / (1 + r); |
157 | c0=1.;c1=0.;c2=0.; | 157 | } |
158 | d0=1.;d1=0.;d2=0.; | 158 | |
159 | } | 159 | /* form product */ |
160 | 160 | c0 = g1 * g2 * (float)(exp((double)(x->s_gain1) * 0.05f * 2.302585093f)); ; | |
161 | SETFLOAT(at,-c1/d0); | 161 | c1 = a1 + a2; |
162 | SETFLOAT(at+1,-c2/d0); | 162 | c2 = a1 * a2; |
163 | SETFLOAT(at+2,d0/d0); | 163 | d0 = 1.0f; |
164 | SETFLOAT(at+3,d1/d0); | 164 | d1 = b1 + b2; |
165 | SETFLOAT(at+4,d2/d0); | 165 | d2 = b1 * b2; |
166 | 166 | ||
167 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); | 167 | if (!hlshelf_check_stability(-c1/d0,-c2/d0,d0/d0,d1/d0,d2/d0)) { |
168 | } | 168 | post("hlshelf: filter unstable -> resetting"); |
169 | 169 | c0=1.;c1=0.;c2=0.; | |
170 | void hlshelf_float(t_hlshelf *x,t_floatarg f) | 170 | d0=1.;d1=0.;d2=0.; |
171 | { | 171 | } |
172 | x->s_gain0 = f; | 172 | |
173 | hlshelf_bang(x); | 173 | SETFLOAT(at,-c1/d0); |
174 | } | 174 | SETFLOAT(at+1,-c2/d0); |
175 | 175 | SETFLOAT(at+2,d0/d0); | |
176 | 176 | SETFLOAT(at+3,d1/d0); | |
177 | static void *hlshelf_new(t_symbol* s,t_int argc, t_atom* at) | 177 | SETFLOAT(at+4,d2/d0); |
178 | { | 178 | |
179 | t_hlshelf *x = (t_hlshelf *)pd_new(hlshelf_class); | 179 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); |
180 | t_float k0 = atom_getfloat(at); | 180 | } |
181 | t_float k1 = atom_getfloat(at+1); | 181 | |
182 | t_float k2 = atom_getfloat(at+2); | 182 | void hlshelf_float(t_hlshelf *x,t_floatarg f) |
183 | t_float f1 = atom_getfloat(at+3); | 183 | { |
184 | t_float f2 = atom_getfloat(at+4); | 184 | x->s_gain0 = f; |
185 | 185 | hlshelf_bang(x); | |
186 | 186 | } | |
187 | f1 = atom_getfloat(at); | 187 | |
188 | f2 = atom_getfloat(at); | 188 | |
189 | 189 | static void *hlshelf_new(t_symbol* s,t_int argc, t_atom* at) | |
190 | if ((f1 == 0.0f && f2 == 0.0f) || f1 > f2){ /* all gains = 0db */ | 190 | { |
191 | f1 = 150.0f; | 191 | #ifdef ROCKBOX |
192 | f2 = 5000.0f; | 192 | (void) s; |
193 | } | 193 | (void) argc; |
194 | 194 | #endif | |
195 | if (f1 < 0) f1 = 0.0f; | 195 | t_hlshelf *x = (t_hlshelf *)pd_new(hlshelf_class); |
196 | if (f2 > SRATE) f2 = .5f*SRATE; | 196 | t_float k0 = atom_getfloat(at); |
197 | 197 | t_float k1 = atom_getfloat(at+1); | |
198 | x->s_rate = SRATE; /* srate default */ | 198 | t_float k2 = atom_getfloat(at+2); |
199 | x->s_gain0 = k0; | 199 | t_float f1 = atom_getfloat(at+3); |
200 | x->s_gain1 = k1; | 200 | t_float f2 = atom_getfloat(at+4); |
201 | x->s_gain2 = k2; | 201 | |
202 | 202 | ||
203 | x->s_ltransfq = 0.0f; | 203 | f1 = atom_getfloat(at); |
204 | x->s_htransfq = SRATE/2; | 204 | f2 = atom_getfloat(at); |
205 | 205 | ||
206 | x->s_lradians = M_PI * x->s_ltransfq / x->s_rate; | 206 | if ((f1 == 0.0f && f2 == 0.0f) || f1 > f2){ /* all gains = 0db */ |
207 | x->s_hradians= M_PI * (0.5f - (x->s_htransfq / x->s_rate)); | 207 | f1 = 150.0f; |
208 | 208 | f2 = 5000.0f; | |
209 | floatinlet_new(&x->x_obj, &x->s_gain1); | 209 | } |
210 | floatinlet_new(&x->x_obj, &x->s_gain2); | 210 | |
211 | floatinlet_new(&x->x_obj, &x->s_ltransfq); | 211 | if (f1 < 0) f1 = 0.0f; |
212 | floatinlet_new(&x->x_obj, &x->s_htransfq); | 212 | if (f2 > SRATE) f2 = .5f*SRATE; |
213 | outlet_new(&x->x_obj, &s_list); | 213 | |
214 | 214 | x->s_rate = SRATE; /* srate default */ | |
215 | return (x); | 215 | x->s_gain0 = k0; |
216 | } | 216 | x->s_gain1 = k1; |
217 | 217 | x->s_gain2 = k2; | |
218 | void hlshelf_setup(void) | 218 | |
219 | { | 219 | x->s_ltransfq = 0.0f; |
220 | hlshelf_class = class_new(gensym("hlshelf"), (t_newmethod)hlshelf_new, 0, | 220 | x->s_htransfq = SRATE/2; |
221 | sizeof(t_hlshelf), 0, A_GIMME, 0); | 221 | |
222 | class_addbang(hlshelf_class,hlshelf_bang); | 222 | x->s_lradians = M_PI * x->s_ltransfq / x->s_rate; |
223 | class_addfloat(hlshelf_class,hlshelf_float); | 223 | x->s_hradians= M_PI * (0.5f - (x->s_htransfq / x->s_rate)); |
224 | } | 224 | |
225 | 225 | floatinlet_new(&x->x_obj, &x->s_gain1); | |
226 | floatinlet_new(&x->x_obj, &x->s_gain2); | ||
227 | floatinlet_new(&x->x_obj, &x->s_ltransfq); | ||
228 | floatinlet_new(&x->x_obj, &x->s_htransfq); | ||
229 | outlet_new(&x->x_obj, &s_list); | ||
230 | |||
231 | return (x); | ||
232 | } | ||
233 | |||
234 | void hlshelf_setup(void) | ||
235 | { | ||
236 | hlshelf_class = class_new(gensym("hlshelf"), (t_newmethod)hlshelf_new, 0, | ||
237 | sizeof(t_hlshelf), 0, A_GIMME, 0); | ||
238 | class_addbang(hlshelf_class,hlshelf_bang); | ||
239 | class_addfloat(hlshelf_class,hlshelf_float); | ||
240 | } | ||
241 | |||
226 | 242 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/image.c b/apps/plugins/pdbox/PDa/extra/image.c index 946a363986..7f55a01a87 100644 --- a/apps/plugins/pdbox/PDa/extra/image.c +++ b/apps/plugins/pdbox/PDa/extra/image.c | |||
@@ -23,6 +23,11 @@ typedef struct _image | |||
23 | 23 | ||
24 | void image_drawme(t_image *x, t_glist *glist, int firsttime) | 24 | void image_drawme(t_image *x, t_glist *glist, int firsttime) |
25 | { | 25 | { |
26 | #ifdef ROCKBOX | ||
27 | (void) x; | ||
28 | (void) glist; | ||
29 | (void) firsttime; | ||
30 | #else /* ROCKBOX */ | ||
26 | if (firsttime) { | 31 | if (firsttime) { |
27 | char fname[MAXPDSTRING]; | 32 | char fname[MAXPDSTRING]; |
28 | canvas_makefilename(glist_getcanvas(x->x_glist), x->x_fname->s_name, | 33 | canvas_makefilename(glist_getcanvas(x->x_glist), x->x_fname->s_name, |
@@ -42,16 +47,20 @@ void image_drawme(t_image *x, t_glist *glist, int firsttime) | |||
42 | glist_getcanvas(glist), x, | 47 | glist_getcanvas(glist), x, |
43 | text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); | 48 | text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); |
44 | } | 49 | } |
45 | 50 | #endif /* ROCKBOX */ | |
46 | } | 51 | } |
47 | 52 | ||
48 | 53 | ||
49 | void image_erase(t_image* x,t_glist* glist) | 54 | void image_erase(t_image* x,t_glist* glist) |
50 | { | 55 | { |
56 | #ifdef ROCKBOX | ||
57 | (void) x; | ||
58 | (void) glist; | ||
59 | #else /* ROCKBOX */ | ||
51 | int n; | 60 | int n; |
52 | sys_vgui(".x%x.c delete %xS\n", | 61 | sys_vgui(".x%x.c delete %xS\n", |
53 | glist_getcanvas(glist), x); | 62 | glist_getcanvas(glist), x); |
54 | 63 | #endif /* ROCKBOX */ | |
55 | } | 64 | } |
56 | 65 | ||
57 | 66 | ||
@@ -80,17 +89,23 @@ static void image_displace(t_gobj *z, t_glist *glist, | |||
80 | t_image *x = (t_image *)z; | 89 | t_image *x = (t_image *)z; |
81 | x->x_obj.te_xpix += dx; | 90 | x->x_obj.te_xpix += dx; |
82 | x->x_obj.te_ypix += dy; | 91 | x->x_obj.te_ypix += dy; |
92 | #ifndef ROCKBOX | ||
83 | sys_vgui(".x%x.c coords %xSEL %d %d %d %d\n", | 93 | sys_vgui(".x%x.c coords %xSEL %d %d %d %d\n", |
84 | glist_getcanvas(glist), x, | 94 | glist_getcanvas(glist), x, |
85 | text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist), | 95 | text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist), |
86 | text_xpix(&x->x_obj, glist) + x->x_width, text_ypix(&x->x_obj, glist) + x->x_height); | 96 | text_xpix(&x->x_obj, glist) + x->x_width, text_ypix(&x->x_obj, glist) + x->x_height); |
87 | 97 | #endif | |
88 | image_drawme(x, glist, 0); | 98 | image_drawme(x, glist, 0); |
89 | canvas_fixlinesfor(glist_getcanvas(glist),(t_text*) x); | 99 | canvas_fixlinesfor(glist_getcanvas(glist),(t_text*) x); |
90 | } | 100 | } |
91 | 101 | ||
92 | static void image_select(t_gobj *z, t_glist *glist, int state) | 102 | static void image_select(t_gobj *z, t_glist *glist, int state) |
93 | { | 103 | { |
104 | #ifdef ROCKBOX | ||
105 | (void) z; | ||
106 | (void) glist; | ||
107 | (void) state; | ||
108 | #else /* ROCKBOX */ | ||
94 | t_image *x = (t_image *)z; | 109 | t_image *x = (t_image *)z; |
95 | if (state) { | 110 | if (state) { |
96 | sys_vgui(".x%x.c create rectangle \ | 111 | sys_vgui(".x%x.c create rectangle \ |
@@ -104,14 +119,17 @@ static void image_select(t_gobj *z, t_glist *glist, int state) | |||
104 | sys_vgui(".x%x.c delete %xSEL\n", | 119 | sys_vgui(".x%x.c delete %xSEL\n", |
105 | glist_getcanvas(glist), x); | 120 | glist_getcanvas(glist), x); |
106 | } | 121 | } |
107 | 122 | #endif /* ROCKBOX */ | |
108 | |||
109 | |||
110 | } | 123 | } |
111 | 124 | ||
112 | 125 | ||
113 | static void image_activate(t_gobj *z, t_glist *glist, int state) | 126 | static void image_activate(t_gobj *z, t_glist *glist, int state) |
114 | { | 127 | { |
128 | #ifdef ROCKBOX | ||
129 | (void) z; | ||
130 | (void) glist; | ||
131 | (void) state; | ||
132 | #endif | ||
115 | /* t_text *x = (t_text *)z; | 133 | /* t_text *x = (t_text *)z; |
116 | t_rtext *y = glist_findrtext(glist, x); | 134 | t_rtext *y = glist_findrtext(glist, x); |
117 | if (z->g_pd != gatom_class) rtext_activate(y, state);*/ | 135 | if (z->g_pd != gatom_class) rtext_activate(y, state);*/ |
@@ -154,6 +172,10 @@ void image_size(t_image* x,t_floatarg w,t_floatarg h) { | |||
154 | 172 | ||
155 | void image_color(t_image* x,t_symbol* col) | 173 | void image_color(t_image* x,t_symbol* col) |
156 | { | 174 | { |
175 | #ifdef ROCKBOX | ||
176 | (void) x; | ||
177 | (void) col; | ||
178 | #endif | ||
157 | /* outlet_bang(x->x_obj.ob_outlet); only bang if there was a bang .. | 179 | /* outlet_bang(x->x_obj.ob_outlet); only bang if there was a bang .. |
158 | so color black does the same as bang, but doesn't forward the bang | 180 | so color black does the same as bang, but doesn't forward the bang |
159 | */ | 181 | */ |
@@ -167,11 +189,11 @@ static void image_setwidget(void) | |||
167 | image_widgetbehavior.w_activatefn = image_activate; | 189 | image_widgetbehavior.w_activatefn = image_activate; |
168 | image_widgetbehavior.w_deletefn = image_delete; | 190 | image_widgetbehavior.w_deletefn = image_delete; |
169 | image_widgetbehavior.w_visfn = image_vis; | 191 | image_widgetbehavior.w_visfn = image_vis; |
170 | #if (PD_VERSION_MINOR > 31) | 192 | #if defined(PD_VERSION_MINOR) && (PD_VERSION_MINOR > 31) |
171 | image_widgetbehavior.w_clickfn = NULL; | 193 | image_widgetbehavior.w_clickfn = NULL; |
172 | image_widgetbehavior.w_propertiesfn = NULL; | 194 | image_widgetbehavior.w_propertiesfn = NULL; |
173 | #endif | 195 | #endif |
174 | #if PD_MINOR_VERSION < 37 | 196 | #if defined(PD_VERSION_MINOR) && PD_MINOR_VERSION < 37 |
175 | image_widgetbehavior.w_savefn = image_save; | 197 | image_widgetbehavior.w_savefn = image_save; |
176 | #endif | 198 | #endif |
177 | } | 199 | } |
diff --git a/apps/plugins/pdbox/PDa/extra/lowpass.c b/apps/plugins/pdbox/PDa/extra/lowpass.c index 251b7175f3..18de4afe8b 100644 --- a/apps/plugins/pdbox/PDa/extra/lowpass.c +++ b/apps/plugins/pdbox/PDa/extra/lowpass.c | |||
@@ -1,87 +1,94 @@ | |||
1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ | 1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ |
2 | 2 | ||
3 | 3 | ||
4 | /* | 4 | /* |
5 | 5 | ||
6 | These filter coefficients computations are taken from | 6 | These filter coefficients computations are taken from |
7 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt | 7 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt |
8 | 8 | ||
9 | written by Robert Bristow-Johnson | 9 | written by Robert Bristow-Johnson |
10 | 10 | ||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include "m_pd.h" | 13 | #ifdef ROCKBOX |
14 | #ifdef NT | 14 | #include "plugin.h" |
15 | #pragma warning( disable : 4244 ) | 15 | #include "pdbox.h" |
16 | #pragma warning( disable : 4305 ) | 16 | #include "m_pd.h" |
17 | #endif | 17 | #include "math.h" |
18 | #include <math.h> | 18 | #include "filters.h" |
19 | #include "filters.h" | 19 | #else /* ROCKBOX */ |
20 | 20 | #include "m_pd.h" | |
21 | 21 | #ifdef NT | |
22 | 22 | #pragma warning( disable : 4244 ) | |
23 | /* ------------------- lowpass ----------------------------*/ | 23 | #pragma warning( disable : 4305 ) |
24 | 24 | #endif | |
25 | static t_class *lowpass_class; | 25 | #include <math.h> |
26 | 26 | #include "filters.h" | |
27 | void lowpass_bang(t_rbjfilter *x) | 27 | #endif /* ROCKBOX */ |
28 | { | 28 | |
29 | t_atom at[5]; | 29 | |
30 | t_float omega = e_omega(x->x_freq,x->x_rate); | 30 | /* ------------------- lowpass ----------------------------*/ |
31 | t_float alpha = e_alpha(x->x_bw*0.01,omega); | 31 | |
32 | t_float b1 = 1 - cos(omega); | 32 | static t_class *lowpass_class; |
33 | t_float b0 = b1/2.; | 33 | |
34 | t_float b2 = b0; | 34 | void lowpass_bang(t_rbjfilter *x) |
35 | t_float a0 = 1 + alpha; | 35 | { |
36 | t_float a1 = -2.*cos(omega); | 36 | t_atom at[5]; |
37 | t_float a2 = 1 - alpha; | 37 | t_float omega = e_omega(x->x_freq,x->x_rate); |
38 | 38 | t_float alpha = e_alpha(x->x_bw*0.01,omega); | |
39 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw); */ | 39 | t_float b1 = 1 - cos(omega); |
40 | 40 | t_float b0 = b1/2.; | |
41 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { | 41 | t_float b2 = b0; |
42 | post("lowpass: filter unstable -> resetting"); | 42 | t_float a0 = 1 + alpha; |
43 | a0=1.;a1=0.;a2=0.; | 43 | t_float a1 = -2.*cos(omega); |
44 | b0=1.;b1=0.;b2=0.; | 44 | t_float a2 = 1 - alpha; |
45 | } | 45 | |
46 | 46 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw); */ | |
47 | SETFLOAT(at,-a1/a0); | 47 | |
48 | SETFLOAT(at+1,-a2/a0); | 48 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { |
49 | SETFLOAT(at+2,b0/a0); | 49 | post("lowpass: filter unstable -> resetting"); |
50 | SETFLOAT(at+3,b1/a0); | 50 | a0=1.;a1=0.;a2=0.; |
51 | SETFLOAT(at+4,b2/a0); | 51 | b0=1.;b1=0.;b2=0.; |
52 | 52 | } | |
53 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); | 53 | |
54 | } | 54 | SETFLOAT(at,-a1/a0); |
55 | 55 | SETFLOAT(at+1,-a2/a0); | |
56 | 56 | SETFLOAT(at+2,b0/a0); | |
57 | void lowpass_float(t_rbjfilter *x,t_floatarg f) | 57 | SETFLOAT(at+3,b1/a0); |
58 | { | 58 | SETFLOAT(at+4,b2/a0); |
59 | x->x_freq = f; | 59 | |
60 | lowpass_bang(x); | 60 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); |
61 | } | 61 | } |
62 | 62 | ||
63 | 63 | ||
64 | static void *lowpass_new(t_floatarg f,t_floatarg bw) | 64 | void lowpass_float(t_rbjfilter *x,t_floatarg f) |
65 | { | 65 | { |
66 | t_rbjfilter *x = (t_rbjfilter *)pd_new(lowpass_class); | 66 | x->x_freq = f; |
67 | 67 | lowpass_bang(x); | |
68 | x->x_rate = 44100.0; | 68 | } |
69 | outlet_new(&x->x_obj,&s_float); | 69 | |
70 | /* floatinlet_new(&x->x_obj, &x->x_gain); */ | 70 | |
71 | floatinlet_new(&x->x_obj, &x->x_bw); | 71 | static void *lowpass_new(t_floatarg f,t_floatarg bw) |
72 | 72 | { | |
73 | if (f > 0.) x->x_freq = f; | 73 | t_rbjfilter *x = (t_rbjfilter *)pd_new(lowpass_class); |
74 | if (bw > 0.) x->x_bw = bw; | 74 | |
75 | return (x); | 75 | x->x_rate = 44100.0; |
76 | } | 76 | outlet_new(&x->x_obj,&s_float); |
77 | 77 | /* floatinlet_new(&x->x_obj, &x->x_gain); */ | |
78 | 78 | floatinlet_new(&x->x_obj, &x->x_bw); | |
79 | void lowpass_setup(void) | 79 | |
80 | { | 80 | if (f > 0.) x->x_freq = f; |
81 | lowpass_class = class_new(gensym("lowpass"), (t_newmethod)lowpass_new, 0, | 81 | if (bw > 0.) x->x_bw = bw; |
82 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,0); | 82 | return (x); |
83 | class_addbang(lowpass_class,lowpass_bang); | 83 | } |
84 | class_addfloat(lowpass_class,lowpass_float); | 84 | |
85 | } | 85 | |
86 | 86 | void lowpass_setup(void) | |
87 | { | ||
88 | lowpass_class = class_new(gensym("lowpass"), (t_newmethod)lowpass_new, 0, | ||
89 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,0); | ||
90 | class_addbang(lowpass_class,lowpass_bang); | ||
91 | class_addfloat(lowpass_class,lowpass_float); | ||
92 | } | ||
93 | |||
87 | 94 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/lowshelf.c b/apps/plugins/pdbox/PDa/extra/lowshelf.c index ba32b6dba8..77086badb7 100644 --- a/apps/plugins/pdbox/PDa/extra/lowshelf.c +++ b/apps/plugins/pdbox/PDa/extra/lowshelf.c | |||
@@ -1,91 +1,98 @@ | |||
1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ | 1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ |
2 | 2 | ||
3 | 3 | ||
4 | /* | 4 | /* |
5 | 5 | ||
6 | These filter coefficients computations are taken from | 6 | These filter coefficients computations are taken from |
7 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt | 7 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt |
8 | 8 | ||
9 | written by Robert Bristow-Johnson | 9 | written by Robert Bristow-Johnson |
10 | 10 | ||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include "m_pd.h" | 13 | #ifdef ROCKBOX |
14 | #ifdef NT | 14 | #include "plugin.h" |
15 | #pragma warning( disable : 4244 ) | 15 | #include "pdbox.h" |
16 | #pragma warning( disable : 4305 ) | 16 | #include "m_pd.h" |
17 | #endif | 17 | #include "math.h" |
18 | #include <math.h> | 18 | #include "filters.h" |
19 | #include "filters.h" | 19 | #else /* ROCKBOX */ |
20 | 20 | #include "m_pd.h" | |
21 | 21 | #ifdef NT | |
22 | 22 | #pragma warning( disable : 4244 ) | |
23 | /* ------------------- lowshelf ----------------------------*/ | 23 | #pragma warning( disable : 4305 ) |
24 | 24 | #endif | |
25 | static t_class *lowshelf_class; | 25 | #include <math.h> |
26 | 26 | #include "filters.h" | |
27 | void lowshelf_bang(t_rbjfilter *x) | 27 | #endif /* ROCKBOX */ |
28 | { | 28 | |
29 | t_atom at[5]; | 29 | |
30 | t_float omega = e_omega(x->x_freq,x->x_rate); | 30 | /* ------------------- lowshelf ----------------------------*/ |
31 | t_float A = e_A(x->x_gain); | 31 | |
32 | t_float cs = cos(omega); | 32 | static t_class *lowshelf_class; |
33 | t_float sn = sin(omega); | 33 | |
34 | t_float beta = e_beta(A,x->x_bw*0.01); | 34 | void lowshelf_bang(t_rbjfilter *x) |
35 | 35 | { | |
36 | t_float b0 = A*((A+1) - (A-1)*cs + beta*sn); | 36 | t_atom at[5]; |
37 | t_float b1 = 2.*A*((A-1) - (A+1)*cs); | 37 | t_float omega = e_omega(x->x_freq,x->x_rate); |
38 | t_float b2 = A*((A+1) - (A-1)*cs - beta*sn); | 38 | t_float A = e_A(x->x_gain); |
39 | t_float a0 = ((A+1) + (A-1)*cs + beta*sn); | 39 | t_float cs = cos(omega); |
40 | t_float a1 = -2.*((A-1) + (A+1)*cs); | 40 | t_float sn = sin(omega); |
41 | t_float a2 = ((A+1) + (A-1)*cs - beta*sn); | 41 | t_float beta = e_beta(A,x->x_bw*0.01); |
42 | 42 | ||
43 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw); */ | 43 | t_float b0 = A*((A+1) - (A-1)*cs + beta*sn); |
44 | 44 | t_float b1 = 2.*A*((A-1) - (A+1)*cs); | |
45 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { | 45 | t_float b2 = A*((A+1) - (A-1)*cs - beta*sn); |
46 | post("lowshelf: filter unstable -> resetting"); | 46 | t_float a0 = ((A+1) + (A-1)*cs + beta*sn); |
47 | a0=1.;a1=0.;a2=0.; | 47 | t_float a1 = -2.*((A-1) + (A+1)*cs); |
48 | b0=1.;b1=0.;b2=0.; | 48 | t_float a2 = ((A+1) + (A-1)*cs - beta*sn); |
49 | } | 49 | |
50 | 50 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw); */ | |
51 | SETFLOAT(at,-a1/a0); | 51 | |
52 | SETFLOAT(at+1,-a2/a0); | 52 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { |
53 | SETFLOAT(at+2,b0/a0); | 53 | post("lowshelf: filter unstable -> resetting"); |
54 | SETFLOAT(at+3,b1/a0); | 54 | a0=1.;a1=0.;a2=0.; |
55 | SETFLOAT(at+4,b2/a0); | 55 | b0=1.;b1=0.;b2=0.; |
56 | 56 | } | |
57 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); | 57 | |
58 | } | 58 | SETFLOAT(at,-a1/a0); |
59 | 59 | SETFLOAT(at+1,-a2/a0); | |
60 | 60 | SETFLOAT(at+2,b0/a0); | |
61 | void lowshelf_float(t_rbjfilter *x,t_floatarg f) | 61 | SETFLOAT(at+3,b1/a0); |
62 | { | 62 | SETFLOAT(at+4,b2/a0); |
63 | x->x_freq = f; | 63 | |
64 | lowshelf_bang(x); | 64 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); |
65 | } | 65 | } |
66 | 66 | ||
67 | 67 | ||
68 | static void *lowshelf_new(t_floatarg f,t_floatarg g,t_floatarg bw) | 68 | void lowshelf_float(t_rbjfilter *x,t_floatarg f) |
69 | { | 69 | { |
70 | t_rbjfilter *x = (t_rbjfilter *)pd_new(lowshelf_class); | 70 | x->x_freq = f; |
71 | 71 | lowshelf_bang(x); | |
72 | x->x_rate = 44100.0; | 72 | } |
73 | outlet_new(&x->x_obj,&s_float); | 73 | |
74 | floatinlet_new(&x->x_obj, &x->x_gain); | 74 | |
75 | floatinlet_new(&x->x_obj, &x->x_bw); | 75 | static void *lowshelf_new(t_floatarg f,t_floatarg g,t_floatarg bw) |
76 | if (f > 0.) x->x_freq = f; | 76 | { |
77 | if (bw > 0.) x->x_bw = bw; | 77 | t_rbjfilter *x = (t_rbjfilter *)pd_new(lowshelf_class); |
78 | if (g != 0.) x->x_gain = g; | 78 | |
79 | return (x); | 79 | x->x_rate = 44100.0; |
80 | } | 80 | outlet_new(&x->x_obj,&s_float); |
81 | 81 | floatinlet_new(&x->x_obj, &x->x_gain); | |
82 | 82 | floatinlet_new(&x->x_obj, &x->x_bw); | |
83 | void lowshelf_setup(void) | 83 | if (f > 0.) x->x_freq = f; |
84 | { | 84 | if (bw > 0.) x->x_bw = bw; |
85 | lowshelf_class = class_new(gensym("lowshelf"), (t_newmethod)lowshelf_new, 0, | 85 | if (g != 0.) x->x_gain = g; |
86 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,A_DEFFLOAT,0); | 86 | return (x); |
87 | class_addbang(lowshelf_class,lowshelf_bang); | 87 | } |
88 | class_addfloat(lowshelf_class,lowshelf_float); | 88 | |
89 | } | 89 | |
90 | 90 | void lowshelf_setup(void) | |
91 | { | ||
92 | lowshelf_class = class_new(gensym("lowshelf"), (t_newmethod)lowshelf_new, 0, | ||
93 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,A_DEFFLOAT,0); | ||
94 | class_addbang(lowshelf_class,lowshelf_bang); | ||
95 | class_addfloat(lowshelf_class,lowshelf_float); | ||
96 | } | ||
97 | |||
91 | 98 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/moog~.c b/apps/plugins/pdbox/PDa/extra/moog~.c index 48d4dfe932..29525db2ef 100644 --- a/apps/plugins/pdbox/PDa/extra/moog~.c +++ b/apps/plugins/pdbox/PDa/extra/moog~.c | |||
@@ -1,184 +1,194 @@ | |||
1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ | 1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ |
2 | 2 | ||
3 | 3 | ||
4 | #include "math.h" | 4 | #include "math.h" |
5 | #include <m_pd.h> | 5 | #ifdef ROCKBOX |
6 | 6 | #include "m_pd.h" | |
7 | /* ----------------------------- moog ----------------------------- */ | 7 | #else |
8 | static t_class *moog_class; | 8 | #include <m_pd.h> |
9 | 9 | #endif | |
10 | 10 | ||
11 | typedef struct _moog | 11 | /* ----------------------------- moog ----------------------------- */ |
12 | { | 12 | static t_class *moog_class; |
13 | t_object x_obj; | 13 | |
14 | t_pd in2; | 14 | |
15 | t_sample x_1,x_2,x_3,x_4; | 15 | typedef struct _moog |
16 | t_sample y_1,y_2,y_3,y_4; | 16 | { |
17 | } t_moog; | 17 | t_object x_obj; |
18 | 18 | t_pd in2; | |
19 | static void moog_reset(t_moog *x) | 19 | t_sample x_1,x_2,x_3,x_4; |
20 | { | 20 | t_sample y_1,y_2,y_3,y_4; |
21 | x->x_1 = x->x_2 = x->x_3 = x->x_4 = 0; | 21 | } t_moog; |
22 | x->y_1 = x->y_2 = x->y_3 = x->y_4 = 0; | 22 | |
23 | 23 | static void moog_reset(t_moog *x) | |
24 | } | 24 | { |
25 | 25 | x->x_1 = x->x_2 = x->x_3 = x->x_4 = 0; | |
26 | 26 | x->y_1 = x->y_2 = x->y_3 = x->y_4 = 0; | |
27 | 27 | ||
28 | static void *moog_new(t_symbol *s, int argc, t_atom *argv) | 28 | } |
29 | { | 29 | |
30 | if (argc > 1) post("moog~: extra arguments ignored"); | 30 | |
31 | { | 31 | |
32 | t_moog *x = (t_moog *)pd_new(moog_class); | 32 | static void *moog_new(t_symbol *s, int argc, t_atom *argv) |
33 | outlet_new(&x->x_obj, &s_signal); | 33 | { |
34 | inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal); | 34 | #ifdef ROCKBOX |
35 | inlet_new(&x->x_obj, &x->in2, &s_signal, &s_signal); | 35 | (void) s; |
36 | moog_reset(x); | 36 | (void) argv; |
37 | return (x); | 37 | #endif |
38 | } | 38 | if (argc > 1) post("moog~: extra arguments ignored"); |
39 | 39 | { | |
40 | 40 | t_moog *x = (t_moog *)pd_new(moog_class); | |
41 | } | 41 | outlet_new(&x->x_obj, &s_signal); |
42 | 42 | inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal); | |
43 | 43 | inlet_new(&x->x_obj, &x->in2, &s_signal, &s_signal); | |
44 | 44 | moog_reset(x); | |
45 | static t_sample calc_k(t_sample f,t_sample k) { | 45 | return (x); |
46 | if (k>itofix(4)) k = itofix(4); | 46 | } |
47 | if (k < 0) k = 0; | 47 | |
48 | if (f <= itofix(3800)) return k; | 48 | |
49 | k = k - mult(0.5,(f-idiv(itofix(3800),itofix(4300)))); | 49 | } |
50 | return k; | 50 | |
51 | } | 51 | |
52 | 52 | ||
53 | t_int *moog_perform(t_int *w) | 53 | static t_sample calc_k(t_sample f,t_sample k) { |
54 | { | 54 | if (k>itofix(4)) k = itofix(4); |
55 | t_moog* x = (t_moog*) (w[1]); | 55 | if (k < 0) k = 0; |
56 | t_sample *in1 = (t_sample *)(w[2]); | 56 | if (f <= itofix(3800)) return k; |
57 | t_sample *p = (t_sample *)(w[3]); | 57 | k = k - mult(0.5,(f-idiv(itofix(3800),itofix(4300)))); |
58 | t_sample *k = (t_sample *)(w[4]); | 58 | return k; |
59 | 59 | } | |
60 | t_sample *out = (t_sample *)(w[5]); | 60 | |
61 | int n = (int)(w[6]); | 61 | t_int *moog_perform(t_int *w) |
62 | t_sample in; | 62 | { |
63 | t_sample pt,pt1; | 63 | t_moog* x = (t_moog*) (w[1]); |
64 | 64 | t_sample *in1 = (t_sample *)(w[2]); | |
65 | t_sample x1 = x->x_1; | 65 | t_sample *p = (t_sample *)(w[3]); |
66 | t_sample x2 = x->x_2; | 66 | t_sample *k = (t_sample *)(w[4]); |
67 | t_sample x3 = x->x_3; | 67 | |
68 | t_sample x4 = x->x_4; | 68 | t_sample *out = (t_sample *)(w[5]); |
69 | t_sample ys1 = x->y_1; | 69 | int n = (int)(w[6]); |
70 | t_sample ys2 = x->y_2; | 70 | t_sample in; |
71 | t_sample ys3 = x->y_3; | 71 | t_sample pt,pt1; |
72 | t_sample ys4 = x->y_4; | 72 | |
73 | 73 | t_sample x1 = x->x_1; | |
74 | 74 | t_sample x2 = x->x_2; | |
75 | while (n--) { | 75 | t_sample x3 = x->x_3; |
76 | if (*p > itofix(8140)) *p = itofix(8140); | 76 | t_sample x4 = x->x_4; |
77 | *k = calc_k(*p,*k); | 77 | t_sample ys1 = x->y_1; |
78 | pt =*p; | 78 | t_sample ys2 = x->y_2; |
79 | pt1=mult((pt+1),ftofix(0.76923077)); | 79 | t_sample ys3 = x->y_3; |
80 | in = *in1++ - mult(*k,ys4); | 80 | t_sample ys4 = x->y_4; |
81 | ys1 = mult(pt1,in) + mult(0.3,x1) - mult(pt,ys1); | 81 | |
82 | x1 = in; | 82 | |
83 | ys2 = mult(pt1,ys1) + mult(0.3,x2) - mult(pt,ys2); | 83 | while (n--) { |
84 | x2 = ys1; | 84 | if (*p > itofix(8140)) *p = itofix(8140); |
85 | ys3 = mult(pt1,ys2) + mult(0.3,x3) - mult(pt,ys3); | 85 | *k = calc_k(*p,*k); |
86 | x3 = ys2; | 86 | pt =*p; |
87 | ys4 = mult(pt1,ys3) + mult(0.3,x4) - mult(pt,ys4); | 87 | pt1=mult((pt+1),ftofix(0.76923077)); |
88 | x4 = ys3; | 88 | in = *in1++ - mult(*k,ys4); |
89 | *out++ = ys4; | 89 | ys1 = mult(pt1,in) + mult(0.3,x1) - mult(pt,ys1); |
90 | } | 90 | x1 = in; |
91 | 91 | ys2 = mult(pt1,ys1) + mult(0.3,x2) - mult(pt,ys2); | |
92 | 92 | x2 = ys1; | |
93 | x->y_1 = ys1; | 93 | ys3 = mult(pt1,ys2) + mult(0.3,x3) - mult(pt,ys3); |
94 | x->y_2 = ys2; | 94 | x3 = ys2; |
95 | x->y_3 = ys3; | 95 | ys4 = mult(pt1,ys3) + mult(0.3,x4) - mult(pt,ys4); |
96 | x->y_4 = ys4; | 96 | x4 = ys3; |
97 | x->x_1 = x1; | 97 | *out++ = ys4; |
98 | x->x_2 = x2; | 98 | } |
99 | x->x_3 = x3; | 99 | |
100 | x->x_4 = x4; | 100 | |
101 | 101 | x->y_1 = ys1; | |
102 | return (w+7); | 102 | x->y_2 = ys2; |
103 | } | 103 | x->y_3 = ys3; |
104 | 104 | x->y_4 = ys4; | |
105 | 105 | x->x_1 = x1; | |
106 | #define CLIP(x) x = ((x) > 1.0 ? (1.0) : (x)) | 106 | x->x_2 = x2; |
107 | 107 | x->x_3 = x3; | |
108 | t_int *moog_perf8(t_int *w) | 108 | x->x_4 = x4; |
109 | { | 109 | |
110 | t_moog* x = (t_moog*) (w[1]); | 110 | return (w+7); |
111 | t_sample *in1 = (t_sample *)(w[2]); | 111 | } |
112 | t_sample *p = (t_sample *)(w[3]); | 112 | |
113 | t_sample *k = (t_sample *)(w[4]); | 113 | |
114 | t_sample *out = (t_sample *)(w[5]); | 114 | #define CLIP(x) x = ((x) > 1.0 ? (1.0) : (x)) |
115 | int n = (int)(w[6]); | 115 | |
116 | 116 | t_int *moog_perf8(t_int *w) | |
117 | t_sample x1 = x->x_1; | 117 | { |
118 | t_sample x2 = x->x_2; | 118 | t_moog* x = (t_moog*) (w[1]); |
119 | t_sample x3 = x->x_3; | 119 | t_sample *in1 = (t_sample *)(w[2]); |
120 | t_sample x4 = x->x_4; | 120 | t_sample *p = (t_sample *)(w[3]); |
121 | t_sample ys1 = x->y_1; | 121 | t_sample *k = (t_sample *)(w[4]); |
122 | t_sample ys2 = x->y_2; | 122 | t_sample *out = (t_sample *)(w[5]); |
123 | t_sample ys3 = x->y_3; | 123 | int n = (int)(w[6]); |
124 | t_sample ys4 = x->y_4; | 124 | |
125 | 125 | t_sample x1 = x->x_1; | |
126 | t_sample temp,temp2; | 126 | t_sample x2 = x->x_2; |
127 | t_sample pt,pt1; | 127 | t_sample x3 = x->x_3; |
128 | t_sample in; | 128 | t_sample x4 = x->x_4; |
129 | 129 | t_sample ys1 = x->y_1; | |
130 | while (n--) { | 130 | t_sample ys2 = x->y_2; |
131 | if (*p > itofix(8140)) *p = itofix(8140); | 131 | t_sample ys3 = x->y_3; |
132 | *k = calc_k(*p,*k); | 132 | t_sample ys4 = x->y_4; |
133 | 133 | ||
134 | pt =mult(*p, ftofix(0.01*0.0140845)) - ftofix(0.9999999f); | 134 | #ifndef ROCKBOX |
135 | pt1=mult((pt+itofix(1)),ftofix(0.76923077)); | 135 | t_sample temp,temp2; |
136 | in = *in1++ - mult(*k,ys4); | 136 | #endif |
137 | ys1 = mult(pt1,(in + mult(ftofix(0.3),x1))) - mult(pt,ys1); | 137 | t_sample pt,pt1; |
138 | x1 = in; | 138 | t_sample in; |
139 | ys2 = mult(pt1,(ys1 + mult(0.3,x2))) - mult(pt,ys2); | 139 | |
140 | x2 = ys1; | 140 | while (n--) { |
141 | ys3 = mult(pt1,(ys2 + mult(0.3,x3))) - mult(pt,ys3); | 141 | if (*p > itofix(8140)) *p = itofix(8140); |
142 | x3 = ys2; | 142 | *k = calc_k(*p,*k); |
143 | ys4 = mult(pt1,(ys3 + mult(0.3,x4))) - mult(pt,ys4); | 143 | |
144 | x4 = ys3; | 144 | pt =mult(*p, ftofix(0.01*0.0140845)) - ftofix(0.9999999f); |
145 | *out++ = ys4; | 145 | pt1=mult((pt+itofix(1)),ftofix(0.76923077)); |
146 | 146 | in = *in1++ - mult(*k,ys4); | |
147 | p++;k++; | 147 | ys1 = mult(pt1,(in + mult(ftofix(0.3),x1))) - mult(pt,ys1); |
148 | } | 148 | x1 = in; |
149 | 149 | ys2 = mult(pt1,(ys1 + mult(0.3,x2))) - mult(pt,ys2); | |
150 | x->y_1 = ys1; | 150 | x2 = ys1; |
151 | x->y_2 = ys2; | 151 | ys3 = mult(pt1,(ys2 + mult(0.3,x3))) - mult(pt,ys3); |
152 | x->y_3 = ys3; | 152 | x3 = ys2; |
153 | x->y_4 = ys4; | 153 | ys4 = mult(pt1,(ys3 + mult(0.3,x4))) - mult(pt,ys4); |
154 | x->x_1 = x1; | 154 | x4 = ys3; |
155 | x->x_2 = x2; | 155 | *out++ = ys4; |
156 | x->x_3 = x3; | 156 | |
157 | x->x_4 = x4; | 157 | p++;k++; |
158 | 158 | } | |
159 | return (w+7); | 159 | |
160 | } | 160 | x->y_1 = ys1; |
161 | 161 | x->y_2 = ys2; | |
162 | void dsp_add_moog(t_moog *x, t_sample *in1, t_sample *in2, t_sample *in3, t_sample *out, int n) | 162 | x->y_3 = ys3; |
163 | { | 163 | x->y_4 = ys4; |
164 | if (n&7) | 164 | x->x_1 = x1; |
165 | dsp_add(moog_perform, 6,(t_int)x, in1,in2,in3, out, n); | 165 | x->x_2 = x2; |
166 | else | 166 | x->x_3 = x3; |
167 | dsp_add(moog_perf8, 6,(t_int) x, in1, in2, in3, out, n); | 167 | x->x_4 = x4; |
168 | } | 168 | |
169 | 169 | return (w+7); | |
170 | static void moog_dsp(t_moog *x, t_signal **sp) | 170 | } |
171 | { | 171 | |
172 | dsp_add_moog(x,sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec,sp[0]->s_n); | 172 | void dsp_add_moog(t_moog *x, t_sample *in1, t_sample *in2, t_sample *in3, t_sample *out, int n) |
173 | } | 173 | { |
174 | 174 | if (n&7) | |
175 | 175 | dsp_add(moog_perform, 6,(t_int)x, in1,in2,in3, out, n); | |
176 | void moog_tilde_setup(void) | 176 | else |
177 | { | 177 | dsp_add(moog_perf8, 6,(t_int) x, in1, in2, in3, out, n); |
178 | moog_class = class_new(gensym("moog~"), (t_newmethod)moog_new, 0, | 178 | } |
179 | sizeof(t_moog), 0, A_GIMME, 0); | 179 | |
180 | class_addmethod(moog_class, nullfn, gensym("signal"), 0); | 180 | static void moog_dsp(t_moog *x, t_signal **sp) |
181 | class_addmethod(moog_class, (t_method)moog_reset, gensym("reset"), 0); | 181 | { |
182 | class_addmethod(moog_class, (t_method)moog_dsp, gensym("dsp"), A_NULL); | 182 | dsp_add_moog(x,sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec,sp[0]->s_n); |
183 | } | 183 | } |
184 | |||
185 | |||
186 | void moog_tilde_setup(void) | ||
187 | { | ||
188 | moog_class = class_new(gensym("moog~"), (t_newmethod)moog_new, 0, | ||
189 | sizeof(t_moog), 0, A_GIMME, 0); | ||
190 | class_addmethod(moog_class, nullfn, gensym("signal"), 0); | ||
191 | class_addmethod(moog_class, (t_method)moog_reset, gensym("reset"), 0); | ||
192 | class_addmethod(moog_class, (t_method)moog_dsp, gensym("dsp"), A_NULL); | ||
193 | } | ||
184 | 194 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/notch.c b/apps/plugins/pdbox/PDa/extra/notch.c index 0ab4332166..44f029988c 100644 --- a/apps/plugins/pdbox/PDa/extra/notch.c +++ b/apps/plugins/pdbox/PDa/extra/notch.c | |||
@@ -1,85 +1,93 @@ | |||
1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ | 1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ |
2 | 2 | ||
3 | 3 | ||
4 | /* | 4 | /* |
5 | 5 | ||
6 | These filter coefficients computations are taken from | 6 | These filter coefficients computations are taken from |
7 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt | 7 | http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt |
8 | 8 | ||
9 | written by Robert Bristow-Johnson | 9 | written by Robert Bristow-Johnson |
10 | 10 | ||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include "m_pd.h" | 13 | #ifdef ROCKBOX |
14 | #ifdef NT | 14 | #include "plugin.h" |
15 | #pragma warning( disable : 4244 ) | 15 | #include "pdbox.h" |
16 | #pragma warning( disable : 4305 ) | 16 | #include "m_pd.h" |
17 | #endif | 17 | #include "math.h" |
18 | #include <math.h> | 18 | #include "filters.h" |
19 | #include "filters.h" | 19 | #else /* ROCKBOX */ |
20 | 20 | #include "m_pd.h" | |
21 | 21 | #ifdef NT | |
22 | 22 | #pragma warning( disable : 4244 ) | |
23 | /* ------------------- notch ----------------------------*/ | 23 | #pragma warning( disable : 4305 ) |
24 | 24 | #endif | |
25 | static t_class *notch_class; | 25 | #include <math.h> |
26 | 26 | #include "filters.h" | |
27 | void notch_bang(t_rbjfilter *x) | 27 | #endif /* ROCKBOX */ |
28 | { | 28 | |
29 | t_atom at[5]; | 29 | |
30 | t_float omega = e_omega(x->x_freq,x->x_rate); | 30 | |
31 | t_float alpha = e_alpha(x->x_bw* 0.01,omega); | 31 | /* ------------------- notch ----------------------------*/ |
32 | t_float b1 = -2.*cos(omega); | 32 | |
33 | t_float b0 = 1; | 33 | static t_class *notch_class; |
34 | t_float b2 = b0; | 34 | |
35 | t_float a0 = 1 + alpha; | 35 | void notch_bang(t_rbjfilter *x) |
36 | t_float a1 = -2.*cos(omega); | 36 | { |
37 | t_float a2 = 1 - alpha; | 37 | t_atom at[5]; |
38 | 38 | t_float omega = e_omega(x->x_freq,x->x_rate); | |
39 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw); */ | 39 | t_float alpha = e_alpha(x->x_bw* 0.01,omega); |
40 | 40 | t_float b1 = -2.*cos(omega); | |
41 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { | 41 | t_float b0 = 1; |
42 | post("notch: filter unstable -> resetting"); | 42 | t_float b2 = b0; |
43 | a0=1.;a1=0.;a2=0.; | 43 | t_float a0 = 1 + alpha; |
44 | b0=1.;b1=0.;b2=0.; | 44 | t_float a1 = -2.*cos(omega); |
45 | } | 45 | t_float a2 = 1 - alpha; |
46 | 46 | ||
47 | SETFLOAT(at,-a1/a0); | 47 | /* post("bang %f %f %f",x->x_freq, x->x_gain, x->x_bw); */ |
48 | SETFLOAT(at+1,-a2/a0); | 48 | |
49 | SETFLOAT(at+2,b0/a0); | 49 | if (!check_stability(-a1/a0,-a2/a0,b0/a0,b1/a0,b2/a0)) { |
50 | SETFLOAT(at+3,b1/a0); | 50 | post("notch: filter unstable -> resetting"); |
51 | SETFLOAT(at+4,b2/a0); | 51 | a0=1.;a1=0.;a2=0.; |
52 | 52 | b0=1.;b1=0.;b2=0.; | |
53 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); | 53 | } |
54 | } | 54 | |
55 | 55 | SETFLOAT(at,-a1/a0); | |
56 | 56 | SETFLOAT(at+1,-a2/a0); | |
57 | void notch_float(t_rbjfilter *x,t_floatarg f) | 57 | SETFLOAT(at+2,b0/a0); |
58 | { | 58 | SETFLOAT(at+3,b1/a0); |
59 | x->x_freq = f; | 59 | SETFLOAT(at+4,b2/a0); |
60 | notch_bang(x); | 60 | |
61 | } | 61 | outlet_list(x->x_obj.ob_outlet,&s_list,5,at); |
62 | 62 | } | |
63 | 63 | ||
64 | static void *notch_new(t_floatarg f,t_floatarg bw) | 64 | |
65 | { | 65 | void notch_float(t_rbjfilter *x,t_floatarg f) |
66 | t_rbjfilter *x = (t_rbjfilter *)pd_new(notch_class); | 66 | { |
67 | 67 | x->x_freq = f; | |
68 | x->x_rate = 44100.0; | 68 | notch_bang(x); |
69 | outlet_new(&x->x_obj,&s_float); | 69 | } |
70 | /* floatinlet_new(&x->x_obj, &x->x_gain); */ | 70 | |
71 | floatinlet_new(&x->x_obj, &x->x_bw); | 71 | |
72 | if (f > 0.) x->x_freq = f; | 72 | static void *notch_new(t_floatarg f,t_floatarg bw) |
73 | if (bw > 0.) x->x_bw = bw; | 73 | { |
74 | return (x); | 74 | t_rbjfilter *x = (t_rbjfilter *)pd_new(notch_class); |
75 | } | 75 | |
76 | 76 | x->x_rate = 44100.0; | |
77 | 77 | outlet_new(&x->x_obj,&s_float); | |
78 | void notch_setup(void) | 78 | /* floatinlet_new(&x->x_obj, &x->x_gain); */ |
79 | { | 79 | floatinlet_new(&x->x_obj, &x->x_bw); |
80 | notch_class = class_new(gensym("notch"), (t_newmethod)notch_new, 0, | 80 | if (f > 0.) x->x_freq = f; |
81 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,0); | 81 | if (bw > 0.) x->x_bw = bw; |
82 | class_addbang(notch_class,notch_bang); | 82 | return (x); |
83 | class_addfloat(notch_class,notch_float); | 83 | } |
84 | } | 84 | |
85 | |||
86 | void notch_setup(void) | ||
87 | { | ||
88 | notch_class = class_new(gensym("notch"), (t_newmethod)notch_new, 0, | ||
89 | sizeof(t_rbjfilter), 0,A_DEFFLOAT,A_DEFFLOAT,0); | ||
90 | class_addbang(notch_class,notch_bang); | ||
91 | class_addfloat(notch_class,notch_float); | ||
92 | } | ||
85 | 93 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/sendOSC.c b/apps/plugins/pdbox/PDa/extra/sendOSC.c index bc983cc31e..ac7ae37954 100644 --- a/apps/plugins/pdbox/PDa/extra/sendOSC.c +++ b/apps/plugins/pdbox/PDa/extra/sendOSC.c | |||
@@ -1,1461 +1,1461 @@ | |||
1 | /* | 1 | /* |
2 | Written by Matt Wright, The Center for New Music and Audio Technologies, | 2 | Written by Matt Wright, The Center for New Music and Audio Technologies, |
3 | University of California, Berkeley. Copyright (c) 1996,97,98,99,2000,01,02,03 | 3 | University of California, Berkeley. Copyright (c) 1996,97,98,99,2000,01,02,03 |
4 | The Regents of the University of California (Regents). | 4 | The Regents of the University of California (Regents). |
5 | 5 | ||
6 | Permission to use, copy, modify, distribute, and distribute modified versions | 6 | Permission to use, copy, modify, distribute, and distribute modified versions |
7 | of this software and its documentation without fee and without a signed | 7 | of this software and its documentation without fee and without a signed |
8 | licensing agreement, is hereby granted, provided that the above copyright | 8 | licensing agreement, is hereby granted, provided that the above copyright |
9 | notice, this paragraph and the following two paragraphs appear in all copies, | 9 | notice, this paragraph and the following two paragraphs appear in all copies, |
10 | modifications, and distributions. | 10 | modifications, and distributions. |
11 | 11 | ||
12 | IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, | 12 | IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, |
13 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING | 13 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING |
14 | OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS | 14 | OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS |
15 | BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 15 | BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
16 | 16 | ||
17 | REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | 17 | REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
18 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 18 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
19 | PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED | 19 | PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED |
20 | HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE | 20 | HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE |
21 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 21 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
22 | 22 | ||
23 | 23 | ||
24 | The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl | 24 | The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl |
25 | */ | 25 | */ |
26 | 26 | ||
27 | 27 | ||
28 | /* sendOSC.c | 28 | /* sendOSC.c |
29 | 29 | ||
30 | Matt Wright, 6/3/97 | 30 | Matt Wright, 6/3/97 |
31 | based on sendOSC.c, which was based on a version by Adrian Freed | 31 | based on sendOSC.c, which was based on a version by Adrian Freed |
32 | 32 | ||
33 | Text-based OpenSoundControl client. User can enter messages via command | 33 | Text-based OpenSoundControl client. User can enter messages via command |
34 | line arguments or standard input. | 34 | line arguments or standard input. |
35 | 35 | ||
36 | Version 0.1: "play" feature | 36 | Version 0.1: "play" feature |
37 | Version 0.2: Message type tags. | 37 | Version 0.2: Message type tags. |
38 | 38 | ||
39 | pd version branched from http://www.cnmat.berkeley.edu/OpenSoundControl/src/sendOSC/sendOSC.c | 39 | pd version branched from http://www.cnmat.berkeley.edu/OpenSoundControl/src/sendOSC/sendOSC.c |
40 | ------------- | 40 | ------------- |
41 | -- added bundle stuff to send. jdl 20020416 | 41 | -- added bundle stuff to send. jdl 20020416 |
42 | -- tweaks for Win32 www.zeggz.com/raf 13-April-2002 | 42 | -- tweaks for Win32 www.zeggz.com/raf 13-April-2002 |
43 | -- ost_at_test.at + i22_at_test.at, 2000-2002 | 43 | -- ost_at_test.at + i22_at_test.at, 2000-2002 |
44 | modified to compile as pd externel | 44 | modified to compile as pd externel |
45 | */ | 45 | */ |
46 | 46 | ||
47 | #define MAX_ARGS 2000 | 47 | #define MAX_ARGS 2000 |
48 | #define SC_BUFFER_SIZE 64000 | 48 | #define SC_BUFFER_SIZE 64000 |
49 | 49 | ||
50 | #include "m_pd.h" | 50 | #include "m_pd.h" |
51 | #include "OSC-client.h" | 51 | #include "OSC-client.h" |
52 | 52 | ||
53 | #include <string.h> | 53 | #include <string.h> |
54 | #include <sys/types.h> | 54 | #include <sys/types.h> |
55 | #include <stdlib.h> | 55 | #include <stdlib.h> |
56 | #include <stdio.h> | 56 | #include <stdio.h> |
57 | #include <sys/stat.h> | 57 | #include <sys/stat.h> |
58 | #include <sys/types.h> | 58 | #include <sys/types.h> |
59 | 59 | ||
60 | #ifdef WIN32 | 60 | #ifdef WIN32 |
61 | #include <winsock2.h> | 61 | #include <winsock2.h> |
62 | #include <io.h> | 62 | #include <io.h> |
63 | #include <errno.h> | 63 | #include <errno.h> |
64 | #include <fcntl.h> | 64 | #include <fcntl.h> |
65 | #include <winsock2.h> | 65 | #include <winsock2.h> |
66 | #include <ctype.h> | 66 | #include <ctype.h> |
67 | #include <signal.h> | 67 | #include <signal.h> |
68 | #else | 68 | #else |
69 | #include <sys/socket.h> | 69 | #include <sys/socket.h> |
70 | #include <netinet/in.h> | 70 | #include <netinet/in.h> |
71 | #include <rpc/rpc.h> | 71 | #include <rpc/rpc.h> |
72 | #include <sys/times.h> | 72 | #include <sys/times.h> |
73 | #include <sys/param.h> | 73 | #include <sys/param.h> |
74 | #include <sys/time.h> | 74 | #include <sys/time.h> |
75 | #include <sys/ioctl.h> | 75 | #include <sys/ioctl.h> |
76 | #include <netdb.h> | 76 | #include <netdb.h> |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #ifdef __APPLE__ | 79 | #ifdef __APPLE__ |
80 | #include <string.h> | 80 | #include <string.h> |
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | #define UNIXDG_PATH "/tmp/htm" | 83 | #define UNIXDG_PATH "/tmp/htm" |
84 | #define UNIXDG_TMP "/tmp/htm.XXXXXX" | 84 | #define UNIXDG_TMP "/tmp/htm.XXXXXX" |
85 | 85 | ||
86 | 86 | ||
87 | 87 | ||
88 | OSCTimeTag OSCTT_Immediately(void) { | 88 | OSCTimeTag OSCTT_Immediately(void) { |
89 | OSCTimeTag result; | 89 | OSCTimeTag result; |
90 | result.seconds = 0; | 90 | result.seconds = 0; |
91 | result.fraction = 1; | 91 | result.fraction = 1; |
92 | return result; | 92 | return result; |
93 | } | 93 | } |
94 | 94 | ||
95 | 95 | ||
96 | OSCTimeTag OSCTT_CurrentTime(void) { | 96 | OSCTimeTag OSCTT_CurrentTime(void) { |
97 | OSCTimeTag result; | 97 | OSCTimeTag result; |
98 | result.seconds = 0; | 98 | result.seconds = 0; |
99 | result.fraction = 1; | 99 | result.fraction = 1; |
100 | return result; | 100 | return result; |
101 | } | 101 | } |
102 | 102 | ||
103 | OSCTimeTag OSCTT_PlusSeconds(OSCTimeTag original, float secondsOffset) { | 103 | OSCTimeTag OSCTT_PlusSeconds(OSCTimeTag original, float secondsOffset) { |
104 | OSCTimeTag result; | 104 | OSCTimeTag result; |
105 | result.seconds = 0; | 105 | result.seconds = 0; |
106 | result.fraction = 1; | 106 | result.fraction = 1; |
107 | return result; | 107 | return result; |
108 | } | 108 | } |
109 | 109 | ||
110 | 110 | ||
111 | typedef int bool; | 111 | typedef int bool; |
112 | 112 | ||
113 | typedef struct | 113 | typedef struct |
114 | { | 114 | { |
115 | float srate; | 115 | float srate; |
116 | 116 | ||
117 | struct sockaddr_in serv_addr; /* udp socket */ | 117 | struct sockaddr_in serv_addr; /* udp socket */ |
118 | #ifndef WIN32 | 118 | #ifndef WIN32 |
119 | struct sockaddr_un userv_addr; /* UNIX socket */ | 119 | struct sockaddr_un userv_addr; /* UNIX socket */ |
120 | #endif | 120 | #endif |
121 | int sockfd; /* socket file descriptor */ | 121 | int sockfd; /* socket file descriptor */ |
122 | int index, len,uservlen; | 122 | int index, len,uservlen; |
123 | void *addr; | 123 | void *addr; |
124 | int id; | 124 | int id; |
125 | } desc; | 125 | } desc; |
126 | 126 | ||
127 | 127 | ||
128 | /* open a socket for HTM communication to given host on given portnumber */ | 128 | /* open a socket for HTM communication to given host on given portnumber */ |
129 | /* if host is 0 then UNIX protocol is used (i.e. local communication */ | 129 | /* if host is 0 then UNIX protocol is used (i.e. local communication */ |
130 | void *OpenHTMSocket(char *host, int portnumber) | 130 | void *OpenHTMSocket(char *host, int portnumber) |
131 | { | 131 | { |
132 | struct sockaddr_in cl_addr; | 132 | struct sockaddr_in cl_addr; |
133 | #ifndef WIN32 | 133 | #ifndef WIN32 |
134 | int sockfd; | 134 | int sockfd; |
135 | struct sockaddr_un ucl_addr; | 135 | struct sockaddr_un ucl_addr; |
136 | #else | 136 | #else |
137 | unsigned int sockfd; | 137 | unsigned int sockfd; |
138 | #endif | 138 | #endif |
139 | 139 | ||
140 | desc *o; | 140 | desc *o; |
141 | int oval = 1; | 141 | int oval = 1; |
142 | o = malloc(sizeof(*o)); | 142 | o = malloc(sizeof(*o)); |
143 | if(!o) return 0; | 143 | if(!o) return 0; |
144 | 144 | ||
145 | #ifndef WIN32 | 145 | #ifndef WIN32 |
146 | 146 | ||
147 | if(!host) | 147 | if(!host) |
148 | { | 148 | { |
149 | char *mktemp(char *); | 149 | char *mktemp(char *); |
150 | int clilen; | 150 | int clilen; |
151 | o->len = sizeof(ucl_addr); | 151 | o->len = sizeof(ucl_addr); |
152 | /* | 152 | /* |
153 | * Fill in the structure "userv_addr" with the address of the | 153 | * Fill in the structure "userv_addr" with the address of the |
154 | * server that we want to send to. | 154 | * server that we want to send to. |
155 | */ | 155 | */ |
156 | 156 | ||
157 | bzero((char *) &o->userv_addr, sizeof(o->userv_addr)); | 157 | bzero((char *) &o->userv_addr, sizeof(o->userv_addr)); |
158 | o->userv_addr.sun_family = AF_UNIX; | 158 | o->userv_addr.sun_family = AF_UNIX; |
159 | strcpy(o->userv_addr.sun_path, UNIXDG_PATH); | 159 | strcpy(o->userv_addr.sun_path, UNIXDG_PATH); |
160 | sprintf(o->userv_addr.sun_path+strlen(o->userv_addr.sun_path), "%d", portnumber); | 160 | sprintf(o->userv_addr.sun_path+strlen(o->userv_addr.sun_path), "%d", portnumber); |
161 | o->uservlen = sizeof(o->userv_addr.sun_family) + strlen(o->userv_addr.sun_path); | 161 | o->uservlen = sizeof(o->userv_addr.sun_family) + strlen(o->userv_addr.sun_path); |
162 | o->addr = &(o->userv_addr); | 162 | o->addr = &(o->userv_addr); |
163 | /* | 163 | /* |
164 | * Open a socket (a UNIX domain datagram socket). | 164 | * Open a socket (a UNIX domain datagram socket). |
165 | */ | 165 | */ |
166 | 166 | ||
167 | if ( (sockfd = socket(AF_UNIX, SOCK_DGRAM, 0)) >= 0) | 167 | if ( (sockfd = socket(AF_UNIX, SOCK_DGRAM, 0)) >= 0) |
168 | { | 168 | { |
169 | /* | 169 | /* |
170 | * Bind a local address for us. | 170 | * Bind a local address for us. |
171 | * In the UNIX domain we have to choose our own name (that | 171 | * In the UNIX domain we have to choose our own name (that |
172 | * should be unique). We'll use mktemp() to create a unique | 172 | * should be unique). We'll use mktemp() to create a unique |
173 | * pathname, based on our process id. | 173 | * pathname, based on our process id. |
174 | */ | 174 | */ |
175 | 175 | ||
176 | bzero((char *) &ucl_addr, sizeof(ucl_addr)); /* zero out */ | 176 | bzero((char *) &ucl_addr, sizeof(ucl_addr)); /* zero out */ |
177 | ucl_addr.sun_family = AF_UNIX; | 177 | ucl_addr.sun_family = AF_UNIX; |
178 | strcpy(ucl_addr.sun_path, UNIXDG_TMP); | 178 | strcpy(ucl_addr.sun_path, UNIXDG_TMP); |
179 | 179 | ||
180 | mktemp(ucl_addr.sun_path); | 180 | mktemp(ucl_addr.sun_path); |
181 | clilen = sizeof(ucl_addr.sun_family) + strlen(ucl_addr.sun_path); | 181 | clilen = sizeof(ucl_addr.sun_family) + strlen(ucl_addr.sun_path); |
182 | 182 | ||
183 | if (bind(sockfd, (struct sockaddr *) &ucl_addr, clilen) < 0) | 183 | if (bind(sockfd, (struct sockaddr *) &ucl_addr, clilen) < 0) |
184 | { | 184 | { |
185 | perror("client: can't bind local address"); | 185 | perror("client: can't bind local address"); |
186 | close(sockfd); | 186 | close(sockfd); |
187 | sockfd = -1; | 187 | sockfd = -1; |
188 | } | 188 | } |
189 | } | 189 | } |
190 | else | 190 | else |
191 | perror("unable to make socket\n"); | 191 | perror("unable to make socket\n"); |
192 | 192 | ||
193 | }else | 193 | }else |
194 | 194 | ||
195 | #endif | 195 | #endif |
196 | 196 | ||
197 | { | 197 | { |
198 | /* | 198 | /* |
199 | * Fill in the structure "serv_addr" with the address of the | 199 | * Fill in the structure "serv_addr" with the address of the |
200 | * server that we want to send to. | 200 | * server that we want to send to. |
201 | */ | 201 | */ |
202 | o->len = sizeof(cl_addr); | 202 | o->len = sizeof(cl_addr); |
203 | 203 | ||
204 | #ifdef WIN32 | 204 | #ifdef WIN32 |
205 | ZeroMemory((char *)&o->serv_addr, sizeof(o->serv_addr)); | 205 | ZeroMemory((char *)&o->serv_addr, sizeof(o->serv_addr)); |
206 | #else | 206 | #else |
207 | bzero((char *)&o->serv_addr, sizeof(o->serv_addr)); | 207 | bzero((char *)&o->serv_addr, sizeof(o->serv_addr)); |
208 | #endif | 208 | #endif |
209 | 209 | ||
210 | o->serv_addr.sin_family = AF_INET; | 210 | o->serv_addr.sin_family = AF_INET; |
211 | 211 | ||
212 | /* MW 6/6/96: Call gethostbyname() instead of inet_addr(), | 212 | /* MW 6/6/96: Call gethostbyname() instead of inet_addr(), |
213 | so that host can be either an Internet host name (e.g., | 213 | so that host can be either an Internet host name (e.g., |
214 | "les") or an Internet address in standard dot notation | 214 | "les") or an Internet address in standard dot notation |
215 | (e.g., "128.32.122.13") */ | 215 | (e.g., "128.32.122.13") */ |
216 | { | 216 | { |
217 | struct hostent *hostsEntry; | 217 | struct hostent *hostsEntry; |
218 | unsigned long address; | 218 | unsigned long address; |
219 | 219 | ||
220 | hostsEntry = gethostbyname(host); | 220 | hostsEntry = gethostbyname(host); |
221 | if (hostsEntry == NULL) { | 221 | if (hostsEntry == NULL) { |
222 | fprintf(stderr, "Couldn't decipher host name \"%s\"\n", host); | 222 | fprintf(stderr, "Couldn't decipher host name \"%s\"\n", host); |
223 | #ifndef WIN32 | 223 | #ifndef WIN32 |
224 | herror(NULL); | 224 | herror(NULL); |
225 | #endif | 225 | #endif |
226 | return 0; | 226 | return 0; |
227 | } | 227 | } |
228 | address = *((unsigned long *) hostsEntry->h_addr_list[0]); | 228 | address = *((unsigned long *) hostsEntry->h_addr_list[0]); |
229 | o->serv_addr.sin_addr.s_addr = address; | 229 | o->serv_addr.sin_addr.s_addr = address; |
230 | } | 230 | } |
231 | 231 | ||
232 | /* was: o->serv_addr.sin_addr.s_addr = inet_addr(host); */ | 232 | /* was: o->serv_addr.sin_addr.s_addr = inet_addr(host); */ |
233 | 233 | ||
234 | /* End MW changes */ | 234 | /* End MW changes */ |
235 | 235 | ||
236 | /* | 236 | /* |
237 | * Open a socket (a UDP domain datagram socket). | 237 | * Open a socket (a UDP domain datagram socket). |
238 | */ | 238 | */ |
239 | 239 | ||
240 | 240 | ||
241 | #ifdef WIN32 | 241 | #ifdef WIN32 |
242 | o->serv_addr.sin_port = htons((USHORT)portnumber); | 242 | o->serv_addr.sin_port = htons((USHORT)portnumber); |
243 | o->addr = &(o->serv_addr); | 243 | o->addr = &(o->serv_addr); |
244 | if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) != INVALID_SOCKET) { | 244 | if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) != INVALID_SOCKET) { |
245 | ZeroMemory((char *)&cl_addr, sizeof(cl_addr)); | 245 | ZeroMemory((char *)&cl_addr, sizeof(cl_addr)); |
246 | cl_addr.sin_family = AF_INET; | 246 | cl_addr.sin_family = AF_INET; |
247 | cl_addr.sin_addr.s_addr = htonl(INADDR_ANY); | 247 | cl_addr.sin_addr.s_addr = htonl(INADDR_ANY); |
248 | cl_addr.sin_port = htons(0); | 248 | cl_addr.sin_port = htons(0); |
249 | 249 | ||
250 | // enable broadcast: jdl ~2003 | 250 | // enable broadcast: jdl ~2003 |
251 | if(setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, &oval, sizeof(int)) == -1) { | 251 | if(setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, &oval, sizeof(int)) == -1) { |
252 | perror("setsockopt"); | 252 | perror("setsockopt"); |
253 | } | 253 | } |
254 | 254 | ||
255 | if(bind(sockfd, (struct sockaddr *) &cl_addr, sizeof(cl_addr)) < 0) { | 255 | if(bind(sockfd, (struct sockaddr *) &cl_addr, sizeof(cl_addr)) < 0) { |
256 | perror("could not bind\n"); | 256 | perror("could not bind\n"); |
257 | closesocket(sockfd); | 257 | closesocket(sockfd); |
258 | sockfd = -1; | 258 | sockfd = -1; |
259 | } | 259 | } |
260 | } | 260 | } |
261 | else { perror("unable to make socket\n");} | 261 | else { perror("unable to make socket\n");} |
262 | #else | 262 | #else |
263 | o->serv_addr.sin_port = htons(portnumber); | 263 | o->serv_addr.sin_port = htons(portnumber); |
264 | o->addr = &(o->serv_addr); | 264 | o->addr = &(o->serv_addr); |
265 | if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) { | 265 | if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) { |
266 | bzero((char *)&cl_addr, sizeof(cl_addr)); | 266 | bzero((char *)&cl_addr, sizeof(cl_addr)); |
267 | cl_addr.sin_family = AF_INET; | 267 | cl_addr.sin_family = AF_INET; |
268 | cl_addr.sin_addr.s_addr = htonl(INADDR_ANY); | 268 | cl_addr.sin_addr.s_addr = htonl(INADDR_ANY); |
269 | cl_addr.sin_port = htons(0); | 269 | cl_addr.sin_port = htons(0); |
270 | 270 | ||
271 | // enable broadcast: jdl ~2003 | 271 | // enable broadcast: jdl ~2003 |
272 | if(setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, &oval, sizeof(int)) == -1) { | 272 | if(setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, &oval, sizeof(int)) == -1) { |
273 | perror("setsockopt"); | 273 | perror("setsockopt"); |
274 | } | 274 | } |
275 | 275 | ||
276 | if(bind(sockfd, (struct sockaddr *) &cl_addr, sizeof(cl_addr)) < 0) { | 276 | if(bind(sockfd, (struct sockaddr *) &cl_addr, sizeof(cl_addr)) < 0) { |
277 | perror("could not bind\n"); | 277 | perror("could not bind\n"); |
278 | close(sockfd); | 278 | close(sockfd); |
279 | sockfd = -1; | 279 | sockfd = -1; |
280 | } | 280 | } |
281 | } | 281 | } |
282 | else { perror("unable to make socket\n");} | 282 | else { perror("unable to make socket\n");} |
283 | #endif | 283 | #endif |
284 | } | 284 | } |
285 | #ifdef WIN32 | 285 | #ifdef WIN32 |
286 | if(sockfd == INVALID_SOCKET) { | 286 | if(sockfd == INVALID_SOCKET) { |
287 | #else | 287 | #else |
288 | if(sockfd < 0) { | 288 | if(sockfd < 0) { |
289 | #endif | 289 | #endif |
290 | free(o); | 290 | free(o); |
291 | o = 0; | 291 | o = 0; |
292 | } | 292 | } |
293 | else | 293 | else |
294 | o->sockfd = sockfd; | 294 | o->sockfd = sockfd; |
295 | return o; | 295 | return o; |
296 | } | 296 | } |
297 | 297 | ||
298 | static bool sendudp(const struct sockaddr *sp, int sockfd,int length, int count, void *b) | 298 | static bool sendudp(const struct sockaddr *sp, int sockfd,int length, int count, void *b) |
299 | { | 299 | { |
300 | int rcount; | 300 | int rcount; |
301 | if((rcount=sendto(sockfd, b, count, 0, sp, length)) != count) | 301 | if((rcount=sendto(sockfd, b, count, 0, sp, length)) != count) |
302 | { | 302 | { |
303 | printf("sockfd %d count %d rcount %dlength %d\n", sockfd,count,rcount,length); | 303 | printf("sockfd %d count %d rcount %dlength %d\n", sockfd,count,rcount,length); |
304 | return FALSE; | 304 | return FALSE; |
305 | } | 305 | } |
306 | return TRUE; | 306 | return TRUE; |
307 | } | 307 | } |
308 | 308 | ||
309 | bool SendHTMSocket(void *htmsendhandle, int length_in_bytes, void *buffer) | 309 | bool SendHTMSocket(void *htmsendhandle, int length_in_bytes, void *buffer) |
310 | { | 310 | { |
311 | desc *o = (desc *)htmsendhandle; | 311 | desc *o = (desc *)htmsendhandle; |
312 | return sendudp(o->addr, o->sockfd, o->len, length_in_bytes, buffer); | 312 | return sendudp(o->addr, o->sockfd, o->len, length_in_bytes, buffer); |
313 | } | 313 | } |
314 | void CloseHTMSocket(void *htmsendhandle) | 314 | void CloseHTMSocket(void *htmsendhandle) |
315 | { | 315 | { |
316 | desc *o = (desc *)htmsendhandle; | 316 | desc *o = (desc *)htmsendhandle; |
317 | #ifdef WIN32 | 317 | #ifdef WIN32 |
318 | if(SOCKET_ERROR == closesocket(o->sockfd)) { | 318 | if(SOCKET_ERROR == closesocket(o->sockfd)) { |
319 | perror("CloseHTMSocket::closesocket failed\n"); | 319 | perror("CloseHTMSocket::closesocket failed\n"); |
320 | return; | 320 | return; |
321 | } | 321 | } |
322 | #else | 322 | #else |
323 | if(close(o->sockfd) == -1) | 323 | if(close(o->sockfd) == -1) |
324 | { | 324 | { |
325 | perror("CloseHTMSocket::closesocket failed"); | 325 | perror("CloseHTMSocket::closesocket failed"); |
326 | return; | 326 | return; |
327 | } | 327 | } |
328 | #endif | 328 | #endif |
329 | 329 | ||
330 | free(o); | 330 | free(o); |
331 | } | 331 | } |
332 | 332 | ||
333 | 333 | ||
334 | /////////////////////// | 334 | /////////////////////// |
335 | // from sendOSC | 335 | // from sendOSC |
336 | 336 | ||
337 | typedef struct { | 337 | typedef struct { |
338 | //enum {INT, FLOAT, STRING} type; | 338 | //enum {INT, FLOAT, STRING} type; |
339 | enum {INT_osc, FLOAT_osc, STRING_osc} type; | 339 | enum {INT_osc, FLOAT_osc, STRING_osc} type; |
340 | union { | 340 | union { |
341 | int i; | 341 | int i; |
342 | float f; | 342 | float f; |
343 | char *s; | 343 | char *s; |
344 | } datum; | 344 | } datum; |
345 | } typedArg; | 345 | } typedArg; |
346 | 346 | ||
347 | void CommandLineMode(int argc, char *argv[], void *htmsocket); | 347 | void CommandLineMode(int argc, char *argv[], void *htmsocket); |
348 | OSCTimeTag ParseTimeTag(char *s); | 348 | OSCTimeTag ParseTimeTag(char *s); |
349 | void ParseInteractiveLine(OSCbuf *buf, char *mesg); | 349 | void ParseInteractiveLine(OSCbuf *buf, char *mesg); |
350 | typedArg ParseToken(char *token); | 350 | typedArg ParseToken(char *token); |
351 | int WriteMessage(OSCbuf *buf, char *messageName, int numArgs, typedArg *args); | 351 | int WriteMessage(OSCbuf *buf, char *messageName, int numArgs, typedArg *args); |
352 | void SendBuffer(void *htmsocket, OSCbuf *buf); | 352 | void SendBuffer(void *htmsocket, OSCbuf *buf); |
353 | void SendData(void *htmsocket, int size, char *data); | 353 | void SendData(void *htmsocket, int size, char *data); |
354 | /* defined in OSC-system-dependent.c now */ | 354 | /* defined in OSC-system-dependent.c now */ |
355 | 355 | ||
356 | //static void *htmsocket; | 356 | //static void *htmsocket; |
357 | static int exitStatus = 0; | 357 | static int exitStatus = 0; |
358 | static int useTypeTags = 0; | 358 | static int useTypeTags = 0; |
359 | 359 | ||
360 | static char bufferForOSCbuf[SC_BUFFER_SIZE]; | 360 | static char bufferForOSCbuf[SC_BUFFER_SIZE]; |
361 | 361 | ||
362 | 362 | ||
363 | ///////// | 363 | ///////// |
364 | // end from sendOSC | 364 | // end from sendOSC |
365 | 365 | ||
366 | static t_class *sendOSC_class; | 366 | static t_class *sendOSC_class; |
367 | 367 | ||
368 | typedef struct _sendOSC | 368 | typedef struct _sendOSC |
369 | { | 369 | { |
370 | t_object x_obj; | 370 | t_object x_obj; |
371 | int x_protocol; // UDP/TCP (udp only atm) | 371 | int x_protocol; // UDP/TCP (udp only atm) |
372 | t_int x_typetags; // typetag flag | 372 | t_int x_typetags; // typetag flag |
373 | void *x_htmsocket; // sending socket | 373 | void *x_htmsocket; // sending socket |
374 | int x_bundle; // bundle open flag | 374 | int x_bundle; // bundle open flag |
375 | OSCbuf x_oscbuf[1]; // OSCbuffer | 375 | OSCbuf x_oscbuf[1]; // OSCbuffer |
376 | t_outlet *x_bdpthout;// bundle-depth floatoutlet | 376 | t_outlet *x_bdpthout;// bundle-depth floatoutlet |
377 | } t_sendOSC; | 377 | } t_sendOSC; |
378 | 378 | ||
379 | static void *sendOSC_new(t_floatarg udpflag) | 379 | static void *sendOSC_new(t_floatarg udpflag) |
380 | { | 380 | { |
381 | t_sendOSC *x = (t_sendOSC *)pd_new(sendOSC_class); | 381 | t_sendOSC *x = (t_sendOSC *)pd_new(sendOSC_class); |
382 | outlet_new(&x->x_obj, &s_float); | 382 | outlet_new(&x->x_obj, &s_float); |
383 | x->x_htmsocket = 0; // {{raf}} | 383 | x->x_htmsocket = 0; // {{raf}} |
384 | // set udp | 384 | // set udp |
385 | x->x_protocol = SOCK_STREAM; | 385 | x->x_protocol = SOCK_STREAM; |
386 | // set typetags to 1 by default | 386 | // set typetags to 1 by default |
387 | x->x_typetags = 1; | 387 | x->x_typetags = 1; |
388 | // bunlde is closed | 388 | // bunlde is closed |
389 | x->x_bundle = 0; | 389 | x->x_bundle = 0; |
390 | OSC_initBuffer(x->x_oscbuf, SC_BUFFER_SIZE, bufferForOSCbuf); | 390 | OSC_initBuffer(x->x_oscbuf, SC_BUFFER_SIZE, bufferForOSCbuf); |
391 | x->x_bdpthout = outlet_new(&x->x_obj, 0); // outlet_float(); | 391 | x->x_bdpthout = outlet_new(&x->x_obj, 0); // outlet_float(); |
392 | //x->x_oscbuf = | 392 | //x->x_oscbuf = |
393 | return (x); | 393 | return (x); |
394 | } | 394 | } |
395 | 395 | ||
396 | 396 | ||
397 | void sendOSC_openbundle(t_sendOSC *x) | 397 | void sendOSC_openbundle(t_sendOSC *x) |
398 | { | 398 | { |
399 | if (x->x_oscbuf->bundleDepth + 1 >= MAX_BUNDLE_NESTING || | 399 | if (x->x_oscbuf->bundleDepth + 1 >= MAX_BUNDLE_NESTING || |
400 | OSC_openBundle(x->x_oscbuf, OSCTT_Immediately())) | 400 | OSC_openBundle(x->x_oscbuf, OSCTT_Immediately())) |
401 | { | 401 | { |
402 | post("Problem opening bundle: %s\n", OSC_errorMessage); | 402 | post("Problem opening bundle: %s\n", OSC_errorMessage); |
403 | return; | 403 | return; |
404 | } | 404 | } |
405 | x->x_bundle = 1; | 405 | x->x_bundle = 1; |
406 | outlet_float(x->x_bdpthout, (float)x->x_oscbuf->bundleDepth); | 406 | outlet_float(x->x_bdpthout, (float)x->x_oscbuf->bundleDepth); |
407 | } | 407 | } |
408 | 408 | ||
409 | static void sendOSC_closebundle(t_sendOSC *x) | 409 | static void sendOSC_closebundle(t_sendOSC *x) |
410 | { | 410 | { |
411 | if (OSC_closeBundle(x->x_oscbuf)) { | 411 | if (OSC_closeBundle(x->x_oscbuf)) { |
412 | post("Problem closing bundle: %s\n", OSC_errorMessage); | 412 | post("Problem closing bundle: %s\n", OSC_errorMessage); |
413 | return; | 413 | return; |
414 | } | 414 | } |
415 | outlet_float(x->x_bdpthout, (float)x->x_oscbuf->bundleDepth); | 415 | outlet_float(x->x_bdpthout, (float)x->x_oscbuf->bundleDepth); |
416 | // in bundle mode we send when bundle is closed? | 416 | // in bundle mode we send when bundle is closed? |
417 | if(!OSC_isBufferEmpty(x->x_oscbuf) > 0 && OSC_isBufferDone(x->x_oscbuf)) { | 417 | if(!OSC_isBufferEmpty(x->x_oscbuf) > 0 && OSC_isBufferDone(x->x_oscbuf)) { |
418 | // post("x_oscbuf: something inside me?"); | 418 | // post("x_oscbuf: something inside me?"); |
419 | if (x->x_htmsocket) { | 419 | if (x->x_htmsocket) { |
420 | SendBuffer(x->x_htmsocket, x->x_oscbuf); | 420 | SendBuffer(x->x_htmsocket, x->x_oscbuf); |
421 | } else { | 421 | } else { |
422 | post("sendOSC: not connected"); | 422 | post("sendOSC: not connected"); |
423 | } | 423 | } |
424 | OSC_initBuffer(x->x_oscbuf, SC_BUFFER_SIZE, bufferForOSCbuf); | 424 | OSC_initBuffer(x->x_oscbuf, SC_BUFFER_SIZE, bufferForOSCbuf); |
425 | x->x_bundle = 0; | 425 | x->x_bundle = 0; |
426 | return; | 426 | return; |
427 | } | 427 | } |
428 | // post("x_oscbuf: something went wrong"); | 428 | // post("x_oscbuf: something went wrong"); |
429 | } | 429 | } |
430 | 430 | ||
431 | static void sendOSC_settypetags(t_sendOSC *x, t_float *f) | 431 | static void sendOSC_settypetags(t_sendOSC *x, t_float *f) |
432 | { | 432 | { |
433 | x->x_typetags = (int)f; | 433 | x->x_typetags = (int)f; |
434 | post("sendOSC.c: setting typetags %d",x->x_typetags); | 434 | post("sendOSC.c: setting typetags %d",x->x_typetags); |
435 | } | 435 | } |
436 | 436 | ||
437 | 437 | ||
438 | static void sendOSC_connect(t_sendOSC *x, t_symbol *hostname, | 438 | static void sendOSC_connect(t_sendOSC *x, t_symbol *hostname, |
439 | t_floatarg fportno) | 439 | t_floatarg fportno) |
440 | { | 440 | { |
441 | int portno = fportno; | 441 | int portno = fportno; |
442 | /* create a socket */ | 442 | /* create a socket */ |
443 | 443 | ||
444 | // make sure handle is available | 444 | // make sure handle is available |
445 | if(x->x_htmsocket == 0) { | 445 | if(x->x_htmsocket == 0) { |
446 | // | 446 | // |
447 | x->x_htmsocket = OpenHTMSocket(hostname->s_name, portno); | 447 | x->x_htmsocket = OpenHTMSocket(hostname->s_name, portno); |
448 | if (!x->x_htmsocket) | 448 | if (!x->x_htmsocket) |
449 | post("Couldn't open socket: "); | 449 | post("Couldn't open socket: "); |
450 | else { | 450 | else { |
451 | post("connected to port %s:%d (hSock=%d)", hostname->s_name, portno, x->x_htmsocket); | 451 | post("connected to port %s:%d (hSock=%d)", hostname->s_name, portno, x->x_htmsocket); |
452 | outlet_float(x->x_obj.ob_outlet, 1); | 452 | outlet_float(x->x_obj.ob_outlet, 1); |
453 | } | 453 | } |
454 | } | 454 | } |
455 | else | 455 | else |
456 | perror("call to sendOSC_connect() against UNavailable socket handle"); | 456 | perror("call to sendOSC_connect() against UNavailable socket handle"); |
457 | } | 457 | } |
458 | 458 | ||
459 | void sendOSC_disconnect(t_sendOSC *x) | 459 | void sendOSC_disconnect(t_sendOSC *x) |
460 | { | 460 | { |
461 | if (x->x_htmsocket) | 461 | if (x->x_htmsocket) |
462 | { | 462 | { |
463 | post("disconnecting htmsock (hSock=%d)...", x->x_htmsocket); | 463 | post("disconnecting htmsock (hSock=%d)...", x->x_htmsocket); |
464 | CloseHTMSocket(x->x_htmsocket); | 464 | CloseHTMSocket(x->x_htmsocket); |
465 | x->x_htmsocket = 0; // {{raf}} semi-quasi-semaphorize this | 465 | x->x_htmsocket = 0; // {{raf}} semi-quasi-semaphorize this |
466 | outlet_float(x->x_obj.ob_outlet, 0); | 466 | outlet_float(x->x_obj.ob_outlet, 0); |
467 | } | 467 | } |
468 | else { | 468 | else { |
469 | perror("call to sendOSC_disconnect() against unused socket handle"); | 469 | perror("call to sendOSC_disconnect() against unused socket handle"); |
470 | } | 470 | } |
471 | } | 471 | } |
472 | 472 | ||
473 | void sendOSC_senduntyped(t_sendOSC *x, t_symbol *s, int argc, t_atom *argv) | 473 | void sendOSC_senduntyped(t_sendOSC *x, t_symbol *s, int argc, t_atom *argv) |
474 | { | 474 | { |
475 | char* targv[MAXPDARG]; | 475 | char* targv[MAXPDARG]; |
476 | char tmparg[MAXPDSTRING]; | 476 | char tmparg[MAXPDSTRING]; |
477 | char* tmp = tmparg; | 477 | char* tmp = tmparg; |
478 | //char testarg[MAXPDSTRING]; | 478 | //char testarg[MAXPDSTRING]; |
479 | int c; | 479 | int c; |
480 | 480 | ||
481 | post("sendOSC: use typetags 0/1 message and plain send method so send untypetagged..."); | 481 | post("sendOSC: use typetags 0/1 message and plain send method so send untypetagged..."); |
482 | return; | 482 | return; |
483 | 483 | ||
484 | //atom_string(argv,testarg, MAXPDSTRING); | 484 | //atom_string(argv,testarg, MAXPDSTRING); |
485 | for (c=0;c<argc;c++) { | 485 | for (c=0;c<argc;c++) { |
486 | atom_string(argv+c,tmp, 80); | 486 | atom_string(argv+c,tmp, 80); |
487 | targv[c] = tmp; | 487 | targv[c] = tmp; |
488 | tmp += strlen(tmp)+1; | 488 | tmp += strlen(tmp)+1; |
489 | } | 489 | } |
490 | 490 | ||
491 | // this sock needs to be larger than 0, not >= .. | 491 | // this sock needs to be larger than 0, not >= .. |
492 | if (x->x_htmsocket) | 492 | if (x->x_htmsocket) |
493 | { | 493 | { |
494 | CommandLineMode(argc, targv, x->x_htmsocket); | 494 | CommandLineMode(argc, targv, x->x_htmsocket); |
495 | // post("test %d", c); | 495 | // post("test %d", c); |
496 | } | 496 | } |
497 | else { | 497 | else { |
498 | post("sendOSC: not connected"); | 498 | post("sendOSC: not connected"); |
499 | } | 499 | } |
500 | } | 500 | } |
501 | 501 | ||
502 | ////////////////////////////////////////////////////////////////////// | 502 | ////////////////////////////////////////////////////////////////////// |
503 | // this is the real and only sending routine now, for both typed and | 503 | // this is the real and only sending routine now, for both typed and |
504 | // undtyped mode. | 504 | // undtyped mode. |
505 | 505 | ||
506 | static void sendOSC_sendtyped(t_sendOSC *x, t_symbol *s, int argc, t_atom *argv) | 506 | static void sendOSC_sendtyped(t_sendOSC *x, t_symbol *s, int argc, t_atom *argv) |
507 | { | 507 | { |
508 | char* targv[MAX_ARGS]; | 508 | char* targv[MAX_ARGS]; |
509 | char tmparg[MAXPDSTRING]; | 509 | char tmparg[MAXPDSTRING]; |
510 | char* tmp = tmparg; | 510 | char* tmp = tmparg; |
511 | int c; | 511 | int c; |
512 | 512 | ||
513 | char *messageName; | 513 | char *messageName; |
514 | char *token; | 514 | char *token; |
515 | typedArg args[MAX_ARGS]; | 515 | typedArg args[MAX_ARGS]; |
516 | int i,j; | 516 | int i,j; |
517 | int numArgs = 0; | 517 | int numArgs = 0; |
518 | 518 | ||
519 | messageName = ""; | 519 | messageName = ""; |
520 | #ifdef DEBUG | 520 | #ifdef DEBUG |
521 | post ("sendOSC: messageName: %s", messageName); | 521 | post ("sendOSC: messageName: %s", messageName); |
522 | #endif | 522 | #endif |
523 | 523 | ||
524 | 524 | ||
525 | 525 | ||
526 | for (c=0;c<argc;c++) { | 526 | for (c=0;c<argc;c++) { |
527 | atom_string(argv+c,tmp, 80); | 527 | atom_string(argv+c,tmp, 80); |
528 | 528 | ||
529 | #ifdef DEBUG | 529 | #ifdef DEBUG |
530 | // post ("sendOSC: %d, %s",c, tmp); | 530 | // post ("sendOSC: %d, %s",c, tmp); |
531 | #endif | 531 | #endif |
532 | 532 | ||
533 | targv[c] = tmp; | 533 | targv[c] = tmp; |
534 | tmp += strlen(tmp)+1; | 534 | tmp += strlen(tmp)+1; |
535 | 535 | ||
536 | #ifdef DEBUG | 536 | #ifdef DEBUG |
537 | // post ("sendOSC: %d, %s",c, targv[c]); | 537 | // post ("sendOSC: %d, %s",c, targv[c]); |
538 | #endif | 538 | #endif |
539 | } | 539 | } |
540 | 540 | ||
541 | // this sock needs to be larger than 0, not >= .. | 541 | // this sock needs to be larger than 0, not >= .. |
542 | if (x->x_htmsocket > 0) | 542 | if (x->x_htmsocket > 0) |
543 | { | 543 | { |
544 | #ifdef DEBUG | 544 | #ifdef DEBUG |
545 | post ("sendOSC: type tags? %d", useTypeTags); | 545 | post ("sendOSC: type tags? %d", useTypeTags); |
546 | #endif | 546 | #endif |
547 | 547 | ||
548 | messageName = strtok(targv[0], ","); | 548 | messageName = strtok(targv[0], ","); |
549 | j = 1; | 549 | j = 1; |
550 | for (i = j; i < argc; i++) { | 550 | for (i = j; i < argc; i++) { |
551 | token = strtok(targv[i],","); | 551 | token = strtok(targv[i],","); |
552 | args[i-j] = ParseToken(token); | 552 | args[i-j] = ParseToken(token); |
553 | #ifdef DEBUG | 553 | #ifdef DEBUG |
554 | printf("cell-cont: %s\n", targv[i]); | 554 | printf("cell-cont: %s\n", targv[i]); |
555 | printf(" type-id: %d\n", args[i-j]); | 555 | printf(" type-id: %d\n", args[i-j]); |
556 | #endif | 556 | #endif |
557 | numArgs = i; | 557 | numArgs = i; |
558 | } | 558 | } |
559 | 559 | ||
560 | 560 | ||
561 | if(WriteMessage(x->x_oscbuf, messageName, numArgs, args)) { | 561 | if(WriteMessage(x->x_oscbuf, messageName, numArgs, args)) { |
562 | post("sendOSC: usage error, write-msg failed: %s", OSC_errorMessage); | 562 | post("sendOSC: usage error, write-msg failed: %s", OSC_errorMessage); |
563 | return; | 563 | return; |
564 | } | 564 | } |
565 | 565 | ||
566 | if(!x->x_bundle) { | 566 | if(!x->x_bundle) { |
567 | SendBuffer(x->x_htmsocket, x->x_oscbuf); | 567 | SendBuffer(x->x_htmsocket, x->x_oscbuf); |
568 | OSC_initBuffer(x->x_oscbuf, SC_BUFFER_SIZE, bufferForOSCbuf); | 568 | OSC_initBuffer(x->x_oscbuf, SC_BUFFER_SIZE, bufferForOSCbuf); |
569 | } | 569 | } |
570 | 570 | ||
571 | //CommandLineMode(argc, targv, x->x_htmsocket); | 571 | //CommandLineMode(argc, targv, x->x_htmsocket); |
572 | //useTypeTags = 0; | 572 | //useTypeTags = 0; |
573 | } | 573 | } |
574 | else { | 574 | else { |
575 | post("sendOSC: not connected"); | 575 | post("sendOSC: not connected"); |
576 | } | 576 | } |
577 | } | 577 | } |
578 | 578 | ||
579 | void sendOSC_send(t_sendOSC *x, t_symbol *s, int argc, t_atom *argv) | 579 | void sendOSC_send(t_sendOSC *x, t_symbol *s, int argc, t_atom *argv) |
580 | { | 580 | { |
581 | if(!argc) { | 581 | if(!argc) { |
582 | post("not sending empty message."); | 582 | post("not sending empty message."); |
583 | return; | 583 | return; |
584 | } | 584 | } |
585 | if(x->x_typetags) { | 585 | if(x->x_typetags) { |
586 | useTypeTags = 1; | 586 | useTypeTags = 1; |
587 | sendOSC_sendtyped(x,s,argc,argv); | 587 | sendOSC_sendtyped(x,s,argc,argv); |
588 | useTypeTags = 0; | 588 | useTypeTags = 0; |
589 | } else { | 589 | } else { |
590 | sendOSC_sendtyped(x,s,argc,argv); | 590 | sendOSC_sendtyped(x,s,argc,argv); |
591 | } | 591 | } |
592 | } | 592 | } |
593 | 593 | ||
594 | static void sendOSC_free(t_sendOSC *x) | 594 | static void sendOSC_free(t_sendOSC *x) |
595 | { | 595 | { |
596 | sendOSC_disconnect(x); | 596 | sendOSC_disconnect(x); |
597 | } | 597 | } |
598 | 598 | ||
599 | #ifdef WIN32 | 599 | #ifdef WIN32 |
600 | OSC_API void sendOSC_setup(void) { | 600 | OSC_API void sendOSC_setup(void) { |
601 | #else | 601 | #else |
602 | void sendOSC_setup(void) { | 602 | void sendOSC_setup(void) { |
603 | #endif | 603 | #endif |
604 | sendOSC_class = class_new(gensym("sendOSC"), (t_newmethod)sendOSC_new, | 604 | sendOSC_class = class_new(gensym("sendOSC"), (t_newmethod)sendOSC_new, |
605 | (t_method)sendOSC_free, | 605 | (t_method)sendOSC_free, |
606 | sizeof(t_sendOSC), 0, A_DEFFLOAT, 0); | 606 | sizeof(t_sendOSC), 0, A_DEFFLOAT, 0); |
607 | class_addmethod(sendOSC_class, (t_method)sendOSC_connect, | 607 | class_addmethod(sendOSC_class, (t_method)sendOSC_connect, |
608 | gensym("connect"), A_SYMBOL, A_FLOAT, 0); | 608 | gensym("connect"), A_SYMBOL, A_FLOAT, 0); |
609 | class_addmethod(sendOSC_class, (t_method)sendOSC_disconnect, | 609 | class_addmethod(sendOSC_class, (t_method)sendOSC_disconnect, |
610 | gensym("disconnect"), 0); | 610 | gensym("disconnect"), 0); |
611 | class_addmethod(sendOSC_class, (t_method)sendOSC_settypetags, | 611 | class_addmethod(sendOSC_class, (t_method)sendOSC_settypetags, |
612 | gensym("typetags"), | 612 | gensym("typetags"), |
613 | A_FLOAT, 0); | 613 | A_FLOAT, 0); |
614 | class_addmethod(sendOSC_class, (t_method)sendOSC_send, | 614 | class_addmethod(sendOSC_class, (t_method)sendOSC_send, |
615 | gensym("send"), | 615 | gensym("send"), |
616 | A_GIMME, 0); | 616 | A_GIMME, 0); |
617 | class_addmethod(sendOSC_class, (t_method)sendOSC_send, | 617 | class_addmethod(sendOSC_class, (t_method)sendOSC_send, |
618 | gensym("senduntyped"), | 618 | gensym("senduntyped"), |
619 | A_GIMME, 0); | 619 | A_GIMME, 0); |
620 | class_addmethod(sendOSC_class, (t_method)sendOSC_send, | 620 | class_addmethod(sendOSC_class, (t_method)sendOSC_send, |
621 | gensym("sendtyped"), | 621 | gensym("sendtyped"), |
622 | A_GIMME, 0); | 622 | A_GIMME, 0); |
623 | class_addmethod(sendOSC_class, (t_method)sendOSC_openbundle, | 623 | class_addmethod(sendOSC_class, (t_method)sendOSC_openbundle, |
624 | gensym("["), | 624 | gensym("["), |
625 | 0, 0); | 625 | 0, 0); |
626 | class_addmethod(sendOSC_class, (t_method)sendOSC_closebundle, | 626 | class_addmethod(sendOSC_class, (t_method)sendOSC_closebundle, |
627 | gensym("]"), | 627 | gensym("]"), |
628 | 0, 0); | 628 | 0, 0); |
629 | class_sethelpsymbol(sendOSC_class, gensym("sendOSC-help.pd")); | 629 | class_sethelpsymbol(sendOSC_class, gensym("sendOSC-help.pd")); |
630 | } | 630 | } |
631 | 631 | ||
632 | 632 | ||
633 | 633 | ||
634 | 634 | ||
635 | 635 | ||
636 | /* Exit status codes: | 636 | /* Exit status codes: |
637 | 0: successful | 637 | 0: successful |
638 | 2: Message(s) dropped because of buffer overflow | 638 | 2: Message(s) dropped because of buffer overflow |
639 | 3: Socket error | 639 | 3: Socket error |
640 | 4: Usage error | 640 | 4: Usage error |
641 | 5: Internal error | 641 | 5: Internal error |
642 | */ | 642 | */ |
643 | 643 | ||
644 | void CommandLineMode(int argc, char *argv[], void *htmsocket) { | 644 | void CommandLineMode(int argc, char *argv[], void *htmsocket) { |
645 | char *messageName; | 645 | char *messageName; |
646 | char *token; | 646 | char *token; |
647 | typedArg args[MAX_ARGS]; | 647 | typedArg args[MAX_ARGS]; |
648 | int i,j, numArgs; | 648 | int i,j, numArgs; |
649 | OSCbuf buf[1]; | 649 | OSCbuf buf[1]; |
650 | 650 | ||
651 | OSC_initBuffer(buf, SC_BUFFER_SIZE, bufferForOSCbuf); | 651 | OSC_initBuffer(buf, SC_BUFFER_SIZE, bufferForOSCbuf); |
652 | 652 | ||
653 | if (argc > 1) { | 653 | if (argc > 1) { |
654 | post("argc (%d) > 1", argc); | 654 | post("argc (%d) > 1", argc); |
655 | } | 655 | } |
656 | 656 | ||
657 | // ParseInteractiveLine(buf, argv); | 657 | // ParseInteractiveLine(buf, argv); |
658 | messageName = strtok(argv[0], ","); | 658 | messageName = strtok(argv[0], ","); |
659 | 659 | ||
660 | j = 1; | 660 | j = 1; |
661 | for (i = j; i < argc; i++) { | 661 | for (i = j; i < argc; i++) { |
662 | token = strtok(argv[i],","); | 662 | token = strtok(argv[i],","); |
663 | args[i-j] = ParseToken(token); | 663 | args[i-j] = ParseToken(token); |
664 | #ifdef DEBUG | 664 | #ifdef DEBUG |
665 | printf("cell-cont: %s\n", argv[i]); | 665 | printf("cell-cont: %s\n", argv[i]); |
666 | printf(" type-id: %d\n", args[i-j]); | 666 | printf(" type-id: %d\n", args[i-j]); |
667 | #endif | 667 | #endif |
668 | numArgs = i; | 668 | numArgs = i; |
669 | } | 669 | } |
670 | 670 | ||
671 | if(WriteMessage(buf, messageName, numArgs, args)) { | 671 | if(WriteMessage(buf, messageName, numArgs, args)) { |
672 | post("sendOSC: usage error. write-msg failed: %s", OSC_errorMessage); | 672 | post("sendOSC: usage error. write-msg failed: %s", OSC_errorMessage); |
673 | return; | 673 | return; |
674 | } | 674 | } |
675 | 675 | ||
676 | SendBuffer(htmsocket, buf); | 676 | SendBuffer(htmsocket, buf); |
677 | } | 677 | } |
678 | 678 | ||
679 | #define MAXMESG 2048 | 679 | #define MAXMESG 2048 |
680 | 680 | ||
681 | void InteractiveMode(void *htmsocket) { | 681 | void InteractiveMode(void *htmsocket) { |
682 | char mesg[MAXMESG]; | 682 | char mesg[MAXMESG]; |
683 | OSCbuf buf[1]; | 683 | OSCbuf buf[1]; |
684 | int bundleDepth = 0; /* At first, we haven't seen "[". */ | 684 | int bundleDepth = 0; /* At first, we haven't seen "[". */ |
685 | 685 | ||
686 | OSC_initBuffer(buf, SC_BUFFER_SIZE, bufferForOSCbuf); | 686 | OSC_initBuffer(buf, SC_BUFFER_SIZE, bufferForOSCbuf); |
687 | 687 | ||
688 | while (fgets(mesg, MAXMESG, stdin) != NULL) { | 688 | while (fgets(mesg, MAXMESG, stdin) != NULL) { |
689 | if (mesg[0] == '\n') { | 689 | if (mesg[0] == '\n') { |
690 | if (bundleDepth > 0) { | 690 | if (bundleDepth > 0) { |
691 | /* Ignore blank lines inside a group. */ | 691 | /* Ignore blank lines inside a group. */ |
692 | } else { | 692 | } else { |
693 | /* blank line => repeat previous send */ | 693 | /* blank line => repeat previous send */ |
694 | SendBuffer(htmsocket, buf); | 694 | SendBuffer(htmsocket, buf); |
695 | } | 695 | } |
696 | continue; | 696 | continue; |
697 | } | 697 | } |
698 | 698 | ||
699 | if (bundleDepth == 0) { | 699 | if (bundleDepth == 0) { |
700 | OSC_resetBuffer(buf); | 700 | OSC_resetBuffer(buf); |
701 | } | 701 | } |
702 | 702 | ||
703 | if (mesg[0] == '[') { | 703 | if (mesg[0] == '[') { |
704 | OSCTimeTag tt = ParseTimeTag(mesg+1); | 704 | OSCTimeTag tt = ParseTimeTag(mesg+1); |
705 | if (OSC_openBundle(buf, tt)) { | 705 | if (OSC_openBundle(buf, tt)) { |
706 | post("Problem opening bundle: %s\n", OSC_errorMessage); | 706 | post("Problem opening bundle: %s\n", OSC_errorMessage); |
707 | OSC_resetBuffer(buf); | 707 | OSC_resetBuffer(buf); |
708 | bundleDepth = 0; | 708 | bundleDepth = 0; |
709 | continue; | 709 | continue; |
710 | } | 710 | } |
711 | bundleDepth++; | 711 | bundleDepth++; |
712 | } else if (mesg[0] == ']' && mesg[1] == '\n' && mesg[2] == '\0') { | 712 | } else if (mesg[0] == ']' && mesg[1] == '\n' && mesg[2] == '\0') { |
713 | if (bundleDepth == 0) { | 713 | if (bundleDepth == 0) { |
714 | post("Unexpected ']': not currently in a bundle.\n"); | 714 | post("Unexpected ']': not currently in a bundle.\n"); |
715 | } else { | 715 | } else { |
716 | if (OSC_closeBundle(buf)) { | 716 | if (OSC_closeBundle(buf)) { |
717 | post("Problem closing bundle: %s\n", OSC_errorMessage); | 717 | post("Problem closing bundle: %s\n", OSC_errorMessage); |
718 | OSC_resetBuffer(buf); | 718 | OSC_resetBuffer(buf); |
719 | bundleDepth = 0; | 719 | bundleDepth = 0; |
720 | continue; | 720 | continue; |
721 | } | 721 | } |
722 | 722 | ||
723 | bundleDepth--; | 723 | bundleDepth--; |
724 | if (bundleDepth == 0) { | 724 | if (bundleDepth == 0) { |
725 | SendBuffer(htmsocket, buf); | 725 | SendBuffer(htmsocket, buf); |
726 | } | 726 | } |
727 | } | 727 | } |
728 | } else { | 728 | } else { |
729 | ParseInteractiveLine(buf, mesg); | 729 | ParseInteractiveLine(buf, mesg); |
730 | if (bundleDepth != 0) { | 730 | if (bundleDepth != 0) { |
731 | /* Don't send anything until we close all bundles */ | 731 | /* Don't send anything until we close all bundles */ |
732 | } else { | 732 | } else { |
733 | SendBuffer(htmsocket, buf); | 733 | SendBuffer(htmsocket, buf); |
734 | } | 734 | } |
735 | } | 735 | } |
736 | } | 736 | } |
737 | } | 737 | } |
738 | 738 | ||
739 | OSCTimeTag ParseTimeTag(char *s) { | 739 | OSCTimeTag ParseTimeTag(char *s) { |
740 | char *p, *newline; | 740 | char *p, *newline; |
741 | typedArg arg; | 741 | typedArg arg; |
742 | 742 | ||
743 | p = s; | 743 | p = s; |
744 | while (isspace(*p)) p++; | 744 | while (isspace(*p)) p++; |
745 | if (*p == '\0') return OSCTT_Immediately(); | 745 | if (*p == '\0') return OSCTT_Immediately(); |
746 | 746 | ||
747 | if (*p == '+') { | 747 | if (*p == '+') { |
748 | /* Time tag is for some time in the future. It should be a | 748 | /* Time tag is for some time in the future. It should be a |
749 | number of seconds as an int or float */ | 749 | number of seconds as an int or float */ |
750 | 750 | ||
751 | newline = strchr(s, '\n'); | 751 | newline = strchr(s, '\n'); |
752 | if (newline != NULL) *newline = '\0'; | 752 | if (newline != NULL) *newline = '\0'; |
753 | 753 | ||
754 | p++; /* Skip '+' */ | 754 | p++; /* Skip '+' */ |
755 | while (isspace(*p)) p++; | 755 | while (isspace(*p)) p++; |
756 | 756 | ||
757 | arg = ParseToken(p); | 757 | arg = ParseToken(p); |
758 | if (arg.type == STRING_osc) { | 758 | if (arg.type == STRING_osc) { |
759 | post("warning: inscrutable time tag request: %s\n", s); | 759 | post("warning: inscrutable time tag request: %s\n", s); |
760 | return OSCTT_Immediately(); | 760 | return OSCTT_Immediately(); |
761 | } else if (arg.type == INT_osc) { | 761 | } else if (arg.type == INT_osc) { |
762 | return OSCTT_PlusSeconds(OSCTT_CurrentTime(), | 762 | return OSCTT_PlusSeconds(OSCTT_CurrentTime(), |
763 | (float) arg.datum.i); | 763 | (float) arg.datum.i); |
764 | } else if (arg.type == FLOAT_osc) { | 764 | } else if (arg.type == FLOAT_osc) { |
765 | return OSCTT_PlusSeconds(OSCTT_CurrentTime(), arg.datum.f); | 765 | return OSCTT_PlusSeconds(OSCTT_CurrentTime(), arg.datum.f); |
766 | } else { | 766 | } else { |
767 | error("This can't happen!"); | 767 | error("This can't happen!"); |
768 | } | 768 | } |
769 | } | 769 | } |
770 | 770 | ||
771 | if (isdigit(*p) || (*p >= 'a' && *p <='f') || (*p >= 'A' && *p <='F')) { | 771 | if (isdigit(*p) || (*p >= 'a' && *p <='f') || (*p >= 'A' && *p <='F')) { |
772 | /* They specified the 8-byte tag in hex */ | 772 | /* They specified the 8-byte tag in hex */ |
773 | OSCTimeTag tt; | 773 | OSCTimeTag tt; |
774 | if (sscanf(p, "%llx", &tt) != 1) { | 774 | if (sscanf(p, "%llx", &tt) != 1) { |
775 | post("warning: couldn't parse time tag %s\n", s); | 775 | post("warning: couldn't parse time tag %s\n", s); |
776 | return OSCTT_Immediately(); | 776 | return OSCTT_Immediately(); |
777 | } | 777 | } |
778 | #ifndef HAS8BYTEINT | 778 | #ifndef HAS8BYTEINT |
779 | if (ntohl(1) != 1) { | 779 | if (ntohl(1) != 1) { |
780 | /* tt is a struct of seconds and fractional part, | 780 | /* tt is a struct of seconds and fractional part, |
781 | and this machine is little-endian, so sscanf | 781 | and this machine is little-endian, so sscanf |
782 | wrote each half of the time tag in the wrong half | 782 | wrote each half of the time tag in the wrong half |
783 | of the struct. */ | 783 | of the struct. */ |
784 | int temp; | 784 | int temp; |
785 | temp = tt.seconds; | 785 | temp = tt.seconds; |
786 | tt.seconds = tt.fraction ; | 786 | tt.seconds = tt.fraction ; |
787 | tt.fraction = temp; | 787 | tt.fraction = temp; |
788 | } | 788 | } |
789 | #endif | 789 | #endif |
790 | return tt; | 790 | return tt; |
791 | } | 791 | } |
792 | 792 | ||
793 | post("warning: invalid time tag: %s\n", s); | 793 | post("warning: invalid time tag: %s\n", s); |
794 | return OSCTT_Immediately(); | 794 | return OSCTT_Immediately(); |
795 | } | 795 | } |
796 | 796 | ||
797 | 797 | ||
798 | void ParseInteractiveLine(OSCbuf *buf, char *mesg) { | 798 | void ParseInteractiveLine(OSCbuf *buf, char *mesg) { |
799 | char *messageName, *token, *p; | 799 | char *messageName, *token, *p; |
800 | typedArg args[MAX_ARGS]; | 800 | typedArg args[MAX_ARGS]; |
801 | int thisArg; | 801 | int thisArg; |
802 | 802 | ||
803 | p = mesg; | 803 | p = mesg; |
804 | while (isspace(*p)) p++; | 804 | while (isspace(*p)) p++; |
805 | if (*p == '\0') return; | 805 | if (*p == '\0') return; |
806 | 806 | ||
807 | messageName = p; | 807 | messageName = p; |
808 | 808 | ||
809 | if (strcmp(messageName, "play\n") == 0) { | 809 | if (strcmp(messageName, "play\n") == 0) { |
810 | /* Special kludge feature to save typing */ | 810 | /* Special kludge feature to save typing */ |
811 | typedArg arg; | 811 | typedArg arg; |
812 | 812 | ||
813 | if (OSC_openBundle(buf, OSCTT_Immediately())) { | 813 | if (OSC_openBundle(buf, OSCTT_Immediately())) { |
814 | post("Problem opening bundle: %s\n", OSC_errorMessage); | 814 | post("Problem opening bundle: %s\n", OSC_errorMessage); |
815 | return; | 815 | return; |
816 | } | 816 | } |
817 | 817 | ||
818 | arg.type = INT_osc; | 818 | arg.type = INT_osc; |
819 | arg.datum.i = 0; | 819 | arg.datum.i = 0; |
820 | WriteMessage(buf, "/voices/0/tp/timbre_index", 1, &arg); | 820 | WriteMessage(buf, "/voices/0/tp/timbre_index", 1, &arg); |
821 | 821 | ||
822 | arg.type = FLOAT_osc; | 822 | arg.type = FLOAT_osc; |
823 | arg.datum.i = 0.0f; | 823 | arg.datum.i = 0.0f; |
824 | WriteMessage(buf, "/voices/0/tm/goto", 1, &arg); | 824 | WriteMessage(buf, "/voices/0/tm/goto", 1, &arg); |
825 | 825 | ||
826 | if (OSC_closeBundle(buf)) { | 826 | if (OSC_closeBundle(buf)) { |
827 | post("Problem closing bundle: %s\n", OSC_errorMessage); | 827 | post("Problem closing bundle: %s\n", OSC_errorMessage); |
828 | } | 828 | } |
829 | 829 | ||
830 | return; | 830 | return; |
831 | } | 831 | } |
832 | 832 | ||
833 | while (!isspace(*p) && *p != '\0') p++; | 833 | while (!isspace(*p) && *p != '\0') p++; |
834 | if (isspace(*p)) { | 834 | if (isspace(*p)) { |
835 | *p = '\0'; | 835 | *p = '\0'; |
836 | p++; | 836 | p++; |
837 | } | 837 | } |
838 | 838 | ||
839 | thisArg = 0; | 839 | thisArg = 0; |
840 | while (*p != '\0') { | 840 | while (*p != '\0') { |
841 | /* flush leading whitespace */ | 841 | /* flush leading whitespace */ |
842 | while (isspace(*p)) p++; | 842 | while (isspace(*p)) p++; |
843 | if (*p == '\0') break; | 843 | if (*p == '\0') break; |
844 | 844 | ||
845 | if (*p == '"') { | 845 | if (*p == '"') { |
846 | /* A string argument: scan for close quotes */ | 846 | /* A string argument: scan for close quotes */ |
847 | p++; | 847 | p++; |
848 | args[thisArg].type = STRING_osc; | 848 | args[thisArg].type = STRING_osc; |
849 | args[thisArg].datum.s = p; | 849 | args[thisArg].datum.s = p; |
850 | 850 | ||
851 | while (*p != '"') { | 851 | while (*p != '"') { |
852 | if (*p == '\0') { | 852 | if (*p == '\0') { |
853 | post("Unterminated quote mark: ignoring line\n"); | 853 | post("Unterminated quote mark: ignoring line\n"); |
854 | return; | 854 | return; |
855 | } | 855 | } |
856 | p++; | 856 | p++; |
857 | } | 857 | } |
858 | *p = '\0'; | 858 | *p = '\0'; |
859 | p++; | 859 | p++; |
860 | } else { | 860 | } else { |
861 | token = p; | 861 | token = p; |
862 | while (!isspace(*p) && (*p != '\0')) p++; | 862 | while (!isspace(*p) && (*p != '\0')) p++; |
863 | if (isspace(*p)) { | 863 | if (isspace(*p)) { |
864 | *p = '\0'; | 864 | *p = '\0'; |
865 | p++; | 865 | p++; |
866 | } | 866 | } |
867 | args[thisArg] = ParseToken(token); | 867 | args[thisArg] = ParseToken(token); |
868 | } | 868 | } |
869 | thisArg++; | 869 | thisArg++; |
870 | if (thisArg >= MAX_ARGS) { | 870 | if (thisArg >= MAX_ARGS) { |
871 | post("Sorry, your message has more than MAX_ARGS (%d) arguments; ignoring the rest.\n", | 871 | post("Sorry, your message has more than MAX_ARGS (%d) arguments; ignoring the rest.\n", |
872 | MAX_ARGS); | 872 | MAX_ARGS); |
873 | break; | 873 | break; |
874 | } | 874 | } |
875 | } | 875 | } |
876 | 876 | ||
877 | if (WriteMessage(buf, messageName, thisArg, args) != 0) { | 877 | if (WriteMessage(buf, messageName, thisArg, args) != 0) { |
878 | post("Problem sending message: %s\n", OSC_errorMessage); | 878 | post("Problem sending message: %s\n", OSC_errorMessage); |
879 | } | 879 | } |
880 | } | 880 | } |
881 | 881 | ||
882 | typedArg ParseToken(char *token) { | 882 | typedArg ParseToken(char *token) { |
883 | char *p = token; | 883 | char *p = token; |
884 | typedArg returnVal; | 884 | typedArg returnVal; |
885 | 885 | ||
886 | /* It might be an int, a float, or a string */ | 886 | /* It might be an int, a float, or a string */ |
887 | 887 | ||
888 | if (*p == '-') p++; | 888 | if (*p == '-') p++; |
889 | 889 | ||
890 | if (isdigit(*p) || *p == '.') { | 890 | if (isdigit(*p) || *p == '.') { |
891 | while (isdigit(*p)) p++; | 891 | while (isdigit(*p)) p++; |
892 | if (*p == '\0') { | 892 | if (*p == '\0') { |
893 | returnVal.type = INT_osc; | 893 | returnVal.type = INT_osc; |
894 | returnVal.datum.i = atoi(token); | 894 | returnVal.datum.i = atoi(token); |
895 | return returnVal; | 895 | return returnVal; |
896 | } | 896 | } |
897 | if (*p == '.') { | 897 | if (*p == '.') { |
898 | p++; | 898 | p++; |
899 | while (isdigit(*p)) p++; | 899 | while (isdigit(*p)) p++; |
900 | if (*p == '\0') { | 900 | if (*p == '\0') { |
901 | returnVal.type = FLOAT_osc; | 901 | returnVal.type = FLOAT_osc; |
902 | returnVal.datum.f = atof(token); | 902 | returnVal.datum.f = atof(token); |
903 | return returnVal; | 903 | return returnVal; |
904 | } | 904 | } |
905 | } | 905 | } |
906 | } | 906 | } |
907 | 907 | ||
908 | returnVal.type = STRING_osc; | 908 | returnVal.type = STRING_osc; |
909 | returnVal.datum.s = token; | 909 | returnVal.datum.s = token; |
910 | return returnVal; | 910 | return returnVal; |
911 | } | 911 | } |
912 | 912 | ||
913 | int WriteMessage(OSCbuf *buf, char *messageName, int numArgs, typedArg *args) { | 913 | int WriteMessage(OSCbuf *buf, char *messageName, int numArgs, typedArg *args) { |
914 | int j, returnVal; | 914 | int j, returnVal; |
915 | const int wmERROR = -1; | 915 | const int wmERROR = -1; |
916 | 916 | ||
917 | returnVal = 0; | 917 | returnVal = 0; |
918 | 918 | ||
919 | #ifdef DEBUG | 919 | #ifdef DEBUG |
920 | printf("WriteMessage: %s ", messageName); | 920 | printf("WriteMessage: %s ", messageName); |
921 | 921 | ||
922 | for (j = 0; j < numArgs; j++) { | 922 | for (j = 0; j < numArgs; j++) { |
923 | switch (args[j].type) { | 923 | switch (args[j].type) { |
924 | case INT_osc: | 924 | case INT_osc: |
925 | printf("%d ", args[j].datum.i); | 925 | printf("%d ", args[j].datum.i); |
926 | break; | 926 | break; |
927 | 927 | ||
928 | case FLOAT_osc: | 928 | case FLOAT_osc: |
929 | printf("%f ", args[j].datum.f); | 929 | printf("%f ", args[j].datum.f); |
930 | break; | 930 | break; |
931 | 931 | ||
932 | case STRING_osc: | 932 | case STRING_osc: |
933 | printf("%s ", args[j].datum.s); | 933 | printf("%s ", args[j].datum.s); |
934 | break; | 934 | break; |
935 | 935 | ||
936 | default: | 936 | default: |
937 | error("Unrecognized arg type, (not exiting)"); | 937 | error("Unrecognized arg type, (not exiting)"); |
938 | return(wmERROR); | 938 | return(wmERROR); |
939 | } | 939 | } |
940 | } | 940 | } |
941 | printf("\n"); | 941 | printf("\n"); |
942 | #endif | 942 | #endif |
943 | 943 | ||
944 | if (!useTypeTags) { | 944 | if (!useTypeTags) { |
945 | returnVal = OSC_writeAddress(buf, messageName); | 945 | returnVal = OSC_writeAddress(buf, messageName); |
946 | if (returnVal) { | 946 | if (returnVal) { |
947 | post("Problem writing address: %s\n", OSC_errorMessage); | 947 | post("Problem writing address: %s\n", OSC_errorMessage); |
948 | } | 948 | } |
949 | } else { | 949 | } else { |
950 | /* First figure out the type tags */ | 950 | /* First figure out the type tags */ |
951 | char typeTags[MAX_ARGS+2]; | 951 | char typeTags[MAX_ARGS+2]; |
952 | int i; | 952 | int i; |
953 | 953 | ||
954 | typeTags[0] = ','; | 954 | typeTags[0] = ','; |
955 | 955 | ||
956 | for (i = 0; i < numArgs; ++i) { | 956 | for (i = 0; i < numArgs; ++i) { |
957 | switch (args[i].type) { | 957 | switch (args[i].type) { |
958 | case INT_osc: | 958 | case INT_osc: |
959 | typeTags[i+1] = 'i'; | 959 | typeTags[i+1] = 'i'; |
960 | break; | 960 | break; |
961 | 961 | ||
962 | case FLOAT_osc: | 962 | case FLOAT_osc: |
963 | typeTags[i+1] = 'f'; | 963 | typeTags[i+1] = 'f'; |
964 | break; | 964 | break; |
965 | 965 | ||
966 | case STRING_osc: | 966 | case STRING_osc: |
967 | typeTags[i+1] = 's'; | 967 | typeTags[i+1] = 's'; |
968 | break; | 968 | break; |
969 | 969 | ||
970 | default: | 970 | default: |
971 | error("Unrecognized arg type (not exiting)"); | 971 | error("Unrecognized arg type (not exiting)"); |
972 | return(wmERROR); | 972 | return(wmERROR); |
973 | } | 973 | } |
974 | } | 974 | } |
975 | typeTags[i+1] = '\0'; | 975 | typeTags[i+1] = '\0'; |
976 | 976 | ||
977 | returnVal = OSC_writeAddressAndTypes(buf, messageName, typeTags); | 977 | returnVal = OSC_writeAddressAndTypes(buf, messageName, typeTags); |
978 | if (returnVal) { | 978 | if (returnVal) { |
979 | post("Problem writing address: %s\n", OSC_errorMessage); | 979 | post("Problem writing address: %s\n", OSC_errorMessage); |
980 | } | 980 | } |
981 | } | 981 | } |
982 | 982 | ||
983 | for (j = 0; j < numArgs; j++) { | 983 | for (j = 0; j < numArgs; j++) { |
984 | switch (args[j].type) { | 984 | switch (args[j].type) { |
985 | case INT_osc: | 985 | case INT_osc: |
986 | if ((returnVal = OSC_writeIntArg(buf, args[j].datum.i)) != 0) { | 986 | if ((returnVal = OSC_writeIntArg(buf, args[j].datum.i)) != 0) { |
987 | return returnVal; | 987 | return returnVal; |
988 | } | 988 | } |
989 | break; | 989 | break; |
990 | 990 | ||
991 | case FLOAT_osc: | 991 | case FLOAT_osc: |
992 | if ((returnVal = OSC_writeFloatArg(buf, args[j].datum.f)) != 0) { | 992 | if ((returnVal = OSC_writeFloatArg(buf, args[j].datum.f)) != 0) { |
993 | return returnVal; | 993 | return returnVal; |
994 | } | 994 | } |
995 | break; | 995 | break; |
996 | 996 | ||
997 | case STRING_osc: | 997 | case STRING_osc: |
998 | if ((returnVal = OSC_writeStringArg(buf, args[j].datum.s)) != 0) { | 998 | if ((returnVal = OSC_writeStringArg(buf, args[j].datum.s)) != 0) { |
999 | return returnVal; | 999 | return returnVal; |
1000 | } | 1000 | } |
1001 | break; | 1001 | break; |
1002 | 1002 | ||
1003 | default: | 1003 | default: |
1004 | error("Unrecognized arg type (not exiting)"); | 1004 | error("Unrecognized arg type (not exiting)"); |
1005 | returnVal = wmERROR; | 1005 | returnVal = wmERROR; |
1006 | } | 1006 | } |
1007 | } | 1007 | } |
1008 | return returnVal; | 1008 | return returnVal; |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | void SendBuffer(void *htmsocket, OSCbuf *buf) { | 1011 | void SendBuffer(void *htmsocket, OSCbuf *buf) { |
1012 | #ifdef DEBUG | 1012 | #ifdef DEBUG |
1013 | printf("Sending buffer...\n"); | 1013 | printf("Sending buffer...\n"); |
1014 | #endif | 1014 | #endif |
1015 | if (OSC_isBufferEmpty(buf)) { | 1015 | if (OSC_isBufferEmpty(buf)) { |
1016 | post("SendBuffer() called but buffer empty"); | 1016 | post("SendBuffer() called but buffer empty"); |
1017 | return; | 1017 | return; |
1018 | } | 1018 | } |
1019 | if (!OSC_isBufferDone(buf)) { | 1019 | if (!OSC_isBufferDone(buf)) { |
1020 | error("SendBuffer() called but buffer not ready!, not exiting"); | 1020 | error("SendBuffer() called but buffer not ready!, not exiting"); |
1021 | return; //{{raf}} | 1021 | return; //{{raf}} |
1022 | } | 1022 | } |
1023 | SendData(htmsocket, OSC_packetSize(buf), OSC_getPacket(buf)); | 1023 | SendData(htmsocket, OSC_packetSize(buf), OSC_getPacket(buf)); |
1024 | } | 1024 | } |
1025 | 1025 | ||
1026 | void SendData(void *htmsocket, int size, char *data) { | 1026 | void SendData(void *htmsocket, int size, char *data) { |
1027 | if (!SendHTMSocket(htmsocket, size, data)) { | 1027 | if (!SendHTMSocket(htmsocket, size, data)) { |
1028 | post("SendData::SendHTMSocket()failure -- not connected"); | 1028 | post("SendData::SendHTMSocket()failure -- not connected"); |
1029 | CloseHTMSocket(htmsocket); | 1029 | CloseHTMSocket(htmsocket); |
1030 | } | 1030 | } |
1031 | } | 1031 | } |
1032 | 1032 | ||
1033 | 1033 | ||
1034 | 1034 | ||
1035 | /* ---------------------- | 1035 | /* ---------------------- |
1036 | OSC-client code | 1036 | OSC-client code |
1037 | 1037 | ||
1038 | */ | 1038 | */ |
1039 | 1039 | ||
1040 | /* Here are the possible values of the state field: */ | 1040 | /* Here are the possible values of the state field: */ |
1041 | 1041 | ||
1042 | #define EMPTY 0 /* Nothing written to packet yet */ | 1042 | #define EMPTY 0 /* Nothing written to packet yet */ |
1043 | #define ONE_MSG_ARGS 1 /* Packet has a single message; gathering arguments */ | 1043 | #define ONE_MSG_ARGS 1 /* Packet has a single message; gathering arguments */ |
1044 | #define NEED_COUNT 2 /* Just opened a bundle; must write message name or | 1044 | #define NEED_COUNT 2 /* Just opened a bundle; must write message name or |
1045 | open another bundle */ | 1045 | open another bundle */ |
1046 | #define GET_ARGS 3 /* Getting arguments to a message. If we see a message | 1046 | #define GET_ARGS 3 /* Getting arguments to a message. If we see a message |
1047 | name or a bundle open/close then the current message | 1047 | name or a bundle open/close then the current message |
1048 | will end. */ | 1048 | will end. */ |
1049 | #define DONE 4 /* All open bundles have been closed, so can't write | 1049 | #define DONE 4 /* All open bundles have been closed, so can't write |
1050 | anything else */ | 1050 | anything else */ |
1051 | 1051 | ||
1052 | #ifdef WIN32 | 1052 | #ifdef WIN32 |
1053 | #include <winsock2.h> | 1053 | #include <winsock2.h> |
1054 | #include <io.h> | 1054 | #include <io.h> |
1055 | #include <stdio.h> | 1055 | #include <stdio.h> |
1056 | #include <errno.h> | 1056 | #include <errno.h> |
1057 | #include <fcntl.h> | 1057 | #include <fcntl.h> |
1058 | #include <sys/types.h> | 1058 | #include <sys/types.h> |
1059 | #include <sys/stat.h> | 1059 | #include <sys/stat.h> |
1060 | #endif | 1060 | #endif |
1061 | 1061 | ||
1062 | #ifdef __APPLE__ | 1062 | #ifdef __APPLE__ |
1063 | #include <sys/types.h> | 1063 | #include <sys/types.h> |
1064 | #endif | 1064 | #endif |
1065 | 1065 | ||
1066 | #ifdef unix | 1066 | #ifdef unix |
1067 | #include <netinet/in.h> | 1067 | #include <netinet/in.h> |
1068 | #include <stdio.h> | 1068 | #include <stdio.h> |
1069 | #endif | 1069 | #endif |
1070 | 1070 | ||
1071 | 1071 | ||
1072 | char *OSC_errorMessage; | 1072 | char *OSC_errorMessage; |
1073 | 1073 | ||
1074 | static int OSC_padString(char *dest, char *str); | 1074 | static int OSC_padString(char *dest, char *str); |
1075 | static int OSC_padStringWithAnExtraStupidComma(char *dest, char *str); | 1075 | static int OSC_padStringWithAnExtraStupidComma(char *dest, char *str); |
1076 | static int OSC_WritePadding(char *dest, int i); | 1076 | static int OSC_WritePadding(char *dest, int i); |
1077 | static int CheckTypeTag(OSCbuf *buf, char expectedType); | 1077 | static int CheckTypeTag(OSCbuf *buf, char expectedType); |
1078 | 1078 | ||
1079 | void OSC_initBuffer(OSCbuf *buf, int size, char *byteArray) { | 1079 | void OSC_initBuffer(OSCbuf *buf, int size, char *byteArray) { |
1080 | buf->buffer = byteArray; | 1080 | buf->buffer = byteArray; |
1081 | buf->size = size; | 1081 | buf->size = size; |
1082 | OSC_resetBuffer(buf); | 1082 | OSC_resetBuffer(buf); |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | void OSC_resetBuffer(OSCbuf *buf) { | 1085 | void OSC_resetBuffer(OSCbuf *buf) { |
1086 | buf->bufptr = buf->buffer; | 1086 | buf->bufptr = buf->buffer; |
1087 | buf->state = EMPTY; | 1087 | buf->state = EMPTY; |
1088 | buf->bundleDepth = 0; | 1088 | buf->bundleDepth = 0; |
1089 | buf->prevCounts[0] = 0; | 1089 | buf->prevCounts[0] = 0; |
1090 | buf->gettingFirstUntypedArg = 0; | 1090 | buf->gettingFirstUntypedArg = 0; |
1091 | buf->typeStringPtr = 0; | 1091 | buf->typeStringPtr = 0; |
1092 | } | 1092 | } |
1093 | 1093 | ||
1094 | int OSC_isBufferEmpty(OSCbuf *buf) { | 1094 | int OSC_isBufferEmpty(OSCbuf *buf) { |
1095 | return buf->bufptr == buf->buffer; | 1095 | return buf->bufptr == buf->buffer; |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | int OSC_freeSpaceInBuffer(OSCbuf *buf) { | 1098 | int OSC_freeSpaceInBuffer(OSCbuf *buf) { |
1099 | return buf->size - (buf->bufptr - buf->buffer); | 1099 | return buf->size - (buf->bufptr - buf->buffer); |
1100 | } | 1100 | } |
1101 | 1101 | ||
1102 | int OSC_isBufferDone(OSCbuf *buf) { | 1102 | int OSC_isBufferDone(OSCbuf *buf) { |
1103 | return (buf->state == DONE || buf->state == ONE_MSG_ARGS); | 1103 | return (buf->state == DONE || buf->state == ONE_MSG_ARGS); |
1104 | } | 1104 | } |
1105 | 1105 | ||
1106 | char *OSC_getPacket(OSCbuf *buf) { | 1106 | char *OSC_getPacket(OSCbuf *buf) { |
1107 | #ifdef ERROR_CHECK_GETPACKET | 1107 | #ifdef ERROR_CHECK_GETPACKET |
1108 | if (buf->state == DONE || buf->state == ONE_MSG_ARGS) { | 1108 | if (buf->state == DONE || buf->state == ONE_MSG_ARGS) { |
1109 | return buf->buffer; | 1109 | return buf->buffer; |
1110 | } else { | 1110 | } else { |
1111 | OSC_errorMessage = "Packet has unterminated bundles"; | 1111 | OSC_errorMessage = "Packet has unterminated bundles"; |
1112 | return 0; | 1112 | return 0; |
1113 | } | 1113 | } |
1114 | #else | 1114 | #else |
1115 | return buf->buffer; | 1115 | return buf->buffer; |
1116 | #endif | 1116 | #endif |
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | int OSC_packetSize(OSCbuf *buf) { | 1119 | int OSC_packetSize(OSCbuf *buf) { |
1120 | #ifdef ERROR_CHECK_PACKETSIZE | 1120 | #ifdef ERROR_CHECK_PACKETSIZE |
1121 | if (buf->state == DONE || buf->state == ONE_MSG_ARGS) { | 1121 | if (buf->state == DONE || buf->state == ONE_MSG_ARGS) { |
1122 | return (buf->bufptr - buf->buffer); | 1122 | return (buf->bufptr - buf->buffer); |
1123 | } else { | 1123 | } else { |
1124 | OSC_errorMessage = "Packet has unterminated bundles"; | 1124 | OSC_errorMessage = "Packet has unterminated bundles"; |
1125 | return 0; | 1125 | return 0; |
1126 | } | 1126 | } |
1127 | #else | 1127 | #else |
1128 | return (buf->bufptr - buf->buffer); | 1128 | return (buf->bufptr - buf->buffer); |
1129 | #endif | 1129 | #endif |
1130 | } | 1130 | } |
1131 | 1131 | ||
1132 | #define CheckOverflow(buf, bytesNeeded) { if ((bytesNeeded) > OSC_freeSpaceInBuffer(buf)) {OSC_errorMessage = "buffer overflow"; return 1;}} | 1132 | #define CheckOverflow(buf, bytesNeeded) { if ((bytesNeeded) > OSC_freeSpaceInBuffer(buf)) {OSC_errorMessage = "buffer overflow"; return 1;}} |
1133 | 1133 | ||
1134 | static void PatchMessageSize(OSCbuf *buf) { | 1134 | static void PatchMessageSize(OSCbuf *buf) { |
1135 | int4byte size; | 1135 | int4byte size; |
1136 | size = buf->bufptr - ((char *) buf->thisMsgSize) - 4; | 1136 | size = buf->bufptr - ((char *) buf->thisMsgSize) - 4; |
1137 | *(buf->thisMsgSize) = htonl(size); | 1137 | *(buf->thisMsgSize) = htonl(size); |
1138 | } | 1138 | } |
1139 | 1139 | ||
1140 | int OSC_openBundle(OSCbuf *buf, OSCTimeTag tt) { | 1140 | int OSC_openBundle(OSCbuf *buf, OSCTimeTag tt) { |
1141 | if (buf->state == ONE_MSG_ARGS) { | 1141 | if (buf->state == ONE_MSG_ARGS) { |
1142 | OSC_errorMessage = "Can't open a bundle in a one-message packet"; | 1142 | OSC_errorMessage = "Can't open a bundle in a one-message packet"; |
1143 | return 3; | 1143 | return 3; |
1144 | } | 1144 | } |
1145 | 1145 | ||
1146 | if (buf->state == DONE) { | 1146 | if (buf->state == DONE) { |
1147 | OSC_errorMessage = "This packet is finished; can't open a new bundle"; | 1147 | OSC_errorMessage = "This packet is finished; can't open a new bundle"; |
1148 | return 4; | 1148 | return 4; |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | if (++(buf->bundleDepth) >= MAX_BUNDLE_NESTING) { | 1151 | if (++(buf->bundleDepth) >= MAX_BUNDLE_NESTING) { |
1152 | OSC_errorMessage = "Bundles nested too deeply; change MAX_BUNDLE_NESTING in OpenSoundControl.h"; | 1152 | OSC_errorMessage = "Bundles nested too deeply; change MAX_BUNDLE_NESTING in OpenSoundControl.h"; |
1153 | return 2; | 1153 | return 2; |
1154 | } | 1154 | } |
1155 | 1155 | ||
1156 | if (CheckTypeTag(buf, '\0')) return 9; | 1156 | if (CheckTypeTag(buf, '\0')) return 9; |
1157 | 1157 | ||
1158 | if (buf->state == GET_ARGS) { | 1158 | if (buf->state == GET_ARGS) { |
1159 | PatchMessageSize(buf); | 1159 | PatchMessageSize(buf); |
1160 | } | 1160 | } |
1161 | 1161 | ||
1162 | if (buf->state == EMPTY) { | 1162 | if (buf->state == EMPTY) { |
1163 | /* Need 16 bytes for "#bundle" and time tag */ | 1163 | /* Need 16 bytes for "#bundle" and time tag */ |
1164 | CheckOverflow(buf, 16); | 1164 | CheckOverflow(buf, 16); |
1165 | } else { | 1165 | } else { |
1166 | /* This bundle is inside another bundle, so we need to leave | 1166 | /* This bundle is inside another bundle, so we need to leave |
1167 | a blank size count for the size of this current bundle. */ | 1167 | a blank size count for the size of this current bundle. */ |
1168 | CheckOverflow(buf, 20); | 1168 | CheckOverflow(buf, 20); |
1169 | *((int4byte *)buf->bufptr) = 0xaaaaaaaa; | 1169 | *((int4byte *)buf->bufptr) = 0xaaaaaaaa; |
1170 | buf->prevCounts[buf->bundleDepth] = (int4byte *)buf->bufptr; | 1170 | buf->prevCounts[buf->bundleDepth] = (int4byte *)buf->bufptr; |
1171 | 1171 | ||
1172 | buf->bufptr += 4; | 1172 | buf->bufptr += 4; |
1173 | } | 1173 | } |
1174 | 1174 | ||
1175 | buf->bufptr += OSC_padString(buf->bufptr, "#bundle"); | 1175 | buf->bufptr += OSC_padString(buf->bufptr, "#bundle"); |
1176 | 1176 | ||
1177 | 1177 | ||
1178 | *((OSCTimeTag *) buf->bufptr) = tt; | 1178 | *((OSCTimeTag *) buf->bufptr) = tt; |
1179 | 1179 | ||
1180 | if (htonl(1) != 1) { | 1180 | if (htonl(1) != 1) { |
1181 | /* Byte swap the 8-byte integer time tag */ | 1181 | /* Byte swap the 8-byte integer time tag */ |
1182 | int4byte *intp = (int4byte *)buf->bufptr; | 1182 | int4byte *intp = (int4byte *)buf->bufptr; |
1183 | intp[0] = htonl(intp[0]); | 1183 | intp[0] = htonl(intp[0]); |
1184 | intp[1] = htonl(intp[1]); | 1184 | intp[1] = htonl(intp[1]); |
1185 | 1185 | ||
1186 | #ifdef HAS8BYTEINT | 1186 | #ifdef HAS8BYTEINT |
1187 | { /* tt is a 64-bit int so we have to swap the two 32-bit words. | 1187 | { /* tt is a 64-bit int so we have to swap the two 32-bit words. |
1188 | (Otherwise tt is a struct of two 32-bit words, and even though | 1188 | (Otherwise tt is a struct of two 32-bit words, and even though |
1189 | each word was wrong-endian, they were in the right order | 1189 | each word was wrong-endian, they were in the right order |
1190 | in the struct.) */ | 1190 | in the struct.) */ |
1191 | int4byte temp = intp[0]; | 1191 | int4byte temp = intp[0]; |
1192 | intp[0] = intp[1]; | 1192 | intp[0] = intp[1]; |
1193 | intp[1] = temp; | 1193 | intp[1] = temp; |
1194 | } | 1194 | } |
1195 | #endif | 1195 | #endif |
1196 | } | 1196 | } |
1197 | 1197 | ||
1198 | buf->bufptr += sizeof(OSCTimeTag); | 1198 | buf->bufptr += sizeof(OSCTimeTag); |
1199 | 1199 | ||
1200 | buf->state = NEED_COUNT; | 1200 | buf->state = NEED_COUNT; |
1201 | 1201 | ||
1202 | buf->gettingFirstUntypedArg = 0; | 1202 | buf->gettingFirstUntypedArg = 0; |
1203 | buf->typeStringPtr = 0; | 1203 | buf->typeStringPtr = 0; |
1204 | return 0; | 1204 | return 0; |
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | 1207 | ||
1208 | int OSC_closeBundle(OSCbuf *buf) { | 1208 | int OSC_closeBundle(OSCbuf *buf) { |
1209 | if (buf->bundleDepth == 0) { | 1209 | if (buf->bundleDepth == 0) { |
1210 | /* This handles EMPTY, ONE_MSG, ARGS, and DONE */ | 1210 | /* This handles EMPTY, ONE_MSG, ARGS, and DONE */ |
1211 | OSC_errorMessage = "Can't close bundle; no bundle is open!"; | 1211 | OSC_errorMessage = "Can't close bundle; no bundle is open!"; |
1212 | return 5; | 1212 | return 5; |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | if (CheckTypeTag(buf, '\0')) return 9; | 1215 | if (CheckTypeTag(buf, '\0')) return 9; |
1216 | 1216 | ||
1217 | if (buf->state == GET_ARGS) { | 1217 | if (buf->state == GET_ARGS) { |
1218 | PatchMessageSize(buf); | 1218 | PatchMessageSize(buf); |
1219 | } | 1219 | } |
1220 | 1220 | ||
1221 | if (buf->bundleDepth == 1) { | 1221 | if (buf->bundleDepth == 1) { |
1222 | /* Closing the last bundle: No bundle size to patch */ | 1222 | /* Closing the last bundle: No bundle size to patch */ |
1223 | buf->state = DONE; | 1223 | buf->state = DONE; |
1224 | } else { | 1224 | } else { |
1225 | /* Closing a sub-bundle: patch bundle size */ | 1225 | /* Closing a sub-bundle: patch bundle size */ |
1226 | int size = buf->bufptr - ((char *) buf->prevCounts[buf->bundleDepth]) - 4; | 1226 | int size = buf->bufptr - ((char *) buf->prevCounts[buf->bundleDepth]) - 4; |
1227 | *(buf->prevCounts[buf->bundleDepth]) = htonl(size); | 1227 | *(buf->prevCounts[buf->bundleDepth]) = htonl(size); |
1228 | buf->state = NEED_COUNT; | 1228 | buf->state = NEED_COUNT; |
1229 | } | 1229 | } |
1230 | 1230 | ||
1231 | --buf->bundleDepth; | 1231 | --buf->bundleDepth; |
1232 | buf->gettingFirstUntypedArg = 0; | 1232 | buf->gettingFirstUntypedArg = 0; |
1233 | buf->typeStringPtr = 0; | 1233 | buf->typeStringPtr = 0; |
1234 | return 0; | 1234 | return 0; |
1235 | } | 1235 | } |
1236 | 1236 | ||
1237 | 1237 | ||
1238 | int OSC_closeAllBundles(OSCbuf *buf) { | 1238 | int OSC_closeAllBundles(OSCbuf *buf) { |
1239 | if (buf->bundleDepth == 0) { | 1239 | if (buf->bundleDepth == 0) { |
1240 | /* This handles EMPTY, ONE_MSG, ARGS, and DONE */ | 1240 | /* This handles EMPTY, ONE_MSG, ARGS, and DONE */ |
1241 | OSC_errorMessage = "Can't close all bundles; no bundle is open!"; | 1241 | OSC_errorMessage = "Can't close all bundles; no bundle is open!"; |
1242 | return 6; | 1242 | return 6; |
1243 | } | 1243 | } |
1244 | 1244 | ||
1245 | if (CheckTypeTag(buf, '\0')) return 9; | 1245 | if (CheckTypeTag(buf, '\0')) return 9; |
1246 | 1246 | ||
1247 | while (buf->bundleDepth > 0) { | 1247 | while (buf->bundleDepth > 0) { |
1248 | OSC_closeBundle(buf); | 1248 | OSC_closeBundle(buf); |
1249 | } | 1249 | } |
1250 | buf->typeStringPtr = 0; | 1250 | buf->typeStringPtr = 0; |
1251 | return 0; | 1251 | return 0; |
1252 | } | 1252 | } |
1253 | 1253 | ||
1254 | int OSC_writeAddress(OSCbuf *buf, char *name) { | 1254 | int OSC_writeAddress(OSCbuf *buf, char *name) { |
1255 | int4byte paddedLength; | 1255 | int4byte paddedLength; |
1256 | 1256 | ||
1257 | if (buf->state == ONE_MSG_ARGS) { | 1257 | if (buf->state == ONE_MSG_ARGS) { |
1258 | OSC_errorMessage = "This packet is not a bundle, so you can't write another address"; | 1258 | OSC_errorMessage = "This packet is not a bundle, so you can't write another address"; |
1259 | return 7; | 1259 | return 7; |
1260 | } | 1260 | } |
1261 | 1261 | ||
1262 | if (buf->state == DONE) { | 1262 | if (buf->state == DONE) { |
1263 | OSC_errorMessage = "This packet is finished; can't write another address"; | 1263 | OSC_errorMessage = "This packet is finished; can't write another address"; |
1264 | return 8; | 1264 | return 8; |
1265 | } | 1265 | } |
1266 | 1266 | ||
1267 | if (CheckTypeTag(buf, '\0')) return 9; | 1267 | if (CheckTypeTag(buf, '\0')) return 9; |
1268 | 1268 | ||
1269 | paddedLength = OSC_effectiveStringLength(name); | 1269 | paddedLength = OSC_effectiveStringLength(name); |
1270 | 1270 | ||
1271 | if (buf->state == EMPTY) { | 1271 | if (buf->state == EMPTY) { |
1272 | /* This will be a one-message packet, so no sizes to worry about */ | 1272 | /* This will be a one-message packet, so no sizes to worry about */ |
1273 | CheckOverflow(buf, paddedLength); | 1273 | CheckOverflow(buf, paddedLength); |
1274 | buf->state = ONE_MSG_ARGS; | 1274 | buf->state = ONE_MSG_ARGS; |
1275 | } else { | 1275 | } else { |
1276 | /* GET_ARGS or NEED_COUNT */ | 1276 | /* GET_ARGS or NEED_COUNT */ |
1277 | CheckOverflow(buf, 4+paddedLength); | 1277 | CheckOverflow(buf, 4+paddedLength); |
1278 | if (buf->state == GET_ARGS) { | 1278 | if (buf->state == GET_ARGS) { |
1279 | /* Close the old message */ | 1279 | /* Close the old message */ |
1280 | PatchMessageSize(buf); | 1280 | PatchMessageSize(buf); |
1281 | } | 1281 | } |
1282 | buf->thisMsgSize = (int4byte *)buf->bufptr; | 1282 | buf->thisMsgSize = (int4byte *)buf->bufptr; |
1283 | *(buf->thisMsgSize) = 0xbbbbbbbb; | 1283 | *(buf->thisMsgSize) = 0xbbbbbbbb; |
1284 | buf->bufptr += 4; | 1284 | buf->bufptr += 4; |
1285 | buf->state = GET_ARGS; | 1285 | buf->state = GET_ARGS; |
1286 | } | 1286 | } |
1287 | 1287 | ||
1288 | /* Now write the name */ | 1288 | /* Now write the name */ |
1289 | buf->bufptr += OSC_padString(buf->bufptr, name); | 1289 | buf->bufptr += OSC_padString(buf->bufptr, name); |
1290 | buf->typeStringPtr = 0; | 1290 | buf->typeStringPtr = 0; |
1291 | buf->gettingFirstUntypedArg = 1; | 1291 | buf->gettingFirstUntypedArg = 1; |
1292 | 1292 | ||
1293 | return 0; | 1293 | return 0; |
1294 | } | 1294 | } |
1295 | 1295 | ||
1296 | int OSC_writeAddressAndTypes(OSCbuf *buf, char *name, char *types) { | 1296 | int OSC_writeAddressAndTypes(OSCbuf *buf, char *name, char *types) { |
1297 | int result; | 1297 | int result; |
1298 | int4byte paddedLength; | 1298 | int4byte paddedLength; |
1299 | 1299 | ||
1300 | if (CheckTypeTag(buf, '\0')) return 9; | 1300 | if (CheckTypeTag(buf, '\0')) return 9; |
1301 | 1301 | ||
1302 | result = OSC_writeAddress(buf, name); | 1302 | result = OSC_writeAddress(buf, name); |
1303 | 1303 | ||
1304 | if (result) return result; | 1304 | if (result) return result; |
1305 | 1305 | ||
1306 | paddedLength = OSC_effectiveStringLength(types); | 1306 | paddedLength = OSC_effectiveStringLength(types); |
1307 | 1307 | ||
1308 | CheckOverflow(buf, paddedLength); | 1308 | CheckOverflow(buf, paddedLength); |
1309 | 1309 | ||
1310 | buf->typeStringPtr = buf->bufptr + 1; /* skip comma */ | 1310 | buf->typeStringPtr = buf->bufptr + 1; /* skip comma */ |
1311 | buf->bufptr += OSC_padString(buf->bufptr, types); | 1311 | buf->bufptr += OSC_padString(buf->bufptr, types); |
1312 | 1312 | ||
1313 | buf->gettingFirstUntypedArg = 0; | 1313 | buf->gettingFirstUntypedArg = 0; |
1314 | return 0; | 1314 | return 0; |
1315 | } | 1315 | } |
1316 | 1316 | ||
1317 | static int CheckTypeTag(OSCbuf *buf, char expectedType) { | 1317 | static int CheckTypeTag(OSCbuf *buf, char expectedType) { |
1318 | if (buf->typeStringPtr) { | 1318 | if (buf->typeStringPtr) { |
1319 | if (*(buf->typeStringPtr) != expectedType) { | 1319 | if (*(buf->typeStringPtr) != expectedType) { |
1320 | if (expectedType == '\0') { | 1320 | if (expectedType == '\0') { |
1321 | OSC_errorMessage = | 1321 | OSC_errorMessage = |
1322 | "According to the type tag I expected more arguments."; | 1322 | "According to the type tag I expected more arguments."; |
1323 | } else if (*(buf->typeStringPtr) == '\0') { | 1323 | } else if (*(buf->typeStringPtr) == '\0') { |
1324 | OSC_errorMessage = | 1324 | OSC_errorMessage = |
1325 | "According to the type tag I didn't expect any more arguments."; | 1325 | "According to the type tag I didn't expect any more arguments."; |
1326 | } else { | 1326 | } else { |
1327 | OSC_errorMessage = | 1327 | OSC_errorMessage = |
1328 | "According to the type tag I expected an argument of a different type."; | 1328 | "According to the type tag I expected an argument of a different type."; |
1329 | printf("* Expected %c, string now %s\n", expectedType, buf->typeStringPtr); | 1329 | printf("* Expected %c, string now %s\n", expectedType, buf->typeStringPtr); |
1330 | } | 1330 | } |
1331 | return 9; | 1331 | return 9; |
1332 | } | 1332 | } |
1333 | ++(buf->typeStringPtr); | 1333 | ++(buf->typeStringPtr); |
1334 | } | 1334 | } |
1335 | return 0; | 1335 | return 0; |
1336 | } | 1336 | } |
1337 | 1337 | ||
1338 | 1338 | ||
1339 | int OSC_writeFloatArg(OSCbuf *buf, float arg) { | 1339 | int OSC_writeFloatArg(OSCbuf *buf, float arg) { |
1340 | int4byte *intp; | 1340 | int4byte *intp; |
1341 | //int result; | 1341 | //int result; |
1342 | 1342 | ||
1343 | CheckOverflow(buf, 4); | 1343 | CheckOverflow(buf, 4); |
1344 | 1344 | ||
1345 | if (CheckTypeTag(buf, 'f')) return 9; | 1345 | if (CheckTypeTag(buf, 'f')) return 9; |
1346 | 1346 | ||
1347 | /* Pretend arg is a long int so we can use htonl() */ | 1347 | /* Pretend arg is a long int so we can use htonl() */ |
1348 | intp = ((int4byte *) &arg); | 1348 | intp = ((int4byte *) &arg); |
1349 | *((int4byte *) buf->bufptr) = htonl(*intp); | 1349 | *((int4byte *) buf->bufptr) = htonl(*intp); |
1350 | 1350 | ||
1351 | buf->bufptr += 4; | 1351 | buf->bufptr += 4; |
1352 | 1352 | ||
1353 | buf->gettingFirstUntypedArg = 0; | 1353 | buf->gettingFirstUntypedArg = 0; |
1354 | return 0; | 1354 | return 0; |
1355 | } | 1355 | } |
1356 | 1356 | ||
1357 | 1357 | ||
1358 | 1358 | ||
1359 | int OSC_writeFloatArgs(OSCbuf *buf, int numFloats, float *args) { | 1359 | int OSC_writeFloatArgs(OSCbuf *buf, int numFloats, float *args) { |
1360 | int i; | 1360 | int i; |
1361 | int4byte *intp; | 1361 | int4byte *intp; |
1362 | 1362 | ||
1363 | CheckOverflow(buf, 4 * numFloats); | 1363 | CheckOverflow(buf, 4 * numFloats); |
1364 | 1364 | ||
1365 | /* Pretend args are long ints so we can use htonl() */ | 1365 | /* Pretend args are long ints so we can use htonl() */ |
1366 | intp = ((int4byte *) args); | 1366 | intp = ((int4byte *) args); |
1367 | 1367 | ||
1368 | for (i = 0; i < numFloats; i++) { | 1368 | for (i = 0; i < numFloats; i++) { |
1369 | if (CheckTypeTag(buf, 'f')) return 9; | 1369 | if (CheckTypeTag(buf, 'f')) return 9; |
1370 | *((int4byte *) buf->bufptr) = htonl(intp[i]); | 1370 | *((int4byte *) buf->bufptr) = htonl(intp[i]); |
1371 | buf->bufptr += 4; | 1371 | buf->bufptr += 4; |
1372 | } | 1372 | } |
1373 | 1373 | ||
1374 | buf->gettingFirstUntypedArg = 0; | 1374 | buf->gettingFirstUntypedArg = 0; |
1375 | return 0; | 1375 | return 0; |
1376 | } | 1376 | } |
1377 | 1377 | ||
1378 | int OSC_writeIntArg(OSCbuf *buf, int4byte arg) { | 1378 | int OSC_writeIntArg(OSCbuf *buf, int4byte arg) { |
1379 | CheckOverflow(buf, 4); | 1379 | CheckOverflow(buf, 4); |
1380 | if (CheckTypeTag(buf, 'i')) return 9; | 1380 | if (CheckTypeTag(buf, 'i')) return 9; |
1381 | 1381 | ||
1382 | *((int4byte *) buf->bufptr) = htonl(arg); | 1382 | *((int4byte *) buf->bufptr) = htonl(arg); |
1383 | buf->bufptr += 4; | 1383 | buf->bufptr += 4; |
1384 | 1384 | ||
1385 | buf->gettingFirstUntypedArg = 0; | 1385 | buf->gettingFirstUntypedArg = 0; |
1386 | return 0; | 1386 | return 0; |
1387 | } | 1387 | } |
1388 | 1388 | ||
1389 | int OSC_writeStringArg(OSCbuf *buf, char *arg) { | 1389 | int OSC_writeStringArg(OSCbuf *buf, char *arg) { |
1390 | int len; | 1390 | int len; |
1391 | 1391 | ||
1392 | if (CheckTypeTag(buf, 's')) return 9; | 1392 | if (CheckTypeTag(buf, 's')) return 9; |
1393 | 1393 | ||
1394 | len = OSC_effectiveStringLength(arg); | 1394 | len = OSC_effectiveStringLength(arg); |
1395 | 1395 | ||
1396 | if (buf->gettingFirstUntypedArg && arg[0] == ',') { | 1396 | if (buf->gettingFirstUntypedArg && arg[0] == ',') { |
1397 | /* This un-type-tagged message starts with a string | 1397 | /* This un-type-tagged message starts with a string |
1398 | that starts with a comma, so we have to escape it | 1398 | that starts with a comma, so we have to escape it |
1399 | (with a double comma) so it won't look like a type | 1399 | (with a double comma) so it won't look like a type |
1400 | tag string. */ | 1400 | tag string. */ |
1401 | 1401 | ||
1402 | CheckOverflow(buf, len+4); /* Too conservative */ | 1402 | CheckOverflow(buf, len+4); /* Too conservative */ |
1403 | buf->bufptr += | 1403 | buf->bufptr += |
1404 | OSC_padStringWithAnExtraStupidComma(buf->bufptr, arg); | 1404 | OSC_padStringWithAnExtraStupidComma(buf->bufptr, arg); |
1405 | 1405 | ||
1406 | } else { | 1406 | } else { |
1407 | CheckOverflow(buf, len); | 1407 | CheckOverflow(buf, len); |
1408 | buf->bufptr += OSC_padString(buf->bufptr, arg); | 1408 | buf->bufptr += OSC_padString(buf->bufptr, arg); |
1409 | } | 1409 | } |
1410 | 1410 | ||
1411 | buf->gettingFirstUntypedArg = 0; | 1411 | buf->gettingFirstUntypedArg = 0; |
1412 | return 0; | 1412 | return 0; |
1413 | 1413 | ||
1414 | } | 1414 | } |
1415 | 1415 | ||
1416 | /* String utilities */ | 1416 | /* String utilities */ |
1417 | 1417 | ||
1418 | #define STRING_ALIGN_PAD 4 | 1418 | #define STRING_ALIGN_PAD 4 |
1419 | int OSC_effectiveStringLength(char *string) { | 1419 | int OSC_effectiveStringLength(char *string) { |
1420 | int len = strlen(string) + 1; /* We need space for the null char. */ | 1420 | int len = strlen(string) + 1; /* We need space for the null char. */ |
1421 | 1421 | ||
1422 | /* Round up len to next multiple of STRING_ALIGN_PAD to account for alignment padding */ | 1422 | /* Round up len to next multiple of STRING_ALIGN_PAD to account for alignment padding */ |
1423 | if ((len % STRING_ALIGN_PAD) != 0) { | 1423 | if ((len % STRING_ALIGN_PAD) != 0) { |
1424 | len += STRING_ALIGN_PAD - (len % STRING_ALIGN_PAD); | 1424 | len += STRING_ALIGN_PAD - (len % STRING_ALIGN_PAD); |
1425 | } | 1425 | } |
1426 | return len; | 1426 | return len; |
1427 | } | 1427 | } |
1428 | 1428 | ||
1429 | static int OSC_padString(char *dest, char *str) { | 1429 | static int OSC_padString(char *dest, char *str) { |
1430 | int i; | 1430 | int i; |
1431 | 1431 | ||
1432 | for (i = 0; str[i] != '\0'; i++) { | 1432 | for (i = 0; str[i] != '\0'; i++) { |
1433 | dest[i] = str[i]; | 1433 | dest[i] = str[i]; |
1434 | } | 1434 | } |
1435 | 1435 | ||
1436 | return OSC_WritePadding(dest, i); | 1436 | return OSC_WritePadding(dest, i); |
1437 | } | 1437 | } |
1438 | 1438 | ||
1439 | static int OSC_padStringWithAnExtraStupidComma(char *dest, char *str) { | 1439 | static int OSC_padStringWithAnExtraStupidComma(char *dest, char *str) { |
1440 | int i; | 1440 | int i; |
1441 | 1441 | ||
1442 | dest[0] = ','; | 1442 | dest[0] = ','; |
1443 | for (i = 0; str[i] != '\0'; i++) { | 1443 | for (i = 0; str[i] != '\0'; i++) { |
1444 | dest[i+1] = str[i]; | 1444 | dest[i+1] = str[i]; |
1445 | } | 1445 | } |
1446 | 1446 | ||
1447 | return OSC_WritePadding(dest, i+1); | 1447 | return OSC_WritePadding(dest, i+1); |
1448 | } | 1448 | } |
1449 | 1449 | ||
1450 | static int OSC_WritePadding(char *dest, int i) { | 1450 | static int OSC_WritePadding(char *dest, int i) { |
1451 | dest[i] = '\0'; | 1451 | dest[i] = '\0'; |
1452 | i++; | 1452 | i++; |
1453 | 1453 | ||
1454 | for (; (i % STRING_ALIGN_PAD) != 0; i++) { | 1454 | for (; (i % STRING_ALIGN_PAD) != 0; i++) { |
1455 | dest[i] = '\0'; | 1455 | dest[i] = '\0'; |
1456 | } | 1456 | } |
1457 | 1457 | ||
1458 | return i; | 1458 | return i; |
1459 | } | 1459 | } |
1460 | 1460 | ||
1461 | 1461 | ||
diff --git a/apps/plugins/pdbox/PDa/extra/shell.c b/apps/plugins/pdbox/PDa/extra/shell.c index dd6b0e239d..51abc134bd 100644 --- a/apps/plugins/pdbox/PDa/extra/shell.c +++ b/apps/plugins/pdbox/PDa/extra/shell.c | |||
@@ -1,312 +1,312 @@ | |||
1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ | 1 | /* (C) Guenter Geiger <geiger@epy.co.at> */ |
2 | 2 | ||
3 | #include "m_pd.h" | 3 | #include "m_pd.h" |
4 | #ifdef NT | 4 | #ifdef NT |
5 | #pragma warning( disable : 4244 ) | 5 | #pragma warning( disable : 4244 ) |
6 | #pragma warning( disable : 4305 ) | 6 | #pragma warning( disable : 4305 ) |
7 | #endif | 7 | #endif |
8 | 8 | ||
9 | #include <unistd.h> | 9 | #include <unistd.h> |
10 | #include <stdlib.h> | 10 | #include <stdlib.h> |
11 | #include <string.h> | 11 | #include <string.h> |
12 | #include <stdio.h> | 12 | #include <stdio.h> |
13 | #include <sys/types.h> | 13 | #include <sys/types.h> |
14 | #include <sys/wait.h> | 14 | #include <sys/wait.h> |
15 | #include <signal.h> | 15 | #include <signal.h> |
16 | #include <sched.h> | 16 | #include <sched.h> |
17 | 17 | ||
18 | void sys_rmpollfn(int fd); | 18 | void sys_rmpollfn(int fd); |
19 | void sys_addpollfn(int fd, void* fn, void *ptr); | 19 | void sys_addpollfn(int fd, void* fn, void *ptr); |
20 | 20 | ||
21 | /* ------------------------ shell ----------------------------- */ | 21 | /* ------------------------ shell ----------------------------- */ |
22 | 22 | ||
23 | #define INBUFSIZE 1024 | 23 | #define INBUFSIZE 1024 |
24 | 24 | ||
25 | static t_class *shell_class; | 25 | static t_class *shell_class; |
26 | 26 | ||
27 | 27 | ||
28 | static void drop_priority(void) | 28 | static void drop_priority(void) |
29 | { | 29 | { |
30 | #ifdef _POSIX_PRIORITY_SCHEDULING | 30 | #ifdef _POSIX_PRIORITY_SCHEDULING |
31 | struct sched_param par; | 31 | struct sched_param par; |
32 | int p1 ,p2, p3; | 32 | int p1 ,p2, p3; |
33 | par.sched_priority = 0; | 33 | par.sched_priority = 0; |
34 | sched_setscheduler(0,SCHED_OTHER,&par); | 34 | sched_setscheduler(0,SCHED_OTHER,&par); |
35 | #endif | 35 | #endif |
36 | } | 36 | } |
37 | 37 | ||
38 | 38 | ||
39 | typedef struct _shell | 39 | typedef struct _shell |
40 | { | 40 | { |
41 | t_object x_obj; | 41 | t_object x_obj; |
42 | int x_echo; | 42 | int x_echo; |
43 | char *sr_inbuf; | 43 | char *sr_inbuf; |
44 | int sr_inhead; | 44 | int sr_inhead; |
45 | int sr_intail; | 45 | int sr_intail; |
46 | void* x_binbuf; | 46 | void* x_binbuf; |
47 | int fdpipe[2]; | 47 | int fdpipe[2]; |
48 | int fdinpipe[2]; | 48 | int fdinpipe[2]; |
49 | int pid; | 49 | int pid; |
50 | int x_del; | 50 | int x_del; |
51 | t_outlet* x_done; | 51 | t_outlet* x_done; |
52 | t_clock* x_clock; | 52 | t_clock* x_clock; |
53 | } t_shell; | 53 | } t_shell; |
54 | 54 | ||
55 | static int shell_pid; | 55 | static int shell_pid; |
56 | 56 | ||
57 | 57 | ||
58 | void shell_cleanup(t_shell* x) | 58 | void shell_cleanup(t_shell* x) |
59 | { | 59 | { |
60 | sys_rmpollfn(x->fdpipe[0]); | 60 | sys_rmpollfn(x->fdpipe[0]); |
61 | 61 | ||
62 | if (x->fdpipe[0]>0) close(x->fdpipe[0]); | 62 | if (x->fdpipe[0]>0) close(x->fdpipe[0]); |
63 | if (x->fdpipe[1]>0) close(x->fdpipe[1]); | 63 | if (x->fdpipe[1]>0) close(x->fdpipe[1]); |
64 | if (x->fdinpipe[0]>0) close(x->fdinpipe[0]); | 64 | if (x->fdinpipe[0]>0) close(x->fdinpipe[0]); |
65 | if (x->fdinpipe[1]>0) close(x->fdinpipe[1]); | 65 | if (x->fdinpipe[1]>0) close(x->fdinpipe[1]); |
66 | 66 | ||
67 | x->fdpipe[0] = -1; | 67 | x->fdpipe[0] = -1; |
68 | x->fdpipe[1] = -1; | 68 | x->fdpipe[1] = -1; |
69 | x->fdinpipe[0] = -1; | 69 | x->fdinpipe[0] = -1; |
70 | x->fdinpipe[1] = -1; | 70 | x->fdinpipe[1] = -1; |
71 | clock_unset(x->x_clock); | 71 | clock_unset(x->x_clock); |
72 | } | 72 | } |
73 | 73 | ||
74 | void shell_check(t_shell* x) | 74 | void shell_check(t_shell* x) |
75 | { | 75 | { |
76 | int ret; | 76 | int ret; |
77 | int status; | 77 | int status; |
78 | ret = waitpid(x->pid,&status,WNOHANG); | 78 | ret = waitpid(x->pid,&status,WNOHANG); |
79 | if (ret == x->pid) { | 79 | if (ret == x->pid) { |
80 | shell_cleanup(x); | 80 | shell_cleanup(x); |
81 | if (WIFEXITED(status)) { | 81 | if (WIFEXITED(status)) { |
82 | outlet_float(x->x_done,WEXITSTATUS(status)); | 82 | outlet_float(x->x_done,WEXITSTATUS(status)); |
83 | } | 83 | } |
84 | else outlet_float(x->x_done,0); | 84 | else outlet_float(x->x_done,0); |
85 | } | 85 | } |
86 | else { | 86 | else { |
87 | if (x->x_del < 100) x->x_del+=2; /* increment poll times */ | 87 | if (x->x_del < 100) x->x_del+=2; /* increment poll times */ |
88 | clock_delay(x->x_clock,x->x_del); | 88 | clock_delay(x->x_clock,x->x_del); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||
92 | 92 | ||
93 | void shell_bang(t_shell *x) | 93 | void shell_bang(t_shell *x) |
94 | { | 94 | { |
95 | post("bang"); | 95 | post("bang"); |
96 | } | 96 | } |
97 | 97 | ||
98 | /* snippet from pd's code */ | 98 | /* snippet from pd's code */ |
99 | static void shell_doit(void *z, t_binbuf *b) | 99 | static void shell_doit(void *z, t_binbuf *b) |
100 | { | 100 | { |
101 | t_shell *x = (t_shell *)z; | 101 | t_shell *x = (t_shell *)z; |
102 | int msg, natom = binbuf_getnatom(b); | 102 | int msg, natom = binbuf_getnatom(b); |
103 | t_atom *at = binbuf_getvec(b); | 103 | t_atom *at = binbuf_getvec(b); |
104 | 104 | ||
105 | for (msg = 0; msg < natom;) | 105 | for (msg = 0; msg < natom;) |
106 | { | 106 | { |
107 | int emsg; | 107 | int emsg; |
108 | for (emsg = msg; emsg < natom && at[emsg].a_type != A_COMMA | 108 | for (emsg = msg; emsg < natom && at[emsg].a_type != A_COMMA |
109 | && at[emsg].a_type != A_SEMI; emsg++) | 109 | && at[emsg].a_type != A_SEMI; emsg++) |
110 | ; | 110 | ; |
111 | if (emsg > msg) | 111 | if (emsg > msg) |
112 | { | 112 | { |
113 | int i; | 113 | int i; |
114 | for (i = msg; i < emsg; i++) | 114 | for (i = msg; i < emsg; i++) |
115 | if (at[i].a_type == A_DOLLAR || at[i].a_type == A_DOLLSYM) | 115 | if (at[i].a_type == A_DOLLAR || at[i].a_type == A_DOLLSYM) |
116 | { | 116 | { |
117 | pd_error(x, "netreceive: got dollar sign in message"); | 117 | pd_error(x, "netreceive: got dollar sign in message"); |
118 | goto nodice; | 118 | goto nodice; |
119 | } | 119 | } |
120 | if (at[msg].a_type == A_FLOAT) | 120 | if (at[msg].a_type == A_FLOAT) |
121 | { | 121 | { |
122 | if (emsg > msg + 1) | 122 | if (emsg > msg + 1) |
123 | outlet_list(x->x_obj.ob_outlet, 0, emsg-msg, at + msg); | 123 | outlet_list(x->x_obj.ob_outlet, 0, emsg-msg, at + msg); |
124 | else outlet_float(x->x_obj.ob_outlet, at[msg].a_w.w_float); | 124 | else outlet_float(x->x_obj.ob_outlet, at[msg].a_w.w_float); |
125 | } | 125 | } |
126 | else if (at[msg].a_type == A_SYMBOL) | 126 | else if (at[msg].a_type == A_SYMBOL) |
127 | outlet_anything(x->x_obj.ob_outlet, at[msg].a_w.w_symbol, | 127 | outlet_anything(x->x_obj.ob_outlet, at[msg].a_w.w_symbol, |
128 | emsg-msg-1, at + msg + 1); | 128 | emsg-msg-1, at + msg + 1); |
129 | } | 129 | } |
130 | nodice: | 130 | nodice: |
131 | msg = emsg + 1; | 131 | msg = emsg + 1; |
132 | } | 132 | } |
133 | } | 133 | } |
134 | 134 | ||
135 | 135 | ||
136 | void shell_read(t_shell *x, int fd) | 136 | void shell_read(t_shell *x, int fd) |
137 | { | 137 | { |
138 | char buf[INBUFSIZE]; | 138 | char buf[INBUFSIZE]; |
139 | t_binbuf* bbuf = binbuf_new(); | 139 | t_binbuf* bbuf = binbuf_new(); |
140 | int i; | 140 | int i; |
141 | int readto = | 141 | int readto = |
142 | (x->sr_inhead >= x->sr_intail ? INBUFSIZE : x->sr_intail-1); | 142 | (x->sr_inhead >= x->sr_intail ? INBUFSIZE : x->sr_intail-1); |
143 | int ret; | 143 | int ret; |
144 | 144 | ||
145 | ret = read(fd, buf,INBUFSIZE-1); | 145 | ret = read(fd, buf,INBUFSIZE-1); |
146 | buf[ret] = '\0'; | 146 | buf[ret] = '\0'; |
147 | 147 | ||
148 | for (i=0;i<ret;i++) | 148 | for (i=0;i<ret;i++) |
149 | if (buf[i] == '\n') buf[i] = ';'; | 149 | if (buf[i] == '\n') buf[i] = ';'; |
150 | if (ret < 0) | 150 | if (ret < 0) |
151 | { | 151 | { |
152 | error("shell: pipe read error"); | 152 | error("shell: pipe read error"); |
153 | sys_rmpollfn(fd); | 153 | sys_rmpollfn(fd); |
154 | x->fdpipe[0] = -1; | 154 | x->fdpipe[0] = -1; |
155 | close(fd); | 155 | close(fd); |
156 | return; | 156 | return; |
157 | } | 157 | } |
158 | else if (ret == 0) | 158 | else if (ret == 0) |
159 | { | 159 | { |
160 | post("EOF on socket %d\n", fd); | 160 | post("EOF on socket %d\n", fd); |
161 | sys_rmpollfn(fd); | 161 | sys_rmpollfn(fd); |
162 | x->fdpipe[0] = -1; | 162 | x->fdpipe[0] = -1; |
163 | close(fd); | 163 | close(fd); |
164 | return; | 164 | return; |
165 | } | 165 | } |
166 | else | 166 | else |
167 | { | 167 | { |
168 | int natom; | 168 | int natom; |
169 | t_atom *at; | 169 | t_atom *at; |
170 | binbuf_text(bbuf, buf, strlen(buf)); | 170 | binbuf_text(bbuf, buf, strlen(buf)); |
171 | 171 | ||
172 | natom = binbuf_getnatom(bbuf); | 172 | natom = binbuf_getnatom(bbuf); |
173 | at = binbuf_getvec(bbuf); | 173 | at = binbuf_getvec(bbuf); |
174 | shell_doit(x,bbuf); | 174 | shell_doit(x,bbuf); |
175 | } | 175 | } |
176 | binbuf_free(bbuf); | 176 | binbuf_free(bbuf); |
177 | } | 177 | } |
178 | 178 | ||
179 | 179 | ||
180 | static void shell_send(t_shell *x, t_symbol *s,int ac, t_atom *at) | 180 | static void shell_send(t_shell *x, t_symbol *s,int ac, t_atom *at) |
181 | { | 181 | { |
182 | int i; | 182 | int i; |
183 | char tmp[MAXPDSTRING]; | 183 | char tmp[MAXPDSTRING]; |
184 | int size = 0; | 184 | int size = 0; |
185 | 185 | ||
186 | if (x->fdinpipe[0] == -1) return; /* nothing to send to */ | 186 | if (x->fdinpipe[0] == -1) return; /* nothing to send to */ |
187 | 187 | ||
188 | for (i=0;i<ac;i++) { | 188 | for (i=0;i<ac;i++) { |
189 | atom_string(at,tmp+size,MAXPDSTRING - size); | 189 | atom_string(at,tmp+size,MAXPDSTRING - size); |
190 | at++; | 190 | at++; |
191 | size=strlen(tmp); | 191 | size=strlen(tmp); |
192 | tmp[size++] = ' '; | 192 | tmp[size++] = ' '; |
193 | } | 193 | } |
194 | tmp[size-1] = '\0'; | 194 | tmp[size-1] = '\0'; |
195 | post("sending %s",tmp); | 195 | post("sending %s",tmp); |
196 | write(x->fdinpipe[0],tmp,strlen(tmp)); | 196 | write(x->fdinpipe[0],tmp,strlen(tmp)); |
197 | } | 197 | } |
198 | 198 | ||
199 | static void shell_anything(t_shell *x, t_symbol *s, int ac, t_atom *at) | 199 | static void shell_anything(t_shell *x, t_symbol *s, int ac, t_atom *at) |
200 | { | 200 | { |
201 | int i; | 201 | int i; |
202 | char* argv[20]; | 202 | char* argv[20]; |
203 | t_symbol* sym; | 203 | t_symbol* sym; |
204 | 204 | ||
205 | if (!strcmp(s->s_name,"send")) { | 205 | if (!strcmp(s->s_name,"send")) { |
206 | post("send"); | 206 | post("send"); |
207 | shell_send(x,s,ac,at); | 207 | shell_send(x,s,ac,at); |
208 | return; | 208 | return; |
209 | } | 209 | } |
210 | 210 | ||
211 | argv[0] = s->s_name; | 211 | argv[0] = s->s_name; |
212 | 212 | ||
213 | if (x->fdpipe[0] != -1) { | 213 | if (x->fdpipe[0] != -1) { |
214 | post("shell: old process still running"); | 214 | post("shell: old process still running"); |
215 | kill(x->pid,SIGKILL); | 215 | kill(x->pid,SIGKILL); |
216 | shell_cleanup(x); | 216 | shell_cleanup(x); |
217 | } | 217 | } |
218 | 218 | ||
219 | 219 | ||
220 | if (pipe(x->fdpipe) < 0) { | 220 | if (pipe(x->fdpipe) < 0) { |
221 | error("unable to create pipe"); | 221 | error("unable to create pipe"); |
222 | return; | 222 | return; |
223 | } | 223 | } |
224 | 224 | ||
225 | if (pipe(x->fdinpipe) < 0) { | 225 | if (pipe(x->fdinpipe) < 0) { |
226 | error("unable to create input pipe"); | 226 | error("unable to create input pipe"); |
227 | return; | 227 | return; |
228 | } | 228 | } |
229 | 229 | ||
230 | 230 | ||
231 | sys_addpollfn(x->fdpipe[0],shell_read,x); | 231 | sys_addpollfn(x->fdpipe[0],shell_read,x); |
232 | 232 | ||
233 | if (!(x->pid = fork())) { | 233 | if (!(x->pid = fork())) { |
234 | int status; | 234 | int status; |
235 | char* cmd = getbytes(1024); | 235 | char* cmd = getbytes(1024); |
236 | char* tcmd = getbytes(1024); | 236 | char* tcmd = getbytes(1024); |
237 | strcpy(cmd,s->s_name); | 237 | strcpy(cmd,s->s_name); |
238 | 238 | ||
239 | #if 0 | 239 | #if 0 |
240 | for (i=1;i<=ac;i++) { | 240 | for (i=1;i<=ac;i++) { |
241 | argv[i] = getbytes(255); | 241 | argv[i] = getbytes(255); |
242 | atom_string(at,argv[i],255); | 242 | atom_string(at,argv[i],255); |
243 | /* post("argument %s",argv[i]); */ | 243 | /* post("argument %s",argv[i]); */ |
244 | at++; | 244 | at++; |
245 | } | 245 | } |
246 | argv[i] = 0; | 246 | argv[i] = 0; |
247 | #endif | 247 | #endif |
248 | for (i=1;i<=ac;i++) { | 248 | for (i=1;i<=ac;i++) { |
249 | atom_string(at,tcmd,255); | 249 | atom_string(at,tcmd,255); |
250 | strcat(cmd," "); | 250 | strcat(cmd," "); |
251 | strcat(cmd,tcmd); | 251 | strcat(cmd,tcmd); |
252 | at++; | 252 | at++; |
253 | } | 253 | } |
254 | 254 | ||
255 | 255 | ||
256 | /* reassign stdout */ | 256 | /* reassign stdout */ |
257 | dup2(x->fdpipe[1],1); | 257 | dup2(x->fdpipe[1],1); |
258 | dup2(x->fdinpipe[1],0); | 258 | dup2(x->fdinpipe[1],0); |
259 | 259 | ||
260 | /* drop privileges */ | 260 | /* drop privileges */ |
261 | drop_priority(); | 261 | drop_priority(); |
262 | seteuid(getuid()); /* lose setuid priveliges */ | 262 | seteuid(getuid()); /* lose setuid priveliges */ |
263 | 263 | ||
264 | post("executing %s",cmd); | 264 | post("executing %s",cmd); |
265 | system(cmd); | 265 | system(cmd); |
266 | // execvp(s->s_name,argv); | 266 | // execvp(s->s_name,argv); |
267 | exit(0); | 267 | exit(0); |
268 | } | 268 | } |
269 | x->x_del = 4; | 269 | x->x_del = 4; |
270 | clock_delay(x->x_clock,x->x_del); | 270 | clock_delay(x->x_clock,x->x_del); |
271 | 271 | ||
272 | if (x->x_echo) | 272 | if (x->x_echo) |
273 | outlet_anything(x->x_obj.ob_outlet, s, ac, at); | 273 | outlet_anything(x->x_obj.ob_outlet, s, ac, at); |
274 | } | 274 | } |
275 | 275 | ||
276 | 276 | ||
277 | 277 | ||
278 | void shell_free(t_shell* x) | 278 | void shell_free(t_shell* x) |
279 | { | 279 | { |
280 | binbuf_free(x->x_binbuf); | 280 | binbuf_free(x->x_binbuf); |
281 | } | 281 | } |
282 | 282 | ||
283 | static void *shell_new(void) | 283 | static void *shell_new(void) |
284 | { | 284 | { |
285 | t_shell *x = (t_shell *)pd_new(shell_class); | 285 | t_shell *x = (t_shell *)pd_new(shell_class); |
286 | 286 | ||
287 | x->x_echo = 0; | 287 | x->x_echo = 0; |
288 | x->fdpipe[0] = -1; | 288 | x->fdpipe[0] = -1; |
289 | x->fdpipe[1] = -1; | 289 | x->fdpipe[1] = -1; |
290 | x->fdinpipe[0] = -1; | 290 | x->fdinpipe[0] = -1; |
291 | x->fdinpipe[1] = -1; | 291 | x->fdinpipe[1] = -1; |
292 | 292 | ||
293 | x->sr_inhead = x->sr_intail = 0; | 293 | x->sr_inhead = x->sr_intail = 0; |
294 | if (!(x->sr_inbuf = (char*) malloc(INBUFSIZE))) bug("t_shell");; | 294 | if (!(x->sr_inbuf = (char*) malloc(INBUFSIZE))) bug("t_shell");; |
295 | 295 | ||
296 | x->x_binbuf = binbuf_new(); | 296 | x->x_binbuf = binbuf_new(); |
297 | 297 | ||
298 | outlet_new(&x->x_obj, &s_list); | 298 | outlet_new(&x->x_obj, &s_list); |
299 | x->x_done = outlet_new(&x->x_obj, &s_bang); | 299 | x->x_done = outlet_new(&x->x_obj, &s_bang); |
300 | x->x_clock = clock_new(x, (t_method) shell_check); | 300 | x->x_clock = clock_new(x, (t_method) shell_check); |
301 | return (x); | 301 | return (x); |
302 | } | 302 | } |
303 | 303 | ||
304 | void shell_setup(void) | 304 | void shell_setup(void) |
305 | { | 305 | { |
306 | shell_class = class_new(gensym("shell"), (t_newmethod)shell_new, | 306 | shell_class = class_new(gensym("shell"), (t_newmethod)shell_new, |
307 | (t_method)shell_free,sizeof(t_shell), 0,0); | 307 | (t_method)shell_free,sizeof(t_shell), 0,0); |
308 | class_addbang(shell_class,shell_bang); | 308 | class_addbang(shell_class,shell_bang); |
309 | class_addanything(shell_class, shell_anything); | 309 | class_addanything(shell_class, shell_anything); |
310 | } | 310 | } |
311 | 311 | ||
312 | 312 | ||
diff --git a/apps/plugins/pdbox/PDa/intern/biquad~.c b/apps/plugins/pdbox/PDa/intern/biquad~.c index 2dc6d72071..f0a4ad2961 100644 --- a/apps/plugins/pdbox/PDa/intern/biquad~.c +++ b/apps/plugins/pdbox/PDa/intern/biquad~.c | |||
@@ -65,12 +65,17 @@ static t_int *sigbiquad_perform(t_int *w) | |||
65 | 65 | ||
66 | static void sigbiquad_list(t_sigbiquad *x, t_symbol *s, int argc, t_atom *argv) | 66 | static void sigbiquad_list(t_sigbiquad *x, t_symbol *s, int argc, t_atom *argv) |
67 | { | 67 | { |
68 | #ifdef ROCKBOX | ||
69 | (void) s; | ||
70 | #endif | ||
71 | |||
68 | float fb1 = atom_getfloatarg(0, argc, argv); | 72 | float fb1 = atom_getfloatarg(0, argc, argv); |
69 | float fb2 = atom_getfloatarg(1, argc, argv); | 73 | float fb2 = atom_getfloatarg(1, argc, argv); |
70 | float ff1 = atom_getfloatarg(2, argc, argv); | 74 | float ff1 = atom_getfloatarg(2, argc, argv); |
71 | float ff2 = atom_getfloatarg(3, argc, argv); | 75 | float ff2 = atom_getfloatarg(3, argc, argv); |
72 | float ff3 = atom_getfloatarg(4, argc, argv); | 76 | float ff3 = atom_getfloatarg(4, argc, argv); |
73 | float discriminant = fb1 * fb1 + 4 * fb2; | 77 | float discriminant = fb1 * fb1 + 4 * fb2; |
78 | |||
74 | t_biquadctl *c = x->x_ctl; | 79 | t_biquadctl *c = x->x_ctl; |
75 | if (discriminant < 0) /* imaginary roots -- resonant filter */ | 80 | if (discriminant < 0) /* imaginary roots -- resonant filter */ |
76 | { | 81 | { |
@@ -99,6 +104,9 @@ stable: | |||
99 | 104 | ||
100 | static void sigbiquad_set(t_sigbiquad *x, t_symbol *s, int argc, t_atom *argv) | 105 | static void sigbiquad_set(t_sigbiquad *x, t_symbol *s, int argc, t_atom *argv) |
101 | { | 106 | { |
107 | #ifdef ROCKBOX | ||
108 | (void) s; | ||
109 | #endif | ||
102 | t_biquadctl *c = x->x_ctl; | 110 | t_biquadctl *c = x->x_ctl; |
103 | c->c_x1 = atom_getfloatarg(0, argc, argv); | 111 | c->c_x1 = atom_getfloatarg(0, argc, argv); |
104 | c->c_x2 = atom_getfloatarg(1, argc, argv); | 112 | c->c_x2 = atom_getfloatarg(1, argc, argv); |
diff --git a/apps/plugins/pdbox/PDa/intern/bp~.c b/apps/plugins/pdbox/PDa/intern/bp~.c index 2c44536e8a..d9da27cc2e 100644 --- a/apps/plugins/pdbox/PDa/intern/bp~.c +++ b/apps/plugins/pdbox/PDa/intern/bp~.c | |||
@@ -81,6 +81,9 @@ static void sigbp_ft2(t_sigbp *x, t_floatarg q) | |||
81 | 81 | ||
82 | static void sigbp_clear(t_sigbp *x, t_floatarg q) | 82 | static void sigbp_clear(t_sigbp *x, t_floatarg q) |
83 | { | 83 | { |
84 | #ifdef ROCKBOX | ||
85 | (void) q; | ||
86 | #endif | ||
84 | x->x_ctl->c_x1 = x->x_ctl->c_x2 = 0; | 87 | x->x_ctl->c_x1 = x->x_ctl->c_x2 = 0; |
85 | } | 88 | } |
86 | 89 | ||
diff --git a/apps/plugins/pdbox/PDa/intern/cos_table.c b/apps/plugins/pdbox/PDa/intern/cos_table.c new file mode 100644 index 0000000000..7de7818ba6 --- /dev/null +++ b/apps/plugins/pdbox/PDa/intern/cos_table.c | |||
@@ -0,0 +1,2 @@ | |||
1 | #include "m_pd.h" | ||
2 | t_sample cos_table[] = {262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262143,262143,262143,262143,262143,262143,262143,262142,262142,262142,262142,262142,262141,262141,262141,262141,262140,262140,262140,262140,262139,262139,262139,262138,262138,262138,262137,262137,262137,262136,262136,262135,262135,262135,262134,262134,262133,262133,262132,262132,262131,262131,262130,262130,262129,262129,262128,262128,262127,262127,262126,262125,262125,262124,262124,262123,262122,262122,262121,262120,262120,262119,262118,262118,262117,262116,262115,262115,262114,262113,262112,262112,262111,262110,262109,262108,262108,262107,262106,262105,262104,262103,262102,262101,262101,262100,262099,262098,262097,262096,262095,262094,262093,262092,262091,262090,262089,262088,262087,262086,262085,262084,262082,262081,262080,262079,262078,262077,262076,262075,262073,262072,262071,262070,262069,262067,262066,262065,262064,262063,262061,262060,262059,262057,262056,262055,262054,262052,262051,262050,262048,262047,262045,262044,262043,262041,262040,262038,262037,262036,262034,262033,262031,262030,262028,262027,262025,262024,262022,262021,262019,262018,262016,262014,262013,262011,262010,262008,262006,262005,262003,262001,262000,261998,261996,261995,261993,261991,261990,261988,261986,261984,261983,261981,261979,261977,261975,261974,261972,261970,261968,261966,261965,261963,261961,261959,261957,261955,261953,261951,261949,261947,261945,261943,261942,261940,261938,261936,261934,261932,261929,261927,261925,261923,261921,261919,261917,261915,261913,261911,261909,261907,261904,261902,261900,261898,261896,261894,261891,261889,261887,261885,261882,261880,261878,261876,261873,261871,261869,261866,261864,261862,261859,261857,261855,261852,261850,261848,261845,261843,261840,261838,261836,261833,261831,261828,261826,261823,261821,261818,261816,261813,261811,261808,261806,261803,261801,261798,261795,261793,261790,261788,261785,261782,261780,261777,261774,261772,261769,261766,261764,261761,261758,261755,261753,261750,261747,261744,261742,261739,261736,261733,261730,261728,261725,261722,261719,261716,261713,261710,261708,261705,261702,261699,261696,261693,261690,261687,261684,261681,261678,261675,261672,261669,261666,261663,261660,261657,261654,261651,261648,261644,261641,261638,261635,261632,261629,261626,261623,261619,261616,261613,261610,261607,261603,261600,261597,261594,261590,261587,261584,261581,261577,261574,261571,261567,261564,261561,261557,261554,261551,261547,261544,261540,261537,261533,261530,261527,261523,261520,261516,261513,261509,261506,261502,261499,261495,261492,261488,261485,261481,261477,261474,261470,261467,261463,261459,261456,261452,261448,261445,261441,261437,261434,261430,261426,261423,261419,261415,261411,261408,261404,261400,261396,261392,261389,261385,261381,261377,261373,261369,261366,261362,261358,261354,261350,261346,261342,261338,261334,261330,261326,261322,261318,261314,261310,261306,261302,261298,261294,261290,261286,261282,261278,261274,261270,261266,261262,261258,261253,261249,261245,261241,261237,261233,261228,261224,261220,261216,261212,261207,261203,261199,261195,261190,261186,261182,261177,261173,261169,261164,261160,261156,261151,261147,261143,261138,261134,261129,261125,261120,261116,261112,261107,261103,261098,261094,261089,261085,261080,261076,261071,261067,261062,261057,261053,261048,261044,261039,261034,261030,261025,261021,261016,261011,261007,261002,260997,260992,260988,260983,260978,260974,260969,260964,260959,260955,260950,260945,260940,260935,260930,260926,260921,260916,260911,260906,260901,260896,260892,260887,260882,260877,260872,260867,260862,260857,260852,260847,260842,260837,260832,260827,260822,260817,260812,260807,260802,260797,260791,260786,260781,260776,260771,260766,260761,260756,260750,260745,260740,260735,260730,260724,260719,260714,260709,260703,260698,260693,260688,260682,260677,260672,260666,260661,260656,260650,260645,260640,260634,260629,260623,260618,260613,260607,260602,260596,260591,260585,260580,260574,260569,260563,260558,260552,260547,260541,260536,260530,260525,260519,260513,260508,260502,260496,260491,260485,260480,260474,260468,260463,260457,260451,260445,260440,260434,260428,260423,260417,260411,260405,260399,260394,260388,260382,260376,260370,260365,260359,260353,260347,260341,260335,260329,260323,260317,260312,260306,260300,260294,260288,260282,260276,260270,260264,260258,260252,260246,260240,260234,260228,260221,260215,260209,260203,260197,260191,260185,260179,260173,260166,260160,260154,260148,260142,260135,260129,260123,260117,260111,260104,260098,260092,260085,260079,260073,260067,260060,260054,260048,260041,260035,260029,260022,260016,260009,260003,259997,259990,259984,259977,259971,259964,259958,259951,259945,259938,259932,259925,259919,259912,259906,259899,259893,259886,259879,259873,259866,259860,259853,259846,259840,259833,259826,259820,259813,259806,259800,259793,259786,259779,259773,259766,259759,259752,259746,259739,259732,259725,259718,259712,259705,259698,259691,259684,259677,259670,259664,259657,259650,259643,259636,259629,259622,259615,259608,259601,259594,259587,259580,259573,259566,259559,259552,259545,259538,259531,259524,259517,259509,259502,259495,259488,259481,259474,259467,259459,259452,259445,259438,259431,259423,259416,259409,259402,259395,259387,259380,259373,259365,259358,259351,259343,259336,259329,259321,259314,259307,259299,259292,259285,259277,259270,259262,259255,259247,259240,259232,259225,259217,259210,259202,259195,259187,259180,259172,259165,259157,259150,259142,259135,259127,259119,259112,259104,259096,259089,259081,259073,259066,259058,259050,259043,259035,259027,259020,259012,259004,258996,258989,258981,258973,258965,258957,258950,258942,258934,258926,258918,258910,258902,258895,258887,258879,258871,258863,258855,258847,258839,258831,258823,258815,258807,258799,258791,258783,258775,258767,258759,258751,258743,258735,258727,258719,258711,258702,258694,258686,258678,258670,258662,258654,258645,258637,258629,258621,258613,258604,258596,258588,258580,258571,258563,258555,258546,258538,258530,258522,258513,258505,258496,258488,258480,258471,258463,258455,258446,258438,258429,258421,258412,258404,258396,258387,258379,258370,258362,258353,258345,258336,258327,258319,258310,258302,258293,258285,258276,258267,258259,258250,258242,258233,258224,258216,258207,258198,258190,258181,258172,258163,258155,258146,258137,258128,258120,258111,258102,258093,258084,258076,258067,258058,258049,258040,258031,258023,258014,258005,257996,257987,257978,257969,257960,257951,257942,257933,257924,257915,257906,257897,257888,257879,257870,257861,257852,257843,257834,257825,257816,257807,257798,257789,257779,257770,257761,257752,257743,257734,257724,257715,257706,257697,257688,257678,257669,257660,257651,257641,257632,257623,257613,257604,257595,257585,257576,257567,257557,257548,257539,257529,257520,257510,257501,257492,257482,257473,257463,257454,257444,257435,257425,257416,257406,257397,257387,257378,257368,257359,257349,257340,257330,257320,257311,257301,257292,257282,257272,257263,257253,257243,257234,257224,257214,257205,257195,257185,257175,257166,257156,257146,257136,257127,257117,257107,257097,257087,257078,257068,257058,257048,257038,257028,257018,257008,256999,256989,256979,256969,256959,256949,256939,256929,256919,256909,256899,256889,256879,256869,256859,256849,256839,256829,256819,256809,256798,256788,256778,256768,256758,256748,256738,256728,256717,256707,256697,256687,256677,256666,256656,256646,256636,256625,256615,256605,256595,256584,256574,256564,256553,256543,256533,256522,256512,256502,256491,256481,256470,256460,256450,256439,256429,256418,256408,256397,256387,256376,256366,256355,256345,256334,256324,256313,256303,256292,256282,256271,256261,256250,256239,256229,256218,256207,256197,256186,256176,256165,256154,256143,256133,256122,256111,256101,256090,256079,256068,256058,256047,256036,256025,256014,256004,255993,255982,255971,255960,255949,255939,255928,255917,255906,255895,255884,255873,255862,255851,255840,255829,255818,255807,255796,255785,255774,255763,255752,255741,255730,255719,255708,255697,255686,255675,255664,255653,255642,255630,255619,255608,255597,255586,255575,255564,255552,255541,255530,255519,255507,255496,255485,255474,255462,255451,255440,255429,255417,255406,255395,255383,255372,255361,255349,255338,255326,255315,255304,255292,255281,255269,255258,255246,255235,255224,255212,255201,255189,255178,255166,255155,255143,255131,255120,255108,255097,255085,255074,255062,255050,255039,255027,255015,255004,254992,254981,254969,254957,254945,254934,254922,254910,254899,254887,254875,254863,254852,254840,254828,254816,254804,254793,254781,254769,254757,254745,254733,254721,254710,254698,254686,254674,254662,254650,254638,254626,254614,254602,254590,254578,254566,254554,254542,254530,254518,254506,254494,254482,254470,254458,254446,254434,254422,254410,254397,254385,254373,254361,254349,254337,254324,254312,254300,254288,254276,254263,254251,254239,254227,254214,254202,254190,254178,254165,254153,254141,254128,254116,254104,254091,254079,254067,254054,254042,254029,254017,254004,253992,253980,253967,253955,253942,253930,253917,253905,253892,253880,253867,253855,253842,253830,253817,253804,253792,253779,253767,253754,253741,253729,253716,253704,253691,253678,253666,253653,253640,253627,253615,253602,253589,253577,253564,253551,253538,253525,253513,253500,253487,253474,253461,253449,253436,253423,253410,253397,253384,253371,253359,253346,253333,253320,253307,253294,253281,253268,253255,253242,253229,253216,253203,253190,253177,253164,253151,253138,253125,253112,253099,253085,253072,253059,253046,253033,253020,253007,252994,252980,252967,252954,252941,252928,252914,252901,252888,252875,252861,252848,252835,252822,252808,252795,252782,252768,252755,252742,252728,252715,252702,252688,252675,252662,252648,252635,252621,252608,252594,252581,252568,252554,252541,252527,252514,252500,252487,252473,252460,252446,252432,252419,252405,252392,252378,252365,252351,252337,252324,252310,252296,252283,252269,252255,252242,252228,252214,252201,252187,252173,252159,252146,252132,252118,252104,252091,252077,252063,252049,252035,252022,252008,251994,251980,251966,251952,251938,251925,251911,251897,251883,251869,251855,251841,251827,251813,251799,251785,251771,251757,251743,251729,251715,251701,251687,251673,251659,251645,251631,251617,251602,251588,251574,251560,251546,251532,251518,251503,251489,251475,251461,251447,251432,251418,251404,251390,251375,251361,251347,251333,251318,251304,251290,251275,251261,251247,251232,251218,251204,251189,251175,251161,251146,251132,251117,251103,251088,251074,251060,251045,251031,251016,251002,250987,250973,250958,250944,250929,250914,250900,250885,250871,250856,250842,250827,250812,250798,250783,250768,250754,250739,250724,250710,250695,250680,250666,250651,250636,250622,250607,250592,250577,250562,250548,250533,250518,250503,250489,250474,250459,250444,250429,250414,250399,250385,250370,250355,250340,250325,250310,250295,250280,250265,250250,250235,250220,250205,250190,250175,250160,250145,250130,250115,250100,250085,250070,250055,250040,250025,250009,249994,249979,249964,249949,249934,249919,249903,249888,249873,249858,249843,249827,249812,249797,249782,249766,249751,249736,249721,249705,249690,249675,249659,249644,249629,249613,249598,249583,249567,249552,249536,249521,249506,249490,249475,249459,249444,249428,249413,249398,249382,249367,249351,249335,249320,249304,249289,249273,249258,249242,249227,249211,249195,249180,249164,249149,249133,249117,249102,249086,249070,249055,249039,249023,249008,248992,248976,248960,248945,248929,248913,248897,248882,248866,248850,248834,248818,248803,248787,248771,248755,248739,248723,248707,248691,248676,248660,248644,248628,248612,248596,248580,248564,248548,248532,248516,248500,248484,248468,248452,248436,248420,248404,248388,248372,248356,248340,248323,248307,248291,248275,248259,248243,248227,248211,248194,248178,248162,248146,248130,248113,248097,248081,248065,248048,248032,248016,248000,247983,247967,247951,247934,247918,247902,247885,247869,247853,247836,247820,247803,247787,247771,247754,247738,247721,247705,247688,247672,247655,247639,247622,247606,247589,247573,247556,247540,247523,247507,247490,247474,247457,247440,247424,247407,247391,247374,247357,247341,247324,247307,247291,247274,247257,247241,247224,247207,247190,247174,247157,247140,247123,247107,247090,247073,247056,247040,247023,247006,246989,246972,246955,246938,246922,246905,246888,246871,246854,246837,246820,246803,246786,246769,246752,246735,246718,246701,246684,246667,246650,246633,246616,246599,246582,246565,246548,246531,246514,246497,246480,246463,246445,246428,246411,246394,246377,246360,246342,246325,246308,246291,246274,246256,246239,246222,246205,246187,246170,246153,246136,246118,246101,246084,246066,246049,246032,246014,245997,245979,245962,245945,245927,245910,245892,245875,245858,245840,245823,245805,245788,245770,245753,245735,245718,245700,245683,245665,245648,245630,245613,245595,245577,245560,245542,245525,245507,245489,245472,245454,245436,245419,245401,245383,245366,245348,245330,245313,245295,245277,245259,245242,245224,245206,245188,245171,245153,245135,245117,245099,245081,245064,245046,245028,245010,244992,244974,244956,244938,244921,244903,244885,244867,244849,244831,244813,244795,244777,244759,244741,244723,244705,244687,244669,244651,244633,244615,244597,244578,244560,244542,244524,244506,244488,244470,244452,244433,244415,244397,244379,244361,244343,244324,244306,244288,244270,244251,244233,244215,244197,244178,244160,244142,244123,244105,244087,244068,244050,244032,244013,243995,243977,243958,243940,243921,243903,243885,243866,243848,243829,243811,243792,243774,243755,243737,243718,243700,243681,243663,243644,243626,243607,243588,243570,243551,243533,243514,243496,243477,243458,243440,243421,243402,243384,243365,243346,243328,243309,243290,243271,243253,243234,243215,243196,243178,243159,243140,243121,243103,243084,243065,243046,243027,243008,242990,242971,242952,242933,242914,242895,242876,242857,242838,242819,242800,242782,242763,242744,242725,242706,242687,242668,242649,242630,242611,242591,242572,242553,242534,242515,242496,242477,242458,242439,242420,242401,242381,242362,242343,242324,242305,242286,242266,242247,242228,242209,242189,242170,242151,242132,242112,242093,242074,242055,242035,242016,241997,241977,241958,241939,241919,241900,241881,241861,241842,241822,241803,241784,241764,241745,241725,241706,241686,241667,241647,241628,241608,241589,241569,241550,241530,241511,241491,241472,241452,241433,241413,241393,241374,241354,241334,241315,241295,241276,241256,241236,241217,241197,241177,241157,241138,241118,241098,241079,241059,241039,241019,241000,240980,240960,240940,240920,240901,240881,240861,240841,240821,240801,240781,240762,240742,240722,240702,240682,240662,240642,240622,240602,240582,240562,240542,240522,240502,240482,240462,240442,240422,240402,240382,240362,240342,240322,240302,240282,240262,240242,240221,240201,240181,240161,240141,240121,240101,240080,240060,240040,240020,240000,239979,239959,239939,239919,239898,239878,239858,239838,239817,239797,239777,239756,239736,239716,239695,239675,239655,239634,239614,239593,239573,239553,239532,239512,239491,239471,239450,239430,239410,239389,239369,239348,239328,239307,239287,239266,239245,239225,239204,239184,239163,239143,239122,239101,239081,239060,239040,239019,238998,238978,238957,238936,238916,238895,238874,238853,238833,238812,238791,238771,238750,238729,238708,238688,238667,238646,238625,238604,238583,238563,238542,238521,238500,238479,238458,238437,238417,238396,238375,238354,238333,238312,238291,238270,238249,238228,238207,238186,238165,238144,238123,238102,238081,238060,238039,238018,237997,237976,237955,237934,237913,237891,237870,237849,237828,237807,237786,237765,237743,237722,237701,237680,237659,237637,237616,237595,237574,237552,237531,237510,237489,237467,237446,237425,237403,237382,237361,237339,237318,237297,237275,237254,237233,237211,237190,237168,237147,237126,237104,237083,237061,237040,237018,236997,236975,236954,236932,236911,236889,236868,236846,236825,236803,236782,236760,236738,236717,236695,236674,236652,236630,236609,236587,236565,236544,236522,236500,236479,236457,236435,236414,236392,236370,236348,236327,236305,236283,236261,236240,236218,236196,236174,236152,236131,236109,236087,236065,236043,236021,235999,235978,235956,235934,235912,235890,235868,235846,235824,235802,235780,235758,235736,235714,235692,235670,235648,235626,235604,235582,235560,235538,235516,235494,235472,235450,235428,235405,235383,235361,235339,235317,235295,235273,235250,235228,235206,235184,235162,235139,235117,235095,235073,235050,235028,235006,234984,234961,234939,234917,234894,234872,234850,234828,234805,234783,234760,234738,234716,234693,234671,234649,234626,234604,234581,234559,234536,234514,234491,234469,234446,234424,234401,234379,234356,234334,234311,234289,234266,234244,234221,234199,234176,234153,234131,234108,234086,234063,234040,234018,233995,233972,233950,233927,233904,233882,233859,233836,233813,233791,233768,233745,233722,233700,233677,233654,233631,233609,233586,233563,233540,233517,233494,233472,233449,233426,233403,233380,233357,233334,233311,233288,233265,233243,233220,233197,233174,233151,233128,233105,233082,233059,233036,233013,232990,232967,232944,232920,232897,232874,232851,232828,232805,232782,232759,232736,232713,232689,232666,232643,232620,232597,232574,232550,232527,232504,232481,232457,232434,232411,232388,232364,232341,232318,232295,232271,232248,232225,232201,232178,232155,232131,232108,232085,232061,232038,232014,231991,231968,231944,231921,231897,231874,231850,231827,231804,231780,231757,231733,231710,231686,231663,231639,231615,231592,231568,231545,231521,231498,231474,231450,231427,231403,231380,231356,231332,231309,231285,231261,231238,231214,231190,231167,231143,231119,231096,231072,231048,231024,231001,230977,230953,230929,230905,230882,230858,230834,230810,230786,230762,230739,230715,230691,230667,230643,230619,230595,230571,230548,230524,230500,230476,230452,230428,230404,230380,230356,230332,230308,230284,230260,230236,230212,230188,230164,230140,230116,230091,230067,230043,230019,229995,229971,229947,229923,229898,229874,229850,229826,229802,229778,229753,229729,229705,229681,229657,229632,229608,229584,229560,229535,229511,229487,229462,229438,229414,229389,229365,229341,229316,229292,229268,229243,229219,229194,229170,229146,229121,229097,229072,229048,229024,228999,228975,228950,228926,228901,228877,228852,228828,228803,228779,228754,228729,228705,228680,228656,228631,228607,228582,228557,228533,228508,228483,228459,228434,228409,228385,228360,228335,228311,228286,228261,228237,228212,228187,228162,228138,228113,228088,228063,228039,228014,227989,227964,227939,227914,227890,227865,227840,227815,227790,227765,227740,227716,227691,227666,227641,227616,227591,227566,227541,227516,227491,227466,227441,227416,227391,227366,227341,227316,227291,227266,227241,227216,227191,227166,227141,227115,227090,227065,227040,227015,226990,226965,226940,226914,226889,226864,226839,226814,226788,226763,226738,226713,226688,226662,226637,226612,226586,226561,226536,226511,226485,226460,226435,226409,226384,226359,226333,226308,226283,226257,226232,226206,226181,226156,226130,226105,226079,226054,226028,226003,225977,225952,225926,225901,225875,225850,225824,225799,225773,225748,225722,225697,225671,225646,225620,225594,225569,225543,225517,225492,225466,225441,225415,225389,225364,225338,225312,225287,225261,225235,225209,225184,225158,225132,225106,225081,225055,225029,225003,224978,224952,224926,224900,224874,224848,224823,224797,224771,224745,224719,224693,224667,224641,224615,224590,224564,224538,224512,224486,224460,224434,224408,224382,224356,224330,224304,224278,224252,224226,224200,224174,224148,224122,224096,224069,224043,224017,223991,223965,223939,223913,223887,223860,223834,223808,223782,223756,223730,223703,223677,223651,223625,223599,223572,223546,223520,223493,223467,223441,223415,223388,223362,223336,223309,223283,223257,223230,223204,223178,223151,223125,223099,223072,223046,223019,222993,222966,222940,222914,222887,222861,222834,222808,222781,222755,222728,222702,222675,222649,222622,222596,222569,222542,222516,222489,222463,222436,222410,222383,222356,222330,222303,222276,222250,222223,222196,222170,222143,222116,222090,222063,222036,222010,221983,221956,221929,221903,221876,221849,221822,221795,221769,221742,221715,221688,221661,221634,221608,221581,221554,221527,221500,221473,221446,221419,221393,221366,221339,221312,221285,221258,221231,221204,221177,221150,221123,221096,221069,221042,221015,220988,220961,220934,220907,220880,220853,220826,220798,220771,220744,220717,220690,220663,220636,220609,220581,220554,220527,220500,220473,220446,220418,220391,220364,220337,220309,220282,220255,220228,220200,220173,220146,220119,220091,220064,220037,220009,219982,219955,219927,219900,219873,219845,219818,219790,219763,219736,219708,219681,219653,219626,219598,219571,219544,219516,219489,219461,219434,219406,219379,219351,219324,219296,219268,219241,219213,219186,219158,219131,219103,219075,219048,219020,218993,218965,218937,218910,218882,218854,218827,218799,218771,218744,218716,218688,218660,218633,218605,218577,218549,218522,218494,218466,218438,218411,218383,218355,218327,218299,218271,218244,218216,218188,218160,218132,218104,218076,218049,218021,217993,217965,217937,217909,217881,217853,217825,217797,217769,217741,217713,217685,217657,217629,217601,217573,217545,217517,217489,217461,217433,217405,217377,217348,217320,217292,217264,217236,217208,217180,217152,217123,217095,217067,217039,217011,216982,216954,216926,216898,216870,216841,216813,216785,216757,216728,216700,216672,216643,216615,216587,216558,216530,216502,216473,216445,216417,216388,216360,216332,216303,216275,216246,216218,216190,216161,216133,216104,216076,216047,216019,215990,215962,215933,215905,215876,215848,215819,215791,215762,215734,215705,215677,215648,215619,215591,215562,215534,215505,215476,215448,215419,215390,215362,215333,215304,215276,215247,215218,215190,215161,215132,215104,215075,215046,215017,214989,214960,214931,214902,214873,214845,214816,214787,214758,214729,214701,214672,214643,214614,214585,214556,214527,214498,214470,214441,214412,214383,214354,214325,214296,214267,214238,214209,214180,214151,214122,214093,214064,214035,214006,213977,213948,213919,213890,213861,213832,213803,213774,213745,213715,213686,213657,213628,213599,213570,213541,213511,213482,213453,213424,213395,213366,213336,213307,213278,213249,213219,213190,213161,213132,213102,213073,213044,213015,212985,212956,212927,212897,212868,212839,212809,212780,212751,212721,212692,212662,212633,212604,212574,212545,212515,212486,212456,212427,212398,212368,212339,212309,212280,212250,212221,212191,212162,212132,212103,212073,212043,212014,211984,211955,211925,211896,211866,211836,211807,211777,211748,211718,211688,211659,211629,211599,211570,211540,211510,211481,211451,211421,211391,211362,211332,211302,211272,211243,211213,211183,211153,211124,211094,211064,211034,211004,210974,210945,210915,210885,210855,210825,210795,210765,210736,210706,210676,210646,210616,210586,210556,210526,210496,210466,210436,210406,210376,210346,210316,210286,210256,210226,210196,210166,210136,210106,210076,210046,210016,209986,209956,209926,209895,209865,209835,209805,209775,209745,209715,209684,209654,209624,209594,209564,209534,209503,209473,209443,209413,209382,209352,209322,209292,209261,209231,209201,209170,209140,209110,209080,209049,209019,208989,208958,208928,208897,208867,208837,208806,208776,208746,208715,208685,208654,208624,208593,208563,208533,208502,208472,208441,208411,208380,208350,208319,208289,208258,208228,208197,208166,208136,208105,208075,208044,208014,207983,207952,207922,207891,207861,207830,207799,207769,207738,207707,207677,207646,207615,207585,207554,207523,207492,207462,207431,207400,207370,207339,207308,207277,207246,207216,207185,207154,207123,207092,207062,207031,207000,206969,206938,206907,206877,206846,206815,206784,206753,206722,206691,206660,206629,206598,206567,206537,206506,206475,206444,206413,206382,206351,206320,206289,206258,206227,206196,206165,206133,206102,206071,206040,206009,205978,205947,205916,205885,205854,205823,205791,205760,205729,205698,205667,205636,205604,205573,205542,205511,205480,205448,205417,205386,205355,205324,205292,205261,205230,205198,205167,205136,205105,205073,205042,205011,204979,204948,204917,204885,204854,204823,204791,204760,204728,204697,204666,204634,204603,204571,204540,204508,204477,204446,204414,204383,204351,204320,204288,204257,204225,204194,204162,204131,204099,204067,204036,204004,203973,203941,203910,203878,203846,203815,203783,203752,203720,203688,203657,203625,203593,203562,203530,203498,203467,203435,203403,203372,203340,203308,203276,203245,203213,203181,203149,203118,203086,203054,203022,202990,202959,202927,202895,202863,202831,202799,202768,202736,202704,202672,202640,202608,202576,202544,202512,202481,202449,202417,202385,202353,202321,202289,202257,202225,202193,202161,202129,202097,202065,202033,202001,201969,201937,201905,201873,201841,201808,201776,201744,201712,201680,201648,201616,201584,201552,201519,201487,201455,201423,201391,201359,201326,201294,201262,201230,201198,201165,201133,201101,201069,201036,201004,200972,200940,200907,200875,200843,200810,200778,200746,200713,200681,200649,200616,200584,200552,200519,200487,200454,200422,200390,200357,200325,200292,200260,200228,200195,200163,200130,200098,200065,200033,200000,199968,199935,199903,199870,199838,199805,199773,199740,199708,199675,199642,199610,199577,199545,199512,199479,199447,199414,199382,199349,199316,199284,199251,199218,199186,199153,199120,199088,199055,199022,198989,198957,198924,198891,198858,198826,198793,198760,198727,198695,198662,198629,198596,198563,198531,198498,198465,198432,198399,198366,198334,198301,198268,198235,198202,198169,198136,198103,198070,198037,198004,197972,197939,197906,197873,197840,197807,197774,197741,197708,197675,197642,197609,197576,197543,197510,197476,197443,197410,197377,197344,197311,197278,197245,197212,197179,197146,197112,197079,197046,197013,196980,196947,196913,196880,196847,196814,196781,196747,196714,196681,196648,196615,196581,196548,196515,196481,196448,196415,196382,196348,196315,196282,196248,196215,196182,196148,196115,196082,196048,196015,195982,195948,195915,195881,195848,195815,195781,195748,195714,195681,195647,195614,195580,195547,195513,195480,195446,195413,195379,195346,195312,195279,195245,195212,195178,195145,195111,195078,195044,195010,194977,194943,194910,194876,194842,194809,194775,194741,194708,194674,194640,194607,194573,194539,194506,194472,194438,194405,194371,194337,194303,194270,194236,194202,194168,194135,194101,194067,194033,193999,193966,193932,193898,193864,193830,193796,193763,193729,193695,193661,193627,193593,193559,193525,193492,193458,193424,193390,193356,193322,193288,193254,193220,193186,193152,193118,193084,193050,193016,192982,192948,192914,192880,192846,192812,192778,192744,192710,192676,192641,192607,192573,192539,192505,192471,192437,192403,192369,192334,192300,192266,192232,192198,192164,192129,192095,192061,192027,191992,191958,191924,191890,191856,191821,191787,191753,191718,191684,191650,191616,191581,191547,191513,191478,191444,191410,191375,191341,191307,191272,191238,191203,191169,191135,191100,191066,191031,190997,190963,190928,190894,190859,190825,190790,190756,190721,190687,190652,190618,190583,190549,190514,190480,190445,190411,190376,190342,190307,190272,190238,190203,190169,190134,190099,190065,190030,189996,189961,189926,189892,189857,189822,189788,189753,189718,189684,189649,189614,189580,189545,189510,189475,189441,189406,189371,189336,189302,189267,189232,189197,189162,189128,189093,189058,189023,188988,188954,188919,188884,188849,188814,188779,188744,188709,188675,188640,188605,188570,188535,188500,188465,188430,188395,188360,188325,188290,188255,188220,188185,188150,188115,188080,188045,188010,187975,187940,187905,187870,187835,187800,187765,187730,187695,187660,187625,187589,187554,187519,187484,187449,187414,187379,187343,187308,187273,187238,187203,187168,187132,187097,187062,187027,186992,186956,186921,186886,186851,186815,186780,186745,186710,186674,186639,186604,186568,186533,186498,186462,186427,186392,186356,186321,186286,186250,186215,186179,186144,186109,186073,186038,186002,185967,185932,185896,185861,185825,185790,185754,185719,185683,185648,185612,185577,185541,185506,185470,185435,185399,185364,185328,185293,185257,185222,185186,185150,185115,185079,185044,185008,184972,184937,184901,184866,184830,184794,184759,184723,184687,184652,184616,184580,184545,184509,184473,184437,184402,184366,184330,184294,184259,184223,184187,184151,184116,184080,184044,184008,183972,183937,183901,183865,183829,183793,183757,183722,183686,183650,183614,183578,183542,183506,183470,183435,183399,183363,183327,183291,183255,183219,183183,183147,183111,183075,183039,183003,182967,182931,182895,182859,182823,182787,182751,182715,182679,182643,182607,182571,182535,182499,182463,182426,182390,182354,182318,182282,182246,182210,182174,182137,182101,182065,182029,181993,181957,181920,181884,181848,181812,181776,181739,181703,181667,181631,181594,181558,181522,181486,181449,181413,181377,181341,181304,181268,181232,181195,181159,181123,181086,181050,181014,180977,180941,180904,180868,180832,180795,180759,180723,180686,180650,180613,180577,180540,180504,180467,180431,180395,180358,180322,180285,180249,180212,180176,180139,180103,180066,180029,179993,179956,179920,179883,179847,179810,179774,179737,179700,179664,179627,179591,179554,179517,179481,179444,179407,179371,179334,179297,179261,179224,179187,179151,179114,179077,179041,179004,178967,178930,178894,178857,178820,178783,178747,178710,178673,178636,178600,178563,178526,178489,178452,178415,178379,178342,178305,178268,178231,178194,178158,178121,178084,178047,178010,177973,177936,177899,177862,177825,177788,177752,177715,177678,177641,177604,177567,177530,177493,177456,177419,177382,177345,177308,177271,177234,177197,177160,177123,177085,177048,177011,176974,176937,176900,176863,176826,176789,176752,176714,176677,176640,176603,176566,176529,176492,176454,176417,176380,176343,176306,176268,176231,176194,176157,176120,176082,176045,176008,175971,175933,175896,175859,175822,175784,175747,175710,175672,175635,175598,175560,175523,175486,175448,175411,175374,175336,175299,175262,175224,175187,175149,175112,175075,175037,175000,174962,174925,174887,174850,174813,174775,174738,174700,174663,174625,174588,174550,174513,174475,174438,174400,174363,174325,174288,174250,174212,174175,174137,174100,174062,174025,173987,173949,173912,173874,173837,173799,173761,173724,173686,173648,173611,173573,173535,173498,173460,173422,173385,173347,173309,173271,173234,173196,173158,173121,173083,173045,173007,172969,172932,172894,172856,172818,172781,172743,172705,172667,172629,172591,172554,172516,172478,172440,172402,172364,172326,172289,172251,172213,172175,172137,172099,172061,172023,171985,171947,171909,171871,171834,171796,171758,171720,171682,171644,171606,171568,171530,171492,171454,171416,171378,171339,171301,171263,171225,171187,171149,171111,171073,171035,170997,170959,170921,170883,170844,170806,170768,170730,170692,170654,170616,170577,170539,170501,170463,170425,170386,170348,170310,170272,170234,170195,170157,170119,170081,170042,170004,169966,169928,169889,169851,169813,169774,169736,169698,169660,169621,169583,169545,169506,169468,169430,169391,169353,169314,169276,169238,169199,169161,169122,169084,169046,169007,168969,168930,168892,168853,168815,168777,168738,168700,168661,168623,168584,168546,168507,168469,168430,168392,168353,168315,168276,168238,168199,168160,168122,168083,168045,168006,167968,167929,167890,167852,167813,167774,167736,167697,167659,167620,167581,167543,167504,167465,167427,167388,167349,167311,167272,167233,167194,167156,167117,167078,167040,167001,166962,166923,166885,166846,166807,166768,166729,166691,166652,166613,166574,166535,166497,166458,166419,166380,166341,166302,166264,166225,166186,166147,166108,166069,166030,165991,165952,165914,165875,165836,165797,165758,165719,165680,165641,165602,165563,165524,165485,165446,165407,165368,165329,165290,165251,165212,165173,165134,165095,165056,165017,164978,164939,164900,164861,164821,164782,164743,164704,164665,164626,164587,164548,164509,164469,164430,164391,164352,164313,164274,164234,164195,164156,164117,164078,164039,163999,163960,163921,163882,163842,163803,163764,163725,163685,163646,163607,163568,163528,163489,163450,163410,163371,163332,163292,163253,163214,163174,163135,163096,163056,163017,162978,162938,162899,162860,162820,162781,162741,162702,162663,162623,162584,162544,162505,162465,162426,162386,162347,162308,162268,162229,162189,162150,162110,162071,162031,161992,161952,161913,161873,161833,161794,161754,161715,161675,161636,161596,161557,161517,161477,161438,161398,161359,161319,161279,161240,161200,161160,161121,161081,161041,161002,160962,160922,160883,160843,160803,160764,160724,160684,160644,160605,160565,160525,160486,160446,160406,160366,160327,160287,160247,160207,160167,160128,160088,160048,160008,159968,159929,159889,159849,159809,159769,159729,159689,159650,159610,159570,159530,159490,159450,159410,159370,159330,159291,159251,159211,159171,159131,159091,159051,159011,158971,158931,158891,158851,158811,158771,158731,158691,158651,158611,158571,158531,158491,158451,158411,158371,158331,158291,158251,158211,158170,158130,158090,158050,158010,157970,157930,157890,157850,157809,157769,157729,157689,157649,157609,157569,157528,157488,157448,157408,157368,157327,157287,157247,157207,157167,157126,157086,157046,157006,156965,156925,156885,156845,156804,156764,156724,156683,156643,156603,156562,156522,156482,156441,156401,156361,156320,156280,156240,156199,156159,156119,156078,156038,155997,155957,155917,155876,155836,155795,155755,155715,155674,155634,155593,155553,155512,155472,155431,155391,155350,155310,155269,155229,155188,155148,155107,155067,155026,154986,154945,154905,154864,154824,154783,154742,154702,154661,154621,154580,154539,154499,154458,154418,154377,154336,154296,154255,154214,154174,154133,154093,154052,154011,153970,153930,153889,153848,153808,153767,153726,153686,153645,153604,153563,153523,153482,153441,153400,153360,153319,153278,153237,153197,153156,153115,153074,153033,152993,152952,152911,152870,152829,152788,152748,152707,152666,152625,152584,152543,152502,152461,152421,152380,152339,152298,152257,152216,152175,152134,152093,152052,152011,151970,151929,151888,151847,151806,151765,151724,151683,151642,151601,151560,151519,151478,151437,151396,151355,151314,151273,151232,151191,151150,151109,151068,151027,150986,150945,150904,150862,150821,150780,150739,150698,150657,150616,150575,150533,150492,150451,150410,150369,150328,150286,150245,150204,150163,150122,150080,150039,149998,149957,149916,149874,149833,149792,149751,149709,149668,149627,149585,149544,149503,149462,149420,149379,149338,149296,149255,149214,149172,149131,149090,149048,149007,148966,148924,148883,148842,148800,148759,148717,148676,148635,148593,148552,148510,148469,148428,148386,148345,148303,148262,148220,148179,148137,148096,148054,148013,147971,147930,147888,147847,147805,147764,147722,147681,147639,147598,147556,147515,147473,147432,147390,147348,147307,147265,147224,147182,147141,147099,147057,147016,146974,146932,146891,146849,146808,146766,146724,146683,146641,146599,146558,146516,146474,146433,146391,146349,146307,146266,146224,146182,146141,146099,146057,146015,145974,145932,145890,145848,145807,145765,145723,145681,145639,145598,145556,145514,145472,145430,145389,145347,145305,145263,145221,145179,145137,145096,145054,145012,144970,144928,144886,144844,144802,144761,144719,144677,144635,144593,144551,144509,144467,144425,144383,144341,144299,144257,144215,144173,144131,144089,144047,144005,143963,143921,143879,143837,143795,143753,143711,143669,143627,143585,143543,143501,143459,143417,143375,143333,143291,143248,143206,143164,143122,143080,143038,142996,142954,142912,142869,142827,142785,142743,142701,142659,142616,142574,142532,142490,142448,142405,142363,142321,142279,142237,142194,142152,142110,142068,142025,141983,141941,141899,141856,141814,141772,141730,141687,141645,141603,141560,141518,141476,141433,141391,141349,141306,141264,141222,141179,141137,141095,141052,141010,140968,140925,140883,140840,140798,140756,140713,140671,140628,140586,140544,140501,140459,140416,140374,140331,140289,140246,140204,140161,140119,140077,140034,139992,139949,139907,139864,139821,139779,139736,139694,139651,139609,139566,139524,139481,139439,139396,139353,139311,139268,139226,139183,139141,139098,139055,139013,138970,138927,138885,138842,138800,138757,138714,138672,138629,138586,138544,138501,138458,138416,138373,138330,138288,138245,138202,138159,138117,138074,138031,137988,137946,137903,137860,137817,137775,137732,137689,137646,137604,137561,137518,137475,137432,137390,137347,137304,137261,137218,137176,137133,137090,137047,137004,136961,136918,136876,136833,136790,136747,136704,136661,136618,136575,136532,136490,136447,136404,136361,136318,136275,136232,136189,136146,136103,136060,136017,135974,135931,135888,135845,135802,135759,135716,135673,135630,135587,135544,135501,135458,135415,135372,135329,135286,135243,135200,135157,135114,135071,135028,134984,134941,134898,134855,134812,134769,134726,134683,134640,134596,134553,134510,134467,134424,134381,134338,134294,134251,134208,134165,134122,134078,134035,133992,133949,133906,133862,133819,133776,133733,133690,133646,133603,133560,133517,133473,133430,133387,133343,133300,133257,133214,133170,133127,133084,133040,132997,132954,132910,132867,132824,132780,132737,132694,132650,132607,132564,132520,132477,132434,132390,132347,132303,132260,132217,132173,132130,132086,132043,132000,131956,131913,131869,131826,131782,131739,131695,131652,131609,131565,131522,131478,131435,131391,131348,131304,131261,131217,131174,131130,131087,131043,130999,130956,130912,130869,130825,130782,130738,130695,130651,130607,130564,130520,130477,130433,130389,130346,130302,130259,130215,130171,130128,130084,130040,129997,129953,129909,129866,129822,129778,129735,129691,129647,129604,129560,129516,129473,129429,129385,129341,129298,129254,129210,129167,129123,129079,129035,128992,128948,128904,128860,128816,128773,128729,128685,128641,128598,128554,128510,128466,128422,128378,128335,128291,128247,128203,128159,128115,128072,128028,127984,127940,127896,127852,127808,127764,127721,127677,127633,127589,127545,127501,127457,127413,127369,127325,127281,127237,127193,127150,127106,127062,127018,126974,126930,126886,126842,126798,126754,126710,126666,126622,126578,126534,126490,126446,126402,126358,126314,126269,126225,126181,126137,126093,126049,126005,125961,125917,125873,125829,125785,125741,125696,125652,125608,125564,125520,125476,125432,125388,125343,125299,125255,125211,125167,125123,125078,125034,124990,124946,124902,124857,124813,124769,124725,124681,124636,124592,124548,124504,124460,124415,124371,124327,124283,124238,124194,124150,124105,124061,124017,123973,123928,123884,123840,123795,123751,123707,123662,123618,123574,123529,123485,123441,123396,123352,123308,123263,123219,123175,123130,123086,123042,122997,122953,122908,122864,122820,122775,122731,122686,122642,122597,122553,122509,122464,122420,122375,122331,122286,122242,122197,122153,122108,122064,122019,121975,121931,121886,121842,121797,121752,121708,121663,121619,121574,121530,121485,121441,121396,121352,121307,121263,121218,121173,121129,121084,121040,120995,120950,120906,120861,120817,120772,120727,120683,120638,120594,120549,120504,120460,120415,120370,120326,120281,120236,120192,120147,120102,120058,120013,119968,119924,119879,119834,119790,119745,119700,119655,119611,119566,119521,119476,119432,119387,119342,119297,119253,119208,119163,119118,119074,119029,118984,118939,118894,118850,118805,118760,118715,118670,118626,118581,118536,118491,118446,118401,118357,118312,118267,118222,118177,118132,118087,118042,117998,117953,117908,117863,117818,117773,117728,117683,117638,117593,117549,117504,117459,117414,117369,117324,117279,117234,117189,117144,117099,117054,117009,116964,116919,116874,116829,116784,116739,116694,116649,116604,116559,116514,116469,116424,116379,116334,116289,116244,116199,116154,116109,116064,116018,115973,115928,115883,115838,115793,115748,115703,115658,115613,115567,115522,115477,115432,115387,115342,115297,115252,115206,115161,115116,115071,115026,114981,114935,114890,114845,114800,114755,114710,114664,114619,114574,114529,114483,114438,114393,114348,114303,114257,114212,114167,114122,114076,114031,113986,113941,113895,113850,113805,113759,113714,113669,113624,113578,113533,113488,113442,113397,113352,113306,113261,113216,113170,113125,113080,113034,112989,112944,112898,112853,112808,112762,112717,112671,112626,112581,112535,112490,112444,112399,112354,112308,112263,112217,112172,112126,112081,112036,111990,111945,111899,111854,111808,111763,111717,111672,111626,111581,111535,111490,111444,111399,111353,111308,111262,111217,111171,111126,111080,111035,110989,110944,110898,110853,110807,110762,110716,110670,110625,110579,110534,110488,110443,110397,110351,110306,110260,110215,110169,110123,110078,110032,109986,109941,109895,109850,109804,109758,109713,109667,109621,109576,109530,109484,109439,109393,109347,109302,109256,109210,109165,109119,109073,109027,108982,108936,108890,108845,108799,108753,108707,108662,108616,108570,108524,108479,108433,108387,108341,108295,108250,108204,108158,108112,108067,108021,107975,107929,107883,107838,107792,107746,107700,107654,107608,107563,107517,107471,107425,107379,107333,107287,107242,107196,107150,107104,107058,107012,106966,106920,106875,106829,106783,106737,106691,106645,106599,106553,106507,106461,106415,106369,106323,106278,106232,106186,106140,106094,106048,106002,105956,105910,105864,105818,105772,105726,105680,105634,105588,105542,105496,105450,105404,105358,105312,105266,105220,105174,105128,105082,105035,104989,104943,104897,104851,104805,104759,104713,104667,104621,104575,104529,104483,104436,104390,104344,104298,104252,104206,104160,104114,104067,104021,103975,103929,103883,103837,103791,103744,103698,103652,103606,103560,103514,103467,103421,103375,103329,103283,103236,103190,103144,103098,103052,103005,102959,102913,102867,102820,102774,102728,102682,102635,102589,102543,102497,102450,102404,102358,102312,102265,102219,102173,102126,102080,102034,101988,101941,101895,101849,101802,101756,101710,101663,101617,101571,101524,101478,101432,101385,101339,101293,101246,101200,101153,101107,101061,101014,100968,100922,100875,100829,100782,100736,100690,100643,100597,100550,100504,100457,100411,100365,100318,100272,100225,100179,100132,100086,100039,99993,99947,99900,99854,99807,99761,99714,99668,99621,99575,99528,99482,99435,99389,99342,99296,99249,99203,99156,99110,99063,99016,98970,98923,98877,98830,98784,98737,98691,98644,98597,98551,98504,98458,98411,98364,98318,98271,98225,98178,98131,98085,98038,97992,97945,97898,97852,97805,97758,97712,97665,97619,97572,97525,97479,97432,97385,97339,97292,97245,97199,97152,97105,97058,97012,96965,96918,96872,96825,96778,96732,96685,96638,96591,96545,96498,96451,96404,96358,96311,96264,96217,96171,96124,96077,96030,95984,95937,95890,95843,95796,95750,95703,95656,95609,95562,95516,95469,95422,95375,95328,95282,95235,95188,95141,95094,95047,95001,94954,94907,94860,94813,94766,94719,94673,94626,94579,94532,94485,94438,94391,94344,94297,94251,94204,94157,94110,94063,94016,93969,93922,93875,93828,93781,93734,93687,93640,93594,93547,93500,93453,93406,93359,93312,93265,93218,93171,93124,93077,93030,92983,92936,92889,92842,92795,92748,92701,92654,92607,92560,92513,92466,92419,92372,92325,92278,92230,92183,92136,92089,92042,91995,91948,91901,91854,91807,91760,91713,91666,91619,91571,91524,91477,91430,91383,91336,91289,91242,91195,91147,91100,91053,91006,90959,90912,90865,90817,90770,90723,90676,90629,90582,90534,90487,90440,90393,90346,90299,90251,90204,90157,90110,90063,90015,89968,89921,89874,89826,89779,89732,89685,89638,89590,89543,89496,89449,89401,89354,89307,89260,89212,89165,89118,89070,89023,88976,88929,88881,88834,88787,88739,88692,88645,88598,88550,88503,88456,88408,88361,88314,88266,88219,88172,88124,88077,88030,87982,87935,87888,87840,87793,87745,87698,87651,87603,87556,87509,87461,87414,87366,87319,87272,87224,87177,87129,87082,87035,86987,86940,86892,86845,86798,86750,86703,86655,86608,86560,86513,86465,86418,86371,86323,86276,86228,86181,86133,86086,86038,85991,85943,85896,85848,85801,85753,85706,85658,85611,85563,85516,85468,85421,85373,85326,85278,85231,85183,85136,85088,85040,84993,84945,84898,84850,84803,84755,84708,84660,84612,84565,84517,84470,84422,84374,84327,84279,84232,84184,84136,84089,84041,83994,83946,83898,83851,83803,83756,83708,83660,83613,83565,83517,83470,83422,83374,83327,83279,83231,83184,83136,83088,83041,82993,82945,82898,82850,82802,82755,82707,82659,82612,82564,82516,82468,82421,82373,82325,82278,82230,82182,82134,82087,82039,81991,81943,81896,81848,81800,81752,81705,81657,81609,81561,81514,81466,81418,81370,81322,81275,81227,81179,81131,81083,81036,80988,80940,80892,80844,80797,80749,80701,80653,80605,80557,80510,80462,80414,80366,80318,80270,80223,80175,80127,80079,80031,79983,79935,79887,79840,79792,79744,79696,79648,79600,79552,79504,79457,79409,79361,79313,79265,79217,79169,79121,79073,79025,78977,78929,78881,78834,78786,78738,78690,78642,78594,78546,78498,78450,78402,78354,78306,78258,78210,78162,78114,78066,78018,77970,77922,77874,77826,77778,77730,77682,77634,77586,77538,77490,77442,77394,77346,77298,77250,77202,77154,77106,77058,77010,76962,76914,76866,76818,76770,76721,76673,76625,76577,76529,76481,76433,76385,76337,76289,76241,76193,76144,76096,76048,76000,75952,75904,75856,75808,75760,75711,75663,75615,75567,75519,75471,75423,75375,75326,75278,75230,75182,75134,75086,75037,74989,74941,74893,74845,74797,74748,74700,74652,74604,74556,74508,74459,74411,74363,74315,74267,74218,74170,74122,74074,74025,73977,73929,73881,73833,73784,73736,73688,73640,73591,73543,73495,73447,73398,73350,73302,73254,73205,73157,73109,73061,73012,72964,72916,72867,72819,72771,72723,72674,72626,72578,72529,72481,72433,72384,72336,72288,72239,72191,72143,72095,72046,71998,71950,71901,71853,71805,71756,71708,71659,71611,71563,71514,71466,71418,71369,71321,71273,71224,71176,71127,71079,71031,70982,70934,70886,70837,70789,70740,70692,70644,70595,70547,70498,70450,70401,70353,70305,70256,70208,70159,70111,70062,70014,69966,69917,69869,69820,69772,69723,69675,69626,69578,69530,69481,69433,69384,69336,69287,69239,69190,69142,69093,69045,68996,68948,68899,68851,68802,68754,68705,68657,68608,68560,68511,68463,68414,68366,68317,68269,68220,68171,68123,68074,68026,67977,67929,67880,67832,67783,67735,67686,67637,67589,67540,67492,67443,67395,67346,67297,67249,67200,67152,67103,67055,67006,66957,66909,66860,66812,66763,66714,66666,66617,66568,66520,66471,66423,66374,66325,66277,66228,66179,66131,66082,66034,65985,65936,65888,65839,65790,65742,65693,65644,65596,65547,65498,65450,65401,65352,65304,65255,65206,65158,65109,65060,65011,64963,64914,64865,64817,64768,64719,64671,64622,64573,64524,64476,64427,64378,64329,64281,64232,64183,64135,64086,64037,63988,63940,63891,63842,63793,63745,63696,63647,63598,63550,63501,63452,63403,63354,63306,63257,63208,63159,63111,63062,63013,62964,62915,62867,62818,62769,62720,62671,62623,62574,62525,62476,62427,62378,62330,62281,62232,62183,62134,62085,62037,61988,61939,61890,61841,61792,61744,61695,61646,61597,61548,61499,61450,61402,61353,61304,61255,61206,61157,61108,61059,61011,60962,60913,60864,60815,60766,60717,60668,60619,60570,60522,60473,60424,60375,60326,60277,60228,60179,60130,60081,60032,59983,59935,59886,59837,59788,59739,59690,59641,59592,59543,59494,59445,59396,59347,59298,59249,59200,59151,59102,59053,59004,58955,58906,58857,58808,58759,58711,58662,58613,58564,58515,58466,58417,58368,58319,58270,58221,58171,58122,58073,58024,57975,57926,57877,57828,57779,57730,57681,57632,57583,57534,57485,57436,57387,57338,57289,57240,57191,57142,57093,57044,56995,56946,56896,56847,56798,56749,56700,56651,56602,56553,56504,56455,56406,56357,56308,56258,56209,56160,56111,56062,56013,55964,55915,55866,55816,55767,55718,55669,55620,55571,55522,55473,55424,55374,55325,55276,55227,55178,55129,55080,55030,54981,54932,54883,54834,54785,54736,54686,54637,54588,54539,54490,54441,54391,54342,54293,54244,54195,54145,54096,54047,53998,53949,53900,53850,53801,53752,53703,53654,53604,53555,53506,53457,53408,53358,53309,53260,53211,53161,53112,53063,53014,52965,52915,52866,52817,52768,52718,52669,52620,52571,52521,52472,52423,52374,52324,52275,52226,52177,52127,52078,52029,51980,51930,51881,51832,51782,51733,51684,51635,51585,51536,51487,51438,51388,51339,51290,51240,51191,51142,51092,51043,50994,50945,50895,50846,50797,50747,50698,50649,50599,50550,50501,50451,50402,50353,50303,50254,50205,50155,50106,50057,50007,49958,49909,49859,49810,49761,49711,49662,49613,49563,49514,49464,49415,49366,49316,49267,49218,49168,49119,49070,49020,48971,48921,48872,48823,48773,48724,48674,48625,48576,48526,48477,48427,48378,48329,48279,48230,48180,48131,48082,48032,47983,47933,47884,47835,47785,47736,47686,47637,47587,47538,47489,47439,47390,47340,47291,47241,47192,47142,47093,47044,46994,46945,46895,46846,46796,46747,46697,46648,46598,46549,46500,46450,46401,46351,46302,46252,46203,46153,46104,46054,46005,45955,45906,45856,45807,45757,45708,45658,45609,45559,45510,45460,45411,45361,45312,45262,45213,45163,45114,45064,45015,44965,44916,44866,44817,44767,44718,44668,44619,44569,44519,44470,44420,44371,44321,44272,44222,44173,44123,44074,44024,43974,43925,43875,43826,43776,43727,43677,43628,43578,43528,43479,43429,43380,43330,43281,43231,43181,43132,43082,43033,42983,42933,42884,42834,42785,42735,42686,42636,42586,42537,42487,42438,42388,42338,42289,42239,42190,42140,42090,42041,41991,41941,41892,41842,41793,41743,41693,41644,41594,41544,41495,41445,41396,41346,41296,41247,41197,41147,41098,41048,40998,40949,40899,40849,40800,40750,40701,40651,40601,40552,40502,40452,40403,40353,40303,40254,40204,40154,40105,40055,40005,39956,39906,39856,39806,39757,39707,39657,39608,39558,39508,39459,39409,39359,39310,39260,39210,39160,39111,39061,39011,38962,38912,38862,38813,38763,38713,38663,38614,38564,38514,38465,38415,38365,38315,38266,38216,38166,38116,38067,38017,37967,37917,37868,37818,37768,37719,37669,37619,37569,37520,37470,37420,37370,37321,37271,37221,37171,37122,37072,37022,36972,36922,36873,36823,36773,36723,36674,36624,36574,36524,36475,36425,36375,36325,36275,36226,36176,36126,36076,36027,35977,35927,35877,35827,35778,35728,35678,35628,35578,35529,35479,35429,35379,35329,35280,35230,35180,35130,35080,35030,34981,34931,34881,34831,34781,34732,34682,34632,34582,34532,34482,34433,34383,34333,34283,34233,34183,34134,34084,34034,33984,33934,33884,33835,33785,33735,33685,33635,33585,33535,33486,33436,33386,33336,33286,33236,33186,33137,33087,33037,32987,32937,32887,32837,32788,32738,32688,32638,32588,32538,32488,32438,32389,32339,32289,32239,32189,32139,32089,32039,31989,31940,31890,31840,31790,31740,31690,31640,31590,31540,31490,31441,31391,31341,31291,31241,31191,31141,31091,31041,30991,30942,30892,30842,30792,30742,30692,30642,30592,30542,30492,30442,30392,30342,30293,30243,30193,30143,30093,30043,29993,29943,29893,29843,29793,29743,29693,29643,29593,29543,29494,29444,29394,29344,29294,29244,29194,29144,29094,29044,28994,28944,28894,28844,28794,28744,28694,28644,28594,28544,28494,28444,28394,28344,28295,28245,28195,28145,28095,28045,27995,27945,27895,27845,27795,27745,27695,27645,27595,27545,27495,27445,27395,27345,27295,27245,27195,27145,27095,27045,26995,26945,26895,26845,26795,26745,26695,26645,26595,26545,26495,26445,26395,26345,26295,26245,26195,26145,26095,26045,25995,25945,25895,25845,25795,25745,25695,25645,25595,25545,25495,25444,25394,25344,25294,25244,25194,25144,25094,25044,24994,24944,24894,24844,24794,24744,24694,24644,24594,24544,24494,24444,24394,24344,24294,24244,24193,24143,24093,24043,23993,23943,23893,23843,23793,23743,23693,23643,23593,23543,23493,23443,23393,23342,23292,23242,23192,23142,23092,23042,22992,22942,22892,22842,22792,22742,22692,22641,22591,22541,22491,22441,22391,22341,22291,22241,22191,22141,22091,22040,21990,21940,21890,21840,21790,21740,21690,21640,21590,21540,21489,21439,21389,21339,21289,21239,21189,21139,21089,21039,20988,20938,20888,20838,20788,20738,20688,20638,20588,20538,20487,20437,20387,20337,20287,20237,20187,20137,20086,20036,19986,19936,19886,19836,19786,19736,19686,19635,19585,19535,19485,19435,19385,19335,19285,19234,19184,19134,19084,19034,18984,18934,18883,18833,18783,18733,18683,18633,18583,18532,18482,18432,18382,18332,18282,18232,18181,18131,18081,18031,17981,17931,17881,17830,17780,17730,17680,17630,17580,17530,17479,17429,17379,17329,17279,17229,17178,17128,17078,17028,16978,16928,16878,16827,16777,16727,16677,16627,16577,16526,16476,16426,16376,16326,16276,16225,16175,16125,16075,16025,15975,15924,15874,15824,15774,15724,15673,15623,15573,15523,15473,15423,15372,15322,15272,15222,15172,15122,15071,15021,14971,14921,14871,14820,14770,14720,14670,14620,14569,14519,14469,14419,14369,14319,14268,14218,14168,14118,14068,14017,13967,13917,13867,13817,13766,13716,13666,13616,13566,13515,13465,13415,13365,13315,13264,13214,13164,13114,13064,13013,12963,12913,12863,12813,12762,12712,12662,12612,12562,12511,12461,12411,12361,12311,12260,12210,12160,12110,12059,12009,11959,11909,11859,11808,11758,11708,11658,11608,11557,11507,11457,11407,11356,11306,11256,11206,11156,11105,11055,11005,10955,10904,10854,10804,10754,10704,10653,10603,10553,10503,10452,10402,10352,10302,10252,10201,10151,10101,10051,10000,9950,9900,9850,9799,9749,9699,9649,9599,9548,9498,9448,9398,9347,9297,9247,9197,9146,9096,9046,8996,8946,8895,8845,8795,8745,8694,8644,8594,8544,8493,8443,8393,8343,8292,8242,8192,8142,8091,8041,7991,7941,7890,7840,7790,7740,7690,7639,7589,7539,7489,7438,7388,7338,7288,7237,7187,7137,7087,7036,6986,6936,6886,6835,6785,6735,6685,6634,6584,6534,6484,6433,6383,6333,6283,6232,6182,6132,6082,6031,5981,5931,5881,5830,5780,5730,5680,5629,5579,5529,5479,5428,5378,5328,5278,5227,5177,5127,5076,5026,4976,4926,4875,4825,4775,4725,4674,4624,4574,4524,4473,4423,4373,4323,4272,4222,4172,4122,4071,4021,3971,3921,3870,3820,3770,3720,3669,3619,3569,3518,3468,3418,3368,3317,3267,3217,3167,3116,3066,3016,2966,2915,2865,2815,2765,2714,2664,2614,2563,2513,2463,2413,2362,2312,2262,2212,2161,2111,2061,2011,1960,1910,1860,1810,1759,1709,1659,1608,1558,1508,1458,1407,1357,1307,1257,1206,1156,1106,1056,1005,955,905,855,804,754,704,653,603,553,503,452,402,352,302,251,201,151,101,50,0,-49,-100,-150,-200,-250,-301,-351,-401,-451,-502,-552,-602,-652,-703,-753,-803,-854,-904,-954,-1004,-1055,-1105,-1155,-1205,-1256,-1306,-1356,-1406,-1457,-1507,-1557,-1607,-1658,-1708,-1758,-1809,-1859,-1909,-1959,-2010,-2060,-2110,-2160,-2211,-2261,-2311,-2361,-2412,-2462,-2512,-2562,-2613,-2663,-2713,-2764,-2814,-2864,-2914,-2965,-3015,-3065,-3115,-3166,-3216,-3266,-3316,-3367,-3417,-3467,-3517,-3568,-3618,-3668,-3719,-3769,-3819,-3869,-3920,-3970,-4020,-4070,-4121,-4171,-4221,-4271,-4322,-4372,-4422,-4472,-4523,-4573,-4623,-4673,-4724,-4774,-4824,-4874,-4925,-4975,-5025,-5075,-5126,-5176,-5226,-5277,-5327,-5377,-5427,-5478,-5528,-5578,-5628,-5679,-5729,-5779,-5829,-5880,-5930,-5980,-6030,-6081,-6131,-6181,-6231,-6282,-6332,-6382,-6432,-6483,-6533,-6583,-6633,-6684,-6734,-6784,-6834,-6885,-6935,-6985,-7035,-7086,-7136,-7186,-7236,-7287,-7337,-7387,-7437,-7488,-7538,-7588,-7638,-7689,-7739,-7789,-7839,-7889,-7940,-7990,-8040,-8090,-8141,-8191,-8241,-8291,-8342,-8392,-8442,-8492,-8543,-8593,-8643,-8693,-8744,-8794,-8844,-8894,-8945,-8995,-9045,-9095,-9145,-9196,-9246,-9296,-9346,-9397,-9447,-9497,-9547,-9598,-9648,-9698,-9748,-9798,-9849,-9899,-9949,-9999,-10050,-10100,-10150,-10200,-10251,-10301,-10351,-10401,-10451,-10502,-10552,-10602,-10652,-10703,-10753,-10803,-10853,-10903,-10954,-11004,-11054,-11104,-11155,-11205,-11255,-11305,-11355,-11406,-11456,-11506,-11556,-11607,-11657,-11707,-11757,-11807,-11858,-11908,-11958,-12008,-12058,-12109,-12159,-12209,-12259,-12310,-12360,-12410,-12460,-12510,-12561,-12611,-12661,-12711,-12761,-12812,-12862,-12912,-12962,-13012,-13063,-13113,-13163,-13213,-13263,-13314,-13364,-13414,-13464,-13514,-13565,-13615,-13665,-13715,-13765,-13816,-13866,-13916,-13966,-14016,-14067,-14117,-14167,-14217,-14267,-14318,-14368,-14418,-14468,-14518,-14568,-14619,-14669,-14719,-14769,-14819,-14870,-14920,-14970,-15020,-15070,-15121,-15171,-15221,-15271,-15321,-15371,-15422,-15472,-15522,-15572,-15622,-15672,-15723,-15773,-15823,-15873,-15923,-15974,-16024,-16074,-16124,-16174,-16224,-16275,-16325,-16375,-16425,-16475,-16525,-16576,-16626,-16676,-16726,-16776,-16826,-16877,-16927,-16977,-17027,-17077,-17127,-17177,-17228,-17278,-17328,-17378,-17428,-17478,-17529,-17579,-17629,-17679,-17729,-17779,-17829,-17880,-17930,-17980,-18030,-18080,-18130,-18180,-18231,-18281,-18331,-18381,-18431,-18481,-18531,-18582,-18632,-18682,-18732,-18782,-18832,-18882,-18933,-18983,-19033,-19083,-19133,-19183,-19233,-19284,-19334,-19384,-19434,-19484,-19534,-19584,-19634,-19685,-19735,-19785,-19835,-19885,-19935,-19985,-20035,-20085,-20136,-20186,-20236,-20286,-20336,-20386,-20436,-20486,-20537,-20587,-20637,-20687,-20737,-20787,-20837,-20887,-20937,-20987,-21038,-21088,-21138,-21188,-21238,-21288,-21338,-21388,-21438,-21488,-21539,-21589,-21639,-21689,-21739,-21789,-21839,-21889,-21939,-21989,-22039,-22090,-22140,-22190,-22240,-22290,-22340,-22390,-22440,-22490,-22540,-22590,-22640,-22691,-22741,-22791,-22841,-22891,-22941,-22991,-23041,-23091,-23141,-23191,-23241,-23291,-23341,-23392,-23442,-23492,-23542,-23592,-23642,-23692,-23742,-23792,-23842,-23892,-23942,-23992,-24042,-24092,-24142,-24192,-24243,-24293,-24343,-24393,-24443,-24493,-24543,-24593,-24643,-24693,-24743,-24793,-24843,-24893,-24943,-24993,-25043,-25093,-25143,-25193,-25243,-25293,-25343,-25393,-25443,-25494,-25544,-25594,-25644,-25694,-25744,-25794,-25844,-25894,-25944,-25994,-26044,-26094,-26144,-26194,-26244,-26294,-26344,-26394,-26444,-26494,-26544,-26594,-26644,-26694,-26744,-26794,-26844,-26894,-26944,-26994,-27044,-27094,-27144,-27194,-27244,-27294,-27344,-27394,-27444,-27494,-27544,-27594,-27644,-27694,-27744,-27794,-27844,-27894,-27944,-27994,-28044,-28094,-28144,-28194,-28244,-28294,-28343,-28393,-28443,-28493,-28543,-28593,-28643,-28693,-28743,-28793,-28843,-28893,-28943,-28993,-29043,-29093,-29143,-29193,-29243,-29293,-29343,-29393,-29443,-29493,-29542,-29592,-29642,-29692,-29742,-29792,-29842,-29892,-29942,-29992,-30042,-30092,-30142,-30192,-30242,-30292,-30341,-30391,-30441,-30491,-30541,-30591,-30641,-30691,-30741,-30791,-30841,-30891,-30941,-30990,-31040,-31090,-31140,-31190,-31240,-31290,-31340,-31390,-31440,-31489,-31539,-31589,-31639,-31689,-31739,-31789,-31839,-31889,-31939,-31988,-32038,-32088,-32138,-32188,-32238,-32288,-32338,-32388,-32437,-32487,-32537,-32587,-32637,-32687,-32737,-32787,-32836,-32886,-32936,-32986,-33036,-33086,-33136,-33185,-33235,-33285,-33335,-33385,-33435,-33485,-33534,-33584,-33634,-33684,-33734,-33784,-33834,-33883,-33933,-33983,-34033,-34083,-34133,-34182,-34232,-34282,-34332,-34382,-34432,-34481,-34531,-34581,-34631,-34681,-34731,-34780,-34830,-34880,-34930,-34980,-35029,-35079,-35129,-35179,-35229,-35279,-35328,-35378,-35428,-35478,-35528,-35577,-35627,-35677,-35727,-35777,-35826,-35876,-35926,-35976,-36026,-36075,-36125,-36175,-36225,-36274,-36324,-36374,-36424,-36474,-36523,-36573,-36623,-36673,-36722,-36772,-36822,-36872,-36921,-36971,-37021,-37071,-37121,-37170,-37220,-37270,-37320,-37369,-37419,-37469,-37519,-37568,-37618,-37668,-37718,-37767,-37817,-37867,-37916,-37966,-38016,-38066,-38115,-38165,-38215,-38265,-38314,-38364,-38414,-38464,-38513,-38563,-38613,-38662,-38712,-38762,-38812,-38861,-38911,-38961,-39010,-39060,-39110,-39159,-39209,-39259,-39309,-39358,-39408,-39458,-39507,-39557,-39607,-39656,-39706,-39756,-39805,-39855,-39905,-39955,-40004,-40054,-40104,-40153,-40203,-40253,-40302,-40352,-40402,-40451,-40501,-40551,-40600,-40650,-40700,-40749,-40799,-40848,-40898,-40948,-40997,-41047,-41097,-41146,-41196,-41246,-41295,-41345,-41395,-41444,-41494,-41543,-41593,-41643,-41692,-41742,-41792,-41841,-41891,-41940,-41990,-42040,-42089,-42139,-42189,-42238,-42288,-42337,-42387,-42437,-42486,-42536,-42585,-42635,-42685,-42734,-42784,-42833,-42883,-42932,-42982,-43032,-43081,-43131,-43180,-43230,-43280,-43329,-43379,-43428,-43478,-43527,-43577,-43627,-43676,-43726,-43775,-43825,-43874,-43924,-43973,-44023,-44073,-44122,-44172,-44221,-44271,-44320,-44370,-44419,-44469,-44518,-44568,-44618,-44667,-44717,-44766,-44816,-44865,-44915,-44964,-45014,-45063,-45113,-45162,-45212,-45261,-45311,-45360,-45410,-45459,-45509,-45558,-45608,-45657,-45707,-45756,-45806,-45855,-45905,-45954,-46004,-46053,-46103,-46152,-46202,-46251,-46301,-46350,-46400,-46449,-46499,-46548,-46597,-46647,-46696,-46746,-46795,-46845,-46894,-46944,-46993,-47043,-47092,-47141,-47191,-47240,-47290,-47339,-47389,-47438,-47488,-47537,-47586,-47636,-47685,-47735,-47784,-47834,-47883,-47932,-47982,-48031,-48081,-48130,-48179,-48229,-48278,-48328,-48377,-48426,-48476,-48525,-48575,-48624,-48673,-48723,-48772,-48822,-48871,-48920,-48970,-49019,-49069,-49118,-49167,-49217,-49266,-49315,-49365,-49414,-49463,-49513,-49562,-49612,-49661,-49710,-49760,-49809,-49858,-49908,-49957,-50006,-50056,-50105,-50154,-50204,-50253,-50302,-50352,-50401,-50450,-50500,-50549,-50598,-50648,-50697,-50746,-50796,-50845,-50894,-50944,-50993,-51042,-51091,-51141,-51190,-51239,-51289,-51338,-51387,-51437,-51486,-51535,-51584,-51634,-51683,-51732,-51781,-51831,-51880,-51929,-51979,-52028,-52077,-52126,-52176,-52225,-52274,-52323,-52373,-52422,-52471,-52520,-52570,-52619,-52668,-52717,-52767,-52816,-52865,-52914,-52964,-53013,-53062,-53111,-53160,-53210,-53259,-53308,-53357,-53407,-53456,-53505,-53554,-53603,-53653,-53702,-53751,-53800,-53849,-53899,-53948,-53997,-54046,-54095,-54144,-54194,-54243,-54292,-54341,-54390,-54440,-54489,-54538,-54587,-54636,-54685,-54735,-54784,-54833,-54882,-54931,-54980,-55029,-55079,-55128,-55177,-55226,-55275,-55324,-55373,-55423,-55472,-55521,-55570,-55619,-55668,-55717,-55766,-55815,-55865,-55914,-55963,-56012,-56061,-56110,-56159,-56208,-56257,-56307,-56356,-56405,-56454,-56503,-56552,-56601,-56650,-56699,-56748,-56797,-56846,-56895,-56945,-56994,-57043,-57092,-57141,-57190,-57239,-57288,-57337,-57386,-57435,-57484,-57533,-57582,-57631,-57680,-57729,-57778,-57827,-57876,-57925,-57974,-58023,-58072,-58121,-58170,-58220,-58269,-58318,-58367,-58416,-58465,-58514,-58563,-58612,-58661,-58710,-58758,-58807,-58856,-58905,-58954,-59003,-59052,-59101,-59150,-59199,-59248,-59297,-59346,-59395,-59444,-59493,-59542,-59591,-59640,-59689,-59738,-59787,-59836,-59885,-59934,-59982,-60031,-60080,-60129,-60178,-60227,-60276,-60325,-60374,-60423,-60472,-60521,-60569,-60618,-60667,-60716,-60765,-60814,-60863,-60912,-60961,-61010,-61058,-61107,-61156,-61205,-61254,-61303,-61352,-61401,-61449,-61498,-61547,-61596,-61645,-61694,-61743,-61791,-61840,-61889,-61938,-61987,-62036,-62084,-62133,-62182,-62231,-62280,-62329,-62377,-62426,-62475,-62524,-62573,-62622,-62670,-62719,-62768,-62817,-62866,-62914,-62963,-63012,-63061,-63110,-63158,-63207,-63256,-63305,-63353,-63402,-63451,-63500,-63549,-63597,-63646,-63695,-63744,-63792,-63841,-63890,-63939,-63987,-64036,-64085,-64134,-64182,-64231,-64280,-64328,-64377,-64426,-64475,-64523,-64572,-64621,-64670,-64718,-64767,-64816,-64864,-64913,-64962,-65010,-65059,-65108,-65157,-65205,-65254,-65303,-65351,-65400,-65449,-65497,-65546,-65595,-65643,-65692,-65741,-65789,-65838,-65887,-65935,-65984,-66033,-66081,-66130,-66178,-66227,-66276,-66324,-66373,-66422,-66470,-66519,-66567,-66616,-66665,-66713,-66762,-66811,-66859,-66908,-66956,-67005,-67054,-67102,-67151,-67199,-67248,-67296,-67345,-67394,-67442,-67491,-67539,-67588,-67636,-67685,-67734,-67782,-67831,-67879,-67928,-67976,-68025,-68073,-68122,-68170,-68219,-68268,-68316,-68365,-68413,-68462,-68510,-68559,-68607,-68656,-68704,-68753,-68801,-68850,-68898,-68947,-68995,-69044,-69092,-69141,-69189,-69238,-69286,-69335,-69383,-69432,-69480,-69529,-69577,-69625,-69674,-69722,-69771,-69819,-69868,-69916,-69965,-70013,-70061,-70110,-70158,-70207,-70255,-70304,-70352,-70400,-70449,-70497,-70546,-70594,-70643,-70691,-70739,-70788,-70836,-70885,-70933,-70981,-71030,-71078,-71126,-71175,-71223,-71272,-71320,-71368,-71417,-71465,-71513,-71562,-71610,-71658,-71707,-71755,-71804,-71852,-71900,-71949,-71997,-72045,-72094,-72142,-72190,-72238,-72287,-72335,-72383,-72432,-72480,-72528,-72577,-72625,-72673,-72722,-72770,-72818,-72866,-72915,-72963,-73011,-73060,-73108,-73156,-73204,-73253,-73301,-73349,-73397,-73446,-73494,-73542,-73590,-73639,-73687,-73735,-73783,-73832,-73880,-73928,-73976,-74024,-74073,-74121,-74169,-74217,-74266,-74314,-74362,-74410,-74458,-74507,-74555,-74603,-74651,-74699,-74747,-74796,-74844,-74892,-74940,-74988,-75036,-75085,-75133,-75181,-75229,-75277,-75325,-75374,-75422,-75470,-75518,-75566,-75614,-75662,-75710,-75759,-75807,-75855,-75903,-75951,-75999,-76047,-76095,-76143,-76192,-76240,-76288,-76336,-76384,-76432,-76480,-76528,-76576,-76624,-76672,-76720,-76769,-76817,-76865,-76913,-76961,-77009,-77057,-77105,-77153,-77201,-77249,-77297,-77345,-77393,-77441,-77489,-77537,-77585,-77633,-77681,-77729,-77777,-77825,-77873,-77921,-77969,-78017,-78065,-78113,-78161,-78209,-78257,-78305,-78353,-78401,-78449,-78497,-78545,-78593,-78641,-78689,-78737,-78785,-78833,-78880,-78928,-78976,-79024,-79072,-79120,-79168,-79216,-79264,-79312,-79360,-79408,-79456,-79503,-79551,-79599,-79647,-79695,-79743,-79791,-79839,-79886,-79934,-79982,-80030,-80078,-80126,-80174,-80222,-80269,-80317,-80365,-80413,-80461,-80509,-80556,-80604,-80652,-80700,-80748,-80796,-80843,-80891,-80939,-80987,-81035,-81082,-81130,-81178,-81226,-81274,-81321,-81369,-81417,-81465,-81513,-81560,-81608,-81656,-81704,-81751,-81799,-81847,-81895,-81942,-81990,-82038,-82086,-82133,-82181,-82229,-82277,-82324,-82372,-82420,-82467,-82515,-82563,-82611,-82658,-82706,-82754,-82801,-82849,-82897,-82944,-82992,-83040,-83087,-83135,-83183,-83230,-83278,-83326,-83373,-83421,-83469,-83516,-83564,-83612,-83659,-83707,-83755,-83802,-83850,-83897,-83945,-83993,-84040,-84088,-84135,-84183,-84231,-84278,-84326,-84373,-84421,-84469,-84516,-84564,-84611,-84659,-84707,-84754,-84802,-84849,-84897,-84944,-84992,-85039,-85087,-85135,-85182,-85230,-85277,-85325,-85372,-85420,-85467,-85515,-85562,-85610,-85657,-85705,-85752,-85800,-85847,-85895,-85942,-85990,-86037,-86085,-86132,-86180,-86227,-86275,-86322,-86370,-86417,-86464,-86512,-86559,-86607,-86654,-86702,-86749,-86797,-86844,-86891,-86939,-86986,-87034,-87081,-87128,-87176,-87223,-87271,-87318,-87365,-87413,-87460,-87508,-87555,-87602,-87650,-87697,-87744,-87792,-87839,-87887,-87934,-87981,-88029,-88076,-88123,-88171,-88218,-88265,-88313,-88360,-88407,-88455,-88502,-88549,-88597,-88644,-88691,-88738,-88786,-88833,-88880,-88928,-88975,-89022,-89069,-89117,-89164,-89211,-89259,-89306,-89353,-89400,-89448,-89495,-89542,-89589,-89637,-89684,-89731,-89778,-89825,-89873,-89920,-89967,-90014,-90062,-90109,-90156,-90203,-90250,-90298,-90345,-90392,-90439,-90486,-90533,-90581,-90628,-90675,-90722,-90769,-90816,-90864,-90911,-90958,-91005,-91052,-91099,-91146,-91194,-91241,-91288,-91335,-91382,-91429,-91476,-91523,-91570,-91618,-91665,-91712,-91759,-91806,-91853,-91900,-91947,-91994,-92041,-92088,-92135,-92182,-92229,-92277,-92324,-92371,-92418,-92465,-92512,-92559,-92606,-92653,-92700,-92747,-92794,-92841,-92888,-92935,-92982,-93029,-93076,-93123,-93170,-93217,-93264,-93311,-93358,-93405,-93452,-93499,-93546,-93593,-93639,-93686,-93733,-93780,-93827,-93874,-93921,-93968,-94015,-94062,-94109,-94156,-94203,-94250,-94296,-94343,-94390,-94437,-94484,-94531,-94578,-94625,-94672,-94718,-94765,-94812,-94859,-94906,-94953,-95000,-95046,-95093,-95140,-95187,-95234,-95281,-95327,-95374,-95421,-95468,-95515,-95561,-95608,-95655,-95702,-95749,-95795,-95842,-95889,-95936,-95983,-96029,-96076,-96123,-96170,-96216,-96263,-96310,-96357,-96403,-96450,-96497,-96544,-96590,-96637,-96684,-96731,-96777,-96824,-96871,-96917,-96964,-97011,-97057,-97104,-97151,-97198,-97244,-97291,-97338,-97384,-97431,-97478,-97524,-97571,-97618,-97664,-97711,-97757,-97804,-97851,-97897,-97944,-97991,-98037,-98084,-98130,-98177,-98224,-98270,-98317,-98363,-98410,-98457,-98503,-98550,-98596,-98643,-98690,-98736,-98783,-98829,-98876,-98922,-98969,-99015,-99062,-99109,-99155,-99202,-99248,-99295,-99341,-99388,-99434,-99481,-99527,-99574,-99620,-99667,-99713,-99760,-99806,-99853,-99899,-99946,-99992,-100038,-100085,-100131,-100178,-100224,-100271,-100317,-100364,-100410,-100456,-100503,-100549,-100596,-100642,-100689,-100735,-100781,-100828,-100874,-100921,-100967,-101013,-101060,-101106,-101152,-101199,-101245,-101292,-101338,-101384,-101431,-101477,-101523,-101570,-101616,-101662,-101709,-101755,-101801,-101848,-101894,-101940,-101987,-102033,-102079,-102125,-102172,-102218,-102264,-102311,-102357,-102403,-102449,-102496,-102542,-102588,-102634,-102681,-102727,-102773,-102819,-102866,-102912,-102958,-103004,-103051,-103097,-103143,-103189,-103235,-103282,-103328,-103374,-103420,-103466,-103513,-103559,-103605,-103651,-103697,-103743,-103790,-103836,-103882,-103928,-103974,-104020,-104066,-104113,-104159,-104205,-104251,-104297,-104343,-104389,-104435,-104482,-104528,-104574,-104620,-104666,-104712,-104758,-104804,-104850,-104896,-104942,-104988,-105034,-105081,-105127,-105173,-105219,-105265,-105311,-105357,-105403,-105449,-105495,-105541,-105587,-105633,-105679,-105725,-105771,-105817,-105863,-105909,-105955,-106001,-106047,-106093,-106139,-106185,-106231,-106277,-106322,-106368,-106414,-106460,-106506,-106552,-106598,-106644,-106690,-106736,-106782,-106828,-106874,-106919,-106965,-107011,-107057,-107103,-107149,-107195,-107241,-107286,-107332,-107378,-107424,-107470,-107516,-107562,-107607,-107653,-107699,-107745,-107791,-107837,-107882,-107928,-107974,-108020,-108066,-108111,-108157,-108203,-108249,-108294,-108340,-108386,-108432,-108478,-108523,-108569,-108615,-108661,-108706,-108752,-108798,-108844,-108889,-108935,-108981,-109026,-109072,-109118,-109164,-109209,-109255,-109301,-109346,-109392,-109438,-109483,-109529,-109575,-109620,-109666,-109712,-109757,-109803,-109849,-109894,-109940,-109985,-110031,-110077,-110122,-110168,-110214,-110259,-110305,-110350,-110396,-110442,-110487,-110533,-110578,-110624,-110669,-110715,-110761,-110806,-110852,-110897,-110943,-110988,-111034,-111079,-111125,-111170,-111216,-111261,-111307,-111352,-111398,-111443,-111489,-111534,-111580,-111625,-111671,-111716,-111762,-111807,-111853,-111898,-111944,-111989,-112035,-112080,-112125,-112171,-112216,-112262,-112307,-112353,-112398,-112443,-112489,-112534,-112580,-112625,-112670,-112716,-112761,-112807,-112852,-112897,-112943,-112988,-113033,-113079,-113124,-113169,-113215,-113260,-113305,-113351,-113396,-113441,-113487,-113532,-113577,-113623,-113668,-113713,-113758,-113804,-113849,-113894,-113940,-113985,-114030,-114075,-114121,-114166,-114211,-114256,-114302,-114347,-114392,-114437,-114482,-114528,-114573,-114618,-114663,-114709,-114754,-114799,-114844,-114889,-114934,-114980,-115025,-115070,-115115,-115160,-115205,-115251,-115296,-115341,-115386,-115431,-115476,-115521,-115566,-115612,-115657,-115702,-115747,-115792,-115837,-115882,-115927,-115972,-116017,-116063,-116108,-116153,-116198,-116243,-116288,-116333,-116378,-116423,-116468,-116513,-116558,-116603,-116648,-116693,-116738,-116783,-116828,-116873,-116918,-116963,-117008,-117053,-117098,-117143,-117188,-117233,-117278,-117323,-117368,-117413,-117458,-117503,-117548,-117592,-117637,-117682,-117727,-117772,-117817,-117862,-117907,-117952,-117997,-118041,-118086,-118131,-118176,-118221,-118266,-118311,-118356,-118400,-118445,-118490,-118535,-118580,-118625,-118669,-118714,-118759,-118804,-118849,-118893,-118938,-118983,-119028,-119073,-119117,-119162,-119207,-119252,-119296,-119341,-119386,-119431,-119475,-119520,-119565,-119610,-119654,-119699,-119744,-119789,-119833,-119878,-119923,-119967,-120012,-120057,-120101,-120146,-120191,-120235,-120280,-120325,-120369,-120414,-120459,-120503,-120548,-120593,-120637,-120682,-120726,-120771,-120816,-120860,-120905,-120949,-120994,-121039,-121083,-121128,-121172,-121217,-121262,-121306,-121351,-121395,-121440,-121484,-121529,-121573,-121618,-121662,-121707,-121751,-121796,-121841,-121885,-121930,-121974,-122018,-122063,-122107,-122152,-122196,-122241,-122285,-122330,-122374,-122419,-122463,-122508,-122552,-122596,-122641,-122685,-122730,-122774,-122819,-122863,-122907,-122952,-122996,-123041,-123085,-123129,-123174,-123218,-123262,-123307,-123351,-123395,-123440,-123484,-123528,-123573,-123617,-123661,-123706,-123750,-123794,-123839,-123883,-123927,-123972,-124016,-124060,-124104,-124149,-124193,-124237,-124282,-124326,-124370,-124414,-124459,-124503,-124547,-124591,-124635,-124680,-124724,-124768,-124812,-124856,-124901,-124945,-124989,-125033,-125077,-125122,-125166,-125210,-125254,-125298,-125342,-125387,-125431,-125475,-125519,-125563,-125607,-125651,-125695,-125740,-125784,-125828,-125872,-125916,-125960,-126004,-126048,-126092,-126136,-126180,-126224,-126268,-126313,-126357,-126401,-126445,-126489,-126533,-126577,-126621,-126665,-126709,-126753,-126797,-126841,-126885,-126929,-126973,-127017,-127061,-127105,-127149,-127192,-127236,-127280,-127324,-127368,-127412,-127456,-127500,-127544,-127588,-127632,-127676,-127720,-127763,-127807,-127851,-127895,-127939,-127983,-128027,-128071,-128114,-128158,-128202,-128246,-128290,-128334,-128377,-128421,-128465,-128509,-128553,-128597,-128640,-128684,-128728,-128772,-128815,-128859,-128903,-128947,-128991,-129034,-129078,-129122,-129166,-129209,-129253,-129297,-129340,-129384,-129428,-129472,-129515,-129559,-129603,-129646,-129690,-129734,-129777,-129821,-129865,-129908,-129952,-129996,-130039,-130083,-130127,-130170,-130214,-130258,-130301,-130345,-130388,-130432,-130476,-130519,-130563,-130606,-130650,-130694,-130737,-130781,-130824,-130868,-130911,-130955,-130998,-131042,-131086,-131129,-131173,-131216,-131260,-131303,-131347,-131390,-131434,-131477,-131521,-131564,-131608,-131651,-131694,-131738,-131781,-131825,-131868,-131912,-131955,-131999,-132042,-132085,-132129,-132172,-132216,-132259,-132302,-132346,-132389,-132433,-132476,-132519,-132563,-132606,-132649,-132693,-132736,-132779,-132823,-132866,-132909,-132953,-132996,-133039,-133083,-133126,-133169,-133213,-133256,-133299,-133342,-133386,-133429,-133472,-133516,-133559,-133602,-133645,-133689,-133732,-133775,-133818,-133861,-133905,-133948,-133991,-134034,-134077,-134121,-134164,-134207,-134250,-134293,-134337,-134380,-134423,-134466,-134509,-134552,-134595,-134639,-134682,-134725,-134768,-134811,-134854,-134897,-134940,-134983,-135027,-135070,-135113,-135156,-135199,-135242,-135285,-135328,-135371,-135414,-135457,-135500,-135543,-135586,-135629,-135672,-135715,-135758,-135801,-135844,-135887,-135930,-135973,-136016,-136059,-136102,-136145,-136188,-136231,-136274,-136317,-136360,-136403,-136446,-136489,-136531,-136574,-136617,-136660,-136703,-136746,-136789,-136832,-136875,-136917,-136960,-137003,-137046,-137089,-137132,-137175,-137217,-137260,-137303,-137346,-137389,-137431,-137474,-137517,-137560,-137603,-137645,-137688,-137731,-137774,-137816,-137859,-137902,-137945,-137987,-138030,-138073,-138116,-138158,-138201,-138244,-138287,-138329,-138372,-138415,-138457,-138500,-138543,-138585,-138628,-138671,-138713,-138756,-138799,-138841,-138884,-138926,-138969,-139012,-139054,-139097,-139140,-139182,-139225,-139267,-139310,-139352,-139395,-139438,-139480,-139523,-139565,-139608,-139650,-139693,-139735,-139778,-139820,-139863,-139906,-139948,-139991,-140033,-140076,-140118,-140160,-140203,-140245,-140288,-140330,-140373,-140415,-140458,-140500,-140543,-140585,-140627,-140670,-140712,-140755,-140797,-140839,-140882,-140924,-140967,-141009,-141051,-141094,-141136,-141178,-141221,-141263,-141305,-141348,-141390,-141432,-141475,-141517,-141559,-141602,-141644,-141686,-141729,-141771,-141813,-141855,-141898,-141940,-141982,-142024,-142067,-142109,-142151,-142193,-142236,-142278,-142320,-142362,-142404,-142447,-142489,-142531,-142573,-142615,-142658,-142700,-142742,-142784,-142826,-142868,-142911,-142953,-142995,-143037,-143079,-143121,-143163,-143205,-143247,-143290,-143332,-143374,-143416,-143458,-143500,-143542,-143584,-143626,-143668,-143710,-143752,-143794,-143836,-143878,-143920,-143962,-144004,-144046,-144088,-144130,-144172,-144214,-144256,-144298,-144340,-144382,-144424,-144466,-144508,-144550,-144592,-144634,-144676,-144718,-144760,-144801,-144843,-144885,-144927,-144969,-145011,-145053,-145095,-145136,-145178,-145220,-145262,-145304,-145346,-145388,-145429,-145471,-145513,-145555,-145597,-145638,-145680,-145722,-145764,-145806,-145847,-145889,-145931,-145973,-146014,-146056,-146098,-146140,-146181,-146223,-146265,-146306,-146348,-146390,-146432,-146473,-146515,-146557,-146598,-146640,-146682,-146723,-146765,-146807,-146848,-146890,-146931,-146973,-147015,-147056,-147098,-147140,-147181,-147223,-147264,-147306,-147347,-147389,-147431,-147472,-147514,-147555,-147597,-147638,-147680,-147721,-147763,-147804,-147846,-147887,-147929,-147970,-148012,-148053,-148095,-148136,-148178,-148219,-148261,-148302,-148344,-148385,-148427,-148468,-148509,-148551,-148592,-148634,-148675,-148716,-148758,-148799,-148841,-148882,-148923,-148965,-149006,-149047,-149089,-149130,-149171,-149213,-149254,-149295,-149337,-149378,-149419,-149461,-149502,-149543,-149584,-149626,-149667,-149708,-149750,-149791,-149832,-149873,-149915,-149956,-149997,-150038,-150079,-150121,-150162,-150203,-150244,-150285,-150327,-150368,-150409,-150450,-150491,-150532,-150574,-150615,-150656,-150697,-150738,-150779,-150820,-150861,-150903,-150944,-150985,-151026,-151067,-151108,-151149,-151190,-151231,-151272,-151313,-151354,-151395,-151436,-151477,-151518,-151559,-151600,-151641,-151682,-151723,-151764,-151805,-151846,-151887,-151928,-151969,-152010,-152051,-152092,-152133,-152174,-152215,-152256,-152297,-152338,-152379,-152420,-152460,-152501,-152542,-152583,-152624,-152665,-152706,-152747,-152787,-152828,-152869,-152910,-152951,-152992,-153032,-153073,-153114,-153155,-153196,-153236,-153277,-153318,-153359,-153399,-153440,-153481,-153522,-153562,-153603,-153644,-153685,-153725,-153766,-153807,-153847,-153888,-153929,-153969,-154010,-154051,-154092,-154132,-154173,-154213,-154254,-154295,-154335,-154376,-154417,-154457,-154498,-154538,-154579,-154620,-154660,-154701,-154741,-154782,-154823,-154863,-154904,-154944,-154985,-155025,-155066,-155106,-155147,-155187,-155228,-155268,-155309,-155349,-155390,-155430,-155471,-155511,-155552,-155592,-155633,-155673,-155714,-155754,-155794,-155835,-155875,-155916,-155956,-155996,-156037,-156077,-156118,-156158,-156198,-156239,-156279,-156319,-156360,-156400,-156440,-156481,-156521,-156561,-156602,-156642,-156682,-156723,-156763,-156803,-156844,-156884,-156924,-156964,-157005,-157045,-157085,-157125,-157166,-157206,-157246,-157286,-157326,-157367,-157407,-157447,-157487,-157527,-157568,-157608,-157648,-157688,-157728,-157768,-157808,-157849,-157889,-157929,-157969,-158009,-158049,-158089,-158129,-158169,-158210,-158250,-158290,-158330,-158370,-158410,-158450,-158490,-158530,-158570,-158610,-158650,-158690,-158730,-158770,-158810,-158850,-158890,-158930,-158970,-159010,-159050,-159090,-159130,-159170,-159210,-159250,-159290,-159329,-159369,-159409,-159449,-159489,-159529,-159569,-159609,-159649,-159688,-159728,-159768,-159808,-159848,-159888,-159928,-159967,-160007,-160047,-160087,-160127,-160166,-160206,-160246,-160286,-160326,-160365,-160405,-160445,-160485,-160524,-160564,-160604,-160643,-160683,-160723,-160763,-160802,-160842,-160882,-160921,-160961,-161001,-161040,-161080,-161120,-161159,-161199,-161239,-161278,-161318,-161358,-161397,-161437,-161476,-161516,-161556,-161595,-161635,-161674,-161714,-161753,-161793,-161832,-161872,-161912,-161951,-161991,-162030,-162070,-162109,-162149,-162188,-162228,-162267,-162307,-162346,-162385,-162425,-162464,-162504,-162543,-162583,-162622,-162662,-162701,-162740,-162780,-162819,-162859,-162898,-162937,-162977,-163016,-163055,-163095,-163134,-163173,-163213,-163252,-163291,-163331,-163370,-163409,-163449,-163488,-163527,-163567,-163606,-163645,-163684,-163724,-163763,-163802,-163841,-163881,-163920,-163959,-163998,-164038,-164077,-164116,-164155,-164194,-164233,-164273,-164312,-164351,-164390,-164429,-164468,-164508,-164547,-164586,-164625,-164664,-164703,-164742,-164781,-164820,-164860,-164899,-164938,-164977,-165016,-165055,-165094,-165133,-165172,-165211,-165250,-165289,-165328,-165367,-165406,-165445,-165484,-165523,-165562,-165601,-165640,-165679,-165718,-165757,-165796,-165835,-165874,-165913,-165951,-165990,-166029,-166068,-166107,-166146,-166185,-166224,-166263,-166301,-166340,-166379,-166418,-166457,-166496,-166534,-166573,-166612,-166651,-166690,-166728,-166767,-166806,-166845,-166884,-166922,-166961,-167000,-167039,-167077,-167116,-167155,-167193,-167232,-167271,-167310,-167348,-167387,-167426,-167464,-167503,-167542,-167580,-167619,-167658,-167696,-167735,-167773,-167812,-167851,-167889,-167928,-167967,-168005,-168044,-168082,-168121,-168159,-168198,-168237,-168275,-168314,-168352,-168391,-168429,-168468,-168506,-168545,-168583,-168622,-168660,-168699,-168737,-168776,-168814,-168852,-168891,-168929,-168968,-169006,-169045,-169083,-169121,-169160,-169198,-169237,-169275,-169313,-169352,-169390,-169429,-169467,-169505,-169544,-169582,-169620,-169659,-169697,-169735,-169773,-169812,-169850,-169888,-169927,-169965,-170003,-170041,-170080,-170118,-170156,-170194,-170233,-170271,-170309,-170347,-170385,-170424,-170462,-170500,-170538,-170576,-170615,-170653,-170691,-170729,-170767,-170805,-170843,-170882,-170920,-170958,-170996,-171034,-171072,-171110,-171148,-171186,-171224,-171262,-171300,-171338,-171377,-171415,-171453,-171491,-171529,-171567,-171605,-171643,-171681,-171719,-171757,-171795,-171833,-171870,-171908,-171946,-171984,-172022,-172060,-172098,-172136,-172174,-172212,-172250,-172288,-172325,-172363,-172401,-172439,-172477,-172515,-172553,-172590,-172628,-172666,-172704,-172742,-172780,-172817,-172855,-172893,-172931,-172968,-173006,-173044,-173082,-173120,-173157,-173195,-173233,-173270,-173308,-173346,-173384,-173421,-173459,-173497,-173534,-173572,-173610,-173647,-173685,-173723,-173760,-173798,-173836,-173873,-173911,-173948,-173986,-174024,-174061,-174099,-174136,-174174,-174211,-174249,-174287,-174324,-174362,-174399,-174437,-174474,-174512,-174549,-174587,-174624,-174662,-174699,-174737,-174774,-174812,-174849,-174886,-174924,-174961,-174999,-175036,-175074,-175111,-175148,-175186,-175223,-175261,-175298,-175335,-175373,-175410,-175447,-175485,-175522,-175559,-175597,-175634,-175671,-175709,-175746,-175783,-175821,-175858,-175895,-175932,-175970,-176007,-176044,-176081,-176119,-176156,-176193,-176230,-176267,-176305,-176342,-176379,-176416,-176453,-176491,-176528,-176565,-176602,-176639,-176676,-176713,-176751,-176788,-176825,-176862,-176899,-176936,-176973,-177010,-177047,-177084,-177122,-177159,-177196,-177233,-177270,-177307,-177344,-177381,-177418,-177455,-177492,-177529,-177566,-177603,-177640,-177677,-177714,-177751,-177787,-177824,-177861,-177898,-177935,-177972,-178009,-178046,-178083,-178120,-178157,-178193,-178230,-178267,-178304,-178341,-178378,-178414,-178451,-178488,-178525,-178562,-178599,-178635,-178672,-178709,-178746,-178782,-178819,-178856,-178893,-178929,-178966,-179003,-179040,-179076,-179113,-179150,-179186,-179223,-179260,-179296,-179333,-179370,-179406,-179443,-179480,-179516,-179553,-179590,-179626,-179663,-179699,-179736,-179773,-179809,-179846,-179882,-179919,-179955,-179992,-180028,-180065,-180102,-180138,-180175,-180211,-180248,-180284,-180321,-180357,-180394,-180430,-180466,-180503,-180539,-180576,-180612,-180649,-180685,-180722,-180758,-180794,-180831,-180867,-180903,-180940,-180976,-181013,-181049,-181085,-181122,-181158,-181194,-181231,-181267,-181303,-181340,-181376,-181412,-181448,-181485,-181521,-181557,-181593,-181630,-181666,-181702,-181738,-181775,-181811,-181847,-181883,-181919,-181956,-181992,-182028,-182064,-182100,-182136,-182173,-182209,-182245,-182281,-182317,-182353,-182389,-182425,-182462,-182498,-182534,-182570,-182606,-182642,-182678,-182714,-182750,-182786,-182822,-182858,-182894,-182930,-182966,-183002,-183038,-183074,-183110,-183146,-183182,-183218,-183254,-183290,-183326,-183362,-183398,-183434,-183469,-183505,-183541,-183577,-183613,-183649,-183685,-183721,-183756,-183792,-183828,-183864,-183900,-183936,-183971,-184007,-184043,-184079,-184115,-184150,-184186,-184222,-184258,-184293,-184329,-184365,-184401,-184436,-184472,-184508,-184544,-184579,-184615,-184651,-184686,-184722,-184758,-184793,-184829,-184865,-184900,-184936,-184971,-185007,-185043,-185078,-185114,-185149,-185185,-185221,-185256,-185292,-185327,-185363,-185398,-185434,-185469,-185505,-185540,-185576,-185611,-185647,-185682,-185718,-185753,-185789,-185824,-185860,-185895,-185931,-185966,-186001,-186037,-186072,-186108,-186143,-186178,-186214,-186249,-186285,-186320,-186355,-186391,-186426,-186461,-186497,-186532,-186567,-186603,-186638,-186673,-186709,-186744,-186779,-186814,-186850,-186885,-186920,-186955,-186991,-187026,-187061,-187096,-187131,-187167,-187202,-187237,-187272,-187307,-187342,-187378,-187413,-187448,-187483,-187518,-187553,-187588,-187624,-187659,-187694,-187729,-187764,-187799,-187834,-187869,-187904,-187939,-187974,-188009,-188044,-188079,-188114,-188149,-188184,-188219,-188254,-188289,-188324,-188359,-188394,-188429,-188464,-188499,-188534,-188569,-188604,-188639,-188674,-188708,-188743,-188778,-188813,-188848,-188883,-188918,-188953,-188987,-189022,-189057,-189092,-189127,-189161,-189196,-189231,-189266,-189301,-189335,-189370,-189405,-189440,-189474,-189509,-189544,-189579,-189613,-189648,-189683,-189717,-189752,-189787,-189821,-189856,-189891,-189925,-189960,-189995,-190029,-190064,-190098,-190133,-190168,-190202,-190237,-190271,-190306,-190341,-190375,-190410,-190444,-190479,-190513,-190548,-190582,-190617,-190651,-190686,-190720,-190755,-190789,-190824,-190858,-190893,-190927,-190962,-190996,-191030,-191065,-191099,-191134,-191168,-191202,-191237,-191271,-191306,-191340,-191374,-191409,-191443,-191477,-191512,-191546,-191580,-191615,-191649,-191683,-191717,-191752,-191786,-191820,-191855,-191889,-191923,-191957,-191991,-192026,-192060,-192094,-192128,-192163,-192197,-192231,-192265,-192299,-192333,-192368,-192402,-192436,-192470,-192504,-192538,-192572,-192606,-192640,-192675,-192709,-192743,-192777,-192811,-192845,-192879,-192913,-192947,-192981,-193015,-193049,-193083,-193117,-193151,-193185,-193219,-193253,-193287,-193321,-193355,-193389,-193423,-193457,-193491,-193524,-193558,-193592,-193626,-193660,-193694,-193728,-193762,-193795,-193829,-193863,-193897,-193931,-193965,-193998,-194032,-194066,-194100,-194134,-194167,-194201,-194235,-194269,-194302,-194336,-194370,-194404,-194437,-194471,-194505,-194538,-194572,-194606,-194639,-194673,-194707,-194740,-194774,-194808,-194841,-194875,-194909,-194942,-194976,-195009,-195043,-195077,-195110,-195144,-195177,-195211,-195244,-195278,-195311,-195345,-195378,-195412,-195445,-195479,-195512,-195546,-195579,-195613,-195646,-195680,-195713,-195747,-195780,-195814,-195847,-195880,-195914,-195947,-195981,-196014,-196047,-196081,-196114,-196147,-196181,-196214,-196247,-196281,-196314,-196347,-196381,-196414,-196447,-196480,-196514,-196547,-196580,-196614,-196647,-196680,-196713,-196746,-196780,-196813,-196846,-196879,-196912,-196946,-196979,-197012,-197045,-197078,-197111,-197145,-197178,-197211,-197244,-197277,-197310,-197343,-197376,-197409,-197442,-197475,-197509,-197542,-197575,-197608,-197641,-197674,-197707,-197740,-197773,-197806,-197839,-197872,-197905,-197938,-197971,-198003,-198036,-198069,-198102,-198135,-198168,-198201,-198234,-198267,-198300,-198333,-198365,-198398,-198431,-198464,-198497,-198530,-198562,-198595,-198628,-198661,-198694,-198726,-198759,-198792,-198825,-198857,-198890,-198923,-198956,-198988,-199021,-199054,-199087,-199119,-199152,-199185,-199217,-199250,-199283,-199315,-199348,-199381,-199413,-199446,-199478,-199511,-199544,-199576,-199609,-199641,-199674,-199707,-199739,-199772,-199804,-199837,-199869,-199902,-199934,-199967,-199999,-200032,-200064,-200097,-200129,-200162,-200194,-200227,-200259,-200291,-200324,-200356,-200389,-200421,-200453,-200486,-200518,-200551,-200583,-200615,-200648,-200680,-200712,-200745,-200777,-200809,-200842,-200874,-200906,-200939,-200971,-201003,-201035,-201068,-201100,-201132,-201164,-201197,-201229,-201261,-201293,-201325,-201358,-201390,-201422,-201454,-201486,-201518,-201551,-201583,-201615,-201647,-201679,-201711,-201743,-201775,-201807,-201840,-201872,-201904,-201936,-201968,-202000,-202032,-202064,-202096,-202128,-202160,-202192,-202224,-202256,-202288,-202320,-202352,-202384,-202416,-202448,-202480,-202511,-202543,-202575,-202607,-202639,-202671,-202703,-202735,-202767,-202798,-202830,-202862,-202894,-202926,-202958,-202989,-203021,-203053,-203085,-203117,-203148,-203180,-203212,-203244,-203275,-203307,-203339,-203371,-203402,-203434,-203466,-203497,-203529,-203561,-203592,-203624,-203656,-203687,-203719,-203751,-203782,-203814,-203845,-203877,-203909,-203940,-203972,-204003,-204035,-204066,-204098,-204130,-204161,-204193,-204224,-204256,-204287,-204319,-204350,-204382,-204413,-204445,-204476,-204507,-204539,-204570,-204602,-204633,-204665,-204696,-204727,-204759,-204790,-204822,-204853,-204884,-204916,-204947,-204978,-205010,-205041,-205072,-205104,-205135,-205166,-205197,-205229,-205260,-205291,-205323,-205354,-205385,-205416,-205447,-205479,-205510,-205541,-205572,-205603,-205635,-205666,-205697,-205728,-205759,-205790,-205822,-205853,-205884,-205915,-205946,-205977,-206008,-206039,-206070,-206101,-206132,-206164,-206195,-206226,-206257,-206288,-206319,-206350,-206381,-206412,-206443,-206474,-206505,-206536,-206566,-206597,-206628,-206659,-206690,-206721,-206752,-206783,-206814,-206845,-206876,-206906,-206937,-206968,-206999,-207030,-207061,-207091,-207122,-207153,-207184,-207215,-207245,-207276,-207307,-207338,-207369,-207399,-207430,-207461,-207491,-207522,-207553,-207584,-207614,-207645,-207676,-207706,-207737,-207768,-207798,-207829,-207860,-207890,-207921,-207951,-207982,-208013,-208043,-208074,-208104,-208135,-208165,-208196,-208227,-208257,-208288,-208318,-208349,-208379,-208410,-208440,-208471,-208501,-208532,-208562,-208592,-208623,-208653,-208684,-208714,-208745,-208775,-208805,-208836,-208866,-208896,-208927,-208957,-208988,-209018,-209048,-209079,-209109,-209139,-209169,-209200,-209230,-209260,-209291,-209321,-209351,-209381,-209412,-209442,-209472,-209502,-209533,-209563,-209593,-209623,-209653,-209683,-209714,-209744,-209774,-209804,-209834,-209864,-209894,-209925,-209955,-209985,-210015,-210045,-210075,-210105,-210135,-210165,-210195,-210225,-210255,-210285,-210315,-210345,-210375,-210405,-210435,-210465,-210495,-210525,-210555,-210585,-210615,-210645,-210675,-210705,-210735,-210764,-210794,-210824,-210854,-210884,-210914,-210944,-210973,-211003,-211033,-211063,-211093,-211123,-211152,-211182,-211212,-211242,-211271,-211301,-211331,-211361,-211390,-211420,-211450,-211480,-211509,-211539,-211569,-211598,-211628,-211658,-211687,-211717,-211747,-211776,-211806,-211835,-211865,-211895,-211924,-211954,-211983,-212013,-212042,-212072,-212102,-212131,-212161,-212190,-212220,-212249,-212279,-212308,-212338,-212367,-212397,-212426,-212455,-212485,-212514,-212544,-212573,-212603,-212632,-212661,-212691,-212720,-212750,-212779,-212808,-212838,-212867,-212896,-212926,-212955,-212984,-213014,-213043,-213072,-213101,-213131,-213160,-213189,-213218,-213248,-213277,-213306,-213335,-213365,-213394,-213423,-213452,-213481,-213510,-213540,-213569,-213598,-213627,-213656,-213685,-213714,-213744,-213773,-213802,-213831,-213860,-213889,-213918,-213947,-213976,-214005,-214034,-214063,-214092,-214121,-214150,-214179,-214208,-214237,-214266,-214295,-214324,-214353,-214382,-214411,-214440,-214469,-214497,-214526,-214555,-214584,-214613,-214642,-214671,-214700,-214728,-214757,-214786,-214815,-214844,-214872,-214901,-214930,-214959,-214988,-215016,-215045,-215074,-215103,-215131,-215160,-215189,-215217,-215246,-215275,-215303,-215332,-215361,-215389,-215418,-215447,-215475,-215504,-215533,-215561,-215590,-215618,-215647,-215676,-215704,-215733,-215761,-215790,-215818,-215847,-215875,-215904,-215932,-215961,-215989,-216018,-216046,-216075,-216103,-216132,-216160,-216189,-216217,-216245,-216274,-216302,-216331,-216359,-216387,-216416,-216444,-216472,-216501,-216529,-216557,-216586,-216614,-216642,-216671,-216699,-216727,-216756,-216784,-216812,-216840,-216869,-216897,-216925,-216953,-216981,-217010,-217038,-217066,-217094,-217122,-217151,-217179,-217207,-217235,-217263,-217291,-217319,-217347,-217376,-217404,-217432,-217460,-217488,-217516,-217544,-217572,-217600,-217628,-217656,-217684,-217712,-217740,-217768,-217796,-217824,-217852,-217880,-217908,-217936,-217964,-217992,-218020,-218048,-218075,-218103,-218131,-218159,-218187,-218215,-218243,-218270,-218298,-218326,-218354,-218382,-218410,-218437,-218465,-218493,-218521,-218548,-218576,-218604,-218632,-218659,-218687,-218715,-218743,-218770,-218798,-218826,-218853,-218881,-218909,-218936,-218964,-218992,-219019,-219047,-219074,-219102,-219130,-219157,-219185,-219212,-219240,-219267,-219295,-219323,-219350,-219378,-219405,-219433,-219460,-219488,-219515,-219543,-219570,-219597,-219625,-219652,-219680,-219707,-219735,-219762,-219789,-219817,-219844,-219872,-219899,-219926,-219954,-219981,-220008,-220036,-220063,-220090,-220118,-220145,-220172,-220199,-220227,-220254,-220281,-220308,-220336,-220363,-220390,-220417,-220445,-220472,-220499,-220526,-220553,-220580,-220608,-220635,-220662,-220689,-220716,-220743,-220770,-220797,-220825,-220852,-220879,-220906,-220933,-220960,-220987,-221014,-221041,-221068,-221095,-221122,-221149,-221176,-221203,-221230,-221257,-221284,-221311,-221338,-221365,-221392,-221418,-221445,-221472,-221499,-221526,-221553,-221580,-221607,-221633,-221660,-221687,-221714,-221741,-221768,-221794,-221821,-221848,-221875,-221902,-221928,-221955,-221982,-222009,-222035,-222062,-222089,-222115,-222142,-222169,-222195,-222222,-222249,-222275,-222302,-222329,-222355,-222382,-222409,-222435,-222462,-222488,-222515,-222541,-222568,-222595,-222621,-222648,-222674,-222701,-222727,-222754,-222780,-222807,-222833,-222860,-222886,-222913,-222939,-222965,-222992,-223018,-223045,-223071,-223098,-223124,-223150,-223177,-223203,-223229,-223256,-223282,-223308,-223335,-223361,-223387,-223414,-223440,-223466,-223492,-223519,-223545,-223571,-223598,-223624,-223650,-223676,-223702,-223729,-223755,-223781,-223807,-223833,-223859,-223886,-223912,-223938,-223964,-223990,-224016,-224042,-224068,-224095,-224121,-224147,-224173,-224199,-224225,-224251,-224277,-224303,-224329,-224355,-224381,-224407,-224433,-224459,-224485,-224511,-224537,-224563,-224589,-224614,-224640,-224666,-224692,-224718,-224744,-224770,-224796,-224822,-224847,-224873,-224899,-224925,-224951,-224977,-225002,-225028,-225054,-225080,-225105,-225131,-225157,-225183,-225208,-225234,-225260,-225286,-225311,-225337,-225363,-225388,-225414,-225440,-225465,-225491,-225516,-225542,-225568,-225593,-225619,-225645,-225670,-225696,-225721,-225747,-225772,-225798,-225823,-225849,-225874,-225900,-225925,-225951,-225976,-226002,-226027,-226053,-226078,-226104,-226129,-226155,-226180,-226205,-226231,-226256,-226282,-226307,-226332,-226358,-226383,-226408,-226434,-226459,-226484,-226510,-226535,-226560,-226585,-226611,-226636,-226661,-226687,-226712,-226737,-226762,-226787,-226813,-226838,-226863,-226888,-226913,-226939,-226964,-226989,-227014,-227039,-227064,-227089,-227114,-227140,-227165,-227190,-227215,-227240,-227265,-227290,-227315,-227340,-227365,-227390,-227415,-227440,-227465,-227490,-227515,-227540,-227565,-227590,-227615,-227640,-227665,-227690,-227715,-227739,-227764,-227789,-227814,-227839,-227864,-227889,-227913,-227938,-227963,-227988,-228013,-228038,-228062,-228087,-228112,-228137,-228161,-228186,-228211,-228236,-228260,-228285,-228310,-228334,-228359,-228384,-228408,-228433,-228458,-228482,-228507,-228532,-228556,-228581,-228606,-228630,-228655,-228679,-228704,-228728,-228753,-228778,-228802,-228827,-228851,-228876,-228900,-228925,-228949,-228974,-228998,-229023,-229047,-229071,-229096,-229120,-229145,-229169,-229193,-229218,-229242,-229267,-229291,-229315,-229340,-229364,-229388,-229413,-229437,-229461,-229486,-229510,-229534,-229559,-229583,-229607,-229631,-229656,-229680,-229704,-229728,-229752,-229777,-229801,-229825,-229849,-229873,-229897,-229922,-229946,-229970,-229994,-230018,-230042,-230066,-230090,-230115,-230139,-230163,-230187,-230211,-230235,-230259,-230283,-230307,-230331,-230355,-230379,-230403,-230427,-230451,-230475,-230499,-230523,-230547,-230570,-230594,-230618,-230642,-230666,-230690,-230714,-230738,-230761,-230785,-230809,-230833,-230857,-230881,-230904,-230928,-230952,-230976,-231000,-231023,-231047,-231071,-231095,-231118,-231142,-231166,-231189,-231213,-231237,-231260,-231284,-231308,-231331,-231355,-231379,-231402,-231426,-231449,-231473,-231497,-231520,-231544,-231567,-231591,-231614,-231638,-231662,-231685,-231709,-231732,-231756,-231779,-231803,-231826,-231849,-231873,-231896,-231920,-231943,-231967,-231990,-232013,-232037,-232060,-232084,-232107,-232130,-232154,-232177,-232200,-232224,-232247,-232270,-232294,-232317,-232340,-232363,-232387,-232410,-232433,-232456,-232480,-232503,-232526,-232549,-232573,-232596,-232619,-232642,-232665,-232688,-232712,-232735,-232758,-232781,-232804,-232827,-232850,-232873,-232896,-232919,-232943,-232966,-232989,-233012,-233035,-233058,-233081,-233104,-233127,-233150,-233173,-233196,-233219,-233242,-233264,-233287,-233310,-233333,-233356,-233379,-233402,-233425,-233448,-233471,-233493,-233516,-233539,-233562,-233585,-233608,-233630,-233653,-233676,-233699,-233721,-233744,-233767,-233790,-233812,-233835,-233858,-233881,-233903,-233926,-233949,-233971,-233994,-234017,-234039,-234062,-234085,-234107,-234130,-234152,-234175,-234198,-234220,-234243,-234265,-234288,-234310,-234333,-234355,-234378,-234400,-234423,-234445,-234468,-234490,-234513,-234535,-234558,-234580,-234603,-234625,-234648,-234670,-234692,-234715,-234737,-234759,-234782,-234804,-234827,-234849,-234871,-234893,-234916,-234938,-234960,-234983,-235005,-235027,-235049,-235072,-235094,-235116,-235138,-235161,-235183,-235205,-235227,-235249,-235272,-235294,-235316,-235338,-235360,-235382,-235404,-235427,-235449,-235471,-235493,-235515,-235537,-235559,-235581,-235603,-235625,-235647,-235669,-235691,-235713,-235735,-235757,-235779,-235801,-235823,-235845,-235867,-235889,-235911,-235933,-235955,-235977,-235998,-236020,-236042,-236064,-236086,-236108,-236130,-236151,-236173,-236195,-236217,-236239,-236260,-236282,-236304,-236326,-236347,-236369,-236391,-236413,-236434,-236456,-236478,-236499,-236521,-236543,-236564,-236586,-236608,-236629,-236651,-236673,-236694,-236716,-236737,-236759,-236781,-236802,-236824,-236845,-236867,-236888,-236910,-236931,-236953,-236974,-236996,-237017,-237039,-237060,-237082,-237103,-237125,-237146,-237167,-237189,-237210,-237232,-237253,-237274,-237296,-237317,-237338,-237360,-237381,-237402,-237424,-237445,-237466,-237488,-237509,-237530,-237551,-237573,-237594,-237615,-237636,-237658,-237679,-237700,-237721,-237742,-237764,-237785,-237806,-237827,-237848,-237869,-237890,-237912,-237933,-237954,-237975,-237996,-238017,-238038,-238059,-238080,-238101,-238122,-238143,-238164,-238185,-238206,-238227,-238248,-238269,-238290,-238311,-238332,-238353,-238374,-238395,-238416,-238436,-238457,-238478,-238499,-238520,-238541,-238562,-238582,-238603,-238624,-238645,-238666,-238687,-238707,-238728,-238749,-238770,-238790,-238811,-238832,-238852,-238873,-238894,-238915,-238935,-238956,-238977,-238997,-239018,-239039,-239059,-239080,-239100,-239121,-239142,-239162,-239183,-239203,-239224,-239244,-239265,-239286,-239306,-239327,-239347,-239368,-239388,-239409,-239429,-239449,-239470,-239490,-239511,-239531,-239552,-239572,-239592,-239613,-239633,-239654,-239674,-239694,-239715,-239735,-239755,-239776,-239796,-239816,-239837,-239857,-239877,-239897,-239918,-239938,-239958,-239978,-239999,-240019,-240039,-240059,-240079,-240100,-240120,-240140,-240160,-240180,-240200,-240220,-240241,-240261,-240281,-240301,-240321,-240341,-240361,-240381,-240401,-240421,-240441,-240461,-240481,-240501,-240521,-240541,-240561,-240581,-240601,-240621,-240641,-240661,-240681,-240701,-240721,-240741,-240761,-240780,-240800,-240820,-240840,-240860,-240880,-240900,-240919,-240939,-240959,-240979,-240999,-241018,-241038,-241058,-241078,-241097,-241117,-241137,-241156,-241176,-241196,-241216,-241235,-241255,-241275,-241294,-241314,-241333,-241353,-241373,-241392,-241412,-241432,-241451,-241471,-241490,-241510,-241529,-241549,-241568,-241588,-241607,-241627,-241646,-241666,-241685,-241705,-241724,-241744,-241763,-241783,-241802,-241821,-241841,-241860,-241880,-241899,-241918,-241938,-241957,-241976,-241996,-242015,-242034,-242054,-242073,-242092,-242111,-242131,-242150,-242169,-242188,-242208,-242227,-242246,-242265,-242285,-242304,-242323,-242342,-242361,-242380,-242400,-242419,-242438,-242457,-242476,-242495,-242514,-242533,-242552,-242571,-242590,-242610,-242629,-242648,-242667,-242686,-242705,-242724,-242743,-242762,-242781,-242799,-242818,-242837,-242856,-242875,-242894,-242913,-242932,-242951,-242970,-242989,-243007,-243026,-243045,-243064,-243083,-243102,-243120,-243139,-243158,-243177,-243195,-243214,-243233,-243252,-243270,-243289,-243308,-243327,-243345,-243364,-243383,-243401,-243420,-243439,-243457,-243476,-243495,-243513,-243532,-243550,-243569,-243587,-243606,-243625,-243643,-243662,-243680,-243699,-243717,-243736,-243754,-243773,-243791,-243810,-243828,-243847,-243865,-243884,-243902,-243920,-243939,-243957,-243976,-243994,-244012,-244031,-244049,-244067,-244086,-244104,-244122,-244141,-244159,-244177,-244196,-244214,-244232,-244250,-244269,-244287,-244305,-244323,-244342,-244360,-244378,-244396,-244414,-244432,-244451,-244469,-244487,-244505,-244523,-244541,-244559,-244577,-244596,-244614,-244632,-244650,-244668,-244686,-244704,-244722,-244740,-244758,-244776,-244794,-244812,-244830,-244848,-244866,-244884,-244902,-244920,-244937,-244955,-244973,-244991,-245009,-245027,-245045,-245063,-245080,-245098,-245116,-245134,-245152,-245170,-245187,-245205,-245223,-245241,-245258,-245276,-245294,-245312,-245329,-245347,-245365,-245382,-245400,-245418,-245435,-245453,-245471,-245488,-245506,-245524,-245541,-245559,-245576,-245594,-245612,-245629,-245647,-245664,-245682,-245699,-245717,-245734,-245752,-245769,-245787,-245804,-245822,-245839,-245857,-245874,-245891,-245909,-245926,-245944,-245961,-245978,-245996,-246013,-246031,-246048,-246065,-246083,-246100,-246117,-246135,-246152,-246169,-246186,-246204,-246221,-246238,-246255,-246273,-246290,-246307,-246324,-246341,-246359,-246376,-246393,-246410,-246427,-246444,-246462,-246479,-246496,-246513,-246530,-246547,-246564,-246581,-246598,-246615,-246632,-246649,-246666,-246683,-246700,-246717,-246734,-246751,-246768,-246785,-246802,-246819,-246836,-246853,-246870,-246887,-246904,-246921,-246937,-246954,-246971,-246988,-247005,-247022,-247039,-247055,-247072,-247089,-247106,-247122,-247139,-247156,-247173,-247189,-247206,-247223,-247240,-247256,-247273,-247290,-247306,-247323,-247340,-247356,-247373,-247390,-247406,-247423,-247439,-247456,-247473,-247489,-247506,-247522,-247539,-247555,-247572,-247588,-247605,-247621,-247638,-247654,-247671,-247687,-247704,-247720,-247737,-247753,-247770,-247786,-247802,-247819,-247835,-247852,-247868,-247884,-247901,-247917,-247933,-247950,-247966,-247982,-247999,-248015,-248031,-248047,-248064,-248080,-248096,-248112,-248129,-248145,-248161,-248177,-248193,-248210,-248226,-248242,-248258,-248274,-248290,-248306,-248322,-248339,-248355,-248371,-248387,-248403,-248419,-248435,-248451,-248467,-248483,-248499,-248515,-248531,-248547,-248563,-248579,-248595,-248611,-248627,-248643,-248659,-248675,-248690,-248706,-248722,-248738,-248754,-248770,-248786,-248802,-248817,-248833,-248849,-248865,-248881,-248896,-248912,-248928,-248944,-248959,-248975,-248991,-249007,-249022,-249038,-249054,-249069,-249085,-249101,-249116,-249132,-249148,-249163,-249179,-249194,-249210,-249226,-249241,-249257,-249272,-249288,-249303,-249319,-249334,-249350,-249366,-249381,-249397,-249412,-249427,-249443,-249458,-249474,-249489,-249505,-249520,-249535,-249551,-249566,-249582,-249597,-249612,-249628,-249643,-249658,-249674,-249689,-249704,-249720,-249735,-249750,-249765,-249781,-249796,-249811,-249826,-249842,-249857,-249872,-249887,-249902,-249918,-249933,-249948,-249963,-249978,-249993,-250008,-250024,-250039,-250054,-250069,-250084,-250099,-250114,-250129,-250144,-250159,-250174,-250189,-250204,-250219,-250234,-250249,-250264,-250279,-250294,-250309,-250324,-250339,-250354,-250369,-250384,-250398,-250413,-250428,-250443,-250458,-250473,-250488,-250502,-250517,-250532,-250547,-250561,-250576,-250591,-250606,-250621,-250635,-250650,-250665,-250679,-250694,-250709,-250723,-250738,-250753,-250767,-250782,-250797,-250811,-250826,-250841,-250855,-250870,-250884,-250899,-250913,-250928,-250943,-250957,-250972,-250986,-251001,-251015,-251030,-251044,-251059,-251073,-251087,-251102,-251116,-251131,-251145,-251160,-251174,-251188,-251203,-251217,-251231,-251246,-251260,-251274,-251289,-251303,-251317,-251332,-251346,-251360,-251374,-251389,-251403,-251417,-251431,-251446,-251460,-251474,-251488,-251502,-251517,-251531,-251545,-251559,-251573,-251587,-251601,-251616,-251630,-251644,-251658,-251672,-251686,-251700,-251714,-251728,-251742,-251756,-251770,-251784,-251798,-251812,-251826,-251840,-251854,-251868,-251882,-251896,-251910,-251924,-251937,-251951,-251965,-251979,-251993,-252007,-252021,-252034,-252048,-252062,-252076,-252090,-252103,-252117,-252131,-252145,-252158,-252172,-252186,-252200,-252213,-252227,-252241,-252254,-252268,-252282,-252295,-252309,-252323,-252336,-252350,-252364,-252377,-252391,-252404,-252418,-252431,-252445,-252459,-252472,-252486,-252499,-252513,-252526,-252540,-252553,-252567,-252580,-252593,-252607,-252620,-252634,-252647,-252661,-252674,-252687,-252701,-252714,-252727,-252741,-252754,-252767,-252781,-252794,-252807,-252821,-252834,-252847,-252860,-252874,-252887,-252900,-252913,-252927,-252940,-252953,-252966,-252979,-252993,-253006,-253019,-253032,-253045,-253058,-253071,-253084,-253098,-253111,-253124,-253137,-253150,-253163,-253176,-253189,-253202,-253215,-253228,-253241,-253254,-253267,-253280,-253293,-253306,-253319,-253332,-253345,-253358,-253370,-253383,-253396,-253409,-253422,-253435,-253448,-253460,-253473,-253486,-253499,-253512,-253524,-253537,-253550,-253563,-253576,-253588,-253601,-253614,-253626,-253639,-253652,-253665,-253677,-253690,-253703,-253715,-253728,-253740,-253753,-253766,-253778,-253791,-253803,-253816,-253829,-253841,-253854,-253866,-253879,-253891,-253904,-253916,-253929,-253941,-253954,-253966,-253979,-253991,-254003,-254016,-254028,-254041,-254053,-254066,-254078,-254090,-254103,-254115,-254127,-254140,-254152,-254164,-254177,-254189,-254201,-254213,-254226,-254238,-254250,-254262,-254275,-254287,-254299,-254311,-254323,-254336,-254348,-254360,-254372,-254384,-254396,-254409,-254421,-254433,-254445,-254457,-254469,-254481,-254493,-254505,-254517,-254529,-254541,-254553,-254565,-254577,-254589,-254601,-254613,-254625,-254637,-254649,-254661,-254673,-254685,-254697,-254709,-254720,-254732,-254744,-254756,-254768,-254780,-254792,-254803,-254815,-254827,-254839,-254851,-254862,-254874,-254886,-254898,-254909,-254921,-254933,-254944,-254956,-254968,-254980,-254991,-255003,-255014,-255026,-255038,-255049,-255061,-255073,-255084,-255096,-255107,-255119,-255130,-255142,-255154,-255165,-255177,-255188,-255200,-255211,-255223,-255234,-255245,-255257,-255268,-255280,-255291,-255303,-255314,-255325,-255337,-255348,-255360,-255371,-255382,-255394,-255405,-255416,-255428,-255439,-255450,-255461,-255473,-255484,-255495,-255506,-255518,-255529,-255540,-255551,-255563,-255574,-255585,-255596,-255607,-255618,-255629,-255641,-255652,-255663,-255674,-255685,-255696,-255707,-255718,-255729,-255740,-255751,-255762,-255773,-255784,-255795,-255806,-255817,-255828,-255839,-255850,-255861,-255872,-255883,-255894,-255905,-255916,-255927,-255938,-255948,-255959,-255970,-255981,-255992,-256003,-256013,-256024,-256035,-256046,-256057,-256067,-256078,-256089,-256100,-256110,-256121,-256132,-256142,-256153,-256164,-256175,-256185,-256196,-256206,-256217,-256228,-256238,-256249,-256260,-256270,-256281,-256291,-256302,-256312,-256323,-256333,-256344,-256354,-256365,-256375,-256386,-256396,-256407,-256417,-256428,-256438,-256449,-256459,-256469,-256480,-256490,-256501,-256511,-256521,-256532,-256542,-256552,-256563,-256573,-256583,-256594,-256604,-256614,-256624,-256635,-256645,-256655,-256665,-256676,-256686,-256696,-256706,-256716,-256727,-256737,-256747,-256757,-256767,-256777,-256787,-256797,-256808,-256818,-256828,-256838,-256848,-256858,-256868,-256878,-256888,-256898,-256908,-256918,-256928,-256938,-256948,-256958,-256968,-256978,-256988,-256998,-257007,-257017,-257027,-257037,-257047,-257057,-257067,-257077,-257086,-257096,-257106,-257116,-257126,-257135,-257145,-257155,-257165,-257174,-257184,-257194,-257204,-257213,-257223,-257233,-257242,-257252,-257262,-257271,-257281,-257291,-257300,-257310,-257319,-257329,-257339,-257348,-257358,-257367,-257377,-257386,-257396,-257405,-257415,-257424,-257434,-257443,-257453,-257462,-257472,-257481,-257491,-257500,-257509,-257519,-257528,-257538,-257547,-257556,-257566,-257575,-257584,-257594,-257603,-257612,-257622,-257631,-257640,-257650,-257659,-257668,-257677,-257687,-257696,-257705,-257714,-257723,-257733,-257742,-257751,-257760,-257769,-257778,-257788,-257797,-257806,-257815,-257824,-257833,-257842,-257851,-257860,-257869,-257878,-257887,-257896,-257905,-257914,-257923,-257932,-257941,-257950,-257959,-257968,-257977,-257986,-257995,-258004,-258013,-258022,-258030,-258039,-258048,-258057,-258066,-258075,-258083,-258092,-258101,-258110,-258119,-258127,-258136,-258145,-258154,-258162,-258171,-258180,-258189,-258197,-258206,-258215,-258223,-258232,-258241,-258249,-258258,-258266,-258275,-258284,-258292,-258301,-258309,-258318,-258326,-258335,-258344,-258352,-258361,-258369,-258378,-258386,-258395,-258403,-258411,-258420,-258428,-258437,-258445,-258454,-258462,-258470,-258479,-258487,-258495,-258504,-258512,-258521,-258529,-258537,-258545,-258554,-258562,-258570,-258579,-258587,-258595,-258603,-258612,-258620,-258628,-258636,-258644,-258653,-258661,-258669,-258677,-258685,-258693,-258701,-258710,-258718,-258726,-258734,-258742,-258750,-258758,-258766,-258774,-258782,-258790,-258798,-258806,-258814,-258822,-258830,-258838,-258846,-258854,-258862,-258870,-258878,-258886,-258894,-258901,-258909,-258917,-258925,-258933,-258941,-258949,-258956,-258964,-258972,-258980,-258988,-258995,-259003,-259011,-259019,-259026,-259034,-259042,-259049,-259057,-259065,-259072,-259080,-259088,-259095,-259103,-259111,-259118,-259126,-259134,-259141,-259149,-259156,-259164,-259171,-259179,-259186,-259194,-259201,-259209,-259216,-259224,-259231,-259239,-259246,-259254,-259261,-259269,-259276,-259284,-259291,-259298,-259306,-259313,-259320,-259328,-259335,-259342,-259350,-259357,-259364,-259372,-259379,-259386,-259394,-259401,-259408,-259415,-259422,-259430,-259437,-259444,-259451,-259458,-259466,-259473,-259480,-259487,-259494,-259501,-259508,-259516,-259523,-259530,-259537,-259544,-259551,-259558,-259565,-259572,-259579,-259586,-259593,-259600,-259607,-259614,-259621,-259628,-259635,-259642,-259649,-259656,-259663,-259669,-259676,-259683,-259690,-259697,-259704,-259711,-259717,-259724,-259731,-259738,-259745,-259751,-259758,-259765,-259772,-259778,-259785,-259792,-259799,-259805,-259812,-259819,-259825,-259832,-259839,-259845,-259852,-259859,-259865,-259872,-259878,-259885,-259892,-259898,-259905,-259911,-259918,-259924,-259931,-259937,-259944,-259950,-259957,-259963,-259970,-259976,-259983,-259989,-259996,-260002,-260008,-260015,-260021,-260028,-260034,-260040,-260047,-260053,-260059,-260066,-260072,-260078,-260084,-260091,-260097,-260103,-260110,-260116,-260122,-260128,-260134,-260141,-260147,-260153,-260159,-260165,-260172,-260178,-260184,-260190,-260196,-260202,-260208,-260214,-260220,-260227,-260233,-260239,-260245,-260251,-260257,-260263,-260269,-260275,-260281,-260287,-260293,-260299,-260305,-260311,-260316,-260322,-260328,-260334,-260340,-260346,-260352,-260358,-260364,-260369,-260375,-260381,-260387,-260393,-260398,-260404,-260410,-260416,-260422,-260427,-260433,-260439,-260444,-260450,-260456,-260462,-260467,-260473,-260479,-260484,-260490,-260495,-260501,-260507,-260512,-260518,-260524,-260529,-260535,-260540,-260546,-260551,-260557,-260562,-260568,-260573,-260579,-260584,-260590,-260595,-260601,-260606,-260612,-260617,-260622,-260628,-260633,-260639,-260644,-260649,-260655,-260660,-260665,-260671,-260676,-260681,-260687,-260692,-260697,-260702,-260708,-260713,-260718,-260723,-260729,-260734,-260739,-260744,-260749,-260755,-260760,-260765,-260770,-260775,-260780,-260785,-260790,-260796,-260801,-260806,-260811,-260816,-260821,-260826,-260831,-260836,-260841,-260846,-260851,-260856,-260861,-260866,-260871,-260876,-260881,-260886,-260891,-260895,-260900,-260905,-260910,-260915,-260920,-260925,-260929,-260934,-260939,-260944,-260949,-260954,-260958,-260963,-260968,-260973,-260977,-260982,-260987,-260991,-260996,-261001,-261006,-261010,-261015,-261020,-261024,-261029,-261033,-261038,-261043,-261047,-261052,-261056,-261061,-261066,-261070,-261075,-261079,-261084,-261088,-261093,-261097,-261102,-261106,-261111,-261115,-261119,-261124,-261128,-261133,-261137,-261142,-261146,-261150,-261155,-261159,-261163,-261168,-261172,-261176,-261181,-261185,-261189,-261194,-261198,-261202,-261206,-261211,-261215,-261219,-261223,-261227,-261232,-261236,-261240,-261244,-261248,-261252,-261257,-261261,-261265,-261269,-261273,-261277,-261281,-261285,-261289,-261293,-261297,-261301,-261305,-261309,-261313,-261317,-261321,-261325,-261329,-261333,-261337,-261341,-261345,-261349,-261353,-261357,-261361,-261365,-261368,-261372,-261376,-261380,-261384,-261388,-261391,-261395,-261399,-261403,-261407,-261410,-261414,-261418,-261422,-261425,-261429,-261433,-261436,-261440,-261444,-261447,-261451,-261455,-261458,-261462,-261466,-261469,-261473,-261476,-261480,-261484,-261487,-261491,-261494,-261498,-261501,-261505,-261508,-261512,-261515,-261519,-261522,-261526,-261529,-261532,-261536,-261539,-261543,-261546,-261550,-261553,-261556,-261560,-261563,-261566,-261570,-261573,-261576,-261580,-261583,-261586,-261589,-261593,-261596,-261599,-261602,-261606,-261609,-261612,-261615,-261618,-261622,-261625,-261628,-261631,-261634,-261637,-261640,-261643,-261647,-261650,-261653,-261656,-261659,-261662,-261665,-261668,-261671,-261674,-261677,-261680,-261683,-261686,-261689,-261692,-261695,-261698,-261701,-261704,-261707,-261709,-261712,-261715,-261718,-261721,-261724,-261727,-261729,-261732,-261735,-261738,-261741,-261743,-261746,-261749,-261752,-261754,-261757,-261760,-261763,-261765,-261768,-261771,-261773,-261776,-261779,-261781,-261784,-261787,-261789,-261792,-261794,-261797,-261800,-261802,-261805,-261807,-261810,-261812,-261815,-261817,-261820,-261822,-261825,-261827,-261830,-261832,-261835,-261837,-261839,-261842,-261844,-261847,-261849,-261851,-261854,-261856,-261858,-261861,-261863,-261865,-261868,-261870,-261872,-261875,-261877,-261879,-261881,-261884,-261886,-261888,-261890,-261893,-261895,-261897,-261899,-261901,-261903,-261906,-261908,-261910,-261912,-261914,-261916,-261918,-261920,-261922,-261924,-261926,-261928,-261931,-261933,-261935,-261937,-261939,-261941,-261942,-261944,-261946,-261948,-261950,-261952,-261954,-261956,-261958,-261960,-261962,-261964,-261965,-261967,-261969,-261971,-261973,-261974,-261976,-261978,-261980,-261982,-261983,-261985,-261987,-261989,-261990,-261992,-261994,-261995,-261997,-261999,-262000,-262002,-262004,-262005,-262007,-262009,-262010,-262012,-262013,-262015,-262017,-262018,-262020,-262021,-262023,-262024,-262026,-262027,-262029,-262030,-262032,-262033,-262035,-262036,-262037,-262039,-262040,-262042,-262043,-262044,-262046,-262047,-262049,-262050,-262051,-262053,-262054,-262055,-262056,-262058,-262059,-262060,-262062,-262063,-262064,-262065,-262066,-262068,-262069,-262070,-262071,-262072,-262074,-262075,-262076,-262077,-262078,-262079,-262080,-262081,-262083,-262084,-262085,-262086,-262087,-262088,-262089,-262090,-262091,-262092,-262093,-262094,-262095,-262096,-262097,-262098,-262099,-262100,-262100,-262101,-262102,-262103,-262104,-262105,-262106,-262107,-262107,-262108,-262109,-262110,-262111,-262111,-262112,-262113,-262114,-262114,-262115,-262116,-262117,-262117,-262118,-262119,-262119,-262120,-262121,-262121,-262122,-262123,-262123,-262124,-262124,-262125,-262126,-262126,-262127,-262127,-262128,-262128,-262129,-262129,-262130,-262130,-262131,-262131,-262132,-262132,-262133,-262133,-262134,-262134,-262134,-262135,-262135,-262136,-262136,-262136,-262137,-262137,-262137,-262138,-262138,-262138,-262139,-262139,-262139,-262139,-262140,-262140,-262140,-262140,-262141,-262141,-262141,-262141,-262141,-262142,-262142,-262142,-262142,-262142,-262142,-262142,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262142,-262142,-262142,-262142,-262142,-262142,-262142,-262141,-262141,-262141,-262141,-262141,-262140,-262140,-262140,-262140,-262139,-262139,-262139,-262139,-262138,-262138,-262138,-262137,-262137,-262137,-262136,-262136,-262136,-262135,-262135,-262134,-262134,-262134,-262133,-262133,-262132,-262132,-262131,-262131,-262130,-262130,-262129,-262129,-262128,-262128,-262127,-262127,-262126,-262126,-262125,-262124,-262124,-262123,-262123,-262122,-262121,-262121,-262120,-262119,-262119,-262118,-262117,-262117,-262116,-262115,-262114,-262114,-262113,-262112,-262111,-262111,-262110,-262109,-262108,-262107,-262107,-262106,-262105,-262104,-262103,-262102,-262101,-262100,-262100,-262099,-262098,-262097,-262096,-262095,-262094,-262093,-262092,-262091,-262090,-262089,-262088,-262087,-262086,-262085,-262084,-262083,-262081,-262080,-262079,-262078,-262077,-262076,-262075,-262074,-262072,-262071,-262070,-262069,-262068,-262066,-262065,-262064,-262063,-262062,-262060,-262059,-262058,-262056,-262055,-262054,-262053,-262051,-262050,-262049,-262047,-262046,-262044,-262043,-262042,-262040,-262039,-262037,-262036,-262035,-262033,-262032,-262030,-262029,-262027,-262026,-262024,-262023,-262021,-262020,-262018,-262017,-262015,-262013,-262012,-262010,-262009,-262007,-262005,-262004,-262002,-262000,-261999,-261997,-261995,-261994,-261992,-261990,-261989,-261987,-261985,-261983,-261982,-261980,-261978,-261976,-261974,-261973,-261971,-261969,-261967,-261965,-261964,-261962,-261960,-261958,-261956,-261954,-261952,-261950,-261948,-261946,-261944,-261942,-261941,-261939,-261937,-261935,-261933,-261931,-261928,-261926,-261924,-261922,-261920,-261918,-261916,-261914,-261912,-261910,-261908,-261906,-261903,-261901,-261899,-261897,-261895,-261893,-261890,-261888,-261886,-261884,-261881,-261879,-261877,-261875,-261872,-261870,-261868,-261865,-261863,-261861,-261858,-261856,-261854,-261851,-261849,-261847,-261844,-261842,-261839,-261837,-261835,-261832,-261830,-261827,-261825,-261822,-261820,-261817,-261815,-261812,-261810,-261807,-261805,-261802,-261800,-261797,-261794,-261792,-261789,-261787,-261784,-261781,-261779,-261776,-261773,-261771,-261768,-261765,-261763,-261760,-261757,-261754,-261752,-261749,-261746,-261743,-261741,-261738,-261735,-261732,-261729,-261727,-261724,-261721,-261718,-261715,-261712,-261709,-261707,-261704,-261701,-261698,-261695,-261692,-261689,-261686,-261683,-261680,-261677,-261674,-261671,-261668,-261665,-261662,-261659,-261656,-261653,-261650,-261647,-261643,-261640,-261637,-261634,-261631,-261628,-261625,-261622,-261618,-261615,-261612,-261609,-261606,-261602,-261599,-261596,-261593,-261589,-261586,-261583,-261580,-261576,-261573,-261570,-261566,-261563,-261560,-261556,-261553,-261550,-261546,-261543,-261539,-261536,-261532,-261529,-261526,-261522,-261519,-261515,-261512,-261508,-261505,-261501,-261498,-261494,-261491,-261487,-261484,-261480,-261476,-261473,-261469,-261466,-261462,-261458,-261455,-261451,-261447,-261444,-261440,-261436,-261433,-261429,-261425,-261422,-261418,-261414,-261410,-261407,-261403,-261399,-261395,-261391,-261388,-261384,-261380,-261376,-261372,-261368,-261365,-261361,-261357,-261353,-261349,-261345,-261341,-261337,-261333,-261329,-261325,-261321,-261317,-261313,-261309,-261305,-261301,-261297,-261293,-261289,-261285,-261281,-261277,-261273,-261269,-261265,-261261,-261257,-261252,-261248,-261244,-261240,-261236,-261232,-261227,-261223,-261219,-261215,-261211,-261206,-261202,-261198,-261194,-261189,-261185,-261181,-261176,-261172,-261168,-261163,-261159,-261155,-261150,-261146,-261142,-261137,-261133,-261128,-261124,-261119,-261115,-261111,-261106,-261102,-261097,-261093,-261088,-261084,-261079,-261075,-261070,-261066,-261061,-261056,-261052,-261047,-261043,-261038,-261033,-261029,-261024,-261020,-261015,-261010,-261006,-261001,-260996,-260991,-260987,-260982,-260977,-260973,-260968,-260963,-260958,-260954,-260949,-260944,-260939,-260934,-260929,-260925,-260920,-260915,-260910,-260905,-260900,-260895,-260891,-260886,-260881,-260876,-260871,-260866,-260861,-260856,-260851,-260846,-260841,-260836,-260831,-260826,-260821,-260816,-260811,-260806,-260801,-260796,-260790,-260785,-260780,-260775,-260770,-260765,-260760,-260755,-260749,-260744,-260739,-260734,-260729,-260723,-260718,-260713,-260708,-260702,-260697,-260692,-260687,-260681,-260676,-260671,-260665,-260660,-260655,-260649,-260644,-260639,-260633,-260628,-260622,-260617,-260612,-260606,-260601,-260595,-260590,-260584,-260579,-260573,-260568,-260562,-260557,-260551,-260546,-260540,-260535,-260529,-260524,-260518,-260512,-260507,-260501,-260495,-260490,-260484,-260479,-260473,-260467,-260462,-260456,-260450,-260444,-260439,-260433,-260427,-260422,-260416,-260410,-260404,-260398,-260393,-260387,-260381,-260375,-260369,-260364,-260358,-260352,-260346,-260340,-260334,-260328,-260322,-260316,-260311,-260305,-260299,-260293,-260287,-260281,-260275,-260269,-260263,-260257,-260251,-260245,-260239,-260233,-260227,-260220,-260214,-260208,-260202,-260196,-260190,-260184,-260178,-260172,-260165,-260159,-260153,-260147,-260141,-260134,-260128,-260122,-260116,-260110,-260103,-260097,-260091,-260084,-260078,-260072,-260066,-260059,-260053,-260047,-260040,-260034,-260028,-260021,-260015,-260008,-260002,-259996,-259989,-259983,-259976,-259970,-259963,-259957,-259950,-259944,-259937,-259931,-259924,-259918,-259911,-259905,-259898,-259892,-259885,-259878,-259872,-259865,-259859,-259852,-259845,-259839,-259832,-259825,-259819,-259812,-259805,-259799,-259792,-259785,-259778,-259772,-259765,-259758,-259751,-259745,-259738,-259731,-259724,-259717,-259711,-259704,-259697,-259690,-259683,-259676,-259669,-259663,-259656,-259649,-259642,-259635,-259628,-259621,-259614,-259607,-259600,-259593,-259586,-259579,-259572,-259565,-259558,-259551,-259544,-259537,-259530,-259523,-259516,-259508,-259501,-259494,-259487,-259480,-259473,-259466,-259458,-259451,-259444,-259437,-259430,-259422,-259415,-259408,-259401,-259394,-259386,-259379,-259372,-259364,-259357,-259350,-259342,-259335,-259328,-259320,-259313,-259306,-259298,-259291,-259284,-259276,-259269,-259261,-259254,-259246,-259239,-259231,-259224,-259216,-259209,-259201,-259194,-259186,-259179,-259171,-259164,-259156,-259149,-259141,-259134,-259126,-259118,-259111,-259103,-259095,-259088,-259080,-259072,-259065,-259057,-259049,-259042,-259034,-259026,-259019,-259011,-259003,-258995,-258988,-258980,-258972,-258964,-258956,-258949,-258941,-258933,-258925,-258917,-258909,-258901,-258894,-258886,-258878,-258870,-258862,-258854,-258846,-258838,-258830,-258822,-258814,-258806,-258798,-258790,-258782,-258774,-258766,-258758,-258750,-258742,-258734,-258726,-258718,-258710,-258701,-258693,-258685,-258677,-258669,-258661,-258653,-258644,-258636,-258628,-258620,-258612,-258603,-258595,-258587,-258579,-258570,-258562,-258554,-258545,-258537,-258529,-258521,-258512,-258504,-258495,-258487,-258479,-258470,-258462,-258454,-258445,-258437,-258428,-258420,-258411,-258403,-258395,-258386,-258378,-258369,-258361,-258352,-258344,-258335,-258326,-258318,-258309,-258301,-258292,-258284,-258275,-258266,-258258,-258249,-258241,-258232,-258223,-258215,-258206,-258197,-258189,-258180,-258171,-258162,-258154,-258145,-258136,-258127,-258119,-258110,-258101,-258092,-258083,-258075,-258066,-258057,-258048,-258039,-258030,-258022,-258013,-258004,-257995,-257986,-257977,-257968,-257959,-257950,-257941,-257932,-257923,-257914,-257905,-257896,-257887,-257878,-257869,-257860,-257851,-257842,-257833,-257824,-257815,-257806,-257797,-257788,-257778,-257769,-257760,-257751,-257742,-257733,-257723,-257714,-257705,-257696,-257687,-257677,-257668,-257659,-257650,-257640,-257631,-257622,-257612,-257603,-257594,-257584,-257575,-257566,-257556,-257547,-257538,-257528,-257519,-257509,-257500,-257491,-257481,-257472,-257462,-257453,-257443,-257434,-257424,-257415,-257405,-257396,-257386,-257377,-257367,-257358,-257348,-257339,-257329,-257319,-257310,-257300,-257291,-257281,-257271,-257262,-257252,-257242,-257233,-257223,-257213,-257204,-257194,-257184,-257174,-257165,-257155,-257145,-257135,-257126,-257116,-257106,-257096,-257086,-257077,-257067,-257057,-257047,-257037,-257027,-257017,-257007,-256998,-256988,-256978,-256968,-256958,-256948,-256938,-256928,-256918,-256908,-256898,-256888,-256878,-256868,-256858,-256848,-256838,-256828,-256818,-256808,-256797,-256787,-256777,-256767,-256757,-256747,-256737,-256727,-256716,-256706,-256696,-256686,-256676,-256665,-256655,-256645,-256635,-256624,-256614,-256604,-256594,-256583,-256573,-256563,-256552,-256542,-256532,-256521,-256511,-256501,-256490,-256480,-256469,-256459,-256449,-256438,-256428,-256417,-256407,-256396,-256386,-256375,-256365,-256354,-256344,-256333,-256323,-256312,-256302,-256291,-256281,-256270,-256260,-256249,-256238,-256228,-256217,-256206,-256196,-256185,-256175,-256164,-256153,-256142,-256132,-256121,-256110,-256100,-256089,-256078,-256067,-256057,-256046,-256035,-256024,-256013,-256003,-255992,-255981,-255970,-255959,-255948,-255938,-255927,-255916,-255905,-255894,-255883,-255872,-255861,-255850,-255839,-255828,-255817,-255806,-255795,-255784,-255773,-255762,-255751,-255740,-255729,-255718,-255707,-255696,-255685,-255674,-255663,-255652,-255641,-255629,-255618,-255607,-255596,-255585,-255574,-255563,-255551,-255540,-255529,-255518,-255506,-255495,-255484,-255473,-255461,-255450,-255439,-255428,-255416,-255405,-255394,-255382,-255371,-255360,-255348,-255337,-255325,-255314,-255303,-255291,-255280,-255268,-255257,-255245,-255234,-255223,-255211,-255200,-255188,-255177,-255165,-255154,-255142,-255130,-255119,-255107,-255096,-255084,-255073,-255061,-255049,-255038,-255026,-255014,-255003,-254991,-254980,-254968,-254956,-254944,-254933,-254921,-254909,-254898,-254886,-254874,-254862,-254851,-254839,-254827,-254815,-254803,-254792,-254780,-254768,-254756,-254744,-254732,-254720,-254709,-254697,-254685,-254673,-254661,-254649,-254637,-254625,-254613,-254601,-254589,-254577,-254565,-254553,-254541,-254529,-254517,-254505,-254493,-254481,-254469,-254457,-254445,-254433,-254421,-254409,-254396,-254384,-254372,-254360,-254348,-254336,-254323,-254311,-254299,-254287,-254275,-254262,-254250,-254238,-254226,-254213,-254201,-254189,-254177,-254164,-254152,-254140,-254127,-254115,-254103,-254090,-254078,-254066,-254053,-254041,-254028,-254016,-254003,-253991,-253979,-253966,-253954,-253941,-253929,-253916,-253904,-253891,-253879,-253866,-253854,-253841,-253829,-253816,-253803,-253791,-253778,-253766,-253753,-253740,-253728,-253715,-253703,-253690,-253677,-253665,-253652,-253639,-253626,-253614,-253601,-253588,-253576,-253563,-253550,-253537,-253524,-253512,-253499,-253486,-253473,-253460,-253448,-253435,-253422,-253409,-253396,-253383,-253370,-253358,-253345,-253332,-253319,-253306,-253293,-253280,-253267,-253254,-253241,-253228,-253215,-253202,-253189,-253176,-253163,-253150,-253137,-253124,-253111,-253098,-253084,-253071,-253058,-253045,-253032,-253019,-253006,-252993,-252979,-252966,-252953,-252940,-252927,-252913,-252900,-252887,-252874,-252860,-252847,-252834,-252821,-252807,-252794,-252781,-252767,-252754,-252741,-252727,-252714,-252701,-252687,-252674,-252661,-252647,-252634,-252620,-252607,-252593,-252580,-252567,-252553,-252540,-252526,-252513,-252499,-252486,-252472,-252459,-252445,-252431,-252418,-252404,-252391,-252377,-252364,-252350,-252336,-252323,-252309,-252295,-252282,-252268,-252254,-252241,-252227,-252213,-252200,-252186,-252172,-252158,-252145,-252131,-252117,-252103,-252090,-252076,-252062,-252048,-252034,-252021,-252007,-251993,-251979,-251965,-251951,-251937,-251924,-251910,-251896,-251882,-251868,-251854,-251840,-251826,-251812,-251798,-251784,-251770,-251756,-251742,-251728,-251714,-251700,-251686,-251672,-251658,-251644,-251630,-251616,-251601,-251587,-251573,-251559,-251545,-251531,-251517,-251502,-251488,-251474,-251460,-251446,-251431,-251417,-251403,-251389,-251374,-251360,-251346,-251332,-251317,-251303,-251289,-251274,-251260,-251246,-251231,-251217,-251203,-251188,-251174,-251160,-251145,-251131,-251116,-251102,-251087,-251073,-251059,-251044,-251030,-251015,-251001,-250986,-250972,-250957,-250943,-250928,-250913,-250899,-250884,-250870,-250855,-250841,-250826,-250811,-250797,-250782,-250767,-250753,-250738,-250723,-250709,-250694,-250679,-250665,-250650,-250635,-250621,-250606,-250591,-250576,-250561,-250547,-250532,-250517,-250502,-250488,-250473,-250458,-250443,-250428,-250413,-250398,-250384,-250369,-250354,-250339,-250324,-250309,-250294,-250279,-250264,-250249,-250234,-250219,-250204,-250189,-250174,-250159,-250144,-250129,-250114,-250099,-250084,-250069,-250054,-250039,-250024,-250008,-249993,-249978,-249963,-249948,-249933,-249918,-249902,-249887,-249872,-249857,-249842,-249826,-249811,-249796,-249781,-249765,-249750,-249735,-249720,-249704,-249689,-249674,-249658,-249643,-249628,-249612,-249597,-249582,-249566,-249551,-249535,-249520,-249505,-249489,-249474,-249458,-249443,-249427,-249412,-249397,-249381,-249366,-249350,-249334,-249319,-249303,-249288,-249272,-249257,-249241,-249226,-249210,-249194,-249179,-249163,-249148,-249132,-249116,-249101,-249085,-249069,-249054,-249038,-249022,-249007,-248991,-248975,-248959,-248944,-248928,-248912,-248896,-248881,-248865,-248849,-248833,-248817,-248802,-248786,-248770,-248754,-248738,-248722,-248706,-248690,-248675,-248659,-248643,-248627,-248611,-248595,-248579,-248563,-248547,-248531,-248515,-248499,-248483,-248467,-248451,-248435,-248419,-248403,-248387,-248371,-248355,-248339,-248322,-248306,-248290,-248274,-248258,-248242,-248226,-248210,-248193,-248177,-248161,-248145,-248129,-248112,-248096,-248080,-248064,-248047,-248031,-248015,-247999,-247982,-247966,-247950,-247933,-247917,-247901,-247884,-247868,-247852,-247835,-247819,-247802,-247786,-247770,-247753,-247737,-247720,-247704,-247687,-247671,-247654,-247638,-247621,-247605,-247588,-247572,-247555,-247539,-247522,-247506,-247489,-247473,-247456,-247439,-247423,-247406,-247390,-247373,-247356,-247340,-247323,-247306,-247290,-247273,-247256,-247240,-247223,-247206,-247189,-247173,-247156,-247139,-247122,-247106,-247089,-247072,-247055,-247039,-247022,-247005,-246988,-246971,-246954,-246937,-246921,-246904,-246887,-246870,-246853,-246836,-246819,-246802,-246785,-246768,-246751,-246734,-246717,-246700,-246683,-246666,-246649,-246632,-246615,-246598,-246581,-246564,-246547,-246530,-246513,-246496,-246479,-246462,-246444,-246427,-246410,-246393,-246376,-246359,-246341,-246324,-246307,-246290,-246273,-246255,-246238,-246221,-246204,-246186,-246169,-246152,-246135,-246117,-246100,-246083,-246065,-246048,-246031,-246013,-245996,-245978,-245961,-245944,-245926,-245909,-245891,-245874,-245857,-245839,-245822,-245804,-245787,-245769,-245752,-245734,-245717,-245699,-245682,-245664,-245647,-245629,-245612,-245594,-245576,-245559,-245541,-245524,-245506,-245488,-245471,-245453,-245435,-245418,-245400,-245382,-245365,-245347,-245329,-245312,-245294,-245276,-245258,-245241,-245223,-245205,-245187,-245170,-245152,-245134,-245116,-245098,-245080,-245063,-245045,-245027,-245009,-244991,-244973,-244955,-244937,-244920,-244902,-244884,-244866,-244848,-244830,-244812,-244794,-244776,-244758,-244740,-244722,-244704,-244686,-244668,-244650,-244632,-244614,-244596,-244577,-244559,-244541,-244523,-244505,-244487,-244469,-244451,-244432,-244414,-244396,-244378,-244360,-244342,-244323,-244305,-244287,-244269,-244250,-244232,-244214,-244196,-244177,-244159,-244141,-244122,-244104,-244086,-244067,-244049,-244031,-244012,-243994,-243976,-243957,-243939,-243920,-243902,-243884,-243865,-243847,-243828,-243810,-243791,-243773,-243754,-243736,-243717,-243699,-243680,-243662,-243643,-243625,-243606,-243587,-243569,-243550,-243532,-243513,-243495,-243476,-243457,-243439,-243420,-243401,-243383,-243364,-243345,-243327,-243308,-243289,-243270,-243252,-243233,-243214,-243195,-243177,-243158,-243139,-243120,-243102,-243083,-243064,-243045,-243026,-243007,-242989,-242970,-242951,-242932,-242913,-242894,-242875,-242856,-242837,-242818,-242799,-242781,-242762,-242743,-242724,-242705,-242686,-242667,-242648,-242629,-242610,-242590,-242571,-242552,-242533,-242514,-242495,-242476,-242457,-242438,-242419,-242400,-242380,-242361,-242342,-242323,-242304,-242285,-242265,-242246,-242227,-242208,-242188,-242169,-242150,-242131,-242111,-242092,-242073,-242054,-242034,-242015,-241996,-241976,-241957,-241938,-241918,-241899,-241880,-241860,-241841,-241821,-241802,-241783,-241763,-241744,-241724,-241705,-241685,-241666,-241646,-241627,-241607,-241588,-241568,-241549,-241529,-241510,-241490,-241471,-241451,-241432,-241412,-241392,-241373,-241353,-241333,-241314,-241294,-241275,-241255,-241235,-241216,-241196,-241176,-241156,-241137,-241117,-241097,-241078,-241058,-241038,-241018,-240999,-240979,-240959,-240939,-240919,-240900,-240880,-240860,-240840,-240820,-240800,-240780,-240761,-240741,-240721,-240701,-240681,-240661,-240641,-240621,-240601,-240581,-240561,-240541,-240521,-240501,-240481,-240461,-240441,-240421,-240401,-240381,-240361,-240341,-240321,-240301,-240281,-240261,-240241,-240220,-240200,-240180,-240160,-240140,-240120,-240100,-240079,-240059,-240039,-240019,-239999,-239978,-239958,-239938,-239918,-239897,-239877,-239857,-239837,-239816,-239796,-239776,-239755,-239735,-239715,-239694,-239674,-239654,-239633,-239613,-239592,-239572,-239552,-239531,-239511,-239490,-239470,-239449,-239429,-239409,-239388,-239368,-239347,-239327,-239306,-239286,-239265,-239244,-239224,-239203,-239183,-239162,-239142,-239121,-239100,-239080,-239059,-239039,-239018,-238997,-238977,-238956,-238935,-238915,-238894,-238873,-238852,-238832,-238811,-238790,-238770,-238749,-238728,-238707,-238687,-238666,-238645,-238624,-238603,-238582,-238562,-238541,-238520,-238499,-238478,-238457,-238436,-238416,-238395,-238374,-238353,-238332,-238311,-238290,-238269,-238248,-238227,-238206,-238185,-238164,-238143,-238122,-238101,-238080,-238059,-238038,-238017,-237996,-237975,-237954,-237933,-237912,-237890,-237869,-237848,-237827,-237806,-237785,-237764,-237742,-237721,-237700,-237679,-237658,-237636,-237615,-237594,-237573,-237551,-237530,-237509,-237488,-237466,-237445,-237424,-237402,-237381,-237360,-237338,-237317,-237296,-237274,-237253,-237232,-237210,-237189,-237167,-237146,-237125,-237103,-237082,-237060,-237039,-237017,-236996,-236974,-236953,-236931,-236910,-236888,-236867,-236845,-236824,-236802,-236781,-236759,-236737,-236716,-236694,-236673,-236651,-236629,-236608,-236586,-236564,-236543,-236521,-236499,-236478,-236456,-236434,-236413,-236391,-236369,-236347,-236326,-236304,-236282,-236260,-236239,-236217,-236195,-236173,-236151,-236130,-236108,-236086,-236064,-236042,-236020,-235998,-235977,-235955,-235933,-235911,-235889,-235867,-235845,-235823,-235801,-235779,-235757,-235735,-235713,-235691,-235669,-235647,-235625,-235603,-235581,-235559,-235537,-235515,-235493,-235471,-235449,-235427,-235404,-235382,-235360,-235338,-235316,-235294,-235272,-235249,-235227,-235205,-235183,-235161,-235138,-235116,-235094,-235072,-235049,-235027,-235005,-234983,-234960,-234938,-234916,-234893,-234871,-234849,-234827,-234804,-234782,-234759,-234737,-234715,-234692,-234670,-234648,-234625,-234603,-234580,-234558,-234535,-234513,-234490,-234468,-234445,-234423,-234400,-234378,-234355,-234333,-234310,-234288,-234265,-234243,-234220,-234198,-234175,-234152,-234130,-234107,-234085,-234062,-234039,-234017,-233994,-233971,-233949,-233926,-233903,-233881,-233858,-233835,-233812,-233790,-233767,-233744,-233721,-233699,-233676,-233653,-233630,-233608,-233585,-233562,-233539,-233516,-233493,-233471,-233448,-233425,-233402,-233379,-233356,-233333,-233310,-233287,-233264,-233242,-233219,-233196,-233173,-233150,-233127,-233104,-233081,-233058,-233035,-233012,-232989,-232966,-232943,-232919,-232896,-232873,-232850,-232827,-232804,-232781,-232758,-232735,-232712,-232688,-232665,-232642,-232619,-232596,-232573,-232549,-232526,-232503,-232480,-232456,-232433,-232410,-232387,-232363,-232340,-232317,-232294,-232270,-232247,-232224,-232200,-232177,-232154,-232130,-232107,-232084,-232060,-232037,-232013,-231990,-231967,-231943,-231920,-231896,-231873,-231849,-231826,-231803,-231779,-231756,-231732,-231709,-231685,-231662,-231638,-231614,-231591,-231567,-231544,-231520,-231497,-231473,-231449,-231426,-231402,-231379,-231355,-231331,-231308,-231284,-231260,-231237,-231213,-231189,-231166,-231142,-231118,-231095,-231071,-231047,-231023,-231000,-230976,-230952,-230928,-230904,-230881,-230857,-230833,-230809,-230785,-230761,-230738,-230714,-230690,-230666,-230642,-230618,-230594,-230570,-230547,-230523,-230499,-230475,-230451,-230427,-230403,-230379,-230355,-230331,-230307,-230283,-230259,-230235,-230211,-230187,-230163,-230139,-230115,-230090,-230066,-230042,-230018,-229994,-229970,-229946,-229922,-229897,-229873,-229849,-229825,-229801,-229777,-229752,-229728,-229704,-229680,-229656,-229631,-229607,-229583,-229559,-229534,-229510,-229486,-229461,-229437,-229413,-229388,-229364,-229340,-229315,-229291,-229267,-229242,-229218,-229193,-229169,-229145,-229120,-229096,-229071,-229047,-229023,-228998,-228974,-228949,-228925,-228900,-228876,-228851,-228827,-228802,-228778,-228753,-228728,-228704,-228679,-228655,-228630,-228606,-228581,-228556,-228532,-228507,-228482,-228458,-228433,-228408,-228384,-228359,-228334,-228310,-228285,-228260,-228236,-228211,-228186,-228161,-228137,-228112,-228087,-228062,-228038,-228013,-227988,-227963,-227938,-227913,-227889,-227864,-227839,-227814,-227789,-227764,-227739,-227715,-227690,-227665,-227640,-227615,-227590,-227565,-227540,-227515,-227490,-227465,-227440,-227415,-227390,-227365,-227340,-227315,-227290,-227265,-227240,-227215,-227190,-227165,-227140,-227114,-227089,-227064,-227039,-227014,-226989,-226964,-226939,-226913,-226888,-226863,-226838,-226813,-226787,-226762,-226737,-226712,-226687,-226661,-226636,-226611,-226585,-226560,-226535,-226510,-226484,-226459,-226434,-226408,-226383,-226358,-226332,-226307,-226282,-226256,-226231,-226205,-226180,-226155,-226129,-226104,-226078,-226053,-226027,-226002,-225976,-225951,-225925,-225900,-225874,-225849,-225823,-225798,-225772,-225747,-225721,-225696,-225670,-225645,-225619,-225593,-225568,-225542,-225516,-225491,-225465,-225440,-225414,-225388,-225363,-225337,-225311,-225286,-225260,-225234,-225208,-225183,-225157,-225131,-225105,-225080,-225054,-225028,-225002,-224977,-224951,-224925,-224899,-224873,-224847,-224822,-224796,-224770,-224744,-224718,-224692,-224666,-224640,-224614,-224589,-224563,-224537,-224511,-224485,-224459,-224433,-224407,-224381,-224355,-224329,-224303,-224277,-224251,-224225,-224199,-224173,-224147,-224121,-224095,-224068,-224042,-224016,-223990,-223964,-223938,-223912,-223886,-223859,-223833,-223807,-223781,-223755,-223729,-223702,-223676,-223650,-223624,-223598,-223571,-223545,-223519,-223492,-223466,-223440,-223414,-223387,-223361,-223335,-223308,-223282,-223256,-223229,-223203,-223177,-223150,-223124,-223098,-223071,-223045,-223018,-222992,-222965,-222939,-222913,-222886,-222860,-222833,-222807,-222780,-222754,-222727,-222701,-222674,-222648,-222621,-222595,-222568,-222541,-222515,-222488,-222462,-222435,-222409,-222382,-222355,-222329,-222302,-222275,-222249,-222222,-222195,-222169,-222142,-222115,-222089,-222062,-222035,-222009,-221982,-221955,-221928,-221902,-221875,-221848,-221821,-221794,-221768,-221741,-221714,-221687,-221660,-221633,-221607,-221580,-221553,-221526,-221499,-221472,-221445,-221418,-221392,-221365,-221338,-221311,-221284,-221257,-221230,-221203,-221176,-221149,-221122,-221095,-221068,-221041,-221014,-220987,-220960,-220933,-220906,-220879,-220852,-220825,-220797,-220770,-220743,-220716,-220689,-220662,-220635,-220608,-220580,-220553,-220526,-220499,-220472,-220445,-220417,-220390,-220363,-220336,-220308,-220281,-220254,-220227,-220199,-220172,-220145,-220118,-220090,-220063,-220036,-220008,-219981,-219954,-219926,-219899,-219872,-219844,-219817,-219789,-219762,-219735,-219707,-219680,-219652,-219625,-219597,-219570,-219543,-219515,-219488,-219460,-219433,-219405,-219378,-219350,-219323,-219295,-219267,-219240,-219212,-219185,-219157,-219130,-219102,-219074,-219047,-219019,-218992,-218964,-218936,-218909,-218881,-218853,-218826,-218798,-218770,-218743,-218715,-218687,-218659,-218632,-218604,-218576,-218548,-218521,-218493,-218465,-218437,-218410,-218382,-218354,-218326,-218298,-218270,-218243,-218215,-218187,-218159,-218131,-218103,-218075,-218048,-218020,-217992,-217964,-217936,-217908,-217880,-217852,-217824,-217796,-217768,-217740,-217712,-217684,-217656,-217628,-217600,-217572,-217544,-217516,-217488,-217460,-217432,-217404,-217376,-217347,-217319,-217291,-217263,-217235,-217207,-217179,-217151,-217122,-217094,-217066,-217038,-217010,-216981,-216953,-216925,-216897,-216869,-216840,-216812,-216784,-216756,-216727,-216699,-216671,-216642,-216614,-216586,-216557,-216529,-216501,-216472,-216444,-216416,-216387,-216359,-216331,-216302,-216274,-216245,-216217,-216189,-216160,-216132,-216103,-216075,-216046,-216018,-215989,-215961,-215932,-215904,-215875,-215847,-215818,-215790,-215761,-215733,-215704,-215676,-215647,-215618,-215590,-215561,-215533,-215504,-215475,-215447,-215418,-215389,-215361,-215332,-215303,-215275,-215246,-215217,-215189,-215160,-215131,-215103,-215074,-215045,-215016,-214988,-214959,-214930,-214901,-214872,-214844,-214815,-214786,-214757,-214728,-214700,-214671,-214642,-214613,-214584,-214555,-214526,-214497,-214469,-214440,-214411,-214382,-214353,-214324,-214295,-214266,-214237,-214208,-214179,-214150,-214121,-214092,-214063,-214034,-214005,-213976,-213947,-213918,-213889,-213860,-213831,-213802,-213773,-213744,-213714,-213685,-213656,-213627,-213598,-213569,-213540,-213510,-213481,-213452,-213423,-213394,-213365,-213335,-213306,-213277,-213248,-213218,-213189,-213160,-213131,-213101,-213072,-213043,-213014,-212984,-212955,-212926,-212896,-212867,-212838,-212808,-212779,-212750,-212720,-212691,-212661,-212632,-212603,-212573,-212544,-212514,-212485,-212455,-212426,-212397,-212367,-212338,-212308,-212279,-212249,-212220,-212190,-212161,-212131,-212102,-212072,-212042,-212013,-211983,-211954,-211924,-211895,-211865,-211835,-211806,-211776,-211747,-211717,-211687,-211658,-211628,-211598,-211569,-211539,-211509,-211480,-211450,-211420,-211390,-211361,-211331,-211301,-211271,-211242,-211212,-211182,-211152,-211123,-211093,-211063,-211033,-211003,-210973,-210944,-210914,-210884,-210854,-210824,-210794,-210764,-210735,-210705,-210675,-210645,-210615,-210585,-210555,-210525,-210495,-210465,-210435,-210405,-210375,-210345,-210315,-210285,-210255,-210225,-210195,-210165,-210135,-210105,-210075,-210045,-210015,-209985,-209955,-209925,-209894,-209864,-209834,-209804,-209774,-209744,-209714,-209683,-209653,-209623,-209593,-209563,-209533,-209502,-209472,-209442,-209412,-209381,-209351,-209321,-209291,-209260,-209230,-209200,-209169,-209139,-209109,-209079,-209048,-209018,-208988,-208957,-208927,-208896,-208866,-208836,-208805,-208775,-208745,-208714,-208684,-208653,-208623,-208592,-208562,-208532,-208501,-208471,-208440,-208410,-208379,-208349,-208318,-208288,-208257,-208227,-208196,-208165,-208135,-208104,-208074,-208043,-208013,-207982,-207951,-207921,-207890,-207860,-207829,-207798,-207768,-207737,-207706,-207676,-207645,-207614,-207584,-207553,-207522,-207491,-207461,-207430,-207399,-207369,-207338,-207307,-207276,-207245,-207215,-207184,-207153,-207122,-207091,-207061,-207030,-206999,-206968,-206937,-206906,-206876,-206845,-206814,-206783,-206752,-206721,-206690,-206659,-206628,-206597,-206566,-206536,-206505,-206474,-206443,-206412,-206381,-206350,-206319,-206288,-206257,-206226,-206195,-206164,-206132,-206101,-206070,-206039,-206008,-205977,-205946,-205915,-205884,-205853,-205822,-205790,-205759,-205728,-205697,-205666,-205635,-205603,-205572,-205541,-205510,-205479,-205447,-205416,-205385,-205354,-205323,-205291,-205260,-205229,-205197,-205166,-205135,-205104,-205072,-205041,-205010,-204978,-204947,-204916,-204884,-204853,-204822,-204790,-204759,-204727,-204696,-204665,-204633,-204602,-204570,-204539,-204507,-204476,-204445,-204413,-204382,-204350,-204319,-204287,-204256,-204224,-204193,-204161,-204130,-204098,-204066,-204035,-204003,-203972,-203940,-203909,-203877,-203845,-203814,-203782,-203751,-203719,-203687,-203656,-203624,-203592,-203561,-203529,-203497,-203466,-203434,-203402,-203371,-203339,-203307,-203275,-203244,-203212,-203180,-203148,-203117,-203085,-203053,-203021,-202989,-202958,-202926,-202894,-202862,-202830,-202798,-202767,-202735,-202703,-202671,-202639,-202607,-202575,-202543,-202511,-202480,-202448,-202416,-202384,-202352,-202320,-202288,-202256,-202224,-202192,-202160,-202128,-202096,-202064,-202032,-202000,-201968,-201936,-201904,-201872,-201840,-201807,-201775,-201743,-201711,-201679,-201647,-201615,-201583,-201551,-201518,-201486,-201454,-201422,-201390,-201358,-201325,-201293,-201261,-201229,-201197,-201164,-201132,-201100,-201068,-201035,-201003,-200971,-200939,-200906,-200874,-200842,-200809,-200777,-200745,-200712,-200680,-200648,-200615,-200583,-200551,-200518,-200486,-200453,-200421,-200389,-200356,-200324,-200291,-200259,-200227,-200194,-200162,-200129,-200097,-200064,-200032,-199999,-199967,-199934,-199902,-199869,-199837,-199804,-199772,-199739,-199707,-199674,-199641,-199609,-199576,-199544,-199511,-199478,-199446,-199413,-199381,-199348,-199315,-199283,-199250,-199217,-199185,-199152,-199119,-199087,-199054,-199021,-198988,-198956,-198923,-198890,-198857,-198825,-198792,-198759,-198726,-198694,-198661,-198628,-198595,-198562,-198530,-198497,-198464,-198431,-198398,-198365,-198333,-198300,-198267,-198234,-198201,-198168,-198135,-198102,-198069,-198036,-198003,-197971,-197938,-197905,-197872,-197839,-197806,-197773,-197740,-197707,-197674,-197641,-197608,-197575,-197542,-197509,-197475,-197442,-197409,-197376,-197343,-197310,-197277,-197244,-197211,-197178,-197145,-197111,-197078,-197045,-197012,-196979,-196946,-196912,-196879,-196846,-196813,-196780,-196746,-196713,-196680,-196647,-196614,-196580,-196547,-196514,-196480,-196447,-196414,-196381,-196347,-196314,-196281,-196247,-196214,-196181,-196147,-196114,-196081,-196047,-196014,-195981,-195947,-195914,-195880,-195847,-195814,-195780,-195747,-195713,-195680,-195646,-195613,-195579,-195546,-195512,-195479,-195445,-195412,-195378,-195345,-195311,-195278,-195244,-195211,-195177,-195144,-195110,-195077,-195043,-195009,-194976,-194942,-194909,-194875,-194841,-194808,-194774,-194740,-194707,-194673,-194639,-194606,-194572,-194538,-194505,-194471,-194437,-194404,-194370,-194336,-194302,-194269,-194235,-194201,-194167,-194134,-194100,-194066,-194032,-193998,-193965,-193931,-193897,-193863,-193829,-193795,-193762,-193728,-193694,-193660,-193626,-193592,-193558,-193524,-193491,-193457,-193423,-193389,-193355,-193321,-193287,-193253,-193219,-193185,-193151,-193117,-193083,-193049,-193015,-192981,-192947,-192913,-192879,-192845,-192811,-192777,-192743,-192709,-192675,-192640,-192606,-192572,-192538,-192504,-192470,-192436,-192402,-192368,-192333,-192299,-192265,-192231,-192197,-192163,-192128,-192094,-192060,-192026,-191991,-191957,-191923,-191889,-191855,-191820,-191786,-191752,-191717,-191683,-191649,-191615,-191580,-191546,-191512,-191477,-191443,-191409,-191374,-191340,-191306,-191271,-191237,-191202,-191168,-191134,-191099,-191065,-191030,-190996,-190962,-190927,-190893,-190858,-190824,-190789,-190755,-190720,-190686,-190651,-190617,-190582,-190548,-190513,-190479,-190444,-190410,-190375,-190341,-190306,-190271,-190237,-190202,-190168,-190133,-190098,-190064,-190029,-189995,-189960,-189925,-189891,-189856,-189821,-189787,-189752,-189717,-189683,-189648,-189613,-189579,-189544,-189509,-189474,-189440,-189405,-189370,-189335,-189301,-189266,-189231,-189196,-189161,-189127,-189092,-189057,-189022,-188987,-188953,-188918,-188883,-188848,-188813,-188778,-188743,-188708,-188674,-188639,-188604,-188569,-188534,-188499,-188464,-188429,-188394,-188359,-188324,-188289,-188254,-188219,-188184,-188149,-188114,-188079,-188044,-188009,-187974,-187939,-187904,-187869,-187834,-187799,-187764,-187729,-187694,-187659,-187624,-187588,-187553,-187518,-187483,-187448,-187413,-187378,-187342,-187307,-187272,-187237,-187202,-187167,-187131,-187096,-187061,-187026,-186991,-186955,-186920,-186885,-186850,-186814,-186779,-186744,-186709,-186673,-186638,-186603,-186567,-186532,-186497,-186461,-186426,-186391,-186355,-186320,-186285,-186249,-186214,-186178,-186143,-186108,-186072,-186037,-186001,-185966,-185931,-185895,-185860,-185824,-185789,-185753,-185718,-185682,-185647,-185611,-185576,-185540,-185505,-185469,-185434,-185398,-185363,-185327,-185292,-185256,-185221,-185185,-185149,-185114,-185078,-185043,-185007,-184971,-184936,-184900,-184865,-184829,-184793,-184758,-184722,-184686,-184651,-184615,-184579,-184544,-184508,-184472,-184436,-184401,-184365,-184329,-184293,-184258,-184222,-184186,-184150,-184115,-184079,-184043,-184007,-183971,-183936,-183900,-183864,-183828,-183792,-183756,-183721,-183685,-183649,-183613,-183577,-183541,-183505,-183469,-183434,-183398,-183362,-183326,-183290,-183254,-183218,-183182,-183146,-183110,-183074,-183038,-183002,-182966,-182930,-182894,-182858,-182822,-182786,-182750,-182714,-182678,-182642,-182606,-182570,-182534,-182498,-182462,-182425,-182389,-182353,-182317,-182281,-182245,-182209,-182173,-182136,-182100,-182064,-182028,-181992,-181956,-181919,-181883,-181847,-181811,-181775,-181738,-181702,-181666,-181630,-181593,-181557,-181521,-181485,-181448,-181412,-181376,-181340,-181303,-181267,-181231,-181194,-181158,-181122,-181085,-181049,-181013,-180976,-180940,-180903,-180867,-180831,-180794,-180758,-180722,-180685,-180649,-180612,-180576,-180539,-180503,-180466,-180430,-180394,-180357,-180321,-180284,-180248,-180211,-180175,-180138,-180102,-180065,-180028,-179992,-179955,-179919,-179882,-179846,-179809,-179773,-179736,-179699,-179663,-179626,-179590,-179553,-179516,-179480,-179443,-179406,-179370,-179333,-179296,-179260,-179223,-179186,-179150,-179113,-179076,-179040,-179003,-178966,-178929,-178893,-178856,-178819,-178782,-178746,-178709,-178672,-178635,-178599,-178562,-178525,-178488,-178451,-178414,-178378,-178341,-178304,-178267,-178230,-178193,-178157,-178120,-178083,-178046,-178009,-177972,-177935,-177898,-177861,-177824,-177787,-177751,-177714,-177677,-177640,-177603,-177566,-177529,-177492,-177455,-177418,-177381,-177344,-177307,-177270,-177233,-177196,-177159,-177122,-177084,-177047,-177010,-176973,-176936,-176899,-176862,-176825,-176788,-176751,-176713,-176676,-176639,-176602,-176565,-176528,-176491,-176453,-176416,-176379,-176342,-176305,-176267,-176230,-176193,-176156,-176119,-176081,-176044,-176007,-175970,-175932,-175895,-175858,-175821,-175783,-175746,-175709,-175671,-175634,-175597,-175559,-175522,-175485,-175447,-175410,-175373,-175335,-175298,-175261,-175223,-175186,-175148,-175111,-175074,-175036,-174999,-174961,-174924,-174886,-174849,-174812,-174774,-174737,-174699,-174662,-174624,-174587,-174549,-174512,-174474,-174437,-174399,-174362,-174324,-174287,-174249,-174211,-174174,-174136,-174099,-174061,-174024,-173986,-173948,-173911,-173873,-173836,-173798,-173760,-173723,-173685,-173647,-173610,-173572,-173534,-173497,-173459,-173421,-173384,-173346,-173308,-173270,-173233,-173195,-173157,-173120,-173082,-173044,-173006,-172968,-172931,-172893,-172855,-172817,-172780,-172742,-172704,-172666,-172628,-172590,-172553,-172515,-172477,-172439,-172401,-172363,-172325,-172288,-172250,-172212,-172174,-172136,-172098,-172060,-172022,-171984,-171946,-171908,-171870,-171833,-171795,-171757,-171719,-171681,-171643,-171605,-171567,-171529,-171491,-171453,-171415,-171377,-171338,-171300,-171262,-171224,-171186,-171148,-171110,-171072,-171034,-170996,-170958,-170920,-170882,-170843,-170805,-170767,-170729,-170691,-170653,-170615,-170576,-170538,-170500,-170462,-170424,-170385,-170347,-170309,-170271,-170233,-170194,-170156,-170118,-170080,-170041,-170003,-169965,-169927,-169888,-169850,-169812,-169773,-169735,-169697,-169659,-169620,-169582,-169544,-169505,-169467,-169429,-169390,-169352,-169313,-169275,-169237,-169198,-169160,-169121,-169083,-169045,-169006,-168968,-168929,-168891,-168852,-168814,-168776,-168737,-168699,-168660,-168622,-168583,-168545,-168506,-168468,-168429,-168391,-168352,-168314,-168275,-168237,-168198,-168159,-168121,-168082,-168044,-168005,-167967,-167928,-167889,-167851,-167812,-167773,-167735,-167696,-167658,-167619,-167580,-167542,-167503,-167464,-167426,-167387,-167348,-167310,-167271,-167232,-167193,-167155,-167116,-167077,-167039,-167000,-166961,-166922,-166884,-166845,-166806,-166767,-166728,-166690,-166651,-166612,-166573,-166534,-166496,-166457,-166418,-166379,-166340,-166301,-166263,-166224,-166185,-166146,-166107,-166068,-166029,-165990,-165951,-165913,-165874,-165835,-165796,-165757,-165718,-165679,-165640,-165601,-165562,-165523,-165484,-165445,-165406,-165367,-165328,-165289,-165250,-165211,-165172,-165133,-165094,-165055,-165016,-164977,-164938,-164899,-164860,-164820,-164781,-164742,-164703,-164664,-164625,-164586,-164547,-164508,-164468,-164429,-164390,-164351,-164312,-164273,-164233,-164194,-164155,-164116,-164077,-164038,-163998,-163959,-163920,-163881,-163841,-163802,-163763,-163724,-163684,-163645,-163606,-163567,-163527,-163488,-163449,-163409,-163370,-163331,-163291,-163252,-163213,-163173,-163134,-163095,-163055,-163016,-162977,-162937,-162898,-162859,-162819,-162780,-162740,-162701,-162662,-162622,-162583,-162543,-162504,-162464,-162425,-162385,-162346,-162307,-162267,-162228,-162188,-162149,-162109,-162070,-162030,-161991,-161951,-161912,-161872,-161832,-161793,-161753,-161714,-161674,-161635,-161595,-161556,-161516,-161476,-161437,-161397,-161358,-161318,-161278,-161239,-161199,-161159,-161120,-161080,-161040,-161001,-160961,-160921,-160882,-160842,-160802,-160763,-160723,-160683,-160643,-160604,-160564,-160524,-160485,-160445,-160405,-160365,-160326,-160286,-160246,-160206,-160166,-160127,-160087,-160047,-160007,-159967,-159928,-159888,-159848,-159808,-159768,-159728,-159688,-159649,-159609,-159569,-159529,-159489,-159449,-159409,-159369,-159329,-159290,-159250,-159210,-159170,-159130,-159090,-159050,-159010,-158970,-158930,-158890,-158850,-158810,-158770,-158730,-158690,-158650,-158610,-158570,-158530,-158490,-158450,-158410,-158370,-158330,-158290,-158250,-158210,-158169,-158129,-158089,-158049,-158009,-157969,-157929,-157889,-157849,-157808,-157768,-157728,-157688,-157648,-157608,-157568,-157527,-157487,-157447,-157407,-157367,-157326,-157286,-157246,-157206,-157166,-157125,-157085,-157045,-157005,-156964,-156924,-156884,-156844,-156803,-156763,-156723,-156682,-156642,-156602,-156561,-156521,-156481,-156440,-156400,-156360,-156319,-156279,-156239,-156198,-156158,-156118,-156077,-156037,-155996,-155956,-155916,-155875,-155835,-155794,-155754,-155714,-155673,-155633,-155592,-155552,-155511,-155471,-155430,-155390,-155349,-155309,-155268,-155228,-155187,-155147,-155106,-155066,-155025,-154985,-154944,-154904,-154863,-154823,-154782,-154741,-154701,-154660,-154620,-154579,-154538,-154498,-154457,-154417,-154376,-154335,-154295,-154254,-154213,-154173,-154132,-154092,-154051,-154010,-153969,-153929,-153888,-153847,-153807,-153766,-153725,-153685,-153644,-153603,-153562,-153522,-153481,-153440,-153399,-153359,-153318,-153277,-153236,-153196,-153155,-153114,-153073,-153032,-152992,-152951,-152910,-152869,-152828,-152787,-152747,-152706,-152665,-152624,-152583,-152542,-152501,-152460,-152420,-152379,-152338,-152297,-152256,-152215,-152174,-152133,-152092,-152051,-152010,-151969,-151928,-151887,-151846,-151805,-151764,-151723,-151682,-151641,-151600,-151559,-151518,-151477,-151436,-151395,-151354,-151313,-151272,-151231,-151190,-151149,-151108,-151067,-151026,-150985,-150944,-150903,-150861,-150820,-150779,-150738,-150697,-150656,-150615,-150574,-150532,-150491,-150450,-150409,-150368,-150327,-150285,-150244,-150203,-150162,-150121,-150079,-150038,-149997,-149956,-149915,-149873,-149832,-149791,-149750,-149708,-149667,-149626,-149584,-149543,-149502,-149461,-149419,-149378,-149337,-149295,-149254,-149213,-149171,-149130,-149089,-149047,-149006,-148965,-148923,-148882,-148841,-148799,-148758,-148716,-148675,-148634,-148592,-148551,-148509,-148468,-148427,-148385,-148344,-148302,-148261,-148219,-148178,-148136,-148095,-148053,-148012,-147970,-147929,-147887,-147846,-147804,-147763,-147721,-147680,-147638,-147597,-147555,-147514,-147472,-147431,-147389,-147347,-147306,-147264,-147223,-147181,-147140,-147098,-147056,-147015,-146973,-146931,-146890,-146848,-146807,-146765,-146723,-146682,-146640,-146598,-146557,-146515,-146473,-146432,-146390,-146348,-146306,-146265,-146223,-146181,-146140,-146098,-146056,-146014,-145973,-145931,-145889,-145847,-145806,-145764,-145722,-145680,-145638,-145597,-145555,-145513,-145471,-145429,-145388,-145346,-145304,-145262,-145220,-145178,-145136,-145095,-145053,-145011,-144969,-144927,-144885,-144843,-144801,-144760,-144718,-144676,-144634,-144592,-144550,-144508,-144466,-144424,-144382,-144340,-144298,-144256,-144214,-144172,-144130,-144088,-144046,-144004,-143962,-143920,-143878,-143836,-143794,-143752,-143710,-143668,-143626,-143584,-143542,-143500,-143458,-143416,-143374,-143332,-143290,-143247,-143205,-143163,-143121,-143079,-143037,-142995,-142953,-142911,-142868,-142826,-142784,-142742,-142700,-142658,-142615,-142573,-142531,-142489,-142447,-142404,-142362,-142320,-142278,-142236,-142193,-142151,-142109,-142067,-142024,-141982,-141940,-141898,-141855,-141813,-141771,-141729,-141686,-141644,-141602,-141559,-141517,-141475,-141432,-141390,-141348,-141305,-141263,-141221,-141178,-141136,-141094,-141051,-141009,-140967,-140924,-140882,-140839,-140797,-140755,-140712,-140670,-140627,-140585,-140543,-140500,-140458,-140415,-140373,-140330,-140288,-140245,-140203,-140160,-140118,-140076,-140033,-139991,-139948,-139906,-139863,-139820,-139778,-139735,-139693,-139650,-139608,-139565,-139523,-139480,-139438,-139395,-139352,-139310,-139267,-139225,-139182,-139140,-139097,-139054,-139012,-138969,-138926,-138884,-138841,-138799,-138756,-138713,-138671,-138628,-138585,-138543,-138500,-138457,-138415,-138372,-138329,-138287,-138244,-138201,-138158,-138116,-138073,-138030,-137987,-137945,-137902,-137859,-137816,-137774,-137731,-137688,-137645,-137603,-137560,-137517,-137474,-137431,-137389,-137346,-137303,-137260,-137217,-137175,-137132,-137089,-137046,-137003,-136960,-136917,-136875,-136832,-136789,-136746,-136703,-136660,-136617,-136574,-136531,-136489,-136446,-136403,-136360,-136317,-136274,-136231,-136188,-136145,-136102,-136059,-136016,-135973,-135930,-135887,-135844,-135801,-135758,-135715,-135672,-135629,-135586,-135543,-135500,-135457,-135414,-135371,-135328,-135285,-135242,-135199,-135156,-135113,-135070,-135027,-134983,-134940,-134897,-134854,-134811,-134768,-134725,-134682,-134639,-134595,-134552,-134509,-134466,-134423,-134380,-134337,-134293,-134250,-134207,-134164,-134121,-134077,-134034,-133991,-133948,-133905,-133861,-133818,-133775,-133732,-133689,-133645,-133602,-133559,-133516,-133472,-133429,-133386,-133342,-133299,-133256,-133213,-133169,-133126,-133083,-133039,-132996,-132953,-132909,-132866,-132823,-132779,-132736,-132693,-132649,-132606,-132563,-132519,-132476,-132433,-132389,-132346,-132302,-132259,-132216,-132172,-132129,-132085,-132042,-131999,-131955,-131912,-131868,-131825,-131781,-131738,-131694,-131651,-131608,-131564,-131521,-131477,-131434,-131390,-131347,-131303,-131260,-131216,-131173,-131129,-131086,-131042,-130998,-130955,-130911,-130868,-130824,-130781,-130737,-130694,-130650,-130606,-130563,-130519,-130476,-130432,-130388,-130345,-130301,-130258,-130214,-130170,-130127,-130083,-130039,-129996,-129952,-129908,-129865,-129821,-129777,-129734,-129690,-129646,-129603,-129559,-129515,-129472,-129428,-129384,-129340,-129297,-129253,-129209,-129166,-129122,-129078,-129034,-128991,-128947,-128903,-128859,-128815,-128772,-128728,-128684,-128640,-128597,-128553,-128509,-128465,-128421,-128377,-128334,-128290,-128246,-128202,-128158,-128114,-128071,-128027,-127983,-127939,-127895,-127851,-127807,-127763,-127720,-127676,-127632,-127588,-127544,-127500,-127456,-127412,-127368,-127324,-127280,-127236,-127192,-127149,-127105,-127061,-127017,-126973,-126929,-126885,-126841,-126797,-126753,-126709,-126665,-126621,-126577,-126533,-126489,-126445,-126401,-126357,-126313,-126268,-126224,-126180,-126136,-126092,-126048,-126004,-125960,-125916,-125872,-125828,-125784,-125740,-125695,-125651,-125607,-125563,-125519,-125475,-125431,-125387,-125342,-125298,-125254,-125210,-125166,-125122,-125077,-125033,-124989,-124945,-124901,-124856,-124812,-124768,-124724,-124680,-124635,-124591,-124547,-124503,-124459,-124414,-124370,-124326,-124282,-124237,-124193,-124149,-124104,-124060,-124016,-123972,-123927,-123883,-123839,-123794,-123750,-123706,-123661,-123617,-123573,-123528,-123484,-123440,-123395,-123351,-123307,-123262,-123218,-123174,-123129,-123085,-123041,-122996,-122952,-122907,-122863,-122819,-122774,-122730,-122685,-122641,-122596,-122552,-122508,-122463,-122419,-122374,-122330,-122285,-122241,-122196,-122152,-122107,-122063,-122018,-121974,-121930,-121885,-121841,-121796,-121751,-121707,-121662,-121618,-121573,-121529,-121484,-121440,-121395,-121351,-121306,-121262,-121217,-121172,-121128,-121083,-121039,-120994,-120949,-120905,-120860,-120816,-120771,-120726,-120682,-120637,-120593,-120548,-120503,-120459,-120414,-120369,-120325,-120280,-120235,-120191,-120146,-120101,-120057,-120012,-119967,-119923,-119878,-119833,-119789,-119744,-119699,-119654,-119610,-119565,-119520,-119475,-119431,-119386,-119341,-119296,-119252,-119207,-119162,-119117,-119073,-119028,-118983,-118938,-118893,-118849,-118804,-118759,-118714,-118669,-118625,-118580,-118535,-118490,-118445,-118400,-118356,-118311,-118266,-118221,-118176,-118131,-118086,-118041,-117997,-117952,-117907,-117862,-117817,-117772,-117727,-117682,-117637,-117592,-117548,-117503,-117458,-117413,-117368,-117323,-117278,-117233,-117188,-117143,-117098,-117053,-117008,-116963,-116918,-116873,-116828,-116783,-116738,-116693,-116648,-116603,-116558,-116513,-116468,-116423,-116378,-116333,-116288,-116243,-116198,-116153,-116108,-116063,-116017,-115972,-115927,-115882,-115837,-115792,-115747,-115702,-115657,-115612,-115566,-115521,-115476,-115431,-115386,-115341,-115296,-115251,-115205,-115160,-115115,-115070,-115025,-114980,-114934,-114889,-114844,-114799,-114754,-114709,-114663,-114618,-114573,-114528,-114482,-114437,-114392,-114347,-114302,-114256,-114211,-114166,-114121,-114075,-114030,-113985,-113940,-113894,-113849,-113804,-113758,-113713,-113668,-113623,-113577,-113532,-113487,-113441,-113396,-113351,-113305,-113260,-113215,-113169,-113124,-113079,-113033,-112988,-112943,-112897,-112852,-112807,-112761,-112716,-112670,-112625,-112580,-112534,-112489,-112443,-112398,-112353,-112307,-112262,-112216,-112171,-112125,-112080,-112035,-111989,-111944,-111898,-111853,-111807,-111762,-111716,-111671,-111625,-111580,-111534,-111489,-111443,-111398,-111352,-111307,-111261,-111216,-111170,-111125,-111079,-111034,-110988,-110943,-110897,-110852,-110806,-110761,-110715,-110669,-110624,-110578,-110533,-110487,-110442,-110396,-110350,-110305,-110259,-110214,-110168,-110122,-110077,-110031,-109985,-109940,-109894,-109849,-109803,-109757,-109712,-109666,-109620,-109575,-109529,-109483,-109438,-109392,-109346,-109301,-109255,-109209,-109164,-109118,-109072,-109026,-108981,-108935,-108889,-108844,-108798,-108752,-108706,-108661,-108615,-108569,-108523,-108478,-108432,-108386,-108340,-108294,-108249,-108203,-108157,-108111,-108066,-108020,-107974,-107928,-107882,-107837,-107791,-107745,-107699,-107653,-107607,-107562,-107516,-107470,-107424,-107378,-107332,-107286,-107241,-107195,-107149,-107103,-107057,-107011,-106965,-106919,-106874,-106828,-106782,-106736,-106690,-106644,-106598,-106552,-106506,-106460,-106414,-106368,-106322,-106277,-106231,-106185,-106139,-106093,-106047,-106001,-105955,-105909,-105863,-105817,-105771,-105725,-105679,-105633,-105587,-105541,-105495,-105449,-105403,-105357,-105311,-105265,-105219,-105173,-105127,-105081,-105034,-104988,-104942,-104896,-104850,-104804,-104758,-104712,-104666,-104620,-104574,-104528,-104482,-104435,-104389,-104343,-104297,-104251,-104205,-104159,-104113,-104066,-104020,-103974,-103928,-103882,-103836,-103790,-103743,-103697,-103651,-103605,-103559,-103513,-103466,-103420,-103374,-103328,-103282,-103235,-103189,-103143,-103097,-103051,-103004,-102958,-102912,-102866,-102819,-102773,-102727,-102681,-102634,-102588,-102542,-102496,-102449,-102403,-102357,-102311,-102264,-102218,-102172,-102125,-102079,-102033,-101987,-101940,-101894,-101848,-101801,-101755,-101709,-101662,-101616,-101570,-101523,-101477,-101431,-101384,-101338,-101292,-101245,-101199,-101152,-101106,-101060,-101013,-100967,-100921,-100874,-100828,-100781,-100735,-100689,-100642,-100596,-100549,-100503,-100456,-100410,-100364,-100317,-100271,-100224,-100178,-100131,-100085,-100038,-99992,-99946,-99899,-99853,-99806,-99760,-99713,-99667,-99620,-99574,-99527,-99481,-99434,-99388,-99341,-99295,-99248,-99202,-99155,-99109,-99062,-99015,-98969,-98922,-98876,-98829,-98783,-98736,-98690,-98643,-98596,-98550,-98503,-98457,-98410,-98363,-98317,-98270,-98224,-98177,-98130,-98084,-98037,-97991,-97944,-97897,-97851,-97804,-97757,-97711,-97664,-97618,-97571,-97524,-97478,-97431,-97384,-97338,-97291,-97244,-97198,-97151,-97104,-97057,-97011,-96964,-96917,-96871,-96824,-96777,-96731,-96684,-96637,-96590,-96544,-96497,-96450,-96403,-96357,-96310,-96263,-96216,-96170,-96123,-96076,-96029,-95983,-95936,-95889,-95842,-95795,-95749,-95702,-95655,-95608,-95561,-95515,-95468,-95421,-95374,-95327,-95281,-95234,-95187,-95140,-95093,-95046,-95000,-94953,-94906,-94859,-94812,-94765,-94718,-94672,-94625,-94578,-94531,-94484,-94437,-94390,-94343,-94296,-94250,-94203,-94156,-94109,-94062,-94015,-93968,-93921,-93874,-93827,-93780,-93733,-93686,-93639,-93593,-93546,-93499,-93452,-93405,-93358,-93311,-93264,-93217,-93170,-93123,-93076,-93029,-92982,-92935,-92888,-92841,-92794,-92747,-92700,-92653,-92606,-92559,-92512,-92465,-92418,-92371,-92324,-92277,-92229,-92182,-92135,-92088,-92041,-91994,-91947,-91900,-91853,-91806,-91759,-91712,-91665,-91618,-91570,-91523,-91476,-91429,-91382,-91335,-91288,-91241,-91194,-91146,-91099,-91052,-91005,-90958,-90911,-90864,-90816,-90769,-90722,-90675,-90628,-90581,-90533,-90486,-90439,-90392,-90345,-90298,-90250,-90203,-90156,-90109,-90062,-90014,-89967,-89920,-89873,-89825,-89778,-89731,-89684,-89637,-89589,-89542,-89495,-89448,-89400,-89353,-89306,-89259,-89211,-89164,-89117,-89069,-89022,-88975,-88928,-88880,-88833,-88786,-88738,-88691,-88644,-88597,-88549,-88502,-88455,-88407,-88360,-88313,-88265,-88218,-88171,-88123,-88076,-88029,-87981,-87934,-87887,-87839,-87792,-87744,-87697,-87650,-87602,-87555,-87508,-87460,-87413,-87365,-87318,-87271,-87223,-87176,-87128,-87081,-87034,-86986,-86939,-86891,-86844,-86797,-86749,-86702,-86654,-86607,-86559,-86512,-86464,-86417,-86370,-86322,-86275,-86227,-86180,-86132,-86085,-86037,-85990,-85942,-85895,-85847,-85800,-85752,-85705,-85657,-85610,-85562,-85515,-85467,-85420,-85372,-85325,-85277,-85230,-85182,-85135,-85087,-85039,-84992,-84944,-84897,-84849,-84802,-84754,-84707,-84659,-84611,-84564,-84516,-84469,-84421,-84373,-84326,-84278,-84231,-84183,-84135,-84088,-84040,-83993,-83945,-83897,-83850,-83802,-83755,-83707,-83659,-83612,-83564,-83516,-83469,-83421,-83373,-83326,-83278,-83230,-83183,-83135,-83087,-83040,-82992,-82944,-82897,-82849,-82801,-82754,-82706,-82658,-82611,-82563,-82515,-82467,-82420,-82372,-82324,-82277,-82229,-82181,-82133,-82086,-82038,-81990,-81942,-81895,-81847,-81799,-81751,-81704,-81656,-81608,-81560,-81513,-81465,-81417,-81369,-81321,-81274,-81226,-81178,-81130,-81082,-81035,-80987,-80939,-80891,-80843,-80796,-80748,-80700,-80652,-80604,-80556,-80509,-80461,-80413,-80365,-80317,-80269,-80222,-80174,-80126,-80078,-80030,-79982,-79934,-79886,-79839,-79791,-79743,-79695,-79647,-79599,-79551,-79503,-79456,-79408,-79360,-79312,-79264,-79216,-79168,-79120,-79072,-79024,-78976,-78928,-78880,-78833,-78785,-78737,-78689,-78641,-78593,-78545,-78497,-78449,-78401,-78353,-78305,-78257,-78209,-78161,-78113,-78065,-78017,-77969,-77921,-77873,-77825,-77777,-77729,-77681,-77633,-77585,-77537,-77489,-77441,-77393,-77345,-77297,-77249,-77201,-77153,-77105,-77057,-77009,-76961,-76913,-76865,-76817,-76769,-76720,-76672,-76624,-76576,-76528,-76480,-76432,-76384,-76336,-76288,-76240,-76192,-76143,-76095,-76047,-75999,-75951,-75903,-75855,-75807,-75759,-75710,-75662,-75614,-75566,-75518,-75470,-75422,-75374,-75325,-75277,-75229,-75181,-75133,-75085,-75036,-74988,-74940,-74892,-74844,-74796,-74747,-74699,-74651,-74603,-74555,-74507,-74458,-74410,-74362,-74314,-74266,-74217,-74169,-74121,-74073,-74024,-73976,-73928,-73880,-73832,-73783,-73735,-73687,-73639,-73590,-73542,-73494,-73446,-73397,-73349,-73301,-73253,-73204,-73156,-73108,-73060,-73011,-72963,-72915,-72866,-72818,-72770,-72722,-72673,-72625,-72577,-72528,-72480,-72432,-72383,-72335,-72287,-72238,-72190,-72142,-72094,-72045,-71997,-71949,-71900,-71852,-71804,-71755,-71707,-71658,-71610,-71562,-71513,-71465,-71417,-71368,-71320,-71272,-71223,-71175,-71126,-71078,-71030,-70981,-70933,-70885,-70836,-70788,-70739,-70691,-70643,-70594,-70546,-70497,-70449,-70400,-70352,-70304,-70255,-70207,-70158,-70110,-70061,-70013,-69965,-69916,-69868,-69819,-69771,-69722,-69674,-69625,-69577,-69529,-69480,-69432,-69383,-69335,-69286,-69238,-69189,-69141,-69092,-69044,-68995,-68947,-68898,-68850,-68801,-68753,-68704,-68656,-68607,-68559,-68510,-68462,-68413,-68365,-68316,-68268,-68219,-68170,-68122,-68073,-68025,-67976,-67928,-67879,-67831,-67782,-67734,-67685,-67636,-67588,-67539,-67491,-67442,-67394,-67345,-67296,-67248,-67199,-67151,-67102,-67054,-67005,-66956,-66908,-66859,-66811,-66762,-66713,-66665,-66616,-66567,-66519,-66470,-66422,-66373,-66324,-66276,-66227,-66178,-66130,-66081,-66033,-65984,-65935,-65887,-65838,-65789,-65741,-65692,-65643,-65595,-65546,-65497,-65449,-65400,-65351,-65303,-65254,-65205,-65157,-65108,-65059,-65010,-64962,-64913,-64864,-64816,-64767,-64718,-64670,-64621,-64572,-64523,-64475,-64426,-64377,-64328,-64280,-64231,-64182,-64134,-64085,-64036,-63987,-63939,-63890,-63841,-63792,-63744,-63695,-63646,-63597,-63549,-63500,-63451,-63402,-63353,-63305,-63256,-63207,-63158,-63110,-63061,-63012,-62963,-62914,-62866,-62817,-62768,-62719,-62670,-62622,-62573,-62524,-62475,-62426,-62377,-62329,-62280,-62231,-62182,-62133,-62084,-62036,-61987,-61938,-61889,-61840,-61791,-61743,-61694,-61645,-61596,-61547,-61498,-61449,-61401,-61352,-61303,-61254,-61205,-61156,-61107,-61058,-61010,-60961,-60912,-60863,-60814,-60765,-60716,-60667,-60618,-60569,-60521,-60472,-60423,-60374,-60325,-60276,-60227,-60178,-60129,-60080,-60031,-59982,-59934,-59885,-59836,-59787,-59738,-59689,-59640,-59591,-59542,-59493,-59444,-59395,-59346,-59297,-59248,-59199,-59150,-59101,-59052,-59003,-58954,-58905,-58856,-58807,-58758,-58710,-58661,-58612,-58563,-58514,-58465,-58416,-58367,-58318,-58269,-58220,-58170,-58121,-58072,-58023,-57974,-57925,-57876,-57827,-57778,-57729,-57680,-57631,-57582,-57533,-57484,-57435,-57386,-57337,-57288,-57239,-57190,-57141,-57092,-57043,-56994,-56945,-56895,-56846,-56797,-56748,-56699,-56650,-56601,-56552,-56503,-56454,-56405,-56356,-56307,-56257,-56208,-56159,-56110,-56061,-56012,-55963,-55914,-55865,-55815,-55766,-55717,-55668,-55619,-55570,-55521,-55472,-55423,-55373,-55324,-55275,-55226,-55177,-55128,-55079,-55029,-54980,-54931,-54882,-54833,-54784,-54735,-54685,-54636,-54587,-54538,-54489,-54440,-54390,-54341,-54292,-54243,-54194,-54144,-54095,-54046,-53997,-53948,-53899,-53849,-53800,-53751,-53702,-53653,-53603,-53554,-53505,-53456,-53407,-53357,-53308,-53259,-53210,-53160,-53111,-53062,-53013,-52964,-52914,-52865,-52816,-52767,-52717,-52668,-52619,-52570,-52520,-52471,-52422,-52373,-52323,-52274,-52225,-52176,-52126,-52077,-52028,-51979,-51929,-51880,-51831,-51781,-51732,-51683,-51634,-51584,-51535,-51486,-51437,-51387,-51338,-51289,-51239,-51190,-51141,-51091,-51042,-50993,-50944,-50894,-50845,-50796,-50746,-50697,-50648,-50598,-50549,-50500,-50450,-50401,-50352,-50302,-50253,-50204,-50154,-50105,-50056,-50006,-49957,-49908,-49858,-49809,-49760,-49710,-49661,-49612,-49562,-49513,-49463,-49414,-49365,-49315,-49266,-49217,-49167,-49118,-49069,-49019,-48970,-48920,-48871,-48822,-48772,-48723,-48673,-48624,-48575,-48525,-48476,-48426,-48377,-48328,-48278,-48229,-48179,-48130,-48081,-48031,-47982,-47932,-47883,-47834,-47784,-47735,-47685,-47636,-47586,-47537,-47488,-47438,-47389,-47339,-47290,-47240,-47191,-47141,-47092,-47043,-46993,-46944,-46894,-46845,-46795,-46746,-46696,-46647,-46597,-46548,-46499,-46449,-46400,-46350,-46301,-46251,-46202,-46152,-46103,-46053,-46004,-45954,-45905,-45855,-45806,-45756,-45707,-45657,-45608,-45558,-45509,-45459,-45410,-45360,-45311,-45261,-45212,-45162,-45113,-45063,-45014,-44964,-44915,-44865,-44816,-44766,-44717,-44667,-44618,-44568,-44518,-44469,-44419,-44370,-44320,-44271,-44221,-44172,-44122,-44073,-44023,-43973,-43924,-43874,-43825,-43775,-43726,-43676,-43627,-43577,-43527,-43478,-43428,-43379,-43329,-43280,-43230,-43180,-43131,-43081,-43032,-42982,-42932,-42883,-42833,-42784,-42734,-42685,-42635,-42585,-42536,-42486,-42437,-42387,-42337,-42288,-42238,-42189,-42139,-42089,-42040,-41990,-41940,-41891,-41841,-41792,-41742,-41692,-41643,-41593,-41543,-41494,-41444,-41395,-41345,-41295,-41246,-41196,-41146,-41097,-41047,-40997,-40948,-40898,-40848,-40799,-40749,-40700,-40650,-40600,-40551,-40501,-40451,-40402,-40352,-40302,-40253,-40203,-40153,-40104,-40054,-40004,-39955,-39905,-39855,-39805,-39756,-39706,-39656,-39607,-39557,-39507,-39458,-39408,-39358,-39309,-39259,-39209,-39159,-39110,-39060,-39010,-38961,-38911,-38861,-38812,-38762,-38712,-38662,-38613,-38563,-38513,-38464,-38414,-38364,-38314,-38265,-38215,-38165,-38115,-38066,-38016,-37966,-37916,-37867,-37817,-37767,-37718,-37668,-37618,-37568,-37519,-37469,-37419,-37369,-37320,-37270,-37220,-37170,-37121,-37071,-37021,-36971,-36921,-36872,-36822,-36772,-36722,-36673,-36623,-36573,-36523,-36474,-36424,-36374,-36324,-36274,-36225,-36175,-36125,-36075,-36026,-35976,-35926,-35876,-35826,-35777,-35727,-35677,-35627,-35577,-35528,-35478,-35428,-35378,-35328,-35279,-35229,-35179,-35129,-35079,-35029,-34980,-34930,-34880,-34830,-34780,-34731,-34681,-34631,-34581,-34531,-34481,-34432,-34382,-34332,-34282,-34232,-34182,-34133,-34083,-34033,-33983,-33933,-33883,-33834,-33784,-33734,-33684,-33634,-33584,-33534,-33485,-33435,-33385,-33335,-33285,-33235,-33185,-33136,-33086,-33036,-32986,-32936,-32886,-32836,-32787,-32737,-32687,-32637,-32587,-32537,-32487,-32437,-32388,-32338,-32288,-32238,-32188,-32138,-32088,-32038,-31988,-31939,-31889,-31839,-31789,-31739,-31689,-31639,-31589,-31539,-31489,-31440,-31390,-31340,-31290,-31240,-31190,-31140,-31090,-31040,-30990,-30941,-30891,-30841,-30791,-30741,-30691,-30641,-30591,-30541,-30491,-30441,-30391,-30341,-30292,-30242,-30192,-30142,-30092,-30042,-29992,-29942,-29892,-29842,-29792,-29742,-29692,-29642,-29592,-29542,-29493,-29443,-29393,-29343,-29293,-29243,-29193,-29143,-29093,-29043,-28993,-28943,-28893,-28843,-28793,-28743,-28693,-28643,-28593,-28543,-28493,-28443,-28393,-28343,-28294,-28244,-28194,-28144,-28094,-28044,-27994,-27944,-27894,-27844,-27794,-27744,-27694,-27644,-27594,-27544,-27494,-27444,-27394,-27344,-27294,-27244,-27194,-27144,-27094,-27044,-26994,-26944,-26894,-26844,-26794,-26744,-26694,-26644,-26594,-26544,-26494,-26444,-26394,-26344,-26294,-26244,-26194,-26144,-26094,-26044,-25994,-25944,-25894,-25844,-25794,-25744,-25694,-25644,-25594,-25544,-25494,-25443,-25393,-25343,-25293,-25243,-25193,-25143,-25093,-25043,-24993,-24943,-24893,-24843,-24793,-24743,-24693,-24643,-24593,-24543,-24493,-24443,-24393,-24343,-24293,-24243,-24192,-24142,-24092,-24042,-23992,-23942,-23892,-23842,-23792,-23742,-23692,-23642,-23592,-23542,-23492,-23442,-23392,-23341,-23291,-23241,-23191,-23141,-23091,-23041,-22991,-22941,-22891,-22841,-22791,-22741,-22691,-22640,-22590,-22540,-22490,-22440,-22390,-22340,-22290,-22240,-22190,-22140,-22090,-22039,-21989,-21939,-21889,-21839,-21789,-21739,-21689,-21639,-21589,-21539,-21488,-21438,-21388,-21338,-21288,-21238,-21188,-21138,-21088,-21038,-20987,-20937,-20887,-20837,-20787,-20737,-20687,-20637,-20587,-20537,-20486,-20436,-20386,-20336,-20286,-20236,-20186,-20136,-20085,-20035,-19985,-19935,-19885,-19835,-19785,-19735,-19685,-19634,-19584,-19534,-19484,-19434,-19384,-19334,-19284,-19233,-19183,-19133,-19083,-19033,-18983,-18933,-18882,-18832,-18782,-18732,-18682,-18632,-18582,-18531,-18481,-18431,-18381,-18331,-18281,-18231,-18180,-18130,-18080,-18030,-17980,-17930,-17880,-17829,-17779,-17729,-17679,-17629,-17579,-17529,-17478,-17428,-17378,-17328,-17278,-17228,-17177,-17127,-17077,-17027,-16977,-16927,-16877,-16826,-16776,-16726,-16676,-16626,-16576,-16525,-16475,-16425,-16375,-16325,-16275,-16224,-16174,-16124,-16074,-16024,-15974,-15923,-15873,-15823,-15773,-15723,-15672,-15622,-15572,-15522,-15472,-15422,-15371,-15321,-15271,-15221,-15171,-15121,-15070,-15020,-14970,-14920,-14870,-14819,-14769,-14719,-14669,-14619,-14568,-14518,-14468,-14418,-14368,-14318,-14267,-14217,-14167,-14117,-14067,-14016,-13966,-13916,-13866,-13816,-13765,-13715,-13665,-13615,-13565,-13514,-13464,-13414,-13364,-13314,-13263,-13213,-13163,-13113,-13063,-13012,-12962,-12912,-12862,-12812,-12761,-12711,-12661,-12611,-12561,-12510,-12460,-12410,-12360,-12310,-12259,-12209,-12159,-12109,-12058,-12008,-11958,-11908,-11858,-11807,-11757,-11707,-11657,-11607,-11556,-11506,-11456,-11406,-11355,-11305,-11255,-11205,-11155,-11104,-11054,-11004,-10954,-10903,-10853,-10803,-10753,-10703,-10652,-10602,-10552,-10502,-10451,-10401,-10351,-10301,-10251,-10200,-10150,-10100,-10050,-9999,-9949,-9899,-9849,-9798,-9748,-9698,-9648,-9598,-9547,-9497,-9447,-9397,-9346,-9296,-9246,-9196,-9145,-9095,-9045,-8995,-8945,-8894,-8844,-8794,-8744,-8693,-8643,-8593,-8543,-8492,-8442,-8392,-8342,-8291,-8241,-8191,-8141,-8090,-8040,-7990,-7940,-7889,-7839,-7789,-7739,-7689,-7638,-7588,-7538,-7488,-7437,-7387,-7337,-7287,-7236,-7186,-7136,-7086,-7035,-6985,-6935,-6885,-6834,-6784,-6734,-6684,-6633,-6583,-6533,-6483,-6432,-6382,-6332,-6282,-6231,-6181,-6131,-6081,-6030,-5980,-5930,-5880,-5829,-5779,-5729,-5679,-5628,-5578,-5528,-5478,-5427,-5377,-5327,-5277,-5226,-5176,-5126,-5075,-5025,-4975,-4925,-4874,-4824,-4774,-4724,-4673,-4623,-4573,-4523,-4472,-4422,-4372,-4322,-4271,-4221,-4171,-4121,-4070,-4020,-3970,-3920,-3869,-3819,-3769,-3719,-3668,-3618,-3568,-3517,-3467,-3417,-3367,-3316,-3266,-3216,-3166,-3115,-3065,-3015,-2965,-2914,-2864,-2814,-2764,-2713,-2663,-2613,-2562,-2512,-2462,-2412,-2361,-2311,-2261,-2211,-2160,-2110,-2060,-2010,-1959,-1909,-1859,-1809,-1758,-1708,-1658,-1607,-1557,-1507,-1457,-1406,-1356,-1306,-1256,-1205,-1155,-1105,-1055,-1004,-954,-904,-854,-803,-753,-703,-652,-602,-552,-502,-451,-401,-351,-301,-250,-200,-150,-100,-49,0,50,101,151,201,251,302,352,402,452,503,553,603,653,704,754,804,855,905,955,1005,1056,1106,1156,1206,1257,1307,1357,1407,1458,1508,1558,1608,1659,1709,1759,1810,1860,1910,1960,2011,2061,2111,2161,2212,2262,2312,2362,2413,2463,2513,2563,2614,2664,2714,2765,2815,2865,2915,2966,3016,3066,3116,3167,3217,3267,3317,3368,3418,3468,3518,3569,3619,3669,3720,3770,3820,3870,3921,3971,4021,4071,4122,4172,4222,4272,4323,4373,4423,4473,4524,4574,4624,4674,4725,4775,4825,4875,4926,4976,5026,5076,5127,5177,5227,5278,5328,5378,5428,5479,5529,5579,5629,5680,5730,5780,5830,5881,5931,5981,6031,6082,6132,6182,6232,6283,6333,6383,6433,6484,6534,6584,6634,6685,6735,6785,6835,6886,6936,6986,7036,7087,7137,7187,7237,7288,7338,7388,7438,7489,7539,7589,7639,7690,7740,7790,7840,7890,7941,7991,8041,8091,8142,8192,8242,8292,8343,8393,8443,8493,8544,8594,8644,8694,8745,8795,8845,8895,8946,8996,9046,9096,9146,9197,9247,9297,9347,9398,9448,9498,9548,9599,9649,9699,9749,9799,9850,9900,9950,10000,10051,10101,10151,10201,10252,10302,10352,10402,10452,10503,10553,10603,10653,10704,10754,10804,10854,10904,10955,11005,11055,11105,11156,11206,11256,11306,11356,11407,11457,11507,11557,11608,11658,11708,11758,11808,11859,11909,11959,12009,12059,12110,12160,12210,12260,12311,12361,12411,12461,12511,12562,12612,12662,12712,12762,12813,12863,12913,12963,13013,13064,13114,13164,13214,13264,13315,13365,13415,13465,13515,13566,13616,13666,13716,13766,13817,13867,13917,13967,14017,14068,14118,14168,14218,14268,14319,14369,14419,14469,14519,14569,14620,14670,14720,14770,14820,14871,14921,14971,15021,15071,15122,15172,15222,15272,15322,15372,15423,15473,15523,15573,15623,15673,15724,15774,15824,15874,15924,15975,16025,16075,16125,16175,16225,16276,16326,16376,16426,16476,16526,16577,16627,16677,16727,16777,16827,16878,16928,16978,17028,17078,17128,17178,17229,17279,17329,17379,17429,17479,17530,17580,17630,17680,17730,17780,17830,17881,17931,17981,18031,18081,18131,18181,18232,18282,18332,18382,18432,18482,18532,18583,18633,18683,18733,18783,18833,18883,18934,18984,19034,19084,19134,19184,19234,19285,19335,19385,19435,19485,19535,19585,19635,19686,19736,19786,19836,19886,19936,19986,20036,20086,20137,20187,20237,20287,20337,20387,20437,20487,20538,20588,20638,20688,20738,20788,20838,20888,20938,20988,21039,21089,21139,21189,21239,21289,21339,21389,21439,21489,21540,21590,21640,21690,21740,21790,21840,21890,21940,21990,22040,22091,22141,22191,22241,22291,22341,22391,22441,22491,22541,22591,22641,22692,22742,22792,22842,22892,22942,22992,23042,23092,23142,23192,23242,23292,23342,23393,23443,23493,23543,23593,23643,23693,23743,23793,23843,23893,23943,23993,24043,24093,24143,24193,24244,24294,24344,24394,24444,24494,24544,24594,24644,24694,24744,24794,24844,24894,24944,24994,25044,25094,25144,25194,25244,25294,25344,25394,25444,25495,25545,25595,25645,25695,25745,25795,25845,25895,25945,25995,26045,26095,26145,26195,26245,26295,26345,26395,26445,26495,26545,26595,26645,26695,26745,26795,26845,26895,26945,26995,27045,27095,27145,27195,27245,27295,27345,27395,27445,27495,27545,27595,27645,27695,27745,27795,27845,27895,27945,27995,28045,28095,28145,28195,28245,28295,28344,28394,28444,28494,28544,28594,28644,28694,28744,28794,28844,28894,28944,28994,29044,29094,29144,29194,29244,29294,29344,29394,29444,29494,29543,29593,29643,29693,29743,29793,29843,29893,29943,29993,30043,30093,30143,30193,30243,30293,30342,30392,30442,30492,30542,30592,30642,30692,30742,30792,30842,30892,30942,30991,31041,31091,31141,31191,31241,31291,31341,31391,31441,31490,31540,31590,31640,31690,31740,31790,31840,31890,31940,31989,32039,32089,32139,32189,32239,32289,32339,32389,32438,32488,32538,32588,32638,32688,32738,32788,32837,32887,32937,32987,33037,33087,33137,33186,33236,33286,33336,33386,33436,33486,33535,33585,33635,33685,33735,33785,33835,33884,33934,33984,34034,34084,34134,34183,34233,34283,34333,34383,34433,34482,34532,34582,34632,34682,34732,34781,34831,34881,34931,34981,35030,35080,35130,35180,35230,35280,35329,35379,35429,35479,35529,35578,35628,35678,35728,35778,35827,35877,35927,35977,36027,36076,36126,36176,36226,36275,36325,36375,36425,36475,36524,36574,36624,36674,36723,36773,36823,36873,36922,36972,37022,37072,37122,37171,37221,37271,37321,37370,37420,37470,37520,37569,37619,37669,37719,37768,37818,37868,37917,37967,38017,38067,38116,38166,38216,38266,38315,38365,38415,38465,38514,38564,38614,38663,38713,38763,38813,38862,38912,38962,39011,39061,39111,39160,39210,39260,39310,39359,39409,39459,39508,39558,39608,39657,39707,39757,39806,39856,39906,39956,40005,40055,40105,40154,40204,40254,40303,40353,40403,40452,40502,40552,40601,40651,40701,40750,40800,40849,40899,40949,40998,41048,41098,41147,41197,41247,41296,41346,41396,41445,41495,41544,41594,41644,41693,41743,41793,41842,41892,41941,41991,42041,42090,42140,42190,42239,42289,42338,42388,42438,42487,42537,42586,42636,42686,42735,42785,42834,42884,42933,42983,43033,43082,43132,43181,43231,43281,43330,43380,43429,43479,43528,43578,43628,43677,43727,43776,43826,43875,43925,43974,44024,44074,44123,44173,44222,44272,44321,44371,44420,44470,44519,44569,44619,44668,44718,44767,44817,44866,44916,44965,45015,45064,45114,45163,45213,45262,45312,45361,45411,45460,45510,45559,45609,45658,45708,45757,45807,45856,45906,45955,46005,46054,46104,46153,46203,46252,46302,46351,46401,46450,46500,46549,46598,46648,46697,46747,46796,46846,46895,46945,46994,47044,47093,47142,47192,47241,47291,47340,47390,47439,47489,47538,47587,47637,47686,47736,47785,47835,47884,47933,47983,48032,48082,48131,48180,48230,48279,48329,48378,48427,48477,48526,48576,48625,48674,48724,48773,48823,48872,48921,48971,49020,49070,49119,49168,49218,49267,49316,49366,49415,49464,49514,49563,49613,49662,49711,49761,49810,49859,49909,49958,50007,50057,50106,50155,50205,50254,50303,50353,50402,50451,50501,50550,50599,50649,50698,50747,50797,50846,50895,50945,50994,51043,51092,51142,51191,51240,51290,51339,51388,51438,51487,51536,51585,51635,51684,51733,51782,51832,51881,51930,51980,52029,52078,52127,52177,52226,52275,52324,52374,52423,52472,52521,52571,52620,52669,52718,52768,52817,52866,52915,52965,53014,53063,53112,53161,53211,53260,53309,53358,53408,53457,53506,53555,53604,53654,53703,53752,53801,53850,53900,53949,53998,54047,54096,54145,54195,54244,54293,54342,54391,54441,54490,54539,54588,54637,54686,54736,54785,54834,54883,54932,54981,55030,55080,55129,55178,55227,55276,55325,55374,55424,55473,55522,55571,55620,55669,55718,55767,55816,55866,55915,55964,56013,56062,56111,56160,56209,56258,56308,56357,56406,56455,56504,56553,56602,56651,56700,56749,56798,56847,56896,56946,56995,57044,57093,57142,57191,57240,57289,57338,57387,57436,57485,57534,57583,57632,57681,57730,57779,57828,57877,57926,57975,58024,58073,58122,58171,58221,58270,58319,58368,58417,58466,58515,58564,58613,58662,58711,58759,58808,58857,58906,58955,59004,59053,59102,59151,59200,59249,59298,59347,59396,59445,59494,59543,59592,59641,59690,59739,59788,59837,59886,59935,59983,60032,60081,60130,60179,60228,60277,60326,60375,60424,60473,60522,60570,60619,60668,60717,60766,60815,60864,60913,60962,61011,61059,61108,61157,61206,61255,61304,61353,61402,61450,61499,61548,61597,61646,61695,61744,61792,61841,61890,61939,61988,62037,62085,62134,62183,62232,62281,62330,62378,62427,62476,62525,62574,62623,62671,62720,62769,62818,62867,62915,62964,63013,63062,63111,63159,63208,63257,63306,63354,63403,63452,63501,63550,63598,63647,63696,63745,63793,63842,63891,63940,63988,64037,64086,64135,64183,64232,64281,64329,64378,64427,64476,64524,64573,64622,64671,64719,64768,64817,64865,64914,64963,65011,65060,65109,65158,65206,65255,65304,65352,65401,65450,65498,65547,65596,65644,65693,65742,65790,65839,65888,65936,65985,66034,66082,66131,66179,66228,66277,66325,66374,66423,66471,66520,66568,66617,66666,66714,66763,66812,66860,66909,66957,67006,67055,67103,67152,67200,67249,67297,67346,67395,67443,67492,67540,67589,67637,67686,67735,67783,67832,67880,67929,67977,68026,68074,68123,68171,68220,68269,68317,68366,68414,68463,68511,68560,68608,68657,68705,68754,68802,68851,68899,68948,68996,69045,69093,69142,69190,69239,69287,69336,69384,69433,69481,69530,69578,69626,69675,69723,69772,69820,69869,69917,69966,70014,70062,70111,70159,70208,70256,70305,70353,70401,70450,70498,70547,70595,70644,70692,70740,70789,70837,70886,70934,70982,71031,71079,71127,71176,71224,71273,71321,71369,71418,71466,71514,71563,71611,71659,71708,71756,71805,71853,71901,71950,71998,72046,72095,72143,72191,72239,72288,72336,72384,72433,72481,72529,72578,72626,72674,72723,72771,72819,72867,72916,72964,73012,73061,73109,73157,73205,73254,73302,73350,73398,73447,73495,73543,73591,73640,73688,73736,73784,73833,73881,73929,73977,74025,74074,74122,74170,74218,74267,74315,74363,74411,74459,74508,74556,74604,74652,74700,74748,74797,74845,74893,74941,74989,75037,75086,75134,75182,75230,75278,75326,75375,75423,75471,75519,75567,75615,75663,75711,75760,75808,75856,75904,75952,76000,76048,76096,76144,76193,76241,76289,76337,76385,76433,76481,76529,76577,76625,76673,76721,76770,76818,76866,76914,76962,77010,77058,77106,77154,77202,77250,77298,77346,77394,77442,77490,77538,77586,77634,77682,77730,77778,77826,77874,77922,77970,78018,78066,78114,78162,78210,78258,78306,78354,78402,78450,78498,78546,78594,78642,78690,78738,78786,78834,78881,78929,78977,79025,79073,79121,79169,79217,79265,79313,79361,79409,79457,79504,79552,79600,79648,79696,79744,79792,79840,79887,79935,79983,80031,80079,80127,80175,80223,80270,80318,80366,80414,80462,80510,80557,80605,80653,80701,80749,80797,80844,80892,80940,80988,81036,81083,81131,81179,81227,81275,81322,81370,81418,81466,81514,81561,81609,81657,81705,81752,81800,81848,81896,81943,81991,82039,82087,82134,82182,82230,82278,82325,82373,82421,82468,82516,82564,82612,82659,82707,82755,82802,82850,82898,82945,82993,83041,83088,83136,83184,83231,83279,83327,83374,83422,83470,83517,83565,83613,83660,83708,83756,83803,83851,83898,83946,83994,84041,84089,84136,84184,84232,84279,84327,84374,84422,84470,84517,84565,84612,84660,84708,84755,84803,84850,84898,84945,84993,85040,85088,85136,85183,85231,85278,85326,85373,85421,85468,85516,85563,85611,85658,85706,85753,85801,85848,85896,85943,85991,86038,86086,86133,86181,86228,86276,86323,86371,86418,86465,86513,86560,86608,86655,86703,86750,86798,86845,86892,86940,86987,87035,87082,87129,87177,87224,87272,87319,87366,87414,87461,87509,87556,87603,87651,87698,87745,87793,87840,87888,87935,87982,88030,88077,88124,88172,88219,88266,88314,88361,88408,88456,88503,88550,88598,88645,88692,88739,88787,88834,88881,88929,88976,89023,89070,89118,89165,89212,89260,89307,89354,89401,89449,89496,89543,89590,89638,89685,89732,89779,89826,89874,89921,89968,90015,90063,90110,90157,90204,90251,90299,90346,90393,90440,90487,90534,90582,90629,90676,90723,90770,90817,90865,90912,90959,91006,91053,91100,91147,91195,91242,91289,91336,91383,91430,91477,91524,91571,91619,91666,91713,91760,91807,91854,91901,91948,91995,92042,92089,92136,92183,92230,92278,92325,92372,92419,92466,92513,92560,92607,92654,92701,92748,92795,92842,92889,92936,92983,93030,93077,93124,93171,93218,93265,93312,93359,93406,93453,93500,93547,93594,93640,93687,93734,93781,93828,93875,93922,93969,94016,94063,94110,94157,94204,94251,94297,94344,94391,94438,94485,94532,94579,94626,94673,94719,94766,94813,94860,94907,94954,95001,95047,95094,95141,95188,95235,95282,95328,95375,95422,95469,95516,95562,95609,95656,95703,95750,95796,95843,95890,95937,95984,96030,96077,96124,96171,96217,96264,96311,96358,96404,96451,96498,96545,96591,96638,96685,96732,96778,96825,96872,96918,96965,97012,97058,97105,97152,97199,97245,97292,97339,97385,97432,97479,97525,97572,97619,97665,97712,97758,97805,97852,97898,97945,97992,98038,98085,98131,98178,98225,98271,98318,98364,98411,98458,98504,98551,98597,98644,98691,98737,98784,98830,98877,98923,98970,99016,99063,99110,99156,99203,99249,99296,99342,99389,99435,99482,99528,99575,99621,99668,99714,99761,99807,99854,99900,99947,99993,100039,100086,100132,100179,100225,100272,100318,100365,100411,100457,100504,100550,100597,100643,100690,100736,100782,100829,100875,100922,100968,101014,101061,101107,101153,101200,101246,101293,101339,101385,101432,101478,101524,101571,101617,101663,101710,101756,101802,101849,101895,101941,101988,102034,102080,102126,102173,102219,102265,102312,102358,102404,102450,102497,102543,102589,102635,102682,102728,102774,102820,102867,102913,102959,103005,103052,103098,103144,103190,103236,103283,103329,103375,103421,103467,103514,103560,103606,103652,103698,103744,103791,103837,103883,103929,103975,104021,104067,104114,104160,104206,104252,104298,104344,104390,104436,104483,104529,104575,104621,104667,104713,104759,104805,104851,104897,104943,104989,105035,105082,105128,105174,105220,105266,105312,105358,105404,105450,105496,105542,105588,105634,105680,105726,105772,105818,105864,105910,105956,106002,106048,106094,106140,106186,106232,106278,106323,106369,106415,106461,106507,106553,106599,106645,106691,106737,106783,106829,106875,106920,106966,107012,107058,107104,107150,107196,107242,107287,107333,107379,107425,107471,107517,107563,107608,107654,107700,107746,107792,107838,107883,107929,107975,108021,108067,108112,108158,108204,108250,108295,108341,108387,108433,108479,108524,108570,108616,108662,108707,108753,108799,108845,108890,108936,108982,109027,109073,109119,109165,109210,109256,109302,109347,109393,109439,109484,109530,109576,109621,109667,109713,109758,109804,109850,109895,109941,109986,110032,110078,110123,110169,110215,110260,110306,110351,110397,110443,110488,110534,110579,110625,110670,110716,110762,110807,110853,110898,110944,110989,111035,111080,111126,111171,111217,111262,111308,111353,111399,111444,111490,111535,111581,111626,111672,111717,111763,111808,111854,111899,111945,111990,112036,112081,112126,112172,112217,112263,112308,112354,112399,112444,112490,112535,112581,112626,112671,112717,112762,112808,112853,112898,112944,112989,113034,113080,113125,113170,113216,113261,113306,113352,113397,113442,113488,113533,113578,113624,113669,113714,113759,113805,113850,113895,113941,113986,114031,114076,114122,114167,114212,114257,114303,114348,114393,114438,114483,114529,114574,114619,114664,114710,114755,114800,114845,114890,114935,114981,115026,115071,115116,115161,115206,115252,115297,115342,115387,115432,115477,115522,115567,115613,115658,115703,115748,115793,115838,115883,115928,115973,116018,116064,116109,116154,116199,116244,116289,116334,116379,116424,116469,116514,116559,116604,116649,116694,116739,116784,116829,116874,116919,116964,117009,117054,117099,117144,117189,117234,117279,117324,117369,117414,117459,117504,117549,117593,117638,117683,117728,117773,117818,117863,117908,117953,117998,118042,118087,118132,118177,118222,118267,118312,118357,118401,118446,118491,118536,118581,118626,118670,118715,118760,118805,118850,118894,118939,118984,119029,119074,119118,119163,119208,119253,119297,119342,119387,119432,119476,119521,119566,119611,119655,119700,119745,119790,119834,119879,119924,119968,120013,120058,120102,120147,120192,120236,120281,120326,120370,120415,120460,120504,120549,120594,120638,120683,120727,120772,120817,120861,120906,120950,120995,121040,121084,121129,121173,121218,121263,121307,121352,121396,121441,121485,121530,121574,121619,121663,121708,121752,121797,121842,121886,121931,121975,122019,122064,122108,122153,122197,122242,122286,122331,122375,122420,122464,122509,122553,122597,122642,122686,122731,122775,122820,122864,122908,122953,122997,123042,123086,123130,123175,123219,123263,123308,123352,123396,123441,123485,123529,123574,123618,123662,123707,123751,123795,123840,123884,123928,123973,124017,124061,124105,124150,124194,124238,124283,124327,124371,124415,124460,124504,124548,124592,124636,124681,124725,124769,124813,124857,124902,124946,124990,125034,125078,125123,125167,125211,125255,125299,125343,125388,125432,125476,125520,125564,125608,125652,125696,125741,125785,125829,125873,125917,125961,126005,126049,126093,126137,126181,126225,126269,126314,126358,126402,126446,126490,126534,126578,126622,126666,126710,126754,126798,126842,126886,126930,126974,127018,127062,127106,127150,127193,127237,127281,127325,127369,127413,127457,127501,127545,127589,127633,127677,127721,127764,127808,127852,127896,127940,127984,128028,128072,128115,128159,128203,128247,128291,128335,128378,128422,128466,128510,128554,128598,128641,128685,128729,128773,128816,128860,128904,128948,128992,129035,129079,129123,129167,129210,129254,129298,129341,129385,129429,129473,129516,129560,129604,129647,129691,129735,129778,129822,129866,129909,129953,129997,130040,130084,130128,130171,130215,130259,130302,130346,130389,130433,130477,130520,130564,130607,130651,130695,130738,130782,130825,130869,130912,130956,130999,131043,131087,131130,131174,131217,131261,131304,131348,131391,131435,131478,131522,131565,131609,131652,131695,131739,131782,131826,131869,131913,131956,132000,132043,132086,132130,132173,132217,132260,132303,132347,132390,132434,132477,132520,132564,132607,132650,132694,132737,132780,132824,132867,132910,132954,132997,133040,133084,133127,133170,133214,133257,133300,133343,133387,133430,133473,133517,133560,133603,133646,133690,133733,133776,133819,133862,133906,133949,133992,134035,134078,134122,134165,134208,134251,134294,134338,134381,134424,134467,134510,134553,134596,134640,134683,134726,134769,134812,134855,134898,134941,134984,135028,135071,135114,135157,135200,135243,135286,135329,135372,135415,135458,135501,135544,135587,135630,135673,135716,135759,135802,135845,135888,135931,135974,136017,136060,136103,136146,136189,136232,136275,136318,136361,136404,136447,136490,136532,136575,136618,136661,136704,136747,136790,136833,136876,136918,136961,137004,137047,137090,137133,137176,137218,137261,137304,137347,137390,137432,137475,137518,137561,137604,137646,137689,137732,137775,137817,137860,137903,137946,137988,138031,138074,138117,138159,138202,138245,138288,138330,138373,138416,138458,138501,138544,138586,138629,138672,138714,138757,138800,138842,138885,138927,138970,139013,139055,139098,139141,139183,139226,139268,139311,139353,139396,139439,139481,139524,139566,139609,139651,139694,139736,139779,139821,139864,139907,139949,139992,140034,140077,140119,140161,140204,140246,140289,140331,140374,140416,140459,140501,140544,140586,140628,140671,140713,140756,140798,140840,140883,140925,140968,141010,141052,141095,141137,141179,141222,141264,141306,141349,141391,141433,141476,141518,141560,141603,141645,141687,141730,141772,141814,141856,141899,141941,141983,142025,142068,142110,142152,142194,142237,142279,142321,142363,142405,142448,142490,142532,142574,142616,142659,142701,142743,142785,142827,142869,142912,142954,142996,143038,143080,143122,143164,143206,143248,143291,143333,143375,143417,143459,143501,143543,143585,143627,143669,143711,143753,143795,143837,143879,143921,143963,144005,144047,144089,144131,144173,144215,144257,144299,144341,144383,144425,144467,144509,144551,144593,144635,144677,144719,144761,144802,144844,144886,144928,144970,145012,145054,145096,145137,145179,145221,145263,145305,145347,145389,145430,145472,145514,145556,145598,145639,145681,145723,145765,145807,145848,145890,145932,145974,146015,146057,146099,146141,146182,146224,146266,146307,146349,146391,146433,146474,146516,146558,146599,146641,146683,146724,146766,146808,146849,146891,146932,146974,147016,147057,147099,147141,147182,147224,147265,147307,147348,147390,147432,147473,147515,147556,147598,147639,147681,147722,147764,147805,147847,147888,147930,147971,148013,148054,148096,148137,148179,148220,148262,148303,148345,148386,148428,148469,148510,148552,148593,148635,148676,148717,148759,148800,148842,148883,148924,148966,149007,149048,149090,149131,149172,149214,149255,149296,149338,149379,149420,149462,149503,149544,149585,149627,149668,149709,149751,149792,149833,149874,149916,149957,149998,150039,150080,150122,150163,150204,150245,150286,150328,150369,150410,150451,150492,150533,150575,150616,150657,150698,150739,150780,150821,150862,150904,150945,150986,151027,151068,151109,151150,151191,151232,151273,151314,151355,151396,151437,151478,151519,151560,151601,151642,151683,151724,151765,151806,151847,151888,151929,151970,152011,152052,152093,152134,152175,152216,152257,152298,152339,152380,152421,152461,152502,152543,152584,152625,152666,152707,152748,152788,152829,152870,152911,152952,152993,153033,153074,153115,153156,153197,153237,153278,153319,153360,153400,153441,153482,153523,153563,153604,153645,153686,153726,153767,153808,153848,153889,153930,153970,154011,154052,154093,154133,154174,154214,154255,154296,154336,154377,154418,154458,154499,154539,154580,154621,154661,154702,154742,154783,154824,154864,154905,154945,154986,155026,155067,155107,155148,155188,155229,155269,155310,155350,155391,155431,155472,155512,155553,155593,155634,155674,155715,155755,155795,155836,155876,155917,155957,155997,156038,156078,156119,156159,156199,156240,156280,156320,156361,156401,156441,156482,156522,156562,156603,156643,156683,156724,156764,156804,156845,156885,156925,156965,157006,157046,157086,157126,157167,157207,157247,157287,157327,157368,157408,157448,157488,157528,157569,157609,157649,157689,157729,157769,157809,157850,157890,157930,157970,158010,158050,158090,158130,158170,158211,158251,158291,158331,158371,158411,158451,158491,158531,158571,158611,158651,158691,158731,158771,158811,158851,158891,158931,158971,159011,159051,159091,159131,159171,159211,159251,159291,159330,159370,159410,159450,159490,159530,159570,159610,159650,159689,159729,159769,159809,159849,159889,159929,159968,160008,160048,160088,160128,160167,160207,160247,160287,160327,160366,160406,160446,160486,160525,160565,160605,160644,160684,160724,160764,160803,160843,160883,160922,160962,161002,161041,161081,161121,161160,161200,161240,161279,161319,161359,161398,161438,161477,161517,161557,161596,161636,161675,161715,161754,161794,161833,161873,161913,161952,161992,162031,162071,162110,162150,162189,162229,162268,162308,162347,162386,162426,162465,162505,162544,162584,162623,162663,162702,162741,162781,162820,162860,162899,162938,162978,163017,163056,163096,163135,163174,163214,163253,163292,163332,163371,163410,163450,163489,163528,163568,163607,163646,163685,163725,163764,163803,163842,163882,163921,163960,163999,164039,164078,164117,164156,164195,164234,164274,164313,164352,164391,164430,164469,164509,164548,164587,164626,164665,164704,164743,164782,164821,164861,164900,164939,164978,165017,165056,165095,165134,165173,165212,165251,165290,165329,165368,165407,165446,165485,165524,165563,165602,165641,165680,165719,165758,165797,165836,165875,165914,165952,165991,166030,166069,166108,166147,166186,166225,166264,166302,166341,166380,166419,166458,166497,166535,166574,166613,166652,166691,166729,166768,166807,166846,166885,166923,166962,167001,167040,167078,167117,167156,167194,167233,167272,167311,167349,167388,167427,167465,167504,167543,167581,167620,167659,167697,167736,167774,167813,167852,167890,167929,167968,168006,168045,168083,168122,168160,168199,168238,168276,168315,168353,168392,168430,168469,168507,168546,168584,168623,168661,168700,168738,168777,168815,168853,168892,168930,168969,169007,169046,169084,169122,169161,169199,169238,169276,169314,169353,169391,169430,169468,169506,169545,169583,169621,169660,169698,169736,169774,169813,169851,169889,169928,169966,170004,170042,170081,170119,170157,170195,170234,170272,170310,170348,170386,170425,170463,170501,170539,170577,170616,170654,170692,170730,170768,170806,170844,170883,170921,170959,170997,171035,171073,171111,171149,171187,171225,171263,171301,171339,171378,171416,171454,171492,171530,171568,171606,171644,171682,171720,171758,171796,171834,171871,171909,171947,171985,172023,172061,172099,172137,172175,172213,172251,172289,172326,172364,172402,172440,172478,172516,172554,172591,172629,172667,172705,172743,172781,172818,172856,172894,172932,172969,173007,173045,173083,173121,173158,173196,173234,173271,173309,173347,173385,173422,173460,173498,173535,173573,173611,173648,173686,173724,173761,173799,173837,173874,173912,173949,173987,174025,174062,174100,174137,174175,174212,174250,174288,174325,174363,174400,174438,174475,174513,174550,174588,174625,174663,174700,174738,174775,174813,174850,174887,174925,174962,175000,175037,175075,175112,175149,175187,175224,175262,175299,175336,175374,175411,175448,175486,175523,175560,175598,175635,175672,175710,175747,175784,175822,175859,175896,175933,175971,176008,176045,176082,176120,176157,176194,176231,176268,176306,176343,176380,176417,176454,176492,176529,176566,176603,176640,176677,176714,176752,176789,176826,176863,176900,176937,176974,177011,177048,177085,177123,177160,177197,177234,177271,177308,177345,177382,177419,177456,177493,177530,177567,177604,177641,177678,177715,177752,177788,177825,177862,177899,177936,177973,178010,178047,178084,178121,178158,178194,178231,178268,178305,178342,178379,178415,178452,178489,178526,178563,178600,178636,178673,178710,178747,178783,178820,178857,178894,178930,178967,179004,179041,179077,179114,179151,179187,179224,179261,179297,179334,179371,179407,179444,179481,179517,179554,179591,179627,179664,179700,179737,179774,179810,179847,179883,179920,179956,179993,180029,180066,180103,180139,180176,180212,180249,180285,180322,180358,180395,180431,180467,180504,180540,180577,180613,180650,180686,180723,180759,180795,180832,180868,180904,180941,180977,181014,181050,181086,181123,181159,181195,181232,181268,181304,181341,181377,181413,181449,181486,181522,181558,181594,181631,181667,181703,181739,181776,181812,181848,181884,181920,181957,181993,182029,182065,182101,182137,182174,182210,182246,182282,182318,182354,182390,182426,182463,182499,182535,182571,182607,182643,182679,182715,182751,182787,182823,182859,182895,182931,182967,183003,183039,183075,183111,183147,183183,183219,183255,183291,183327,183363,183399,183435,183470,183506,183542,183578,183614,183650,183686,183722,183757,183793,183829,183865,183901,183937,183972,184008,184044,184080,184116,184151,184187,184223,184259,184294,184330,184366,184402,184437,184473,184509,184545,184580,184616,184652,184687,184723,184759,184794,184830,184866,184901,184937,184972,185008,185044,185079,185115,185150,185186,185222,185257,185293,185328,185364,185399,185435,185470,185506,185541,185577,185612,185648,185683,185719,185754,185790,185825,185861,185896,185932,185967,186002,186038,186073,186109,186144,186179,186215,186250,186286,186321,186356,186392,186427,186462,186498,186533,186568,186604,186639,186674,186710,186745,186780,186815,186851,186886,186921,186956,186992,187027,187062,187097,187132,187168,187203,187238,187273,187308,187343,187379,187414,187449,187484,187519,187554,187589,187625,187660,187695,187730,187765,187800,187835,187870,187905,187940,187975,188010,188045,188080,188115,188150,188185,188220,188255,188290,188325,188360,188395,188430,188465,188500,188535,188570,188605,188640,188675,188709,188744,188779,188814,188849,188884,188919,188954,188988,189023,189058,189093,189128,189162,189197,189232,189267,189302,189336,189371,189406,189441,189475,189510,189545,189580,189614,189649,189684,189718,189753,189788,189822,189857,189892,189926,189961,189996,190030,190065,190099,190134,190169,190203,190238,190272,190307,190342,190376,190411,190445,190480,190514,190549,190583,190618,190652,190687,190721,190756,190790,190825,190859,190894,190928,190963,190997,191031,191066,191100,191135,191169,191203,191238,191272,191307,191341,191375,191410,191444,191478,191513,191547,191581,191616,191650,191684,191718,191753,191787,191821,191856,191890,191924,191958,191992,192027,192061,192095,192129,192164,192198,192232,192266,192300,192334,192369,192403,192437,192471,192505,192539,192573,192607,192641,192676,192710,192744,192778,192812,192846,192880,192914,192948,192982,193016,193050,193084,193118,193152,193186,193220,193254,193288,193322,193356,193390,193424,193458,193492,193525,193559,193593,193627,193661,193695,193729,193763,193796,193830,193864,193898,193932,193966,193999,194033,194067,194101,194135,194168,194202,194236,194270,194303,194337,194371,194405,194438,194472,194506,194539,194573,194607,194640,194674,194708,194741,194775,194809,194842,194876,194910,194943,194977,195010,195044,195078,195111,195145,195178,195212,195245,195279,195312,195346,195379,195413,195446,195480,195513,195547,195580,195614,195647,195681,195714,195748,195781,195815,195848,195881,195915,195948,195982,196015,196048,196082,196115,196148,196182,196215,196248,196282,196315,196348,196382,196415,196448,196481,196515,196548,196581,196615,196648,196681,196714,196747,196781,196814,196847,196880,196913,196947,196980,197013,197046,197079,197112,197146,197179,197212,197245,197278,197311,197344,197377,197410,197443,197476,197510,197543,197576,197609,197642,197675,197708,197741,197774,197807,197840,197873,197906,197939,197972,198004,198037,198070,198103,198136,198169,198202,198235,198268,198301,198334,198366,198399,198432,198465,198498,198531,198563,198596,198629,198662,198695,198727,198760,198793,198826,198858,198891,198924,198957,198989,199022,199055,199088,199120,199153,199186,199218,199251,199284,199316,199349,199382,199414,199447,199479,199512,199545,199577,199610,199642,199675,199708,199740,199773,199805,199838,199870,199903,199935,199968,200000,200033,200065,200098,200130,200163,200195,200228,200260,200292,200325,200357,200390,200422,200454,200487,200519,200552,200584,200616,200649,200681,200713,200746,200778,200810,200843,200875,200907,200940,200972,201004,201036,201069,201101,201133,201165,201198,201230,201262,201294,201326,201359,201391,201423,201455,201487,201519,201552,201584,201616,201648,201680,201712,201744,201776,201808,201841,201873,201905,201937,201969,202001,202033,202065,202097,202129,202161,202193,202225,202257,202289,202321,202353,202385,202417,202449,202481,202512,202544,202576,202608,202640,202672,202704,202736,202768,202799,202831,202863,202895,202927,202959,202990,203022,203054,203086,203118,203149,203181,203213,203245,203276,203308,203340,203372,203403,203435,203467,203498,203530,203562,203593,203625,203657,203688,203720,203752,203783,203815,203846,203878,203910,203941,203973,204004,204036,204067,204099,204131,204162,204194,204225,204257,204288,204320,204351,204383,204414,204446,204477,204508,204540,204571,204603,204634,204666,204697,204728,204760,204791,204823,204854,204885,204917,204948,204979,205011,205042,205073,205105,205136,205167,205198,205230,205261,205292,205324,205355,205386,205417,205448,205480,205511,205542,205573,205604,205636,205667,205698,205729,205760,205791,205823,205854,205885,205916,205947,205978,206009,206040,206071,206102,206133,206165,206196,206227,206258,206289,206320,206351,206382,206413,206444,206475,206506,206537,206567,206598,206629,206660,206691,206722,206753,206784,206815,206846,206877,206907,206938,206969,207000,207031,207062,207092,207123,207154,207185,207216,207246,207277,207308,207339,207370,207400,207431,207462,207492,207523,207554,207585,207615,207646,207677,207707,207738,207769,207799,207830,207861,207891,207922,207952,207983,208014,208044,208075,208105,208136,208166,208197,208228,208258,208289,208319,208350,208380,208411,208441,208472,208502,208533,208563,208593,208624,208654,208685,208715,208746,208776,208806,208837,208867,208897,208928,208958,208989,209019,209049,209080,209110,209140,209170,209201,209231,209261,209292,209322,209352,209382,209413,209443,209473,209503,209534,209564,209594,209624,209654,209684,209715,209745,209775,209805,209835,209865,209895,209926,209956,209986,210016,210046,210076,210106,210136,210166,210196,210226,210256,210286,210316,210346,210376,210406,210436,210466,210496,210526,210556,210586,210616,210646,210676,210706,210736,210765,210795,210825,210855,210885,210915,210945,210974,211004,211034,211064,211094,211124,211153,211183,211213,211243,211272,211302,211332,211362,211391,211421,211451,211481,211510,211540,211570,211599,211629,211659,211688,211718,211748,211777,211807,211836,211866,211896,211925,211955,211984,212014,212043,212073,212103,212132,212162,212191,212221,212250,212280,212309,212339,212368,212398,212427,212456,212486,212515,212545,212574,212604,212633,212662,212692,212721,212751,212780,212809,212839,212868,212897,212927,212956,212985,213015,213044,213073,213102,213132,213161,213190,213219,213249,213278,213307,213336,213366,213395,213424,213453,213482,213511,213541,213570,213599,213628,213657,213686,213715,213745,213774,213803,213832,213861,213890,213919,213948,213977,214006,214035,214064,214093,214122,214151,214180,214209,214238,214267,214296,214325,214354,214383,214412,214441,214470,214498,214527,214556,214585,214614,214643,214672,214701,214729,214758,214787,214816,214845,214873,214902,214931,214960,214989,215017,215046,215075,215104,215132,215161,215190,215218,215247,215276,215304,215333,215362,215390,215419,215448,215476,215505,215534,215562,215591,215619,215648,215677,215705,215734,215762,215791,215819,215848,215876,215905,215933,215962,215990,216019,216047,216076,216104,216133,216161,216190,216218,216246,216275,216303,216332,216360,216388,216417,216445,216473,216502,216530,216558,216587,216615,216643,216672,216700,216728,216757,216785,216813,216841,216870,216898,216926,216954,216982,217011,217039,217067,217095,217123,217152,217180,217208,217236,217264,217292,217320,217348,217377,217405,217433,217461,217489,217517,217545,217573,217601,217629,217657,217685,217713,217741,217769,217797,217825,217853,217881,217909,217937,217965,217993,218021,218049,218076,218104,218132,218160,218188,218216,218244,218271,218299,218327,218355,218383,218411,218438,218466,218494,218522,218549,218577,218605,218633,218660,218688,218716,218744,218771,218799,218827,218854,218882,218910,218937,218965,218993,219020,219048,219075,219103,219131,219158,219186,219213,219241,219268,219296,219324,219351,219379,219406,219434,219461,219489,219516,219544,219571,219598,219626,219653,219681,219708,219736,219763,219790,219818,219845,219873,219900,219927,219955,219982,220009,220037,220064,220091,220119,220146,220173,220200,220228,220255,220282,220309,220337,220364,220391,220418,220446,220473,220500,220527,220554,220581,220609,220636,220663,220690,220717,220744,220771,220798,220826,220853,220880,220907,220934,220961,220988,221015,221042,221069,221096,221123,221150,221177,221204,221231,221258,221285,221312,221339,221366,221393,221419,221446,221473,221500,221527,221554,221581,221608,221634,221661,221688,221715,221742,221769,221795,221822,221849,221876,221903,221929,221956,221983,222010,222036,222063,222090,222116,222143,222170,222196,222223,222250,222276,222303,222330,222356,222383,222410,222436,222463,222489,222516,222542,222569,222596,222622,222649,222675,222702,222728,222755,222781,222808,222834,222861,222887,222914,222940,222966,222993,223019,223046,223072,223099,223125,223151,223178,223204,223230,223257,223283,223309,223336,223362,223388,223415,223441,223467,223493,223520,223546,223572,223599,223625,223651,223677,223703,223730,223756,223782,223808,223834,223860,223887,223913,223939,223965,223991,224017,224043,224069,224096,224122,224148,224174,224200,224226,224252,224278,224304,224330,224356,224382,224408,224434,224460,224486,224512,224538,224564,224590,224615,224641,224667,224693,224719,224745,224771,224797,224823,224848,224874,224900,224926,224952,224978,225003,225029,225055,225081,225106,225132,225158,225184,225209,225235,225261,225287,225312,225338,225364,225389,225415,225441,225466,225492,225517,225543,225569,225594,225620,225646,225671,225697,225722,225748,225773,225799,225824,225850,225875,225901,225926,225952,225977,226003,226028,226054,226079,226105,226130,226156,226181,226206,226232,226257,226283,226308,226333,226359,226384,226409,226435,226460,226485,226511,226536,226561,226586,226612,226637,226662,226688,226713,226738,226763,226788,226814,226839,226864,226889,226914,226940,226965,226990,227015,227040,227065,227090,227115,227141,227166,227191,227216,227241,227266,227291,227316,227341,227366,227391,227416,227441,227466,227491,227516,227541,227566,227591,227616,227641,227666,227691,227716,227740,227765,227790,227815,227840,227865,227890,227914,227939,227964,227989,228014,228039,228063,228088,228113,228138,228162,228187,228212,228237,228261,228286,228311,228335,228360,228385,228409,228434,228459,228483,228508,228533,228557,228582,228607,228631,228656,228680,228705,228729,228754,228779,228803,228828,228852,228877,228901,228926,228950,228975,228999,229024,229048,229072,229097,229121,229146,229170,229194,229219,229243,229268,229292,229316,229341,229365,229389,229414,229438,229462,229487,229511,229535,229560,229584,229608,229632,229657,229681,229705,229729,229753,229778,229802,229826,229850,229874,229898,229923,229947,229971,229995,230019,230043,230067,230091,230116,230140,230164,230188,230212,230236,230260,230284,230308,230332,230356,230380,230404,230428,230452,230476,230500,230524,230548,230571,230595,230619,230643,230667,230691,230715,230739,230762,230786,230810,230834,230858,230882,230905,230929,230953,230977,231001,231024,231048,231072,231096,231119,231143,231167,231190,231214,231238,231261,231285,231309,231332,231356,231380,231403,231427,231450,231474,231498,231521,231545,231568,231592,231615,231639,231663,231686,231710,231733,231757,231780,231804,231827,231850,231874,231897,231921,231944,231968,231991,232014,232038,232061,232085,232108,232131,232155,232178,232201,232225,232248,232271,232295,232318,232341,232364,232388,232411,232434,232457,232481,232504,232527,232550,232574,232597,232620,232643,232666,232689,232713,232736,232759,232782,232805,232828,232851,232874,232897,232920,232944,232967,232990,233013,233036,233059,233082,233105,233128,233151,233174,233197,233220,233243,233265,233288,233311,233334,233357,233380,233403,233426,233449,233472,233494,233517,233540,233563,233586,233609,233631,233654,233677,233700,233722,233745,233768,233791,233813,233836,233859,233882,233904,233927,233950,233972,233995,234018,234040,234063,234086,234108,234131,234153,234176,234199,234221,234244,234266,234289,234311,234334,234356,234379,234401,234424,234446,234469,234491,234514,234536,234559,234581,234604,234626,234649,234671,234693,234716,234738,234760,234783,234805,234828,234850,234872,234894,234917,234939,234961,234984,235006,235028,235050,235073,235095,235117,235139,235162,235184,235206,235228,235250,235273,235295,235317,235339,235361,235383,235405,235428,235450,235472,235494,235516,235538,235560,235582,235604,235626,235648,235670,235692,235714,235736,235758,235780,235802,235824,235846,235868,235890,235912,235934,235956,235978,235999,236021,236043,236065,236087,236109,236131,236152,236174,236196,236218,236240,236261,236283,236305,236327,236348,236370,236392,236414,236435,236457,236479,236500,236522,236544,236565,236587,236609,236630,236652,236674,236695,236717,236738,236760,236782,236803,236825,236846,236868,236889,236911,236932,236954,236975,236997,237018,237040,237061,237083,237104,237126,237147,237168,237190,237211,237233,237254,237275,237297,237318,237339,237361,237382,237403,237425,237446,237467,237489,237510,237531,237552,237574,237595,237616,237637,237659,237680,237701,237722,237743,237765,237786,237807,237828,237849,237870,237891,237913,237934,237955,237976,237997,238018,238039,238060,238081,238102,238123,238144,238165,238186,238207,238228,238249,238270,238291,238312,238333,238354,238375,238396,238417,238437,238458,238479,238500,238521,238542,238563,238583,238604,238625,238646,238667,238688,238708,238729,238750,238771,238791,238812,238833,238853,238874,238895,238916,238936,238957,238978,238998,239019,239040,239060,239081,239101,239122,239143,239163,239184,239204,239225,239245,239266,239287,239307,239328,239348,239369,239389,239410,239430,239450,239471,239491,239512,239532,239553,239573,239593,239614,239634,239655,239675,239695,239716,239736,239756,239777,239797,239817,239838,239858,239878,239898,239919,239939,239959,239979,240000,240020,240040,240060,240080,240101,240121,240141,240161,240181,240201,240221,240242,240262,240282,240302,240322,240342,240362,240382,240402,240422,240442,240462,240482,240502,240522,240542,240562,240582,240602,240622,240642,240662,240682,240702,240722,240742,240762,240781,240801,240821,240841,240861,240881,240901,240920,240940,240960,240980,241000,241019,241039,241059,241079,241098,241118,241138,241157,241177,241197,241217,241236,241256,241276,241295,241315,241334,241354,241374,241393,241413,241433,241452,241472,241491,241511,241530,241550,241569,241589,241608,241628,241647,241667,241686,241706,241725,241745,241764,241784,241803,241822,241842,241861,241881,241900,241919,241939,241958,241977,241997,242016,242035,242055,242074,242093,242112,242132,242151,242170,242189,242209,242228,242247,242266,242286,242305,242324,242343,242362,242381,242401,242420,242439,242458,242477,242496,242515,242534,242553,242572,242591,242611,242630,242649,242668,242687,242706,242725,242744,242763,242782,242800,242819,242838,242857,242876,242895,242914,242933,242952,242971,242990,243008,243027,243046,243065,243084,243103,243121,243140,243159,243178,243196,243215,243234,243253,243271,243290,243309,243328,243346,243365,243384,243402,243421,243440,243458,243477,243496,243514,243533,243551,243570,243588,243607,243626,243644,243663,243681,243700,243718,243737,243755,243774,243792,243811,243829,243848,243866,243885,243903,243921,243940,243958,243977,243995,244013,244032,244050,244068,244087,244105,244123,244142,244160,244178,244197,244215,244233,244251,244270,244288,244306,244324,244343,244361,244379,244397,244415,244433,244452,244470,244488,244506,244524,244542,244560,244578,244597,244615,244633,244651,244669,244687,244705,244723,244741,244759,244777,244795,244813,244831,244849,244867,244885,244903,244921,244938,244956,244974,244992,245010,245028,245046,245064,245081,245099,245117,245135,245153,245171,245188,245206,245224,245242,245259,245277,245295,245313,245330,245348,245366,245383,245401,245419,245436,245454,245472,245489,245507,245525,245542,245560,245577,245595,245613,245630,245648,245665,245683,245700,245718,245735,245753,245770,245788,245805,245823,245840,245858,245875,245892,245910,245927,245945,245962,245979,245997,246014,246032,246049,246066,246084,246101,246118,246136,246153,246170,246187,246205,246222,246239,246256,246274,246291,246308,246325,246342,246360,246377,246394,246411,246428,246445,246463,246480,246497,246514,246531,246548,246565,246582,246599,246616,246633,246650,246667,246684,246701,246718,246735,246752,246769,246786,246803,246820,246837,246854,246871,246888,246905,246922,246938,246955,246972,246989,247006,247023,247040,247056,247073,247090,247107,247123,247140,247157,247174,247190,247207,247224,247241,247257,247274,247291,247307,247324,247341,247357,247374,247391,247407,247424,247440,247457,247474,247490,247507,247523,247540,247556,247573,247589,247606,247622,247639,247655,247672,247688,247705,247721,247738,247754,247771,247787,247803,247820,247836,247853,247869,247885,247902,247918,247934,247951,247967,247983,248000,248016,248032,248048,248065,248081,248097,248113,248130,248146,248162,248178,248194,248211,248227,248243,248259,248275,248291,248307,248323,248340,248356,248372,248388,248404,248420,248436,248452,248468,248484,248500,248516,248532,248548,248564,248580,248596,248612,248628,248644,248660,248676,248691,248707,248723,248739,248755,248771,248787,248803,248818,248834,248850,248866,248882,248897,248913,248929,248945,248960,248976,248992,249008,249023,249039,249055,249070,249086,249102,249117,249133,249149,249164,249180,249195,249211,249227,249242,249258,249273,249289,249304,249320,249335,249351,249367,249382,249398,249413,249428,249444,249459,249475,249490,249506,249521,249536,249552,249567,249583,249598,249613,249629,249644,249659,249675,249690,249705,249721,249736,249751,249766,249782,249797,249812,249827,249843,249858,249873,249888,249903,249919,249934,249949,249964,249979,249994,250009,250025,250040,250055,250070,250085,250100,250115,250130,250145,250160,250175,250190,250205,250220,250235,250250,250265,250280,250295,250310,250325,250340,250355,250370,250385,250399,250414,250429,250444,250459,250474,250489,250503,250518,250533,250548,250562,250577,250592,250607,250622,250636,250651,250666,250680,250695,250710,250724,250739,250754,250768,250783,250798,250812,250827,250842,250856,250871,250885,250900,250914,250929,250944,250958,250973,250987,251002,251016,251031,251045,251060,251074,251088,251103,251117,251132,251146,251161,251175,251189,251204,251218,251232,251247,251261,251275,251290,251304,251318,251333,251347,251361,251375,251390,251404,251418,251432,251447,251461,251475,251489,251503,251518,251532,251546,251560,251574,251588,251602,251617,251631,251645,251659,251673,251687,251701,251715,251729,251743,251757,251771,251785,251799,251813,251827,251841,251855,251869,251883,251897,251911,251925,251938,251952,251966,251980,251994,252008,252022,252035,252049,252063,252077,252091,252104,252118,252132,252146,252159,252173,252187,252201,252214,252228,252242,252255,252269,252283,252296,252310,252324,252337,252351,252365,252378,252392,252405,252419,252432,252446,252460,252473,252487,252500,252514,252527,252541,252554,252568,252581,252594,252608,252621,252635,252648,252662,252675,252688,252702,252715,252728,252742,252755,252768,252782,252795,252808,252822,252835,252848,252861,252875,252888,252901,252914,252928,252941,252954,252967,252980,252994,253007,253020,253033,253046,253059,253072,253085,253099,253112,253125,253138,253151,253164,253177,253190,253203,253216,253229,253242,253255,253268,253281,253294,253307,253320,253333,253346,253359,253371,253384,253397,253410,253423,253436,253449,253461,253474,253487,253500,253513,253525,253538,253551,253564,253577,253589,253602,253615,253627,253640,253653,253666,253678,253691,253704,253716,253729,253741,253754,253767,253779,253792,253804,253817,253830,253842,253855,253867,253880,253892,253905,253917,253930,253942,253955,253967,253980,253992,254004,254017,254029,254042,254054,254067,254079,254091,254104,254116,254128,254141,254153,254165,254178,254190,254202,254214,254227,254239,254251,254263,254276,254288,254300,254312,254324,254337,254349,254361,254373,254385,254397,254410,254422,254434,254446,254458,254470,254482,254494,254506,254518,254530,254542,254554,254566,254578,254590,254602,254614,254626,254638,254650,254662,254674,254686,254698,254710,254721,254733,254745,254757,254769,254781,254793,254804,254816,254828,254840,254852,254863,254875,254887,254899,254910,254922,254934,254945,254957,254969,254981,254992,255004,255015,255027,255039,255050,255062,255074,255085,255097,255108,255120,255131,255143,255155,255166,255178,255189,255201,255212,255224,255235,255246,255258,255269,255281,255292,255304,255315,255326,255338,255349,255361,255372,255383,255395,255406,255417,255429,255440,255451,255462,255474,255485,255496,255507,255519,255530,255541,255552,255564,255575,255586,255597,255608,255619,255630,255642,255653,255664,255675,255686,255697,255708,255719,255730,255741,255752,255763,255774,255785,255796,255807,255818,255829,255840,255851,255862,255873,255884,255895,255906,255917,255928,255939,255949,255960,255971,255982,255993,256004,256014,256025,256036,256047,256058,256068,256079,256090,256101,256111,256122,256133,256143,256154,256165,256176,256186,256197,256207,256218,256229,256239,256250,256261,256271,256282,256292,256303,256313,256324,256334,256345,256355,256366,256376,256387,256397,256408,256418,256429,256439,256450,256460,256470,256481,256491,256502,256512,256522,256533,256543,256553,256564,256574,256584,256595,256605,256615,256625,256636,256646,256656,256666,256677,256687,256697,256707,256717,256728,256738,256748,256758,256768,256778,256788,256798,256809,256819,256829,256839,256849,256859,256869,256879,256889,256899,256909,256919,256929,256939,256949,256959,256969,256979,256989,256999,257008,257018,257028,257038,257048,257058,257068,257078,257087,257097,257107,257117,257127,257136,257146,257156,257166,257175,257185,257195,257205,257214,257224,257234,257243,257253,257263,257272,257282,257292,257301,257311,257320,257330,257340,257349,257359,257368,257378,257387,257397,257406,257416,257425,257435,257444,257454,257463,257473,257482,257492,257501,257510,257520,257529,257539,257548,257557,257567,257576,257585,257595,257604,257613,257623,257632,257641,257651,257660,257669,257678,257688,257697,257706,257715,257724,257734,257743,257752,257761,257770,257779,257789,257798,257807,257816,257825,257834,257843,257852,257861,257870,257879,257888,257897,257906,257915,257924,257933,257942,257951,257960,257969,257978,257987,257996,258005,258014,258023,258031,258040,258049,258058,258067,258076,258084,258093,258102,258111,258120,258128,258137,258146,258155,258163,258172,258181,258190,258198,258207,258216,258224,258233,258242,258250,258259,258267,258276,258285,258293,258302,258310,258319,258327,258336,258345,258353,258362,258370,258379,258387,258396,258404,258412,258421,258429,258438,258446,258455,258463,258471,258480,258488,258496,258505,258513,258522,258530,258538,258546,258555,258563,258571,258580,258588,258596,258604,258613,258621,258629,258637,258645,258654,258662,258670,258678,258686,258694,258702,258711,258719,258727,258735,258743,258751,258759,258767,258775,258783,258791,258799,258807,258815,258823,258831,258839,258847,258855,258863,258871,258879,258887,258895,258902,258910,258918,258926,258934,258942,258950,258957,258965,258973,258981,258989,258996,259004,259012,259020,259027,259035,259043,259050,259058,259066,259073,259081,259089,259096,259104,259112,259119,259127,259135,259142,259150,259157,259165,259172,259180,259187,259195,259202,259210,259217,259225,259232,259240,259247,259255,259262,259270,259277,259285,259292,259299,259307,259314,259321,259329,259336,259343,259351,259358,259365,259373,259380,259387,259395,259402,259409,259416,259423,259431,259438,259445,259452,259459,259467,259474,259481,259488,259495,259502,259509,259517,259524,259531,259538,259545,259552,259559,259566,259573,259580,259587,259594,259601,259608,259615,259622,259629,259636,259643,259650,259657,259664,259670,259677,259684,259691,259698,259705,259712,259718,259725,259732,259739,259746,259752,259759,259766,259773,259779,259786,259793,259800,259806,259813,259820,259826,259833,259840,259846,259853,259860,259866,259873,259879,259886,259893,259899,259906,259912,259919,259925,259932,259938,259945,259951,259958,259964,259971,259977,259984,259990,259997,260003,260009,260016,260022,260029,260035,260041,260048,260054,260060,260067,260073,260079,260085,260092,260098,260104,260111,260117,260123,260129,260135,260142,260148,260154,260160,260166,260173,260179,260185,260191,260197,260203,260209,260215,260221,260228,260234,260240,260246,260252,260258,260264,260270,260276,260282,260288,260294,260300,260306,260312,260317,260323,260329,260335,260341,260347,260353,260359,260365,260370,260376,260382,260388,260394,260399,260405,260411,260417,260423,260428,260434,260440,260445,260451,260457,260463,260468,260474,260480,260485,260491,260496,260502,260508,260513,260519,260525,260530,260536,260541,260547,260552,260558,260563,260569,260574,260580,260585,260591,260596,260602,260607,260613,260618,260623,260629,260634,260640,260645,260650,260656,260661,260666,260672,260677,260682,260688,260693,260698,260703,260709,260714,260719,260724,260730,260735,260740,260745,260750,260756,260761,260766,260771,260776,260781,260786,260791,260797,260802,260807,260812,260817,260822,260827,260832,260837,260842,260847,260852,260857,260862,260867,260872,260877,260882,260887,260892,260896,260901,260906,260911,260916,260921,260926,260930,260935,260940,260945,260950,260955,260959,260964,260969,260974,260978,260983,260988,260992,260997,261002,261007,261011,261016,261021,261025,261030,261034,261039,261044,261048,261053,261057,261062,261067,261071,261076,261080,261085,261089,261094,261098,261103,261107,261112,261116,261120,261125,261129,261134,261138,261143,261147,261151,261156,261160,261164,261169,261173,261177,261182,261186,261190,261195,261199,261203,261207,261212,261216,261220,261224,261228,261233,261237,261241,261245,261249,261253,261258,261262,261266,261270,261274,261278,261282,261286,261290,261294,261298,261302,261306,261310,261314,261318,261322,261326,261330,261334,261338,261342,261346,261350,261354,261358,261362,261366,261369,261373,261377,261381,261385,261389,261392,261396,261400,261404,261408,261411,261415,261419,261423,261426,261430,261434,261437,261441,261445,261448,261452,261456,261459,261463,261467,261470,261474,261477,261481,261485,261488,261492,261495,261499,261502,261506,261509,261513,261516,261520,261523,261527,261530,261533,261537,261540,261544,261547,261551,261554,261557,261561,261564,261567,261571,261574,261577,261581,261584,261587,261590,261594,261597,261600,261603,261607,261610,261613,261616,261619,261623,261626,261629,261632,261635,261638,261641,261644,261648,261651,261654,261657,261660,261663,261666,261669,261672,261675,261678,261681,261684,261687,261690,261693,261696,261699,261702,261705,261708,261710,261713,261716,261719,261722,261725,261728,261730,261733,261736,261739,261742,261744,261747,261750,261753,261755,261758,261761,261764,261766,261769,261772,261774,261777,261780,261782,261785,261788,261790,261793,261795,261798,261801,261803,261806,261808,261811,261813,261816,261818,261821,261823,261826,261828,261831,261833,261836,261838,261840,261843,261845,261848,261850,261852,261855,261857,261859,261862,261864,261866,261869,261871,261873,261876,261878,261880,261882,261885,261887,261889,261891,261894,261896,261898,261900,261902,261904,261907,261909,261911,261913,261915,261917,261919,261921,261923,261925,261927,261929,261932,261934,261936,261938,261940,261942,261943,261945,261947,261949,261951,261953,261955,261957,261959,261961,261963,261965,261966,261968,261970,261972,261974,261975,261977,261979,261981,261983,261984,261986,261988,261990,261991,261993,261995,261996,261998,262000,262001,262003,262005,262006,262008,262010,262011,262013,262014,262016,262018,262019,262021,262022,262024,262025,262027,262028,262030,262031,262033,262034,262036,262037,262038,262040,262041,262043,262044,262045,262047,262048,262050,262051,262052,262054,262055,262056,262057,262059,262060,262061,262063,262064,262065,262066,262067,262069,262070,262071,262072,262073,262075,262076,262077,262078,262079,262080,262081,262082,262084,262085,262086,262087,262088,262089,262090,262091,262092,262093,262094,262095,262096,262097,262098,262099,262100,262101,262101,262102,262103,262104,262105,262106,262107,262108,262108,262109,262110,262111,262112,262112,262113,262114,262115,262115,262116,262117,262118,262118,262119,262120,262120,262121,262122,262122,262123,262124,262124,262125,262125,262126,262127,262127,262128,262128,262129,262129,262130,262130,262131,262131,262132,262132,262133,262133,262134,262134,262135,262135,262135,262136,262136,262137,262137,262137,262138,262138,262138,262139,262139,262139,262140,262140,262140,262140,262141,262141,262141,262141,262142,262142,262142,262142,262142,262143,262143,262143,262143,262143,262143,262143,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,0}; | ||
diff --git a/apps/plugins/pdbox/PDa/intern/cos_table.h b/apps/plugins/pdbox/PDa/intern/cos_table.h index e8be7f5c8c..fc7aff9115 100644 --- a/apps/plugins/pdbox/PDa/intern/cos_table.h +++ b/apps/plugins/pdbox/PDa/intern/cos_table.h | |||
@@ -1,3 +1,7 @@ | |||
1 | #define ILOGCOSTABSIZE 15 | 1 | #define ILOGCOSTABSIZE 15 |
2 | #define ICOSTABSIZE (1<<ILOGCOSTABSIZE) | 2 | #define ICOSTABSIZE (1<<ILOGCOSTABSIZE) |
3 | #ifdef ROCKBOX | ||
4 | extern t_sample cos_table[]; | ||
5 | #else /* ROCKBOX */ | ||
3 | static t_sample cos_table[] = {262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262143,262143,262143,262143,262143,262143,262143,262142,262142,262142,262142,262142,262141,262141,262141,262141,262140,262140,262140,262140,262139,262139,262139,262138,262138,262138,262137,262137,262137,262136,262136,262135,262135,262135,262134,262134,262133,262133,262132,262132,262131,262131,262130,262130,262129,262129,262128,262128,262127,262127,262126,262125,262125,262124,262124,262123,262122,262122,262121,262120,262120,262119,262118,262118,262117,262116,262115,262115,262114,262113,262112,262112,262111,262110,262109,262108,262108,262107,262106,262105,262104,262103,262102,262101,262101,262100,262099,262098,262097,262096,262095,262094,262093,262092,262091,262090,262089,262088,262087,262086,262085,262084,262082,262081,262080,262079,262078,262077,262076,262075,262073,262072,262071,262070,262069,262067,262066,262065,262064,262063,262061,262060,262059,262057,262056,262055,262054,262052,262051,262050,262048,262047,262045,262044,262043,262041,262040,262038,262037,262036,262034,262033,262031,262030,262028,262027,262025,262024,262022,262021,262019,262018,262016,262014,262013,262011,262010,262008,262006,262005,262003,262001,262000,261998,261996,261995,261993,261991,261990,261988,261986,261984,261983,261981,261979,261977,261975,261974,261972,261970,261968,261966,261965,261963,261961,261959,261957,261955,261953,261951,261949,261947,261945,261943,261942,261940,261938,261936,261934,261932,261929,261927,261925,261923,261921,261919,261917,261915,261913,261911,261909,261907,261904,261902,261900,261898,261896,261894,261891,261889,261887,261885,261882,261880,261878,261876,261873,261871,261869,261866,261864,261862,261859,261857,261855,261852,261850,261848,261845,261843,261840,261838,261836,261833,261831,261828,261826,261823,261821,261818,261816,261813,261811,261808,261806,261803,261801,261798,261795,261793,261790,261788,261785,261782,261780,261777,261774,261772,261769,261766,261764,261761,261758,261755,261753,261750,261747,261744,261742,261739,261736,261733,261730,261728,261725,261722,261719,261716,261713,261710,261708,261705,261702,261699,261696,261693,261690,261687,261684,261681,261678,261675,261672,261669,261666,261663,261660,261657,261654,261651,261648,261644,261641,261638,261635,261632,261629,261626,261623,261619,261616,261613,261610,261607,261603,261600,261597,261594,261590,261587,261584,261581,261577,261574,261571,261567,261564,261561,261557,261554,261551,261547,261544,261540,261537,261533,261530,261527,261523,261520,261516,261513,261509,261506,261502,261499,261495,261492,261488,261485,261481,261477,261474,261470,261467,261463,261459,261456,261452,261448,261445,261441,261437,261434,261430,261426,261423,261419,261415,261411,261408,261404,261400,261396,261392,261389,261385,261381,261377,261373,261369,261366,261362,261358,261354,261350,261346,261342,261338,261334,261330,261326,261322,261318,261314,261310,261306,261302,261298,261294,261290,261286,261282,261278,261274,261270,261266,261262,261258,261253,261249,261245,261241,261237,261233,261228,261224,261220,261216,261212,261207,261203,261199,261195,261190,261186,261182,261177,261173,261169,261164,261160,261156,261151,261147,261143,261138,261134,261129,261125,261120,261116,261112,261107,261103,261098,261094,261089,261085,261080,261076,261071,261067,261062,261057,261053,261048,261044,261039,261034,261030,261025,261021,261016,261011,261007,261002,260997,260992,260988,260983,260978,260974,260969,260964,260959,260955,260950,260945,260940,260935,260930,260926,260921,260916,260911,260906,260901,260896,260892,260887,260882,260877,260872,260867,260862,260857,260852,260847,260842,260837,260832,260827,260822,260817,260812,260807,260802,260797,260791,260786,260781,260776,260771,260766,260761,260756,260750,260745,260740,260735,260730,260724,260719,260714,260709,260703,260698,260693,260688,260682,260677,260672,260666,260661,260656,260650,260645,260640,260634,260629,260623,260618,260613,260607,260602,260596,260591,260585,260580,260574,260569,260563,260558,260552,260547,260541,260536,260530,260525,260519,260513,260508,260502,260496,260491,260485,260480,260474,260468,260463,260457,260451,260445,260440,260434,260428,260423,260417,260411,260405,260399,260394,260388,260382,260376,260370,260365,260359,260353,260347,260341,260335,260329,260323,260317,260312,260306,260300,260294,260288,260282,260276,260270,260264,260258,260252,260246,260240,260234,260228,260221,260215,260209,260203,260197,260191,260185,260179,260173,260166,260160,260154,260148,260142,260135,260129,260123,260117,260111,260104,260098,260092,260085,260079,260073,260067,260060,260054,260048,260041,260035,260029,260022,260016,260009,260003,259997,259990,259984,259977,259971,259964,259958,259951,259945,259938,259932,259925,259919,259912,259906,259899,259893,259886,259879,259873,259866,259860,259853,259846,259840,259833,259826,259820,259813,259806,259800,259793,259786,259779,259773,259766,259759,259752,259746,259739,259732,259725,259718,259712,259705,259698,259691,259684,259677,259670,259664,259657,259650,259643,259636,259629,259622,259615,259608,259601,259594,259587,259580,259573,259566,259559,259552,259545,259538,259531,259524,259517,259509,259502,259495,259488,259481,259474,259467,259459,259452,259445,259438,259431,259423,259416,259409,259402,259395,259387,259380,259373,259365,259358,259351,259343,259336,259329,259321,259314,259307,259299,259292,259285,259277,259270,259262,259255,259247,259240,259232,259225,259217,259210,259202,259195,259187,259180,259172,259165,259157,259150,259142,259135,259127,259119,259112,259104,259096,259089,259081,259073,259066,259058,259050,259043,259035,259027,259020,259012,259004,258996,258989,258981,258973,258965,258957,258950,258942,258934,258926,258918,258910,258902,258895,258887,258879,258871,258863,258855,258847,258839,258831,258823,258815,258807,258799,258791,258783,258775,258767,258759,258751,258743,258735,258727,258719,258711,258702,258694,258686,258678,258670,258662,258654,258645,258637,258629,258621,258613,258604,258596,258588,258580,258571,258563,258555,258546,258538,258530,258522,258513,258505,258496,258488,258480,258471,258463,258455,258446,258438,258429,258421,258412,258404,258396,258387,258379,258370,258362,258353,258345,258336,258327,258319,258310,258302,258293,258285,258276,258267,258259,258250,258242,258233,258224,258216,258207,258198,258190,258181,258172,258163,258155,258146,258137,258128,258120,258111,258102,258093,258084,258076,258067,258058,258049,258040,258031,258023,258014,258005,257996,257987,257978,257969,257960,257951,257942,257933,257924,257915,257906,257897,257888,257879,257870,257861,257852,257843,257834,257825,257816,257807,257798,257789,257779,257770,257761,257752,257743,257734,257724,257715,257706,257697,257688,257678,257669,257660,257651,257641,257632,257623,257613,257604,257595,257585,257576,257567,257557,257548,257539,257529,257520,257510,257501,257492,257482,257473,257463,257454,257444,257435,257425,257416,257406,257397,257387,257378,257368,257359,257349,257340,257330,257320,257311,257301,257292,257282,257272,257263,257253,257243,257234,257224,257214,257205,257195,257185,257175,257166,257156,257146,257136,257127,257117,257107,257097,257087,257078,257068,257058,257048,257038,257028,257018,257008,256999,256989,256979,256969,256959,256949,256939,256929,256919,256909,256899,256889,256879,256869,256859,256849,256839,256829,256819,256809,256798,256788,256778,256768,256758,256748,256738,256728,256717,256707,256697,256687,256677,256666,256656,256646,256636,256625,256615,256605,256595,256584,256574,256564,256553,256543,256533,256522,256512,256502,256491,256481,256470,256460,256450,256439,256429,256418,256408,256397,256387,256376,256366,256355,256345,256334,256324,256313,256303,256292,256282,256271,256261,256250,256239,256229,256218,256207,256197,256186,256176,256165,256154,256143,256133,256122,256111,256101,256090,256079,256068,256058,256047,256036,256025,256014,256004,255993,255982,255971,255960,255949,255939,255928,255917,255906,255895,255884,255873,255862,255851,255840,255829,255818,255807,255796,255785,255774,255763,255752,255741,255730,255719,255708,255697,255686,255675,255664,255653,255642,255630,255619,255608,255597,255586,255575,255564,255552,255541,255530,255519,255507,255496,255485,255474,255462,255451,255440,255429,255417,255406,255395,255383,255372,255361,255349,255338,255326,255315,255304,255292,255281,255269,255258,255246,255235,255224,255212,255201,255189,255178,255166,255155,255143,255131,255120,255108,255097,255085,255074,255062,255050,255039,255027,255015,255004,254992,254981,254969,254957,254945,254934,254922,254910,254899,254887,254875,254863,254852,254840,254828,254816,254804,254793,254781,254769,254757,254745,254733,254721,254710,254698,254686,254674,254662,254650,254638,254626,254614,254602,254590,254578,254566,254554,254542,254530,254518,254506,254494,254482,254470,254458,254446,254434,254422,254410,254397,254385,254373,254361,254349,254337,254324,254312,254300,254288,254276,254263,254251,254239,254227,254214,254202,254190,254178,254165,254153,254141,254128,254116,254104,254091,254079,254067,254054,254042,254029,254017,254004,253992,253980,253967,253955,253942,253930,253917,253905,253892,253880,253867,253855,253842,253830,253817,253804,253792,253779,253767,253754,253741,253729,253716,253704,253691,253678,253666,253653,253640,253627,253615,253602,253589,253577,253564,253551,253538,253525,253513,253500,253487,253474,253461,253449,253436,253423,253410,253397,253384,253371,253359,253346,253333,253320,253307,253294,253281,253268,253255,253242,253229,253216,253203,253190,253177,253164,253151,253138,253125,253112,253099,253085,253072,253059,253046,253033,253020,253007,252994,252980,252967,252954,252941,252928,252914,252901,252888,252875,252861,252848,252835,252822,252808,252795,252782,252768,252755,252742,252728,252715,252702,252688,252675,252662,252648,252635,252621,252608,252594,252581,252568,252554,252541,252527,252514,252500,252487,252473,252460,252446,252432,252419,252405,252392,252378,252365,252351,252337,252324,252310,252296,252283,252269,252255,252242,252228,252214,252201,252187,252173,252159,252146,252132,252118,252104,252091,252077,252063,252049,252035,252022,252008,251994,251980,251966,251952,251938,251925,251911,251897,251883,251869,251855,251841,251827,251813,251799,251785,251771,251757,251743,251729,251715,251701,251687,251673,251659,251645,251631,251617,251602,251588,251574,251560,251546,251532,251518,251503,251489,251475,251461,251447,251432,251418,251404,251390,251375,251361,251347,251333,251318,251304,251290,251275,251261,251247,251232,251218,251204,251189,251175,251161,251146,251132,251117,251103,251088,251074,251060,251045,251031,251016,251002,250987,250973,250958,250944,250929,250914,250900,250885,250871,250856,250842,250827,250812,250798,250783,250768,250754,250739,250724,250710,250695,250680,250666,250651,250636,250622,250607,250592,250577,250562,250548,250533,250518,250503,250489,250474,250459,250444,250429,250414,250399,250385,250370,250355,250340,250325,250310,250295,250280,250265,250250,250235,250220,250205,250190,250175,250160,250145,250130,250115,250100,250085,250070,250055,250040,250025,250009,249994,249979,249964,249949,249934,249919,249903,249888,249873,249858,249843,249827,249812,249797,249782,249766,249751,249736,249721,249705,249690,249675,249659,249644,249629,249613,249598,249583,249567,249552,249536,249521,249506,249490,249475,249459,249444,249428,249413,249398,249382,249367,249351,249335,249320,249304,249289,249273,249258,249242,249227,249211,249195,249180,249164,249149,249133,249117,249102,249086,249070,249055,249039,249023,249008,248992,248976,248960,248945,248929,248913,248897,248882,248866,248850,248834,248818,248803,248787,248771,248755,248739,248723,248707,248691,248676,248660,248644,248628,248612,248596,248580,248564,248548,248532,248516,248500,248484,248468,248452,248436,248420,248404,248388,248372,248356,248340,248323,248307,248291,248275,248259,248243,248227,248211,248194,248178,248162,248146,248130,248113,248097,248081,248065,248048,248032,248016,248000,247983,247967,247951,247934,247918,247902,247885,247869,247853,247836,247820,247803,247787,247771,247754,247738,247721,247705,247688,247672,247655,247639,247622,247606,247589,247573,247556,247540,247523,247507,247490,247474,247457,247440,247424,247407,247391,247374,247357,247341,247324,247307,247291,247274,247257,247241,247224,247207,247190,247174,247157,247140,247123,247107,247090,247073,247056,247040,247023,247006,246989,246972,246955,246938,246922,246905,246888,246871,246854,246837,246820,246803,246786,246769,246752,246735,246718,246701,246684,246667,246650,246633,246616,246599,246582,246565,246548,246531,246514,246497,246480,246463,246445,246428,246411,246394,246377,246360,246342,246325,246308,246291,246274,246256,246239,246222,246205,246187,246170,246153,246136,246118,246101,246084,246066,246049,246032,246014,245997,245979,245962,245945,245927,245910,245892,245875,245858,245840,245823,245805,245788,245770,245753,245735,245718,245700,245683,245665,245648,245630,245613,245595,245577,245560,245542,245525,245507,245489,245472,245454,245436,245419,245401,245383,245366,245348,245330,245313,245295,245277,245259,245242,245224,245206,245188,245171,245153,245135,245117,245099,245081,245064,245046,245028,245010,244992,244974,244956,244938,244921,244903,244885,244867,244849,244831,244813,244795,244777,244759,244741,244723,244705,244687,244669,244651,244633,244615,244597,244578,244560,244542,244524,244506,244488,244470,244452,244433,244415,244397,244379,244361,244343,244324,244306,244288,244270,244251,244233,244215,244197,244178,244160,244142,244123,244105,244087,244068,244050,244032,244013,243995,243977,243958,243940,243921,243903,243885,243866,243848,243829,243811,243792,243774,243755,243737,243718,243700,243681,243663,243644,243626,243607,243588,243570,243551,243533,243514,243496,243477,243458,243440,243421,243402,243384,243365,243346,243328,243309,243290,243271,243253,243234,243215,243196,243178,243159,243140,243121,243103,243084,243065,243046,243027,243008,242990,242971,242952,242933,242914,242895,242876,242857,242838,242819,242800,242782,242763,242744,242725,242706,242687,242668,242649,242630,242611,242591,242572,242553,242534,242515,242496,242477,242458,242439,242420,242401,242381,242362,242343,242324,242305,242286,242266,242247,242228,242209,242189,242170,242151,242132,242112,242093,242074,242055,242035,242016,241997,241977,241958,241939,241919,241900,241881,241861,241842,241822,241803,241784,241764,241745,241725,241706,241686,241667,241647,241628,241608,241589,241569,241550,241530,241511,241491,241472,241452,241433,241413,241393,241374,241354,241334,241315,241295,241276,241256,241236,241217,241197,241177,241157,241138,241118,241098,241079,241059,241039,241019,241000,240980,240960,240940,240920,240901,240881,240861,240841,240821,240801,240781,240762,240742,240722,240702,240682,240662,240642,240622,240602,240582,240562,240542,240522,240502,240482,240462,240442,240422,240402,240382,240362,240342,240322,240302,240282,240262,240242,240221,240201,240181,240161,240141,240121,240101,240080,240060,240040,240020,240000,239979,239959,239939,239919,239898,239878,239858,239838,239817,239797,239777,239756,239736,239716,239695,239675,239655,239634,239614,239593,239573,239553,239532,239512,239491,239471,239450,239430,239410,239389,239369,239348,239328,239307,239287,239266,239245,239225,239204,239184,239163,239143,239122,239101,239081,239060,239040,239019,238998,238978,238957,238936,238916,238895,238874,238853,238833,238812,238791,238771,238750,238729,238708,238688,238667,238646,238625,238604,238583,238563,238542,238521,238500,238479,238458,238437,238417,238396,238375,238354,238333,238312,238291,238270,238249,238228,238207,238186,238165,238144,238123,238102,238081,238060,238039,238018,237997,237976,237955,237934,237913,237891,237870,237849,237828,237807,237786,237765,237743,237722,237701,237680,237659,237637,237616,237595,237574,237552,237531,237510,237489,237467,237446,237425,237403,237382,237361,237339,237318,237297,237275,237254,237233,237211,237190,237168,237147,237126,237104,237083,237061,237040,237018,236997,236975,236954,236932,236911,236889,236868,236846,236825,236803,236782,236760,236738,236717,236695,236674,236652,236630,236609,236587,236565,236544,236522,236500,236479,236457,236435,236414,236392,236370,236348,236327,236305,236283,236261,236240,236218,236196,236174,236152,236131,236109,236087,236065,236043,236021,235999,235978,235956,235934,235912,235890,235868,235846,235824,235802,235780,235758,235736,235714,235692,235670,235648,235626,235604,235582,235560,235538,235516,235494,235472,235450,235428,235405,235383,235361,235339,235317,235295,235273,235250,235228,235206,235184,235162,235139,235117,235095,235073,235050,235028,235006,234984,234961,234939,234917,234894,234872,234850,234828,234805,234783,234760,234738,234716,234693,234671,234649,234626,234604,234581,234559,234536,234514,234491,234469,234446,234424,234401,234379,234356,234334,234311,234289,234266,234244,234221,234199,234176,234153,234131,234108,234086,234063,234040,234018,233995,233972,233950,233927,233904,233882,233859,233836,233813,233791,233768,233745,233722,233700,233677,233654,233631,233609,233586,233563,233540,233517,233494,233472,233449,233426,233403,233380,233357,233334,233311,233288,233265,233243,233220,233197,233174,233151,233128,233105,233082,233059,233036,233013,232990,232967,232944,232920,232897,232874,232851,232828,232805,232782,232759,232736,232713,232689,232666,232643,232620,232597,232574,232550,232527,232504,232481,232457,232434,232411,232388,232364,232341,232318,232295,232271,232248,232225,232201,232178,232155,232131,232108,232085,232061,232038,232014,231991,231968,231944,231921,231897,231874,231850,231827,231804,231780,231757,231733,231710,231686,231663,231639,231615,231592,231568,231545,231521,231498,231474,231450,231427,231403,231380,231356,231332,231309,231285,231261,231238,231214,231190,231167,231143,231119,231096,231072,231048,231024,231001,230977,230953,230929,230905,230882,230858,230834,230810,230786,230762,230739,230715,230691,230667,230643,230619,230595,230571,230548,230524,230500,230476,230452,230428,230404,230380,230356,230332,230308,230284,230260,230236,230212,230188,230164,230140,230116,230091,230067,230043,230019,229995,229971,229947,229923,229898,229874,229850,229826,229802,229778,229753,229729,229705,229681,229657,229632,229608,229584,229560,229535,229511,229487,229462,229438,229414,229389,229365,229341,229316,229292,229268,229243,229219,229194,229170,229146,229121,229097,229072,229048,229024,228999,228975,228950,228926,228901,228877,228852,228828,228803,228779,228754,228729,228705,228680,228656,228631,228607,228582,228557,228533,228508,228483,228459,228434,228409,228385,228360,228335,228311,228286,228261,228237,228212,228187,228162,228138,228113,228088,228063,228039,228014,227989,227964,227939,227914,227890,227865,227840,227815,227790,227765,227740,227716,227691,227666,227641,227616,227591,227566,227541,227516,227491,227466,227441,227416,227391,227366,227341,227316,227291,227266,227241,227216,227191,227166,227141,227115,227090,227065,227040,227015,226990,226965,226940,226914,226889,226864,226839,226814,226788,226763,226738,226713,226688,226662,226637,226612,226586,226561,226536,226511,226485,226460,226435,226409,226384,226359,226333,226308,226283,226257,226232,226206,226181,226156,226130,226105,226079,226054,226028,226003,225977,225952,225926,225901,225875,225850,225824,225799,225773,225748,225722,225697,225671,225646,225620,225594,225569,225543,225517,225492,225466,225441,225415,225389,225364,225338,225312,225287,225261,225235,225209,225184,225158,225132,225106,225081,225055,225029,225003,224978,224952,224926,224900,224874,224848,224823,224797,224771,224745,224719,224693,224667,224641,224615,224590,224564,224538,224512,224486,224460,224434,224408,224382,224356,224330,224304,224278,224252,224226,224200,224174,224148,224122,224096,224069,224043,224017,223991,223965,223939,223913,223887,223860,223834,223808,223782,223756,223730,223703,223677,223651,223625,223599,223572,223546,223520,223493,223467,223441,223415,223388,223362,223336,223309,223283,223257,223230,223204,223178,223151,223125,223099,223072,223046,223019,222993,222966,222940,222914,222887,222861,222834,222808,222781,222755,222728,222702,222675,222649,222622,222596,222569,222542,222516,222489,222463,222436,222410,222383,222356,222330,222303,222276,222250,222223,222196,222170,222143,222116,222090,222063,222036,222010,221983,221956,221929,221903,221876,221849,221822,221795,221769,221742,221715,221688,221661,221634,221608,221581,221554,221527,221500,221473,221446,221419,221393,221366,221339,221312,221285,221258,221231,221204,221177,221150,221123,221096,221069,221042,221015,220988,220961,220934,220907,220880,220853,220826,220798,220771,220744,220717,220690,220663,220636,220609,220581,220554,220527,220500,220473,220446,220418,220391,220364,220337,220309,220282,220255,220228,220200,220173,220146,220119,220091,220064,220037,220009,219982,219955,219927,219900,219873,219845,219818,219790,219763,219736,219708,219681,219653,219626,219598,219571,219544,219516,219489,219461,219434,219406,219379,219351,219324,219296,219268,219241,219213,219186,219158,219131,219103,219075,219048,219020,218993,218965,218937,218910,218882,218854,218827,218799,218771,218744,218716,218688,218660,218633,218605,218577,218549,218522,218494,218466,218438,218411,218383,218355,218327,218299,218271,218244,218216,218188,218160,218132,218104,218076,218049,218021,217993,217965,217937,217909,217881,217853,217825,217797,217769,217741,217713,217685,217657,217629,217601,217573,217545,217517,217489,217461,217433,217405,217377,217348,217320,217292,217264,217236,217208,217180,217152,217123,217095,217067,217039,217011,216982,216954,216926,216898,216870,216841,216813,216785,216757,216728,216700,216672,216643,216615,216587,216558,216530,216502,216473,216445,216417,216388,216360,216332,216303,216275,216246,216218,216190,216161,216133,216104,216076,216047,216019,215990,215962,215933,215905,215876,215848,215819,215791,215762,215734,215705,215677,215648,215619,215591,215562,215534,215505,215476,215448,215419,215390,215362,215333,215304,215276,215247,215218,215190,215161,215132,215104,215075,215046,215017,214989,214960,214931,214902,214873,214845,214816,214787,214758,214729,214701,214672,214643,214614,214585,214556,214527,214498,214470,214441,214412,214383,214354,214325,214296,214267,214238,214209,214180,214151,214122,214093,214064,214035,214006,213977,213948,213919,213890,213861,213832,213803,213774,213745,213715,213686,213657,213628,213599,213570,213541,213511,213482,213453,213424,213395,213366,213336,213307,213278,213249,213219,213190,213161,213132,213102,213073,213044,213015,212985,212956,212927,212897,212868,212839,212809,212780,212751,212721,212692,212662,212633,212604,212574,212545,212515,212486,212456,212427,212398,212368,212339,212309,212280,212250,212221,212191,212162,212132,212103,212073,212043,212014,211984,211955,211925,211896,211866,211836,211807,211777,211748,211718,211688,211659,211629,211599,211570,211540,211510,211481,211451,211421,211391,211362,211332,211302,211272,211243,211213,211183,211153,211124,211094,211064,211034,211004,210974,210945,210915,210885,210855,210825,210795,210765,210736,210706,210676,210646,210616,210586,210556,210526,210496,210466,210436,210406,210376,210346,210316,210286,210256,210226,210196,210166,210136,210106,210076,210046,210016,209986,209956,209926,209895,209865,209835,209805,209775,209745,209715,209684,209654,209624,209594,209564,209534,209503,209473,209443,209413,209382,209352,209322,209292,209261,209231,209201,209170,209140,209110,209080,209049,209019,208989,208958,208928,208897,208867,208837,208806,208776,208746,208715,208685,208654,208624,208593,208563,208533,208502,208472,208441,208411,208380,208350,208319,208289,208258,208228,208197,208166,208136,208105,208075,208044,208014,207983,207952,207922,207891,207861,207830,207799,207769,207738,207707,207677,207646,207615,207585,207554,207523,207492,207462,207431,207400,207370,207339,207308,207277,207246,207216,207185,207154,207123,207092,207062,207031,207000,206969,206938,206907,206877,206846,206815,206784,206753,206722,206691,206660,206629,206598,206567,206537,206506,206475,206444,206413,206382,206351,206320,206289,206258,206227,206196,206165,206133,206102,206071,206040,206009,205978,205947,205916,205885,205854,205823,205791,205760,205729,205698,205667,205636,205604,205573,205542,205511,205480,205448,205417,205386,205355,205324,205292,205261,205230,205198,205167,205136,205105,205073,205042,205011,204979,204948,204917,204885,204854,204823,204791,204760,204728,204697,204666,204634,204603,204571,204540,204508,204477,204446,204414,204383,204351,204320,204288,204257,204225,204194,204162,204131,204099,204067,204036,204004,203973,203941,203910,203878,203846,203815,203783,203752,203720,203688,203657,203625,203593,203562,203530,203498,203467,203435,203403,203372,203340,203308,203276,203245,203213,203181,203149,203118,203086,203054,203022,202990,202959,202927,202895,202863,202831,202799,202768,202736,202704,202672,202640,202608,202576,202544,202512,202481,202449,202417,202385,202353,202321,202289,202257,202225,202193,202161,202129,202097,202065,202033,202001,201969,201937,201905,201873,201841,201808,201776,201744,201712,201680,201648,201616,201584,201552,201519,201487,201455,201423,201391,201359,201326,201294,201262,201230,201198,201165,201133,201101,201069,201036,201004,200972,200940,200907,200875,200843,200810,200778,200746,200713,200681,200649,200616,200584,200552,200519,200487,200454,200422,200390,200357,200325,200292,200260,200228,200195,200163,200130,200098,200065,200033,200000,199968,199935,199903,199870,199838,199805,199773,199740,199708,199675,199642,199610,199577,199545,199512,199479,199447,199414,199382,199349,199316,199284,199251,199218,199186,199153,199120,199088,199055,199022,198989,198957,198924,198891,198858,198826,198793,198760,198727,198695,198662,198629,198596,198563,198531,198498,198465,198432,198399,198366,198334,198301,198268,198235,198202,198169,198136,198103,198070,198037,198004,197972,197939,197906,197873,197840,197807,197774,197741,197708,197675,197642,197609,197576,197543,197510,197476,197443,197410,197377,197344,197311,197278,197245,197212,197179,197146,197112,197079,197046,197013,196980,196947,196913,196880,196847,196814,196781,196747,196714,196681,196648,196615,196581,196548,196515,196481,196448,196415,196382,196348,196315,196282,196248,196215,196182,196148,196115,196082,196048,196015,195982,195948,195915,195881,195848,195815,195781,195748,195714,195681,195647,195614,195580,195547,195513,195480,195446,195413,195379,195346,195312,195279,195245,195212,195178,195145,195111,195078,195044,195010,194977,194943,194910,194876,194842,194809,194775,194741,194708,194674,194640,194607,194573,194539,194506,194472,194438,194405,194371,194337,194303,194270,194236,194202,194168,194135,194101,194067,194033,193999,193966,193932,193898,193864,193830,193796,193763,193729,193695,193661,193627,193593,193559,193525,193492,193458,193424,193390,193356,193322,193288,193254,193220,193186,193152,193118,193084,193050,193016,192982,192948,192914,192880,192846,192812,192778,192744,192710,192676,192641,192607,192573,192539,192505,192471,192437,192403,192369,192334,192300,192266,192232,192198,192164,192129,192095,192061,192027,191992,191958,191924,191890,191856,191821,191787,191753,191718,191684,191650,191616,191581,191547,191513,191478,191444,191410,191375,191341,191307,191272,191238,191203,191169,191135,191100,191066,191031,190997,190963,190928,190894,190859,190825,190790,190756,190721,190687,190652,190618,190583,190549,190514,190480,190445,190411,190376,190342,190307,190272,190238,190203,190169,190134,190099,190065,190030,189996,189961,189926,189892,189857,189822,189788,189753,189718,189684,189649,189614,189580,189545,189510,189475,189441,189406,189371,189336,189302,189267,189232,189197,189162,189128,189093,189058,189023,188988,188954,188919,188884,188849,188814,188779,188744,188709,188675,188640,188605,188570,188535,188500,188465,188430,188395,188360,188325,188290,188255,188220,188185,188150,188115,188080,188045,188010,187975,187940,187905,187870,187835,187800,187765,187730,187695,187660,187625,187589,187554,187519,187484,187449,187414,187379,187343,187308,187273,187238,187203,187168,187132,187097,187062,187027,186992,186956,186921,186886,186851,186815,186780,186745,186710,186674,186639,186604,186568,186533,186498,186462,186427,186392,186356,186321,186286,186250,186215,186179,186144,186109,186073,186038,186002,185967,185932,185896,185861,185825,185790,185754,185719,185683,185648,185612,185577,185541,185506,185470,185435,185399,185364,185328,185293,185257,185222,185186,185150,185115,185079,185044,185008,184972,184937,184901,184866,184830,184794,184759,184723,184687,184652,184616,184580,184545,184509,184473,184437,184402,184366,184330,184294,184259,184223,184187,184151,184116,184080,184044,184008,183972,183937,183901,183865,183829,183793,183757,183722,183686,183650,183614,183578,183542,183506,183470,183435,183399,183363,183327,183291,183255,183219,183183,183147,183111,183075,183039,183003,182967,182931,182895,182859,182823,182787,182751,182715,182679,182643,182607,182571,182535,182499,182463,182426,182390,182354,182318,182282,182246,182210,182174,182137,182101,182065,182029,181993,181957,181920,181884,181848,181812,181776,181739,181703,181667,181631,181594,181558,181522,181486,181449,181413,181377,181341,181304,181268,181232,181195,181159,181123,181086,181050,181014,180977,180941,180904,180868,180832,180795,180759,180723,180686,180650,180613,180577,180540,180504,180467,180431,180395,180358,180322,180285,180249,180212,180176,180139,180103,180066,180029,179993,179956,179920,179883,179847,179810,179774,179737,179700,179664,179627,179591,179554,179517,179481,179444,179407,179371,179334,179297,179261,179224,179187,179151,179114,179077,179041,179004,178967,178930,178894,178857,178820,178783,178747,178710,178673,178636,178600,178563,178526,178489,178452,178415,178379,178342,178305,178268,178231,178194,178158,178121,178084,178047,178010,177973,177936,177899,177862,177825,177788,177752,177715,177678,177641,177604,177567,177530,177493,177456,177419,177382,177345,177308,177271,177234,177197,177160,177123,177085,177048,177011,176974,176937,176900,176863,176826,176789,176752,176714,176677,176640,176603,176566,176529,176492,176454,176417,176380,176343,176306,176268,176231,176194,176157,176120,176082,176045,176008,175971,175933,175896,175859,175822,175784,175747,175710,175672,175635,175598,175560,175523,175486,175448,175411,175374,175336,175299,175262,175224,175187,175149,175112,175075,175037,175000,174962,174925,174887,174850,174813,174775,174738,174700,174663,174625,174588,174550,174513,174475,174438,174400,174363,174325,174288,174250,174212,174175,174137,174100,174062,174025,173987,173949,173912,173874,173837,173799,173761,173724,173686,173648,173611,173573,173535,173498,173460,173422,173385,173347,173309,173271,173234,173196,173158,173121,173083,173045,173007,172969,172932,172894,172856,172818,172781,172743,172705,172667,172629,172591,172554,172516,172478,172440,172402,172364,172326,172289,172251,172213,172175,172137,172099,172061,172023,171985,171947,171909,171871,171834,171796,171758,171720,171682,171644,171606,171568,171530,171492,171454,171416,171378,171339,171301,171263,171225,171187,171149,171111,171073,171035,170997,170959,170921,170883,170844,170806,170768,170730,170692,170654,170616,170577,170539,170501,170463,170425,170386,170348,170310,170272,170234,170195,170157,170119,170081,170042,170004,169966,169928,169889,169851,169813,169774,169736,169698,169660,169621,169583,169545,169506,169468,169430,169391,169353,169314,169276,169238,169199,169161,169122,169084,169046,169007,168969,168930,168892,168853,168815,168777,168738,168700,168661,168623,168584,168546,168507,168469,168430,168392,168353,168315,168276,168238,168199,168160,168122,168083,168045,168006,167968,167929,167890,167852,167813,167774,167736,167697,167659,167620,167581,167543,167504,167465,167427,167388,167349,167311,167272,167233,167194,167156,167117,167078,167040,167001,166962,166923,166885,166846,166807,166768,166729,166691,166652,166613,166574,166535,166497,166458,166419,166380,166341,166302,166264,166225,166186,166147,166108,166069,166030,165991,165952,165914,165875,165836,165797,165758,165719,165680,165641,165602,165563,165524,165485,165446,165407,165368,165329,165290,165251,165212,165173,165134,165095,165056,165017,164978,164939,164900,164861,164821,164782,164743,164704,164665,164626,164587,164548,164509,164469,164430,164391,164352,164313,164274,164234,164195,164156,164117,164078,164039,163999,163960,163921,163882,163842,163803,163764,163725,163685,163646,163607,163568,163528,163489,163450,163410,163371,163332,163292,163253,163214,163174,163135,163096,163056,163017,162978,162938,162899,162860,162820,162781,162741,162702,162663,162623,162584,162544,162505,162465,162426,162386,162347,162308,162268,162229,162189,162150,162110,162071,162031,161992,161952,161913,161873,161833,161794,161754,161715,161675,161636,161596,161557,161517,161477,161438,161398,161359,161319,161279,161240,161200,161160,161121,161081,161041,161002,160962,160922,160883,160843,160803,160764,160724,160684,160644,160605,160565,160525,160486,160446,160406,160366,160327,160287,160247,160207,160167,160128,160088,160048,160008,159968,159929,159889,159849,159809,159769,159729,159689,159650,159610,159570,159530,159490,159450,159410,159370,159330,159291,159251,159211,159171,159131,159091,159051,159011,158971,158931,158891,158851,158811,158771,158731,158691,158651,158611,158571,158531,158491,158451,158411,158371,158331,158291,158251,158211,158170,158130,158090,158050,158010,157970,157930,157890,157850,157809,157769,157729,157689,157649,157609,157569,157528,157488,157448,157408,157368,157327,157287,157247,157207,157167,157126,157086,157046,157006,156965,156925,156885,156845,156804,156764,156724,156683,156643,156603,156562,156522,156482,156441,156401,156361,156320,156280,156240,156199,156159,156119,156078,156038,155997,155957,155917,155876,155836,155795,155755,155715,155674,155634,155593,155553,155512,155472,155431,155391,155350,155310,155269,155229,155188,155148,155107,155067,155026,154986,154945,154905,154864,154824,154783,154742,154702,154661,154621,154580,154539,154499,154458,154418,154377,154336,154296,154255,154214,154174,154133,154093,154052,154011,153970,153930,153889,153848,153808,153767,153726,153686,153645,153604,153563,153523,153482,153441,153400,153360,153319,153278,153237,153197,153156,153115,153074,153033,152993,152952,152911,152870,152829,152788,152748,152707,152666,152625,152584,152543,152502,152461,152421,152380,152339,152298,152257,152216,152175,152134,152093,152052,152011,151970,151929,151888,151847,151806,151765,151724,151683,151642,151601,151560,151519,151478,151437,151396,151355,151314,151273,151232,151191,151150,151109,151068,151027,150986,150945,150904,150862,150821,150780,150739,150698,150657,150616,150575,150533,150492,150451,150410,150369,150328,150286,150245,150204,150163,150122,150080,150039,149998,149957,149916,149874,149833,149792,149751,149709,149668,149627,149585,149544,149503,149462,149420,149379,149338,149296,149255,149214,149172,149131,149090,149048,149007,148966,148924,148883,148842,148800,148759,148717,148676,148635,148593,148552,148510,148469,148428,148386,148345,148303,148262,148220,148179,148137,148096,148054,148013,147971,147930,147888,147847,147805,147764,147722,147681,147639,147598,147556,147515,147473,147432,147390,147348,147307,147265,147224,147182,147141,147099,147057,147016,146974,146932,146891,146849,146808,146766,146724,146683,146641,146599,146558,146516,146474,146433,146391,146349,146307,146266,146224,146182,146141,146099,146057,146015,145974,145932,145890,145848,145807,145765,145723,145681,145639,145598,145556,145514,145472,145430,145389,145347,145305,145263,145221,145179,145137,145096,145054,145012,144970,144928,144886,144844,144802,144761,144719,144677,144635,144593,144551,144509,144467,144425,144383,144341,144299,144257,144215,144173,144131,144089,144047,144005,143963,143921,143879,143837,143795,143753,143711,143669,143627,143585,143543,143501,143459,143417,143375,143333,143291,143248,143206,143164,143122,143080,143038,142996,142954,142912,142869,142827,142785,142743,142701,142659,142616,142574,142532,142490,142448,142405,142363,142321,142279,142237,142194,142152,142110,142068,142025,141983,141941,141899,141856,141814,141772,141730,141687,141645,141603,141560,141518,141476,141433,141391,141349,141306,141264,141222,141179,141137,141095,141052,141010,140968,140925,140883,140840,140798,140756,140713,140671,140628,140586,140544,140501,140459,140416,140374,140331,140289,140246,140204,140161,140119,140077,140034,139992,139949,139907,139864,139821,139779,139736,139694,139651,139609,139566,139524,139481,139439,139396,139353,139311,139268,139226,139183,139141,139098,139055,139013,138970,138927,138885,138842,138800,138757,138714,138672,138629,138586,138544,138501,138458,138416,138373,138330,138288,138245,138202,138159,138117,138074,138031,137988,137946,137903,137860,137817,137775,137732,137689,137646,137604,137561,137518,137475,137432,137390,137347,137304,137261,137218,137176,137133,137090,137047,137004,136961,136918,136876,136833,136790,136747,136704,136661,136618,136575,136532,136490,136447,136404,136361,136318,136275,136232,136189,136146,136103,136060,136017,135974,135931,135888,135845,135802,135759,135716,135673,135630,135587,135544,135501,135458,135415,135372,135329,135286,135243,135200,135157,135114,135071,135028,134984,134941,134898,134855,134812,134769,134726,134683,134640,134596,134553,134510,134467,134424,134381,134338,134294,134251,134208,134165,134122,134078,134035,133992,133949,133906,133862,133819,133776,133733,133690,133646,133603,133560,133517,133473,133430,133387,133343,133300,133257,133214,133170,133127,133084,133040,132997,132954,132910,132867,132824,132780,132737,132694,132650,132607,132564,132520,132477,132434,132390,132347,132303,132260,132217,132173,132130,132086,132043,132000,131956,131913,131869,131826,131782,131739,131695,131652,131609,131565,131522,131478,131435,131391,131348,131304,131261,131217,131174,131130,131087,131043,130999,130956,130912,130869,130825,130782,130738,130695,130651,130607,130564,130520,130477,130433,130389,130346,130302,130259,130215,130171,130128,130084,130040,129997,129953,129909,129866,129822,129778,129735,129691,129647,129604,129560,129516,129473,129429,129385,129341,129298,129254,129210,129167,129123,129079,129035,128992,128948,128904,128860,128816,128773,128729,128685,128641,128598,128554,128510,128466,128422,128378,128335,128291,128247,128203,128159,128115,128072,128028,127984,127940,127896,127852,127808,127764,127721,127677,127633,127589,127545,127501,127457,127413,127369,127325,127281,127237,127193,127150,127106,127062,127018,126974,126930,126886,126842,126798,126754,126710,126666,126622,126578,126534,126490,126446,126402,126358,126314,126269,126225,126181,126137,126093,126049,126005,125961,125917,125873,125829,125785,125741,125696,125652,125608,125564,125520,125476,125432,125388,125343,125299,125255,125211,125167,125123,125078,125034,124990,124946,124902,124857,124813,124769,124725,124681,124636,124592,124548,124504,124460,124415,124371,124327,124283,124238,124194,124150,124105,124061,124017,123973,123928,123884,123840,123795,123751,123707,123662,123618,123574,123529,123485,123441,123396,123352,123308,123263,123219,123175,123130,123086,123042,122997,122953,122908,122864,122820,122775,122731,122686,122642,122597,122553,122509,122464,122420,122375,122331,122286,122242,122197,122153,122108,122064,122019,121975,121931,121886,121842,121797,121752,121708,121663,121619,121574,121530,121485,121441,121396,121352,121307,121263,121218,121173,121129,121084,121040,120995,120950,120906,120861,120817,120772,120727,120683,120638,120594,120549,120504,120460,120415,120370,120326,120281,120236,120192,120147,120102,120058,120013,119968,119924,119879,119834,119790,119745,119700,119655,119611,119566,119521,119476,119432,119387,119342,119297,119253,119208,119163,119118,119074,119029,118984,118939,118894,118850,118805,118760,118715,118670,118626,118581,118536,118491,118446,118401,118357,118312,118267,118222,118177,118132,118087,118042,117998,117953,117908,117863,117818,117773,117728,117683,117638,117593,117549,117504,117459,117414,117369,117324,117279,117234,117189,117144,117099,117054,117009,116964,116919,116874,116829,116784,116739,116694,116649,116604,116559,116514,116469,116424,116379,116334,116289,116244,116199,116154,116109,116064,116018,115973,115928,115883,115838,115793,115748,115703,115658,115613,115567,115522,115477,115432,115387,115342,115297,115252,115206,115161,115116,115071,115026,114981,114935,114890,114845,114800,114755,114710,114664,114619,114574,114529,114483,114438,114393,114348,114303,114257,114212,114167,114122,114076,114031,113986,113941,113895,113850,113805,113759,113714,113669,113624,113578,113533,113488,113442,113397,113352,113306,113261,113216,113170,113125,113080,113034,112989,112944,112898,112853,112808,112762,112717,112671,112626,112581,112535,112490,112444,112399,112354,112308,112263,112217,112172,112126,112081,112036,111990,111945,111899,111854,111808,111763,111717,111672,111626,111581,111535,111490,111444,111399,111353,111308,111262,111217,111171,111126,111080,111035,110989,110944,110898,110853,110807,110762,110716,110670,110625,110579,110534,110488,110443,110397,110351,110306,110260,110215,110169,110123,110078,110032,109986,109941,109895,109850,109804,109758,109713,109667,109621,109576,109530,109484,109439,109393,109347,109302,109256,109210,109165,109119,109073,109027,108982,108936,108890,108845,108799,108753,108707,108662,108616,108570,108524,108479,108433,108387,108341,108295,108250,108204,108158,108112,108067,108021,107975,107929,107883,107838,107792,107746,107700,107654,107608,107563,107517,107471,107425,107379,107333,107287,107242,107196,107150,107104,107058,107012,106966,106920,106875,106829,106783,106737,106691,106645,106599,106553,106507,106461,106415,106369,106323,106278,106232,106186,106140,106094,106048,106002,105956,105910,105864,105818,105772,105726,105680,105634,105588,105542,105496,105450,105404,105358,105312,105266,105220,105174,105128,105082,105035,104989,104943,104897,104851,104805,104759,104713,104667,104621,104575,104529,104483,104436,104390,104344,104298,104252,104206,104160,104114,104067,104021,103975,103929,103883,103837,103791,103744,103698,103652,103606,103560,103514,103467,103421,103375,103329,103283,103236,103190,103144,103098,103052,103005,102959,102913,102867,102820,102774,102728,102682,102635,102589,102543,102497,102450,102404,102358,102312,102265,102219,102173,102126,102080,102034,101988,101941,101895,101849,101802,101756,101710,101663,101617,101571,101524,101478,101432,101385,101339,101293,101246,101200,101153,101107,101061,101014,100968,100922,100875,100829,100782,100736,100690,100643,100597,100550,100504,100457,100411,100365,100318,100272,100225,100179,100132,100086,100039,99993,99947,99900,99854,99807,99761,99714,99668,99621,99575,99528,99482,99435,99389,99342,99296,99249,99203,99156,99110,99063,99016,98970,98923,98877,98830,98784,98737,98691,98644,98597,98551,98504,98458,98411,98364,98318,98271,98225,98178,98131,98085,98038,97992,97945,97898,97852,97805,97758,97712,97665,97619,97572,97525,97479,97432,97385,97339,97292,97245,97199,97152,97105,97058,97012,96965,96918,96872,96825,96778,96732,96685,96638,96591,96545,96498,96451,96404,96358,96311,96264,96217,96171,96124,96077,96030,95984,95937,95890,95843,95796,95750,95703,95656,95609,95562,95516,95469,95422,95375,95328,95282,95235,95188,95141,95094,95047,95001,94954,94907,94860,94813,94766,94719,94673,94626,94579,94532,94485,94438,94391,94344,94297,94251,94204,94157,94110,94063,94016,93969,93922,93875,93828,93781,93734,93687,93640,93594,93547,93500,93453,93406,93359,93312,93265,93218,93171,93124,93077,93030,92983,92936,92889,92842,92795,92748,92701,92654,92607,92560,92513,92466,92419,92372,92325,92278,92230,92183,92136,92089,92042,91995,91948,91901,91854,91807,91760,91713,91666,91619,91571,91524,91477,91430,91383,91336,91289,91242,91195,91147,91100,91053,91006,90959,90912,90865,90817,90770,90723,90676,90629,90582,90534,90487,90440,90393,90346,90299,90251,90204,90157,90110,90063,90015,89968,89921,89874,89826,89779,89732,89685,89638,89590,89543,89496,89449,89401,89354,89307,89260,89212,89165,89118,89070,89023,88976,88929,88881,88834,88787,88739,88692,88645,88598,88550,88503,88456,88408,88361,88314,88266,88219,88172,88124,88077,88030,87982,87935,87888,87840,87793,87745,87698,87651,87603,87556,87509,87461,87414,87366,87319,87272,87224,87177,87129,87082,87035,86987,86940,86892,86845,86798,86750,86703,86655,86608,86560,86513,86465,86418,86371,86323,86276,86228,86181,86133,86086,86038,85991,85943,85896,85848,85801,85753,85706,85658,85611,85563,85516,85468,85421,85373,85326,85278,85231,85183,85136,85088,85040,84993,84945,84898,84850,84803,84755,84708,84660,84612,84565,84517,84470,84422,84374,84327,84279,84232,84184,84136,84089,84041,83994,83946,83898,83851,83803,83756,83708,83660,83613,83565,83517,83470,83422,83374,83327,83279,83231,83184,83136,83088,83041,82993,82945,82898,82850,82802,82755,82707,82659,82612,82564,82516,82468,82421,82373,82325,82278,82230,82182,82134,82087,82039,81991,81943,81896,81848,81800,81752,81705,81657,81609,81561,81514,81466,81418,81370,81322,81275,81227,81179,81131,81083,81036,80988,80940,80892,80844,80797,80749,80701,80653,80605,80557,80510,80462,80414,80366,80318,80270,80223,80175,80127,80079,80031,79983,79935,79887,79840,79792,79744,79696,79648,79600,79552,79504,79457,79409,79361,79313,79265,79217,79169,79121,79073,79025,78977,78929,78881,78834,78786,78738,78690,78642,78594,78546,78498,78450,78402,78354,78306,78258,78210,78162,78114,78066,78018,77970,77922,77874,77826,77778,77730,77682,77634,77586,77538,77490,77442,77394,77346,77298,77250,77202,77154,77106,77058,77010,76962,76914,76866,76818,76770,76721,76673,76625,76577,76529,76481,76433,76385,76337,76289,76241,76193,76144,76096,76048,76000,75952,75904,75856,75808,75760,75711,75663,75615,75567,75519,75471,75423,75375,75326,75278,75230,75182,75134,75086,75037,74989,74941,74893,74845,74797,74748,74700,74652,74604,74556,74508,74459,74411,74363,74315,74267,74218,74170,74122,74074,74025,73977,73929,73881,73833,73784,73736,73688,73640,73591,73543,73495,73447,73398,73350,73302,73254,73205,73157,73109,73061,73012,72964,72916,72867,72819,72771,72723,72674,72626,72578,72529,72481,72433,72384,72336,72288,72239,72191,72143,72095,72046,71998,71950,71901,71853,71805,71756,71708,71659,71611,71563,71514,71466,71418,71369,71321,71273,71224,71176,71127,71079,71031,70982,70934,70886,70837,70789,70740,70692,70644,70595,70547,70498,70450,70401,70353,70305,70256,70208,70159,70111,70062,70014,69966,69917,69869,69820,69772,69723,69675,69626,69578,69530,69481,69433,69384,69336,69287,69239,69190,69142,69093,69045,68996,68948,68899,68851,68802,68754,68705,68657,68608,68560,68511,68463,68414,68366,68317,68269,68220,68171,68123,68074,68026,67977,67929,67880,67832,67783,67735,67686,67637,67589,67540,67492,67443,67395,67346,67297,67249,67200,67152,67103,67055,67006,66957,66909,66860,66812,66763,66714,66666,66617,66568,66520,66471,66423,66374,66325,66277,66228,66179,66131,66082,66034,65985,65936,65888,65839,65790,65742,65693,65644,65596,65547,65498,65450,65401,65352,65304,65255,65206,65158,65109,65060,65011,64963,64914,64865,64817,64768,64719,64671,64622,64573,64524,64476,64427,64378,64329,64281,64232,64183,64135,64086,64037,63988,63940,63891,63842,63793,63745,63696,63647,63598,63550,63501,63452,63403,63354,63306,63257,63208,63159,63111,63062,63013,62964,62915,62867,62818,62769,62720,62671,62623,62574,62525,62476,62427,62378,62330,62281,62232,62183,62134,62085,62037,61988,61939,61890,61841,61792,61744,61695,61646,61597,61548,61499,61450,61402,61353,61304,61255,61206,61157,61108,61059,61011,60962,60913,60864,60815,60766,60717,60668,60619,60570,60522,60473,60424,60375,60326,60277,60228,60179,60130,60081,60032,59983,59935,59886,59837,59788,59739,59690,59641,59592,59543,59494,59445,59396,59347,59298,59249,59200,59151,59102,59053,59004,58955,58906,58857,58808,58759,58711,58662,58613,58564,58515,58466,58417,58368,58319,58270,58221,58171,58122,58073,58024,57975,57926,57877,57828,57779,57730,57681,57632,57583,57534,57485,57436,57387,57338,57289,57240,57191,57142,57093,57044,56995,56946,56896,56847,56798,56749,56700,56651,56602,56553,56504,56455,56406,56357,56308,56258,56209,56160,56111,56062,56013,55964,55915,55866,55816,55767,55718,55669,55620,55571,55522,55473,55424,55374,55325,55276,55227,55178,55129,55080,55030,54981,54932,54883,54834,54785,54736,54686,54637,54588,54539,54490,54441,54391,54342,54293,54244,54195,54145,54096,54047,53998,53949,53900,53850,53801,53752,53703,53654,53604,53555,53506,53457,53408,53358,53309,53260,53211,53161,53112,53063,53014,52965,52915,52866,52817,52768,52718,52669,52620,52571,52521,52472,52423,52374,52324,52275,52226,52177,52127,52078,52029,51980,51930,51881,51832,51782,51733,51684,51635,51585,51536,51487,51438,51388,51339,51290,51240,51191,51142,51092,51043,50994,50945,50895,50846,50797,50747,50698,50649,50599,50550,50501,50451,50402,50353,50303,50254,50205,50155,50106,50057,50007,49958,49909,49859,49810,49761,49711,49662,49613,49563,49514,49464,49415,49366,49316,49267,49218,49168,49119,49070,49020,48971,48921,48872,48823,48773,48724,48674,48625,48576,48526,48477,48427,48378,48329,48279,48230,48180,48131,48082,48032,47983,47933,47884,47835,47785,47736,47686,47637,47587,47538,47489,47439,47390,47340,47291,47241,47192,47142,47093,47044,46994,46945,46895,46846,46796,46747,46697,46648,46598,46549,46500,46450,46401,46351,46302,46252,46203,46153,46104,46054,46005,45955,45906,45856,45807,45757,45708,45658,45609,45559,45510,45460,45411,45361,45312,45262,45213,45163,45114,45064,45015,44965,44916,44866,44817,44767,44718,44668,44619,44569,44519,44470,44420,44371,44321,44272,44222,44173,44123,44074,44024,43974,43925,43875,43826,43776,43727,43677,43628,43578,43528,43479,43429,43380,43330,43281,43231,43181,43132,43082,43033,42983,42933,42884,42834,42785,42735,42686,42636,42586,42537,42487,42438,42388,42338,42289,42239,42190,42140,42090,42041,41991,41941,41892,41842,41793,41743,41693,41644,41594,41544,41495,41445,41396,41346,41296,41247,41197,41147,41098,41048,40998,40949,40899,40849,40800,40750,40701,40651,40601,40552,40502,40452,40403,40353,40303,40254,40204,40154,40105,40055,40005,39956,39906,39856,39806,39757,39707,39657,39608,39558,39508,39459,39409,39359,39310,39260,39210,39160,39111,39061,39011,38962,38912,38862,38813,38763,38713,38663,38614,38564,38514,38465,38415,38365,38315,38266,38216,38166,38116,38067,38017,37967,37917,37868,37818,37768,37719,37669,37619,37569,37520,37470,37420,37370,37321,37271,37221,37171,37122,37072,37022,36972,36922,36873,36823,36773,36723,36674,36624,36574,36524,36475,36425,36375,36325,36275,36226,36176,36126,36076,36027,35977,35927,35877,35827,35778,35728,35678,35628,35578,35529,35479,35429,35379,35329,35280,35230,35180,35130,35080,35030,34981,34931,34881,34831,34781,34732,34682,34632,34582,34532,34482,34433,34383,34333,34283,34233,34183,34134,34084,34034,33984,33934,33884,33835,33785,33735,33685,33635,33585,33535,33486,33436,33386,33336,33286,33236,33186,33137,33087,33037,32987,32937,32887,32837,32788,32738,32688,32638,32588,32538,32488,32438,32389,32339,32289,32239,32189,32139,32089,32039,31989,31940,31890,31840,31790,31740,31690,31640,31590,31540,31490,31441,31391,31341,31291,31241,31191,31141,31091,31041,30991,30942,30892,30842,30792,30742,30692,30642,30592,30542,30492,30442,30392,30342,30293,30243,30193,30143,30093,30043,29993,29943,29893,29843,29793,29743,29693,29643,29593,29543,29494,29444,29394,29344,29294,29244,29194,29144,29094,29044,28994,28944,28894,28844,28794,28744,28694,28644,28594,28544,28494,28444,28394,28344,28295,28245,28195,28145,28095,28045,27995,27945,27895,27845,27795,27745,27695,27645,27595,27545,27495,27445,27395,27345,27295,27245,27195,27145,27095,27045,26995,26945,26895,26845,26795,26745,26695,26645,26595,26545,26495,26445,26395,26345,26295,26245,26195,26145,26095,26045,25995,25945,25895,25845,25795,25745,25695,25645,25595,25545,25495,25444,25394,25344,25294,25244,25194,25144,25094,25044,24994,24944,24894,24844,24794,24744,24694,24644,24594,24544,24494,24444,24394,24344,24294,24244,24193,24143,24093,24043,23993,23943,23893,23843,23793,23743,23693,23643,23593,23543,23493,23443,23393,23342,23292,23242,23192,23142,23092,23042,22992,22942,22892,22842,22792,22742,22692,22641,22591,22541,22491,22441,22391,22341,22291,22241,22191,22141,22091,22040,21990,21940,21890,21840,21790,21740,21690,21640,21590,21540,21489,21439,21389,21339,21289,21239,21189,21139,21089,21039,20988,20938,20888,20838,20788,20738,20688,20638,20588,20538,20487,20437,20387,20337,20287,20237,20187,20137,20086,20036,19986,19936,19886,19836,19786,19736,19686,19635,19585,19535,19485,19435,19385,19335,19285,19234,19184,19134,19084,19034,18984,18934,18883,18833,18783,18733,18683,18633,18583,18532,18482,18432,18382,18332,18282,18232,18181,18131,18081,18031,17981,17931,17881,17830,17780,17730,17680,17630,17580,17530,17479,17429,17379,17329,17279,17229,17178,17128,17078,17028,16978,16928,16878,16827,16777,16727,16677,16627,16577,16526,16476,16426,16376,16326,16276,16225,16175,16125,16075,16025,15975,15924,15874,15824,15774,15724,15673,15623,15573,15523,15473,15423,15372,15322,15272,15222,15172,15122,15071,15021,14971,14921,14871,14820,14770,14720,14670,14620,14569,14519,14469,14419,14369,14319,14268,14218,14168,14118,14068,14017,13967,13917,13867,13817,13766,13716,13666,13616,13566,13515,13465,13415,13365,13315,13264,13214,13164,13114,13064,13013,12963,12913,12863,12813,12762,12712,12662,12612,12562,12511,12461,12411,12361,12311,12260,12210,12160,12110,12059,12009,11959,11909,11859,11808,11758,11708,11658,11608,11557,11507,11457,11407,11356,11306,11256,11206,11156,11105,11055,11005,10955,10904,10854,10804,10754,10704,10653,10603,10553,10503,10452,10402,10352,10302,10252,10201,10151,10101,10051,10000,9950,9900,9850,9799,9749,9699,9649,9599,9548,9498,9448,9398,9347,9297,9247,9197,9146,9096,9046,8996,8946,8895,8845,8795,8745,8694,8644,8594,8544,8493,8443,8393,8343,8292,8242,8192,8142,8091,8041,7991,7941,7890,7840,7790,7740,7690,7639,7589,7539,7489,7438,7388,7338,7288,7237,7187,7137,7087,7036,6986,6936,6886,6835,6785,6735,6685,6634,6584,6534,6484,6433,6383,6333,6283,6232,6182,6132,6082,6031,5981,5931,5881,5830,5780,5730,5680,5629,5579,5529,5479,5428,5378,5328,5278,5227,5177,5127,5076,5026,4976,4926,4875,4825,4775,4725,4674,4624,4574,4524,4473,4423,4373,4323,4272,4222,4172,4122,4071,4021,3971,3921,3870,3820,3770,3720,3669,3619,3569,3518,3468,3418,3368,3317,3267,3217,3167,3116,3066,3016,2966,2915,2865,2815,2765,2714,2664,2614,2563,2513,2463,2413,2362,2312,2262,2212,2161,2111,2061,2011,1960,1910,1860,1810,1759,1709,1659,1608,1558,1508,1458,1407,1357,1307,1257,1206,1156,1106,1056,1005,955,905,855,804,754,704,653,603,553,503,452,402,352,302,251,201,151,101,50,0,-49,-100,-150,-200,-250,-301,-351,-401,-451,-502,-552,-602,-652,-703,-753,-803,-854,-904,-954,-1004,-1055,-1105,-1155,-1205,-1256,-1306,-1356,-1406,-1457,-1507,-1557,-1607,-1658,-1708,-1758,-1809,-1859,-1909,-1959,-2010,-2060,-2110,-2160,-2211,-2261,-2311,-2361,-2412,-2462,-2512,-2562,-2613,-2663,-2713,-2764,-2814,-2864,-2914,-2965,-3015,-3065,-3115,-3166,-3216,-3266,-3316,-3367,-3417,-3467,-3517,-3568,-3618,-3668,-3719,-3769,-3819,-3869,-3920,-3970,-4020,-4070,-4121,-4171,-4221,-4271,-4322,-4372,-4422,-4472,-4523,-4573,-4623,-4673,-4724,-4774,-4824,-4874,-4925,-4975,-5025,-5075,-5126,-5176,-5226,-5277,-5327,-5377,-5427,-5478,-5528,-5578,-5628,-5679,-5729,-5779,-5829,-5880,-5930,-5980,-6030,-6081,-6131,-6181,-6231,-6282,-6332,-6382,-6432,-6483,-6533,-6583,-6633,-6684,-6734,-6784,-6834,-6885,-6935,-6985,-7035,-7086,-7136,-7186,-7236,-7287,-7337,-7387,-7437,-7488,-7538,-7588,-7638,-7689,-7739,-7789,-7839,-7889,-7940,-7990,-8040,-8090,-8141,-8191,-8241,-8291,-8342,-8392,-8442,-8492,-8543,-8593,-8643,-8693,-8744,-8794,-8844,-8894,-8945,-8995,-9045,-9095,-9145,-9196,-9246,-9296,-9346,-9397,-9447,-9497,-9547,-9598,-9648,-9698,-9748,-9798,-9849,-9899,-9949,-9999,-10050,-10100,-10150,-10200,-10251,-10301,-10351,-10401,-10451,-10502,-10552,-10602,-10652,-10703,-10753,-10803,-10853,-10903,-10954,-11004,-11054,-11104,-11155,-11205,-11255,-11305,-11355,-11406,-11456,-11506,-11556,-11607,-11657,-11707,-11757,-11807,-11858,-11908,-11958,-12008,-12058,-12109,-12159,-12209,-12259,-12310,-12360,-12410,-12460,-12510,-12561,-12611,-12661,-12711,-12761,-12812,-12862,-12912,-12962,-13012,-13063,-13113,-13163,-13213,-13263,-13314,-13364,-13414,-13464,-13514,-13565,-13615,-13665,-13715,-13765,-13816,-13866,-13916,-13966,-14016,-14067,-14117,-14167,-14217,-14267,-14318,-14368,-14418,-14468,-14518,-14568,-14619,-14669,-14719,-14769,-14819,-14870,-14920,-14970,-15020,-15070,-15121,-15171,-15221,-15271,-15321,-15371,-15422,-15472,-15522,-15572,-15622,-15672,-15723,-15773,-15823,-15873,-15923,-15974,-16024,-16074,-16124,-16174,-16224,-16275,-16325,-16375,-16425,-16475,-16525,-16576,-16626,-16676,-16726,-16776,-16826,-16877,-16927,-16977,-17027,-17077,-17127,-17177,-17228,-17278,-17328,-17378,-17428,-17478,-17529,-17579,-17629,-17679,-17729,-17779,-17829,-17880,-17930,-17980,-18030,-18080,-18130,-18180,-18231,-18281,-18331,-18381,-18431,-18481,-18531,-18582,-18632,-18682,-18732,-18782,-18832,-18882,-18933,-18983,-19033,-19083,-19133,-19183,-19233,-19284,-19334,-19384,-19434,-19484,-19534,-19584,-19634,-19685,-19735,-19785,-19835,-19885,-19935,-19985,-20035,-20085,-20136,-20186,-20236,-20286,-20336,-20386,-20436,-20486,-20537,-20587,-20637,-20687,-20737,-20787,-20837,-20887,-20937,-20987,-21038,-21088,-21138,-21188,-21238,-21288,-21338,-21388,-21438,-21488,-21539,-21589,-21639,-21689,-21739,-21789,-21839,-21889,-21939,-21989,-22039,-22090,-22140,-22190,-22240,-22290,-22340,-22390,-22440,-22490,-22540,-22590,-22640,-22691,-22741,-22791,-22841,-22891,-22941,-22991,-23041,-23091,-23141,-23191,-23241,-23291,-23341,-23392,-23442,-23492,-23542,-23592,-23642,-23692,-23742,-23792,-23842,-23892,-23942,-23992,-24042,-24092,-24142,-24192,-24243,-24293,-24343,-24393,-24443,-24493,-24543,-24593,-24643,-24693,-24743,-24793,-24843,-24893,-24943,-24993,-25043,-25093,-25143,-25193,-25243,-25293,-25343,-25393,-25443,-25494,-25544,-25594,-25644,-25694,-25744,-25794,-25844,-25894,-25944,-25994,-26044,-26094,-26144,-26194,-26244,-26294,-26344,-26394,-26444,-26494,-26544,-26594,-26644,-26694,-26744,-26794,-26844,-26894,-26944,-26994,-27044,-27094,-27144,-27194,-27244,-27294,-27344,-27394,-27444,-27494,-27544,-27594,-27644,-27694,-27744,-27794,-27844,-27894,-27944,-27994,-28044,-28094,-28144,-28194,-28244,-28294,-28343,-28393,-28443,-28493,-28543,-28593,-28643,-28693,-28743,-28793,-28843,-28893,-28943,-28993,-29043,-29093,-29143,-29193,-29243,-29293,-29343,-29393,-29443,-29493,-29542,-29592,-29642,-29692,-29742,-29792,-29842,-29892,-29942,-29992,-30042,-30092,-30142,-30192,-30242,-30292,-30341,-30391,-30441,-30491,-30541,-30591,-30641,-30691,-30741,-30791,-30841,-30891,-30941,-30990,-31040,-31090,-31140,-31190,-31240,-31290,-31340,-31390,-31440,-31489,-31539,-31589,-31639,-31689,-31739,-31789,-31839,-31889,-31939,-31988,-32038,-32088,-32138,-32188,-32238,-32288,-32338,-32388,-32437,-32487,-32537,-32587,-32637,-32687,-32737,-32787,-32836,-32886,-32936,-32986,-33036,-33086,-33136,-33185,-33235,-33285,-33335,-33385,-33435,-33485,-33534,-33584,-33634,-33684,-33734,-33784,-33834,-33883,-33933,-33983,-34033,-34083,-34133,-34182,-34232,-34282,-34332,-34382,-34432,-34481,-34531,-34581,-34631,-34681,-34731,-34780,-34830,-34880,-34930,-34980,-35029,-35079,-35129,-35179,-35229,-35279,-35328,-35378,-35428,-35478,-35528,-35577,-35627,-35677,-35727,-35777,-35826,-35876,-35926,-35976,-36026,-36075,-36125,-36175,-36225,-36274,-36324,-36374,-36424,-36474,-36523,-36573,-36623,-36673,-36722,-36772,-36822,-36872,-36921,-36971,-37021,-37071,-37121,-37170,-37220,-37270,-37320,-37369,-37419,-37469,-37519,-37568,-37618,-37668,-37718,-37767,-37817,-37867,-37916,-37966,-38016,-38066,-38115,-38165,-38215,-38265,-38314,-38364,-38414,-38464,-38513,-38563,-38613,-38662,-38712,-38762,-38812,-38861,-38911,-38961,-39010,-39060,-39110,-39159,-39209,-39259,-39309,-39358,-39408,-39458,-39507,-39557,-39607,-39656,-39706,-39756,-39805,-39855,-39905,-39955,-40004,-40054,-40104,-40153,-40203,-40253,-40302,-40352,-40402,-40451,-40501,-40551,-40600,-40650,-40700,-40749,-40799,-40848,-40898,-40948,-40997,-41047,-41097,-41146,-41196,-41246,-41295,-41345,-41395,-41444,-41494,-41543,-41593,-41643,-41692,-41742,-41792,-41841,-41891,-41940,-41990,-42040,-42089,-42139,-42189,-42238,-42288,-42337,-42387,-42437,-42486,-42536,-42585,-42635,-42685,-42734,-42784,-42833,-42883,-42932,-42982,-43032,-43081,-43131,-43180,-43230,-43280,-43329,-43379,-43428,-43478,-43527,-43577,-43627,-43676,-43726,-43775,-43825,-43874,-43924,-43973,-44023,-44073,-44122,-44172,-44221,-44271,-44320,-44370,-44419,-44469,-44518,-44568,-44618,-44667,-44717,-44766,-44816,-44865,-44915,-44964,-45014,-45063,-45113,-45162,-45212,-45261,-45311,-45360,-45410,-45459,-45509,-45558,-45608,-45657,-45707,-45756,-45806,-45855,-45905,-45954,-46004,-46053,-46103,-46152,-46202,-46251,-46301,-46350,-46400,-46449,-46499,-46548,-46597,-46647,-46696,-46746,-46795,-46845,-46894,-46944,-46993,-47043,-47092,-47141,-47191,-47240,-47290,-47339,-47389,-47438,-47488,-47537,-47586,-47636,-47685,-47735,-47784,-47834,-47883,-47932,-47982,-48031,-48081,-48130,-48179,-48229,-48278,-48328,-48377,-48426,-48476,-48525,-48575,-48624,-48673,-48723,-48772,-48822,-48871,-48920,-48970,-49019,-49069,-49118,-49167,-49217,-49266,-49315,-49365,-49414,-49463,-49513,-49562,-49612,-49661,-49710,-49760,-49809,-49858,-49908,-49957,-50006,-50056,-50105,-50154,-50204,-50253,-50302,-50352,-50401,-50450,-50500,-50549,-50598,-50648,-50697,-50746,-50796,-50845,-50894,-50944,-50993,-51042,-51091,-51141,-51190,-51239,-51289,-51338,-51387,-51437,-51486,-51535,-51584,-51634,-51683,-51732,-51781,-51831,-51880,-51929,-51979,-52028,-52077,-52126,-52176,-52225,-52274,-52323,-52373,-52422,-52471,-52520,-52570,-52619,-52668,-52717,-52767,-52816,-52865,-52914,-52964,-53013,-53062,-53111,-53160,-53210,-53259,-53308,-53357,-53407,-53456,-53505,-53554,-53603,-53653,-53702,-53751,-53800,-53849,-53899,-53948,-53997,-54046,-54095,-54144,-54194,-54243,-54292,-54341,-54390,-54440,-54489,-54538,-54587,-54636,-54685,-54735,-54784,-54833,-54882,-54931,-54980,-55029,-55079,-55128,-55177,-55226,-55275,-55324,-55373,-55423,-55472,-55521,-55570,-55619,-55668,-55717,-55766,-55815,-55865,-55914,-55963,-56012,-56061,-56110,-56159,-56208,-56257,-56307,-56356,-56405,-56454,-56503,-56552,-56601,-56650,-56699,-56748,-56797,-56846,-56895,-56945,-56994,-57043,-57092,-57141,-57190,-57239,-57288,-57337,-57386,-57435,-57484,-57533,-57582,-57631,-57680,-57729,-57778,-57827,-57876,-57925,-57974,-58023,-58072,-58121,-58170,-58220,-58269,-58318,-58367,-58416,-58465,-58514,-58563,-58612,-58661,-58710,-58758,-58807,-58856,-58905,-58954,-59003,-59052,-59101,-59150,-59199,-59248,-59297,-59346,-59395,-59444,-59493,-59542,-59591,-59640,-59689,-59738,-59787,-59836,-59885,-59934,-59982,-60031,-60080,-60129,-60178,-60227,-60276,-60325,-60374,-60423,-60472,-60521,-60569,-60618,-60667,-60716,-60765,-60814,-60863,-60912,-60961,-61010,-61058,-61107,-61156,-61205,-61254,-61303,-61352,-61401,-61449,-61498,-61547,-61596,-61645,-61694,-61743,-61791,-61840,-61889,-61938,-61987,-62036,-62084,-62133,-62182,-62231,-62280,-62329,-62377,-62426,-62475,-62524,-62573,-62622,-62670,-62719,-62768,-62817,-62866,-62914,-62963,-63012,-63061,-63110,-63158,-63207,-63256,-63305,-63353,-63402,-63451,-63500,-63549,-63597,-63646,-63695,-63744,-63792,-63841,-63890,-63939,-63987,-64036,-64085,-64134,-64182,-64231,-64280,-64328,-64377,-64426,-64475,-64523,-64572,-64621,-64670,-64718,-64767,-64816,-64864,-64913,-64962,-65010,-65059,-65108,-65157,-65205,-65254,-65303,-65351,-65400,-65449,-65497,-65546,-65595,-65643,-65692,-65741,-65789,-65838,-65887,-65935,-65984,-66033,-66081,-66130,-66178,-66227,-66276,-66324,-66373,-66422,-66470,-66519,-66567,-66616,-66665,-66713,-66762,-66811,-66859,-66908,-66956,-67005,-67054,-67102,-67151,-67199,-67248,-67296,-67345,-67394,-67442,-67491,-67539,-67588,-67636,-67685,-67734,-67782,-67831,-67879,-67928,-67976,-68025,-68073,-68122,-68170,-68219,-68268,-68316,-68365,-68413,-68462,-68510,-68559,-68607,-68656,-68704,-68753,-68801,-68850,-68898,-68947,-68995,-69044,-69092,-69141,-69189,-69238,-69286,-69335,-69383,-69432,-69480,-69529,-69577,-69625,-69674,-69722,-69771,-69819,-69868,-69916,-69965,-70013,-70061,-70110,-70158,-70207,-70255,-70304,-70352,-70400,-70449,-70497,-70546,-70594,-70643,-70691,-70739,-70788,-70836,-70885,-70933,-70981,-71030,-71078,-71126,-71175,-71223,-71272,-71320,-71368,-71417,-71465,-71513,-71562,-71610,-71658,-71707,-71755,-71804,-71852,-71900,-71949,-71997,-72045,-72094,-72142,-72190,-72238,-72287,-72335,-72383,-72432,-72480,-72528,-72577,-72625,-72673,-72722,-72770,-72818,-72866,-72915,-72963,-73011,-73060,-73108,-73156,-73204,-73253,-73301,-73349,-73397,-73446,-73494,-73542,-73590,-73639,-73687,-73735,-73783,-73832,-73880,-73928,-73976,-74024,-74073,-74121,-74169,-74217,-74266,-74314,-74362,-74410,-74458,-74507,-74555,-74603,-74651,-74699,-74747,-74796,-74844,-74892,-74940,-74988,-75036,-75085,-75133,-75181,-75229,-75277,-75325,-75374,-75422,-75470,-75518,-75566,-75614,-75662,-75710,-75759,-75807,-75855,-75903,-75951,-75999,-76047,-76095,-76143,-76192,-76240,-76288,-76336,-76384,-76432,-76480,-76528,-76576,-76624,-76672,-76720,-76769,-76817,-76865,-76913,-76961,-77009,-77057,-77105,-77153,-77201,-77249,-77297,-77345,-77393,-77441,-77489,-77537,-77585,-77633,-77681,-77729,-77777,-77825,-77873,-77921,-77969,-78017,-78065,-78113,-78161,-78209,-78257,-78305,-78353,-78401,-78449,-78497,-78545,-78593,-78641,-78689,-78737,-78785,-78833,-78880,-78928,-78976,-79024,-79072,-79120,-79168,-79216,-79264,-79312,-79360,-79408,-79456,-79503,-79551,-79599,-79647,-79695,-79743,-79791,-79839,-79886,-79934,-79982,-80030,-80078,-80126,-80174,-80222,-80269,-80317,-80365,-80413,-80461,-80509,-80556,-80604,-80652,-80700,-80748,-80796,-80843,-80891,-80939,-80987,-81035,-81082,-81130,-81178,-81226,-81274,-81321,-81369,-81417,-81465,-81513,-81560,-81608,-81656,-81704,-81751,-81799,-81847,-81895,-81942,-81990,-82038,-82086,-82133,-82181,-82229,-82277,-82324,-82372,-82420,-82467,-82515,-82563,-82611,-82658,-82706,-82754,-82801,-82849,-82897,-82944,-82992,-83040,-83087,-83135,-83183,-83230,-83278,-83326,-83373,-83421,-83469,-83516,-83564,-83612,-83659,-83707,-83755,-83802,-83850,-83897,-83945,-83993,-84040,-84088,-84135,-84183,-84231,-84278,-84326,-84373,-84421,-84469,-84516,-84564,-84611,-84659,-84707,-84754,-84802,-84849,-84897,-84944,-84992,-85039,-85087,-85135,-85182,-85230,-85277,-85325,-85372,-85420,-85467,-85515,-85562,-85610,-85657,-85705,-85752,-85800,-85847,-85895,-85942,-85990,-86037,-86085,-86132,-86180,-86227,-86275,-86322,-86370,-86417,-86464,-86512,-86559,-86607,-86654,-86702,-86749,-86797,-86844,-86891,-86939,-86986,-87034,-87081,-87128,-87176,-87223,-87271,-87318,-87365,-87413,-87460,-87508,-87555,-87602,-87650,-87697,-87744,-87792,-87839,-87887,-87934,-87981,-88029,-88076,-88123,-88171,-88218,-88265,-88313,-88360,-88407,-88455,-88502,-88549,-88597,-88644,-88691,-88738,-88786,-88833,-88880,-88928,-88975,-89022,-89069,-89117,-89164,-89211,-89259,-89306,-89353,-89400,-89448,-89495,-89542,-89589,-89637,-89684,-89731,-89778,-89825,-89873,-89920,-89967,-90014,-90062,-90109,-90156,-90203,-90250,-90298,-90345,-90392,-90439,-90486,-90533,-90581,-90628,-90675,-90722,-90769,-90816,-90864,-90911,-90958,-91005,-91052,-91099,-91146,-91194,-91241,-91288,-91335,-91382,-91429,-91476,-91523,-91570,-91618,-91665,-91712,-91759,-91806,-91853,-91900,-91947,-91994,-92041,-92088,-92135,-92182,-92229,-92277,-92324,-92371,-92418,-92465,-92512,-92559,-92606,-92653,-92700,-92747,-92794,-92841,-92888,-92935,-92982,-93029,-93076,-93123,-93170,-93217,-93264,-93311,-93358,-93405,-93452,-93499,-93546,-93593,-93639,-93686,-93733,-93780,-93827,-93874,-93921,-93968,-94015,-94062,-94109,-94156,-94203,-94250,-94296,-94343,-94390,-94437,-94484,-94531,-94578,-94625,-94672,-94718,-94765,-94812,-94859,-94906,-94953,-95000,-95046,-95093,-95140,-95187,-95234,-95281,-95327,-95374,-95421,-95468,-95515,-95561,-95608,-95655,-95702,-95749,-95795,-95842,-95889,-95936,-95983,-96029,-96076,-96123,-96170,-96216,-96263,-96310,-96357,-96403,-96450,-96497,-96544,-96590,-96637,-96684,-96731,-96777,-96824,-96871,-96917,-96964,-97011,-97057,-97104,-97151,-97198,-97244,-97291,-97338,-97384,-97431,-97478,-97524,-97571,-97618,-97664,-97711,-97757,-97804,-97851,-97897,-97944,-97991,-98037,-98084,-98130,-98177,-98224,-98270,-98317,-98363,-98410,-98457,-98503,-98550,-98596,-98643,-98690,-98736,-98783,-98829,-98876,-98922,-98969,-99015,-99062,-99109,-99155,-99202,-99248,-99295,-99341,-99388,-99434,-99481,-99527,-99574,-99620,-99667,-99713,-99760,-99806,-99853,-99899,-99946,-99992,-100038,-100085,-100131,-100178,-100224,-100271,-100317,-100364,-100410,-100456,-100503,-100549,-100596,-100642,-100689,-100735,-100781,-100828,-100874,-100921,-100967,-101013,-101060,-101106,-101152,-101199,-101245,-101292,-101338,-101384,-101431,-101477,-101523,-101570,-101616,-101662,-101709,-101755,-101801,-101848,-101894,-101940,-101987,-102033,-102079,-102125,-102172,-102218,-102264,-102311,-102357,-102403,-102449,-102496,-102542,-102588,-102634,-102681,-102727,-102773,-102819,-102866,-102912,-102958,-103004,-103051,-103097,-103143,-103189,-103235,-103282,-103328,-103374,-103420,-103466,-103513,-103559,-103605,-103651,-103697,-103743,-103790,-103836,-103882,-103928,-103974,-104020,-104066,-104113,-104159,-104205,-104251,-104297,-104343,-104389,-104435,-104482,-104528,-104574,-104620,-104666,-104712,-104758,-104804,-104850,-104896,-104942,-104988,-105034,-105081,-105127,-105173,-105219,-105265,-105311,-105357,-105403,-105449,-105495,-105541,-105587,-105633,-105679,-105725,-105771,-105817,-105863,-105909,-105955,-106001,-106047,-106093,-106139,-106185,-106231,-106277,-106322,-106368,-106414,-106460,-106506,-106552,-106598,-106644,-106690,-106736,-106782,-106828,-106874,-106919,-106965,-107011,-107057,-107103,-107149,-107195,-107241,-107286,-107332,-107378,-107424,-107470,-107516,-107562,-107607,-107653,-107699,-107745,-107791,-107837,-107882,-107928,-107974,-108020,-108066,-108111,-108157,-108203,-108249,-108294,-108340,-108386,-108432,-108478,-108523,-108569,-108615,-108661,-108706,-108752,-108798,-108844,-108889,-108935,-108981,-109026,-109072,-109118,-109164,-109209,-109255,-109301,-109346,-109392,-109438,-109483,-109529,-109575,-109620,-109666,-109712,-109757,-109803,-109849,-109894,-109940,-109985,-110031,-110077,-110122,-110168,-110214,-110259,-110305,-110350,-110396,-110442,-110487,-110533,-110578,-110624,-110669,-110715,-110761,-110806,-110852,-110897,-110943,-110988,-111034,-111079,-111125,-111170,-111216,-111261,-111307,-111352,-111398,-111443,-111489,-111534,-111580,-111625,-111671,-111716,-111762,-111807,-111853,-111898,-111944,-111989,-112035,-112080,-112125,-112171,-112216,-112262,-112307,-112353,-112398,-112443,-112489,-112534,-112580,-112625,-112670,-112716,-112761,-112807,-112852,-112897,-112943,-112988,-113033,-113079,-113124,-113169,-113215,-113260,-113305,-113351,-113396,-113441,-113487,-113532,-113577,-113623,-113668,-113713,-113758,-113804,-113849,-113894,-113940,-113985,-114030,-114075,-114121,-114166,-114211,-114256,-114302,-114347,-114392,-114437,-114482,-114528,-114573,-114618,-114663,-114709,-114754,-114799,-114844,-114889,-114934,-114980,-115025,-115070,-115115,-115160,-115205,-115251,-115296,-115341,-115386,-115431,-115476,-115521,-115566,-115612,-115657,-115702,-115747,-115792,-115837,-115882,-115927,-115972,-116017,-116063,-116108,-116153,-116198,-116243,-116288,-116333,-116378,-116423,-116468,-116513,-116558,-116603,-116648,-116693,-116738,-116783,-116828,-116873,-116918,-116963,-117008,-117053,-117098,-117143,-117188,-117233,-117278,-117323,-117368,-117413,-117458,-117503,-117548,-117592,-117637,-117682,-117727,-117772,-117817,-117862,-117907,-117952,-117997,-118041,-118086,-118131,-118176,-118221,-118266,-118311,-118356,-118400,-118445,-118490,-118535,-118580,-118625,-118669,-118714,-118759,-118804,-118849,-118893,-118938,-118983,-119028,-119073,-119117,-119162,-119207,-119252,-119296,-119341,-119386,-119431,-119475,-119520,-119565,-119610,-119654,-119699,-119744,-119789,-119833,-119878,-119923,-119967,-120012,-120057,-120101,-120146,-120191,-120235,-120280,-120325,-120369,-120414,-120459,-120503,-120548,-120593,-120637,-120682,-120726,-120771,-120816,-120860,-120905,-120949,-120994,-121039,-121083,-121128,-121172,-121217,-121262,-121306,-121351,-121395,-121440,-121484,-121529,-121573,-121618,-121662,-121707,-121751,-121796,-121841,-121885,-121930,-121974,-122018,-122063,-122107,-122152,-122196,-122241,-122285,-122330,-122374,-122419,-122463,-122508,-122552,-122596,-122641,-122685,-122730,-122774,-122819,-122863,-122907,-122952,-122996,-123041,-123085,-123129,-123174,-123218,-123262,-123307,-123351,-123395,-123440,-123484,-123528,-123573,-123617,-123661,-123706,-123750,-123794,-123839,-123883,-123927,-123972,-124016,-124060,-124104,-124149,-124193,-124237,-124282,-124326,-124370,-124414,-124459,-124503,-124547,-124591,-124635,-124680,-124724,-124768,-124812,-124856,-124901,-124945,-124989,-125033,-125077,-125122,-125166,-125210,-125254,-125298,-125342,-125387,-125431,-125475,-125519,-125563,-125607,-125651,-125695,-125740,-125784,-125828,-125872,-125916,-125960,-126004,-126048,-126092,-126136,-126180,-126224,-126268,-126313,-126357,-126401,-126445,-126489,-126533,-126577,-126621,-126665,-126709,-126753,-126797,-126841,-126885,-126929,-126973,-127017,-127061,-127105,-127149,-127192,-127236,-127280,-127324,-127368,-127412,-127456,-127500,-127544,-127588,-127632,-127676,-127720,-127763,-127807,-127851,-127895,-127939,-127983,-128027,-128071,-128114,-128158,-128202,-128246,-128290,-128334,-128377,-128421,-128465,-128509,-128553,-128597,-128640,-128684,-128728,-128772,-128815,-128859,-128903,-128947,-128991,-129034,-129078,-129122,-129166,-129209,-129253,-129297,-129340,-129384,-129428,-129472,-129515,-129559,-129603,-129646,-129690,-129734,-129777,-129821,-129865,-129908,-129952,-129996,-130039,-130083,-130127,-130170,-130214,-130258,-130301,-130345,-130388,-130432,-130476,-130519,-130563,-130606,-130650,-130694,-130737,-130781,-130824,-130868,-130911,-130955,-130998,-131042,-131086,-131129,-131173,-131216,-131260,-131303,-131347,-131390,-131434,-131477,-131521,-131564,-131608,-131651,-131694,-131738,-131781,-131825,-131868,-131912,-131955,-131999,-132042,-132085,-132129,-132172,-132216,-132259,-132302,-132346,-132389,-132433,-132476,-132519,-132563,-132606,-132649,-132693,-132736,-132779,-132823,-132866,-132909,-132953,-132996,-133039,-133083,-133126,-133169,-133213,-133256,-133299,-133342,-133386,-133429,-133472,-133516,-133559,-133602,-133645,-133689,-133732,-133775,-133818,-133861,-133905,-133948,-133991,-134034,-134077,-134121,-134164,-134207,-134250,-134293,-134337,-134380,-134423,-134466,-134509,-134552,-134595,-134639,-134682,-134725,-134768,-134811,-134854,-134897,-134940,-134983,-135027,-135070,-135113,-135156,-135199,-135242,-135285,-135328,-135371,-135414,-135457,-135500,-135543,-135586,-135629,-135672,-135715,-135758,-135801,-135844,-135887,-135930,-135973,-136016,-136059,-136102,-136145,-136188,-136231,-136274,-136317,-136360,-136403,-136446,-136489,-136531,-136574,-136617,-136660,-136703,-136746,-136789,-136832,-136875,-136917,-136960,-137003,-137046,-137089,-137132,-137175,-137217,-137260,-137303,-137346,-137389,-137431,-137474,-137517,-137560,-137603,-137645,-137688,-137731,-137774,-137816,-137859,-137902,-137945,-137987,-138030,-138073,-138116,-138158,-138201,-138244,-138287,-138329,-138372,-138415,-138457,-138500,-138543,-138585,-138628,-138671,-138713,-138756,-138799,-138841,-138884,-138926,-138969,-139012,-139054,-139097,-139140,-139182,-139225,-139267,-139310,-139352,-139395,-139438,-139480,-139523,-139565,-139608,-139650,-139693,-139735,-139778,-139820,-139863,-139906,-139948,-139991,-140033,-140076,-140118,-140160,-140203,-140245,-140288,-140330,-140373,-140415,-140458,-140500,-140543,-140585,-140627,-140670,-140712,-140755,-140797,-140839,-140882,-140924,-140967,-141009,-141051,-141094,-141136,-141178,-141221,-141263,-141305,-141348,-141390,-141432,-141475,-141517,-141559,-141602,-141644,-141686,-141729,-141771,-141813,-141855,-141898,-141940,-141982,-142024,-142067,-142109,-142151,-142193,-142236,-142278,-142320,-142362,-142404,-142447,-142489,-142531,-142573,-142615,-142658,-142700,-142742,-142784,-142826,-142868,-142911,-142953,-142995,-143037,-143079,-143121,-143163,-143205,-143247,-143290,-143332,-143374,-143416,-143458,-143500,-143542,-143584,-143626,-143668,-143710,-143752,-143794,-143836,-143878,-143920,-143962,-144004,-144046,-144088,-144130,-144172,-144214,-144256,-144298,-144340,-144382,-144424,-144466,-144508,-144550,-144592,-144634,-144676,-144718,-144760,-144801,-144843,-144885,-144927,-144969,-145011,-145053,-145095,-145136,-145178,-145220,-145262,-145304,-145346,-145388,-145429,-145471,-145513,-145555,-145597,-145638,-145680,-145722,-145764,-145806,-145847,-145889,-145931,-145973,-146014,-146056,-146098,-146140,-146181,-146223,-146265,-146306,-146348,-146390,-146432,-146473,-146515,-146557,-146598,-146640,-146682,-146723,-146765,-146807,-146848,-146890,-146931,-146973,-147015,-147056,-147098,-147140,-147181,-147223,-147264,-147306,-147347,-147389,-147431,-147472,-147514,-147555,-147597,-147638,-147680,-147721,-147763,-147804,-147846,-147887,-147929,-147970,-148012,-148053,-148095,-148136,-148178,-148219,-148261,-148302,-148344,-148385,-148427,-148468,-148509,-148551,-148592,-148634,-148675,-148716,-148758,-148799,-148841,-148882,-148923,-148965,-149006,-149047,-149089,-149130,-149171,-149213,-149254,-149295,-149337,-149378,-149419,-149461,-149502,-149543,-149584,-149626,-149667,-149708,-149750,-149791,-149832,-149873,-149915,-149956,-149997,-150038,-150079,-150121,-150162,-150203,-150244,-150285,-150327,-150368,-150409,-150450,-150491,-150532,-150574,-150615,-150656,-150697,-150738,-150779,-150820,-150861,-150903,-150944,-150985,-151026,-151067,-151108,-151149,-151190,-151231,-151272,-151313,-151354,-151395,-151436,-151477,-151518,-151559,-151600,-151641,-151682,-151723,-151764,-151805,-151846,-151887,-151928,-151969,-152010,-152051,-152092,-152133,-152174,-152215,-152256,-152297,-152338,-152379,-152420,-152460,-152501,-152542,-152583,-152624,-152665,-152706,-152747,-152787,-152828,-152869,-152910,-152951,-152992,-153032,-153073,-153114,-153155,-153196,-153236,-153277,-153318,-153359,-153399,-153440,-153481,-153522,-153562,-153603,-153644,-153685,-153725,-153766,-153807,-153847,-153888,-153929,-153969,-154010,-154051,-154092,-154132,-154173,-154213,-154254,-154295,-154335,-154376,-154417,-154457,-154498,-154538,-154579,-154620,-154660,-154701,-154741,-154782,-154823,-154863,-154904,-154944,-154985,-155025,-155066,-155106,-155147,-155187,-155228,-155268,-155309,-155349,-155390,-155430,-155471,-155511,-155552,-155592,-155633,-155673,-155714,-155754,-155794,-155835,-155875,-155916,-155956,-155996,-156037,-156077,-156118,-156158,-156198,-156239,-156279,-156319,-156360,-156400,-156440,-156481,-156521,-156561,-156602,-156642,-156682,-156723,-156763,-156803,-156844,-156884,-156924,-156964,-157005,-157045,-157085,-157125,-157166,-157206,-157246,-157286,-157326,-157367,-157407,-157447,-157487,-157527,-157568,-157608,-157648,-157688,-157728,-157768,-157808,-157849,-157889,-157929,-157969,-158009,-158049,-158089,-158129,-158169,-158210,-158250,-158290,-158330,-158370,-158410,-158450,-158490,-158530,-158570,-158610,-158650,-158690,-158730,-158770,-158810,-158850,-158890,-158930,-158970,-159010,-159050,-159090,-159130,-159170,-159210,-159250,-159290,-159329,-159369,-159409,-159449,-159489,-159529,-159569,-159609,-159649,-159688,-159728,-159768,-159808,-159848,-159888,-159928,-159967,-160007,-160047,-160087,-160127,-160166,-160206,-160246,-160286,-160326,-160365,-160405,-160445,-160485,-160524,-160564,-160604,-160643,-160683,-160723,-160763,-160802,-160842,-160882,-160921,-160961,-161001,-161040,-161080,-161120,-161159,-161199,-161239,-161278,-161318,-161358,-161397,-161437,-161476,-161516,-161556,-161595,-161635,-161674,-161714,-161753,-161793,-161832,-161872,-161912,-161951,-161991,-162030,-162070,-162109,-162149,-162188,-162228,-162267,-162307,-162346,-162385,-162425,-162464,-162504,-162543,-162583,-162622,-162662,-162701,-162740,-162780,-162819,-162859,-162898,-162937,-162977,-163016,-163055,-163095,-163134,-163173,-163213,-163252,-163291,-163331,-163370,-163409,-163449,-163488,-163527,-163567,-163606,-163645,-163684,-163724,-163763,-163802,-163841,-163881,-163920,-163959,-163998,-164038,-164077,-164116,-164155,-164194,-164233,-164273,-164312,-164351,-164390,-164429,-164468,-164508,-164547,-164586,-164625,-164664,-164703,-164742,-164781,-164820,-164860,-164899,-164938,-164977,-165016,-165055,-165094,-165133,-165172,-165211,-165250,-165289,-165328,-165367,-165406,-165445,-165484,-165523,-165562,-165601,-165640,-165679,-165718,-165757,-165796,-165835,-165874,-165913,-165951,-165990,-166029,-166068,-166107,-166146,-166185,-166224,-166263,-166301,-166340,-166379,-166418,-166457,-166496,-166534,-166573,-166612,-166651,-166690,-166728,-166767,-166806,-166845,-166884,-166922,-166961,-167000,-167039,-167077,-167116,-167155,-167193,-167232,-167271,-167310,-167348,-167387,-167426,-167464,-167503,-167542,-167580,-167619,-167658,-167696,-167735,-167773,-167812,-167851,-167889,-167928,-167967,-168005,-168044,-168082,-168121,-168159,-168198,-168237,-168275,-168314,-168352,-168391,-168429,-168468,-168506,-168545,-168583,-168622,-168660,-168699,-168737,-168776,-168814,-168852,-168891,-168929,-168968,-169006,-169045,-169083,-169121,-169160,-169198,-169237,-169275,-169313,-169352,-169390,-169429,-169467,-169505,-169544,-169582,-169620,-169659,-169697,-169735,-169773,-169812,-169850,-169888,-169927,-169965,-170003,-170041,-170080,-170118,-170156,-170194,-170233,-170271,-170309,-170347,-170385,-170424,-170462,-170500,-170538,-170576,-170615,-170653,-170691,-170729,-170767,-170805,-170843,-170882,-170920,-170958,-170996,-171034,-171072,-171110,-171148,-171186,-171224,-171262,-171300,-171338,-171377,-171415,-171453,-171491,-171529,-171567,-171605,-171643,-171681,-171719,-171757,-171795,-171833,-171870,-171908,-171946,-171984,-172022,-172060,-172098,-172136,-172174,-172212,-172250,-172288,-172325,-172363,-172401,-172439,-172477,-172515,-172553,-172590,-172628,-172666,-172704,-172742,-172780,-172817,-172855,-172893,-172931,-172968,-173006,-173044,-173082,-173120,-173157,-173195,-173233,-173270,-173308,-173346,-173384,-173421,-173459,-173497,-173534,-173572,-173610,-173647,-173685,-173723,-173760,-173798,-173836,-173873,-173911,-173948,-173986,-174024,-174061,-174099,-174136,-174174,-174211,-174249,-174287,-174324,-174362,-174399,-174437,-174474,-174512,-174549,-174587,-174624,-174662,-174699,-174737,-174774,-174812,-174849,-174886,-174924,-174961,-174999,-175036,-175074,-175111,-175148,-175186,-175223,-175261,-175298,-175335,-175373,-175410,-175447,-175485,-175522,-175559,-175597,-175634,-175671,-175709,-175746,-175783,-175821,-175858,-175895,-175932,-175970,-176007,-176044,-176081,-176119,-176156,-176193,-176230,-176267,-176305,-176342,-176379,-176416,-176453,-176491,-176528,-176565,-176602,-176639,-176676,-176713,-176751,-176788,-176825,-176862,-176899,-176936,-176973,-177010,-177047,-177084,-177122,-177159,-177196,-177233,-177270,-177307,-177344,-177381,-177418,-177455,-177492,-177529,-177566,-177603,-177640,-177677,-177714,-177751,-177787,-177824,-177861,-177898,-177935,-177972,-178009,-178046,-178083,-178120,-178157,-178193,-178230,-178267,-178304,-178341,-178378,-178414,-178451,-178488,-178525,-178562,-178599,-178635,-178672,-178709,-178746,-178782,-178819,-178856,-178893,-178929,-178966,-179003,-179040,-179076,-179113,-179150,-179186,-179223,-179260,-179296,-179333,-179370,-179406,-179443,-179480,-179516,-179553,-179590,-179626,-179663,-179699,-179736,-179773,-179809,-179846,-179882,-179919,-179955,-179992,-180028,-180065,-180102,-180138,-180175,-180211,-180248,-180284,-180321,-180357,-180394,-180430,-180466,-180503,-180539,-180576,-180612,-180649,-180685,-180722,-180758,-180794,-180831,-180867,-180903,-180940,-180976,-181013,-181049,-181085,-181122,-181158,-181194,-181231,-181267,-181303,-181340,-181376,-181412,-181448,-181485,-181521,-181557,-181593,-181630,-181666,-181702,-181738,-181775,-181811,-181847,-181883,-181919,-181956,-181992,-182028,-182064,-182100,-182136,-182173,-182209,-182245,-182281,-182317,-182353,-182389,-182425,-182462,-182498,-182534,-182570,-182606,-182642,-182678,-182714,-182750,-182786,-182822,-182858,-182894,-182930,-182966,-183002,-183038,-183074,-183110,-183146,-183182,-183218,-183254,-183290,-183326,-183362,-183398,-183434,-183469,-183505,-183541,-183577,-183613,-183649,-183685,-183721,-183756,-183792,-183828,-183864,-183900,-183936,-183971,-184007,-184043,-184079,-184115,-184150,-184186,-184222,-184258,-184293,-184329,-184365,-184401,-184436,-184472,-184508,-184544,-184579,-184615,-184651,-184686,-184722,-184758,-184793,-184829,-184865,-184900,-184936,-184971,-185007,-185043,-185078,-185114,-185149,-185185,-185221,-185256,-185292,-185327,-185363,-185398,-185434,-185469,-185505,-185540,-185576,-185611,-185647,-185682,-185718,-185753,-185789,-185824,-185860,-185895,-185931,-185966,-186001,-186037,-186072,-186108,-186143,-186178,-186214,-186249,-186285,-186320,-186355,-186391,-186426,-186461,-186497,-186532,-186567,-186603,-186638,-186673,-186709,-186744,-186779,-186814,-186850,-186885,-186920,-186955,-186991,-187026,-187061,-187096,-187131,-187167,-187202,-187237,-187272,-187307,-187342,-187378,-187413,-187448,-187483,-187518,-187553,-187588,-187624,-187659,-187694,-187729,-187764,-187799,-187834,-187869,-187904,-187939,-187974,-188009,-188044,-188079,-188114,-188149,-188184,-188219,-188254,-188289,-188324,-188359,-188394,-188429,-188464,-188499,-188534,-188569,-188604,-188639,-188674,-188708,-188743,-188778,-188813,-188848,-188883,-188918,-188953,-188987,-189022,-189057,-189092,-189127,-189161,-189196,-189231,-189266,-189301,-189335,-189370,-189405,-189440,-189474,-189509,-189544,-189579,-189613,-189648,-189683,-189717,-189752,-189787,-189821,-189856,-189891,-189925,-189960,-189995,-190029,-190064,-190098,-190133,-190168,-190202,-190237,-190271,-190306,-190341,-190375,-190410,-190444,-190479,-190513,-190548,-190582,-190617,-190651,-190686,-190720,-190755,-190789,-190824,-190858,-190893,-190927,-190962,-190996,-191030,-191065,-191099,-191134,-191168,-191202,-191237,-191271,-191306,-191340,-191374,-191409,-191443,-191477,-191512,-191546,-191580,-191615,-191649,-191683,-191717,-191752,-191786,-191820,-191855,-191889,-191923,-191957,-191991,-192026,-192060,-192094,-192128,-192163,-192197,-192231,-192265,-192299,-192333,-192368,-192402,-192436,-192470,-192504,-192538,-192572,-192606,-192640,-192675,-192709,-192743,-192777,-192811,-192845,-192879,-192913,-192947,-192981,-193015,-193049,-193083,-193117,-193151,-193185,-193219,-193253,-193287,-193321,-193355,-193389,-193423,-193457,-193491,-193524,-193558,-193592,-193626,-193660,-193694,-193728,-193762,-193795,-193829,-193863,-193897,-193931,-193965,-193998,-194032,-194066,-194100,-194134,-194167,-194201,-194235,-194269,-194302,-194336,-194370,-194404,-194437,-194471,-194505,-194538,-194572,-194606,-194639,-194673,-194707,-194740,-194774,-194808,-194841,-194875,-194909,-194942,-194976,-195009,-195043,-195077,-195110,-195144,-195177,-195211,-195244,-195278,-195311,-195345,-195378,-195412,-195445,-195479,-195512,-195546,-195579,-195613,-195646,-195680,-195713,-195747,-195780,-195814,-195847,-195880,-195914,-195947,-195981,-196014,-196047,-196081,-196114,-196147,-196181,-196214,-196247,-196281,-196314,-196347,-196381,-196414,-196447,-196480,-196514,-196547,-196580,-196614,-196647,-196680,-196713,-196746,-196780,-196813,-196846,-196879,-196912,-196946,-196979,-197012,-197045,-197078,-197111,-197145,-197178,-197211,-197244,-197277,-197310,-197343,-197376,-197409,-197442,-197475,-197509,-197542,-197575,-197608,-197641,-197674,-197707,-197740,-197773,-197806,-197839,-197872,-197905,-197938,-197971,-198003,-198036,-198069,-198102,-198135,-198168,-198201,-198234,-198267,-198300,-198333,-198365,-198398,-198431,-198464,-198497,-198530,-198562,-198595,-198628,-198661,-198694,-198726,-198759,-198792,-198825,-198857,-198890,-198923,-198956,-198988,-199021,-199054,-199087,-199119,-199152,-199185,-199217,-199250,-199283,-199315,-199348,-199381,-199413,-199446,-199478,-199511,-199544,-199576,-199609,-199641,-199674,-199707,-199739,-199772,-199804,-199837,-199869,-199902,-199934,-199967,-199999,-200032,-200064,-200097,-200129,-200162,-200194,-200227,-200259,-200291,-200324,-200356,-200389,-200421,-200453,-200486,-200518,-200551,-200583,-200615,-200648,-200680,-200712,-200745,-200777,-200809,-200842,-200874,-200906,-200939,-200971,-201003,-201035,-201068,-201100,-201132,-201164,-201197,-201229,-201261,-201293,-201325,-201358,-201390,-201422,-201454,-201486,-201518,-201551,-201583,-201615,-201647,-201679,-201711,-201743,-201775,-201807,-201840,-201872,-201904,-201936,-201968,-202000,-202032,-202064,-202096,-202128,-202160,-202192,-202224,-202256,-202288,-202320,-202352,-202384,-202416,-202448,-202480,-202511,-202543,-202575,-202607,-202639,-202671,-202703,-202735,-202767,-202798,-202830,-202862,-202894,-202926,-202958,-202989,-203021,-203053,-203085,-203117,-203148,-203180,-203212,-203244,-203275,-203307,-203339,-203371,-203402,-203434,-203466,-203497,-203529,-203561,-203592,-203624,-203656,-203687,-203719,-203751,-203782,-203814,-203845,-203877,-203909,-203940,-203972,-204003,-204035,-204066,-204098,-204130,-204161,-204193,-204224,-204256,-204287,-204319,-204350,-204382,-204413,-204445,-204476,-204507,-204539,-204570,-204602,-204633,-204665,-204696,-204727,-204759,-204790,-204822,-204853,-204884,-204916,-204947,-204978,-205010,-205041,-205072,-205104,-205135,-205166,-205197,-205229,-205260,-205291,-205323,-205354,-205385,-205416,-205447,-205479,-205510,-205541,-205572,-205603,-205635,-205666,-205697,-205728,-205759,-205790,-205822,-205853,-205884,-205915,-205946,-205977,-206008,-206039,-206070,-206101,-206132,-206164,-206195,-206226,-206257,-206288,-206319,-206350,-206381,-206412,-206443,-206474,-206505,-206536,-206566,-206597,-206628,-206659,-206690,-206721,-206752,-206783,-206814,-206845,-206876,-206906,-206937,-206968,-206999,-207030,-207061,-207091,-207122,-207153,-207184,-207215,-207245,-207276,-207307,-207338,-207369,-207399,-207430,-207461,-207491,-207522,-207553,-207584,-207614,-207645,-207676,-207706,-207737,-207768,-207798,-207829,-207860,-207890,-207921,-207951,-207982,-208013,-208043,-208074,-208104,-208135,-208165,-208196,-208227,-208257,-208288,-208318,-208349,-208379,-208410,-208440,-208471,-208501,-208532,-208562,-208592,-208623,-208653,-208684,-208714,-208745,-208775,-208805,-208836,-208866,-208896,-208927,-208957,-208988,-209018,-209048,-209079,-209109,-209139,-209169,-209200,-209230,-209260,-209291,-209321,-209351,-209381,-209412,-209442,-209472,-209502,-209533,-209563,-209593,-209623,-209653,-209683,-209714,-209744,-209774,-209804,-209834,-209864,-209894,-209925,-209955,-209985,-210015,-210045,-210075,-210105,-210135,-210165,-210195,-210225,-210255,-210285,-210315,-210345,-210375,-210405,-210435,-210465,-210495,-210525,-210555,-210585,-210615,-210645,-210675,-210705,-210735,-210764,-210794,-210824,-210854,-210884,-210914,-210944,-210973,-211003,-211033,-211063,-211093,-211123,-211152,-211182,-211212,-211242,-211271,-211301,-211331,-211361,-211390,-211420,-211450,-211480,-211509,-211539,-211569,-211598,-211628,-211658,-211687,-211717,-211747,-211776,-211806,-211835,-211865,-211895,-211924,-211954,-211983,-212013,-212042,-212072,-212102,-212131,-212161,-212190,-212220,-212249,-212279,-212308,-212338,-212367,-212397,-212426,-212455,-212485,-212514,-212544,-212573,-212603,-212632,-212661,-212691,-212720,-212750,-212779,-212808,-212838,-212867,-212896,-212926,-212955,-212984,-213014,-213043,-213072,-213101,-213131,-213160,-213189,-213218,-213248,-213277,-213306,-213335,-213365,-213394,-213423,-213452,-213481,-213510,-213540,-213569,-213598,-213627,-213656,-213685,-213714,-213744,-213773,-213802,-213831,-213860,-213889,-213918,-213947,-213976,-214005,-214034,-214063,-214092,-214121,-214150,-214179,-214208,-214237,-214266,-214295,-214324,-214353,-214382,-214411,-214440,-214469,-214497,-214526,-214555,-214584,-214613,-214642,-214671,-214700,-214728,-214757,-214786,-214815,-214844,-214872,-214901,-214930,-214959,-214988,-215016,-215045,-215074,-215103,-215131,-215160,-215189,-215217,-215246,-215275,-215303,-215332,-215361,-215389,-215418,-215447,-215475,-215504,-215533,-215561,-215590,-215618,-215647,-215676,-215704,-215733,-215761,-215790,-215818,-215847,-215875,-215904,-215932,-215961,-215989,-216018,-216046,-216075,-216103,-216132,-216160,-216189,-216217,-216245,-216274,-216302,-216331,-216359,-216387,-216416,-216444,-216472,-216501,-216529,-216557,-216586,-216614,-216642,-216671,-216699,-216727,-216756,-216784,-216812,-216840,-216869,-216897,-216925,-216953,-216981,-217010,-217038,-217066,-217094,-217122,-217151,-217179,-217207,-217235,-217263,-217291,-217319,-217347,-217376,-217404,-217432,-217460,-217488,-217516,-217544,-217572,-217600,-217628,-217656,-217684,-217712,-217740,-217768,-217796,-217824,-217852,-217880,-217908,-217936,-217964,-217992,-218020,-218048,-218075,-218103,-218131,-218159,-218187,-218215,-218243,-218270,-218298,-218326,-218354,-218382,-218410,-218437,-218465,-218493,-218521,-218548,-218576,-218604,-218632,-218659,-218687,-218715,-218743,-218770,-218798,-218826,-218853,-218881,-218909,-218936,-218964,-218992,-219019,-219047,-219074,-219102,-219130,-219157,-219185,-219212,-219240,-219267,-219295,-219323,-219350,-219378,-219405,-219433,-219460,-219488,-219515,-219543,-219570,-219597,-219625,-219652,-219680,-219707,-219735,-219762,-219789,-219817,-219844,-219872,-219899,-219926,-219954,-219981,-220008,-220036,-220063,-220090,-220118,-220145,-220172,-220199,-220227,-220254,-220281,-220308,-220336,-220363,-220390,-220417,-220445,-220472,-220499,-220526,-220553,-220580,-220608,-220635,-220662,-220689,-220716,-220743,-220770,-220797,-220825,-220852,-220879,-220906,-220933,-220960,-220987,-221014,-221041,-221068,-221095,-221122,-221149,-221176,-221203,-221230,-221257,-221284,-221311,-221338,-221365,-221392,-221418,-221445,-221472,-221499,-221526,-221553,-221580,-221607,-221633,-221660,-221687,-221714,-221741,-221768,-221794,-221821,-221848,-221875,-221902,-221928,-221955,-221982,-222009,-222035,-222062,-222089,-222115,-222142,-222169,-222195,-222222,-222249,-222275,-222302,-222329,-222355,-222382,-222409,-222435,-222462,-222488,-222515,-222541,-222568,-222595,-222621,-222648,-222674,-222701,-222727,-222754,-222780,-222807,-222833,-222860,-222886,-222913,-222939,-222965,-222992,-223018,-223045,-223071,-223098,-223124,-223150,-223177,-223203,-223229,-223256,-223282,-223308,-223335,-223361,-223387,-223414,-223440,-223466,-223492,-223519,-223545,-223571,-223598,-223624,-223650,-223676,-223702,-223729,-223755,-223781,-223807,-223833,-223859,-223886,-223912,-223938,-223964,-223990,-224016,-224042,-224068,-224095,-224121,-224147,-224173,-224199,-224225,-224251,-224277,-224303,-224329,-224355,-224381,-224407,-224433,-224459,-224485,-224511,-224537,-224563,-224589,-224614,-224640,-224666,-224692,-224718,-224744,-224770,-224796,-224822,-224847,-224873,-224899,-224925,-224951,-224977,-225002,-225028,-225054,-225080,-225105,-225131,-225157,-225183,-225208,-225234,-225260,-225286,-225311,-225337,-225363,-225388,-225414,-225440,-225465,-225491,-225516,-225542,-225568,-225593,-225619,-225645,-225670,-225696,-225721,-225747,-225772,-225798,-225823,-225849,-225874,-225900,-225925,-225951,-225976,-226002,-226027,-226053,-226078,-226104,-226129,-226155,-226180,-226205,-226231,-226256,-226282,-226307,-226332,-226358,-226383,-226408,-226434,-226459,-226484,-226510,-226535,-226560,-226585,-226611,-226636,-226661,-226687,-226712,-226737,-226762,-226787,-226813,-226838,-226863,-226888,-226913,-226939,-226964,-226989,-227014,-227039,-227064,-227089,-227114,-227140,-227165,-227190,-227215,-227240,-227265,-227290,-227315,-227340,-227365,-227390,-227415,-227440,-227465,-227490,-227515,-227540,-227565,-227590,-227615,-227640,-227665,-227690,-227715,-227739,-227764,-227789,-227814,-227839,-227864,-227889,-227913,-227938,-227963,-227988,-228013,-228038,-228062,-228087,-228112,-228137,-228161,-228186,-228211,-228236,-228260,-228285,-228310,-228334,-228359,-228384,-228408,-228433,-228458,-228482,-228507,-228532,-228556,-228581,-228606,-228630,-228655,-228679,-228704,-228728,-228753,-228778,-228802,-228827,-228851,-228876,-228900,-228925,-228949,-228974,-228998,-229023,-229047,-229071,-229096,-229120,-229145,-229169,-229193,-229218,-229242,-229267,-229291,-229315,-229340,-229364,-229388,-229413,-229437,-229461,-229486,-229510,-229534,-229559,-229583,-229607,-229631,-229656,-229680,-229704,-229728,-229752,-229777,-229801,-229825,-229849,-229873,-229897,-229922,-229946,-229970,-229994,-230018,-230042,-230066,-230090,-230115,-230139,-230163,-230187,-230211,-230235,-230259,-230283,-230307,-230331,-230355,-230379,-230403,-230427,-230451,-230475,-230499,-230523,-230547,-230570,-230594,-230618,-230642,-230666,-230690,-230714,-230738,-230761,-230785,-230809,-230833,-230857,-230881,-230904,-230928,-230952,-230976,-231000,-231023,-231047,-231071,-231095,-231118,-231142,-231166,-231189,-231213,-231237,-231260,-231284,-231308,-231331,-231355,-231379,-231402,-231426,-231449,-231473,-231497,-231520,-231544,-231567,-231591,-231614,-231638,-231662,-231685,-231709,-231732,-231756,-231779,-231803,-231826,-231849,-231873,-231896,-231920,-231943,-231967,-231990,-232013,-232037,-232060,-232084,-232107,-232130,-232154,-232177,-232200,-232224,-232247,-232270,-232294,-232317,-232340,-232363,-232387,-232410,-232433,-232456,-232480,-232503,-232526,-232549,-232573,-232596,-232619,-232642,-232665,-232688,-232712,-232735,-232758,-232781,-232804,-232827,-232850,-232873,-232896,-232919,-232943,-232966,-232989,-233012,-233035,-233058,-233081,-233104,-233127,-233150,-233173,-233196,-233219,-233242,-233264,-233287,-233310,-233333,-233356,-233379,-233402,-233425,-233448,-233471,-233493,-233516,-233539,-233562,-233585,-233608,-233630,-233653,-233676,-233699,-233721,-233744,-233767,-233790,-233812,-233835,-233858,-233881,-233903,-233926,-233949,-233971,-233994,-234017,-234039,-234062,-234085,-234107,-234130,-234152,-234175,-234198,-234220,-234243,-234265,-234288,-234310,-234333,-234355,-234378,-234400,-234423,-234445,-234468,-234490,-234513,-234535,-234558,-234580,-234603,-234625,-234648,-234670,-234692,-234715,-234737,-234759,-234782,-234804,-234827,-234849,-234871,-234893,-234916,-234938,-234960,-234983,-235005,-235027,-235049,-235072,-235094,-235116,-235138,-235161,-235183,-235205,-235227,-235249,-235272,-235294,-235316,-235338,-235360,-235382,-235404,-235427,-235449,-235471,-235493,-235515,-235537,-235559,-235581,-235603,-235625,-235647,-235669,-235691,-235713,-235735,-235757,-235779,-235801,-235823,-235845,-235867,-235889,-235911,-235933,-235955,-235977,-235998,-236020,-236042,-236064,-236086,-236108,-236130,-236151,-236173,-236195,-236217,-236239,-236260,-236282,-236304,-236326,-236347,-236369,-236391,-236413,-236434,-236456,-236478,-236499,-236521,-236543,-236564,-236586,-236608,-236629,-236651,-236673,-236694,-236716,-236737,-236759,-236781,-236802,-236824,-236845,-236867,-236888,-236910,-236931,-236953,-236974,-236996,-237017,-237039,-237060,-237082,-237103,-237125,-237146,-237167,-237189,-237210,-237232,-237253,-237274,-237296,-237317,-237338,-237360,-237381,-237402,-237424,-237445,-237466,-237488,-237509,-237530,-237551,-237573,-237594,-237615,-237636,-237658,-237679,-237700,-237721,-237742,-237764,-237785,-237806,-237827,-237848,-237869,-237890,-237912,-237933,-237954,-237975,-237996,-238017,-238038,-238059,-238080,-238101,-238122,-238143,-238164,-238185,-238206,-238227,-238248,-238269,-238290,-238311,-238332,-238353,-238374,-238395,-238416,-238436,-238457,-238478,-238499,-238520,-238541,-238562,-238582,-238603,-238624,-238645,-238666,-238687,-238707,-238728,-238749,-238770,-238790,-238811,-238832,-238852,-238873,-238894,-238915,-238935,-238956,-238977,-238997,-239018,-239039,-239059,-239080,-239100,-239121,-239142,-239162,-239183,-239203,-239224,-239244,-239265,-239286,-239306,-239327,-239347,-239368,-239388,-239409,-239429,-239449,-239470,-239490,-239511,-239531,-239552,-239572,-239592,-239613,-239633,-239654,-239674,-239694,-239715,-239735,-239755,-239776,-239796,-239816,-239837,-239857,-239877,-239897,-239918,-239938,-239958,-239978,-239999,-240019,-240039,-240059,-240079,-240100,-240120,-240140,-240160,-240180,-240200,-240220,-240241,-240261,-240281,-240301,-240321,-240341,-240361,-240381,-240401,-240421,-240441,-240461,-240481,-240501,-240521,-240541,-240561,-240581,-240601,-240621,-240641,-240661,-240681,-240701,-240721,-240741,-240761,-240780,-240800,-240820,-240840,-240860,-240880,-240900,-240919,-240939,-240959,-240979,-240999,-241018,-241038,-241058,-241078,-241097,-241117,-241137,-241156,-241176,-241196,-241216,-241235,-241255,-241275,-241294,-241314,-241333,-241353,-241373,-241392,-241412,-241432,-241451,-241471,-241490,-241510,-241529,-241549,-241568,-241588,-241607,-241627,-241646,-241666,-241685,-241705,-241724,-241744,-241763,-241783,-241802,-241821,-241841,-241860,-241880,-241899,-241918,-241938,-241957,-241976,-241996,-242015,-242034,-242054,-242073,-242092,-242111,-242131,-242150,-242169,-242188,-242208,-242227,-242246,-242265,-242285,-242304,-242323,-242342,-242361,-242380,-242400,-242419,-242438,-242457,-242476,-242495,-242514,-242533,-242552,-242571,-242590,-242610,-242629,-242648,-242667,-242686,-242705,-242724,-242743,-242762,-242781,-242799,-242818,-242837,-242856,-242875,-242894,-242913,-242932,-242951,-242970,-242989,-243007,-243026,-243045,-243064,-243083,-243102,-243120,-243139,-243158,-243177,-243195,-243214,-243233,-243252,-243270,-243289,-243308,-243327,-243345,-243364,-243383,-243401,-243420,-243439,-243457,-243476,-243495,-243513,-243532,-243550,-243569,-243587,-243606,-243625,-243643,-243662,-243680,-243699,-243717,-243736,-243754,-243773,-243791,-243810,-243828,-243847,-243865,-243884,-243902,-243920,-243939,-243957,-243976,-243994,-244012,-244031,-244049,-244067,-244086,-244104,-244122,-244141,-244159,-244177,-244196,-244214,-244232,-244250,-244269,-244287,-244305,-244323,-244342,-244360,-244378,-244396,-244414,-244432,-244451,-244469,-244487,-244505,-244523,-244541,-244559,-244577,-244596,-244614,-244632,-244650,-244668,-244686,-244704,-244722,-244740,-244758,-244776,-244794,-244812,-244830,-244848,-244866,-244884,-244902,-244920,-244937,-244955,-244973,-244991,-245009,-245027,-245045,-245063,-245080,-245098,-245116,-245134,-245152,-245170,-245187,-245205,-245223,-245241,-245258,-245276,-245294,-245312,-245329,-245347,-245365,-245382,-245400,-245418,-245435,-245453,-245471,-245488,-245506,-245524,-245541,-245559,-245576,-245594,-245612,-245629,-245647,-245664,-245682,-245699,-245717,-245734,-245752,-245769,-245787,-245804,-245822,-245839,-245857,-245874,-245891,-245909,-245926,-245944,-245961,-245978,-245996,-246013,-246031,-246048,-246065,-246083,-246100,-246117,-246135,-246152,-246169,-246186,-246204,-246221,-246238,-246255,-246273,-246290,-246307,-246324,-246341,-246359,-246376,-246393,-246410,-246427,-246444,-246462,-246479,-246496,-246513,-246530,-246547,-246564,-246581,-246598,-246615,-246632,-246649,-246666,-246683,-246700,-246717,-246734,-246751,-246768,-246785,-246802,-246819,-246836,-246853,-246870,-246887,-246904,-246921,-246937,-246954,-246971,-246988,-247005,-247022,-247039,-247055,-247072,-247089,-247106,-247122,-247139,-247156,-247173,-247189,-247206,-247223,-247240,-247256,-247273,-247290,-247306,-247323,-247340,-247356,-247373,-247390,-247406,-247423,-247439,-247456,-247473,-247489,-247506,-247522,-247539,-247555,-247572,-247588,-247605,-247621,-247638,-247654,-247671,-247687,-247704,-247720,-247737,-247753,-247770,-247786,-247802,-247819,-247835,-247852,-247868,-247884,-247901,-247917,-247933,-247950,-247966,-247982,-247999,-248015,-248031,-248047,-248064,-248080,-248096,-248112,-248129,-248145,-248161,-248177,-248193,-248210,-248226,-248242,-248258,-248274,-248290,-248306,-248322,-248339,-248355,-248371,-248387,-248403,-248419,-248435,-248451,-248467,-248483,-248499,-248515,-248531,-248547,-248563,-248579,-248595,-248611,-248627,-248643,-248659,-248675,-248690,-248706,-248722,-248738,-248754,-248770,-248786,-248802,-248817,-248833,-248849,-248865,-248881,-248896,-248912,-248928,-248944,-248959,-248975,-248991,-249007,-249022,-249038,-249054,-249069,-249085,-249101,-249116,-249132,-249148,-249163,-249179,-249194,-249210,-249226,-249241,-249257,-249272,-249288,-249303,-249319,-249334,-249350,-249366,-249381,-249397,-249412,-249427,-249443,-249458,-249474,-249489,-249505,-249520,-249535,-249551,-249566,-249582,-249597,-249612,-249628,-249643,-249658,-249674,-249689,-249704,-249720,-249735,-249750,-249765,-249781,-249796,-249811,-249826,-249842,-249857,-249872,-249887,-249902,-249918,-249933,-249948,-249963,-249978,-249993,-250008,-250024,-250039,-250054,-250069,-250084,-250099,-250114,-250129,-250144,-250159,-250174,-250189,-250204,-250219,-250234,-250249,-250264,-250279,-250294,-250309,-250324,-250339,-250354,-250369,-250384,-250398,-250413,-250428,-250443,-250458,-250473,-250488,-250502,-250517,-250532,-250547,-250561,-250576,-250591,-250606,-250621,-250635,-250650,-250665,-250679,-250694,-250709,-250723,-250738,-250753,-250767,-250782,-250797,-250811,-250826,-250841,-250855,-250870,-250884,-250899,-250913,-250928,-250943,-250957,-250972,-250986,-251001,-251015,-251030,-251044,-251059,-251073,-251087,-251102,-251116,-251131,-251145,-251160,-251174,-251188,-251203,-251217,-251231,-251246,-251260,-251274,-251289,-251303,-251317,-251332,-251346,-251360,-251374,-251389,-251403,-251417,-251431,-251446,-251460,-251474,-251488,-251502,-251517,-251531,-251545,-251559,-251573,-251587,-251601,-251616,-251630,-251644,-251658,-251672,-251686,-251700,-251714,-251728,-251742,-251756,-251770,-251784,-251798,-251812,-251826,-251840,-251854,-251868,-251882,-251896,-251910,-251924,-251937,-251951,-251965,-251979,-251993,-252007,-252021,-252034,-252048,-252062,-252076,-252090,-252103,-252117,-252131,-252145,-252158,-252172,-252186,-252200,-252213,-252227,-252241,-252254,-252268,-252282,-252295,-252309,-252323,-252336,-252350,-252364,-252377,-252391,-252404,-252418,-252431,-252445,-252459,-252472,-252486,-252499,-252513,-252526,-252540,-252553,-252567,-252580,-252593,-252607,-252620,-252634,-252647,-252661,-252674,-252687,-252701,-252714,-252727,-252741,-252754,-252767,-252781,-252794,-252807,-252821,-252834,-252847,-252860,-252874,-252887,-252900,-252913,-252927,-252940,-252953,-252966,-252979,-252993,-253006,-253019,-253032,-253045,-253058,-253071,-253084,-253098,-253111,-253124,-253137,-253150,-253163,-253176,-253189,-253202,-253215,-253228,-253241,-253254,-253267,-253280,-253293,-253306,-253319,-253332,-253345,-253358,-253370,-253383,-253396,-253409,-253422,-253435,-253448,-253460,-253473,-253486,-253499,-253512,-253524,-253537,-253550,-253563,-253576,-253588,-253601,-253614,-253626,-253639,-253652,-253665,-253677,-253690,-253703,-253715,-253728,-253740,-253753,-253766,-253778,-253791,-253803,-253816,-253829,-253841,-253854,-253866,-253879,-253891,-253904,-253916,-253929,-253941,-253954,-253966,-253979,-253991,-254003,-254016,-254028,-254041,-254053,-254066,-254078,-254090,-254103,-254115,-254127,-254140,-254152,-254164,-254177,-254189,-254201,-254213,-254226,-254238,-254250,-254262,-254275,-254287,-254299,-254311,-254323,-254336,-254348,-254360,-254372,-254384,-254396,-254409,-254421,-254433,-254445,-254457,-254469,-254481,-254493,-254505,-254517,-254529,-254541,-254553,-254565,-254577,-254589,-254601,-254613,-254625,-254637,-254649,-254661,-254673,-254685,-254697,-254709,-254720,-254732,-254744,-254756,-254768,-254780,-254792,-254803,-254815,-254827,-254839,-254851,-254862,-254874,-254886,-254898,-254909,-254921,-254933,-254944,-254956,-254968,-254980,-254991,-255003,-255014,-255026,-255038,-255049,-255061,-255073,-255084,-255096,-255107,-255119,-255130,-255142,-255154,-255165,-255177,-255188,-255200,-255211,-255223,-255234,-255245,-255257,-255268,-255280,-255291,-255303,-255314,-255325,-255337,-255348,-255360,-255371,-255382,-255394,-255405,-255416,-255428,-255439,-255450,-255461,-255473,-255484,-255495,-255506,-255518,-255529,-255540,-255551,-255563,-255574,-255585,-255596,-255607,-255618,-255629,-255641,-255652,-255663,-255674,-255685,-255696,-255707,-255718,-255729,-255740,-255751,-255762,-255773,-255784,-255795,-255806,-255817,-255828,-255839,-255850,-255861,-255872,-255883,-255894,-255905,-255916,-255927,-255938,-255948,-255959,-255970,-255981,-255992,-256003,-256013,-256024,-256035,-256046,-256057,-256067,-256078,-256089,-256100,-256110,-256121,-256132,-256142,-256153,-256164,-256175,-256185,-256196,-256206,-256217,-256228,-256238,-256249,-256260,-256270,-256281,-256291,-256302,-256312,-256323,-256333,-256344,-256354,-256365,-256375,-256386,-256396,-256407,-256417,-256428,-256438,-256449,-256459,-256469,-256480,-256490,-256501,-256511,-256521,-256532,-256542,-256552,-256563,-256573,-256583,-256594,-256604,-256614,-256624,-256635,-256645,-256655,-256665,-256676,-256686,-256696,-256706,-256716,-256727,-256737,-256747,-256757,-256767,-256777,-256787,-256797,-256808,-256818,-256828,-256838,-256848,-256858,-256868,-256878,-256888,-256898,-256908,-256918,-256928,-256938,-256948,-256958,-256968,-256978,-256988,-256998,-257007,-257017,-257027,-257037,-257047,-257057,-257067,-257077,-257086,-257096,-257106,-257116,-257126,-257135,-257145,-257155,-257165,-257174,-257184,-257194,-257204,-257213,-257223,-257233,-257242,-257252,-257262,-257271,-257281,-257291,-257300,-257310,-257319,-257329,-257339,-257348,-257358,-257367,-257377,-257386,-257396,-257405,-257415,-257424,-257434,-257443,-257453,-257462,-257472,-257481,-257491,-257500,-257509,-257519,-257528,-257538,-257547,-257556,-257566,-257575,-257584,-257594,-257603,-257612,-257622,-257631,-257640,-257650,-257659,-257668,-257677,-257687,-257696,-257705,-257714,-257723,-257733,-257742,-257751,-257760,-257769,-257778,-257788,-257797,-257806,-257815,-257824,-257833,-257842,-257851,-257860,-257869,-257878,-257887,-257896,-257905,-257914,-257923,-257932,-257941,-257950,-257959,-257968,-257977,-257986,-257995,-258004,-258013,-258022,-258030,-258039,-258048,-258057,-258066,-258075,-258083,-258092,-258101,-258110,-258119,-258127,-258136,-258145,-258154,-258162,-258171,-258180,-258189,-258197,-258206,-258215,-258223,-258232,-258241,-258249,-258258,-258266,-258275,-258284,-258292,-258301,-258309,-258318,-258326,-258335,-258344,-258352,-258361,-258369,-258378,-258386,-258395,-258403,-258411,-258420,-258428,-258437,-258445,-258454,-258462,-258470,-258479,-258487,-258495,-258504,-258512,-258521,-258529,-258537,-258545,-258554,-258562,-258570,-258579,-258587,-258595,-258603,-258612,-258620,-258628,-258636,-258644,-258653,-258661,-258669,-258677,-258685,-258693,-258701,-258710,-258718,-258726,-258734,-258742,-258750,-258758,-258766,-258774,-258782,-258790,-258798,-258806,-258814,-258822,-258830,-258838,-258846,-258854,-258862,-258870,-258878,-258886,-258894,-258901,-258909,-258917,-258925,-258933,-258941,-258949,-258956,-258964,-258972,-258980,-258988,-258995,-259003,-259011,-259019,-259026,-259034,-259042,-259049,-259057,-259065,-259072,-259080,-259088,-259095,-259103,-259111,-259118,-259126,-259134,-259141,-259149,-259156,-259164,-259171,-259179,-259186,-259194,-259201,-259209,-259216,-259224,-259231,-259239,-259246,-259254,-259261,-259269,-259276,-259284,-259291,-259298,-259306,-259313,-259320,-259328,-259335,-259342,-259350,-259357,-259364,-259372,-259379,-259386,-259394,-259401,-259408,-259415,-259422,-259430,-259437,-259444,-259451,-259458,-259466,-259473,-259480,-259487,-259494,-259501,-259508,-259516,-259523,-259530,-259537,-259544,-259551,-259558,-259565,-259572,-259579,-259586,-259593,-259600,-259607,-259614,-259621,-259628,-259635,-259642,-259649,-259656,-259663,-259669,-259676,-259683,-259690,-259697,-259704,-259711,-259717,-259724,-259731,-259738,-259745,-259751,-259758,-259765,-259772,-259778,-259785,-259792,-259799,-259805,-259812,-259819,-259825,-259832,-259839,-259845,-259852,-259859,-259865,-259872,-259878,-259885,-259892,-259898,-259905,-259911,-259918,-259924,-259931,-259937,-259944,-259950,-259957,-259963,-259970,-259976,-259983,-259989,-259996,-260002,-260008,-260015,-260021,-260028,-260034,-260040,-260047,-260053,-260059,-260066,-260072,-260078,-260084,-260091,-260097,-260103,-260110,-260116,-260122,-260128,-260134,-260141,-260147,-260153,-260159,-260165,-260172,-260178,-260184,-260190,-260196,-260202,-260208,-260214,-260220,-260227,-260233,-260239,-260245,-260251,-260257,-260263,-260269,-260275,-260281,-260287,-260293,-260299,-260305,-260311,-260316,-260322,-260328,-260334,-260340,-260346,-260352,-260358,-260364,-260369,-260375,-260381,-260387,-260393,-260398,-260404,-260410,-260416,-260422,-260427,-260433,-260439,-260444,-260450,-260456,-260462,-260467,-260473,-260479,-260484,-260490,-260495,-260501,-260507,-260512,-260518,-260524,-260529,-260535,-260540,-260546,-260551,-260557,-260562,-260568,-260573,-260579,-260584,-260590,-260595,-260601,-260606,-260612,-260617,-260622,-260628,-260633,-260639,-260644,-260649,-260655,-260660,-260665,-260671,-260676,-260681,-260687,-260692,-260697,-260702,-260708,-260713,-260718,-260723,-260729,-260734,-260739,-260744,-260749,-260755,-260760,-260765,-260770,-260775,-260780,-260785,-260790,-260796,-260801,-260806,-260811,-260816,-260821,-260826,-260831,-260836,-260841,-260846,-260851,-260856,-260861,-260866,-260871,-260876,-260881,-260886,-260891,-260895,-260900,-260905,-260910,-260915,-260920,-260925,-260929,-260934,-260939,-260944,-260949,-260954,-260958,-260963,-260968,-260973,-260977,-260982,-260987,-260991,-260996,-261001,-261006,-261010,-261015,-261020,-261024,-261029,-261033,-261038,-261043,-261047,-261052,-261056,-261061,-261066,-261070,-261075,-261079,-261084,-261088,-261093,-261097,-261102,-261106,-261111,-261115,-261119,-261124,-261128,-261133,-261137,-261142,-261146,-261150,-261155,-261159,-261163,-261168,-261172,-261176,-261181,-261185,-261189,-261194,-261198,-261202,-261206,-261211,-261215,-261219,-261223,-261227,-261232,-261236,-261240,-261244,-261248,-261252,-261257,-261261,-261265,-261269,-261273,-261277,-261281,-261285,-261289,-261293,-261297,-261301,-261305,-261309,-261313,-261317,-261321,-261325,-261329,-261333,-261337,-261341,-261345,-261349,-261353,-261357,-261361,-261365,-261368,-261372,-261376,-261380,-261384,-261388,-261391,-261395,-261399,-261403,-261407,-261410,-261414,-261418,-261422,-261425,-261429,-261433,-261436,-261440,-261444,-261447,-261451,-261455,-261458,-261462,-261466,-261469,-261473,-261476,-261480,-261484,-261487,-261491,-261494,-261498,-261501,-261505,-261508,-261512,-261515,-261519,-261522,-261526,-261529,-261532,-261536,-261539,-261543,-261546,-261550,-261553,-261556,-261560,-261563,-261566,-261570,-261573,-261576,-261580,-261583,-261586,-261589,-261593,-261596,-261599,-261602,-261606,-261609,-261612,-261615,-261618,-261622,-261625,-261628,-261631,-261634,-261637,-261640,-261643,-261647,-261650,-261653,-261656,-261659,-261662,-261665,-261668,-261671,-261674,-261677,-261680,-261683,-261686,-261689,-261692,-261695,-261698,-261701,-261704,-261707,-261709,-261712,-261715,-261718,-261721,-261724,-261727,-261729,-261732,-261735,-261738,-261741,-261743,-261746,-261749,-261752,-261754,-261757,-261760,-261763,-261765,-261768,-261771,-261773,-261776,-261779,-261781,-261784,-261787,-261789,-261792,-261794,-261797,-261800,-261802,-261805,-261807,-261810,-261812,-261815,-261817,-261820,-261822,-261825,-261827,-261830,-261832,-261835,-261837,-261839,-261842,-261844,-261847,-261849,-261851,-261854,-261856,-261858,-261861,-261863,-261865,-261868,-261870,-261872,-261875,-261877,-261879,-261881,-261884,-261886,-261888,-261890,-261893,-261895,-261897,-261899,-261901,-261903,-261906,-261908,-261910,-261912,-261914,-261916,-261918,-261920,-261922,-261924,-261926,-261928,-261931,-261933,-261935,-261937,-261939,-261941,-261942,-261944,-261946,-261948,-261950,-261952,-261954,-261956,-261958,-261960,-261962,-261964,-261965,-261967,-261969,-261971,-261973,-261974,-261976,-261978,-261980,-261982,-261983,-261985,-261987,-261989,-261990,-261992,-261994,-261995,-261997,-261999,-262000,-262002,-262004,-262005,-262007,-262009,-262010,-262012,-262013,-262015,-262017,-262018,-262020,-262021,-262023,-262024,-262026,-262027,-262029,-262030,-262032,-262033,-262035,-262036,-262037,-262039,-262040,-262042,-262043,-262044,-262046,-262047,-262049,-262050,-262051,-262053,-262054,-262055,-262056,-262058,-262059,-262060,-262062,-262063,-262064,-262065,-262066,-262068,-262069,-262070,-262071,-262072,-262074,-262075,-262076,-262077,-262078,-262079,-262080,-262081,-262083,-262084,-262085,-262086,-262087,-262088,-262089,-262090,-262091,-262092,-262093,-262094,-262095,-262096,-262097,-262098,-262099,-262100,-262100,-262101,-262102,-262103,-262104,-262105,-262106,-262107,-262107,-262108,-262109,-262110,-262111,-262111,-262112,-262113,-262114,-262114,-262115,-262116,-262117,-262117,-262118,-262119,-262119,-262120,-262121,-262121,-262122,-262123,-262123,-262124,-262124,-262125,-262126,-262126,-262127,-262127,-262128,-262128,-262129,-262129,-262130,-262130,-262131,-262131,-262132,-262132,-262133,-262133,-262134,-262134,-262134,-262135,-262135,-262136,-262136,-262136,-262137,-262137,-262137,-262138,-262138,-262138,-262139,-262139,-262139,-262139,-262140,-262140,-262140,-262140,-262141,-262141,-262141,-262141,-262141,-262142,-262142,-262142,-262142,-262142,-262142,-262142,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262142,-262142,-262142,-262142,-262142,-262142,-262142,-262141,-262141,-262141,-262141,-262141,-262140,-262140,-262140,-262140,-262139,-262139,-262139,-262139,-262138,-262138,-262138,-262137,-262137,-262137,-262136,-262136,-262136,-262135,-262135,-262134,-262134,-262134,-262133,-262133,-262132,-262132,-262131,-262131,-262130,-262130,-262129,-262129,-262128,-262128,-262127,-262127,-262126,-262126,-262125,-262124,-262124,-262123,-262123,-262122,-262121,-262121,-262120,-262119,-262119,-262118,-262117,-262117,-262116,-262115,-262114,-262114,-262113,-262112,-262111,-262111,-262110,-262109,-262108,-262107,-262107,-262106,-262105,-262104,-262103,-262102,-262101,-262100,-262100,-262099,-262098,-262097,-262096,-262095,-262094,-262093,-262092,-262091,-262090,-262089,-262088,-262087,-262086,-262085,-262084,-262083,-262081,-262080,-262079,-262078,-262077,-262076,-262075,-262074,-262072,-262071,-262070,-262069,-262068,-262066,-262065,-262064,-262063,-262062,-262060,-262059,-262058,-262056,-262055,-262054,-262053,-262051,-262050,-262049,-262047,-262046,-262044,-262043,-262042,-262040,-262039,-262037,-262036,-262035,-262033,-262032,-262030,-262029,-262027,-262026,-262024,-262023,-262021,-262020,-262018,-262017,-262015,-262013,-262012,-262010,-262009,-262007,-262005,-262004,-262002,-262000,-261999,-261997,-261995,-261994,-261992,-261990,-261989,-261987,-261985,-261983,-261982,-261980,-261978,-261976,-261974,-261973,-261971,-261969,-261967,-261965,-261964,-261962,-261960,-261958,-261956,-261954,-261952,-261950,-261948,-261946,-261944,-261942,-261941,-261939,-261937,-261935,-261933,-261931,-261928,-261926,-261924,-261922,-261920,-261918,-261916,-261914,-261912,-261910,-261908,-261906,-261903,-261901,-261899,-261897,-261895,-261893,-261890,-261888,-261886,-261884,-261881,-261879,-261877,-261875,-261872,-261870,-261868,-261865,-261863,-261861,-261858,-261856,-261854,-261851,-261849,-261847,-261844,-261842,-261839,-261837,-261835,-261832,-261830,-261827,-261825,-261822,-261820,-261817,-261815,-261812,-261810,-261807,-261805,-261802,-261800,-261797,-261794,-261792,-261789,-261787,-261784,-261781,-261779,-261776,-261773,-261771,-261768,-261765,-261763,-261760,-261757,-261754,-261752,-261749,-261746,-261743,-261741,-261738,-261735,-261732,-261729,-261727,-261724,-261721,-261718,-261715,-261712,-261709,-261707,-261704,-261701,-261698,-261695,-261692,-261689,-261686,-261683,-261680,-261677,-261674,-261671,-261668,-261665,-261662,-261659,-261656,-261653,-261650,-261647,-261643,-261640,-261637,-261634,-261631,-261628,-261625,-261622,-261618,-261615,-261612,-261609,-261606,-261602,-261599,-261596,-261593,-261589,-261586,-261583,-261580,-261576,-261573,-261570,-261566,-261563,-261560,-261556,-261553,-261550,-261546,-261543,-261539,-261536,-261532,-261529,-261526,-261522,-261519,-261515,-261512,-261508,-261505,-261501,-261498,-261494,-261491,-261487,-261484,-261480,-261476,-261473,-261469,-261466,-261462,-261458,-261455,-261451,-261447,-261444,-261440,-261436,-261433,-261429,-261425,-261422,-261418,-261414,-261410,-261407,-261403,-261399,-261395,-261391,-261388,-261384,-261380,-261376,-261372,-261368,-261365,-261361,-261357,-261353,-261349,-261345,-261341,-261337,-261333,-261329,-261325,-261321,-261317,-261313,-261309,-261305,-261301,-261297,-261293,-261289,-261285,-261281,-261277,-261273,-261269,-261265,-261261,-261257,-261252,-261248,-261244,-261240,-261236,-261232,-261227,-261223,-261219,-261215,-261211,-261206,-261202,-261198,-261194,-261189,-261185,-261181,-261176,-261172,-261168,-261163,-261159,-261155,-261150,-261146,-261142,-261137,-261133,-261128,-261124,-261119,-261115,-261111,-261106,-261102,-261097,-261093,-261088,-261084,-261079,-261075,-261070,-261066,-261061,-261056,-261052,-261047,-261043,-261038,-261033,-261029,-261024,-261020,-261015,-261010,-261006,-261001,-260996,-260991,-260987,-260982,-260977,-260973,-260968,-260963,-260958,-260954,-260949,-260944,-260939,-260934,-260929,-260925,-260920,-260915,-260910,-260905,-260900,-260895,-260891,-260886,-260881,-260876,-260871,-260866,-260861,-260856,-260851,-260846,-260841,-260836,-260831,-260826,-260821,-260816,-260811,-260806,-260801,-260796,-260790,-260785,-260780,-260775,-260770,-260765,-260760,-260755,-260749,-260744,-260739,-260734,-260729,-260723,-260718,-260713,-260708,-260702,-260697,-260692,-260687,-260681,-260676,-260671,-260665,-260660,-260655,-260649,-260644,-260639,-260633,-260628,-260622,-260617,-260612,-260606,-260601,-260595,-260590,-260584,-260579,-260573,-260568,-260562,-260557,-260551,-260546,-260540,-260535,-260529,-260524,-260518,-260512,-260507,-260501,-260495,-260490,-260484,-260479,-260473,-260467,-260462,-260456,-260450,-260444,-260439,-260433,-260427,-260422,-260416,-260410,-260404,-260398,-260393,-260387,-260381,-260375,-260369,-260364,-260358,-260352,-260346,-260340,-260334,-260328,-260322,-260316,-260311,-260305,-260299,-260293,-260287,-260281,-260275,-260269,-260263,-260257,-260251,-260245,-260239,-260233,-260227,-260220,-260214,-260208,-260202,-260196,-260190,-260184,-260178,-260172,-260165,-260159,-260153,-260147,-260141,-260134,-260128,-260122,-260116,-260110,-260103,-260097,-260091,-260084,-260078,-260072,-260066,-260059,-260053,-260047,-260040,-260034,-260028,-260021,-260015,-260008,-260002,-259996,-259989,-259983,-259976,-259970,-259963,-259957,-259950,-259944,-259937,-259931,-259924,-259918,-259911,-259905,-259898,-259892,-259885,-259878,-259872,-259865,-259859,-259852,-259845,-259839,-259832,-259825,-259819,-259812,-259805,-259799,-259792,-259785,-259778,-259772,-259765,-259758,-259751,-259745,-259738,-259731,-259724,-259717,-259711,-259704,-259697,-259690,-259683,-259676,-259669,-259663,-259656,-259649,-259642,-259635,-259628,-259621,-259614,-259607,-259600,-259593,-259586,-259579,-259572,-259565,-259558,-259551,-259544,-259537,-259530,-259523,-259516,-259508,-259501,-259494,-259487,-259480,-259473,-259466,-259458,-259451,-259444,-259437,-259430,-259422,-259415,-259408,-259401,-259394,-259386,-259379,-259372,-259364,-259357,-259350,-259342,-259335,-259328,-259320,-259313,-259306,-259298,-259291,-259284,-259276,-259269,-259261,-259254,-259246,-259239,-259231,-259224,-259216,-259209,-259201,-259194,-259186,-259179,-259171,-259164,-259156,-259149,-259141,-259134,-259126,-259118,-259111,-259103,-259095,-259088,-259080,-259072,-259065,-259057,-259049,-259042,-259034,-259026,-259019,-259011,-259003,-258995,-258988,-258980,-258972,-258964,-258956,-258949,-258941,-258933,-258925,-258917,-258909,-258901,-258894,-258886,-258878,-258870,-258862,-258854,-258846,-258838,-258830,-258822,-258814,-258806,-258798,-258790,-258782,-258774,-258766,-258758,-258750,-258742,-258734,-258726,-258718,-258710,-258701,-258693,-258685,-258677,-258669,-258661,-258653,-258644,-258636,-258628,-258620,-258612,-258603,-258595,-258587,-258579,-258570,-258562,-258554,-258545,-258537,-258529,-258521,-258512,-258504,-258495,-258487,-258479,-258470,-258462,-258454,-258445,-258437,-258428,-258420,-258411,-258403,-258395,-258386,-258378,-258369,-258361,-258352,-258344,-258335,-258326,-258318,-258309,-258301,-258292,-258284,-258275,-258266,-258258,-258249,-258241,-258232,-258223,-258215,-258206,-258197,-258189,-258180,-258171,-258162,-258154,-258145,-258136,-258127,-258119,-258110,-258101,-258092,-258083,-258075,-258066,-258057,-258048,-258039,-258030,-258022,-258013,-258004,-257995,-257986,-257977,-257968,-257959,-257950,-257941,-257932,-257923,-257914,-257905,-257896,-257887,-257878,-257869,-257860,-257851,-257842,-257833,-257824,-257815,-257806,-257797,-257788,-257778,-257769,-257760,-257751,-257742,-257733,-257723,-257714,-257705,-257696,-257687,-257677,-257668,-257659,-257650,-257640,-257631,-257622,-257612,-257603,-257594,-257584,-257575,-257566,-257556,-257547,-257538,-257528,-257519,-257509,-257500,-257491,-257481,-257472,-257462,-257453,-257443,-257434,-257424,-257415,-257405,-257396,-257386,-257377,-257367,-257358,-257348,-257339,-257329,-257319,-257310,-257300,-257291,-257281,-257271,-257262,-257252,-257242,-257233,-257223,-257213,-257204,-257194,-257184,-257174,-257165,-257155,-257145,-257135,-257126,-257116,-257106,-257096,-257086,-257077,-257067,-257057,-257047,-257037,-257027,-257017,-257007,-256998,-256988,-256978,-256968,-256958,-256948,-256938,-256928,-256918,-256908,-256898,-256888,-256878,-256868,-256858,-256848,-256838,-256828,-256818,-256808,-256797,-256787,-256777,-256767,-256757,-256747,-256737,-256727,-256716,-256706,-256696,-256686,-256676,-256665,-256655,-256645,-256635,-256624,-256614,-256604,-256594,-256583,-256573,-256563,-256552,-256542,-256532,-256521,-256511,-256501,-256490,-256480,-256469,-256459,-256449,-256438,-256428,-256417,-256407,-256396,-256386,-256375,-256365,-256354,-256344,-256333,-256323,-256312,-256302,-256291,-256281,-256270,-256260,-256249,-256238,-256228,-256217,-256206,-256196,-256185,-256175,-256164,-256153,-256142,-256132,-256121,-256110,-256100,-256089,-256078,-256067,-256057,-256046,-256035,-256024,-256013,-256003,-255992,-255981,-255970,-255959,-255948,-255938,-255927,-255916,-255905,-255894,-255883,-255872,-255861,-255850,-255839,-255828,-255817,-255806,-255795,-255784,-255773,-255762,-255751,-255740,-255729,-255718,-255707,-255696,-255685,-255674,-255663,-255652,-255641,-255629,-255618,-255607,-255596,-255585,-255574,-255563,-255551,-255540,-255529,-255518,-255506,-255495,-255484,-255473,-255461,-255450,-255439,-255428,-255416,-255405,-255394,-255382,-255371,-255360,-255348,-255337,-255325,-255314,-255303,-255291,-255280,-255268,-255257,-255245,-255234,-255223,-255211,-255200,-255188,-255177,-255165,-255154,-255142,-255130,-255119,-255107,-255096,-255084,-255073,-255061,-255049,-255038,-255026,-255014,-255003,-254991,-254980,-254968,-254956,-254944,-254933,-254921,-254909,-254898,-254886,-254874,-254862,-254851,-254839,-254827,-254815,-254803,-254792,-254780,-254768,-254756,-254744,-254732,-254720,-254709,-254697,-254685,-254673,-254661,-254649,-254637,-254625,-254613,-254601,-254589,-254577,-254565,-254553,-254541,-254529,-254517,-254505,-254493,-254481,-254469,-254457,-254445,-254433,-254421,-254409,-254396,-254384,-254372,-254360,-254348,-254336,-254323,-254311,-254299,-254287,-254275,-254262,-254250,-254238,-254226,-254213,-254201,-254189,-254177,-254164,-254152,-254140,-254127,-254115,-254103,-254090,-254078,-254066,-254053,-254041,-254028,-254016,-254003,-253991,-253979,-253966,-253954,-253941,-253929,-253916,-253904,-253891,-253879,-253866,-253854,-253841,-253829,-253816,-253803,-253791,-253778,-253766,-253753,-253740,-253728,-253715,-253703,-253690,-253677,-253665,-253652,-253639,-253626,-253614,-253601,-253588,-253576,-253563,-253550,-253537,-253524,-253512,-253499,-253486,-253473,-253460,-253448,-253435,-253422,-253409,-253396,-253383,-253370,-253358,-253345,-253332,-253319,-253306,-253293,-253280,-253267,-253254,-253241,-253228,-253215,-253202,-253189,-253176,-253163,-253150,-253137,-253124,-253111,-253098,-253084,-253071,-253058,-253045,-253032,-253019,-253006,-252993,-252979,-252966,-252953,-252940,-252927,-252913,-252900,-252887,-252874,-252860,-252847,-252834,-252821,-252807,-252794,-252781,-252767,-252754,-252741,-252727,-252714,-252701,-252687,-252674,-252661,-252647,-252634,-252620,-252607,-252593,-252580,-252567,-252553,-252540,-252526,-252513,-252499,-252486,-252472,-252459,-252445,-252431,-252418,-252404,-252391,-252377,-252364,-252350,-252336,-252323,-252309,-252295,-252282,-252268,-252254,-252241,-252227,-252213,-252200,-252186,-252172,-252158,-252145,-252131,-252117,-252103,-252090,-252076,-252062,-252048,-252034,-252021,-252007,-251993,-251979,-251965,-251951,-251937,-251924,-251910,-251896,-251882,-251868,-251854,-251840,-251826,-251812,-251798,-251784,-251770,-251756,-251742,-251728,-251714,-251700,-251686,-251672,-251658,-251644,-251630,-251616,-251601,-251587,-251573,-251559,-251545,-251531,-251517,-251502,-251488,-251474,-251460,-251446,-251431,-251417,-251403,-251389,-251374,-251360,-251346,-251332,-251317,-251303,-251289,-251274,-251260,-251246,-251231,-251217,-251203,-251188,-251174,-251160,-251145,-251131,-251116,-251102,-251087,-251073,-251059,-251044,-251030,-251015,-251001,-250986,-250972,-250957,-250943,-250928,-250913,-250899,-250884,-250870,-250855,-250841,-250826,-250811,-250797,-250782,-250767,-250753,-250738,-250723,-250709,-250694,-250679,-250665,-250650,-250635,-250621,-250606,-250591,-250576,-250561,-250547,-250532,-250517,-250502,-250488,-250473,-250458,-250443,-250428,-250413,-250398,-250384,-250369,-250354,-250339,-250324,-250309,-250294,-250279,-250264,-250249,-250234,-250219,-250204,-250189,-250174,-250159,-250144,-250129,-250114,-250099,-250084,-250069,-250054,-250039,-250024,-250008,-249993,-249978,-249963,-249948,-249933,-249918,-249902,-249887,-249872,-249857,-249842,-249826,-249811,-249796,-249781,-249765,-249750,-249735,-249720,-249704,-249689,-249674,-249658,-249643,-249628,-249612,-249597,-249582,-249566,-249551,-249535,-249520,-249505,-249489,-249474,-249458,-249443,-249427,-249412,-249397,-249381,-249366,-249350,-249334,-249319,-249303,-249288,-249272,-249257,-249241,-249226,-249210,-249194,-249179,-249163,-249148,-249132,-249116,-249101,-249085,-249069,-249054,-249038,-249022,-249007,-248991,-248975,-248959,-248944,-248928,-248912,-248896,-248881,-248865,-248849,-248833,-248817,-248802,-248786,-248770,-248754,-248738,-248722,-248706,-248690,-248675,-248659,-248643,-248627,-248611,-248595,-248579,-248563,-248547,-248531,-248515,-248499,-248483,-248467,-248451,-248435,-248419,-248403,-248387,-248371,-248355,-248339,-248322,-248306,-248290,-248274,-248258,-248242,-248226,-248210,-248193,-248177,-248161,-248145,-248129,-248112,-248096,-248080,-248064,-248047,-248031,-248015,-247999,-247982,-247966,-247950,-247933,-247917,-247901,-247884,-247868,-247852,-247835,-247819,-247802,-247786,-247770,-247753,-247737,-247720,-247704,-247687,-247671,-247654,-247638,-247621,-247605,-247588,-247572,-247555,-247539,-247522,-247506,-247489,-247473,-247456,-247439,-247423,-247406,-247390,-247373,-247356,-247340,-247323,-247306,-247290,-247273,-247256,-247240,-247223,-247206,-247189,-247173,-247156,-247139,-247122,-247106,-247089,-247072,-247055,-247039,-247022,-247005,-246988,-246971,-246954,-246937,-246921,-246904,-246887,-246870,-246853,-246836,-246819,-246802,-246785,-246768,-246751,-246734,-246717,-246700,-246683,-246666,-246649,-246632,-246615,-246598,-246581,-246564,-246547,-246530,-246513,-246496,-246479,-246462,-246444,-246427,-246410,-246393,-246376,-246359,-246341,-246324,-246307,-246290,-246273,-246255,-246238,-246221,-246204,-246186,-246169,-246152,-246135,-246117,-246100,-246083,-246065,-246048,-246031,-246013,-245996,-245978,-245961,-245944,-245926,-245909,-245891,-245874,-245857,-245839,-245822,-245804,-245787,-245769,-245752,-245734,-245717,-245699,-245682,-245664,-245647,-245629,-245612,-245594,-245576,-245559,-245541,-245524,-245506,-245488,-245471,-245453,-245435,-245418,-245400,-245382,-245365,-245347,-245329,-245312,-245294,-245276,-245258,-245241,-245223,-245205,-245187,-245170,-245152,-245134,-245116,-245098,-245080,-245063,-245045,-245027,-245009,-244991,-244973,-244955,-244937,-244920,-244902,-244884,-244866,-244848,-244830,-244812,-244794,-244776,-244758,-244740,-244722,-244704,-244686,-244668,-244650,-244632,-244614,-244596,-244577,-244559,-244541,-244523,-244505,-244487,-244469,-244451,-244432,-244414,-244396,-244378,-244360,-244342,-244323,-244305,-244287,-244269,-244250,-244232,-244214,-244196,-244177,-244159,-244141,-244122,-244104,-244086,-244067,-244049,-244031,-244012,-243994,-243976,-243957,-243939,-243920,-243902,-243884,-243865,-243847,-243828,-243810,-243791,-243773,-243754,-243736,-243717,-243699,-243680,-243662,-243643,-243625,-243606,-243587,-243569,-243550,-243532,-243513,-243495,-243476,-243457,-243439,-243420,-243401,-243383,-243364,-243345,-243327,-243308,-243289,-243270,-243252,-243233,-243214,-243195,-243177,-243158,-243139,-243120,-243102,-243083,-243064,-243045,-243026,-243007,-242989,-242970,-242951,-242932,-242913,-242894,-242875,-242856,-242837,-242818,-242799,-242781,-242762,-242743,-242724,-242705,-242686,-242667,-242648,-242629,-242610,-242590,-242571,-242552,-242533,-242514,-242495,-242476,-242457,-242438,-242419,-242400,-242380,-242361,-242342,-242323,-242304,-242285,-242265,-242246,-242227,-242208,-242188,-242169,-242150,-242131,-242111,-242092,-242073,-242054,-242034,-242015,-241996,-241976,-241957,-241938,-241918,-241899,-241880,-241860,-241841,-241821,-241802,-241783,-241763,-241744,-241724,-241705,-241685,-241666,-241646,-241627,-241607,-241588,-241568,-241549,-241529,-241510,-241490,-241471,-241451,-241432,-241412,-241392,-241373,-241353,-241333,-241314,-241294,-241275,-241255,-241235,-241216,-241196,-241176,-241156,-241137,-241117,-241097,-241078,-241058,-241038,-241018,-240999,-240979,-240959,-240939,-240919,-240900,-240880,-240860,-240840,-240820,-240800,-240780,-240761,-240741,-240721,-240701,-240681,-240661,-240641,-240621,-240601,-240581,-240561,-240541,-240521,-240501,-240481,-240461,-240441,-240421,-240401,-240381,-240361,-240341,-240321,-240301,-240281,-240261,-240241,-240220,-240200,-240180,-240160,-240140,-240120,-240100,-240079,-240059,-240039,-240019,-239999,-239978,-239958,-239938,-239918,-239897,-239877,-239857,-239837,-239816,-239796,-239776,-239755,-239735,-239715,-239694,-239674,-239654,-239633,-239613,-239592,-239572,-239552,-239531,-239511,-239490,-239470,-239449,-239429,-239409,-239388,-239368,-239347,-239327,-239306,-239286,-239265,-239244,-239224,-239203,-239183,-239162,-239142,-239121,-239100,-239080,-239059,-239039,-239018,-238997,-238977,-238956,-238935,-238915,-238894,-238873,-238852,-238832,-238811,-238790,-238770,-238749,-238728,-238707,-238687,-238666,-238645,-238624,-238603,-238582,-238562,-238541,-238520,-238499,-238478,-238457,-238436,-238416,-238395,-238374,-238353,-238332,-238311,-238290,-238269,-238248,-238227,-238206,-238185,-238164,-238143,-238122,-238101,-238080,-238059,-238038,-238017,-237996,-237975,-237954,-237933,-237912,-237890,-237869,-237848,-237827,-237806,-237785,-237764,-237742,-237721,-237700,-237679,-237658,-237636,-237615,-237594,-237573,-237551,-237530,-237509,-237488,-237466,-237445,-237424,-237402,-237381,-237360,-237338,-237317,-237296,-237274,-237253,-237232,-237210,-237189,-237167,-237146,-237125,-237103,-237082,-237060,-237039,-237017,-236996,-236974,-236953,-236931,-236910,-236888,-236867,-236845,-236824,-236802,-236781,-236759,-236737,-236716,-236694,-236673,-236651,-236629,-236608,-236586,-236564,-236543,-236521,-236499,-236478,-236456,-236434,-236413,-236391,-236369,-236347,-236326,-236304,-236282,-236260,-236239,-236217,-236195,-236173,-236151,-236130,-236108,-236086,-236064,-236042,-236020,-235998,-235977,-235955,-235933,-235911,-235889,-235867,-235845,-235823,-235801,-235779,-235757,-235735,-235713,-235691,-235669,-235647,-235625,-235603,-235581,-235559,-235537,-235515,-235493,-235471,-235449,-235427,-235404,-235382,-235360,-235338,-235316,-235294,-235272,-235249,-235227,-235205,-235183,-235161,-235138,-235116,-235094,-235072,-235049,-235027,-235005,-234983,-234960,-234938,-234916,-234893,-234871,-234849,-234827,-234804,-234782,-234759,-234737,-234715,-234692,-234670,-234648,-234625,-234603,-234580,-234558,-234535,-234513,-234490,-234468,-234445,-234423,-234400,-234378,-234355,-234333,-234310,-234288,-234265,-234243,-234220,-234198,-234175,-234152,-234130,-234107,-234085,-234062,-234039,-234017,-233994,-233971,-233949,-233926,-233903,-233881,-233858,-233835,-233812,-233790,-233767,-233744,-233721,-233699,-233676,-233653,-233630,-233608,-233585,-233562,-233539,-233516,-233493,-233471,-233448,-233425,-233402,-233379,-233356,-233333,-233310,-233287,-233264,-233242,-233219,-233196,-233173,-233150,-233127,-233104,-233081,-233058,-233035,-233012,-232989,-232966,-232943,-232919,-232896,-232873,-232850,-232827,-232804,-232781,-232758,-232735,-232712,-232688,-232665,-232642,-232619,-232596,-232573,-232549,-232526,-232503,-232480,-232456,-232433,-232410,-232387,-232363,-232340,-232317,-232294,-232270,-232247,-232224,-232200,-232177,-232154,-232130,-232107,-232084,-232060,-232037,-232013,-231990,-231967,-231943,-231920,-231896,-231873,-231849,-231826,-231803,-231779,-231756,-231732,-231709,-231685,-231662,-231638,-231614,-231591,-231567,-231544,-231520,-231497,-231473,-231449,-231426,-231402,-231379,-231355,-231331,-231308,-231284,-231260,-231237,-231213,-231189,-231166,-231142,-231118,-231095,-231071,-231047,-231023,-231000,-230976,-230952,-230928,-230904,-230881,-230857,-230833,-230809,-230785,-230761,-230738,-230714,-230690,-230666,-230642,-230618,-230594,-230570,-230547,-230523,-230499,-230475,-230451,-230427,-230403,-230379,-230355,-230331,-230307,-230283,-230259,-230235,-230211,-230187,-230163,-230139,-230115,-230090,-230066,-230042,-230018,-229994,-229970,-229946,-229922,-229897,-229873,-229849,-229825,-229801,-229777,-229752,-229728,-229704,-229680,-229656,-229631,-229607,-229583,-229559,-229534,-229510,-229486,-229461,-229437,-229413,-229388,-229364,-229340,-229315,-229291,-229267,-229242,-229218,-229193,-229169,-229145,-229120,-229096,-229071,-229047,-229023,-228998,-228974,-228949,-228925,-228900,-228876,-228851,-228827,-228802,-228778,-228753,-228728,-228704,-228679,-228655,-228630,-228606,-228581,-228556,-228532,-228507,-228482,-228458,-228433,-228408,-228384,-228359,-228334,-228310,-228285,-228260,-228236,-228211,-228186,-228161,-228137,-228112,-228087,-228062,-228038,-228013,-227988,-227963,-227938,-227913,-227889,-227864,-227839,-227814,-227789,-227764,-227739,-227715,-227690,-227665,-227640,-227615,-227590,-227565,-227540,-227515,-227490,-227465,-227440,-227415,-227390,-227365,-227340,-227315,-227290,-227265,-227240,-227215,-227190,-227165,-227140,-227114,-227089,-227064,-227039,-227014,-226989,-226964,-226939,-226913,-226888,-226863,-226838,-226813,-226787,-226762,-226737,-226712,-226687,-226661,-226636,-226611,-226585,-226560,-226535,-226510,-226484,-226459,-226434,-226408,-226383,-226358,-226332,-226307,-226282,-226256,-226231,-226205,-226180,-226155,-226129,-226104,-226078,-226053,-226027,-226002,-225976,-225951,-225925,-225900,-225874,-225849,-225823,-225798,-225772,-225747,-225721,-225696,-225670,-225645,-225619,-225593,-225568,-225542,-225516,-225491,-225465,-225440,-225414,-225388,-225363,-225337,-225311,-225286,-225260,-225234,-225208,-225183,-225157,-225131,-225105,-225080,-225054,-225028,-225002,-224977,-224951,-224925,-224899,-224873,-224847,-224822,-224796,-224770,-224744,-224718,-224692,-224666,-224640,-224614,-224589,-224563,-224537,-224511,-224485,-224459,-224433,-224407,-224381,-224355,-224329,-224303,-224277,-224251,-224225,-224199,-224173,-224147,-224121,-224095,-224068,-224042,-224016,-223990,-223964,-223938,-223912,-223886,-223859,-223833,-223807,-223781,-223755,-223729,-223702,-223676,-223650,-223624,-223598,-223571,-223545,-223519,-223492,-223466,-223440,-223414,-223387,-223361,-223335,-223308,-223282,-223256,-223229,-223203,-223177,-223150,-223124,-223098,-223071,-223045,-223018,-222992,-222965,-222939,-222913,-222886,-222860,-222833,-222807,-222780,-222754,-222727,-222701,-222674,-222648,-222621,-222595,-222568,-222541,-222515,-222488,-222462,-222435,-222409,-222382,-222355,-222329,-222302,-222275,-222249,-222222,-222195,-222169,-222142,-222115,-222089,-222062,-222035,-222009,-221982,-221955,-221928,-221902,-221875,-221848,-221821,-221794,-221768,-221741,-221714,-221687,-221660,-221633,-221607,-221580,-221553,-221526,-221499,-221472,-221445,-221418,-221392,-221365,-221338,-221311,-221284,-221257,-221230,-221203,-221176,-221149,-221122,-221095,-221068,-221041,-221014,-220987,-220960,-220933,-220906,-220879,-220852,-220825,-220797,-220770,-220743,-220716,-220689,-220662,-220635,-220608,-220580,-220553,-220526,-220499,-220472,-220445,-220417,-220390,-220363,-220336,-220308,-220281,-220254,-220227,-220199,-220172,-220145,-220118,-220090,-220063,-220036,-220008,-219981,-219954,-219926,-219899,-219872,-219844,-219817,-219789,-219762,-219735,-219707,-219680,-219652,-219625,-219597,-219570,-219543,-219515,-219488,-219460,-219433,-219405,-219378,-219350,-219323,-219295,-219267,-219240,-219212,-219185,-219157,-219130,-219102,-219074,-219047,-219019,-218992,-218964,-218936,-218909,-218881,-218853,-218826,-218798,-218770,-218743,-218715,-218687,-218659,-218632,-218604,-218576,-218548,-218521,-218493,-218465,-218437,-218410,-218382,-218354,-218326,-218298,-218270,-218243,-218215,-218187,-218159,-218131,-218103,-218075,-218048,-218020,-217992,-217964,-217936,-217908,-217880,-217852,-217824,-217796,-217768,-217740,-217712,-217684,-217656,-217628,-217600,-217572,-217544,-217516,-217488,-217460,-217432,-217404,-217376,-217347,-217319,-217291,-217263,-217235,-217207,-217179,-217151,-217122,-217094,-217066,-217038,-217010,-216981,-216953,-216925,-216897,-216869,-216840,-216812,-216784,-216756,-216727,-216699,-216671,-216642,-216614,-216586,-216557,-216529,-216501,-216472,-216444,-216416,-216387,-216359,-216331,-216302,-216274,-216245,-216217,-216189,-216160,-216132,-216103,-216075,-216046,-216018,-215989,-215961,-215932,-215904,-215875,-215847,-215818,-215790,-215761,-215733,-215704,-215676,-215647,-215618,-215590,-215561,-215533,-215504,-215475,-215447,-215418,-215389,-215361,-215332,-215303,-215275,-215246,-215217,-215189,-215160,-215131,-215103,-215074,-215045,-215016,-214988,-214959,-214930,-214901,-214872,-214844,-214815,-214786,-214757,-214728,-214700,-214671,-214642,-214613,-214584,-214555,-214526,-214497,-214469,-214440,-214411,-214382,-214353,-214324,-214295,-214266,-214237,-214208,-214179,-214150,-214121,-214092,-214063,-214034,-214005,-213976,-213947,-213918,-213889,-213860,-213831,-213802,-213773,-213744,-213714,-213685,-213656,-213627,-213598,-213569,-213540,-213510,-213481,-213452,-213423,-213394,-213365,-213335,-213306,-213277,-213248,-213218,-213189,-213160,-213131,-213101,-213072,-213043,-213014,-212984,-212955,-212926,-212896,-212867,-212838,-212808,-212779,-212750,-212720,-212691,-212661,-212632,-212603,-212573,-212544,-212514,-212485,-212455,-212426,-212397,-212367,-212338,-212308,-212279,-212249,-212220,-212190,-212161,-212131,-212102,-212072,-212042,-212013,-211983,-211954,-211924,-211895,-211865,-211835,-211806,-211776,-211747,-211717,-211687,-211658,-211628,-211598,-211569,-211539,-211509,-211480,-211450,-211420,-211390,-211361,-211331,-211301,-211271,-211242,-211212,-211182,-211152,-211123,-211093,-211063,-211033,-211003,-210973,-210944,-210914,-210884,-210854,-210824,-210794,-210764,-210735,-210705,-210675,-210645,-210615,-210585,-210555,-210525,-210495,-210465,-210435,-210405,-210375,-210345,-210315,-210285,-210255,-210225,-210195,-210165,-210135,-210105,-210075,-210045,-210015,-209985,-209955,-209925,-209894,-209864,-209834,-209804,-209774,-209744,-209714,-209683,-209653,-209623,-209593,-209563,-209533,-209502,-209472,-209442,-209412,-209381,-209351,-209321,-209291,-209260,-209230,-209200,-209169,-209139,-209109,-209079,-209048,-209018,-208988,-208957,-208927,-208896,-208866,-208836,-208805,-208775,-208745,-208714,-208684,-208653,-208623,-208592,-208562,-208532,-208501,-208471,-208440,-208410,-208379,-208349,-208318,-208288,-208257,-208227,-208196,-208165,-208135,-208104,-208074,-208043,-208013,-207982,-207951,-207921,-207890,-207860,-207829,-207798,-207768,-207737,-207706,-207676,-207645,-207614,-207584,-207553,-207522,-207491,-207461,-207430,-207399,-207369,-207338,-207307,-207276,-207245,-207215,-207184,-207153,-207122,-207091,-207061,-207030,-206999,-206968,-206937,-206906,-206876,-206845,-206814,-206783,-206752,-206721,-206690,-206659,-206628,-206597,-206566,-206536,-206505,-206474,-206443,-206412,-206381,-206350,-206319,-206288,-206257,-206226,-206195,-206164,-206132,-206101,-206070,-206039,-206008,-205977,-205946,-205915,-205884,-205853,-205822,-205790,-205759,-205728,-205697,-205666,-205635,-205603,-205572,-205541,-205510,-205479,-205447,-205416,-205385,-205354,-205323,-205291,-205260,-205229,-205197,-205166,-205135,-205104,-205072,-205041,-205010,-204978,-204947,-204916,-204884,-204853,-204822,-204790,-204759,-204727,-204696,-204665,-204633,-204602,-204570,-204539,-204507,-204476,-204445,-204413,-204382,-204350,-204319,-204287,-204256,-204224,-204193,-204161,-204130,-204098,-204066,-204035,-204003,-203972,-203940,-203909,-203877,-203845,-203814,-203782,-203751,-203719,-203687,-203656,-203624,-203592,-203561,-203529,-203497,-203466,-203434,-203402,-203371,-203339,-203307,-203275,-203244,-203212,-203180,-203148,-203117,-203085,-203053,-203021,-202989,-202958,-202926,-202894,-202862,-202830,-202798,-202767,-202735,-202703,-202671,-202639,-202607,-202575,-202543,-202511,-202480,-202448,-202416,-202384,-202352,-202320,-202288,-202256,-202224,-202192,-202160,-202128,-202096,-202064,-202032,-202000,-201968,-201936,-201904,-201872,-201840,-201807,-201775,-201743,-201711,-201679,-201647,-201615,-201583,-201551,-201518,-201486,-201454,-201422,-201390,-201358,-201325,-201293,-201261,-201229,-201197,-201164,-201132,-201100,-201068,-201035,-201003,-200971,-200939,-200906,-200874,-200842,-200809,-200777,-200745,-200712,-200680,-200648,-200615,-200583,-200551,-200518,-200486,-200453,-200421,-200389,-200356,-200324,-200291,-200259,-200227,-200194,-200162,-200129,-200097,-200064,-200032,-199999,-199967,-199934,-199902,-199869,-199837,-199804,-199772,-199739,-199707,-199674,-199641,-199609,-199576,-199544,-199511,-199478,-199446,-199413,-199381,-199348,-199315,-199283,-199250,-199217,-199185,-199152,-199119,-199087,-199054,-199021,-198988,-198956,-198923,-198890,-198857,-198825,-198792,-198759,-198726,-198694,-198661,-198628,-198595,-198562,-198530,-198497,-198464,-198431,-198398,-198365,-198333,-198300,-198267,-198234,-198201,-198168,-198135,-198102,-198069,-198036,-198003,-197971,-197938,-197905,-197872,-197839,-197806,-197773,-197740,-197707,-197674,-197641,-197608,-197575,-197542,-197509,-197475,-197442,-197409,-197376,-197343,-197310,-197277,-197244,-197211,-197178,-197145,-197111,-197078,-197045,-197012,-196979,-196946,-196912,-196879,-196846,-196813,-196780,-196746,-196713,-196680,-196647,-196614,-196580,-196547,-196514,-196480,-196447,-196414,-196381,-196347,-196314,-196281,-196247,-196214,-196181,-196147,-196114,-196081,-196047,-196014,-195981,-195947,-195914,-195880,-195847,-195814,-195780,-195747,-195713,-195680,-195646,-195613,-195579,-195546,-195512,-195479,-195445,-195412,-195378,-195345,-195311,-195278,-195244,-195211,-195177,-195144,-195110,-195077,-195043,-195009,-194976,-194942,-194909,-194875,-194841,-194808,-194774,-194740,-194707,-194673,-194639,-194606,-194572,-194538,-194505,-194471,-194437,-194404,-194370,-194336,-194302,-194269,-194235,-194201,-194167,-194134,-194100,-194066,-194032,-193998,-193965,-193931,-193897,-193863,-193829,-193795,-193762,-193728,-193694,-193660,-193626,-193592,-193558,-193524,-193491,-193457,-193423,-193389,-193355,-193321,-193287,-193253,-193219,-193185,-193151,-193117,-193083,-193049,-193015,-192981,-192947,-192913,-192879,-192845,-192811,-192777,-192743,-192709,-192675,-192640,-192606,-192572,-192538,-192504,-192470,-192436,-192402,-192368,-192333,-192299,-192265,-192231,-192197,-192163,-192128,-192094,-192060,-192026,-191991,-191957,-191923,-191889,-191855,-191820,-191786,-191752,-191717,-191683,-191649,-191615,-191580,-191546,-191512,-191477,-191443,-191409,-191374,-191340,-191306,-191271,-191237,-191202,-191168,-191134,-191099,-191065,-191030,-190996,-190962,-190927,-190893,-190858,-190824,-190789,-190755,-190720,-190686,-190651,-190617,-190582,-190548,-190513,-190479,-190444,-190410,-190375,-190341,-190306,-190271,-190237,-190202,-190168,-190133,-190098,-190064,-190029,-189995,-189960,-189925,-189891,-189856,-189821,-189787,-189752,-189717,-189683,-189648,-189613,-189579,-189544,-189509,-189474,-189440,-189405,-189370,-189335,-189301,-189266,-189231,-189196,-189161,-189127,-189092,-189057,-189022,-188987,-188953,-188918,-188883,-188848,-188813,-188778,-188743,-188708,-188674,-188639,-188604,-188569,-188534,-188499,-188464,-188429,-188394,-188359,-188324,-188289,-188254,-188219,-188184,-188149,-188114,-188079,-188044,-188009,-187974,-187939,-187904,-187869,-187834,-187799,-187764,-187729,-187694,-187659,-187624,-187588,-187553,-187518,-187483,-187448,-187413,-187378,-187342,-187307,-187272,-187237,-187202,-187167,-187131,-187096,-187061,-187026,-186991,-186955,-186920,-186885,-186850,-186814,-186779,-186744,-186709,-186673,-186638,-186603,-186567,-186532,-186497,-186461,-186426,-186391,-186355,-186320,-186285,-186249,-186214,-186178,-186143,-186108,-186072,-186037,-186001,-185966,-185931,-185895,-185860,-185824,-185789,-185753,-185718,-185682,-185647,-185611,-185576,-185540,-185505,-185469,-185434,-185398,-185363,-185327,-185292,-185256,-185221,-185185,-185149,-185114,-185078,-185043,-185007,-184971,-184936,-184900,-184865,-184829,-184793,-184758,-184722,-184686,-184651,-184615,-184579,-184544,-184508,-184472,-184436,-184401,-184365,-184329,-184293,-184258,-184222,-184186,-184150,-184115,-184079,-184043,-184007,-183971,-183936,-183900,-183864,-183828,-183792,-183756,-183721,-183685,-183649,-183613,-183577,-183541,-183505,-183469,-183434,-183398,-183362,-183326,-183290,-183254,-183218,-183182,-183146,-183110,-183074,-183038,-183002,-182966,-182930,-182894,-182858,-182822,-182786,-182750,-182714,-182678,-182642,-182606,-182570,-182534,-182498,-182462,-182425,-182389,-182353,-182317,-182281,-182245,-182209,-182173,-182136,-182100,-182064,-182028,-181992,-181956,-181919,-181883,-181847,-181811,-181775,-181738,-181702,-181666,-181630,-181593,-181557,-181521,-181485,-181448,-181412,-181376,-181340,-181303,-181267,-181231,-181194,-181158,-181122,-181085,-181049,-181013,-180976,-180940,-180903,-180867,-180831,-180794,-180758,-180722,-180685,-180649,-180612,-180576,-180539,-180503,-180466,-180430,-180394,-180357,-180321,-180284,-180248,-180211,-180175,-180138,-180102,-180065,-180028,-179992,-179955,-179919,-179882,-179846,-179809,-179773,-179736,-179699,-179663,-179626,-179590,-179553,-179516,-179480,-179443,-179406,-179370,-179333,-179296,-179260,-179223,-179186,-179150,-179113,-179076,-179040,-179003,-178966,-178929,-178893,-178856,-178819,-178782,-178746,-178709,-178672,-178635,-178599,-178562,-178525,-178488,-178451,-178414,-178378,-178341,-178304,-178267,-178230,-178193,-178157,-178120,-178083,-178046,-178009,-177972,-177935,-177898,-177861,-177824,-177787,-177751,-177714,-177677,-177640,-177603,-177566,-177529,-177492,-177455,-177418,-177381,-177344,-177307,-177270,-177233,-177196,-177159,-177122,-177084,-177047,-177010,-176973,-176936,-176899,-176862,-176825,-176788,-176751,-176713,-176676,-176639,-176602,-176565,-176528,-176491,-176453,-176416,-176379,-176342,-176305,-176267,-176230,-176193,-176156,-176119,-176081,-176044,-176007,-175970,-175932,-175895,-175858,-175821,-175783,-175746,-175709,-175671,-175634,-175597,-175559,-175522,-175485,-175447,-175410,-175373,-175335,-175298,-175261,-175223,-175186,-175148,-175111,-175074,-175036,-174999,-174961,-174924,-174886,-174849,-174812,-174774,-174737,-174699,-174662,-174624,-174587,-174549,-174512,-174474,-174437,-174399,-174362,-174324,-174287,-174249,-174211,-174174,-174136,-174099,-174061,-174024,-173986,-173948,-173911,-173873,-173836,-173798,-173760,-173723,-173685,-173647,-173610,-173572,-173534,-173497,-173459,-173421,-173384,-173346,-173308,-173270,-173233,-173195,-173157,-173120,-173082,-173044,-173006,-172968,-172931,-172893,-172855,-172817,-172780,-172742,-172704,-172666,-172628,-172590,-172553,-172515,-172477,-172439,-172401,-172363,-172325,-172288,-172250,-172212,-172174,-172136,-172098,-172060,-172022,-171984,-171946,-171908,-171870,-171833,-171795,-171757,-171719,-171681,-171643,-171605,-171567,-171529,-171491,-171453,-171415,-171377,-171338,-171300,-171262,-171224,-171186,-171148,-171110,-171072,-171034,-170996,-170958,-170920,-170882,-170843,-170805,-170767,-170729,-170691,-170653,-170615,-170576,-170538,-170500,-170462,-170424,-170385,-170347,-170309,-170271,-170233,-170194,-170156,-170118,-170080,-170041,-170003,-169965,-169927,-169888,-169850,-169812,-169773,-169735,-169697,-169659,-169620,-169582,-169544,-169505,-169467,-169429,-169390,-169352,-169313,-169275,-169237,-169198,-169160,-169121,-169083,-169045,-169006,-168968,-168929,-168891,-168852,-168814,-168776,-168737,-168699,-168660,-168622,-168583,-168545,-168506,-168468,-168429,-168391,-168352,-168314,-168275,-168237,-168198,-168159,-168121,-168082,-168044,-168005,-167967,-167928,-167889,-167851,-167812,-167773,-167735,-167696,-167658,-167619,-167580,-167542,-167503,-167464,-167426,-167387,-167348,-167310,-167271,-167232,-167193,-167155,-167116,-167077,-167039,-167000,-166961,-166922,-166884,-166845,-166806,-166767,-166728,-166690,-166651,-166612,-166573,-166534,-166496,-166457,-166418,-166379,-166340,-166301,-166263,-166224,-166185,-166146,-166107,-166068,-166029,-165990,-165951,-165913,-165874,-165835,-165796,-165757,-165718,-165679,-165640,-165601,-165562,-165523,-165484,-165445,-165406,-165367,-165328,-165289,-165250,-165211,-165172,-165133,-165094,-165055,-165016,-164977,-164938,-164899,-164860,-164820,-164781,-164742,-164703,-164664,-164625,-164586,-164547,-164508,-164468,-164429,-164390,-164351,-164312,-164273,-164233,-164194,-164155,-164116,-164077,-164038,-163998,-163959,-163920,-163881,-163841,-163802,-163763,-163724,-163684,-163645,-163606,-163567,-163527,-163488,-163449,-163409,-163370,-163331,-163291,-163252,-163213,-163173,-163134,-163095,-163055,-163016,-162977,-162937,-162898,-162859,-162819,-162780,-162740,-162701,-162662,-162622,-162583,-162543,-162504,-162464,-162425,-162385,-162346,-162307,-162267,-162228,-162188,-162149,-162109,-162070,-162030,-161991,-161951,-161912,-161872,-161832,-161793,-161753,-161714,-161674,-161635,-161595,-161556,-161516,-161476,-161437,-161397,-161358,-161318,-161278,-161239,-161199,-161159,-161120,-161080,-161040,-161001,-160961,-160921,-160882,-160842,-160802,-160763,-160723,-160683,-160643,-160604,-160564,-160524,-160485,-160445,-160405,-160365,-160326,-160286,-160246,-160206,-160166,-160127,-160087,-160047,-160007,-159967,-159928,-159888,-159848,-159808,-159768,-159728,-159688,-159649,-159609,-159569,-159529,-159489,-159449,-159409,-159369,-159329,-159290,-159250,-159210,-159170,-159130,-159090,-159050,-159010,-158970,-158930,-158890,-158850,-158810,-158770,-158730,-158690,-158650,-158610,-158570,-158530,-158490,-158450,-158410,-158370,-158330,-158290,-158250,-158210,-158169,-158129,-158089,-158049,-158009,-157969,-157929,-157889,-157849,-157808,-157768,-157728,-157688,-157648,-157608,-157568,-157527,-157487,-157447,-157407,-157367,-157326,-157286,-157246,-157206,-157166,-157125,-157085,-157045,-157005,-156964,-156924,-156884,-156844,-156803,-156763,-156723,-156682,-156642,-156602,-156561,-156521,-156481,-156440,-156400,-156360,-156319,-156279,-156239,-156198,-156158,-156118,-156077,-156037,-155996,-155956,-155916,-155875,-155835,-155794,-155754,-155714,-155673,-155633,-155592,-155552,-155511,-155471,-155430,-155390,-155349,-155309,-155268,-155228,-155187,-155147,-155106,-155066,-155025,-154985,-154944,-154904,-154863,-154823,-154782,-154741,-154701,-154660,-154620,-154579,-154538,-154498,-154457,-154417,-154376,-154335,-154295,-154254,-154213,-154173,-154132,-154092,-154051,-154010,-153969,-153929,-153888,-153847,-153807,-153766,-153725,-153685,-153644,-153603,-153562,-153522,-153481,-153440,-153399,-153359,-153318,-153277,-153236,-153196,-153155,-153114,-153073,-153032,-152992,-152951,-152910,-152869,-152828,-152787,-152747,-152706,-152665,-152624,-152583,-152542,-152501,-152460,-152420,-152379,-152338,-152297,-152256,-152215,-152174,-152133,-152092,-152051,-152010,-151969,-151928,-151887,-151846,-151805,-151764,-151723,-151682,-151641,-151600,-151559,-151518,-151477,-151436,-151395,-151354,-151313,-151272,-151231,-151190,-151149,-151108,-151067,-151026,-150985,-150944,-150903,-150861,-150820,-150779,-150738,-150697,-150656,-150615,-150574,-150532,-150491,-150450,-150409,-150368,-150327,-150285,-150244,-150203,-150162,-150121,-150079,-150038,-149997,-149956,-149915,-149873,-149832,-149791,-149750,-149708,-149667,-149626,-149584,-149543,-149502,-149461,-149419,-149378,-149337,-149295,-149254,-149213,-149171,-149130,-149089,-149047,-149006,-148965,-148923,-148882,-148841,-148799,-148758,-148716,-148675,-148634,-148592,-148551,-148509,-148468,-148427,-148385,-148344,-148302,-148261,-148219,-148178,-148136,-148095,-148053,-148012,-147970,-147929,-147887,-147846,-147804,-147763,-147721,-147680,-147638,-147597,-147555,-147514,-147472,-147431,-147389,-147347,-147306,-147264,-147223,-147181,-147140,-147098,-147056,-147015,-146973,-146931,-146890,-146848,-146807,-146765,-146723,-146682,-146640,-146598,-146557,-146515,-146473,-146432,-146390,-146348,-146306,-146265,-146223,-146181,-146140,-146098,-146056,-146014,-145973,-145931,-145889,-145847,-145806,-145764,-145722,-145680,-145638,-145597,-145555,-145513,-145471,-145429,-145388,-145346,-145304,-145262,-145220,-145178,-145136,-145095,-145053,-145011,-144969,-144927,-144885,-144843,-144801,-144760,-144718,-144676,-144634,-144592,-144550,-144508,-144466,-144424,-144382,-144340,-144298,-144256,-144214,-144172,-144130,-144088,-144046,-144004,-143962,-143920,-143878,-143836,-143794,-143752,-143710,-143668,-143626,-143584,-143542,-143500,-143458,-143416,-143374,-143332,-143290,-143247,-143205,-143163,-143121,-143079,-143037,-142995,-142953,-142911,-142868,-142826,-142784,-142742,-142700,-142658,-142615,-142573,-142531,-142489,-142447,-142404,-142362,-142320,-142278,-142236,-142193,-142151,-142109,-142067,-142024,-141982,-141940,-141898,-141855,-141813,-141771,-141729,-141686,-141644,-141602,-141559,-141517,-141475,-141432,-141390,-141348,-141305,-141263,-141221,-141178,-141136,-141094,-141051,-141009,-140967,-140924,-140882,-140839,-140797,-140755,-140712,-140670,-140627,-140585,-140543,-140500,-140458,-140415,-140373,-140330,-140288,-140245,-140203,-140160,-140118,-140076,-140033,-139991,-139948,-139906,-139863,-139820,-139778,-139735,-139693,-139650,-139608,-139565,-139523,-139480,-139438,-139395,-139352,-139310,-139267,-139225,-139182,-139140,-139097,-139054,-139012,-138969,-138926,-138884,-138841,-138799,-138756,-138713,-138671,-138628,-138585,-138543,-138500,-138457,-138415,-138372,-138329,-138287,-138244,-138201,-138158,-138116,-138073,-138030,-137987,-137945,-137902,-137859,-137816,-137774,-137731,-137688,-137645,-137603,-137560,-137517,-137474,-137431,-137389,-137346,-137303,-137260,-137217,-137175,-137132,-137089,-137046,-137003,-136960,-136917,-136875,-136832,-136789,-136746,-136703,-136660,-136617,-136574,-136531,-136489,-136446,-136403,-136360,-136317,-136274,-136231,-136188,-136145,-136102,-136059,-136016,-135973,-135930,-135887,-135844,-135801,-135758,-135715,-135672,-135629,-135586,-135543,-135500,-135457,-135414,-135371,-135328,-135285,-135242,-135199,-135156,-135113,-135070,-135027,-134983,-134940,-134897,-134854,-134811,-134768,-134725,-134682,-134639,-134595,-134552,-134509,-134466,-134423,-134380,-134337,-134293,-134250,-134207,-134164,-134121,-134077,-134034,-133991,-133948,-133905,-133861,-133818,-133775,-133732,-133689,-133645,-133602,-133559,-133516,-133472,-133429,-133386,-133342,-133299,-133256,-133213,-133169,-133126,-133083,-133039,-132996,-132953,-132909,-132866,-132823,-132779,-132736,-132693,-132649,-132606,-132563,-132519,-132476,-132433,-132389,-132346,-132302,-132259,-132216,-132172,-132129,-132085,-132042,-131999,-131955,-131912,-131868,-131825,-131781,-131738,-131694,-131651,-131608,-131564,-131521,-131477,-131434,-131390,-131347,-131303,-131260,-131216,-131173,-131129,-131086,-131042,-130998,-130955,-130911,-130868,-130824,-130781,-130737,-130694,-130650,-130606,-130563,-130519,-130476,-130432,-130388,-130345,-130301,-130258,-130214,-130170,-130127,-130083,-130039,-129996,-129952,-129908,-129865,-129821,-129777,-129734,-129690,-129646,-129603,-129559,-129515,-129472,-129428,-129384,-129340,-129297,-129253,-129209,-129166,-129122,-129078,-129034,-128991,-128947,-128903,-128859,-128815,-128772,-128728,-128684,-128640,-128597,-128553,-128509,-128465,-128421,-128377,-128334,-128290,-128246,-128202,-128158,-128114,-128071,-128027,-127983,-127939,-127895,-127851,-127807,-127763,-127720,-127676,-127632,-127588,-127544,-127500,-127456,-127412,-127368,-127324,-127280,-127236,-127192,-127149,-127105,-127061,-127017,-126973,-126929,-126885,-126841,-126797,-126753,-126709,-126665,-126621,-126577,-126533,-126489,-126445,-126401,-126357,-126313,-126268,-126224,-126180,-126136,-126092,-126048,-126004,-125960,-125916,-125872,-125828,-125784,-125740,-125695,-125651,-125607,-125563,-125519,-125475,-125431,-125387,-125342,-125298,-125254,-125210,-125166,-125122,-125077,-125033,-124989,-124945,-124901,-124856,-124812,-124768,-124724,-124680,-124635,-124591,-124547,-124503,-124459,-124414,-124370,-124326,-124282,-124237,-124193,-124149,-124104,-124060,-124016,-123972,-123927,-123883,-123839,-123794,-123750,-123706,-123661,-123617,-123573,-123528,-123484,-123440,-123395,-123351,-123307,-123262,-123218,-123174,-123129,-123085,-123041,-122996,-122952,-122907,-122863,-122819,-122774,-122730,-122685,-122641,-122596,-122552,-122508,-122463,-122419,-122374,-122330,-122285,-122241,-122196,-122152,-122107,-122063,-122018,-121974,-121930,-121885,-121841,-121796,-121751,-121707,-121662,-121618,-121573,-121529,-121484,-121440,-121395,-121351,-121306,-121262,-121217,-121172,-121128,-121083,-121039,-120994,-120949,-120905,-120860,-120816,-120771,-120726,-120682,-120637,-120593,-120548,-120503,-120459,-120414,-120369,-120325,-120280,-120235,-120191,-120146,-120101,-120057,-120012,-119967,-119923,-119878,-119833,-119789,-119744,-119699,-119654,-119610,-119565,-119520,-119475,-119431,-119386,-119341,-119296,-119252,-119207,-119162,-119117,-119073,-119028,-118983,-118938,-118893,-118849,-118804,-118759,-118714,-118669,-118625,-118580,-118535,-118490,-118445,-118400,-118356,-118311,-118266,-118221,-118176,-118131,-118086,-118041,-117997,-117952,-117907,-117862,-117817,-117772,-117727,-117682,-117637,-117592,-117548,-117503,-117458,-117413,-117368,-117323,-117278,-117233,-117188,-117143,-117098,-117053,-117008,-116963,-116918,-116873,-116828,-116783,-116738,-116693,-116648,-116603,-116558,-116513,-116468,-116423,-116378,-116333,-116288,-116243,-116198,-116153,-116108,-116063,-116017,-115972,-115927,-115882,-115837,-115792,-115747,-115702,-115657,-115612,-115566,-115521,-115476,-115431,-115386,-115341,-115296,-115251,-115205,-115160,-115115,-115070,-115025,-114980,-114934,-114889,-114844,-114799,-114754,-114709,-114663,-114618,-114573,-114528,-114482,-114437,-114392,-114347,-114302,-114256,-114211,-114166,-114121,-114075,-114030,-113985,-113940,-113894,-113849,-113804,-113758,-113713,-113668,-113623,-113577,-113532,-113487,-113441,-113396,-113351,-113305,-113260,-113215,-113169,-113124,-113079,-113033,-112988,-112943,-112897,-112852,-112807,-112761,-112716,-112670,-112625,-112580,-112534,-112489,-112443,-112398,-112353,-112307,-112262,-112216,-112171,-112125,-112080,-112035,-111989,-111944,-111898,-111853,-111807,-111762,-111716,-111671,-111625,-111580,-111534,-111489,-111443,-111398,-111352,-111307,-111261,-111216,-111170,-111125,-111079,-111034,-110988,-110943,-110897,-110852,-110806,-110761,-110715,-110669,-110624,-110578,-110533,-110487,-110442,-110396,-110350,-110305,-110259,-110214,-110168,-110122,-110077,-110031,-109985,-109940,-109894,-109849,-109803,-109757,-109712,-109666,-109620,-109575,-109529,-109483,-109438,-109392,-109346,-109301,-109255,-109209,-109164,-109118,-109072,-109026,-108981,-108935,-108889,-108844,-108798,-108752,-108706,-108661,-108615,-108569,-108523,-108478,-108432,-108386,-108340,-108294,-108249,-108203,-108157,-108111,-108066,-108020,-107974,-107928,-107882,-107837,-107791,-107745,-107699,-107653,-107607,-107562,-107516,-107470,-107424,-107378,-107332,-107286,-107241,-107195,-107149,-107103,-107057,-107011,-106965,-106919,-106874,-106828,-106782,-106736,-106690,-106644,-106598,-106552,-106506,-106460,-106414,-106368,-106322,-106277,-106231,-106185,-106139,-106093,-106047,-106001,-105955,-105909,-105863,-105817,-105771,-105725,-105679,-105633,-105587,-105541,-105495,-105449,-105403,-105357,-105311,-105265,-105219,-105173,-105127,-105081,-105034,-104988,-104942,-104896,-104850,-104804,-104758,-104712,-104666,-104620,-104574,-104528,-104482,-104435,-104389,-104343,-104297,-104251,-104205,-104159,-104113,-104066,-104020,-103974,-103928,-103882,-103836,-103790,-103743,-103697,-103651,-103605,-103559,-103513,-103466,-103420,-103374,-103328,-103282,-103235,-103189,-103143,-103097,-103051,-103004,-102958,-102912,-102866,-102819,-102773,-102727,-102681,-102634,-102588,-102542,-102496,-102449,-102403,-102357,-102311,-102264,-102218,-102172,-102125,-102079,-102033,-101987,-101940,-101894,-101848,-101801,-101755,-101709,-101662,-101616,-101570,-101523,-101477,-101431,-101384,-101338,-101292,-101245,-101199,-101152,-101106,-101060,-101013,-100967,-100921,-100874,-100828,-100781,-100735,-100689,-100642,-100596,-100549,-100503,-100456,-100410,-100364,-100317,-100271,-100224,-100178,-100131,-100085,-100038,-99992,-99946,-99899,-99853,-99806,-99760,-99713,-99667,-99620,-99574,-99527,-99481,-99434,-99388,-99341,-99295,-99248,-99202,-99155,-99109,-99062,-99015,-98969,-98922,-98876,-98829,-98783,-98736,-98690,-98643,-98596,-98550,-98503,-98457,-98410,-98363,-98317,-98270,-98224,-98177,-98130,-98084,-98037,-97991,-97944,-97897,-97851,-97804,-97757,-97711,-97664,-97618,-97571,-97524,-97478,-97431,-97384,-97338,-97291,-97244,-97198,-97151,-97104,-97057,-97011,-96964,-96917,-96871,-96824,-96777,-96731,-96684,-96637,-96590,-96544,-96497,-96450,-96403,-96357,-96310,-96263,-96216,-96170,-96123,-96076,-96029,-95983,-95936,-95889,-95842,-95795,-95749,-95702,-95655,-95608,-95561,-95515,-95468,-95421,-95374,-95327,-95281,-95234,-95187,-95140,-95093,-95046,-95000,-94953,-94906,-94859,-94812,-94765,-94718,-94672,-94625,-94578,-94531,-94484,-94437,-94390,-94343,-94296,-94250,-94203,-94156,-94109,-94062,-94015,-93968,-93921,-93874,-93827,-93780,-93733,-93686,-93639,-93593,-93546,-93499,-93452,-93405,-93358,-93311,-93264,-93217,-93170,-93123,-93076,-93029,-92982,-92935,-92888,-92841,-92794,-92747,-92700,-92653,-92606,-92559,-92512,-92465,-92418,-92371,-92324,-92277,-92229,-92182,-92135,-92088,-92041,-91994,-91947,-91900,-91853,-91806,-91759,-91712,-91665,-91618,-91570,-91523,-91476,-91429,-91382,-91335,-91288,-91241,-91194,-91146,-91099,-91052,-91005,-90958,-90911,-90864,-90816,-90769,-90722,-90675,-90628,-90581,-90533,-90486,-90439,-90392,-90345,-90298,-90250,-90203,-90156,-90109,-90062,-90014,-89967,-89920,-89873,-89825,-89778,-89731,-89684,-89637,-89589,-89542,-89495,-89448,-89400,-89353,-89306,-89259,-89211,-89164,-89117,-89069,-89022,-88975,-88928,-88880,-88833,-88786,-88738,-88691,-88644,-88597,-88549,-88502,-88455,-88407,-88360,-88313,-88265,-88218,-88171,-88123,-88076,-88029,-87981,-87934,-87887,-87839,-87792,-87744,-87697,-87650,-87602,-87555,-87508,-87460,-87413,-87365,-87318,-87271,-87223,-87176,-87128,-87081,-87034,-86986,-86939,-86891,-86844,-86797,-86749,-86702,-86654,-86607,-86559,-86512,-86464,-86417,-86370,-86322,-86275,-86227,-86180,-86132,-86085,-86037,-85990,-85942,-85895,-85847,-85800,-85752,-85705,-85657,-85610,-85562,-85515,-85467,-85420,-85372,-85325,-85277,-85230,-85182,-85135,-85087,-85039,-84992,-84944,-84897,-84849,-84802,-84754,-84707,-84659,-84611,-84564,-84516,-84469,-84421,-84373,-84326,-84278,-84231,-84183,-84135,-84088,-84040,-83993,-83945,-83897,-83850,-83802,-83755,-83707,-83659,-83612,-83564,-83516,-83469,-83421,-83373,-83326,-83278,-83230,-83183,-83135,-83087,-83040,-82992,-82944,-82897,-82849,-82801,-82754,-82706,-82658,-82611,-82563,-82515,-82467,-82420,-82372,-82324,-82277,-82229,-82181,-82133,-82086,-82038,-81990,-81942,-81895,-81847,-81799,-81751,-81704,-81656,-81608,-81560,-81513,-81465,-81417,-81369,-81321,-81274,-81226,-81178,-81130,-81082,-81035,-80987,-80939,-80891,-80843,-80796,-80748,-80700,-80652,-80604,-80556,-80509,-80461,-80413,-80365,-80317,-80269,-80222,-80174,-80126,-80078,-80030,-79982,-79934,-79886,-79839,-79791,-79743,-79695,-79647,-79599,-79551,-79503,-79456,-79408,-79360,-79312,-79264,-79216,-79168,-79120,-79072,-79024,-78976,-78928,-78880,-78833,-78785,-78737,-78689,-78641,-78593,-78545,-78497,-78449,-78401,-78353,-78305,-78257,-78209,-78161,-78113,-78065,-78017,-77969,-77921,-77873,-77825,-77777,-77729,-77681,-77633,-77585,-77537,-77489,-77441,-77393,-77345,-77297,-77249,-77201,-77153,-77105,-77057,-77009,-76961,-76913,-76865,-76817,-76769,-76720,-76672,-76624,-76576,-76528,-76480,-76432,-76384,-76336,-76288,-76240,-76192,-76143,-76095,-76047,-75999,-75951,-75903,-75855,-75807,-75759,-75710,-75662,-75614,-75566,-75518,-75470,-75422,-75374,-75325,-75277,-75229,-75181,-75133,-75085,-75036,-74988,-74940,-74892,-74844,-74796,-74747,-74699,-74651,-74603,-74555,-74507,-74458,-74410,-74362,-74314,-74266,-74217,-74169,-74121,-74073,-74024,-73976,-73928,-73880,-73832,-73783,-73735,-73687,-73639,-73590,-73542,-73494,-73446,-73397,-73349,-73301,-73253,-73204,-73156,-73108,-73060,-73011,-72963,-72915,-72866,-72818,-72770,-72722,-72673,-72625,-72577,-72528,-72480,-72432,-72383,-72335,-72287,-72238,-72190,-72142,-72094,-72045,-71997,-71949,-71900,-71852,-71804,-71755,-71707,-71658,-71610,-71562,-71513,-71465,-71417,-71368,-71320,-71272,-71223,-71175,-71126,-71078,-71030,-70981,-70933,-70885,-70836,-70788,-70739,-70691,-70643,-70594,-70546,-70497,-70449,-70400,-70352,-70304,-70255,-70207,-70158,-70110,-70061,-70013,-69965,-69916,-69868,-69819,-69771,-69722,-69674,-69625,-69577,-69529,-69480,-69432,-69383,-69335,-69286,-69238,-69189,-69141,-69092,-69044,-68995,-68947,-68898,-68850,-68801,-68753,-68704,-68656,-68607,-68559,-68510,-68462,-68413,-68365,-68316,-68268,-68219,-68170,-68122,-68073,-68025,-67976,-67928,-67879,-67831,-67782,-67734,-67685,-67636,-67588,-67539,-67491,-67442,-67394,-67345,-67296,-67248,-67199,-67151,-67102,-67054,-67005,-66956,-66908,-66859,-66811,-66762,-66713,-66665,-66616,-66567,-66519,-66470,-66422,-66373,-66324,-66276,-66227,-66178,-66130,-66081,-66033,-65984,-65935,-65887,-65838,-65789,-65741,-65692,-65643,-65595,-65546,-65497,-65449,-65400,-65351,-65303,-65254,-65205,-65157,-65108,-65059,-65010,-64962,-64913,-64864,-64816,-64767,-64718,-64670,-64621,-64572,-64523,-64475,-64426,-64377,-64328,-64280,-64231,-64182,-64134,-64085,-64036,-63987,-63939,-63890,-63841,-63792,-63744,-63695,-63646,-63597,-63549,-63500,-63451,-63402,-63353,-63305,-63256,-63207,-63158,-63110,-63061,-63012,-62963,-62914,-62866,-62817,-62768,-62719,-62670,-62622,-62573,-62524,-62475,-62426,-62377,-62329,-62280,-62231,-62182,-62133,-62084,-62036,-61987,-61938,-61889,-61840,-61791,-61743,-61694,-61645,-61596,-61547,-61498,-61449,-61401,-61352,-61303,-61254,-61205,-61156,-61107,-61058,-61010,-60961,-60912,-60863,-60814,-60765,-60716,-60667,-60618,-60569,-60521,-60472,-60423,-60374,-60325,-60276,-60227,-60178,-60129,-60080,-60031,-59982,-59934,-59885,-59836,-59787,-59738,-59689,-59640,-59591,-59542,-59493,-59444,-59395,-59346,-59297,-59248,-59199,-59150,-59101,-59052,-59003,-58954,-58905,-58856,-58807,-58758,-58710,-58661,-58612,-58563,-58514,-58465,-58416,-58367,-58318,-58269,-58220,-58170,-58121,-58072,-58023,-57974,-57925,-57876,-57827,-57778,-57729,-57680,-57631,-57582,-57533,-57484,-57435,-57386,-57337,-57288,-57239,-57190,-57141,-57092,-57043,-56994,-56945,-56895,-56846,-56797,-56748,-56699,-56650,-56601,-56552,-56503,-56454,-56405,-56356,-56307,-56257,-56208,-56159,-56110,-56061,-56012,-55963,-55914,-55865,-55815,-55766,-55717,-55668,-55619,-55570,-55521,-55472,-55423,-55373,-55324,-55275,-55226,-55177,-55128,-55079,-55029,-54980,-54931,-54882,-54833,-54784,-54735,-54685,-54636,-54587,-54538,-54489,-54440,-54390,-54341,-54292,-54243,-54194,-54144,-54095,-54046,-53997,-53948,-53899,-53849,-53800,-53751,-53702,-53653,-53603,-53554,-53505,-53456,-53407,-53357,-53308,-53259,-53210,-53160,-53111,-53062,-53013,-52964,-52914,-52865,-52816,-52767,-52717,-52668,-52619,-52570,-52520,-52471,-52422,-52373,-52323,-52274,-52225,-52176,-52126,-52077,-52028,-51979,-51929,-51880,-51831,-51781,-51732,-51683,-51634,-51584,-51535,-51486,-51437,-51387,-51338,-51289,-51239,-51190,-51141,-51091,-51042,-50993,-50944,-50894,-50845,-50796,-50746,-50697,-50648,-50598,-50549,-50500,-50450,-50401,-50352,-50302,-50253,-50204,-50154,-50105,-50056,-50006,-49957,-49908,-49858,-49809,-49760,-49710,-49661,-49612,-49562,-49513,-49463,-49414,-49365,-49315,-49266,-49217,-49167,-49118,-49069,-49019,-48970,-48920,-48871,-48822,-48772,-48723,-48673,-48624,-48575,-48525,-48476,-48426,-48377,-48328,-48278,-48229,-48179,-48130,-48081,-48031,-47982,-47932,-47883,-47834,-47784,-47735,-47685,-47636,-47586,-47537,-47488,-47438,-47389,-47339,-47290,-47240,-47191,-47141,-47092,-47043,-46993,-46944,-46894,-46845,-46795,-46746,-46696,-46647,-46597,-46548,-46499,-46449,-46400,-46350,-46301,-46251,-46202,-46152,-46103,-46053,-46004,-45954,-45905,-45855,-45806,-45756,-45707,-45657,-45608,-45558,-45509,-45459,-45410,-45360,-45311,-45261,-45212,-45162,-45113,-45063,-45014,-44964,-44915,-44865,-44816,-44766,-44717,-44667,-44618,-44568,-44518,-44469,-44419,-44370,-44320,-44271,-44221,-44172,-44122,-44073,-44023,-43973,-43924,-43874,-43825,-43775,-43726,-43676,-43627,-43577,-43527,-43478,-43428,-43379,-43329,-43280,-43230,-43180,-43131,-43081,-43032,-42982,-42932,-42883,-42833,-42784,-42734,-42685,-42635,-42585,-42536,-42486,-42437,-42387,-42337,-42288,-42238,-42189,-42139,-42089,-42040,-41990,-41940,-41891,-41841,-41792,-41742,-41692,-41643,-41593,-41543,-41494,-41444,-41395,-41345,-41295,-41246,-41196,-41146,-41097,-41047,-40997,-40948,-40898,-40848,-40799,-40749,-40700,-40650,-40600,-40551,-40501,-40451,-40402,-40352,-40302,-40253,-40203,-40153,-40104,-40054,-40004,-39955,-39905,-39855,-39805,-39756,-39706,-39656,-39607,-39557,-39507,-39458,-39408,-39358,-39309,-39259,-39209,-39159,-39110,-39060,-39010,-38961,-38911,-38861,-38812,-38762,-38712,-38662,-38613,-38563,-38513,-38464,-38414,-38364,-38314,-38265,-38215,-38165,-38115,-38066,-38016,-37966,-37916,-37867,-37817,-37767,-37718,-37668,-37618,-37568,-37519,-37469,-37419,-37369,-37320,-37270,-37220,-37170,-37121,-37071,-37021,-36971,-36921,-36872,-36822,-36772,-36722,-36673,-36623,-36573,-36523,-36474,-36424,-36374,-36324,-36274,-36225,-36175,-36125,-36075,-36026,-35976,-35926,-35876,-35826,-35777,-35727,-35677,-35627,-35577,-35528,-35478,-35428,-35378,-35328,-35279,-35229,-35179,-35129,-35079,-35029,-34980,-34930,-34880,-34830,-34780,-34731,-34681,-34631,-34581,-34531,-34481,-34432,-34382,-34332,-34282,-34232,-34182,-34133,-34083,-34033,-33983,-33933,-33883,-33834,-33784,-33734,-33684,-33634,-33584,-33534,-33485,-33435,-33385,-33335,-33285,-33235,-33185,-33136,-33086,-33036,-32986,-32936,-32886,-32836,-32787,-32737,-32687,-32637,-32587,-32537,-32487,-32437,-32388,-32338,-32288,-32238,-32188,-32138,-32088,-32038,-31988,-31939,-31889,-31839,-31789,-31739,-31689,-31639,-31589,-31539,-31489,-31440,-31390,-31340,-31290,-31240,-31190,-31140,-31090,-31040,-30990,-30941,-30891,-30841,-30791,-30741,-30691,-30641,-30591,-30541,-30491,-30441,-30391,-30341,-30292,-30242,-30192,-30142,-30092,-30042,-29992,-29942,-29892,-29842,-29792,-29742,-29692,-29642,-29592,-29542,-29493,-29443,-29393,-29343,-29293,-29243,-29193,-29143,-29093,-29043,-28993,-28943,-28893,-28843,-28793,-28743,-28693,-28643,-28593,-28543,-28493,-28443,-28393,-28343,-28294,-28244,-28194,-28144,-28094,-28044,-27994,-27944,-27894,-27844,-27794,-27744,-27694,-27644,-27594,-27544,-27494,-27444,-27394,-27344,-27294,-27244,-27194,-27144,-27094,-27044,-26994,-26944,-26894,-26844,-26794,-26744,-26694,-26644,-26594,-26544,-26494,-26444,-26394,-26344,-26294,-26244,-26194,-26144,-26094,-26044,-25994,-25944,-25894,-25844,-25794,-25744,-25694,-25644,-25594,-25544,-25494,-25443,-25393,-25343,-25293,-25243,-25193,-25143,-25093,-25043,-24993,-24943,-24893,-24843,-24793,-24743,-24693,-24643,-24593,-24543,-24493,-24443,-24393,-24343,-24293,-24243,-24192,-24142,-24092,-24042,-23992,-23942,-23892,-23842,-23792,-23742,-23692,-23642,-23592,-23542,-23492,-23442,-23392,-23341,-23291,-23241,-23191,-23141,-23091,-23041,-22991,-22941,-22891,-22841,-22791,-22741,-22691,-22640,-22590,-22540,-22490,-22440,-22390,-22340,-22290,-22240,-22190,-22140,-22090,-22039,-21989,-21939,-21889,-21839,-21789,-21739,-21689,-21639,-21589,-21539,-21488,-21438,-21388,-21338,-21288,-21238,-21188,-21138,-21088,-21038,-20987,-20937,-20887,-20837,-20787,-20737,-20687,-20637,-20587,-20537,-20486,-20436,-20386,-20336,-20286,-20236,-20186,-20136,-20085,-20035,-19985,-19935,-19885,-19835,-19785,-19735,-19685,-19634,-19584,-19534,-19484,-19434,-19384,-19334,-19284,-19233,-19183,-19133,-19083,-19033,-18983,-18933,-18882,-18832,-18782,-18732,-18682,-18632,-18582,-18531,-18481,-18431,-18381,-18331,-18281,-18231,-18180,-18130,-18080,-18030,-17980,-17930,-17880,-17829,-17779,-17729,-17679,-17629,-17579,-17529,-17478,-17428,-17378,-17328,-17278,-17228,-17177,-17127,-17077,-17027,-16977,-16927,-16877,-16826,-16776,-16726,-16676,-16626,-16576,-16525,-16475,-16425,-16375,-16325,-16275,-16224,-16174,-16124,-16074,-16024,-15974,-15923,-15873,-15823,-15773,-15723,-15672,-15622,-15572,-15522,-15472,-15422,-15371,-15321,-15271,-15221,-15171,-15121,-15070,-15020,-14970,-14920,-14870,-14819,-14769,-14719,-14669,-14619,-14568,-14518,-14468,-14418,-14368,-14318,-14267,-14217,-14167,-14117,-14067,-14016,-13966,-13916,-13866,-13816,-13765,-13715,-13665,-13615,-13565,-13514,-13464,-13414,-13364,-13314,-13263,-13213,-13163,-13113,-13063,-13012,-12962,-12912,-12862,-12812,-12761,-12711,-12661,-12611,-12561,-12510,-12460,-12410,-12360,-12310,-12259,-12209,-12159,-12109,-12058,-12008,-11958,-11908,-11858,-11807,-11757,-11707,-11657,-11607,-11556,-11506,-11456,-11406,-11355,-11305,-11255,-11205,-11155,-11104,-11054,-11004,-10954,-10903,-10853,-10803,-10753,-10703,-10652,-10602,-10552,-10502,-10451,-10401,-10351,-10301,-10251,-10200,-10150,-10100,-10050,-9999,-9949,-9899,-9849,-9798,-9748,-9698,-9648,-9598,-9547,-9497,-9447,-9397,-9346,-9296,-9246,-9196,-9145,-9095,-9045,-8995,-8945,-8894,-8844,-8794,-8744,-8693,-8643,-8593,-8543,-8492,-8442,-8392,-8342,-8291,-8241,-8191,-8141,-8090,-8040,-7990,-7940,-7889,-7839,-7789,-7739,-7689,-7638,-7588,-7538,-7488,-7437,-7387,-7337,-7287,-7236,-7186,-7136,-7086,-7035,-6985,-6935,-6885,-6834,-6784,-6734,-6684,-6633,-6583,-6533,-6483,-6432,-6382,-6332,-6282,-6231,-6181,-6131,-6081,-6030,-5980,-5930,-5880,-5829,-5779,-5729,-5679,-5628,-5578,-5528,-5478,-5427,-5377,-5327,-5277,-5226,-5176,-5126,-5075,-5025,-4975,-4925,-4874,-4824,-4774,-4724,-4673,-4623,-4573,-4523,-4472,-4422,-4372,-4322,-4271,-4221,-4171,-4121,-4070,-4020,-3970,-3920,-3869,-3819,-3769,-3719,-3668,-3618,-3568,-3517,-3467,-3417,-3367,-3316,-3266,-3216,-3166,-3115,-3065,-3015,-2965,-2914,-2864,-2814,-2764,-2713,-2663,-2613,-2562,-2512,-2462,-2412,-2361,-2311,-2261,-2211,-2160,-2110,-2060,-2010,-1959,-1909,-1859,-1809,-1758,-1708,-1658,-1607,-1557,-1507,-1457,-1406,-1356,-1306,-1256,-1205,-1155,-1105,-1055,-1004,-954,-904,-854,-803,-753,-703,-652,-602,-552,-502,-451,-401,-351,-301,-250,-200,-150,-100,-49,0,50,101,151,201,251,302,352,402,452,503,553,603,653,704,754,804,855,905,955,1005,1056,1106,1156,1206,1257,1307,1357,1407,1458,1508,1558,1608,1659,1709,1759,1810,1860,1910,1960,2011,2061,2111,2161,2212,2262,2312,2362,2413,2463,2513,2563,2614,2664,2714,2765,2815,2865,2915,2966,3016,3066,3116,3167,3217,3267,3317,3368,3418,3468,3518,3569,3619,3669,3720,3770,3820,3870,3921,3971,4021,4071,4122,4172,4222,4272,4323,4373,4423,4473,4524,4574,4624,4674,4725,4775,4825,4875,4926,4976,5026,5076,5127,5177,5227,5278,5328,5378,5428,5479,5529,5579,5629,5680,5730,5780,5830,5881,5931,5981,6031,6082,6132,6182,6232,6283,6333,6383,6433,6484,6534,6584,6634,6685,6735,6785,6835,6886,6936,6986,7036,7087,7137,7187,7237,7288,7338,7388,7438,7489,7539,7589,7639,7690,7740,7790,7840,7890,7941,7991,8041,8091,8142,8192,8242,8292,8343,8393,8443,8493,8544,8594,8644,8694,8745,8795,8845,8895,8946,8996,9046,9096,9146,9197,9247,9297,9347,9398,9448,9498,9548,9599,9649,9699,9749,9799,9850,9900,9950,10000,10051,10101,10151,10201,10252,10302,10352,10402,10452,10503,10553,10603,10653,10704,10754,10804,10854,10904,10955,11005,11055,11105,11156,11206,11256,11306,11356,11407,11457,11507,11557,11608,11658,11708,11758,11808,11859,11909,11959,12009,12059,12110,12160,12210,12260,12311,12361,12411,12461,12511,12562,12612,12662,12712,12762,12813,12863,12913,12963,13013,13064,13114,13164,13214,13264,13315,13365,13415,13465,13515,13566,13616,13666,13716,13766,13817,13867,13917,13967,14017,14068,14118,14168,14218,14268,14319,14369,14419,14469,14519,14569,14620,14670,14720,14770,14820,14871,14921,14971,15021,15071,15122,15172,15222,15272,15322,15372,15423,15473,15523,15573,15623,15673,15724,15774,15824,15874,15924,15975,16025,16075,16125,16175,16225,16276,16326,16376,16426,16476,16526,16577,16627,16677,16727,16777,16827,16878,16928,16978,17028,17078,17128,17178,17229,17279,17329,17379,17429,17479,17530,17580,17630,17680,17730,17780,17830,17881,17931,17981,18031,18081,18131,18181,18232,18282,18332,18382,18432,18482,18532,18583,18633,18683,18733,18783,18833,18883,18934,18984,19034,19084,19134,19184,19234,19285,19335,19385,19435,19485,19535,19585,19635,19686,19736,19786,19836,19886,19936,19986,20036,20086,20137,20187,20237,20287,20337,20387,20437,20487,20538,20588,20638,20688,20738,20788,20838,20888,20938,20988,21039,21089,21139,21189,21239,21289,21339,21389,21439,21489,21540,21590,21640,21690,21740,21790,21840,21890,21940,21990,22040,22091,22141,22191,22241,22291,22341,22391,22441,22491,22541,22591,22641,22692,22742,22792,22842,22892,22942,22992,23042,23092,23142,23192,23242,23292,23342,23393,23443,23493,23543,23593,23643,23693,23743,23793,23843,23893,23943,23993,24043,24093,24143,24193,24244,24294,24344,24394,24444,24494,24544,24594,24644,24694,24744,24794,24844,24894,24944,24994,25044,25094,25144,25194,25244,25294,25344,25394,25444,25495,25545,25595,25645,25695,25745,25795,25845,25895,25945,25995,26045,26095,26145,26195,26245,26295,26345,26395,26445,26495,26545,26595,26645,26695,26745,26795,26845,26895,26945,26995,27045,27095,27145,27195,27245,27295,27345,27395,27445,27495,27545,27595,27645,27695,27745,27795,27845,27895,27945,27995,28045,28095,28145,28195,28245,28295,28344,28394,28444,28494,28544,28594,28644,28694,28744,28794,28844,28894,28944,28994,29044,29094,29144,29194,29244,29294,29344,29394,29444,29494,29543,29593,29643,29693,29743,29793,29843,29893,29943,29993,30043,30093,30143,30193,30243,30293,30342,30392,30442,30492,30542,30592,30642,30692,30742,30792,30842,30892,30942,30991,31041,31091,31141,31191,31241,31291,31341,31391,31441,31490,31540,31590,31640,31690,31740,31790,31840,31890,31940,31989,32039,32089,32139,32189,32239,32289,32339,32389,32438,32488,32538,32588,32638,32688,32738,32788,32837,32887,32937,32987,33037,33087,33137,33186,33236,33286,33336,33386,33436,33486,33535,33585,33635,33685,33735,33785,33835,33884,33934,33984,34034,34084,34134,34183,34233,34283,34333,34383,34433,34482,34532,34582,34632,34682,34732,34781,34831,34881,34931,34981,35030,35080,35130,35180,35230,35280,35329,35379,35429,35479,35529,35578,35628,35678,35728,35778,35827,35877,35927,35977,36027,36076,36126,36176,36226,36275,36325,36375,36425,36475,36524,36574,36624,36674,36723,36773,36823,36873,36922,36972,37022,37072,37122,37171,37221,37271,37321,37370,37420,37470,37520,37569,37619,37669,37719,37768,37818,37868,37917,37967,38017,38067,38116,38166,38216,38266,38315,38365,38415,38465,38514,38564,38614,38663,38713,38763,38813,38862,38912,38962,39011,39061,39111,39160,39210,39260,39310,39359,39409,39459,39508,39558,39608,39657,39707,39757,39806,39856,39906,39956,40005,40055,40105,40154,40204,40254,40303,40353,40403,40452,40502,40552,40601,40651,40701,40750,40800,40849,40899,40949,40998,41048,41098,41147,41197,41247,41296,41346,41396,41445,41495,41544,41594,41644,41693,41743,41793,41842,41892,41941,41991,42041,42090,42140,42190,42239,42289,42338,42388,42438,42487,42537,42586,42636,42686,42735,42785,42834,42884,42933,42983,43033,43082,43132,43181,43231,43281,43330,43380,43429,43479,43528,43578,43628,43677,43727,43776,43826,43875,43925,43974,44024,44074,44123,44173,44222,44272,44321,44371,44420,44470,44519,44569,44619,44668,44718,44767,44817,44866,44916,44965,45015,45064,45114,45163,45213,45262,45312,45361,45411,45460,45510,45559,45609,45658,45708,45757,45807,45856,45906,45955,46005,46054,46104,46153,46203,46252,46302,46351,46401,46450,46500,46549,46598,46648,46697,46747,46796,46846,46895,46945,46994,47044,47093,47142,47192,47241,47291,47340,47390,47439,47489,47538,47587,47637,47686,47736,47785,47835,47884,47933,47983,48032,48082,48131,48180,48230,48279,48329,48378,48427,48477,48526,48576,48625,48674,48724,48773,48823,48872,48921,48971,49020,49070,49119,49168,49218,49267,49316,49366,49415,49464,49514,49563,49613,49662,49711,49761,49810,49859,49909,49958,50007,50057,50106,50155,50205,50254,50303,50353,50402,50451,50501,50550,50599,50649,50698,50747,50797,50846,50895,50945,50994,51043,51092,51142,51191,51240,51290,51339,51388,51438,51487,51536,51585,51635,51684,51733,51782,51832,51881,51930,51980,52029,52078,52127,52177,52226,52275,52324,52374,52423,52472,52521,52571,52620,52669,52718,52768,52817,52866,52915,52965,53014,53063,53112,53161,53211,53260,53309,53358,53408,53457,53506,53555,53604,53654,53703,53752,53801,53850,53900,53949,53998,54047,54096,54145,54195,54244,54293,54342,54391,54441,54490,54539,54588,54637,54686,54736,54785,54834,54883,54932,54981,55030,55080,55129,55178,55227,55276,55325,55374,55424,55473,55522,55571,55620,55669,55718,55767,55816,55866,55915,55964,56013,56062,56111,56160,56209,56258,56308,56357,56406,56455,56504,56553,56602,56651,56700,56749,56798,56847,56896,56946,56995,57044,57093,57142,57191,57240,57289,57338,57387,57436,57485,57534,57583,57632,57681,57730,57779,57828,57877,57926,57975,58024,58073,58122,58171,58221,58270,58319,58368,58417,58466,58515,58564,58613,58662,58711,58759,58808,58857,58906,58955,59004,59053,59102,59151,59200,59249,59298,59347,59396,59445,59494,59543,59592,59641,59690,59739,59788,59837,59886,59935,59983,60032,60081,60130,60179,60228,60277,60326,60375,60424,60473,60522,60570,60619,60668,60717,60766,60815,60864,60913,60962,61011,61059,61108,61157,61206,61255,61304,61353,61402,61450,61499,61548,61597,61646,61695,61744,61792,61841,61890,61939,61988,62037,62085,62134,62183,62232,62281,62330,62378,62427,62476,62525,62574,62623,62671,62720,62769,62818,62867,62915,62964,63013,63062,63111,63159,63208,63257,63306,63354,63403,63452,63501,63550,63598,63647,63696,63745,63793,63842,63891,63940,63988,64037,64086,64135,64183,64232,64281,64329,64378,64427,64476,64524,64573,64622,64671,64719,64768,64817,64865,64914,64963,65011,65060,65109,65158,65206,65255,65304,65352,65401,65450,65498,65547,65596,65644,65693,65742,65790,65839,65888,65936,65985,66034,66082,66131,66179,66228,66277,66325,66374,66423,66471,66520,66568,66617,66666,66714,66763,66812,66860,66909,66957,67006,67055,67103,67152,67200,67249,67297,67346,67395,67443,67492,67540,67589,67637,67686,67735,67783,67832,67880,67929,67977,68026,68074,68123,68171,68220,68269,68317,68366,68414,68463,68511,68560,68608,68657,68705,68754,68802,68851,68899,68948,68996,69045,69093,69142,69190,69239,69287,69336,69384,69433,69481,69530,69578,69626,69675,69723,69772,69820,69869,69917,69966,70014,70062,70111,70159,70208,70256,70305,70353,70401,70450,70498,70547,70595,70644,70692,70740,70789,70837,70886,70934,70982,71031,71079,71127,71176,71224,71273,71321,71369,71418,71466,71514,71563,71611,71659,71708,71756,71805,71853,71901,71950,71998,72046,72095,72143,72191,72239,72288,72336,72384,72433,72481,72529,72578,72626,72674,72723,72771,72819,72867,72916,72964,73012,73061,73109,73157,73205,73254,73302,73350,73398,73447,73495,73543,73591,73640,73688,73736,73784,73833,73881,73929,73977,74025,74074,74122,74170,74218,74267,74315,74363,74411,74459,74508,74556,74604,74652,74700,74748,74797,74845,74893,74941,74989,75037,75086,75134,75182,75230,75278,75326,75375,75423,75471,75519,75567,75615,75663,75711,75760,75808,75856,75904,75952,76000,76048,76096,76144,76193,76241,76289,76337,76385,76433,76481,76529,76577,76625,76673,76721,76770,76818,76866,76914,76962,77010,77058,77106,77154,77202,77250,77298,77346,77394,77442,77490,77538,77586,77634,77682,77730,77778,77826,77874,77922,77970,78018,78066,78114,78162,78210,78258,78306,78354,78402,78450,78498,78546,78594,78642,78690,78738,78786,78834,78881,78929,78977,79025,79073,79121,79169,79217,79265,79313,79361,79409,79457,79504,79552,79600,79648,79696,79744,79792,79840,79887,79935,79983,80031,80079,80127,80175,80223,80270,80318,80366,80414,80462,80510,80557,80605,80653,80701,80749,80797,80844,80892,80940,80988,81036,81083,81131,81179,81227,81275,81322,81370,81418,81466,81514,81561,81609,81657,81705,81752,81800,81848,81896,81943,81991,82039,82087,82134,82182,82230,82278,82325,82373,82421,82468,82516,82564,82612,82659,82707,82755,82802,82850,82898,82945,82993,83041,83088,83136,83184,83231,83279,83327,83374,83422,83470,83517,83565,83613,83660,83708,83756,83803,83851,83898,83946,83994,84041,84089,84136,84184,84232,84279,84327,84374,84422,84470,84517,84565,84612,84660,84708,84755,84803,84850,84898,84945,84993,85040,85088,85136,85183,85231,85278,85326,85373,85421,85468,85516,85563,85611,85658,85706,85753,85801,85848,85896,85943,85991,86038,86086,86133,86181,86228,86276,86323,86371,86418,86465,86513,86560,86608,86655,86703,86750,86798,86845,86892,86940,86987,87035,87082,87129,87177,87224,87272,87319,87366,87414,87461,87509,87556,87603,87651,87698,87745,87793,87840,87888,87935,87982,88030,88077,88124,88172,88219,88266,88314,88361,88408,88456,88503,88550,88598,88645,88692,88739,88787,88834,88881,88929,88976,89023,89070,89118,89165,89212,89260,89307,89354,89401,89449,89496,89543,89590,89638,89685,89732,89779,89826,89874,89921,89968,90015,90063,90110,90157,90204,90251,90299,90346,90393,90440,90487,90534,90582,90629,90676,90723,90770,90817,90865,90912,90959,91006,91053,91100,91147,91195,91242,91289,91336,91383,91430,91477,91524,91571,91619,91666,91713,91760,91807,91854,91901,91948,91995,92042,92089,92136,92183,92230,92278,92325,92372,92419,92466,92513,92560,92607,92654,92701,92748,92795,92842,92889,92936,92983,93030,93077,93124,93171,93218,93265,93312,93359,93406,93453,93500,93547,93594,93640,93687,93734,93781,93828,93875,93922,93969,94016,94063,94110,94157,94204,94251,94297,94344,94391,94438,94485,94532,94579,94626,94673,94719,94766,94813,94860,94907,94954,95001,95047,95094,95141,95188,95235,95282,95328,95375,95422,95469,95516,95562,95609,95656,95703,95750,95796,95843,95890,95937,95984,96030,96077,96124,96171,96217,96264,96311,96358,96404,96451,96498,96545,96591,96638,96685,96732,96778,96825,96872,96918,96965,97012,97058,97105,97152,97199,97245,97292,97339,97385,97432,97479,97525,97572,97619,97665,97712,97758,97805,97852,97898,97945,97992,98038,98085,98131,98178,98225,98271,98318,98364,98411,98458,98504,98551,98597,98644,98691,98737,98784,98830,98877,98923,98970,99016,99063,99110,99156,99203,99249,99296,99342,99389,99435,99482,99528,99575,99621,99668,99714,99761,99807,99854,99900,99947,99993,100039,100086,100132,100179,100225,100272,100318,100365,100411,100457,100504,100550,100597,100643,100690,100736,100782,100829,100875,100922,100968,101014,101061,101107,101153,101200,101246,101293,101339,101385,101432,101478,101524,101571,101617,101663,101710,101756,101802,101849,101895,101941,101988,102034,102080,102126,102173,102219,102265,102312,102358,102404,102450,102497,102543,102589,102635,102682,102728,102774,102820,102867,102913,102959,103005,103052,103098,103144,103190,103236,103283,103329,103375,103421,103467,103514,103560,103606,103652,103698,103744,103791,103837,103883,103929,103975,104021,104067,104114,104160,104206,104252,104298,104344,104390,104436,104483,104529,104575,104621,104667,104713,104759,104805,104851,104897,104943,104989,105035,105082,105128,105174,105220,105266,105312,105358,105404,105450,105496,105542,105588,105634,105680,105726,105772,105818,105864,105910,105956,106002,106048,106094,106140,106186,106232,106278,106323,106369,106415,106461,106507,106553,106599,106645,106691,106737,106783,106829,106875,106920,106966,107012,107058,107104,107150,107196,107242,107287,107333,107379,107425,107471,107517,107563,107608,107654,107700,107746,107792,107838,107883,107929,107975,108021,108067,108112,108158,108204,108250,108295,108341,108387,108433,108479,108524,108570,108616,108662,108707,108753,108799,108845,108890,108936,108982,109027,109073,109119,109165,109210,109256,109302,109347,109393,109439,109484,109530,109576,109621,109667,109713,109758,109804,109850,109895,109941,109986,110032,110078,110123,110169,110215,110260,110306,110351,110397,110443,110488,110534,110579,110625,110670,110716,110762,110807,110853,110898,110944,110989,111035,111080,111126,111171,111217,111262,111308,111353,111399,111444,111490,111535,111581,111626,111672,111717,111763,111808,111854,111899,111945,111990,112036,112081,112126,112172,112217,112263,112308,112354,112399,112444,112490,112535,112581,112626,112671,112717,112762,112808,112853,112898,112944,112989,113034,113080,113125,113170,113216,113261,113306,113352,113397,113442,113488,113533,113578,113624,113669,113714,113759,113805,113850,113895,113941,113986,114031,114076,114122,114167,114212,114257,114303,114348,114393,114438,114483,114529,114574,114619,114664,114710,114755,114800,114845,114890,114935,114981,115026,115071,115116,115161,115206,115252,115297,115342,115387,115432,115477,115522,115567,115613,115658,115703,115748,115793,115838,115883,115928,115973,116018,116064,116109,116154,116199,116244,116289,116334,116379,116424,116469,116514,116559,116604,116649,116694,116739,116784,116829,116874,116919,116964,117009,117054,117099,117144,117189,117234,117279,117324,117369,117414,117459,117504,117549,117593,117638,117683,117728,117773,117818,117863,117908,117953,117998,118042,118087,118132,118177,118222,118267,118312,118357,118401,118446,118491,118536,118581,118626,118670,118715,118760,118805,118850,118894,118939,118984,119029,119074,119118,119163,119208,119253,119297,119342,119387,119432,119476,119521,119566,119611,119655,119700,119745,119790,119834,119879,119924,119968,120013,120058,120102,120147,120192,120236,120281,120326,120370,120415,120460,120504,120549,120594,120638,120683,120727,120772,120817,120861,120906,120950,120995,121040,121084,121129,121173,121218,121263,121307,121352,121396,121441,121485,121530,121574,121619,121663,121708,121752,121797,121842,121886,121931,121975,122019,122064,122108,122153,122197,122242,122286,122331,122375,122420,122464,122509,122553,122597,122642,122686,122731,122775,122820,122864,122908,122953,122997,123042,123086,123130,123175,123219,123263,123308,123352,123396,123441,123485,123529,123574,123618,123662,123707,123751,123795,123840,123884,123928,123973,124017,124061,124105,124150,124194,124238,124283,124327,124371,124415,124460,124504,124548,124592,124636,124681,124725,124769,124813,124857,124902,124946,124990,125034,125078,125123,125167,125211,125255,125299,125343,125388,125432,125476,125520,125564,125608,125652,125696,125741,125785,125829,125873,125917,125961,126005,126049,126093,126137,126181,126225,126269,126314,126358,126402,126446,126490,126534,126578,126622,126666,126710,126754,126798,126842,126886,126930,126974,127018,127062,127106,127150,127193,127237,127281,127325,127369,127413,127457,127501,127545,127589,127633,127677,127721,127764,127808,127852,127896,127940,127984,128028,128072,128115,128159,128203,128247,128291,128335,128378,128422,128466,128510,128554,128598,128641,128685,128729,128773,128816,128860,128904,128948,128992,129035,129079,129123,129167,129210,129254,129298,129341,129385,129429,129473,129516,129560,129604,129647,129691,129735,129778,129822,129866,129909,129953,129997,130040,130084,130128,130171,130215,130259,130302,130346,130389,130433,130477,130520,130564,130607,130651,130695,130738,130782,130825,130869,130912,130956,130999,131043,131087,131130,131174,131217,131261,131304,131348,131391,131435,131478,131522,131565,131609,131652,131695,131739,131782,131826,131869,131913,131956,132000,132043,132086,132130,132173,132217,132260,132303,132347,132390,132434,132477,132520,132564,132607,132650,132694,132737,132780,132824,132867,132910,132954,132997,133040,133084,133127,133170,133214,133257,133300,133343,133387,133430,133473,133517,133560,133603,133646,133690,133733,133776,133819,133862,133906,133949,133992,134035,134078,134122,134165,134208,134251,134294,134338,134381,134424,134467,134510,134553,134596,134640,134683,134726,134769,134812,134855,134898,134941,134984,135028,135071,135114,135157,135200,135243,135286,135329,135372,135415,135458,135501,135544,135587,135630,135673,135716,135759,135802,135845,135888,135931,135974,136017,136060,136103,136146,136189,136232,136275,136318,136361,136404,136447,136490,136532,136575,136618,136661,136704,136747,136790,136833,136876,136918,136961,137004,137047,137090,137133,137176,137218,137261,137304,137347,137390,137432,137475,137518,137561,137604,137646,137689,137732,137775,137817,137860,137903,137946,137988,138031,138074,138117,138159,138202,138245,138288,138330,138373,138416,138458,138501,138544,138586,138629,138672,138714,138757,138800,138842,138885,138927,138970,139013,139055,139098,139141,139183,139226,139268,139311,139353,139396,139439,139481,139524,139566,139609,139651,139694,139736,139779,139821,139864,139907,139949,139992,140034,140077,140119,140161,140204,140246,140289,140331,140374,140416,140459,140501,140544,140586,140628,140671,140713,140756,140798,140840,140883,140925,140968,141010,141052,141095,141137,141179,141222,141264,141306,141349,141391,141433,141476,141518,141560,141603,141645,141687,141730,141772,141814,141856,141899,141941,141983,142025,142068,142110,142152,142194,142237,142279,142321,142363,142405,142448,142490,142532,142574,142616,142659,142701,142743,142785,142827,142869,142912,142954,142996,143038,143080,143122,143164,143206,143248,143291,143333,143375,143417,143459,143501,143543,143585,143627,143669,143711,143753,143795,143837,143879,143921,143963,144005,144047,144089,144131,144173,144215,144257,144299,144341,144383,144425,144467,144509,144551,144593,144635,144677,144719,144761,144802,144844,144886,144928,144970,145012,145054,145096,145137,145179,145221,145263,145305,145347,145389,145430,145472,145514,145556,145598,145639,145681,145723,145765,145807,145848,145890,145932,145974,146015,146057,146099,146141,146182,146224,146266,146307,146349,146391,146433,146474,146516,146558,146599,146641,146683,146724,146766,146808,146849,146891,146932,146974,147016,147057,147099,147141,147182,147224,147265,147307,147348,147390,147432,147473,147515,147556,147598,147639,147681,147722,147764,147805,147847,147888,147930,147971,148013,148054,148096,148137,148179,148220,148262,148303,148345,148386,148428,148469,148510,148552,148593,148635,148676,148717,148759,148800,148842,148883,148924,148966,149007,149048,149090,149131,149172,149214,149255,149296,149338,149379,149420,149462,149503,149544,149585,149627,149668,149709,149751,149792,149833,149874,149916,149957,149998,150039,150080,150122,150163,150204,150245,150286,150328,150369,150410,150451,150492,150533,150575,150616,150657,150698,150739,150780,150821,150862,150904,150945,150986,151027,151068,151109,151150,151191,151232,151273,151314,151355,151396,151437,151478,151519,151560,151601,151642,151683,151724,151765,151806,151847,151888,151929,151970,152011,152052,152093,152134,152175,152216,152257,152298,152339,152380,152421,152461,152502,152543,152584,152625,152666,152707,152748,152788,152829,152870,152911,152952,152993,153033,153074,153115,153156,153197,153237,153278,153319,153360,153400,153441,153482,153523,153563,153604,153645,153686,153726,153767,153808,153848,153889,153930,153970,154011,154052,154093,154133,154174,154214,154255,154296,154336,154377,154418,154458,154499,154539,154580,154621,154661,154702,154742,154783,154824,154864,154905,154945,154986,155026,155067,155107,155148,155188,155229,155269,155310,155350,155391,155431,155472,155512,155553,155593,155634,155674,155715,155755,155795,155836,155876,155917,155957,155997,156038,156078,156119,156159,156199,156240,156280,156320,156361,156401,156441,156482,156522,156562,156603,156643,156683,156724,156764,156804,156845,156885,156925,156965,157006,157046,157086,157126,157167,157207,157247,157287,157327,157368,157408,157448,157488,157528,157569,157609,157649,157689,157729,157769,157809,157850,157890,157930,157970,158010,158050,158090,158130,158170,158211,158251,158291,158331,158371,158411,158451,158491,158531,158571,158611,158651,158691,158731,158771,158811,158851,158891,158931,158971,159011,159051,159091,159131,159171,159211,159251,159291,159330,159370,159410,159450,159490,159530,159570,159610,159650,159689,159729,159769,159809,159849,159889,159929,159968,160008,160048,160088,160128,160167,160207,160247,160287,160327,160366,160406,160446,160486,160525,160565,160605,160644,160684,160724,160764,160803,160843,160883,160922,160962,161002,161041,161081,161121,161160,161200,161240,161279,161319,161359,161398,161438,161477,161517,161557,161596,161636,161675,161715,161754,161794,161833,161873,161913,161952,161992,162031,162071,162110,162150,162189,162229,162268,162308,162347,162386,162426,162465,162505,162544,162584,162623,162663,162702,162741,162781,162820,162860,162899,162938,162978,163017,163056,163096,163135,163174,163214,163253,163292,163332,163371,163410,163450,163489,163528,163568,163607,163646,163685,163725,163764,163803,163842,163882,163921,163960,163999,164039,164078,164117,164156,164195,164234,164274,164313,164352,164391,164430,164469,164509,164548,164587,164626,164665,164704,164743,164782,164821,164861,164900,164939,164978,165017,165056,165095,165134,165173,165212,165251,165290,165329,165368,165407,165446,165485,165524,165563,165602,165641,165680,165719,165758,165797,165836,165875,165914,165952,165991,166030,166069,166108,166147,166186,166225,166264,166302,166341,166380,166419,166458,166497,166535,166574,166613,166652,166691,166729,166768,166807,166846,166885,166923,166962,167001,167040,167078,167117,167156,167194,167233,167272,167311,167349,167388,167427,167465,167504,167543,167581,167620,167659,167697,167736,167774,167813,167852,167890,167929,167968,168006,168045,168083,168122,168160,168199,168238,168276,168315,168353,168392,168430,168469,168507,168546,168584,168623,168661,168700,168738,168777,168815,168853,168892,168930,168969,169007,169046,169084,169122,169161,169199,169238,169276,169314,169353,169391,169430,169468,169506,169545,169583,169621,169660,169698,169736,169774,169813,169851,169889,169928,169966,170004,170042,170081,170119,170157,170195,170234,170272,170310,170348,170386,170425,170463,170501,170539,170577,170616,170654,170692,170730,170768,170806,170844,170883,170921,170959,170997,171035,171073,171111,171149,171187,171225,171263,171301,171339,171378,171416,171454,171492,171530,171568,171606,171644,171682,171720,171758,171796,171834,171871,171909,171947,171985,172023,172061,172099,172137,172175,172213,172251,172289,172326,172364,172402,172440,172478,172516,172554,172591,172629,172667,172705,172743,172781,172818,172856,172894,172932,172969,173007,173045,173083,173121,173158,173196,173234,173271,173309,173347,173385,173422,173460,173498,173535,173573,173611,173648,173686,173724,173761,173799,173837,173874,173912,173949,173987,174025,174062,174100,174137,174175,174212,174250,174288,174325,174363,174400,174438,174475,174513,174550,174588,174625,174663,174700,174738,174775,174813,174850,174887,174925,174962,175000,175037,175075,175112,175149,175187,175224,175262,175299,175336,175374,175411,175448,175486,175523,175560,175598,175635,175672,175710,175747,175784,175822,175859,175896,175933,175971,176008,176045,176082,176120,176157,176194,176231,176268,176306,176343,176380,176417,176454,176492,176529,176566,176603,176640,176677,176714,176752,176789,176826,176863,176900,176937,176974,177011,177048,177085,177123,177160,177197,177234,177271,177308,177345,177382,177419,177456,177493,177530,177567,177604,177641,177678,177715,177752,177788,177825,177862,177899,177936,177973,178010,178047,178084,178121,178158,178194,178231,178268,178305,178342,178379,178415,178452,178489,178526,178563,178600,178636,178673,178710,178747,178783,178820,178857,178894,178930,178967,179004,179041,179077,179114,179151,179187,179224,179261,179297,179334,179371,179407,179444,179481,179517,179554,179591,179627,179664,179700,179737,179774,179810,179847,179883,179920,179956,179993,180029,180066,180103,180139,180176,180212,180249,180285,180322,180358,180395,180431,180467,180504,180540,180577,180613,180650,180686,180723,180759,180795,180832,180868,180904,180941,180977,181014,181050,181086,181123,181159,181195,181232,181268,181304,181341,181377,181413,181449,181486,181522,181558,181594,181631,181667,181703,181739,181776,181812,181848,181884,181920,181957,181993,182029,182065,182101,182137,182174,182210,182246,182282,182318,182354,182390,182426,182463,182499,182535,182571,182607,182643,182679,182715,182751,182787,182823,182859,182895,182931,182967,183003,183039,183075,183111,183147,183183,183219,183255,183291,183327,183363,183399,183435,183470,183506,183542,183578,183614,183650,183686,183722,183757,183793,183829,183865,183901,183937,183972,184008,184044,184080,184116,184151,184187,184223,184259,184294,184330,184366,184402,184437,184473,184509,184545,184580,184616,184652,184687,184723,184759,184794,184830,184866,184901,184937,184972,185008,185044,185079,185115,185150,185186,185222,185257,185293,185328,185364,185399,185435,185470,185506,185541,185577,185612,185648,185683,185719,185754,185790,185825,185861,185896,185932,185967,186002,186038,186073,186109,186144,186179,186215,186250,186286,186321,186356,186392,186427,186462,186498,186533,186568,186604,186639,186674,186710,186745,186780,186815,186851,186886,186921,186956,186992,187027,187062,187097,187132,187168,187203,187238,187273,187308,187343,187379,187414,187449,187484,187519,187554,187589,187625,187660,187695,187730,187765,187800,187835,187870,187905,187940,187975,188010,188045,188080,188115,188150,188185,188220,188255,188290,188325,188360,188395,188430,188465,188500,188535,188570,188605,188640,188675,188709,188744,188779,188814,188849,188884,188919,188954,188988,189023,189058,189093,189128,189162,189197,189232,189267,189302,189336,189371,189406,189441,189475,189510,189545,189580,189614,189649,189684,189718,189753,189788,189822,189857,189892,189926,189961,189996,190030,190065,190099,190134,190169,190203,190238,190272,190307,190342,190376,190411,190445,190480,190514,190549,190583,190618,190652,190687,190721,190756,190790,190825,190859,190894,190928,190963,190997,191031,191066,191100,191135,191169,191203,191238,191272,191307,191341,191375,191410,191444,191478,191513,191547,191581,191616,191650,191684,191718,191753,191787,191821,191856,191890,191924,191958,191992,192027,192061,192095,192129,192164,192198,192232,192266,192300,192334,192369,192403,192437,192471,192505,192539,192573,192607,192641,192676,192710,192744,192778,192812,192846,192880,192914,192948,192982,193016,193050,193084,193118,193152,193186,193220,193254,193288,193322,193356,193390,193424,193458,193492,193525,193559,193593,193627,193661,193695,193729,193763,193796,193830,193864,193898,193932,193966,193999,194033,194067,194101,194135,194168,194202,194236,194270,194303,194337,194371,194405,194438,194472,194506,194539,194573,194607,194640,194674,194708,194741,194775,194809,194842,194876,194910,194943,194977,195010,195044,195078,195111,195145,195178,195212,195245,195279,195312,195346,195379,195413,195446,195480,195513,195547,195580,195614,195647,195681,195714,195748,195781,195815,195848,195881,195915,195948,195982,196015,196048,196082,196115,196148,196182,196215,196248,196282,196315,196348,196382,196415,196448,196481,196515,196548,196581,196615,196648,196681,196714,196747,196781,196814,196847,196880,196913,196947,196980,197013,197046,197079,197112,197146,197179,197212,197245,197278,197311,197344,197377,197410,197443,197476,197510,197543,197576,197609,197642,197675,197708,197741,197774,197807,197840,197873,197906,197939,197972,198004,198037,198070,198103,198136,198169,198202,198235,198268,198301,198334,198366,198399,198432,198465,198498,198531,198563,198596,198629,198662,198695,198727,198760,198793,198826,198858,198891,198924,198957,198989,199022,199055,199088,199120,199153,199186,199218,199251,199284,199316,199349,199382,199414,199447,199479,199512,199545,199577,199610,199642,199675,199708,199740,199773,199805,199838,199870,199903,199935,199968,200000,200033,200065,200098,200130,200163,200195,200228,200260,200292,200325,200357,200390,200422,200454,200487,200519,200552,200584,200616,200649,200681,200713,200746,200778,200810,200843,200875,200907,200940,200972,201004,201036,201069,201101,201133,201165,201198,201230,201262,201294,201326,201359,201391,201423,201455,201487,201519,201552,201584,201616,201648,201680,201712,201744,201776,201808,201841,201873,201905,201937,201969,202001,202033,202065,202097,202129,202161,202193,202225,202257,202289,202321,202353,202385,202417,202449,202481,202512,202544,202576,202608,202640,202672,202704,202736,202768,202799,202831,202863,202895,202927,202959,202990,203022,203054,203086,203118,203149,203181,203213,203245,203276,203308,203340,203372,203403,203435,203467,203498,203530,203562,203593,203625,203657,203688,203720,203752,203783,203815,203846,203878,203910,203941,203973,204004,204036,204067,204099,204131,204162,204194,204225,204257,204288,204320,204351,204383,204414,204446,204477,204508,204540,204571,204603,204634,204666,204697,204728,204760,204791,204823,204854,204885,204917,204948,204979,205011,205042,205073,205105,205136,205167,205198,205230,205261,205292,205324,205355,205386,205417,205448,205480,205511,205542,205573,205604,205636,205667,205698,205729,205760,205791,205823,205854,205885,205916,205947,205978,206009,206040,206071,206102,206133,206165,206196,206227,206258,206289,206320,206351,206382,206413,206444,206475,206506,206537,206567,206598,206629,206660,206691,206722,206753,206784,206815,206846,206877,206907,206938,206969,207000,207031,207062,207092,207123,207154,207185,207216,207246,207277,207308,207339,207370,207400,207431,207462,207492,207523,207554,207585,207615,207646,207677,207707,207738,207769,207799,207830,207861,207891,207922,207952,207983,208014,208044,208075,208105,208136,208166,208197,208228,208258,208289,208319,208350,208380,208411,208441,208472,208502,208533,208563,208593,208624,208654,208685,208715,208746,208776,208806,208837,208867,208897,208928,208958,208989,209019,209049,209080,209110,209140,209170,209201,209231,209261,209292,209322,209352,209382,209413,209443,209473,209503,209534,209564,209594,209624,209654,209684,209715,209745,209775,209805,209835,209865,209895,209926,209956,209986,210016,210046,210076,210106,210136,210166,210196,210226,210256,210286,210316,210346,210376,210406,210436,210466,210496,210526,210556,210586,210616,210646,210676,210706,210736,210765,210795,210825,210855,210885,210915,210945,210974,211004,211034,211064,211094,211124,211153,211183,211213,211243,211272,211302,211332,211362,211391,211421,211451,211481,211510,211540,211570,211599,211629,211659,211688,211718,211748,211777,211807,211836,211866,211896,211925,211955,211984,212014,212043,212073,212103,212132,212162,212191,212221,212250,212280,212309,212339,212368,212398,212427,212456,212486,212515,212545,212574,212604,212633,212662,212692,212721,212751,212780,212809,212839,212868,212897,212927,212956,212985,213015,213044,213073,213102,213132,213161,213190,213219,213249,213278,213307,213336,213366,213395,213424,213453,213482,213511,213541,213570,213599,213628,213657,213686,213715,213745,213774,213803,213832,213861,213890,213919,213948,213977,214006,214035,214064,214093,214122,214151,214180,214209,214238,214267,214296,214325,214354,214383,214412,214441,214470,214498,214527,214556,214585,214614,214643,214672,214701,214729,214758,214787,214816,214845,214873,214902,214931,214960,214989,215017,215046,215075,215104,215132,215161,215190,215218,215247,215276,215304,215333,215362,215390,215419,215448,215476,215505,215534,215562,215591,215619,215648,215677,215705,215734,215762,215791,215819,215848,215876,215905,215933,215962,215990,216019,216047,216076,216104,216133,216161,216190,216218,216246,216275,216303,216332,216360,216388,216417,216445,216473,216502,216530,216558,216587,216615,216643,216672,216700,216728,216757,216785,216813,216841,216870,216898,216926,216954,216982,217011,217039,217067,217095,217123,217152,217180,217208,217236,217264,217292,217320,217348,217377,217405,217433,217461,217489,217517,217545,217573,217601,217629,217657,217685,217713,217741,217769,217797,217825,217853,217881,217909,217937,217965,217993,218021,218049,218076,218104,218132,218160,218188,218216,218244,218271,218299,218327,218355,218383,218411,218438,218466,218494,218522,218549,218577,218605,218633,218660,218688,218716,218744,218771,218799,218827,218854,218882,218910,218937,218965,218993,219020,219048,219075,219103,219131,219158,219186,219213,219241,219268,219296,219324,219351,219379,219406,219434,219461,219489,219516,219544,219571,219598,219626,219653,219681,219708,219736,219763,219790,219818,219845,219873,219900,219927,219955,219982,220009,220037,220064,220091,220119,220146,220173,220200,220228,220255,220282,220309,220337,220364,220391,220418,220446,220473,220500,220527,220554,220581,220609,220636,220663,220690,220717,220744,220771,220798,220826,220853,220880,220907,220934,220961,220988,221015,221042,221069,221096,221123,221150,221177,221204,221231,221258,221285,221312,221339,221366,221393,221419,221446,221473,221500,221527,221554,221581,221608,221634,221661,221688,221715,221742,221769,221795,221822,221849,221876,221903,221929,221956,221983,222010,222036,222063,222090,222116,222143,222170,222196,222223,222250,222276,222303,222330,222356,222383,222410,222436,222463,222489,222516,222542,222569,222596,222622,222649,222675,222702,222728,222755,222781,222808,222834,222861,222887,222914,222940,222966,222993,223019,223046,223072,223099,223125,223151,223178,223204,223230,223257,223283,223309,223336,223362,223388,223415,223441,223467,223493,223520,223546,223572,223599,223625,223651,223677,223703,223730,223756,223782,223808,223834,223860,223887,223913,223939,223965,223991,224017,224043,224069,224096,224122,224148,224174,224200,224226,224252,224278,224304,224330,224356,224382,224408,224434,224460,224486,224512,224538,224564,224590,224615,224641,224667,224693,224719,224745,224771,224797,224823,224848,224874,224900,224926,224952,224978,225003,225029,225055,225081,225106,225132,225158,225184,225209,225235,225261,225287,225312,225338,225364,225389,225415,225441,225466,225492,225517,225543,225569,225594,225620,225646,225671,225697,225722,225748,225773,225799,225824,225850,225875,225901,225926,225952,225977,226003,226028,226054,226079,226105,226130,226156,226181,226206,226232,226257,226283,226308,226333,226359,226384,226409,226435,226460,226485,226511,226536,226561,226586,226612,226637,226662,226688,226713,226738,226763,226788,226814,226839,226864,226889,226914,226940,226965,226990,227015,227040,227065,227090,227115,227141,227166,227191,227216,227241,227266,227291,227316,227341,227366,227391,227416,227441,227466,227491,227516,227541,227566,227591,227616,227641,227666,227691,227716,227740,227765,227790,227815,227840,227865,227890,227914,227939,227964,227989,228014,228039,228063,228088,228113,228138,228162,228187,228212,228237,228261,228286,228311,228335,228360,228385,228409,228434,228459,228483,228508,228533,228557,228582,228607,228631,228656,228680,228705,228729,228754,228779,228803,228828,228852,228877,228901,228926,228950,228975,228999,229024,229048,229072,229097,229121,229146,229170,229194,229219,229243,229268,229292,229316,229341,229365,229389,229414,229438,229462,229487,229511,229535,229560,229584,229608,229632,229657,229681,229705,229729,229753,229778,229802,229826,229850,229874,229898,229923,229947,229971,229995,230019,230043,230067,230091,230116,230140,230164,230188,230212,230236,230260,230284,230308,230332,230356,230380,230404,230428,230452,230476,230500,230524,230548,230571,230595,230619,230643,230667,230691,230715,230739,230762,230786,230810,230834,230858,230882,230905,230929,230953,230977,231001,231024,231048,231072,231096,231119,231143,231167,231190,231214,231238,231261,231285,231309,231332,231356,231380,231403,231427,231450,231474,231498,231521,231545,231568,231592,231615,231639,231663,231686,231710,231733,231757,231780,231804,231827,231850,231874,231897,231921,231944,231968,231991,232014,232038,232061,232085,232108,232131,232155,232178,232201,232225,232248,232271,232295,232318,232341,232364,232388,232411,232434,232457,232481,232504,232527,232550,232574,232597,232620,232643,232666,232689,232713,232736,232759,232782,232805,232828,232851,232874,232897,232920,232944,232967,232990,233013,233036,233059,233082,233105,233128,233151,233174,233197,233220,233243,233265,233288,233311,233334,233357,233380,233403,233426,233449,233472,233494,233517,233540,233563,233586,233609,233631,233654,233677,233700,233722,233745,233768,233791,233813,233836,233859,233882,233904,233927,233950,233972,233995,234018,234040,234063,234086,234108,234131,234153,234176,234199,234221,234244,234266,234289,234311,234334,234356,234379,234401,234424,234446,234469,234491,234514,234536,234559,234581,234604,234626,234649,234671,234693,234716,234738,234760,234783,234805,234828,234850,234872,234894,234917,234939,234961,234984,235006,235028,235050,235073,235095,235117,235139,235162,235184,235206,235228,235250,235273,235295,235317,235339,235361,235383,235405,235428,235450,235472,235494,235516,235538,235560,235582,235604,235626,235648,235670,235692,235714,235736,235758,235780,235802,235824,235846,235868,235890,235912,235934,235956,235978,235999,236021,236043,236065,236087,236109,236131,236152,236174,236196,236218,236240,236261,236283,236305,236327,236348,236370,236392,236414,236435,236457,236479,236500,236522,236544,236565,236587,236609,236630,236652,236674,236695,236717,236738,236760,236782,236803,236825,236846,236868,236889,236911,236932,236954,236975,236997,237018,237040,237061,237083,237104,237126,237147,237168,237190,237211,237233,237254,237275,237297,237318,237339,237361,237382,237403,237425,237446,237467,237489,237510,237531,237552,237574,237595,237616,237637,237659,237680,237701,237722,237743,237765,237786,237807,237828,237849,237870,237891,237913,237934,237955,237976,237997,238018,238039,238060,238081,238102,238123,238144,238165,238186,238207,238228,238249,238270,238291,238312,238333,238354,238375,238396,238417,238437,238458,238479,238500,238521,238542,238563,238583,238604,238625,238646,238667,238688,238708,238729,238750,238771,238791,238812,238833,238853,238874,238895,238916,238936,238957,238978,238998,239019,239040,239060,239081,239101,239122,239143,239163,239184,239204,239225,239245,239266,239287,239307,239328,239348,239369,239389,239410,239430,239450,239471,239491,239512,239532,239553,239573,239593,239614,239634,239655,239675,239695,239716,239736,239756,239777,239797,239817,239838,239858,239878,239898,239919,239939,239959,239979,240000,240020,240040,240060,240080,240101,240121,240141,240161,240181,240201,240221,240242,240262,240282,240302,240322,240342,240362,240382,240402,240422,240442,240462,240482,240502,240522,240542,240562,240582,240602,240622,240642,240662,240682,240702,240722,240742,240762,240781,240801,240821,240841,240861,240881,240901,240920,240940,240960,240980,241000,241019,241039,241059,241079,241098,241118,241138,241157,241177,241197,241217,241236,241256,241276,241295,241315,241334,241354,241374,241393,241413,241433,241452,241472,241491,241511,241530,241550,241569,241589,241608,241628,241647,241667,241686,241706,241725,241745,241764,241784,241803,241822,241842,241861,241881,241900,241919,241939,241958,241977,241997,242016,242035,242055,242074,242093,242112,242132,242151,242170,242189,242209,242228,242247,242266,242286,242305,242324,242343,242362,242381,242401,242420,242439,242458,242477,242496,242515,242534,242553,242572,242591,242611,242630,242649,242668,242687,242706,242725,242744,242763,242782,242800,242819,242838,242857,242876,242895,242914,242933,242952,242971,242990,243008,243027,243046,243065,243084,243103,243121,243140,243159,243178,243196,243215,243234,243253,243271,243290,243309,243328,243346,243365,243384,243402,243421,243440,243458,243477,243496,243514,243533,243551,243570,243588,243607,243626,243644,243663,243681,243700,243718,243737,243755,243774,243792,243811,243829,243848,243866,243885,243903,243921,243940,243958,243977,243995,244013,244032,244050,244068,244087,244105,244123,244142,244160,244178,244197,244215,244233,244251,244270,244288,244306,244324,244343,244361,244379,244397,244415,244433,244452,244470,244488,244506,244524,244542,244560,244578,244597,244615,244633,244651,244669,244687,244705,244723,244741,244759,244777,244795,244813,244831,244849,244867,244885,244903,244921,244938,244956,244974,244992,245010,245028,245046,245064,245081,245099,245117,245135,245153,245171,245188,245206,245224,245242,245259,245277,245295,245313,245330,245348,245366,245383,245401,245419,245436,245454,245472,245489,245507,245525,245542,245560,245577,245595,245613,245630,245648,245665,245683,245700,245718,245735,245753,245770,245788,245805,245823,245840,245858,245875,245892,245910,245927,245945,245962,245979,245997,246014,246032,246049,246066,246084,246101,246118,246136,246153,246170,246187,246205,246222,246239,246256,246274,246291,246308,246325,246342,246360,246377,246394,246411,246428,246445,246463,246480,246497,246514,246531,246548,246565,246582,246599,246616,246633,246650,246667,246684,246701,246718,246735,246752,246769,246786,246803,246820,246837,246854,246871,246888,246905,246922,246938,246955,246972,246989,247006,247023,247040,247056,247073,247090,247107,247123,247140,247157,247174,247190,247207,247224,247241,247257,247274,247291,247307,247324,247341,247357,247374,247391,247407,247424,247440,247457,247474,247490,247507,247523,247540,247556,247573,247589,247606,247622,247639,247655,247672,247688,247705,247721,247738,247754,247771,247787,247803,247820,247836,247853,247869,247885,247902,247918,247934,247951,247967,247983,248000,248016,248032,248048,248065,248081,248097,248113,248130,248146,248162,248178,248194,248211,248227,248243,248259,248275,248291,248307,248323,248340,248356,248372,248388,248404,248420,248436,248452,248468,248484,248500,248516,248532,248548,248564,248580,248596,248612,248628,248644,248660,248676,248691,248707,248723,248739,248755,248771,248787,248803,248818,248834,248850,248866,248882,248897,248913,248929,248945,248960,248976,248992,249008,249023,249039,249055,249070,249086,249102,249117,249133,249149,249164,249180,249195,249211,249227,249242,249258,249273,249289,249304,249320,249335,249351,249367,249382,249398,249413,249428,249444,249459,249475,249490,249506,249521,249536,249552,249567,249583,249598,249613,249629,249644,249659,249675,249690,249705,249721,249736,249751,249766,249782,249797,249812,249827,249843,249858,249873,249888,249903,249919,249934,249949,249964,249979,249994,250009,250025,250040,250055,250070,250085,250100,250115,250130,250145,250160,250175,250190,250205,250220,250235,250250,250265,250280,250295,250310,250325,250340,250355,250370,250385,250399,250414,250429,250444,250459,250474,250489,250503,250518,250533,250548,250562,250577,250592,250607,250622,250636,250651,250666,250680,250695,250710,250724,250739,250754,250768,250783,250798,250812,250827,250842,250856,250871,250885,250900,250914,250929,250944,250958,250973,250987,251002,251016,251031,251045,251060,251074,251088,251103,251117,251132,251146,251161,251175,251189,251204,251218,251232,251247,251261,251275,251290,251304,251318,251333,251347,251361,251375,251390,251404,251418,251432,251447,251461,251475,251489,251503,251518,251532,251546,251560,251574,251588,251602,251617,251631,251645,251659,251673,251687,251701,251715,251729,251743,251757,251771,251785,251799,251813,251827,251841,251855,251869,251883,251897,251911,251925,251938,251952,251966,251980,251994,252008,252022,252035,252049,252063,252077,252091,252104,252118,252132,252146,252159,252173,252187,252201,252214,252228,252242,252255,252269,252283,252296,252310,252324,252337,252351,252365,252378,252392,252405,252419,252432,252446,252460,252473,252487,252500,252514,252527,252541,252554,252568,252581,252594,252608,252621,252635,252648,252662,252675,252688,252702,252715,252728,252742,252755,252768,252782,252795,252808,252822,252835,252848,252861,252875,252888,252901,252914,252928,252941,252954,252967,252980,252994,253007,253020,253033,253046,253059,253072,253085,253099,253112,253125,253138,253151,253164,253177,253190,253203,253216,253229,253242,253255,253268,253281,253294,253307,253320,253333,253346,253359,253371,253384,253397,253410,253423,253436,253449,253461,253474,253487,253500,253513,253525,253538,253551,253564,253577,253589,253602,253615,253627,253640,253653,253666,253678,253691,253704,253716,253729,253741,253754,253767,253779,253792,253804,253817,253830,253842,253855,253867,253880,253892,253905,253917,253930,253942,253955,253967,253980,253992,254004,254017,254029,254042,254054,254067,254079,254091,254104,254116,254128,254141,254153,254165,254178,254190,254202,254214,254227,254239,254251,254263,254276,254288,254300,254312,254324,254337,254349,254361,254373,254385,254397,254410,254422,254434,254446,254458,254470,254482,254494,254506,254518,254530,254542,254554,254566,254578,254590,254602,254614,254626,254638,254650,254662,254674,254686,254698,254710,254721,254733,254745,254757,254769,254781,254793,254804,254816,254828,254840,254852,254863,254875,254887,254899,254910,254922,254934,254945,254957,254969,254981,254992,255004,255015,255027,255039,255050,255062,255074,255085,255097,255108,255120,255131,255143,255155,255166,255178,255189,255201,255212,255224,255235,255246,255258,255269,255281,255292,255304,255315,255326,255338,255349,255361,255372,255383,255395,255406,255417,255429,255440,255451,255462,255474,255485,255496,255507,255519,255530,255541,255552,255564,255575,255586,255597,255608,255619,255630,255642,255653,255664,255675,255686,255697,255708,255719,255730,255741,255752,255763,255774,255785,255796,255807,255818,255829,255840,255851,255862,255873,255884,255895,255906,255917,255928,255939,255949,255960,255971,255982,255993,256004,256014,256025,256036,256047,256058,256068,256079,256090,256101,256111,256122,256133,256143,256154,256165,256176,256186,256197,256207,256218,256229,256239,256250,256261,256271,256282,256292,256303,256313,256324,256334,256345,256355,256366,256376,256387,256397,256408,256418,256429,256439,256450,256460,256470,256481,256491,256502,256512,256522,256533,256543,256553,256564,256574,256584,256595,256605,256615,256625,256636,256646,256656,256666,256677,256687,256697,256707,256717,256728,256738,256748,256758,256768,256778,256788,256798,256809,256819,256829,256839,256849,256859,256869,256879,256889,256899,256909,256919,256929,256939,256949,256959,256969,256979,256989,256999,257008,257018,257028,257038,257048,257058,257068,257078,257087,257097,257107,257117,257127,257136,257146,257156,257166,257175,257185,257195,257205,257214,257224,257234,257243,257253,257263,257272,257282,257292,257301,257311,257320,257330,257340,257349,257359,257368,257378,257387,257397,257406,257416,257425,257435,257444,257454,257463,257473,257482,257492,257501,257510,257520,257529,257539,257548,257557,257567,257576,257585,257595,257604,257613,257623,257632,257641,257651,257660,257669,257678,257688,257697,257706,257715,257724,257734,257743,257752,257761,257770,257779,257789,257798,257807,257816,257825,257834,257843,257852,257861,257870,257879,257888,257897,257906,257915,257924,257933,257942,257951,257960,257969,257978,257987,257996,258005,258014,258023,258031,258040,258049,258058,258067,258076,258084,258093,258102,258111,258120,258128,258137,258146,258155,258163,258172,258181,258190,258198,258207,258216,258224,258233,258242,258250,258259,258267,258276,258285,258293,258302,258310,258319,258327,258336,258345,258353,258362,258370,258379,258387,258396,258404,258412,258421,258429,258438,258446,258455,258463,258471,258480,258488,258496,258505,258513,258522,258530,258538,258546,258555,258563,258571,258580,258588,258596,258604,258613,258621,258629,258637,258645,258654,258662,258670,258678,258686,258694,258702,258711,258719,258727,258735,258743,258751,258759,258767,258775,258783,258791,258799,258807,258815,258823,258831,258839,258847,258855,258863,258871,258879,258887,258895,258902,258910,258918,258926,258934,258942,258950,258957,258965,258973,258981,258989,258996,259004,259012,259020,259027,259035,259043,259050,259058,259066,259073,259081,259089,259096,259104,259112,259119,259127,259135,259142,259150,259157,259165,259172,259180,259187,259195,259202,259210,259217,259225,259232,259240,259247,259255,259262,259270,259277,259285,259292,259299,259307,259314,259321,259329,259336,259343,259351,259358,259365,259373,259380,259387,259395,259402,259409,259416,259423,259431,259438,259445,259452,259459,259467,259474,259481,259488,259495,259502,259509,259517,259524,259531,259538,259545,259552,259559,259566,259573,259580,259587,259594,259601,259608,259615,259622,259629,259636,259643,259650,259657,259664,259670,259677,259684,259691,259698,259705,259712,259718,259725,259732,259739,259746,259752,259759,259766,259773,259779,259786,259793,259800,259806,259813,259820,259826,259833,259840,259846,259853,259860,259866,259873,259879,259886,259893,259899,259906,259912,259919,259925,259932,259938,259945,259951,259958,259964,259971,259977,259984,259990,259997,260003,260009,260016,260022,260029,260035,260041,260048,260054,260060,260067,260073,260079,260085,260092,260098,260104,260111,260117,260123,260129,260135,260142,260148,260154,260160,260166,260173,260179,260185,260191,260197,260203,260209,260215,260221,260228,260234,260240,260246,260252,260258,260264,260270,260276,260282,260288,260294,260300,260306,260312,260317,260323,260329,260335,260341,260347,260353,260359,260365,260370,260376,260382,260388,260394,260399,260405,260411,260417,260423,260428,260434,260440,260445,260451,260457,260463,260468,260474,260480,260485,260491,260496,260502,260508,260513,260519,260525,260530,260536,260541,260547,260552,260558,260563,260569,260574,260580,260585,260591,260596,260602,260607,260613,260618,260623,260629,260634,260640,260645,260650,260656,260661,260666,260672,260677,260682,260688,260693,260698,260703,260709,260714,260719,260724,260730,260735,260740,260745,260750,260756,260761,260766,260771,260776,260781,260786,260791,260797,260802,260807,260812,260817,260822,260827,260832,260837,260842,260847,260852,260857,260862,260867,260872,260877,260882,260887,260892,260896,260901,260906,260911,260916,260921,260926,260930,260935,260940,260945,260950,260955,260959,260964,260969,260974,260978,260983,260988,260992,260997,261002,261007,261011,261016,261021,261025,261030,261034,261039,261044,261048,261053,261057,261062,261067,261071,261076,261080,261085,261089,261094,261098,261103,261107,261112,261116,261120,261125,261129,261134,261138,261143,261147,261151,261156,261160,261164,261169,261173,261177,261182,261186,261190,261195,261199,261203,261207,261212,261216,261220,261224,261228,261233,261237,261241,261245,261249,261253,261258,261262,261266,261270,261274,261278,261282,261286,261290,261294,261298,261302,261306,261310,261314,261318,261322,261326,261330,261334,261338,261342,261346,261350,261354,261358,261362,261366,261369,261373,261377,261381,261385,261389,261392,261396,261400,261404,261408,261411,261415,261419,261423,261426,261430,261434,261437,261441,261445,261448,261452,261456,261459,261463,261467,261470,261474,261477,261481,261485,261488,261492,261495,261499,261502,261506,261509,261513,261516,261520,261523,261527,261530,261533,261537,261540,261544,261547,261551,261554,261557,261561,261564,261567,261571,261574,261577,261581,261584,261587,261590,261594,261597,261600,261603,261607,261610,261613,261616,261619,261623,261626,261629,261632,261635,261638,261641,261644,261648,261651,261654,261657,261660,261663,261666,261669,261672,261675,261678,261681,261684,261687,261690,261693,261696,261699,261702,261705,261708,261710,261713,261716,261719,261722,261725,261728,261730,261733,261736,261739,261742,261744,261747,261750,261753,261755,261758,261761,261764,261766,261769,261772,261774,261777,261780,261782,261785,261788,261790,261793,261795,261798,261801,261803,261806,261808,261811,261813,261816,261818,261821,261823,261826,261828,261831,261833,261836,261838,261840,261843,261845,261848,261850,261852,261855,261857,261859,261862,261864,261866,261869,261871,261873,261876,261878,261880,261882,261885,261887,261889,261891,261894,261896,261898,261900,261902,261904,261907,261909,261911,261913,261915,261917,261919,261921,261923,261925,261927,261929,261932,261934,261936,261938,261940,261942,261943,261945,261947,261949,261951,261953,261955,261957,261959,261961,261963,261965,261966,261968,261970,261972,261974,261975,261977,261979,261981,261983,261984,261986,261988,261990,261991,261993,261995,261996,261998,262000,262001,262003,262005,262006,262008,262010,262011,262013,262014,262016,262018,262019,262021,262022,262024,262025,262027,262028,262030,262031,262033,262034,262036,262037,262038,262040,262041,262043,262044,262045,262047,262048,262050,262051,262052,262054,262055,262056,262057,262059,262060,262061,262063,262064,262065,262066,262067,262069,262070,262071,262072,262073,262075,262076,262077,262078,262079,262080,262081,262082,262084,262085,262086,262087,262088,262089,262090,262091,262092,262093,262094,262095,262096,262097,262098,262099,262100,262101,262101,262102,262103,262104,262105,262106,262107,262108,262108,262109,262110,262111,262112,262112,262113,262114,262115,262115,262116,262117,262118,262118,262119,262120,262120,262121,262122,262122,262123,262124,262124,262125,262125,262126,262127,262127,262128,262128,262129,262129,262130,262130,262131,262131,262132,262132,262133,262133,262134,262134,262135,262135,262135,262136,262136,262137,262137,262137,262138,262138,262138,262139,262139,262139,262140,262140,262140,262140,262141,262141,262141,262141,262142,262142,262142,262142,262142,262143,262143,262143,262143,262143,262143,262143,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,0}; | 6 | static t_sample cos_table[] = {262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262143,262143,262143,262143,262143,262143,262143,262142,262142,262142,262142,262142,262141,262141,262141,262141,262140,262140,262140,262140,262139,262139,262139,262138,262138,262138,262137,262137,262137,262136,262136,262135,262135,262135,262134,262134,262133,262133,262132,262132,262131,262131,262130,262130,262129,262129,262128,262128,262127,262127,262126,262125,262125,262124,262124,262123,262122,262122,262121,262120,262120,262119,262118,262118,262117,262116,262115,262115,262114,262113,262112,262112,262111,262110,262109,262108,262108,262107,262106,262105,262104,262103,262102,262101,262101,262100,262099,262098,262097,262096,262095,262094,262093,262092,262091,262090,262089,262088,262087,262086,262085,262084,262082,262081,262080,262079,262078,262077,262076,262075,262073,262072,262071,262070,262069,262067,262066,262065,262064,262063,262061,262060,262059,262057,262056,262055,262054,262052,262051,262050,262048,262047,262045,262044,262043,262041,262040,262038,262037,262036,262034,262033,262031,262030,262028,262027,262025,262024,262022,262021,262019,262018,262016,262014,262013,262011,262010,262008,262006,262005,262003,262001,262000,261998,261996,261995,261993,261991,261990,261988,261986,261984,261983,261981,261979,261977,261975,261974,261972,261970,261968,261966,261965,261963,261961,261959,261957,261955,261953,261951,261949,261947,261945,261943,261942,261940,261938,261936,261934,261932,261929,261927,261925,261923,261921,261919,261917,261915,261913,261911,261909,261907,261904,261902,261900,261898,261896,261894,261891,261889,261887,261885,261882,261880,261878,261876,261873,261871,261869,261866,261864,261862,261859,261857,261855,261852,261850,261848,261845,261843,261840,261838,261836,261833,261831,261828,261826,261823,261821,261818,261816,261813,261811,261808,261806,261803,261801,261798,261795,261793,261790,261788,261785,261782,261780,261777,261774,261772,261769,261766,261764,261761,261758,261755,261753,261750,261747,261744,261742,261739,261736,261733,261730,261728,261725,261722,261719,261716,261713,261710,261708,261705,261702,261699,261696,261693,261690,261687,261684,261681,261678,261675,261672,261669,261666,261663,261660,261657,261654,261651,261648,261644,261641,261638,261635,261632,261629,261626,261623,261619,261616,261613,261610,261607,261603,261600,261597,261594,261590,261587,261584,261581,261577,261574,261571,261567,261564,261561,261557,261554,261551,261547,261544,261540,261537,261533,261530,261527,261523,261520,261516,261513,261509,261506,261502,261499,261495,261492,261488,261485,261481,261477,261474,261470,261467,261463,261459,261456,261452,261448,261445,261441,261437,261434,261430,261426,261423,261419,261415,261411,261408,261404,261400,261396,261392,261389,261385,261381,261377,261373,261369,261366,261362,261358,261354,261350,261346,261342,261338,261334,261330,261326,261322,261318,261314,261310,261306,261302,261298,261294,261290,261286,261282,261278,261274,261270,261266,261262,261258,261253,261249,261245,261241,261237,261233,261228,261224,261220,261216,261212,261207,261203,261199,261195,261190,261186,261182,261177,261173,261169,261164,261160,261156,261151,261147,261143,261138,261134,261129,261125,261120,261116,261112,261107,261103,261098,261094,261089,261085,261080,261076,261071,261067,261062,261057,261053,261048,261044,261039,261034,261030,261025,261021,261016,261011,261007,261002,260997,260992,260988,260983,260978,260974,260969,260964,260959,260955,260950,260945,260940,260935,260930,260926,260921,260916,260911,260906,260901,260896,260892,260887,260882,260877,260872,260867,260862,260857,260852,260847,260842,260837,260832,260827,260822,260817,260812,260807,260802,260797,260791,260786,260781,260776,260771,260766,260761,260756,260750,260745,260740,260735,260730,260724,260719,260714,260709,260703,260698,260693,260688,260682,260677,260672,260666,260661,260656,260650,260645,260640,260634,260629,260623,260618,260613,260607,260602,260596,260591,260585,260580,260574,260569,260563,260558,260552,260547,260541,260536,260530,260525,260519,260513,260508,260502,260496,260491,260485,260480,260474,260468,260463,260457,260451,260445,260440,260434,260428,260423,260417,260411,260405,260399,260394,260388,260382,260376,260370,260365,260359,260353,260347,260341,260335,260329,260323,260317,260312,260306,260300,260294,260288,260282,260276,260270,260264,260258,260252,260246,260240,260234,260228,260221,260215,260209,260203,260197,260191,260185,260179,260173,260166,260160,260154,260148,260142,260135,260129,260123,260117,260111,260104,260098,260092,260085,260079,260073,260067,260060,260054,260048,260041,260035,260029,260022,260016,260009,260003,259997,259990,259984,259977,259971,259964,259958,259951,259945,259938,259932,259925,259919,259912,259906,259899,259893,259886,259879,259873,259866,259860,259853,259846,259840,259833,259826,259820,259813,259806,259800,259793,259786,259779,259773,259766,259759,259752,259746,259739,259732,259725,259718,259712,259705,259698,259691,259684,259677,259670,259664,259657,259650,259643,259636,259629,259622,259615,259608,259601,259594,259587,259580,259573,259566,259559,259552,259545,259538,259531,259524,259517,259509,259502,259495,259488,259481,259474,259467,259459,259452,259445,259438,259431,259423,259416,259409,259402,259395,259387,259380,259373,259365,259358,259351,259343,259336,259329,259321,259314,259307,259299,259292,259285,259277,259270,259262,259255,259247,259240,259232,259225,259217,259210,259202,259195,259187,259180,259172,259165,259157,259150,259142,259135,259127,259119,259112,259104,259096,259089,259081,259073,259066,259058,259050,259043,259035,259027,259020,259012,259004,258996,258989,258981,258973,258965,258957,258950,258942,258934,258926,258918,258910,258902,258895,258887,258879,258871,258863,258855,258847,258839,258831,258823,258815,258807,258799,258791,258783,258775,258767,258759,258751,258743,258735,258727,258719,258711,258702,258694,258686,258678,258670,258662,258654,258645,258637,258629,258621,258613,258604,258596,258588,258580,258571,258563,258555,258546,258538,258530,258522,258513,258505,258496,258488,258480,258471,258463,258455,258446,258438,258429,258421,258412,258404,258396,258387,258379,258370,258362,258353,258345,258336,258327,258319,258310,258302,258293,258285,258276,258267,258259,258250,258242,258233,258224,258216,258207,258198,258190,258181,258172,258163,258155,258146,258137,258128,258120,258111,258102,258093,258084,258076,258067,258058,258049,258040,258031,258023,258014,258005,257996,257987,257978,257969,257960,257951,257942,257933,257924,257915,257906,257897,257888,257879,257870,257861,257852,257843,257834,257825,257816,257807,257798,257789,257779,257770,257761,257752,257743,257734,257724,257715,257706,257697,257688,257678,257669,257660,257651,257641,257632,257623,257613,257604,257595,257585,257576,257567,257557,257548,257539,257529,257520,257510,257501,257492,257482,257473,257463,257454,257444,257435,257425,257416,257406,257397,257387,257378,257368,257359,257349,257340,257330,257320,257311,257301,257292,257282,257272,257263,257253,257243,257234,257224,257214,257205,257195,257185,257175,257166,257156,257146,257136,257127,257117,257107,257097,257087,257078,257068,257058,257048,257038,257028,257018,257008,256999,256989,256979,256969,256959,256949,256939,256929,256919,256909,256899,256889,256879,256869,256859,256849,256839,256829,256819,256809,256798,256788,256778,256768,256758,256748,256738,256728,256717,256707,256697,256687,256677,256666,256656,256646,256636,256625,256615,256605,256595,256584,256574,256564,256553,256543,256533,256522,256512,256502,256491,256481,256470,256460,256450,256439,256429,256418,256408,256397,256387,256376,256366,256355,256345,256334,256324,256313,256303,256292,256282,256271,256261,256250,256239,256229,256218,256207,256197,256186,256176,256165,256154,256143,256133,256122,256111,256101,256090,256079,256068,256058,256047,256036,256025,256014,256004,255993,255982,255971,255960,255949,255939,255928,255917,255906,255895,255884,255873,255862,255851,255840,255829,255818,255807,255796,255785,255774,255763,255752,255741,255730,255719,255708,255697,255686,255675,255664,255653,255642,255630,255619,255608,255597,255586,255575,255564,255552,255541,255530,255519,255507,255496,255485,255474,255462,255451,255440,255429,255417,255406,255395,255383,255372,255361,255349,255338,255326,255315,255304,255292,255281,255269,255258,255246,255235,255224,255212,255201,255189,255178,255166,255155,255143,255131,255120,255108,255097,255085,255074,255062,255050,255039,255027,255015,255004,254992,254981,254969,254957,254945,254934,254922,254910,254899,254887,254875,254863,254852,254840,254828,254816,254804,254793,254781,254769,254757,254745,254733,254721,254710,254698,254686,254674,254662,254650,254638,254626,254614,254602,254590,254578,254566,254554,254542,254530,254518,254506,254494,254482,254470,254458,254446,254434,254422,254410,254397,254385,254373,254361,254349,254337,254324,254312,254300,254288,254276,254263,254251,254239,254227,254214,254202,254190,254178,254165,254153,254141,254128,254116,254104,254091,254079,254067,254054,254042,254029,254017,254004,253992,253980,253967,253955,253942,253930,253917,253905,253892,253880,253867,253855,253842,253830,253817,253804,253792,253779,253767,253754,253741,253729,253716,253704,253691,253678,253666,253653,253640,253627,253615,253602,253589,253577,253564,253551,253538,253525,253513,253500,253487,253474,253461,253449,253436,253423,253410,253397,253384,253371,253359,253346,253333,253320,253307,253294,253281,253268,253255,253242,253229,253216,253203,253190,253177,253164,253151,253138,253125,253112,253099,253085,253072,253059,253046,253033,253020,253007,252994,252980,252967,252954,252941,252928,252914,252901,252888,252875,252861,252848,252835,252822,252808,252795,252782,252768,252755,252742,252728,252715,252702,252688,252675,252662,252648,252635,252621,252608,252594,252581,252568,252554,252541,252527,252514,252500,252487,252473,252460,252446,252432,252419,252405,252392,252378,252365,252351,252337,252324,252310,252296,252283,252269,252255,252242,252228,252214,252201,252187,252173,252159,252146,252132,252118,252104,252091,252077,252063,252049,252035,252022,252008,251994,251980,251966,251952,251938,251925,251911,251897,251883,251869,251855,251841,251827,251813,251799,251785,251771,251757,251743,251729,251715,251701,251687,251673,251659,251645,251631,251617,251602,251588,251574,251560,251546,251532,251518,251503,251489,251475,251461,251447,251432,251418,251404,251390,251375,251361,251347,251333,251318,251304,251290,251275,251261,251247,251232,251218,251204,251189,251175,251161,251146,251132,251117,251103,251088,251074,251060,251045,251031,251016,251002,250987,250973,250958,250944,250929,250914,250900,250885,250871,250856,250842,250827,250812,250798,250783,250768,250754,250739,250724,250710,250695,250680,250666,250651,250636,250622,250607,250592,250577,250562,250548,250533,250518,250503,250489,250474,250459,250444,250429,250414,250399,250385,250370,250355,250340,250325,250310,250295,250280,250265,250250,250235,250220,250205,250190,250175,250160,250145,250130,250115,250100,250085,250070,250055,250040,250025,250009,249994,249979,249964,249949,249934,249919,249903,249888,249873,249858,249843,249827,249812,249797,249782,249766,249751,249736,249721,249705,249690,249675,249659,249644,249629,249613,249598,249583,249567,249552,249536,249521,249506,249490,249475,249459,249444,249428,249413,249398,249382,249367,249351,249335,249320,249304,249289,249273,249258,249242,249227,249211,249195,249180,249164,249149,249133,249117,249102,249086,249070,249055,249039,249023,249008,248992,248976,248960,248945,248929,248913,248897,248882,248866,248850,248834,248818,248803,248787,248771,248755,248739,248723,248707,248691,248676,248660,248644,248628,248612,248596,248580,248564,248548,248532,248516,248500,248484,248468,248452,248436,248420,248404,248388,248372,248356,248340,248323,248307,248291,248275,248259,248243,248227,248211,248194,248178,248162,248146,248130,248113,248097,248081,248065,248048,248032,248016,248000,247983,247967,247951,247934,247918,247902,247885,247869,247853,247836,247820,247803,247787,247771,247754,247738,247721,247705,247688,247672,247655,247639,247622,247606,247589,247573,247556,247540,247523,247507,247490,247474,247457,247440,247424,247407,247391,247374,247357,247341,247324,247307,247291,247274,247257,247241,247224,247207,247190,247174,247157,247140,247123,247107,247090,247073,247056,247040,247023,247006,246989,246972,246955,246938,246922,246905,246888,246871,246854,246837,246820,246803,246786,246769,246752,246735,246718,246701,246684,246667,246650,246633,246616,246599,246582,246565,246548,246531,246514,246497,246480,246463,246445,246428,246411,246394,246377,246360,246342,246325,246308,246291,246274,246256,246239,246222,246205,246187,246170,246153,246136,246118,246101,246084,246066,246049,246032,246014,245997,245979,245962,245945,245927,245910,245892,245875,245858,245840,245823,245805,245788,245770,245753,245735,245718,245700,245683,245665,245648,245630,245613,245595,245577,245560,245542,245525,245507,245489,245472,245454,245436,245419,245401,245383,245366,245348,245330,245313,245295,245277,245259,245242,245224,245206,245188,245171,245153,245135,245117,245099,245081,245064,245046,245028,245010,244992,244974,244956,244938,244921,244903,244885,244867,244849,244831,244813,244795,244777,244759,244741,244723,244705,244687,244669,244651,244633,244615,244597,244578,244560,244542,244524,244506,244488,244470,244452,244433,244415,244397,244379,244361,244343,244324,244306,244288,244270,244251,244233,244215,244197,244178,244160,244142,244123,244105,244087,244068,244050,244032,244013,243995,243977,243958,243940,243921,243903,243885,243866,243848,243829,243811,243792,243774,243755,243737,243718,243700,243681,243663,243644,243626,243607,243588,243570,243551,243533,243514,243496,243477,243458,243440,243421,243402,243384,243365,243346,243328,243309,243290,243271,243253,243234,243215,243196,243178,243159,243140,243121,243103,243084,243065,243046,243027,243008,242990,242971,242952,242933,242914,242895,242876,242857,242838,242819,242800,242782,242763,242744,242725,242706,242687,242668,242649,242630,242611,242591,242572,242553,242534,242515,242496,242477,242458,242439,242420,242401,242381,242362,242343,242324,242305,242286,242266,242247,242228,242209,242189,242170,242151,242132,242112,242093,242074,242055,242035,242016,241997,241977,241958,241939,241919,241900,241881,241861,241842,241822,241803,241784,241764,241745,241725,241706,241686,241667,241647,241628,241608,241589,241569,241550,241530,241511,241491,241472,241452,241433,241413,241393,241374,241354,241334,241315,241295,241276,241256,241236,241217,241197,241177,241157,241138,241118,241098,241079,241059,241039,241019,241000,240980,240960,240940,240920,240901,240881,240861,240841,240821,240801,240781,240762,240742,240722,240702,240682,240662,240642,240622,240602,240582,240562,240542,240522,240502,240482,240462,240442,240422,240402,240382,240362,240342,240322,240302,240282,240262,240242,240221,240201,240181,240161,240141,240121,240101,240080,240060,240040,240020,240000,239979,239959,239939,239919,239898,239878,239858,239838,239817,239797,239777,239756,239736,239716,239695,239675,239655,239634,239614,239593,239573,239553,239532,239512,239491,239471,239450,239430,239410,239389,239369,239348,239328,239307,239287,239266,239245,239225,239204,239184,239163,239143,239122,239101,239081,239060,239040,239019,238998,238978,238957,238936,238916,238895,238874,238853,238833,238812,238791,238771,238750,238729,238708,238688,238667,238646,238625,238604,238583,238563,238542,238521,238500,238479,238458,238437,238417,238396,238375,238354,238333,238312,238291,238270,238249,238228,238207,238186,238165,238144,238123,238102,238081,238060,238039,238018,237997,237976,237955,237934,237913,237891,237870,237849,237828,237807,237786,237765,237743,237722,237701,237680,237659,237637,237616,237595,237574,237552,237531,237510,237489,237467,237446,237425,237403,237382,237361,237339,237318,237297,237275,237254,237233,237211,237190,237168,237147,237126,237104,237083,237061,237040,237018,236997,236975,236954,236932,236911,236889,236868,236846,236825,236803,236782,236760,236738,236717,236695,236674,236652,236630,236609,236587,236565,236544,236522,236500,236479,236457,236435,236414,236392,236370,236348,236327,236305,236283,236261,236240,236218,236196,236174,236152,236131,236109,236087,236065,236043,236021,235999,235978,235956,235934,235912,235890,235868,235846,235824,235802,235780,235758,235736,235714,235692,235670,235648,235626,235604,235582,235560,235538,235516,235494,235472,235450,235428,235405,235383,235361,235339,235317,235295,235273,235250,235228,235206,235184,235162,235139,235117,235095,235073,235050,235028,235006,234984,234961,234939,234917,234894,234872,234850,234828,234805,234783,234760,234738,234716,234693,234671,234649,234626,234604,234581,234559,234536,234514,234491,234469,234446,234424,234401,234379,234356,234334,234311,234289,234266,234244,234221,234199,234176,234153,234131,234108,234086,234063,234040,234018,233995,233972,233950,233927,233904,233882,233859,233836,233813,233791,233768,233745,233722,233700,233677,233654,233631,233609,233586,233563,233540,233517,233494,233472,233449,233426,233403,233380,233357,233334,233311,233288,233265,233243,233220,233197,233174,233151,233128,233105,233082,233059,233036,233013,232990,232967,232944,232920,232897,232874,232851,232828,232805,232782,232759,232736,232713,232689,232666,232643,232620,232597,232574,232550,232527,232504,232481,232457,232434,232411,232388,232364,232341,232318,232295,232271,232248,232225,232201,232178,232155,232131,232108,232085,232061,232038,232014,231991,231968,231944,231921,231897,231874,231850,231827,231804,231780,231757,231733,231710,231686,231663,231639,231615,231592,231568,231545,231521,231498,231474,231450,231427,231403,231380,231356,231332,231309,231285,231261,231238,231214,231190,231167,231143,231119,231096,231072,231048,231024,231001,230977,230953,230929,230905,230882,230858,230834,230810,230786,230762,230739,230715,230691,230667,230643,230619,230595,230571,230548,230524,230500,230476,230452,230428,230404,230380,230356,230332,230308,230284,230260,230236,230212,230188,230164,230140,230116,230091,230067,230043,230019,229995,229971,229947,229923,229898,229874,229850,229826,229802,229778,229753,229729,229705,229681,229657,229632,229608,229584,229560,229535,229511,229487,229462,229438,229414,229389,229365,229341,229316,229292,229268,229243,229219,229194,229170,229146,229121,229097,229072,229048,229024,228999,228975,228950,228926,228901,228877,228852,228828,228803,228779,228754,228729,228705,228680,228656,228631,228607,228582,228557,228533,228508,228483,228459,228434,228409,228385,228360,228335,228311,228286,228261,228237,228212,228187,228162,228138,228113,228088,228063,228039,228014,227989,227964,227939,227914,227890,227865,227840,227815,227790,227765,227740,227716,227691,227666,227641,227616,227591,227566,227541,227516,227491,227466,227441,227416,227391,227366,227341,227316,227291,227266,227241,227216,227191,227166,227141,227115,227090,227065,227040,227015,226990,226965,226940,226914,226889,226864,226839,226814,226788,226763,226738,226713,226688,226662,226637,226612,226586,226561,226536,226511,226485,226460,226435,226409,226384,226359,226333,226308,226283,226257,226232,226206,226181,226156,226130,226105,226079,226054,226028,226003,225977,225952,225926,225901,225875,225850,225824,225799,225773,225748,225722,225697,225671,225646,225620,225594,225569,225543,225517,225492,225466,225441,225415,225389,225364,225338,225312,225287,225261,225235,225209,225184,225158,225132,225106,225081,225055,225029,225003,224978,224952,224926,224900,224874,224848,224823,224797,224771,224745,224719,224693,224667,224641,224615,224590,224564,224538,224512,224486,224460,224434,224408,224382,224356,224330,224304,224278,224252,224226,224200,224174,224148,224122,224096,224069,224043,224017,223991,223965,223939,223913,223887,223860,223834,223808,223782,223756,223730,223703,223677,223651,223625,223599,223572,223546,223520,223493,223467,223441,223415,223388,223362,223336,223309,223283,223257,223230,223204,223178,223151,223125,223099,223072,223046,223019,222993,222966,222940,222914,222887,222861,222834,222808,222781,222755,222728,222702,222675,222649,222622,222596,222569,222542,222516,222489,222463,222436,222410,222383,222356,222330,222303,222276,222250,222223,222196,222170,222143,222116,222090,222063,222036,222010,221983,221956,221929,221903,221876,221849,221822,221795,221769,221742,221715,221688,221661,221634,221608,221581,221554,221527,221500,221473,221446,221419,221393,221366,221339,221312,221285,221258,221231,221204,221177,221150,221123,221096,221069,221042,221015,220988,220961,220934,220907,220880,220853,220826,220798,220771,220744,220717,220690,220663,220636,220609,220581,220554,220527,220500,220473,220446,220418,220391,220364,220337,220309,220282,220255,220228,220200,220173,220146,220119,220091,220064,220037,220009,219982,219955,219927,219900,219873,219845,219818,219790,219763,219736,219708,219681,219653,219626,219598,219571,219544,219516,219489,219461,219434,219406,219379,219351,219324,219296,219268,219241,219213,219186,219158,219131,219103,219075,219048,219020,218993,218965,218937,218910,218882,218854,218827,218799,218771,218744,218716,218688,218660,218633,218605,218577,218549,218522,218494,218466,218438,218411,218383,218355,218327,218299,218271,218244,218216,218188,218160,218132,218104,218076,218049,218021,217993,217965,217937,217909,217881,217853,217825,217797,217769,217741,217713,217685,217657,217629,217601,217573,217545,217517,217489,217461,217433,217405,217377,217348,217320,217292,217264,217236,217208,217180,217152,217123,217095,217067,217039,217011,216982,216954,216926,216898,216870,216841,216813,216785,216757,216728,216700,216672,216643,216615,216587,216558,216530,216502,216473,216445,216417,216388,216360,216332,216303,216275,216246,216218,216190,216161,216133,216104,216076,216047,216019,215990,215962,215933,215905,215876,215848,215819,215791,215762,215734,215705,215677,215648,215619,215591,215562,215534,215505,215476,215448,215419,215390,215362,215333,215304,215276,215247,215218,215190,215161,215132,215104,215075,215046,215017,214989,214960,214931,214902,214873,214845,214816,214787,214758,214729,214701,214672,214643,214614,214585,214556,214527,214498,214470,214441,214412,214383,214354,214325,214296,214267,214238,214209,214180,214151,214122,214093,214064,214035,214006,213977,213948,213919,213890,213861,213832,213803,213774,213745,213715,213686,213657,213628,213599,213570,213541,213511,213482,213453,213424,213395,213366,213336,213307,213278,213249,213219,213190,213161,213132,213102,213073,213044,213015,212985,212956,212927,212897,212868,212839,212809,212780,212751,212721,212692,212662,212633,212604,212574,212545,212515,212486,212456,212427,212398,212368,212339,212309,212280,212250,212221,212191,212162,212132,212103,212073,212043,212014,211984,211955,211925,211896,211866,211836,211807,211777,211748,211718,211688,211659,211629,211599,211570,211540,211510,211481,211451,211421,211391,211362,211332,211302,211272,211243,211213,211183,211153,211124,211094,211064,211034,211004,210974,210945,210915,210885,210855,210825,210795,210765,210736,210706,210676,210646,210616,210586,210556,210526,210496,210466,210436,210406,210376,210346,210316,210286,210256,210226,210196,210166,210136,210106,210076,210046,210016,209986,209956,209926,209895,209865,209835,209805,209775,209745,209715,209684,209654,209624,209594,209564,209534,209503,209473,209443,209413,209382,209352,209322,209292,209261,209231,209201,209170,209140,209110,209080,209049,209019,208989,208958,208928,208897,208867,208837,208806,208776,208746,208715,208685,208654,208624,208593,208563,208533,208502,208472,208441,208411,208380,208350,208319,208289,208258,208228,208197,208166,208136,208105,208075,208044,208014,207983,207952,207922,207891,207861,207830,207799,207769,207738,207707,207677,207646,207615,207585,207554,207523,207492,207462,207431,207400,207370,207339,207308,207277,207246,207216,207185,207154,207123,207092,207062,207031,207000,206969,206938,206907,206877,206846,206815,206784,206753,206722,206691,206660,206629,206598,206567,206537,206506,206475,206444,206413,206382,206351,206320,206289,206258,206227,206196,206165,206133,206102,206071,206040,206009,205978,205947,205916,205885,205854,205823,205791,205760,205729,205698,205667,205636,205604,205573,205542,205511,205480,205448,205417,205386,205355,205324,205292,205261,205230,205198,205167,205136,205105,205073,205042,205011,204979,204948,204917,204885,204854,204823,204791,204760,204728,204697,204666,204634,204603,204571,204540,204508,204477,204446,204414,204383,204351,204320,204288,204257,204225,204194,204162,204131,204099,204067,204036,204004,203973,203941,203910,203878,203846,203815,203783,203752,203720,203688,203657,203625,203593,203562,203530,203498,203467,203435,203403,203372,203340,203308,203276,203245,203213,203181,203149,203118,203086,203054,203022,202990,202959,202927,202895,202863,202831,202799,202768,202736,202704,202672,202640,202608,202576,202544,202512,202481,202449,202417,202385,202353,202321,202289,202257,202225,202193,202161,202129,202097,202065,202033,202001,201969,201937,201905,201873,201841,201808,201776,201744,201712,201680,201648,201616,201584,201552,201519,201487,201455,201423,201391,201359,201326,201294,201262,201230,201198,201165,201133,201101,201069,201036,201004,200972,200940,200907,200875,200843,200810,200778,200746,200713,200681,200649,200616,200584,200552,200519,200487,200454,200422,200390,200357,200325,200292,200260,200228,200195,200163,200130,200098,200065,200033,200000,199968,199935,199903,199870,199838,199805,199773,199740,199708,199675,199642,199610,199577,199545,199512,199479,199447,199414,199382,199349,199316,199284,199251,199218,199186,199153,199120,199088,199055,199022,198989,198957,198924,198891,198858,198826,198793,198760,198727,198695,198662,198629,198596,198563,198531,198498,198465,198432,198399,198366,198334,198301,198268,198235,198202,198169,198136,198103,198070,198037,198004,197972,197939,197906,197873,197840,197807,197774,197741,197708,197675,197642,197609,197576,197543,197510,197476,197443,197410,197377,197344,197311,197278,197245,197212,197179,197146,197112,197079,197046,197013,196980,196947,196913,196880,196847,196814,196781,196747,196714,196681,196648,196615,196581,196548,196515,196481,196448,196415,196382,196348,196315,196282,196248,196215,196182,196148,196115,196082,196048,196015,195982,195948,195915,195881,195848,195815,195781,195748,195714,195681,195647,195614,195580,195547,195513,195480,195446,195413,195379,195346,195312,195279,195245,195212,195178,195145,195111,195078,195044,195010,194977,194943,194910,194876,194842,194809,194775,194741,194708,194674,194640,194607,194573,194539,194506,194472,194438,194405,194371,194337,194303,194270,194236,194202,194168,194135,194101,194067,194033,193999,193966,193932,193898,193864,193830,193796,193763,193729,193695,193661,193627,193593,193559,193525,193492,193458,193424,193390,193356,193322,193288,193254,193220,193186,193152,193118,193084,193050,193016,192982,192948,192914,192880,192846,192812,192778,192744,192710,192676,192641,192607,192573,192539,192505,192471,192437,192403,192369,192334,192300,192266,192232,192198,192164,192129,192095,192061,192027,191992,191958,191924,191890,191856,191821,191787,191753,191718,191684,191650,191616,191581,191547,191513,191478,191444,191410,191375,191341,191307,191272,191238,191203,191169,191135,191100,191066,191031,190997,190963,190928,190894,190859,190825,190790,190756,190721,190687,190652,190618,190583,190549,190514,190480,190445,190411,190376,190342,190307,190272,190238,190203,190169,190134,190099,190065,190030,189996,189961,189926,189892,189857,189822,189788,189753,189718,189684,189649,189614,189580,189545,189510,189475,189441,189406,189371,189336,189302,189267,189232,189197,189162,189128,189093,189058,189023,188988,188954,188919,188884,188849,188814,188779,188744,188709,188675,188640,188605,188570,188535,188500,188465,188430,188395,188360,188325,188290,188255,188220,188185,188150,188115,188080,188045,188010,187975,187940,187905,187870,187835,187800,187765,187730,187695,187660,187625,187589,187554,187519,187484,187449,187414,187379,187343,187308,187273,187238,187203,187168,187132,187097,187062,187027,186992,186956,186921,186886,186851,186815,186780,186745,186710,186674,186639,186604,186568,186533,186498,186462,186427,186392,186356,186321,186286,186250,186215,186179,186144,186109,186073,186038,186002,185967,185932,185896,185861,185825,185790,185754,185719,185683,185648,185612,185577,185541,185506,185470,185435,185399,185364,185328,185293,185257,185222,185186,185150,185115,185079,185044,185008,184972,184937,184901,184866,184830,184794,184759,184723,184687,184652,184616,184580,184545,184509,184473,184437,184402,184366,184330,184294,184259,184223,184187,184151,184116,184080,184044,184008,183972,183937,183901,183865,183829,183793,183757,183722,183686,183650,183614,183578,183542,183506,183470,183435,183399,183363,183327,183291,183255,183219,183183,183147,183111,183075,183039,183003,182967,182931,182895,182859,182823,182787,182751,182715,182679,182643,182607,182571,182535,182499,182463,182426,182390,182354,182318,182282,182246,182210,182174,182137,182101,182065,182029,181993,181957,181920,181884,181848,181812,181776,181739,181703,181667,181631,181594,181558,181522,181486,181449,181413,181377,181341,181304,181268,181232,181195,181159,181123,181086,181050,181014,180977,180941,180904,180868,180832,180795,180759,180723,180686,180650,180613,180577,180540,180504,180467,180431,180395,180358,180322,180285,180249,180212,180176,180139,180103,180066,180029,179993,179956,179920,179883,179847,179810,179774,179737,179700,179664,179627,179591,179554,179517,179481,179444,179407,179371,179334,179297,179261,179224,179187,179151,179114,179077,179041,179004,178967,178930,178894,178857,178820,178783,178747,178710,178673,178636,178600,178563,178526,178489,178452,178415,178379,178342,178305,178268,178231,178194,178158,178121,178084,178047,178010,177973,177936,177899,177862,177825,177788,177752,177715,177678,177641,177604,177567,177530,177493,177456,177419,177382,177345,177308,177271,177234,177197,177160,177123,177085,177048,177011,176974,176937,176900,176863,176826,176789,176752,176714,176677,176640,176603,176566,176529,176492,176454,176417,176380,176343,176306,176268,176231,176194,176157,176120,176082,176045,176008,175971,175933,175896,175859,175822,175784,175747,175710,175672,175635,175598,175560,175523,175486,175448,175411,175374,175336,175299,175262,175224,175187,175149,175112,175075,175037,175000,174962,174925,174887,174850,174813,174775,174738,174700,174663,174625,174588,174550,174513,174475,174438,174400,174363,174325,174288,174250,174212,174175,174137,174100,174062,174025,173987,173949,173912,173874,173837,173799,173761,173724,173686,173648,173611,173573,173535,173498,173460,173422,173385,173347,173309,173271,173234,173196,173158,173121,173083,173045,173007,172969,172932,172894,172856,172818,172781,172743,172705,172667,172629,172591,172554,172516,172478,172440,172402,172364,172326,172289,172251,172213,172175,172137,172099,172061,172023,171985,171947,171909,171871,171834,171796,171758,171720,171682,171644,171606,171568,171530,171492,171454,171416,171378,171339,171301,171263,171225,171187,171149,171111,171073,171035,170997,170959,170921,170883,170844,170806,170768,170730,170692,170654,170616,170577,170539,170501,170463,170425,170386,170348,170310,170272,170234,170195,170157,170119,170081,170042,170004,169966,169928,169889,169851,169813,169774,169736,169698,169660,169621,169583,169545,169506,169468,169430,169391,169353,169314,169276,169238,169199,169161,169122,169084,169046,169007,168969,168930,168892,168853,168815,168777,168738,168700,168661,168623,168584,168546,168507,168469,168430,168392,168353,168315,168276,168238,168199,168160,168122,168083,168045,168006,167968,167929,167890,167852,167813,167774,167736,167697,167659,167620,167581,167543,167504,167465,167427,167388,167349,167311,167272,167233,167194,167156,167117,167078,167040,167001,166962,166923,166885,166846,166807,166768,166729,166691,166652,166613,166574,166535,166497,166458,166419,166380,166341,166302,166264,166225,166186,166147,166108,166069,166030,165991,165952,165914,165875,165836,165797,165758,165719,165680,165641,165602,165563,165524,165485,165446,165407,165368,165329,165290,165251,165212,165173,165134,165095,165056,165017,164978,164939,164900,164861,164821,164782,164743,164704,164665,164626,164587,164548,164509,164469,164430,164391,164352,164313,164274,164234,164195,164156,164117,164078,164039,163999,163960,163921,163882,163842,163803,163764,163725,163685,163646,163607,163568,163528,163489,163450,163410,163371,163332,163292,163253,163214,163174,163135,163096,163056,163017,162978,162938,162899,162860,162820,162781,162741,162702,162663,162623,162584,162544,162505,162465,162426,162386,162347,162308,162268,162229,162189,162150,162110,162071,162031,161992,161952,161913,161873,161833,161794,161754,161715,161675,161636,161596,161557,161517,161477,161438,161398,161359,161319,161279,161240,161200,161160,161121,161081,161041,161002,160962,160922,160883,160843,160803,160764,160724,160684,160644,160605,160565,160525,160486,160446,160406,160366,160327,160287,160247,160207,160167,160128,160088,160048,160008,159968,159929,159889,159849,159809,159769,159729,159689,159650,159610,159570,159530,159490,159450,159410,159370,159330,159291,159251,159211,159171,159131,159091,159051,159011,158971,158931,158891,158851,158811,158771,158731,158691,158651,158611,158571,158531,158491,158451,158411,158371,158331,158291,158251,158211,158170,158130,158090,158050,158010,157970,157930,157890,157850,157809,157769,157729,157689,157649,157609,157569,157528,157488,157448,157408,157368,157327,157287,157247,157207,157167,157126,157086,157046,157006,156965,156925,156885,156845,156804,156764,156724,156683,156643,156603,156562,156522,156482,156441,156401,156361,156320,156280,156240,156199,156159,156119,156078,156038,155997,155957,155917,155876,155836,155795,155755,155715,155674,155634,155593,155553,155512,155472,155431,155391,155350,155310,155269,155229,155188,155148,155107,155067,155026,154986,154945,154905,154864,154824,154783,154742,154702,154661,154621,154580,154539,154499,154458,154418,154377,154336,154296,154255,154214,154174,154133,154093,154052,154011,153970,153930,153889,153848,153808,153767,153726,153686,153645,153604,153563,153523,153482,153441,153400,153360,153319,153278,153237,153197,153156,153115,153074,153033,152993,152952,152911,152870,152829,152788,152748,152707,152666,152625,152584,152543,152502,152461,152421,152380,152339,152298,152257,152216,152175,152134,152093,152052,152011,151970,151929,151888,151847,151806,151765,151724,151683,151642,151601,151560,151519,151478,151437,151396,151355,151314,151273,151232,151191,151150,151109,151068,151027,150986,150945,150904,150862,150821,150780,150739,150698,150657,150616,150575,150533,150492,150451,150410,150369,150328,150286,150245,150204,150163,150122,150080,150039,149998,149957,149916,149874,149833,149792,149751,149709,149668,149627,149585,149544,149503,149462,149420,149379,149338,149296,149255,149214,149172,149131,149090,149048,149007,148966,148924,148883,148842,148800,148759,148717,148676,148635,148593,148552,148510,148469,148428,148386,148345,148303,148262,148220,148179,148137,148096,148054,148013,147971,147930,147888,147847,147805,147764,147722,147681,147639,147598,147556,147515,147473,147432,147390,147348,147307,147265,147224,147182,147141,147099,147057,147016,146974,146932,146891,146849,146808,146766,146724,146683,146641,146599,146558,146516,146474,146433,146391,146349,146307,146266,146224,146182,146141,146099,146057,146015,145974,145932,145890,145848,145807,145765,145723,145681,145639,145598,145556,145514,145472,145430,145389,145347,145305,145263,145221,145179,145137,145096,145054,145012,144970,144928,144886,144844,144802,144761,144719,144677,144635,144593,144551,144509,144467,144425,144383,144341,144299,144257,144215,144173,144131,144089,144047,144005,143963,143921,143879,143837,143795,143753,143711,143669,143627,143585,143543,143501,143459,143417,143375,143333,143291,143248,143206,143164,143122,143080,143038,142996,142954,142912,142869,142827,142785,142743,142701,142659,142616,142574,142532,142490,142448,142405,142363,142321,142279,142237,142194,142152,142110,142068,142025,141983,141941,141899,141856,141814,141772,141730,141687,141645,141603,141560,141518,141476,141433,141391,141349,141306,141264,141222,141179,141137,141095,141052,141010,140968,140925,140883,140840,140798,140756,140713,140671,140628,140586,140544,140501,140459,140416,140374,140331,140289,140246,140204,140161,140119,140077,140034,139992,139949,139907,139864,139821,139779,139736,139694,139651,139609,139566,139524,139481,139439,139396,139353,139311,139268,139226,139183,139141,139098,139055,139013,138970,138927,138885,138842,138800,138757,138714,138672,138629,138586,138544,138501,138458,138416,138373,138330,138288,138245,138202,138159,138117,138074,138031,137988,137946,137903,137860,137817,137775,137732,137689,137646,137604,137561,137518,137475,137432,137390,137347,137304,137261,137218,137176,137133,137090,137047,137004,136961,136918,136876,136833,136790,136747,136704,136661,136618,136575,136532,136490,136447,136404,136361,136318,136275,136232,136189,136146,136103,136060,136017,135974,135931,135888,135845,135802,135759,135716,135673,135630,135587,135544,135501,135458,135415,135372,135329,135286,135243,135200,135157,135114,135071,135028,134984,134941,134898,134855,134812,134769,134726,134683,134640,134596,134553,134510,134467,134424,134381,134338,134294,134251,134208,134165,134122,134078,134035,133992,133949,133906,133862,133819,133776,133733,133690,133646,133603,133560,133517,133473,133430,133387,133343,133300,133257,133214,133170,133127,133084,133040,132997,132954,132910,132867,132824,132780,132737,132694,132650,132607,132564,132520,132477,132434,132390,132347,132303,132260,132217,132173,132130,132086,132043,132000,131956,131913,131869,131826,131782,131739,131695,131652,131609,131565,131522,131478,131435,131391,131348,131304,131261,131217,131174,131130,131087,131043,130999,130956,130912,130869,130825,130782,130738,130695,130651,130607,130564,130520,130477,130433,130389,130346,130302,130259,130215,130171,130128,130084,130040,129997,129953,129909,129866,129822,129778,129735,129691,129647,129604,129560,129516,129473,129429,129385,129341,129298,129254,129210,129167,129123,129079,129035,128992,128948,128904,128860,128816,128773,128729,128685,128641,128598,128554,128510,128466,128422,128378,128335,128291,128247,128203,128159,128115,128072,128028,127984,127940,127896,127852,127808,127764,127721,127677,127633,127589,127545,127501,127457,127413,127369,127325,127281,127237,127193,127150,127106,127062,127018,126974,126930,126886,126842,126798,126754,126710,126666,126622,126578,126534,126490,126446,126402,126358,126314,126269,126225,126181,126137,126093,126049,126005,125961,125917,125873,125829,125785,125741,125696,125652,125608,125564,125520,125476,125432,125388,125343,125299,125255,125211,125167,125123,125078,125034,124990,124946,124902,124857,124813,124769,124725,124681,124636,124592,124548,124504,124460,124415,124371,124327,124283,124238,124194,124150,124105,124061,124017,123973,123928,123884,123840,123795,123751,123707,123662,123618,123574,123529,123485,123441,123396,123352,123308,123263,123219,123175,123130,123086,123042,122997,122953,122908,122864,122820,122775,122731,122686,122642,122597,122553,122509,122464,122420,122375,122331,122286,122242,122197,122153,122108,122064,122019,121975,121931,121886,121842,121797,121752,121708,121663,121619,121574,121530,121485,121441,121396,121352,121307,121263,121218,121173,121129,121084,121040,120995,120950,120906,120861,120817,120772,120727,120683,120638,120594,120549,120504,120460,120415,120370,120326,120281,120236,120192,120147,120102,120058,120013,119968,119924,119879,119834,119790,119745,119700,119655,119611,119566,119521,119476,119432,119387,119342,119297,119253,119208,119163,119118,119074,119029,118984,118939,118894,118850,118805,118760,118715,118670,118626,118581,118536,118491,118446,118401,118357,118312,118267,118222,118177,118132,118087,118042,117998,117953,117908,117863,117818,117773,117728,117683,117638,117593,117549,117504,117459,117414,117369,117324,117279,117234,117189,117144,117099,117054,117009,116964,116919,116874,116829,116784,116739,116694,116649,116604,116559,116514,116469,116424,116379,116334,116289,116244,116199,116154,116109,116064,116018,115973,115928,115883,115838,115793,115748,115703,115658,115613,115567,115522,115477,115432,115387,115342,115297,115252,115206,115161,115116,115071,115026,114981,114935,114890,114845,114800,114755,114710,114664,114619,114574,114529,114483,114438,114393,114348,114303,114257,114212,114167,114122,114076,114031,113986,113941,113895,113850,113805,113759,113714,113669,113624,113578,113533,113488,113442,113397,113352,113306,113261,113216,113170,113125,113080,113034,112989,112944,112898,112853,112808,112762,112717,112671,112626,112581,112535,112490,112444,112399,112354,112308,112263,112217,112172,112126,112081,112036,111990,111945,111899,111854,111808,111763,111717,111672,111626,111581,111535,111490,111444,111399,111353,111308,111262,111217,111171,111126,111080,111035,110989,110944,110898,110853,110807,110762,110716,110670,110625,110579,110534,110488,110443,110397,110351,110306,110260,110215,110169,110123,110078,110032,109986,109941,109895,109850,109804,109758,109713,109667,109621,109576,109530,109484,109439,109393,109347,109302,109256,109210,109165,109119,109073,109027,108982,108936,108890,108845,108799,108753,108707,108662,108616,108570,108524,108479,108433,108387,108341,108295,108250,108204,108158,108112,108067,108021,107975,107929,107883,107838,107792,107746,107700,107654,107608,107563,107517,107471,107425,107379,107333,107287,107242,107196,107150,107104,107058,107012,106966,106920,106875,106829,106783,106737,106691,106645,106599,106553,106507,106461,106415,106369,106323,106278,106232,106186,106140,106094,106048,106002,105956,105910,105864,105818,105772,105726,105680,105634,105588,105542,105496,105450,105404,105358,105312,105266,105220,105174,105128,105082,105035,104989,104943,104897,104851,104805,104759,104713,104667,104621,104575,104529,104483,104436,104390,104344,104298,104252,104206,104160,104114,104067,104021,103975,103929,103883,103837,103791,103744,103698,103652,103606,103560,103514,103467,103421,103375,103329,103283,103236,103190,103144,103098,103052,103005,102959,102913,102867,102820,102774,102728,102682,102635,102589,102543,102497,102450,102404,102358,102312,102265,102219,102173,102126,102080,102034,101988,101941,101895,101849,101802,101756,101710,101663,101617,101571,101524,101478,101432,101385,101339,101293,101246,101200,101153,101107,101061,101014,100968,100922,100875,100829,100782,100736,100690,100643,100597,100550,100504,100457,100411,100365,100318,100272,100225,100179,100132,100086,100039,99993,99947,99900,99854,99807,99761,99714,99668,99621,99575,99528,99482,99435,99389,99342,99296,99249,99203,99156,99110,99063,99016,98970,98923,98877,98830,98784,98737,98691,98644,98597,98551,98504,98458,98411,98364,98318,98271,98225,98178,98131,98085,98038,97992,97945,97898,97852,97805,97758,97712,97665,97619,97572,97525,97479,97432,97385,97339,97292,97245,97199,97152,97105,97058,97012,96965,96918,96872,96825,96778,96732,96685,96638,96591,96545,96498,96451,96404,96358,96311,96264,96217,96171,96124,96077,96030,95984,95937,95890,95843,95796,95750,95703,95656,95609,95562,95516,95469,95422,95375,95328,95282,95235,95188,95141,95094,95047,95001,94954,94907,94860,94813,94766,94719,94673,94626,94579,94532,94485,94438,94391,94344,94297,94251,94204,94157,94110,94063,94016,93969,93922,93875,93828,93781,93734,93687,93640,93594,93547,93500,93453,93406,93359,93312,93265,93218,93171,93124,93077,93030,92983,92936,92889,92842,92795,92748,92701,92654,92607,92560,92513,92466,92419,92372,92325,92278,92230,92183,92136,92089,92042,91995,91948,91901,91854,91807,91760,91713,91666,91619,91571,91524,91477,91430,91383,91336,91289,91242,91195,91147,91100,91053,91006,90959,90912,90865,90817,90770,90723,90676,90629,90582,90534,90487,90440,90393,90346,90299,90251,90204,90157,90110,90063,90015,89968,89921,89874,89826,89779,89732,89685,89638,89590,89543,89496,89449,89401,89354,89307,89260,89212,89165,89118,89070,89023,88976,88929,88881,88834,88787,88739,88692,88645,88598,88550,88503,88456,88408,88361,88314,88266,88219,88172,88124,88077,88030,87982,87935,87888,87840,87793,87745,87698,87651,87603,87556,87509,87461,87414,87366,87319,87272,87224,87177,87129,87082,87035,86987,86940,86892,86845,86798,86750,86703,86655,86608,86560,86513,86465,86418,86371,86323,86276,86228,86181,86133,86086,86038,85991,85943,85896,85848,85801,85753,85706,85658,85611,85563,85516,85468,85421,85373,85326,85278,85231,85183,85136,85088,85040,84993,84945,84898,84850,84803,84755,84708,84660,84612,84565,84517,84470,84422,84374,84327,84279,84232,84184,84136,84089,84041,83994,83946,83898,83851,83803,83756,83708,83660,83613,83565,83517,83470,83422,83374,83327,83279,83231,83184,83136,83088,83041,82993,82945,82898,82850,82802,82755,82707,82659,82612,82564,82516,82468,82421,82373,82325,82278,82230,82182,82134,82087,82039,81991,81943,81896,81848,81800,81752,81705,81657,81609,81561,81514,81466,81418,81370,81322,81275,81227,81179,81131,81083,81036,80988,80940,80892,80844,80797,80749,80701,80653,80605,80557,80510,80462,80414,80366,80318,80270,80223,80175,80127,80079,80031,79983,79935,79887,79840,79792,79744,79696,79648,79600,79552,79504,79457,79409,79361,79313,79265,79217,79169,79121,79073,79025,78977,78929,78881,78834,78786,78738,78690,78642,78594,78546,78498,78450,78402,78354,78306,78258,78210,78162,78114,78066,78018,77970,77922,77874,77826,77778,77730,77682,77634,77586,77538,77490,77442,77394,77346,77298,77250,77202,77154,77106,77058,77010,76962,76914,76866,76818,76770,76721,76673,76625,76577,76529,76481,76433,76385,76337,76289,76241,76193,76144,76096,76048,76000,75952,75904,75856,75808,75760,75711,75663,75615,75567,75519,75471,75423,75375,75326,75278,75230,75182,75134,75086,75037,74989,74941,74893,74845,74797,74748,74700,74652,74604,74556,74508,74459,74411,74363,74315,74267,74218,74170,74122,74074,74025,73977,73929,73881,73833,73784,73736,73688,73640,73591,73543,73495,73447,73398,73350,73302,73254,73205,73157,73109,73061,73012,72964,72916,72867,72819,72771,72723,72674,72626,72578,72529,72481,72433,72384,72336,72288,72239,72191,72143,72095,72046,71998,71950,71901,71853,71805,71756,71708,71659,71611,71563,71514,71466,71418,71369,71321,71273,71224,71176,71127,71079,71031,70982,70934,70886,70837,70789,70740,70692,70644,70595,70547,70498,70450,70401,70353,70305,70256,70208,70159,70111,70062,70014,69966,69917,69869,69820,69772,69723,69675,69626,69578,69530,69481,69433,69384,69336,69287,69239,69190,69142,69093,69045,68996,68948,68899,68851,68802,68754,68705,68657,68608,68560,68511,68463,68414,68366,68317,68269,68220,68171,68123,68074,68026,67977,67929,67880,67832,67783,67735,67686,67637,67589,67540,67492,67443,67395,67346,67297,67249,67200,67152,67103,67055,67006,66957,66909,66860,66812,66763,66714,66666,66617,66568,66520,66471,66423,66374,66325,66277,66228,66179,66131,66082,66034,65985,65936,65888,65839,65790,65742,65693,65644,65596,65547,65498,65450,65401,65352,65304,65255,65206,65158,65109,65060,65011,64963,64914,64865,64817,64768,64719,64671,64622,64573,64524,64476,64427,64378,64329,64281,64232,64183,64135,64086,64037,63988,63940,63891,63842,63793,63745,63696,63647,63598,63550,63501,63452,63403,63354,63306,63257,63208,63159,63111,63062,63013,62964,62915,62867,62818,62769,62720,62671,62623,62574,62525,62476,62427,62378,62330,62281,62232,62183,62134,62085,62037,61988,61939,61890,61841,61792,61744,61695,61646,61597,61548,61499,61450,61402,61353,61304,61255,61206,61157,61108,61059,61011,60962,60913,60864,60815,60766,60717,60668,60619,60570,60522,60473,60424,60375,60326,60277,60228,60179,60130,60081,60032,59983,59935,59886,59837,59788,59739,59690,59641,59592,59543,59494,59445,59396,59347,59298,59249,59200,59151,59102,59053,59004,58955,58906,58857,58808,58759,58711,58662,58613,58564,58515,58466,58417,58368,58319,58270,58221,58171,58122,58073,58024,57975,57926,57877,57828,57779,57730,57681,57632,57583,57534,57485,57436,57387,57338,57289,57240,57191,57142,57093,57044,56995,56946,56896,56847,56798,56749,56700,56651,56602,56553,56504,56455,56406,56357,56308,56258,56209,56160,56111,56062,56013,55964,55915,55866,55816,55767,55718,55669,55620,55571,55522,55473,55424,55374,55325,55276,55227,55178,55129,55080,55030,54981,54932,54883,54834,54785,54736,54686,54637,54588,54539,54490,54441,54391,54342,54293,54244,54195,54145,54096,54047,53998,53949,53900,53850,53801,53752,53703,53654,53604,53555,53506,53457,53408,53358,53309,53260,53211,53161,53112,53063,53014,52965,52915,52866,52817,52768,52718,52669,52620,52571,52521,52472,52423,52374,52324,52275,52226,52177,52127,52078,52029,51980,51930,51881,51832,51782,51733,51684,51635,51585,51536,51487,51438,51388,51339,51290,51240,51191,51142,51092,51043,50994,50945,50895,50846,50797,50747,50698,50649,50599,50550,50501,50451,50402,50353,50303,50254,50205,50155,50106,50057,50007,49958,49909,49859,49810,49761,49711,49662,49613,49563,49514,49464,49415,49366,49316,49267,49218,49168,49119,49070,49020,48971,48921,48872,48823,48773,48724,48674,48625,48576,48526,48477,48427,48378,48329,48279,48230,48180,48131,48082,48032,47983,47933,47884,47835,47785,47736,47686,47637,47587,47538,47489,47439,47390,47340,47291,47241,47192,47142,47093,47044,46994,46945,46895,46846,46796,46747,46697,46648,46598,46549,46500,46450,46401,46351,46302,46252,46203,46153,46104,46054,46005,45955,45906,45856,45807,45757,45708,45658,45609,45559,45510,45460,45411,45361,45312,45262,45213,45163,45114,45064,45015,44965,44916,44866,44817,44767,44718,44668,44619,44569,44519,44470,44420,44371,44321,44272,44222,44173,44123,44074,44024,43974,43925,43875,43826,43776,43727,43677,43628,43578,43528,43479,43429,43380,43330,43281,43231,43181,43132,43082,43033,42983,42933,42884,42834,42785,42735,42686,42636,42586,42537,42487,42438,42388,42338,42289,42239,42190,42140,42090,42041,41991,41941,41892,41842,41793,41743,41693,41644,41594,41544,41495,41445,41396,41346,41296,41247,41197,41147,41098,41048,40998,40949,40899,40849,40800,40750,40701,40651,40601,40552,40502,40452,40403,40353,40303,40254,40204,40154,40105,40055,40005,39956,39906,39856,39806,39757,39707,39657,39608,39558,39508,39459,39409,39359,39310,39260,39210,39160,39111,39061,39011,38962,38912,38862,38813,38763,38713,38663,38614,38564,38514,38465,38415,38365,38315,38266,38216,38166,38116,38067,38017,37967,37917,37868,37818,37768,37719,37669,37619,37569,37520,37470,37420,37370,37321,37271,37221,37171,37122,37072,37022,36972,36922,36873,36823,36773,36723,36674,36624,36574,36524,36475,36425,36375,36325,36275,36226,36176,36126,36076,36027,35977,35927,35877,35827,35778,35728,35678,35628,35578,35529,35479,35429,35379,35329,35280,35230,35180,35130,35080,35030,34981,34931,34881,34831,34781,34732,34682,34632,34582,34532,34482,34433,34383,34333,34283,34233,34183,34134,34084,34034,33984,33934,33884,33835,33785,33735,33685,33635,33585,33535,33486,33436,33386,33336,33286,33236,33186,33137,33087,33037,32987,32937,32887,32837,32788,32738,32688,32638,32588,32538,32488,32438,32389,32339,32289,32239,32189,32139,32089,32039,31989,31940,31890,31840,31790,31740,31690,31640,31590,31540,31490,31441,31391,31341,31291,31241,31191,31141,31091,31041,30991,30942,30892,30842,30792,30742,30692,30642,30592,30542,30492,30442,30392,30342,30293,30243,30193,30143,30093,30043,29993,29943,29893,29843,29793,29743,29693,29643,29593,29543,29494,29444,29394,29344,29294,29244,29194,29144,29094,29044,28994,28944,28894,28844,28794,28744,28694,28644,28594,28544,28494,28444,28394,28344,28295,28245,28195,28145,28095,28045,27995,27945,27895,27845,27795,27745,27695,27645,27595,27545,27495,27445,27395,27345,27295,27245,27195,27145,27095,27045,26995,26945,26895,26845,26795,26745,26695,26645,26595,26545,26495,26445,26395,26345,26295,26245,26195,26145,26095,26045,25995,25945,25895,25845,25795,25745,25695,25645,25595,25545,25495,25444,25394,25344,25294,25244,25194,25144,25094,25044,24994,24944,24894,24844,24794,24744,24694,24644,24594,24544,24494,24444,24394,24344,24294,24244,24193,24143,24093,24043,23993,23943,23893,23843,23793,23743,23693,23643,23593,23543,23493,23443,23393,23342,23292,23242,23192,23142,23092,23042,22992,22942,22892,22842,22792,22742,22692,22641,22591,22541,22491,22441,22391,22341,22291,22241,22191,22141,22091,22040,21990,21940,21890,21840,21790,21740,21690,21640,21590,21540,21489,21439,21389,21339,21289,21239,21189,21139,21089,21039,20988,20938,20888,20838,20788,20738,20688,20638,20588,20538,20487,20437,20387,20337,20287,20237,20187,20137,20086,20036,19986,19936,19886,19836,19786,19736,19686,19635,19585,19535,19485,19435,19385,19335,19285,19234,19184,19134,19084,19034,18984,18934,18883,18833,18783,18733,18683,18633,18583,18532,18482,18432,18382,18332,18282,18232,18181,18131,18081,18031,17981,17931,17881,17830,17780,17730,17680,17630,17580,17530,17479,17429,17379,17329,17279,17229,17178,17128,17078,17028,16978,16928,16878,16827,16777,16727,16677,16627,16577,16526,16476,16426,16376,16326,16276,16225,16175,16125,16075,16025,15975,15924,15874,15824,15774,15724,15673,15623,15573,15523,15473,15423,15372,15322,15272,15222,15172,15122,15071,15021,14971,14921,14871,14820,14770,14720,14670,14620,14569,14519,14469,14419,14369,14319,14268,14218,14168,14118,14068,14017,13967,13917,13867,13817,13766,13716,13666,13616,13566,13515,13465,13415,13365,13315,13264,13214,13164,13114,13064,13013,12963,12913,12863,12813,12762,12712,12662,12612,12562,12511,12461,12411,12361,12311,12260,12210,12160,12110,12059,12009,11959,11909,11859,11808,11758,11708,11658,11608,11557,11507,11457,11407,11356,11306,11256,11206,11156,11105,11055,11005,10955,10904,10854,10804,10754,10704,10653,10603,10553,10503,10452,10402,10352,10302,10252,10201,10151,10101,10051,10000,9950,9900,9850,9799,9749,9699,9649,9599,9548,9498,9448,9398,9347,9297,9247,9197,9146,9096,9046,8996,8946,8895,8845,8795,8745,8694,8644,8594,8544,8493,8443,8393,8343,8292,8242,8192,8142,8091,8041,7991,7941,7890,7840,7790,7740,7690,7639,7589,7539,7489,7438,7388,7338,7288,7237,7187,7137,7087,7036,6986,6936,6886,6835,6785,6735,6685,6634,6584,6534,6484,6433,6383,6333,6283,6232,6182,6132,6082,6031,5981,5931,5881,5830,5780,5730,5680,5629,5579,5529,5479,5428,5378,5328,5278,5227,5177,5127,5076,5026,4976,4926,4875,4825,4775,4725,4674,4624,4574,4524,4473,4423,4373,4323,4272,4222,4172,4122,4071,4021,3971,3921,3870,3820,3770,3720,3669,3619,3569,3518,3468,3418,3368,3317,3267,3217,3167,3116,3066,3016,2966,2915,2865,2815,2765,2714,2664,2614,2563,2513,2463,2413,2362,2312,2262,2212,2161,2111,2061,2011,1960,1910,1860,1810,1759,1709,1659,1608,1558,1508,1458,1407,1357,1307,1257,1206,1156,1106,1056,1005,955,905,855,804,754,704,653,603,553,503,452,402,352,302,251,201,151,101,50,0,-49,-100,-150,-200,-250,-301,-351,-401,-451,-502,-552,-602,-652,-703,-753,-803,-854,-904,-954,-1004,-1055,-1105,-1155,-1205,-1256,-1306,-1356,-1406,-1457,-1507,-1557,-1607,-1658,-1708,-1758,-1809,-1859,-1909,-1959,-2010,-2060,-2110,-2160,-2211,-2261,-2311,-2361,-2412,-2462,-2512,-2562,-2613,-2663,-2713,-2764,-2814,-2864,-2914,-2965,-3015,-3065,-3115,-3166,-3216,-3266,-3316,-3367,-3417,-3467,-3517,-3568,-3618,-3668,-3719,-3769,-3819,-3869,-3920,-3970,-4020,-4070,-4121,-4171,-4221,-4271,-4322,-4372,-4422,-4472,-4523,-4573,-4623,-4673,-4724,-4774,-4824,-4874,-4925,-4975,-5025,-5075,-5126,-5176,-5226,-5277,-5327,-5377,-5427,-5478,-5528,-5578,-5628,-5679,-5729,-5779,-5829,-5880,-5930,-5980,-6030,-6081,-6131,-6181,-6231,-6282,-6332,-6382,-6432,-6483,-6533,-6583,-6633,-6684,-6734,-6784,-6834,-6885,-6935,-6985,-7035,-7086,-7136,-7186,-7236,-7287,-7337,-7387,-7437,-7488,-7538,-7588,-7638,-7689,-7739,-7789,-7839,-7889,-7940,-7990,-8040,-8090,-8141,-8191,-8241,-8291,-8342,-8392,-8442,-8492,-8543,-8593,-8643,-8693,-8744,-8794,-8844,-8894,-8945,-8995,-9045,-9095,-9145,-9196,-9246,-9296,-9346,-9397,-9447,-9497,-9547,-9598,-9648,-9698,-9748,-9798,-9849,-9899,-9949,-9999,-10050,-10100,-10150,-10200,-10251,-10301,-10351,-10401,-10451,-10502,-10552,-10602,-10652,-10703,-10753,-10803,-10853,-10903,-10954,-11004,-11054,-11104,-11155,-11205,-11255,-11305,-11355,-11406,-11456,-11506,-11556,-11607,-11657,-11707,-11757,-11807,-11858,-11908,-11958,-12008,-12058,-12109,-12159,-12209,-12259,-12310,-12360,-12410,-12460,-12510,-12561,-12611,-12661,-12711,-12761,-12812,-12862,-12912,-12962,-13012,-13063,-13113,-13163,-13213,-13263,-13314,-13364,-13414,-13464,-13514,-13565,-13615,-13665,-13715,-13765,-13816,-13866,-13916,-13966,-14016,-14067,-14117,-14167,-14217,-14267,-14318,-14368,-14418,-14468,-14518,-14568,-14619,-14669,-14719,-14769,-14819,-14870,-14920,-14970,-15020,-15070,-15121,-15171,-15221,-15271,-15321,-15371,-15422,-15472,-15522,-15572,-15622,-15672,-15723,-15773,-15823,-15873,-15923,-15974,-16024,-16074,-16124,-16174,-16224,-16275,-16325,-16375,-16425,-16475,-16525,-16576,-16626,-16676,-16726,-16776,-16826,-16877,-16927,-16977,-17027,-17077,-17127,-17177,-17228,-17278,-17328,-17378,-17428,-17478,-17529,-17579,-17629,-17679,-17729,-17779,-17829,-17880,-17930,-17980,-18030,-18080,-18130,-18180,-18231,-18281,-18331,-18381,-18431,-18481,-18531,-18582,-18632,-18682,-18732,-18782,-18832,-18882,-18933,-18983,-19033,-19083,-19133,-19183,-19233,-19284,-19334,-19384,-19434,-19484,-19534,-19584,-19634,-19685,-19735,-19785,-19835,-19885,-19935,-19985,-20035,-20085,-20136,-20186,-20236,-20286,-20336,-20386,-20436,-20486,-20537,-20587,-20637,-20687,-20737,-20787,-20837,-20887,-20937,-20987,-21038,-21088,-21138,-21188,-21238,-21288,-21338,-21388,-21438,-21488,-21539,-21589,-21639,-21689,-21739,-21789,-21839,-21889,-21939,-21989,-22039,-22090,-22140,-22190,-22240,-22290,-22340,-22390,-22440,-22490,-22540,-22590,-22640,-22691,-22741,-22791,-22841,-22891,-22941,-22991,-23041,-23091,-23141,-23191,-23241,-23291,-23341,-23392,-23442,-23492,-23542,-23592,-23642,-23692,-23742,-23792,-23842,-23892,-23942,-23992,-24042,-24092,-24142,-24192,-24243,-24293,-24343,-24393,-24443,-24493,-24543,-24593,-24643,-24693,-24743,-24793,-24843,-24893,-24943,-24993,-25043,-25093,-25143,-25193,-25243,-25293,-25343,-25393,-25443,-25494,-25544,-25594,-25644,-25694,-25744,-25794,-25844,-25894,-25944,-25994,-26044,-26094,-26144,-26194,-26244,-26294,-26344,-26394,-26444,-26494,-26544,-26594,-26644,-26694,-26744,-26794,-26844,-26894,-26944,-26994,-27044,-27094,-27144,-27194,-27244,-27294,-27344,-27394,-27444,-27494,-27544,-27594,-27644,-27694,-27744,-27794,-27844,-27894,-27944,-27994,-28044,-28094,-28144,-28194,-28244,-28294,-28343,-28393,-28443,-28493,-28543,-28593,-28643,-28693,-28743,-28793,-28843,-28893,-28943,-28993,-29043,-29093,-29143,-29193,-29243,-29293,-29343,-29393,-29443,-29493,-29542,-29592,-29642,-29692,-29742,-29792,-29842,-29892,-29942,-29992,-30042,-30092,-30142,-30192,-30242,-30292,-30341,-30391,-30441,-30491,-30541,-30591,-30641,-30691,-30741,-30791,-30841,-30891,-30941,-30990,-31040,-31090,-31140,-31190,-31240,-31290,-31340,-31390,-31440,-31489,-31539,-31589,-31639,-31689,-31739,-31789,-31839,-31889,-31939,-31988,-32038,-32088,-32138,-32188,-32238,-32288,-32338,-32388,-32437,-32487,-32537,-32587,-32637,-32687,-32737,-32787,-32836,-32886,-32936,-32986,-33036,-33086,-33136,-33185,-33235,-33285,-33335,-33385,-33435,-33485,-33534,-33584,-33634,-33684,-33734,-33784,-33834,-33883,-33933,-33983,-34033,-34083,-34133,-34182,-34232,-34282,-34332,-34382,-34432,-34481,-34531,-34581,-34631,-34681,-34731,-34780,-34830,-34880,-34930,-34980,-35029,-35079,-35129,-35179,-35229,-35279,-35328,-35378,-35428,-35478,-35528,-35577,-35627,-35677,-35727,-35777,-35826,-35876,-35926,-35976,-36026,-36075,-36125,-36175,-36225,-36274,-36324,-36374,-36424,-36474,-36523,-36573,-36623,-36673,-36722,-36772,-36822,-36872,-36921,-36971,-37021,-37071,-37121,-37170,-37220,-37270,-37320,-37369,-37419,-37469,-37519,-37568,-37618,-37668,-37718,-37767,-37817,-37867,-37916,-37966,-38016,-38066,-38115,-38165,-38215,-38265,-38314,-38364,-38414,-38464,-38513,-38563,-38613,-38662,-38712,-38762,-38812,-38861,-38911,-38961,-39010,-39060,-39110,-39159,-39209,-39259,-39309,-39358,-39408,-39458,-39507,-39557,-39607,-39656,-39706,-39756,-39805,-39855,-39905,-39955,-40004,-40054,-40104,-40153,-40203,-40253,-40302,-40352,-40402,-40451,-40501,-40551,-40600,-40650,-40700,-40749,-40799,-40848,-40898,-40948,-40997,-41047,-41097,-41146,-41196,-41246,-41295,-41345,-41395,-41444,-41494,-41543,-41593,-41643,-41692,-41742,-41792,-41841,-41891,-41940,-41990,-42040,-42089,-42139,-42189,-42238,-42288,-42337,-42387,-42437,-42486,-42536,-42585,-42635,-42685,-42734,-42784,-42833,-42883,-42932,-42982,-43032,-43081,-43131,-43180,-43230,-43280,-43329,-43379,-43428,-43478,-43527,-43577,-43627,-43676,-43726,-43775,-43825,-43874,-43924,-43973,-44023,-44073,-44122,-44172,-44221,-44271,-44320,-44370,-44419,-44469,-44518,-44568,-44618,-44667,-44717,-44766,-44816,-44865,-44915,-44964,-45014,-45063,-45113,-45162,-45212,-45261,-45311,-45360,-45410,-45459,-45509,-45558,-45608,-45657,-45707,-45756,-45806,-45855,-45905,-45954,-46004,-46053,-46103,-46152,-46202,-46251,-46301,-46350,-46400,-46449,-46499,-46548,-46597,-46647,-46696,-46746,-46795,-46845,-46894,-46944,-46993,-47043,-47092,-47141,-47191,-47240,-47290,-47339,-47389,-47438,-47488,-47537,-47586,-47636,-47685,-47735,-47784,-47834,-47883,-47932,-47982,-48031,-48081,-48130,-48179,-48229,-48278,-48328,-48377,-48426,-48476,-48525,-48575,-48624,-48673,-48723,-48772,-48822,-48871,-48920,-48970,-49019,-49069,-49118,-49167,-49217,-49266,-49315,-49365,-49414,-49463,-49513,-49562,-49612,-49661,-49710,-49760,-49809,-49858,-49908,-49957,-50006,-50056,-50105,-50154,-50204,-50253,-50302,-50352,-50401,-50450,-50500,-50549,-50598,-50648,-50697,-50746,-50796,-50845,-50894,-50944,-50993,-51042,-51091,-51141,-51190,-51239,-51289,-51338,-51387,-51437,-51486,-51535,-51584,-51634,-51683,-51732,-51781,-51831,-51880,-51929,-51979,-52028,-52077,-52126,-52176,-52225,-52274,-52323,-52373,-52422,-52471,-52520,-52570,-52619,-52668,-52717,-52767,-52816,-52865,-52914,-52964,-53013,-53062,-53111,-53160,-53210,-53259,-53308,-53357,-53407,-53456,-53505,-53554,-53603,-53653,-53702,-53751,-53800,-53849,-53899,-53948,-53997,-54046,-54095,-54144,-54194,-54243,-54292,-54341,-54390,-54440,-54489,-54538,-54587,-54636,-54685,-54735,-54784,-54833,-54882,-54931,-54980,-55029,-55079,-55128,-55177,-55226,-55275,-55324,-55373,-55423,-55472,-55521,-55570,-55619,-55668,-55717,-55766,-55815,-55865,-55914,-55963,-56012,-56061,-56110,-56159,-56208,-56257,-56307,-56356,-56405,-56454,-56503,-56552,-56601,-56650,-56699,-56748,-56797,-56846,-56895,-56945,-56994,-57043,-57092,-57141,-57190,-57239,-57288,-57337,-57386,-57435,-57484,-57533,-57582,-57631,-57680,-57729,-57778,-57827,-57876,-57925,-57974,-58023,-58072,-58121,-58170,-58220,-58269,-58318,-58367,-58416,-58465,-58514,-58563,-58612,-58661,-58710,-58758,-58807,-58856,-58905,-58954,-59003,-59052,-59101,-59150,-59199,-59248,-59297,-59346,-59395,-59444,-59493,-59542,-59591,-59640,-59689,-59738,-59787,-59836,-59885,-59934,-59982,-60031,-60080,-60129,-60178,-60227,-60276,-60325,-60374,-60423,-60472,-60521,-60569,-60618,-60667,-60716,-60765,-60814,-60863,-60912,-60961,-61010,-61058,-61107,-61156,-61205,-61254,-61303,-61352,-61401,-61449,-61498,-61547,-61596,-61645,-61694,-61743,-61791,-61840,-61889,-61938,-61987,-62036,-62084,-62133,-62182,-62231,-62280,-62329,-62377,-62426,-62475,-62524,-62573,-62622,-62670,-62719,-62768,-62817,-62866,-62914,-62963,-63012,-63061,-63110,-63158,-63207,-63256,-63305,-63353,-63402,-63451,-63500,-63549,-63597,-63646,-63695,-63744,-63792,-63841,-63890,-63939,-63987,-64036,-64085,-64134,-64182,-64231,-64280,-64328,-64377,-64426,-64475,-64523,-64572,-64621,-64670,-64718,-64767,-64816,-64864,-64913,-64962,-65010,-65059,-65108,-65157,-65205,-65254,-65303,-65351,-65400,-65449,-65497,-65546,-65595,-65643,-65692,-65741,-65789,-65838,-65887,-65935,-65984,-66033,-66081,-66130,-66178,-66227,-66276,-66324,-66373,-66422,-66470,-66519,-66567,-66616,-66665,-66713,-66762,-66811,-66859,-66908,-66956,-67005,-67054,-67102,-67151,-67199,-67248,-67296,-67345,-67394,-67442,-67491,-67539,-67588,-67636,-67685,-67734,-67782,-67831,-67879,-67928,-67976,-68025,-68073,-68122,-68170,-68219,-68268,-68316,-68365,-68413,-68462,-68510,-68559,-68607,-68656,-68704,-68753,-68801,-68850,-68898,-68947,-68995,-69044,-69092,-69141,-69189,-69238,-69286,-69335,-69383,-69432,-69480,-69529,-69577,-69625,-69674,-69722,-69771,-69819,-69868,-69916,-69965,-70013,-70061,-70110,-70158,-70207,-70255,-70304,-70352,-70400,-70449,-70497,-70546,-70594,-70643,-70691,-70739,-70788,-70836,-70885,-70933,-70981,-71030,-71078,-71126,-71175,-71223,-71272,-71320,-71368,-71417,-71465,-71513,-71562,-71610,-71658,-71707,-71755,-71804,-71852,-71900,-71949,-71997,-72045,-72094,-72142,-72190,-72238,-72287,-72335,-72383,-72432,-72480,-72528,-72577,-72625,-72673,-72722,-72770,-72818,-72866,-72915,-72963,-73011,-73060,-73108,-73156,-73204,-73253,-73301,-73349,-73397,-73446,-73494,-73542,-73590,-73639,-73687,-73735,-73783,-73832,-73880,-73928,-73976,-74024,-74073,-74121,-74169,-74217,-74266,-74314,-74362,-74410,-74458,-74507,-74555,-74603,-74651,-74699,-74747,-74796,-74844,-74892,-74940,-74988,-75036,-75085,-75133,-75181,-75229,-75277,-75325,-75374,-75422,-75470,-75518,-75566,-75614,-75662,-75710,-75759,-75807,-75855,-75903,-75951,-75999,-76047,-76095,-76143,-76192,-76240,-76288,-76336,-76384,-76432,-76480,-76528,-76576,-76624,-76672,-76720,-76769,-76817,-76865,-76913,-76961,-77009,-77057,-77105,-77153,-77201,-77249,-77297,-77345,-77393,-77441,-77489,-77537,-77585,-77633,-77681,-77729,-77777,-77825,-77873,-77921,-77969,-78017,-78065,-78113,-78161,-78209,-78257,-78305,-78353,-78401,-78449,-78497,-78545,-78593,-78641,-78689,-78737,-78785,-78833,-78880,-78928,-78976,-79024,-79072,-79120,-79168,-79216,-79264,-79312,-79360,-79408,-79456,-79503,-79551,-79599,-79647,-79695,-79743,-79791,-79839,-79886,-79934,-79982,-80030,-80078,-80126,-80174,-80222,-80269,-80317,-80365,-80413,-80461,-80509,-80556,-80604,-80652,-80700,-80748,-80796,-80843,-80891,-80939,-80987,-81035,-81082,-81130,-81178,-81226,-81274,-81321,-81369,-81417,-81465,-81513,-81560,-81608,-81656,-81704,-81751,-81799,-81847,-81895,-81942,-81990,-82038,-82086,-82133,-82181,-82229,-82277,-82324,-82372,-82420,-82467,-82515,-82563,-82611,-82658,-82706,-82754,-82801,-82849,-82897,-82944,-82992,-83040,-83087,-83135,-83183,-83230,-83278,-83326,-83373,-83421,-83469,-83516,-83564,-83612,-83659,-83707,-83755,-83802,-83850,-83897,-83945,-83993,-84040,-84088,-84135,-84183,-84231,-84278,-84326,-84373,-84421,-84469,-84516,-84564,-84611,-84659,-84707,-84754,-84802,-84849,-84897,-84944,-84992,-85039,-85087,-85135,-85182,-85230,-85277,-85325,-85372,-85420,-85467,-85515,-85562,-85610,-85657,-85705,-85752,-85800,-85847,-85895,-85942,-85990,-86037,-86085,-86132,-86180,-86227,-86275,-86322,-86370,-86417,-86464,-86512,-86559,-86607,-86654,-86702,-86749,-86797,-86844,-86891,-86939,-86986,-87034,-87081,-87128,-87176,-87223,-87271,-87318,-87365,-87413,-87460,-87508,-87555,-87602,-87650,-87697,-87744,-87792,-87839,-87887,-87934,-87981,-88029,-88076,-88123,-88171,-88218,-88265,-88313,-88360,-88407,-88455,-88502,-88549,-88597,-88644,-88691,-88738,-88786,-88833,-88880,-88928,-88975,-89022,-89069,-89117,-89164,-89211,-89259,-89306,-89353,-89400,-89448,-89495,-89542,-89589,-89637,-89684,-89731,-89778,-89825,-89873,-89920,-89967,-90014,-90062,-90109,-90156,-90203,-90250,-90298,-90345,-90392,-90439,-90486,-90533,-90581,-90628,-90675,-90722,-90769,-90816,-90864,-90911,-90958,-91005,-91052,-91099,-91146,-91194,-91241,-91288,-91335,-91382,-91429,-91476,-91523,-91570,-91618,-91665,-91712,-91759,-91806,-91853,-91900,-91947,-91994,-92041,-92088,-92135,-92182,-92229,-92277,-92324,-92371,-92418,-92465,-92512,-92559,-92606,-92653,-92700,-92747,-92794,-92841,-92888,-92935,-92982,-93029,-93076,-93123,-93170,-93217,-93264,-93311,-93358,-93405,-93452,-93499,-93546,-93593,-93639,-93686,-93733,-93780,-93827,-93874,-93921,-93968,-94015,-94062,-94109,-94156,-94203,-94250,-94296,-94343,-94390,-94437,-94484,-94531,-94578,-94625,-94672,-94718,-94765,-94812,-94859,-94906,-94953,-95000,-95046,-95093,-95140,-95187,-95234,-95281,-95327,-95374,-95421,-95468,-95515,-95561,-95608,-95655,-95702,-95749,-95795,-95842,-95889,-95936,-95983,-96029,-96076,-96123,-96170,-96216,-96263,-96310,-96357,-96403,-96450,-96497,-96544,-96590,-96637,-96684,-96731,-96777,-96824,-96871,-96917,-96964,-97011,-97057,-97104,-97151,-97198,-97244,-97291,-97338,-97384,-97431,-97478,-97524,-97571,-97618,-97664,-97711,-97757,-97804,-97851,-97897,-97944,-97991,-98037,-98084,-98130,-98177,-98224,-98270,-98317,-98363,-98410,-98457,-98503,-98550,-98596,-98643,-98690,-98736,-98783,-98829,-98876,-98922,-98969,-99015,-99062,-99109,-99155,-99202,-99248,-99295,-99341,-99388,-99434,-99481,-99527,-99574,-99620,-99667,-99713,-99760,-99806,-99853,-99899,-99946,-99992,-100038,-100085,-100131,-100178,-100224,-100271,-100317,-100364,-100410,-100456,-100503,-100549,-100596,-100642,-100689,-100735,-100781,-100828,-100874,-100921,-100967,-101013,-101060,-101106,-101152,-101199,-101245,-101292,-101338,-101384,-101431,-101477,-101523,-101570,-101616,-101662,-101709,-101755,-101801,-101848,-101894,-101940,-101987,-102033,-102079,-102125,-102172,-102218,-102264,-102311,-102357,-102403,-102449,-102496,-102542,-102588,-102634,-102681,-102727,-102773,-102819,-102866,-102912,-102958,-103004,-103051,-103097,-103143,-103189,-103235,-103282,-103328,-103374,-103420,-103466,-103513,-103559,-103605,-103651,-103697,-103743,-103790,-103836,-103882,-103928,-103974,-104020,-104066,-104113,-104159,-104205,-104251,-104297,-104343,-104389,-104435,-104482,-104528,-104574,-104620,-104666,-104712,-104758,-104804,-104850,-104896,-104942,-104988,-105034,-105081,-105127,-105173,-105219,-105265,-105311,-105357,-105403,-105449,-105495,-105541,-105587,-105633,-105679,-105725,-105771,-105817,-105863,-105909,-105955,-106001,-106047,-106093,-106139,-106185,-106231,-106277,-106322,-106368,-106414,-106460,-106506,-106552,-106598,-106644,-106690,-106736,-106782,-106828,-106874,-106919,-106965,-107011,-107057,-107103,-107149,-107195,-107241,-107286,-107332,-107378,-107424,-107470,-107516,-107562,-107607,-107653,-107699,-107745,-107791,-107837,-107882,-107928,-107974,-108020,-108066,-108111,-108157,-108203,-108249,-108294,-108340,-108386,-108432,-108478,-108523,-108569,-108615,-108661,-108706,-108752,-108798,-108844,-108889,-108935,-108981,-109026,-109072,-109118,-109164,-109209,-109255,-109301,-109346,-109392,-109438,-109483,-109529,-109575,-109620,-109666,-109712,-109757,-109803,-109849,-109894,-109940,-109985,-110031,-110077,-110122,-110168,-110214,-110259,-110305,-110350,-110396,-110442,-110487,-110533,-110578,-110624,-110669,-110715,-110761,-110806,-110852,-110897,-110943,-110988,-111034,-111079,-111125,-111170,-111216,-111261,-111307,-111352,-111398,-111443,-111489,-111534,-111580,-111625,-111671,-111716,-111762,-111807,-111853,-111898,-111944,-111989,-112035,-112080,-112125,-112171,-112216,-112262,-112307,-112353,-112398,-112443,-112489,-112534,-112580,-112625,-112670,-112716,-112761,-112807,-112852,-112897,-112943,-112988,-113033,-113079,-113124,-113169,-113215,-113260,-113305,-113351,-113396,-113441,-113487,-113532,-113577,-113623,-113668,-113713,-113758,-113804,-113849,-113894,-113940,-113985,-114030,-114075,-114121,-114166,-114211,-114256,-114302,-114347,-114392,-114437,-114482,-114528,-114573,-114618,-114663,-114709,-114754,-114799,-114844,-114889,-114934,-114980,-115025,-115070,-115115,-115160,-115205,-115251,-115296,-115341,-115386,-115431,-115476,-115521,-115566,-115612,-115657,-115702,-115747,-115792,-115837,-115882,-115927,-115972,-116017,-116063,-116108,-116153,-116198,-116243,-116288,-116333,-116378,-116423,-116468,-116513,-116558,-116603,-116648,-116693,-116738,-116783,-116828,-116873,-116918,-116963,-117008,-117053,-117098,-117143,-117188,-117233,-117278,-117323,-117368,-117413,-117458,-117503,-117548,-117592,-117637,-117682,-117727,-117772,-117817,-117862,-117907,-117952,-117997,-118041,-118086,-118131,-118176,-118221,-118266,-118311,-118356,-118400,-118445,-118490,-118535,-118580,-118625,-118669,-118714,-118759,-118804,-118849,-118893,-118938,-118983,-119028,-119073,-119117,-119162,-119207,-119252,-119296,-119341,-119386,-119431,-119475,-119520,-119565,-119610,-119654,-119699,-119744,-119789,-119833,-119878,-119923,-119967,-120012,-120057,-120101,-120146,-120191,-120235,-120280,-120325,-120369,-120414,-120459,-120503,-120548,-120593,-120637,-120682,-120726,-120771,-120816,-120860,-120905,-120949,-120994,-121039,-121083,-121128,-121172,-121217,-121262,-121306,-121351,-121395,-121440,-121484,-121529,-121573,-121618,-121662,-121707,-121751,-121796,-121841,-121885,-121930,-121974,-122018,-122063,-122107,-122152,-122196,-122241,-122285,-122330,-122374,-122419,-122463,-122508,-122552,-122596,-122641,-122685,-122730,-122774,-122819,-122863,-122907,-122952,-122996,-123041,-123085,-123129,-123174,-123218,-123262,-123307,-123351,-123395,-123440,-123484,-123528,-123573,-123617,-123661,-123706,-123750,-123794,-123839,-123883,-123927,-123972,-124016,-124060,-124104,-124149,-124193,-124237,-124282,-124326,-124370,-124414,-124459,-124503,-124547,-124591,-124635,-124680,-124724,-124768,-124812,-124856,-124901,-124945,-124989,-125033,-125077,-125122,-125166,-125210,-125254,-125298,-125342,-125387,-125431,-125475,-125519,-125563,-125607,-125651,-125695,-125740,-125784,-125828,-125872,-125916,-125960,-126004,-126048,-126092,-126136,-126180,-126224,-126268,-126313,-126357,-126401,-126445,-126489,-126533,-126577,-126621,-126665,-126709,-126753,-126797,-126841,-126885,-126929,-126973,-127017,-127061,-127105,-127149,-127192,-127236,-127280,-127324,-127368,-127412,-127456,-127500,-127544,-127588,-127632,-127676,-127720,-127763,-127807,-127851,-127895,-127939,-127983,-128027,-128071,-128114,-128158,-128202,-128246,-128290,-128334,-128377,-128421,-128465,-128509,-128553,-128597,-128640,-128684,-128728,-128772,-128815,-128859,-128903,-128947,-128991,-129034,-129078,-129122,-129166,-129209,-129253,-129297,-129340,-129384,-129428,-129472,-129515,-129559,-129603,-129646,-129690,-129734,-129777,-129821,-129865,-129908,-129952,-129996,-130039,-130083,-130127,-130170,-130214,-130258,-130301,-130345,-130388,-130432,-130476,-130519,-130563,-130606,-130650,-130694,-130737,-130781,-130824,-130868,-130911,-130955,-130998,-131042,-131086,-131129,-131173,-131216,-131260,-131303,-131347,-131390,-131434,-131477,-131521,-131564,-131608,-131651,-131694,-131738,-131781,-131825,-131868,-131912,-131955,-131999,-132042,-132085,-132129,-132172,-132216,-132259,-132302,-132346,-132389,-132433,-132476,-132519,-132563,-132606,-132649,-132693,-132736,-132779,-132823,-132866,-132909,-132953,-132996,-133039,-133083,-133126,-133169,-133213,-133256,-133299,-133342,-133386,-133429,-133472,-133516,-133559,-133602,-133645,-133689,-133732,-133775,-133818,-133861,-133905,-133948,-133991,-134034,-134077,-134121,-134164,-134207,-134250,-134293,-134337,-134380,-134423,-134466,-134509,-134552,-134595,-134639,-134682,-134725,-134768,-134811,-134854,-134897,-134940,-134983,-135027,-135070,-135113,-135156,-135199,-135242,-135285,-135328,-135371,-135414,-135457,-135500,-135543,-135586,-135629,-135672,-135715,-135758,-135801,-135844,-135887,-135930,-135973,-136016,-136059,-136102,-136145,-136188,-136231,-136274,-136317,-136360,-136403,-136446,-136489,-136531,-136574,-136617,-136660,-136703,-136746,-136789,-136832,-136875,-136917,-136960,-137003,-137046,-137089,-137132,-137175,-137217,-137260,-137303,-137346,-137389,-137431,-137474,-137517,-137560,-137603,-137645,-137688,-137731,-137774,-137816,-137859,-137902,-137945,-137987,-138030,-138073,-138116,-138158,-138201,-138244,-138287,-138329,-138372,-138415,-138457,-138500,-138543,-138585,-138628,-138671,-138713,-138756,-138799,-138841,-138884,-138926,-138969,-139012,-139054,-139097,-139140,-139182,-139225,-139267,-139310,-139352,-139395,-139438,-139480,-139523,-139565,-139608,-139650,-139693,-139735,-139778,-139820,-139863,-139906,-139948,-139991,-140033,-140076,-140118,-140160,-140203,-140245,-140288,-140330,-140373,-140415,-140458,-140500,-140543,-140585,-140627,-140670,-140712,-140755,-140797,-140839,-140882,-140924,-140967,-141009,-141051,-141094,-141136,-141178,-141221,-141263,-141305,-141348,-141390,-141432,-141475,-141517,-141559,-141602,-141644,-141686,-141729,-141771,-141813,-141855,-141898,-141940,-141982,-142024,-142067,-142109,-142151,-142193,-142236,-142278,-142320,-142362,-142404,-142447,-142489,-142531,-142573,-142615,-142658,-142700,-142742,-142784,-142826,-142868,-142911,-142953,-142995,-143037,-143079,-143121,-143163,-143205,-143247,-143290,-143332,-143374,-143416,-143458,-143500,-143542,-143584,-143626,-143668,-143710,-143752,-143794,-143836,-143878,-143920,-143962,-144004,-144046,-144088,-144130,-144172,-144214,-144256,-144298,-144340,-144382,-144424,-144466,-144508,-144550,-144592,-144634,-144676,-144718,-144760,-144801,-144843,-144885,-144927,-144969,-145011,-145053,-145095,-145136,-145178,-145220,-145262,-145304,-145346,-145388,-145429,-145471,-145513,-145555,-145597,-145638,-145680,-145722,-145764,-145806,-145847,-145889,-145931,-145973,-146014,-146056,-146098,-146140,-146181,-146223,-146265,-146306,-146348,-146390,-146432,-146473,-146515,-146557,-146598,-146640,-146682,-146723,-146765,-146807,-146848,-146890,-146931,-146973,-147015,-147056,-147098,-147140,-147181,-147223,-147264,-147306,-147347,-147389,-147431,-147472,-147514,-147555,-147597,-147638,-147680,-147721,-147763,-147804,-147846,-147887,-147929,-147970,-148012,-148053,-148095,-148136,-148178,-148219,-148261,-148302,-148344,-148385,-148427,-148468,-148509,-148551,-148592,-148634,-148675,-148716,-148758,-148799,-148841,-148882,-148923,-148965,-149006,-149047,-149089,-149130,-149171,-149213,-149254,-149295,-149337,-149378,-149419,-149461,-149502,-149543,-149584,-149626,-149667,-149708,-149750,-149791,-149832,-149873,-149915,-149956,-149997,-150038,-150079,-150121,-150162,-150203,-150244,-150285,-150327,-150368,-150409,-150450,-150491,-150532,-150574,-150615,-150656,-150697,-150738,-150779,-150820,-150861,-150903,-150944,-150985,-151026,-151067,-151108,-151149,-151190,-151231,-151272,-151313,-151354,-151395,-151436,-151477,-151518,-151559,-151600,-151641,-151682,-151723,-151764,-151805,-151846,-151887,-151928,-151969,-152010,-152051,-152092,-152133,-152174,-152215,-152256,-152297,-152338,-152379,-152420,-152460,-152501,-152542,-152583,-152624,-152665,-152706,-152747,-152787,-152828,-152869,-152910,-152951,-152992,-153032,-153073,-153114,-153155,-153196,-153236,-153277,-153318,-153359,-153399,-153440,-153481,-153522,-153562,-153603,-153644,-153685,-153725,-153766,-153807,-153847,-153888,-153929,-153969,-154010,-154051,-154092,-154132,-154173,-154213,-154254,-154295,-154335,-154376,-154417,-154457,-154498,-154538,-154579,-154620,-154660,-154701,-154741,-154782,-154823,-154863,-154904,-154944,-154985,-155025,-155066,-155106,-155147,-155187,-155228,-155268,-155309,-155349,-155390,-155430,-155471,-155511,-155552,-155592,-155633,-155673,-155714,-155754,-155794,-155835,-155875,-155916,-155956,-155996,-156037,-156077,-156118,-156158,-156198,-156239,-156279,-156319,-156360,-156400,-156440,-156481,-156521,-156561,-156602,-156642,-156682,-156723,-156763,-156803,-156844,-156884,-156924,-156964,-157005,-157045,-157085,-157125,-157166,-157206,-157246,-157286,-157326,-157367,-157407,-157447,-157487,-157527,-157568,-157608,-157648,-157688,-157728,-157768,-157808,-157849,-157889,-157929,-157969,-158009,-158049,-158089,-158129,-158169,-158210,-158250,-158290,-158330,-158370,-158410,-158450,-158490,-158530,-158570,-158610,-158650,-158690,-158730,-158770,-158810,-158850,-158890,-158930,-158970,-159010,-159050,-159090,-159130,-159170,-159210,-159250,-159290,-159329,-159369,-159409,-159449,-159489,-159529,-159569,-159609,-159649,-159688,-159728,-159768,-159808,-159848,-159888,-159928,-159967,-160007,-160047,-160087,-160127,-160166,-160206,-160246,-160286,-160326,-160365,-160405,-160445,-160485,-160524,-160564,-160604,-160643,-160683,-160723,-160763,-160802,-160842,-160882,-160921,-160961,-161001,-161040,-161080,-161120,-161159,-161199,-161239,-161278,-161318,-161358,-161397,-161437,-161476,-161516,-161556,-161595,-161635,-161674,-161714,-161753,-161793,-161832,-161872,-161912,-161951,-161991,-162030,-162070,-162109,-162149,-162188,-162228,-162267,-162307,-162346,-162385,-162425,-162464,-162504,-162543,-162583,-162622,-162662,-162701,-162740,-162780,-162819,-162859,-162898,-162937,-162977,-163016,-163055,-163095,-163134,-163173,-163213,-163252,-163291,-163331,-163370,-163409,-163449,-163488,-163527,-163567,-163606,-163645,-163684,-163724,-163763,-163802,-163841,-163881,-163920,-163959,-163998,-164038,-164077,-164116,-164155,-164194,-164233,-164273,-164312,-164351,-164390,-164429,-164468,-164508,-164547,-164586,-164625,-164664,-164703,-164742,-164781,-164820,-164860,-164899,-164938,-164977,-165016,-165055,-165094,-165133,-165172,-165211,-165250,-165289,-165328,-165367,-165406,-165445,-165484,-165523,-165562,-165601,-165640,-165679,-165718,-165757,-165796,-165835,-165874,-165913,-165951,-165990,-166029,-166068,-166107,-166146,-166185,-166224,-166263,-166301,-166340,-166379,-166418,-166457,-166496,-166534,-166573,-166612,-166651,-166690,-166728,-166767,-166806,-166845,-166884,-166922,-166961,-167000,-167039,-167077,-167116,-167155,-167193,-167232,-167271,-167310,-167348,-167387,-167426,-167464,-167503,-167542,-167580,-167619,-167658,-167696,-167735,-167773,-167812,-167851,-167889,-167928,-167967,-168005,-168044,-168082,-168121,-168159,-168198,-168237,-168275,-168314,-168352,-168391,-168429,-168468,-168506,-168545,-168583,-168622,-168660,-168699,-168737,-168776,-168814,-168852,-168891,-168929,-168968,-169006,-169045,-169083,-169121,-169160,-169198,-169237,-169275,-169313,-169352,-169390,-169429,-169467,-169505,-169544,-169582,-169620,-169659,-169697,-169735,-169773,-169812,-169850,-169888,-169927,-169965,-170003,-170041,-170080,-170118,-170156,-170194,-170233,-170271,-170309,-170347,-170385,-170424,-170462,-170500,-170538,-170576,-170615,-170653,-170691,-170729,-170767,-170805,-170843,-170882,-170920,-170958,-170996,-171034,-171072,-171110,-171148,-171186,-171224,-171262,-171300,-171338,-171377,-171415,-171453,-171491,-171529,-171567,-171605,-171643,-171681,-171719,-171757,-171795,-171833,-171870,-171908,-171946,-171984,-172022,-172060,-172098,-172136,-172174,-172212,-172250,-172288,-172325,-172363,-172401,-172439,-172477,-172515,-172553,-172590,-172628,-172666,-172704,-172742,-172780,-172817,-172855,-172893,-172931,-172968,-173006,-173044,-173082,-173120,-173157,-173195,-173233,-173270,-173308,-173346,-173384,-173421,-173459,-173497,-173534,-173572,-173610,-173647,-173685,-173723,-173760,-173798,-173836,-173873,-173911,-173948,-173986,-174024,-174061,-174099,-174136,-174174,-174211,-174249,-174287,-174324,-174362,-174399,-174437,-174474,-174512,-174549,-174587,-174624,-174662,-174699,-174737,-174774,-174812,-174849,-174886,-174924,-174961,-174999,-175036,-175074,-175111,-175148,-175186,-175223,-175261,-175298,-175335,-175373,-175410,-175447,-175485,-175522,-175559,-175597,-175634,-175671,-175709,-175746,-175783,-175821,-175858,-175895,-175932,-175970,-176007,-176044,-176081,-176119,-176156,-176193,-176230,-176267,-176305,-176342,-176379,-176416,-176453,-176491,-176528,-176565,-176602,-176639,-176676,-176713,-176751,-176788,-176825,-176862,-176899,-176936,-176973,-177010,-177047,-177084,-177122,-177159,-177196,-177233,-177270,-177307,-177344,-177381,-177418,-177455,-177492,-177529,-177566,-177603,-177640,-177677,-177714,-177751,-177787,-177824,-177861,-177898,-177935,-177972,-178009,-178046,-178083,-178120,-178157,-178193,-178230,-178267,-178304,-178341,-178378,-178414,-178451,-178488,-178525,-178562,-178599,-178635,-178672,-178709,-178746,-178782,-178819,-178856,-178893,-178929,-178966,-179003,-179040,-179076,-179113,-179150,-179186,-179223,-179260,-179296,-179333,-179370,-179406,-179443,-179480,-179516,-179553,-179590,-179626,-179663,-179699,-179736,-179773,-179809,-179846,-179882,-179919,-179955,-179992,-180028,-180065,-180102,-180138,-180175,-180211,-180248,-180284,-180321,-180357,-180394,-180430,-180466,-180503,-180539,-180576,-180612,-180649,-180685,-180722,-180758,-180794,-180831,-180867,-180903,-180940,-180976,-181013,-181049,-181085,-181122,-181158,-181194,-181231,-181267,-181303,-181340,-181376,-181412,-181448,-181485,-181521,-181557,-181593,-181630,-181666,-181702,-181738,-181775,-181811,-181847,-181883,-181919,-181956,-181992,-182028,-182064,-182100,-182136,-182173,-182209,-182245,-182281,-182317,-182353,-182389,-182425,-182462,-182498,-182534,-182570,-182606,-182642,-182678,-182714,-182750,-182786,-182822,-182858,-182894,-182930,-182966,-183002,-183038,-183074,-183110,-183146,-183182,-183218,-183254,-183290,-183326,-183362,-183398,-183434,-183469,-183505,-183541,-183577,-183613,-183649,-183685,-183721,-183756,-183792,-183828,-183864,-183900,-183936,-183971,-184007,-184043,-184079,-184115,-184150,-184186,-184222,-184258,-184293,-184329,-184365,-184401,-184436,-184472,-184508,-184544,-184579,-184615,-184651,-184686,-184722,-184758,-184793,-184829,-184865,-184900,-184936,-184971,-185007,-185043,-185078,-185114,-185149,-185185,-185221,-185256,-185292,-185327,-185363,-185398,-185434,-185469,-185505,-185540,-185576,-185611,-185647,-185682,-185718,-185753,-185789,-185824,-185860,-185895,-185931,-185966,-186001,-186037,-186072,-186108,-186143,-186178,-186214,-186249,-186285,-186320,-186355,-186391,-186426,-186461,-186497,-186532,-186567,-186603,-186638,-186673,-186709,-186744,-186779,-186814,-186850,-186885,-186920,-186955,-186991,-187026,-187061,-187096,-187131,-187167,-187202,-187237,-187272,-187307,-187342,-187378,-187413,-187448,-187483,-187518,-187553,-187588,-187624,-187659,-187694,-187729,-187764,-187799,-187834,-187869,-187904,-187939,-187974,-188009,-188044,-188079,-188114,-188149,-188184,-188219,-188254,-188289,-188324,-188359,-188394,-188429,-188464,-188499,-188534,-188569,-188604,-188639,-188674,-188708,-188743,-188778,-188813,-188848,-188883,-188918,-188953,-188987,-189022,-189057,-189092,-189127,-189161,-189196,-189231,-189266,-189301,-189335,-189370,-189405,-189440,-189474,-189509,-189544,-189579,-189613,-189648,-189683,-189717,-189752,-189787,-189821,-189856,-189891,-189925,-189960,-189995,-190029,-190064,-190098,-190133,-190168,-190202,-190237,-190271,-190306,-190341,-190375,-190410,-190444,-190479,-190513,-190548,-190582,-190617,-190651,-190686,-190720,-190755,-190789,-190824,-190858,-190893,-190927,-190962,-190996,-191030,-191065,-191099,-191134,-191168,-191202,-191237,-191271,-191306,-191340,-191374,-191409,-191443,-191477,-191512,-191546,-191580,-191615,-191649,-191683,-191717,-191752,-191786,-191820,-191855,-191889,-191923,-191957,-191991,-192026,-192060,-192094,-192128,-192163,-192197,-192231,-192265,-192299,-192333,-192368,-192402,-192436,-192470,-192504,-192538,-192572,-192606,-192640,-192675,-192709,-192743,-192777,-192811,-192845,-192879,-192913,-192947,-192981,-193015,-193049,-193083,-193117,-193151,-193185,-193219,-193253,-193287,-193321,-193355,-193389,-193423,-193457,-193491,-193524,-193558,-193592,-193626,-193660,-193694,-193728,-193762,-193795,-193829,-193863,-193897,-193931,-193965,-193998,-194032,-194066,-194100,-194134,-194167,-194201,-194235,-194269,-194302,-194336,-194370,-194404,-194437,-194471,-194505,-194538,-194572,-194606,-194639,-194673,-194707,-194740,-194774,-194808,-194841,-194875,-194909,-194942,-194976,-195009,-195043,-195077,-195110,-195144,-195177,-195211,-195244,-195278,-195311,-195345,-195378,-195412,-195445,-195479,-195512,-195546,-195579,-195613,-195646,-195680,-195713,-195747,-195780,-195814,-195847,-195880,-195914,-195947,-195981,-196014,-196047,-196081,-196114,-196147,-196181,-196214,-196247,-196281,-196314,-196347,-196381,-196414,-196447,-196480,-196514,-196547,-196580,-196614,-196647,-196680,-196713,-196746,-196780,-196813,-196846,-196879,-196912,-196946,-196979,-197012,-197045,-197078,-197111,-197145,-197178,-197211,-197244,-197277,-197310,-197343,-197376,-197409,-197442,-197475,-197509,-197542,-197575,-197608,-197641,-197674,-197707,-197740,-197773,-197806,-197839,-197872,-197905,-197938,-197971,-198003,-198036,-198069,-198102,-198135,-198168,-198201,-198234,-198267,-198300,-198333,-198365,-198398,-198431,-198464,-198497,-198530,-198562,-198595,-198628,-198661,-198694,-198726,-198759,-198792,-198825,-198857,-198890,-198923,-198956,-198988,-199021,-199054,-199087,-199119,-199152,-199185,-199217,-199250,-199283,-199315,-199348,-199381,-199413,-199446,-199478,-199511,-199544,-199576,-199609,-199641,-199674,-199707,-199739,-199772,-199804,-199837,-199869,-199902,-199934,-199967,-199999,-200032,-200064,-200097,-200129,-200162,-200194,-200227,-200259,-200291,-200324,-200356,-200389,-200421,-200453,-200486,-200518,-200551,-200583,-200615,-200648,-200680,-200712,-200745,-200777,-200809,-200842,-200874,-200906,-200939,-200971,-201003,-201035,-201068,-201100,-201132,-201164,-201197,-201229,-201261,-201293,-201325,-201358,-201390,-201422,-201454,-201486,-201518,-201551,-201583,-201615,-201647,-201679,-201711,-201743,-201775,-201807,-201840,-201872,-201904,-201936,-201968,-202000,-202032,-202064,-202096,-202128,-202160,-202192,-202224,-202256,-202288,-202320,-202352,-202384,-202416,-202448,-202480,-202511,-202543,-202575,-202607,-202639,-202671,-202703,-202735,-202767,-202798,-202830,-202862,-202894,-202926,-202958,-202989,-203021,-203053,-203085,-203117,-203148,-203180,-203212,-203244,-203275,-203307,-203339,-203371,-203402,-203434,-203466,-203497,-203529,-203561,-203592,-203624,-203656,-203687,-203719,-203751,-203782,-203814,-203845,-203877,-203909,-203940,-203972,-204003,-204035,-204066,-204098,-204130,-204161,-204193,-204224,-204256,-204287,-204319,-204350,-204382,-204413,-204445,-204476,-204507,-204539,-204570,-204602,-204633,-204665,-204696,-204727,-204759,-204790,-204822,-204853,-204884,-204916,-204947,-204978,-205010,-205041,-205072,-205104,-205135,-205166,-205197,-205229,-205260,-205291,-205323,-205354,-205385,-205416,-205447,-205479,-205510,-205541,-205572,-205603,-205635,-205666,-205697,-205728,-205759,-205790,-205822,-205853,-205884,-205915,-205946,-205977,-206008,-206039,-206070,-206101,-206132,-206164,-206195,-206226,-206257,-206288,-206319,-206350,-206381,-206412,-206443,-206474,-206505,-206536,-206566,-206597,-206628,-206659,-206690,-206721,-206752,-206783,-206814,-206845,-206876,-206906,-206937,-206968,-206999,-207030,-207061,-207091,-207122,-207153,-207184,-207215,-207245,-207276,-207307,-207338,-207369,-207399,-207430,-207461,-207491,-207522,-207553,-207584,-207614,-207645,-207676,-207706,-207737,-207768,-207798,-207829,-207860,-207890,-207921,-207951,-207982,-208013,-208043,-208074,-208104,-208135,-208165,-208196,-208227,-208257,-208288,-208318,-208349,-208379,-208410,-208440,-208471,-208501,-208532,-208562,-208592,-208623,-208653,-208684,-208714,-208745,-208775,-208805,-208836,-208866,-208896,-208927,-208957,-208988,-209018,-209048,-209079,-209109,-209139,-209169,-209200,-209230,-209260,-209291,-209321,-209351,-209381,-209412,-209442,-209472,-209502,-209533,-209563,-209593,-209623,-209653,-209683,-209714,-209744,-209774,-209804,-209834,-209864,-209894,-209925,-209955,-209985,-210015,-210045,-210075,-210105,-210135,-210165,-210195,-210225,-210255,-210285,-210315,-210345,-210375,-210405,-210435,-210465,-210495,-210525,-210555,-210585,-210615,-210645,-210675,-210705,-210735,-210764,-210794,-210824,-210854,-210884,-210914,-210944,-210973,-211003,-211033,-211063,-211093,-211123,-211152,-211182,-211212,-211242,-211271,-211301,-211331,-211361,-211390,-211420,-211450,-211480,-211509,-211539,-211569,-211598,-211628,-211658,-211687,-211717,-211747,-211776,-211806,-211835,-211865,-211895,-211924,-211954,-211983,-212013,-212042,-212072,-212102,-212131,-212161,-212190,-212220,-212249,-212279,-212308,-212338,-212367,-212397,-212426,-212455,-212485,-212514,-212544,-212573,-212603,-212632,-212661,-212691,-212720,-212750,-212779,-212808,-212838,-212867,-212896,-212926,-212955,-212984,-213014,-213043,-213072,-213101,-213131,-213160,-213189,-213218,-213248,-213277,-213306,-213335,-213365,-213394,-213423,-213452,-213481,-213510,-213540,-213569,-213598,-213627,-213656,-213685,-213714,-213744,-213773,-213802,-213831,-213860,-213889,-213918,-213947,-213976,-214005,-214034,-214063,-214092,-214121,-214150,-214179,-214208,-214237,-214266,-214295,-214324,-214353,-214382,-214411,-214440,-214469,-214497,-214526,-214555,-214584,-214613,-214642,-214671,-214700,-214728,-214757,-214786,-214815,-214844,-214872,-214901,-214930,-214959,-214988,-215016,-215045,-215074,-215103,-215131,-215160,-215189,-215217,-215246,-215275,-215303,-215332,-215361,-215389,-215418,-215447,-215475,-215504,-215533,-215561,-215590,-215618,-215647,-215676,-215704,-215733,-215761,-215790,-215818,-215847,-215875,-215904,-215932,-215961,-215989,-216018,-216046,-216075,-216103,-216132,-216160,-216189,-216217,-216245,-216274,-216302,-216331,-216359,-216387,-216416,-216444,-216472,-216501,-216529,-216557,-216586,-216614,-216642,-216671,-216699,-216727,-216756,-216784,-216812,-216840,-216869,-216897,-216925,-216953,-216981,-217010,-217038,-217066,-217094,-217122,-217151,-217179,-217207,-217235,-217263,-217291,-217319,-217347,-217376,-217404,-217432,-217460,-217488,-217516,-217544,-217572,-217600,-217628,-217656,-217684,-217712,-217740,-217768,-217796,-217824,-217852,-217880,-217908,-217936,-217964,-217992,-218020,-218048,-218075,-218103,-218131,-218159,-218187,-218215,-218243,-218270,-218298,-218326,-218354,-218382,-218410,-218437,-218465,-218493,-218521,-218548,-218576,-218604,-218632,-218659,-218687,-218715,-218743,-218770,-218798,-218826,-218853,-218881,-218909,-218936,-218964,-218992,-219019,-219047,-219074,-219102,-219130,-219157,-219185,-219212,-219240,-219267,-219295,-219323,-219350,-219378,-219405,-219433,-219460,-219488,-219515,-219543,-219570,-219597,-219625,-219652,-219680,-219707,-219735,-219762,-219789,-219817,-219844,-219872,-219899,-219926,-219954,-219981,-220008,-220036,-220063,-220090,-220118,-220145,-220172,-220199,-220227,-220254,-220281,-220308,-220336,-220363,-220390,-220417,-220445,-220472,-220499,-220526,-220553,-220580,-220608,-220635,-220662,-220689,-220716,-220743,-220770,-220797,-220825,-220852,-220879,-220906,-220933,-220960,-220987,-221014,-221041,-221068,-221095,-221122,-221149,-221176,-221203,-221230,-221257,-221284,-221311,-221338,-221365,-221392,-221418,-221445,-221472,-221499,-221526,-221553,-221580,-221607,-221633,-221660,-221687,-221714,-221741,-221768,-221794,-221821,-221848,-221875,-221902,-221928,-221955,-221982,-222009,-222035,-222062,-222089,-222115,-222142,-222169,-222195,-222222,-222249,-222275,-222302,-222329,-222355,-222382,-222409,-222435,-222462,-222488,-222515,-222541,-222568,-222595,-222621,-222648,-222674,-222701,-222727,-222754,-222780,-222807,-222833,-222860,-222886,-222913,-222939,-222965,-222992,-223018,-223045,-223071,-223098,-223124,-223150,-223177,-223203,-223229,-223256,-223282,-223308,-223335,-223361,-223387,-223414,-223440,-223466,-223492,-223519,-223545,-223571,-223598,-223624,-223650,-223676,-223702,-223729,-223755,-223781,-223807,-223833,-223859,-223886,-223912,-223938,-223964,-223990,-224016,-224042,-224068,-224095,-224121,-224147,-224173,-224199,-224225,-224251,-224277,-224303,-224329,-224355,-224381,-224407,-224433,-224459,-224485,-224511,-224537,-224563,-224589,-224614,-224640,-224666,-224692,-224718,-224744,-224770,-224796,-224822,-224847,-224873,-224899,-224925,-224951,-224977,-225002,-225028,-225054,-225080,-225105,-225131,-225157,-225183,-225208,-225234,-225260,-225286,-225311,-225337,-225363,-225388,-225414,-225440,-225465,-225491,-225516,-225542,-225568,-225593,-225619,-225645,-225670,-225696,-225721,-225747,-225772,-225798,-225823,-225849,-225874,-225900,-225925,-225951,-225976,-226002,-226027,-226053,-226078,-226104,-226129,-226155,-226180,-226205,-226231,-226256,-226282,-226307,-226332,-226358,-226383,-226408,-226434,-226459,-226484,-226510,-226535,-226560,-226585,-226611,-226636,-226661,-226687,-226712,-226737,-226762,-226787,-226813,-226838,-226863,-226888,-226913,-226939,-226964,-226989,-227014,-227039,-227064,-227089,-227114,-227140,-227165,-227190,-227215,-227240,-227265,-227290,-227315,-227340,-227365,-227390,-227415,-227440,-227465,-227490,-227515,-227540,-227565,-227590,-227615,-227640,-227665,-227690,-227715,-227739,-227764,-227789,-227814,-227839,-227864,-227889,-227913,-227938,-227963,-227988,-228013,-228038,-228062,-228087,-228112,-228137,-228161,-228186,-228211,-228236,-228260,-228285,-228310,-228334,-228359,-228384,-228408,-228433,-228458,-228482,-228507,-228532,-228556,-228581,-228606,-228630,-228655,-228679,-228704,-228728,-228753,-228778,-228802,-228827,-228851,-228876,-228900,-228925,-228949,-228974,-228998,-229023,-229047,-229071,-229096,-229120,-229145,-229169,-229193,-229218,-229242,-229267,-229291,-229315,-229340,-229364,-229388,-229413,-229437,-229461,-229486,-229510,-229534,-229559,-229583,-229607,-229631,-229656,-229680,-229704,-229728,-229752,-229777,-229801,-229825,-229849,-229873,-229897,-229922,-229946,-229970,-229994,-230018,-230042,-230066,-230090,-230115,-230139,-230163,-230187,-230211,-230235,-230259,-230283,-230307,-230331,-230355,-230379,-230403,-230427,-230451,-230475,-230499,-230523,-230547,-230570,-230594,-230618,-230642,-230666,-230690,-230714,-230738,-230761,-230785,-230809,-230833,-230857,-230881,-230904,-230928,-230952,-230976,-231000,-231023,-231047,-231071,-231095,-231118,-231142,-231166,-231189,-231213,-231237,-231260,-231284,-231308,-231331,-231355,-231379,-231402,-231426,-231449,-231473,-231497,-231520,-231544,-231567,-231591,-231614,-231638,-231662,-231685,-231709,-231732,-231756,-231779,-231803,-231826,-231849,-231873,-231896,-231920,-231943,-231967,-231990,-232013,-232037,-232060,-232084,-232107,-232130,-232154,-232177,-232200,-232224,-232247,-232270,-232294,-232317,-232340,-232363,-232387,-232410,-232433,-232456,-232480,-232503,-232526,-232549,-232573,-232596,-232619,-232642,-232665,-232688,-232712,-232735,-232758,-232781,-232804,-232827,-232850,-232873,-232896,-232919,-232943,-232966,-232989,-233012,-233035,-233058,-233081,-233104,-233127,-233150,-233173,-233196,-233219,-233242,-233264,-233287,-233310,-233333,-233356,-233379,-233402,-233425,-233448,-233471,-233493,-233516,-233539,-233562,-233585,-233608,-233630,-233653,-233676,-233699,-233721,-233744,-233767,-233790,-233812,-233835,-233858,-233881,-233903,-233926,-233949,-233971,-233994,-234017,-234039,-234062,-234085,-234107,-234130,-234152,-234175,-234198,-234220,-234243,-234265,-234288,-234310,-234333,-234355,-234378,-234400,-234423,-234445,-234468,-234490,-234513,-234535,-234558,-234580,-234603,-234625,-234648,-234670,-234692,-234715,-234737,-234759,-234782,-234804,-234827,-234849,-234871,-234893,-234916,-234938,-234960,-234983,-235005,-235027,-235049,-235072,-235094,-235116,-235138,-235161,-235183,-235205,-235227,-235249,-235272,-235294,-235316,-235338,-235360,-235382,-235404,-235427,-235449,-235471,-235493,-235515,-235537,-235559,-235581,-235603,-235625,-235647,-235669,-235691,-235713,-235735,-235757,-235779,-235801,-235823,-235845,-235867,-235889,-235911,-235933,-235955,-235977,-235998,-236020,-236042,-236064,-236086,-236108,-236130,-236151,-236173,-236195,-236217,-236239,-236260,-236282,-236304,-236326,-236347,-236369,-236391,-236413,-236434,-236456,-236478,-236499,-236521,-236543,-236564,-236586,-236608,-236629,-236651,-236673,-236694,-236716,-236737,-236759,-236781,-236802,-236824,-236845,-236867,-236888,-236910,-236931,-236953,-236974,-236996,-237017,-237039,-237060,-237082,-237103,-237125,-237146,-237167,-237189,-237210,-237232,-237253,-237274,-237296,-237317,-237338,-237360,-237381,-237402,-237424,-237445,-237466,-237488,-237509,-237530,-237551,-237573,-237594,-237615,-237636,-237658,-237679,-237700,-237721,-237742,-237764,-237785,-237806,-237827,-237848,-237869,-237890,-237912,-237933,-237954,-237975,-237996,-238017,-238038,-238059,-238080,-238101,-238122,-238143,-238164,-238185,-238206,-238227,-238248,-238269,-238290,-238311,-238332,-238353,-238374,-238395,-238416,-238436,-238457,-238478,-238499,-238520,-238541,-238562,-238582,-238603,-238624,-238645,-238666,-238687,-238707,-238728,-238749,-238770,-238790,-238811,-238832,-238852,-238873,-238894,-238915,-238935,-238956,-238977,-238997,-239018,-239039,-239059,-239080,-239100,-239121,-239142,-239162,-239183,-239203,-239224,-239244,-239265,-239286,-239306,-239327,-239347,-239368,-239388,-239409,-239429,-239449,-239470,-239490,-239511,-239531,-239552,-239572,-239592,-239613,-239633,-239654,-239674,-239694,-239715,-239735,-239755,-239776,-239796,-239816,-239837,-239857,-239877,-239897,-239918,-239938,-239958,-239978,-239999,-240019,-240039,-240059,-240079,-240100,-240120,-240140,-240160,-240180,-240200,-240220,-240241,-240261,-240281,-240301,-240321,-240341,-240361,-240381,-240401,-240421,-240441,-240461,-240481,-240501,-240521,-240541,-240561,-240581,-240601,-240621,-240641,-240661,-240681,-240701,-240721,-240741,-240761,-240780,-240800,-240820,-240840,-240860,-240880,-240900,-240919,-240939,-240959,-240979,-240999,-241018,-241038,-241058,-241078,-241097,-241117,-241137,-241156,-241176,-241196,-241216,-241235,-241255,-241275,-241294,-241314,-241333,-241353,-241373,-241392,-241412,-241432,-241451,-241471,-241490,-241510,-241529,-241549,-241568,-241588,-241607,-241627,-241646,-241666,-241685,-241705,-241724,-241744,-241763,-241783,-241802,-241821,-241841,-241860,-241880,-241899,-241918,-241938,-241957,-241976,-241996,-242015,-242034,-242054,-242073,-242092,-242111,-242131,-242150,-242169,-242188,-242208,-242227,-242246,-242265,-242285,-242304,-242323,-242342,-242361,-242380,-242400,-242419,-242438,-242457,-242476,-242495,-242514,-242533,-242552,-242571,-242590,-242610,-242629,-242648,-242667,-242686,-242705,-242724,-242743,-242762,-242781,-242799,-242818,-242837,-242856,-242875,-242894,-242913,-242932,-242951,-242970,-242989,-243007,-243026,-243045,-243064,-243083,-243102,-243120,-243139,-243158,-243177,-243195,-243214,-243233,-243252,-243270,-243289,-243308,-243327,-243345,-243364,-243383,-243401,-243420,-243439,-243457,-243476,-243495,-243513,-243532,-243550,-243569,-243587,-243606,-243625,-243643,-243662,-243680,-243699,-243717,-243736,-243754,-243773,-243791,-243810,-243828,-243847,-243865,-243884,-243902,-243920,-243939,-243957,-243976,-243994,-244012,-244031,-244049,-244067,-244086,-244104,-244122,-244141,-244159,-244177,-244196,-244214,-244232,-244250,-244269,-244287,-244305,-244323,-244342,-244360,-244378,-244396,-244414,-244432,-244451,-244469,-244487,-244505,-244523,-244541,-244559,-244577,-244596,-244614,-244632,-244650,-244668,-244686,-244704,-244722,-244740,-244758,-244776,-244794,-244812,-244830,-244848,-244866,-244884,-244902,-244920,-244937,-244955,-244973,-244991,-245009,-245027,-245045,-245063,-245080,-245098,-245116,-245134,-245152,-245170,-245187,-245205,-245223,-245241,-245258,-245276,-245294,-245312,-245329,-245347,-245365,-245382,-245400,-245418,-245435,-245453,-245471,-245488,-245506,-245524,-245541,-245559,-245576,-245594,-245612,-245629,-245647,-245664,-245682,-245699,-245717,-245734,-245752,-245769,-245787,-245804,-245822,-245839,-245857,-245874,-245891,-245909,-245926,-245944,-245961,-245978,-245996,-246013,-246031,-246048,-246065,-246083,-246100,-246117,-246135,-246152,-246169,-246186,-246204,-246221,-246238,-246255,-246273,-246290,-246307,-246324,-246341,-246359,-246376,-246393,-246410,-246427,-246444,-246462,-246479,-246496,-246513,-246530,-246547,-246564,-246581,-246598,-246615,-246632,-246649,-246666,-246683,-246700,-246717,-246734,-246751,-246768,-246785,-246802,-246819,-246836,-246853,-246870,-246887,-246904,-246921,-246937,-246954,-246971,-246988,-247005,-247022,-247039,-247055,-247072,-247089,-247106,-247122,-247139,-247156,-247173,-247189,-247206,-247223,-247240,-247256,-247273,-247290,-247306,-247323,-247340,-247356,-247373,-247390,-247406,-247423,-247439,-247456,-247473,-247489,-247506,-247522,-247539,-247555,-247572,-247588,-247605,-247621,-247638,-247654,-247671,-247687,-247704,-247720,-247737,-247753,-247770,-247786,-247802,-247819,-247835,-247852,-247868,-247884,-247901,-247917,-247933,-247950,-247966,-247982,-247999,-248015,-248031,-248047,-248064,-248080,-248096,-248112,-248129,-248145,-248161,-248177,-248193,-248210,-248226,-248242,-248258,-248274,-248290,-248306,-248322,-248339,-248355,-248371,-248387,-248403,-248419,-248435,-248451,-248467,-248483,-248499,-248515,-248531,-248547,-248563,-248579,-248595,-248611,-248627,-248643,-248659,-248675,-248690,-248706,-248722,-248738,-248754,-248770,-248786,-248802,-248817,-248833,-248849,-248865,-248881,-248896,-248912,-248928,-248944,-248959,-248975,-248991,-249007,-249022,-249038,-249054,-249069,-249085,-249101,-249116,-249132,-249148,-249163,-249179,-249194,-249210,-249226,-249241,-249257,-249272,-249288,-249303,-249319,-249334,-249350,-249366,-249381,-249397,-249412,-249427,-249443,-249458,-249474,-249489,-249505,-249520,-249535,-249551,-249566,-249582,-249597,-249612,-249628,-249643,-249658,-249674,-249689,-249704,-249720,-249735,-249750,-249765,-249781,-249796,-249811,-249826,-249842,-249857,-249872,-249887,-249902,-249918,-249933,-249948,-249963,-249978,-249993,-250008,-250024,-250039,-250054,-250069,-250084,-250099,-250114,-250129,-250144,-250159,-250174,-250189,-250204,-250219,-250234,-250249,-250264,-250279,-250294,-250309,-250324,-250339,-250354,-250369,-250384,-250398,-250413,-250428,-250443,-250458,-250473,-250488,-250502,-250517,-250532,-250547,-250561,-250576,-250591,-250606,-250621,-250635,-250650,-250665,-250679,-250694,-250709,-250723,-250738,-250753,-250767,-250782,-250797,-250811,-250826,-250841,-250855,-250870,-250884,-250899,-250913,-250928,-250943,-250957,-250972,-250986,-251001,-251015,-251030,-251044,-251059,-251073,-251087,-251102,-251116,-251131,-251145,-251160,-251174,-251188,-251203,-251217,-251231,-251246,-251260,-251274,-251289,-251303,-251317,-251332,-251346,-251360,-251374,-251389,-251403,-251417,-251431,-251446,-251460,-251474,-251488,-251502,-251517,-251531,-251545,-251559,-251573,-251587,-251601,-251616,-251630,-251644,-251658,-251672,-251686,-251700,-251714,-251728,-251742,-251756,-251770,-251784,-251798,-251812,-251826,-251840,-251854,-251868,-251882,-251896,-251910,-251924,-251937,-251951,-251965,-251979,-251993,-252007,-252021,-252034,-252048,-252062,-252076,-252090,-252103,-252117,-252131,-252145,-252158,-252172,-252186,-252200,-252213,-252227,-252241,-252254,-252268,-252282,-252295,-252309,-252323,-252336,-252350,-252364,-252377,-252391,-252404,-252418,-252431,-252445,-252459,-252472,-252486,-252499,-252513,-252526,-252540,-252553,-252567,-252580,-252593,-252607,-252620,-252634,-252647,-252661,-252674,-252687,-252701,-252714,-252727,-252741,-252754,-252767,-252781,-252794,-252807,-252821,-252834,-252847,-252860,-252874,-252887,-252900,-252913,-252927,-252940,-252953,-252966,-252979,-252993,-253006,-253019,-253032,-253045,-253058,-253071,-253084,-253098,-253111,-253124,-253137,-253150,-253163,-253176,-253189,-253202,-253215,-253228,-253241,-253254,-253267,-253280,-253293,-253306,-253319,-253332,-253345,-253358,-253370,-253383,-253396,-253409,-253422,-253435,-253448,-253460,-253473,-253486,-253499,-253512,-253524,-253537,-253550,-253563,-253576,-253588,-253601,-253614,-253626,-253639,-253652,-253665,-253677,-253690,-253703,-253715,-253728,-253740,-253753,-253766,-253778,-253791,-253803,-253816,-253829,-253841,-253854,-253866,-253879,-253891,-253904,-253916,-253929,-253941,-253954,-253966,-253979,-253991,-254003,-254016,-254028,-254041,-254053,-254066,-254078,-254090,-254103,-254115,-254127,-254140,-254152,-254164,-254177,-254189,-254201,-254213,-254226,-254238,-254250,-254262,-254275,-254287,-254299,-254311,-254323,-254336,-254348,-254360,-254372,-254384,-254396,-254409,-254421,-254433,-254445,-254457,-254469,-254481,-254493,-254505,-254517,-254529,-254541,-254553,-254565,-254577,-254589,-254601,-254613,-254625,-254637,-254649,-254661,-254673,-254685,-254697,-254709,-254720,-254732,-254744,-254756,-254768,-254780,-254792,-254803,-254815,-254827,-254839,-254851,-254862,-254874,-254886,-254898,-254909,-254921,-254933,-254944,-254956,-254968,-254980,-254991,-255003,-255014,-255026,-255038,-255049,-255061,-255073,-255084,-255096,-255107,-255119,-255130,-255142,-255154,-255165,-255177,-255188,-255200,-255211,-255223,-255234,-255245,-255257,-255268,-255280,-255291,-255303,-255314,-255325,-255337,-255348,-255360,-255371,-255382,-255394,-255405,-255416,-255428,-255439,-255450,-255461,-255473,-255484,-255495,-255506,-255518,-255529,-255540,-255551,-255563,-255574,-255585,-255596,-255607,-255618,-255629,-255641,-255652,-255663,-255674,-255685,-255696,-255707,-255718,-255729,-255740,-255751,-255762,-255773,-255784,-255795,-255806,-255817,-255828,-255839,-255850,-255861,-255872,-255883,-255894,-255905,-255916,-255927,-255938,-255948,-255959,-255970,-255981,-255992,-256003,-256013,-256024,-256035,-256046,-256057,-256067,-256078,-256089,-256100,-256110,-256121,-256132,-256142,-256153,-256164,-256175,-256185,-256196,-256206,-256217,-256228,-256238,-256249,-256260,-256270,-256281,-256291,-256302,-256312,-256323,-256333,-256344,-256354,-256365,-256375,-256386,-256396,-256407,-256417,-256428,-256438,-256449,-256459,-256469,-256480,-256490,-256501,-256511,-256521,-256532,-256542,-256552,-256563,-256573,-256583,-256594,-256604,-256614,-256624,-256635,-256645,-256655,-256665,-256676,-256686,-256696,-256706,-256716,-256727,-256737,-256747,-256757,-256767,-256777,-256787,-256797,-256808,-256818,-256828,-256838,-256848,-256858,-256868,-256878,-256888,-256898,-256908,-256918,-256928,-256938,-256948,-256958,-256968,-256978,-256988,-256998,-257007,-257017,-257027,-257037,-257047,-257057,-257067,-257077,-257086,-257096,-257106,-257116,-257126,-257135,-257145,-257155,-257165,-257174,-257184,-257194,-257204,-257213,-257223,-257233,-257242,-257252,-257262,-257271,-257281,-257291,-257300,-257310,-257319,-257329,-257339,-257348,-257358,-257367,-257377,-257386,-257396,-257405,-257415,-257424,-257434,-257443,-257453,-257462,-257472,-257481,-257491,-257500,-257509,-257519,-257528,-257538,-257547,-257556,-257566,-257575,-257584,-257594,-257603,-257612,-257622,-257631,-257640,-257650,-257659,-257668,-257677,-257687,-257696,-257705,-257714,-257723,-257733,-257742,-257751,-257760,-257769,-257778,-257788,-257797,-257806,-257815,-257824,-257833,-257842,-257851,-257860,-257869,-257878,-257887,-257896,-257905,-257914,-257923,-257932,-257941,-257950,-257959,-257968,-257977,-257986,-257995,-258004,-258013,-258022,-258030,-258039,-258048,-258057,-258066,-258075,-258083,-258092,-258101,-258110,-258119,-258127,-258136,-258145,-258154,-258162,-258171,-258180,-258189,-258197,-258206,-258215,-258223,-258232,-258241,-258249,-258258,-258266,-258275,-258284,-258292,-258301,-258309,-258318,-258326,-258335,-258344,-258352,-258361,-258369,-258378,-258386,-258395,-258403,-258411,-258420,-258428,-258437,-258445,-258454,-258462,-258470,-258479,-258487,-258495,-258504,-258512,-258521,-258529,-258537,-258545,-258554,-258562,-258570,-258579,-258587,-258595,-258603,-258612,-258620,-258628,-258636,-258644,-258653,-258661,-258669,-258677,-258685,-258693,-258701,-258710,-258718,-258726,-258734,-258742,-258750,-258758,-258766,-258774,-258782,-258790,-258798,-258806,-258814,-258822,-258830,-258838,-258846,-258854,-258862,-258870,-258878,-258886,-258894,-258901,-258909,-258917,-258925,-258933,-258941,-258949,-258956,-258964,-258972,-258980,-258988,-258995,-259003,-259011,-259019,-259026,-259034,-259042,-259049,-259057,-259065,-259072,-259080,-259088,-259095,-259103,-259111,-259118,-259126,-259134,-259141,-259149,-259156,-259164,-259171,-259179,-259186,-259194,-259201,-259209,-259216,-259224,-259231,-259239,-259246,-259254,-259261,-259269,-259276,-259284,-259291,-259298,-259306,-259313,-259320,-259328,-259335,-259342,-259350,-259357,-259364,-259372,-259379,-259386,-259394,-259401,-259408,-259415,-259422,-259430,-259437,-259444,-259451,-259458,-259466,-259473,-259480,-259487,-259494,-259501,-259508,-259516,-259523,-259530,-259537,-259544,-259551,-259558,-259565,-259572,-259579,-259586,-259593,-259600,-259607,-259614,-259621,-259628,-259635,-259642,-259649,-259656,-259663,-259669,-259676,-259683,-259690,-259697,-259704,-259711,-259717,-259724,-259731,-259738,-259745,-259751,-259758,-259765,-259772,-259778,-259785,-259792,-259799,-259805,-259812,-259819,-259825,-259832,-259839,-259845,-259852,-259859,-259865,-259872,-259878,-259885,-259892,-259898,-259905,-259911,-259918,-259924,-259931,-259937,-259944,-259950,-259957,-259963,-259970,-259976,-259983,-259989,-259996,-260002,-260008,-260015,-260021,-260028,-260034,-260040,-260047,-260053,-260059,-260066,-260072,-260078,-260084,-260091,-260097,-260103,-260110,-260116,-260122,-260128,-260134,-260141,-260147,-260153,-260159,-260165,-260172,-260178,-260184,-260190,-260196,-260202,-260208,-260214,-260220,-260227,-260233,-260239,-260245,-260251,-260257,-260263,-260269,-260275,-260281,-260287,-260293,-260299,-260305,-260311,-260316,-260322,-260328,-260334,-260340,-260346,-260352,-260358,-260364,-260369,-260375,-260381,-260387,-260393,-260398,-260404,-260410,-260416,-260422,-260427,-260433,-260439,-260444,-260450,-260456,-260462,-260467,-260473,-260479,-260484,-260490,-260495,-260501,-260507,-260512,-260518,-260524,-260529,-260535,-260540,-260546,-260551,-260557,-260562,-260568,-260573,-260579,-260584,-260590,-260595,-260601,-260606,-260612,-260617,-260622,-260628,-260633,-260639,-260644,-260649,-260655,-260660,-260665,-260671,-260676,-260681,-260687,-260692,-260697,-260702,-260708,-260713,-260718,-260723,-260729,-260734,-260739,-260744,-260749,-260755,-260760,-260765,-260770,-260775,-260780,-260785,-260790,-260796,-260801,-260806,-260811,-260816,-260821,-260826,-260831,-260836,-260841,-260846,-260851,-260856,-260861,-260866,-260871,-260876,-260881,-260886,-260891,-260895,-260900,-260905,-260910,-260915,-260920,-260925,-260929,-260934,-260939,-260944,-260949,-260954,-260958,-260963,-260968,-260973,-260977,-260982,-260987,-260991,-260996,-261001,-261006,-261010,-261015,-261020,-261024,-261029,-261033,-261038,-261043,-261047,-261052,-261056,-261061,-261066,-261070,-261075,-261079,-261084,-261088,-261093,-261097,-261102,-261106,-261111,-261115,-261119,-261124,-261128,-261133,-261137,-261142,-261146,-261150,-261155,-261159,-261163,-261168,-261172,-261176,-261181,-261185,-261189,-261194,-261198,-261202,-261206,-261211,-261215,-261219,-261223,-261227,-261232,-261236,-261240,-261244,-261248,-261252,-261257,-261261,-261265,-261269,-261273,-261277,-261281,-261285,-261289,-261293,-261297,-261301,-261305,-261309,-261313,-261317,-261321,-261325,-261329,-261333,-261337,-261341,-261345,-261349,-261353,-261357,-261361,-261365,-261368,-261372,-261376,-261380,-261384,-261388,-261391,-261395,-261399,-261403,-261407,-261410,-261414,-261418,-261422,-261425,-261429,-261433,-261436,-261440,-261444,-261447,-261451,-261455,-261458,-261462,-261466,-261469,-261473,-261476,-261480,-261484,-261487,-261491,-261494,-261498,-261501,-261505,-261508,-261512,-261515,-261519,-261522,-261526,-261529,-261532,-261536,-261539,-261543,-261546,-261550,-261553,-261556,-261560,-261563,-261566,-261570,-261573,-261576,-261580,-261583,-261586,-261589,-261593,-261596,-261599,-261602,-261606,-261609,-261612,-261615,-261618,-261622,-261625,-261628,-261631,-261634,-261637,-261640,-261643,-261647,-261650,-261653,-261656,-261659,-261662,-261665,-261668,-261671,-261674,-261677,-261680,-261683,-261686,-261689,-261692,-261695,-261698,-261701,-261704,-261707,-261709,-261712,-261715,-261718,-261721,-261724,-261727,-261729,-261732,-261735,-261738,-261741,-261743,-261746,-261749,-261752,-261754,-261757,-261760,-261763,-261765,-261768,-261771,-261773,-261776,-261779,-261781,-261784,-261787,-261789,-261792,-261794,-261797,-261800,-261802,-261805,-261807,-261810,-261812,-261815,-261817,-261820,-261822,-261825,-261827,-261830,-261832,-261835,-261837,-261839,-261842,-261844,-261847,-261849,-261851,-261854,-261856,-261858,-261861,-261863,-261865,-261868,-261870,-261872,-261875,-261877,-261879,-261881,-261884,-261886,-261888,-261890,-261893,-261895,-261897,-261899,-261901,-261903,-261906,-261908,-261910,-261912,-261914,-261916,-261918,-261920,-261922,-261924,-261926,-261928,-261931,-261933,-261935,-261937,-261939,-261941,-261942,-261944,-261946,-261948,-261950,-261952,-261954,-261956,-261958,-261960,-261962,-261964,-261965,-261967,-261969,-261971,-261973,-261974,-261976,-261978,-261980,-261982,-261983,-261985,-261987,-261989,-261990,-261992,-261994,-261995,-261997,-261999,-262000,-262002,-262004,-262005,-262007,-262009,-262010,-262012,-262013,-262015,-262017,-262018,-262020,-262021,-262023,-262024,-262026,-262027,-262029,-262030,-262032,-262033,-262035,-262036,-262037,-262039,-262040,-262042,-262043,-262044,-262046,-262047,-262049,-262050,-262051,-262053,-262054,-262055,-262056,-262058,-262059,-262060,-262062,-262063,-262064,-262065,-262066,-262068,-262069,-262070,-262071,-262072,-262074,-262075,-262076,-262077,-262078,-262079,-262080,-262081,-262083,-262084,-262085,-262086,-262087,-262088,-262089,-262090,-262091,-262092,-262093,-262094,-262095,-262096,-262097,-262098,-262099,-262100,-262100,-262101,-262102,-262103,-262104,-262105,-262106,-262107,-262107,-262108,-262109,-262110,-262111,-262111,-262112,-262113,-262114,-262114,-262115,-262116,-262117,-262117,-262118,-262119,-262119,-262120,-262121,-262121,-262122,-262123,-262123,-262124,-262124,-262125,-262126,-262126,-262127,-262127,-262128,-262128,-262129,-262129,-262130,-262130,-262131,-262131,-262132,-262132,-262133,-262133,-262134,-262134,-262134,-262135,-262135,-262136,-262136,-262136,-262137,-262137,-262137,-262138,-262138,-262138,-262139,-262139,-262139,-262139,-262140,-262140,-262140,-262140,-262141,-262141,-262141,-262141,-262141,-262142,-262142,-262142,-262142,-262142,-262142,-262142,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262143,-262142,-262142,-262142,-262142,-262142,-262142,-262142,-262141,-262141,-262141,-262141,-262141,-262140,-262140,-262140,-262140,-262139,-262139,-262139,-262139,-262138,-262138,-262138,-262137,-262137,-262137,-262136,-262136,-262136,-262135,-262135,-262134,-262134,-262134,-262133,-262133,-262132,-262132,-262131,-262131,-262130,-262130,-262129,-262129,-262128,-262128,-262127,-262127,-262126,-262126,-262125,-262124,-262124,-262123,-262123,-262122,-262121,-262121,-262120,-262119,-262119,-262118,-262117,-262117,-262116,-262115,-262114,-262114,-262113,-262112,-262111,-262111,-262110,-262109,-262108,-262107,-262107,-262106,-262105,-262104,-262103,-262102,-262101,-262100,-262100,-262099,-262098,-262097,-262096,-262095,-262094,-262093,-262092,-262091,-262090,-262089,-262088,-262087,-262086,-262085,-262084,-262083,-262081,-262080,-262079,-262078,-262077,-262076,-262075,-262074,-262072,-262071,-262070,-262069,-262068,-262066,-262065,-262064,-262063,-262062,-262060,-262059,-262058,-262056,-262055,-262054,-262053,-262051,-262050,-262049,-262047,-262046,-262044,-262043,-262042,-262040,-262039,-262037,-262036,-262035,-262033,-262032,-262030,-262029,-262027,-262026,-262024,-262023,-262021,-262020,-262018,-262017,-262015,-262013,-262012,-262010,-262009,-262007,-262005,-262004,-262002,-262000,-261999,-261997,-261995,-261994,-261992,-261990,-261989,-261987,-261985,-261983,-261982,-261980,-261978,-261976,-261974,-261973,-261971,-261969,-261967,-261965,-261964,-261962,-261960,-261958,-261956,-261954,-261952,-261950,-261948,-261946,-261944,-261942,-261941,-261939,-261937,-261935,-261933,-261931,-261928,-261926,-261924,-261922,-261920,-261918,-261916,-261914,-261912,-261910,-261908,-261906,-261903,-261901,-261899,-261897,-261895,-261893,-261890,-261888,-261886,-261884,-261881,-261879,-261877,-261875,-261872,-261870,-261868,-261865,-261863,-261861,-261858,-261856,-261854,-261851,-261849,-261847,-261844,-261842,-261839,-261837,-261835,-261832,-261830,-261827,-261825,-261822,-261820,-261817,-261815,-261812,-261810,-261807,-261805,-261802,-261800,-261797,-261794,-261792,-261789,-261787,-261784,-261781,-261779,-261776,-261773,-261771,-261768,-261765,-261763,-261760,-261757,-261754,-261752,-261749,-261746,-261743,-261741,-261738,-261735,-261732,-261729,-261727,-261724,-261721,-261718,-261715,-261712,-261709,-261707,-261704,-261701,-261698,-261695,-261692,-261689,-261686,-261683,-261680,-261677,-261674,-261671,-261668,-261665,-261662,-261659,-261656,-261653,-261650,-261647,-261643,-261640,-261637,-261634,-261631,-261628,-261625,-261622,-261618,-261615,-261612,-261609,-261606,-261602,-261599,-261596,-261593,-261589,-261586,-261583,-261580,-261576,-261573,-261570,-261566,-261563,-261560,-261556,-261553,-261550,-261546,-261543,-261539,-261536,-261532,-261529,-261526,-261522,-261519,-261515,-261512,-261508,-261505,-261501,-261498,-261494,-261491,-261487,-261484,-261480,-261476,-261473,-261469,-261466,-261462,-261458,-261455,-261451,-261447,-261444,-261440,-261436,-261433,-261429,-261425,-261422,-261418,-261414,-261410,-261407,-261403,-261399,-261395,-261391,-261388,-261384,-261380,-261376,-261372,-261368,-261365,-261361,-261357,-261353,-261349,-261345,-261341,-261337,-261333,-261329,-261325,-261321,-261317,-261313,-261309,-261305,-261301,-261297,-261293,-261289,-261285,-261281,-261277,-261273,-261269,-261265,-261261,-261257,-261252,-261248,-261244,-261240,-261236,-261232,-261227,-261223,-261219,-261215,-261211,-261206,-261202,-261198,-261194,-261189,-261185,-261181,-261176,-261172,-261168,-261163,-261159,-261155,-261150,-261146,-261142,-261137,-261133,-261128,-261124,-261119,-261115,-261111,-261106,-261102,-261097,-261093,-261088,-261084,-261079,-261075,-261070,-261066,-261061,-261056,-261052,-261047,-261043,-261038,-261033,-261029,-261024,-261020,-261015,-261010,-261006,-261001,-260996,-260991,-260987,-260982,-260977,-260973,-260968,-260963,-260958,-260954,-260949,-260944,-260939,-260934,-260929,-260925,-260920,-260915,-260910,-260905,-260900,-260895,-260891,-260886,-260881,-260876,-260871,-260866,-260861,-260856,-260851,-260846,-260841,-260836,-260831,-260826,-260821,-260816,-260811,-260806,-260801,-260796,-260790,-260785,-260780,-260775,-260770,-260765,-260760,-260755,-260749,-260744,-260739,-260734,-260729,-260723,-260718,-260713,-260708,-260702,-260697,-260692,-260687,-260681,-260676,-260671,-260665,-260660,-260655,-260649,-260644,-260639,-260633,-260628,-260622,-260617,-260612,-260606,-260601,-260595,-260590,-260584,-260579,-260573,-260568,-260562,-260557,-260551,-260546,-260540,-260535,-260529,-260524,-260518,-260512,-260507,-260501,-260495,-260490,-260484,-260479,-260473,-260467,-260462,-260456,-260450,-260444,-260439,-260433,-260427,-260422,-260416,-260410,-260404,-260398,-260393,-260387,-260381,-260375,-260369,-260364,-260358,-260352,-260346,-260340,-260334,-260328,-260322,-260316,-260311,-260305,-260299,-260293,-260287,-260281,-260275,-260269,-260263,-260257,-260251,-260245,-260239,-260233,-260227,-260220,-260214,-260208,-260202,-260196,-260190,-260184,-260178,-260172,-260165,-260159,-260153,-260147,-260141,-260134,-260128,-260122,-260116,-260110,-260103,-260097,-260091,-260084,-260078,-260072,-260066,-260059,-260053,-260047,-260040,-260034,-260028,-260021,-260015,-260008,-260002,-259996,-259989,-259983,-259976,-259970,-259963,-259957,-259950,-259944,-259937,-259931,-259924,-259918,-259911,-259905,-259898,-259892,-259885,-259878,-259872,-259865,-259859,-259852,-259845,-259839,-259832,-259825,-259819,-259812,-259805,-259799,-259792,-259785,-259778,-259772,-259765,-259758,-259751,-259745,-259738,-259731,-259724,-259717,-259711,-259704,-259697,-259690,-259683,-259676,-259669,-259663,-259656,-259649,-259642,-259635,-259628,-259621,-259614,-259607,-259600,-259593,-259586,-259579,-259572,-259565,-259558,-259551,-259544,-259537,-259530,-259523,-259516,-259508,-259501,-259494,-259487,-259480,-259473,-259466,-259458,-259451,-259444,-259437,-259430,-259422,-259415,-259408,-259401,-259394,-259386,-259379,-259372,-259364,-259357,-259350,-259342,-259335,-259328,-259320,-259313,-259306,-259298,-259291,-259284,-259276,-259269,-259261,-259254,-259246,-259239,-259231,-259224,-259216,-259209,-259201,-259194,-259186,-259179,-259171,-259164,-259156,-259149,-259141,-259134,-259126,-259118,-259111,-259103,-259095,-259088,-259080,-259072,-259065,-259057,-259049,-259042,-259034,-259026,-259019,-259011,-259003,-258995,-258988,-258980,-258972,-258964,-258956,-258949,-258941,-258933,-258925,-258917,-258909,-258901,-258894,-258886,-258878,-258870,-258862,-258854,-258846,-258838,-258830,-258822,-258814,-258806,-258798,-258790,-258782,-258774,-258766,-258758,-258750,-258742,-258734,-258726,-258718,-258710,-258701,-258693,-258685,-258677,-258669,-258661,-258653,-258644,-258636,-258628,-258620,-258612,-258603,-258595,-258587,-258579,-258570,-258562,-258554,-258545,-258537,-258529,-258521,-258512,-258504,-258495,-258487,-258479,-258470,-258462,-258454,-258445,-258437,-258428,-258420,-258411,-258403,-258395,-258386,-258378,-258369,-258361,-258352,-258344,-258335,-258326,-258318,-258309,-258301,-258292,-258284,-258275,-258266,-258258,-258249,-258241,-258232,-258223,-258215,-258206,-258197,-258189,-258180,-258171,-258162,-258154,-258145,-258136,-258127,-258119,-258110,-258101,-258092,-258083,-258075,-258066,-258057,-258048,-258039,-258030,-258022,-258013,-258004,-257995,-257986,-257977,-257968,-257959,-257950,-257941,-257932,-257923,-257914,-257905,-257896,-257887,-257878,-257869,-257860,-257851,-257842,-257833,-257824,-257815,-257806,-257797,-257788,-257778,-257769,-257760,-257751,-257742,-257733,-257723,-257714,-257705,-257696,-257687,-257677,-257668,-257659,-257650,-257640,-257631,-257622,-257612,-257603,-257594,-257584,-257575,-257566,-257556,-257547,-257538,-257528,-257519,-257509,-257500,-257491,-257481,-257472,-257462,-257453,-257443,-257434,-257424,-257415,-257405,-257396,-257386,-257377,-257367,-257358,-257348,-257339,-257329,-257319,-257310,-257300,-257291,-257281,-257271,-257262,-257252,-257242,-257233,-257223,-257213,-257204,-257194,-257184,-257174,-257165,-257155,-257145,-257135,-257126,-257116,-257106,-257096,-257086,-257077,-257067,-257057,-257047,-257037,-257027,-257017,-257007,-256998,-256988,-256978,-256968,-256958,-256948,-256938,-256928,-256918,-256908,-256898,-256888,-256878,-256868,-256858,-256848,-256838,-256828,-256818,-256808,-256797,-256787,-256777,-256767,-256757,-256747,-256737,-256727,-256716,-256706,-256696,-256686,-256676,-256665,-256655,-256645,-256635,-256624,-256614,-256604,-256594,-256583,-256573,-256563,-256552,-256542,-256532,-256521,-256511,-256501,-256490,-256480,-256469,-256459,-256449,-256438,-256428,-256417,-256407,-256396,-256386,-256375,-256365,-256354,-256344,-256333,-256323,-256312,-256302,-256291,-256281,-256270,-256260,-256249,-256238,-256228,-256217,-256206,-256196,-256185,-256175,-256164,-256153,-256142,-256132,-256121,-256110,-256100,-256089,-256078,-256067,-256057,-256046,-256035,-256024,-256013,-256003,-255992,-255981,-255970,-255959,-255948,-255938,-255927,-255916,-255905,-255894,-255883,-255872,-255861,-255850,-255839,-255828,-255817,-255806,-255795,-255784,-255773,-255762,-255751,-255740,-255729,-255718,-255707,-255696,-255685,-255674,-255663,-255652,-255641,-255629,-255618,-255607,-255596,-255585,-255574,-255563,-255551,-255540,-255529,-255518,-255506,-255495,-255484,-255473,-255461,-255450,-255439,-255428,-255416,-255405,-255394,-255382,-255371,-255360,-255348,-255337,-255325,-255314,-255303,-255291,-255280,-255268,-255257,-255245,-255234,-255223,-255211,-255200,-255188,-255177,-255165,-255154,-255142,-255130,-255119,-255107,-255096,-255084,-255073,-255061,-255049,-255038,-255026,-255014,-255003,-254991,-254980,-254968,-254956,-254944,-254933,-254921,-254909,-254898,-254886,-254874,-254862,-254851,-254839,-254827,-254815,-254803,-254792,-254780,-254768,-254756,-254744,-254732,-254720,-254709,-254697,-254685,-254673,-254661,-254649,-254637,-254625,-254613,-254601,-254589,-254577,-254565,-254553,-254541,-254529,-254517,-254505,-254493,-254481,-254469,-254457,-254445,-254433,-254421,-254409,-254396,-254384,-254372,-254360,-254348,-254336,-254323,-254311,-254299,-254287,-254275,-254262,-254250,-254238,-254226,-254213,-254201,-254189,-254177,-254164,-254152,-254140,-254127,-254115,-254103,-254090,-254078,-254066,-254053,-254041,-254028,-254016,-254003,-253991,-253979,-253966,-253954,-253941,-253929,-253916,-253904,-253891,-253879,-253866,-253854,-253841,-253829,-253816,-253803,-253791,-253778,-253766,-253753,-253740,-253728,-253715,-253703,-253690,-253677,-253665,-253652,-253639,-253626,-253614,-253601,-253588,-253576,-253563,-253550,-253537,-253524,-253512,-253499,-253486,-253473,-253460,-253448,-253435,-253422,-253409,-253396,-253383,-253370,-253358,-253345,-253332,-253319,-253306,-253293,-253280,-253267,-253254,-253241,-253228,-253215,-253202,-253189,-253176,-253163,-253150,-253137,-253124,-253111,-253098,-253084,-253071,-253058,-253045,-253032,-253019,-253006,-252993,-252979,-252966,-252953,-252940,-252927,-252913,-252900,-252887,-252874,-252860,-252847,-252834,-252821,-252807,-252794,-252781,-252767,-252754,-252741,-252727,-252714,-252701,-252687,-252674,-252661,-252647,-252634,-252620,-252607,-252593,-252580,-252567,-252553,-252540,-252526,-252513,-252499,-252486,-252472,-252459,-252445,-252431,-252418,-252404,-252391,-252377,-252364,-252350,-252336,-252323,-252309,-252295,-252282,-252268,-252254,-252241,-252227,-252213,-252200,-252186,-252172,-252158,-252145,-252131,-252117,-252103,-252090,-252076,-252062,-252048,-252034,-252021,-252007,-251993,-251979,-251965,-251951,-251937,-251924,-251910,-251896,-251882,-251868,-251854,-251840,-251826,-251812,-251798,-251784,-251770,-251756,-251742,-251728,-251714,-251700,-251686,-251672,-251658,-251644,-251630,-251616,-251601,-251587,-251573,-251559,-251545,-251531,-251517,-251502,-251488,-251474,-251460,-251446,-251431,-251417,-251403,-251389,-251374,-251360,-251346,-251332,-251317,-251303,-251289,-251274,-251260,-251246,-251231,-251217,-251203,-251188,-251174,-251160,-251145,-251131,-251116,-251102,-251087,-251073,-251059,-251044,-251030,-251015,-251001,-250986,-250972,-250957,-250943,-250928,-250913,-250899,-250884,-250870,-250855,-250841,-250826,-250811,-250797,-250782,-250767,-250753,-250738,-250723,-250709,-250694,-250679,-250665,-250650,-250635,-250621,-250606,-250591,-250576,-250561,-250547,-250532,-250517,-250502,-250488,-250473,-250458,-250443,-250428,-250413,-250398,-250384,-250369,-250354,-250339,-250324,-250309,-250294,-250279,-250264,-250249,-250234,-250219,-250204,-250189,-250174,-250159,-250144,-250129,-250114,-250099,-250084,-250069,-250054,-250039,-250024,-250008,-249993,-249978,-249963,-249948,-249933,-249918,-249902,-249887,-249872,-249857,-249842,-249826,-249811,-249796,-249781,-249765,-249750,-249735,-249720,-249704,-249689,-249674,-249658,-249643,-249628,-249612,-249597,-249582,-249566,-249551,-249535,-249520,-249505,-249489,-249474,-249458,-249443,-249427,-249412,-249397,-249381,-249366,-249350,-249334,-249319,-249303,-249288,-249272,-249257,-249241,-249226,-249210,-249194,-249179,-249163,-249148,-249132,-249116,-249101,-249085,-249069,-249054,-249038,-249022,-249007,-248991,-248975,-248959,-248944,-248928,-248912,-248896,-248881,-248865,-248849,-248833,-248817,-248802,-248786,-248770,-248754,-248738,-248722,-248706,-248690,-248675,-248659,-248643,-248627,-248611,-248595,-248579,-248563,-248547,-248531,-248515,-248499,-248483,-248467,-248451,-248435,-248419,-248403,-248387,-248371,-248355,-248339,-248322,-248306,-248290,-248274,-248258,-248242,-248226,-248210,-248193,-248177,-248161,-248145,-248129,-248112,-248096,-248080,-248064,-248047,-248031,-248015,-247999,-247982,-247966,-247950,-247933,-247917,-247901,-247884,-247868,-247852,-247835,-247819,-247802,-247786,-247770,-247753,-247737,-247720,-247704,-247687,-247671,-247654,-247638,-247621,-247605,-247588,-247572,-247555,-247539,-247522,-247506,-247489,-247473,-247456,-247439,-247423,-247406,-247390,-247373,-247356,-247340,-247323,-247306,-247290,-247273,-247256,-247240,-247223,-247206,-247189,-247173,-247156,-247139,-247122,-247106,-247089,-247072,-247055,-247039,-247022,-247005,-246988,-246971,-246954,-246937,-246921,-246904,-246887,-246870,-246853,-246836,-246819,-246802,-246785,-246768,-246751,-246734,-246717,-246700,-246683,-246666,-246649,-246632,-246615,-246598,-246581,-246564,-246547,-246530,-246513,-246496,-246479,-246462,-246444,-246427,-246410,-246393,-246376,-246359,-246341,-246324,-246307,-246290,-246273,-246255,-246238,-246221,-246204,-246186,-246169,-246152,-246135,-246117,-246100,-246083,-246065,-246048,-246031,-246013,-245996,-245978,-245961,-245944,-245926,-245909,-245891,-245874,-245857,-245839,-245822,-245804,-245787,-245769,-245752,-245734,-245717,-245699,-245682,-245664,-245647,-245629,-245612,-245594,-245576,-245559,-245541,-245524,-245506,-245488,-245471,-245453,-245435,-245418,-245400,-245382,-245365,-245347,-245329,-245312,-245294,-245276,-245258,-245241,-245223,-245205,-245187,-245170,-245152,-245134,-245116,-245098,-245080,-245063,-245045,-245027,-245009,-244991,-244973,-244955,-244937,-244920,-244902,-244884,-244866,-244848,-244830,-244812,-244794,-244776,-244758,-244740,-244722,-244704,-244686,-244668,-244650,-244632,-244614,-244596,-244577,-244559,-244541,-244523,-244505,-244487,-244469,-244451,-244432,-244414,-244396,-244378,-244360,-244342,-244323,-244305,-244287,-244269,-244250,-244232,-244214,-244196,-244177,-244159,-244141,-244122,-244104,-244086,-244067,-244049,-244031,-244012,-243994,-243976,-243957,-243939,-243920,-243902,-243884,-243865,-243847,-243828,-243810,-243791,-243773,-243754,-243736,-243717,-243699,-243680,-243662,-243643,-243625,-243606,-243587,-243569,-243550,-243532,-243513,-243495,-243476,-243457,-243439,-243420,-243401,-243383,-243364,-243345,-243327,-243308,-243289,-243270,-243252,-243233,-243214,-243195,-243177,-243158,-243139,-243120,-243102,-243083,-243064,-243045,-243026,-243007,-242989,-242970,-242951,-242932,-242913,-242894,-242875,-242856,-242837,-242818,-242799,-242781,-242762,-242743,-242724,-242705,-242686,-242667,-242648,-242629,-242610,-242590,-242571,-242552,-242533,-242514,-242495,-242476,-242457,-242438,-242419,-242400,-242380,-242361,-242342,-242323,-242304,-242285,-242265,-242246,-242227,-242208,-242188,-242169,-242150,-242131,-242111,-242092,-242073,-242054,-242034,-242015,-241996,-241976,-241957,-241938,-241918,-241899,-241880,-241860,-241841,-241821,-241802,-241783,-241763,-241744,-241724,-241705,-241685,-241666,-241646,-241627,-241607,-241588,-241568,-241549,-241529,-241510,-241490,-241471,-241451,-241432,-241412,-241392,-241373,-241353,-241333,-241314,-241294,-241275,-241255,-241235,-241216,-241196,-241176,-241156,-241137,-241117,-241097,-241078,-241058,-241038,-241018,-240999,-240979,-240959,-240939,-240919,-240900,-240880,-240860,-240840,-240820,-240800,-240780,-240761,-240741,-240721,-240701,-240681,-240661,-240641,-240621,-240601,-240581,-240561,-240541,-240521,-240501,-240481,-240461,-240441,-240421,-240401,-240381,-240361,-240341,-240321,-240301,-240281,-240261,-240241,-240220,-240200,-240180,-240160,-240140,-240120,-240100,-240079,-240059,-240039,-240019,-239999,-239978,-239958,-239938,-239918,-239897,-239877,-239857,-239837,-239816,-239796,-239776,-239755,-239735,-239715,-239694,-239674,-239654,-239633,-239613,-239592,-239572,-239552,-239531,-239511,-239490,-239470,-239449,-239429,-239409,-239388,-239368,-239347,-239327,-239306,-239286,-239265,-239244,-239224,-239203,-239183,-239162,-239142,-239121,-239100,-239080,-239059,-239039,-239018,-238997,-238977,-238956,-238935,-238915,-238894,-238873,-238852,-238832,-238811,-238790,-238770,-238749,-238728,-238707,-238687,-238666,-238645,-238624,-238603,-238582,-238562,-238541,-238520,-238499,-238478,-238457,-238436,-238416,-238395,-238374,-238353,-238332,-238311,-238290,-238269,-238248,-238227,-238206,-238185,-238164,-238143,-238122,-238101,-238080,-238059,-238038,-238017,-237996,-237975,-237954,-237933,-237912,-237890,-237869,-237848,-237827,-237806,-237785,-237764,-237742,-237721,-237700,-237679,-237658,-237636,-237615,-237594,-237573,-237551,-237530,-237509,-237488,-237466,-237445,-237424,-237402,-237381,-237360,-237338,-237317,-237296,-237274,-237253,-237232,-237210,-237189,-237167,-237146,-237125,-237103,-237082,-237060,-237039,-237017,-236996,-236974,-236953,-236931,-236910,-236888,-236867,-236845,-236824,-236802,-236781,-236759,-236737,-236716,-236694,-236673,-236651,-236629,-236608,-236586,-236564,-236543,-236521,-236499,-236478,-236456,-236434,-236413,-236391,-236369,-236347,-236326,-236304,-236282,-236260,-236239,-236217,-236195,-236173,-236151,-236130,-236108,-236086,-236064,-236042,-236020,-235998,-235977,-235955,-235933,-235911,-235889,-235867,-235845,-235823,-235801,-235779,-235757,-235735,-235713,-235691,-235669,-235647,-235625,-235603,-235581,-235559,-235537,-235515,-235493,-235471,-235449,-235427,-235404,-235382,-235360,-235338,-235316,-235294,-235272,-235249,-235227,-235205,-235183,-235161,-235138,-235116,-235094,-235072,-235049,-235027,-235005,-234983,-234960,-234938,-234916,-234893,-234871,-234849,-234827,-234804,-234782,-234759,-234737,-234715,-234692,-234670,-234648,-234625,-234603,-234580,-234558,-234535,-234513,-234490,-234468,-234445,-234423,-234400,-234378,-234355,-234333,-234310,-234288,-234265,-234243,-234220,-234198,-234175,-234152,-234130,-234107,-234085,-234062,-234039,-234017,-233994,-233971,-233949,-233926,-233903,-233881,-233858,-233835,-233812,-233790,-233767,-233744,-233721,-233699,-233676,-233653,-233630,-233608,-233585,-233562,-233539,-233516,-233493,-233471,-233448,-233425,-233402,-233379,-233356,-233333,-233310,-233287,-233264,-233242,-233219,-233196,-233173,-233150,-233127,-233104,-233081,-233058,-233035,-233012,-232989,-232966,-232943,-232919,-232896,-232873,-232850,-232827,-232804,-232781,-232758,-232735,-232712,-232688,-232665,-232642,-232619,-232596,-232573,-232549,-232526,-232503,-232480,-232456,-232433,-232410,-232387,-232363,-232340,-232317,-232294,-232270,-232247,-232224,-232200,-232177,-232154,-232130,-232107,-232084,-232060,-232037,-232013,-231990,-231967,-231943,-231920,-231896,-231873,-231849,-231826,-231803,-231779,-231756,-231732,-231709,-231685,-231662,-231638,-231614,-231591,-231567,-231544,-231520,-231497,-231473,-231449,-231426,-231402,-231379,-231355,-231331,-231308,-231284,-231260,-231237,-231213,-231189,-231166,-231142,-231118,-231095,-231071,-231047,-231023,-231000,-230976,-230952,-230928,-230904,-230881,-230857,-230833,-230809,-230785,-230761,-230738,-230714,-230690,-230666,-230642,-230618,-230594,-230570,-230547,-230523,-230499,-230475,-230451,-230427,-230403,-230379,-230355,-230331,-230307,-230283,-230259,-230235,-230211,-230187,-230163,-230139,-230115,-230090,-230066,-230042,-230018,-229994,-229970,-229946,-229922,-229897,-229873,-229849,-229825,-229801,-229777,-229752,-229728,-229704,-229680,-229656,-229631,-229607,-229583,-229559,-229534,-229510,-229486,-229461,-229437,-229413,-229388,-229364,-229340,-229315,-229291,-229267,-229242,-229218,-229193,-229169,-229145,-229120,-229096,-229071,-229047,-229023,-228998,-228974,-228949,-228925,-228900,-228876,-228851,-228827,-228802,-228778,-228753,-228728,-228704,-228679,-228655,-228630,-228606,-228581,-228556,-228532,-228507,-228482,-228458,-228433,-228408,-228384,-228359,-228334,-228310,-228285,-228260,-228236,-228211,-228186,-228161,-228137,-228112,-228087,-228062,-228038,-228013,-227988,-227963,-227938,-227913,-227889,-227864,-227839,-227814,-227789,-227764,-227739,-227715,-227690,-227665,-227640,-227615,-227590,-227565,-227540,-227515,-227490,-227465,-227440,-227415,-227390,-227365,-227340,-227315,-227290,-227265,-227240,-227215,-227190,-227165,-227140,-227114,-227089,-227064,-227039,-227014,-226989,-226964,-226939,-226913,-226888,-226863,-226838,-226813,-226787,-226762,-226737,-226712,-226687,-226661,-226636,-226611,-226585,-226560,-226535,-226510,-226484,-226459,-226434,-226408,-226383,-226358,-226332,-226307,-226282,-226256,-226231,-226205,-226180,-226155,-226129,-226104,-226078,-226053,-226027,-226002,-225976,-225951,-225925,-225900,-225874,-225849,-225823,-225798,-225772,-225747,-225721,-225696,-225670,-225645,-225619,-225593,-225568,-225542,-225516,-225491,-225465,-225440,-225414,-225388,-225363,-225337,-225311,-225286,-225260,-225234,-225208,-225183,-225157,-225131,-225105,-225080,-225054,-225028,-225002,-224977,-224951,-224925,-224899,-224873,-224847,-224822,-224796,-224770,-224744,-224718,-224692,-224666,-224640,-224614,-224589,-224563,-224537,-224511,-224485,-224459,-224433,-224407,-224381,-224355,-224329,-224303,-224277,-224251,-224225,-224199,-224173,-224147,-224121,-224095,-224068,-224042,-224016,-223990,-223964,-223938,-223912,-223886,-223859,-223833,-223807,-223781,-223755,-223729,-223702,-223676,-223650,-223624,-223598,-223571,-223545,-223519,-223492,-223466,-223440,-223414,-223387,-223361,-223335,-223308,-223282,-223256,-223229,-223203,-223177,-223150,-223124,-223098,-223071,-223045,-223018,-222992,-222965,-222939,-222913,-222886,-222860,-222833,-222807,-222780,-222754,-222727,-222701,-222674,-222648,-222621,-222595,-222568,-222541,-222515,-222488,-222462,-222435,-222409,-222382,-222355,-222329,-222302,-222275,-222249,-222222,-222195,-222169,-222142,-222115,-222089,-222062,-222035,-222009,-221982,-221955,-221928,-221902,-221875,-221848,-221821,-221794,-221768,-221741,-221714,-221687,-221660,-221633,-221607,-221580,-221553,-221526,-221499,-221472,-221445,-221418,-221392,-221365,-221338,-221311,-221284,-221257,-221230,-221203,-221176,-221149,-221122,-221095,-221068,-221041,-221014,-220987,-220960,-220933,-220906,-220879,-220852,-220825,-220797,-220770,-220743,-220716,-220689,-220662,-220635,-220608,-220580,-220553,-220526,-220499,-220472,-220445,-220417,-220390,-220363,-220336,-220308,-220281,-220254,-220227,-220199,-220172,-220145,-220118,-220090,-220063,-220036,-220008,-219981,-219954,-219926,-219899,-219872,-219844,-219817,-219789,-219762,-219735,-219707,-219680,-219652,-219625,-219597,-219570,-219543,-219515,-219488,-219460,-219433,-219405,-219378,-219350,-219323,-219295,-219267,-219240,-219212,-219185,-219157,-219130,-219102,-219074,-219047,-219019,-218992,-218964,-218936,-218909,-218881,-218853,-218826,-218798,-218770,-218743,-218715,-218687,-218659,-218632,-218604,-218576,-218548,-218521,-218493,-218465,-218437,-218410,-218382,-218354,-218326,-218298,-218270,-218243,-218215,-218187,-218159,-218131,-218103,-218075,-218048,-218020,-217992,-217964,-217936,-217908,-217880,-217852,-217824,-217796,-217768,-217740,-217712,-217684,-217656,-217628,-217600,-217572,-217544,-217516,-217488,-217460,-217432,-217404,-217376,-217347,-217319,-217291,-217263,-217235,-217207,-217179,-217151,-217122,-217094,-217066,-217038,-217010,-216981,-216953,-216925,-216897,-216869,-216840,-216812,-216784,-216756,-216727,-216699,-216671,-216642,-216614,-216586,-216557,-216529,-216501,-216472,-216444,-216416,-216387,-216359,-216331,-216302,-216274,-216245,-216217,-216189,-216160,-216132,-216103,-216075,-216046,-216018,-215989,-215961,-215932,-215904,-215875,-215847,-215818,-215790,-215761,-215733,-215704,-215676,-215647,-215618,-215590,-215561,-215533,-215504,-215475,-215447,-215418,-215389,-215361,-215332,-215303,-215275,-215246,-215217,-215189,-215160,-215131,-215103,-215074,-215045,-215016,-214988,-214959,-214930,-214901,-214872,-214844,-214815,-214786,-214757,-214728,-214700,-214671,-214642,-214613,-214584,-214555,-214526,-214497,-214469,-214440,-214411,-214382,-214353,-214324,-214295,-214266,-214237,-214208,-214179,-214150,-214121,-214092,-214063,-214034,-214005,-213976,-213947,-213918,-213889,-213860,-213831,-213802,-213773,-213744,-213714,-213685,-213656,-213627,-213598,-213569,-213540,-213510,-213481,-213452,-213423,-213394,-213365,-213335,-213306,-213277,-213248,-213218,-213189,-213160,-213131,-213101,-213072,-213043,-213014,-212984,-212955,-212926,-212896,-212867,-212838,-212808,-212779,-212750,-212720,-212691,-212661,-212632,-212603,-212573,-212544,-212514,-212485,-212455,-212426,-212397,-212367,-212338,-212308,-212279,-212249,-212220,-212190,-212161,-212131,-212102,-212072,-212042,-212013,-211983,-211954,-211924,-211895,-211865,-211835,-211806,-211776,-211747,-211717,-211687,-211658,-211628,-211598,-211569,-211539,-211509,-211480,-211450,-211420,-211390,-211361,-211331,-211301,-211271,-211242,-211212,-211182,-211152,-211123,-211093,-211063,-211033,-211003,-210973,-210944,-210914,-210884,-210854,-210824,-210794,-210764,-210735,-210705,-210675,-210645,-210615,-210585,-210555,-210525,-210495,-210465,-210435,-210405,-210375,-210345,-210315,-210285,-210255,-210225,-210195,-210165,-210135,-210105,-210075,-210045,-210015,-209985,-209955,-209925,-209894,-209864,-209834,-209804,-209774,-209744,-209714,-209683,-209653,-209623,-209593,-209563,-209533,-209502,-209472,-209442,-209412,-209381,-209351,-209321,-209291,-209260,-209230,-209200,-209169,-209139,-209109,-209079,-209048,-209018,-208988,-208957,-208927,-208896,-208866,-208836,-208805,-208775,-208745,-208714,-208684,-208653,-208623,-208592,-208562,-208532,-208501,-208471,-208440,-208410,-208379,-208349,-208318,-208288,-208257,-208227,-208196,-208165,-208135,-208104,-208074,-208043,-208013,-207982,-207951,-207921,-207890,-207860,-207829,-207798,-207768,-207737,-207706,-207676,-207645,-207614,-207584,-207553,-207522,-207491,-207461,-207430,-207399,-207369,-207338,-207307,-207276,-207245,-207215,-207184,-207153,-207122,-207091,-207061,-207030,-206999,-206968,-206937,-206906,-206876,-206845,-206814,-206783,-206752,-206721,-206690,-206659,-206628,-206597,-206566,-206536,-206505,-206474,-206443,-206412,-206381,-206350,-206319,-206288,-206257,-206226,-206195,-206164,-206132,-206101,-206070,-206039,-206008,-205977,-205946,-205915,-205884,-205853,-205822,-205790,-205759,-205728,-205697,-205666,-205635,-205603,-205572,-205541,-205510,-205479,-205447,-205416,-205385,-205354,-205323,-205291,-205260,-205229,-205197,-205166,-205135,-205104,-205072,-205041,-205010,-204978,-204947,-204916,-204884,-204853,-204822,-204790,-204759,-204727,-204696,-204665,-204633,-204602,-204570,-204539,-204507,-204476,-204445,-204413,-204382,-204350,-204319,-204287,-204256,-204224,-204193,-204161,-204130,-204098,-204066,-204035,-204003,-203972,-203940,-203909,-203877,-203845,-203814,-203782,-203751,-203719,-203687,-203656,-203624,-203592,-203561,-203529,-203497,-203466,-203434,-203402,-203371,-203339,-203307,-203275,-203244,-203212,-203180,-203148,-203117,-203085,-203053,-203021,-202989,-202958,-202926,-202894,-202862,-202830,-202798,-202767,-202735,-202703,-202671,-202639,-202607,-202575,-202543,-202511,-202480,-202448,-202416,-202384,-202352,-202320,-202288,-202256,-202224,-202192,-202160,-202128,-202096,-202064,-202032,-202000,-201968,-201936,-201904,-201872,-201840,-201807,-201775,-201743,-201711,-201679,-201647,-201615,-201583,-201551,-201518,-201486,-201454,-201422,-201390,-201358,-201325,-201293,-201261,-201229,-201197,-201164,-201132,-201100,-201068,-201035,-201003,-200971,-200939,-200906,-200874,-200842,-200809,-200777,-200745,-200712,-200680,-200648,-200615,-200583,-200551,-200518,-200486,-200453,-200421,-200389,-200356,-200324,-200291,-200259,-200227,-200194,-200162,-200129,-200097,-200064,-200032,-199999,-199967,-199934,-199902,-199869,-199837,-199804,-199772,-199739,-199707,-199674,-199641,-199609,-199576,-199544,-199511,-199478,-199446,-199413,-199381,-199348,-199315,-199283,-199250,-199217,-199185,-199152,-199119,-199087,-199054,-199021,-198988,-198956,-198923,-198890,-198857,-198825,-198792,-198759,-198726,-198694,-198661,-198628,-198595,-198562,-198530,-198497,-198464,-198431,-198398,-198365,-198333,-198300,-198267,-198234,-198201,-198168,-198135,-198102,-198069,-198036,-198003,-197971,-197938,-197905,-197872,-197839,-197806,-197773,-197740,-197707,-197674,-197641,-197608,-197575,-197542,-197509,-197475,-197442,-197409,-197376,-197343,-197310,-197277,-197244,-197211,-197178,-197145,-197111,-197078,-197045,-197012,-196979,-196946,-196912,-196879,-196846,-196813,-196780,-196746,-196713,-196680,-196647,-196614,-196580,-196547,-196514,-196480,-196447,-196414,-196381,-196347,-196314,-196281,-196247,-196214,-196181,-196147,-196114,-196081,-196047,-196014,-195981,-195947,-195914,-195880,-195847,-195814,-195780,-195747,-195713,-195680,-195646,-195613,-195579,-195546,-195512,-195479,-195445,-195412,-195378,-195345,-195311,-195278,-195244,-195211,-195177,-195144,-195110,-195077,-195043,-195009,-194976,-194942,-194909,-194875,-194841,-194808,-194774,-194740,-194707,-194673,-194639,-194606,-194572,-194538,-194505,-194471,-194437,-194404,-194370,-194336,-194302,-194269,-194235,-194201,-194167,-194134,-194100,-194066,-194032,-193998,-193965,-193931,-193897,-193863,-193829,-193795,-193762,-193728,-193694,-193660,-193626,-193592,-193558,-193524,-193491,-193457,-193423,-193389,-193355,-193321,-193287,-193253,-193219,-193185,-193151,-193117,-193083,-193049,-193015,-192981,-192947,-192913,-192879,-192845,-192811,-192777,-192743,-192709,-192675,-192640,-192606,-192572,-192538,-192504,-192470,-192436,-192402,-192368,-192333,-192299,-192265,-192231,-192197,-192163,-192128,-192094,-192060,-192026,-191991,-191957,-191923,-191889,-191855,-191820,-191786,-191752,-191717,-191683,-191649,-191615,-191580,-191546,-191512,-191477,-191443,-191409,-191374,-191340,-191306,-191271,-191237,-191202,-191168,-191134,-191099,-191065,-191030,-190996,-190962,-190927,-190893,-190858,-190824,-190789,-190755,-190720,-190686,-190651,-190617,-190582,-190548,-190513,-190479,-190444,-190410,-190375,-190341,-190306,-190271,-190237,-190202,-190168,-190133,-190098,-190064,-190029,-189995,-189960,-189925,-189891,-189856,-189821,-189787,-189752,-189717,-189683,-189648,-189613,-189579,-189544,-189509,-189474,-189440,-189405,-189370,-189335,-189301,-189266,-189231,-189196,-189161,-189127,-189092,-189057,-189022,-188987,-188953,-188918,-188883,-188848,-188813,-188778,-188743,-188708,-188674,-188639,-188604,-188569,-188534,-188499,-188464,-188429,-188394,-188359,-188324,-188289,-188254,-188219,-188184,-188149,-188114,-188079,-188044,-188009,-187974,-187939,-187904,-187869,-187834,-187799,-187764,-187729,-187694,-187659,-187624,-187588,-187553,-187518,-187483,-187448,-187413,-187378,-187342,-187307,-187272,-187237,-187202,-187167,-187131,-187096,-187061,-187026,-186991,-186955,-186920,-186885,-186850,-186814,-186779,-186744,-186709,-186673,-186638,-186603,-186567,-186532,-186497,-186461,-186426,-186391,-186355,-186320,-186285,-186249,-186214,-186178,-186143,-186108,-186072,-186037,-186001,-185966,-185931,-185895,-185860,-185824,-185789,-185753,-185718,-185682,-185647,-185611,-185576,-185540,-185505,-185469,-185434,-185398,-185363,-185327,-185292,-185256,-185221,-185185,-185149,-185114,-185078,-185043,-185007,-184971,-184936,-184900,-184865,-184829,-184793,-184758,-184722,-184686,-184651,-184615,-184579,-184544,-184508,-184472,-184436,-184401,-184365,-184329,-184293,-184258,-184222,-184186,-184150,-184115,-184079,-184043,-184007,-183971,-183936,-183900,-183864,-183828,-183792,-183756,-183721,-183685,-183649,-183613,-183577,-183541,-183505,-183469,-183434,-183398,-183362,-183326,-183290,-183254,-183218,-183182,-183146,-183110,-183074,-183038,-183002,-182966,-182930,-182894,-182858,-182822,-182786,-182750,-182714,-182678,-182642,-182606,-182570,-182534,-182498,-182462,-182425,-182389,-182353,-182317,-182281,-182245,-182209,-182173,-182136,-182100,-182064,-182028,-181992,-181956,-181919,-181883,-181847,-181811,-181775,-181738,-181702,-181666,-181630,-181593,-181557,-181521,-181485,-181448,-181412,-181376,-181340,-181303,-181267,-181231,-181194,-181158,-181122,-181085,-181049,-181013,-180976,-180940,-180903,-180867,-180831,-180794,-180758,-180722,-180685,-180649,-180612,-180576,-180539,-180503,-180466,-180430,-180394,-180357,-180321,-180284,-180248,-180211,-180175,-180138,-180102,-180065,-180028,-179992,-179955,-179919,-179882,-179846,-179809,-179773,-179736,-179699,-179663,-179626,-179590,-179553,-179516,-179480,-179443,-179406,-179370,-179333,-179296,-179260,-179223,-179186,-179150,-179113,-179076,-179040,-179003,-178966,-178929,-178893,-178856,-178819,-178782,-178746,-178709,-178672,-178635,-178599,-178562,-178525,-178488,-178451,-178414,-178378,-178341,-178304,-178267,-178230,-178193,-178157,-178120,-178083,-178046,-178009,-177972,-177935,-177898,-177861,-177824,-177787,-177751,-177714,-177677,-177640,-177603,-177566,-177529,-177492,-177455,-177418,-177381,-177344,-177307,-177270,-177233,-177196,-177159,-177122,-177084,-177047,-177010,-176973,-176936,-176899,-176862,-176825,-176788,-176751,-176713,-176676,-176639,-176602,-176565,-176528,-176491,-176453,-176416,-176379,-176342,-176305,-176267,-176230,-176193,-176156,-176119,-176081,-176044,-176007,-175970,-175932,-175895,-175858,-175821,-175783,-175746,-175709,-175671,-175634,-175597,-175559,-175522,-175485,-175447,-175410,-175373,-175335,-175298,-175261,-175223,-175186,-175148,-175111,-175074,-175036,-174999,-174961,-174924,-174886,-174849,-174812,-174774,-174737,-174699,-174662,-174624,-174587,-174549,-174512,-174474,-174437,-174399,-174362,-174324,-174287,-174249,-174211,-174174,-174136,-174099,-174061,-174024,-173986,-173948,-173911,-173873,-173836,-173798,-173760,-173723,-173685,-173647,-173610,-173572,-173534,-173497,-173459,-173421,-173384,-173346,-173308,-173270,-173233,-173195,-173157,-173120,-173082,-173044,-173006,-172968,-172931,-172893,-172855,-172817,-172780,-172742,-172704,-172666,-172628,-172590,-172553,-172515,-172477,-172439,-172401,-172363,-172325,-172288,-172250,-172212,-172174,-172136,-172098,-172060,-172022,-171984,-171946,-171908,-171870,-171833,-171795,-171757,-171719,-171681,-171643,-171605,-171567,-171529,-171491,-171453,-171415,-171377,-171338,-171300,-171262,-171224,-171186,-171148,-171110,-171072,-171034,-170996,-170958,-170920,-170882,-170843,-170805,-170767,-170729,-170691,-170653,-170615,-170576,-170538,-170500,-170462,-170424,-170385,-170347,-170309,-170271,-170233,-170194,-170156,-170118,-170080,-170041,-170003,-169965,-169927,-169888,-169850,-169812,-169773,-169735,-169697,-169659,-169620,-169582,-169544,-169505,-169467,-169429,-169390,-169352,-169313,-169275,-169237,-169198,-169160,-169121,-169083,-169045,-169006,-168968,-168929,-168891,-168852,-168814,-168776,-168737,-168699,-168660,-168622,-168583,-168545,-168506,-168468,-168429,-168391,-168352,-168314,-168275,-168237,-168198,-168159,-168121,-168082,-168044,-168005,-167967,-167928,-167889,-167851,-167812,-167773,-167735,-167696,-167658,-167619,-167580,-167542,-167503,-167464,-167426,-167387,-167348,-167310,-167271,-167232,-167193,-167155,-167116,-167077,-167039,-167000,-166961,-166922,-166884,-166845,-166806,-166767,-166728,-166690,-166651,-166612,-166573,-166534,-166496,-166457,-166418,-166379,-166340,-166301,-166263,-166224,-166185,-166146,-166107,-166068,-166029,-165990,-165951,-165913,-165874,-165835,-165796,-165757,-165718,-165679,-165640,-165601,-165562,-165523,-165484,-165445,-165406,-165367,-165328,-165289,-165250,-165211,-165172,-165133,-165094,-165055,-165016,-164977,-164938,-164899,-164860,-164820,-164781,-164742,-164703,-164664,-164625,-164586,-164547,-164508,-164468,-164429,-164390,-164351,-164312,-164273,-164233,-164194,-164155,-164116,-164077,-164038,-163998,-163959,-163920,-163881,-163841,-163802,-163763,-163724,-163684,-163645,-163606,-163567,-163527,-163488,-163449,-163409,-163370,-163331,-163291,-163252,-163213,-163173,-163134,-163095,-163055,-163016,-162977,-162937,-162898,-162859,-162819,-162780,-162740,-162701,-162662,-162622,-162583,-162543,-162504,-162464,-162425,-162385,-162346,-162307,-162267,-162228,-162188,-162149,-162109,-162070,-162030,-161991,-161951,-161912,-161872,-161832,-161793,-161753,-161714,-161674,-161635,-161595,-161556,-161516,-161476,-161437,-161397,-161358,-161318,-161278,-161239,-161199,-161159,-161120,-161080,-161040,-161001,-160961,-160921,-160882,-160842,-160802,-160763,-160723,-160683,-160643,-160604,-160564,-160524,-160485,-160445,-160405,-160365,-160326,-160286,-160246,-160206,-160166,-160127,-160087,-160047,-160007,-159967,-159928,-159888,-159848,-159808,-159768,-159728,-159688,-159649,-159609,-159569,-159529,-159489,-159449,-159409,-159369,-159329,-159290,-159250,-159210,-159170,-159130,-159090,-159050,-159010,-158970,-158930,-158890,-158850,-158810,-158770,-158730,-158690,-158650,-158610,-158570,-158530,-158490,-158450,-158410,-158370,-158330,-158290,-158250,-158210,-158169,-158129,-158089,-158049,-158009,-157969,-157929,-157889,-157849,-157808,-157768,-157728,-157688,-157648,-157608,-157568,-157527,-157487,-157447,-157407,-157367,-157326,-157286,-157246,-157206,-157166,-157125,-157085,-157045,-157005,-156964,-156924,-156884,-156844,-156803,-156763,-156723,-156682,-156642,-156602,-156561,-156521,-156481,-156440,-156400,-156360,-156319,-156279,-156239,-156198,-156158,-156118,-156077,-156037,-155996,-155956,-155916,-155875,-155835,-155794,-155754,-155714,-155673,-155633,-155592,-155552,-155511,-155471,-155430,-155390,-155349,-155309,-155268,-155228,-155187,-155147,-155106,-155066,-155025,-154985,-154944,-154904,-154863,-154823,-154782,-154741,-154701,-154660,-154620,-154579,-154538,-154498,-154457,-154417,-154376,-154335,-154295,-154254,-154213,-154173,-154132,-154092,-154051,-154010,-153969,-153929,-153888,-153847,-153807,-153766,-153725,-153685,-153644,-153603,-153562,-153522,-153481,-153440,-153399,-153359,-153318,-153277,-153236,-153196,-153155,-153114,-153073,-153032,-152992,-152951,-152910,-152869,-152828,-152787,-152747,-152706,-152665,-152624,-152583,-152542,-152501,-152460,-152420,-152379,-152338,-152297,-152256,-152215,-152174,-152133,-152092,-152051,-152010,-151969,-151928,-151887,-151846,-151805,-151764,-151723,-151682,-151641,-151600,-151559,-151518,-151477,-151436,-151395,-151354,-151313,-151272,-151231,-151190,-151149,-151108,-151067,-151026,-150985,-150944,-150903,-150861,-150820,-150779,-150738,-150697,-150656,-150615,-150574,-150532,-150491,-150450,-150409,-150368,-150327,-150285,-150244,-150203,-150162,-150121,-150079,-150038,-149997,-149956,-149915,-149873,-149832,-149791,-149750,-149708,-149667,-149626,-149584,-149543,-149502,-149461,-149419,-149378,-149337,-149295,-149254,-149213,-149171,-149130,-149089,-149047,-149006,-148965,-148923,-148882,-148841,-148799,-148758,-148716,-148675,-148634,-148592,-148551,-148509,-148468,-148427,-148385,-148344,-148302,-148261,-148219,-148178,-148136,-148095,-148053,-148012,-147970,-147929,-147887,-147846,-147804,-147763,-147721,-147680,-147638,-147597,-147555,-147514,-147472,-147431,-147389,-147347,-147306,-147264,-147223,-147181,-147140,-147098,-147056,-147015,-146973,-146931,-146890,-146848,-146807,-146765,-146723,-146682,-146640,-146598,-146557,-146515,-146473,-146432,-146390,-146348,-146306,-146265,-146223,-146181,-146140,-146098,-146056,-146014,-145973,-145931,-145889,-145847,-145806,-145764,-145722,-145680,-145638,-145597,-145555,-145513,-145471,-145429,-145388,-145346,-145304,-145262,-145220,-145178,-145136,-145095,-145053,-145011,-144969,-144927,-144885,-144843,-144801,-144760,-144718,-144676,-144634,-144592,-144550,-144508,-144466,-144424,-144382,-144340,-144298,-144256,-144214,-144172,-144130,-144088,-144046,-144004,-143962,-143920,-143878,-143836,-143794,-143752,-143710,-143668,-143626,-143584,-143542,-143500,-143458,-143416,-143374,-143332,-143290,-143247,-143205,-143163,-143121,-143079,-143037,-142995,-142953,-142911,-142868,-142826,-142784,-142742,-142700,-142658,-142615,-142573,-142531,-142489,-142447,-142404,-142362,-142320,-142278,-142236,-142193,-142151,-142109,-142067,-142024,-141982,-141940,-141898,-141855,-141813,-141771,-141729,-141686,-141644,-141602,-141559,-141517,-141475,-141432,-141390,-141348,-141305,-141263,-141221,-141178,-141136,-141094,-141051,-141009,-140967,-140924,-140882,-140839,-140797,-140755,-140712,-140670,-140627,-140585,-140543,-140500,-140458,-140415,-140373,-140330,-140288,-140245,-140203,-140160,-140118,-140076,-140033,-139991,-139948,-139906,-139863,-139820,-139778,-139735,-139693,-139650,-139608,-139565,-139523,-139480,-139438,-139395,-139352,-139310,-139267,-139225,-139182,-139140,-139097,-139054,-139012,-138969,-138926,-138884,-138841,-138799,-138756,-138713,-138671,-138628,-138585,-138543,-138500,-138457,-138415,-138372,-138329,-138287,-138244,-138201,-138158,-138116,-138073,-138030,-137987,-137945,-137902,-137859,-137816,-137774,-137731,-137688,-137645,-137603,-137560,-137517,-137474,-137431,-137389,-137346,-137303,-137260,-137217,-137175,-137132,-137089,-137046,-137003,-136960,-136917,-136875,-136832,-136789,-136746,-136703,-136660,-136617,-136574,-136531,-136489,-136446,-136403,-136360,-136317,-136274,-136231,-136188,-136145,-136102,-136059,-136016,-135973,-135930,-135887,-135844,-135801,-135758,-135715,-135672,-135629,-135586,-135543,-135500,-135457,-135414,-135371,-135328,-135285,-135242,-135199,-135156,-135113,-135070,-135027,-134983,-134940,-134897,-134854,-134811,-134768,-134725,-134682,-134639,-134595,-134552,-134509,-134466,-134423,-134380,-134337,-134293,-134250,-134207,-134164,-134121,-134077,-134034,-133991,-133948,-133905,-133861,-133818,-133775,-133732,-133689,-133645,-133602,-133559,-133516,-133472,-133429,-133386,-133342,-133299,-133256,-133213,-133169,-133126,-133083,-133039,-132996,-132953,-132909,-132866,-132823,-132779,-132736,-132693,-132649,-132606,-132563,-132519,-132476,-132433,-132389,-132346,-132302,-132259,-132216,-132172,-132129,-132085,-132042,-131999,-131955,-131912,-131868,-131825,-131781,-131738,-131694,-131651,-131608,-131564,-131521,-131477,-131434,-131390,-131347,-131303,-131260,-131216,-131173,-131129,-131086,-131042,-130998,-130955,-130911,-130868,-130824,-130781,-130737,-130694,-130650,-130606,-130563,-130519,-130476,-130432,-130388,-130345,-130301,-130258,-130214,-130170,-130127,-130083,-130039,-129996,-129952,-129908,-129865,-129821,-129777,-129734,-129690,-129646,-129603,-129559,-129515,-129472,-129428,-129384,-129340,-129297,-129253,-129209,-129166,-129122,-129078,-129034,-128991,-128947,-128903,-128859,-128815,-128772,-128728,-128684,-128640,-128597,-128553,-128509,-128465,-128421,-128377,-128334,-128290,-128246,-128202,-128158,-128114,-128071,-128027,-127983,-127939,-127895,-127851,-127807,-127763,-127720,-127676,-127632,-127588,-127544,-127500,-127456,-127412,-127368,-127324,-127280,-127236,-127192,-127149,-127105,-127061,-127017,-126973,-126929,-126885,-126841,-126797,-126753,-126709,-126665,-126621,-126577,-126533,-126489,-126445,-126401,-126357,-126313,-126268,-126224,-126180,-126136,-126092,-126048,-126004,-125960,-125916,-125872,-125828,-125784,-125740,-125695,-125651,-125607,-125563,-125519,-125475,-125431,-125387,-125342,-125298,-125254,-125210,-125166,-125122,-125077,-125033,-124989,-124945,-124901,-124856,-124812,-124768,-124724,-124680,-124635,-124591,-124547,-124503,-124459,-124414,-124370,-124326,-124282,-124237,-124193,-124149,-124104,-124060,-124016,-123972,-123927,-123883,-123839,-123794,-123750,-123706,-123661,-123617,-123573,-123528,-123484,-123440,-123395,-123351,-123307,-123262,-123218,-123174,-123129,-123085,-123041,-122996,-122952,-122907,-122863,-122819,-122774,-122730,-122685,-122641,-122596,-122552,-122508,-122463,-122419,-122374,-122330,-122285,-122241,-122196,-122152,-122107,-122063,-122018,-121974,-121930,-121885,-121841,-121796,-121751,-121707,-121662,-121618,-121573,-121529,-121484,-121440,-121395,-121351,-121306,-121262,-121217,-121172,-121128,-121083,-121039,-120994,-120949,-120905,-120860,-120816,-120771,-120726,-120682,-120637,-120593,-120548,-120503,-120459,-120414,-120369,-120325,-120280,-120235,-120191,-120146,-120101,-120057,-120012,-119967,-119923,-119878,-119833,-119789,-119744,-119699,-119654,-119610,-119565,-119520,-119475,-119431,-119386,-119341,-119296,-119252,-119207,-119162,-119117,-119073,-119028,-118983,-118938,-118893,-118849,-118804,-118759,-118714,-118669,-118625,-118580,-118535,-118490,-118445,-118400,-118356,-118311,-118266,-118221,-118176,-118131,-118086,-118041,-117997,-117952,-117907,-117862,-117817,-117772,-117727,-117682,-117637,-117592,-117548,-117503,-117458,-117413,-117368,-117323,-117278,-117233,-117188,-117143,-117098,-117053,-117008,-116963,-116918,-116873,-116828,-116783,-116738,-116693,-116648,-116603,-116558,-116513,-116468,-116423,-116378,-116333,-116288,-116243,-116198,-116153,-116108,-116063,-116017,-115972,-115927,-115882,-115837,-115792,-115747,-115702,-115657,-115612,-115566,-115521,-115476,-115431,-115386,-115341,-115296,-115251,-115205,-115160,-115115,-115070,-115025,-114980,-114934,-114889,-114844,-114799,-114754,-114709,-114663,-114618,-114573,-114528,-114482,-114437,-114392,-114347,-114302,-114256,-114211,-114166,-114121,-114075,-114030,-113985,-113940,-113894,-113849,-113804,-113758,-113713,-113668,-113623,-113577,-113532,-113487,-113441,-113396,-113351,-113305,-113260,-113215,-113169,-113124,-113079,-113033,-112988,-112943,-112897,-112852,-112807,-112761,-112716,-112670,-112625,-112580,-112534,-112489,-112443,-112398,-112353,-112307,-112262,-112216,-112171,-112125,-112080,-112035,-111989,-111944,-111898,-111853,-111807,-111762,-111716,-111671,-111625,-111580,-111534,-111489,-111443,-111398,-111352,-111307,-111261,-111216,-111170,-111125,-111079,-111034,-110988,-110943,-110897,-110852,-110806,-110761,-110715,-110669,-110624,-110578,-110533,-110487,-110442,-110396,-110350,-110305,-110259,-110214,-110168,-110122,-110077,-110031,-109985,-109940,-109894,-109849,-109803,-109757,-109712,-109666,-109620,-109575,-109529,-109483,-109438,-109392,-109346,-109301,-109255,-109209,-109164,-109118,-109072,-109026,-108981,-108935,-108889,-108844,-108798,-108752,-108706,-108661,-108615,-108569,-108523,-108478,-108432,-108386,-108340,-108294,-108249,-108203,-108157,-108111,-108066,-108020,-107974,-107928,-107882,-107837,-107791,-107745,-107699,-107653,-107607,-107562,-107516,-107470,-107424,-107378,-107332,-107286,-107241,-107195,-107149,-107103,-107057,-107011,-106965,-106919,-106874,-106828,-106782,-106736,-106690,-106644,-106598,-106552,-106506,-106460,-106414,-106368,-106322,-106277,-106231,-106185,-106139,-106093,-106047,-106001,-105955,-105909,-105863,-105817,-105771,-105725,-105679,-105633,-105587,-105541,-105495,-105449,-105403,-105357,-105311,-105265,-105219,-105173,-105127,-105081,-105034,-104988,-104942,-104896,-104850,-104804,-104758,-104712,-104666,-104620,-104574,-104528,-104482,-104435,-104389,-104343,-104297,-104251,-104205,-104159,-104113,-104066,-104020,-103974,-103928,-103882,-103836,-103790,-103743,-103697,-103651,-103605,-103559,-103513,-103466,-103420,-103374,-103328,-103282,-103235,-103189,-103143,-103097,-103051,-103004,-102958,-102912,-102866,-102819,-102773,-102727,-102681,-102634,-102588,-102542,-102496,-102449,-102403,-102357,-102311,-102264,-102218,-102172,-102125,-102079,-102033,-101987,-101940,-101894,-101848,-101801,-101755,-101709,-101662,-101616,-101570,-101523,-101477,-101431,-101384,-101338,-101292,-101245,-101199,-101152,-101106,-101060,-101013,-100967,-100921,-100874,-100828,-100781,-100735,-100689,-100642,-100596,-100549,-100503,-100456,-100410,-100364,-100317,-100271,-100224,-100178,-100131,-100085,-100038,-99992,-99946,-99899,-99853,-99806,-99760,-99713,-99667,-99620,-99574,-99527,-99481,-99434,-99388,-99341,-99295,-99248,-99202,-99155,-99109,-99062,-99015,-98969,-98922,-98876,-98829,-98783,-98736,-98690,-98643,-98596,-98550,-98503,-98457,-98410,-98363,-98317,-98270,-98224,-98177,-98130,-98084,-98037,-97991,-97944,-97897,-97851,-97804,-97757,-97711,-97664,-97618,-97571,-97524,-97478,-97431,-97384,-97338,-97291,-97244,-97198,-97151,-97104,-97057,-97011,-96964,-96917,-96871,-96824,-96777,-96731,-96684,-96637,-96590,-96544,-96497,-96450,-96403,-96357,-96310,-96263,-96216,-96170,-96123,-96076,-96029,-95983,-95936,-95889,-95842,-95795,-95749,-95702,-95655,-95608,-95561,-95515,-95468,-95421,-95374,-95327,-95281,-95234,-95187,-95140,-95093,-95046,-95000,-94953,-94906,-94859,-94812,-94765,-94718,-94672,-94625,-94578,-94531,-94484,-94437,-94390,-94343,-94296,-94250,-94203,-94156,-94109,-94062,-94015,-93968,-93921,-93874,-93827,-93780,-93733,-93686,-93639,-93593,-93546,-93499,-93452,-93405,-93358,-93311,-93264,-93217,-93170,-93123,-93076,-93029,-92982,-92935,-92888,-92841,-92794,-92747,-92700,-92653,-92606,-92559,-92512,-92465,-92418,-92371,-92324,-92277,-92229,-92182,-92135,-92088,-92041,-91994,-91947,-91900,-91853,-91806,-91759,-91712,-91665,-91618,-91570,-91523,-91476,-91429,-91382,-91335,-91288,-91241,-91194,-91146,-91099,-91052,-91005,-90958,-90911,-90864,-90816,-90769,-90722,-90675,-90628,-90581,-90533,-90486,-90439,-90392,-90345,-90298,-90250,-90203,-90156,-90109,-90062,-90014,-89967,-89920,-89873,-89825,-89778,-89731,-89684,-89637,-89589,-89542,-89495,-89448,-89400,-89353,-89306,-89259,-89211,-89164,-89117,-89069,-89022,-88975,-88928,-88880,-88833,-88786,-88738,-88691,-88644,-88597,-88549,-88502,-88455,-88407,-88360,-88313,-88265,-88218,-88171,-88123,-88076,-88029,-87981,-87934,-87887,-87839,-87792,-87744,-87697,-87650,-87602,-87555,-87508,-87460,-87413,-87365,-87318,-87271,-87223,-87176,-87128,-87081,-87034,-86986,-86939,-86891,-86844,-86797,-86749,-86702,-86654,-86607,-86559,-86512,-86464,-86417,-86370,-86322,-86275,-86227,-86180,-86132,-86085,-86037,-85990,-85942,-85895,-85847,-85800,-85752,-85705,-85657,-85610,-85562,-85515,-85467,-85420,-85372,-85325,-85277,-85230,-85182,-85135,-85087,-85039,-84992,-84944,-84897,-84849,-84802,-84754,-84707,-84659,-84611,-84564,-84516,-84469,-84421,-84373,-84326,-84278,-84231,-84183,-84135,-84088,-84040,-83993,-83945,-83897,-83850,-83802,-83755,-83707,-83659,-83612,-83564,-83516,-83469,-83421,-83373,-83326,-83278,-83230,-83183,-83135,-83087,-83040,-82992,-82944,-82897,-82849,-82801,-82754,-82706,-82658,-82611,-82563,-82515,-82467,-82420,-82372,-82324,-82277,-82229,-82181,-82133,-82086,-82038,-81990,-81942,-81895,-81847,-81799,-81751,-81704,-81656,-81608,-81560,-81513,-81465,-81417,-81369,-81321,-81274,-81226,-81178,-81130,-81082,-81035,-80987,-80939,-80891,-80843,-80796,-80748,-80700,-80652,-80604,-80556,-80509,-80461,-80413,-80365,-80317,-80269,-80222,-80174,-80126,-80078,-80030,-79982,-79934,-79886,-79839,-79791,-79743,-79695,-79647,-79599,-79551,-79503,-79456,-79408,-79360,-79312,-79264,-79216,-79168,-79120,-79072,-79024,-78976,-78928,-78880,-78833,-78785,-78737,-78689,-78641,-78593,-78545,-78497,-78449,-78401,-78353,-78305,-78257,-78209,-78161,-78113,-78065,-78017,-77969,-77921,-77873,-77825,-77777,-77729,-77681,-77633,-77585,-77537,-77489,-77441,-77393,-77345,-77297,-77249,-77201,-77153,-77105,-77057,-77009,-76961,-76913,-76865,-76817,-76769,-76720,-76672,-76624,-76576,-76528,-76480,-76432,-76384,-76336,-76288,-76240,-76192,-76143,-76095,-76047,-75999,-75951,-75903,-75855,-75807,-75759,-75710,-75662,-75614,-75566,-75518,-75470,-75422,-75374,-75325,-75277,-75229,-75181,-75133,-75085,-75036,-74988,-74940,-74892,-74844,-74796,-74747,-74699,-74651,-74603,-74555,-74507,-74458,-74410,-74362,-74314,-74266,-74217,-74169,-74121,-74073,-74024,-73976,-73928,-73880,-73832,-73783,-73735,-73687,-73639,-73590,-73542,-73494,-73446,-73397,-73349,-73301,-73253,-73204,-73156,-73108,-73060,-73011,-72963,-72915,-72866,-72818,-72770,-72722,-72673,-72625,-72577,-72528,-72480,-72432,-72383,-72335,-72287,-72238,-72190,-72142,-72094,-72045,-71997,-71949,-71900,-71852,-71804,-71755,-71707,-71658,-71610,-71562,-71513,-71465,-71417,-71368,-71320,-71272,-71223,-71175,-71126,-71078,-71030,-70981,-70933,-70885,-70836,-70788,-70739,-70691,-70643,-70594,-70546,-70497,-70449,-70400,-70352,-70304,-70255,-70207,-70158,-70110,-70061,-70013,-69965,-69916,-69868,-69819,-69771,-69722,-69674,-69625,-69577,-69529,-69480,-69432,-69383,-69335,-69286,-69238,-69189,-69141,-69092,-69044,-68995,-68947,-68898,-68850,-68801,-68753,-68704,-68656,-68607,-68559,-68510,-68462,-68413,-68365,-68316,-68268,-68219,-68170,-68122,-68073,-68025,-67976,-67928,-67879,-67831,-67782,-67734,-67685,-67636,-67588,-67539,-67491,-67442,-67394,-67345,-67296,-67248,-67199,-67151,-67102,-67054,-67005,-66956,-66908,-66859,-66811,-66762,-66713,-66665,-66616,-66567,-66519,-66470,-66422,-66373,-66324,-66276,-66227,-66178,-66130,-66081,-66033,-65984,-65935,-65887,-65838,-65789,-65741,-65692,-65643,-65595,-65546,-65497,-65449,-65400,-65351,-65303,-65254,-65205,-65157,-65108,-65059,-65010,-64962,-64913,-64864,-64816,-64767,-64718,-64670,-64621,-64572,-64523,-64475,-64426,-64377,-64328,-64280,-64231,-64182,-64134,-64085,-64036,-63987,-63939,-63890,-63841,-63792,-63744,-63695,-63646,-63597,-63549,-63500,-63451,-63402,-63353,-63305,-63256,-63207,-63158,-63110,-63061,-63012,-62963,-62914,-62866,-62817,-62768,-62719,-62670,-62622,-62573,-62524,-62475,-62426,-62377,-62329,-62280,-62231,-62182,-62133,-62084,-62036,-61987,-61938,-61889,-61840,-61791,-61743,-61694,-61645,-61596,-61547,-61498,-61449,-61401,-61352,-61303,-61254,-61205,-61156,-61107,-61058,-61010,-60961,-60912,-60863,-60814,-60765,-60716,-60667,-60618,-60569,-60521,-60472,-60423,-60374,-60325,-60276,-60227,-60178,-60129,-60080,-60031,-59982,-59934,-59885,-59836,-59787,-59738,-59689,-59640,-59591,-59542,-59493,-59444,-59395,-59346,-59297,-59248,-59199,-59150,-59101,-59052,-59003,-58954,-58905,-58856,-58807,-58758,-58710,-58661,-58612,-58563,-58514,-58465,-58416,-58367,-58318,-58269,-58220,-58170,-58121,-58072,-58023,-57974,-57925,-57876,-57827,-57778,-57729,-57680,-57631,-57582,-57533,-57484,-57435,-57386,-57337,-57288,-57239,-57190,-57141,-57092,-57043,-56994,-56945,-56895,-56846,-56797,-56748,-56699,-56650,-56601,-56552,-56503,-56454,-56405,-56356,-56307,-56257,-56208,-56159,-56110,-56061,-56012,-55963,-55914,-55865,-55815,-55766,-55717,-55668,-55619,-55570,-55521,-55472,-55423,-55373,-55324,-55275,-55226,-55177,-55128,-55079,-55029,-54980,-54931,-54882,-54833,-54784,-54735,-54685,-54636,-54587,-54538,-54489,-54440,-54390,-54341,-54292,-54243,-54194,-54144,-54095,-54046,-53997,-53948,-53899,-53849,-53800,-53751,-53702,-53653,-53603,-53554,-53505,-53456,-53407,-53357,-53308,-53259,-53210,-53160,-53111,-53062,-53013,-52964,-52914,-52865,-52816,-52767,-52717,-52668,-52619,-52570,-52520,-52471,-52422,-52373,-52323,-52274,-52225,-52176,-52126,-52077,-52028,-51979,-51929,-51880,-51831,-51781,-51732,-51683,-51634,-51584,-51535,-51486,-51437,-51387,-51338,-51289,-51239,-51190,-51141,-51091,-51042,-50993,-50944,-50894,-50845,-50796,-50746,-50697,-50648,-50598,-50549,-50500,-50450,-50401,-50352,-50302,-50253,-50204,-50154,-50105,-50056,-50006,-49957,-49908,-49858,-49809,-49760,-49710,-49661,-49612,-49562,-49513,-49463,-49414,-49365,-49315,-49266,-49217,-49167,-49118,-49069,-49019,-48970,-48920,-48871,-48822,-48772,-48723,-48673,-48624,-48575,-48525,-48476,-48426,-48377,-48328,-48278,-48229,-48179,-48130,-48081,-48031,-47982,-47932,-47883,-47834,-47784,-47735,-47685,-47636,-47586,-47537,-47488,-47438,-47389,-47339,-47290,-47240,-47191,-47141,-47092,-47043,-46993,-46944,-46894,-46845,-46795,-46746,-46696,-46647,-46597,-46548,-46499,-46449,-46400,-46350,-46301,-46251,-46202,-46152,-46103,-46053,-46004,-45954,-45905,-45855,-45806,-45756,-45707,-45657,-45608,-45558,-45509,-45459,-45410,-45360,-45311,-45261,-45212,-45162,-45113,-45063,-45014,-44964,-44915,-44865,-44816,-44766,-44717,-44667,-44618,-44568,-44518,-44469,-44419,-44370,-44320,-44271,-44221,-44172,-44122,-44073,-44023,-43973,-43924,-43874,-43825,-43775,-43726,-43676,-43627,-43577,-43527,-43478,-43428,-43379,-43329,-43280,-43230,-43180,-43131,-43081,-43032,-42982,-42932,-42883,-42833,-42784,-42734,-42685,-42635,-42585,-42536,-42486,-42437,-42387,-42337,-42288,-42238,-42189,-42139,-42089,-42040,-41990,-41940,-41891,-41841,-41792,-41742,-41692,-41643,-41593,-41543,-41494,-41444,-41395,-41345,-41295,-41246,-41196,-41146,-41097,-41047,-40997,-40948,-40898,-40848,-40799,-40749,-40700,-40650,-40600,-40551,-40501,-40451,-40402,-40352,-40302,-40253,-40203,-40153,-40104,-40054,-40004,-39955,-39905,-39855,-39805,-39756,-39706,-39656,-39607,-39557,-39507,-39458,-39408,-39358,-39309,-39259,-39209,-39159,-39110,-39060,-39010,-38961,-38911,-38861,-38812,-38762,-38712,-38662,-38613,-38563,-38513,-38464,-38414,-38364,-38314,-38265,-38215,-38165,-38115,-38066,-38016,-37966,-37916,-37867,-37817,-37767,-37718,-37668,-37618,-37568,-37519,-37469,-37419,-37369,-37320,-37270,-37220,-37170,-37121,-37071,-37021,-36971,-36921,-36872,-36822,-36772,-36722,-36673,-36623,-36573,-36523,-36474,-36424,-36374,-36324,-36274,-36225,-36175,-36125,-36075,-36026,-35976,-35926,-35876,-35826,-35777,-35727,-35677,-35627,-35577,-35528,-35478,-35428,-35378,-35328,-35279,-35229,-35179,-35129,-35079,-35029,-34980,-34930,-34880,-34830,-34780,-34731,-34681,-34631,-34581,-34531,-34481,-34432,-34382,-34332,-34282,-34232,-34182,-34133,-34083,-34033,-33983,-33933,-33883,-33834,-33784,-33734,-33684,-33634,-33584,-33534,-33485,-33435,-33385,-33335,-33285,-33235,-33185,-33136,-33086,-33036,-32986,-32936,-32886,-32836,-32787,-32737,-32687,-32637,-32587,-32537,-32487,-32437,-32388,-32338,-32288,-32238,-32188,-32138,-32088,-32038,-31988,-31939,-31889,-31839,-31789,-31739,-31689,-31639,-31589,-31539,-31489,-31440,-31390,-31340,-31290,-31240,-31190,-31140,-31090,-31040,-30990,-30941,-30891,-30841,-30791,-30741,-30691,-30641,-30591,-30541,-30491,-30441,-30391,-30341,-30292,-30242,-30192,-30142,-30092,-30042,-29992,-29942,-29892,-29842,-29792,-29742,-29692,-29642,-29592,-29542,-29493,-29443,-29393,-29343,-29293,-29243,-29193,-29143,-29093,-29043,-28993,-28943,-28893,-28843,-28793,-28743,-28693,-28643,-28593,-28543,-28493,-28443,-28393,-28343,-28294,-28244,-28194,-28144,-28094,-28044,-27994,-27944,-27894,-27844,-27794,-27744,-27694,-27644,-27594,-27544,-27494,-27444,-27394,-27344,-27294,-27244,-27194,-27144,-27094,-27044,-26994,-26944,-26894,-26844,-26794,-26744,-26694,-26644,-26594,-26544,-26494,-26444,-26394,-26344,-26294,-26244,-26194,-26144,-26094,-26044,-25994,-25944,-25894,-25844,-25794,-25744,-25694,-25644,-25594,-25544,-25494,-25443,-25393,-25343,-25293,-25243,-25193,-25143,-25093,-25043,-24993,-24943,-24893,-24843,-24793,-24743,-24693,-24643,-24593,-24543,-24493,-24443,-24393,-24343,-24293,-24243,-24192,-24142,-24092,-24042,-23992,-23942,-23892,-23842,-23792,-23742,-23692,-23642,-23592,-23542,-23492,-23442,-23392,-23341,-23291,-23241,-23191,-23141,-23091,-23041,-22991,-22941,-22891,-22841,-22791,-22741,-22691,-22640,-22590,-22540,-22490,-22440,-22390,-22340,-22290,-22240,-22190,-22140,-22090,-22039,-21989,-21939,-21889,-21839,-21789,-21739,-21689,-21639,-21589,-21539,-21488,-21438,-21388,-21338,-21288,-21238,-21188,-21138,-21088,-21038,-20987,-20937,-20887,-20837,-20787,-20737,-20687,-20637,-20587,-20537,-20486,-20436,-20386,-20336,-20286,-20236,-20186,-20136,-20085,-20035,-19985,-19935,-19885,-19835,-19785,-19735,-19685,-19634,-19584,-19534,-19484,-19434,-19384,-19334,-19284,-19233,-19183,-19133,-19083,-19033,-18983,-18933,-18882,-18832,-18782,-18732,-18682,-18632,-18582,-18531,-18481,-18431,-18381,-18331,-18281,-18231,-18180,-18130,-18080,-18030,-17980,-17930,-17880,-17829,-17779,-17729,-17679,-17629,-17579,-17529,-17478,-17428,-17378,-17328,-17278,-17228,-17177,-17127,-17077,-17027,-16977,-16927,-16877,-16826,-16776,-16726,-16676,-16626,-16576,-16525,-16475,-16425,-16375,-16325,-16275,-16224,-16174,-16124,-16074,-16024,-15974,-15923,-15873,-15823,-15773,-15723,-15672,-15622,-15572,-15522,-15472,-15422,-15371,-15321,-15271,-15221,-15171,-15121,-15070,-15020,-14970,-14920,-14870,-14819,-14769,-14719,-14669,-14619,-14568,-14518,-14468,-14418,-14368,-14318,-14267,-14217,-14167,-14117,-14067,-14016,-13966,-13916,-13866,-13816,-13765,-13715,-13665,-13615,-13565,-13514,-13464,-13414,-13364,-13314,-13263,-13213,-13163,-13113,-13063,-13012,-12962,-12912,-12862,-12812,-12761,-12711,-12661,-12611,-12561,-12510,-12460,-12410,-12360,-12310,-12259,-12209,-12159,-12109,-12058,-12008,-11958,-11908,-11858,-11807,-11757,-11707,-11657,-11607,-11556,-11506,-11456,-11406,-11355,-11305,-11255,-11205,-11155,-11104,-11054,-11004,-10954,-10903,-10853,-10803,-10753,-10703,-10652,-10602,-10552,-10502,-10451,-10401,-10351,-10301,-10251,-10200,-10150,-10100,-10050,-9999,-9949,-9899,-9849,-9798,-9748,-9698,-9648,-9598,-9547,-9497,-9447,-9397,-9346,-9296,-9246,-9196,-9145,-9095,-9045,-8995,-8945,-8894,-8844,-8794,-8744,-8693,-8643,-8593,-8543,-8492,-8442,-8392,-8342,-8291,-8241,-8191,-8141,-8090,-8040,-7990,-7940,-7889,-7839,-7789,-7739,-7689,-7638,-7588,-7538,-7488,-7437,-7387,-7337,-7287,-7236,-7186,-7136,-7086,-7035,-6985,-6935,-6885,-6834,-6784,-6734,-6684,-6633,-6583,-6533,-6483,-6432,-6382,-6332,-6282,-6231,-6181,-6131,-6081,-6030,-5980,-5930,-5880,-5829,-5779,-5729,-5679,-5628,-5578,-5528,-5478,-5427,-5377,-5327,-5277,-5226,-5176,-5126,-5075,-5025,-4975,-4925,-4874,-4824,-4774,-4724,-4673,-4623,-4573,-4523,-4472,-4422,-4372,-4322,-4271,-4221,-4171,-4121,-4070,-4020,-3970,-3920,-3869,-3819,-3769,-3719,-3668,-3618,-3568,-3517,-3467,-3417,-3367,-3316,-3266,-3216,-3166,-3115,-3065,-3015,-2965,-2914,-2864,-2814,-2764,-2713,-2663,-2613,-2562,-2512,-2462,-2412,-2361,-2311,-2261,-2211,-2160,-2110,-2060,-2010,-1959,-1909,-1859,-1809,-1758,-1708,-1658,-1607,-1557,-1507,-1457,-1406,-1356,-1306,-1256,-1205,-1155,-1105,-1055,-1004,-954,-904,-854,-803,-753,-703,-652,-602,-552,-502,-451,-401,-351,-301,-250,-200,-150,-100,-49,0,50,101,151,201,251,302,352,402,452,503,553,603,653,704,754,804,855,905,955,1005,1056,1106,1156,1206,1257,1307,1357,1407,1458,1508,1558,1608,1659,1709,1759,1810,1860,1910,1960,2011,2061,2111,2161,2212,2262,2312,2362,2413,2463,2513,2563,2614,2664,2714,2765,2815,2865,2915,2966,3016,3066,3116,3167,3217,3267,3317,3368,3418,3468,3518,3569,3619,3669,3720,3770,3820,3870,3921,3971,4021,4071,4122,4172,4222,4272,4323,4373,4423,4473,4524,4574,4624,4674,4725,4775,4825,4875,4926,4976,5026,5076,5127,5177,5227,5278,5328,5378,5428,5479,5529,5579,5629,5680,5730,5780,5830,5881,5931,5981,6031,6082,6132,6182,6232,6283,6333,6383,6433,6484,6534,6584,6634,6685,6735,6785,6835,6886,6936,6986,7036,7087,7137,7187,7237,7288,7338,7388,7438,7489,7539,7589,7639,7690,7740,7790,7840,7890,7941,7991,8041,8091,8142,8192,8242,8292,8343,8393,8443,8493,8544,8594,8644,8694,8745,8795,8845,8895,8946,8996,9046,9096,9146,9197,9247,9297,9347,9398,9448,9498,9548,9599,9649,9699,9749,9799,9850,9900,9950,10000,10051,10101,10151,10201,10252,10302,10352,10402,10452,10503,10553,10603,10653,10704,10754,10804,10854,10904,10955,11005,11055,11105,11156,11206,11256,11306,11356,11407,11457,11507,11557,11608,11658,11708,11758,11808,11859,11909,11959,12009,12059,12110,12160,12210,12260,12311,12361,12411,12461,12511,12562,12612,12662,12712,12762,12813,12863,12913,12963,13013,13064,13114,13164,13214,13264,13315,13365,13415,13465,13515,13566,13616,13666,13716,13766,13817,13867,13917,13967,14017,14068,14118,14168,14218,14268,14319,14369,14419,14469,14519,14569,14620,14670,14720,14770,14820,14871,14921,14971,15021,15071,15122,15172,15222,15272,15322,15372,15423,15473,15523,15573,15623,15673,15724,15774,15824,15874,15924,15975,16025,16075,16125,16175,16225,16276,16326,16376,16426,16476,16526,16577,16627,16677,16727,16777,16827,16878,16928,16978,17028,17078,17128,17178,17229,17279,17329,17379,17429,17479,17530,17580,17630,17680,17730,17780,17830,17881,17931,17981,18031,18081,18131,18181,18232,18282,18332,18382,18432,18482,18532,18583,18633,18683,18733,18783,18833,18883,18934,18984,19034,19084,19134,19184,19234,19285,19335,19385,19435,19485,19535,19585,19635,19686,19736,19786,19836,19886,19936,19986,20036,20086,20137,20187,20237,20287,20337,20387,20437,20487,20538,20588,20638,20688,20738,20788,20838,20888,20938,20988,21039,21089,21139,21189,21239,21289,21339,21389,21439,21489,21540,21590,21640,21690,21740,21790,21840,21890,21940,21990,22040,22091,22141,22191,22241,22291,22341,22391,22441,22491,22541,22591,22641,22692,22742,22792,22842,22892,22942,22992,23042,23092,23142,23192,23242,23292,23342,23393,23443,23493,23543,23593,23643,23693,23743,23793,23843,23893,23943,23993,24043,24093,24143,24193,24244,24294,24344,24394,24444,24494,24544,24594,24644,24694,24744,24794,24844,24894,24944,24994,25044,25094,25144,25194,25244,25294,25344,25394,25444,25495,25545,25595,25645,25695,25745,25795,25845,25895,25945,25995,26045,26095,26145,26195,26245,26295,26345,26395,26445,26495,26545,26595,26645,26695,26745,26795,26845,26895,26945,26995,27045,27095,27145,27195,27245,27295,27345,27395,27445,27495,27545,27595,27645,27695,27745,27795,27845,27895,27945,27995,28045,28095,28145,28195,28245,28295,28344,28394,28444,28494,28544,28594,28644,28694,28744,28794,28844,28894,28944,28994,29044,29094,29144,29194,29244,29294,29344,29394,29444,29494,29543,29593,29643,29693,29743,29793,29843,29893,29943,29993,30043,30093,30143,30193,30243,30293,30342,30392,30442,30492,30542,30592,30642,30692,30742,30792,30842,30892,30942,30991,31041,31091,31141,31191,31241,31291,31341,31391,31441,31490,31540,31590,31640,31690,31740,31790,31840,31890,31940,31989,32039,32089,32139,32189,32239,32289,32339,32389,32438,32488,32538,32588,32638,32688,32738,32788,32837,32887,32937,32987,33037,33087,33137,33186,33236,33286,33336,33386,33436,33486,33535,33585,33635,33685,33735,33785,33835,33884,33934,33984,34034,34084,34134,34183,34233,34283,34333,34383,34433,34482,34532,34582,34632,34682,34732,34781,34831,34881,34931,34981,35030,35080,35130,35180,35230,35280,35329,35379,35429,35479,35529,35578,35628,35678,35728,35778,35827,35877,35927,35977,36027,36076,36126,36176,36226,36275,36325,36375,36425,36475,36524,36574,36624,36674,36723,36773,36823,36873,36922,36972,37022,37072,37122,37171,37221,37271,37321,37370,37420,37470,37520,37569,37619,37669,37719,37768,37818,37868,37917,37967,38017,38067,38116,38166,38216,38266,38315,38365,38415,38465,38514,38564,38614,38663,38713,38763,38813,38862,38912,38962,39011,39061,39111,39160,39210,39260,39310,39359,39409,39459,39508,39558,39608,39657,39707,39757,39806,39856,39906,39956,40005,40055,40105,40154,40204,40254,40303,40353,40403,40452,40502,40552,40601,40651,40701,40750,40800,40849,40899,40949,40998,41048,41098,41147,41197,41247,41296,41346,41396,41445,41495,41544,41594,41644,41693,41743,41793,41842,41892,41941,41991,42041,42090,42140,42190,42239,42289,42338,42388,42438,42487,42537,42586,42636,42686,42735,42785,42834,42884,42933,42983,43033,43082,43132,43181,43231,43281,43330,43380,43429,43479,43528,43578,43628,43677,43727,43776,43826,43875,43925,43974,44024,44074,44123,44173,44222,44272,44321,44371,44420,44470,44519,44569,44619,44668,44718,44767,44817,44866,44916,44965,45015,45064,45114,45163,45213,45262,45312,45361,45411,45460,45510,45559,45609,45658,45708,45757,45807,45856,45906,45955,46005,46054,46104,46153,46203,46252,46302,46351,46401,46450,46500,46549,46598,46648,46697,46747,46796,46846,46895,46945,46994,47044,47093,47142,47192,47241,47291,47340,47390,47439,47489,47538,47587,47637,47686,47736,47785,47835,47884,47933,47983,48032,48082,48131,48180,48230,48279,48329,48378,48427,48477,48526,48576,48625,48674,48724,48773,48823,48872,48921,48971,49020,49070,49119,49168,49218,49267,49316,49366,49415,49464,49514,49563,49613,49662,49711,49761,49810,49859,49909,49958,50007,50057,50106,50155,50205,50254,50303,50353,50402,50451,50501,50550,50599,50649,50698,50747,50797,50846,50895,50945,50994,51043,51092,51142,51191,51240,51290,51339,51388,51438,51487,51536,51585,51635,51684,51733,51782,51832,51881,51930,51980,52029,52078,52127,52177,52226,52275,52324,52374,52423,52472,52521,52571,52620,52669,52718,52768,52817,52866,52915,52965,53014,53063,53112,53161,53211,53260,53309,53358,53408,53457,53506,53555,53604,53654,53703,53752,53801,53850,53900,53949,53998,54047,54096,54145,54195,54244,54293,54342,54391,54441,54490,54539,54588,54637,54686,54736,54785,54834,54883,54932,54981,55030,55080,55129,55178,55227,55276,55325,55374,55424,55473,55522,55571,55620,55669,55718,55767,55816,55866,55915,55964,56013,56062,56111,56160,56209,56258,56308,56357,56406,56455,56504,56553,56602,56651,56700,56749,56798,56847,56896,56946,56995,57044,57093,57142,57191,57240,57289,57338,57387,57436,57485,57534,57583,57632,57681,57730,57779,57828,57877,57926,57975,58024,58073,58122,58171,58221,58270,58319,58368,58417,58466,58515,58564,58613,58662,58711,58759,58808,58857,58906,58955,59004,59053,59102,59151,59200,59249,59298,59347,59396,59445,59494,59543,59592,59641,59690,59739,59788,59837,59886,59935,59983,60032,60081,60130,60179,60228,60277,60326,60375,60424,60473,60522,60570,60619,60668,60717,60766,60815,60864,60913,60962,61011,61059,61108,61157,61206,61255,61304,61353,61402,61450,61499,61548,61597,61646,61695,61744,61792,61841,61890,61939,61988,62037,62085,62134,62183,62232,62281,62330,62378,62427,62476,62525,62574,62623,62671,62720,62769,62818,62867,62915,62964,63013,63062,63111,63159,63208,63257,63306,63354,63403,63452,63501,63550,63598,63647,63696,63745,63793,63842,63891,63940,63988,64037,64086,64135,64183,64232,64281,64329,64378,64427,64476,64524,64573,64622,64671,64719,64768,64817,64865,64914,64963,65011,65060,65109,65158,65206,65255,65304,65352,65401,65450,65498,65547,65596,65644,65693,65742,65790,65839,65888,65936,65985,66034,66082,66131,66179,66228,66277,66325,66374,66423,66471,66520,66568,66617,66666,66714,66763,66812,66860,66909,66957,67006,67055,67103,67152,67200,67249,67297,67346,67395,67443,67492,67540,67589,67637,67686,67735,67783,67832,67880,67929,67977,68026,68074,68123,68171,68220,68269,68317,68366,68414,68463,68511,68560,68608,68657,68705,68754,68802,68851,68899,68948,68996,69045,69093,69142,69190,69239,69287,69336,69384,69433,69481,69530,69578,69626,69675,69723,69772,69820,69869,69917,69966,70014,70062,70111,70159,70208,70256,70305,70353,70401,70450,70498,70547,70595,70644,70692,70740,70789,70837,70886,70934,70982,71031,71079,71127,71176,71224,71273,71321,71369,71418,71466,71514,71563,71611,71659,71708,71756,71805,71853,71901,71950,71998,72046,72095,72143,72191,72239,72288,72336,72384,72433,72481,72529,72578,72626,72674,72723,72771,72819,72867,72916,72964,73012,73061,73109,73157,73205,73254,73302,73350,73398,73447,73495,73543,73591,73640,73688,73736,73784,73833,73881,73929,73977,74025,74074,74122,74170,74218,74267,74315,74363,74411,74459,74508,74556,74604,74652,74700,74748,74797,74845,74893,74941,74989,75037,75086,75134,75182,75230,75278,75326,75375,75423,75471,75519,75567,75615,75663,75711,75760,75808,75856,75904,75952,76000,76048,76096,76144,76193,76241,76289,76337,76385,76433,76481,76529,76577,76625,76673,76721,76770,76818,76866,76914,76962,77010,77058,77106,77154,77202,77250,77298,77346,77394,77442,77490,77538,77586,77634,77682,77730,77778,77826,77874,77922,77970,78018,78066,78114,78162,78210,78258,78306,78354,78402,78450,78498,78546,78594,78642,78690,78738,78786,78834,78881,78929,78977,79025,79073,79121,79169,79217,79265,79313,79361,79409,79457,79504,79552,79600,79648,79696,79744,79792,79840,79887,79935,79983,80031,80079,80127,80175,80223,80270,80318,80366,80414,80462,80510,80557,80605,80653,80701,80749,80797,80844,80892,80940,80988,81036,81083,81131,81179,81227,81275,81322,81370,81418,81466,81514,81561,81609,81657,81705,81752,81800,81848,81896,81943,81991,82039,82087,82134,82182,82230,82278,82325,82373,82421,82468,82516,82564,82612,82659,82707,82755,82802,82850,82898,82945,82993,83041,83088,83136,83184,83231,83279,83327,83374,83422,83470,83517,83565,83613,83660,83708,83756,83803,83851,83898,83946,83994,84041,84089,84136,84184,84232,84279,84327,84374,84422,84470,84517,84565,84612,84660,84708,84755,84803,84850,84898,84945,84993,85040,85088,85136,85183,85231,85278,85326,85373,85421,85468,85516,85563,85611,85658,85706,85753,85801,85848,85896,85943,85991,86038,86086,86133,86181,86228,86276,86323,86371,86418,86465,86513,86560,86608,86655,86703,86750,86798,86845,86892,86940,86987,87035,87082,87129,87177,87224,87272,87319,87366,87414,87461,87509,87556,87603,87651,87698,87745,87793,87840,87888,87935,87982,88030,88077,88124,88172,88219,88266,88314,88361,88408,88456,88503,88550,88598,88645,88692,88739,88787,88834,88881,88929,88976,89023,89070,89118,89165,89212,89260,89307,89354,89401,89449,89496,89543,89590,89638,89685,89732,89779,89826,89874,89921,89968,90015,90063,90110,90157,90204,90251,90299,90346,90393,90440,90487,90534,90582,90629,90676,90723,90770,90817,90865,90912,90959,91006,91053,91100,91147,91195,91242,91289,91336,91383,91430,91477,91524,91571,91619,91666,91713,91760,91807,91854,91901,91948,91995,92042,92089,92136,92183,92230,92278,92325,92372,92419,92466,92513,92560,92607,92654,92701,92748,92795,92842,92889,92936,92983,93030,93077,93124,93171,93218,93265,93312,93359,93406,93453,93500,93547,93594,93640,93687,93734,93781,93828,93875,93922,93969,94016,94063,94110,94157,94204,94251,94297,94344,94391,94438,94485,94532,94579,94626,94673,94719,94766,94813,94860,94907,94954,95001,95047,95094,95141,95188,95235,95282,95328,95375,95422,95469,95516,95562,95609,95656,95703,95750,95796,95843,95890,95937,95984,96030,96077,96124,96171,96217,96264,96311,96358,96404,96451,96498,96545,96591,96638,96685,96732,96778,96825,96872,96918,96965,97012,97058,97105,97152,97199,97245,97292,97339,97385,97432,97479,97525,97572,97619,97665,97712,97758,97805,97852,97898,97945,97992,98038,98085,98131,98178,98225,98271,98318,98364,98411,98458,98504,98551,98597,98644,98691,98737,98784,98830,98877,98923,98970,99016,99063,99110,99156,99203,99249,99296,99342,99389,99435,99482,99528,99575,99621,99668,99714,99761,99807,99854,99900,99947,99993,100039,100086,100132,100179,100225,100272,100318,100365,100411,100457,100504,100550,100597,100643,100690,100736,100782,100829,100875,100922,100968,101014,101061,101107,101153,101200,101246,101293,101339,101385,101432,101478,101524,101571,101617,101663,101710,101756,101802,101849,101895,101941,101988,102034,102080,102126,102173,102219,102265,102312,102358,102404,102450,102497,102543,102589,102635,102682,102728,102774,102820,102867,102913,102959,103005,103052,103098,103144,103190,103236,103283,103329,103375,103421,103467,103514,103560,103606,103652,103698,103744,103791,103837,103883,103929,103975,104021,104067,104114,104160,104206,104252,104298,104344,104390,104436,104483,104529,104575,104621,104667,104713,104759,104805,104851,104897,104943,104989,105035,105082,105128,105174,105220,105266,105312,105358,105404,105450,105496,105542,105588,105634,105680,105726,105772,105818,105864,105910,105956,106002,106048,106094,106140,106186,106232,106278,106323,106369,106415,106461,106507,106553,106599,106645,106691,106737,106783,106829,106875,106920,106966,107012,107058,107104,107150,107196,107242,107287,107333,107379,107425,107471,107517,107563,107608,107654,107700,107746,107792,107838,107883,107929,107975,108021,108067,108112,108158,108204,108250,108295,108341,108387,108433,108479,108524,108570,108616,108662,108707,108753,108799,108845,108890,108936,108982,109027,109073,109119,109165,109210,109256,109302,109347,109393,109439,109484,109530,109576,109621,109667,109713,109758,109804,109850,109895,109941,109986,110032,110078,110123,110169,110215,110260,110306,110351,110397,110443,110488,110534,110579,110625,110670,110716,110762,110807,110853,110898,110944,110989,111035,111080,111126,111171,111217,111262,111308,111353,111399,111444,111490,111535,111581,111626,111672,111717,111763,111808,111854,111899,111945,111990,112036,112081,112126,112172,112217,112263,112308,112354,112399,112444,112490,112535,112581,112626,112671,112717,112762,112808,112853,112898,112944,112989,113034,113080,113125,113170,113216,113261,113306,113352,113397,113442,113488,113533,113578,113624,113669,113714,113759,113805,113850,113895,113941,113986,114031,114076,114122,114167,114212,114257,114303,114348,114393,114438,114483,114529,114574,114619,114664,114710,114755,114800,114845,114890,114935,114981,115026,115071,115116,115161,115206,115252,115297,115342,115387,115432,115477,115522,115567,115613,115658,115703,115748,115793,115838,115883,115928,115973,116018,116064,116109,116154,116199,116244,116289,116334,116379,116424,116469,116514,116559,116604,116649,116694,116739,116784,116829,116874,116919,116964,117009,117054,117099,117144,117189,117234,117279,117324,117369,117414,117459,117504,117549,117593,117638,117683,117728,117773,117818,117863,117908,117953,117998,118042,118087,118132,118177,118222,118267,118312,118357,118401,118446,118491,118536,118581,118626,118670,118715,118760,118805,118850,118894,118939,118984,119029,119074,119118,119163,119208,119253,119297,119342,119387,119432,119476,119521,119566,119611,119655,119700,119745,119790,119834,119879,119924,119968,120013,120058,120102,120147,120192,120236,120281,120326,120370,120415,120460,120504,120549,120594,120638,120683,120727,120772,120817,120861,120906,120950,120995,121040,121084,121129,121173,121218,121263,121307,121352,121396,121441,121485,121530,121574,121619,121663,121708,121752,121797,121842,121886,121931,121975,122019,122064,122108,122153,122197,122242,122286,122331,122375,122420,122464,122509,122553,122597,122642,122686,122731,122775,122820,122864,122908,122953,122997,123042,123086,123130,123175,123219,123263,123308,123352,123396,123441,123485,123529,123574,123618,123662,123707,123751,123795,123840,123884,123928,123973,124017,124061,124105,124150,124194,124238,124283,124327,124371,124415,124460,124504,124548,124592,124636,124681,124725,124769,124813,124857,124902,124946,124990,125034,125078,125123,125167,125211,125255,125299,125343,125388,125432,125476,125520,125564,125608,125652,125696,125741,125785,125829,125873,125917,125961,126005,126049,126093,126137,126181,126225,126269,126314,126358,126402,126446,126490,126534,126578,126622,126666,126710,126754,126798,126842,126886,126930,126974,127018,127062,127106,127150,127193,127237,127281,127325,127369,127413,127457,127501,127545,127589,127633,127677,127721,127764,127808,127852,127896,127940,127984,128028,128072,128115,128159,128203,128247,128291,128335,128378,128422,128466,128510,128554,128598,128641,128685,128729,128773,128816,128860,128904,128948,128992,129035,129079,129123,129167,129210,129254,129298,129341,129385,129429,129473,129516,129560,129604,129647,129691,129735,129778,129822,129866,129909,129953,129997,130040,130084,130128,130171,130215,130259,130302,130346,130389,130433,130477,130520,130564,130607,130651,130695,130738,130782,130825,130869,130912,130956,130999,131043,131087,131130,131174,131217,131261,131304,131348,131391,131435,131478,131522,131565,131609,131652,131695,131739,131782,131826,131869,131913,131956,132000,132043,132086,132130,132173,132217,132260,132303,132347,132390,132434,132477,132520,132564,132607,132650,132694,132737,132780,132824,132867,132910,132954,132997,133040,133084,133127,133170,133214,133257,133300,133343,133387,133430,133473,133517,133560,133603,133646,133690,133733,133776,133819,133862,133906,133949,133992,134035,134078,134122,134165,134208,134251,134294,134338,134381,134424,134467,134510,134553,134596,134640,134683,134726,134769,134812,134855,134898,134941,134984,135028,135071,135114,135157,135200,135243,135286,135329,135372,135415,135458,135501,135544,135587,135630,135673,135716,135759,135802,135845,135888,135931,135974,136017,136060,136103,136146,136189,136232,136275,136318,136361,136404,136447,136490,136532,136575,136618,136661,136704,136747,136790,136833,136876,136918,136961,137004,137047,137090,137133,137176,137218,137261,137304,137347,137390,137432,137475,137518,137561,137604,137646,137689,137732,137775,137817,137860,137903,137946,137988,138031,138074,138117,138159,138202,138245,138288,138330,138373,138416,138458,138501,138544,138586,138629,138672,138714,138757,138800,138842,138885,138927,138970,139013,139055,139098,139141,139183,139226,139268,139311,139353,139396,139439,139481,139524,139566,139609,139651,139694,139736,139779,139821,139864,139907,139949,139992,140034,140077,140119,140161,140204,140246,140289,140331,140374,140416,140459,140501,140544,140586,140628,140671,140713,140756,140798,140840,140883,140925,140968,141010,141052,141095,141137,141179,141222,141264,141306,141349,141391,141433,141476,141518,141560,141603,141645,141687,141730,141772,141814,141856,141899,141941,141983,142025,142068,142110,142152,142194,142237,142279,142321,142363,142405,142448,142490,142532,142574,142616,142659,142701,142743,142785,142827,142869,142912,142954,142996,143038,143080,143122,143164,143206,143248,143291,143333,143375,143417,143459,143501,143543,143585,143627,143669,143711,143753,143795,143837,143879,143921,143963,144005,144047,144089,144131,144173,144215,144257,144299,144341,144383,144425,144467,144509,144551,144593,144635,144677,144719,144761,144802,144844,144886,144928,144970,145012,145054,145096,145137,145179,145221,145263,145305,145347,145389,145430,145472,145514,145556,145598,145639,145681,145723,145765,145807,145848,145890,145932,145974,146015,146057,146099,146141,146182,146224,146266,146307,146349,146391,146433,146474,146516,146558,146599,146641,146683,146724,146766,146808,146849,146891,146932,146974,147016,147057,147099,147141,147182,147224,147265,147307,147348,147390,147432,147473,147515,147556,147598,147639,147681,147722,147764,147805,147847,147888,147930,147971,148013,148054,148096,148137,148179,148220,148262,148303,148345,148386,148428,148469,148510,148552,148593,148635,148676,148717,148759,148800,148842,148883,148924,148966,149007,149048,149090,149131,149172,149214,149255,149296,149338,149379,149420,149462,149503,149544,149585,149627,149668,149709,149751,149792,149833,149874,149916,149957,149998,150039,150080,150122,150163,150204,150245,150286,150328,150369,150410,150451,150492,150533,150575,150616,150657,150698,150739,150780,150821,150862,150904,150945,150986,151027,151068,151109,151150,151191,151232,151273,151314,151355,151396,151437,151478,151519,151560,151601,151642,151683,151724,151765,151806,151847,151888,151929,151970,152011,152052,152093,152134,152175,152216,152257,152298,152339,152380,152421,152461,152502,152543,152584,152625,152666,152707,152748,152788,152829,152870,152911,152952,152993,153033,153074,153115,153156,153197,153237,153278,153319,153360,153400,153441,153482,153523,153563,153604,153645,153686,153726,153767,153808,153848,153889,153930,153970,154011,154052,154093,154133,154174,154214,154255,154296,154336,154377,154418,154458,154499,154539,154580,154621,154661,154702,154742,154783,154824,154864,154905,154945,154986,155026,155067,155107,155148,155188,155229,155269,155310,155350,155391,155431,155472,155512,155553,155593,155634,155674,155715,155755,155795,155836,155876,155917,155957,155997,156038,156078,156119,156159,156199,156240,156280,156320,156361,156401,156441,156482,156522,156562,156603,156643,156683,156724,156764,156804,156845,156885,156925,156965,157006,157046,157086,157126,157167,157207,157247,157287,157327,157368,157408,157448,157488,157528,157569,157609,157649,157689,157729,157769,157809,157850,157890,157930,157970,158010,158050,158090,158130,158170,158211,158251,158291,158331,158371,158411,158451,158491,158531,158571,158611,158651,158691,158731,158771,158811,158851,158891,158931,158971,159011,159051,159091,159131,159171,159211,159251,159291,159330,159370,159410,159450,159490,159530,159570,159610,159650,159689,159729,159769,159809,159849,159889,159929,159968,160008,160048,160088,160128,160167,160207,160247,160287,160327,160366,160406,160446,160486,160525,160565,160605,160644,160684,160724,160764,160803,160843,160883,160922,160962,161002,161041,161081,161121,161160,161200,161240,161279,161319,161359,161398,161438,161477,161517,161557,161596,161636,161675,161715,161754,161794,161833,161873,161913,161952,161992,162031,162071,162110,162150,162189,162229,162268,162308,162347,162386,162426,162465,162505,162544,162584,162623,162663,162702,162741,162781,162820,162860,162899,162938,162978,163017,163056,163096,163135,163174,163214,163253,163292,163332,163371,163410,163450,163489,163528,163568,163607,163646,163685,163725,163764,163803,163842,163882,163921,163960,163999,164039,164078,164117,164156,164195,164234,164274,164313,164352,164391,164430,164469,164509,164548,164587,164626,164665,164704,164743,164782,164821,164861,164900,164939,164978,165017,165056,165095,165134,165173,165212,165251,165290,165329,165368,165407,165446,165485,165524,165563,165602,165641,165680,165719,165758,165797,165836,165875,165914,165952,165991,166030,166069,166108,166147,166186,166225,166264,166302,166341,166380,166419,166458,166497,166535,166574,166613,166652,166691,166729,166768,166807,166846,166885,166923,166962,167001,167040,167078,167117,167156,167194,167233,167272,167311,167349,167388,167427,167465,167504,167543,167581,167620,167659,167697,167736,167774,167813,167852,167890,167929,167968,168006,168045,168083,168122,168160,168199,168238,168276,168315,168353,168392,168430,168469,168507,168546,168584,168623,168661,168700,168738,168777,168815,168853,168892,168930,168969,169007,169046,169084,169122,169161,169199,169238,169276,169314,169353,169391,169430,169468,169506,169545,169583,169621,169660,169698,169736,169774,169813,169851,169889,169928,169966,170004,170042,170081,170119,170157,170195,170234,170272,170310,170348,170386,170425,170463,170501,170539,170577,170616,170654,170692,170730,170768,170806,170844,170883,170921,170959,170997,171035,171073,171111,171149,171187,171225,171263,171301,171339,171378,171416,171454,171492,171530,171568,171606,171644,171682,171720,171758,171796,171834,171871,171909,171947,171985,172023,172061,172099,172137,172175,172213,172251,172289,172326,172364,172402,172440,172478,172516,172554,172591,172629,172667,172705,172743,172781,172818,172856,172894,172932,172969,173007,173045,173083,173121,173158,173196,173234,173271,173309,173347,173385,173422,173460,173498,173535,173573,173611,173648,173686,173724,173761,173799,173837,173874,173912,173949,173987,174025,174062,174100,174137,174175,174212,174250,174288,174325,174363,174400,174438,174475,174513,174550,174588,174625,174663,174700,174738,174775,174813,174850,174887,174925,174962,175000,175037,175075,175112,175149,175187,175224,175262,175299,175336,175374,175411,175448,175486,175523,175560,175598,175635,175672,175710,175747,175784,175822,175859,175896,175933,175971,176008,176045,176082,176120,176157,176194,176231,176268,176306,176343,176380,176417,176454,176492,176529,176566,176603,176640,176677,176714,176752,176789,176826,176863,176900,176937,176974,177011,177048,177085,177123,177160,177197,177234,177271,177308,177345,177382,177419,177456,177493,177530,177567,177604,177641,177678,177715,177752,177788,177825,177862,177899,177936,177973,178010,178047,178084,178121,178158,178194,178231,178268,178305,178342,178379,178415,178452,178489,178526,178563,178600,178636,178673,178710,178747,178783,178820,178857,178894,178930,178967,179004,179041,179077,179114,179151,179187,179224,179261,179297,179334,179371,179407,179444,179481,179517,179554,179591,179627,179664,179700,179737,179774,179810,179847,179883,179920,179956,179993,180029,180066,180103,180139,180176,180212,180249,180285,180322,180358,180395,180431,180467,180504,180540,180577,180613,180650,180686,180723,180759,180795,180832,180868,180904,180941,180977,181014,181050,181086,181123,181159,181195,181232,181268,181304,181341,181377,181413,181449,181486,181522,181558,181594,181631,181667,181703,181739,181776,181812,181848,181884,181920,181957,181993,182029,182065,182101,182137,182174,182210,182246,182282,182318,182354,182390,182426,182463,182499,182535,182571,182607,182643,182679,182715,182751,182787,182823,182859,182895,182931,182967,183003,183039,183075,183111,183147,183183,183219,183255,183291,183327,183363,183399,183435,183470,183506,183542,183578,183614,183650,183686,183722,183757,183793,183829,183865,183901,183937,183972,184008,184044,184080,184116,184151,184187,184223,184259,184294,184330,184366,184402,184437,184473,184509,184545,184580,184616,184652,184687,184723,184759,184794,184830,184866,184901,184937,184972,185008,185044,185079,185115,185150,185186,185222,185257,185293,185328,185364,185399,185435,185470,185506,185541,185577,185612,185648,185683,185719,185754,185790,185825,185861,185896,185932,185967,186002,186038,186073,186109,186144,186179,186215,186250,186286,186321,186356,186392,186427,186462,186498,186533,186568,186604,186639,186674,186710,186745,186780,186815,186851,186886,186921,186956,186992,187027,187062,187097,187132,187168,187203,187238,187273,187308,187343,187379,187414,187449,187484,187519,187554,187589,187625,187660,187695,187730,187765,187800,187835,187870,187905,187940,187975,188010,188045,188080,188115,188150,188185,188220,188255,188290,188325,188360,188395,188430,188465,188500,188535,188570,188605,188640,188675,188709,188744,188779,188814,188849,188884,188919,188954,188988,189023,189058,189093,189128,189162,189197,189232,189267,189302,189336,189371,189406,189441,189475,189510,189545,189580,189614,189649,189684,189718,189753,189788,189822,189857,189892,189926,189961,189996,190030,190065,190099,190134,190169,190203,190238,190272,190307,190342,190376,190411,190445,190480,190514,190549,190583,190618,190652,190687,190721,190756,190790,190825,190859,190894,190928,190963,190997,191031,191066,191100,191135,191169,191203,191238,191272,191307,191341,191375,191410,191444,191478,191513,191547,191581,191616,191650,191684,191718,191753,191787,191821,191856,191890,191924,191958,191992,192027,192061,192095,192129,192164,192198,192232,192266,192300,192334,192369,192403,192437,192471,192505,192539,192573,192607,192641,192676,192710,192744,192778,192812,192846,192880,192914,192948,192982,193016,193050,193084,193118,193152,193186,193220,193254,193288,193322,193356,193390,193424,193458,193492,193525,193559,193593,193627,193661,193695,193729,193763,193796,193830,193864,193898,193932,193966,193999,194033,194067,194101,194135,194168,194202,194236,194270,194303,194337,194371,194405,194438,194472,194506,194539,194573,194607,194640,194674,194708,194741,194775,194809,194842,194876,194910,194943,194977,195010,195044,195078,195111,195145,195178,195212,195245,195279,195312,195346,195379,195413,195446,195480,195513,195547,195580,195614,195647,195681,195714,195748,195781,195815,195848,195881,195915,195948,195982,196015,196048,196082,196115,196148,196182,196215,196248,196282,196315,196348,196382,196415,196448,196481,196515,196548,196581,196615,196648,196681,196714,196747,196781,196814,196847,196880,196913,196947,196980,197013,197046,197079,197112,197146,197179,197212,197245,197278,197311,197344,197377,197410,197443,197476,197510,197543,197576,197609,197642,197675,197708,197741,197774,197807,197840,197873,197906,197939,197972,198004,198037,198070,198103,198136,198169,198202,198235,198268,198301,198334,198366,198399,198432,198465,198498,198531,198563,198596,198629,198662,198695,198727,198760,198793,198826,198858,198891,198924,198957,198989,199022,199055,199088,199120,199153,199186,199218,199251,199284,199316,199349,199382,199414,199447,199479,199512,199545,199577,199610,199642,199675,199708,199740,199773,199805,199838,199870,199903,199935,199968,200000,200033,200065,200098,200130,200163,200195,200228,200260,200292,200325,200357,200390,200422,200454,200487,200519,200552,200584,200616,200649,200681,200713,200746,200778,200810,200843,200875,200907,200940,200972,201004,201036,201069,201101,201133,201165,201198,201230,201262,201294,201326,201359,201391,201423,201455,201487,201519,201552,201584,201616,201648,201680,201712,201744,201776,201808,201841,201873,201905,201937,201969,202001,202033,202065,202097,202129,202161,202193,202225,202257,202289,202321,202353,202385,202417,202449,202481,202512,202544,202576,202608,202640,202672,202704,202736,202768,202799,202831,202863,202895,202927,202959,202990,203022,203054,203086,203118,203149,203181,203213,203245,203276,203308,203340,203372,203403,203435,203467,203498,203530,203562,203593,203625,203657,203688,203720,203752,203783,203815,203846,203878,203910,203941,203973,204004,204036,204067,204099,204131,204162,204194,204225,204257,204288,204320,204351,204383,204414,204446,204477,204508,204540,204571,204603,204634,204666,204697,204728,204760,204791,204823,204854,204885,204917,204948,204979,205011,205042,205073,205105,205136,205167,205198,205230,205261,205292,205324,205355,205386,205417,205448,205480,205511,205542,205573,205604,205636,205667,205698,205729,205760,205791,205823,205854,205885,205916,205947,205978,206009,206040,206071,206102,206133,206165,206196,206227,206258,206289,206320,206351,206382,206413,206444,206475,206506,206537,206567,206598,206629,206660,206691,206722,206753,206784,206815,206846,206877,206907,206938,206969,207000,207031,207062,207092,207123,207154,207185,207216,207246,207277,207308,207339,207370,207400,207431,207462,207492,207523,207554,207585,207615,207646,207677,207707,207738,207769,207799,207830,207861,207891,207922,207952,207983,208014,208044,208075,208105,208136,208166,208197,208228,208258,208289,208319,208350,208380,208411,208441,208472,208502,208533,208563,208593,208624,208654,208685,208715,208746,208776,208806,208837,208867,208897,208928,208958,208989,209019,209049,209080,209110,209140,209170,209201,209231,209261,209292,209322,209352,209382,209413,209443,209473,209503,209534,209564,209594,209624,209654,209684,209715,209745,209775,209805,209835,209865,209895,209926,209956,209986,210016,210046,210076,210106,210136,210166,210196,210226,210256,210286,210316,210346,210376,210406,210436,210466,210496,210526,210556,210586,210616,210646,210676,210706,210736,210765,210795,210825,210855,210885,210915,210945,210974,211004,211034,211064,211094,211124,211153,211183,211213,211243,211272,211302,211332,211362,211391,211421,211451,211481,211510,211540,211570,211599,211629,211659,211688,211718,211748,211777,211807,211836,211866,211896,211925,211955,211984,212014,212043,212073,212103,212132,212162,212191,212221,212250,212280,212309,212339,212368,212398,212427,212456,212486,212515,212545,212574,212604,212633,212662,212692,212721,212751,212780,212809,212839,212868,212897,212927,212956,212985,213015,213044,213073,213102,213132,213161,213190,213219,213249,213278,213307,213336,213366,213395,213424,213453,213482,213511,213541,213570,213599,213628,213657,213686,213715,213745,213774,213803,213832,213861,213890,213919,213948,213977,214006,214035,214064,214093,214122,214151,214180,214209,214238,214267,214296,214325,214354,214383,214412,214441,214470,214498,214527,214556,214585,214614,214643,214672,214701,214729,214758,214787,214816,214845,214873,214902,214931,214960,214989,215017,215046,215075,215104,215132,215161,215190,215218,215247,215276,215304,215333,215362,215390,215419,215448,215476,215505,215534,215562,215591,215619,215648,215677,215705,215734,215762,215791,215819,215848,215876,215905,215933,215962,215990,216019,216047,216076,216104,216133,216161,216190,216218,216246,216275,216303,216332,216360,216388,216417,216445,216473,216502,216530,216558,216587,216615,216643,216672,216700,216728,216757,216785,216813,216841,216870,216898,216926,216954,216982,217011,217039,217067,217095,217123,217152,217180,217208,217236,217264,217292,217320,217348,217377,217405,217433,217461,217489,217517,217545,217573,217601,217629,217657,217685,217713,217741,217769,217797,217825,217853,217881,217909,217937,217965,217993,218021,218049,218076,218104,218132,218160,218188,218216,218244,218271,218299,218327,218355,218383,218411,218438,218466,218494,218522,218549,218577,218605,218633,218660,218688,218716,218744,218771,218799,218827,218854,218882,218910,218937,218965,218993,219020,219048,219075,219103,219131,219158,219186,219213,219241,219268,219296,219324,219351,219379,219406,219434,219461,219489,219516,219544,219571,219598,219626,219653,219681,219708,219736,219763,219790,219818,219845,219873,219900,219927,219955,219982,220009,220037,220064,220091,220119,220146,220173,220200,220228,220255,220282,220309,220337,220364,220391,220418,220446,220473,220500,220527,220554,220581,220609,220636,220663,220690,220717,220744,220771,220798,220826,220853,220880,220907,220934,220961,220988,221015,221042,221069,221096,221123,221150,221177,221204,221231,221258,221285,221312,221339,221366,221393,221419,221446,221473,221500,221527,221554,221581,221608,221634,221661,221688,221715,221742,221769,221795,221822,221849,221876,221903,221929,221956,221983,222010,222036,222063,222090,222116,222143,222170,222196,222223,222250,222276,222303,222330,222356,222383,222410,222436,222463,222489,222516,222542,222569,222596,222622,222649,222675,222702,222728,222755,222781,222808,222834,222861,222887,222914,222940,222966,222993,223019,223046,223072,223099,223125,223151,223178,223204,223230,223257,223283,223309,223336,223362,223388,223415,223441,223467,223493,223520,223546,223572,223599,223625,223651,223677,223703,223730,223756,223782,223808,223834,223860,223887,223913,223939,223965,223991,224017,224043,224069,224096,224122,224148,224174,224200,224226,224252,224278,224304,224330,224356,224382,224408,224434,224460,224486,224512,224538,224564,224590,224615,224641,224667,224693,224719,224745,224771,224797,224823,224848,224874,224900,224926,224952,224978,225003,225029,225055,225081,225106,225132,225158,225184,225209,225235,225261,225287,225312,225338,225364,225389,225415,225441,225466,225492,225517,225543,225569,225594,225620,225646,225671,225697,225722,225748,225773,225799,225824,225850,225875,225901,225926,225952,225977,226003,226028,226054,226079,226105,226130,226156,226181,226206,226232,226257,226283,226308,226333,226359,226384,226409,226435,226460,226485,226511,226536,226561,226586,226612,226637,226662,226688,226713,226738,226763,226788,226814,226839,226864,226889,226914,226940,226965,226990,227015,227040,227065,227090,227115,227141,227166,227191,227216,227241,227266,227291,227316,227341,227366,227391,227416,227441,227466,227491,227516,227541,227566,227591,227616,227641,227666,227691,227716,227740,227765,227790,227815,227840,227865,227890,227914,227939,227964,227989,228014,228039,228063,228088,228113,228138,228162,228187,228212,228237,228261,228286,228311,228335,228360,228385,228409,228434,228459,228483,228508,228533,228557,228582,228607,228631,228656,228680,228705,228729,228754,228779,228803,228828,228852,228877,228901,228926,228950,228975,228999,229024,229048,229072,229097,229121,229146,229170,229194,229219,229243,229268,229292,229316,229341,229365,229389,229414,229438,229462,229487,229511,229535,229560,229584,229608,229632,229657,229681,229705,229729,229753,229778,229802,229826,229850,229874,229898,229923,229947,229971,229995,230019,230043,230067,230091,230116,230140,230164,230188,230212,230236,230260,230284,230308,230332,230356,230380,230404,230428,230452,230476,230500,230524,230548,230571,230595,230619,230643,230667,230691,230715,230739,230762,230786,230810,230834,230858,230882,230905,230929,230953,230977,231001,231024,231048,231072,231096,231119,231143,231167,231190,231214,231238,231261,231285,231309,231332,231356,231380,231403,231427,231450,231474,231498,231521,231545,231568,231592,231615,231639,231663,231686,231710,231733,231757,231780,231804,231827,231850,231874,231897,231921,231944,231968,231991,232014,232038,232061,232085,232108,232131,232155,232178,232201,232225,232248,232271,232295,232318,232341,232364,232388,232411,232434,232457,232481,232504,232527,232550,232574,232597,232620,232643,232666,232689,232713,232736,232759,232782,232805,232828,232851,232874,232897,232920,232944,232967,232990,233013,233036,233059,233082,233105,233128,233151,233174,233197,233220,233243,233265,233288,233311,233334,233357,233380,233403,233426,233449,233472,233494,233517,233540,233563,233586,233609,233631,233654,233677,233700,233722,233745,233768,233791,233813,233836,233859,233882,233904,233927,233950,233972,233995,234018,234040,234063,234086,234108,234131,234153,234176,234199,234221,234244,234266,234289,234311,234334,234356,234379,234401,234424,234446,234469,234491,234514,234536,234559,234581,234604,234626,234649,234671,234693,234716,234738,234760,234783,234805,234828,234850,234872,234894,234917,234939,234961,234984,235006,235028,235050,235073,235095,235117,235139,235162,235184,235206,235228,235250,235273,235295,235317,235339,235361,235383,235405,235428,235450,235472,235494,235516,235538,235560,235582,235604,235626,235648,235670,235692,235714,235736,235758,235780,235802,235824,235846,235868,235890,235912,235934,235956,235978,235999,236021,236043,236065,236087,236109,236131,236152,236174,236196,236218,236240,236261,236283,236305,236327,236348,236370,236392,236414,236435,236457,236479,236500,236522,236544,236565,236587,236609,236630,236652,236674,236695,236717,236738,236760,236782,236803,236825,236846,236868,236889,236911,236932,236954,236975,236997,237018,237040,237061,237083,237104,237126,237147,237168,237190,237211,237233,237254,237275,237297,237318,237339,237361,237382,237403,237425,237446,237467,237489,237510,237531,237552,237574,237595,237616,237637,237659,237680,237701,237722,237743,237765,237786,237807,237828,237849,237870,237891,237913,237934,237955,237976,237997,238018,238039,238060,238081,238102,238123,238144,238165,238186,238207,238228,238249,238270,238291,238312,238333,238354,238375,238396,238417,238437,238458,238479,238500,238521,238542,238563,238583,238604,238625,238646,238667,238688,238708,238729,238750,238771,238791,238812,238833,238853,238874,238895,238916,238936,238957,238978,238998,239019,239040,239060,239081,239101,239122,239143,239163,239184,239204,239225,239245,239266,239287,239307,239328,239348,239369,239389,239410,239430,239450,239471,239491,239512,239532,239553,239573,239593,239614,239634,239655,239675,239695,239716,239736,239756,239777,239797,239817,239838,239858,239878,239898,239919,239939,239959,239979,240000,240020,240040,240060,240080,240101,240121,240141,240161,240181,240201,240221,240242,240262,240282,240302,240322,240342,240362,240382,240402,240422,240442,240462,240482,240502,240522,240542,240562,240582,240602,240622,240642,240662,240682,240702,240722,240742,240762,240781,240801,240821,240841,240861,240881,240901,240920,240940,240960,240980,241000,241019,241039,241059,241079,241098,241118,241138,241157,241177,241197,241217,241236,241256,241276,241295,241315,241334,241354,241374,241393,241413,241433,241452,241472,241491,241511,241530,241550,241569,241589,241608,241628,241647,241667,241686,241706,241725,241745,241764,241784,241803,241822,241842,241861,241881,241900,241919,241939,241958,241977,241997,242016,242035,242055,242074,242093,242112,242132,242151,242170,242189,242209,242228,242247,242266,242286,242305,242324,242343,242362,242381,242401,242420,242439,242458,242477,242496,242515,242534,242553,242572,242591,242611,242630,242649,242668,242687,242706,242725,242744,242763,242782,242800,242819,242838,242857,242876,242895,242914,242933,242952,242971,242990,243008,243027,243046,243065,243084,243103,243121,243140,243159,243178,243196,243215,243234,243253,243271,243290,243309,243328,243346,243365,243384,243402,243421,243440,243458,243477,243496,243514,243533,243551,243570,243588,243607,243626,243644,243663,243681,243700,243718,243737,243755,243774,243792,243811,243829,243848,243866,243885,243903,243921,243940,243958,243977,243995,244013,244032,244050,244068,244087,244105,244123,244142,244160,244178,244197,244215,244233,244251,244270,244288,244306,244324,244343,244361,244379,244397,244415,244433,244452,244470,244488,244506,244524,244542,244560,244578,244597,244615,244633,244651,244669,244687,244705,244723,244741,244759,244777,244795,244813,244831,244849,244867,244885,244903,244921,244938,244956,244974,244992,245010,245028,245046,245064,245081,245099,245117,245135,245153,245171,245188,245206,245224,245242,245259,245277,245295,245313,245330,245348,245366,245383,245401,245419,245436,245454,245472,245489,245507,245525,245542,245560,245577,245595,245613,245630,245648,245665,245683,245700,245718,245735,245753,245770,245788,245805,245823,245840,245858,245875,245892,245910,245927,245945,245962,245979,245997,246014,246032,246049,246066,246084,246101,246118,246136,246153,246170,246187,246205,246222,246239,246256,246274,246291,246308,246325,246342,246360,246377,246394,246411,246428,246445,246463,246480,246497,246514,246531,246548,246565,246582,246599,246616,246633,246650,246667,246684,246701,246718,246735,246752,246769,246786,246803,246820,246837,246854,246871,246888,246905,246922,246938,246955,246972,246989,247006,247023,247040,247056,247073,247090,247107,247123,247140,247157,247174,247190,247207,247224,247241,247257,247274,247291,247307,247324,247341,247357,247374,247391,247407,247424,247440,247457,247474,247490,247507,247523,247540,247556,247573,247589,247606,247622,247639,247655,247672,247688,247705,247721,247738,247754,247771,247787,247803,247820,247836,247853,247869,247885,247902,247918,247934,247951,247967,247983,248000,248016,248032,248048,248065,248081,248097,248113,248130,248146,248162,248178,248194,248211,248227,248243,248259,248275,248291,248307,248323,248340,248356,248372,248388,248404,248420,248436,248452,248468,248484,248500,248516,248532,248548,248564,248580,248596,248612,248628,248644,248660,248676,248691,248707,248723,248739,248755,248771,248787,248803,248818,248834,248850,248866,248882,248897,248913,248929,248945,248960,248976,248992,249008,249023,249039,249055,249070,249086,249102,249117,249133,249149,249164,249180,249195,249211,249227,249242,249258,249273,249289,249304,249320,249335,249351,249367,249382,249398,249413,249428,249444,249459,249475,249490,249506,249521,249536,249552,249567,249583,249598,249613,249629,249644,249659,249675,249690,249705,249721,249736,249751,249766,249782,249797,249812,249827,249843,249858,249873,249888,249903,249919,249934,249949,249964,249979,249994,250009,250025,250040,250055,250070,250085,250100,250115,250130,250145,250160,250175,250190,250205,250220,250235,250250,250265,250280,250295,250310,250325,250340,250355,250370,250385,250399,250414,250429,250444,250459,250474,250489,250503,250518,250533,250548,250562,250577,250592,250607,250622,250636,250651,250666,250680,250695,250710,250724,250739,250754,250768,250783,250798,250812,250827,250842,250856,250871,250885,250900,250914,250929,250944,250958,250973,250987,251002,251016,251031,251045,251060,251074,251088,251103,251117,251132,251146,251161,251175,251189,251204,251218,251232,251247,251261,251275,251290,251304,251318,251333,251347,251361,251375,251390,251404,251418,251432,251447,251461,251475,251489,251503,251518,251532,251546,251560,251574,251588,251602,251617,251631,251645,251659,251673,251687,251701,251715,251729,251743,251757,251771,251785,251799,251813,251827,251841,251855,251869,251883,251897,251911,251925,251938,251952,251966,251980,251994,252008,252022,252035,252049,252063,252077,252091,252104,252118,252132,252146,252159,252173,252187,252201,252214,252228,252242,252255,252269,252283,252296,252310,252324,252337,252351,252365,252378,252392,252405,252419,252432,252446,252460,252473,252487,252500,252514,252527,252541,252554,252568,252581,252594,252608,252621,252635,252648,252662,252675,252688,252702,252715,252728,252742,252755,252768,252782,252795,252808,252822,252835,252848,252861,252875,252888,252901,252914,252928,252941,252954,252967,252980,252994,253007,253020,253033,253046,253059,253072,253085,253099,253112,253125,253138,253151,253164,253177,253190,253203,253216,253229,253242,253255,253268,253281,253294,253307,253320,253333,253346,253359,253371,253384,253397,253410,253423,253436,253449,253461,253474,253487,253500,253513,253525,253538,253551,253564,253577,253589,253602,253615,253627,253640,253653,253666,253678,253691,253704,253716,253729,253741,253754,253767,253779,253792,253804,253817,253830,253842,253855,253867,253880,253892,253905,253917,253930,253942,253955,253967,253980,253992,254004,254017,254029,254042,254054,254067,254079,254091,254104,254116,254128,254141,254153,254165,254178,254190,254202,254214,254227,254239,254251,254263,254276,254288,254300,254312,254324,254337,254349,254361,254373,254385,254397,254410,254422,254434,254446,254458,254470,254482,254494,254506,254518,254530,254542,254554,254566,254578,254590,254602,254614,254626,254638,254650,254662,254674,254686,254698,254710,254721,254733,254745,254757,254769,254781,254793,254804,254816,254828,254840,254852,254863,254875,254887,254899,254910,254922,254934,254945,254957,254969,254981,254992,255004,255015,255027,255039,255050,255062,255074,255085,255097,255108,255120,255131,255143,255155,255166,255178,255189,255201,255212,255224,255235,255246,255258,255269,255281,255292,255304,255315,255326,255338,255349,255361,255372,255383,255395,255406,255417,255429,255440,255451,255462,255474,255485,255496,255507,255519,255530,255541,255552,255564,255575,255586,255597,255608,255619,255630,255642,255653,255664,255675,255686,255697,255708,255719,255730,255741,255752,255763,255774,255785,255796,255807,255818,255829,255840,255851,255862,255873,255884,255895,255906,255917,255928,255939,255949,255960,255971,255982,255993,256004,256014,256025,256036,256047,256058,256068,256079,256090,256101,256111,256122,256133,256143,256154,256165,256176,256186,256197,256207,256218,256229,256239,256250,256261,256271,256282,256292,256303,256313,256324,256334,256345,256355,256366,256376,256387,256397,256408,256418,256429,256439,256450,256460,256470,256481,256491,256502,256512,256522,256533,256543,256553,256564,256574,256584,256595,256605,256615,256625,256636,256646,256656,256666,256677,256687,256697,256707,256717,256728,256738,256748,256758,256768,256778,256788,256798,256809,256819,256829,256839,256849,256859,256869,256879,256889,256899,256909,256919,256929,256939,256949,256959,256969,256979,256989,256999,257008,257018,257028,257038,257048,257058,257068,257078,257087,257097,257107,257117,257127,257136,257146,257156,257166,257175,257185,257195,257205,257214,257224,257234,257243,257253,257263,257272,257282,257292,257301,257311,257320,257330,257340,257349,257359,257368,257378,257387,257397,257406,257416,257425,257435,257444,257454,257463,257473,257482,257492,257501,257510,257520,257529,257539,257548,257557,257567,257576,257585,257595,257604,257613,257623,257632,257641,257651,257660,257669,257678,257688,257697,257706,257715,257724,257734,257743,257752,257761,257770,257779,257789,257798,257807,257816,257825,257834,257843,257852,257861,257870,257879,257888,257897,257906,257915,257924,257933,257942,257951,257960,257969,257978,257987,257996,258005,258014,258023,258031,258040,258049,258058,258067,258076,258084,258093,258102,258111,258120,258128,258137,258146,258155,258163,258172,258181,258190,258198,258207,258216,258224,258233,258242,258250,258259,258267,258276,258285,258293,258302,258310,258319,258327,258336,258345,258353,258362,258370,258379,258387,258396,258404,258412,258421,258429,258438,258446,258455,258463,258471,258480,258488,258496,258505,258513,258522,258530,258538,258546,258555,258563,258571,258580,258588,258596,258604,258613,258621,258629,258637,258645,258654,258662,258670,258678,258686,258694,258702,258711,258719,258727,258735,258743,258751,258759,258767,258775,258783,258791,258799,258807,258815,258823,258831,258839,258847,258855,258863,258871,258879,258887,258895,258902,258910,258918,258926,258934,258942,258950,258957,258965,258973,258981,258989,258996,259004,259012,259020,259027,259035,259043,259050,259058,259066,259073,259081,259089,259096,259104,259112,259119,259127,259135,259142,259150,259157,259165,259172,259180,259187,259195,259202,259210,259217,259225,259232,259240,259247,259255,259262,259270,259277,259285,259292,259299,259307,259314,259321,259329,259336,259343,259351,259358,259365,259373,259380,259387,259395,259402,259409,259416,259423,259431,259438,259445,259452,259459,259467,259474,259481,259488,259495,259502,259509,259517,259524,259531,259538,259545,259552,259559,259566,259573,259580,259587,259594,259601,259608,259615,259622,259629,259636,259643,259650,259657,259664,259670,259677,259684,259691,259698,259705,259712,259718,259725,259732,259739,259746,259752,259759,259766,259773,259779,259786,259793,259800,259806,259813,259820,259826,259833,259840,259846,259853,259860,259866,259873,259879,259886,259893,259899,259906,259912,259919,259925,259932,259938,259945,259951,259958,259964,259971,259977,259984,259990,259997,260003,260009,260016,260022,260029,260035,260041,260048,260054,260060,260067,260073,260079,260085,260092,260098,260104,260111,260117,260123,260129,260135,260142,260148,260154,260160,260166,260173,260179,260185,260191,260197,260203,260209,260215,260221,260228,260234,260240,260246,260252,260258,260264,260270,260276,260282,260288,260294,260300,260306,260312,260317,260323,260329,260335,260341,260347,260353,260359,260365,260370,260376,260382,260388,260394,260399,260405,260411,260417,260423,260428,260434,260440,260445,260451,260457,260463,260468,260474,260480,260485,260491,260496,260502,260508,260513,260519,260525,260530,260536,260541,260547,260552,260558,260563,260569,260574,260580,260585,260591,260596,260602,260607,260613,260618,260623,260629,260634,260640,260645,260650,260656,260661,260666,260672,260677,260682,260688,260693,260698,260703,260709,260714,260719,260724,260730,260735,260740,260745,260750,260756,260761,260766,260771,260776,260781,260786,260791,260797,260802,260807,260812,260817,260822,260827,260832,260837,260842,260847,260852,260857,260862,260867,260872,260877,260882,260887,260892,260896,260901,260906,260911,260916,260921,260926,260930,260935,260940,260945,260950,260955,260959,260964,260969,260974,260978,260983,260988,260992,260997,261002,261007,261011,261016,261021,261025,261030,261034,261039,261044,261048,261053,261057,261062,261067,261071,261076,261080,261085,261089,261094,261098,261103,261107,261112,261116,261120,261125,261129,261134,261138,261143,261147,261151,261156,261160,261164,261169,261173,261177,261182,261186,261190,261195,261199,261203,261207,261212,261216,261220,261224,261228,261233,261237,261241,261245,261249,261253,261258,261262,261266,261270,261274,261278,261282,261286,261290,261294,261298,261302,261306,261310,261314,261318,261322,261326,261330,261334,261338,261342,261346,261350,261354,261358,261362,261366,261369,261373,261377,261381,261385,261389,261392,261396,261400,261404,261408,261411,261415,261419,261423,261426,261430,261434,261437,261441,261445,261448,261452,261456,261459,261463,261467,261470,261474,261477,261481,261485,261488,261492,261495,261499,261502,261506,261509,261513,261516,261520,261523,261527,261530,261533,261537,261540,261544,261547,261551,261554,261557,261561,261564,261567,261571,261574,261577,261581,261584,261587,261590,261594,261597,261600,261603,261607,261610,261613,261616,261619,261623,261626,261629,261632,261635,261638,261641,261644,261648,261651,261654,261657,261660,261663,261666,261669,261672,261675,261678,261681,261684,261687,261690,261693,261696,261699,261702,261705,261708,261710,261713,261716,261719,261722,261725,261728,261730,261733,261736,261739,261742,261744,261747,261750,261753,261755,261758,261761,261764,261766,261769,261772,261774,261777,261780,261782,261785,261788,261790,261793,261795,261798,261801,261803,261806,261808,261811,261813,261816,261818,261821,261823,261826,261828,261831,261833,261836,261838,261840,261843,261845,261848,261850,261852,261855,261857,261859,261862,261864,261866,261869,261871,261873,261876,261878,261880,261882,261885,261887,261889,261891,261894,261896,261898,261900,261902,261904,261907,261909,261911,261913,261915,261917,261919,261921,261923,261925,261927,261929,261932,261934,261936,261938,261940,261942,261943,261945,261947,261949,261951,261953,261955,261957,261959,261961,261963,261965,261966,261968,261970,261972,261974,261975,261977,261979,261981,261983,261984,261986,261988,261990,261991,261993,261995,261996,261998,262000,262001,262003,262005,262006,262008,262010,262011,262013,262014,262016,262018,262019,262021,262022,262024,262025,262027,262028,262030,262031,262033,262034,262036,262037,262038,262040,262041,262043,262044,262045,262047,262048,262050,262051,262052,262054,262055,262056,262057,262059,262060,262061,262063,262064,262065,262066,262067,262069,262070,262071,262072,262073,262075,262076,262077,262078,262079,262080,262081,262082,262084,262085,262086,262087,262088,262089,262090,262091,262092,262093,262094,262095,262096,262097,262098,262099,262100,262101,262101,262102,262103,262104,262105,262106,262107,262108,262108,262109,262110,262111,262112,262112,262113,262114,262115,262115,262116,262117,262118,262118,262119,262120,262120,262121,262122,262122,262123,262124,262124,262125,262125,262126,262127,262127,262128,262128,262129,262129,262130,262130,262131,262131,262132,262132,262133,262133,262134,262134,262135,262135,262135,262136,262136,262137,262137,262137,262138,262138,262138,262139,262139,262139,262140,262140,262140,262140,262141,262141,262141,262141,262142,262142,262142,262142,262142,262143,262143,262143,262143,262143,262143,262143,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,0}; |
7 | #endif /* ROCKBOX */ | ||
diff --git a/apps/plugins/pdbox/PDa/intern/cos~.c b/apps/plugins/pdbox/PDa/intern/cos~.c index 38625d7419..fa680e1972 100644 --- a/apps/plugins/pdbox/PDa/intern/cos~.c +++ b/apps/plugins/pdbox/PDa/intern/cos~.c | |||
@@ -47,6 +47,9 @@ static t_int *cos_perform(t_int *w) | |||
47 | 47 | ||
48 | static void cos_dsp(t_cos *x, t_signal **sp) | 48 | static void cos_dsp(t_cos *x, t_signal **sp) |
49 | { | 49 | { |
50 | #ifdef ROCKBOX | ||
51 | (void) x; | ||
52 | #endif | ||
50 | dsp_add(cos_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); | 53 | dsp_add(cos_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); |
51 | } | 54 | } |
52 | 55 | ||
diff --git a/apps/plugins/pdbox/PDa/intern/dbtopow~.c b/apps/plugins/pdbox/PDa/intern/dbtopow~.c index ad4a826f9e..de25b95c5c 100644 --- a/apps/plugins/pdbox/PDa/intern/dbtopow~.c +++ b/apps/plugins/pdbox/PDa/intern/dbtopow~.c | |||
@@ -1,3 +1,8 @@ | |||
1 | #ifdef ROCKBOX | ||
2 | #include "plugin.h" | ||
3 | #include "pdbox.h" | ||
4 | #endif | ||
5 | |||
1 | #include <m_pd.h> | 6 | #include <m_pd.h> |
2 | #include <m_fixed.h> | 7 | #include <m_fixed.h> |
3 | 8 | ||
@@ -39,6 +44,9 @@ static t_int *dbtopow_tilde_perform(t_int *w) | |||
39 | 44 | ||
40 | static void dbtopow_tilde_dsp(t_dbtopow_tilde *x, t_signal **sp) | 45 | static void dbtopow_tilde_dsp(t_dbtopow_tilde *x, t_signal **sp) |
41 | { | 46 | { |
47 | #ifdef ROCKBOX | ||
48 | (void) x; | ||
49 | #endif | ||
42 | post("warning: %s not usable yet",__FUNCTION__); | 50 | post("warning: %s not usable yet",__FUNCTION__); |
43 | dsp_add(dbtopow_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); | 51 | dsp_add(dbtopow_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); |
44 | } | 52 | } |
diff --git a/apps/plugins/pdbox/PDa/intern/dbtorms~.c b/apps/plugins/pdbox/PDa/intern/dbtorms~.c index 703d0883b9..1473ca8170 100644 --- a/apps/plugins/pdbox/PDa/intern/dbtorms~.c +++ b/apps/plugins/pdbox/PDa/intern/dbtorms~.c | |||
@@ -1,3 +1,8 @@ | |||
1 | #ifdef ROCKBOX | ||
2 | #include "plugin.h" | ||
3 | #include "pdbox.h" | ||
4 | #endif | ||
5 | |||
1 | #include <m_pd.h> | 6 | #include <m_pd.h> |
2 | #include <m_fixed.h> | 7 | #include <m_fixed.h> |
3 | 8 | ||
@@ -40,6 +45,9 @@ static t_int *dbtorms_tilde_perform(t_int *w) | |||
40 | 45 | ||
41 | static void dbtorms_tilde_dsp(t_dbtorms_tilde *x, t_signal **sp) | 46 | static void dbtorms_tilde_dsp(t_dbtorms_tilde *x, t_signal **sp) |
42 | { | 47 | { |
48 | #ifdef ROCKBOX | ||
49 | (void) x; | ||
50 | #endif | ||
43 | post("warning: %s not usable yet",__FUNCTION__); | 51 | post("warning: %s not usable yet",__FUNCTION__); |
44 | dsp_add(dbtorms_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); | 52 | dsp_add(dbtorms_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); |
45 | } | 53 | } |
diff --git a/apps/plugins/pdbox/PDa/intern/delread~.c b/apps/plugins/pdbox/PDa/intern/delread~.c index ed7d2f2d80..d7db986fea 100644 --- a/apps/plugins/pdbox/PDa/intern/delread~.c +++ b/apps/plugins/pdbox/PDa/intern/delread~.c | |||
@@ -1,11 +1,19 @@ | |||
1 | #ifdef ROCKBOX | ||
2 | #include "plugin.h" | ||
3 | #include "pdbox.h" | ||
4 | #endif | ||
5 | |||
1 | #include <m_pd.h> | 6 | #include <m_pd.h> |
2 | #include <m_fixed.h> | 7 | #include <m_fixed.h> |
3 | #include "delay.h" | ||
4 | 8 | ||
5 | extern int ugen_getsortno(void); | 9 | extern int ugen_getsortno(void); |
6 | 10 | ||
11 | #include "delay.h" | ||
12 | |||
7 | #define DEFDELVS 64 /* LATER get this from canvas at DSP time */ | 13 | #define DEFDELVS 64 /* LATER get this from canvas at DSP time */ |
14 | #ifndef ROCKBOX | ||
8 | static int delread_zero = 0; /* four bytes of zero for delread~, vd~ */ | 15 | static int delread_zero = 0; /* four bytes of zero for delread~, vd~ */ |
16 | #endif | ||
9 | 17 | ||
10 | static t_class *sigdelread_class; | 18 | static t_class *sigdelread_class; |
11 | 19 | ||
@@ -36,13 +44,17 @@ static void *sigdelread_new(t_symbol *s, t_floatarg f) | |||
36 | 44 | ||
37 | static void sigdelread_float(t_sigdelread *x, t_float f) | 45 | static void sigdelread_float(t_sigdelread *x, t_float f) |
38 | { | 46 | { |
47 | #ifndef ROCKBOX | ||
39 | int samps; | 48 | int samps; |
49 | #endif | ||
40 | t_sigdelwrite *delwriter = | 50 | t_sigdelwrite *delwriter = |
41 | (t_sigdelwrite *)pd_findbyclass(x->x_sym, sigdelwrite_class); | 51 | (t_sigdelwrite *)pd_findbyclass(x->x_sym, sigdelwrite_class); |
42 | x->x_deltime = f; | 52 | x->x_deltime = f; |
43 | if (delwriter) | 53 | if (delwriter) |
44 | { | 54 | { |
55 | #ifndef ROCKBOX | ||
45 | int delsize = delwriter->x_cspace.c_n; | 56 | int delsize = delwriter->x_cspace.c_n; |
57 | #endif | ||
46 | x->x_delsamps = (int)(0.5 + x->x_sr * x->x_deltime) | 58 | x->x_delsamps = (int)(0.5 + x->x_sr * x->x_deltime) |
47 | + x->x_n - x->x_zerodel; | 59 | + x->x_n - x->x_zerodel; |
48 | if (x->x_delsamps < x->x_n) x->x_delsamps = x->x_n; | 60 | if (x->x_delsamps < x->x_n) x->x_delsamps = x->x_n; |
diff --git a/apps/plugins/pdbox/PDa/intern/delwrite~.c b/apps/plugins/pdbox/PDa/intern/delwrite~.c index 825ff2396a..74ddb45611 100644 --- a/apps/plugins/pdbox/PDa/intern/delwrite~.c +++ b/apps/plugins/pdbox/PDa/intern/delwrite~.c | |||
@@ -4,7 +4,9 @@ | |||
4 | extern int ugen_getsortno(void); | 4 | extern int ugen_getsortno(void); |
5 | 5 | ||
6 | #define DEFDELVS 64 /* LATER get this from canvas at DSP time */ | 6 | #define DEFDELVS 64 /* LATER get this from canvas at DSP time */ |
7 | #ifndef ROCKBOX | ||
7 | static int delread_zero = 0; /* four bytes of zero for delread~, vd~ */ | 8 | static int delread_zero = 0; /* four bytes of zero for delread~, vd~ */ |
9 | #endif | ||
8 | 10 | ||
9 | #include "delay.h" | 11 | #include "delay.h" |
10 | 12 | ||
diff --git a/apps/plugins/pdbox/PDa/intern/env~.c b/apps/plugins/pdbox/PDa/intern/env~.c index 8f42658461..c46a3f8f6f 100644 --- a/apps/plugins/pdbox/PDa/intern/env~.c +++ b/apps/plugins/pdbox/PDa/intern/env~.c | |||
@@ -1,5 +1,9 @@ | |||
1 | 1 | #ifdef ROCKBOX | |
2 | #include "plugin.h" | ||
3 | #include "pdbox.h" | ||
4 | #else /* ROCKBOX */ | ||
2 | #define FIXEDPOINT | 5 | #define FIXEDPOINT |
6 | #endif /* ROCKBOX */ | ||
3 | #include <m_pd.h> | 7 | #include <m_pd.h> |
4 | #include <m_fixed.h> | 8 | #include <m_fixed.h> |
5 | 9 | ||
diff --git a/apps/plugins/pdbox/PDa/intern/ftom~.c b/apps/plugins/pdbox/PDa/intern/ftom~.c index fb40ff6e7c..0b6fa14a00 100644 --- a/apps/plugins/pdbox/PDa/intern/ftom~.c +++ b/apps/plugins/pdbox/PDa/intern/ftom~.c | |||
@@ -1,3 +1,8 @@ | |||
1 | #ifdef ROCKBOX | ||
2 | #include "plugin.h" | ||
3 | #include "pdbox.h" | ||
4 | #endif | ||
5 | |||
1 | #include <m_pd.h> | 6 | #include <m_pd.h> |
2 | #include <m_fixed.h> | 7 | #include <m_fixed.h> |
3 | 8 | ||
@@ -19,7 +24,11 @@ static void *ftom_tilde_new(void) | |||
19 | 24 | ||
20 | static t_int *ftom_tilde_perform(t_int *w) | 25 | static t_int *ftom_tilde_perform(t_int *w) |
21 | { | 26 | { |
27 | #ifdef ROCKBOX | ||
28 | t_sample *in = *(t_sample **)(w+1), *out = (t_sample*)*(t_float **)(w+2); | ||
29 | #else | ||
22 | t_sample *in = *(t_sample **)(w+1), *out = *(t_float **)(w+2); | 30 | t_sample *in = *(t_sample **)(w+1), *out = *(t_float **)(w+2); |
31 | #endif | ||
23 | t_int n = *(t_int *)(w+3); | 32 | t_int n = *(t_int *)(w+3); |
24 | for (; n--; *in++, out++) | 33 | for (; n--; *in++, out++) |
25 | { | 34 | { |
@@ -31,6 +40,9 @@ static t_int *ftom_tilde_perform(t_int *w) | |||
31 | 40 | ||
32 | static void ftom_tilde_dsp(t_ftom_tilde *x, t_signal **sp) | 41 | static void ftom_tilde_dsp(t_ftom_tilde *x, t_signal **sp) |
33 | { | 42 | { |
43 | #ifdef ROCKBOX | ||
44 | (void) x; | ||
45 | #endif | ||
34 | post("warning: %s not usable yet",__FUNCTION__); | 46 | post("warning: %s not usable yet",__FUNCTION__); |
35 | dsp_add(ftom_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); | 47 | dsp_add(ftom_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); |
36 | } | 48 | } |
diff --git a/apps/plugins/pdbox/PDa/intern/hip~.c b/apps/plugins/pdbox/PDa/intern/hip~.c index 6c6de41809..4c4a55d515 100644 --- a/apps/plugins/pdbox/PDa/intern/hip~.c +++ b/apps/plugins/pdbox/PDa/intern/hip~.c | |||
@@ -76,6 +76,9 @@ static void sighip_dsp(t_sighip *x, t_signal **sp) | |||
76 | 76 | ||
77 | static void sighip_clear(t_sighip *x, t_floatarg q) | 77 | static void sighip_clear(t_sighip *x, t_floatarg q) |
78 | { | 78 | { |
79 | #ifdef ROCKBOX | ||
80 | (void) q; | ||
81 | #endif | ||
79 | x->x_cspace.c_x = 0; | 82 | x->x_cspace.c_x = 0; |
80 | } | 83 | } |
81 | 84 | ||
diff --git a/apps/plugins/pdbox/PDa/intern/intern_setup.c b/apps/plugins/pdbox/PDa/intern/intern_setup.c index 017f72a349..95d29b8cf5 100644 --- a/apps/plugins/pdbox/PDa/intern/intern_setup.c +++ b/apps/plugins/pdbox/PDa/intern/intern_setup.c | |||
@@ -1,7 +1,57 @@ | |||
1 | #ifndef ROCKBOX | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #endif | ||
2 | 4 | ||
3 | void d_intern_setup() { | 5 | #ifdef ROCKBOX |
6 | /* Get rid of warnings. */ | ||
7 | void biquad_tilde_setup(void); | ||
8 | void bp_tilde_setup(void); | ||
9 | void clip_tilde_setup(void); | ||
10 | void cos_tilde_setup(void); | ||
11 | void dbtopow_tilde_setup(void); | ||
12 | void dbtorms_tilde_setup(void); | ||
13 | void delread_tilde_setup(void); | ||
14 | void delwrite_tilde_setup(void); | ||
15 | void env_tilde_setup(void); | ||
16 | void ftom_tilde_setup(void); | ||
17 | void hip_tilde_setup(void); | ||
18 | void line_tilde_setup(void); | ||
19 | void lop_tilde_setup(void); | ||
20 | void mtof_tilde_setup(void); | ||
21 | void noise_tilde_setup(void); | ||
22 | void osc_tilde_setup(void); | ||
23 | void phasor_tilde_setup(void); | ||
24 | void powtodb_tilde_setup(void); | ||
25 | void print_tilde_setup(void); | ||
26 | void rmstodb_tilde_setup(void); | ||
27 | void rsqrt_tilde_setup(void); | ||
28 | void samphold_tilde_setup(void); | ||
29 | void sfread_tilde_setup(void); | ||
30 | void sfwrite_tilde_setup(void); | ||
31 | void sig_tilde_setup(void); | ||
32 | void snapshot_tilde_setup(void); | ||
33 | void sqrt_tilde_setup(void); | ||
34 | void tabosc4_tilde_setup(void); | ||
35 | void tabplay_tilde_setup(void); | ||
36 | void tabread4_tilde_setup(void); | ||
37 | void tabread_tilde_setup(void); | ||
38 | void tabread_setup(void); | ||
39 | void tabreceive_tilde_setup(void); | ||
40 | void tabsend_tilde_setup(void); | ||
41 | void tabwrite_tilde_setup(void); | ||
42 | void tabwrite_setup(void); | ||
43 | void threshold_tilde_setup(void); | ||
44 | void vcf_tilde_setup(void); | ||
45 | void vd_tilde_setup(void); | ||
46 | void vline_tilde_setup(void); | ||
47 | void vsnapshot_tilde_setup(void); | ||
48 | void wrap_tilde_setup(void); | ||
49 | #endif /* ROCKBOX */ | ||
50 | |||
51 | void d_intern_setup(void) { | ||
52 | #ifndef ROCKBOX | ||
4 | fprintf(stderr,"setup\n"); | 53 | fprintf(stderr,"setup\n"); |
54 | #endif | ||
5 | biquad_tilde_setup(); | 55 | biquad_tilde_setup(); |
6 | bp_tilde_setup(); | 56 | bp_tilde_setup(); |
7 | clip_tilde_setup(); | 57 | clip_tilde_setup(); |
diff --git a/apps/plugins/pdbox/PDa/intern/line~.c b/apps/plugins/pdbox/PDa/intern/line~.c index f37f23c19d..bb4e689bda 100644 --- a/apps/plugins/pdbox/PDa/intern/line~.c +++ b/apps/plugins/pdbox/PDa/intern/line~.c | |||
@@ -23,7 +23,9 @@ static t_int *line_perform(t_int *w) | |||
23 | t_line *x = (t_line *)(w[1]); | 23 | t_line *x = (t_line *)(w[1]); |
24 | t_sample *out = (t_sample *)(w[2]); | 24 | t_sample *out = (t_sample *)(w[2]); |
25 | int n = (int)(w[3]); | 25 | int n = (int)(w[3]); |
26 | #ifndef ROCKBOX | ||
26 | t_sample f = x->x_value; | 27 | t_sample f = x->x_value; |
28 | #endif | ||
27 | 29 | ||
28 | if (x->x_retarget) | 30 | if (x->x_retarget) |
29 | { | 31 | { |
diff --git a/apps/plugins/pdbox/PDa/intern/lop~.c b/apps/plugins/pdbox/PDa/intern/lop~.c index 9d36091711..08fe8188c9 100644 --- a/apps/plugins/pdbox/PDa/intern/lop~.c +++ b/apps/plugins/pdbox/PDa/intern/lop~.c | |||
@@ -46,6 +46,9 @@ static void siglop_ft1(t_siglop *x, t_floatarg f) | |||
46 | 46 | ||
47 | static void siglop_clear(t_siglop *x, t_floatarg q) | 47 | static void siglop_clear(t_siglop *x, t_floatarg q) |
48 | { | 48 | { |
49 | #ifdef ROCKBOX | ||
50 | (void) q; | ||
51 | #endif | ||
49 | x->x_cspace.c_x = 0; | 52 | x->x_cspace.c_x = 0; |
50 | } | 53 | } |
51 | 54 | ||
diff --git a/apps/plugins/pdbox/PDa/intern/mtof~.c b/apps/plugins/pdbox/PDa/intern/mtof~.c index cf0fd66da6..86d78ce107 100644 --- a/apps/plugins/pdbox/PDa/intern/mtof~.c +++ b/apps/plugins/pdbox/PDa/intern/mtof~.c | |||
@@ -1,3 +1,8 @@ | |||
1 | #ifdef ROCKBOX | ||
2 | #include "plugin.h" | ||
3 | #include "pdbox.h" | ||
4 | #endif | ||
5 | |||
1 | #include <m_pd.h> | 6 | #include <m_pd.h> |
2 | #include <m_fixed.h> | 7 | #include <m_fixed.h> |
3 | 8 | ||
@@ -36,6 +41,9 @@ static t_int *mtof_tilde_perform(t_int *w) | |||
36 | 41 | ||
37 | static void mtof_tilde_dsp(t_mtof_tilde *x, t_signal **sp) | 42 | static void mtof_tilde_dsp(t_mtof_tilde *x, t_signal **sp) |
38 | { | 43 | { |
44 | #ifdef ROCKBOX | ||
45 | (void) x; | ||
46 | #endif | ||
39 | post("warning: %s not usable yet",__FUNCTION__); | 47 | post("warning: %s not usable yet",__FUNCTION__); |
40 | dsp_add(mtof_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); | 48 | dsp_add(mtof_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); |
41 | } | 49 | } |
diff --git a/apps/plugins/pdbox/PDa/intern/osc~.c b/apps/plugins/pdbox/PDa/intern/osc~.c index b2cc843b55..871519173b 100644 --- a/apps/plugins/pdbox/PDa/intern/osc~.c +++ b/apps/plugins/pdbox/PDa/intern/osc~.c | |||
@@ -6,7 +6,11 @@ | |||
6 | 6 | ||
7 | /* ------------------------ osc~ ----------------------------- */ | 7 | /* ------------------------ osc~ ----------------------------- */ |
8 | 8 | ||
9 | #ifdef ROCKBOX | ||
10 | static t_class *osc_class; | ||
11 | #else | ||
9 | static t_class *osc_class, *scalarosc_class; | 12 | static t_class *osc_class, *scalarosc_class; |
13 | #endif | ||
10 | 14 | ||
11 | typedef struct _osc | 15 | typedef struct _osc |
12 | { | 16 | { |
diff --git a/apps/plugins/pdbox/PDa/intern/powtodb~.c b/apps/plugins/pdbox/PDa/intern/powtodb~.c index 5fead1511c..1714c8855e 100644 --- a/apps/plugins/pdbox/PDa/intern/powtodb~.c +++ b/apps/plugins/pdbox/PDa/intern/powtodb~.c | |||
@@ -1,3 +1,8 @@ | |||
1 | #ifdef ROCKBOX | ||
2 | #include "plugin.h" | ||
3 | #include "pdbox.h" | ||
4 | #endif | ||
5 | |||
1 | #include <m_pd.h> | 6 | #include <m_pd.h> |
2 | #include <m_fixed.h> | 7 | #include <m_fixed.h> |
3 | 8 | ||
@@ -39,6 +44,9 @@ static t_int *powtodb_tilde_perform(t_int *w) | |||
39 | 44 | ||
40 | static void powtodb_tilde_dsp(t_powtodb_tilde *x, t_signal **sp) | 45 | static void powtodb_tilde_dsp(t_powtodb_tilde *x, t_signal **sp) |
41 | { | 46 | { |
47 | #ifdef ROCKBOX | ||
48 | (void) x; | ||
49 | #endif | ||
42 | post("warning: %s not usable yet",__FUNCTION__); | 50 | post("warning: %s not usable yet",__FUNCTION__); |
43 | dsp_add(powtodb_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); | 51 | dsp_add(powtodb_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); |
44 | } | 52 | } |
diff --git a/apps/plugins/pdbox/PDa/intern/rmstodb~.c b/apps/plugins/pdbox/PDa/intern/rmstodb~.c index ee2b2a9874..3b46b38ea7 100644 --- a/apps/plugins/pdbox/PDa/intern/rmstodb~.c +++ b/apps/plugins/pdbox/PDa/intern/rmstodb~.c | |||
@@ -1,3 +1,8 @@ | |||
1 | #ifdef ROCKBOX | ||
2 | #include "plugin.h" | ||
3 | #include "pdbox.h" | ||
4 | #endif | ||
5 | |||
1 | #include <m_pd.h> | 6 | #include <m_pd.h> |
2 | #include <m_fixed.h> | 7 | #include <m_fixed.h> |
3 | 8 | ||
@@ -39,6 +44,9 @@ static t_int *rmstodb_tilde_perform(t_int *w) | |||
39 | 44 | ||
40 | static void rmstodb_tilde_dsp(t_rmstodb_tilde *x, t_signal **sp) | 45 | static void rmstodb_tilde_dsp(t_rmstodb_tilde *x, t_signal **sp) |
41 | { | 46 | { |
47 | #ifdef ROCKBOX | ||
48 | (void) x; | ||
49 | #endif | ||
42 | post("warning: %s not usable yet",__FUNCTION__); | 50 | post("warning: %s not usable yet",__FUNCTION__); |
43 | dsp_add(rmstodb_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); | 51 | dsp_add(rmstodb_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); |
44 | } | 52 | } |
diff --git a/apps/plugins/pdbox/PDa/intern/rsqrt~.c b/apps/plugins/pdbox/PDa/intern/rsqrt~.c index dd7e2a135b..7f5a481132 100644 --- a/apps/plugins/pdbox/PDa/intern/rsqrt~.c +++ b/apps/plugins/pdbox/PDa/intern/rsqrt~.c | |||
@@ -1,3 +1,8 @@ | |||
1 | #ifdef ROCKBOX | ||
2 | #include "plugin.h" | ||
3 | #include "pdbox.h" | ||
4 | #endif | ||
5 | |||
1 | #include <m_pd.h> | 6 | #include <m_pd.h> |
2 | #include <m_fixed.h> | 7 | #include <m_fixed.h> |
3 | 8 | ||
@@ -89,6 +94,9 @@ static t_int *sigrsqrt_perform(t_int *w) | |||
89 | 94 | ||
90 | static void sigrsqrt_dsp(t_sigrsqrt *x, t_signal **sp) | 95 | static void sigrsqrt_dsp(t_sigrsqrt *x, t_signal **sp) |
91 | { | 96 | { |
97 | #ifdef ROCKBOX | ||
98 | (void) x; | ||
99 | #endif | ||
92 | dsp_add(sigrsqrt_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); | 100 | dsp_add(sigrsqrt_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); |
93 | } | 101 | } |
94 | 102 | ||
diff --git a/apps/plugins/pdbox/PDa/intern/sfread~.c b/apps/plugins/pdbox/PDa/intern/sfread~.c index 3882777ed9..186d7b5893 100644 --- a/apps/plugins/pdbox/PDa/intern/sfread~.c +++ b/apps/plugins/pdbox/PDa/intern/sfread~.c | |||
@@ -1,3 +1,7 @@ | |||
1 | #ifdef ROCKBOX | ||
2 | #include "plugin.h" | ||
3 | #include "pdbox.h" | ||
4 | #else /* ROCKBOX */ | ||
1 | #include <unistd.h> | 5 | #include <unistd.h> |
2 | #include <fcntl.h> | 6 | #include <fcntl.h> |
3 | #include <errno.h> | 7 | #include <errno.h> |
@@ -6,6 +10,7 @@ | |||
6 | #include <unistd.h> | 10 | #include <unistd.h> |
7 | #include <sys/mman.h> | 11 | #include <sys/mman.h> |
8 | #include <sys/stat.h> | 12 | #include <sys/stat.h> |
13 | #endif /* ROCKBOX */ | ||
9 | 14 | ||
10 | #include <m_pd.h> | 15 | #include <m_pd.h> |
11 | #include <m_fixed.h> | 16 | #include <m_fixed.h> |
@@ -40,7 +45,9 @@ typedef struct _sfread | |||
40 | 45 | ||
41 | void sfread_open(t_sfread *x,t_symbol *filename) | 46 | void sfread_open(t_sfread *x,t_symbol *filename) |
42 | { | 47 | { |
48 | #ifndef ROCKBOX | ||
43 | struct stat fstate; | 49 | struct stat fstate; |
50 | #endif | ||
44 | char fname[MAXPDSTRING]; | 51 | char fname[MAXPDSTRING]; |
45 | 52 | ||
46 | if (filename == &s_) { | 53 | if (filename == &s_) { |
@@ -54,7 +61,11 @@ void sfread_open(t_sfread *x,t_symbol *filename) | |||
54 | 61 | ||
55 | /* close the old file */ | 62 | /* close the old file */ |
56 | 63 | ||
64 | #ifdef ROCKBOX | ||
65 | if (x->x_mapaddr) freebytes(x->x_mapaddr, x->x_size); | ||
66 | #else | ||
57 | if (x->x_mapaddr) munmap(x->x_mapaddr,x->x_size); | 67 | if (x->x_mapaddr) munmap(x->x_mapaddr,x->x_size); |
68 | #endif | ||
58 | if (x->x_fd >= 0) close(x->x_fd); | 69 | if (x->x_fd >= 0) close(x->x_fd); |
59 | 70 | ||
60 | if ((x->x_fd = open(fname,O_RDONLY)) < 0) | 71 | if ((x->x_fd = open(fname,O_RDONLY)) < 0) |
@@ -66,17 +77,35 @@ void sfread_open(t_sfread *x,t_symbol *filename) | |||
66 | } | 77 | } |
67 | 78 | ||
68 | /* get the size */ | 79 | /* get the size */ |
69 | 80 | #ifdef ROCKBOX | |
81 | x->x_size = rb->filesize(x->x_fd); | ||
82 | #else | ||
70 | fstat(x->x_fd,&fstate); | 83 | fstat(x->x_fd,&fstate); |
71 | x->x_size = fstate.st_size; | 84 | x->x_size = fstate.st_size; |
85 | #endif | ||
72 | 86 | ||
73 | /* map the file into memory */ | 87 | /* map the file into memory */ |
74 | 88 | ||
89 | #ifdef ROCKBOX | ||
90 | x->x_mapaddr = getbytes(x->x_size); | ||
91 | if (!x->x_mapaddr) | ||
92 | { | ||
93 | error("can't mmap %s",fname); | ||
94 | return; | ||
95 | } | ||
96 | int r = read(x->x_fd, x->x_mapaddr, x->x_size); | ||
97 | if (r != x->x_size) | ||
98 | { | ||
99 | error("can't mmap %s",fname); | ||
100 | return; | ||
101 | } | ||
102 | #else | ||
75 | if (!(x->x_mapaddr = mmap(NULL,x->x_size,PROT_READ,MAP_PRIVATE,x->x_fd,0))) | 103 | if (!(x->x_mapaddr = mmap(NULL,x->x_size,PROT_READ,MAP_PRIVATE,x->x_fd,0))) |
76 | { | 104 | { |
77 | error("can't mmap %s",fname); | 105 | error("can't mmap %s",fname); |
78 | return; | 106 | return; |
79 | } | 107 | } |
108 | #endif | ||
80 | } | 109 | } |
81 | 110 | ||
82 | #define MAX_CHANS 4 | 111 | #define MAX_CHANS 4 |
@@ -236,6 +265,9 @@ static void sfread_offset(t_sfread* x, t_floatarg f) | |||
236 | 265 | ||
237 | static void *sfread_new(t_floatarg chan,t_floatarg skip) | 266 | static void *sfread_new(t_floatarg chan,t_floatarg skip) |
238 | { | 267 | { |
268 | #ifdef ROCKBOX | ||
269 | (void) skip; | ||
270 | #endif | ||
239 | t_sfread *x = (t_sfread *)pd_new(sfread_class); | 271 | t_sfread *x = (t_sfread *)pd_new(sfread_class); |
240 | t_int c = chan; | 272 | t_int c = chan; |
241 | 273 | ||
diff --git a/apps/plugins/pdbox/PDa/intern/sfwrite~.c b/apps/plugins/pdbox/PDa/intern/sfwrite~.c index 6b054f17b9..0a6f4e9381 100644 --- a/apps/plugins/pdbox/PDa/intern/sfwrite~.c +++ b/apps/plugins/pdbox/PDa/intern/sfwrite~.c | |||
@@ -1,4 +1,7 @@ | |||
1 | 1 | #ifdef ROCKBOX | |
2 | #include "plugin.h" | ||
3 | #include "pdbox.h" | ||
4 | #else /* ROCKBOX */ | ||
2 | #include <unistd.h> | 5 | #include <unistd.h> |
3 | #include <fcntl.h> | 6 | #include <fcntl.h> |
4 | #include <errno.h> | 7 | #include <errno.h> |
@@ -7,6 +10,7 @@ | |||
7 | #include <unistd.h> | 10 | #include <unistd.h> |
8 | #include <sys/mman.h> | 11 | #include <sys/mman.h> |
9 | #include <sys/stat.h> | 12 | #include <sys/stat.h> |
13 | #endif /* ROCKBOX */ | ||
10 | 14 | ||
11 | #include <m_pd.h> | 15 | #include <m_pd.h> |
12 | #include <m_fixed.h> | 16 | #include <m_fixed.h> |
@@ -87,7 +91,11 @@ static void sfwrite_open(t_sfwrite *x,t_symbol *filename) | |||
87 | 91 | ||
88 | sfwrite_close(x); | 92 | sfwrite_close(x); |
89 | 93 | ||
94 | #ifdef ROCKBOX | ||
95 | if ((x->x_file = open(fname, O_RDWR | O_CREAT)) < 0) | ||
96 | #else | ||
90 | if ((x->x_file = open(fname,O_RDWR | O_CREAT,0664)) < 0) | 97 | if ((x->x_file = open(fname,O_RDWR | O_CREAT,0664)) < 0) |
98 | #endif | ||
91 | { | 99 | { |
92 | error("can't create %s",fname); | 100 | error("can't create %s",fname); |
93 | return; | 101 | return; |
diff --git a/apps/plugins/pdbox/PDa/intern/sqrt~.c b/apps/plugins/pdbox/PDa/intern/sqrt~.c index f5362f094f..d78a6c6b98 100644 --- a/apps/plugins/pdbox/PDa/intern/sqrt~.c +++ b/apps/plugins/pdbox/PDa/intern/sqrt~.c | |||
@@ -1,6 +1,11 @@ | |||
1 | #define DUMTAB1SIZE 256 | 1 | #define DUMTAB1SIZE 256 |
2 | #define DUMTAB2SIZE 1024 | 2 | #define DUMTAB2SIZE 1024 |
3 | 3 | ||
4 | #ifdef ROCKBOX | ||
5 | #include "plugin.h" | ||
6 | #include "pdbox.h" | ||
7 | #endif | ||
8 | |||
4 | #include<m_pd.h> | 9 | #include<m_pd.h> |
5 | #include<m_fixed.h> | 10 | #include<m_fixed.h> |
6 | 11 | ||
@@ -62,6 +67,9 @@ t_int *sigsqrt_perform(t_int *w) /* not static; also used in d_fft.c */ | |||
62 | 67 | ||
63 | static void sigsqrt_dsp(t_sigsqrt *x, t_signal **sp) | 68 | static void sigsqrt_dsp(t_sigsqrt *x, t_signal **sp) |
64 | { | 69 | { |
70 | #ifdef ROCKBOX | ||
71 | (void) x; | ||
72 | #endif | ||
65 | dsp_add(sigsqrt_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); | 73 | dsp_add(sigsqrt_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); |
66 | } | 74 | } |
67 | 75 | ||
diff --git a/apps/plugins/pdbox/PDa/intern/tabosc4~.c b/apps/plugins/pdbox/PDa/intern/tabosc4~.c index f9b6ad0ac3..1c41e44bc3 100644 --- a/apps/plugins/pdbox/PDa/intern/tabosc4~.c +++ b/apps/plugins/pdbox/PDa/intern/tabosc4~.c | |||
@@ -77,7 +77,11 @@ zero: | |||
77 | void tabosc4_tilde_set(t_tabosc4_tilde *x, t_symbol *s) | 77 | void tabosc4_tilde_set(t_tabosc4_tilde *x, t_symbol *s) |
78 | { | 78 | { |
79 | t_garray *a; | 79 | t_garray *a; |
80 | #ifdef ROCKBOX | ||
81 | int pointsinarray; | ||
82 | #else | ||
80 | int npoints, pointsinarray; | 83 | int npoints, pointsinarray; |
84 | #endif | ||
81 | x->x_arrayname = s; | 85 | x->x_arrayname = s; |
82 | 86 | ||
83 | if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) | 87 | if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) |
@@ -93,7 +97,9 @@ void tabosc4_tilde_set(t_tabosc4_tilde *x, t_symbol *s) | |||
93 | } | 97 | } |
94 | else | 98 | else |
95 | { | 99 | { |
100 | #ifndef ROCKBOX | ||
96 | int i; | 101 | int i; |
102 | #endif | ||
97 | x->x_fnpoints = pointsinarray; | 103 | x->x_fnpoints = pointsinarray; |
98 | x->x_lognpoints = ilog2(pointsinarray); | 104 | x->x_lognpoints = ilog2(pointsinarray); |
99 | post("tabosc~: using %d (log %d) points of array",x->x_fnpoints,x->x_lognpoints); | 105 | post("tabosc~: using %d (log %d) points of array",x->x_fnpoints,x->x_lognpoints); |
diff --git a/apps/plugins/pdbox/PDa/intern/tabplay~.c b/apps/plugins/pdbox/PDa/intern/tabplay~.c index 5ac0d2701a..cc326559fa 100644 --- a/apps/plugins/pdbox/PDa/intern/tabplay~.c +++ b/apps/plugins/pdbox/PDa/intern/tabplay~.c | |||
@@ -1,5 +1,8 @@ | |||
1 | 1 | ||
2 | #ifndef ROCKBOX | ||
2 | #define FIXEDPOINT | 3 | #define FIXEDPOINT |
4 | #endif | ||
5 | |||
3 | #include <m_pd.h> | 6 | #include <m_pd.h> |
4 | #include <m_fixed.h> | 7 | #include <m_fixed.h> |
5 | 8 | ||
@@ -94,6 +97,11 @@ static void tabplay_tilde_list(t_tabplay_tilde *x, t_symbol *s, | |||
94 | { | 97 | { |
95 | long start = atom_getfloatarg(0, argc, argv); | 98 | long start = atom_getfloatarg(0, argc, argv); |
96 | long length = atom_getfloatarg(1, argc, argv); | 99 | long length = atom_getfloatarg(1, argc, argv); |
100 | |||
101 | #ifdef ROCKBOX | ||
102 | (void) s; | ||
103 | #endif | ||
104 | |||
97 | if (start < 0) start = 0; | 105 | if (start < 0) start = 0; |
98 | if (length <= 0) | 106 | if (length <= 0) |
99 | x->x_limit = 0x7fffffff; | 107 | x->x_limit = 0x7fffffff; |
diff --git a/apps/plugins/pdbox/PDa/intern/tabread4~.c b/apps/plugins/pdbox/PDa/intern/tabread4~.c index 47a6fc3ddf..62b539eb03 100644 --- a/apps/plugins/pdbox/PDa/intern/tabread4~.c +++ b/apps/plugins/pdbox/PDa/intern/tabread4~.c | |||
@@ -90,6 +90,9 @@ static void tabread4_tilde_dsp(t_tabread4_tilde *x, t_signal **sp) | |||
90 | 90 | ||
91 | static void tabread4_tilde_free(t_tabread4_tilde *x) | 91 | static void tabread4_tilde_free(t_tabread4_tilde *x) |
92 | { | 92 | { |
93 | #ifdef ROCKBOX | ||
94 | (void) x; | ||
95 | #endif | ||
93 | } | 96 | } |
94 | 97 | ||
95 | void tabread4_tilde_setup(void) | 98 | void tabread4_tilde_setup(void) |
diff --git a/apps/plugins/pdbox/PDa/intern/tabread~.c b/apps/plugins/pdbox/PDa/intern/tabread~.c index 5a7ea5d57f..c46a9045a0 100644 --- a/apps/plugins/pdbox/PDa/intern/tabread~.c +++ b/apps/plugins/pdbox/PDa/intern/tabread~.c | |||
@@ -1,4 +1,7 @@ | |||
1 | #ifndef ROCKBOX | ||
1 | #define FIXEDPOINT | 2 | #define FIXEDPOINT |
3 | #endif | ||
4 | |||
2 | #include <m_pd.h> | 5 | #include <m_pd.h> |
3 | #include <m_fixed.h> | 6 | #include <m_fixed.h> |
4 | 7 | ||
@@ -30,7 +33,11 @@ static t_int *tabread_tilde_perform(t_int *w) | |||
30 | t_sample *out = (t_sample *)(w[3]); | 33 | t_sample *out = (t_sample *)(w[3]); |
31 | int n = (int)(w[4]); | 34 | int n = (int)(w[4]); |
32 | int maxindex; | 35 | int maxindex; |
36 | #ifdef ROCKBOX | ||
37 | t_sample *buf = x->x_vec; | ||
38 | #else | ||
33 | t_sample *buf = x->x_vec, *fp; | 39 | t_sample *buf = x->x_vec, *fp; |
40 | #endif | ||
34 | int i; | 41 | int i; |
35 | 42 | ||
36 | maxindex = x->x_npoints - 1; | 43 | maxindex = x->x_npoints - 1; |
@@ -82,6 +89,9 @@ static void tabread_tilde_dsp(t_tabread_tilde *x, t_signal **sp) | |||
82 | 89 | ||
83 | static void tabread_tilde_free(t_tabread_tilde *x) | 90 | static void tabread_tilde_free(t_tabread_tilde *x) |
84 | { | 91 | { |
92 | #ifdef ROCKBOX | ||
93 | (void) x; | ||
94 | #endif | ||
85 | } | 95 | } |
86 | 96 | ||
87 | void tabread_tilde_setup(void) | 97 | void tabread_tilde_setup(void) |
diff --git a/apps/plugins/pdbox/PDa/intern/tabsend~.c b/apps/plugins/pdbox/PDa/intern/tabsend~.c index 9021bac951..a3bc5605b4 100644 --- a/apps/plugins/pdbox/PDa/intern/tabsend~.c +++ b/apps/plugins/pdbox/PDa/intern/tabsend~.c | |||
@@ -54,7 +54,11 @@ bad: | |||
54 | 54 | ||
55 | static void tabsend_dsp(t_tabsend *x, t_signal **sp) | 55 | static void tabsend_dsp(t_tabsend *x, t_signal **sp) |
56 | { | 56 | { |
57 | #ifdef ROCKBOX | ||
58 | int vecsize; | ||
59 | #else | ||
57 | int i, vecsize; | 60 | int i, vecsize; |
61 | #endif | ||
58 | t_garray *a; | 62 | t_garray *a; |
59 | 63 | ||
60 | if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) | 64 | if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) |
diff --git a/apps/plugins/pdbox/PDa/intern/tabwrite.c b/apps/plugins/pdbox/PDa/intern/tabwrite.c index ff4e40d042..1db5aaa407 100644 --- a/apps/plugins/pdbox/PDa/intern/tabwrite.c +++ b/apps/plugins/pdbox/PDa/intern/tabwrite.c | |||
@@ -24,7 +24,11 @@ static void tabwrite_tick(t_tabwrite *x) | |||
24 | 24 | ||
25 | static void tabwrite_float(t_tabwrite *x, t_float f) | 25 | static void tabwrite_float(t_tabwrite *x, t_float f) |
26 | { | 26 | { |
27 | #ifdef ROCKBOX | ||
28 | int vecsize; | ||
29 | #else | ||
27 | int i, vecsize; | 30 | int i, vecsize; |
31 | #endif | ||
28 | t_garray *a; | 32 | t_garray *a; |
29 | t_sample *vec; | 33 | t_sample *vec; |
30 | 34 | ||
diff --git a/apps/plugins/pdbox/PDa/intern/vd~.c b/apps/plugins/pdbox/PDa/intern/vd~.c index 471df56753..81f9d48938 100644 --- a/apps/plugins/pdbox/PDa/intern/vd~.c +++ b/apps/plugins/pdbox/PDa/intern/vd~.c | |||
@@ -1,12 +1,14 @@ | |||
1 | #include <m_pd.h> | 1 | #include <m_pd.h> |
2 | #include <m_fixed.h> | 2 | #include <m_fixed.h> |
3 | 3 | ||
4 | #include "delay.h" | ||
5 | |||
6 | extern int ugen_getsortno(void); | 4 | extern int ugen_getsortno(void); |
7 | 5 | ||
6 | #include "delay.h" | ||
7 | |||
8 | #define DEFDELVS 64 /* LATER get this from canvas at DSP time */ | 8 | #define DEFDELVS 64 /* LATER get this from canvas at DSP time */ |
9 | #ifndef ROCKBOX | ||
9 | static int delread_zero = 0; /* four bytes of zero for delread~, vd~ */ | 10 | static int delread_zero = 0; /* four bytes of zero for delread~, vd~ */ |
11 | #endif | ||
10 | 12 | ||
11 | static t_class *sigvd_class; | 13 | static t_class *sigvd_class; |
12 | 14 | ||
@@ -37,14 +39,18 @@ static t_int *sigvd_perform(t_int *w) | |||
37 | t_sample *in = (t_sample *)(w[1]); | 39 | t_sample *in = (t_sample *)(w[1]); |
38 | t_sample *out = (t_sample *)(w[2]); | 40 | t_sample *out = (t_sample *)(w[2]); |
39 | t_delwritectl *ctl = (t_delwritectl *)(w[3]); | 41 | t_delwritectl *ctl = (t_delwritectl *)(w[3]); |
42 | #ifndef ROCKBOX | ||
40 | t_sigvd *x = (t_sigvd *)(w[4]); | 43 | t_sigvd *x = (t_sigvd *)(w[4]); |
44 | #endif | ||
41 | int n = (int)(w[5]); | 45 | int n = (int)(w[5]); |
42 | 46 | ||
43 | int nsamps = ctl->c_n; | 47 | int nsamps = ctl->c_n; |
44 | int fn = n; | 48 | int fn = n; |
45 | t_sample limit = nsamps - n - 1; | 49 | t_sample limit = nsamps - n - 1; |
46 | t_sample *vp = ctl->c_vec, *bp, *wp = vp + ctl->c_phase; | 50 | t_sample *vp = ctl->c_vec, *bp, *wp = vp + ctl->c_phase; |
51 | #ifndef ROCKBOX | ||
47 | t_sample zerodel = x->x_zerodel; | 52 | t_sample zerodel = x->x_zerodel; |
53 | #endif | ||
48 | while (n--) | 54 | while (n--) |
49 | { | 55 | { |
50 | t_time delsamps = ((long long) mult((*in++),ftofix(44.1)));//- itofix(zerodel); | 56 | t_time delsamps = ((long long) mult((*in++),ftofix(44.1)));//- itofix(zerodel); |
diff --git a/apps/plugins/pdbox/PDa/intern/vline~.c b/apps/plugins/pdbox/PDa/intern/vline~.c index 15f0d1793e..dc73f72571 100644 --- a/apps/plugins/pdbox/PDa/intern/vline~.c +++ b/apps/plugins/pdbox/PDa/intern/vline~.c | |||
@@ -1,3 +1,8 @@ | |||
1 | #ifdef ROCKBOX | ||
2 | #include "plugin.h" | ||
3 | #include "pdbox.h" | ||
4 | #endif | ||
5 | |||
1 | #include <m_pd.h> | 6 | #include <m_pd.h> |
2 | #include <m_fixed.h> | 7 | #include <m_fixed.h> |
3 | 8 | ||
@@ -36,7 +41,9 @@ static t_int *vline_tilde_perform(t_int *w) | |||
36 | t_sample f = x->x_value; | 41 | t_sample f = x->x_value; |
37 | t_sample inc = x->x_inc; | 42 | t_sample inc = x->x_inc; |
38 | t_time msecpersamp = x->x_msecpersamp; | 43 | t_time msecpersamp = x->x_msecpersamp; |
44 | #ifndef ROCKBOX | ||
39 | t_time samppermsec = x->x_samppermsec; | 45 | t_time samppermsec = x->x_samppermsec; |
46 | #endif | ||
40 | t_time timenow = clock_gettimesince(x->x_referencetime) - n * msecpersamp; | 47 | t_time timenow = clock_gettimesince(x->x_referencetime) - n * msecpersamp; |
41 | t_vseg *s = x->x_list; | 48 | t_vseg *s = x->x_list; |
42 | for (i = 0; i < n; i++) | 49 | for (i = 0; i < n; i++) |
@@ -58,7 +65,7 @@ static t_int *vline_tilde_perform(t_int *w) | |||
58 | } | 65 | } |
59 | else | 66 | else |
60 | { | 67 | { |
61 | t_time incpermsec = div((s->s_target - f), | 68 | t_time incpermsec = idiv((s->s_target - f), |
62 | (s->s_targettime - s->s_starttime)); | 69 | (s->s_targettime - s->s_starttime)); |
63 | f = mult(f + incpermsec,(timenext - s->s_starttime)); | 70 | f = mult(f + incpermsec,(timenext - s->s_starttime)); |
64 | inc = mult(incpermsec,msecpersamp); | 71 | inc = mult(incpermsec,msecpersamp); |
@@ -123,7 +130,7 @@ static void vline_tilde_float(t_vline *x, t_float f) | |||
123 | } | 130 | } |
124 | else | 131 | else |
125 | { | 132 | { |
126 | for (s1 = x->x_list; s2 = s1->s_next; s1 = s2) | 133 | for (s1 = x->x_list; (s2 = s1->s_next); s1 = s2) |
127 | { | 134 | { |
128 | if (s2->s_starttime > starttime || | 135 | if (s2->s_starttime > starttime || |
129 | (s2->s_starttime == starttime && | 136 | (s2->s_starttime == starttime && |
diff --git a/apps/plugins/pdbox/PDa/intern/wrap~.c b/apps/plugins/pdbox/PDa/intern/wrap~.c index c011babdfc..99b50e61dd 100644 --- a/apps/plugins/pdbox/PDa/intern/wrap~.c +++ b/apps/plugins/pdbox/PDa/intern/wrap~.c | |||
@@ -40,6 +40,9 @@ static t_int *sigwrap_perform(t_int *w) | |||
40 | 40 | ||
41 | static void sigwrap_dsp(t_sigwrap *x, t_signal **sp) | 41 | static void sigwrap_dsp(t_sigwrap *x, t_signal **sp) |
42 | { | 42 | { |
43 | #ifdef ROCKBOX | ||
44 | (void) x; | ||
45 | #endif | ||
43 | dsp_add(sigwrap_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); | 46 | dsp_add(sigwrap_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); |
44 | } | 47 | } |
45 | 48 | ||
diff --git a/apps/plugins/pdbox/PDa/src/d_arithmetic.c b/apps/plugins/pdbox/PDa/src/d_arithmetic.c index 30744882f4..fa306dedd3 100644 --- a/apps/plugins/pdbox/PDa/src/d_arithmetic.c +++ b/apps/plugins/pdbox/PDa/src/d_arithmetic.c | |||
@@ -28,6 +28,9 @@ typedef struct _scalarplus | |||
28 | 28 | ||
29 | static void *plus_new(t_symbol *s, int argc, t_atom *argv) | 29 | static void *plus_new(t_symbol *s, int argc, t_atom *argv) |
30 | { | 30 | { |
31 | #ifdef ROCKBOX | ||
32 | (void) s; | ||
33 | #endif | ||
31 | if (argc > 1) post("+~: extra arguments ignored"); | 34 | if (argc > 1) post("+~: extra arguments ignored"); |
32 | if (argc) | 35 | if (argc) |
33 | { | 36 | { |
@@ -115,6 +118,9 @@ void dsp_add_plus(t_sample *in1, t_sample *in2, t_sample *out, int n) | |||
115 | 118 | ||
116 | static void plus_dsp(t_plus *x, t_signal **sp) | 119 | static void plus_dsp(t_plus *x, t_signal **sp) |
117 | { | 120 | { |
121 | #ifdef ROCKBOX | ||
122 | (void) x; | ||
123 | #endif | ||
118 | dsp_add_plus(sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); | 124 | dsp_add_plus(sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); |
119 | } | 125 | } |
120 | 126 | ||
@@ -161,6 +167,9 @@ typedef struct _scalarminus | |||
161 | 167 | ||
162 | static void *minus_new(t_symbol *s, int argc, t_atom *argv) | 168 | static void *minus_new(t_symbol *s, int argc, t_atom *argv) |
163 | { | 169 | { |
170 | #ifdef ROCKBOX | ||
171 | (void) s; | ||
172 | #endif | ||
164 | if (argc > 1) post("-~: extra arguments ignored"); | 173 | if (argc > 1) post("-~: extra arguments ignored"); |
165 | if (argc) | 174 | if (argc) |
166 | { | 175 | { |
@@ -240,6 +249,9 @@ t_int *scalarminus_perf8(t_int *w) | |||
240 | 249 | ||
241 | static void minus_dsp(t_minus *x, t_signal **sp) | 250 | static void minus_dsp(t_minus *x, t_signal **sp) |
242 | { | 251 | { |
252 | #ifdef ROCKBOX | ||
253 | (void) x; | ||
254 | #endif | ||
243 | if (sp[0]->s_n&7) | 255 | if (sp[0]->s_n&7) |
244 | dsp_add(minus_perform, 4, | 256 | dsp_add(minus_perform, 4, |
245 | sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); | 257 | sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); |
@@ -292,6 +304,9 @@ typedef struct _scalartimes | |||
292 | 304 | ||
293 | static void *times_new(t_symbol *s, int argc, t_atom *argv) | 305 | static void *times_new(t_symbol *s, int argc, t_atom *argv) |
294 | { | 306 | { |
307 | #ifdef ROCKBOX | ||
308 | (void) s; | ||
309 | #endif | ||
295 | if (argc > 1) post("*~: extra arguments ignored"); | 310 | if (argc > 1) post("*~: extra arguments ignored"); |
296 | if (argc) | 311 | if (argc) |
297 | { | 312 | { |
@@ -371,6 +386,9 @@ t_int *scalartimes_perf8(t_int *w) | |||
371 | 386 | ||
372 | static void times_dsp(t_times *x, t_signal **sp) | 387 | static void times_dsp(t_times *x, t_signal **sp) |
373 | { | 388 | { |
389 | #ifdef ROCKBOX | ||
390 | (void) x; | ||
391 | #endif | ||
374 | if (sp[0]->s_n&7) | 392 | if (sp[0]->s_n&7) |
375 | dsp_add(times_perform, 4, | 393 | dsp_add(times_perform, 4, |
376 | sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); | 394 | sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); |
@@ -422,6 +440,9 @@ typedef struct _scalarover | |||
422 | 440 | ||
423 | static void *over_new(t_symbol *s, int argc, t_atom *argv) | 441 | static void *over_new(t_symbol *s, int argc, t_atom *argv) |
424 | { | 442 | { |
443 | #ifdef ROCKBOX | ||
444 | (void) s; | ||
445 | #endif | ||
425 | if (argc > 1) post("/~: extra arguments ignored"); | 446 | if (argc > 1) post("/~: extra arguments ignored"); |
426 | if (argc) | 447 | if (argc) |
427 | { | 448 | { |
@@ -512,6 +533,9 @@ t_int *scalarover_perf8(t_int *w) | |||
512 | 533 | ||
513 | static void over_dsp(t_over *x, t_signal **sp) | 534 | static void over_dsp(t_over *x, t_signal **sp) |
514 | { | 535 | { |
536 | #ifdef ROCKBOX | ||
537 | (void) x; | ||
538 | #endif | ||
515 | if (sp[0]->s_n&7) | 539 | if (sp[0]->s_n&7) |
516 | dsp_add(over_perform, 4, | 540 | dsp_add(over_perform, 4, |
517 | sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); | 541 | sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); |
@@ -563,6 +587,9 @@ typedef struct _scalarmax | |||
563 | 587 | ||
564 | static void *max_new(t_symbol *s, int argc, t_atom *argv) | 588 | static void *max_new(t_symbol *s, int argc, t_atom *argv) |
565 | { | 589 | { |
590 | #ifdef ROCKBOX | ||
591 | (void) s; | ||
592 | #endif | ||
566 | if (argc > 1) post("max~: extra arguments ignored"); | 593 | if (argc > 1) post("max~: extra arguments ignored"); |
567 | if (argc) | 594 | if (argc) |
568 | { | 595 | { |
@@ -654,6 +681,9 @@ t_int *scalarmax_perf8(t_int *w) | |||
654 | 681 | ||
655 | static void max_dsp(t_max *x, t_signal **sp) | 682 | static void max_dsp(t_max *x, t_signal **sp) |
656 | { | 683 | { |
684 | #ifdef ROCKBOX | ||
685 | (void) x; | ||
686 | #endif | ||
657 | if (sp[0]->s_n&7) | 687 | if (sp[0]->s_n&7) |
658 | dsp_add(max_perform, 4, | 688 | dsp_add(max_perform, 4, |
659 | sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); | 689 | sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); |
@@ -705,6 +735,9 @@ typedef struct _scalarmin | |||
705 | 735 | ||
706 | static void *min_new(t_symbol *s, int argc, t_atom *argv) | 736 | static void *min_new(t_symbol *s, int argc, t_atom *argv) |
707 | { | 737 | { |
738 | #ifdef ROCKBOX | ||
739 | (void) s; | ||
740 | #endif | ||
708 | if (argc > 1) post("min~: extra arguments ignored"); | 741 | if (argc > 1) post("min~: extra arguments ignored"); |
709 | if (argc) | 742 | if (argc) |
710 | { | 743 | { |
@@ -796,6 +829,9 @@ t_int *scalarmin_perf8(t_int *w) | |||
796 | 829 | ||
797 | static void min_dsp(t_min *x, t_signal **sp) | 830 | static void min_dsp(t_min *x, t_signal **sp) |
798 | { | 831 | { |
832 | #ifdef ROCKBOX | ||
833 | (void) x; | ||
834 | #endif | ||
799 | if (sp[0]->s_n&7) | 835 | if (sp[0]->s_n&7) |
800 | dsp_add(min_perform, 4, | 836 | dsp_add(min_perform, 4, |
801 | sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); | 837 | sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); |
diff --git a/apps/plugins/pdbox/PDa/src/d_ctl.c b/apps/plugins/pdbox/PDa/src/d_ctl.c index 809899addf..aa8df4fae8 100644 --- a/apps/plugins/pdbox/PDa/src/d_ctl.c +++ b/apps/plugins/pdbox/PDa/src/d_ctl.c | |||
@@ -74,7 +74,10 @@ static void *sig_tilde_new(t_floatarg f) | |||
74 | return (x); | 74 | return (x); |
75 | } | 75 | } |
76 | 76 | ||
77 | static void sig_tilde_setup(void) | 77 | #ifndef ROCKBOX |
78 | static | ||
79 | #endif | ||
80 | void sig_tilde_setup(void) | ||
78 | { | 81 | { |
79 | sig_tilde_class = class_new(gensym("sig~"), (t_newmethod)sig_tilde_new, 0, | 82 | sig_tilde_class = class_new(gensym("sig~"), (t_newmethod)sig_tilde_new, 0, |
80 | sizeof(t_sig), 0, A_DEFFLOAT, 0); | 83 | sizeof(t_sig), 0, A_DEFFLOAT, 0); |
diff --git a/apps/plugins/pdbox/PDa/src/d_dac.c b/apps/plugins/pdbox/PDa/src/d_dac.c index 1606b3a1f2..29b3410de9 100644 --- a/apps/plugins/pdbox/PDa/src/d_dac.c +++ b/apps/plugins/pdbox/PDa/src/d_dac.c | |||
@@ -22,8 +22,17 @@ typedef struct _dac | |||
22 | static void *dac_new(t_symbol *s, int argc, t_atom *argv) | 22 | static void *dac_new(t_symbol *s, int argc, t_atom *argv) |
23 | { | 23 | { |
24 | t_dac *x = (t_dac *)pd_new(dac_class); | 24 | t_dac *x = (t_dac *)pd_new(dac_class); |
25 | #ifdef ROCKBOX | ||
26 | t_atom defarg[2]; | ||
27 | #else | ||
25 | t_atom defarg[2], *ap; | 28 | t_atom defarg[2], *ap; |
29 | #endif | ||
26 | int i; | 30 | int i; |
31 | |||
32 | #ifdef ROCKBOX | ||
33 | (void) s; | ||
34 | #endif | ||
35 | |||
27 | if (!argc) | 36 | if (!argc) |
28 | { | 37 | { |
29 | argv = defarg; | 38 | argv = defarg; |
@@ -83,8 +92,17 @@ typedef struct _adc | |||
83 | static void *adc_new(t_symbol *s, int argc, t_atom *argv) | 92 | static void *adc_new(t_symbol *s, int argc, t_atom *argv) |
84 | { | 93 | { |
85 | t_adc *x = (t_adc *)pd_new(adc_class); | 94 | t_adc *x = (t_adc *)pd_new(adc_class); |
95 | #ifdef ROCKBOX | ||
96 | t_atom defarg[2]; | ||
97 | #else | ||
86 | t_atom defarg[2], *ap; | 98 | t_atom defarg[2], *ap; |
99 | #endif | ||
87 | int i; | 100 | int i; |
101 | |||
102 | #ifdef ROCKBOX | ||
103 | (void) s; | ||
104 | #endif | ||
105 | |||
88 | if (!argc) | 106 | if (!argc) |
89 | { | 107 | { |
90 | argv = defarg; | 108 | argv = defarg; |
diff --git a/apps/plugins/pdbox/PDa/src/d_fft.c b/apps/plugins/pdbox/PDa/src/d_fft.c index 7b70561a0e..6e2713a960 100644 --- a/apps/plugins/pdbox/PDa/src/d_fft.c +++ b/apps/plugins/pdbox/PDa/src/d_fft.c | |||
@@ -67,6 +67,9 @@ static t_int *sigifft_perform(t_int *w) | |||
67 | 67 | ||
68 | static void sigfft_dspx(t_sigfft *x, t_signal **sp, t_int *(*f)(t_int *w)) | 68 | static void sigfft_dspx(t_sigfft *x, t_signal **sp, t_int *(*f)(t_int *w)) |
69 | { | 69 | { |
70 | #ifdef ROCKBOX | ||
71 | (void) x; | ||
72 | #endif | ||
70 | int n = sp[0]->s_n; | 73 | int n = sp[0]->s_n; |
71 | t_sample *in1 = sp[0]->s_vec; | 74 | t_sample *in1 = sp[0]->s_vec; |
72 | t_sample *in2 = sp[1]->s_vec; | 75 | t_sample *in2 = sp[1]->s_vec; |
@@ -150,6 +153,9 @@ static t_int *sigrfft_perform(t_int *w) | |||
150 | 153 | ||
151 | static void sigrfft_dsp(t_sigrfft *x, t_signal **sp) | 154 | static void sigrfft_dsp(t_sigrfft *x, t_signal **sp) |
152 | { | 155 | { |
156 | #ifdef ROCKBOX | ||
157 | (void) x; | ||
158 | #endif | ||
153 | int n = sp[0]->s_n, n2 = (n>>1); | 159 | int n = sp[0]->s_n, n2 = (n>>1); |
154 | t_sample *in1 = sp[0]->s_vec; | 160 | t_sample *in1 = sp[0]->s_vec; |
155 | t_sample *out1 = sp[1]->s_vec; | 161 | t_sample *out1 = sp[1]->s_vec; |
@@ -213,6 +219,9 @@ static t_int *sigrifft_perform(t_int *w) | |||
213 | 219 | ||
214 | static void sigrifft_dsp(t_sigrifft *x, t_signal **sp) | 220 | static void sigrifft_dsp(t_sigrifft *x, t_signal **sp) |
215 | { | 221 | { |
222 | #ifdef ROCKBOX | ||
223 | (void) x; | ||
224 | #endif | ||
216 | int n = sp[0]->s_n, n2 = (n>>1); | 225 | int n = sp[0]->s_n, n2 = (n>>1); |
217 | t_sample *in1 = sp[0]->s_vec; | 226 | t_sample *in1 = sp[0]->s_vec; |
218 | t_sample *in2 = sp[1]->s_vec; | 227 | t_sample *in2 = sp[1]->s_vec; |
diff --git a/apps/plugins/pdbox/PDa/src/d_fftroutine.c b/apps/plugins/pdbox/PDa/src/d_fftroutine.c index 41948132d7..08888333fc 100644 --- a/apps/plugins/pdbox/PDa/src/d_fftroutine.c +++ b/apps/plugins/pdbox/PDa/src/d_fftroutine.c | |||
@@ -84,9 +84,14 @@ | |||
84 | /* INCLUDE FILES */ | 84 | /* INCLUDE FILES */ |
85 | /*****************************************************************************/ | 85 | /*****************************************************************************/ |
86 | 86 | ||
87 | #ifdef ROCKBOX | ||
88 | #include "plugin.h" | ||
89 | #include "pdbox.h" | ||
90 | #else /* ROCKBOX */ | ||
87 | #include <stdio.h> | 91 | #include <stdio.h> |
88 | #include <math.h> | 92 | #include <math.h> |
89 | #include <stdlib.h> | 93 | #include <stdlib.h> |
94 | #endif /* ROCKBOX */ | ||
90 | 95 | ||
91 | /* the following is needed only to declare pd_fft() as exportable in MSW */ | 96 | /* the following is needed only to declare pd_fft() as exportable in MSW */ |
92 | #include "m_pd.h" | 97 | #include "m_pd.h" |
@@ -280,7 +285,7 @@ void fft_clear(void) | |||
280 | nextnet = thisnet->next; | 285 | nextnet = thisnet->next; |
281 | net_dealloc(thisnet); | 286 | net_dealloc(thisnet); |
282 | free((char *)thisnet); | 287 | free((char *)thisnet); |
283 | } while (thisnet = nextnet); | 288 | } while ((thisnet = nextnet)); |
284 | } | 289 | } |
285 | } | 290 | } |
286 | 291 | ||
@@ -485,14 +490,21 @@ void load_registers(FFT_NET *fft_net, float *buf, int buf_form, | |||
485 | 490 | ||
486 | { | 491 | { |
487 | int *load_index = fft_net->load_index; | 492 | int *load_index = fft_net->load_index; |
493 | #ifdef ROCKBOX | ||
494 | SAMPLE *window = NULL; | ||
495 | int index, i = 0; | ||
496 | #else | ||
488 | SAMPLE *window; | 497 | SAMPLE *window; |
489 | int index, i = 0, n = fft_net->n; | 498 | int index, i = 0, n = fft_net->n; |
499 | #endif | ||
490 | 500 | ||
491 | if (trnsfrm_dir==FORWARD) window = fft_net->window; | 501 | if (trnsfrm_dir==FORWARD) window = fft_net->window; |
492 | else if (trnsfrm_dir==INVERSE) window = fft_net->inv_window; | 502 | else if (trnsfrm_dir==INVERSE) window = fft_net->inv_window; |
493 | else { | 503 | else { |
504 | #ifndef ROCKBOX | ||
494 | fprintf(stderr, "load_registers:illegal transform direction\n"); | 505 | fprintf(stderr, "load_registers:illegal transform direction\n"); |
495 | exit(0); | 506 | exit(0); |
507 | #endif | ||
496 | } | 508 | } |
497 | fft_net->direction = trnsfrm_dir; | 509 | fft_net->direction = trnsfrm_dir; |
498 | 510 | ||
@@ -539,8 +551,10 @@ void load_registers(FFT_NET *fft_net, float *buf, int buf_form, | |||
539 | } break; | 551 | } break; |
540 | 552 | ||
541 | default: { | 553 | default: { |
554 | #ifndef ROCKBOX | ||
542 | fprintf(stderr, "load_registers:illegal input form\n"); | 555 | fprintf(stderr, "load_registers:illegal input form\n"); |
543 | exit(0); | 556 | exit(0); |
557 | #endif | ||
544 | } break; | 558 | } break; |
545 | } | 559 | } |
546 | } break; | 560 | } break; |
@@ -591,15 +605,19 @@ void load_registers(FFT_NET *fft_net, float *buf, int buf_form, | |||
591 | } break; | 605 | } break; |
592 | 606 | ||
593 | default: { | 607 | default: { |
608 | #ifndef ROCKBOX | ||
594 | fprintf(stderr, "load_registers:illegal input form\n"); | 609 | fprintf(stderr, "load_registers:illegal input form\n"); |
595 | exit(0); | 610 | exit(0); |
611 | #endif | ||
596 | } break; | 612 | } break; |
597 | } | 613 | } |
598 | } break; | 614 | } break; |
599 | 615 | ||
600 | default: { | 616 | default: { |
617 | #ifndef ROCKBOX | ||
601 | fprintf(stderr, "load_registers:illegal input scale\n"); | 618 | fprintf(stderr, "load_registers:illegal input scale\n"); |
602 | exit(0); | 619 | exit(0); |
620 | #endif | ||
603 | } break; | 621 | } break; |
604 | } | 622 | } |
605 | } | 623 | } |
@@ -616,8 +634,15 @@ void store_registers(FFT_NET *fft_net, float *buf, int buf_form, | |||
616 | */ | 634 | */ |
617 | 635 | ||
618 | { | 636 | { |
637 | #ifdef ROCKBOX | ||
638 | (void) debug; | ||
639 | #endif | ||
619 | int i; | 640 | int i; |
641 | #ifdef ROCKBOX | ||
642 | SAMPLE real, imag; | ||
643 | #else | ||
620 | SAMPLE real, imag, mag, phase; | 644 | SAMPLE real, imag, mag, phase; |
645 | #endif | ||
621 | int n; | 646 | int n; |
622 | 647 | ||
623 | i = 0; | 648 | i = 0; |
@@ -661,12 +686,21 @@ void store_registers(FFT_NET *fft_net, float *buf, int buf_form, | |||
661 | if (real > .00001) | 686 | if (real > .00001) |
662 | *buf++ = (float)atan2(imag, real); | 687 | *buf++ = (float)atan2(imag, real); |
663 | else { /* deal with bad case */ | 688 | else { /* deal with bad case */ |
689 | #ifdef ROCKBOX | ||
690 | if (imag > 0){ *buf++ = PI / 2.; | ||
691 | } | ||
692 | else if (imag < 0){ *buf++ = -PI / 2.; | ||
693 | } | ||
694 | else { *buf++ = 0; | ||
695 | } | ||
696 | #else | ||
664 | if (imag > 0){ *buf++ = PI / 2.; | 697 | if (imag > 0){ *buf++ = PI / 2.; |
665 | if(debug) fprintf(stderr,"real=0 and imag > 0\n");} | 698 | if(debug) fprintf(stderr,"real=0 and imag > 0\n");} |
666 | else if (imag < 0){ *buf++ = -PI / 2.; | 699 | else if (imag < 0){ *buf++ = -PI / 2.; |
667 | if(debug) fprintf(stderr,"real=0 and imag < 0\n");} | 700 | if(debug) fprintf(stderr,"real=0 and imag < 0\n");} |
668 | else { *buf++ = 0; | 701 | else { *buf++ = 0; |
669 | if(debug) fprintf(stderr,"real=0 and imag=0\n");} | 702 | if(debug) fprintf(stderr,"real=0 and imag=0\n");} |
703 | #endif | ||
670 | } | 704 | } |
671 | } while (++i < n); | 705 | } while (++i < n); |
672 | } break; | 706 | } break; |
@@ -687,8 +721,10 @@ void store_registers(FFT_NET *fft_net, float *buf, int buf_form, | |||
687 | } break; | 721 | } break; |
688 | 722 | ||
689 | default: { | 723 | default: { |
724 | #ifndef ROCKBOX | ||
690 | fprintf(stderr, "store_registers:illegal output form\n"); | 725 | fprintf(stderr, "store_registers:illegal output form\n"); |
691 | exit(0); | 726 | exit(0); |
727 | #endif | ||
692 | } break; | 728 | } break; |
693 | } | 729 | } |
694 | } break; | 730 | } break; |
@@ -753,15 +789,19 @@ void store_registers(FFT_NET *fft_net, float *buf, int buf_form, | |||
753 | } break; | 789 | } break; |
754 | 790 | ||
755 | default: { | 791 | default: { |
792 | #ifndef ROCKBOX | ||
756 | fprintf(stderr, "store_registers:illegal output form\n"); | 793 | fprintf(stderr, "store_registers:illegal output form\n"); |
757 | exit(0); | 794 | exit(0); |
795 | #endif | ||
758 | } break; | 796 | } break; |
759 | } | 797 | } |
760 | } break; | 798 | } break; |
761 | 799 | ||
762 | default: { | 800 | default: { |
801 | #ifndef ROCKBOX | ||
763 | fprintf(stderr, "store_registers:illegal output scale\n"); | 802 | fprintf(stderr, "store_registers:illegal output scale\n"); |
764 | exit(0); | 803 | exit(0); |
804 | #endif | ||
765 | } break; | 805 | } break; |
766 | } | 806 | } |
767 | } | 807 | } |
@@ -992,7 +1032,11 @@ void short_to_float(short *short_buf, float *float_buf, int n) | |||
992 | void pd_fft(float *buf, int npoints, int inverse) | 1032 | void pd_fft(float *buf, int npoints, int inverse) |
993 | { | 1033 | { |
994 | double renorm; | 1034 | double renorm; |
1035 | #ifdef ROCKBOX | ||
1036 | float *fp; | ||
1037 | #else | ||
995 | float *fp, *fp2; | 1038 | float *fp, *fp2; |
1039 | #endif | ||
996 | int i; | 1040 | int i; |
997 | renorm = (inverse ? npoints : 1.); | 1041 | renorm = (inverse ? npoints : 1.); |
998 | cfft((inverse ? INVERSE : FORWARD), npoints, RECTANGULAR, | 1042 | cfft((inverse ? INVERSE : FORWARD), npoints, RECTANGULAR, |
diff --git a/apps/plugins/pdbox/PDa/src/d_global.c b/apps/plugins/pdbox/PDa/src/d_global.c index 893abe1f7d..9f4676d48a 100644 --- a/apps/plugins/pdbox/PDa/src/d_global.c +++ b/apps/plugins/pdbox/PDa/src/d_global.c | |||
@@ -4,8 +4,16 @@ | |||
4 | 4 | ||
5 | /* send~, receive~, throw~, catch~ */ | 5 | /* send~, receive~, throw~, catch~ */ |
6 | 6 | ||
7 | #ifdef ROCKBOX | ||
8 | #include "plugin.h" | ||
9 | #include "pdbox.h" | ||
10 | #endif | ||
11 | |||
7 | #include "m_pd.h" | 12 | #include "m_pd.h" |
13 | |||
14 | #ifndef ROCKBOX | ||
8 | #include <string.h> | 15 | #include <string.h> |
16 | #endif | ||
9 | 17 | ||
10 | #define DEFSENDVS 64 /* LATER get send to get this from canvas */ | 18 | #define DEFSENDVS 64 /* LATER get send to get this from canvas */ |
11 | 19 | ||
diff --git a/apps/plugins/pdbox/PDa/src/d_imayer_fft.c b/apps/plugins/pdbox/PDa/src/d_imayer_fft.c index 05d944ed44..3e07eac49e 100644 --- a/apps/plugins/pdbox/PDa/src/d_imayer_fft.c +++ b/apps/plugins/pdbox/PDa/src/d_imayer_fft.c | |||
@@ -95,7 +95,9 @@ char mtrig_algorithm[] = "Simple"; | |||
95 | 95 | ||
96 | #define TRIG_TAB_SIZE 22 | 96 | #define TRIG_TAB_SIZE 22 |
97 | 97 | ||
98 | #ifndef ROCKBOX | ||
98 | static long long halsec[TRIG_TAB_SIZE]= {1,2,3}; | 99 | static long long halsec[TRIG_TAB_SIZE]= {1,2,3}; |
100 | #endif | ||
99 | 101 | ||
100 | #define FFTmult(x,y) mult(x,y) | 102 | #define FFTmult(x,y) mult(x,y) |
101 | 103 | ||
@@ -286,7 +288,11 @@ void imayer_ifft(int n, t_fixed *real, t_fixed *imag) | |||
286 | 288 | ||
287 | void imayer_realfft(int n, t_fixed *real) | 289 | void imayer_realfft(int n, t_fixed *real) |
288 | { | 290 | { |
291 | #ifdef ROCKBOX | ||
292 | t_fixed a,b; | ||
293 | #else | ||
289 | t_fixed a,b,c,d; | 294 | t_fixed a,b,c,d; |
295 | #endif | ||
290 | int i,j,k; | 296 | int i,j,k; |
291 | imayer_fht(real,n); | 297 | imayer_fht(real,n); |
292 | for (i=1,j=n-1,k=n/2;i<k;i++,j--) { | 298 | for (i=1,j=n-1,k=n/2;i<k;i++,j--) { |
@@ -299,7 +305,11 @@ void imayer_realfft(int n, t_fixed *real) | |||
299 | 305 | ||
300 | void imayer_realifft(int n, t_fixed *real) | 306 | void imayer_realifft(int n, t_fixed *real) |
301 | { | 307 | { |
308 | #ifdef ROCKBOX | ||
309 | t_fixed a,b; | ||
310 | #else | ||
302 | t_fixed a,b,c,d; | 311 | t_fixed a,b,c,d; |
312 | #endif | ||
303 | int i,j,k; | 313 | int i,j,k; |
304 | for (i=1,j=n-1,k=n/2;i<k;i++,j--) { | 314 | for (i=1,j=n-1,k=n/2;i<k;i++,j--) { |
305 | a = real[i]; | 315 | a = real[i]; |
diff --git a/apps/plugins/pdbox/PDa/src/d_mayer_fft.c b/apps/plugins/pdbox/PDa/src/d_mayer_fft.c index 95fb303e91..f703510e8f 100644 --- a/apps/plugins/pdbox/PDa/src/d_mayer_fft.c +++ b/apps/plugins/pdbox/PDa/src/d_mayer_fft.c | |||
@@ -394,7 +394,11 @@ void mayer_ifft(int n, REAL *real, REAL *imag) | |||
394 | 394 | ||
395 | void mayer_realfft(int n, REAL *real) | 395 | void mayer_realfft(int n, REAL *real) |
396 | { | 396 | { |
397 | #ifdef ROCKBOX | ||
398 | REAL a,b; | ||
399 | #else | ||
397 | REAL a,b,c,d; | 400 | REAL a,b,c,d; |
401 | #endif | ||
398 | int i,j,k; | 402 | int i,j,k; |
399 | mayer_fht(real,n); | 403 | mayer_fht(real,n); |
400 | for (i=1,j=n-1,k=n/2;i<k;i++,j--) { | 404 | for (i=1,j=n-1,k=n/2;i<k;i++,j--) { |
@@ -407,7 +411,11 @@ void mayer_realfft(int n, REAL *real) | |||
407 | 411 | ||
408 | void mayer_realifft(int n, REAL *real) | 412 | void mayer_realifft(int n, REAL *real) |
409 | { | 413 | { |
414 | #ifdef ROCKBOX | ||
415 | REAL a,b; | ||
416 | #else | ||
410 | REAL a,b,c,d; | 417 | REAL a,b,c,d; |
418 | #endif | ||
411 | int i,j,k; | 419 | int i,j,k; |
412 | for (i=1,j=n-1,k=n/2;i<k;i++,j--) { | 420 | for (i=1,j=n-1,k=n/2;i<k;i++,j--) { |
413 | a = real[i]; | 421 | a = real[i]; |
diff --git a/apps/plugins/pdbox/PDa/src/d_misc.c b/apps/plugins/pdbox/PDa/src/d_misc.c index b6d36764b8..6eb2857db9 100644 --- a/apps/plugins/pdbox/PDa/src/d_misc.c +++ b/apps/plugins/pdbox/PDa/src/d_misc.c | |||
@@ -5,9 +5,17 @@ | |||
5 | /* miscellaneous: print~; more to come. | 5 | /* miscellaneous: print~; more to come. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #ifdef ROCKBOX | ||
9 | #include "plugin.h" | ||
10 | #include "pdbox.h" | ||
11 | #endif | ||
12 | |||
8 | #include "m_pd.h" | 13 | #include "m_pd.h" |
14 | |||
15 | #ifndef ROCKBOX | ||
9 | #include <stdio.h> | 16 | #include <stdio.h> |
10 | #include <string.h> | 17 | #include <string.h> |
18 | #endif | ||
11 | 19 | ||
12 | /* ------------------------- print~ -------------------------- */ | 20 | /* ------------------------- print~ -------------------------- */ |
13 | static t_class *print_class; | 21 | static t_class *print_class; |
@@ -69,7 +77,10 @@ static void *print_new(t_symbol *s) | |||
69 | return (x); | 77 | return (x); |
70 | } | 78 | } |
71 | 79 | ||
72 | static void print_setup(void) | 80 | #ifndef ROCKBOX |
81 | static | ||
82 | #endif | ||
83 | void print_setup(void) | ||
73 | { | 84 | { |
74 | print_class = class_new(gensym("print~"), (t_newmethod)print_new, 0, | 85 | print_class = class_new(gensym("print~"), (t_newmethod)print_new, 0, |
75 | sizeof(t_print), 0, A_DEFSYM, 0); | 86 | sizeof(t_print), 0, A_DEFSYM, 0); |
@@ -118,7 +129,11 @@ static void scope_dsp(t_scope *x, t_signal **sp) | |||
118 | 129 | ||
119 | static void scope_erase(t_scope *x) | 130 | static void scope_erase(t_scope *x) |
120 | { | 131 | { |
132 | #ifdef ROCKBOX | ||
133 | (void) x; | ||
134 | #else | ||
121 | if (x->x_drawn) sys_vgui(".x%x.c delete gumbo\n", x->x_canvas); | 135 | if (x->x_drawn) sys_vgui(".x%x.c delete gumbo\n", x->x_canvas); |
136 | #endif | ||
122 | } | 137 | } |
123 | 138 | ||
124 | #define X1 10. | 139 | #define X1 10. |
@@ -126,6 +141,7 @@ static void scope_erase(t_scope *x) | |||
126 | #define YC 5. | 141 | #define YC 5. |
127 | static void scope_bang(t_scope *x) | 142 | static void scope_bang(t_scope *x) |
128 | { | 143 | { |
144 | #ifndef ROCKBOX | ||
129 | int n, phase; | 145 | int n, phase; |
130 | char hugebuf[10000], *s = hugebuf; | 146 | char hugebuf[10000], *s = hugebuf; |
131 | scope_erase(x); | 147 | scope_erase(x); |
@@ -142,6 +158,7 @@ static void scope_bang(t_scope *x) | |||
142 | } | 158 | } |
143 | sprintf(s, "-tags gumbo\n"); | 159 | sprintf(s, "-tags gumbo\n"); |
144 | sys_gui(hugebuf); | 160 | sys_gui(hugebuf); |
161 | #endif | ||
145 | x->x_drawn = 1; | 162 | x->x_drawn = 1; |
146 | } | 163 | } |
147 | 164 | ||
@@ -152,6 +169,9 @@ static void scope_free(t_scope *x) | |||
152 | 169 | ||
153 | static void *scope_new(t_symbol *s) | 170 | static void *scope_new(t_symbol *s) |
154 | { | 171 | { |
172 | #ifdef ROCKBOX | ||
173 | (void) s; | ||
174 | #endif | ||
155 | t_scope *x = (t_scope *)pd_new(scope_class); | 175 | t_scope *x = (t_scope *)pd_new(scope_class); |
156 | error("scope: this is now obsolete; use arrays and tabwrite~ instead"); | 176 | error("scope: this is now obsolete; use arrays and tabwrite~ instead"); |
157 | x->x_phase = 0; | 177 | x->x_phase = 0; |
@@ -188,6 +208,9 @@ static t_int *bang_tilde_perform(t_int *w) | |||
188 | 208 | ||
189 | static void bang_tilde_dsp(t_bang *x, t_signal **sp) | 209 | static void bang_tilde_dsp(t_bang *x, t_signal **sp) |
190 | { | 210 | { |
211 | #ifdef ROCKBOX | ||
212 | (void) sp; | ||
213 | #endif | ||
191 | dsp_add(bang_tilde_perform, 1, x); | 214 | dsp_add(bang_tilde_perform, 1, x); |
192 | } | 215 | } |
193 | 216 | ||
@@ -203,6 +226,9 @@ static void bang_tilde_free(t_bang *x) | |||
203 | 226 | ||
204 | static void *bang_tilde_new(t_symbol *s) | 227 | static void *bang_tilde_new(t_symbol *s) |
205 | { | 228 | { |
229 | #ifdef ROCKBOX | ||
230 | (void) s; | ||
231 | #endif | ||
206 | t_bang *x = (t_bang *)pd_new(bang_tilde_class); | 232 | t_bang *x = (t_bang *)pd_new(bang_tilde_class); |
207 | x->x_clock = clock_new(x, (t_method)bang_tilde_tick); | 233 | x->x_clock = clock_new(x, (t_method)bang_tilde_tick); |
208 | outlet_new(&x->x_obj, &s_bang); | 234 | outlet_new(&x->x_obj, &s_bang); |
@@ -233,6 +259,9 @@ static void samplerate_tilde_bang(t_samplerate *x) | |||
233 | 259 | ||
234 | static void *samplerate_tilde_new(t_symbol *s) | 260 | static void *samplerate_tilde_new(t_symbol *s) |
235 | { | 261 | { |
262 | #ifdef ROCKBOX | ||
263 | (void) s; | ||
264 | #endif | ||
236 | t_samplerate *x = (t_samplerate *)pd_new(samplerate_tilde_class); | 265 | t_samplerate *x = (t_samplerate *)pd_new(samplerate_tilde_class); |
237 | outlet_new(&x->x_obj, &s_float); | 266 | outlet_new(&x->x_obj, &s_float); |
238 | return (x); | 267 | return (x); |
diff --git a/apps/plugins/pdbox/PDa/src/d_soundfile.c b/apps/plugins/pdbox/PDa/src/d_soundfile.c index 4b89e93fd4..34aa105d28 100644 --- a/apps/plugins/pdbox/PDa/src/d_soundfile.c +++ b/apps/plugins/pdbox/PDa/src/d_soundfile.c | |||
@@ -11,6 +11,10 @@ readsf~ and writesf~ are defined which confine disk operations to a separate | |||
11 | thread so that they can be used in real time. The readsf~ and writesf~ | 11 | thread so that they can be used in real time. The readsf~ and writesf~ |
12 | objects use Posix-like threads. */ | 12 | objects use Posix-like threads. */ |
13 | 13 | ||
14 | #ifdef ROCKBOX | ||
15 | #include "plugin.h" | ||
16 | #include "pdbox.h" | ||
17 | #else /* ROCKBOX */ | ||
14 | #ifdef UNIX | 18 | #ifdef UNIX |
15 | #include <unistd.h> | 19 | #include <unistd.h> |
16 | #include <fcntl.h> | 20 | #include <fcntl.h> |
@@ -22,6 +26,7 @@ objects use Posix-like threads. */ | |||
22 | #include <stdio.h> | 26 | #include <stdio.h> |
23 | #include <string.h> | 27 | #include <string.h> |
24 | #include <errno.h> | 28 | #include <errno.h> |
29 | #endif /* ROCKBOX */ | ||
25 | 30 | ||
26 | #include "m_pd.h" | 31 | #include "m_pd.h" |
27 | 32 | ||
@@ -198,9 +203,15 @@ int open_soundfile(const char *dirname, const char *filename, int headersize, | |||
198 | long skipframes) | 203 | long skipframes) |
199 | { | 204 | { |
200 | char buf[OBUFSIZE], *bufptr; | 205 | char buf[OBUFSIZE], *bufptr; |
206 | #ifdef ROCKBOX | ||
207 | int fd, nchannels, bigendian, bytespersamp, swap, sysrtn; | ||
208 | #else | ||
201 | int fd, format, nchannels, bigendian, bytespersamp, swap, sysrtn; | 209 | int fd, format, nchannels, bigendian, bytespersamp, swap, sysrtn; |
210 | #endif | ||
202 | long bytelimit = 0x7fffffff; | 211 | long bytelimit = 0x7fffffff; |
212 | #ifndef ROCKBOX | ||
203 | errno = 0; | 213 | errno = 0; |
214 | #endif | ||
204 | fd = open_via_path(dirname, filename, | 215 | fd = open_via_path(dirname, filename, |
205 | "", buf, &bufptr, MAXPDSTRING, 1); | 216 | "", buf, &bufptr, MAXPDSTRING, 1); |
206 | if (fd < 0) | 217 | if (fd < 0) |
@@ -239,7 +250,9 @@ int open_soundfile(const char *dirname, const char *filename, int headersize, | |||
239 | swap = (bigendian != garray_ambigendian()); | 250 | swap = (bigendian != garray_ambigendian()); |
240 | if (format == FORMAT_NEXT) /* nextstep header */ | 251 | if (format == FORMAT_NEXT) /* nextstep header */ |
241 | { | 252 | { |
253 | #ifndef ROCKBOX | ||
242 | uint32 param; | 254 | uint32 param; |
255 | #endif | ||
243 | if (bytesread < (int)sizeof(t_nextstep)) | 256 | if (bytesread < (int)sizeof(t_nextstep)) |
244 | goto badheader; | 257 | goto badheader; |
245 | nchannels = swap4(((t_nextstep *)buf)->ns_nchans, swap); | 258 | nchannels = swap4(((t_nextstep *)buf)->ns_nchans, swap); |
@@ -381,7 +394,9 @@ int open_soundfile(const char *dirname, const char *filename, int headersize, | |||
381 | badheader: | 394 | badheader: |
382 | /* the header wasn't recognized. We're threadable here so let's not | 395 | /* the header wasn't recognized. We're threadable here so let's not |
383 | print out the error... */ | 396 | print out the error... */ |
397 | #ifndef ROCKBOX | ||
384 | errno = EIO; | 398 | errno = EIO; |
399 | #endif | ||
385 | return (-1); | 400 | return (-1); |
386 | } | 401 | } |
387 | 402 | ||
@@ -705,7 +720,11 @@ static int create_soundfile(t_canvas *canvas, const char *filename, | |||
705 | 720 | ||
706 | canvas_makefilename(canvas, filenamebuf, buf2, MAXPDSTRING); | 721 | canvas_makefilename(canvas, filenamebuf, buf2, MAXPDSTRING); |
707 | sys_bashfilename(buf2, buf2); | 722 | sys_bashfilename(buf2, buf2); |
723 | #ifdef ROCKBOX | ||
724 | if ((fd = open(buf2, BINCREATE)) < 0) | ||
725 | #else | ||
708 | if ((fd = open(buf2, BINCREATE, 0666)) < 0) | 726 | if ((fd = open(buf2, BINCREATE, 0666)) < 0) |
727 | #endif | ||
709 | return (-1); | 728 | return (-1); |
710 | 729 | ||
711 | if (write(fd, headerbuf, headersize) < headersize) | 730 | if (write(fd, headerbuf, headersize) < headersize) |
@@ -771,7 +790,11 @@ static void soundfile_finishwrite(void *obj, char *filename, int fd, | |||
771 | } | 790 | } |
772 | return; | 791 | return; |
773 | baddonewrite: | 792 | baddonewrite: |
793 | #ifdef ROCKBOX | ||
794 | post("%s: error", filename); | ||
795 | #else | ||
774 | post("%s: %s", filename, strerror(errno)); | 796 | post("%s: %s", filename, strerror(errno)); |
797 | #endif | ||
775 | } | 798 | } |
776 | 799 | ||
777 | static void soundfile_xferout(int nchannels, t_sample **vecs, | 800 | static void soundfile_xferout(int nchannels, t_sample **vecs, |
@@ -920,9 +943,16 @@ static t_soundfiler *soundfiler_new(void) | |||
920 | static void soundfiler_read(t_soundfiler *x, t_symbol *s, | 943 | static void soundfiler_read(t_soundfiler *x, t_symbol *s, |
921 | int argc, t_atom *argv) | 944 | int argc, t_atom *argv) |
922 | { | 945 | { |
946 | #ifdef ROCKBOX | ||
947 | (void) s; | ||
948 | #endif | ||
923 | int headersize = -1, channels = 0, bytespersamp = 0, bigendian = 0, | 949 | int headersize = -1, channels = 0, bytespersamp = 0, bigendian = 0, |
924 | resize = 0, i, j; | 950 | resize = 0, i, j; |
951 | #ifdef ROCKBOX | ||
952 | long skipframes = 0, nframes = 0, finalsize = 0, | ||
953 | #else | ||
925 | long skipframes = 0, nframes = 0, finalsize = 0, itemsleft, | 954 | long skipframes = 0, nframes = 0, finalsize = 0, itemsleft, |
955 | #endif | ||
926 | maxsize = DEFMAXSIZE, itemsread = 0, bytelimit = 0x7fffffff; | 956 | maxsize = DEFMAXSIZE, itemsread = 0, bytelimit = 0x7fffffff; |
927 | int fd = -1; | 957 | int fd = -1; |
928 | char endianness, *filename; | 958 | char endianness, *filename; |
@@ -930,7 +960,11 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s, | |||
930 | t_sample *vecs[MAXSFCHANS]; | 960 | t_sample *vecs[MAXSFCHANS]; |
931 | char sampbuf[SAMPBUFSIZE]; | 961 | char sampbuf[SAMPBUFSIZE]; |
932 | int bufframes, nitems; | 962 | int bufframes, nitems; |
963 | #ifdef ROCKBOX | ||
964 | int fp; | ||
965 | #else | ||
933 | FILE *fp; | 966 | FILE *fp; |
967 | #endif | ||
934 | while (argc > 0 && argv->a_type == A_SYMBOL && | 968 | while (argc > 0 && argv->a_type == A_SYMBOL && |
935 | *argv->a_w.w_symbol->s_name == '-') | 969 | *argv->a_w.w_symbol->s_name == '-') |
936 | { | 970 | { |
@@ -1019,8 +1053,14 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s, | |||
1019 | 1053 | ||
1020 | if (fd < 0) | 1054 | if (fd < 0) |
1021 | { | 1055 | { |
1056 | #ifdef ROCKBOX | ||
1057 | pd_error(x, "soundfiler_read: %s: %s", | ||
1058 | filename, | ||
1059 | "unknown or bad header format"); | ||
1060 | #else | ||
1022 | pd_error(x, "soundfiler_read: %s: %s", filename, (errno == EIO ? | 1061 | pd_error(x, "soundfiler_read: %s: %s", filename, (errno == EIO ? |
1023 | "unknown or bad header format" : strerror(errno))); | 1062 | "unknown or bad header format" : strerror(errno))); |
1063 | #endif | ||
1024 | goto done; | 1064 | goto done; |
1025 | } | 1065 | } |
1026 | 1066 | ||
@@ -1065,14 +1105,22 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s, | |||
1065 | if (!finalsize) finalsize = 0x7fffffff; | 1105 | if (!finalsize) finalsize = 0x7fffffff; |
1066 | if (finalsize > bytelimit / (channels * bytespersamp)) | 1106 | if (finalsize > bytelimit / (channels * bytespersamp)) |
1067 | finalsize = bytelimit / (channels * bytespersamp); | 1107 | finalsize = bytelimit / (channels * bytespersamp); |
1108 | #ifdef ROCKBOX | ||
1109 | fp = open(filename, O_RDONLY); | ||
1110 | #else | ||
1068 | fp = fdopen(fd, "rb"); | 1111 | fp = fdopen(fd, "rb"); |
1112 | #endif | ||
1069 | bufframes = SAMPBUFSIZE / (channels * bytespersamp); | 1113 | bufframes = SAMPBUFSIZE / (channels * bytespersamp); |
1070 | 1114 | ||
1071 | for (itemsread = 0; itemsread < finalsize; ) | 1115 | for (itemsread = 0; itemsread < finalsize; ) |
1072 | { | 1116 | { |
1073 | int thisread = finalsize - itemsread; | 1117 | int thisread = finalsize - itemsread; |
1074 | thisread = (thisread > bufframes ? bufframes : thisread); | 1118 | thisread = (thisread > bufframes ? bufframes : thisread); |
1119 | #ifdef ROCKBOX | ||
1120 | nitems = read(fp, sampbuf, thisread * bytespersamp * channels); | ||
1121 | #else | ||
1075 | nitems = fread(sampbuf, channels * bytespersamp, thisread, fp); | 1122 | nitems = fread(sampbuf, channels * bytespersamp, thisread, fp); |
1123 | #endif | ||
1076 | if (nitems <= 0) break; | 1124 | if (nitems <= 0) break; |
1077 | soundfile_xferin(channels, argc, vecs, itemsread, | 1125 | soundfile_xferin(channels, argc, vecs, itemsread, |
1078 | (unsigned char *)sampbuf, nitems, bytespersamp, bigendian); | 1126 | (unsigned char *)sampbuf, nitems, bytespersamp, bigendian); |
@@ -1082,7 +1130,11 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s, | |||
1082 | 1130 | ||
1083 | for (i = 0; i < argc; i++) | 1131 | for (i = 0; i < argc; i++) |
1084 | { | 1132 | { |
1133 | #ifdef ROCKBOX | ||
1134 | int vecsize; | ||
1135 | #else | ||
1085 | int nzero, vecsize; | 1136 | int nzero, vecsize; |
1137 | #endif | ||
1086 | garray_getfloatarray(garrays[i], &vecsize, &vecs[i]); | 1138 | garray_getfloatarray(garrays[i], &vecsize, &vecs[i]); |
1087 | for (j = itemsread; j < vecsize; j++) | 1139 | for (j = itemsread; j < vecsize; j++) |
1088 | vecs[i][j] = 0; | 1140 | vecs[i][j] = 0; |
@@ -1099,7 +1151,11 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s, | |||
1099 | /* do all graphics updates */ | 1151 | /* do all graphics updates */ |
1100 | for (i = 0; i < argc; i++) | 1152 | for (i = 0; i < argc; i++) |
1101 | garray_redraw(garrays[i]); | 1153 | garray_redraw(garrays[i]); |
1154 | #ifdef ROCKBOX | ||
1155 | close(fp); | ||
1156 | #else | ||
1102 | fclose(fp); | 1157 | fclose(fp); |
1158 | #endif | ||
1103 | fd = -1; | 1159 | fd = -1; |
1104 | goto done; | 1160 | goto done; |
1105 | usage: | 1161 | usage: |
@@ -1118,14 +1174,25 @@ done: | |||
1118 | long soundfiler_dowrite(void *obj, t_canvas *canvas, | 1174 | long soundfiler_dowrite(void *obj, t_canvas *canvas, |
1119 | int argc, t_atom *argv) | 1175 | int argc, t_atom *argv) |
1120 | { | 1176 | { |
1177 | #ifdef ROCKBOX | ||
1178 | int bytespersamp, bigendian, | ||
1179 | swap, filetype, normalize, i, j, nchannels; | ||
1180 | long onset, nframes, | ||
1181 | itemswritten = 0; | ||
1182 | #else | ||
1121 | int headersize, bytespersamp, bigendian, | 1183 | int headersize, bytespersamp, bigendian, |
1122 | endianness, swap, filetype, normalize, i, j, nchannels; | 1184 | endianness, swap, filetype, normalize, i, j, nchannels; |
1123 | long onset, nframes, itemsleft, | 1185 | long onset, nframes, itemsleft, |
1124 | maxsize = DEFMAXSIZE, itemswritten = 0; | 1186 | maxsize = DEFMAXSIZE, itemswritten = 0; |
1187 | #endif | ||
1125 | t_garray *garrays[MAXSFCHANS]; | 1188 | t_garray *garrays[MAXSFCHANS]; |
1126 | t_sample *vecs[MAXSFCHANS]; | 1189 | t_sample *vecs[MAXSFCHANS]; |
1127 | char sampbuf[SAMPBUFSIZE]; | 1190 | char sampbuf[SAMPBUFSIZE]; |
1191 | #ifdef ROCKBOX | ||
1192 | int bufframes; | ||
1193 | #else | ||
1128 | int bufframes, nitems; | 1194 | int bufframes, nitems; |
1195 | #endif | ||
1129 | int fd = -1; | 1196 | int fd = -1; |
1130 | float normfactor, biggest = 0, samplerate; | 1197 | float normfactor, biggest = 0, samplerate; |
1131 | t_symbol *filesym; | 1198 | t_symbol *filesym; |
@@ -1174,7 +1241,11 @@ long soundfiler_dowrite(void *obj, t_canvas *canvas, | |||
1174 | nframes, bytespersamp, bigendian, nchannels, | 1241 | nframes, bytespersamp, bigendian, nchannels, |
1175 | swap, samplerate)) < 0) | 1242 | swap, samplerate)) < 0) |
1176 | { | 1243 | { |
1244 | #ifdef ROCKBOX | ||
1245 | post("%s: %s\n", filesym->s_name, "error"); | ||
1246 | #else | ||
1177 | post("%s: %s\n", filesym->s_name, strerror(errno)); | 1247 | post("%s: %s\n", filesym->s_name, strerror(errno)); |
1248 | #endif | ||
1178 | goto fail; | 1249 | goto fail; |
1179 | } | 1250 | } |
1180 | if (!normalize) | 1251 | if (!normalize) |
@@ -1194,14 +1265,22 @@ long soundfiler_dowrite(void *obj, t_canvas *canvas, | |||
1194 | 1265 | ||
1195 | for (itemswritten = 0; itemswritten < nframes; ) | 1266 | for (itemswritten = 0; itemswritten < nframes; ) |
1196 | { | 1267 | { |
1268 | #ifdef ROCKBOX | ||
1269 | int thiswrite = nframes - itemswritten, nbytes; | ||
1270 | #else | ||
1197 | int thiswrite = nframes - itemswritten, nitems, nbytes; | 1271 | int thiswrite = nframes - itemswritten, nitems, nbytes; |
1272 | #endif | ||
1198 | thiswrite = (thiswrite > bufframes ? bufframes : thiswrite); | 1273 | thiswrite = (thiswrite > bufframes ? bufframes : thiswrite); |
1199 | soundfile_xferout(argc, vecs, (unsigned char *)sampbuf, thiswrite, | 1274 | soundfile_xferout(argc, vecs, (unsigned char *)sampbuf, thiswrite, |
1200 | onset, bytespersamp, bigendian, normfactor); | 1275 | onset, bytespersamp, bigendian, normfactor); |
1201 | nbytes = write(fd, sampbuf, nchannels * bytespersamp * thiswrite); | 1276 | nbytes = write(fd, sampbuf, nchannels * bytespersamp * thiswrite); |
1202 | if (nbytes < nchannels * bytespersamp * thiswrite) | 1277 | if (nbytes < nchannels * bytespersamp * thiswrite) |
1203 | { | 1278 | { |
1279 | #ifdef ROCKBOX | ||
1280 | post("%s: %s", filesym->s_name, "error"); | ||
1281 | #else | ||
1204 | post("%s: %s", filesym->s_name, strerror(errno)); | 1282 | post("%s: %s", filesym->s_name, strerror(errno)); |
1283 | #endif | ||
1205 | if (nbytes > 0) | 1284 | if (nbytes > 0) |
1206 | itemswritten += nbytes / (nchannels * bytespersamp); | 1285 | itemswritten += nbytes / (nchannels * bytespersamp); |
1207 | break; | 1286 | break; |
@@ -1230,6 +1309,9 @@ fail: | |||
1230 | static void soundfiler_write(t_soundfiler *x, t_symbol *s, | 1309 | static void soundfiler_write(t_soundfiler *x, t_symbol *s, |
1231 | int argc, t_atom *argv) | 1310 | int argc, t_atom *argv) |
1232 | { | 1311 | { |
1312 | #ifdef ROCKBOX | ||
1313 | (void) s; | ||
1314 | #endif | ||
1233 | long bozo = soundfiler_dowrite(x, x->x_canvas, | 1315 | long bozo = soundfiler_dowrite(x, x->x_canvas, |
1234 | argc, argv); | 1316 | argc, argv); |
1235 | outlet_float(x->x_obj.ob_outlet, (float)bozo); | 1317 | outlet_float(x->x_obj.ob_outlet, (float)bozo); |
diff --git a/apps/plugins/pdbox/PDa/src/d_ugen.c b/apps/plugins/pdbox/PDa/src/d_ugen.c index 2c359c384d..6cf0a5a97d 100644 --- a/apps/plugins/pdbox/PDa/src/d_ugen.c +++ b/apps/plugins/pdbox/PDa/src/d_ugen.c | |||
@@ -21,11 +21,17 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | 24 | #ifdef ROCKBOX | |
25 | #include "plugin.h" | ||
26 | #include "pdbox.h" | ||
27 | #include "m_pd.h" | ||
28 | #include "m_imp.h" | ||
29 | #else /* ROCKBOX */ | ||
25 | #include "m_pd.h" | 30 | #include "m_pd.h" |
26 | #include "m_imp.h" | 31 | #include "m_imp.h" |
27 | #include <stdlib.h> | 32 | #include <stdlib.h> |
28 | #include <stdarg.h> | 33 | #include <stdarg.h> |
34 | #endif /* ROCKBOX */ | ||
29 | 35 | ||
30 | extern t_class *vinlet_class, *voutlet_class, *canvas_class; | 36 | extern t_class *vinlet_class, *voutlet_class, *canvas_class; |
31 | t_sample *obj_findsignalscalar(t_object *x, int m); | 37 | t_sample *obj_findsignalscalar(t_object *x, int m); |
@@ -258,6 +264,10 @@ static t_int *block_epilog(t_int *w) | |||
258 | 264 | ||
259 | static void block_dsp(t_block *x, t_signal **sp) | 265 | static void block_dsp(t_block *x, t_signal **sp) |
260 | { | 266 | { |
267 | #ifdef ROCKBOX | ||
268 | (void) x; | ||
269 | (void) sp; | ||
270 | #endif | ||
261 | /* do nothing here */ | 271 | /* do nothing here */ |
262 | } | 272 | } |
263 | 273 | ||
@@ -303,6 +313,7 @@ void dsp_tick(void) | |||
303 | t_int *ip; | 313 | t_int *ip; |
304 | for (ip = dsp_chain; *ip; ) ip = (*(t_perfroutine)(*ip))(ip); | 314 | for (ip = dsp_chain; *ip; ) ip = (*(t_perfroutine)(*ip))(ip); |
305 | dsp_phase++; | 315 | dsp_phase++; |
316 | printf("%d\n", dsp_phase); | ||
306 | } | 317 | } |
307 | } | 318 | } |
308 | 319 | ||
@@ -330,9 +341,13 @@ static t_signal *signal_usedlist; | |||
330 | /* call this when DSP is stopped to free all the signals */ | 341 | /* call this when DSP is stopped to free all the signals */ |
331 | void signal_cleanup(void) | 342 | void signal_cleanup(void) |
332 | { | 343 | { |
344 | #ifdef ROCKBOX | ||
345 | t_signal *sig; | ||
346 | #else | ||
333 | t_signal **svec, *sig, *sig2; | 347 | t_signal **svec, *sig, *sig2; |
348 | #endif | ||
334 | int i; | 349 | int i; |
335 | while (sig = signal_usedlist) | 350 | while((sig = signal_usedlist)) |
336 | { | 351 | { |
337 | signal_usedlist = sig->s_nextused; | 352 | signal_usedlist = sig->s_nextused; |
338 | if (!sig->s_isborrowed) | 353 | if (!sig->s_isborrowed) |
@@ -397,9 +412,15 @@ void signal_makereusable(t_signal *sig) | |||
397 | 412 | ||
398 | t_signal *signal_new(int n, float sr) | 413 | t_signal *signal_new(int n, float sr) |
399 | { | 414 | { |
415 | #ifdef ROCKBOX | ||
416 | int logn; | ||
417 | #else | ||
400 | int logn, n2; | 418 | int logn, n2; |
419 | #endif | ||
401 | t_signal *ret, **whichlist; | 420 | t_signal *ret, **whichlist; |
421 | #ifndef ROCKBOX | ||
402 | t_sample *fp; | 422 | t_sample *fp; |
423 | #endif | ||
403 | logn = ilog2(n); | 424 | logn = ilog2(n); |
404 | if (n) | 425 | if (n) |
405 | { | 426 | { |
@@ -413,7 +434,7 @@ t_signal *signal_new(int n, float sr) | |||
413 | whichlist = &signal_freeborrowed; | 434 | whichlist = &signal_freeborrowed; |
414 | 435 | ||
415 | /* first try to reclaim one from the free list */ | 436 | /* first try to reclaim one from the free list */ |
416 | if (ret = *whichlist) | 437 | if((ret = *whichlist)) |
417 | *whichlist = ret->s_nextfree; | 438 | *whichlist = ret->s_nextfree; |
418 | else | 439 | else |
419 | { | 440 | { |
@@ -520,8 +541,10 @@ static t_dspcontext *ugen_currentcontext; | |||
520 | 541 | ||
521 | void ugen_stop(void) | 542 | void ugen_stop(void) |
522 | { | 543 | { |
544 | #ifndef ROCKBOX | ||
523 | t_signal *s; | 545 | t_signal *s; |
524 | int i; | 546 | int i; |
547 | #endif | ||
525 | if (dsp_chain) | 548 | if (dsp_chain) |
526 | { | 549 | { |
527 | freebytes(dsp_chain, dsp_chainsize * sizeof (t_int)); | 550 | freebytes(dsp_chain, dsp_chainsize * sizeof (t_int)); |
@@ -577,8 +600,10 @@ t_dspcontext *ugen_start_graph(int toplevel, t_signal **sp, | |||
577 | int ninlets, int noutlets) | 600 | int ninlets, int noutlets) |
578 | { | 601 | { |
579 | t_dspcontext *dc = (t_dspcontext *)getbytes(sizeof(*dc)); | 602 | t_dspcontext *dc = (t_dspcontext *)getbytes(sizeof(*dc)); |
603 | #ifndef ROCKBOX | ||
580 | float parent_srate, srate; | 604 | float parent_srate, srate; |
581 | int parent_vecsize, vecsize; | 605 | int parent_vecsize, vecsize; |
606 | #endif | ||
582 | 607 | ||
583 | if (ugen_loud) post("ugen_start_graph..."); | 608 | if (ugen_loud) post("ugen_start_graph..."); |
584 | 609 | ||
@@ -672,7 +697,11 @@ static void ugen_doit(t_dspcontext *dc, t_ugenbox *u) | |||
672 | { | 697 | { |
673 | t_sigoutlet *uout; | 698 | t_sigoutlet *uout; |
674 | t_siginlet *uin; | 699 | t_siginlet *uin; |
700 | #ifdef ROCKBOX | ||
701 | t_sigoutconnect *oc; | ||
702 | #else | ||
675 | t_sigoutconnect *oc, *oc2; | 703 | t_sigoutconnect *oc, *oc2; |
704 | #endif | ||
676 | t_class *class = pd_class(&u->u_obj->ob_pd); | 705 | t_class *class = pd_class(&u->u_obj->ob_pd); |
677 | int i, n; | 706 | int i, n; |
678 | /* suppress creating new signals for the outputs of signal | 707 | /* suppress creating new signals for the outputs of signal |
@@ -681,13 +710,13 @@ static void ugen_doit(t_dspcontext *dc, t_ugenbox *u) | |||
681 | we delay new signal creation, which will be handled by calling | 710 | we delay new signal creation, which will be handled by calling |
682 | signal_setborrowed in the ugen_done_graph routine below. */ | 711 | signal_setborrowed in the ugen_done_graph routine below. */ |
683 | int nonewsigs = (class == canvas_class || | 712 | int nonewsigs = (class == canvas_class || |
684 | (class == vinlet_class) && !(dc->dc_reblock)); | 713 | ((class == vinlet_class) && !(dc->dc_reblock))); |
685 | /* when we encounter a subcanvas or a signal outlet, suppress freeing | 714 | /* when we encounter a subcanvas or a signal outlet, suppress freeing |
686 | the input signals as they may be "borrowed" for the super or sub | 715 | the input signals as they may be "borrowed" for the super or sub |
687 | patch; same exception as above, but also if we're "switched" we | 716 | patch; same exception as above, but also if we're "switched" we |
688 | have to do a copy rather than a borrow. */ | 717 | have to do a copy rather than a borrow. */ |
689 | int nofreesigs = (class == canvas_class || | 718 | int nofreesigs = (class == canvas_class || |
690 | (class == voutlet_class) && !(dc->dc_reblock || dc->dc_switched)); | 719 | ((class == voutlet_class) && !(dc->dc_reblock || dc->dc_switched))); |
691 | t_signal **insig, **outsig, **sig, *s1, *s2, *s3; | 720 | t_signal **insig, **outsig, **sig, *s1, *s2, *s3; |
692 | t_ugenbox *u2; | 721 | t_ugenbox *u2; |
693 | 722 | ||
@@ -701,7 +730,7 @@ static void ugen_doit(t_dspcontext *dc, t_ugenbox *u) | |||
701 | s3 = signal_new(dc->dc_vecsize, dc->dc_srate); | 730 | s3 = signal_new(dc->dc_vecsize, dc->dc_srate); |
702 | /* post("%s: unconnected signal inlet set to zero", | 731 | /* post("%s: unconnected signal inlet set to zero", |
703 | class_getname(u->u_obj->ob_pd)); */ | 732 | class_getname(u->u_obj->ob_pd)); */ |
704 | if (scalar = obj_findsignalscalar(u->u_obj, i)) | 733 | if((scalar = obj_findsignalscalar(u->u_obj, i))) |
705 | dsp_add_scalarcopy(scalar, s3->s_vec, s3->s_n); | 734 | dsp_add_scalarcopy(scalar, s3->s_vec, s3->s_n); |
706 | else | 735 | else |
707 | dsp_add_zero(s3->s_vec, s3->s_n); | 736 | dsp_add_zero(s3->s_vec, s3->s_n); |
@@ -781,7 +810,7 @@ static void ugen_doit(t_dspcontext *dc, t_ugenbox *u) | |||
781 | u2 = oc->oc_who; | 810 | u2 = oc->oc_who; |
782 | uin = &u2->u_in[oc->oc_inno]; | 811 | uin = &u2->u_in[oc->oc_inno]; |
783 | /* if there's already someone here, sum the two */ | 812 | /* if there's already someone here, sum the two */ |
784 | if (s2 = uin->i_signal) | 813 | if((s2 = uin->i_signal)) |
785 | { | 814 | { |
786 | s1->s_refcount--; | 815 | s1->s_refcount--; |
787 | s2->s_refcount--; | 816 | s2->s_refcount--; |
@@ -825,7 +854,11 @@ static void ugen_doit(t_dspcontext *dc, t_ugenbox *u) | |||
825 | 854 | ||
826 | void ugen_done_graph(t_dspcontext *dc) | 855 | void ugen_done_graph(t_dspcontext *dc) |
827 | { | 856 | { |
857 | #ifdef ROCKBOX | ||
858 | t_ugenbox *u; | ||
859 | #else | ||
828 | t_ugenbox *u, *u2; | 860 | t_ugenbox *u, *u2; |
861 | #endif | ||
829 | t_sigoutlet *uout; | 862 | t_sigoutlet *uout; |
830 | t_siginlet *uin; | 863 | t_siginlet *uin; |
831 | t_sigoutconnect *oc, *oc2; | 864 | t_sigoutconnect *oc, *oc2; |
@@ -966,7 +999,11 @@ void ugen_done_graph(t_dspcontext *dc) | |||
966 | for (u = dc->dc_ugenlist; u; u = u->u_next) | 999 | for (u = dc->dc_ugenlist; u; u = u->u_next) |
967 | { | 1000 | { |
968 | t_pd *zz = &u->u_obj->ob_pd; | 1001 | t_pd *zz = &u->u_obj->ob_pd; |
1002 | #ifdef ROCKBOX | ||
1003 | t_signal **outsigs = dc->dc_iosigs; | ||
1004 | #else | ||
969 | t_signal **insigs = dc->dc_iosigs, **outsigs = dc->dc_iosigs; | 1005 | t_signal **insigs = dc->dc_iosigs, **outsigs = dc->dc_iosigs; |
1006 | #endif | ||
970 | if (outsigs) outsigs += dc->dc_ninlets; | 1007 | if (outsigs) outsigs += dc->dc_ninlets; |
971 | 1008 | ||
972 | if (pd_class(zz) == vinlet_class) | 1009 | if (pd_class(zz) == vinlet_class) |
diff --git a/apps/plugins/pdbox/PDa/src/g_all_guis.c b/apps/plugins/pdbox/PDa/src/g_all_guis.c index 74a7656492..165c9ac14f 100644 --- a/apps/plugins/pdbox/PDa/src/g_all_guis.c +++ b/apps/plugins/pdbox/PDa/src/g_all_guis.c | |||
@@ -6,6 +6,14 @@ | |||
6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ | 6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ |
7 | 7 | ||
8 | 8 | ||
9 | #ifdef ROCKBOX | ||
10 | #include "plugin.h" | ||
11 | #include "pdbox.h" | ||
12 | #include "m_pd.h" | ||
13 | #include "g_canvas.h" | ||
14 | #include "g_all_guis.h" | ||
15 | #define snprintf rb->snprintf | ||
16 | #else /* ROCKBOX */ | ||
9 | #include <stdlib.h> | 17 | #include <stdlib.h> |
10 | #include <string.h> | 18 | #include <string.h> |
11 | #include <stdio.h> | 19 | #include <stdio.h> |
@@ -21,6 +29,7 @@ | |||
21 | #else | 29 | #else |
22 | #include <unistd.h> | 30 | #include <unistd.h> |
23 | #endif | 31 | #endif |
32 | #endif /* ROCKBOX */ | ||
24 | 33 | ||
25 | /* #define GGEE_HSLIDER_COMPATIBLE */ | 34 | /* #define GGEE_HSLIDER_COMPATIBLE */ |
26 | 35 | ||
@@ -185,12 +194,20 @@ void iemgui_verify_snd_ne_rcv(t_iemgui *iemgui) | |||
185 | 194 | ||
186 | t_symbol *iemgui_new_dogetname(t_iemgui *iemgui, int indx, t_atom *argv) | 195 | t_symbol *iemgui_new_dogetname(t_iemgui *iemgui, int indx, t_atom *argv) |
187 | { | 196 | { |
197 | #ifdef ROCKBOX | ||
198 | (void) iemgui; | ||
199 | #endif | ||
188 | if (IS_A_SYMBOL(argv, indx)) | 200 | if (IS_A_SYMBOL(argv, indx)) |
189 | return (atom_getsymbolarg(indx, 100000, argv)); | 201 | return (atom_getsymbolarg(indx, 100000, argv)); |
190 | else if (IS_A_FLOAT(argv, indx)) | 202 | else if (IS_A_FLOAT(argv, indx)) |
191 | { | 203 | { |
192 | char str[80]; | 204 | char str[80]; |
205 | #ifdef ROCKBOX | ||
206 | snprintf(str, sizeof(str)-1, | ||
207 | "%d", (int)atom_getintarg(indx, 100000, argv)); | ||
208 | #else | ||
193 | sprintf(str, "%d", (int)atom_getintarg(indx, 100000, argv)); | 209 | sprintf(str, "%d", (int)atom_getintarg(indx, 100000, argv)); |
210 | #endif | ||
194 | return (gensym(str)); | 211 | return (gensym(str)); |
195 | } | 212 | } |
196 | else return (gensym("empty")); | 213 | else return (gensym("empty")); |
@@ -261,6 +278,10 @@ void iemgui_all_sym2dollararg(t_iemgui *iemgui, t_symbol **srlsym) | |||
261 | 278 | ||
262 | void iemgui_first_dollararg2sym(t_iemgui *iemgui, t_symbol **srlsym) | 279 | void iemgui_first_dollararg2sym(t_iemgui *iemgui, t_symbol **srlsym) |
263 | { | 280 | { |
281 | #ifdef ROCKBOX | ||
282 | (void) iemgui; | ||
283 | (void) srlsym; | ||
284 | #endif | ||
264 | /* delete this function */ | 285 | /* delete this function */ |
265 | } | 286 | } |
266 | 287 | ||
@@ -341,8 +362,12 @@ void iemgui_all_raute2dollar(t_symbol **srlsym) | |||
341 | void iemgui_send(void *x, t_iemgui *iemgui, t_symbol *s) | 362 | void iemgui_send(void *x, t_iemgui *iemgui, t_symbol *s) |
342 | { | 363 | { |
343 | t_symbol *snd; | 364 | t_symbol *snd; |
365 | #ifdef ROCKBOX | ||
366 | int sndable=1, oldsndrcvable=0; | ||
367 | #else | ||
344 | int pargc, tail_len, nth_arg, sndable=1, oldsndrcvable=0; | 368 | int pargc, tail_len, nth_arg, sndable=1, oldsndrcvable=0; |
345 | t_atom *pargv; | 369 | t_atom *pargv; |
370 | #endif | ||
346 | 371 | ||
347 | if(iemgui->x_fsf.x_rcv_able) | 372 | if(iemgui->x_fsf.x_rcv_able) |
348 | oldsndrcvable += IEM_GUI_OLD_RCV_FLAG; | 373 | oldsndrcvable += IEM_GUI_OLD_RCV_FLAG; |
@@ -364,8 +389,12 @@ void iemgui_send(void *x, t_iemgui *iemgui, t_symbol *s) | |||
364 | void iemgui_receive(void *x, t_iemgui *iemgui, t_symbol *s) | 389 | void iemgui_receive(void *x, t_iemgui *iemgui, t_symbol *s) |
365 | { | 390 | { |
366 | t_symbol *rcv; | 391 | t_symbol *rcv; |
392 | #ifdef ROCKBOX | ||
393 | int rcvable=1, oldsndrcvable=0; | ||
394 | #else | ||
367 | int pargc, tail_len, nth_arg, rcvable=1, oldsndrcvable=0; | 395 | int pargc, tail_len, nth_arg, rcvable=1, oldsndrcvable=0; |
368 | t_atom *pargv; | 396 | t_atom *pargv; |
397 | #endif | ||
369 | 398 | ||
370 | if(iemgui->x_fsf.x_rcv_able) | 399 | if(iemgui->x_fsf.x_rcv_able) |
371 | oldsndrcvable += IEM_GUI_OLD_RCV_FLAG; | 400 | oldsndrcvable += IEM_GUI_OLD_RCV_FLAG; |
@@ -399,34 +428,55 @@ void iemgui_receive(void *x, t_iemgui *iemgui, t_symbol *s) | |||
399 | void iemgui_label(void *x, t_iemgui *iemgui, t_symbol *s) | 428 | void iemgui_label(void *x, t_iemgui *iemgui, t_symbol *s) |
400 | { | 429 | { |
401 | t_symbol *lab; | 430 | t_symbol *lab; |
431 | #ifndef ROCKBOX | ||
402 | int pargc, tail_len, nth_arg; | 432 | int pargc, tail_len, nth_arg; |
403 | t_atom *pargv; | 433 | t_atom *pargv; |
434 | #endif | ||
435 | |||
436 | #ifdef ROCKBOX | ||
437 | (void) x; | ||
438 | #endif | ||
404 | 439 | ||
405 | lab = iemgui_raute2dollar(s); | 440 | lab = iemgui_raute2dollar(s); |
406 | iemgui->x_lab_unexpanded = lab; | 441 | iemgui->x_lab_unexpanded = lab; |
407 | iemgui->x_lab = lab = canvas_realizedollar(iemgui->x_glist, lab); | 442 | iemgui->x_lab = lab = canvas_realizedollar(iemgui->x_glist, lab); |
408 | 443 | ||
444 | #ifndef ROCKBOX | ||
409 | if(glist_isvisible(iemgui->x_glist)) | 445 | if(glist_isvisible(iemgui->x_glist)) |
410 | sys_vgui(".x%x.c itemconfigure %xLABEL -text {%s} \n", | 446 | sys_vgui(".x%x.c itemconfigure %xLABEL -text {%s} \n", |
411 | glist_getcanvas(iemgui->x_glist), x, | 447 | glist_getcanvas(iemgui->x_glist), x, |
412 | strcmp(s->s_name, "empty")?iemgui->x_lab->s_name:""); | 448 | strcmp(s->s_name, "empty")?iemgui->x_lab->s_name:""); |
449 | #endif | ||
413 | } | 450 | } |
414 | 451 | ||
415 | void iemgui_label_pos(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) | 452 | void iemgui_label_pos(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) |
416 | { | 453 | { |
454 | #ifdef ROCKBOX | ||
455 | (void) x; | ||
456 | (void) s; | ||
457 | #endif | ||
458 | |||
417 | iemgui->x_ldx = (int)atom_getintarg(0, ac, av); | 459 | iemgui->x_ldx = (int)atom_getintarg(0, ac, av); |
418 | iemgui->x_ldy = (int)atom_getintarg(1, ac, av); | 460 | iemgui->x_ldy = (int)atom_getintarg(1, ac, av); |
461 | |||
462 | #ifndef ROCKBOX | ||
419 | if(glist_isvisible(iemgui->x_glist)) | 463 | if(glist_isvisible(iemgui->x_glist)) |
420 | sys_vgui(".x%x.c coords %xLABEL %d %d\n", | 464 | sys_vgui(".x%x.c coords %xLABEL %d %d\n", |
421 | glist_getcanvas(iemgui->x_glist), x, | 465 | glist_getcanvas(iemgui->x_glist), x, |
422 | iemgui->x_obj.te_xpix+iemgui->x_ldx, | 466 | iemgui->x_obj.te_xpix+iemgui->x_ldx, |
423 | iemgui->x_obj.te_ypix+iemgui->x_ldy); | 467 | iemgui->x_obj.te_ypix+iemgui->x_ldy); |
468 | #endif | ||
424 | } | 469 | } |
425 | 470 | ||
426 | void iemgui_label_font(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) | 471 | void iemgui_label_font(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) |
427 | { | 472 | { |
428 | int f = (int)atom_getintarg(0, ac, av); | 473 | int f = (int)atom_getintarg(0, ac, av); |
429 | 474 | ||
475 | #ifdef ROCKBOX | ||
476 | (void) x; | ||
477 | (void) s; | ||
478 | #endif | ||
479 | |||
430 | if(f == 1) strcpy(iemgui->x_font, "helvetica"); | 480 | if(f == 1) strcpy(iemgui->x_font, "helvetica"); |
431 | else if(f == 2) strcpy(iemgui->x_font, "times"); | 481 | else if(f == 2) strcpy(iemgui->x_font, "times"); |
432 | else | 482 | else |
@@ -439,9 +489,11 @@ void iemgui_label_font(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *a | |||
439 | if(f < 4) | 489 | if(f < 4) |
440 | f = 4; | 490 | f = 4; |
441 | iemgui->x_fontsize = f; | 491 | iemgui->x_fontsize = f; |
492 | #ifndef ROCKBOX | ||
442 | if(glist_isvisible(iemgui->x_glist)) | 493 | if(glist_isvisible(iemgui->x_glist)) |
443 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold}\n", | 494 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold}\n", |
444 | glist_getcanvas(iemgui->x_glist), x, iemgui->x_font, iemgui->x_fontsize); | 495 | glist_getcanvas(iemgui->x_glist), x, iemgui->x_font, iemgui->x_fontsize); |
496 | #endif | ||
445 | } | 497 | } |
446 | 498 | ||
447 | void iemgui_size(void *x, t_iemgui *iemgui) | 499 | void iemgui_size(void *x, t_iemgui *iemgui) |
@@ -455,6 +507,9 @@ void iemgui_size(void *x, t_iemgui *iemgui) | |||
455 | 507 | ||
456 | void iemgui_delta(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) | 508 | void iemgui_delta(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) |
457 | { | 509 | { |
510 | #ifdef ROCKBOX | ||
511 | (void) s; | ||
512 | #endif | ||
458 | iemgui->x_obj.te_xpix += (int)atom_getintarg(0, ac, av); | 513 | iemgui->x_obj.te_xpix += (int)atom_getintarg(0, ac, av); |
459 | iemgui->x_obj.te_ypix += (int)atom_getintarg(1, ac, av); | 514 | iemgui->x_obj.te_ypix += (int)atom_getintarg(1, ac, av); |
460 | if(glist_isvisible(iemgui->x_glist)) | 515 | if(glist_isvisible(iemgui->x_glist)) |
@@ -466,6 +521,9 @@ void iemgui_delta(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) | |||
466 | 521 | ||
467 | void iemgui_pos(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) | 522 | void iemgui_pos(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) |
468 | { | 523 | { |
524 | #ifdef ROCKBOX | ||
525 | (void) s; | ||
526 | #endif | ||
469 | iemgui->x_obj.te_xpix = (int)atom_getintarg(0, ac, av); | 527 | iemgui->x_obj.te_xpix = (int)atom_getintarg(0, ac, av); |
470 | iemgui->x_obj.te_ypix = (int)atom_getintarg(1, ac, av); | 528 | iemgui->x_obj.te_ypix = (int)atom_getintarg(1, ac, av); |
471 | if(glist_isvisible(iemgui->x_glist)) | 529 | if(glist_isvisible(iemgui->x_glist)) |
@@ -477,6 +535,9 @@ void iemgui_pos(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) | |||
477 | 535 | ||
478 | void iemgui_color(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) | 536 | void iemgui_color(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) |
479 | { | 537 | { |
538 | #ifdef ROCKBOX | ||
539 | (void) s; | ||
540 | #endif | ||
480 | iemgui->x_bcol = iemgui_compatible_col(atom_getintarg(0, ac, av)); | 541 | iemgui->x_bcol = iemgui_compatible_col(atom_getintarg(0, ac, av)); |
481 | if(ac > 2) | 542 | if(ac > 2) |
482 | { | 543 | { |
@@ -561,21 +622,36 @@ int iemgui_dialog(t_iemgui *iemgui, t_symbol **srl, int argc, t_atom *argv) | |||
561 | srl[0] = atom_getsymbolarg(7, argc, argv); | 622 | srl[0] = atom_getsymbolarg(7, argc, argv); |
562 | else if(IS_A_FLOAT(argv,7)) | 623 | else if(IS_A_FLOAT(argv,7)) |
563 | { | 624 | { |
625 | #ifdef ROCKBOX | ||
626 | snprintf(str, sizeof(str)-1, | ||
627 | "%d", (int)atom_getintarg(7, argc, argv)); | ||
628 | #else | ||
564 | sprintf(str, "%d", (int)atom_getintarg(7, argc, argv)); | 629 | sprintf(str, "%d", (int)atom_getintarg(7, argc, argv)); |
630 | #endif | ||
565 | srl[0] = gensym(str); | 631 | srl[0] = gensym(str); |
566 | } | 632 | } |
567 | if(IS_A_SYMBOL(argv,8)) | 633 | if(IS_A_SYMBOL(argv,8)) |
568 | srl[1] = atom_getsymbolarg(8, argc, argv); | 634 | srl[1] = atom_getsymbolarg(8, argc, argv); |
569 | else if(IS_A_FLOAT(argv,8)) | 635 | else if(IS_A_FLOAT(argv,8)) |
570 | { | 636 | { |
637 | #ifdef ROCKBOX | ||
638 | snprintf(str, sizeof(str)-1, | ||
639 | "%d", (int)atom_getintarg(8, argc, argv)); | ||
640 | #else | ||
571 | sprintf(str, "%d", (int)atom_getintarg(8, argc, argv)); | 641 | sprintf(str, "%d", (int)atom_getintarg(8, argc, argv)); |
642 | #endif | ||
572 | srl[1] = gensym(str); | 643 | srl[1] = gensym(str); |
573 | } | 644 | } |
574 | if(IS_A_SYMBOL(argv,9)) | 645 | if(IS_A_SYMBOL(argv,9)) |
575 | srl[2] = atom_getsymbolarg(9, argc, argv); | 646 | srl[2] = atom_getsymbolarg(9, argc, argv); |
576 | else if(IS_A_FLOAT(argv,9)) | 647 | else if(IS_A_FLOAT(argv,9)) |
577 | { | 648 | { |
649 | #ifdef ROCKBOX | ||
650 | snprintf(str, sizeof(str)-1, | ||
651 | "%d", (int)atom_getintarg(9, argc, argv)); | ||
652 | #else | ||
578 | sprintf(str, "%d", (int)atom_getintarg(9, argc, argv)); | 653 | sprintf(str, "%d", (int)atom_getintarg(9, argc, argv)); |
654 | #endif | ||
579 | srl[2] = gensym(str); | 655 | srl[2] = gensym(str); |
580 | } | 656 | } |
581 | if(init != 0) init = 1; | 657 | if(init != 0) init = 1; |
diff --git a/apps/plugins/pdbox/PDa/src/g_array.c b/apps/plugins/pdbox/PDa/src/g_array.c index 3e2225637a..b6870b6117 100644 --- a/apps/plugins/pdbox/PDa/src/g_array.c +++ b/apps/plugins/pdbox/PDa/src/g_array.c | |||
@@ -2,12 +2,22 @@ | |||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | 2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL |
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | 3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ |
4 | 4 | ||
5 | #ifdef ROCKBOX | ||
6 | #include "plugin.h" | ||
7 | #include "pdbox.h" | ||
8 | #include "m_pd.h" | ||
9 | #include "g_canvas.h" | ||
10 | #ifdef SIMULATOR | ||
11 | int printf(const char *fmt, ...); | ||
12 | #endif /* SIMULATOR */ | ||
13 | #else /* ROCKBOX */ | ||
5 | #include <stdlib.h> | 14 | #include <stdlib.h> |
6 | #include <string.h> | 15 | #include <string.h> |
7 | #include <stdio.h> /* for read/write to files */ | 16 | #include <stdio.h> /* for read/write to files */ |
8 | #include "m_pd.h" | 17 | #include "m_pd.h" |
9 | #include "g_canvas.h" | 18 | #include "g_canvas.h" |
10 | #include <math.h> | 19 | #include <math.h> |
20 | #endif /* ROCKBOX */ | ||
11 | 21 | ||
12 | /* see also the "plot" object in g_scalar.c which deals with graphing | 22 | /* see also the "plot" object in g_scalar.c which deals with graphing |
13 | arrays which are fields in scalars. Someday we should unify the | 23 | arrays which are fields in scalars. Someday we should unify the |
@@ -40,7 +50,9 @@ t_array *array_new(t_symbol *templatesym, t_gpointer *parent) | |||
40 | { | 50 | { |
41 | t_array *x = (t_array *)getbytes(sizeof (*x)); | 51 | t_array *x = (t_array *)getbytes(sizeof (*x)); |
42 | t_template *template; | 52 | t_template *template; |
53 | #ifndef ROCKBOX | ||
43 | t_gpointer *gp; | 54 | t_gpointer *gp; |
55 | #endif | ||
44 | template = template_findbyname(templatesym); | 56 | template = template_findbyname(templatesym); |
45 | x->a_templatesym = templatesym; | 57 | x->a_templatesym = templatesym; |
46 | x->a_n = 1; | 58 | x->a_n = 1; |
@@ -59,7 +71,9 @@ t_array *array_new(t_symbol *templatesym, t_gpointer *parent) | |||
59 | void array_resize(t_array *x, t_template *template, int n) | 71 | void array_resize(t_array *x, t_template *template, int n) |
60 | { | 72 | { |
61 | int elemsize, oldn; | 73 | int elemsize, oldn; |
74 | #ifndef ROCKBOX | ||
62 | t_gpointer *gp; | 75 | t_gpointer *gp; |
76 | #endif | ||
63 | 77 | ||
64 | if (n < 1) | 78 | if (n < 1) |
65 | n = 1; | 79 | n = 1; |
@@ -135,7 +149,11 @@ t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *templatesym, | |||
135 | if (s == &s_) | 149 | if (s == &s_) |
136 | { | 150 | { |
137 | char buf[40]; | 151 | char buf[40]; |
152 | #ifdef ROCKBOX | ||
153 | snprintf(buf, sizeof(buf)-1, "array%d", ++gcount); | ||
154 | #else | ||
138 | sprintf(buf, "array%d", ++gcount); | 155 | sprintf(buf, "array%d", ++gcount); |
156 | #endif | ||
139 | s = gensym(buf); | 157 | s = gensym(buf); |
140 | templatesym = &s_float; | 158 | templatesym = &s_float; |
141 | n = 100; | 159 | n = 100; |
@@ -179,7 +197,7 @@ t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *templatesym, | |||
179 | x->x_glist = gl; | 197 | x->x_glist = gl; |
180 | x->x_usedindsp = 0; | 198 | x->x_usedindsp = 0; |
181 | x->x_saveit = (saveit != 0); | 199 | x->x_saveit = (saveit != 0); |
182 | if (x2 = pd_findbyclass(gensym("#A"), garray_class)) | 200 | if((x2 = pd_findbyclass(gensym("#A"), garray_class))) |
183 | pd_unbind(x2, gensym("#A")); | 201 | pd_unbind(x2, gensym("#A")); |
184 | 202 | ||
185 | pd_bind(&x->x_gobj.g_pd, gensym("#A")); | 203 | pd_bind(&x->x_gobj.g_pd, gensym("#A")); |
@@ -190,16 +208,23 @@ t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *templatesym, | |||
190 | /* called from array menu item to create a new one */ | 208 | /* called from array menu item to create a new one */ |
191 | void canvas_menuarray(t_glist *canvas) | 209 | void canvas_menuarray(t_glist *canvas) |
192 | { | 210 | { |
211 | #ifdef ROCKBOX | ||
212 | (void) canvas; | ||
213 | #else /* ROCKBOX */ | ||
193 | t_glist *x = (t_glist *)canvas; | 214 | t_glist *x = (t_glist *)canvas; |
194 | char cmdbuf[200]; | 215 | char cmdbuf[200]; |
195 | sprintf(cmdbuf, "pdtk_array_dialog %%s array%d 100 1 1\n", | 216 | sprintf(cmdbuf, "pdtk_array_dialog %%s array%d 100 1 1\n", |
196 | ++gcount); | 217 | ++gcount); |
197 | gfxstub_new(&x->gl_pd, x, cmdbuf); | 218 | gfxstub_new(&x->gl_pd, x, cmdbuf); |
219 | #endif /* ROCKBOX */ | ||
198 | } | 220 | } |
199 | 221 | ||
200 | /* called from graph_dialog to set properties */ | 222 | /* called from graph_dialog to set properties */ |
201 | void garray_properties(t_garray *x) | 223 | void garray_properties(t_garray *x) |
202 | { | 224 | { |
225 | #ifdef ROCKBOX | ||
226 | (void) x; | ||
227 | #else /* ROCKBOX */ | ||
203 | char cmdbuf[200]; | 228 | char cmdbuf[200]; |
204 | gfxstub_deleteforkey(x); | 229 | gfxstub_deleteforkey(x); |
205 | /* create dialog window. LATER fix this to escape '$' | 230 | /* create dialog window. LATER fix this to escape '$' |
@@ -211,6 +236,7 @@ void garray_properties(t_garray *x) | |||
211 | else sprintf(cmdbuf, "pdtk_array_dialog %%s %s %d %d 0\n", | 236 | else sprintf(cmdbuf, "pdtk_array_dialog %%s %s %d %d 0\n", |
212 | x->x_name->s_name, x->x_n, x->x_saveit); | 237 | x->x_name->s_name, x->x_n, x->x_saveit); |
213 | gfxstub_new(&x->x_gobj.g_pd, x, cmdbuf); | 238 | gfxstub_new(&x->x_gobj.g_pd, x, cmdbuf); |
239 | #endif /* ROCKBOX */ | ||
214 | } | 240 | } |
215 | 241 | ||
216 | /* this is called back from the dialog window to create a garray. | 242 | /* this is called back from the dialog window to create a garray. |
@@ -260,10 +286,12 @@ void garray_arraydialog(t_garray *x, t_symbol *name, t_floatarg fsize, | |||
260 | static void garray_free(t_garray *x) | 286 | static void garray_free(t_garray *x) |
261 | { | 287 | { |
262 | t_pd *x2; | 288 | t_pd *x2; |
289 | #ifndef ROCKBOX | ||
263 | gfxstub_deleteforkey(x); | 290 | gfxstub_deleteforkey(x); |
291 | #endif | ||
264 | pd_unbind(&x->x_gobj.g_pd, x->x_realname); | 292 | pd_unbind(&x->x_gobj.g_pd, x->x_realname); |
265 | /* LATER find a way to get #A unbound earlier (at end of load?) */ | 293 | /* LATER find a way to get #A unbound earlier (at end of load?) */ |
266 | while (x2 = pd_findbyclass(gensym("#A"), garray_class)) | 294 | while((x2 = pd_findbyclass(gensym("#A"), garray_class))) |
267 | pd_unbind(x2, gensym("#A")); | 295 | pd_unbind(x2, gensym("#A")); |
268 | freebytes(x->x_vec, x->x_n * x->x_elemsize); | 296 | freebytes(x->x_vec, x->x_n * x->x_elemsize); |
269 | } | 297 | } |
@@ -308,7 +336,9 @@ static t_word *array_motion_wp; | |||
308 | static t_template *array_motion_template; | 336 | static t_template *array_motion_template; |
309 | static int array_motion_npoints; | 337 | static int array_motion_npoints; |
310 | static int array_motion_elemsize; | 338 | static int array_motion_elemsize; |
339 | #ifndef ROCKBOX | ||
311 | static int array_motion_altkey; | 340 | static int array_motion_altkey; |
341 | #endif | ||
312 | static float array_motion_initx; | 342 | static float array_motion_initx; |
313 | static float array_motion_xperpix; | 343 | static float array_motion_xperpix; |
314 | static float array_motion_yperpix; | 344 | static float array_motion_yperpix; |
@@ -320,6 +350,9 @@ static int array_motion_fatten; | |||
320 | 350 | ||
321 | static void array_motion(void *z, t_floatarg dx, t_floatarg dy) | 351 | static void array_motion(void *z, t_floatarg dx, t_floatarg dy) |
322 | { | 352 | { |
353 | #ifdef ROCKBOX | ||
354 | (void) z; | ||
355 | #endif | ||
323 | array_motion_xcumulative += dx * array_motion_xperpix; | 356 | array_motion_xcumulative += dx * array_motion_xperpix; |
324 | array_motion_ycumulative += dy * array_motion_yperpix; | 357 | array_motion_ycumulative += dy * array_motion_yperpix; |
325 | if (*array_motion_xfield->s_name) | 358 | if (*array_motion_xfield->s_name) |
@@ -402,6 +435,12 @@ int array_doclick(t_array *array, t_glist *glist, t_gobj *gobj, | |||
402 | t_template *elemtemplate; | 435 | t_template *elemtemplate; |
403 | int elemsize, yonset, wonset, xonset, i; | 436 | int elemsize, yonset, wonset, xonset, i; |
404 | 437 | ||
438 | #ifdef ROCKBOX | ||
439 | (void) linewidth; | ||
440 | (void) shift; | ||
441 | (void) dbl; | ||
442 | #endif | ||
443 | |||
405 | if (!array_getfields(elemtemplatesym, &elemtemplatecanvas, | 444 | if (!array_getfields(elemtemplatesym, &elemtemplatecanvas, |
406 | &elemtemplate, &elemsize, &xonset, &yonset, &wonset)) | 445 | &elemtemplate, &elemsize, &xonset, &yonset, &wonset)) |
407 | { | 446 | { |
@@ -575,7 +614,11 @@ static void garray_getrect(t_gobj *z, t_glist *glist, | |||
575 | else incr = x->x_array.a_n / 300; | 614 | else incr = x->x_array.a_n / 300; |
576 | for (i = 0; i < x->x_array.a_n; i += incr) | 615 | for (i = 0; i < x->x_array.a_n; i += incr) |
577 | { | 616 | { |
617 | #ifdef ROCKBOX | ||
618 | float pxpix, pypix, pwpix; | ||
619 | #else /* ROCKBOX */ | ||
578 | float pxpix, pypix, pwpix, dx, dy; | 620 | float pxpix, pypix, pwpix, dx, dy; |
621 | #endif /* ROCKBOX */ | ||
579 | array_getcoordinate(glist, (char *)(x->x_array.a_vec) + | 622 | array_getcoordinate(glist, (char *)(x->x_array.a_vec) + |
580 | i * elemsize, | 623 | i * elemsize, |
581 | xonset, yonset, wonset, i, 0, 0, 1, | 624 | xonset, yonset, wonset, i, 0, 0, 1, |
@@ -600,21 +643,42 @@ static void garray_getrect(t_gobj *z, t_glist *glist, | |||
600 | 643 | ||
601 | static void garray_displace(t_gobj *z, t_glist *glist, int dx, int dy) | 644 | static void garray_displace(t_gobj *z, t_glist *glist, int dx, int dy) |
602 | { | 645 | { |
646 | #ifdef ROCKBOX | ||
647 | (void) z; | ||
648 | (void) glist; | ||
649 | (void) dx; | ||
650 | (void) dy; | ||
651 | #endif | ||
603 | /* refuse */ | 652 | /* refuse */ |
604 | } | 653 | } |
605 | 654 | ||
606 | static void garray_select(t_gobj *z, t_glist *glist, int state) | 655 | static void garray_select(t_gobj *z, t_glist *glist, int state) |
607 | { | 656 | { |
657 | #ifdef ROCKBOX | ||
658 | (void) z; | ||
659 | (void) glist; | ||
660 | (void) state; | ||
661 | #else /* ROCKBOX */ | ||
608 | t_garray *x = (t_garray *)z; | 662 | t_garray *x = (t_garray *)z; |
663 | #endif /* ROCKBOX */ | ||
609 | /* fill in later */ | 664 | /* fill in later */ |
610 | } | 665 | } |
611 | 666 | ||
612 | static void garray_activate(t_gobj *z, t_glist *glist, int state) | 667 | static void garray_activate(t_gobj *z, t_glist *glist, int state) |
613 | { | 668 | { |
669 | #ifdef ROCKBOX | ||
670 | (void) z; | ||
671 | (void) glist; | ||
672 | (void) state; | ||
673 | #endif | ||
614 | } | 674 | } |
615 | 675 | ||
616 | static void garray_delete(t_gobj *z, t_glist *glist) | 676 | static void garray_delete(t_gobj *z, t_glist *glist) |
617 | { | 677 | { |
678 | #ifdef ROCKBOX | ||
679 | (void) z; | ||
680 | (void) glist; | ||
681 | #endif | ||
618 | /* nothing to do */ | 682 | /* nothing to do */ |
619 | } | 683 | } |
620 | 684 | ||
@@ -633,9 +697,11 @@ static void garray_vis(t_gobj *z, t_glist *glist, int vis) | |||
633 | { | 697 | { |
634 | error("%s: needs floating-point 'y' field", | 698 | error("%s: needs floating-point 'y' field", |
635 | x->x_templatesym->s_name); | 699 | x->x_templatesym->s_name); |
700 | #ifndef ROCKBOX | ||
636 | sys_vgui(".x%x.c create text 50 50 -text foo\ | 701 | sys_vgui(".x%x.c create text 50 50 -text foo\ |
637 | -tags .x%x.a%x\n", | 702 | -tags .x%x.a%x\n", |
638 | glist_getcanvas(glist), glist_getcanvas(glist), x); | 703 | glist_getcanvas(glist), glist_getcanvas(glist), x); |
704 | #endif | ||
639 | } | 705 | } |
640 | else if (!template_find_field(template, gensym("x"), &xonset, &type, | 706 | else if (!template_find_field(template, gensym("x"), &xonset, &type, |
641 | &arraytype) || type != DT_FLOAT) | 707 | &arraytype) || type != DT_FLOAT) |
@@ -644,7 +710,9 @@ static void garray_vis(t_gobj *z, t_glist *glist, int vis) | |||
644 | int lastpixel = -1, ndrawn = 0; | 710 | int lastpixel = -1, ndrawn = 0; |
645 | float yval = 0, xpix; | 711 | float yval = 0, xpix; |
646 | int ixpix = 0; | 712 | int ixpix = 0; |
713 | #ifndef ROCKBOX | ||
647 | sys_vgui(".x%x.c create line \\\n", glist_getcanvas(glist)); | 714 | sys_vgui(".x%x.c create line \\\n", glist_getcanvas(glist)); |
715 | #endif | ||
648 | for (i = 0; i < x->x_n; i++) | 716 | for (i = 0; i < x->x_n; i++) |
649 | { | 717 | { |
650 | yval = fixtof(*(t_sample *)(x->x_vec + | 718 | yval = fixtof(*(t_sample *)(x->x_vec + |
@@ -653,8 +721,10 @@ static void garray_vis(t_gobj *z, t_glist *glist, int vis) | |||
653 | ixpix = xpix + 0.5; | 721 | ixpix = xpix + 0.5; |
654 | if (ixpix != lastpixel) | 722 | if (ixpix != lastpixel) |
655 | { | 723 | { |
724 | #ifndef ROCKBOX | ||
656 | sys_vgui("%d %f \\\n", ixpix, | 725 | sys_vgui("%d %f \\\n", ixpix, |
657 | glist_ytopixels(glist, yval)); | 726 | glist_ytopixels(glist, yval)); |
727 | #endif | ||
658 | ndrawn++; | 728 | ndrawn++; |
659 | } | 729 | } |
660 | lastpixel = ixpix; | 730 | lastpixel = ixpix; |
@@ -662,11 +732,14 @@ static void garray_vis(t_gobj *z, t_glist *glist, int vis) | |||
662 | xcum += x->x_xinc; | 732 | xcum += x->x_xinc; |
663 | } | 733 | } |
664 | /* TK will complain if there aren't at least 2 points... */ | 734 | /* TK will complain if there aren't at least 2 points... */ |
735 | #ifndef ROCKBOX | ||
665 | if (ndrawn == 0) sys_vgui("0 0 0 0 \\\n"); | 736 | if (ndrawn == 0) sys_vgui("0 0 0 0 \\\n"); |
666 | else if (ndrawn == 1) sys_vgui("%d %f \\\n", ixpix, | 737 | else if (ndrawn == 1) sys_vgui("%d %f \\\n", ixpix, |
667 | glist_ytopixels(glist, yval)); | 738 | glist_ytopixels(glist, yval)); |
668 | sys_vgui("-tags .x%x.a%x\n", glist_getcanvas(glist), x); | 739 | sys_vgui("-tags .x%x.a%x\n", glist_getcanvas(glist), x); |
740 | #endif | ||
669 | firsty = fixtof(*(t_sample *)(x->x_vec + yonset)); | 741 | firsty = fixtof(*(t_sample *)(x->x_vec + yonset)); |
742 | #ifndef ROCKBOX | ||
670 | sys_vgui(".x%x.c create text %f %f -text {%s} -anchor e\ | 743 | sys_vgui(".x%x.c create text %f %f -text {%s} -anchor e\ |
671 | -font -*-courier-bold--normal--%d-* -tags .x%x.a%x\n", | 744 | -font -*-courier-bold--normal--%d-* -tags .x%x.a%x\n", |
672 | glist_getcanvas(glist), | 745 | glist_getcanvas(glist), |
@@ -674,6 +747,7 @@ static void garray_vis(t_gobj *z, t_glist *glist, int vis) | |||
674 | glist_ytopixels(glist, firsty), | 747 | glist_ytopixels(glist, firsty), |
675 | x->x_name->s_name, glist_getfont(glist), | 748 | x->x_name->s_name, glist_getfont(glist), |
676 | glist_getcanvas(glist), x); | 749 | glist_getcanvas(glist), x); |
750 | #endif | ||
677 | } | 751 | } |
678 | else | 752 | else |
679 | { | 753 | { |
@@ -682,8 +756,10 @@ static void garray_vis(t_gobj *z, t_glist *glist, int vis) | |||
682 | } | 756 | } |
683 | else | 757 | else |
684 | { | 758 | { |
759 | #ifndef ROCKBOX | ||
685 | sys_vgui(".x%x.c delete .x%x.a%x\n", | 760 | sys_vgui(".x%x.c delete .x%x.a%x\n", |
686 | glist_getcanvas(glist), glist_getcanvas(glist), x); | 761 | glist_getcanvas(glist), glist_getcanvas(glist), x); |
762 | #endif | ||
687 | } | 763 | } |
688 | } | 764 | } |
689 | 765 | ||
@@ -702,7 +778,13 @@ static void garray_save(t_gobj *z, t_binbuf *b) | |||
702 | t_garray *x = (t_garray *)z; | 778 | t_garray *x = (t_garray *)z; |
703 | binbuf_addv(b, "sssisi;", gensym("#X"), gensym("array"), | 779 | binbuf_addv(b, "sssisi;", gensym("#X"), gensym("array"), |
704 | x->x_name, x->x_n, x->x_templatesym, x->x_saveit); | 780 | x->x_name, x->x_n, x->x_templatesym, x->x_saveit); |
781 | #ifdef ROCKBOX | ||
782 | #ifdef SIMULATOR | ||
783 | printf("array save\n"); | ||
784 | #endif /* SIMULATOR */ | ||
785 | #else /* ROCKBOX */ | ||
705 | fprintf(stderr,"array save\n"); | 786 | fprintf(stderr,"array save\n"); |
787 | #endif /* ROCKBOX */ | ||
706 | if (x->x_saveit) | 788 | if (x->x_saveit) |
707 | { | 789 | { |
708 | int n = x->x_n, n2 = 0; | 790 | int n = x->x_n, n2 = 0; |
@@ -877,7 +959,11 @@ static void garray_dofo(t_garray *x, int npoints, float dcval, | |||
877 | 959 | ||
878 | static void garray_sinesum(t_garray *x, t_symbol *s, int argc, t_atom *argv) | 960 | static void garray_sinesum(t_garray *x, t_symbol *s, int argc, t_atom *argv) |
879 | { | 961 | { |
962 | #ifdef ROCKBOX | ||
963 | (void) s; | ||
964 | #else | ||
880 | t_template *template = garray_template(x); | 965 | t_template *template = garray_template(x); |
966 | #endif | ||
881 | 967 | ||
882 | t_float *svec = (t_float *)t_getbytes(sizeof(t_float) * argc); | 968 | t_float *svec = (t_float *)t_getbytes(sizeof(t_float) * argc); |
883 | int npoints, i; | 969 | int npoints, i; |
@@ -902,7 +988,11 @@ static void garray_sinesum(t_garray *x, t_symbol *s, int argc, t_atom *argv) | |||
902 | 988 | ||
903 | static void garray_cosinesum(t_garray *x, t_symbol *s, int argc, t_atom *argv) | 989 | static void garray_cosinesum(t_garray *x, t_symbol *s, int argc, t_atom *argv) |
904 | { | 990 | { |
991 | #ifdef ROCKBOX | ||
992 | (void) s; | ||
993 | #else | ||
905 | t_template *template = garray_template(x); | 994 | t_template *template = garray_template(x); |
995 | #endif | ||
906 | 996 | ||
907 | t_float *svec = (t_float *)t_getbytes(sizeof(t_float) * argc); | 997 | t_float *svec = (t_float *)t_getbytes(sizeof(t_float) * argc); |
908 | int npoints, i; | 998 | int npoints, i; |
@@ -928,7 +1018,11 @@ static void garray_cosinesum(t_garray *x, t_symbol *s, int argc, t_atom *argv) | |||
928 | static void garray_normalize(t_garray *x, t_float f) | 1018 | static void garray_normalize(t_garray *x, t_float f) |
929 | { | 1019 | { |
930 | t_template *template = garray_template(x); | 1020 | t_template *template = garray_template(x); |
1021 | #ifdef ROCKBOX | ||
1022 | int yonset, type, i; | ||
1023 | #else | ||
931 | int yonset, type, npoints, i; | 1024 | int yonset, type, npoints, i; |
1025 | #endif | ||
932 | double maxv, renormer; | 1026 | double maxv, renormer; |
933 | t_symbol *arraytype; | 1027 | t_symbol *arraytype; |
934 | 1028 | ||
@@ -968,6 +1062,9 @@ static void garray_list(t_garray *x, t_symbol *s, int argc, t_atom *argv) | |||
968 | t_template *template = garray_template(x); | 1062 | t_template *template = garray_template(x); |
969 | int yonset, type, i; | 1063 | int yonset, type, i; |
970 | t_symbol *arraytype; | 1064 | t_symbol *arraytype; |
1065 | #ifdef ROCKBOX | ||
1066 | (void) s; | ||
1067 | #endif | ||
971 | if (!template_find_field(template, gensym("y"), &yonset, | 1068 | if (!template_find_field(template, gensym("y"), &yonset, |
972 | &type, &arraytype) || type != DT_FLOAT) | 1069 | &type, &arraytype) || type != DT_FLOAT) |
973 | error("%s: needs floating-point 'y' field", | 1070 | error("%s: needs floating-point 'y' field", |
@@ -1038,7 +1135,11 @@ static void garray_rename(t_garray *x, t_symbol *s) | |||
1038 | static void garray_read(t_garray *x, t_symbol *filename) | 1135 | static void garray_read(t_garray *x, t_symbol *filename) |
1039 | { | 1136 | { |
1040 | int nelem = x->x_n, filedesc; | 1137 | int nelem = x->x_n, filedesc; |
1138 | #ifdef ROCKBOX | ||
1139 | int fd = 0; | ||
1140 | #else | ||
1041 | FILE *fd; | 1141 | FILE *fd; |
1142 | #endif | ||
1042 | char buf[MAXPDSTRING], *bufptr; | 1143 | char buf[MAXPDSTRING], *bufptr; |
1043 | t_template *template = garray_template(x); | 1144 | t_template *template = garray_template(x); |
1044 | int yonset, type, i; | 1145 | int yonset, type, i; |
@@ -1052,15 +1153,23 @@ static void garray_read(t_garray *x, t_symbol *filename) | |||
1052 | if ((filedesc = open_via_path( | 1153 | if ((filedesc = open_via_path( |
1053 | canvas_getdir(glist_getcanvas(x->x_glist))->s_name, | 1154 | canvas_getdir(glist_getcanvas(x->x_glist))->s_name, |
1054 | filename->s_name, "", buf, &bufptr, MAXPDSTRING, 0)) < 0 | 1155 | filename->s_name, "", buf, &bufptr, MAXPDSTRING, 0)) < 0 |
1156 | #ifdef ROCKBOX | ||
1157 | ) | ||
1158 | #else | ||
1055 | || !(fd = fdopen(filedesc, "r"))) | 1159 | || !(fd = fdopen(filedesc, "r"))) |
1160 | #endif | ||
1056 | { | 1161 | { |
1057 | error("%s: can't open", filename->s_name); | 1162 | error("%s: can't open", filename->s_name); |
1058 | return; | 1163 | return; |
1059 | } | 1164 | } |
1060 | for (i = 0; i < nelem; i++) | 1165 | for (i = 0; i < nelem; i++) |
1061 | { | 1166 | { |
1167 | #ifdef ROCKBOX | ||
1168 | if(rb_fscanf_f(fd, (float*)((x->x_vec + sizeof(t_word) * i) + yonset))) | ||
1169 | #else | ||
1062 | if (!fscanf(fd, "%f", (float *)((x->x_vec + sizeof(t_word) * i) + | 1170 | if (!fscanf(fd, "%f", (float *)((x->x_vec + sizeof(t_word) * i) + |
1063 | yonset))) | 1171 | yonset))) |
1172 | #endif | ||
1064 | { | 1173 | { |
1065 | post("%s: read %d elements into table of size %d", | 1174 | post("%s: read %d elements into table of size %d", |
1066 | filename->s_name, i, nelem); | 1175 | filename->s_name, i, nelem); |
@@ -1069,7 +1178,11 @@ static void garray_read(t_garray *x, t_symbol *filename) | |||
1069 | } | 1178 | } |
1070 | while (i < nelem) | 1179 | while (i < nelem) |
1071 | *(float *)((x->x_vec + sizeof(t_word) * i) + yonset) = 0, i++; | 1180 | *(float *)((x->x_vec + sizeof(t_word) * i) + yonset) = 0, i++; |
1181 | #ifdef ROCKBOX | ||
1182 | close(fd); | ||
1183 | #else | ||
1072 | fclose(fd); | 1184 | fclose(fd); |
1185 | #endif | ||
1073 | garray_redraw(x); | 1186 | garray_redraw(x); |
1074 | } | 1187 | } |
1075 | 1188 | ||
@@ -1090,7 +1203,11 @@ static void garray_read16(t_garray *x, t_symbol *filename, | |||
1090 | int skip = fskip, filedesc; | 1203 | int skip = fskip, filedesc; |
1091 | int i, nelem; | 1204 | int i, nelem; |
1092 | t_sample *vec; | 1205 | t_sample *vec; |
1206 | #ifdef ROCKBOX | ||
1207 | int fd = 0; | ||
1208 | #else | ||
1093 | FILE *fd; | 1209 | FILE *fd; |
1210 | #endif | ||
1094 | char buf[MAXPDSTRING], *bufptr; | 1211 | char buf[MAXPDSTRING], *bufptr; |
1095 | short s; | 1212 | short s; |
1096 | int cpubig = garray_ambigendian(), swap = 0; | 1213 | int cpubig = garray_ambigendian(), swap = 0; |
@@ -1116,25 +1233,41 @@ static void garray_read16(t_garray *x, t_symbol *filename, | |||
1116 | if ((filedesc = open_via_path( | 1233 | if ((filedesc = open_via_path( |
1117 | canvas_getdir(glist_getcanvas(x->x_glist))->s_name, | 1234 | canvas_getdir(glist_getcanvas(x->x_glist))->s_name, |
1118 | filename->s_name, "", buf, &bufptr, MAXPDSTRING, 1)) < 0 | 1235 | filename->s_name, "", buf, &bufptr, MAXPDSTRING, 1)) < 0 |
1236 | #ifdef ROCKBOX | ||
1237 | ) | ||
1238 | #else | ||
1119 | || !(fd = fdopen(filedesc, BINREADMODE))) | 1239 | || !(fd = fdopen(filedesc, BINREADMODE))) |
1240 | #endif | ||
1120 | { | 1241 | { |
1121 | error("%s: can't open", filename->s_name); | 1242 | error("%s: can't open", filename->s_name); |
1122 | return; | 1243 | return; |
1123 | } | 1244 | } |
1124 | if (skip) | 1245 | if (skip) |
1125 | { | 1246 | { |
1247 | #ifdef ROCKBOX | ||
1248 | long pos = lseek(fd, (long)skip, SEEK_SET); | ||
1249 | #else | ||
1126 | long pos = fseek(fd, (long)skip, SEEK_SET); | 1250 | long pos = fseek(fd, (long)skip, SEEK_SET); |
1251 | #endif | ||
1127 | if (pos < 0) | 1252 | if (pos < 0) |
1128 | { | 1253 | { |
1129 | error("%s: can't seek to byte %d", buf, skip); | 1254 | error("%s: can't seek to byte %d", buf, skip); |
1255 | #ifdef ROCKBOX | ||
1256 | close(fd); | ||
1257 | #else | ||
1130 | fclose(fd); | 1258 | fclose(fd); |
1259 | #endif | ||
1131 | return; | 1260 | return; |
1132 | } | 1261 | } |
1133 | } | 1262 | } |
1134 | 1263 | ||
1135 | for (i = 0; i < nelem; i++) | 1264 | for (i = 0; i < nelem; i++) |
1136 | { | 1265 | { |
1266 | #ifdef ROCKBOX | ||
1267 | if(read(fd, &s, sizeof(s)) < 1) | ||
1268 | #else | ||
1137 | if (fread(&s, sizeof(s), 1, fd) < 1) | 1269 | if (fread(&s, sizeof(s), 1, fd) < 1) |
1270 | #endif | ||
1138 | { | 1271 | { |
1139 | post("%s: read %d elements into table of size %d", | 1272 | post("%s: read %d elements into table of size %d", |
1140 | filename->s_name, i, nelem); | 1273 | filename->s_name, i, nelem); |
@@ -1144,13 +1277,21 @@ static void garray_read16(t_garray *x, t_symbol *filename, | |||
1144 | vec[i] = s * (1./32768.); | 1277 | vec[i] = s * (1./32768.); |
1145 | } | 1278 | } |
1146 | while (i < nelem) vec[i++] = 0; | 1279 | while (i < nelem) vec[i++] = 0; |
1280 | #ifdef ROCKBOX | ||
1281 | close(fd); | ||
1282 | #else | ||
1147 | fclose(fd); | 1283 | fclose(fd); |
1284 | #endif | ||
1148 | garray_redraw(x); | 1285 | garray_redraw(x); |
1149 | } | 1286 | } |
1150 | 1287 | ||
1151 | static void garray_write(t_garray *x, t_symbol *filename) | 1288 | static void garray_write(t_garray *x, t_symbol *filename) |
1152 | { | 1289 | { |
1290 | #ifdef ROCKBOX | ||
1291 | int fd; | ||
1292 | #else | ||
1153 | FILE *fd; | 1293 | FILE *fd; |
1294 | #endif | ||
1154 | char buf[MAXPDSTRING]; | 1295 | char buf[MAXPDSTRING]; |
1155 | t_template *template = garray_template(x); | 1296 | t_template *template = garray_template(x); |
1156 | int yonset, type, i; | 1297 | int yonset, type, i; |
@@ -1164,21 +1305,33 @@ static void garray_write(t_garray *x, t_symbol *filename) | |||
1164 | canvas_makefilename(glist_getcanvas(x->x_glist), filename->s_name, | 1305 | canvas_makefilename(glist_getcanvas(x->x_glist), filename->s_name, |
1165 | buf, MAXPDSTRING); | 1306 | buf, MAXPDSTRING); |
1166 | sys_bashfilename(buf, buf); | 1307 | sys_bashfilename(buf, buf); |
1308 | #ifdef ROCKBOX | ||
1309 | if(!(fd = open(buf, O_WRONLY|O_CREAT|O_TRUNC))) | ||
1310 | #else | ||
1167 | if (!(fd = fopen(buf, "w"))) | 1311 | if (!(fd = fopen(buf, "w"))) |
1312 | #endif | ||
1168 | { | 1313 | { |
1169 | error("%s: can't create", buf); | 1314 | error("%s: can't create", buf); |
1170 | return; | 1315 | return; |
1171 | } | 1316 | } |
1172 | for (i = 0; i < x->x_n; i++) | 1317 | for (i = 0; i < x->x_n; i++) |
1173 | { | 1318 | { |
1319 | #ifdef ROCKBOX | ||
1320 | if(rb_fprintf_f(fd, | ||
1321 | #else /* ROCKBOX */ | ||
1174 | if (fprintf(fd, "%g\n", | 1322 | if (fprintf(fd, "%g\n", |
1323 | #endif /* ROCKBOX */ | ||
1175 | *(float *)((x->x_vec + sizeof(t_word) * i) + yonset)) < 1) | 1324 | *(float *)((x->x_vec + sizeof(t_word) * i) + yonset)) < 1) |
1176 | { | 1325 | { |
1177 | post("%s: write error", filename->s_name); | 1326 | post("%s: write error", filename->s_name); |
1178 | break; | 1327 | break; |
1179 | } | 1328 | } |
1180 | } | 1329 | } |
1330 | #ifdef ROCKBOX | ||
1331 | close(fd); | ||
1332 | #else | ||
1181 | fclose(fd); | 1333 | fclose(fd); |
1334 | #endif | ||
1182 | } | 1335 | } |
1183 | 1336 | ||
1184 | static unsigned char waveheader[] = { | 1337 | static unsigned char waveheader[] = { |
@@ -1203,7 +1356,11 @@ static void garray_write16(t_garray *x, t_symbol *filename, t_symbol *format) | |||
1203 | t_template *template = garray_template(x); | 1356 | t_template *template = garray_template(x); |
1204 | int yonset, type, i; | 1357 | int yonset, type, i; |
1205 | t_symbol *arraytype; | 1358 | t_symbol *arraytype; |
1359 | #ifdef ROCKBOX | ||
1360 | int fd; | ||
1361 | #else | ||
1206 | FILE *fd; | 1362 | FILE *fd; |
1363 | #endif | ||
1207 | int aiff = (format == gensym("aiff")); | 1364 | int aiff = (format == gensym("aiff")); |
1208 | char filenamebuf[MAXPDSTRING], buf2[MAXPDSTRING]; | 1365 | char filenamebuf[MAXPDSTRING], buf2[MAXPDSTRING]; |
1209 | int swap = garray_ambigendian(); /* wave is only little endian */ | 1366 | int swap = garray_ambigendian(); /* wave is only little endian */ |
@@ -1230,7 +1387,11 @@ static void garray_write16(t_garray *x, t_symbol *filename, t_symbol *format) | |||
1230 | canvas_makefilename(glist_getcanvas(x->x_glist), filenamebuf, | 1387 | canvas_makefilename(glist_getcanvas(x->x_glist), filenamebuf, |
1231 | buf2, MAXPDSTRING); | 1388 | buf2, MAXPDSTRING); |
1232 | sys_bashfilename(buf2, buf2); | 1389 | sys_bashfilename(buf2, buf2); |
1390 | #ifdef ROCKBOX | ||
1391 | if(!(fd = open(buf2, O_WRONLY|O_CREAT|O_TRUNC))) | ||
1392 | #else | ||
1233 | if (!(fd = fopen(buf2, BINWRITEMODE))) | 1393 | if (!(fd = fopen(buf2, BINWRITEMODE))) |
1394 | #endif | ||
1234 | { | 1395 | { |
1235 | error("%s: can't create", buf2); | 1396 | error("%s: can't create", buf2); |
1236 | return; | 1397 | return; |
@@ -1251,7 +1412,11 @@ static void garray_write16(t_garray *x, t_symbol *filename, t_symbol *format) | |||
1251 | xxx = foo[1]; foo[1] = foo[2]; foo[2] = xxx; | 1412 | xxx = foo[1]; foo[1] = foo[2]; foo[2] = xxx; |
1252 | } | 1413 | } |
1253 | memcpy((void *)(waveheader + 40), (void *)(&intbuf), 4); | 1414 | memcpy((void *)(waveheader + 40), (void *)(&intbuf), 4); |
1415 | #ifdef ROCKBOX | ||
1416 | if(write(fd, waveheader, sizeof(waveheader)) < 1) | ||
1417 | #else | ||
1254 | if (fwrite(waveheader, sizeof(waveheader), 1, fd) < 1) | 1418 | if (fwrite(waveheader, sizeof(waveheader), 1, fd) < 1) |
1419 | #endif | ||
1255 | { | 1420 | { |
1256 | post("%s: write error", buf2); | 1421 | post("%s: write error", buf2); |
1257 | goto closeit; | 1422 | goto closeit; |
@@ -1268,21 +1433,31 @@ static void garray_write16(t_garray *x, t_symbol *filename, t_symbol *format) | |||
1268 | unsigned char *foo = (unsigned char *)&sh, xxx; | 1433 | unsigned char *foo = (unsigned char *)&sh, xxx; |
1269 | xxx = foo[0]; foo[0] = foo[1]; foo[1] = xxx; | 1434 | xxx = foo[0]; foo[0] = foo[1]; foo[1] = xxx; |
1270 | } | 1435 | } |
1436 | #ifdef ROCKBOX | ||
1437 | if(write(fd, &sh, sizeof(sh)) < 1) | ||
1438 | #else | ||
1271 | if (fwrite(&sh, sizeof(sh), 1, fd) < 1) | 1439 | if (fwrite(&sh, sizeof(sh), 1, fd) < 1) |
1440 | #endif | ||
1272 | { | 1441 | { |
1273 | post("%s: write error", buf2); | 1442 | post("%s: write error", buf2); |
1274 | goto closeit; | 1443 | goto closeit; |
1275 | } | 1444 | } |
1276 | } | 1445 | } |
1277 | closeit: | 1446 | closeit: |
1447 | #ifdef ROCKBOX | ||
1448 | close(fd); | ||
1449 | #else | ||
1278 | fclose(fd); | 1450 | fclose(fd); |
1451 | #endif | ||
1279 | } | 1452 | } |
1280 | 1453 | ||
1281 | void garray_resize(t_garray *x, t_floatarg f) | 1454 | void garray_resize(t_garray *x, t_floatarg f) |
1282 | { | 1455 | { |
1283 | int was = x->x_n, elemsize; | 1456 | int was = x->x_n, elemsize; |
1284 | t_glist *gl; | 1457 | t_glist *gl; |
1458 | #ifndef ROCKBOX | ||
1285 | int dspwas; | 1459 | int dspwas; |
1460 | #endif | ||
1286 | int n = f; | 1461 | int n = f; |
1287 | char *nvec; | 1462 | char *nvec; |
1288 | 1463 | ||
@@ -1309,7 +1484,9 @@ void garray_resize(t_garray *x, t_floatarg f) | |||
1309 | vmess(&gl->gl_pd, gensym("bounds"), "ffff", | 1484 | vmess(&gl->gl_pd, gensym("bounds"), "ffff", |
1310 | 0., gl->gl_y1, (double)(n > 1 ? n-1 : 1), gl->gl_y2); | 1485 | 0., gl->gl_y1, (double)(n > 1 ? n-1 : 1), gl->gl_y2); |
1311 | /* close any dialogs that might have the wrong info now... */ | 1486 | /* close any dialogs that might have the wrong info now... */ |
1487 | #ifndef ROCKBOX | ||
1312 | gfxstub_deleteforkey(gl); | 1488 | gfxstub_deleteforkey(gl); |
1489 | #endif | ||
1313 | } | 1490 | } |
1314 | else garray_redraw(x); | 1491 | else garray_redraw(x); |
1315 | if (x->x_usedindsp) canvas_update_dsp(); | 1492 | if (x->x_usedindsp) canvas_update_dsp(); |
diff --git a/apps/plugins/pdbox/PDa/src/g_bang.c b/apps/plugins/pdbox/PDa/src/g_bang.c index 6556f7019a..ce1bed9c9a 100644 --- a/apps/plugins/pdbox/PDa/src/g_bang.c +++ b/apps/plugins/pdbox/PDa/src/g_bang.c | |||
@@ -5,7 +5,13 @@ | |||
5 | /* g_7_guis.c written by Thomas Musil (c) IEM KUG Graz Austria 2000-2001 */ | 5 | /* g_7_guis.c written by Thomas Musil (c) IEM KUG Graz Austria 2000-2001 */ |
6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ | 6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ |
7 | 7 | ||
8 | 8 | #ifdef ROCKBOX | |
9 | #include "plugin.h" | ||
10 | #include "pdbox.h" | ||
11 | #include "m_pd.h" | ||
12 | #include "g_canvas.h" | ||
13 | #include "g_all_guis.h" | ||
14 | #else /* ROCKBOX */ | ||
9 | #include <stdlib.h> | 15 | #include <stdlib.h> |
10 | #include <string.h> | 16 | #include <string.h> |
11 | #include <stdio.h> | 17 | #include <stdio.h> |
@@ -21,6 +27,7 @@ | |||
21 | #else | 27 | #else |
22 | #include <unistd.h> | 28 | #include <unistd.h> |
23 | #endif | 29 | #endif |
30 | #endif /* ROCKBOX */ | ||
24 | 31 | ||
25 | 32 | ||
26 | /* --------------- bng gui-bang ------------------------- */ | 33 | /* --------------- bng gui-bang ------------------------- */ |
@@ -33,15 +40,24 @@ static t_class *bng_class; | |||
33 | 40 | ||
34 | void bng_draw_update(t_bng *x, t_glist *glist) | 41 | void bng_draw_update(t_bng *x, t_glist *glist) |
35 | { | 42 | { |
43 | #ifdef ROCKBOX | ||
44 | (void) x; | ||
45 | (void) glist; | ||
46 | #else /* ROCKBOX */ | ||
36 | if(glist_isvisible(glist)) | 47 | if(glist_isvisible(glist)) |
37 | { | 48 | { |
38 | sys_vgui(".x%x.c itemconfigure %xBUT -fill #%6.6x\n", glist_getcanvas(glist), x, | 49 | sys_vgui(".x%x.c itemconfigure %xBUT -fill #%6.6x\n", glist_getcanvas(glist), x, |
39 | x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol); | 50 | x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol); |
40 | } | 51 | } |
52 | #endif /* ROCKBOX */ | ||
41 | } | 53 | } |
42 | 54 | ||
43 | void bng_draw_new(t_bng *x, t_glist *glist) | 55 | void bng_draw_new(t_bng *x, t_glist *glist) |
44 | { | 56 | { |
57 | #ifdef ROCKBOX | ||
58 | (void) x; | ||
59 | (void) glist; | ||
60 | #else /* ROCKBOX */ | ||
45 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 61 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
46 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 62 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
47 | t_canvas *canvas=glist_getcanvas(glist); | 63 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -69,10 +85,15 @@ void bng_draw_new(t_bng *x, t_glist *glist) | |||
69 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xIN%d\n", | 85 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xIN%d\n", |
70 | canvas, xpos, ypos, | 86 | canvas, xpos, ypos, |
71 | xpos + IOWIDTH, ypos+1, x, 0); | 87 | xpos + IOWIDTH, ypos+1, x, 0); |
88 | #endif /* ROCKBOX */ | ||
72 | } | 89 | } |
73 | 90 | ||
74 | void bng_draw_move(t_bng *x, t_glist *glist) | 91 | void bng_draw_move(t_bng *x, t_glist *glist) |
75 | { | 92 | { |
93 | #ifdef ROCKBOX | ||
94 | (void) x; | ||
95 | (void) glist; | ||
96 | #else /* ROCKBOX */ | ||
76 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 97 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
77 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 98 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
78 | t_canvas *canvas=glist_getcanvas(glist); | 99 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -96,10 +117,15 @@ void bng_draw_move(t_bng *x, t_glist *glist) | |||
96 | sys_vgui(".x%x.c coords %xIN%d %d %d %d %d\n", | 117 | sys_vgui(".x%x.c coords %xIN%d %d %d %d %d\n", |
97 | canvas, x, 0, xpos, ypos, | 118 | canvas, x, 0, xpos, ypos, |
98 | xpos + IOWIDTH, ypos+1); | 119 | xpos + IOWIDTH, ypos+1); |
120 | #endif /* ROCKBOX */ | ||
99 | } | 121 | } |
100 | 122 | ||
101 | void bng_draw_erase(t_bng* x, t_glist* glist) | 123 | void bng_draw_erase(t_bng* x, t_glist* glist) |
102 | { | 124 | { |
125 | #ifdef ROCKBOX | ||
126 | (void) x; | ||
127 | (void) glist; | ||
128 | #else /* ROCKBOX */ | ||
103 | t_canvas *canvas=glist_getcanvas(glist); | 129 | t_canvas *canvas=glist_getcanvas(glist); |
104 | 130 | ||
105 | sys_vgui(".x%x.c delete %xBASE\n", canvas, x); | 131 | sys_vgui(".x%x.c delete %xBASE\n", canvas, x); |
@@ -109,10 +135,15 @@ void bng_draw_erase(t_bng* x, t_glist* glist) | |||
109 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); | 135 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); |
110 | if(!x->x_gui.x_fsf.x_rcv_able) | 136 | if(!x->x_gui.x_fsf.x_rcv_able) |
111 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 137 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
138 | #endif /* ROCKBOX */ | ||
112 | } | 139 | } |
113 | 140 | ||
114 | void bng_draw_config(t_bng* x, t_glist* glist) | 141 | void bng_draw_config(t_bng* x, t_glist* glist) |
115 | { | 142 | { |
143 | #ifdef ROCKBOX | ||
144 | (void) x; | ||
145 | (void) glist; | ||
146 | #else /* ROCKBOX */ | ||
116 | t_canvas *canvas=glist_getcanvas(glist); | 147 | t_canvas *canvas=glist_getcanvas(glist); |
117 | 148 | ||
118 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", | 149 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", |
@@ -122,10 +153,16 @@ void bng_draw_config(t_bng* x, t_glist* glist) | |||
122 | sys_vgui(".x%x.c itemconfigure %xBASE -fill #%6.6x\n", canvas, x, x->x_gui.x_bcol); | 153 | sys_vgui(".x%x.c itemconfigure %xBASE -fill #%6.6x\n", canvas, x, x->x_gui.x_bcol); |
123 | sys_vgui(".x%x.c itemconfigure %xBUT -fill #%6.6x\n", canvas, x, | 154 | sys_vgui(".x%x.c itemconfigure %xBUT -fill #%6.6x\n", canvas, x, |
124 | x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol); | 155 | x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol); |
156 | #endif /* ROCKBOX */ | ||
125 | } | 157 | } |
126 | 158 | ||
127 | void bng_draw_io(t_bng* x, t_glist* glist, int old_snd_rcv_flags) | 159 | void bng_draw_io(t_bng* x, t_glist* glist, int old_snd_rcv_flags) |
128 | { | 160 | { |
161 | #ifdef ROCKBOX | ||
162 | (void) x; | ||
163 | (void) glist; | ||
164 | (void) old_snd_rcv_flags; | ||
165 | #else /* ROCKBOX */ | ||
129 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 166 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
130 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 167 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
131 | t_canvas *canvas=glist_getcanvas(glist); | 168 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -143,10 +180,15 @@ void bng_draw_io(t_bng* x, t_glist* glist, int old_snd_rcv_flags) | |||
143 | xpos + IOWIDTH, ypos+1, x, 0); | 180 | xpos + IOWIDTH, ypos+1, x, 0); |
144 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) | 181 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) |
145 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 182 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
183 | #endif /* ROCKBOX */ | ||
146 | } | 184 | } |
147 | 185 | ||
148 | void bng_draw_select(t_bng* x, t_glist* glist) | 186 | void bng_draw_select(t_bng* x, t_glist* glist) |
149 | { | 187 | { |
188 | #ifdef ROCKBOX | ||
189 | (void) x; | ||
190 | (void) glist; | ||
191 | #else /* ROCKBOX */ | ||
150 | t_canvas *canvas=glist_getcanvas(glist); | 192 | t_canvas *canvas=glist_getcanvas(glist); |
151 | 193 | ||
152 | if(x->x_gui.x_fsf.x_selected) | 194 | if(x->x_gui.x_fsf.x_selected) |
@@ -161,6 +203,7 @@ void bng_draw_select(t_bng* x, t_glist* glist) | |||
161 | sys_vgui(".x%x.c itemconfigure %xBUT -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL); | 203 | sys_vgui(".x%x.c itemconfigure %xBUT -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL); |
162 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol); | 204 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol); |
163 | } | 205 | } |
206 | #endif /* ROCKBOX */ | ||
164 | } | 207 | } |
165 | 208 | ||
166 | void bng_draw(t_bng *x, t_glist *glist, int mode) | 209 | void bng_draw(t_bng *x, t_glist *glist, int mode) |
@@ -232,6 +275,10 @@ void bng_check_minmax(t_bng *x, int ftbreak, int fthold) | |||
232 | 275 | ||
233 | static void bng_properties(t_gobj *z, t_glist *owner) | 276 | static void bng_properties(t_gobj *z, t_glist *owner) |
234 | { | 277 | { |
278 | #ifdef ROCKBOX | ||
279 | (void) z; | ||
280 | (void) owner; | ||
281 | #else /* ROCKBOX */ | ||
235 | t_bng *x = (t_bng *)z; | 282 | t_bng *x = (t_bng *)z; |
236 | char buf[800]; | 283 | char buf[800]; |
237 | t_symbol *srl[3]; | 284 | t_symbol *srl[3]; |
@@ -253,6 +300,7 @@ static void bng_properties(t_gobj *z, t_glist *owner) | |||
253 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, | 300 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, |
254 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol); | 301 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol); |
255 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); | 302 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); |
303 | #endif /* ROCKBOX */ | ||
256 | } | 304 | } |
257 | 305 | ||
258 | static void bng_set(t_bng *x) | 306 | static void bng_set(t_bng *x) |
@@ -316,6 +364,9 @@ static void bng_bang2(t_bng *x)/*wird immer gesendet, wenn moeglich*/ | |||
316 | 364 | ||
317 | static void bng_dialog(t_bng *x, t_symbol *s, int argc, t_atom *argv) | 365 | static void bng_dialog(t_bng *x, t_symbol *s, int argc, t_atom *argv) |
318 | { | 366 | { |
367 | #ifdef ROCKBOX | ||
368 | (void) s; | ||
369 | #endif | ||
319 | t_symbol *srl[3]; | 370 | t_symbol *srl[3]; |
320 | int a = (int)atom_getintarg(0, argc, argv); | 371 | int a = (int)atom_getintarg(0, argc, argv); |
321 | int fthold = (int)atom_getintarg(2, argc, argv); | 372 | int fthold = (int)atom_getintarg(2, argc, argv); |
@@ -333,33 +384,84 @@ static void bng_dialog(t_bng *x, t_symbol *s, int argc, t_atom *argv) | |||
333 | 384 | ||
334 | static void bng_click(t_bng *x, t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, t_floatarg alt) | 385 | static void bng_click(t_bng *x, t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, t_floatarg alt) |
335 | { | 386 | { |
387 | #ifdef ROCKBOX | ||
388 | (void) xpos; | ||
389 | (void) ypos; | ||
390 | (void) shift; | ||
391 | (void) ctrl; | ||
392 | (void) alt; | ||
393 | #endif | ||
336 | bng_set(x); | 394 | bng_set(x); |
337 | bng_bout2(x); | 395 | bng_bout2(x); |
338 | } | 396 | } |
339 | 397 | ||
340 | static int bng_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) | 398 | static int bng_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) |
341 | { | 399 | { |
400 | #ifdef ROCKBOX | ||
401 | (void) glist; | ||
402 | (void) dbl; | ||
403 | #endif | ||
342 | if(doit) | 404 | if(doit) |
343 | bng_click((t_bng *)z, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, 0, (t_floatarg)alt); | 405 | bng_click((t_bng *)z, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, 0, (t_floatarg)alt); |
344 | return (1); | 406 | return (1); |
345 | } | 407 | } |
346 | 408 | ||
347 | static void bng_float(t_bng *x, t_floatarg f) | 409 | static void bng_float(t_bng *x, t_floatarg f) |
410 | #ifdef ROCKBOX | ||
411 | { | ||
412 | (void) f; | ||
413 | |||
414 | bng_bang2(x); | ||
415 | } | ||
416 | #else /* ROCKBOX */ | ||
348 | {bng_bang2(x);} | 417 | {bng_bang2(x);} |
418 | #endif /* ROCKBOX */ | ||
349 | 419 | ||
350 | static void bng_symbol(t_bng *x, t_symbol *s) | 420 | static void bng_symbol(t_bng *x, t_symbol *s) |
421 | #ifdef ROCKBOX | ||
422 | { | ||
423 | (void) s; | ||
424 | |||
425 | bng_bang2(x); | ||
426 | } | ||
427 | #else /* ROCKBOX */ | ||
351 | {bng_bang2(x);} | 428 | {bng_bang2(x);} |
429 | #endif /* ROCKBOX */ | ||
352 | 430 | ||
353 | static void bng_pointer(t_bng *x, t_gpointer *gp) | 431 | static void bng_pointer(t_bng *x, t_gpointer *gp) |
432 | #ifdef ROCKBOX | ||
433 | { | ||
434 | (void) gp; | ||
435 | |||
436 | bng_bang2(x); | ||
437 | } | ||
438 | #else /* ROCKBOX */ | ||
354 | {bng_bang2(x);} | 439 | {bng_bang2(x);} |
440 | #endif /* ROCKBOX */ | ||
355 | 441 | ||
356 | static void bng_list(t_bng *x, t_symbol *s, int ac, t_atom *av) | 442 | static void bng_list(t_bng *x, t_symbol *s, int ac, t_atom *av) |
357 | { | 443 | { |
444 | #ifdef ROCKBOX | ||
445 | (void) s; | ||
446 | (void) ac; | ||
447 | (void) av; | ||
448 | #endif /* ROCKBOX */ | ||
449 | |||
358 | bng_bang2(x); | 450 | bng_bang2(x); |
359 | } | 451 | } |
360 | 452 | ||
361 | static void bng_anything(t_bng *x, t_symbol *s, int argc, t_atom *argv) | 453 | static void bng_anything(t_bng *x, t_symbol *s, int argc, t_atom *argv) |
454 | #ifdef ROCKBOX | ||
455 | { | ||
456 | (void) s; | ||
457 | (void) argc; | ||
458 | (void) argv; | ||
459 | |||
460 | bng_bang2(x); | ||
461 | } | ||
462 | #else /* ROCKBOX */ | ||
362 | {bng_bang2(x);} | 463 | {bng_bang2(x);} |
464 | #endif /* ROCKBOX */ | ||
363 | 465 | ||
364 | static void bng_loadbang(t_bng *x) | 466 | static void bng_loadbang(t_bng *x) |
365 | { | 467 | { |
@@ -372,6 +474,9 @@ static void bng_loadbang(t_bng *x) | |||
372 | 474 | ||
373 | static void bng_size(t_bng *x, t_symbol *s, int ac, t_atom *av) | 475 | static void bng_size(t_bng *x, t_symbol *s, int ac, t_atom *av) |
374 | { | 476 | { |
477 | #ifdef ROCKBOX | ||
478 | (void) s; | ||
479 | #endif | ||
375 | x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); | 480 | x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); |
376 | x->x_gui.x_h = x->x_gui.x_w; | 481 | x->x_gui.x_h = x->x_gui.x_w; |
377 | iemgui_size((void *)x, &x->x_gui); | 482 | iemgui_size((void *)x, &x->x_gui); |
@@ -385,6 +490,9 @@ static void bng_pos(t_bng *x, t_symbol *s, int ac, t_atom *av) | |||
385 | 490 | ||
386 | static void bng_flashtime(t_bng *x, t_symbol *s, int ac, t_atom *av) | 491 | static void bng_flashtime(t_bng *x, t_symbol *s, int ac, t_atom *av) |
387 | { | 492 | { |
493 | #ifdef ROCKBOX | ||
494 | (void) s; | ||
495 | #endif | ||
388 | bng_check_minmax(x, (int)atom_getintarg(0, ac, av), | 496 | bng_check_minmax(x, (int)atom_getintarg(0, ac, av), |
389 | (int)atom_getintarg(1, ac, av)); | 497 | (int)atom_getintarg(1, ac, av)); |
390 | } | 498 | } |
@@ -437,7 +545,11 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv) | |||
437 | int fs=8; | 545 | int fs=8; |
438 | int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, | 546 | int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, |
439 | fthold=IEM_BNG_DEFAULTHOLDFLASHTIME; | 547 | fthold=IEM_BNG_DEFAULTHOLDFLASHTIME; |
548 | #ifdef ROCKBOX | ||
549 | (void) s; | ||
550 | #else | ||
440 | char str[144]; | 551 | char str[144]; |
552 | #endif | ||
441 | 553 | ||
442 | iem_inttosymargs(&x->x_gui.x_isa, 0); | 554 | iem_inttosymargs(&x->x_gui.x_isa, 0); |
443 | iem_inttofstyle(&x->x_gui.x_fsf, 0); | 555 | iem_inttofstyle(&x->x_gui.x_fsf, 0); |
@@ -511,7 +623,9 @@ static void bng_ff(t_bng *x) | |||
511 | clock_free(x->x_clock_lck); | 623 | clock_free(x->x_clock_lck); |
512 | clock_free(x->x_clock_brk); | 624 | clock_free(x->x_clock_brk); |
513 | clock_free(x->x_clock_hld); | 625 | clock_free(x->x_clock_hld); |
626 | #ifndef ROCKBOX | ||
514 | gfxstub_deleteforkey(x); | 627 | gfxstub_deleteforkey(x); |
628 | #endif | ||
515 | } | 629 | } |
516 | 630 | ||
517 | void g_bang_setup(void) | 631 | void g_bang_setup(void) |
diff --git a/apps/plugins/pdbox/PDa/src/g_canvas.c b/apps/plugins/pdbox/PDa/src/g_canvas.c index f8b8dda0cf..19c10474c1 100644 --- a/apps/plugins/pdbox/PDa/src/g_canvas.c +++ b/apps/plugins/pdbox/PDa/src/g_canvas.c | |||
@@ -18,6 +18,15 @@ to be different but are now unified except for some fossilized names.) */ | |||
18 | * changes marked with IOhannes | 18 | * changes marked with IOhannes |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifdef ROCKBOX | ||
22 | #include "plugin.h" | ||
23 | #include "pdbox.h" | ||
24 | #include "m_pd.h" | ||
25 | #include "m_imp.h" | ||
26 | #include "s_stuff.h" | ||
27 | #include "g_canvas.h" | ||
28 | #include "g_all_guis.h" | ||
29 | #else /* ROCKBOX */ | ||
21 | #include <stdlib.h> | 30 | #include <stdlib.h> |
22 | #include <stdio.h> | 31 | #include <stdio.h> |
23 | #include "m_pd.h" | 32 | #include "m_pd.h" |
@@ -26,6 +35,7 @@ to be different but are now unified except for some fossilized names.) */ | |||
26 | #include "g_canvas.h" | 35 | #include "g_canvas.h" |
27 | #include <string.h> | 36 | #include <string.h> |
28 | #include "g_all_guis.h" | 37 | #include "g_all_guis.h" |
38 | #endif /* ROCKBOX */ | ||
29 | 39 | ||
30 | struct _canvasenvironment | 40 | struct _canvasenvironment |
31 | { | 41 | { |
@@ -83,7 +93,12 @@ static void glist_doupdatewindowlist(t_glist *gl, char *sbuf) | |||
83 | if (strlen(sbuf) + strlen(gl->gl_name->s_name) + 100 <= 1024) | 93 | if (strlen(sbuf) + strlen(gl->gl_name->s_name) + 100 <= 1024) |
84 | { | 94 | { |
85 | char tbuf[1024]; | 95 | char tbuf[1024]; |
96 | #ifdef ROCKBOX | ||
97 | snprintf(tbuf, sizeof(tbuf)-1, | ||
98 | "{%s .x%x} ", gl->gl_name->s_name, (t_int)canvas); | ||
99 | #else /* ROCKBOX */ | ||
86 | sprintf(tbuf, "{%s .x%x} ", gl->gl_name->s_name, (t_int)canvas); | 100 | sprintf(tbuf, "{%s .x%x} ", gl->gl_name->s_name, (t_int)canvas); |
101 | #endif /* ROCKBOX */ | ||
87 | strcat(sbuf, tbuf); | 102 | strcat(sbuf, tbuf); |
88 | } | 103 | } |
89 | } | 104 | } |
@@ -107,7 +122,9 @@ void canvas_updatewindowlist( void) | |||
107 | glist_doupdatewindowlist(x, sbuf); | 122 | glist_doupdatewindowlist(x, sbuf); |
108 | /* next line updates the window menu state before -postcommand tries it */ | 123 | /* next line updates the window menu state before -postcommand tries it */ |
109 | strcat(sbuf, "}\npdtk_fixwindowmenu\n"); | 124 | strcat(sbuf, "}\npdtk_fixwindowmenu\n"); |
125 | #ifndef ROCKBOX | ||
110 | sys_gui(sbuf); | 126 | sys_gui(sbuf); |
127 | #endif | ||
111 | } | 128 | } |
112 | 129 | ||
113 | /* add a glist the list of "root" canvases (toplevels without parents.) */ | 130 | /* add a glist the list of "root" canvases (toplevels without parents.) */ |
@@ -144,6 +161,9 @@ void canvas_setargs(int argc, t_atom *argv) | |||
144 | 161 | ||
145 | void glob_setfilename(void *dummy, t_symbol *filesym, t_symbol *dirsym) | 162 | void glob_setfilename(void *dummy, t_symbol *filesym, t_symbol *dirsym) |
146 | { | 163 | { |
164 | #ifdef ROCKBOX | ||
165 | (void) dummy; | ||
166 | #endif | ||
147 | canvas_newfilename = filesym; | 167 | canvas_newfilename = filesym; |
148 | canvas_newdirectory = dirsym; | 168 | canvas_newdirectory = dirsym; |
149 | } | 169 | } |
@@ -286,7 +306,7 @@ t_outconnect *linetraverser_next(t_linetraverser *t) | |||
286 | if (!t->tr_ob) y = t->tr_x->gl_list; | 306 | if (!t->tr_ob) y = t->tr_x->gl_list; |
287 | else y = t->tr_ob->ob_g.g_next; | 307 | else y = t->tr_ob->ob_g.g_next; |
288 | for (; y; y = y->g_next) | 308 | for (; y; y = y->g_next) |
289 | if (ob = pd_checkobject(&y->g_pd)) break; | 309 | if((ob = pd_checkobject(&y->g_pd))) break; |
290 | if (!ob) return (0); | 310 | if (!ob) return (0); |
291 | t->tr_ob = ob; | 311 | t->tr_ob = ob; |
292 | t->tr_nout = obj_noutlets(ob); | 312 | t->tr_nout = obj_noutlets(ob); |
@@ -357,7 +377,13 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) | |||
357 | t_symbol *s = &s_; | 377 | t_symbol *s = &s_; |
358 | int vis = 0, width = GLIST_DEFCANVASWIDTH, height = GLIST_DEFCANVASHEIGHT; | 378 | int vis = 0, width = GLIST_DEFCANVASWIDTH, height = GLIST_DEFCANVASHEIGHT; |
359 | int xloc = 0, yloc = GLIST_DEFCANVASYLOC; | 379 | int xloc = 0, yloc = GLIST_DEFCANVASYLOC; |
380 | #ifdef ROCKBOX | ||
381 | (void) dummy; | ||
382 | (void) sel; | ||
383 | int font = 10; | ||
384 | #else /* ROCKBOX */ | ||
360 | int font = (owner ? owner->gl_font : sys_defaultfont); | 385 | int font = (owner ? owner->gl_font : sys_defaultfont); |
386 | #endif /* ROCKBOX */ | ||
361 | glist_init(x); | 387 | glist_init(x); |
362 | x->gl_obj.te_type = T_OBJECT; | 388 | x->gl_obj.te_type = T_OBJECT; |
363 | if (!owner) | 389 | if (!owner) |
@@ -415,7 +441,11 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) | |||
415 | x->gl_loading = 1; | 441 | x->gl_loading = 1; |
416 | x->gl_willvis = vis; | 442 | x->gl_willvis = vis; |
417 | x->gl_edit = !strncmp(x->gl_name->s_name, "Untitled", 8); | 443 | x->gl_edit = !strncmp(x->gl_name->s_name, "Untitled", 8); |
444 | #ifdef ROCKBOX | ||
445 | x->gl_font = 10; | ||
446 | #else /* ROCKBOX */ | ||
418 | x->gl_font = sys_nearestfontsize(font); | 447 | x->gl_font = sys_nearestfontsize(font); |
448 | #endif /* ROCKBOX */ | ||
419 | pd_pushsym(&x->gl_pd); | 449 | pd_pushsym(&x->gl_pd); |
420 | return(x); | 450 | return(x); |
421 | } | 451 | } |
@@ -424,6 +454,9 @@ void canvas_setgraph(t_glist *x, int flag); | |||
424 | 454 | ||
425 | static void canvas_coords(t_glist *x, t_symbol *s, int argc, t_atom *argv) | 455 | static void canvas_coords(t_glist *x, t_symbol *s, int argc, t_atom *argv) |
426 | { | 456 | { |
457 | #ifdef ROCKBOX | ||
458 | (void) s; | ||
459 | #endif | ||
427 | x->gl_x1 = atom_getfloatarg(0, argc, argv); | 460 | x->gl_x1 = atom_getfloatarg(0, argc, argv); |
428 | x->gl_y1 = atom_getfloatarg(1, argc, argv); | 461 | x->gl_y1 = atom_getfloatarg(1, argc, argv); |
429 | x->gl_x2 = atom_getfloatarg(2, argc, argv); | 462 | x->gl_x2 = atom_getfloatarg(2, argc, argv); |
@@ -449,7 +482,11 @@ t_glist *glist_addglist(t_glist *g, t_symbol *sym, | |||
449 | if (!*sym->s_name) | 482 | if (!*sym->s_name) |
450 | { | 483 | { |
451 | char buf[40]; | 484 | char buf[40]; |
485 | #ifdef ROCKBOX | ||
486 | snprintf(buf, sizeof(buf)-1, "graph%d", ++gcount); | ||
487 | #else /* ROCKBOX */ | ||
452 | sprintf(buf, "graph%d", ++gcount); | 488 | sprintf(buf, "graph%d", ++gcount); |
489 | #endif /* ROCKBOX */ | ||
453 | sym = gensym(buf); | 490 | sym = gensym(buf); |
454 | menu = 1; | 491 | menu = 1; |
455 | } | 492 | } |
@@ -484,8 +521,12 @@ t_glist *glist_addglist(t_glist *g, t_symbol *sym, | |||
484 | x->gl_obj.te_ypix = py1; | 521 | x->gl_obj.te_ypix = py1; |
485 | x->gl_pixwidth = px2 - px1; | 522 | x->gl_pixwidth = px2 - px1; |
486 | x->gl_pixheight = py2 - py1; | 523 | x->gl_pixheight = py2 - py1; |
524 | #ifdef ROCKBOX | ||
525 | x->gl_font = 10; | ||
526 | #else /* ROCKBOX */ | ||
487 | x->gl_font = (canvas_getcurrent() ? | 527 | x->gl_font = (canvas_getcurrent() ? |
488 | canvas_getcurrent()->gl_font : sys_defaultfont); | 528 | canvas_getcurrent()->gl_font : sys_defaultfont); |
529 | #endif /* ROCKBOX */ | ||
489 | x->gl_screenx1 = x->gl_screeny1 = 0; | 530 | x->gl_screenx1 = x->gl_screeny1 = 0; |
490 | x->gl_screenx2 = 240; | 531 | x->gl_screenx2 = 240; |
491 | x->gl_screeny2 = 300; | 532 | x->gl_screeny2 = 300; |
@@ -507,6 +548,9 @@ t_glist *glist_addglist(t_glist *g, t_symbol *sym, | |||
507 | /* call glist_addglist from a Pd message */ | 548 | /* call glist_addglist from a Pd message */ |
508 | void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv) | 549 | void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv) |
509 | { | 550 | { |
551 | #ifdef ROCKBOX | ||
552 | (void) s; | ||
553 | #endif | ||
510 | t_symbol *sym = atom_getsymbolarg(0, argc, argv); | 554 | t_symbol *sym = atom_getsymbolarg(0, argc, argv); |
511 | float x1 = atom_getfloatarg(1, argc, argv); | 555 | float x1 = atom_getfloatarg(1, argc, argv); |
512 | float y1 = atom_getfloatarg(2, argc, argv); | 556 | float y1 = atom_getfloatarg(2, argc, argv); |
@@ -584,9 +628,11 @@ void canvas_reflecttitle(t_canvas *x) | |||
584 | strcat(namebuf, ")"); | 628 | strcat(namebuf, ")"); |
585 | } | 629 | } |
586 | else namebuf[0] = 0; | 630 | else namebuf[0] = 0; |
631 | #ifndef ROCKBOX | ||
587 | sys_vgui("wm title .x%x {%s%c%s - %s}\n", | 632 | sys_vgui("wm title .x%x {%s%c%s - %s}\n", |
588 | x, x->gl_name->s_name, (x->gl_dirty? '*' : ' '), namebuf, | 633 | x, x->gl_name->s_name, (x->gl_dirty? '*' : ' '), namebuf, |
589 | canvas_getdir(x)->s_name); | 634 | canvas_getdir(x)->s_name); |
635 | #endif | ||
590 | } | 636 | } |
591 | 637 | ||
592 | void canvas_dirty(t_canvas *x, t_int n) | 638 | void canvas_dirty(t_canvas *x, t_int n) |
@@ -624,7 +670,9 @@ void canvas_map(t_canvas *x, t_floatarg f) | |||
624 | canvas_drawlines(x); | 670 | canvas_drawlines(x); |
625 | /* simulate a mouse up so u_main will calculate scrollbars... | 671 | /* simulate a mouse up so u_main will calculate scrollbars... |
626 | ugly! */ | 672 | ugly! */ |
673 | #ifndef ROCKBOX | ||
627 | sys_vgui("pdtk_canvas_mouseup .x%x.c 0 0 0\n", x); | 674 | sys_vgui("pdtk_canvas_mouseup .x%x.c 0 0 0\n", x); |
675 | #endif | ||
628 | } | 676 | } |
629 | } | 677 | } |
630 | else | 678 | else |
@@ -632,7 +680,9 @@ void canvas_map(t_canvas *x, t_floatarg f) | |||
632 | if (glist_isvisible(x)) | 680 | if (glist_isvisible(x)) |
633 | { | 681 | { |
634 | /* just clear out the whole canvas... */ | 682 | /* just clear out the whole canvas... */ |
683 | #ifndef ROCKBOX | ||
635 | sys_vgui(".x%x.c delete all\n", x); | 684 | sys_vgui(".x%x.c delete all\n", x); |
685 | #endif | ||
636 | /* alternatively, we could have erased them one by one... | 686 | /* alternatively, we could have erased them one by one... |
637 | for (y = x->gl_list; y; y = y->g_next) | 687 | for (y = x->gl_list; y; y = y->g_next) |
638 | gobj_vis(y, x, 0); | 688 | gobj_vis(y, x, 0); |
@@ -661,7 +711,11 @@ static t_editor *editor_new(t_glist *owner) | |||
661 | x->e_connectbuf = binbuf_new(); | 711 | x->e_connectbuf = binbuf_new(); |
662 | x->e_deleted = binbuf_new(); | 712 | x->e_deleted = binbuf_new(); |
663 | x->e_glist = owner; | 713 | x->e_glist = owner; |
714 | #ifdef ROCKBOX | ||
715 | snprintf(buf, sizeof(buf)-1, ".x%x", (t_int)owner); | ||
716 | #else /* ROCKBOX */ | ||
664 | sprintf(buf, ".x%x", (t_int)owner); | 717 | sprintf(buf, ".x%x", (t_int)owner); |
718 | #endif /* ROCKBOX */ | ||
665 | x->e_guiconnect = guiconnect_new(&owner->gl_pd, gensym(buf)); | 719 | x->e_guiconnect = guiconnect_new(&owner->gl_pd, gensym(buf)); |
666 | return (x); | 720 | return (x); |
667 | } | 721 | } |
@@ -689,7 +743,7 @@ void canvas_create_editor(t_glist *x, int createit) | |||
689 | { | 743 | { |
690 | x->gl_editor = editor_new(x); | 744 | x->gl_editor = editor_new(x); |
691 | for (y = x->gl_list; y; y = y->g_next) | 745 | for (y = x->gl_list; y; y = y->g_next) |
692 | if (ob = pd_checkobject(&y->g_pd)) | 746 | if((ob = pd_checkobject(&y->g_pd))) |
693 | rtext_new(x, ob); | 747 | rtext_new(x, ob); |
694 | } | 748 | } |
695 | } | 749 | } |
@@ -700,7 +754,7 @@ void canvas_create_editor(t_glist *x, int createit) | |||
700 | else | 754 | else |
701 | { | 755 | { |
702 | for (y = x->gl_list; y; y = y->g_next) | 756 | for (y = x->gl_list; y; y = y->g_next) |
703 | if (ob = pd_checkobject(&y->g_pd)) | 757 | if((ob = pd_checkobject(&y->g_pd))) |
704 | rtext_free(glist_findrtext(x, ob)); | 758 | rtext_free(glist_findrtext(x, ob)); |
705 | editor_free(x->gl_editor, x); | 759 | editor_free(x->gl_editor, x); |
706 | x->gl_editor = 0; | 760 | x->gl_editor = 0; |
@@ -717,7 +771,9 @@ void canvas_create_editor(t_glist *x, int createit) | |||
717 | the window. */ | 771 | the window. */ |
718 | void canvas_vis(t_canvas *x, t_floatarg f) | 772 | void canvas_vis(t_canvas *x, t_floatarg f) |
719 | { | 773 | { |
774 | #ifndef ROCKBOX | ||
720 | char buf[30]; | 775 | char buf[30]; |
776 | #endif | ||
721 | int flag = (f != 0); | 777 | int flag = (f != 0); |
722 | if (flag) | 778 | if (flag) |
723 | { | 779 | { |
@@ -728,19 +784,23 @@ void canvas_vis(t_canvas *x, t_floatarg f) | |||
728 | canvas_vis(x, 0); | 784 | canvas_vis(x, 0); |
729 | canvas_vis(x, 1); | 785 | canvas_vis(x, 1); |
730 | #else | 786 | #else |
787 | #ifndef ROCKBOX | ||
731 | sys_vgui("raise .x%x\n", x); | 788 | sys_vgui("raise .x%x\n", x); |
732 | sys_vgui("focus .x%x.c\n", x); | 789 | sys_vgui("focus .x%x.c\n", x); |
733 | sys_vgui("wm deiconify .x%x\n", x); | 790 | sys_vgui("wm deiconify .x%x\n", x); |
791 | #endif /* ROCKBOX */ | ||
734 | #endif | 792 | #endif |
735 | } | 793 | } |
736 | else | 794 | else |
737 | { | 795 | { |
738 | canvas_create_editor(x, 1); | 796 | canvas_create_editor(x, 1); |
797 | #ifndef ROCKBOX | ||
739 | sys_vgui("pdtk_canvas_new .x%x %d %d +%d+%d %d\n", x, | 798 | sys_vgui("pdtk_canvas_new .x%x %d %d +%d+%d %d\n", x, |
740 | (int)(x->gl_screenx2 - x->gl_screenx1), | 799 | (int)(x->gl_screenx2 - x->gl_screenx1), |
741 | (int)(x->gl_screeny2 - x->gl_screeny1), | 800 | (int)(x->gl_screeny2 - x->gl_screeny1), |
742 | (int)(x->gl_screenx1), (int)(x->gl_screeny1), | 801 | (int)(x->gl_screenx1), (int)(x->gl_screeny1), |
743 | x->gl_edit); | 802 | x->gl_edit); |
803 | #endif /* ROCKBOX */ | ||
744 | canvas_reflecttitle(x); | 804 | canvas_reflecttitle(x); |
745 | x->gl_havewindow = 1; | 805 | x->gl_havewindow = 1; |
746 | canvas_updatewindowlist(); | 806 | canvas_updatewindowlist(); |
@@ -765,10 +825,14 @@ void canvas_vis(t_canvas *x, t_floatarg f) | |||
765 | if (glist_isvisible(x)) | 825 | if (glist_isvisible(x)) |
766 | canvas_map(x, 0); | 826 | canvas_map(x, 0); |
767 | canvas_create_editor(x, 0); | 827 | canvas_create_editor(x, 0); |
828 | #ifndef ROCKBOX | ||
768 | sys_vgui("destroy .x%x\n", x); | 829 | sys_vgui("destroy .x%x\n", x); |
830 | #endif | ||
769 | for (i = 1, x2 = x; x2; x2 = x2->gl_next, i++) | 831 | for (i = 1, x2 = x; x2; x2 = x2->gl_next, i++) |
770 | ; | 832 | ; |
833 | #ifndef ROCKBOX | ||
771 | sys_vgui(".mbar.find delete %d\n", i); | 834 | sys_vgui(".mbar.find delete %d\n", i); |
835 | #endif | ||
772 | /* if we're a graph on our parent, and if the parent exists | 836 | /* if we're a graph on our parent, and if the parent exists |
773 | and is visible, show ourselves on parent. */ | 837 | and is visible, show ourselves on parent. */ |
774 | if (glist_isgraph(x) && x->gl_owner) | 838 | if (glist_isgraph(x) && x->gl_owner) |
@@ -837,7 +901,7 @@ void canvas_free(t_canvas *x) | |||
837 | if (canvas_whichfind == x) | 901 | if (canvas_whichfind == x) |
838 | canvas_whichfind = 0; | 902 | canvas_whichfind = 0; |
839 | glist_noselect(x); | 903 | glist_noselect(x); |
840 | while (y = x->gl_list) | 904 | while((y = x->gl_list)) |
841 | glist_delete(x, y); | 905 | glist_delete(x, y); |
842 | canvas_vis(x, 0); | 906 | canvas_vis(x, 0); |
843 | 907 | ||
@@ -850,7 +914,9 @@ void canvas_free(t_canvas *x) | |||
850 | } | 914 | } |
851 | canvas_resume_dsp(dspstate); | 915 | canvas_resume_dsp(dspstate); |
852 | glist_cleanup(x); | 916 | glist_cleanup(x); |
917 | #ifndef ROCKBOX | ||
853 | gfxstub_deleteforkey(x); /* probably unnecessary */ | 918 | gfxstub_deleteforkey(x); /* probably unnecessary */ |
919 | #endif | ||
854 | if (!x->gl_owner) | 920 | if (!x->gl_owner) |
855 | canvas_takeofflist(x); | 921 | canvas_takeofflist(x); |
856 | } | 922 | } |
@@ -863,12 +929,16 @@ static void canvas_drawlines(t_canvas *x) | |||
863 | t_outconnect *oc; | 929 | t_outconnect *oc; |
864 | { | 930 | { |
865 | linetraverser_start(&t, x); | 931 | linetraverser_start(&t, x); |
866 | while (oc = linetraverser_next(&t)) | 932 | while((oc = linetraverser_next(&t))) |
933 | #ifdef ROCKBOX | ||
934 | ; | ||
935 | #else /* ROCKBOX */ | ||
867 | sys_vgui(".x%x.c create line %d %d %d %d -width %d -tags l%x\n", | 936 | sys_vgui(".x%x.c create line %d %d %d %d -width %d -tags l%x\n", |
868 | glist_getcanvas(x), | 937 | glist_getcanvas(x), |
869 | t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2, | 938 | t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2, |
870 | (outlet_getsymbol(t.tr_outlet) == &s_signal ? 2:1), | 939 | (outlet_getsymbol(t.tr_outlet) == &s_signal ? 2:1), |
871 | oc); | 940 | oc); |
941 | #endif /* ROCKBOX */ | ||
872 | } | 942 | } |
873 | } | 943 | } |
874 | 944 | ||
@@ -878,13 +948,15 @@ void canvas_fixlinesfor(t_canvas *x, t_text *text) | |||
878 | t_outconnect *oc; | 948 | t_outconnect *oc; |
879 | 949 | ||
880 | linetraverser_start(&t, x); | 950 | linetraverser_start(&t, x); |
881 | while (oc = linetraverser_next(&t)) | 951 | while((oc = linetraverser_next(&t))) |
882 | { | 952 | { |
883 | if (t.tr_ob == text || t.tr_ob2 == text) | 953 | if (t.tr_ob == text || t.tr_ob2 == text) |
884 | { | 954 | { |
955 | #ifndef ROCKBOX | ||
885 | sys_vgui(".x%x.c coords l%x %d %d %d %d\n", | 956 | sys_vgui(".x%x.c coords l%x %d %d %d %d\n", |
886 | glist_getcanvas(x), oc, | 957 | glist_getcanvas(x), oc, |
887 | t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2); | 958 | t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2); |
959 | #endif | ||
888 | } | 960 | } |
889 | } | 961 | } |
890 | } | 962 | } |
@@ -895,14 +967,16 @@ void canvas_deletelinesfor(t_canvas *x, t_text *text) | |||
895 | t_linetraverser t; | 967 | t_linetraverser t; |
896 | t_outconnect *oc; | 968 | t_outconnect *oc; |
897 | linetraverser_start(&t, x); | 969 | linetraverser_start(&t, x); |
898 | while (oc = linetraverser_next(&t)) | 970 | while((oc = linetraverser_next(&t))) |
899 | { | 971 | { |
900 | if (t.tr_ob == text || t.tr_ob2 == text) | 972 | if (t.tr_ob == text || t.tr_ob2 == text) |
901 | { | 973 | { |
902 | if (x->gl_editor) | 974 | if (x->gl_editor) |
903 | { | 975 | { |
976 | #ifndef ROCKBOX | ||
904 | sys_vgui(".x%x.c delete l%x\n", | 977 | sys_vgui(".x%x.c delete l%x\n", |
905 | glist_getcanvas(x), oc); | 978 | glist_getcanvas(x), oc); |
979 | #endif | ||
906 | } | 980 | } |
907 | obj_disconnect(t.tr_ob, t.tr_outno, t.tr_ob2, t.tr_inno); | 981 | obj_disconnect(t.tr_ob, t.tr_outno, t.tr_ob2, t.tr_inno); |
908 | } | 982 | } |
@@ -916,15 +990,17 @@ void canvas_deletelinesforio(t_canvas *x, t_text *text, | |||
916 | t_linetraverser t; | 990 | t_linetraverser t; |
917 | t_outconnect *oc; | 991 | t_outconnect *oc; |
918 | linetraverser_start(&t, x); | 992 | linetraverser_start(&t, x); |
919 | while (oc = linetraverser_next(&t)) | 993 | while((oc = linetraverser_next(&t))) |
920 | { | 994 | { |
921 | if ((t.tr_ob == text && t.tr_outlet == outp) || | 995 | if ((t.tr_ob == text && t.tr_outlet == outp) || |
922 | (t.tr_ob2 == text && t.tr_inlet == inp)) | 996 | (t.tr_ob2 == text && t.tr_inlet == inp)) |
923 | { | 997 | { |
924 | if (x->gl_editor) | 998 | if (x->gl_editor) |
925 | { | 999 | { |
1000 | #ifndef ROCKBOX | ||
926 | sys_vgui(".x%x.c delete l%x\n", | 1001 | sys_vgui(".x%x.c delete l%x\n", |
927 | glist_getcanvas(x), oc); | 1002 | glist_getcanvas(x), oc); |
1003 | #endif | ||
928 | } | 1004 | } |
929 | obj_disconnect(t.tr_ob, t.tr_outno, t.tr_ob2, t.tr_inno); | 1005 | obj_disconnect(t.tr_ob, t.tr_outno, t.tr_ob2, t.tr_inno); |
930 | } | 1006 | } |
@@ -947,6 +1023,9 @@ void canvas_objfor(t_glist *gl, t_text *x, int argc, t_atom *argv); | |||
947 | void canvas_restore(t_canvas *x, t_symbol *s, int argc, t_atom *argv) | 1023 | void canvas_restore(t_canvas *x, t_symbol *s, int argc, t_atom *argv) |
948 | { /* IOhannes */ | 1024 | { /* IOhannes */ |
949 | t_pd *z; | 1025 | t_pd *z; |
1026 | #ifdef ROCKBOX | ||
1027 | (void) s; | ||
1028 | #endif | ||
950 | /* this should be unnecessary, but sometimes the canvas's name gets | 1029 | /* this should be unnecessary, but sometimes the canvas's name gets |
951 | out of sync with the owning box's argument; this fixes that */ | 1030 | out of sync with the owning box's argument; this fixes that */ |
952 | if (argc > 3) | 1031 | if (argc > 3) |
@@ -992,7 +1071,9 @@ void canvas_restore(t_canvas *x, t_symbol *s, int argc, t_atom *argv) | |||
992 | static void canvas_loadbangabstractions(t_canvas *x) | 1071 | static void canvas_loadbangabstractions(t_canvas *x) |
993 | { | 1072 | { |
994 | t_gobj *y; | 1073 | t_gobj *y; |
1074 | #ifndef ROCKBOX | ||
995 | t_symbol *s = gensym("loadbang"); | 1075 | t_symbol *s = gensym("loadbang"); |
1076 | #endif | ||
996 | for (y = x->gl_list; y; y = y->g_next) | 1077 | for (y = x->gl_list; y; y = y->g_next) |
997 | if (pd_class(&y->g_pd) == canvas_class) | 1078 | if (pd_class(&y->g_pd) == canvas_class) |
998 | { | 1079 | { |
@@ -1021,7 +1102,9 @@ void canvas_loadbangsubpatches(t_canvas *x) | |||
1021 | 1102 | ||
1022 | void canvas_loadbang(t_canvas *x) | 1103 | void canvas_loadbang(t_canvas *x) |
1023 | { | 1104 | { |
1105 | #ifndef ROCKBOX | ||
1024 | t_gobj *y; | 1106 | t_gobj *y; |
1107 | #endif | ||
1025 | canvas_loadbangabstractions(x); | 1108 | canvas_loadbangabstractions(x); |
1026 | canvas_loadbangsubpatches(x); | 1109 | canvas_loadbangsubpatches(x); |
1027 | } | 1110 | } |
@@ -1042,6 +1125,11 @@ void canvas_loadbang(t_canvas *x) | |||
1042 | static void canvas_relocate(t_canvas *x, t_symbol *canvasgeom, | 1125 | static void canvas_relocate(t_canvas *x, t_symbol *canvasgeom, |
1043 | t_symbol *topgeom) | 1126 | t_symbol *topgeom) |
1044 | { | 1127 | { |
1128 | #ifdef ROCKBOX | ||
1129 | (void) x; | ||
1130 | (void) canvasgeom; | ||
1131 | (void) topgeom; | ||
1132 | #else /* ROCKBOX */ | ||
1045 | int cxpix, cypix, cw, ch, txpix, typix, tw, th; | 1133 | int cxpix, cypix, cw, ch, txpix, typix, tw, th; |
1046 | if (sscanf(canvasgeom->s_name, "%dx%d+%d+%d", &cw, &ch, &cxpix, &cypix) | 1134 | if (sscanf(canvasgeom->s_name, "%dx%d+%d+%d", &cw, &ch, &cxpix, &cypix) |
1047 | < 4 || | 1135 | < 4 || |
@@ -1052,6 +1140,7 @@ static void canvas_relocate(t_canvas *x, t_symbol *canvasgeom, | |||
1052 | if (cw > 5 && ch > 5) | 1140 | if (cw > 5 && ch > 5) |
1053 | canvas_setbounds(x, txpix, typix, | 1141 | canvas_setbounds(x, txpix, typix, |
1054 | txpix + cw - HORIZBORDER, typix + ch - VERTBORDER); | 1142 | txpix + cw - HORIZBORDER, typix + ch - VERTBORDER); |
1143 | #endif /* ROCKBOX */ | ||
1055 | } | 1144 | } |
1056 | 1145 | ||
1057 | void canvas_popabstraction(t_canvas *x) | 1146 | void canvas_popabstraction(t_canvas *x) |
@@ -1065,6 +1154,9 @@ void canvas_popabstraction(t_canvas *x) | |||
1065 | 1154 | ||
1066 | void canvas_logerror(t_object *y) | 1155 | void canvas_logerror(t_object *y) |
1067 | { | 1156 | { |
1157 | #ifdef ROCKBOX | ||
1158 | (void) y; | ||
1159 | #endif | ||
1068 | #ifdef LATER | 1160 | #ifdef LATER |
1069 | canvas_vis(x, 1); | 1161 | canvas_vis(x, 1); |
1070 | if (!glist_isselected(x, &y->ob_g)) | 1162 | if (!glist_isselected(x, &y->ob_g)) |
@@ -1095,6 +1187,13 @@ static void canvas_click(t_canvas *x, | |||
1095 | t_floatarg xpos, t_floatarg ypos, | 1187 | t_floatarg xpos, t_floatarg ypos, |
1096 | t_floatarg shift, t_floatarg ctrl, t_floatarg alt) | 1188 | t_floatarg shift, t_floatarg ctrl, t_floatarg alt) |
1097 | { | 1189 | { |
1190 | #ifdef ROCKBOX | ||
1191 | (void) xpos; | ||
1192 | (void) ypos; | ||
1193 | (void) shift; | ||
1194 | (void) ctrl; | ||
1195 | (void) alt; | ||
1196 | #endif | ||
1098 | canvas_vis(x, 1); | 1197 | canvas_vis(x, 1); |
1099 | } | 1198 | } |
1100 | 1199 | ||
@@ -1103,13 +1202,22 @@ static void canvas_click(t_canvas *x, | |||
1103 | void canvas_fattensub(t_canvas *x, | 1202 | void canvas_fattensub(t_canvas *x, |
1104 | int *xp1, int *yp1, int *xp2, int *yp2) | 1203 | int *xp1, int *yp1, int *xp2, int *yp2) |
1105 | { | 1204 | { |
1205 | #ifdef ROCKBOX | ||
1206 | (void) x; | ||
1207 | (void) xp1; | ||
1208 | (void) yp1; | ||
1209 | #else /* ROCKBOX */ | ||
1106 | t_gobj *y; | 1210 | t_gobj *y; |
1211 | #endif /* ROCKBOX */ | ||
1107 | *xp2 += 50; /* fake for now */ | 1212 | *xp2 += 50; /* fake for now */ |
1108 | *yp2 += 50; | 1213 | *yp2 += 50; |
1109 | } | 1214 | } |
1110 | 1215 | ||
1111 | static void canvas_rename_method(t_canvas *x, t_symbol *s, int ac, t_atom *av) | 1216 | static void canvas_rename_method(t_canvas *x, t_symbol *s, int ac, t_atom *av) |
1112 | { | 1217 | { |
1218 | #ifdef ROCKBOX | ||
1219 | (void) s; | ||
1220 | #endif | ||
1113 | if (ac && av->a_type == A_SYMBOL) | 1221 | if (ac && av->a_type == A_SYMBOL) |
1114 | canvas_rename(x, av->a_w.w_symbol, 0); | 1222 | canvas_rename(x, av->a_w.w_symbol, 0); |
1115 | else canvas_rename(x, gensym("Pd"), 0); | 1223 | else canvas_rename(x, gensym("Pd"), 0); |
@@ -1128,7 +1236,11 @@ static void *table_new(t_symbol *s, t_floatarg f) | |||
1128 | { | 1236 | { |
1129 | char tabname[255]; | 1237 | char tabname[255]; |
1130 | t_symbol *t = gensym("table"); | 1238 | t_symbol *t = gensym("table"); |
1239 | #ifdef ROCKBOX | ||
1240 | snprintf(tabname, sizeof(tabname)-1, "%s%d", t->s_name, tabcount++); | ||
1241 | #else /* ROCKBOX */ | ||
1131 | sprintf(tabname, "%s%d", t->s_name, tabcount++); | 1242 | sprintf(tabname, "%s%d", t->s_name, tabcount++); |
1243 | #endif /* ROCKBOX */ | ||
1132 | s = gensym(tabname); | 1244 | s = gensym(tabname); |
1133 | } | 1245 | } |
1134 | if (f <= 1) | 1246 | if (f <= 1) |
@@ -1239,7 +1351,7 @@ static void canvas_dodsp(t_canvas *x, int toplevel, t_signal **sp) | |||
1239 | 1351 | ||
1240 | /* ... and all dsp interconnections */ | 1352 | /* ... and all dsp interconnections */ |
1241 | linetraverser_start(&t, x); | 1353 | linetraverser_start(&t, x); |
1242 | while (oc = linetraverser_next(&t)) | 1354 | while((oc = linetraverser_next(&t))) |
1243 | if (obj_issignaloutlet(t.tr_ob, t.tr_outno)) | 1355 | if (obj_issignaloutlet(t.tr_ob, t.tr_outno)) |
1244 | ugen_connect(dc, t.tr_ob, t.tr_outno, t.tr_ob2, t.tr_inno); | 1356 | ugen_connect(dc, t.tr_ob, t.tr_outno, t.tr_ob2, t.tr_inno); |
1245 | 1357 | ||
@@ -1252,7 +1364,9 @@ static void canvas_start_dsp(void) | |||
1252 | { | 1364 | { |
1253 | t_canvas *x; | 1365 | t_canvas *x; |
1254 | if (canvas_dspstate) ugen_stop(); | 1366 | if (canvas_dspstate) ugen_stop(); |
1367 | #ifndef ROCKBOX | ||
1255 | else sys_gui("pdtk_pd_dsp ON\n"); | 1368 | else sys_gui("pdtk_pd_dsp ON\n"); |
1369 | #endif | ||
1256 | ugen_start(); | 1370 | ugen_start(); |
1257 | 1371 | ||
1258 | for (x = canvas_list; x; x = x->gl_next) | 1372 | for (x = canvas_list; x; x = x->gl_next) |
@@ -1266,7 +1380,9 @@ static void canvas_stop_dsp(void) | |||
1266 | if (canvas_dspstate) | 1380 | if (canvas_dspstate) |
1267 | { | 1381 | { |
1268 | ugen_stop(); | 1382 | ugen_stop(); |
1383 | #ifndef ROCKBOX | ||
1269 | sys_gui("pdtk_pd_dsp OFF\n"); | 1384 | sys_gui("pdtk_pd_dsp OFF\n"); |
1385 | #endif | ||
1270 | canvas_dspstate = 0; | 1386 | canvas_dspstate = 0; |
1271 | } | 1387 | } |
1272 | } | 1388 | } |
@@ -1297,6 +1413,10 @@ void canvas_update_dsp(void) | |||
1297 | void glob_dsp(void *dummy, t_symbol *s, int argc, t_atom *argv) | 1413 | void glob_dsp(void *dummy, t_symbol *s, int argc, t_atom *argv) |
1298 | { | 1414 | { |
1299 | int newstate; | 1415 | int newstate; |
1416 | #ifdef ROCKBOX | ||
1417 | (void) dummy; | ||
1418 | (void) s; | ||
1419 | #endif | ||
1300 | if (argc) | 1420 | if (argc) |
1301 | { | 1421 | { |
1302 | newstate = atom_getintarg(0, argc, argv); | 1422 | newstate = atom_getintarg(0, argc, argv); |
@@ -1333,7 +1453,9 @@ static void glist_redrawall(t_glist *gl) | |||
1333 | int vis = glist_isvisible(gl); | 1453 | int vis = glist_isvisible(gl); |
1334 | for (g = gl->gl_list; g; g = g->g_next) | 1454 | for (g = gl->gl_list; g; g = g->g_next) |
1335 | { | 1455 | { |
1456 | #ifndef ROCKBOX | ||
1336 | t_class *cl; | 1457 | t_class *cl; |
1458 | #endif | ||
1337 | if (vis && g->g_pd == scalar_class) | 1459 | if (vis && g->g_pd == scalar_class) |
1338 | glist_redrawitem(gl, g); | 1460 | glist_redrawitem(gl, g); |
1339 | else if (g->g_pd == canvas_class) | 1461 | else if (g->g_pd == canvas_class) |
@@ -1345,6 +1467,9 @@ static void glist_redrawall(t_glist *gl) | |||
1345 | void canvas_redrawallfortemplate(t_canvas *templatecanvas) | 1467 | void canvas_redrawallfortemplate(t_canvas *templatecanvas) |
1346 | { | 1468 | { |
1347 | t_canvas *x; | 1469 | t_canvas *x; |
1470 | #ifdef ROCKBOX | ||
1471 | (void) templatecanvas; | ||
1472 | #endif | ||
1348 | /* find all root canvases */ | 1473 | /* find all root canvases */ |
1349 | for (x = canvas_list; x; x = x->gl_next) | 1474 | for (x = canvas_list; x; x = x->gl_next) |
1350 | glist_redrawall(x); | 1475 | glist_redrawall(x); |
diff --git a/apps/plugins/pdbox/PDa/src/g_editor.c b/apps/plugins/pdbox/PDa/src/g_editor.c index 1190739e1a..a5cce20e10 100644 --- a/apps/plugins/pdbox/PDa/src/g_editor.c +++ b/apps/plugins/pdbox/PDa/src/g_editor.c | |||
@@ -2,6 +2,14 @@ | |||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | 2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL |
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | 3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ |
4 | 4 | ||
5 | #ifdef ROCKBOX | ||
6 | #include "plugin.h" | ||
7 | #include "pdbox.h" | ||
8 | #include "m_pd.h" | ||
9 | #include "m_imp.h" | ||
10 | #include "s_stuff.h" | ||
11 | #include "g_canvas.h" | ||
12 | #else /* ROCKBOX */ | ||
5 | #include <stdlib.h> | 13 | #include <stdlib.h> |
6 | #include <stdio.h> | 14 | #include <stdio.h> |
7 | #include "m_pd.h" | 15 | #include "m_pd.h" |
@@ -9,6 +17,7 @@ | |||
9 | #include "s_stuff.h" | 17 | #include "s_stuff.h" |
10 | #include "g_canvas.h" | 18 | #include "g_canvas.h" |
11 | #include <string.h> | 19 | #include <string.h> |
20 | #endif /* ROCKBOX */ | ||
12 | 21 | ||
13 | void glist_readfrombinbuf(t_glist *x, t_binbuf *b, char *filename, | 22 | void glist_readfrombinbuf(t_glist *x, t_binbuf *b, char *filename, |
14 | int selectem); | 23 | int selectem); |
@@ -88,8 +97,10 @@ void glist_selectline(t_glist *x, t_outconnect *oc, int index1, | |||
88 | x->gl_editor->e_selectline_index2 = index2; | 97 | x->gl_editor->e_selectline_index2 = index2; |
89 | x->gl_editor->e_selectline_inno = inno; | 98 | x->gl_editor->e_selectline_inno = inno; |
90 | x->gl_editor->e_selectline_tag = oc; | 99 | x->gl_editor->e_selectline_tag = oc; |
100 | #ifndef ROCKBOX | ||
91 | sys_vgui(".x%x.c itemconfigure l%x -fill blue\n", | 101 | sys_vgui(".x%x.c itemconfigure l%x -fill blue\n", |
92 | x, x->gl_editor->e_selectline_tag); | 102 | x, x->gl_editor->e_selectline_tag); |
103 | #endif | ||
93 | } | 104 | } |
94 | } | 105 | } |
95 | 106 | ||
@@ -98,8 +109,10 @@ void glist_deselectline(t_glist *x) | |||
98 | if (x->gl_editor) | 109 | if (x->gl_editor) |
99 | { | 110 | { |
100 | x->gl_editor->e_selectedline = 0; | 111 | x->gl_editor->e_selectedline = 0; |
112 | #ifndef ROCKBOX | ||
101 | sys_vgui(".x%x.c itemconfigure l%x -fill black\n", | 113 | sys_vgui(".x%x.c itemconfigure l%x -fill black\n", |
102 | x, x->gl_editor->e_selectline_tag); | 114 | x, x->gl_editor->e_selectline_tag); |
115 | #endif | ||
103 | } | 116 | } |
104 | } | 117 | } |
105 | 118 | ||
@@ -166,7 +179,7 @@ void glist_deselect(t_glist *x, t_gobj *y) | |||
166 | } | 179 | } |
167 | else | 180 | else |
168 | { | 181 | { |
169 | for (sel = x->gl_editor->e_selection; sel2 = sel->sel_next; | 182 | for(sel = x->gl_editor->e_selection; (sel2 = sel->sel_next); |
170 | sel = sel2) | 183 | sel = sel2) |
171 | { | 184 | { |
172 | if (sel2->sel_what == y) | 185 | if (sel2->sel_what == y) |
@@ -217,7 +230,7 @@ void glist_selectall(t_glist *x) | |||
217 | x->gl_editor->e_selection = sel; | 230 | x->gl_editor->e_selection = sel; |
218 | sel->sel_what = y; | 231 | sel->sel_what = y; |
219 | gobj_select(y, x, 1); | 232 | gobj_select(y, x, 1); |
220 | while (y = y->g_next) | 233 | while((y = y->g_next)) |
221 | { | 234 | { |
222 | t_selection *sel2 = (t_selection *)getbytes(sizeof(*sel2)); | 235 | t_selection *sel2 = (t_selection *)getbytes(sizeof(*sel2)); |
223 | sel->sel_next = sel2; | 236 | sel->sel_next = sel2; |
@@ -290,11 +303,13 @@ void canvas_setundo(t_canvas *x, t_undofn undofn, void *buf, | |||
290 | canvas_undo_buf = buf; | 303 | canvas_undo_buf = buf; |
291 | canvas_undo_whatnext = UNDO_UNDO; | 304 | canvas_undo_whatnext = UNDO_UNDO; |
292 | canvas_undo_name = name; | 305 | canvas_undo_name = name; |
306 | #ifndef ROCKBOX | ||
293 | if (x && glist_isvisible(x) && glist_istoplevel(x)) | 307 | if (x && glist_isvisible(x) && glist_istoplevel(x)) |
294 | /* enable undo in menu */ | 308 | /* enable undo in menu */ |
295 | sys_vgui("pdtk_undomenu .x%x %s no\n", x, name); | 309 | sys_vgui("pdtk_undomenu .x%x %s no\n", x, name); |
296 | else if (hadone) | 310 | else if (hadone) |
297 | sys_vgui("pdtk_undomenu nobody no no\n"); | 311 | sys_vgui("pdtk_undomenu nobody no no\n"); |
312 | #endif | ||
298 | } | 313 | } |
299 | 314 | ||
300 | /* clear undo if it happens to be for the canvas x. | 315 | /* clear undo if it happens to be for the canvas x. |
@@ -316,8 +331,10 @@ static void canvas_undo(t_canvas *x) | |||
316 | /* post("undo"); */ | 331 | /* post("undo"); */ |
317 | (*canvas_undo_fn)(canvas_undo_canvas, canvas_undo_buf, UNDO_UNDO); | 332 | (*canvas_undo_fn)(canvas_undo_canvas, canvas_undo_buf, UNDO_UNDO); |
318 | /* enable redo in menu */ | 333 | /* enable redo in menu */ |
334 | #ifndef ROCKBOX | ||
319 | if (glist_isvisible(x) && glist_istoplevel(x)) | 335 | if (glist_isvisible(x) && glist_istoplevel(x)) |
320 | sys_vgui("pdtk_undomenu .x%x no %s\n", x, canvas_undo_name); | 336 | sys_vgui("pdtk_undomenu .x%x no %s\n", x, canvas_undo_name); |
337 | #endif | ||
321 | canvas_undo_whatnext = UNDO_REDO; | 338 | canvas_undo_whatnext = UNDO_REDO; |
322 | } | 339 | } |
323 | } | 340 | } |
@@ -333,8 +350,10 @@ static void canvas_redo(t_canvas *x) | |||
333 | /* post("redo"); */ | 350 | /* post("redo"); */ |
334 | (*canvas_undo_fn)(canvas_undo_canvas, canvas_undo_buf, UNDO_REDO); | 351 | (*canvas_undo_fn)(canvas_undo_canvas, canvas_undo_buf, UNDO_REDO); |
335 | /* enable undo in menu */ | 352 | /* enable undo in menu */ |
353 | #ifndef ROCKBOX | ||
336 | if (glist_isvisible(x) && glist_istoplevel(x)) | 354 | if (glist_isvisible(x) && glist_istoplevel(x)) |
337 | sys_vgui("pdtk_undomenu .x%x %s no\n", x, canvas_undo_name); | 355 | sys_vgui("pdtk_undomenu .x%x %s no\n", x, canvas_undo_name); |
356 | #endif | ||
338 | canvas_undo_whatnext = UNDO_UNDO; | 357 | canvas_undo_whatnext = UNDO_UNDO; |
339 | } | 358 | } |
340 | } | 359 | } |
@@ -352,6 +371,9 @@ typedef struct _undo_connect | |||
352 | static void *canvas_undo_set_disconnect(t_canvas *x, | 371 | static void *canvas_undo_set_disconnect(t_canvas *x, |
353 | int index1, int outno, int index2, int inno) | 372 | int index1, int outno, int index2, int inno) |
354 | { | 373 | { |
374 | #ifdef ROCKBOX | ||
375 | (void) x; | ||
376 | #endif | ||
355 | t_undo_connect *buf = (t_undo_connect *)getbytes(sizeof(*buf)); | 377 | t_undo_connect *buf = (t_undo_connect *)getbytes(sizeof(*buf)); |
356 | buf->u_index1 = index1; | 378 | buf->u_index1 = index1; |
357 | buf->u_outletno = outno; | 379 | buf->u_outletno = outno; |
@@ -366,14 +388,16 @@ void canvas_disconnect(t_canvas *x, | |||
366 | t_linetraverser t; | 388 | t_linetraverser t; |
367 | t_outconnect *oc; | 389 | t_outconnect *oc; |
368 | linetraverser_start(&t, x); | 390 | linetraverser_start(&t, x); |
369 | while (oc = linetraverser_next(&t)) | 391 | while((oc = linetraverser_next(&t))) |
370 | { | 392 | { |
371 | int srcno = canvas_getindex(x, &t.tr_ob->ob_g); | 393 | int srcno = canvas_getindex(x, &t.tr_ob->ob_g); |
372 | int sinkno = canvas_getindex(x, &t.tr_ob2->ob_g); | 394 | int sinkno = canvas_getindex(x, &t.tr_ob2->ob_g); |
373 | if (srcno == index1 && t.tr_outno == outno && | 395 | if (srcno == index1 && t.tr_outno == outno && |
374 | sinkno == index2 && t.tr_inno == inno) | 396 | sinkno == index2 && t.tr_inno == inno) |
375 | { | 397 | { |
398 | #ifndef ROCKBOX | ||
376 | sys_vgui(".x%x.c delete l%x\n", x, oc); | 399 | sys_vgui(".x%x.c delete l%x\n", x, oc); |
400 | #endif | ||
377 | obj_disconnect(t.tr_ob, t.tr_outno, t.tr_ob2, t.tr_inno); | 401 | obj_disconnect(t.tr_ob, t.tr_outno, t.tr_ob2, t.tr_inno); |
378 | break; | 402 | break; |
379 | } | 403 | } |
@@ -432,7 +456,9 @@ typedef struct _undo_cut | |||
432 | static void *canvas_undo_set_cut(t_canvas *x, int mode) | 456 | static void *canvas_undo_set_cut(t_canvas *x, int mode) |
433 | { | 457 | { |
434 | t_undo_cut *buf; | 458 | t_undo_cut *buf; |
459 | #ifndef ROCKBOX | ||
435 | t_gobj *y; | 460 | t_gobj *y; |
461 | #endif | ||
436 | t_linetraverser t; | 462 | t_linetraverser t; |
437 | t_outconnect *oc; | 463 | t_outconnect *oc; |
438 | int nnotsel= glist_selectionindex(x, 0, 0); | 464 | int nnotsel= glist_selectionindex(x, 0, 0); |
@@ -443,7 +469,7 @@ static void *canvas_undo_set_cut(t_canvas *x, int mode) | |||
443 | /* store connections into/out of the selection */ | 469 | /* store connections into/out of the selection */ |
444 | buf->u_reconnectbuf = binbuf_new(); | 470 | buf->u_reconnectbuf = binbuf_new(); |
445 | linetraverser_start(&t, x); | 471 | linetraverser_start(&t, x); |
446 | while (oc = linetraverser_next(&t)) | 472 | while((oc = linetraverser_next(&t))) |
447 | { | 473 | { |
448 | int issel1 = glist_isselected(x, &t.tr_ob->ob_g); | 474 | int issel1 = glist_isselected(x, &t.tr_ob->ob_g); |
449 | int issel2 = glist_isselected(x, &t.tr_ob2->ob_g); | 475 | int issel2 = glist_isselected(x, &t.tr_ob2->ob_g); |
@@ -488,7 +514,7 @@ static void canvas_undo_cut(t_canvas *x, void *z, int action) | |||
488 | { | 514 | { |
489 | t_gobj *y1, *y2; | 515 | t_gobj *y1, *y2; |
490 | glist_noselect(x); | 516 | glist_noselect(x); |
491 | for (y1 = x->gl_list; y2 = y1->g_next; y1 = y2) | 517 | for(y1 = x->gl_list; (y2 = y1->g_next); y1 = y2) |
492 | ; | 518 | ; |
493 | if (y1) | 519 | if (y1) |
494 | { | 520 | { |
@@ -514,7 +540,7 @@ static void canvas_undo_cut(t_canvas *x, void *z, int action) | |||
514 | else if (mode == UCUT_TEXT) | 540 | else if (mode == UCUT_TEXT) |
515 | { | 541 | { |
516 | t_gobj *y1, *y2; | 542 | t_gobj *y1, *y2; |
517 | for (y1 = x->gl_list; y2 = y1->g_next; y1 = y2) | 543 | for(y1 = x->gl_list; (y2 = y1->g_next); y1 = y2) |
518 | ; | 544 | ; |
519 | if (y1) | 545 | if (y1) |
520 | glist_delete(x, y1); | 546 | glist_delete(x, y1); |
@@ -738,7 +764,9 @@ void canvas_setcursor(t_canvas *x, unsigned int cursornum) | |||
738 | } | 764 | } |
739 | if (xwas != x || cursorwas != cursornum) | 765 | if (xwas != x || cursorwas != cursornum) |
740 | { | 766 | { |
767 | #ifndef ROCKBOX | ||
741 | sys_vgui(".x%x configure -cursor %s\n", x, cursorlist[cursornum]); | 768 | sys_vgui(".x%x configure -cursor %s\n", x, cursorlist[cursornum]); |
769 | #endif | ||
742 | xwas = x; | 770 | xwas = x; |
743 | cursorwas = cursornum; | 771 | cursorwas = cursornum; |
744 | } | 772 | } |
@@ -784,8 +812,14 @@ static void canvas_rightclick(t_canvas *x, int xpos, int ypos, t_gobj *y) | |||
784 | int canprop, canopen; | 812 | int canprop, canopen; |
785 | canprop = (!y || (y && class_getpropertiesfn(pd_class(&y->g_pd)))); | 813 | canprop = (!y || (y && class_getpropertiesfn(pd_class(&y->g_pd)))); |
786 | canopen = (y && zgetfn(&y->g_pd, gensym("menu-open"))); | 814 | canopen = (y && zgetfn(&y->g_pd, gensym("menu-open"))); |
815 | #ifdef ROCKBOX | ||
816 | (void) x; | ||
817 | (void) xpos; | ||
818 | (void) ypos; | ||
819 | #else /* ROCKBOX */ | ||
787 | sys_vgui("pdtk_canvas_popup .x%x %d %d %d %d\n", | 820 | sys_vgui("pdtk_canvas_popup .x%x %d %d %d %d\n", |
788 | x, xpos, ypos, canprop, canopen); | 821 | x, xpos, ypos, canprop, canopen); |
822 | #endif /* ROCKBOX */ | ||
789 | } | 823 | } |
790 | 824 | ||
791 | /* tell GUI to create a properties dialog on the canvas. We tell | 825 | /* tell GUI to create a properties dialog on the canvas. We tell |
@@ -793,11 +827,15 @@ static void canvas_rightclick(t_canvas *x, int xpos, int ypos, t_gobj *y) | |||
793 | naturally upward, whereas pixels grow downward. */ | 827 | naturally upward, whereas pixels grow downward. */ |
794 | static void canvas_properties(t_glist *x) | 828 | static void canvas_properties(t_glist *x) |
795 | { | 829 | { |
830 | #ifdef ROCKBOX | ||
831 | (void) x; | ||
832 | #else /* ROCKBOX */ | ||
796 | char graphbuf[200]; | 833 | char graphbuf[200]; |
797 | sprintf(graphbuf, "pdtk_canvas_dialog %%s %g %g %g %g \n", | 834 | sprintf(graphbuf, "pdtk_canvas_dialog %%s %g %g %g %g \n", |
798 | glist_dpixtodx(x, 1), -glist_dpixtody(x, 1), | 835 | glist_dpixtodx(x, 1), -glist_dpixtody(x, 1), |
799 | (float)glist_isgraph(x), (float)x->gl_stretch); | 836 | (float)glist_isgraph(x), (float)x->gl_stretch); |
800 | gfxstub_new(&x->gl_pd, x, graphbuf); | 837 | gfxstub_new(&x->gl_pd, x, graphbuf); |
838 | #endif /* ROCKBOX */ | ||
801 | } | 839 | } |
802 | 840 | ||
803 | 841 | ||
@@ -885,7 +923,11 @@ static void canvas_donecanvasdialog(t_glist *x, t_floatarg xperpix, | |||
885 | "open," or "help." */ | 923 | "open," or "help." */ |
886 | static void canvas_done_popup(t_canvas *x, float which, float xpos, float ypos) | 924 | static void canvas_done_popup(t_canvas *x, float which, float xpos, float ypos) |
887 | { | 925 | { |
926 | #ifdef ROCKBOX | ||
927 | char namebuf[MAXPDSTRING]; | ||
928 | #else | ||
888 | char pathbuf[MAXPDSTRING], namebuf[MAXPDSTRING]; | 929 | char pathbuf[MAXPDSTRING], namebuf[MAXPDSTRING]; |
930 | #endif | ||
889 | t_gobj *y; | 931 | t_gobj *y; |
890 | for (y = x->gl_list; y; y = y->g_next) | 932 | for (y = x->gl_list; y; y = y->g_next) |
891 | { | 933 | { |
@@ -936,9 +978,11 @@ static void canvas_done_popup(t_canvas *x, float which, float xpos, float ypos) | |||
936 | canvas_properties(x); | 978 | canvas_properties(x); |
937 | else if (which == 2) | 979 | else if (which == 2) |
938 | { | 980 | { |
981 | #ifndef ROCKBOX | ||
939 | strcpy(pathbuf, sys_libdir->s_name); | 982 | strcpy(pathbuf, sys_libdir->s_name); |
940 | strcat(pathbuf, "/doc/5.reference/0.INTRO.txt"); | 983 | strcat(pathbuf, "/doc/5.reference/0.INTRO.txt"); |
941 | sys_vgui("menu_opentext %s\n", pathbuf); | 984 | sys_vgui("menu_opentext %s\n", pathbuf); |
985 | #endif | ||
942 | } | 986 | } |
943 | } | 987 | } |
944 | 988 | ||
@@ -967,7 +1011,11 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, | |||
967 | t_gobj *y; | 1011 | t_gobj *y; |
968 | int shiftmod, runmode, altmod, rightclick; | 1012 | int shiftmod, runmode, altmod, rightclick; |
969 | int x1, y1, x2, y2, clickreturned = 0; | 1013 | int x1, y1, x2, y2, clickreturned = 0; |
970 | 1014 | ||
1015 | #ifdef ROCKBOX | ||
1016 | (void) which; | ||
1017 | #endif | ||
1018 | |||
971 | if (!x->gl_editor) | 1019 | if (!x->gl_editor) |
972 | { | 1020 | { |
973 | bug("editor"); | 1021 | bug("editor"); |
@@ -1027,7 +1075,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, | |||
1027 | return; | 1075 | return; |
1028 | } | 1076 | } |
1029 | /* if not a runmode left click, fall here. */ | 1077 | /* if not a runmode left click, fall here. */ |
1030 | if (y = canvas_findhitbox(x, xpos, ypos, &x1, &y1, &x2, &y2)) | 1078 | if((y = canvas_findhitbox(x, xpos, ypos, &x1, &y1, &x2, &y2))) |
1031 | { | 1079 | { |
1032 | t_object *ob = pd_checkobject(&y->g_pd); | 1080 | t_object *ob = pd_checkobject(&y->g_pd); |
1033 | /* check you're in the rectangle */ | 1081 | /* check you're in the rectangle */ |
@@ -1071,14 +1119,18 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, | |||
1071 | { | 1119 | { |
1072 | if (doit) | 1120 | if (doit) |
1073 | { | 1121 | { |
1122 | #ifndef ROCKBOX | ||
1074 | int issignal = obj_issignaloutlet(ob, closest); | 1123 | int issignal = obj_issignaloutlet(ob, closest); |
1124 | #endif | ||
1075 | x->gl_editor->e_onmotion = MA_CONNECT; | 1125 | x->gl_editor->e_onmotion = MA_CONNECT; |
1076 | x->gl_editor->e_xwas = xpos; | 1126 | x->gl_editor->e_xwas = xpos; |
1077 | x->gl_editor->e_ywas = ypos; | 1127 | x->gl_editor->e_ywas = ypos; |
1128 | #ifndef ROCKBOX | ||
1078 | sys_vgui( | 1129 | sys_vgui( |
1079 | ".x%x.c create line %d %d %d %d -width %d -tags x\n", | 1130 | ".x%x.c create line %d %d %d %d -width %d -tags x\n", |
1080 | x, xpos, ypos, xpos, ypos, | 1131 | x, xpos, ypos, xpos, ypos, |
1081 | (issignal ? 2 : 1)); | 1132 | (issignal ? 2 : 1)); |
1133 | #endif | ||
1082 | } | 1134 | } |
1083 | else canvas_setcursor(x, CURSOR_EDITMODE_CONNECT); | 1135 | else canvas_setcursor(x, CURSOR_EDITMODE_CONNECT); |
1084 | } | 1136 | } |
@@ -1134,7 +1186,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, | |||
1134 | float fx = xpos, fy = ypos; | 1186 | float fx = xpos, fy = ypos; |
1135 | t_glist *glist2 = glist_getcanvas(x); | 1187 | t_glist *glist2 = glist_getcanvas(x); |
1136 | linetraverser_start(&t, glist2); | 1188 | linetraverser_start(&t, glist2); |
1137 | while (oc = linetraverser_next(&t)) | 1189 | while((oc = linetraverser_next(&t))) |
1138 | { | 1190 | { |
1139 | float lx1 = t.tr_lx1, ly1 = t.tr_ly1, | 1191 | float lx1 = t.tr_lx1, ly1 = t.tr_ly1, |
1140 | lx2 = t.tr_lx2, ly2 = t.tr_ly2; | 1192 | lx2 = t.tr_lx2, ly2 = t.tr_ly2; |
@@ -1158,8 +1210,10 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, | |||
1158 | if (doit) | 1210 | if (doit) |
1159 | { | 1211 | { |
1160 | if (!shiftmod) glist_noselect(x); | 1212 | if (!shiftmod) glist_noselect(x); |
1213 | #ifndef ROCKBOX | ||
1161 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags x\n", | 1214 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags x\n", |
1162 | x, xpos, ypos, xpos, ypos); | 1215 | x, xpos, ypos, xpos, ypos); |
1216 | #endif | ||
1163 | x->gl_editor->e_xwas = xpos; | 1217 | x->gl_editor->e_xwas = xpos; |
1164 | x->gl_editor->e_ywas = ypos; | 1218 | x->gl_editor->e_ywas = ypos; |
1165 | x->gl_editor->e_onmotion = MA_REGION; | 1219 | x->gl_editor->e_onmotion = MA_REGION; |
@@ -1178,7 +1232,7 @@ int canvas_isconnected (t_canvas *x, t_text *ob1, int n1, | |||
1178 | t_linetraverser t; | 1232 | t_linetraverser t; |
1179 | t_outconnect *oc; | 1233 | t_outconnect *oc; |
1180 | linetraverser_start(&t, x); | 1234 | linetraverser_start(&t, x); |
1181 | while (oc = linetraverser_next(&t)) | 1235 | while((oc = linetraverser_next(&t))) |
1182 | if (t.tr_ob == ob1 && t.tr_outno == n1 && | 1236 | if (t.tr_ob == ob1 && t.tr_outno == n1 && |
1183 | t.tr_ob2 == ob2 && t.tr_inno == n2) | 1237 | t.tr_ob2 == ob2 && t.tr_inno == n2) |
1184 | return (1); | 1238 | return (1); |
@@ -1193,10 +1247,15 @@ void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit) | |||
1193 | t_gobj *y2; | 1247 | t_gobj *y2; |
1194 | int xwas = x->gl_editor->e_xwas, | 1248 | int xwas = x->gl_editor->e_xwas, |
1195 | ywas = x->gl_editor->e_ywas; | 1249 | ywas = x->gl_editor->e_ywas; |
1250 | #ifdef ROCKBOX | ||
1251 | (void) which; | ||
1252 | #endif /* ROCKBOX */ | ||
1253 | #ifndef ROCKBOX | ||
1196 | if (doit) sys_vgui(".x%x.c delete x\n", x); | 1254 | if (doit) sys_vgui(".x%x.c delete x\n", x); |
1197 | else sys_vgui(".x%x.c coords x %d %d %d %d\n", | 1255 | else sys_vgui(".x%x.c coords x %d %d %d %d\n", |
1198 | x, x->gl_editor->e_xwas, | 1256 | x, x->gl_editor->e_xwas, |
1199 | x->gl_editor->e_ywas, xpos, ypos); | 1257 | x->gl_editor->e_ywas, xpos, ypos); |
1258 | #endif /* ROCKBOX */ | ||
1200 | 1259 | ||
1201 | if ((y1 = canvas_findhitbox(x, xwas, ywas, &x11, &y11, &x12, &y12)) | 1260 | if ((y1 = canvas_findhitbox(x, xwas, ywas, &x11, &y11, &x12, &y12)) |
1202 | && (y2 = canvas_findhitbox(x, xpos, ypos, &x21, &y21, &x22, &y22))) | 1261 | && (y2 = canvas_findhitbox(x, xpos, ypos, &x21, &y21, &x22, &y22))) |
@@ -1258,10 +1317,12 @@ void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit) | |||
1258 | ((x22-x21-IOWIDTH) * closest2)/(ninlet2-1) : 0) | 1317 | ((x22-x21-IOWIDTH) * closest2)/(ninlet2-1) : 0) |
1259 | + IOMIDDLE; | 1318 | + IOMIDDLE; |
1260 | ly2 = y21; | 1319 | ly2 = y21; |
1320 | #ifndef ROCKBOX | ||
1261 | sys_vgui(".x%x.c create line %d %d %d %d -width %d -tags l%x\n", | 1321 | sys_vgui(".x%x.c create line %d %d %d %d -width %d -tags l%x\n", |
1262 | glist_getcanvas(x), | 1322 | glist_getcanvas(x), |
1263 | lx1, ly1, lx2, ly2, | 1323 | lx1, ly1, lx2, ly2, |
1264 | (obj_issignaloutlet(ob1, closest1) ? 2 : 1), oc); | 1324 | (obj_issignaloutlet(ob1, closest1) ? 2 : 1), oc); |
1325 | #endif /* ROCKBOX */ | ||
1265 | canvas_setundo(x, canvas_undo_connect, | 1326 | canvas_setundo(x, canvas_undo_connect, |
1266 | canvas_undo_set_connect(x, | 1327 | canvas_undo_set_connect(x, |
1267 | canvas_getindex(x, &ob1->ob_g), closest1, | 1328 | canvas_getindex(x, &ob1->ob_g), closest1, |
@@ -1300,12 +1361,16 @@ static void canvas_doregion(t_canvas *x, int xpos, int ypos, int doit) | |||
1300 | loy = x->gl_editor->e_ywas, hiy = ypos; | 1361 | loy = x->gl_editor->e_ywas, hiy = ypos; |
1301 | else hiy = x->gl_editor->e_ywas, loy = ypos; | 1362 | else hiy = x->gl_editor->e_ywas, loy = ypos; |
1302 | canvas_selectinrect(x, lox, loy, hix, hiy); | 1363 | canvas_selectinrect(x, lox, loy, hix, hiy); |
1364 | #ifndef ROCKBOX | ||
1303 | sys_vgui(".x%x.c delete x\n", x); | 1365 | sys_vgui(".x%x.c delete x\n", x); |
1366 | #endif | ||
1304 | x->gl_editor->e_onmotion = 0; | 1367 | x->gl_editor->e_onmotion = 0; |
1305 | } | 1368 | } |
1369 | #ifndef ROCKBOX | ||
1306 | else sys_vgui(".x%x.c coords x %d %d %d %d\n", | 1370 | else sys_vgui(".x%x.c coords x %d %d %d %d\n", |
1307 | x, x->gl_editor->e_xwas, | 1371 | x, x->gl_editor->e_xwas, |
1308 | x->gl_editor->e_ywas, xpos, ypos); | 1372 | x->gl_editor->e_ywas, xpos, ypos); |
1373 | #endif | ||
1309 | } | 1374 | } |
1310 | 1375 | ||
1311 | void canvas_mouseup(t_canvas *x, | 1376 | void canvas_mouseup(t_canvas *x, |
@@ -1395,7 +1460,11 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av) | |||
1395 | t_symbol *gotkeysym; | 1460 | t_symbol *gotkeysym; |
1396 | 1461 | ||
1397 | int down, shift; | 1462 | int down, shift; |
1398 | 1463 | ||
1464 | #ifdef ROCKBOX | ||
1465 | (void) s; | ||
1466 | #endif | ||
1467 | |||
1399 | if (ac < 3) | 1468 | if (ac < 3) |
1400 | return; | 1469 | return; |
1401 | if (!x->gl_editor) | 1470 | if (!x->gl_editor) |
@@ -1411,7 +1480,11 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av) | |||
1411 | else if (av[1].a_type == A_FLOAT) | 1480 | else if (av[1].a_type == A_FLOAT) |
1412 | { | 1481 | { |
1413 | char buf[3]; | 1482 | char buf[3]; |
1483 | #ifdef ROCKBOX | ||
1484 | snprintf(buf, sizeof(buf)-1, "%c", (int)(av[1].a_w.w_float)); | ||
1485 | #else /* ROCKBOX */ | ||
1414 | sprintf(buf, "%c", (int)(av[1].a_w.w_float)); | 1486 | sprintf(buf, "%c", (int)(av[1].a_w.w_float)); |
1487 | #endif /* ROCKBOX */ | ||
1415 | gotkeysym = gensym(buf); | 1488 | gotkeysym = gensym(buf); |
1416 | } | 1489 | } |
1417 | else gotkeysym = gensym("?"); | 1490 | else gotkeysym = gensym("?"); |
@@ -1559,8 +1632,13 @@ void canvas_startmotion(t_canvas *x) | |||
1559 | 1632 | ||
1560 | void canvas_print(t_canvas *x, t_symbol *s) | 1633 | void canvas_print(t_canvas *x, t_symbol *s) |
1561 | { | 1634 | { |
1635 | #ifdef ROCKBOX | ||
1636 | (void) x; | ||
1637 | (void) s; | ||
1638 | #else /* ROCKBOX */ | ||
1562 | if (*s->s_name) sys_vgui(".x%x.c postscript -file %s\n", x, s->s_name); | 1639 | if (*s->s_name) sys_vgui(".x%x.c postscript -file %s\n", x, s->s_name); |
1563 | else sys_vgui(".x%x.c postscript -file x.ps\n", x); | 1640 | else sys_vgui(".x%x.c postscript -file x.ps\n", x); |
1641 | #endif /* ROCKBOX */ | ||
1564 | } | 1642 | } |
1565 | 1643 | ||
1566 | void canvas_menuclose(t_canvas *x, t_floatarg force) | 1644 | void canvas_menuclose(t_canvas *x, t_floatarg force) |
@@ -1569,18 +1647,24 @@ void canvas_menuclose(t_canvas *x, t_floatarg force) | |||
1569 | canvas_vis(x, 0); | 1647 | canvas_vis(x, 0); |
1570 | else if ((force != 0) || (!x->gl_dirty)) | 1648 | else if ((force != 0) || (!x->gl_dirty)) |
1571 | pd_free(&x->gl_pd); | 1649 | pd_free(&x->gl_pd); |
1650 | #ifndef ROCKBOX | ||
1572 | else sys_vgui("pdtk_check {This window has been modified. Close anyway?}\ | 1651 | else sys_vgui("pdtk_check {This window has been modified. Close anyway?}\ |
1573 | {.x%x menuclose 1;\n}\n", x); | 1652 | {.x%x menuclose 1;\n}\n", x); |
1653 | #endif | ||
1574 | } | 1654 | } |
1575 | 1655 | ||
1576 | /* put up a dialog which may call canvas_font back to do the work */ | 1656 | /* put up a dialog which may call canvas_font back to do the work */ |
1577 | static void canvas_menufont(t_canvas *x) | 1657 | static void canvas_menufont(t_canvas *x) |
1578 | { | 1658 | { |
1659 | #ifdef ROCKBOX | ||
1660 | (void) x; | ||
1661 | #else /* ROCKBOX */ | ||
1579 | char buf[80]; | 1662 | char buf[80]; |
1580 | t_canvas *x2 = canvas_getrootfor(x); | 1663 | t_canvas *x2 = canvas_getrootfor(x); |
1581 | gfxstub_deleteforkey(x2); | 1664 | gfxstub_deleteforkey(x2); |
1582 | sprintf(buf, "pdtk_canvas_dofont %%s %d\n", x2->gl_font); | 1665 | sprintf(buf, "pdtk_canvas_dofont %%s %d\n", x2->gl_font); |
1583 | gfxstub_new(&x2->gl_pd, &x2->gl_pd, buf); | 1666 | gfxstub_new(&x2->gl_pd, &x2->gl_pd, buf); |
1667 | #endif /* ROCKBOX */ | ||
1584 | } | 1668 | } |
1585 | 1669 | ||
1586 | static int canvas_find_index1, canvas_find_index2; | 1670 | static int canvas_find_index1, canvas_find_index2; |
@@ -1598,13 +1682,13 @@ static int canvas_dofind(t_canvas *x, int *myindex1p) | |||
1598 | y = y->g_next, myindex2++) | 1682 | y = y->g_next, myindex2++) |
1599 | { | 1683 | { |
1600 | t_object *ob = 0; | 1684 | t_object *ob = 0; |
1601 | if (ob = pd_checkobject(&y->g_pd)) | 1685 | if((ob = pd_checkobject(&y->g_pd))) |
1602 | { | 1686 | { |
1603 | if (binbuf_match(ob->ob_binbuf, canvas_findbuf)) | 1687 | if (binbuf_match(ob->ob_binbuf, canvas_findbuf)) |
1604 | { | 1688 | { |
1605 | if (myindex1 > canvas_find_index1 || | 1689 | if (myindex1 > canvas_find_index1 || |
1606 | myindex1 == canvas_find_index1 && | 1690 | (myindex1 == canvas_find_index1 && |
1607 | myindex2 > canvas_find_index2) | 1691 | myindex2 > canvas_find_index2)) |
1608 | { | 1692 | { |
1609 | canvas_find_index1 = myindex1; | 1693 | canvas_find_index1 = myindex1; |
1610 | canvas_find_index2 = myindex2; | 1694 | canvas_find_index2 = myindex2; |
@@ -1633,6 +1717,9 @@ static int canvas_dofind(t_canvas *x, int *myindex1p) | |||
1633 | static void canvas_find(t_canvas *x, t_symbol *s, int ac, t_atom *av) | 1717 | static void canvas_find(t_canvas *x, t_symbol *s, int ac, t_atom *av) |
1634 | { | 1718 | { |
1635 | int myindex1 = 0, i; | 1719 | int myindex1 = 0, i; |
1720 | #ifdef ROCKBOX | ||
1721 | (void) s; | ||
1722 | #endif | ||
1636 | for (i = 0; i < ac; i++) | 1723 | for (i = 0; i < ac; i++) |
1637 | { | 1724 | { |
1638 | if (av[i].a_type == A_SYMBOL) | 1725 | if (av[i].a_type == A_SYMBOL) |
@@ -1660,6 +1747,9 @@ static void canvas_find(t_canvas *x, t_symbol *s, int ac, t_atom *av) | |||
1660 | static void canvas_find_again(t_canvas *x) | 1747 | static void canvas_find_again(t_canvas *x) |
1661 | { | 1748 | { |
1662 | int myindex1 = 0; | 1749 | int myindex1 = 0; |
1750 | #ifdef ROCKBOX | ||
1751 | (void) x; | ||
1752 | #endif | ||
1663 | if (!canvas_findbuf || !canvas_whichfind) | 1753 | if (!canvas_findbuf || !canvas_whichfind) |
1664 | return; | 1754 | return; |
1665 | if (!canvas_dofind(canvas_whichfind, &myindex1)) | 1755 | if (!canvas_dofind(canvas_whichfind, &myindex1)) |
@@ -1756,7 +1846,7 @@ void canvas_stowconnections(t_canvas *x) | |||
1756 | /* add connections to binbuf */ | 1846 | /* add connections to binbuf */ |
1757 | binbuf_clear(x->gl_editor->e_connectbuf); | 1847 | binbuf_clear(x->gl_editor->e_connectbuf); |
1758 | linetraverser_start(&t, x); | 1848 | linetraverser_start(&t, x); |
1759 | while (oc = linetraverser_next(&t)) | 1849 | while((oc = linetraverser_next(&t))) |
1760 | { | 1850 | { |
1761 | int s1 = glist_isselected(x, &t.tr_ob->ob_g); | 1851 | int s1 = glist_isselected(x, &t.tr_ob->ob_g); |
1762 | int s2 = glist_isselected(x, &t.tr_ob2->ob_g); | 1852 | int s2 = glist_isselected(x, &t.tr_ob2->ob_g); |
@@ -1787,7 +1877,7 @@ static t_binbuf *canvas_docopy(t_canvas *x) | |||
1787 | gobj_save(y, b); | 1877 | gobj_save(y, b); |
1788 | } | 1878 | } |
1789 | linetraverser_start(&t, x); | 1879 | linetraverser_start(&t, x); |
1790 | while (oc = linetraverser_next(&t)) | 1880 | while((oc = linetraverser_next(&t))) |
1791 | { | 1881 | { |
1792 | if (glist_isselected(x, &t.tr_ob->ob_g) | 1882 | if (glist_isselected(x, &t.tr_ob->ob_g) |
1793 | && glist_isselected(x, &t.tr_ob2->ob_g)) | 1883 | && glist_isselected(x, &t.tr_ob2->ob_g)) |
@@ -1912,7 +2002,11 @@ static void glist_donewloadbangs(t_glist *x) | |||
1912 | 2002 | ||
1913 | static void canvas_dopaste(t_canvas *x, t_binbuf *b) | 2003 | static void canvas_dopaste(t_canvas *x, t_binbuf *b) |
1914 | { | 2004 | { |
2005 | #ifdef ROCKBOX | ||
2006 | t_gobj *g2; | ||
2007 | #else /* ROCKBOX */ | ||
1915 | t_gobj *newgobj, *last, *g2; | 2008 | t_gobj *newgobj, *last, *g2; |
2009 | #endif /* ROCKBOX */ | ||
1916 | int dspstate = canvas_suspend_dsp(), nbox, count; | 2010 | int dspstate = canvas_suspend_dsp(), nbox, count; |
1917 | 2011 | ||
1918 | canvas_editmode(x, 1.); | 2012 | canvas_editmode(x, 1.); |
@@ -1987,9 +2081,11 @@ void canvas_connect(t_canvas *x, t_floatarg fwhoout, t_floatarg foutno, | |||
1987 | if (!(oc = obj_connect(objsrc, outno, objsink, inno))) goto bad; | 2081 | if (!(oc = obj_connect(objsrc, outno, objsink, inno))) goto bad; |
1988 | if (glist_isvisible(x)) | 2082 | if (glist_isvisible(x)) |
1989 | { | 2083 | { |
2084 | #ifndef ROCKBOX | ||
1990 | sys_vgui(".x%x.c create line %d %d %d %d -width %d -tags l%x\n", | 2085 | sys_vgui(".x%x.c create line %d %d %d %d -width %d -tags l%x\n", |
1991 | glist_getcanvas(x), 0, 0, 0, 0, | 2086 | glist_getcanvas(x), 0, 0, 0, 0, |
1992 | (obj_issignaloutlet(objsrc, outno) ? 2 : 1),oc); | 2087 | (obj_issignaloutlet(objsrc, outno) ? 2 : 1),oc); |
2088 | #endif | ||
1993 | canvas_fixlinesfor(x, objsrc); | 2089 | canvas_fixlinesfor(x, objsrc); |
1994 | } | 2090 | } |
1995 | return; | 2091 | return; |
@@ -2008,7 +2104,11 @@ bad: | |||
2008 | /* LATER might have to speed this up */ | 2104 | /* LATER might have to speed this up */ |
2009 | static void canvas_tidy(t_canvas *x) | 2105 | static void canvas_tidy(t_canvas *x) |
2010 | { | 2106 | { |
2107 | #ifdef ROCKBOX | ||
2108 | t_gobj *y, *y2; | ||
2109 | #else /* ROCKBOX */ | ||
2011 | t_gobj *y, *y2, *y3; | 2110 | t_gobj *y, *y2, *y3; |
2111 | #endif /* ROCKBOX */ | ||
2012 | int ax1, ay1, ax2, ay2, bx1, by1, bx2, by2; | 2112 | int ax1, ay1, ax2, ay2, bx1, by1, bx2, by2; |
2013 | int histogram[NHIST], *ip, i, besthist, bestdist; | 2113 | int histogram[NHIST], *ip, i, besthist, bestdist; |
2014 | /* if nobody is selected, this means do it to all boxes; | 2114 | /* if nobody is selected, this means do it to all boxes; |
@@ -2114,15 +2214,19 @@ static void canvas_texteditor(t_canvas *x) | |||
2114 | t_rtext *foo; | 2214 | t_rtext *foo; |
2115 | char *buf; | 2215 | char *buf; |
2116 | int bufsize; | 2216 | int bufsize; |
2117 | if (foo = x->gl_editor->e_textedfor) | 2217 | if((foo = x->gl_editor->e_textedfor)) |
2118 | rtext_gettext(foo, &buf, &bufsize); | 2218 | rtext_gettext(foo, &buf, &bufsize); |
2119 | else buf = "", bufsize = 0; | 2219 | else buf = "", bufsize = 0; |
2220 | #ifndef ROCKBOX | ||
2120 | sys_vgui("pdtk_pd_texteditor {%.*s}\n", bufsize, buf); | 2221 | sys_vgui("pdtk_pd_texteditor {%.*s}\n", bufsize, buf); |
2121 | 2222 | #endif | |
2122 | } | 2223 | } |
2123 | 2224 | ||
2124 | void glob_key(void *dummy, t_symbol *s, int ac, t_atom *av) | 2225 | void glob_key(void *dummy, t_symbol *s, int ac, t_atom *av) |
2125 | { | 2226 | { |
2227 | #ifdef ROCKBOX | ||
2228 | (void) dummy; | ||
2229 | #endif | ||
2126 | /* canvas_editing can be zero; canvas_key checks for that */ | 2230 | /* canvas_editing can be zero; canvas_key checks for that */ |
2127 | canvas_key(canvas_editing, s, ac, av); | 2231 | canvas_key(canvas_editing, s, ac, av); |
2128 | } | 2232 | } |
@@ -2141,8 +2245,10 @@ void canvas_editmode(t_canvas *x, t_floatarg fyesplease) | |||
2141 | if (glist_isvisible(x) && glist_istoplevel(x)) | 2245 | if (glist_isvisible(x) && glist_istoplevel(x)) |
2142 | canvas_setcursor(x, CURSOR_RUNMODE_NOTHING); | 2246 | canvas_setcursor(x, CURSOR_RUNMODE_NOTHING); |
2143 | } | 2247 | } |
2248 | #ifndef ROCKBOX | ||
2144 | sys_vgui("pdtk_canvas_editval .x%x %d\n", | 2249 | sys_vgui("pdtk_canvas_editval .x%x %d\n", |
2145 | glist_getcanvas(x), x->gl_edit); | 2250 | glist_getcanvas(x), x->gl_edit); |
2251 | #endif | ||
2146 | } | 2252 | } |
2147 | 2253 | ||
2148 | /* called by canvas_font below */ | 2254 | /* called by canvas_font below */ |
@@ -2188,7 +2294,9 @@ static void canvas_font(t_canvas *x, t_floatarg font, t_floatarg resize, | |||
2188 | if (whichresize != 3) realresx = realresize; | 2294 | if (whichresize != 3) realresx = realresize; |
2189 | if (whichresize != 2) realresy = realresize; | 2295 | if (whichresize != 2) realresy = realresize; |
2190 | canvas_dofont(x2, font, realresx, realresy); | 2296 | canvas_dofont(x2, font, realresx, realresy); |
2297 | #ifndef ROCKBOX | ||
2191 | sys_defaultfont = font; | 2298 | sys_defaultfont = font; |
2299 | #endif | ||
2192 | } | 2300 | } |
2193 | 2301 | ||
2194 | static t_glist *canvas_last_glist; | 2302 | static t_glist *canvas_last_glist; |
diff --git a/apps/plugins/pdbox/PDa/src/g_graph.c b/apps/plugins/pdbox/PDa/src/g_graph.c index c81bac10b8..a3d1798733 100644 --- a/apps/plugins/pdbox/PDa/src/g_graph.c +++ b/apps/plugins/pdbox/PDa/src/g_graph.c | |||
@@ -6,12 +6,21 @@ | |||
6 | "graphs" inside another glist. LATER move the inlet/outlet code of g_canvas.c | 6 | "graphs" inside another glist. LATER move the inlet/outlet code of g_canvas.c |
7 | to this file... */ | 7 | to this file... */ |
8 | 8 | ||
9 | #ifdef ROCKBOX | ||
10 | #include "plugin.h" | ||
11 | #include "pdbox.h" | ||
12 | #include "m_pd.h" | ||
13 | #include "g_canvas.h" | ||
14 | #define snprintf rb->snprintf | ||
15 | #define atof rb_atof | ||
16 | #else /* ROCKBOX */ | ||
9 | #include <stdlib.h> | 17 | #include <stdlib.h> |
10 | #include "m_pd.h" | 18 | #include "m_pd.h" |
11 | #include "t_tk.h" | 19 | #include "t_tk.h" |
12 | #include "g_canvas.h" | 20 | #include "g_canvas.h" |
13 | #include <stdio.h> | 21 | #include <stdio.h> |
14 | #include <string.h> | 22 | #include <string.h> |
23 | #endif /* ROCKBOX */ | ||
15 | 24 | ||
16 | /* ---------------------- forward definitions ----------------- */ | 25 | /* ---------------------- forward definitions ----------------- */ |
17 | 26 | ||
@@ -80,7 +89,11 @@ void glist_delete(t_glist *x, t_gobj *y) | |||
80 | if (gl->gl_isgraph) | 89 | if (gl->gl_isgraph) |
81 | { | 90 | { |
82 | char tag[80]; | 91 | char tag[80]; |
92 | #ifdef ROCKBOX | ||
93 | snprintf(tag, sizeof(tag)-1, "graph%x", (int)gl); | ||
94 | #else /* ROCKBOX */ | ||
83 | sprintf(tag, "graph%x", (int)gl); | 95 | sprintf(tag, "graph%x", (int)gl); |
96 | #endif /* ROCKBOX */ | ||
84 | glist_eraseiofor(x, &gl->gl_obj, tag); | 97 | glist_eraseiofor(x, &gl->gl_obj, tag); |
85 | } | 98 | } |
86 | else | 99 | else |
@@ -112,16 +125,22 @@ void glist_delete(t_glist *x, t_gobj *y) | |||
112 | /* remove every object from a glist. Experimental. */ | 125 | /* remove every object from a glist. Experimental. */ |
113 | void glist_clear(t_glist *x) | 126 | void glist_clear(t_glist *x) |
114 | { | 127 | { |
128 | #ifdef ROCKBOX | ||
129 | t_gobj *y; | ||
130 | #else | ||
115 | t_gobj *y, *y2; | 131 | t_gobj *y, *y2; |
132 | #endif | ||
116 | int dspstate = canvas_suspend_dsp(); | 133 | int dspstate = canvas_suspend_dsp(); |
117 | while (y = x->gl_list) | 134 | while((y = x->gl_list)) |
118 | glist_delete(x, y); | 135 | glist_delete(x, y); |
119 | canvas_resume_dsp(dspstate); | 136 | canvas_resume_dsp(dspstate); |
120 | } | 137 | } |
121 | 138 | ||
122 | void glist_retext(t_glist *glist, t_text *y) | 139 | void glist_retext(t_glist *glist, t_text *y) |
123 | { | 140 | { |
141 | #ifndef ROCKBOX | ||
124 | t_canvas *c = glist_getcanvas(glist); | 142 | t_canvas *c = glist_getcanvas(glist); |
143 | #endif | ||
125 | /* check that we have built rtexts yet. LATER need a better test. */ | 144 | /* check that we have built rtexts yet. LATER need a better test. */ |
126 | if (glist->gl_editor && glist->gl_editor->e_rtext) | 145 | if (glist->gl_editor && glist->gl_editor->e_rtext) |
127 | { | 146 | { |
@@ -167,6 +186,9 @@ static t_gobj *glist_merge(t_glist *x, t_gobj *g1, t_gobj *g2) | |||
167 | { | 186 | { |
168 | t_gobj *g = 0, *g9 = 0; | 187 | t_gobj *g = 0, *g9 = 0; |
169 | float f1 = 0, f2 = 0; | 188 | float f1 = 0, f2 = 0; |
189 | #ifdef ROCKBOX | ||
190 | (void) x; | ||
191 | #endif | ||
170 | if (g1) | 192 | if (g1) |
171 | f1 = gobj_getxforsort(g1); | 193 | f1 = gobj_getxforsort(g1); |
172 | if (g2) | 194 | if (g2) |
@@ -190,7 +212,7 @@ static t_gobj *glist_merge(t_glist *x, t_gobj *g1, t_gobj *g2) | |||
190 | if (g9) | 212 | if (g9) |
191 | g9->g_next = g1, g9 = g1; | 213 | g9->g_next = g1, g9 = g1; |
192 | else g9 = g = g1; | 214 | else g9 = g = g1; |
193 | if (g1 = g1->g_next) | 215 | if((g1 = g1->g_next)) |
194 | f1 = gobj_getxforsort(g1); | 216 | f1 = gobj_getxforsort(g1); |
195 | g9->g_next = 0; | 217 | g9->g_next = 0; |
196 | continue; | 218 | continue; |
@@ -198,7 +220,7 @@ static t_gobj *glist_merge(t_glist *x, t_gobj *g1, t_gobj *g2) | |||
198 | if (g9) | 220 | if (g9) |
199 | g9->g_next = g2, g9 = g2; | 221 | g9->g_next = g2, g9 = g2; |
200 | else g9 = g = g2; | 222 | else g9 = g = g2; |
201 | if (g2 = g2->g_next) | 223 | if((g2 = g2->g_next)) |
202 | f2 = gobj_getxforsort(g2); | 224 | f2 = gobj_getxforsort(g2); |
203 | g9->g_next = 0; | 225 | g9->g_next = 0; |
204 | continue; | 226 | continue; |
@@ -333,6 +355,9 @@ void canvas_resortinlets(t_canvas *x) | |||
333 | t_outlet *canvas_addoutlet(t_canvas *x, t_pd *who, t_symbol *s) | 355 | t_outlet *canvas_addoutlet(t_canvas *x, t_pd *who, t_symbol *s) |
334 | { | 356 | { |
335 | t_outlet *op = outlet_new(&x->gl_obj, s); | 357 | t_outlet *op = outlet_new(&x->gl_obj, s); |
358 | #ifdef ROCKBOX | ||
359 | (void) who; | ||
360 | #endif | ||
336 | if (!x->gl_loading && x->gl_owner && glist_isvisible(x->gl_owner)) | 361 | if (!x->gl_loading && x->gl_owner && glist_isvisible(x->gl_owner)) |
337 | { | 362 | { |
338 | gobj_vis(&x->gl_gobj, x->gl_owner, 0); | 363 | gobj_vis(&x->gl_gobj, x->gl_owner, 0); |
@@ -444,6 +469,9 @@ static void graph_yticks(t_glist *x, | |||
444 | static void graph_xlabel(t_glist *x, t_symbol *s, int argc, t_atom *argv) | 469 | static void graph_xlabel(t_glist *x, t_symbol *s, int argc, t_atom *argv) |
445 | { | 470 | { |
446 | int i; | 471 | int i; |
472 | #ifdef ROCKBOX | ||
473 | (void) s; | ||
474 | #endif | ||
447 | if (argc < 1) error("graph_xlabel: no y value given"); | 475 | if (argc < 1) error("graph_xlabel: no y value given"); |
448 | else | 476 | else |
449 | { | 477 | { |
@@ -460,6 +488,9 @@ static void graph_xlabel(t_glist *x, t_symbol *s, int argc, t_atom *argv) | |||
460 | static void graph_ylabel(t_glist *x, t_symbol *s, int argc, t_atom *argv) | 488 | static void graph_ylabel(t_glist *x, t_symbol *s, int argc, t_atom *argv) |
461 | { | 489 | { |
462 | int i; | 490 | int i; |
491 | #ifdef ROCKBOX | ||
492 | (void) s; | ||
493 | #endif | ||
463 | if (argc < 1) error("graph_ylabel: no x value given"); | 494 | if (argc < 1) error("graph_ylabel: no x value given"); |
464 | else | 495 | else |
465 | { | 496 | { |
@@ -613,10 +644,14 @@ void glist_redraw(t_glist *x) | |||
613 | } | 644 | } |
614 | /* redraw all the lines */ | 645 | /* redraw all the lines */ |
615 | linetraverser_start(&t, x); | 646 | linetraverser_start(&t, x); |
616 | while (oc = linetraverser_next(&t)) | 647 | while((oc = linetraverser_next(&t))) |
648 | #ifdef ROCKBOX | ||
649 | ; | ||
650 | #else /* ROCKBOX */ | ||
617 | sys_vgui(".x%x.c coords l%x %d %d %d %d\n", | 651 | sys_vgui(".x%x.c coords l%x %d %d %d %d\n", |
618 | glist_getcanvas(x), oc, | 652 | glist_getcanvas(x), oc, |
619 | t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2); | 653 | t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2); |
654 | #endif /* ROCKBOX */ | ||
620 | } | 655 | } |
621 | if (x->gl_owner) | 656 | if (x->gl_owner) |
622 | { | 657 | { |
@@ -651,7 +686,11 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) | |||
651 | if (!vis) | 686 | if (!vis) |
652 | rtext_erase(glist_findrtext(parent_glist, &x->gl_obj)); | 687 | rtext_erase(glist_findrtext(parent_glist, &x->gl_obj)); |
653 | 688 | ||
689 | #ifdef ROCKBOX | ||
690 | snprintf(tag, sizeof(tag)-1, "graph%x", (int) x); | ||
691 | #else | ||
654 | sprintf(tag, "graph%x", (int)x); | 692 | sprintf(tag, "graph%x", (int)x); |
693 | #endif | ||
655 | if (vis) | 694 | if (vis) |
656 | glist_drawiofor(parent_glist, &x->gl_obj, 1, | 695 | glist_drawiofor(parent_glist, &x->gl_obj, 1, |
657 | tag, x1, y1, x2, y2); | 696 | tag, x1, y1, x2, y2); |
@@ -660,6 +699,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) | |||
660 | just show the bounding rectangle */ | 699 | just show the bounding rectangle */ |
661 | if (x->gl_havewindow) | 700 | if (x->gl_havewindow) |
662 | { | 701 | { |
702 | #ifndef ROCKBOX | ||
663 | if (vis) | 703 | if (vis) |
664 | { | 704 | { |
665 | sys_vgui(".x%x.c create polygon\ | 705 | sys_vgui(".x%x.c create polygon\ |
@@ -672,6 +712,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) | |||
672 | sys_vgui(".x%x.c delete %s\n", | 712 | sys_vgui(".x%x.c delete %s\n", |
673 | glist_getcanvas(x->gl_owner), tag); | 713 | glist_getcanvas(x->gl_owner), tag); |
674 | } | 714 | } |
715 | #endif | ||
675 | return; | 716 | return; |
676 | } | 717 | } |
677 | /* otherwise draw (or erase) us as a graph inside another glist. */ | 718 | /* otherwise draw (or erase) us as a graph inside another glist. */ |
@@ -681,10 +722,12 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) | |||
681 | float f; | 722 | float f; |
682 | 723 | ||
683 | /* draw a rectangle around the graph */ | 724 | /* draw a rectangle around the graph */ |
725 | #ifndef ROCKBOX | ||
684 | sys_vgui(".x%x.c create line\ | 726 | sys_vgui(".x%x.c create line\ |
685 | %d %d %d %d %d %d %d %d %d %d -tags %s\n", | 727 | %d %d %d %d %d %d %d %d %d %d -tags %s\n", |
686 | glist_getcanvas(x->gl_owner), | 728 | glist_getcanvas(x->gl_owner), |
687 | x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, tag); | 729 | x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, tag); |
730 | #endif | ||
688 | 731 | ||
689 | /* draw ticks on horizontal borders. If lperb field is | 732 | /* draw ticks on horizontal borders. If lperb field is |
690 | zero, this is disabled. */ | 733 | zero, this is disabled. */ |
@@ -698,6 +741,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) | |||
698 | f < 0.99 * x->gl_x2 + 0.01*x->gl_x1; i++, | 741 | f < 0.99 * x->gl_x2 + 0.01*x->gl_x1; i++, |
699 | f += x->gl_xtick.k_inc) | 742 | f += x->gl_xtick.k_inc) |
700 | { | 743 | { |
744 | #ifndef ROCKBOX | ||
701 | int tickpix = (i % x->gl_xtick.k_lperb ? 2 : 4); | 745 | int tickpix = (i % x->gl_xtick.k_lperb ? 2 : 4); |
702 | sys_vgui(".x%x.c create line %d %d %d %d -tags %s\n", | 746 | sys_vgui(".x%x.c create line %d %d %d %d -tags %s\n", |
703 | glist_getcanvas(x->gl_owner), | 747 | glist_getcanvas(x->gl_owner), |
@@ -707,11 +751,13 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) | |||
707 | glist_getcanvas(x->gl_owner), | 751 | glist_getcanvas(x->gl_owner), |
708 | (int)glist_xtopixels(x, f), (int)lpix, | 752 | (int)glist_xtopixels(x, f), (int)lpix, |
709 | (int)glist_xtopixels(x, f), (int)lpix + tickpix, tag); | 753 | (int)glist_xtopixels(x, f), (int)lpix + tickpix, tag); |
754 | #endif | ||
710 | } | 755 | } |
711 | for (i = 1, f = x->gl_xtick.k_point - x->gl_xtick.k_inc; | 756 | for (i = 1, f = x->gl_xtick.k_point - x->gl_xtick.k_inc; |
712 | f > 0.99 * x->gl_x1 + 0.01*x->gl_x2; | 757 | f > 0.99 * x->gl_x1 + 0.01*x->gl_x2; |
713 | i++, f -= x->gl_xtick.k_inc) | 758 | i++, f -= x->gl_xtick.k_inc) |
714 | { | 759 | { |
760 | #ifndef ROCKBOX | ||
715 | int tickpix = (i % x->gl_xtick.k_lperb ? 2 : 4); | 761 | int tickpix = (i % x->gl_xtick.k_lperb ? 2 : 4); |
716 | sys_vgui(".x%x.c create line %d %d %d %d -tags %s\n", | 762 | sys_vgui(".x%x.c create line %d %d %d %d -tags %s\n", |
717 | glist_getcanvas(x->gl_owner), | 763 | glist_getcanvas(x->gl_owner), |
@@ -721,6 +767,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) | |||
721 | glist_getcanvas(x->gl_owner), | 767 | glist_getcanvas(x->gl_owner), |
722 | (int)glist_xtopixels(x, f), (int)lpix, | 768 | (int)glist_xtopixels(x, f), (int)lpix, |
723 | (int)glist_xtopixels(x, f), (int)lpix + tickpix, tag); | 769 | (int)glist_xtopixels(x, f), (int)lpix + tickpix, tag); |
770 | #endif | ||
724 | } | 771 | } |
725 | } | 772 | } |
726 | 773 | ||
@@ -735,6 +782,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) | |||
735 | f < 0.99 * ubound + 0.01 * lbound; | 782 | f < 0.99 * ubound + 0.01 * lbound; |
736 | i++, f += x->gl_ytick.k_inc) | 783 | i++, f += x->gl_ytick.k_inc) |
737 | { | 784 | { |
785 | #ifndef ROCKBOX | ||
738 | int tickpix = (i % x->gl_ytick.k_lperb ? 2 : 4); | 786 | int tickpix = (i % x->gl_ytick.k_lperb ? 2 : 4); |
739 | sys_vgui(".x%x.c create line %d %d %d %d -tags %s\n", | 787 | sys_vgui(".x%x.c create line %d %d %d %d -tags %s\n", |
740 | glist_getcanvas(x->gl_owner), | 788 | glist_getcanvas(x->gl_owner), |
@@ -744,11 +792,13 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) | |||
744 | glist_getcanvas(x->gl_owner), | 792 | glist_getcanvas(x->gl_owner), |
745 | x2, (int)glist_ytopixels(x, f), | 793 | x2, (int)glist_ytopixels(x, f), |
746 | x2 - tickpix, (int)glist_ytopixels(x, f), tag); | 794 | x2 - tickpix, (int)glist_ytopixels(x, f), tag); |
795 | #endif | ||
747 | } | 796 | } |
748 | for (i = 1, f = x->gl_ytick.k_point - x->gl_ytick.k_inc; | 797 | for (i = 1, f = x->gl_ytick.k_point - x->gl_ytick.k_inc; |
749 | f > 0.99 * lbound + 0.01 * ubound; | 798 | f > 0.99 * lbound + 0.01 * ubound; |
750 | i++, f -= x->gl_ytick.k_inc) | 799 | i++, f -= x->gl_ytick.k_inc) |
751 | { | 800 | { |
801 | #ifndef ROCKBOX | ||
752 | int tickpix = (i % x->gl_ytick.k_lperb ? 2 : 4); | 802 | int tickpix = (i % x->gl_ytick.k_lperb ? 2 : 4); |
753 | sys_vgui(".x%x.c create line %d %d %d %d -tags %s\n", | 803 | sys_vgui(".x%x.c create line %d %d %d %d -tags %s\n", |
754 | glist_getcanvas(x->gl_owner), | 804 | glist_getcanvas(x->gl_owner), |
@@ -758,19 +808,27 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) | |||
758 | glist_getcanvas(x->gl_owner), | 808 | glist_getcanvas(x->gl_owner), |
759 | x2, (int)glist_ytopixels(x, f), | 809 | x2, (int)glist_ytopixels(x, f), |
760 | x2 - tickpix, (int)glist_ytopixels(x, f), tag); | 810 | x2 - tickpix, (int)glist_ytopixels(x, f), tag); |
811 | #endif | ||
761 | } | 812 | } |
762 | } | 813 | } |
763 | /* draw x labels */ | 814 | /* draw x labels */ |
764 | for (i = 0; i < x->gl_nxlabels; i++) | 815 | for (i = 0; i < x->gl_nxlabels; i++) |
816 | #ifdef ROCKBOX | ||
817 | ; | ||
818 | #else /* ROCKBOX */ | ||
765 | sys_vgui(".x%x.c create text\ | 819 | sys_vgui(".x%x.c create text\ |
766 | %d %d -text {%s} -font -*-courier-bold--normal--%d-* -tags %s\n", | 820 | %d %d -text {%s} -font -*-courier-bold--normal--%d-* -tags %s\n", |
767 | glist_getcanvas(x), | 821 | glist_getcanvas(x), |
768 | (int)glist_xtopixels(x, atof(x->gl_xlabel[i]->s_name)), | 822 | (int)glist_xtopixels(x, atof(x->gl_xlabel[i]->s_name)), |
769 | (int)glist_ytopixels(x, x->gl_xlabely), x->gl_xlabel[i]->s_name, | 823 | (int)glist_ytopixels(x, x->gl_xlabely), x->gl_xlabel[i]->s_name, |
770 | glist_getfont(x), tag); | 824 | glist_getfont(x), tag); |
825 | #endif /* ROCKBOX */ | ||
771 | 826 | ||
772 | /* draw y labels */ | 827 | /* draw y labels */ |
773 | for (i = 0; i < x->gl_nylabels; i++) | 828 | for (i = 0; i < x->gl_nylabels; i++) |
829 | #ifdef ROCKBOX | ||
830 | ; | ||
831 | #else /* ROCKBOX */ | ||
774 | sys_vgui(".x%x.c create text\ | 832 | sys_vgui(".x%x.c create text\ |
775 | %d %d -text {%s} -font -*-courier-bold--normal--%d-* -tags %s\n", | 833 | %d %d -text {%s} -font -*-courier-bold--normal--%d-* -tags %s\n", |
776 | glist_getcanvas(x), | 834 | glist_getcanvas(x), |
@@ -778,6 +836,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) | |||
778 | (int)glist_ytopixels(x, atof(x->gl_ylabel[i]->s_name)), | 836 | (int)glist_ytopixels(x, atof(x->gl_ylabel[i]->s_name)), |
779 | x->gl_ylabel[i]->s_name, | 837 | x->gl_ylabel[i]->s_name, |
780 | glist_getfont(x), tag); | 838 | glist_getfont(x), tag); |
839 | #endif /* ROCKBOX */ | ||
781 | 840 | ||
782 | /* draw contents of graph as glist */ | 841 | /* draw contents of graph as glist */ |
783 | for (g = x->gl_list; g; g = g->g_next) | 842 | for (g = x->gl_list; g; g = g->g_next) |
@@ -785,8 +844,10 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) | |||
785 | } | 844 | } |
786 | else | 845 | else |
787 | { | 846 | { |
847 | #ifndef ROCKBOX | ||
788 | sys_vgui(".x%x.c delete %s\n", | 848 | sys_vgui(".x%x.c delete %s\n", |
789 | glist_getcanvas(x->gl_owner), tag); | 849 | glist_getcanvas(x->gl_owner), tag); |
850 | #endif | ||
790 | for (g = x->gl_list; g; g = g->g_next) | 851 | for (g = x->gl_list; g; g = g->g_next) |
791 | gobj_vis(g, x, 0); | 852 | gobj_vis(g, x, 0); |
792 | } | 853 | } |
@@ -904,10 +965,12 @@ static void graph_select(t_gobj *z, t_glist *glist, int state) | |||
904 | t_rtext *y = glist_findrtext(glist, &x->gl_obj); | 965 | t_rtext *y = glist_findrtext(glist, &x->gl_obj); |
905 | if (canvas_showtext(x)) | 966 | if (canvas_showtext(x)) |
906 | rtext_select(y, state); | 967 | rtext_select(y, state); |
968 | #ifndef ROCKBOX | ||
907 | sys_vgui(".x%x.c itemconfigure %sR -fill %s\n", glist, | 969 | sys_vgui(".x%x.c itemconfigure %sR -fill %s\n", glist, |
908 | rtext_gettag(y), (state? "blue" : "black")); | 970 | rtext_gettag(y), (state? "blue" : "black")); |
909 | sys_vgui(".x%x.c itemconfigure graph%x -fill %s\n", | 971 | sys_vgui(".x%x.c itemconfigure graph%x -fill %s\n", |
910 | glist_getcanvas(glist), z, (state? "blue" : "black")); | 972 | glist_getcanvas(glist), z, (state? "blue" : "black")); |
973 | #endif | ||
911 | } | 974 | } |
912 | } | 975 | } |
913 | 976 | ||
@@ -941,10 +1004,11 @@ static void graph_delete(t_gobj *z, t_glist *glist) | |||
941 | t_glist *x = (t_glist *)z; | 1004 | t_glist *x = (t_glist *)z; |
942 | t_gobj *y; | 1005 | t_gobj *y; |
943 | text_widgetbehavior.w_deletefn(z, glist); | 1006 | text_widgetbehavior.w_deletefn(z, glist); |
944 | while (y = x->gl_list) | 1007 | while((y = x->gl_list)) |
945 | glist_delete(x, y); | 1008 | glist_delete(x, y); |
946 | } | 1009 | } |
947 | 1010 | ||
1011 | #ifndef ROCKBOX | ||
948 | static float graph_lastxpix, graph_lastypix; | 1012 | static float graph_lastxpix, graph_lastypix; |
949 | 1013 | ||
950 | static void graph_motion(void *z, t_floatarg dx, t_floatarg dy) | 1014 | static void graph_motion(void *z, t_floatarg dx, t_floatarg dy) |
@@ -986,6 +1050,7 @@ static void graph_motion(void *z, t_floatarg dx, t_floatarg dy) | |||
986 | else vec[newx] = newy; | 1050 | else vec[newx] = newy; |
987 | garray_redraw(a); | 1051 | garray_redraw(a); |
988 | } | 1052 | } |
1053 | #endif | ||
989 | 1054 | ||
990 | static int graph_click(t_gobj *z, struct _glist *glist, | 1055 | static int graph_click(t_gobj *z, struct _glist *glist, |
991 | int xpix, int ypix, int shift, int alt, int dbl, int doit) | 1056 | int xpix, int ypix, int shift, int alt, int dbl, int doit) |
@@ -1037,11 +1102,16 @@ void graph_properties(t_gobj *z, t_glist *owner) | |||
1037 | t_glist *x = (t_glist *)z; | 1102 | t_glist *x = (t_glist *)z; |
1038 | { | 1103 | { |
1039 | t_gobj *y; | 1104 | t_gobj *y; |
1105 | #ifdef ROCKBOX | ||
1106 | (void) owner; | ||
1107 | #else /* ROCKBOX */ | ||
1040 | char graphbuf[200]; | 1108 | char graphbuf[200]; |
1109 | |||
1041 | sprintf(graphbuf, "pdtk_graph_dialog %%s %g %g %g %g %d %d\n", | 1110 | sprintf(graphbuf, "pdtk_graph_dialog %%s %g %g %g %g %d %d\n", |
1042 | x->gl_x1, x->gl_y1, x->gl_x2, x->gl_y2, | 1111 | x->gl_x1, x->gl_y1, x->gl_x2, x->gl_y2, |
1043 | x->gl_pixwidth, x->gl_pixheight); | 1112 | x->gl_pixwidth, x->gl_pixheight); |
1044 | gfxstub_new(&x->gl_pd, x, graphbuf); | 1113 | gfxstub_new(&x->gl_pd, x, graphbuf); |
1114 | #endif /* ROCKBOX */ | ||
1045 | 1115 | ||
1046 | for (y = x->gl_list; y; y = y->g_next) | 1116 | for (y = x->gl_list; y; y = y->g_next) |
1047 | if (pd_class(&y->g_pd) == garray_class) | 1117 | if (pd_class(&y->g_pd) == garray_class) |
@@ -1071,6 +1141,9 @@ static void graph_dialog(t_glist *x, t_symbol *s, int argc, t_atom *argv) | |||
1071 | t_float y2 = atom_getfloatarg(3, argc, argv); | 1141 | t_float y2 = atom_getfloatarg(3, argc, argv); |
1072 | t_float xpix = atom_getfloatarg(4, argc, argv); | 1142 | t_float xpix = atom_getfloatarg(4, argc, argv); |
1073 | t_float ypix = atom_getfloatarg(5, argc, argv); | 1143 | t_float ypix = atom_getfloatarg(5, argc, argv); |
1144 | #ifdef ROCKBOX | ||
1145 | (void) s; | ||
1146 | #endif | ||
1074 | if (x1 != x->gl_x1 || x2 != x->gl_x2 || | 1147 | if (x1 != x->gl_x1 || x2 != x->gl_x2 || |
1075 | y1 != x->gl_y1 || y2 != x->gl_y2) | 1148 | y1 != x->gl_y1 || y2 != x->gl_y2) |
1076 | graph_bounds(x, x1, y1, x2, y2); | 1149 | graph_bounds(x, x1, y1, x2, y2); |
diff --git a/apps/plugins/pdbox/PDa/src/g_hdial.c b/apps/plugins/pdbox/PDa/src/g_hdial.c index eb88f22e2d..4bf2e0ad50 100644 --- a/apps/plugins/pdbox/PDa/src/g_hdial.c +++ b/apps/plugins/pdbox/PDa/src/g_hdial.c | |||
@@ -8,6 +8,13 @@ | |||
8 | /* name change to hradio by MSP and changed to | 8 | /* name change to hradio by MSP and changed to |
9 | put out a "float" as in sliders, toggles, etc. */ | 9 | put out a "float" as in sliders, toggles, etc. */ |
10 | 10 | ||
11 | #ifdef ROCKBOX | ||
12 | #include "plugin.h" | ||
13 | #include "pdbox.h" | ||
14 | #include "m_pd.h" | ||
15 | #include "g_canvas.h" | ||
16 | #include "g_all_guis.h" | ||
17 | #else /* ROCKBOX */ | ||
11 | #include <stdlib.h> | 18 | #include <stdlib.h> |
12 | #include <string.h> | 19 | #include <string.h> |
13 | #include <stdio.h> | 20 | #include <stdio.h> |
@@ -23,6 +30,7 @@ put out a "float" as in sliders, toggles, etc. */ | |||
23 | #else | 30 | #else |
24 | #include <unistd.h> | 31 | #include <unistd.h> |
25 | #endif | 32 | #endif |
33 | #endif /* ROCKBOX */ | ||
26 | 34 | ||
27 | /* ------------- hdl gui-horicontal dial ---------------------- */ | 35 | /* ------------- hdl gui-horicontal dial ---------------------- */ |
28 | 36 | ||
@@ -33,6 +41,10 @@ static t_class *hradio_class, *hradio_old_class; | |||
33 | 41 | ||
34 | void hradio_draw_update(t_hradio *x, t_glist *glist) | 42 | void hradio_draw_update(t_hradio *x, t_glist *glist) |
35 | { | 43 | { |
44 | #ifdef ROCKBOX | ||
45 | (void) x; | ||
46 | (void) glist; | ||
47 | #else /* ROCKBOX */ | ||
36 | if(glist_isvisible(glist)) | 48 | if(glist_isvisible(glist)) |
37 | { | 49 | { |
38 | t_canvas *canvas=glist_getcanvas(glist); | 50 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -44,10 +56,15 @@ void hradio_draw_update(t_hradio *x, t_glist *glist) | |||
44 | canvas, x, x->x_on, | 56 | canvas, x, x->x_on, |
45 | x->x_gui.x_fcol, x->x_gui.x_fcol); | 57 | x->x_gui.x_fcol, x->x_gui.x_fcol); |
46 | } | 58 | } |
59 | #endif /* ROCKBOX */ | ||
47 | } | 60 | } |
48 | 61 | ||
49 | void hradio_draw_new(t_hradio *x, t_glist *glist) | 62 | void hradio_draw_new(t_hradio *x, t_glist *glist) |
50 | { | 63 | { |
64 | #ifdef ROCKBOX | ||
65 | (void) x; | ||
66 | (void) glist; | ||
67 | #else /* ROCKBOX */ | ||
51 | t_canvas *canvas=glist_getcanvas(glist); | 68 | t_canvas *canvas=glist_getcanvas(glist); |
52 | int n=x->x_number, i, dx=x->x_gui.x_w, s4=dx/4; | 69 | int n=x->x_number, i, dx=x->x_gui.x_w, s4=dx/4; |
53 | int yy11=text_ypix(&x->x_gui.x_obj, glist), yy12=yy11+dx; | 70 | int yy11=text_ypix(&x->x_gui.x_obj, glist), yy12=yy11+dx; |
@@ -55,7 +72,6 @@ void hradio_draw_new(t_hradio *x, t_glist *glist) | |||
55 | int xx11b=text_xpix(&x->x_gui.x_obj, glist), xx11=xx11b, xx21=xx11b+s4; | 72 | int xx11b=text_xpix(&x->x_gui.x_obj, glist), xx11=xx11b, xx21=xx11b+s4; |
56 | int xx22=xx11b+dx-s4; | 73 | int xx22=xx11b+dx-s4; |
57 | 74 | ||
58 | |||
59 | for(i=0; i<n; i++) | 75 | for(i=0; i<n; i++) |
60 | { | 76 | { |
61 | sys_vgui(".x%x.c create rectangle %d %d %d %d -fill #%6.6x -tags %xBASE%d\n", | 77 | sys_vgui(".x%x.c create rectangle %d %d %d %d -fill #%6.6x -tags %xBASE%d\n", |
@@ -81,11 +97,15 @@ void hradio_draw_new(t_hradio *x, t_glist *glist) | |||
81 | if(!x->x_gui.x_fsf.x_rcv_able) | 97 | if(!x->x_gui.x_fsf.x_rcv_able) |
82 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xIN%d\n", | 98 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xIN%d\n", |
83 | canvas, xx11b, yy11, xx11b + IOWIDTH, yy11+1, x, 0); | 99 | canvas, xx11b, yy11, xx11b + IOWIDTH, yy11+1, x, 0); |
84 | 100 | #endif /* ROCKBOX */ | |
85 | } | 101 | } |
86 | 102 | ||
87 | void hradio_draw_move(t_hradio *x, t_glist *glist) | 103 | void hradio_draw_move(t_hradio *x, t_glist *glist) |
88 | { | 104 | { |
105 | #ifdef ROCKBOX | ||
106 | (void) x; | ||
107 | (void) glist; | ||
108 | #else /* ROCKBOX */ | ||
89 | t_canvas *canvas=glist_getcanvas(glist); | 109 | t_canvas *canvas=glist_getcanvas(glist); |
90 | int n=x->x_number, i, dx=x->x_gui.x_w, s4=dx/4; | 110 | int n=x->x_number, i, dx=x->x_gui.x_w, s4=dx/4; |
91 | int yy11=text_ypix(&x->x_gui.x_obj, glist), yy12=yy11+dx; | 111 | int yy11=text_ypix(&x->x_gui.x_obj, glist), yy12=yy11+dx; |
@@ -114,10 +134,15 @@ void hradio_draw_move(t_hradio *x, t_glist *glist) | |||
114 | if(!x->x_gui.x_fsf.x_rcv_able) | 134 | if(!x->x_gui.x_fsf.x_rcv_able) |
115 | sys_vgui(".x%x.c coords %xIN%d %d %d %d %d\n", | 135 | sys_vgui(".x%x.c coords %xIN%d %d %d %d %d\n", |
116 | canvas, x, 0, xx11b, yy11, xx11b + IOWIDTH, yy11+1); | 136 | canvas, x, 0, xx11b, yy11, xx11b + IOWIDTH, yy11+1); |
137 | #endif /* ROCKBOX */ | ||
117 | } | 138 | } |
118 | 139 | ||
119 | void hradio_draw_erase(t_hradio* x, t_glist* glist) | 140 | void hradio_draw_erase(t_hradio* x, t_glist* glist) |
120 | { | 141 | { |
142 | #ifdef ROCKBOX | ||
143 | (void) x; | ||
144 | (void) glist; | ||
145 | #else /* ROCKBOX */ | ||
121 | t_canvas *canvas=glist_getcanvas(glist); | 146 | t_canvas *canvas=glist_getcanvas(glist); |
122 | int n=x->x_number, i; | 147 | int n=x->x_number, i; |
123 | 148 | ||
@@ -131,10 +156,15 @@ void hradio_draw_erase(t_hradio* x, t_glist* glist) | |||
131 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); | 156 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); |
132 | if(!x->x_gui.x_fsf.x_rcv_able) | 157 | if(!x->x_gui.x_fsf.x_rcv_able) |
133 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 158 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
159 | #endif /* ROCKBOX */ | ||
134 | } | 160 | } |
135 | 161 | ||
136 | void hradio_draw_config(t_hradio* x, t_glist* glist) | 162 | void hradio_draw_config(t_hradio* x, t_glist* glist) |
137 | { | 163 | { |
164 | #ifdef ROCKBOX | ||
165 | (void) x; | ||
166 | (void) glist; | ||
167 | #else /* ROCKBOX */ | ||
138 | t_canvas *canvas=glist_getcanvas(glist); | 168 | t_canvas *canvas=glist_getcanvas(glist); |
139 | int n=x->x_number, i; | 169 | int n=x->x_number, i; |
140 | 170 | ||
@@ -150,10 +180,16 @@ void hradio_draw_config(t_hradio* x, t_glist* glist) | |||
150 | (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol, | 180 | (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol, |
151 | (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol); | 181 | (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol); |
152 | } | 182 | } |
183 | #endif | ||
153 | } | 184 | } |
154 | 185 | ||
155 | void hradio_draw_io(t_hradio* x, t_glist* glist, int old_snd_rcv_flags) | 186 | void hradio_draw_io(t_hradio* x, t_glist* glist, int old_snd_rcv_flags) |
156 | { | 187 | { |
188 | #ifdef ROCKBOX | ||
189 | (void) x; | ||
190 | (void) glist; | ||
191 | (void) old_snd_rcv_flags; | ||
192 | #else /* ROCKBOX */ | ||
157 | t_canvas *canvas=glist_getcanvas(glist); | 193 | t_canvas *canvas=glist_getcanvas(glist); |
158 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 194 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
159 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 195 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
@@ -173,10 +209,15 @@ void hradio_draw_io(t_hradio* x, t_glist* glist, int old_snd_rcv_flags) | |||
173 | xpos + IOWIDTH, ypos+1, x, 0); | 209 | xpos + IOWIDTH, ypos+1, x, 0); |
174 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) | 210 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) |
175 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 211 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
212 | #endif /* ROCKBOX */ | ||
176 | } | 213 | } |
177 | 214 | ||
178 | void hradio_draw_select(t_hradio* x, t_glist* glist) | 215 | void hradio_draw_select(t_hradio* x, t_glist* glist) |
179 | { | 216 | { |
217 | #ifdef ROCKBOX | ||
218 | (void) x; | ||
219 | (void) glist; | ||
220 | #else /* ROCKBOX */ | ||
180 | t_canvas *canvas=glist_getcanvas(glist); | 221 | t_canvas *canvas=glist_getcanvas(glist); |
181 | int n=x->x_number, i; | 222 | int n=x->x_number, i; |
182 | 223 | ||
@@ -199,6 +240,7 @@ void hradio_draw_select(t_hradio* x, t_glist* glist) | |||
199 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, | 240 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, |
200 | x->x_gui.x_lcol); | 241 | x->x_gui.x_lcol); |
201 | } | 242 | } |
243 | #endif /* ROCKBOX */ | ||
202 | } | 244 | } |
203 | 245 | ||
204 | void hradio_draw(t_hradio *x, t_glist *glist, int mode) | 246 | void hradio_draw(t_hradio *x, t_glist *glist, int mode) |
@@ -254,6 +296,10 @@ static void hradio_save(t_gobj *z, t_binbuf *b) | |||
254 | 296 | ||
255 | static void hradio_properties(t_gobj *z, t_glist *owner) | 297 | static void hradio_properties(t_gobj *z, t_glist *owner) |
256 | { | 298 | { |
299 | #ifdef ROCKBOX | ||
300 | (void) z; | ||
301 | (void) owner; | ||
302 | #else /* ROCKBOX */ | ||
257 | t_hradio *x = (t_hradio *)z; | 303 | t_hradio *x = (t_hradio *)z; |
258 | char buf[800]; | 304 | char buf[800]; |
259 | t_symbol *srl[3]; | 305 | t_symbol *srl[3]; |
@@ -278,6 +324,7 @@ static void hradio_properties(t_gobj *z, t_glist *owner) | |||
278 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, | 324 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, |
279 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol); | 325 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol); |
280 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); | 326 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); |
327 | #endif /* ROCKBOX */ | ||
281 | } | 328 | } |
282 | 329 | ||
283 | static void hradio_dialog(t_hradio *x, t_symbol *s, int argc, t_atom *argv) | 330 | static void hradio_dialog(t_hradio *x, t_symbol *s, int argc, t_atom *argv) |
@@ -288,6 +335,10 @@ static void hradio_dialog(t_hradio *x, t_symbol *s, int argc, t_atom *argv) | |||
288 | int num = (int)atom_getintarg(6, argc, argv); | 335 | int num = (int)atom_getintarg(6, argc, argv); |
289 | int sr_flags; | 336 | int sr_flags; |
290 | 337 | ||
338 | #ifdef ROCKBOX | ||
339 | (void) s; | ||
340 | #endif | ||
341 | |||
291 | if(chg != 0) chg = 1; | 342 | if(chg != 0) chg = 1; |
292 | x->x_change = chg; | 343 | x->x_change = chg; |
293 | sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); | 344 | sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); |
@@ -462,11 +513,22 @@ static void hradio_click(t_hradio *x, t_floatarg xpos, t_floatarg ypos, t_floata | |||
462 | { | 513 | { |
463 | int xx = (int)xpos - (int)text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist); | 514 | int xx = (int)xpos - (int)text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist); |
464 | 515 | ||
516 | #ifdef ROCKBOX | ||
517 | (void) ypos; | ||
518 | (void) shift; | ||
519 | (void) ctrl; | ||
520 | (void) alt; | ||
521 | #endif | ||
522 | |||
465 | hradio_fout(x, (float)(xx / x->x_gui.x_w)); | 523 | hradio_fout(x, (float)(xx / x->x_gui.x_w)); |
466 | } | 524 | } |
467 | 525 | ||
468 | static int hradio_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) | 526 | static int hradio_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) |
469 | { | 527 | { |
528 | #ifdef ROCKBOX | ||
529 | (void) glist; | ||
530 | (void) dbl; | ||
531 | #endif | ||
470 | if(doit) | 532 | if(doit) |
471 | hradio_click((t_hradio *)z, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, 0, (t_floatarg)alt); | 533 | hradio_click((t_hradio *)z, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, 0, (t_floatarg)alt); |
472 | return (1); | 534 | return (1); |
@@ -499,6 +561,9 @@ static void hradio_number(t_hradio *x, t_floatarg num) | |||
499 | 561 | ||
500 | static void hradio_size(t_hradio *x, t_symbol *s, int ac, t_atom *av) | 562 | static void hradio_size(t_hradio *x, t_symbol *s, int ac, t_atom *av) |
501 | { | 563 | { |
564 | #ifdef ROCKBOX | ||
565 | (void) s; | ||
566 | #endif | ||
502 | x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); | 567 | x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); |
503 | x->x_gui.x_h = x->x_gui.x_w; | 568 | x->x_gui.x_h = x->x_gui.x_w; |
504 | iemgui_size((void *)x, &x->x_gui); | 569 | iemgui_size((void *)x, &x->x_gui); |
@@ -543,11 +608,21 @@ static void *hradio_donew(t_symbol *s, int argc, t_atom *argv, int old) | |||
543 | { | 608 | { |
544 | t_hradio *x = (t_hradio *)pd_new(old? hradio_old_class : hradio_class); | 609 | t_hradio *x = (t_hradio *)pd_new(old? hradio_old_class : hradio_class); |
545 | int bflcol[]={-262144, -1, -1}; | 610 | int bflcol[]={-262144, -1, -1}; |
611 | #ifdef ROCKBOX | ||
612 | int a=IEM_GUI_DEFAULTSIZE, on=0; | ||
613 | #else | ||
546 | int a=IEM_GUI_DEFAULTSIZE, on=0, f=0; | 614 | int a=IEM_GUI_DEFAULTSIZE, on=0, f=0; |
615 | #endif | ||
547 | int ldx=0, ldy=-6, chg=1, num=8; | 616 | int ldx=0, ldy=-6, chg=1, num=8; |
548 | int fs=8; | 617 | int fs=8; |
618 | #ifndef ROCKBOX | ||
549 | int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, fthold=IEM_BNG_DEFAULTHOLDFLASHTIME; | 619 | int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, fthold=IEM_BNG_DEFAULTHOLDFLASHTIME; |
550 | char str[144]; | 620 | char str[144]; |
621 | #endif | ||
622 | |||
623 | #ifdef ROCKBOX | ||
624 | (void) s; | ||
625 | #endif | ||
551 | 626 | ||
552 | iem_inttosymargs(&x->x_gui.x_isa, 0); | 627 | iem_inttosymargs(&x->x_gui.x_isa, 0); |
553 | iem_inttofstyle(&x->x_gui.x_fsf, 0); | 628 | iem_inttofstyle(&x->x_gui.x_fsf, 0); |
@@ -632,7 +707,9 @@ static void hradio_ff(t_hradio *x) | |||
632 | { | 707 | { |
633 | if(x->x_gui.x_fsf.x_rcv_able) | 708 | if(x->x_gui.x_fsf.x_rcv_able) |
634 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); | 709 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); |
710 | #ifndef ROCKBOX | ||
635 | gfxstub_deleteforkey(x); | 711 | gfxstub_deleteforkey(x); |
712 | #endif | ||
636 | } | 713 | } |
637 | 714 | ||
638 | void g_hradio_setup(void) | 715 | void g_hradio_setup(void) |
diff --git a/apps/plugins/pdbox/PDa/src/g_hslider.c b/apps/plugins/pdbox/PDa/src/g_hslider.c index c5d660c5d7..4f9343cffa 100644 --- a/apps/plugins/pdbox/PDa/src/g_hslider.c +++ b/apps/plugins/pdbox/PDa/src/g_hslider.c | |||
@@ -6,6 +6,13 @@ | |||
6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ | 6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ |
7 | 7 | ||
8 | 8 | ||
9 | #ifdef ROCKBOX | ||
10 | #include "plugin.h" | ||
11 | #include "pdbox.h" | ||
12 | #include "m_pd.h" | ||
13 | #include "g_canvas.h" | ||
14 | #include "g_all_guis.h" | ||
15 | #else /* ROCKBOX */ | ||
9 | #include <stdlib.h> | 16 | #include <stdlib.h> |
10 | #include <string.h> | 17 | #include <string.h> |
11 | #include <stdio.h> | 18 | #include <stdio.h> |
@@ -21,7 +28,7 @@ | |||
21 | #else | 28 | #else |
22 | #include <unistd.h> | 29 | #include <unistd.h> |
23 | #endif | 30 | #endif |
24 | 31 | #endif /* ROCKBOX */ | |
25 | 32 | ||
26 | /* ------------ hsl gui-horicontal slider ----------------------- */ | 33 | /* ------------ hsl gui-horicontal slider ----------------------- */ |
27 | 34 | ||
@@ -32,6 +39,10 @@ static t_class *hslider_class; | |||
32 | 39 | ||
33 | static void hslider_draw_update(t_hslider *x, t_glist *glist) | 40 | static void hslider_draw_update(t_hslider *x, t_glist *glist) |
34 | { | 41 | { |
42 | #ifdef ROCKBOX | ||
43 | (void) x; | ||
44 | (void) glist; | ||
45 | #else /* ROCKBOX */ | ||
35 | t_canvas *canvas=glist_getcanvas(glist); | 46 | t_canvas *canvas=glist_getcanvas(glist); |
36 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 47 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
37 | 48 | ||
@@ -58,10 +69,15 @@ static void hslider_draw_update(t_hslider *x, t_glist *glist) | |||
58 | } | 69 | } |
59 | } | 70 | } |
60 | } | 71 | } |
72 | #endif /* ROCKBOX */ | ||
61 | } | 73 | } |
62 | 74 | ||
63 | static void hslider_draw_new(t_hslider *x, t_glist *glist) | 75 | static void hslider_draw_new(t_hslider *x, t_glist *glist) |
64 | { | 76 | { |
77 | #ifdef ROCKBOX | ||
78 | (void) x; | ||
79 | (void) glist; | ||
80 | #else /* ROCKBOX */ | ||
65 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 81 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
66 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 82 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
67 | int r = xpos + (x->x_val + 50)/100; | 83 | int r = xpos + (x->x_val + 50)/100; |
@@ -88,10 +104,15 @@ static void hslider_draw_new(t_hslider *x, t_glist *glist) | |||
88 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xIN%d\n", | 104 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xIN%d\n", |
89 | canvas, xpos-3, ypos, | 105 | canvas, xpos-3, ypos, |
90 | xpos+4, ypos+1, x, 0); | 106 | xpos+4, ypos+1, x, 0); |
107 | #endif /* ROCKBOX */ | ||
91 | } | 108 | } |
92 | 109 | ||
93 | static void hslider_draw_move(t_hslider *x, t_glist *glist) | 110 | static void hslider_draw_move(t_hslider *x, t_glist *glist) |
94 | { | 111 | { |
112 | #ifdef ROCKBOX | ||
113 | (void) x; | ||
114 | (void) glist; | ||
115 | #else /* ROCKBOX */ | ||
95 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 116 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
96 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 117 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
97 | int r = xpos + (x->x_val + 50)/100; | 118 | int r = xpos + (x->x_val + 50)/100; |
@@ -116,10 +137,15 @@ static void hslider_draw_move(t_hslider *x, t_glist *glist) | |||
116 | canvas, x, 0, | 137 | canvas, x, 0, |
117 | xpos-3, ypos, | 138 | xpos-3, ypos, |
118 | xpos+4, ypos+1); | 139 | xpos+4, ypos+1); |
140 | #endif /* ROCKBOX */ | ||
119 | } | 141 | } |
120 | 142 | ||
121 | static void hslider_draw_erase(t_hslider* x,t_glist* glist) | 143 | static void hslider_draw_erase(t_hslider* x,t_glist* glist) |
122 | { | 144 | { |
145 | #ifdef ROCKBOX | ||
146 | (void) x; | ||
147 | (void) glist; | ||
148 | #else /* ROCKBOX */ | ||
123 | t_canvas *canvas=glist_getcanvas(glist); | 149 | t_canvas *canvas=glist_getcanvas(glist); |
124 | 150 | ||
125 | sys_vgui(".x%x.c delete %xBASE\n", canvas, x); | 151 | sys_vgui(".x%x.c delete %xBASE\n", canvas, x); |
@@ -129,10 +155,15 @@ static void hslider_draw_erase(t_hslider* x,t_glist* glist) | |||
129 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); | 155 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); |
130 | if(!x->x_gui.x_fsf.x_rcv_able) | 156 | if(!x->x_gui.x_fsf.x_rcv_able) |
131 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 157 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
158 | #endif /* ROCKBOX */ | ||
132 | } | 159 | } |
133 | 160 | ||
134 | static void hslider_draw_config(t_hslider* x,t_glist* glist) | 161 | static void hslider_draw_config(t_hslider* x,t_glist* glist) |
135 | { | 162 | { |
163 | #ifdef ROCKBOX | ||
164 | (void) x; | ||
165 | (void) glist; | ||
166 | #else /* ROCKBOX */ | ||
136 | t_canvas *canvas=glist_getcanvas(glist); | 167 | t_canvas *canvas=glist_getcanvas(glist); |
137 | 168 | ||
138 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", | 169 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", |
@@ -141,10 +172,16 @@ static void hslider_draw_config(t_hslider* x,t_glist* glist) | |||
141 | strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:""); | 172 | strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:""); |
142 | sys_vgui(".x%x.c itemconfigure %xKNOB -fill #%6.6x\n", canvas, x, x->x_gui.x_fcol); | 173 | sys_vgui(".x%x.c itemconfigure %xKNOB -fill #%6.6x\n", canvas, x, x->x_gui.x_fcol); |
143 | sys_vgui(".x%x.c itemconfigure %xBASE -fill #%6.6x\n", canvas, x, x->x_gui.x_bcol); | 174 | sys_vgui(".x%x.c itemconfigure %xBASE -fill #%6.6x\n", canvas, x, x->x_gui.x_bcol); |
175 | #endif /* ROCKBOX */ | ||
144 | } | 176 | } |
145 | 177 | ||
146 | static void hslider_draw_io(t_hslider* x,t_glist* glist, int old_snd_rcv_flags) | 178 | static void hslider_draw_io(t_hslider* x,t_glist* glist, int old_snd_rcv_flags) |
147 | { | 179 | { |
180 | #ifdef ROCKBOX | ||
181 | (void) x; | ||
182 | (void) glist; | ||
183 | (void) old_snd_rcv_flags; | ||
184 | #else /* ROCKBOX */ | ||
148 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 185 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
149 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 186 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
150 | t_canvas *canvas=glist_getcanvas(glist); | 187 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -161,10 +198,15 @@ static void hslider_draw_io(t_hslider* x,t_glist* glist, int old_snd_rcv_flags) | |||
161 | xpos+4, ypos+1, x, 0); | 198 | xpos+4, ypos+1, x, 0); |
162 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) | 199 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) |
163 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 200 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
201 | #endif /* ROCKBOX */ | ||
164 | } | 202 | } |
165 | 203 | ||
166 | static void hslider_draw_select(t_hslider* x,t_glist* glist) | 204 | static void hslider_draw_select(t_hslider* x,t_glist* glist) |
167 | { | 205 | { |
206 | #ifdef ROCKBOX | ||
207 | (void) x; | ||
208 | (void) glist; | ||
209 | #else /* ROCKBOX */ | ||
168 | t_canvas *canvas=glist_getcanvas(glist); | 210 | t_canvas *canvas=glist_getcanvas(glist); |
169 | 211 | ||
170 | if(x->x_gui.x_fsf.x_selected) | 212 | if(x->x_gui.x_fsf.x_selected) |
@@ -177,6 +219,7 @@ static void hslider_draw_select(t_hslider* x,t_glist* glist) | |||
177 | sys_vgui(".x%x.c itemconfigure %xBASE -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL); | 219 | sys_vgui(".x%x.c itemconfigure %xBASE -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL); |
178 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol); | 220 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol); |
179 | } | 221 | } |
222 | #endif /* ROCKBOX */ | ||
180 | } | 223 | } |
181 | 224 | ||
182 | void hslider_draw(t_hslider *x, t_glist *glist, int mode) | 225 | void hslider_draw(t_hslider *x, t_glist *glist, int mode) |
@@ -279,6 +322,10 @@ void hslider_check_minmax(t_hslider *x, double min, double max) | |||
279 | 322 | ||
280 | static void hslider_properties(t_gobj *z, t_glist *owner) | 323 | static void hslider_properties(t_gobj *z, t_glist *owner) |
281 | { | 324 | { |
325 | #ifdef ROCKBOX | ||
326 | (void) z; | ||
327 | (void) owner; | ||
328 | #else /* ROCKBOX */ | ||
282 | t_hslider *x = (t_hslider *)z; | 329 | t_hslider *x = (t_hslider *)z; |
283 | char buf[800]; | 330 | char buf[800]; |
284 | t_symbol *srl[3]; | 331 | t_symbol *srl[3]; |
@@ -300,6 +347,7 @@ static void hslider_properties(t_gobj *z, t_glist *owner) | |||
300 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, | 347 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, |
301 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol); | 348 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol); |
302 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); | 349 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); |
350 | #endif /* ROCKBOX */ | ||
303 | } | 351 | } |
304 | 352 | ||
305 | static void hslider_set(t_hslider *x, t_floatarg f) /* bugfix */ | 353 | static void hslider_set(t_hslider *x, t_floatarg f) /* bugfix */ |
@@ -355,6 +403,10 @@ static void hslider_dialog(t_hslider *x, t_symbol *s, int argc, t_atom *argv) | |||
355 | int steady = (int)atom_getintarg(17, argc, argv); | 403 | int steady = (int)atom_getintarg(17, argc, argv); |
356 | int sr_flags; | 404 | int sr_flags; |
357 | 405 | ||
406 | #ifdef ROCKBOX | ||
407 | (void) s; | ||
408 | #endif | ||
409 | |||
358 | if(lilo != 0) lilo = 1; | 410 | if(lilo != 0) lilo = 1; |
359 | x->x_lin0_log1 = lilo; | 411 | x->x_lin0_log1 = lilo; |
360 | if(steady) | 412 | if(steady) |
@@ -375,6 +427,10 @@ static void hslider_motion(t_hslider *x, t_floatarg dx, t_floatarg dy) | |||
375 | { | 427 | { |
376 | int old = x->x_val; | 428 | int old = x->x_val; |
377 | 429 | ||
430 | #ifdef ROCKBOX | ||
431 | (void) dy; | ||
432 | #endif | ||
433 | |||
378 | if(x->x_gui.x_fsf.x_finemoved) | 434 | if(x->x_gui.x_fsf.x_finemoved) |
379 | x->x_pos += (int)dx; | 435 | x->x_pos += (int)dx; |
380 | else | 436 | else |
@@ -402,6 +458,11 @@ static void hslider_motion(t_hslider *x, t_floatarg dx, t_floatarg dy) | |||
402 | static void hslider_click(t_hslider *x, t_floatarg xpos, t_floatarg ypos, | 458 | static void hslider_click(t_hslider *x, t_floatarg xpos, t_floatarg ypos, |
403 | t_floatarg shift, t_floatarg ctrl, t_floatarg alt) | 459 | t_floatarg shift, t_floatarg ctrl, t_floatarg alt) |
404 | { | 460 | { |
461 | #ifdef ROCKBOX | ||
462 | (void) shift; | ||
463 | (void) ctrl; | ||
464 | (void) alt; | ||
465 | #endif | ||
405 | if(!x->x_steady) | 466 | if(!x->x_steady) |
406 | x->x_val = (int)(100.0 * (xpos - text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist))); | 467 | x->x_val = (int)(100.0 * (xpos - text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist))); |
407 | if(x->x_val > (100*x->x_gui.x_w - 100)) | 468 | if(x->x_val > (100*x->x_gui.x_w - 100)) |
@@ -420,6 +481,11 @@ static int hslider_newclick(t_gobj *z, struct _glist *glist, | |||
420 | { | 481 | { |
421 | t_hslider* x = (t_hslider *)z; | 482 | t_hslider* x = (t_hslider *)z; |
422 | 483 | ||
484 | #ifdef ROCKBOX | ||
485 | (void) glist; | ||
486 | (void) dbl; | ||
487 | #endif | ||
488 | |||
423 | if(doit) | 489 | if(doit) |
424 | { | 490 | { |
425 | hslider_click( x, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, | 491 | hslider_click( x, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, |
@@ -434,6 +500,9 @@ static int hslider_newclick(t_gobj *z, struct _glist *glist, | |||
434 | 500 | ||
435 | static void hslider_size(t_hslider *x, t_symbol *s, int ac, t_atom *av) | 501 | static void hslider_size(t_hslider *x, t_symbol *s, int ac, t_atom *av) |
436 | { | 502 | { |
503 | #ifdef ROCKBOX | ||
504 | (void) s; | ||
505 | #endif | ||
437 | hslider_check_width(x, (int)atom_getintarg(0, ac, av)); | 506 | hslider_check_width(x, (int)atom_getintarg(0, ac, av)); |
438 | if(ac > 1) | 507 | if(ac > 1) |
439 | x->x_gui.x_h = iemgui_clip_size((int)atom_getintarg(1, ac, av)); | 508 | x->x_gui.x_h = iemgui_clip_size((int)atom_getintarg(1, ac, av)); |
@@ -448,6 +517,9 @@ static void hslider_pos(t_hslider *x, t_symbol *s, int ac, t_atom *av) | |||
448 | 517 | ||
449 | static void hslider_range(t_hslider *x, t_symbol *s, int ac, t_atom *av) | 518 | static void hslider_range(t_hslider *x, t_symbol *s, int ac, t_atom *av) |
450 | { | 519 | { |
520 | #ifdef ROCKBOX | ||
521 | (void) s; | ||
522 | #endif | ||
451 | hslider_check_minmax(x, (double)atom_getfloatarg(0, ac, av), | 523 | hslider_check_minmax(x, (double)atom_getfloatarg(0, ac, av), |
452 | (double)atom_getfloatarg(1, ac, av)); | 524 | (double)atom_getfloatarg(1, ac, av)); |
453 | } | 525 | } |
@@ -525,10 +597,20 @@ static void *hslider_new(t_symbol *s, int argc, t_atom *argv) | |||
525 | t_hslider *x = (t_hslider *)pd_new(hslider_class); | 597 | t_hslider *x = (t_hslider *)pd_new(hslider_class); |
526 | int bflcol[]={-262144, -1, -1}; | 598 | int bflcol[]={-262144, -1, -1}; |
527 | int w=IEM_SL_DEFAULTSIZE, h=IEM_GUI_DEFAULTSIZE; | 599 | int w=IEM_SL_DEFAULTSIZE, h=IEM_GUI_DEFAULTSIZE; |
600 | #ifdef ROCKBOX | ||
601 | int lilo=0, ldx=-2, ldy=-6, v=0, steady=1; | ||
602 | #else | ||
528 | int lilo=0, ldx=-2, ldy=-6, f=0, v=0, steady=1; | 603 | int lilo=0, ldx=-2, ldy=-6, f=0, v=0, steady=1; |
604 | #endif | ||
529 | int fs=8; | 605 | int fs=8; |
530 | double min=0.0, max=(double)(IEM_SL_DEFAULTSIZE-1); | 606 | double min=0.0, max=(double)(IEM_SL_DEFAULTSIZE-1); |
607 | #ifndef ROCKBOX | ||
531 | char str[144]; | 608 | char str[144]; |
609 | #endif | ||
610 | |||
611 | #ifdef ROCKBOX | ||
612 | (void) s; | ||
613 | #endif | ||
532 | 614 | ||
533 | iem_inttosymargs(&x->x_gui.x_isa, 0); | 615 | iem_inttosymargs(&x->x_gui.x_isa, 0); |
534 | iem_inttofstyle(&x->x_gui.x_fsf, 0); | 616 | iem_inttofstyle(&x->x_gui.x_fsf, 0); |
@@ -607,7 +689,9 @@ static void hslider_free(t_hslider *x) | |||
607 | { | 689 | { |
608 | if(x->x_gui.x_fsf.x_rcv_able) | 690 | if(x->x_gui.x_fsf.x_rcv_able) |
609 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); | 691 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); |
692 | #ifndef ROCKBOX | ||
610 | gfxstub_deleteforkey(x); | 693 | gfxstub_deleteforkey(x); |
694 | #endif | ||
611 | } | 695 | } |
612 | 696 | ||
613 | void g_hslider_setup(void) | 697 | void g_hslider_setup(void) |
diff --git a/apps/plugins/pdbox/PDa/src/g_io.c b/apps/plugins/pdbox/PDa/src/g_io.c index db69543a87..3df518717b 100644 --- a/apps/plugins/pdbox/PDa/src/g_io.c +++ b/apps/plugins/pdbox/PDa/src/g_io.c | |||
@@ -22,9 +22,17 @@ life elsewhere. */ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #ifdef ROCKBOX | ||
26 | #include "plugin.h" | ||
27 | #include "pdbox.h" | ||
28 | #include "m_pd.h" | ||
29 | #include "g_canvas.h" | ||
30 | #else | ||
25 | #include "m_pd.h" | 31 | #include "m_pd.h" |
26 | #include "g_canvas.h" | 32 | #include "g_canvas.h" |
27 | #include <string.h> | 33 | #include <string.h> |
34 | #endif | ||
35 | |||
28 | void signal_setborrowed(t_signal *sig, t_signal *sig2); | 36 | void signal_setborrowed(t_signal *sig, t_signal *sig2); |
29 | void signal_makereusable(t_signal *sig); | 37 | void signal_makereusable(t_signal *sig); |
30 | 38 | ||
@@ -51,6 +59,9 @@ typedef struct _vinlet | |||
51 | 59 | ||
52 | static void *vinlet_new(t_symbol *s) | 60 | static void *vinlet_new(t_symbol *s) |
53 | { | 61 | { |
62 | #ifdef ROCKBOX | ||
63 | (void) s; | ||
64 | #endif | ||
54 | t_vinlet *x = (t_vinlet *)pd_new(vinlet_class); | 65 | t_vinlet *x = (t_vinlet *)pd_new(vinlet_class); |
55 | x->x_canvas = canvas_getcurrent(); | 66 | x->x_canvas = canvas_getcurrent(); |
56 | x->x_inlet = canvas_addinlet(x->x_canvas, &x->x_obj.ob_pd, 0); | 67 | x->x_inlet = canvas_addinlet(x->x_canvas, &x->x_obj.ob_pd, 0); |
@@ -108,7 +119,9 @@ int vinlet_issignal(t_vinlet *x) | |||
108 | return (x->x_buf != 0); | 119 | return (x->x_buf != 0); |
109 | } | 120 | } |
110 | 121 | ||
122 | #ifndef ROCKBOX | ||
111 | static int tot; | 123 | static int tot; |
124 | #endif | ||
112 | 125 | ||
113 | t_int *vinlet_perform(t_int *w) | 126 | t_int *vinlet_perform(t_int *w) |
114 | { | 127 | { |
@@ -176,7 +189,13 @@ void vinlet_dspprolog(t_vinlet *x, t_signal **parentsigs, | |||
176 | int myvecsize, int phase, int period, int frequency, int downsample, int upsample/* IOhannes */, int reblock, | 189 | int myvecsize, int phase, int period, int frequency, int downsample, int upsample/* IOhannes */, int reblock, |
177 | int switched) | 190 | int switched) |
178 | { | 191 | { |
192 | #ifdef ROCKBOX | ||
193 | t_signal *insig; | ||
194 | (void) frequency; | ||
195 | (void) switched; | ||
196 | #else | ||
179 | t_signal *insig, *outsig; | 197 | t_signal *insig, *outsig; |
198 | #endif | ||
180 | x->x_updown.downsample = downsample; | 199 | x->x_updown.downsample = downsample; |
181 | x->x_updown.upsample = upsample; | 200 | x->x_updown.upsample = upsample; |
182 | 201 | ||
@@ -318,6 +337,9 @@ typedef struct _voutlet | |||
318 | 337 | ||
319 | static void *voutlet_new(t_symbol *s) | 338 | static void *voutlet_new(t_symbol *s) |
320 | { | 339 | { |
340 | #ifdef ROCKBOX | ||
341 | (void) s; | ||
342 | #endif | ||
321 | t_voutlet *x = (t_voutlet *)pd_new(voutlet_class); | 343 | t_voutlet *x = (t_voutlet *)pd_new(voutlet_class); |
322 | x->x_canvas = canvas_getcurrent(); | 344 | x->x_canvas = canvas_getcurrent(); |
323 | x->x_parentoutlet = canvas_addoutlet(x->x_canvas, &x->x_obj.ob_pd, 0); | 345 | x->x_parentoutlet = canvas_addoutlet(x->x_canvas, &x->x_obj.ob_pd, 0); |
@@ -445,6 +467,12 @@ void voutlet_dspprolog(t_voutlet *x, t_signal **parentsigs, | |||
445 | int myvecsize, int phase, int period, int frequency, int downsample, int upsample /* IOhannes */, int reblock, | 467 | int myvecsize, int phase, int period, int frequency, int downsample, int upsample /* IOhannes */, int reblock, |
446 | int switched) | 468 | int switched) |
447 | { | 469 | { |
470 | #ifdef ROCKBOX | ||
471 | (void) myvecsize; | ||
472 | (void) phase; | ||
473 | (void) period; | ||
474 | (void) frequency; | ||
475 | #endif | ||
448 | x->x_updown.downsample=downsample; x->x_updown.upsample=upsample; /* IOhannes */ | 476 | x->x_updown.downsample=downsample; x->x_updown.upsample=upsample; /* IOhannes */ |
449 | x->x_justcopyout = (switched && !reblock); | 477 | x->x_justcopyout = (switched && !reblock); |
450 | if (reblock) | 478 | if (reblock) |
@@ -488,7 +516,11 @@ void voutlet_dspepilog(t_voutlet *x, t_signal **parentsigs, | |||
488 | x->x_updown.downsample=downsample; x->x_updown.upsample=upsample; /* IOhannes */ | 516 | x->x_updown.downsample=downsample; x->x_updown.upsample=upsample; /* IOhannes */ |
489 | if (reblock) | 517 | if (reblock) |
490 | { | 518 | { |
519 | #ifdef ROCKBOX | ||
520 | t_signal *outsig; | ||
521 | #else | ||
491 | t_signal *insig, *outsig; | 522 | t_signal *insig, *outsig; |
523 | #endif | ||
492 | int parentvecsize, bufsize, oldbufsize; | 524 | int parentvecsize, bufsize, oldbufsize; |
493 | int re_parentvecsize; /* IOhannes */ | 525 | int re_parentvecsize; /* IOhannes */ |
494 | int bigperiod, epilogphase, blockphase; | 526 | int bigperiod, epilogphase, blockphase; |
diff --git a/apps/plugins/pdbox/PDa/src/g_mycanvas.c b/apps/plugins/pdbox/PDa/src/g_mycanvas.c index 92615e912f..a00b1bf642 100644 --- a/apps/plugins/pdbox/PDa/src/g_mycanvas.c +++ b/apps/plugins/pdbox/PDa/src/g_mycanvas.c | |||
@@ -6,6 +6,13 @@ | |||
6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ | 6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ |
7 | 7 | ||
8 | 8 | ||
9 | #ifdef ROCKBOX | ||
10 | #include "plugin.h" | ||
11 | #include "pdbox.h" | ||
12 | #include "m_pd.h" | ||
13 | #include "g_canvas.h" | ||
14 | #include "g_all_guis.h" | ||
15 | #else /* ROCKBOX */ | ||
9 | #include <stdlib.h> | 16 | #include <stdlib.h> |
10 | #include <string.h> | 17 | #include <string.h> |
11 | #include <stdio.h> | 18 | #include <stdio.h> |
@@ -21,6 +28,7 @@ | |||
21 | #else | 28 | #else |
22 | #include <unistd.h> | 29 | #include <unistd.h> |
23 | #endif | 30 | #endif |
31 | #endif /* ROCKBOX */ | ||
24 | 32 | ||
25 | /* ---------- cnv my gui-canvas for a window ---------------- */ | 33 | /* ---------- cnv my gui-canvas for a window ---------------- */ |
26 | 34 | ||
@@ -31,6 +39,10 @@ static t_class *my_canvas_class; | |||
31 | 39 | ||
32 | void my_canvas_draw_new(t_my_canvas *x, t_glist *glist) | 40 | void my_canvas_draw_new(t_my_canvas *x, t_glist *glist) |
33 | { | 41 | { |
42 | #ifdef ROCKBOX | ||
43 | (void) x; | ||
44 | (void) glist; | ||
45 | #else /* ROCKBOX */ | ||
34 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 46 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
35 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 47 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
36 | t_canvas *canvas=glist_getcanvas(glist); | 48 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -48,10 +60,15 @@ void my_canvas_draw_new(t_my_canvas *x, t_glist *glist) | |||
48 | canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy, | 60 | canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy, |
49 | strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"", | 61 | strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"", |
50 | x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, x); | 62 | x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, x); |
63 | #endif /* ROCKBOX */ | ||
51 | } | 64 | } |
52 | 65 | ||
53 | void my_canvas_draw_move(t_my_canvas *x, t_glist *glist) | 66 | void my_canvas_draw_move(t_my_canvas *x, t_glist *glist) |
54 | { | 67 | { |
68 | #ifdef ROCKBOX | ||
69 | (void) x; | ||
70 | (void) glist; | ||
71 | #else /* ROCKBOX */ | ||
55 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 72 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
56 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 73 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
57 | t_canvas *canvas=glist_getcanvas(glist); | 74 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -65,19 +82,29 @@ void my_canvas_draw_move(t_my_canvas *x, t_glist *glist) | |||
65 | sys_vgui(".x%x.c coords %xLABEL %d %d\n", | 82 | sys_vgui(".x%x.c coords %xLABEL %d %d\n", |
66 | canvas, x, xpos+x->x_gui.x_ldx, | 83 | canvas, x, xpos+x->x_gui.x_ldx, |
67 | ypos+x->x_gui.x_ldy); | 84 | ypos+x->x_gui.x_ldy); |
85 | #endif /* ROCKBOX */ | ||
68 | } | 86 | } |
69 | 87 | ||
70 | void my_canvas_draw_erase(t_my_canvas* x, t_glist* glist) | 88 | void my_canvas_draw_erase(t_my_canvas* x, t_glist* glist) |
71 | { | 89 | { |
90 | #ifdef ROCKBOX | ||
91 | (void) x; | ||
92 | (void) glist; | ||
93 | #else /* ROCKBOX */ | ||
72 | t_canvas *canvas=glist_getcanvas(glist); | 94 | t_canvas *canvas=glist_getcanvas(glist); |
73 | 95 | ||
74 | sys_vgui(".x%x.c delete %xBASE\n", canvas, x); | 96 | sys_vgui(".x%x.c delete %xBASE\n", canvas, x); |
75 | sys_vgui(".x%x.c delete %xRECT\n", canvas, x); | 97 | sys_vgui(".x%x.c delete %xRECT\n", canvas, x); |
76 | sys_vgui(".x%x.c delete %xLABEL\n", canvas, x); | 98 | sys_vgui(".x%x.c delete %xLABEL\n", canvas, x); |
99 | #endif /* ROCKBOX */ | ||
77 | } | 100 | } |
78 | 101 | ||
79 | void my_canvas_draw_config(t_my_canvas* x, t_glist* glist) | 102 | void my_canvas_draw_config(t_my_canvas* x, t_glist* glist) |
80 | { | 103 | { |
104 | #ifdef ROCKBOX | ||
105 | (void) x; | ||
106 | (void) glist; | ||
107 | #else /* ROCKBOX */ | ||
81 | t_canvas *canvas=glist_getcanvas(glist); | 108 | t_canvas *canvas=glist_getcanvas(glist); |
82 | 109 | ||
83 | sys_vgui(".x%x.c itemconfigure %xRECT -fill #%6.6x -outline #%6.6x\n", canvas, x, | 110 | sys_vgui(".x%x.c itemconfigure %xRECT -fill #%6.6x -outline #%6.6x\n", canvas, x, |
@@ -87,10 +114,15 @@ void my_canvas_draw_config(t_my_canvas* x, t_glist* glist) | |||
87 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", | 114 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", |
88 | canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, | 115 | canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, |
89 | strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:""); | 116 | strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:""); |
117 | #endif /* ROCKBOX */ | ||
90 | } | 118 | } |
91 | 119 | ||
92 | void my_canvas_draw_select(t_my_canvas* x, t_glist* glist) | 120 | void my_canvas_draw_select(t_my_canvas* x, t_glist* glist) |
93 | { | 121 | { |
122 | #ifdef ROCKBOX | ||
123 | (void) x; | ||
124 | (void) glist; | ||
125 | #else /* ROCKBOX */ | ||
94 | t_canvas *canvas=glist_getcanvas(glist); | 126 | t_canvas *canvas=glist_getcanvas(glist); |
95 | 127 | ||
96 | if(x->x_gui.x_fsf.x_selected) | 128 | if(x->x_gui.x_fsf.x_selected) |
@@ -101,6 +133,7 @@ void my_canvas_draw_select(t_my_canvas* x, t_glist* glist) | |||
101 | { | 133 | { |
102 | sys_vgui(".x%x.c itemconfigure %xBASE -outline #%6.6x\n", canvas, x, x->x_gui.x_bcol); | 134 | sys_vgui(".x%x.c itemconfigure %xBASE -outline #%6.6x\n", canvas, x, x->x_gui.x_bcol); |
103 | } | 135 | } |
136 | #endif /* ROCKBOX */ | ||
104 | } | 137 | } |
105 | 138 | ||
106 | void my_canvas_draw(t_my_canvas *x, t_glist *glist, int mode) | 139 | void my_canvas_draw(t_my_canvas *x, t_glist *glist, int mode) |
@@ -147,6 +180,10 @@ static void my_canvas_save(t_gobj *z, t_binbuf *b) | |||
147 | 180 | ||
148 | static void my_canvas_properties(t_gobj *z, t_glist *owner) | 181 | static void my_canvas_properties(t_gobj *z, t_glist *owner) |
149 | { | 182 | { |
183 | #ifdef ROCKBOX | ||
184 | (void) z; | ||
185 | (void) owner; | ||
186 | #else /* ROCKBOX */ | ||
150 | t_my_canvas *x = (t_my_canvas *)z; | 187 | t_my_canvas *x = (t_my_canvas *)z; |
151 | char buf[800]; | 188 | char buf[800]; |
152 | t_symbol *srl[3]; | 189 | t_symbol *srl[3]; |
@@ -168,6 +205,7 @@ static void my_canvas_properties(t_gobj *z, t_glist *owner) | |||
168 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, | 205 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, |
169 | 0xffffff & x->x_gui.x_bcol, -1/*no frontcolor*/, 0xffffff & x->x_gui.x_lcol); | 206 | 0xffffff & x->x_gui.x_bcol, -1/*no frontcolor*/, 0xffffff & x->x_gui.x_lcol); |
170 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); | 207 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); |
208 | #endif /* ROCKBOX */ | ||
171 | } | 209 | } |
172 | 210 | ||
173 | static void my_canvas_get_pos(t_my_canvas *x) | 211 | static void my_canvas_get_pos(t_my_canvas *x) |
@@ -182,11 +220,19 @@ static void my_canvas_get_pos(t_my_canvas *x) | |||
182 | 220 | ||
183 | static void my_canvas_dialog(t_my_canvas *x, t_symbol *s, int argc, t_atom *argv) | 221 | static void my_canvas_dialog(t_my_canvas *x, t_symbol *s, int argc, t_atom *argv) |
184 | { | 222 | { |
223 | #ifndef ROCKBOX | ||
185 | t_symbol *srl[3]; | 224 | t_symbol *srl[3]; |
225 | #endif | ||
186 | int a = (int)atom_getintarg(0, argc, argv); | 226 | int a = (int)atom_getintarg(0, argc, argv); |
187 | int w = (int)atom_getintarg(2, argc, argv); | 227 | int w = (int)atom_getintarg(2, argc, argv); |
188 | int h = (int)atom_getintarg(3, argc, argv); | 228 | int h = (int)atom_getintarg(3, argc, argv); |
229 | #ifndef ROCKBOX | ||
189 | int sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); | 230 | int sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); |
231 | #endif | ||
232 | |||
233 | #ifdef ROCKBOX | ||
234 | (void) s; | ||
235 | #endif | ||
190 | 236 | ||
191 | x->x_gui.x_isa.x_loadinit = 0; | 237 | x->x_gui.x_isa.x_loadinit = 0; |
192 | if(a < 1) | 238 | if(a < 1) |
@@ -207,6 +253,10 @@ static void my_canvas_size(t_my_canvas *x, t_symbol *s, int ac, t_atom *av) | |||
207 | { | 253 | { |
208 | int i = (int)atom_getintarg(0, ac, av); | 254 | int i = (int)atom_getintarg(0, ac, av); |
209 | 255 | ||
256 | #ifdef ROCKBOX | ||
257 | (void) s; | ||
258 | #endif | ||
259 | |||
210 | if(i < 1) | 260 | if(i < 1) |
211 | i = 1; | 261 | i = 1; |
212 | x->x_gui.x_w = i; | 262 | x->x_gui.x_w = i; |
@@ -224,6 +274,10 @@ static void my_canvas_vis_size(t_my_canvas *x, t_symbol *s, int ac, t_atom *av) | |||
224 | { | 274 | { |
225 | int i; | 275 | int i; |
226 | 276 | ||
277 | #ifdef ROCKBOX | ||
278 | (void) s; | ||
279 | #endif | ||
280 | |||
227 | i = (int)atom_getintarg(0, ac, av); | 281 | i = (int)atom_getintarg(0, ac, av); |
228 | if(i < 1) | 282 | if(i < 1) |
229 | i = 1; | 283 | i = 1; |
@@ -262,9 +316,19 @@ static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv) | |||
262 | t_my_canvas *x = (t_my_canvas *)pd_new(my_canvas_class); | 316 | t_my_canvas *x = (t_my_canvas *)pd_new(my_canvas_class); |
263 | int bflcol[]={-233017, -1, -66577}; | 317 | int bflcol[]={-233017, -1, -66577}; |
264 | int a=IEM_GUI_DEFAULTSIZE, w=100, h=60; | 318 | int a=IEM_GUI_DEFAULTSIZE, w=100, h=60; |
319 | #ifdef ROCKBOX | ||
320 | int ldx=20, ldy=12, i=0; | ||
321 | #else | ||
265 | int ldx=20, ldy=12, f=2, i=0; | 322 | int ldx=20, ldy=12, f=2, i=0; |
323 | #endif | ||
266 | int fs=14; | 324 | int fs=14; |
325 | #ifndef ROCKBOX | ||
267 | char str[144]; | 326 | char str[144]; |
327 | #endif | ||
328 | |||
329 | #ifdef ROCKBOX | ||
330 | (void) s; | ||
331 | #endif | ||
268 | 332 | ||
269 | iem_inttosymargs(&x->x_gui.x_isa, 0); | 333 | iem_inttosymargs(&x->x_gui.x_isa, 0); |
270 | iem_inttofstyle(&x->x_gui.x_fsf, 0); | 334 | iem_inttofstyle(&x->x_gui.x_fsf, 0); |
@@ -350,7 +414,9 @@ static void my_canvas_ff(t_my_canvas *x) | |||
350 | { | 414 | { |
351 | if(x->x_gui.x_fsf.x_rcv_able) | 415 | if(x->x_gui.x_fsf.x_rcv_able) |
352 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); | 416 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); |
417 | #ifndef ROCKBOX | ||
353 | gfxstub_deleteforkey(x); | 418 | gfxstub_deleteforkey(x); |
419 | #endif | ||
354 | } | 420 | } |
355 | 421 | ||
356 | void g_mycanvas_setup(void) | 422 | void g_mycanvas_setup(void) |
diff --git a/apps/plugins/pdbox/PDa/src/g_numbox.c b/apps/plugins/pdbox/PDa/src/g_numbox.c index 1c4dbb5e48..a5e0a447dc 100644 --- a/apps/plugins/pdbox/PDa/src/g_numbox.c +++ b/apps/plugins/pdbox/PDa/src/g_numbox.c | |||
@@ -4,6 +4,13 @@ | |||
4 | 4 | ||
5 | /* my_numbox.c written by Thomas Musil (c) IEM KUG Graz Austria 2000-2001 */ | 5 | /* my_numbox.c written by Thomas Musil (c) IEM KUG Graz Austria 2000-2001 */ |
6 | 6 | ||
7 | #ifdef ROCKBOX | ||
8 | #include "plugin.h" | ||
9 | #include "pdbox.h" | ||
10 | #include "m_pd.h" | ||
11 | #include "g_canvas.h" | ||
12 | #include "g_all_guis.h" | ||
13 | #else /* ROCKBOX */ | ||
7 | #include <stdlib.h> | 14 | #include <stdlib.h> |
8 | #include <string.h> | 15 | #include <string.h> |
9 | #include <stdio.h> | 16 | #include <stdio.h> |
@@ -19,6 +26,7 @@ | |||
19 | #else | 26 | #else |
20 | #include <unistd.h> | 27 | #include <unistd.h> |
21 | #endif | 28 | #endif |
29 | #endif /* ROCKBOX */ | ||
22 | 30 | ||
23 | /*------------------ global varaibles -------------------------*/ | 31 | /*------------------ global varaibles -------------------------*/ |
24 | 32 | ||
@@ -76,7 +84,11 @@ void my_numbox_ftoa(t_my_numbox *x) | |||
76 | double f=x->x_val; | 84 | double f=x->x_val; |
77 | int bufsize, is_exp=0, i, idecimal; | 85 | int bufsize, is_exp=0, i, idecimal; |
78 | 86 | ||
87 | #ifdef ROCKBOX | ||
88 | ftoan(f, x->x_buf, 10); | ||
89 | #else | ||
79 | sprintf(x->x_buf, "%g", f); | 90 | sprintf(x->x_buf, "%g", f); |
91 | #endif | ||
80 | bufsize = strlen(x->x_buf); | 92 | bufsize = strlen(x->x_buf); |
81 | if(bufsize >= 5)/* if it is in exponential mode */ | 93 | if(bufsize >= 5)/* if it is in exponential mode */ |
82 | { | 94 | { |
@@ -130,6 +142,10 @@ void my_numbox_ftoa(t_my_numbox *x) | |||
130 | 142 | ||
131 | static void my_numbox_draw_update(t_my_numbox *x, t_glist *glist) | 143 | static void my_numbox_draw_update(t_my_numbox *x, t_glist *glist) |
132 | { | 144 | { |
145 | #ifdef ROCKBOX | ||
146 | (void) x; | ||
147 | (void) glist; | ||
148 | #else /* ROCKBOX */ | ||
133 | if (glist_isvisible(glist)) | 149 | if (glist_isvisible(glist)) |
134 | { | 150 | { |
135 | if(x->x_gui.x_fsf.x_change) | 151 | if(x->x_gui.x_fsf.x_change) |
@@ -169,10 +185,15 @@ static void my_numbox_draw_update(t_my_numbox *x, t_glist *glist) | |||
169 | x->x_buf[0] = 0; | 185 | x->x_buf[0] = 0; |
170 | } | 186 | } |
171 | } | 187 | } |
188 | #endif /* ROCKBOX */ | ||
172 | } | 189 | } |
173 | 190 | ||
174 | static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist) | 191 | static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist) |
175 | { | 192 | { |
193 | #ifdef ROCKBOX | ||
194 | (void) x; | ||
195 | (void) glist; | ||
196 | #else /* ROCKBOX */ | ||
176 | int half=x->x_gui.x_h/2, d=1+x->x_gui.x_h/34; | 197 | int half=x->x_gui.x_h/2, d=1+x->x_gui.x_h/34; |
177 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 198 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
178 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 199 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
@@ -215,10 +236,15 @@ static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist) | |||
215 | xpos, ypos, | 236 | xpos, ypos, |
216 | xpos+IOWIDTH, ypos+1, | 237 | xpos+IOWIDTH, ypos+1, |
217 | x, 0); | 238 | x, 0); |
239 | #endif /* ROCKBOX */ | ||
218 | } | 240 | } |
219 | 241 | ||
220 | static void my_numbox_draw_move(t_my_numbox *x, t_glist *glist) | 242 | static void my_numbox_draw_move(t_my_numbox *x, t_glist *glist) |
221 | { | 243 | { |
244 | #ifdef ROCKBOX | ||
245 | (void) x; | ||
246 | (void) glist; | ||
247 | #else /* ROCKBOX */ | ||
222 | int half = x->x_gui.x_h/2, d=1+x->x_gui.x_h/34; | 248 | int half = x->x_gui.x_h/2, d=1+x->x_gui.x_h/34; |
223 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 249 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
224 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 250 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
@@ -248,10 +274,15 @@ static void my_numbox_draw_move(t_my_numbox *x, t_glist *glist) | |||
248 | canvas, x, 0, | 274 | canvas, x, 0, |
249 | xpos, ypos, | 275 | xpos, ypos, |
250 | xpos+IOWIDTH, ypos+1); | 276 | xpos+IOWIDTH, ypos+1); |
277 | #endif /* ROCKBOX */ | ||
251 | } | 278 | } |
252 | 279 | ||
253 | static void my_numbox_draw_erase(t_my_numbox* x,t_glist* glist) | 280 | static void my_numbox_draw_erase(t_my_numbox* x,t_glist* glist) |
254 | { | 281 | { |
282 | #ifdef ROCKBOX | ||
283 | (void) x; | ||
284 | (void) glist; | ||
285 | #else /* ROCKBOX */ | ||
255 | t_canvas *canvas=glist_getcanvas(glist); | 286 | t_canvas *canvas=glist_getcanvas(glist); |
256 | 287 | ||
257 | sys_vgui(".x%x.c delete %xBASE1\n", canvas, x); | 288 | sys_vgui(".x%x.c delete %xBASE1\n", canvas, x); |
@@ -262,10 +293,15 @@ static void my_numbox_draw_erase(t_my_numbox* x,t_glist* glist) | |||
262 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); | 293 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); |
263 | if(!x->x_gui.x_fsf.x_rcv_able) | 294 | if(!x->x_gui.x_fsf.x_rcv_able) |
264 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 295 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
296 | #endif /* ROCKBOX */ | ||
265 | } | 297 | } |
266 | 298 | ||
267 | static void my_numbox_draw_config(t_my_numbox* x,t_glist* glist) | 299 | static void my_numbox_draw_config(t_my_numbox* x,t_glist* glist) |
268 | { | 300 | { |
301 | #ifdef ROCKBOX | ||
302 | (void) x; | ||
303 | (void) glist; | ||
304 | #else /* ROCKBOX */ | ||
269 | t_canvas *canvas=glist_getcanvas(glist); | 305 | t_canvas *canvas=glist_getcanvas(glist); |
270 | 306 | ||
271 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", | 307 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", |
@@ -279,10 +315,16 @@ static void my_numbox_draw_config(t_my_numbox* x,t_glist* glist) | |||
279 | x, x->x_gui.x_bcol); | 315 | x, x->x_gui.x_bcol); |
280 | sys_vgui(".x%x.c itemconfigure %xBASE2 -fill #%6.6x\n", canvas, | 316 | sys_vgui(".x%x.c itemconfigure %xBASE2 -fill #%6.6x\n", canvas, |
281 | x, x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_fcol); | 317 | x, x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_fcol); |
318 | #endif /* ROCKBOX */ | ||
282 | } | 319 | } |
283 | 320 | ||
284 | static void my_numbox_draw_io(t_my_numbox* x,t_glist* glist, int old_snd_rcv_flags) | 321 | static void my_numbox_draw_io(t_my_numbox* x,t_glist* glist, int old_snd_rcv_flags) |
285 | { | 322 | { |
323 | #ifdef ROCKBOX | ||
324 | (void) x; | ||
325 | (void) glist; | ||
326 | (void) old_snd_rcv_flags; | ||
327 | #else /* ROCKBOX */ | ||
286 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 328 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
287 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 329 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
288 | t_canvas *canvas=glist_getcanvas(glist); | 330 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -303,10 +345,15 @@ static void my_numbox_draw_io(t_my_numbox* x,t_glist* glist, int old_snd_rcv_fla | |||
303 | x, 0); | 345 | x, 0); |
304 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) | 346 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) |
305 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 347 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
348 | #endif /* ROCKBOX */ | ||
306 | } | 349 | } |
307 | 350 | ||
308 | static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist) | 351 | static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist) |
309 | { | 352 | { |
353 | #ifdef ROCKBOX | ||
354 | (void) x; | ||
355 | (void) glist; | ||
356 | #else /* ROCKBOX */ | ||
310 | t_canvas *canvas=glist_getcanvas(glist); | 357 | t_canvas *canvas=glist_getcanvas(glist); |
311 | 358 | ||
312 | if(x->x_gui.x_fsf.x_selected) | 359 | if(x->x_gui.x_fsf.x_selected) |
@@ -338,6 +385,7 @@ static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist) | |||
338 | sys_vgui(".x%x.c itemconfigure %xNUMBER -fill #%6.6x\n", | 385 | sys_vgui(".x%x.c itemconfigure %xNUMBER -fill #%6.6x\n", |
339 | canvas, x, x->x_gui.x_fcol); | 386 | canvas, x, x->x_gui.x_fcol); |
340 | } | 387 | } |
388 | #endif /* ROCKBOX */ | ||
341 | } | 389 | } |
342 | 390 | ||
343 | void my_numbox_draw(t_my_numbox *x, t_glist *glist, int mode) | 391 | void my_numbox_draw(t_my_numbox *x, t_glist *glist, int mode) |
@@ -440,6 +488,10 @@ int my_numbox_check_minmax(t_my_numbox *x, double min, double max) | |||
440 | 488 | ||
441 | static void my_numbox_properties(t_gobj *z, t_glist *owner) | 489 | static void my_numbox_properties(t_gobj *z, t_glist *owner) |
442 | { | 490 | { |
491 | #ifdef ROCKBOX | ||
492 | (void) z; | ||
493 | (void) owner; | ||
494 | #else /* ROCKBOX */ | ||
443 | t_my_numbox *x = (t_my_numbox *)z; | 495 | t_my_numbox *x = (t_my_numbox *)z; |
444 | char buf[800]; | 496 | char buf[800]; |
445 | t_symbol *srl[3]; | 497 | t_symbol *srl[3]; |
@@ -471,6 +523,7 @@ static void my_numbox_properties(t_gobj *z, t_glist *owner) | |||
471 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, | 523 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, |
472 | 0xffffff & x->x_gui.x_lcol); | 524 | 0xffffff & x->x_gui.x_lcol); |
473 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); | 525 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); |
526 | #endif /* ROCKBOX */ | ||
474 | } | 527 | } |
475 | 528 | ||
476 | static void my_numbox_bang(t_my_numbox *x) | 529 | static void my_numbox_bang(t_my_numbox *x) |
@@ -492,6 +545,10 @@ static void my_numbox_dialog(t_my_numbox *x, t_symbol *s, int argc, | |||
492 | int log_height = (int)atom_getintarg(6, argc, argv); | 545 | int log_height = (int)atom_getintarg(6, argc, argv); |
493 | int sr_flags; | 546 | int sr_flags; |
494 | 547 | ||
548 | #ifdef ROCKBOX | ||
549 | (void) s; | ||
550 | #endif | ||
551 | |||
495 | if(lilo != 0) lilo = 1; | 552 | if(lilo != 0) lilo = 1; |
496 | x->x_lin0_log1 = lilo; | 553 | x->x_lin0_log1 = lilo; |
497 | sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); | 554 | sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); |
@@ -519,6 +576,10 @@ static void my_numbox_motion(t_my_numbox *x, t_floatarg dx, t_floatarg dy) | |||
519 | { | 576 | { |
520 | double k2=1.0; | 577 | double k2=1.0; |
521 | 578 | ||
579 | #ifdef ROCKBOX | ||
580 | (void) dx; | ||
581 | #endif | ||
582 | |||
522 | if(x->x_gui.x_fsf.x_finemoved) | 583 | if(x->x_gui.x_fsf.x_finemoved) |
523 | k2 = 0.01; | 584 | k2 = 0.01; |
524 | if(x->x_lin0_log1) | 585 | if(x->x_lin0_log1) |
@@ -534,6 +595,11 @@ static void my_numbox_motion(t_my_numbox *x, t_floatarg dx, t_floatarg dy) | |||
534 | static void my_numbox_click(t_my_numbox *x, t_floatarg xpos, t_floatarg ypos, | 595 | static void my_numbox_click(t_my_numbox *x, t_floatarg xpos, t_floatarg ypos, |
535 | t_floatarg shift, t_floatarg ctrl, t_floatarg alt) | 596 | t_floatarg shift, t_floatarg ctrl, t_floatarg alt) |
536 | { | 597 | { |
598 | #ifdef ROCKBOX | ||
599 | (void) shift; | ||
600 | (void) ctrl; | ||
601 | (void) alt; | ||
602 | #endif | ||
537 | glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, | 603 | glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, |
538 | (t_glistmotionfn)my_numbox_motion, my_numbox_key, xpos, ypos); | 604 | (t_glistmotionfn)my_numbox_motion, my_numbox_key, xpos, ypos); |
539 | } | 605 | } |
@@ -543,6 +609,11 @@ static int my_numbox_newclick(t_gobj *z, struct _glist *glist, | |||
543 | { | 609 | { |
544 | t_my_numbox* x = (t_my_numbox *)z; | 610 | t_my_numbox* x = (t_my_numbox *)z; |
545 | 611 | ||
612 | #ifdef ROCKBOX | ||
613 | (void) glist; | ||
614 | (void) dbl; | ||
615 | #endif | ||
616 | |||
546 | if(doit) | 617 | if(doit) |
547 | { | 618 | { |
548 | my_numbox_click( x, (t_floatarg)xpix, (t_floatarg)ypix, | 619 | my_numbox_click( x, (t_floatarg)xpix, (t_floatarg)ypix, |
@@ -603,6 +674,10 @@ static void my_numbox_size(t_my_numbox *x, t_symbol *s, int ac, t_atom *av) | |||
603 | { | 674 | { |
604 | int h, w; | 675 | int h, w; |
605 | 676 | ||
677 | #ifdef ROCKBOX | ||
678 | (void) s; | ||
679 | #endif | ||
680 | |||
606 | w = (int)atom_getintarg(0, ac, av); | 681 | w = (int)atom_getintarg(0, ac, av); |
607 | if(w < 1) | 682 | if(w < 1) |
608 | w = 1; | 683 | w = 1; |
@@ -626,6 +701,9 @@ static void my_numbox_pos(t_my_numbox *x, t_symbol *s, int ac, t_atom *av) | |||
626 | 701 | ||
627 | static void my_numbox_range(t_my_numbox *x, t_symbol *s, int ac, t_atom *av) | 702 | static void my_numbox_range(t_my_numbox *x, t_symbol *s, int ac, t_atom *av) |
628 | { | 703 | { |
704 | #ifdef ROCKBOX | ||
705 | (void) s; | ||
706 | #endif | ||
629 | if(my_numbox_check_minmax(x, (double)atom_getfloatarg(0, ac, av), | 707 | if(my_numbox_check_minmax(x, (double)atom_getfloatarg(0, ac, av), |
630 | (double)atom_getfloatarg(1, ac, av))) | 708 | (double)atom_getfloatarg(1, ac, av))) |
631 | { | 709 | { |
@@ -742,6 +820,9 @@ static void my_numbox_key(void *z, t_floatarg fkey) | |||
742 | 820 | ||
743 | static void my_numbox_list(t_my_numbox *x, t_symbol *s, int ac, t_atom *av) | 821 | static void my_numbox_list(t_my_numbox *x, t_symbol *s, int ac, t_atom *av) |
744 | { | 822 | { |
823 | #ifdef ROCKBOX | ||
824 | (void) s; | ||
825 | #endif | ||
745 | if (IS_A_FLOAT(av,0)) | 826 | if (IS_A_FLOAT(av,0)) |
746 | { | 827 | { |
747 | my_numbox_set(x, atom_getfloatarg(0, ac, av)); | 828 | my_numbox_set(x, atom_getfloatarg(0, ac, av)); |
@@ -754,11 +835,21 @@ static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv) | |||
754 | t_my_numbox *x = (t_my_numbox *)pd_new(my_numbox_class); | 835 | t_my_numbox *x = (t_my_numbox *)pd_new(my_numbox_class); |
755 | int bflcol[]={-262144, -1, -1}; | 836 | int bflcol[]={-262144, -1, -1}; |
756 | int w=5, h=14; | 837 | int w=5, h=14; |
838 | #ifdef ROCKBOX | ||
839 | int lilo=0, ldx=0, ldy=-6; | ||
840 | #else | ||
757 | int lilo=0, f=0, ldx=0, ldy=-6; | 841 | int lilo=0, f=0, ldx=0, ldy=-6; |
842 | #endif | ||
758 | int fs=10; | 843 | int fs=10; |
759 | int log_height=256; | 844 | int log_height=256; |
760 | double min=-1.0e+37, max=1.0e+37,v=0.0; | 845 | double min=-1.0e+37, max=1.0e+37,v=0.0; |
846 | #ifndef ROCKBOX | ||
761 | char str[144]; | 847 | char str[144]; |
848 | #endif | ||
849 | |||
850 | #ifdef ROCKBOX | ||
851 | (void) s; | ||
852 | #endif | ||
762 | 853 | ||
763 | if((argc >= 17)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1) | 854 | if((argc >= 17)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1) |
764 | &&IS_A_FLOAT(argv,2)&&IS_A_FLOAT(argv,3) | 855 | &&IS_A_FLOAT(argv,2)&&IS_A_FLOAT(argv,3) |
@@ -843,7 +934,9 @@ static void my_numbox_free(t_my_numbox *x) | |||
843 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); | 934 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); |
844 | clock_free(x->x_clock_reset); | 935 | clock_free(x->x_clock_reset); |
845 | clock_free(x->x_clock_wait); | 936 | clock_free(x->x_clock_wait); |
937 | #ifndef ROCKBOX | ||
846 | gfxstub_deleteforkey(x); | 938 | gfxstub_deleteforkey(x); |
939 | #endif | ||
847 | } | 940 | } |
848 | 941 | ||
849 | void g_numbox_setup(void) | 942 | void g_numbox_setup(void) |
diff --git a/apps/plugins/pdbox/PDa/src/g_readwrite.c b/apps/plugins/pdbox/PDa/src/g_readwrite.c index 55759dbf1a..81bf02e512 100644 --- a/apps/plugins/pdbox/PDa/src/g_readwrite.c +++ b/apps/plugins/pdbox/PDa/src/g_readwrite.c | |||
@@ -8,18 +8,29 @@ collection of "scalar" objects. Routines here can save collections of | |||
8 | scalars into a file and reload them; also, support is included here for | 8 | scalars into a file and reload them; also, support is included here for |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifdef ROCKBOX | ||
12 | #include "plugin.h" | ||
13 | #include "pdbox.h" | ||
14 | #include "m_pd.h" | ||
15 | #include "g_canvas.h" | ||
16 | #else /* ROCKBOX */ | ||
11 | #include <stdlib.h> | 17 | #include <stdlib.h> |
12 | #include <stdio.h> | 18 | #include <stdio.h> |
13 | #include "m_pd.h" | 19 | #include "m_pd.h" |
14 | #include "g_canvas.h" | 20 | #include "g_canvas.h" |
15 | #include <string.h> | 21 | #include <string.h> |
22 | #endif /* ROCKBOX */ | ||
16 | 23 | ||
17 | /* the following routines read "scalars" from a file into a canvas. */ | 24 | /* the following routines read "scalars" from a file into a canvas. */ |
18 | 25 | ||
19 | static int canvas_scanbinbuf(int natoms, t_atom *vec, int *p_indexout, | 26 | static int canvas_scanbinbuf(int natoms, t_atom *vec, int *p_indexout, |
20 | int *p_next) | 27 | int *p_next) |
21 | { | 28 | { |
29 | #ifdef ROCKBOX | ||
30 | int i; | ||
31 | #else | ||
22 | int i, j; | 32 | int i, j; |
33 | #endif | ||
23 | int indexwas = *p_next; | 34 | int indexwas = *p_next; |
24 | *p_indexout = indexwas; | 35 | *p_indexout = indexwas; |
25 | if (indexwas >= natoms) | 36 | if (indexwas >= natoms) |
@@ -38,6 +49,9 @@ int glist_readscalar(t_glist *x, int natoms, t_atom *vec, | |||
38 | static void canvas_readerror(int natoms, t_atom *vec, int message, | 49 | static void canvas_readerror(int natoms, t_atom *vec, int message, |
39 | int nline, char *s) | 50 | int nline, char *s) |
40 | { | 51 | { |
52 | #ifdef ROCKBOX | ||
53 | (void) natoms; | ||
54 | #endif | ||
41 | error(s); | 55 | error(s); |
42 | startpost("line was:"); | 56 | startpost("line was:"); |
43 | postatom(nline, vec + message); | 57 | postatom(nline, vec + message); |
@@ -49,7 +63,11 @@ static void canvas_readerror(int natoms, t_atom *vec, int message, | |||
49 | static void glist_readatoms(t_glist *x, int natoms, t_atom *vec, | 63 | static void glist_readatoms(t_glist *x, int natoms, t_atom *vec, |
50 | int *p_nextmsg, t_symbol *templatesym, t_word *w, int argc, t_atom *argv) | 64 | int *p_nextmsg, t_symbol *templatesym, t_word *w, int argc, t_atom *argv) |
51 | { | 65 | { |
66 | #ifdef ROCKBOX | ||
67 | int message, n, i; | ||
68 | #else | ||
52 | int message, nline, n, i; | 69 | int message, nline, n, i; |
70 | #endif | ||
53 | 71 | ||
54 | t_template *template = template_findbyname(templatesym); | 72 | t_template *template = template_findbyname(templatesym); |
55 | if (!template) | 73 | if (!template) |
@@ -64,7 +82,9 @@ static void glist_readatoms(t_glist *x, int natoms, t_atom *vec, | |||
64 | { | 82 | { |
65 | if (template->t_vec[i].ds_type == DT_ARRAY) | 83 | if (template->t_vec[i].ds_type == DT_ARRAY) |
66 | { | 84 | { |
85 | #ifndef ROCKBOX | ||
67 | int j; | 86 | int j; |
87 | #endif | ||
68 | t_array *a = w[i].w_array; | 88 | t_array *a = w[i].w_array; |
69 | int elemsize = a->a_elemsize, nitems = 0; | 89 | int elemsize = a->a_elemsize, nitems = 0; |
70 | t_symbol *arraytemplatesym = template->t_vec[i].ds_arraytemplate; | 90 | t_symbol *arraytemplatesym = template->t_vec[i].ds_arraytemplate; |
@@ -104,7 +124,11 @@ static void glist_readatoms(t_glist *x, int natoms, t_atom *vec, | |||
104 | int glist_readscalar(t_glist *x, int natoms, t_atom *vec, | 124 | int glist_readscalar(t_glist *x, int natoms, t_atom *vec, |
105 | int *p_nextmsg, int selectit) | 125 | int *p_nextmsg, int selectit) |
106 | { | 126 | { |
127 | #ifdef ROCKBOX | ||
128 | int message, nline; | ||
129 | #else | ||
107 | int message, i, j, nline; | 130 | int message, i, j, nline; |
131 | #endif | ||
108 | t_template *template; | 132 | t_template *template; |
109 | t_symbol *templatesym; | 133 | t_symbol *templatesym; |
110 | t_scalar *sc; | 134 | t_scalar *sc; |
@@ -159,10 +183,16 @@ int glist_readscalar(t_glist *x, int natoms, t_atom *vec, | |||
159 | 183 | ||
160 | void glist_readfrombinbuf(t_glist *x, t_binbuf *b, char *filename, int selectem) | 184 | void glist_readfrombinbuf(t_glist *x, t_binbuf *b, char *filename, int selectem) |
161 | { | 185 | { |
186 | #ifdef ROCKBOX | ||
187 | int natoms, nline, message, nextmsg = 0; | ||
188 | #else | ||
162 | t_canvas *canvas = glist_getcanvas(x); | 189 | t_canvas *canvas = glist_getcanvas(x); |
163 | int cr = 0, natoms, nline, message, nextmsg = 0, i, j, nitems; | 190 | int cr = 0, natoms, nline, message, nextmsg = 0, i, j, nitems; |
191 | #endif | ||
164 | t_atom *vec; | 192 | t_atom *vec; |
193 | #ifndef ROCKBOX | ||
165 | t_gobj *gobj; | 194 | t_gobj *gobj; |
195 | #endif | ||
166 | 196 | ||
167 | natoms = binbuf_getnatom(b); | 197 | natoms = binbuf_getnatom(b); |
168 | vec = binbuf_getvec(b); | 198 | vec = binbuf_getvec(b); |
@@ -244,8 +274,12 @@ static void glist_doread(t_glist *x, t_symbol *filename, t_symbol *format, | |||
244 | t_binbuf *b = binbuf_new(); | 274 | t_binbuf *b = binbuf_new(); |
245 | t_canvas *canvas = glist_getcanvas(x); | 275 | t_canvas *canvas = glist_getcanvas(x); |
246 | int wasvis = glist_isvisible(canvas); | 276 | int wasvis = glist_isvisible(canvas); |
277 | #ifdef ROCKBOX | ||
278 | int cr = 0; | ||
279 | #else | ||
247 | int cr = 0, natoms, nline, message, nextmsg = 0, i, j; | 280 | int cr = 0, natoms, nline, message, nextmsg = 0, i, j; |
248 | t_atom *vec; | 281 | t_atom *vec; |
282 | #endif | ||
249 | 283 | ||
250 | if (!strcmp(format->s_name, "cr")) | 284 | if (!strcmp(format->s_name, "cr")) |
251 | cr = 1; | 285 | cr = 1; |
@@ -302,7 +336,7 @@ void canvas_dataproperties(t_canvas *x, t_scalar *sc, t_binbuf *b) | |||
302 | /* take the new object off the list */ | 336 | /* take the new object off the list */ |
303 | if (ntotal) | 337 | if (ntotal) |
304 | { | 338 | { |
305 | for (y = x->gl_list, nnew = 1; y2 = y->g_next; | 339 | for(y = x->gl_list, nnew = 1; (y2 = y->g_next); |
306 | y = y2, nnew++) | 340 | y = y2, nnew++) |
307 | if (nnew == ntotal) | 341 | if (nnew == ntotal) |
308 | { | 342 | { |
@@ -360,7 +394,9 @@ static void glist_writelist(t_gobj *y, t_binbuf *b); | |||
360 | void canvas_writescalar(t_symbol *templatesym, t_word *w, t_binbuf *b, | 394 | void canvas_writescalar(t_symbol *templatesym, t_word *w, t_binbuf *b, |
361 | int amarrayelement) | 395 | int amarrayelement) |
362 | { | 396 | { |
397 | #ifndef ROCKBOX | ||
363 | t_dataslot *ds; | 398 | t_dataslot *ds; |
399 | #endif | ||
364 | t_template *template = template_findbyname(templatesym); | 400 | t_template *template = template_findbyname(templatesym); |
365 | t_atom *a = (t_atom *)t_getbytes(0); | 401 | t_atom *a = (t_atom *)t_getbytes(0); |
366 | int i, n = template->t_n, natom = 0; | 402 | int i, n = template->t_n, natom = 0; |
@@ -532,12 +568,18 @@ t_binbuf *glist_writetobinbuf(t_glist *x, int wholething) | |||
532 | 568 | ||
533 | static void glist_write(t_glist *x, t_symbol *filename, t_symbol *format) | 569 | static void glist_write(t_glist *x, t_symbol *filename, t_symbol *format) |
534 | { | 570 | { |
571 | #ifdef ROCKBOX | ||
572 | int cr = 0; | ||
573 | #else | ||
535 | int cr = 0, i; | 574 | int cr = 0, i; |
575 | #endif | ||
536 | t_binbuf *b; | 576 | t_binbuf *b; |
537 | char buf[MAXPDSTRING]; | 577 | char buf[MAXPDSTRING]; |
578 | #ifndef ROCKBOX | ||
538 | t_symbol **templatevec = getbytes(0); | 579 | t_symbol **templatevec = getbytes(0); |
539 | int ntemplates = 0; | 580 | int ntemplates = 0; |
540 | t_gobj *y; | 581 | t_gobj *y; |
582 | #endif | ||
541 | t_canvas *canvas = glist_getcanvas(x); | 583 | t_canvas *canvas = glist_getcanvas(x); |
542 | canvas_makefilename(canvas, filename->s_name, buf, MAXPDSTRING); | 584 | canvas_makefilename(canvas, filename->s_name, buf, MAXPDSTRING); |
543 | if (!strcmp(format->s_name, "cr")) | 585 | if (!strcmp(format->s_name, "cr")) |
@@ -586,7 +628,7 @@ static void canvas_saveto(t_canvas *x, t_binbuf *b) | |||
586 | gobj_save(y, b); | 628 | gobj_save(y, b); |
587 | 629 | ||
588 | linetraverser_start(&t, x); | 630 | linetraverser_start(&t, x); |
589 | while (oc = linetraverser_next(&t)) | 631 | while((oc = linetraverser_next(&t))) |
590 | { | 632 | { |
591 | int srcno = canvas_getindex(x, &t.tr_ob->ob_g); | 633 | int srcno = canvas_getindex(x, &t.tr_ob->ob_g); |
592 | int sinkno = canvas_getindex(x, &t.tr_ob2->ob_g); | 634 | int sinkno = canvas_getindex(x, &t.tr_ob2->ob_g); |
@@ -629,7 +671,9 @@ static void canvas_savetemplatesto(t_canvas *x, t_binbuf *b, int wholething) | |||
629 | { | 671 | { |
630 | t_symbol **templatevec = getbytes(0); | 672 | t_symbol **templatevec = getbytes(0); |
631 | int i, ntemplates = 0; | 673 | int i, ntemplates = 0; |
674 | #ifndef ROCKBOX | ||
632 | t_gobj *y; | 675 | t_gobj *y; |
676 | #endif | ||
633 | canvas_collecttemplatesfor(x, &ntemplates, &templatevec, wholething); | 677 | canvas_collecttemplatesfor(x, &ntemplates, &templatevec, wholething); |
634 | for (i = 0; i < ntemplates; i++) | 678 | for (i = 0; i < ntemplates; i++) |
635 | { | 679 | { |
@@ -687,9 +731,13 @@ static void canvas_savetofile(t_canvas *x, t_symbol *filename, t_symbol *dir) | |||
687 | 731 | ||
688 | static void canvas_menusaveas(t_canvas *x) | 732 | static void canvas_menusaveas(t_canvas *x) |
689 | { | 733 | { |
734 | #ifdef ROCKBOX | ||
735 | (void) x; | ||
736 | #else /* ROCKBOX */ | ||
690 | t_canvas *x2 = canvas_getrootfor(x); | 737 | t_canvas *x2 = canvas_getrootfor(x); |
691 | sys_vgui("pdtk_canvas_saveas .x%x \"%s\" \"%s\"\n", x2, | 738 | sys_vgui("pdtk_canvas_saveas .x%x \"%s\" \"%s\"\n", x2, |
692 | x2->gl_name->s_name, canvas_getdir(x2)->s_name); | 739 | x2->gl_name->s_name, canvas_getdir(x2)->s_name); |
740 | #endif /* ROCKBOX */ | ||
693 | } | 741 | } |
694 | 742 | ||
695 | static void canvas_menusave(t_canvas *x) | 743 | static void canvas_menusave(t_canvas *x) |
diff --git a/apps/plugins/pdbox/PDa/src/g_rtext.c b/apps/plugins/pdbox/PDa/src/g_rtext.c index 05c31a9ea7..03aea97e9b 100644 --- a/apps/plugins/pdbox/PDa/src/g_rtext.c +++ b/apps/plugins/pdbox/PDa/src/g_rtext.c | |||
@@ -6,6 +6,14 @@ | |||
6 | /* have to insert gui-objects into editor-list */ | 6 | /* have to insert gui-objects into editor-list */ |
7 | /* all changes are labeled with iemlib */ | 7 | /* all changes are labeled with iemlib */ |
8 | 8 | ||
9 | #ifdef ROCKBOX | ||
10 | #include "plugin.h" | ||
11 | #include "ctype.h" | ||
12 | #include "pdbox.h" | ||
13 | #include "m_pd.h" | ||
14 | #include "g_canvas.h" | ||
15 | #define snprintf rb->snprintf | ||
16 | #else /* ROCKBOX */ | ||
9 | #include <stdlib.h> | 17 | #include <stdlib.h> |
10 | #include <string.h> | 18 | #include <string.h> |
11 | #include <stdio.h> | 19 | #include <stdio.h> |
@@ -14,6 +22,7 @@ | |||
14 | #include "s_stuff.h" | 22 | #include "s_stuff.h" |
15 | #include "g_canvas.h" | 23 | #include "g_canvas.h" |
16 | #include "t_tk.h" | 24 | #include "t_tk.h" |
25 | #endif /* ROCKBOX */ | ||
17 | 26 | ||
18 | #define LMARGIN 1 | 27 | #define LMARGIN 1 |
19 | #define RMARGIN 1 | 28 | #define RMARGIN 1 |
@@ -44,7 +53,9 @@ struct _rtext | |||
44 | t_rtext *rtext_new(t_glist *glist, t_text *who) | 53 | t_rtext *rtext_new(t_glist *glist, t_text *who) |
45 | { | 54 | { |
46 | t_rtext *x = (t_rtext *)getbytes(sizeof *x); | 55 | t_rtext *x = (t_rtext *)getbytes(sizeof *x); |
56 | #ifndef ROCKBOX | ||
47 | int w = 0, h = 0, indx; | 57 | int w = 0, h = 0, indx; |
58 | #endif | ||
48 | x->x_height = -1; | 59 | x->x_height = -1; |
49 | x->x_text = who; | 60 | x->x_text = who; |
50 | x->x_glist = glist; | 61 | x->x_glist = glist; |
@@ -53,8 +64,13 @@ t_rtext *rtext_new(t_glist *glist, t_text *who) | |||
53 | x->x_drawnwidth = x->x_drawnheight = 0; | 64 | x->x_drawnwidth = x->x_drawnheight = 0; |
54 | binbuf_gettext(who->te_binbuf, &x->x_buf, &x->x_bufsize); | 65 | binbuf_gettext(who->te_binbuf, &x->x_buf, &x->x_bufsize); |
55 | glist->gl_editor->e_rtext = x; | 66 | glist->gl_editor->e_rtext = x; |
67 | #ifdef ROCKBOX | ||
68 | snprintf(x->x_tag, strlen(x->x_tag), | ||
69 | ".x%x.t%x", (t_int)glist_getcanvas(x->x_glist), (t_int)x); | ||
70 | #else /* ROCKBOX */ | ||
56 | sprintf(x->x_tag, ".x%x.t%x", (t_int)glist_getcanvas(x->x_glist), | 71 | sprintf(x->x_tag, ".x%x.t%x", (t_int)glist_getcanvas(x->x_glist), |
57 | (t_int)x); | 72 | (t_int)x); |
73 | #endif /* ROCKBOX */ | ||
58 | return (x); | 74 | return (x); |
59 | } | 75 | } |
60 | 76 | ||
@@ -149,12 +165,18 @@ static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp, | |||
149 | char tempbuf[UPBUFSIZE], *tp = tempbuf, *bp = x->x_buf; | 165 | char tempbuf[UPBUFSIZE], *tp = tempbuf, *bp = x->x_buf; |
150 | int outchars, inchars = x->x_bufsize, nlines = 0, ncolumns = 0, | 166 | int outchars, inchars = x->x_bufsize, nlines = 0, ncolumns = 0, |
151 | pixwide, pixhigh; | 167 | pixwide, pixhigh; |
168 | #ifdef ROCKBOX | ||
169 | int fontwidth = 8, fontheight = 10; | ||
170 | #else | ||
152 | int font = glist_getfont(x->x_glist); | 171 | int font = glist_getfont(x->x_glist); |
153 | int fontwidth = sys_fontwidth(font), fontheight = sys_fontheight(font); | 172 | int fontwidth = sys_fontwidth(font), fontheight = sys_fontheight(font); |
173 | #endif | ||
154 | int findx = (*widthp + (fontwidth/2)) / fontwidth, | 174 | int findx = (*widthp + (fontwidth/2)) / fontwidth, |
155 | findy = *heightp / fontheight; | 175 | findy = *heightp / fontheight; |
156 | int reportedindex = 0; | 176 | int reportedindex = 0; |
177 | #ifndef ROCKBOX | ||
157 | t_canvas *canvas = glist_getcanvas(x->x_glist); | 178 | t_canvas *canvas = glist_getcanvas(x->x_glist); |
179 | #endif | ||
158 | int widthspec = x->x_text->te_width; | 180 | int widthspec = x->x_text->te_width; |
159 | int widthlimit = (widthspec ? widthspec : BOXWIDTH); | 181 | int widthlimit = (widthspec ? widthspec : BOXWIDTH); |
160 | while (inchars) | 182 | while (inchars) |
@@ -214,16 +236,22 @@ static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp, | |||
214 | pixhigh = nlines * fontheight + (TMARGIN + BMARGIN); | 236 | pixhigh = nlines * fontheight + (TMARGIN + BMARGIN); |
215 | 237 | ||
216 | if (action == SEND_FIRST) | 238 | if (action == SEND_FIRST) |
239 | #ifdef ROCKBOX | ||
240 | ; | ||
241 | #else /* ROCKBOX */ | ||
217 | sys_vgui("pdtk_text_new .x%x.c %s %f %f {%.*s} %d %s\n", | 242 | sys_vgui("pdtk_text_new .x%x.c %s %f %f {%.*s} %d %s\n", |
218 | canvas, x->x_tag, | 243 | canvas, x->x_tag, |
219 | dispx + LMARGIN, dispy + TMARGIN, | 244 | dispx + LMARGIN, dispy + TMARGIN, |
220 | outchars, tempbuf, sys_hostfontsize(font), | 245 | outchars, tempbuf, sys_hostfontsize(font), |
221 | (glist_isselected(x->x_glist, | 246 | (glist_isselected(x->x_glist, |
222 | &x->x_glist->gl_gobj)? "blue" : "black")); | 247 | &x->x_glist->gl_gobj)? "blue" : "black")); |
248 | #endif /* ROCKBOX */ | ||
223 | else if (action == SEND_UPDATE) | 249 | else if (action == SEND_UPDATE) |
224 | { | 250 | { |
251 | #ifndef ROCKBOX | ||
225 | sys_vgui("pdtk_text_set .x%x.c %s {%.*s}\n", | 252 | sys_vgui("pdtk_text_set .x%x.c %s {%.*s}\n", |
226 | canvas, x->x_tag, outchars, tempbuf); | 253 | canvas, x->x_tag, outchars, tempbuf); |
254 | #endif | ||
227 | if (pixwide != x->x_drawnwidth || pixhigh != x->x_drawnheight) | 255 | if (pixwide != x->x_drawnwidth || pixhigh != x->x_drawnheight) |
228 | text_drawborder(x->x_text, x->x_glist, x->x_tag, | 256 | text_drawborder(x->x_text, x->x_glist, x->x_tag, |
229 | pixwide, pixhigh, 0); | 257 | pixwide, pixhigh, 0); |
@@ -231,18 +259,22 @@ static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp, | |||
231 | { | 259 | { |
232 | if (x->x_selend > x->x_selstart) | 260 | if (x->x_selend > x->x_selstart) |
233 | { | 261 | { |
262 | #ifndef ROCKBOX | ||
234 | sys_vgui(".x%x.c select from %s %d\n", canvas, | 263 | sys_vgui(".x%x.c select from %s %d\n", canvas, |
235 | x->x_tag, x->x_selstart); | 264 | x->x_tag, x->x_selstart); |
236 | sys_vgui(".x%x.c select to %s %d\n", canvas, | 265 | sys_vgui(".x%x.c select to %s %d\n", canvas, |
237 | x->x_tag, x->x_selend + (sys_oldtclversion ? 0 : -1)); | 266 | x->x_tag, x->x_selend + (sys_oldtclversion ? 0 : -1)); |
238 | sys_vgui(".x%x.c focus \"\"\n", canvas); | 267 | sys_vgui(".x%x.c focus \"\"\n", canvas); |
268 | #endif | ||
239 | } | 269 | } |
240 | else | 270 | else |
241 | { | 271 | { |
272 | #ifndef ROCKBOX | ||
242 | sys_vgui(".x%x.c select clear\n", canvas); | 273 | sys_vgui(".x%x.c select clear\n", canvas); |
243 | sys_vgui(".x%x.c icursor %s %d\n", canvas, x->x_tag, | 274 | sys_vgui(".x%x.c icursor %s %d\n", canvas, x->x_tag, |
244 | x->x_selstart); | 275 | x->x_selstart); |
245 | sys_vgui(".x%x.c focus %s\n", canvas, x->x_tag); | 276 | sys_vgui(".x%x.c focus %s\n", canvas, x->x_tag); |
277 | #endif | ||
246 | } | 278 | } |
247 | } | 279 | } |
248 | } | 280 | } |
@@ -273,7 +305,9 @@ void rtext_retext(t_rtext *x) | |||
273 | int wantreduce = bufsize - text->te_width; | 305 | int wantreduce = bufsize - text->te_width; |
274 | char *decimal = 0, *nextchar, *ebuf = x->x_buf + bufsize, | 306 | char *decimal = 0, *nextchar, *ebuf = x->x_buf + bufsize, |
275 | *s1, *s2; | 307 | *s1, *s2; |
308 | #ifndef ROCKBOX | ||
276 | int ndecimals; | 309 | int ndecimals; |
310 | #endif | ||
277 | for (decimal = x->x_buf; decimal < ebuf; decimal++) | 311 | for (decimal = x->x_buf; decimal < ebuf; decimal++) |
278 | if (*decimal == '.') | 312 | if (*decimal == '.') |
279 | break; | 313 | break; |
@@ -339,21 +373,35 @@ void rtext_draw(t_rtext *x) | |||
339 | 373 | ||
340 | void rtext_erase(t_rtext *x) | 374 | void rtext_erase(t_rtext *x) |
341 | { | 375 | { |
376 | #ifdef ROCKBOX | ||
377 | (void) x; | ||
378 | #else | ||
342 | sys_vgui(".x%x.c delete %s\n", glist_getcanvas(x->x_glist), x->x_tag); | 379 | sys_vgui(".x%x.c delete %s\n", glist_getcanvas(x->x_glist), x->x_tag); |
380 | #endif | ||
343 | } | 381 | } |
344 | 382 | ||
345 | void rtext_displace(t_rtext *x, int dx, int dy) | 383 | void rtext_displace(t_rtext *x, int dx, int dy) |
346 | { | 384 | { |
385 | #ifdef ROCKBOX | ||
386 | (void) x; | ||
387 | (void) dx; | ||
388 | (void) dy; | ||
389 | #else /* ROCKBOX */ | ||
347 | sys_vgui(".x%x.c move %s %d %d\n", glist_getcanvas(x->x_glist), | 390 | sys_vgui(".x%x.c move %s %d %d\n", glist_getcanvas(x->x_glist), |
348 | x->x_tag, dx, dy); | 391 | x->x_tag, dx, dy); |
392 | #endif /* ROCKBOX */ | ||
349 | } | 393 | } |
350 | 394 | ||
351 | void rtext_select(t_rtext *x, int state) | 395 | void rtext_select(t_rtext *x, int state) |
352 | { | 396 | { |
353 | t_glist *glist = x->x_glist; | 397 | t_glist *glist = x->x_glist; |
354 | t_canvas *canvas = glist_getcanvas(glist); | 398 | t_canvas *canvas = glist_getcanvas(glist); |
399 | #ifdef ROCKBOX | ||
400 | (void) state; | ||
401 | #else /* ROCKBOX */ | ||
355 | sys_vgui(".x%x.c itemconfigure %s -fill %s\n", canvas, | 402 | sys_vgui(".x%x.c itemconfigure %s -fill %s\n", canvas, |
356 | x->x_tag, (state? "blue" : "black")); | 403 | x->x_tag, (state? "blue" : "black")); |
404 | #endif /* ROCKBOX */ | ||
357 | canvas_editing = canvas; | 405 | canvas_editing = canvas; |
358 | } | 406 | } |
359 | 407 | ||
@@ -361,10 +409,14 @@ void rtext_activate(t_rtext *x, int state) | |||
361 | { | 409 | { |
362 | int w = 0, h = 0, indx; | 410 | int w = 0, h = 0, indx; |
363 | t_glist *glist = x->x_glist; | 411 | t_glist *glist = x->x_glist; |
412 | #ifndef ROCKBOX | ||
364 | t_canvas *canvas = glist_getcanvas(glist); | 413 | t_canvas *canvas = glist_getcanvas(glist); |
414 | #endif | ||
365 | if (state) | 415 | if (state) |
366 | { | 416 | { |
417 | #ifndef ROCKBOX | ||
367 | sys_vgui(".x%x.c focus %s\n", canvas, x->x_tag); | 418 | sys_vgui(".x%x.c focus %s\n", canvas, x->x_tag); |
419 | #endif | ||
368 | glist->gl_editor->e_textedfor = x; | 420 | glist->gl_editor->e_textedfor = x; |
369 | glist->gl_editor->e_textdirty = 0; | 421 | glist->gl_editor->e_textdirty = 0; |
370 | x->x_dragfrom = x->x_selstart = 0; | 422 | x->x_dragfrom = x->x_selstart = 0; |
@@ -373,8 +425,10 @@ void rtext_activate(t_rtext *x, int state) | |||
373 | } | 425 | } |
374 | else | 426 | else |
375 | { | 427 | { |
428 | #ifndef ROCKBOX | ||
376 | sys_vgui("selection clear .x%x.c\n", canvas); | 429 | sys_vgui("selection clear .x%x.c\n", canvas); |
377 | sys_vgui(".x%x.c focus \"\"\n", canvas); | 430 | sys_vgui(".x%x.c focus \"\"\n", canvas); |
431 | #endif | ||
378 | if (glist->gl_editor->e_textedfor == x) | 432 | if (glist->gl_editor->e_textedfor == x) |
379 | glist->gl_editor->e_textedfor = 0; | 433 | glist->gl_editor->e_textedfor = 0; |
380 | x->x_active = 0; | 434 | x->x_active = 0; |
@@ -385,7 +439,9 @@ void rtext_activate(t_rtext *x, int state) | |||
385 | void rtext_key(t_rtext *x, int keynum, t_symbol *keysym) | 439 | void rtext_key(t_rtext *x, int keynum, t_symbol *keysym) |
386 | { | 440 | { |
387 | int w = 0, h = 0, indx, i, newsize, ndel; | 441 | int w = 0, h = 0, indx, i, newsize, ndel; |
442 | #ifndef ROCKBOX | ||
388 | char *s1, *s2; | 443 | char *s1, *s2; |
444 | #endif | ||
389 | if (keynum) | 445 | if (keynum) |
390 | { | 446 | { |
391 | int n = keynum; | 447 | int n = keynum; |
diff --git a/apps/plugins/pdbox/PDa/src/g_scalar.c b/apps/plugins/pdbox/PDa/src/g_scalar.c index 329003e63e..8f9b5609d5 100644 --- a/apps/plugins/pdbox/PDa/src/g_scalar.c +++ b/apps/plugins/pdbox/PDa/src/g_scalar.c | |||
@@ -19,11 +19,18 @@ control their appearances by adding stuff to draw. | |||
19 | * added Krzysztof Czajas fix to avoid crashing... | 19 | * added Krzysztof Czajas fix to avoid crashing... |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #ifdef ROCKBOX | ||
23 | #include "plugin.h" | ||
24 | #include "pdbox.h" | ||
25 | #include "m_pd.h" | ||
26 | #include "g_canvas.h" | ||
27 | #else /* ROCKBOX */ | ||
22 | #include <stdlib.h> | 28 | #include <stdlib.h> |
23 | #include <string.h> | 29 | #include <string.h> |
24 | #include <stdio.h> /* for read/write to files */ | 30 | #include <stdio.h> /* for read/write to files */ |
25 | #include "m_pd.h" | 31 | #include "m_pd.h" |
26 | #include "g_canvas.h" | 32 | #include "g_canvas.h" |
33 | #endif /* ROCKBOX */ | ||
27 | 34 | ||
28 | t_class *scalar_class; | 35 | t_class *scalar_class; |
29 | 36 | ||
@@ -139,6 +146,9 @@ void glist_scalar(t_glist *glist, | |||
139 | t_binbuf *b; | 146 | t_binbuf *b; |
140 | int natoms, nextmsg = 0; | 147 | int natoms, nextmsg = 0; |
141 | t_atom *vec; | 148 | t_atom *vec; |
149 | #ifdef ROCKBOX | ||
150 | (void) classname; | ||
151 | #endif | ||
142 | if (!template_findbyname(templatesym)) | 152 | if (!template_findbyname(templatesym)) |
143 | { | 153 | { |
144 | pd_error(glist, "%s: no such template", | 154 | pd_error(glist, "%s: no such template", |
@@ -167,7 +177,9 @@ static void scalar_getrect(t_gobj *z, t_glist *owner, | |||
167 | int *xp1, int *yp1, int *xp2, int *yp2) | 177 | int *xp1, int *yp1, int *xp2, int *yp2) |
168 | { | 178 | { |
169 | t_scalar *x = (t_scalar *)z; | 179 | t_scalar *x = (t_scalar *)z; |
180 | #ifndef ROCKBOX | ||
170 | int hit = 0; | 181 | int hit = 0; |
182 | #endif | ||
171 | t_template *template = template_findbyname(x->sc_template); | 183 | t_template *template = template_findbyname(x->sc_template); |
172 | t_canvas *templatecanvas = template_findcanvas(template); | 184 | t_canvas *templatecanvas = template_findcanvas(template); |
173 | int x1 = 0x7fffffff, x2 = -0x7fffffff, y1 = 0x7fffffff, y2 = -0x7fffffff; | 185 | int x1 = 0x7fffffff, x2 = -0x7fffffff, y1 = 0x7fffffff, y2 = -0x7fffffff; |
@@ -213,7 +225,9 @@ static void scalar_getrect(t_gobj *z, t_glist *owner, | |||
213 | 225 | ||
214 | static void scalar_select(t_gobj *z, t_glist *owner, int state) | 226 | static void scalar_select(t_gobj *z, t_glist *owner, int state) |
215 | { | 227 | { |
228 | #ifndef ROCKBOX | ||
216 | t_scalar *x = (t_scalar *)z; | 229 | t_scalar *x = (t_scalar *)z; |
230 | #endif | ||
217 | /* post("scalar_select %d", state); */ | 231 | /* post("scalar_select %d", state); */ |
218 | /* later */ | 232 | /* later */ |
219 | if (state) | 233 | if (state) |
@@ -221,12 +235,16 @@ static void scalar_select(t_gobj *z, t_glist *owner, int state) | |||
221 | int x1, y1, x2, y2; | 235 | int x1, y1, x2, y2; |
222 | scalar_getrect(z, owner, &x1, &y1, &x2, &y2); | 236 | scalar_getrect(z, owner, &x1, &y1, &x2, &y2); |
223 | x1--; x2++; y1--; y2++; | 237 | x1--; x2++; y1--; y2++; |
238 | #ifndef ROCKBOX | ||
224 | sys_vgui(".x%x.c create line %d %d %d %d %d %d %d %d %d %d \ | 239 | sys_vgui(".x%x.c create line %d %d %d %d %d %d %d %d %d %d \ |
225 | -width 0 -fill blue -tags select%x\n", | 240 | -width 0 -fill blue -tags select%x\n", |
226 | glist_getcanvas(owner), x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, | 241 | glist_getcanvas(owner), x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, |
227 | x); | 242 | x); |
243 | #endif | ||
228 | } | 244 | } |
245 | #ifndef ROCKBOX | ||
229 | else sys_vgui(".x%x.c delete select%x\n", glist_getcanvas(owner), x); | 246 | else sys_vgui(".x%x.c delete select%x\n", glist_getcanvas(owner), x); |
247 | #endif | ||
230 | } | 248 | } |
231 | 249 | ||
232 | static void scalar_displace(t_gobj *z, t_glist *glist, int dx, int dy) | 250 | static void scalar_displace(t_gobj *z, t_glist *glist, int dx, int dy) |
@@ -263,12 +281,21 @@ static void scalar_displace(t_gobj *z, t_glist *glist, int dx, int dy) | |||
263 | 281 | ||
264 | static void scalar_activate(t_gobj *z, t_glist *owner, int state) | 282 | static void scalar_activate(t_gobj *z, t_glist *owner, int state) |
265 | { | 283 | { |
284 | #ifdef ROCKBOX | ||
285 | (void) z; | ||
286 | (void) owner; | ||
287 | (void) state; | ||
288 | #endif | ||
266 | /* post("scalar_activate %d", state); */ | 289 | /* post("scalar_activate %d", state); */ |
267 | /* later */ | 290 | /* later */ |
268 | } | 291 | } |
269 | 292 | ||
270 | static void scalar_delete(t_gobj *z, t_glist *glist) | 293 | static void scalar_delete(t_gobj *z, t_glist *glist) |
271 | { | 294 | { |
295 | #ifdef ROCKBOX | ||
296 | (void) z; | ||
297 | (void) glist; | ||
298 | #endif | ||
272 | /* nothing to do */ | 299 | /* nothing to do */ |
273 | } | 300 | } |
274 | 301 | ||
@@ -285,12 +312,16 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) | |||
285 | { | 312 | { |
286 | if (vis) | 313 | if (vis) |
287 | { | 314 | { |
315 | #ifndef ROCKBOX | ||
288 | int x1 = glist_xtopixels(owner, basex); | 316 | int x1 = glist_xtopixels(owner, basex); |
289 | int y1 = glist_ytopixels(owner, basey); | 317 | int y1 = glist_ytopixels(owner, basey); |
290 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags scalar%x\n", | 318 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags scalar%x\n", |
291 | glist_getcanvas(owner), x1-1, y1-1, x1+1, y1+1, x); | 319 | glist_getcanvas(owner), x1-1, y1-1, x1+1, y1+1, x); |
320 | #endif | ||
292 | } | 321 | } |
322 | #ifndef ROCKBOX | ||
293 | else sys_vgui(".x%x.c delete scalar%x\n", glist_getcanvas(owner), x); | 323 | else sys_vgui(".x%x.c delete scalar%x\n", glist_getcanvas(owner), x); |
324 | #endif | ||
294 | return; | 325 | return; |
295 | } | 326 | } |
296 | 327 | ||
@@ -316,9 +347,9 @@ static int scalar_click(t_gobj *z, struct _glist *owner, | |||
316 | { | 347 | { |
317 | t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd); | 348 | t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd); |
318 | if (!wb) continue; | 349 | if (!wb) continue; |
319 | if (hit = (*wb->w_parentclickfn)(y, owner, | 350 | if((hit = (*wb->w_parentclickfn)(y, owner, |
320 | x, template, basex, basey, | 351 | x, template, basex, basey, |
321 | xpix, ypix, shift, alt, dbl, doit)) | 352 | xpix, ypix, shift, alt, dbl, doit))) |
322 | return (hit); | 353 | return (hit); |
323 | } | 354 | } |
324 | return (0); | 355 | return (0); |
@@ -331,8 +362,10 @@ static void scalar_save(t_gobj *z, t_binbuf *b) | |||
331 | { | 362 | { |
332 | t_scalar *x = (t_scalar *)z; | 363 | t_scalar *x = (t_scalar *)z; |
333 | t_binbuf *b2 = binbuf_new(); | 364 | t_binbuf *b2 = binbuf_new(); |
365 | #ifndef ROCKBOX | ||
334 | t_atom a, *argv; | 366 | t_atom a, *argv; |
335 | int i, argc; | 367 | int i, argc; |
368 | #endif | ||
336 | canvas_writescalar(x->sc_template, x->sc_vec, b2, 0); | 369 | canvas_writescalar(x->sc_template, x->sc_vec, b2, 0); |
337 | binbuf_addv(b, "ss", &s__X, gensym("scalar")); | 370 | binbuf_addv(b, "ss", &s__X, gensym("scalar")); |
338 | binbuf_addbinbuf(b, b2); | 371 | binbuf_addbinbuf(b, b2); |
@@ -342,6 +375,10 @@ static void scalar_save(t_gobj *z, t_binbuf *b) | |||
342 | 375 | ||
343 | static void scalar_properties(t_gobj *z, struct _glist *owner) | 376 | static void scalar_properties(t_gobj *z, struct _glist *owner) |
344 | { | 377 | { |
378 | #ifdef ROCKBOX | ||
379 | (void) z; | ||
380 | (void) owner; | ||
381 | #else /* ROCKBOX */ | ||
345 | t_scalar *x = (t_scalar *)z; | 382 | t_scalar *x = (t_scalar *)z; |
346 | char *buf, buf2[80]; | 383 | char *buf, buf2[80]; |
347 | int bufsize; | 384 | int bufsize; |
@@ -358,6 +395,7 @@ static void scalar_properties(t_gobj *z, struct _glist *owner) | |||
358 | sys_gui(buf); | 395 | sys_gui(buf); |
359 | sys_gui("}\n"); | 396 | sys_gui("}\n"); |
360 | t_freebytes(buf, bufsize+1); | 397 | t_freebytes(buf, bufsize+1); |
398 | #endif /* ROCKBOX */ | ||
361 | } | 399 | } |
362 | 400 | ||
363 | static t_widgetbehavior scalar_widgetbehavior = | 401 | static t_widgetbehavior scalar_widgetbehavior = |
@@ -373,8 +411,10 @@ static t_widgetbehavior scalar_widgetbehavior = | |||
373 | 411 | ||
374 | static void scalar_free(t_scalar *x) | 412 | static void scalar_free(t_scalar *x) |
375 | { | 413 | { |
414 | #ifndef ROCKBOX | ||
376 | int i; | 415 | int i; |
377 | t_dataslot *datatypes, *dt; | 416 | t_dataslot *datatypes, *dt; |
417 | #endif | ||
378 | t_symbol *templatesym = x->sc_template; | 418 | t_symbol *templatesym = x->sc_template; |
379 | t_template *template = template_findbyname(templatesym); | 419 | t_template *template = template_findbyname(templatesym); |
380 | if (!template) | 420 | if (!template) |
@@ -383,7 +423,9 @@ static void scalar_free(t_scalar *x) | |||
383 | return; | 423 | return; |
384 | } | 424 | } |
385 | word_free(x->sc_vec, template); | 425 | word_free(x->sc_vec, template); |
426 | #ifndef ROCKBOX | ||
386 | gfxstub_deleteforkey(x); | 427 | gfxstub_deleteforkey(x); |
428 | #endif | ||
387 | /* the "size" field in the class is zero, so Pd doesn't try to free | 429 | /* the "size" field in the class is zero, so Pd doesn't try to free |
388 | us automatically (see pd_free()) */ | 430 | us automatically (see pd_free()) */ |
389 | freebytes(x, sizeof(t_scalar) + (template->t_n - 1) * sizeof(*x->sc_vec)); | 431 | freebytes(x, sizeof(t_scalar) + (template->t_n - 1) * sizeof(*x->sc_vec)); |
diff --git a/apps/plugins/pdbox/PDa/src/g_template.c b/apps/plugins/pdbox/PDa/src/g_template.c index 9e62c0f1d2..deb47c3129 100644 --- a/apps/plugins/pdbox/PDa/src/g_template.c +++ b/apps/plugins/pdbox/PDa/src/g_template.c | |||
@@ -2,6 +2,14 @@ | |||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | 2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL |
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | 3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ |
4 | 4 | ||
5 | #ifdef ROCKBOX | ||
6 | #include "plugin.h" | ||
7 | #include "pdbox.h" | ||
8 | #include "m_pd.h" | ||
9 | #include "s_stuff.h" | ||
10 | #include "g_canvas.h" | ||
11 | #define snprintf rb->snprintf | ||
12 | #else /* ROCKBOX */ | ||
5 | #include <stdlib.h> | 13 | #include <stdlib.h> |
6 | #include <string.h> | 14 | #include <string.h> |
7 | #include <stdio.h> | 15 | #include <stdio.h> |
@@ -9,6 +17,7 @@ | |||
9 | #include "m_pd.h" | 17 | #include "m_pd.h" |
10 | #include "s_stuff.h" /* for sys_hostfontsize */ | 18 | #include "s_stuff.h" /* for sys_hostfontsize */ |
11 | #include "g_canvas.h" | 19 | #include "g_canvas.h" |
20 | #endif /* ROCKBOX */ | ||
12 | 21 | ||
13 | /* | 22 | /* |
14 | This file contains text objects you would put in a canvas to define a | 23 | This file contains text objects you would put in a canvas to define a |
@@ -140,7 +149,9 @@ int template_size(t_template *x) | |||
140 | int template_find_field(t_template *x, t_symbol *name, int *p_onset, | 149 | int template_find_field(t_template *x, t_symbol *name, int *p_onset, |
141 | int *p_type, t_symbol **p_arraytype) | 150 | int *p_type, t_symbol **p_arraytype) |
142 | { | 151 | { |
152 | #ifndef ROCKBOX | ||
143 | t_template *t; | 153 | t_template *t; |
154 | #endif | ||
144 | int i, n; | 155 | int i, n; |
145 | if (!x) | 156 | if (!x) |
146 | { | 157 | { |
@@ -262,7 +273,13 @@ elements might still be old ones. | |||
262 | static void template_conformwords(t_template *tfrom, t_template *tto, | 273 | static void template_conformwords(t_template *tfrom, t_template *tto, |
263 | int *conformaction, t_word *wfrom, t_word *wto) | 274 | int *conformaction, t_word *wfrom, t_word *wto) |
264 | { | 275 | { |
276 | #ifdef ROCKBOX | ||
277 | int nto = tto->t_n, i; | ||
278 | |||
279 | (void) tfrom; | ||
280 | #else | ||
265 | int nfrom = tfrom->t_n, nto = tto->t_n, i; | 281 | int nfrom = tfrom->t_n, nto = tto->t_n, i; |
282 | #endif | ||
266 | for (i = 0; i < nto; i++) | 283 | for (i = 0; i < nto; i++) |
267 | { | 284 | { |
268 | if (conformaction[i] >= 0) | 285 | if (conformaction[i] >= 0) |
@@ -282,7 +299,11 @@ static t_scalar *template_conformscalar(t_template *tfrom, t_template *tto, | |||
282 | { | 299 | { |
283 | t_scalar *x; | 300 | t_scalar *x; |
284 | t_gpointer gp; | 301 | t_gpointer gp; |
302 | #ifdef ROCKBOX | ||
303 | int i; | ||
304 | #else | ||
285 | int nto = tto->t_n, nfrom = tfrom->t_n, i; | 305 | int nto = tto->t_n, nfrom = tfrom->t_n, i; |
306 | #endif | ||
286 | t_template *scalartemplate; | 307 | t_template *scalartemplate; |
287 | /* post("conform scalar"); */ | 308 | /* post("conform scalar"); */ |
288 | /* possibly replace the scalar */ | 309 | /* possibly replace the scalar */ |
@@ -311,7 +332,7 @@ static t_scalar *template_conformscalar(t_template *tfrom, t_template *tto, | |||
311 | else | 332 | else |
312 | { | 333 | { |
313 | t_gobj *y, *y2; | 334 | t_gobj *y, *y2; |
314 | for (y = glist->gl_list; y2 = y->g_next; y = y2) | 335 | for (y = glist->gl_list; (y2 = y->g_next); y = y2) |
315 | if (y2 == &scfrom->sc_gobj) | 336 | if (y2 == &scfrom->sc_gobj) |
316 | { | 337 | { |
317 | x->sc_gobj.g_next = y2->g_next; | 338 | x->sc_gobj.g_next = y2->g_next; |
@@ -447,7 +468,9 @@ void template_conform(t_template *tfrom, t_template *tto) | |||
447 | 468 | ||
448 | t_template *template_findbyname(t_symbol *s) | 469 | t_template *template_findbyname(t_symbol *s) |
449 | { | 470 | { |
471 | #ifndef ROCKBOX | ||
450 | int i; | 472 | int i; |
473 | #endif | ||
451 | if (s == &s_float) | 474 | if (s == &s_float) |
452 | return (&template_float); | 475 | return (&template_float); |
453 | else return ((t_template *)pd_findbyclass(s, template_class)); | 476 | else return ((t_template *)pd_findbyclass(s, template_class)); |
@@ -477,6 +500,10 @@ static void *template_usetemplate(void *dummy, t_symbol *s, | |||
477 | t_template *x; | 500 | t_template *x; |
478 | t_symbol *templatesym = | 501 | t_symbol *templatesym = |
479 | canvas_makebindsym(atom_getsymbolarg(0, argc, argv)); | 502 | canvas_makebindsym(atom_getsymbolarg(0, argc, argv)); |
503 | #ifdef ROCKBOX | ||
504 | (void) dummy; | ||
505 | (void) s; | ||
506 | #endif | ||
480 | if (!argc) | 507 | if (!argc) |
481 | return (0); | 508 | return (0); |
482 | argc--; argv++; | 509 | argc--; argv++; |
@@ -540,7 +567,9 @@ static void *gtemplate_donew(t_symbol *sym, int argc, t_atom *argv) | |||
540 | t_gtemplate *x = (t_gtemplate *)pd_new(gtemplate_class); | 567 | t_gtemplate *x = (t_gtemplate *)pd_new(gtemplate_class); |
541 | t_template *t = template_findbyname(sym); | 568 | t_template *t = template_findbyname(sym); |
542 | int i; | 569 | int i; |
570 | #ifndef ROCKBOX | ||
543 | t_symbol *sx = gensym("x"); | 571 | t_symbol *sx = gensym("x"); |
572 | #endif | ||
544 | x->x_owner = canvas_getcurrent(); | 573 | x->x_owner = canvas_getcurrent(); |
545 | x->x_next = 0; | 574 | x->x_next = 0; |
546 | x->x_sym = sym; | 575 | x->x_sym = sym; |
@@ -559,7 +588,7 @@ static void *gtemplate_donew(t_symbol *sym, int argc, t_atom *argv) | |||
559 | if (t->t_list) | 588 | if (t->t_list) |
560 | { | 589 | { |
561 | t_gtemplate *x2, *x3; | 590 | t_gtemplate *x2, *x3; |
562 | for (x2 = x->x_template->t_list; x3 = x2->x_next; x2 = x3) | 591 | for(x2 = x->x_template->t_list; (x3 = x2->x_next); x2 = x3) |
563 | ; | 592 | ; |
564 | x2->x_next = x; | 593 | x2->x_next = x; |
565 | post("template %s: warning: already exists.", sym->s_name); | 594 | post("template %s: warning: already exists.", sym->s_name); |
@@ -593,8 +622,13 @@ static void *gtemplate_donew(t_symbol *sym, int argc, t_atom *argv) | |||
593 | 622 | ||
594 | static void *gtemplate_new(t_symbol *s, int argc, t_atom *argv) | 623 | static void *gtemplate_new(t_symbol *s, int argc, t_atom *argv) |
595 | { | 624 | { |
625 | #ifndef ROCKBOX | ||
596 | t_gtemplate *x = (t_gtemplate *)pd_new(gtemplate_class); | 626 | t_gtemplate *x = (t_gtemplate *)pd_new(gtemplate_class); |
627 | #endif | ||
597 | t_symbol *sym = atom_getsymbolarg(0, argc, argv); | 628 | t_symbol *sym = atom_getsymbolarg(0, argc, argv); |
629 | #ifdef ROCKBOX | ||
630 | (void) s; | ||
631 | #endif | ||
598 | if (argc >= 1) | 632 | if (argc >= 1) |
599 | argc--; argv++; | 633 | argc--; argv++; |
600 | return (gtemplate_donew(canvas_makebindsym(sym), argc, argv)); | 634 | return (gtemplate_donew(canvas_makebindsym(sym), argc, argv)); |
@@ -603,9 +637,14 @@ static void *gtemplate_new(t_symbol *s, int argc, t_atom *argv) | |||
603 | /* old version (0.34) -- delete 2003 or so */ | 637 | /* old version (0.34) -- delete 2003 or so */ |
604 | static void *gtemplate_new_old(t_symbol *s, int argc, t_atom *argv) | 638 | static void *gtemplate_new_old(t_symbol *s, int argc, t_atom *argv) |
605 | { | 639 | { |
640 | #ifndef ROCKBOX | ||
606 | t_gtemplate *x = (t_gtemplate *)pd_new(gtemplate_class); | 641 | t_gtemplate *x = (t_gtemplate *)pd_new(gtemplate_class); |
642 | #endif | ||
607 | t_symbol *sym = canvas_makebindsym(canvas_getcurrent()->gl_name); | 643 | t_symbol *sym = canvas_makebindsym(canvas_getcurrent()->gl_name); |
608 | static int warned; | 644 | static int warned; |
645 | #ifdef ROCKBOX | ||
646 | (void) s; | ||
647 | #endif | ||
609 | if (!warned) | 648 | if (!warned) |
610 | { | 649 | { |
611 | post("warning -- 'template' (%s) is obsolete; replace with 'struct'", | 650 | post("warning -- 'template' (%s) is obsolete; replace with 'struct'", |
@@ -643,7 +682,7 @@ static void gtemplate_free(t_gtemplate *x) | |||
643 | else | 682 | else |
644 | { | 683 | { |
645 | t_gtemplate *x2, *x3; | 684 | t_gtemplate *x2, *x3; |
646 | for (x2 = t->t_list; x3 = x2->x_next; x2 = x3) | 685 | for(x2 = t->t_list; (x3 = x2->x_next); x2 = x3) |
647 | { | 686 | { |
648 | if (x == x3) | 687 | if (x == x3) |
649 | { | 688 | { |
@@ -829,6 +868,16 @@ static void curve_displace(t_gobj *z, t_glist *glist, | |||
829 | t_word *data, t_template *template, float basex, float basey, | 868 | t_word *data, t_template *template, float basex, float basey, |
830 | int dx, int dy) | 869 | int dx, int dy) |
831 | { | 870 | { |
871 | #ifdef ROCKBOX | ||
872 | (void) z; | ||
873 | (void) glist; | ||
874 | (void) data; | ||
875 | (void) template; | ||
876 | (void) basex; | ||
877 | (void) basey; | ||
878 | (void) dx; | ||
879 | (void) dy; | ||
880 | #endif | ||
832 | /* refuse */ | 881 | /* refuse */ |
833 | } | 882 | } |
834 | 883 | ||
@@ -836,6 +885,15 @@ static void curve_select(t_gobj *z, t_glist *glist, | |||
836 | t_word *data, t_template *template, float basex, float basey, | 885 | t_word *data, t_template *template, float basex, float basey, |
837 | int state) | 886 | int state) |
838 | { | 887 | { |
888 | #ifdef ROCKBOX | ||
889 | (void) z; | ||
890 | (void) glist; | ||
891 | (void) data; | ||
892 | (void) template; | ||
893 | (void) basex; | ||
894 | (void) basey; | ||
895 | (void) state; | ||
896 | #endif | ||
839 | /* fill in later */ | 897 | /* fill in later */ |
840 | } | 898 | } |
841 | 899 | ||
@@ -843,6 +901,15 @@ static void curve_activate(t_gobj *z, t_glist *glist, | |||
843 | t_word *data, t_template *template, float basex, float basey, | 901 | t_word *data, t_template *template, float basex, float basey, |
844 | int state) | 902 | int state) |
845 | { | 903 | { |
904 | #ifdef ROCKBOX | ||
905 | (void) z; | ||
906 | (void) glist; | ||
907 | (void) data; | ||
908 | (void) template; | ||
909 | (void) basex; | ||
910 | (void) basey; | ||
911 | (void) state; | ||
912 | #endif | ||
846 | /* fill in later */ | 913 | /* fill in later */ |
847 | } | 914 | } |
848 | 915 | ||
@@ -861,8 +928,13 @@ static void numbertocolor(int n, char *s) | |||
861 | red = n / 100; | 928 | red = n / 100; |
862 | blue = ((n / 10) % 10); | 929 | blue = ((n / 10) % 10); |
863 | green = n % 10; | 930 | green = n % 10; |
931 | #ifdef ROCKBOX | ||
932 | snprintf(s, 8, "#%2.2x%2.2x%2.2x", | ||
933 | rangecolor(red), rangecolor(blue), rangecolor(green)); | ||
934 | #else | ||
864 | sprintf(s, "#%2.2x%2.2x%2.2x", rangecolor(red), rangecolor(blue), | 935 | sprintf(s, "#%2.2x%2.2x%2.2x", rangecolor(red), rangecolor(blue), |
865 | rangecolor(green)); | 936 | rangecolor(green)); |
937 | #endif | ||
866 | } | 938 | } |
867 | 939 | ||
868 | static void curve_vis(t_gobj *z, t_glist *glist, | 940 | static void curve_vis(t_gobj *z, t_glist *glist, |
@@ -872,12 +944,22 @@ static void curve_vis(t_gobj *z, t_glist *glist, | |||
872 | t_curve *x = (t_curve *)z; | 944 | t_curve *x = (t_curve *)z; |
873 | int i, n = x->x_npoints; | 945 | int i, n = x->x_npoints; |
874 | t_fielddesc *f = x->x_vec; | 946 | t_fielddesc *f = x->x_vec; |
947 | |||
948 | #ifdef ROCKBOX | ||
949 | (void) glist; | ||
950 | (void) basex; | ||
951 | (void) basey; | ||
952 | #endif | ||
875 | 953 | ||
876 | if (vis) | 954 | if (vis) |
877 | { | 955 | { |
878 | if (n > 1) | 956 | if (n > 1) |
879 | { | 957 | { |
958 | #ifdef ROCKBOX | ||
959 | int flags = x->x_flags; | ||
960 | #else | ||
880 | int flags = x->x_flags, closed = (flags & CLOSED); | 961 | int flags = x->x_flags, closed = (flags & CLOSED); |
962 | #endif | ||
881 | float width = fielddesc_getfloat(&x->x_width, template, data, 1); | 963 | float width = fielddesc_getfloat(&x->x_width, template, data, 1); |
882 | char outline[20], fill[20]; | 964 | char outline[20], fill[20]; |
883 | if (width < 1) width = 1; | 965 | if (width < 1) width = 1; |
@@ -889,19 +971,26 @@ static void curve_vis(t_gobj *z, t_glist *glist, | |||
889 | numbertocolor( | 971 | numbertocolor( |
890 | fielddesc_getfloat(&x->x_fillcolor, template, data, 1), | 972 | fielddesc_getfloat(&x->x_fillcolor, template, data, 1), |
891 | fill); | 973 | fill); |
974 | #ifndef ROCKBOX | ||
892 | sys_vgui(".x%x.c create polygon\\\n", | 975 | sys_vgui(".x%x.c create polygon\\\n", |
893 | glist_getcanvas(glist)); | 976 | glist_getcanvas(glist)); |
977 | #endif | ||
894 | } | 978 | } |
979 | #ifndef ROCKBOX | ||
895 | else sys_vgui(".x%x.c create line\\\n", | 980 | else sys_vgui(".x%x.c create line\\\n", |
896 | glist_getcanvas(glist)); | 981 | glist_getcanvas(glist)); |
982 | #endif | ||
897 | for (i = 0, f = x->x_vec; i < n; i++, f += 2) | 983 | for (i = 0, f = x->x_vec; i < n; i++, f += 2) |
898 | { | 984 | { |
985 | #ifndef ROCKBOX | ||
899 | float xloc = glist_xtopixels(glist, | 986 | float xloc = glist_xtopixels(glist, |
900 | basex + fielddesc_getfloat(f, template, data, 1)); | 987 | basex + fielddesc_getfloat(f, template, data, 1)); |
901 | float yloc = glist_ytopixels(glist, | 988 | float yloc = glist_ytopixels(glist, |
902 | basey + fielddesc_getfloat(f+1, template, data, 1)); | 989 | basey + fielddesc_getfloat(f+1, template, data, 1)); |
903 | sys_vgui("%d %d\\\n", (int)xloc, (int)yloc); | 990 | sys_vgui("%d %d\\\n", (int)xloc, (int)yloc); |
991 | #endif | ||
904 | } | 992 | } |
993 | #ifndef ROCKBOX | ||
905 | sys_vgui("-width %f\\\n", | 994 | sys_vgui("-width %f\\\n", |
906 | fielddesc_getfloat(&x->x_width, template, data, 1)); | 995 | fielddesc_getfloat(&x->x_width, template, data, 1)); |
907 | if (flags & CLOSED) sys_vgui("-fill %s -outline %s\\\n", | 996 | if (flags & CLOSED) sys_vgui("-fill %s -outline %s\\\n", |
@@ -909,13 +998,16 @@ static void curve_vis(t_gobj *z, t_glist *glist, | |||
909 | else sys_vgui("-fill %s\\\n", outline); | 998 | else sys_vgui("-fill %s\\\n", outline); |
910 | if (flags & BEZ) sys_vgui("-smooth 1\\\n"); | 999 | if (flags & BEZ) sys_vgui("-smooth 1\\\n"); |
911 | sys_vgui("-tags curve%x\n", data); | 1000 | sys_vgui("-tags curve%x\n", data); |
1001 | #endif | ||
912 | } | 1002 | } |
913 | else post("warning: curves need at least two points to be graphed"); | 1003 | else post("warning: curves need at least two points to be graphed"); |
914 | } | 1004 | } |
915 | else | 1005 | else |
916 | { | 1006 | { |
1007 | #ifndef ROCKBOX | ||
917 | if (n > 1) sys_vgui(".x%x.c delete curve%x\n", | 1008 | if (n > 1) sys_vgui(".x%x.c delete curve%x\n", |
918 | glist_getcanvas(glist), data); | 1009 | glist_getcanvas(glist), data); |
1010 | #endif | ||
919 | } | 1011 | } |
920 | } | 1012 | } |
921 | 1013 | ||
@@ -969,6 +1061,13 @@ static int curve_click(t_gobj *z, t_glist *glist, | |||
969 | int besterror = 0x7fffffff; | 1061 | int besterror = 0x7fffffff; |
970 | t_fielddesc *f = x->x_vec; | 1062 | t_fielddesc *f = x->x_vec; |
971 | t_word *data = sc->sc_vec; | 1063 | t_word *data = sc->sc_vec; |
1064 | |||
1065 | #ifdef ROCKBOX | ||
1066 | (void) shift; | ||
1067 | (void) alt; | ||
1068 | (void) dbl; | ||
1069 | #endif | ||
1070 | |||
972 | for (i = 0, f = x->x_vec; i < n; i++, f += 2) | 1071 | for (i = 0, f = x->x_vec; i < n; i++, f += 2) |
973 | { | 1072 | { |
974 | int xloc = glist_xtopixels(glist, | 1073 | int xloc = glist_xtopixels(glist, |
@@ -1060,9 +1159,16 @@ static void *plot_new(t_symbol *classsym, t_int argc, t_atom *argv) | |||
1060 | { | 1159 | { |
1061 | t_plot *x = (t_plot *)pd_new(plot_class); | 1160 | t_plot *x = (t_plot *)pd_new(plot_class); |
1062 | int flags = 0; | 1161 | int flags = 0; |
1162 | #ifndef ROCKBOX | ||
1063 | int nxy, i; | 1163 | int nxy, i; |
1064 | t_fielddesc *fd; | 1164 | t_fielddesc *fd; |
1165 | #endif | ||
1065 | t_symbol *firstarg = atom_getsymbolarg(0, argc, argv); | 1166 | t_symbol *firstarg = atom_getsymbolarg(0, argc, argv); |
1167 | |||
1168 | #ifdef ROCKBOX | ||
1169 | (void) classsym; | ||
1170 | #endif | ||
1171 | |||
1066 | if (!strcmp(firstarg->s_name, "curve")) | 1172 | if (!strcmp(firstarg->s_name, "curve")) |
1067 | { | 1173 | { |
1068 | flags |= BEZ; | 1174 | flags |= BEZ; |
@@ -1132,7 +1238,11 @@ int array_getfields(t_symbol *elemtemplatesym, | |||
1132 | t_template **elemtemplatep, int *elemsizep, | 1238 | t_template **elemtemplatep, int *elemsizep, |
1133 | int *xonsetp, int *yonsetp, int *wonsetp) | 1239 | int *xonsetp, int *yonsetp, int *wonsetp) |
1134 | { | 1240 | { |
1241 | #ifdef ROCKBOX | ||
1242 | int elemsize, yonset, wonset, xonset, type; | ||
1243 | #else | ||
1135 | int arrayonset, elemsize, yonset, wonset, xonset, type; | 1244 | int arrayonset, elemsize, yonset, wonset, xonset, type; |
1245 | #endif | ||
1136 | t_template *elemtemplate; | 1246 | t_template *elemtemplate; |
1137 | t_symbol *dummy; | 1247 | t_symbol *dummy; |
1138 | t_canvas *elemtemplatecanvas = 0; | 1248 | t_canvas *elemtemplatecanvas = 0; |
@@ -1219,6 +1329,16 @@ static void plot_displace(t_gobj *z, t_glist *glist, | |||
1219 | t_word *data, t_template *template, float basex, float basey, | 1329 | t_word *data, t_template *template, float basex, float basey, |
1220 | int dx, int dy) | 1330 | int dx, int dy) |
1221 | { | 1331 | { |
1332 | #ifdef ROCKBOX | ||
1333 | (void) z; | ||
1334 | (void) glist; | ||
1335 | (void) data; | ||
1336 | (void) template; | ||
1337 | (void) basex; | ||
1338 | (void) basey; | ||
1339 | (void) dx; | ||
1340 | (void) dy; | ||
1341 | #endif | ||
1222 | /* not yet */ | 1342 | /* not yet */ |
1223 | } | 1343 | } |
1224 | 1344 | ||
@@ -1226,6 +1346,15 @@ static void plot_select(t_gobj *z, t_glist *glist, | |||
1226 | t_word *data, t_template *template, float basex, float basey, | 1346 | t_word *data, t_template *template, float basex, float basey, |
1227 | int state) | 1347 | int state) |
1228 | { | 1348 | { |
1349 | #ifdef ROCKBOX | ||
1350 | (void) z; | ||
1351 | (void) glist; | ||
1352 | (void) data; | ||
1353 | (void) template; | ||
1354 | (void) basex; | ||
1355 | (void) basey; | ||
1356 | (void) state; | ||
1357 | #endif | ||
1229 | /* not yet */ | 1358 | /* not yet */ |
1230 | } | 1359 | } |
1231 | 1360 | ||
@@ -1233,6 +1362,15 @@ static void plot_activate(t_gobj *z, t_glist *glist, | |||
1233 | t_word *data, t_template *template, float basex, float basey, | 1362 | t_word *data, t_template *template, float basex, float basey, |
1234 | int state) | 1363 | int state) |
1235 | { | 1364 | { |
1365 | #ifdef ROCKBOX | ||
1366 | (void) z; | ||
1367 | (void) glist; | ||
1368 | (void) data; | ||
1369 | (void) template; | ||
1370 | (void) basex; | ||
1371 | (void) basey; | ||
1372 | (void) state; | ||
1373 | #endif | ||
1236 | /* not yet */ | 1374 | /* not yet */ |
1237 | } | 1375 | } |
1238 | 1376 | ||
@@ -1270,8 +1408,10 @@ static void plot_vis(t_gobj *z, t_glist *glist, | |||
1270 | { | 1408 | { |
1271 | /* found "w" field which controls linewidth. The trace is | 1409 | /* found "w" field which controls linewidth. The trace is |
1272 | a filled polygon with 2n points. */ | 1410 | a filled polygon with 2n points. */ |
1411 | #ifndef ROCKBOX | ||
1273 | sys_vgui(".x%x.c create polygon \\\n", | 1412 | sys_vgui(".x%x.c create polygon \\\n", |
1274 | glist_getcanvas(glist)); | 1413 | glist_getcanvas(glist)); |
1414 | #endif | ||
1275 | 1415 | ||
1276 | for (i = 0, xsum = xloc; i < nelem; i++) | 1416 | for (i = 0, xsum = xloc; i < nelem; i++) |
1277 | { | 1417 | { |
@@ -1287,9 +1427,11 @@ static void plot_vis(t_gobj *z, t_glist *glist, | |||
1287 | ixpix = xpix + 0.5; | 1427 | ixpix = xpix + 0.5; |
1288 | if (xonset >= 0 || ixpix != lastpixel) | 1428 | if (xonset >= 0 || ixpix != lastpixel) |
1289 | { | 1429 | { |
1430 | #ifndef ROCKBOX | ||
1290 | sys_vgui("%d %f \\\n", ixpix, | 1431 | sys_vgui("%d %f \\\n", ixpix, |
1291 | glist_ytopixels(glist, | 1432 | glist_ytopixels(glist, |
1292 | basey + yloc + yval - wval)); | 1433 | basey + yloc + yval - wval)); |
1434 | #endif | ||
1293 | ndrawn++; | 1435 | ndrawn++; |
1294 | } | 1436 | } |
1295 | lastpixel = ixpix; | 1437 | lastpixel = ixpix; |
@@ -1310,8 +1452,10 @@ static void plot_vis(t_gobj *z, t_glist *glist, | |||
1310 | ixpix = xpix + 0.5; | 1452 | ixpix = xpix + 0.5; |
1311 | if (xonset >= 0 || ixpix != lastpixel) | 1453 | if (xonset >= 0 || ixpix != lastpixel) |
1312 | { | 1454 | { |
1455 | #ifndef ROCKBOX | ||
1313 | sys_vgui("%d %f \\\n", ixpix, glist_ytopixels(glist, | 1456 | sys_vgui("%d %f \\\n", ixpix, glist_ytopixels(glist, |
1314 | basey + yloc + yval + wval)); | 1457 | basey + yloc + yval + wval)); |
1458 | #endif | ||
1315 | ndrawn++; | 1459 | ndrawn++; |
1316 | } | 1460 | } |
1317 | lastpixel = ixpix; | 1461 | lastpixel = ixpix; |
@@ -1321,23 +1465,31 @@ static void plot_vis(t_gobj *z, t_glist *glist, | |||
1321 | should be at least two already. */ | 1465 | should be at least two already. */ |
1322 | if (ndrawn < 4) | 1466 | if (ndrawn < 4) |
1323 | { | 1467 | { |
1468 | #ifndef ROCKBOX | ||
1324 | sys_vgui("%d %f \\\n", ixpix + 10, glist_ytopixels(glist, | 1469 | sys_vgui("%d %f \\\n", ixpix + 10, glist_ytopixels(glist, |
1325 | basey + yloc + yval + wval)); | 1470 | basey + yloc + yval + wval)); |
1326 | sys_vgui("%d %f \\\n", ixpix + 10, glist_ytopixels(glist, | 1471 | sys_vgui("%d %f \\\n", ixpix + 10, glist_ytopixels(glist, |
1327 | basey + yloc + yval - wval)); | 1472 | basey + yloc + yval - wval)); |
1473 | #endif | ||
1328 | } | 1474 | } |
1329 | ouch: | 1475 | ouch: |
1476 | #ifdef ROCKBOX | ||
1477 | ; | ||
1478 | #else /* ROCKBOX */ | ||
1330 | sys_vgui(" -width 1 -fill %s -outline %s\\\n", outline, outline); | 1479 | sys_vgui(" -width 1 -fill %s -outline %s\\\n", outline, outline); |
1331 | if (x->x_flags & BEZ) sys_vgui("-smooth 1\\\n"); | 1480 | if (x->x_flags & BEZ) sys_vgui("-smooth 1\\\n"); |
1332 | 1481 | ||
1333 | sys_vgui("-tags plot%x\n", data); | 1482 | sys_vgui("-tags plot%x\n", data); |
1483 | #endif /* ROCKBOX */ | ||
1334 | } | 1484 | } |
1335 | else if (linewidth > 0) | 1485 | else if (linewidth > 0) |
1336 | { | 1486 | { |
1337 | /* no "w" field. If the linewidth is positive, draw a | 1487 | /* no "w" field. If the linewidth is positive, draw a |
1338 | segmented line with the requested width; otherwise don't | 1488 | segmented line with the requested width; otherwise don't |
1339 | draw the trace at all. */ | 1489 | draw the trace at all. */ |
1490 | #ifndef ROCKBOX | ||
1340 | sys_vgui(".x%x.c create line \\\n", glist_getcanvas(glist)); | 1491 | sys_vgui(".x%x.c create line \\\n", glist_getcanvas(glist)); |
1492 | #endif | ||
1341 | 1493 | ||
1342 | for (xsum = xloc, i = 0; i < nelem; i++) | 1494 | for (xsum = xloc, i = 0; i < nelem; i++) |
1343 | { | 1495 | { |
@@ -1352,14 +1504,17 @@ static void plot_vis(t_gobj *z, t_glist *glist, | |||
1352 | ixpix = xpix + 0.5; | 1504 | ixpix = xpix + 0.5; |
1353 | if (xonset >= 0 || ixpix != lastpixel) | 1505 | if (xonset >= 0 || ixpix != lastpixel) |
1354 | { | 1506 | { |
1507 | #ifndef ROCKBOX | ||
1355 | sys_vgui("%d %f \\\n", ixpix, | 1508 | sys_vgui("%d %f \\\n", ixpix, |
1356 | glist_ytopixels(glist, basey + yloc + yval)); | 1509 | glist_ytopixels(glist, basey + yloc + yval)); |
1510 | #endif | ||
1357 | ndrawn++; | 1511 | ndrawn++; |
1358 | } | 1512 | } |
1359 | lastpixel = ixpix; | 1513 | lastpixel = ixpix; |
1360 | if (ndrawn >= 1000) break; | 1514 | if (ndrawn >= 1000) break; |
1361 | } | 1515 | } |
1362 | /* TK will complain if there aren't at least 2 points... */ | 1516 | /* TK will complain if there aren't at least 2 points... */ |
1517 | #ifndef ROCKBOX | ||
1363 | if (ndrawn == 0) sys_vgui("0 0 0 0 \\\n"); | 1518 | if (ndrawn == 0) sys_vgui("0 0 0 0 \\\n"); |
1364 | else if (ndrawn == 1) sys_vgui("%d %f \\\n", ixpix + 10, | 1519 | else if (ndrawn == 1) sys_vgui("%d %f \\\n", ixpix + 10, |
1365 | glist_ytopixels(glist, basey + yloc + yval)); | 1520 | glist_ytopixels(glist, basey + yloc + yval)); |
@@ -1369,6 +1524,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, | |||
1369 | if (x->x_flags & BEZ) sys_vgui("-smooth 1\\\n"); | 1524 | if (x->x_flags & BEZ) sys_vgui("-smooth 1\\\n"); |
1370 | 1525 | ||
1371 | sys_vgui("-tags plot%x\n", data); | 1526 | sys_vgui("-tags plot%x\n", data); |
1527 | #endif | ||
1372 | } | 1528 | } |
1373 | /* We're done with the outline; now draw all the points. | 1529 | /* We're done with the outline; now draw all the points. |
1374 | This code is inefficient since the template has to be | 1530 | This code is inefficient since the template has to be |
@@ -1413,8 +1569,10 @@ static void plot_vis(t_gobj *z, t_glist *glist, | |||
1413 | } | 1569 | } |
1414 | } | 1570 | } |
1415 | /* and then the trace */ | 1571 | /* and then the trace */ |
1572 | #ifndef ROCKBOX | ||
1416 | sys_vgui(".x%x.c delete plot%x\n", | 1573 | sys_vgui(".x%x.c delete plot%x\n", |
1417 | glist_getcanvas(glist), data); | 1574 | glist_getcanvas(glist), data); |
1575 | #endif | ||
1418 | } | 1576 | } |
1419 | } | 1577 | } |
1420 | 1578 | ||
@@ -1526,8 +1684,12 @@ static void drawnumber_getrect(t_gobj *z, t_glist *glist, | |||
1526 | basex + fielddesc_getfloat(&x->x_xloc, template, data, 0)); | 1684 | basex + fielddesc_getfloat(&x->x_xloc, template, data, 0)); |
1527 | int yloc = glist_ytopixels(glist, | 1685 | int yloc = glist_ytopixels(glist, |
1528 | basey + fielddesc_getfloat(&x->x_yloc, template, data, 0)); | 1686 | basey + fielddesc_getfloat(&x->x_yloc, template, data, 0)); |
1687 | #ifdef ROCKBOX | ||
1688 | int fontwidth = 8, fontheight = 10; | ||
1689 | #else | ||
1529 | int font = glist_getfont(glist); | 1690 | int font = glist_getfont(glist); |
1530 | int fontwidth = sys_fontwidth(font), fontheight = sys_fontheight(font); | 1691 | int fontwidth = sys_fontwidth(font), fontheight = sys_fontheight(font); |
1692 | #endif | ||
1531 | char buf[DRAWNUMBER_BUFSIZE]; | 1693 | char buf[DRAWNUMBER_BUFSIZE]; |
1532 | if (x->x_flags & DRAW_SYMBOL) | 1694 | if (x->x_flags & DRAW_SYMBOL) |
1533 | SETSYMBOL(&at, fielddesc_getsymbol(&x->x_value, template, data, 0)); | 1695 | SETSYMBOL(&at, fielddesc_getsymbol(&x->x_value, template, data, 0)); |
@@ -1543,6 +1705,16 @@ static void drawnumber_displace(t_gobj *z, t_glist *glist, | |||
1543 | t_word *data, t_template *template, float basex, float basey, | 1705 | t_word *data, t_template *template, float basex, float basey, |
1544 | int dx, int dy) | 1706 | int dx, int dy) |
1545 | { | 1707 | { |
1708 | #ifdef ROCKBOX | ||
1709 | (void) z; | ||
1710 | (void) glist; | ||
1711 | (void) data; | ||
1712 | (void) template; | ||
1713 | (void) basex; | ||
1714 | (void) basey; | ||
1715 | (void) dx; | ||
1716 | (void) dy; | ||
1717 | #endif | ||
1546 | /* refuse */ | 1718 | /* refuse */ |
1547 | } | 1719 | } |
1548 | 1720 | ||
@@ -1550,6 +1722,14 @@ static void drawnumber_select(t_gobj *z, t_glist *glist, | |||
1550 | t_word *data, t_template *template, float basex, float basey, | 1722 | t_word *data, t_template *template, float basex, float basey, |
1551 | int state) | 1723 | int state) |
1552 | { | 1724 | { |
1725 | #ifdef ROCKBOX | ||
1726 | (void) z; | ||
1727 | (void) glist; | ||
1728 | (void) data; | ||
1729 | (void) template; | ||
1730 | (void) basex; | ||
1731 | (void) basey; | ||
1732 | #endif | ||
1553 | post("drawnumber_select %d", state); | 1733 | post("drawnumber_select %d", state); |
1554 | /* fill in later */ | 1734 | /* fill in later */ |
1555 | } | 1735 | } |
@@ -1558,6 +1738,14 @@ static void drawnumber_activate(t_gobj *z, t_glist *glist, | |||
1558 | t_word *data, t_template *template, float basex, float basey, | 1738 | t_word *data, t_template *template, float basex, float basey, |
1559 | int state) | 1739 | int state) |
1560 | { | 1740 | { |
1741 | #ifdef ROCKBOX | ||
1742 | (void) z; | ||
1743 | (void) glist; | ||
1744 | (void) data; | ||
1745 | (void) template; | ||
1746 | (void) basex; | ||
1747 | (void) basey; | ||
1748 | #endif | ||
1561 | post("drawnumber_activate %d", state); | 1749 | post("drawnumber_activate %d", state); |
1562 | } | 1750 | } |
1563 | 1751 | ||
@@ -1566,14 +1754,22 @@ static void drawnumber_vis(t_gobj *z, t_glist *glist, | |||
1566 | int vis) | 1754 | int vis) |
1567 | { | 1755 | { |
1568 | t_drawnumber *x = (t_drawnumber *)z; | 1756 | t_drawnumber *x = (t_drawnumber *)z; |
1569 | 1757 | ||
1758 | #ifdef ROCKBOX | ||
1759 | (void) glist; | ||
1760 | (void) basex; | ||
1761 | (void) basey; | ||
1762 | #endif | ||
1763 | |||
1570 | if (vis) | 1764 | if (vis) |
1571 | { | 1765 | { |
1572 | t_atom at; | 1766 | t_atom at; |
1767 | #ifndef ROCKBOX | ||
1573 | int xloc = glist_xtopixels(glist, | 1768 | int xloc = glist_xtopixels(glist, |
1574 | basex + fielddesc_getfloat(&x->x_xloc, template, data, 0)); | 1769 | basex + fielddesc_getfloat(&x->x_xloc, template, data, 0)); |
1575 | int yloc = glist_ytopixels(glist, | 1770 | int yloc = glist_ytopixels(glist, |
1576 | basey + fielddesc_getfloat(&x->x_yloc, template, data, 0)); | 1771 | basey + fielddesc_getfloat(&x->x_yloc, template, data, 0)); |
1772 | #endif | ||
1577 | char colorstring[20], buf[DRAWNUMBER_BUFSIZE]; | 1773 | char colorstring[20], buf[DRAWNUMBER_BUFSIZE]; |
1578 | numbertocolor(fielddesc_getfloat(&x->x_color, template, data, 1), | 1774 | numbertocolor(fielddesc_getfloat(&x->x_color, template, data, 1), |
1579 | colorstring); | 1775 | colorstring); |
@@ -1581,13 +1777,17 @@ static void drawnumber_vis(t_gobj *z, t_glist *glist, | |||
1581 | SETSYMBOL(&at, fielddesc_getsymbol(&x->x_value, template, data, 0)); | 1777 | SETSYMBOL(&at, fielddesc_getsymbol(&x->x_value, template, data, 0)); |
1582 | else SETFLOAT(&at, fielddesc_getfloat(&x->x_value, template, data, 0)); | 1778 | else SETFLOAT(&at, fielddesc_getfloat(&x->x_value, template, data, 0)); |
1583 | drawnumber_sprintf(x, buf, &at); | 1779 | drawnumber_sprintf(x, buf, &at); |
1780 | #ifndef ROCKBOX | ||
1584 | sys_vgui(".x%x.c create text %d %d -anchor nw -fill %s -text {%s}", | 1781 | sys_vgui(".x%x.c create text %d %d -anchor nw -fill %s -text {%s}", |
1585 | glist_getcanvas(glist), xloc, yloc, colorstring, buf); | 1782 | glist_getcanvas(glist), xloc, yloc, colorstring, buf); |
1586 | sys_vgui(" -font -*-courier-bold--normal--%d-*", | 1783 | sys_vgui(" -font -*-courier-bold--normal--%d-*", |
1587 | sys_hostfontsize(glist_getfont(glist))); | 1784 | sys_hostfontsize(glist_getfont(glist))); |
1588 | sys_vgui(" -tags drawnumber%x\n", data); | 1785 | sys_vgui(" -tags drawnumber%x\n", data); |
1786 | #endif | ||
1589 | } | 1787 | } |
1788 | #ifndef ROCKBOX | ||
1590 | else sys_vgui(".x%x.c delete drawnumber%x\n", glist_getcanvas(glist), data); | 1789 | else sys_vgui(".x%x.c delete drawnumber%x\n", glist_getcanvas(glist), data); |
1790 | #endif | ||
1591 | } | 1791 | } |
1592 | 1792 | ||
1593 | static float drawnumber_motion_ycumulative; | 1793 | static float drawnumber_motion_ycumulative; |
@@ -1604,6 +1804,9 @@ static void drawnumber_motion(void *z, t_floatarg dx, t_floatarg dy) | |||
1604 | t_drawnumber *x = (t_drawnumber *)z; | 1804 | t_drawnumber *x = (t_drawnumber *)z; |
1605 | t_fielddesc *f = &x->x_value; | 1805 | t_fielddesc *f = &x->x_value; |
1606 | drawnumber_motion_ycumulative -= dy; | 1806 | drawnumber_motion_ycumulative -= dy; |
1807 | #ifdef ROCKBOX | ||
1808 | (void) dx; | ||
1809 | #endif | ||
1607 | template_setfloat(drawnumber_motion_template, | 1810 | template_setfloat(drawnumber_motion_template, |
1608 | f->fd_un.fd_varsym, | 1811 | f->fd_un.fd_varsym, |
1609 | drawnumber_motion_wp, | 1812 | drawnumber_motion_wp, |
@@ -1619,6 +1822,11 @@ static int drawnumber_click(t_gobj *z, t_glist *glist, | |||
1619 | t_drawnumber *x = (t_drawnumber *)z; | 1822 | t_drawnumber *x = (t_drawnumber *)z; |
1620 | int x1, y1, x2, y2; | 1823 | int x1, y1, x2, y2; |
1621 | t_word *data = sc->sc_vec; | 1824 | t_word *data = sc->sc_vec; |
1825 | #ifdef ROCKBOX | ||
1826 | (void) shift; | ||
1827 | (void) alt; | ||
1828 | (void) dbl; | ||
1829 | #endif | ||
1622 | drawnumber_getrect(z, glist, | 1830 | drawnumber_getrect(z, glist, |
1623 | sc->sc_vec, template, basex, basey, | 1831 | sc->sc_vec, template, basex, basey, |
1624 | &x1, &y1, &x2, &y2); | 1832 | &x1, &y1, &x2, &y2); |
@@ -1652,6 +1860,9 @@ t_parentwidgetbehavior drawnumber_widgetbehavior = | |||
1652 | 1860 | ||
1653 | static void drawnumber_free(t_drawnumber *x) | 1861 | static void drawnumber_free(t_drawnumber *x) |
1654 | { | 1862 | { |
1863 | #ifdef ROCKBOX | ||
1864 | (void) x; | ||
1865 | #endif | ||
1655 | } | 1866 | } |
1656 | 1867 | ||
1657 | static void drawnumber_setup(void) | 1868 | static void drawnumber_setup(void) |
@@ -1678,3 +1889,4 @@ void g_template_setup(void) | |||
1678 | } | 1889 | } |
1679 | 1890 | ||
1680 | 1891 | ||
1892 | |||
diff --git a/apps/plugins/pdbox/PDa/src/g_text.c b/apps/plugins/pdbox/PDa/src/g_text.c index f1fbb7f719..98b3fb74f8 100644 --- a/apps/plugins/pdbox/PDa/src/g_text.c +++ b/apps/plugins/pdbox/PDa/src/g_text.c | |||
@@ -6,15 +6,21 @@ | |||
6 | /* the methods for calling the gui-objects from menu are implemented */ | 6 | /* the methods for calling the gui-objects from menu are implemented */ |
7 | /* all changes are labeled with iemlib */ | 7 | /* all changes are labeled with iemlib */ |
8 | 8 | ||
9 | #include <stdlib.h> | ||
10 | #include "m_pd.h" | 9 | #include "m_pd.h" |
11 | #include "m_imp.h" | 10 | #include "m_imp.h" |
12 | #include "s_stuff.h" | 11 | #include "s_stuff.h" |
13 | #include "t_tk.h" | 12 | #include "t_tk.h" |
14 | #include "g_canvas.h" | 13 | #include "g_canvas.h" |
14 | |||
15 | #ifdef ROCKBOX | ||
16 | #include "plugin.h" | ||
17 | #include "pdbox.h" | ||
18 | #else /* ROCKBOX */ | ||
19 | #include <stdlib.h> | ||
15 | #include <stdio.h> | 20 | #include <stdio.h> |
16 | #include <string.h> | 21 | #include <string.h> |
17 | #include <math.h> | 22 | #include <math.h> |
23 | #endif /* ROCKBOX */ | ||
18 | 24 | ||
19 | static t_class *text_class; | 25 | static t_class *text_class; |
20 | static t_class *message_class; | 26 | static t_class *message_class; |
@@ -39,6 +45,11 @@ void glist_text(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | |||
39 | { | 45 | { |
40 | t_text *x = (t_text *)pd_new(text_class); | 46 | t_text *x = (t_text *)pd_new(text_class); |
41 | t_atom at; | 47 | t_atom at; |
48 | |||
49 | #ifdef ROCKBOX | ||
50 | (void) s; | ||
51 | #endif | ||
52 | |||
42 | x->te_width = 0; /* don't know it yet. */ | 53 | x->te_width = 0; /* don't know it yet. */ |
43 | x->te_type = T_TEXT; | 54 | x->te_type = T_TEXT; |
44 | x->te_binbuf = binbuf_new(); | 55 | x->te_binbuf = binbuf_new(); |
@@ -138,7 +149,12 @@ static void canvas_objtext(t_glist *gl, int xpix, int ypix, int selected, | |||
138 | 149 | ||
139 | void canvas_obj(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 150 | void canvas_obj(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
140 | { | 151 | { |
152 | #ifdef ROCKBOX | ||
153 | (void) s; | ||
154 | #else | ||
141 | t_text *x; | 155 | t_text *x; |
156 | #endif | ||
157 | |||
142 | if (argc >= 2) | 158 | if (argc >= 2) |
143 | { | 159 | { |
144 | t_binbuf *b = binbuf_new(); | 160 | t_binbuf *b = binbuf_new(); |
@@ -178,56 +194,111 @@ void canvas_iemguis(t_glist *gl, t_symbol *guiobjname) | |||
178 | 194 | ||
179 | void canvas_bng(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 195 | void canvas_bng(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
180 | { | 196 | { |
197 | #ifdef ROCKBOX | ||
198 | (void) s; | ||
199 | (void) argc; | ||
200 | (void) argv; | ||
201 | #endif | ||
181 | canvas_iemguis(gl, gensym("bng")); | 202 | canvas_iemguis(gl, gensym("bng")); |
182 | } | 203 | } |
183 | 204 | ||
184 | void canvas_toggle(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 205 | void canvas_toggle(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
185 | { | 206 | { |
207 | #ifdef ROCKBOX | ||
208 | (void) s; | ||
209 | (void) argc; | ||
210 | (void) argv; | ||
211 | #endif | ||
186 | canvas_iemguis(gl, gensym("tgl")); | 212 | canvas_iemguis(gl, gensym("tgl")); |
187 | } | 213 | } |
188 | 214 | ||
189 | void canvas_vslider(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 215 | void canvas_vslider(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
190 | { | 216 | { |
217 | #ifdef ROCKBOX | ||
218 | (void) s; | ||
219 | (void) argc; | ||
220 | (void) argv; | ||
221 | #endif | ||
191 | canvas_iemguis(gl, gensym("vsl")); | 222 | canvas_iemguis(gl, gensym("vsl")); |
192 | } | 223 | } |
193 | 224 | ||
194 | void canvas_hslider(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 225 | void canvas_hslider(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
195 | { | 226 | { |
227 | #ifdef ROCKBOX | ||
228 | (void) s; | ||
229 | (void) argc; | ||
230 | (void) argv; | ||
231 | #endif | ||
196 | canvas_iemguis(gl, gensym("hsl")); | 232 | canvas_iemguis(gl, gensym("hsl")); |
197 | } | 233 | } |
198 | 234 | ||
199 | void canvas_hdial(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 235 | void canvas_hdial(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
200 | { | 236 | { |
237 | #ifdef ROCKBOX | ||
238 | (void) s; | ||
239 | (void) argc; | ||
240 | (void) argv; | ||
241 | #endif | ||
201 | canvas_iemguis(gl, gensym("hdl")); | 242 | canvas_iemguis(gl, gensym("hdl")); |
202 | } | 243 | } |
203 | 244 | ||
204 | void canvas_vdial(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 245 | void canvas_vdial(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
205 | { | 246 | { |
247 | #ifdef ROCKBOX | ||
248 | (void) s; | ||
249 | (void) argc; | ||
250 | (void) argv; | ||
251 | #endif | ||
206 | canvas_iemguis(gl, gensym("vdl")); | 252 | canvas_iemguis(gl, gensym("vdl")); |
207 | } | 253 | } |
208 | 254 | ||
209 | void canvas_hradio(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 255 | void canvas_hradio(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
210 | { | 256 | { |
257 | #ifdef ROCKBOX | ||
258 | (void) s; | ||
259 | (void) argc; | ||
260 | (void) argv; | ||
261 | #endif | ||
211 | canvas_iemguis(gl, gensym("hradio")); | 262 | canvas_iemguis(gl, gensym("hradio")); |
212 | } | 263 | } |
213 | 264 | ||
214 | void canvas_vradio(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 265 | void canvas_vradio(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
215 | { | 266 | { |
267 | #ifdef ROCKBOX | ||
268 | (void) s; | ||
269 | (void) argc; | ||
270 | (void) argv; | ||
271 | #endif | ||
216 | canvas_iemguis(gl, gensym("vradio")); | 272 | canvas_iemguis(gl, gensym("vradio")); |
217 | } | 273 | } |
218 | 274 | ||
219 | void canvas_vumeter(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 275 | void canvas_vumeter(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
220 | { | 276 | { |
277 | #ifdef ROCKBOX | ||
278 | (void) s; | ||
279 | (void) argc; | ||
280 | (void) argv; | ||
281 | #endif | ||
221 | canvas_iemguis(gl, gensym("vu")); | 282 | canvas_iemguis(gl, gensym("vu")); |
222 | } | 283 | } |
223 | 284 | ||
224 | void canvas_mycnv(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 285 | void canvas_mycnv(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
225 | { | 286 | { |
287 | #ifdef ROCKBOX | ||
288 | (void) s; | ||
289 | (void) argc; | ||
290 | (void) argv; | ||
291 | #endif | ||
226 | canvas_iemguis(gl, gensym("cnv")); | 292 | canvas_iemguis(gl, gensym("cnv")); |
227 | } | 293 | } |
228 | 294 | ||
229 | void canvas_numbox(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 295 | void canvas_numbox(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
230 | { | 296 | { |
297 | #ifdef ROCKBOX | ||
298 | (void) s; | ||
299 | (void) argc; | ||
300 | (void) argv; | ||
301 | #endif | ||
231 | canvas_iemguis(gl, gensym("nbx")); | 302 | canvas_iemguis(gl, gensym("nbx")); |
232 | } | 303 | } |
233 | 304 | ||
@@ -310,11 +381,17 @@ static void message_symbol(t_message *x, t_symbol *s) | |||
310 | 381 | ||
311 | static void message_list(t_message *x, t_symbol *s, int argc, t_atom *argv) | 382 | static void message_list(t_message *x, t_symbol *s, int argc, t_atom *argv) |
312 | { | 383 | { |
384 | #ifdef ROCKBOX | ||
385 | (void) s; | ||
386 | #endif | ||
313 | binbuf_eval(x->m_text.te_binbuf, &x->m_messresponder.mr_pd, argc, argv); | 387 | binbuf_eval(x->m_text.te_binbuf, &x->m_messresponder.mr_pd, argc, argv); |
314 | } | 388 | } |
315 | 389 | ||
316 | static void message_set(t_message *x, t_symbol *s, int argc, t_atom *argv) | 390 | static void message_set(t_message *x, t_symbol *s, int argc, t_atom *argv) |
317 | { | 391 | { |
392 | #ifdef ROCKBOX | ||
393 | (void) s; | ||
394 | #endif | ||
318 | binbuf_clear(x->m_text.te_binbuf); | 395 | binbuf_clear(x->m_text.te_binbuf); |
319 | binbuf_add(x->m_text.te_binbuf, argc, argv); | 396 | binbuf_add(x->m_text.te_binbuf, argc, argv); |
320 | glist_retext(x->m_glist, &x->m_text); | 397 | glist_retext(x->m_glist, &x->m_text); |
@@ -322,12 +399,18 @@ static void message_set(t_message *x, t_symbol *s, int argc, t_atom *argv) | |||
322 | 399 | ||
323 | static void message_add2(t_message *x, t_symbol *s, int argc, t_atom *argv) | 400 | static void message_add2(t_message *x, t_symbol *s, int argc, t_atom *argv) |
324 | { | 401 | { |
402 | #ifdef ROCKBOX | ||
403 | (void) s; | ||
404 | #endif | ||
325 | binbuf_add(x->m_text.te_binbuf, argc, argv); | 405 | binbuf_add(x->m_text.te_binbuf, argc, argv); |
326 | glist_retext(x->m_glist, &x->m_text); | 406 | glist_retext(x->m_glist, &x->m_text); |
327 | } | 407 | } |
328 | 408 | ||
329 | static void message_add(t_message *x, t_symbol *s, int argc, t_atom *argv) | 409 | static void message_add(t_message *x, t_symbol *s, int argc, t_atom *argv) |
330 | { | 410 | { |
411 | #ifdef ROCKBOX | ||
412 | (void) s; | ||
413 | #endif | ||
331 | binbuf_add(x->m_text.te_binbuf, argc, argv); | 414 | binbuf_add(x->m_text.te_binbuf, argc, argv); |
332 | binbuf_addsemi(x->m_text.te_binbuf); | 415 | binbuf_addsemi(x->m_text.te_binbuf); |
333 | glist_retext(x->m_glist, &x->m_text); | 416 | glist_retext(x->m_glist, &x->m_text); |
@@ -337,12 +420,21 @@ static void message_click(t_message *x, | |||
337 | t_floatarg xpos, t_floatarg ypos, t_floatarg shift, | 420 | t_floatarg xpos, t_floatarg ypos, t_floatarg shift, |
338 | t_floatarg ctrl, t_floatarg alt) | 421 | t_floatarg ctrl, t_floatarg alt) |
339 | { | 422 | { |
423 | #ifdef ROCKBOX | ||
424 | (void) xpos; | ||
425 | (void) ypos; | ||
426 | (void) shift; | ||
427 | (void) ctrl; | ||
428 | (void) alt; | ||
429 | #endif | ||
340 | message_float(x, 0); | 430 | message_float(x, 0); |
341 | if (glist_isvisible(x->m_glist)) | 431 | if (glist_isvisible(x->m_glist)) |
342 | { | 432 | { |
433 | #ifndef ROCKBOX | ||
343 | t_rtext *y = glist_findrtext(x->m_glist, &x->m_text); | 434 | t_rtext *y = glist_findrtext(x->m_glist, &x->m_text); |
344 | sys_vgui(".x%x.c itemconfigure %sR -width 5\n", | 435 | sys_vgui(".x%x.c itemconfigure %sR -width 5\n", |
345 | glist_getcanvas(x->m_glist), rtext_gettag(y)); | 436 | glist_getcanvas(x->m_glist), rtext_gettag(y)); |
437 | #endif | ||
346 | clock_delay(x->m_clock, 120); | 438 | clock_delay(x->m_clock, 120); |
347 | } | 439 | } |
348 | } | 440 | } |
@@ -351,9 +443,11 @@ static void message_tick(t_message *x) | |||
351 | { | 443 | { |
352 | if (glist_isvisible(x->m_glist)) | 444 | if (glist_isvisible(x->m_glist)) |
353 | { | 445 | { |
446 | #ifndef ROCKBOX | ||
354 | t_rtext *y = glist_findrtext(x->m_glist, &x->m_text); | 447 | t_rtext *y = glist_findrtext(x->m_glist, &x->m_text); |
355 | sys_vgui(".x%x.c itemconfigure %sR -width 1\n", | 448 | sys_vgui(".x%x.c itemconfigure %sR -width 1\n", |
356 | glist_getcanvas(x->m_glist), rtext_gettag(y)); | 449 | glist_getcanvas(x->m_glist), rtext_gettag(y)); |
450 | #endif | ||
357 | } | 451 | } |
358 | } | 452 | } |
359 | 453 | ||
@@ -364,6 +458,9 @@ static void message_free(t_message *x) | |||
364 | 458 | ||
365 | void canvas_msg(t_glist *gl, t_symbol *s, int argc, t_atom *argv) | 459 | void canvas_msg(t_glist *gl, t_symbol *s, int argc, t_atom *argv) |
366 | { | 460 | { |
461 | #ifdef ROCKBOX | ||
462 | (void) s; | ||
463 | #endif | ||
367 | t_message *x = (t_message *)pd_new(message_class); | 464 | t_message *x = (t_message *)pd_new(message_class); |
368 | x->m_messresponder.mr_pd = messresponder_class; | 465 | x->m_messresponder.mr_pd = messresponder_class; |
369 | x->m_messresponder.mr_outlet = outlet_new(&x->m_text, &s_float); | 466 | x->m_messresponder.mr_outlet = outlet_new(&x->m_text, &s_float); |
@@ -467,6 +564,9 @@ static void gatom_set(t_gatom *x, t_symbol *s, int argc, t_atom *argv) | |||
467 | { | 564 | { |
468 | t_atom oldatom = x->a_atom; | 565 | t_atom oldatom = x->a_atom; |
469 | int senditup = 0; | 566 | int senditup = 0; |
567 | #ifdef ROCKBOX | ||
568 | (void) s; | ||
569 | #endif | ||
470 | if (!argc) return; | 570 | if (!argc) return; |
471 | if (x->a_atom.a_type == A_FLOAT) | 571 | if (x->a_atom.a_type == A_FLOAT) |
472 | x->a_atom.a_w.w_float = atom_getfloat(argv), | 572 | x->a_atom.a_w.w_float = atom_getfloat(argv), |
@@ -538,6 +638,9 @@ static void gatom_symbol(t_gatom *x, t_symbol *s) | |||
538 | 638 | ||
539 | static void gatom_motion(void *z, t_floatarg dx, t_floatarg dy) | 639 | static void gatom_motion(void *z, t_floatarg dx, t_floatarg dy) |
540 | { | 640 | { |
641 | #ifdef ROCKBOX | ||
642 | (void) dx; | ||
643 | #endif | ||
541 | t_gatom *x = (t_gatom *)z; | 644 | t_gatom *x = (t_gatom *)z; |
542 | if (dy == 0) return; | 645 | if (dy == 0) return; |
543 | if (x->a_atom.a_type == A_FLOAT) | 646 | if (x->a_atom.a_type == A_FLOAT) |
@@ -597,7 +700,7 @@ static void gatom_key(void *z, t_floatarg f) | |||
597 | { | 700 | { |
598 | /* for numbers, only let reasonable characters through */ | 701 | /* for numbers, only let reasonable characters through */ |
599 | if ((x->a_atom.a_type == A_SYMBOL) || | 702 | if ((x->a_atom.a_type == A_SYMBOL) || |
600 | (c >= '0' && c <= '9' || c == '.' || c == '-' | 703 | ((c >= '0' && c <= '9') || c == '.' || c == '-' |
601 | || c == 'e' || c == 'E')) | 704 | || c == 'e' || c == 'E')) |
602 | { | 705 | { |
603 | x->a_buf[len] = c; | 706 | x->a_buf[len] = c; |
@@ -608,7 +711,11 @@ static void gatom_key(void *z, t_floatarg f) | |||
608 | return; | 711 | return; |
609 | redraw: | 712 | redraw: |
610 | /* LATER figure out how to avoid creating all these symbols! */ | 713 | /* LATER figure out how to avoid creating all these symbols! */ |
714 | #ifdef ROCKBOX | ||
715 | snprintf(sbuf, sizeof(sbuf)-1, "%s...", x->a_buf); | ||
716 | #else /* ROCKBOX */ | ||
611 | sprintf(sbuf, "%s...", x->a_buf); | 717 | sprintf(sbuf, "%s...", x->a_buf); |
718 | #endif | ||
612 | SETSYMBOL(&at, gensym(sbuf)); | 719 | SETSYMBOL(&at, gensym(sbuf)); |
613 | binbuf_clear(x->a_text.te_binbuf); | 720 | binbuf_clear(x->a_text.te_binbuf); |
614 | binbuf_add(x->a_text.te_binbuf, 1, &at); | 721 | binbuf_add(x->a_text.te_binbuf, 1, &at); |
@@ -619,6 +726,9 @@ static void gatom_click(t_gatom *x, | |||
619 | t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, | 726 | t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, |
620 | t_floatarg alt) | 727 | t_floatarg alt) |
621 | { | 728 | { |
729 | #ifdef ROCKBOX | ||
730 | (void) ctrl; | ||
731 | #endif | ||
622 | if (x->a_text.te_width == 1) | 732 | if (x->a_text.te_width == 1) |
623 | { | 733 | { |
624 | if (x->a_atom.a_type == A_FLOAT) | 734 | if (x->a_atom.a_type == A_FLOAT) |
@@ -655,6 +765,10 @@ static void gatom_param(t_gatom *x, t_symbol *sel, int argc, t_atom *argv) | |||
655 | t_symbol *symfrom = gatom_unescapit(atom_getsymbolarg(5, argc, argv)); | 765 | t_symbol *symfrom = gatom_unescapit(atom_getsymbolarg(5, argc, argv)); |
656 | t_symbol *symto = gatom_unescapit(atom_getsymbolarg(6, argc, argv)); | 766 | t_symbol *symto = gatom_unescapit(atom_getsymbolarg(6, argc, argv)); |
657 | 767 | ||
768 | #ifdef ROCKBOX | ||
769 | (void) sel; | ||
770 | #endif | ||
771 | |||
658 | gobj_vis(&x->a_text.te_g, x->a_glist, 0); | 772 | gobj_vis(&x->a_text.te_g, x->a_glist, 0); |
659 | if (!*symfrom->s_name && *x->a_symfrom->s_name) | 773 | if (!*symfrom->s_name && *x->a_symfrom->s_name) |
660 | inlet_new(&x->a_text, &x->a_text.te_pd, 0, 0); | 774 | inlet_new(&x->a_text, &x->a_text.te_pd, 0, 0); |
@@ -708,7 +822,11 @@ static void gatom_getwherelabel(t_gatom *x, t_glist *glist, int *xp, int *yp) | |||
708 | { | 822 | { |
709 | *xp = x1 - 3 - | 823 | *xp = x1 - 3 - |
710 | strlen(canvas_realizedollar(x->a_glist, x->a_label)->s_name) * | 824 | strlen(canvas_realizedollar(x->a_glist, x->a_label)->s_name) * |
825 | #ifdef ROCKBOX | ||
826 | 8; | ||
827 | #else | ||
711 | sys_fontwidth(glist_getfont(glist)); | 828 | sys_fontwidth(glist_getfont(glist)); |
829 | #endif | ||
712 | *yp = y1 + 2; | 830 | *yp = y1 + 2; |
713 | } | 831 | } |
714 | else if (x->a_wherelabel == ATOM_LABELRIGHT) | 832 | else if (x->a_wherelabel == ATOM_LABELRIGHT) |
@@ -719,7 +837,11 @@ static void gatom_getwherelabel(t_gatom *x, t_glist *glist, int *xp, int *yp) | |||
719 | else if (x->a_wherelabel == ATOM_LABELUP) | 837 | else if (x->a_wherelabel == ATOM_LABELUP) |
720 | { | 838 | { |
721 | *xp = x1 - 1; | 839 | *xp = x1 - 1; |
840 | #ifdef ROCKBOX | ||
841 | *yp = y1 - 1 - 10; | ||
842 | #else | ||
722 | *yp = y1 - 1 - sys_fontheight(glist_getfont(glist));; | 843 | *yp = y1 - 1 - sys_fontheight(glist_getfont(glist));; |
844 | #endif | ||
723 | } | 845 | } |
724 | else | 846 | else |
725 | { | 847 | { |
@@ -731,10 +853,14 @@ static void gatom_getwherelabel(t_gatom *x, t_glist *glist, int *xp, int *yp) | |||
731 | static void gatom_displace(t_gobj *z, t_glist *glist, | 853 | static void gatom_displace(t_gobj *z, t_glist *glist, |
732 | int dx, int dy) | 854 | int dx, int dy) |
733 | { | 855 | { |
856 | #ifndef ROCKBOX | ||
734 | t_gatom *x = (t_gatom*)z; | 857 | t_gatom *x = (t_gatom*)z; |
858 | #endif | ||
735 | text_displace(z, glist, dx, dy); | 859 | text_displace(z, glist, dx, dy); |
860 | #ifndef ROCKBOX | ||
736 | sys_vgui(".x%x.c move %x.l %d %d\n", glist_getcanvas(glist), | 861 | sys_vgui(".x%x.c move %x.l %d %d\n", glist_getcanvas(glist), |
737 | x, dx, dy); | 862 | x, dx, dy); |
863 | #endif | ||
738 | } | 864 | } |
739 | 865 | ||
740 | static void gatom_vis(t_gobj *z, t_glist *glist, int vis) | 866 | static void gatom_vis(t_gobj *z, t_glist *glist, int vis) |
@@ -747,14 +873,18 @@ static void gatom_vis(t_gobj *z, t_glist *glist, int vis) | |||
747 | { | 873 | { |
748 | int x1, y1; | 874 | int x1, y1; |
749 | gatom_getwherelabel(x, glist, &x1, &y1); | 875 | gatom_getwherelabel(x, glist, &x1, &y1); |
876 | #ifndef ROCKBOX | ||
750 | sys_vgui("pdtk_text_new .x%x.c %x.l %f %f {%s} %d %s\n", | 877 | sys_vgui("pdtk_text_new .x%x.c %x.l %f %f {%s} %d %s\n", |
751 | glist_getcanvas(glist), x, | 878 | glist_getcanvas(glist), x, |
752 | (double)x1, (double)y1, | 879 | (double)x1, (double)y1, |
753 | canvas_realizedollar(x->a_glist, x->a_label)->s_name, | 880 | canvas_realizedollar(x->a_glist, x->a_label)->s_name, |
754 | sys_hostfontsize(glist_getfont(glist)), | 881 | sys_hostfontsize(glist_getfont(glist)), |
755 | "black"); | 882 | "black"); |
883 | #endif | ||
756 | } | 884 | } |
885 | #ifndef ROCKBOX | ||
757 | else sys_vgui(".x%x.c delete %x.l\n", glist_getcanvas(glist), x); | 886 | else sys_vgui(".x%x.c delete %x.l\n", glist_getcanvas(glist), x); |
887 | #endif | ||
758 | } | 888 | } |
759 | } | 889 | } |
760 | 890 | ||
@@ -763,6 +893,11 @@ void canvas_atom(t_glist *gl, t_atomtype type, | |||
763 | { | 893 | { |
764 | t_gatom *x = (t_gatom *)pd_new(gatom_class); | 894 | t_gatom *x = (t_gatom *)pd_new(gatom_class); |
765 | t_atom at; | 895 | t_atom at; |
896 | |||
897 | #ifdef ROCKBOX | ||
898 | (void) s; | ||
899 | #endif | ||
900 | |||
766 | x->a_text.te_width = 0; /* don't know it yet. */ | 901 | x->a_text.te_width = 0; /* don't know it yet. */ |
767 | x->a_text.te_type = T_ATOM; | 902 | x->a_text.te_type = T_ATOM; |
768 | x->a_text.te_binbuf = binbuf_new(); | 903 | x->a_text.te_binbuf = binbuf_new(); |
@@ -850,11 +985,17 @@ static void gatom_free(t_gatom *x) | |||
850 | if (*x->a_symfrom->s_name) | 985 | if (*x->a_symfrom->s_name) |
851 | pd_unbind(&x->a_text.te_pd, | 986 | pd_unbind(&x->a_text.te_pd, |
852 | canvas_realizedollar(x->a_glist, x->a_symfrom)); | 987 | canvas_realizedollar(x->a_glist, x->a_symfrom)); |
988 | #ifndef ROCKBOX | ||
853 | gfxstub_deleteforkey(x); | 989 | gfxstub_deleteforkey(x); |
990 | #endif | ||
854 | } | 991 | } |
855 | 992 | ||
856 | static void gatom_properties(t_gobj *z, t_glist *owner) | 993 | static void gatom_properties(t_gobj *z, t_glist *owner) |
857 | { | 994 | { |
995 | #ifdef ROCKBOX | ||
996 | (void) z; | ||
997 | (void) owner; | ||
998 | #else /* ROCKBOX */ | ||
858 | t_gatom *x = (t_gatom *)z; | 999 | t_gatom *x = (t_gatom *)z; |
859 | char buf[200]; | 1000 | char buf[200]; |
860 | sprintf(buf, "pdtk_gatom_dialog %%s %d %g %g %d %s %s %s\n", | 1001 | sprintf(buf, "pdtk_gatom_dialog %%s %d %g %g %d %s %s %s\n", |
@@ -863,6 +1004,7 @@ static void gatom_properties(t_gobj *z, t_glist *owner) | |||
863 | gatom_escapit(x->a_symfrom)->s_name, | 1004 | gatom_escapit(x->a_symfrom)->s_name, |
864 | gatom_escapit(x->a_symto)->s_name); | 1005 | gatom_escapit(x->a_symto)->s_name); |
865 | gfxstub_new(&x->a_text.te_pd, x, buf); | 1006 | gfxstub_new(&x->a_text.te_pd, x, buf); |
1007 | #endif /* ROCKBOX */ | ||
866 | } | 1008 | } |
867 | 1009 | ||
868 | 1010 | ||
@@ -880,8 +1022,12 @@ static void text_getrect(t_gobj *z, t_glist *glist, | |||
880 | 1022 | ||
881 | if (x->te_type == T_ATOM && x->te_width > 0) | 1023 | if (x->te_type == T_ATOM && x->te_width > 0) |
882 | { | 1024 | { |
1025 | #ifdef ROCKBOX | ||
1026 | int fontwidth = 8, fontheight = 10; | ||
1027 | #else | ||
883 | int font = glist_getfont(glist); | 1028 | int font = glist_getfont(glist); |
884 | int fontwidth = sys_fontwidth(font), fontheight = sys_fontheight(font); | 1029 | int fontwidth = sys_fontwidth(font), fontheight = sys_fontheight(font); |
1030 | #endif | ||
885 | width = (x->te_width > 0 ? x->te_width : 6) * fontwidth + 2; | 1031 | width = (x->te_width > 0 ? x->te_width : 6) * fontwidth + 2; |
886 | height = fontheight + 1; /* borrowed from TMARGIN, etc, in g_rtext.c */ | 1032 | height = fontheight + 1; /* borrowed from TMARGIN, etc, in g_rtext.c */ |
887 | } | 1033 | } |
@@ -933,8 +1079,13 @@ static void text_select(t_gobj *z, t_glist *glist, int state) | |||
933 | t_rtext *y = glist_findrtext(glist, x); | 1079 | t_rtext *y = glist_findrtext(glist, x); |
934 | rtext_select(y, state); | 1080 | rtext_select(y, state); |
935 | if (glist_isvisible(glist) && text_shouldvis(x, glist)) | 1081 | if (glist_isvisible(glist) && text_shouldvis(x, glist)) |
1082 | #ifdef ROCKBOX | ||
1083 | { | ||
1084 | } | ||
1085 | #else /* ROCKBOX */ | ||
936 | sys_vgui(".x%x.c itemconfigure %sR -fill %s\n", glist, | 1086 | sys_vgui(".x%x.c itemconfigure %sR -fill %s\n", glist, |
937 | rtext_gettag(y), (state? "blue" : "black")); | 1087 | rtext_gettag(y), (state? "blue" : "black")); |
1088 | #endif /* ROCKBOX */ | ||
938 | } | 1089 | } |
939 | 1090 | ||
940 | static void text_activate(t_gobj *z, t_glist *glist, int state) | 1091 | static void text_activate(t_gobj *z, t_glist *glist, int state) |
@@ -988,6 +1139,10 @@ static void text_vis(t_gobj *z, t_glist *glist, int vis) | |||
988 | static int text_click(t_gobj *z, struct _glist *glist, | 1139 | static int text_click(t_gobj *z, struct _glist *glist, |
989 | int xpix, int ypix, int shift, int alt, int dbl, int doit) | 1140 | int xpix, int ypix, int shift, int alt, int dbl, int doit) |
990 | { | 1141 | { |
1142 | #ifdef ROCKBOX | ||
1143 | (void) glist; | ||
1144 | (void) dbl; | ||
1145 | #endif | ||
991 | t_text *x = (t_text *)z; | 1146 | t_text *x = (t_text *)z; |
992 | if (x->te_type == T_OBJECT) | 1147 | if (x->te_type == T_OBJECT) |
993 | { | 1148 | { |
@@ -1111,9 +1266,20 @@ void glist_drawiofor(t_glist *glist, t_object *ob, int firsttime, | |||
1111 | char *tag, int x1, int y1, int x2, int y2) | 1266 | char *tag, int x1, int y1, int x2, int y2) |
1112 | { | 1267 | { |
1113 | int n = obj_noutlets(ob), nplus = (n == 1 ? 1 : n-1), i; | 1268 | int n = obj_noutlets(ob), nplus = (n == 1 ? 1 : n-1), i; |
1269 | #ifdef ROCKBOX | ||
1270 | (void) glist; | ||
1271 | (void) firsttime; | ||
1272 | (void) tag; | ||
1273 | (void) x1; | ||
1274 | (void) y1; | ||
1275 | (void) x2; | ||
1276 | (void) y2; | ||
1277 | #else /* ROCKBOX */ | ||
1114 | int width = x2 - x1; | 1278 | int width = x2 - x1; |
1279 | #endif /* ROCKBOX */ | ||
1115 | for (i = 0; i < n; i++) | 1280 | for (i = 0; i < n; i++) |
1116 | { | 1281 | { |
1282 | #ifndef ROCKBOX | ||
1117 | int onset = x1 + (width - IOWIDTH) * i / nplus; | 1283 | int onset = x1 + (width - IOWIDTH) * i / nplus; |
1118 | if (firsttime) | 1284 | if (firsttime) |
1119 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %so%d\n", | 1285 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %so%d\n", |
@@ -1126,11 +1292,13 @@ void glist_drawiofor(t_glist *glist, t_object *ob, int firsttime, | |||
1126 | glist_getcanvas(glist), tag, i, | 1292 | glist_getcanvas(glist), tag, i, |
1127 | onset, y2 - 1, | 1293 | onset, y2 - 1, |
1128 | onset + IOWIDTH, y2); | 1294 | onset + IOWIDTH, y2); |
1295 | #endif /* ROCKBOX */ | ||
1129 | } | 1296 | } |
1130 | n = obj_ninlets(ob); | 1297 | n = obj_ninlets(ob); |
1131 | nplus = (n == 1 ? 1 : n-1); | 1298 | nplus = (n == 1 ? 1 : n-1); |
1132 | for (i = 0; i < n; i++) | 1299 | for (i = 0; i < n; i++) |
1133 | { | 1300 | { |
1301 | #ifndef ROCKBOX | ||
1134 | int onset = x1 + (width - IOWIDTH) * i / nplus; | 1302 | int onset = x1 + (width - IOWIDTH) * i / nplus; |
1135 | if (firsttime) | 1303 | if (firsttime) |
1136 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %si%d\n", | 1304 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %si%d\n", |
@@ -1143,6 +1311,7 @@ void glist_drawiofor(t_glist *glist, t_object *ob, int firsttime, | |||
1143 | glist_getcanvas(glist), tag, i, | 1311 | glist_getcanvas(glist), tag, i, |
1144 | onset, y1, | 1312 | onset, y1, |
1145 | onset + IOWIDTH, y1 + EXTRAPIX); | 1313 | onset + IOWIDTH, y1 + EXTRAPIX); |
1314 | #endif /* ROCKBOX */ | ||
1146 | } | 1315 | } |
1147 | } | 1316 | } |
1148 | 1317 | ||
@@ -1151,11 +1320,18 @@ void text_drawborder(t_text *x, t_glist *glist, | |||
1151 | { | 1320 | { |
1152 | t_object *ob; | 1321 | t_object *ob; |
1153 | int x1, y1, x2, y2, width, height; | 1322 | int x1, y1, x2, y2, width, height; |
1323 | |||
1324 | #ifdef ROCKBOX | ||
1325 | (void) width2; | ||
1326 | (void) height2; | ||
1327 | #endif | ||
1328 | |||
1154 | text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2); | 1329 | text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2); |
1155 | width = x2 - x1; | 1330 | width = x2 - x1; |
1156 | height = y2 - y1; | 1331 | height = y2 - y1; |
1157 | if (x->te_type == T_OBJECT) | 1332 | if (x->te_type == T_OBJECT) |
1158 | { | 1333 | { |
1334 | #ifndef ROCKBOX | ||
1159 | if (firsttime) | 1335 | if (firsttime) |
1160 | sys_vgui(".x%x.c create line\ | 1336 | sys_vgui(".x%x.c create line\ |
1161 | %d %d %d %d %d %d %d %d %d %d -tags %sR\n", | 1337 | %d %d %d %d %d %d %d %d %d %d -tags %sR\n", |
@@ -1166,9 +1342,11 @@ void text_drawborder(t_text *x, t_glist *glist, | |||
1166 | %d %d %d %d %d %d %d %d %d %d\n", | 1342 | %d %d %d %d %d %d %d %d %d %d\n", |
1167 | glist_getcanvas(glist), tag, | 1343 | glist_getcanvas(glist), tag, |
1168 | x1, y1, x2, y1, x2, y2, x1, y2, x1, y1); | 1344 | x1, y1, x2, y1, x2, y2, x1, y2, x1, y1); |
1345 | #endif | ||
1169 | } | 1346 | } |
1170 | else if (x->te_type == T_MESSAGE) | 1347 | else if (x->te_type == T_MESSAGE) |
1171 | { | 1348 | { |
1349 | #ifndef ROCKBOX | ||
1172 | if (firsttime) | 1350 | if (firsttime) |
1173 | sys_vgui(".x%x.c create line\ | 1351 | sys_vgui(".x%x.c create line\ |
1174 | %d %d %d %d %d %d %d %d %d %d %d %d %d %d -tags %sR\n", | 1352 | %d %d %d %d %d %d %d %d %d %d %d %d %d %d -tags %sR\n", |
@@ -1182,9 +1360,11 @@ void text_drawborder(t_text *x, t_glist *glist, | |||
1182 | glist_getcanvas(glist), tag, | 1360 | glist_getcanvas(glist), tag, |
1183 | x1, y1, x2+4, y1, x2, y1+4, x2, y2-4, x2+4, y2, | 1361 | x1, y1, x2+4, y1, x2, y1+4, x2, y2-4, x2+4, y2, |
1184 | x1, y2, x1, y1); | 1362 | x1, y2, x1, y1); |
1363 | #endif | ||
1185 | } | 1364 | } |
1186 | else if (x->te_type == T_ATOM) | 1365 | else if (x->te_type == T_ATOM) |
1187 | { | 1366 | { |
1367 | #ifndef ROCKBOX | ||
1188 | if (firsttime) | 1368 | if (firsttime) |
1189 | sys_vgui(".x%x.c create line\ | 1369 | sys_vgui(".x%x.c create line\ |
1190 | %d %d %d %d %d %d %d %d %d %d %d %d -tags %sR\n", | 1370 | %d %d %d %d %d %d %d %d %d %d %d %d -tags %sR\n", |
@@ -1196,31 +1376,46 @@ void text_drawborder(t_text *x, t_glist *glist, | |||
1196 | %d %d %d %d %d %d %d %d %d %d %d %d\n", | 1376 | %d %d %d %d %d %d %d %d %d %d %d %d\n", |
1197 | glist_getcanvas(glist), tag, | 1377 | glist_getcanvas(glist), tag, |
1198 | x1, y1, x2-4, y1, x2, y1+4, x2, y2, x1, y2, x1, y1); | 1378 | x1, y1, x2-4, y1, x2, y1+4, x2, y2, x1, y2, x1, y1); |
1379 | #endif | ||
1199 | } | 1380 | } |
1200 | /* draw inlets/outlets */ | 1381 | /* draw inlets/outlets */ |
1201 | 1382 | ||
1202 | if (ob = pd_checkobject(&x->te_pd)) | 1383 | if ((ob = pd_checkobject(&x->te_pd))) |
1203 | glist_drawiofor(glist, ob, firsttime, tag, x1, y1, x2, y2); | 1384 | glist_drawiofor(glist, ob, firsttime, tag, x1, y1, x2, y2); |
1204 | } | 1385 | } |
1205 | 1386 | ||
1206 | void glist_eraseiofor(t_glist *glist, t_object *ob, char *tag) | 1387 | void glist_eraseiofor(t_glist *glist, t_object *ob, char *tag) |
1207 | { | 1388 | { |
1208 | int i, n; | 1389 | int i, n; |
1390 | #ifdef ROCKBOX | ||
1391 | (void) glist; | ||
1392 | (void) tag; | ||
1393 | #endif | ||
1209 | n = obj_noutlets(ob); | 1394 | n = obj_noutlets(ob); |
1210 | for (i = 0; i < n; i++) | 1395 | for (i = 0; i < n; i++) |
1396 | #ifdef ROCKBOX | ||
1397 | ; | ||
1398 | #else /* ROCKBOX */ | ||
1211 | sys_vgui(".x%x.c delete %so%d\n", | 1399 | sys_vgui(".x%x.c delete %so%d\n", |
1212 | glist_getcanvas(glist), tag, i); | 1400 | glist_getcanvas(glist), tag, i); |
1401 | #endif /* ROCKBOX */ | ||
1213 | n = obj_ninlets(ob); | 1402 | n = obj_ninlets(ob); |
1214 | for (i = 0; i < n; i++) | 1403 | for (i = 0; i < n; i++) |
1404 | #ifdef ROCKBOX | ||
1405 | ; | ||
1406 | #else /* ROCKBOX */ | ||
1215 | sys_vgui(".x%x.c delete %si%d\n", | 1407 | sys_vgui(".x%x.c delete %si%d\n", |
1216 | glist_getcanvas(glist), tag, i); | 1408 | glist_getcanvas(glist), tag, i); |
1409 | #endif /* ROCKBOX */ | ||
1217 | } | 1410 | } |
1218 | 1411 | ||
1219 | void text_eraseborder(t_text *x, t_glist *glist, char *tag) | 1412 | void text_eraseborder(t_text *x, t_glist *glist, char *tag) |
1220 | { | 1413 | { |
1221 | if (x->te_type == T_TEXT) return; | 1414 | if (x->te_type == T_TEXT) return; |
1415 | #ifndef ROCKBOX | ||
1222 | sys_vgui(".x%x.c delete %sR\n", | 1416 | sys_vgui(".x%x.c delete %sR\n", |
1223 | glist_getcanvas(glist), tag); | 1417 | glist_getcanvas(glist), tag); |
1418 | #endif | ||
1224 | glist_eraseiofor(glist, x, tag); | 1419 | glist_eraseiofor(glist, x, tag); |
1225 | } | 1420 | } |
1226 | 1421 | ||
diff --git a/apps/plugins/pdbox/PDa/src/g_toggle.c b/apps/plugins/pdbox/PDa/src/g_toggle.c index 5a3401ffa8..e3e2f05098 100644 --- a/apps/plugins/pdbox/PDa/src/g_toggle.c +++ b/apps/plugins/pdbox/PDa/src/g_toggle.c | |||
@@ -6,6 +6,13 @@ | |||
6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ | 6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ |
7 | 7 | ||
8 | 8 | ||
9 | #ifdef ROCKBOX | ||
10 | #include "plugin.h" | ||
11 | #include "pdbox.h" | ||
12 | #include "m_pd.h" | ||
13 | #include "g_canvas.h" | ||
14 | #include "g_all_guis.h" | ||
15 | #else /* ROCKBOX */ | ||
9 | #include <stdlib.h> | 16 | #include <stdlib.h> |
10 | #include <string.h> | 17 | #include <string.h> |
11 | #include <stdio.h> | 18 | #include <stdio.h> |
@@ -21,6 +28,7 @@ | |||
21 | #else | 28 | #else |
22 | #include <unistd.h> | 29 | #include <unistd.h> |
23 | #endif | 30 | #endif |
31 | #endif /* ROCKBOX */ | ||
24 | 32 | ||
25 | /* --------------- tgl gui-toggle ------------------------- */ | 33 | /* --------------- tgl gui-toggle ------------------------- */ |
26 | 34 | ||
@@ -31,6 +39,10 @@ static t_class *toggle_class; | |||
31 | 39 | ||
32 | void toggle_draw_update(t_toggle *x, t_glist *glist) | 40 | void toggle_draw_update(t_toggle *x, t_glist *glist) |
33 | { | 41 | { |
42 | #ifdef ROCKBOX | ||
43 | (void) x; | ||
44 | (void) glist; | ||
45 | #else /* ROCKBOX */ | ||
34 | if(glist_isvisible(glist)) | 46 | if(glist_isvisible(glist)) |
35 | { | 47 | { |
36 | t_canvas *canvas=glist_getcanvas(glist); | 48 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -40,10 +52,15 @@ void toggle_draw_update(t_toggle *x, t_glist *glist) | |||
40 | sys_vgui(".x%x.c itemconfigure %xX2 -fill #%6.6x\n", canvas, x, | 52 | sys_vgui(".x%x.c itemconfigure %xX2 -fill #%6.6x\n", canvas, x, |
41 | (x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol); | 53 | (x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol); |
42 | } | 54 | } |
55 | #endif /* ROCKBOX */ | ||
43 | } | 56 | } |
44 | 57 | ||
45 | void toggle_draw_new(t_toggle *x, t_glist *glist) | 58 | void toggle_draw_new(t_toggle *x, t_glist *glist) |
46 | { | 59 | { |
60 | #ifdef ROCKBOX | ||
61 | (void) x; | ||
62 | (void) glist; | ||
63 | #else /* ROCKBOX */ | ||
47 | t_canvas *canvas=glist_getcanvas(glist); | 64 | t_canvas *canvas=glist_getcanvas(glist); |
48 | int w=1, xx=text_xpix(&x->x_gui.x_obj, glist), yy=text_ypix(&x->x_gui.x_obj, glist); | 65 | int w=1, xx=text_xpix(&x->x_gui.x_obj, glist), yy=text_ypix(&x->x_gui.x_obj, glist); |
49 | 66 | ||
@@ -72,10 +89,15 @@ void toggle_draw_new(t_toggle *x, t_glist *glist) | |||
72 | if(!x->x_gui.x_fsf.x_rcv_able) | 89 | if(!x->x_gui.x_fsf.x_rcv_able) |
73 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xIN%d\n", | 90 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xIN%d\n", |
74 | canvas, xx, yy, xx + IOWIDTH, yy+1, x, 0); | 91 | canvas, xx, yy, xx + IOWIDTH, yy+1, x, 0); |
92 | #endif /* ROCKBOX */ | ||
75 | } | 93 | } |
76 | 94 | ||
77 | void toggle_draw_move(t_toggle *x, t_glist *glist) | 95 | void toggle_draw_move(t_toggle *x, t_glist *glist) |
78 | { | 96 | { |
97 | #ifdef ROCKBOX | ||
98 | (void) x; | ||
99 | (void) glist; | ||
100 | #else /* ROCKBOX */ | ||
79 | t_canvas *canvas=glist_getcanvas(glist); | 101 | t_canvas *canvas=glist_getcanvas(glist); |
80 | int w=1, xx=text_xpix(&x->x_gui.x_obj, glist), yy=text_ypix(&x->x_gui.x_obj, glist); | 102 | int w=1, xx=text_xpix(&x->x_gui.x_obj, glist), yy=text_ypix(&x->x_gui.x_obj, glist); |
81 | 103 | ||
@@ -100,10 +122,15 @@ void toggle_draw_move(t_toggle *x, t_glist *glist) | |||
100 | if(!x->x_gui.x_fsf.x_rcv_able) | 122 | if(!x->x_gui.x_fsf.x_rcv_able) |
101 | sys_vgui(".x%x.c coords %xIN%d %d %d %d %d\n", | 123 | sys_vgui(".x%x.c coords %xIN%d %d %d %d %d\n", |
102 | canvas, x, 0, xx, yy, xx + IOWIDTH, yy+1); | 124 | canvas, x, 0, xx, yy, xx + IOWIDTH, yy+1); |
125 | #endif /* ROCKBOX */ | ||
103 | } | 126 | } |
104 | 127 | ||
105 | void toggle_draw_erase(t_toggle* x, t_glist* glist) | 128 | void toggle_draw_erase(t_toggle* x, t_glist* glist) |
106 | { | 129 | { |
130 | #ifdef ROCKBOX | ||
131 | (void) x; | ||
132 | (void) glist; | ||
133 | #else /* ROCKBOX */ | ||
107 | t_canvas *canvas=glist_getcanvas(glist); | 134 | t_canvas *canvas=glist_getcanvas(glist); |
108 | 135 | ||
109 | sys_vgui(".x%x.c delete %xBASE\n", canvas, x); | 136 | sys_vgui(".x%x.c delete %xBASE\n", canvas, x); |
@@ -114,10 +141,15 @@ void toggle_draw_erase(t_toggle* x, t_glist* glist) | |||
114 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); | 141 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); |
115 | if(!x->x_gui.x_fsf.x_rcv_able) | 142 | if(!x->x_gui.x_fsf.x_rcv_able) |
116 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 143 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
144 | #endif /* ROCKBOX */ | ||
117 | } | 145 | } |
118 | 146 | ||
119 | void toggle_draw_config(t_toggle* x, t_glist* glist) | 147 | void toggle_draw_config(t_toggle* x, t_glist* glist) |
120 | { | 148 | { |
149 | #ifdef ROCKBOX | ||
150 | (void) x; | ||
151 | (void) glist; | ||
152 | #else /* ROCKBOX */ | ||
121 | t_canvas *canvas=glist_getcanvas(glist); | 153 | t_canvas *canvas=glist_getcanvas(glist); |
122 | 154 | ||
123 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", | 155 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", |
@@ -130,10 +162,16 @@ void toggle_draw_config(t_toggle* x, t_glist* glist) | |||
130 | x->x_on?x->x_gui.x_fcol:x->x_gui.x_bcol); | 162 | x->x_on?x->x_gui.x_fcol:x->x_gui.x_bcol); |
131 | sys_vgui(".x%x.c itemconfigure %xX2 -fill #%6.6x\n", canvas, x, | 163 | sys_vgui(".x%x.c itemconfigure %xX2 -fill #%6.6x\n", canvas, x, |
132 | x->x_on?x->x_gui.x_fcol:x->x_gui.x_bcol); | 164 | x->x_on?x->x_gui.x_fcol:x->x_gui.x_bcol); |
165 | #endif /* ROCKBOX */ | ||
133 | } | 166 | } |
134 | 167 | ||
135 | void toggle_draw_io(t_toggle* x, t_glist* glist, int old_snd_rcv_flags) | 168 | void toggle_draw_io(t_toggle* x, t_glist* glist, int old_snd_rcv_flags) |
136 | { | 169 | { |
170 | #ifdef ROCKBOX | ||
171 | (void) x; | ||
172 | (void) glist; | ||
173 | (void) old_snd_rcv_flags; | ||
174 | #else /* ROCKBOX */ | ||
137 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 175 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
138 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 176 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
139 | t_canvas *canvas=glist_getcanvas(glist); | 177 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -151,10 +189,15 @@ void toggle_draw_io(t_toggle* x, t_glist* glist, int old_snd_rcv_flags) | |||
151 | xpos + IOWIDTH, ypos+1, x, 0); | 189 | xpos + IOWIDTH, ypos+1, x, 0); |
152 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) | 190 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) |
153 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 191 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
192 | #endif /* ROCKBOX */ | ||
154 | } | 193 | } |
155 | 194 | ||
156 | void toggle_draw_select(t_toggle* x, t_glist* glist) | 195 | void toggle_draw_select(t_toggle* x, t_glist* glist) |
157 | { | 196 | { |
197 | #ifdef ROCKBOX | ||
198 | (void) x; | ||
199 | (void) glist; | ||
200 | #else /* ROCKBOX */ | ||
158 | t_canvas *canvas=glist_getcanvas(glist); | 201 | t_canvas *canvas=glist_getcanvas(glist); |
159 | 202 | ||
160 | if(x->x_gui.x_fsf.x_selected) | 203 | if(x->x_gui.x_fsf.x_selected) |
@@ -167,6 +210,7 @@ void toggle_draw_select(t_toggle* x, t_glist* glist) | |||
167 | sys_vgui(".x%x.c itemconfigure %xBASE -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL); | 210 | sys_vgui(".x%x.c itemconfigure %xBASE -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL); |
168 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol); | 211 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol); |
169 | } | 212 | } |
213 | #endif /* ROCKBOX */ | ||
170 | } | 214 | } |
171 | 215 | ||
172 | void toggle_draw(t_toggle *x, t_glist *glist, int mode) | 216 | void toggle_draw(t_toggle *x, t_glist *glist, int mode) |
@@ -220,6 +264,10 @@ static void toggle_save(t_gobj *z, t_binbuf *b) | |||
220 | 264 | ||
221 | static void toggle_properties(t_gobj *z, t_glist *owner) | 265 | static void toggle_properties(t_gobj *z, t_glist *owner) |
222 | { | 266 | { |
267 | #ifdef ROCKBOX | ||
268 | (void) z; | ||
269 | (void) owner; | ||
270 | #else /* ROCKBOX */ | ||
223 | t_toggle *x = (t_toggle *)z; | 271 | t_toggle *x = (t_toggle *)z; |
224 | char buf[800]; | 272 | char buf[800]; |
225 | t_symbol *srl[3]; | 273 | t_symbol *srl[3]; |
@@ -241,6 +289,7 @@ static void toggle_properties(t_gobj *z, t_glist *owner) | |||
241 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, | 289 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, |
242 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol); | 290 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol); |
243 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); | 291 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); |
292 | #endif | ||
244 | } | 293 | } |
245 | 294 | ||
246 | static void toggle_bang(t_toggle *x) | 295 | static void toggle_bang(t_toggle *x) |
@@ -259,6 +308,10 @@ static void toggle_dialog(t_toggle *x, t_symbol *s, int argc, t_atom *argv) | |||
259 | float nonzero = (float)atom_getfloatarg(2, argc, argv); | 308 | float nonzero = (float)atom_getfloatarg(2, argc, argv); |
260 | int sr_flags; | 309 | int sr_flags; |
261 | 310 | ||
311 | #ifdef ROCKBOX | ||
312 | (void) s; | ||
313 | #endif | ||
314 | |||
262 | if(nonzero == 0.0) | 315 | if(nonzero == 0.0) |
263 | nonzero = 1.0; | 316 | nonzero = 1.0; |
264 | x->x_nonzero = nonzero; | 317 | x->x_nonzero = nonzero; |
@@ -274,10 +327,26 @@ static void toggle_dialog(t_toggle *x, t_symbol *s, int argc, t_atom *argv) | |||
274 | } | 327 | } |
275 | 328 | ||
276 | static void toggle_click(t_toggle *x, t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, t_floatarg alt) | 329 | static void toggle_click(t_toggle *x, t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, t_floatarg alt) |
330 | #ifdef ROCKBOX | ||
331 | { | ||
332 | (void) xpos; | ||
333 | (void) ypos; | ||
334 | (void) shift; | ||
335 | (void) alt; | ||
336 | (void) ctrl; | ||
337 | |||
338 | toggle_bang(x); | ||
339 | } | ||
340 | #else /* ROCKBOX */ | ||
277 | {toggle_bang(x);} | 341 | {toggle_bang(x);} |
342 | #endif /* ROCKBOX */ | ||
278 | 343 | ||
279 | static int toggle_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) | 344 | static int toggle_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) |
280 | { | 345 | { |
346 | #ifdef ROCKBOX | ||
347 | (void) glist; | ||
348 | (void) dbl; | ||
349 | #endif | ||
281 | if(doit) | 350 | if(doit) |
282 | toggle_click((t_toggle *)z, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, 0, (t_floatarg)alt); | 351 | toggle_click((t_toggle *)z, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, 0, (t_floatarg)alt); |
283 | return (1); | 352 | return (1); |
@@ -318,6 +387,9 @@ static void toggle_loadbang(t_toggle *x) | |||
318 | 387 | ||
319 | static void toggle_size(t_toggle *x, t_symbol *s, int ac, t_atom *av) | 388 | static void toggle_size(t_toggle *x, t_symbol *s, int ac, t_atom *av) |
320 | { | 389 | { |
390 | #ifdef ROCKBOX | ||
391 | (void) s; | ||
392 | #endif | ||
321 | x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); | 393 | x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); |
322 | x->x_gui.x_h = x->x_gui.x_w; | 394 | x->x_gui.x_h = x->x_gui.x_w; |
323 | iemgui_size((void *)x, &x->x_gui); | 395 | iemgui_size((void *)x, &x->x_gui); |
@@ -362,11 +434,21 @@ static void *toggle_new(t_symbol *s, int argc, t_atom *argv) | |||
362 | { | 434 | { |
363 | t_toggle *x = (t_toggle *)pd_new(toggle_class); | 435 | t_toggle *x = (t_toggle *)pd_new(toggle_class); |
364 | int bflcol[]={-262144, -1, -1}; | 436 | int bflcol[]={-262144, -1, -1}; |
437 | #ifdef ROCKBOX | ||
438 | int a=IEM_GUI_DEFAULTSIZE; | ||
439 | #else | ||
365 | int a=IEM_GUI_DEFAULTSIZE, f=0; | 440 | int a=IEM_GUI_DEFAULTSIZE, f=0; |
441 | #endif | ||
366 | int ldx=0, ldy=-6; | 442 | int ldx=0, ldy=-6; |
367 | int fs=8; | 443 | int fs=8; |
368 | float on=0.0, nonzero=1.0; | 444 | float on=0.0, nonzero=1.0; |
445 | #ifndef ROCKBOX | ||
369 | char str[144]; | 446 | char str[144]; |
447 | #endif | ||
448 | |||
449 | #ifdef ROCKBOX | ||
450 | (void) s; | ||
451 | #endif | ||
370 | 452 | ||
371 | iem_inttosymargs(&x->x_gui.x_isa, 0); | 453 | iem_inttosymargs(&x->x_gui.x_isa, 0); |
372 | iem_inttofstyle(&x->x_gui.x_fsf, 0); | 454 | iem_inttofstyle(&x->x_gui.x_fsf, 0); |
@@ -433,7 +515,9 @@ static void toggle_ff(t_toggle *x) | |||
433 | { | 515 | { |
434 | if(x->x_gui.x_fsf.x_rcv_able) | 516 | if(x->x_gui.x_fsf.x_rcv_able) |
435 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); | 517 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); |
518 | #ifndef ROCKBOX | ||
436 | gfxstub_deleteforkey(x); | 519 | gfxstub_deleteforkey(x); |
520 | #endif | ||
437 | } | 521 | } |
438 | 522 | ||
439 | void g_toggle_setup(void) | 523 | void g_toggle_setup(void) |
diff --git a/apps/plugins/pdbox/PDa/src/g_traversal.c b/apps/plugins/pdbox/PDa/src/g_traversal.c index 0e2c6855b4..b6ac2d110e 100644 --- a/apps/plugins/pdbox/PDa/src/g_traversal.c +++ b/apps/plugins/pdbox/PDa/src/g_traversal.c | |||
@@ -16,11 +16,18 @@ sublist - get a pointer into a list which is an element of another scalar | |||
16 | 16 | ||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #ifdef ROCKBOX | ||
20 | #include "plugin.h" | ||
21 | #include "pdbox.h" | ||
22 | #include "m_pd.h" | ||
23 | #include "g_canvas.h" | ||
24 | #else /* ROCKBOX */ | ||
19 | #include <stdlib.h> | 25 | #include <stdlib.h> |
20 | #include <string.h> | 26 | #include <string.h> |
21 | #include <stdio.h> /* for read/write to files */ | 27 | #include <stdio.h> /* for read/write to files */ |
22 | #include "m_pd.h" | 28 | #include "m_pd.h" |
23 | #include "g_canvas.h" | 29 | #include "g_canvas.h" |
30 | #endif /* ROCKBOX */ | ||
24 | 31 | ||
25 | /* ------------- gstubs and gpointers - safe pointing --------------- */ | 32 | /* ------------- gstubs and gpointers - safe pointing --------------- */ |
26 | 33 | ||
@@ -135,7 +142,7 @@ void gpointer_copy(const t_gpointer *gpfrom, t_gpointer *gpto) | |||
135 | void gpointer_unset(t_gpointer *gp) | 142 | void gpointer_unset(t_gpointer *gp) |
136 | { | 143 | { |
137 | t_gstub *gs; | 144 | t_gstub *gs; |
138 | if (gs = gp->gp_stub) | 145 | if((gs = gp->gp_stub)) |
139 | { | 146 | { |
140 | gstub_dis(gs); | 147 | gstub_dis(gs); |
141 | gp->gp_stub = 0; | 148 | gp->gp_stub = 0; |
@@ -145,7 +152,7 @@ void gpointer_unset(t_gpointer *gp) | |||
145 | void gpointer_setglist(t_gpointer *gp, t_glist *glist, t_scalar *x) | 152 | void gpointer_setglist(t_gpointer *gp, t_glist *glist, t_scalar *x) |
146 | { | 153 | { |
147 | t_gstub *gs; | 154 | t_gstub *gs; |
148 | if (gs = gp->gp_stub) gstub_dis(gs); | 155 | if((gs = gp->gp_stub)) gstub_dis(gs); |
149 | gp->gp_stub = gs = glist->gl_stub; | 156 | gp->gp_stub = gs = glist->gl_stub; |
150 | gp->gp_valid = glist->gl_valid; | 157 | gp->gp_valid = glist->gl_valid; |
151 | gp->gp_un.gp_scalar = x; | 158 | gp->gp_un.gp_scalar = x; |
@@ -155,7 +162,7 @@ void gpointer_setglist(t_gpointer *gp, t_glist *glist, t_scalar *x) | |||
155 | static void gpointer_setarray(t_gpointer *gp, t_array *array, t_word *w) | 162 | static void gpointer_setarray(t_gpointer *gp, t_array *array, t_word *w) |
156 | { | 163 | { |
157 | t_gstub *gs; | 164 | t_gstub *gs; |
158 | if (gs = gp->gp_stub) gstub_dis(gs); | 165 | if((gs = gp->gp_stub)) gstub_dis(gs); |
159 | gp->gp_stub = gs = array->a_stub; | 166 | gp->gp_stub = gs = array->a_stub; |
160 | gp->gp_valid = array->a_valid; | 167 | gp->gp_valid = array->a_valid; |
161 | gp->gp_un.gp_w = w; | 168 | gp->gp_un.gp_w = w; |
@@ -194,6 +201,9 @@ static void *ptrobj_new(t_symbol *classname, int argc, t_atom *argv) | |||
194 | t_ptrobj *x = (t_ptrobj *)pd_new(ptrobj_class); | 201 | t_ptrobj *x = (t_ptrobj *)pd_new(ptrobj_class); |
195 | t_typedout *to; | 202 | t_typedout *to; |
196 | int n; | 203 | int n; |
204 | #ifdef ROCKBOX | ||
205 | (void) classname; | ||
206 | #endif | ||
197 | gpointer_init(&x->x_gp); | 207 | gpointer_init(&x->x_gp); |
198 | x->x_typedout = to = (t_typedout *)getbytes(argc * sizeof (*to)); | 208 | x->x_typedout = to = (t_typedout *)getbytes(argc * sizeof (*to)); |
199 | x->x_ntypedout = n = argc; | 209 | x->x_ntypedout = n = argc; |
@@ -285,10 +295,14 @@ static void ptrobj_next(t_ptrobj *x) | |||
285 | 295 | ||
286 | static void ptrobj_sendwindow(t_ptrobj *x, t_symbol *s, int argc, t_atom *argv) | 296 | static void ptrobj_sendwindow(t_ptrobj *x, t_symbol *s, int argc, t_atom *argv) |
287 | { | 297 | { |
298 | #ifdef ROCKBOX | ||
299 | (void) s; | ||
300 | #else /* ROCKBOX */ | ||
288 | t_scalar *sc; | 301 | t_scalar *sc; |
289 | t_symbol *templatesym; | 302 | t_symbol *templatesym; |
290 | int n; | 303 | int n; |
291 | t_typedout *to; | 304 | t_typedout *to; |
305 | #endif /* ROCKBOX */ | ||
292 | t_glist *glist; | 306 | t_glist *glist; |
293 | t_pd *canvas; | 307 | t_pd *canvas; |
294 | t_gstub *gs; | 308 | t_gstub *gs; |
@@ -388,6 +402,9 @@ static void *get_new(t_symbol *why, int argc, t_atom *argv) | |||
388 | int i; | 402 | int i; |
389 | t_getvariable *sp; | 403 | t_getvariable *sp; |
390 | x->x_templatesym = canvas_makebindsym(atom_getsymbolarg(0, argc, argv)); | 404 | x->x_templatesym = canvas_makebindsym(atom_getsymbolarg(0, argc, argv)); |
405 | #ifdef ROCKBOX | ||
406 | (void) why; | ||
407 | #endif | ||
391 | if (argc) argc--, argv++; | 408 | if (argc) argc--, argv++; |
392 | x->x_variables | 409 | x->x_variables |
393 | = (t_getvariable *)getbytes(argc * sizeof (*x->x_variables)); | 410 | = (t_getvariable *)getbytes(argc * sizeof (*x->x_variables)); |
@@ -468,6 +485,9 @@ static void *set_new(t_symbol *why, int argc, t_atom *argv) | |||
468 | int i; | 485 | int i; |
469 | t_setvariable *sp; | 486 | t_setvariable *sp; |
470 | x->x_templatesym = canvas_makebindsym(atom_getsymbolarg(0, argc, argv)); | 487 | x->x_templatesym = canvas_makebindsym(atom_getsymbolarg(0, argc, argv)); |
488 | #ifdef ROCKBOX | ||
489 | (void) why; | ||
490 | #endif | ||
471 | if (argc) argc--, argv++; | 491 | if (argc) argc--, argv++; |
472 | x->x_variables | 492 | x->x_variables |
473 | = (t_setvariable *)getbytes(argc * sizeof (*x->x_variables)); | 493 | = (t_setvariable *)getbytes(argc * sizeof (*x->x_variables)); |
@@ -634,6 +654,9 @@ static void elem_float(t_elem *x, t_float f) | |||
634 | 654 | ||
635 | static void elem_free(t_elem *x, t_gpointer *gp) | 655 | static void elem_free(t_elem *x, t_gpointer *gp) |
636 | { | 656 | { |
657 | #ifdef ROCKBOX | ||
658 | (void) gp; | ||
659 | #endif | ||
637 | gpointer_unset(&x->x_gp); | 660 | gpointer_unset(&x->x_gp); |
638 | gpointer_unset(&x->x_gparent); | 661 | gpointer_unset(&x->x_gparent); |
639 | } | 662 | } |
@@ -667,13 +690,19 @@ static void *getsize_new(t_symbol *templatesym, t_symbol *fieldsym) | |||
667 | 690 | ||
668 | static void getsize_pointer(t_getsize *x, t_gpointer *gp) | 691 | static void getsize_pointer(t_getsize *x, t_gpointer *gp) |
669 | { | 692 | { |
693 | #ifdef ROCKBOX | ||
694 | int onset, type; | ||
695 | #else /* ROCKBOX */ | ||
670 | int nitems, onset, type; | 696 | int nitems, onset, type; |
697 | #endif /* ROCKBOX */ | ||
671 | t_symbol *templatesym = x->x_templatesym, *fieldsym = x->x_fieldsym, | 698 | t_symbol *templatesym = x->x_templatesym, *fieldsym = x->x_fieldsym, |
672 | *elemtemplatesym; | 699 | *elemtemplatesym; |
673 | t_template *template = template_findbyname(templatesym); | 700 | t_template *template = template_findbyname(templatesym); |
674 | t_word *w; | 701 | t_word *w; |
675 | t_array *array; | 702 | t_array *array; |
703 | #ifndef ROCKBOX | ||
676 | int elemsize; | 704 | int elemsize; |
705 | #endif | ||
677 | t_gstub *gs = gp->gp_stub; | 706 | t_gstub *gs = gp->gp_stub; |
678 | if (!template) | 707 | if (!template) |
679 | { | 708 | { |
@@ -731,6 +760,9 @@ typedef struct _setsize | |||
731 | static void *setsize_new(t_symbol *templatesym, t_symbol *fieldsym, | 760 | static void *setsize_new(t_symbol *templatesym, t_symbol *fieldsym, |
732 | t_floatarg newsize) | 761 | t_floatarg newsize) |
733 | { | 762 | { |
763 | #ifdef ROCKBOX | ||
764 | (void) newsize; | ||
765 | #endif | ||
734 | t_setsize *x = (t_setsize *)pd_new(setsize_class); | 766 | t_setsize *x = (t_setsize *)pd_new(setsize_class); |
735 | x->x_templatesym = canvas_makebindsym(templatesym); | 767 | x->x_templatesym = canvas_makebindsym(templatesym); |
736 | x->x_fieldsym = fieldsym; | 768 | x->x_fieldsym = fieldsym; |
@@ -748,7 +780,9 @@ static void setsize_float(t_setsize *x, t_float f) | |||
748 | t_template *template = template_findbyname(templatesym); | 780 | t_template *template = template_findbyname(templatesym); |
749 | t_template *elemtemplate; | 781 | t_template *elemtemplate; |
750 | t_word *w; | 782 | t_word *w; |
783 | #ifndef ROCKBOX | ||
751 | t_atom at; | 784 | t_atom at; |
785 | #endif | ||
752 | t_array *array; | 786 | t_array *array; |
753 | int elemsize; | 787 | int elemsize; |
754 | int newsize = f; | 788 | int newsize = f; |
@@ -830,7 +864,11 @@ static void setsize_float(t_setsize *x, t_float f) | |||
830 | if (newsize > nitems) | 864 | if (newsize > nitems) |
831 | { | 865 | { |
832 | char *newelem = ((char *)array->a_vec) + nitems * elemsize; | 866 | char *newelem = ((char *)array->a_vec) + nitems * elemsize; |
867 | #ifdef ROCKBOX | ||
868 | int nnew = newsize - nitems; | ||
869 | #else /* ROCKBOX */ | ||
833 | int i = 0, nnew = newsize - nitems; | 870 | int i = 0, nnew = newsize - nitems; |
871 | #endif /* ROCKBOX */ | ||
834 | 872 | ||
835 | while (nnew--) | 873 | while (nnew--) |
836 | { | 874 | { |
@@ -896,6 +934,9 @@ static void *append_new(t_symbol *why, int argc, t_atom *argv) | |||
896 | int i; | 934 | int i; |
897 | t_appendvariable *sp; | 935 | t_appendvariable *sp; |
898 | x->x_templatesym = canvas_makebindsym(atom_getsymbolarg(0, argc, argv)); | 936 | x->x_templatesym = canvas_makebindsym(atom_getsymbolarg(0, argc, argv)); |
937 | #ifdef ROCKBOX | ||
938 | (void) why; | ||
939 | #endif | ||
899 | if (argc) argc--, argv++; | 940 | if (argc) argc--, argv++; |
900 | x->x_variables | 941 | x->x_variables |
901 | = (t_appendvariable *)getbytes(argc * sizeof (*x->x_variables)); | 942 | = (t_appendvariable *)getbytes(argc * sizeof (*x->x_variables)); |
@@ -1023,8 +1064,10 @@ static void sublist_pointer(t_sublist *x, t_gpointer *gp) | |||
1023 | t_symbol *templatesym = x->x_templatesym, *dummy; | 1064 | t_symbol *templatesym = x->x_templatesym, *dummy; |
1024 | t_template *template = template_findbyname(templatesym); | 1065 | t_template *template = template_findbyname(templatesym); |
1025 | t_gstub *gs = gp->gp_stub; | 1066 | t_gstub *gs = gp->gp_stub; |
1026 | t_word *vec; | 1067 | #ifndef ROCKBOX |
1068 | t_word *vec; | ||
1027 | t_getvariable *vp; | 1069 | t_getvariable *vp; |
1070 | #endif | ||
1028 | int onset, type; | 1071 | int onset, type; |
1029 | t_word *w; | 1072 | t_word *w; |
1030 | 1073 | ||
@@ -1059,6 +1102,9 @@ static void sublist_pointer(t_sublist *x, t_gpointer *gp) | |||
1059 | 1102 | ||
1060 | static void sublist_free(t_sublist *x, t_gpointer *gp) | 1103 | static void sublist_free(t_sublist *x, t_gpointer *gp) |
1061 | { | 1104 | { |
1105 | #ifdef ROCKBOX | ||
1106 | (void) gp; | ||
1107 | #endif | ||
1062 | gpointer_unset(&x->x_gp); | 1108 | gpointer_unset(&x->x_gp); |
1063 | } | 1109 | } |
1064 | 1110 | ||
diff --git a/apps/plugins/pdbox/PDa/src/g_vdial.c b/apps/plugins/pdbox/PDa/src/g_vdial.c index 47ac3d19bb..bf026c697f 100644 --- a/apps/plugins/pdbox/PDa/src/g_vdial.c +++ b/apps/plugins/pdbox/PDa/src/g_vdial.c | |||
@@ -7,6 +7,13 @@ | |||
7 | /* name change to vradio by MSP (it's a radio button really) and changed to | 7 | /* name change to vradio by MSP (it's a radio button really) and changed to |
8 | put out a "float" as in sliders, toggles, etc. */ | 8 | put out a "float" as in sliders, toggles, etc. */ |
9 | 9 | ||
10 | #ifdef ROCKBOX | ||
11 | #include "plugin.h" | ||
12 | #include "pdbox.h" | ||
13 | #include "m_pd.h" | ||
14 | #include "g_canvas.h" | ||
15 | #include "g_all_guis.h" | ||
16 | #else /* ROCKBOX */ | ||
10 | #include <stdlib.h> | 17 | #include <stdlib.h> |
11 | #include <string.h> | 18 | #include <string.h> |
12 | #include <stdio.h> | 19 | #include <stdio.h> |
@@ -16,6 +23,7 @@ put out a "float" as in sliders, toggles, etc. */ | |||
16 | #include "t_tk.h" | 23 | #include "t_tk.h" |
17 | #include "g_all_guis.h" | 24 | #include "g_all_guis.h" |
18 | #include <math.h> | 25 | #include <math.h> |
26 | #endif /* ROCKBOX */ | ||
19 | 27 | ||
20 | /*------------------ global variables -------------------------*/ | 28 | /*------------------ global variables -------------------------*/ |
21 | 29 | ||
@@ -34,6 +42,10 @@ static t_class *vradio_class, *vradio_old_class; | |||
34 | 42 | ||
35 | void vradio_draw_update(t_vradio *x, t_glist *glist) | 43 | void vradio_draw_update(t_vradio *x, t_glist *glist) |
36 | { | 44 | { |
45 | #ifdef ROCKBOX | ||
46 | (void) x; | ||
47 | (void) glist; | ||
48 | #else /* ROCKBOX */ | ||
37 | if(glist_isvisible(glist)) | 49 | if(glist_isvisible(glist)) |
38 | { | 50 | { |
39 | t_canvas *canvas=glist_getcanvas(glist); | 51 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -45,10 +57,15 @@ void vradio_draw_update(t_vradio *x, t_glist *glist) | |||
45 | canvas, x, x->x_on, | 57 | canvas, x, x->x_on, |
46 | x->x_gui.x_fcol, x->x_gui.x_fcol); | 58 | x->x_gui.x_fcol, x->x_gui.x_fcol); |
47 | } | 59 | } |
60 | #endif /* ROCKBOX */ | ||
48 | } | 61 | } |
49 | 62 | ||
50 | void vradio_draw_new(t_vradio *x, t_glist *glist) | 63 | void vradio_draw_new(t_vradio *x, t_glist *glist) |
51 | { | 64 | { |
65 | #ifdef ROCKBOX | ||
66 | (void) x; | ||
67 | (void) glist; | ||
68 | #else /* ROCKBOX */ | ||
52 | t_canvas *canvas=glist_getcanvas(glist); | 69 | t_canvas *canvas=glist_getcanvas(glist); |
53 | int n=x->x_number, i, dy=x->x_gui.x_h, s4=dy/4; | 70 | int n=x->x_number, i, dy=x->x_gui.x_h, s4=dy/4; |
54 | int yy11b=text_ypix(&x->x_gui.x_obj, glist); | 71 | int yy11b=text_ypix(&x->x_gui.x_obj, glist); |
@@ -83,10 +100,15 @@ void vradio_draw_new(t_vradio *x, t_glist *glist) | |||
83 | if(!x->x_gui.x_fsf.x_rcv_able) | 100 | if(!x->x_gui.x_fsf.x_rcv_able) |
84 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xIN%d\n", | 101 | sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xIN%d\n", |
85 | canvas, xx11, yy11b, xx11 + IOWIDTH, yy11b+1, x, 0); | 102 | canvas, xx11, yy11b, xx11 + IOWIDTH, yy11b+1, x, 0); |
103 | #endif /* ROCKBOX */ | ||
86 | } | 104 | } |
87 | 105 | ||
88 | void vradio_draw_move(t_vradio *x, t_glist *glist) | 106 | void vradio_draw_move(t_vradio *x, t_glist *glist) |
89 | { | 107 | { |
108 | #ifdef ROCKBOX | ||
109 | (void) x; | ||
110 | (void) glist; | ||
111 | #else /* ROCKBOX */ | ||
90 | t_canvas *canvas=glist_getcanvas(glist); | 112 | t_canvas *canvas=glist_getcanvas(glist); |
91 | int n=x->x_number, i, dy=x->x_gui.x_h, s4=dy/4; | 113 | int n=x->x_number, i, dy=x->x_gui.x_h, s4=dy/4; |
92 | int yy11b=text_ypix(&x->x_gui.x_obj, glist); | 114 | int yy11b=text_ypix(&x->x_gui.x_obj, glist); |
@@ -114,10 +136,15 @@ void vradio_draw_move(t_vradio *x, t_glist *glist) | |||
114 | if(!x->x_gui.x_fsf.x_rcv_able) | 136 | if(!x->x_gui.x_fsf.x_rcv_able) |
115 | sys_vgui(".x%x.c coords %xIN%d %d %d %d %d\n", | 137 | sys_vgui(".x%x.c coords %xIN%d %d %d %d %d\n", |
116 | canvas, x, 0, xx11, yy11b, xx11 + IOWIDTH, yy11b+1); | 138 | canvas, x, 0, xx11, yy11b, xx11 + IOWIDTH, yy11b+1); |
139 | #endif /* ROCKBOX */ | ||
117 | } | 140 | } |
118 | 141 | ||
119 | void vradio_draw_erase(t_vradio* x, t_glist* glist) | 142 | void vradio_draw_erase(t_vradio* x, t_glist* glist) |
120 | { | 143 | { |
144 | #ifdef ROCKBOX | ||
145 | (void) x; | ||
146 | (void) glist; | ||
147 | #else /* ROCKBOX */ | ||
121 | t_canvas *canvas=glist_getcanvas(glist); | 148 | t_canvas *canvas=glist_getcanvas(glist); |
122 | int n=x->x_number, i; | 149 | int n=x->x_number, i; |
123 | 150 | ||
@@ -131,10 +158,15 @@ void vradio_draw_erase(t_vradio* x, t_glist* glist) | |||
131 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); | 158 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); |
132 | if(!x->x_gui.x_fsf.x_rcv_able) | 159 | if(!x->x_gui.x_fsf.x_rcv_able) |
133 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 160 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
161 | #endif /* ROCKBOX */ | ||
134 | } | 162 | } |
135 | 163 | ||
136 | void vradio_draw_config(t_vradio* x, t_glist* glist) | 164 | void vradio_draw_config(t_vradio* x, t_glist* glist) |
137 | { | 165 | { |
166 | #ifdef ROCKBOX | ||
167 | (void) x; | ||
168 | (void) glist; | ||
169 | #else /* ROCKBOX */ | ||
138 | t_canvas *canvas=glist_getcanvas(glist); | 170 | t_canvas *canvas=glist_getcanvas(glist); |
139 | int n=x->x_number, i; | 171 | int n=x->x_number, i; |
140 | 172 | ||
@@ -150,10 +182,16 @@ void vradio_draw_config(t_vradio* x, t_glist* glist) | |||
150 | (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol, | 182 | (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol, |
151 | (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol); | 183 | (x->x_on==i)?x->x_gui.x_fcol:x->x_gui.x_bcol); |
152 | } | 184 | } |
185 | #endif /* ROCKBOX */ | ||
153 | } | 186 | } |
154 | 187 | ||
155 | void vradio_draw_io(t_vradio* x, t_glist* glist, int old_snd_rcv_flags) | 188 | void vradio_draw_io(t_vradio* x, t_glist* glist, int old_snd_rcv_flags) |
156 | { | 189 | { |
190 | #ifdef ROCKBOX | ||
191 | (void) x; | ||
192 | (void) glist; | ||
193 | (void) old_snd_rcv_flags; | ||
194 | #else /* ROCKBOX */ | ||
157 | t_canvas *canvas=glist_getcanvas(glist); | 195 | t_canvas *canvas=glist_getcanvas(glist); |
158 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 196 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
159 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 197 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
@@ -173,10 +211,15 @@ void vradio_draw_io(t_vradio* x, t_glist* glist, int old_snd_rcv_flags) | |||
173 | x, 0); | 211 | x, 0); |
174 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) | 212 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) |
175 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 213 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
214 | #endif /* ROCKBOX */ | ||
176 | } | 215 | } |
177 | 216 | ||
178 | void vradio_draw_select(t_vradio* x, t_glist* glist) | 217 | void vradio_draw_select(t_vradio* x, t_glist* glist) |
179 | { | 218 | { |
219 | #ifdef ROCKBOX | ||
220 | (void) x; | ||
221 | (void) glist; | ||
222 | #else /* ROCKBOX */ | ||
180 | t_canvas *canvas=glist_getcanvas(glist); | 223 | t_canvas *canvas=glist_getcanvas(glist); |
181 | int n=x->x_number, i; | 224 | int n=x->x_number, i; |
182 | 225 | ||
@@ -199,6 +242,7 @@ void vradio_draw_select(t_vradio* x, t_glist* glist) | |||
199 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, | 242 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, |
200 | x->x_gui.x_lcol); | 243 | x->x_gui.x_lcol); |
201 | } | 244 | } |
245 | #endif /* ROCKBOX */ | ||
202 | } | 246 | } |
203 | 247 | ||
204 | void vradio_draw(t_vradio *x, t_glist *glist, int mode) | 248 | void vradio_draw(t_vradio *x, t_glist *glist, int mode) |
@@ -254,6 +298,10 @@ static void vradio_save(t_gobj *z, t_binbuf *b) | |||
254 | 298 | ||
255 | static void vradio_properties(t_gobj *z, t_glist *owner) | 299 | static void vradio_properties(t_gobj *z, t_glist *owner) |
256 | { | 300 | { |
301 | #ifdef ROCKBOX | ||
302 | (void) z; | ||
303 | (void) owner; | ||
304 | #else /* ROCKBOX */ | ||
257 | t_vradio *x = (t_vradio *)z; | 305 | t_vradio *x = (t_vradio *)z; |
258 | char buf[800]; | 306 | char buf[800]; |
259 | t_symbol *srl[3]; | 307 | t_symbol *srl[3]; |
@@ -278,6 +326,7 @@ static void vradio_properties(t_gobj *z, t_glist *owner) | |||
278 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, | 326 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, |
279 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol); | 327 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol); |
280 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); | 328 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); |
329 | #endif /* ROCKBOX */ | ||
281 | } | 330 | } |
282 | 331 | ||
283 | static void vradio_dialog(t_vradio *x, t_symbol *s, int argc, t_atom *argv) | 332 | static void vradio_dialog(t_vradio *x, t_symbol *s, int argc, t_atom *argv) |
@@ -288,6 +337,10 @@ static void vradio_dialog(t_vradio *x, t_symbol *s, int argc, t_atom *argv) | |||
288 | int num = (int)atom_getintarg(6, argc, argv); | 337 | int num = (int)atom_getintarg(6, argc, argv); |
289 | int sr_flags; | 338 | int sr_flags; |
290 | 339 | ||
340 | #ifdef ROCKBOX | ||
341 | (void) s; | ||
342 | #endif | ||
343 | |||
291 | if(chg != 0) chg = 1; | 344 | if(chg != 0) chg = 1; |
292 | x->x_change = chg; | 345 | x->x_change = chg; |
293 | sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); | 346 | sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); |
@@ -463,12 +516,23 @@ static void vradio_click(t_vradio *x, t_floatarg xpos, t_floatarg ypos, | |||
463 | { | 516 | { |
464 | int yy = (int)ypos - text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist); | 517 | int yy = (int)ypos - text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist); |
465 | 518 | ||
519 | #ifdef ROCKBOX | ||
520 | (void) xpos; | ||
521 | (void) shift; | ||
522 | (void) ctrl; | ||
523 | (void) alt; | ||
524 | #endif | ||
525 | |||
466 | vradio_fout(x, (float)(yy / x->x_gui.x_h)); | 526 | vradio_fout(x, (float)(yy / x->x_gui.x_h)); |
467 | } | 527 | } |
468 | 528 | ||
469 | static int vradio_newclick(t_gobj *z, struct _glist *glist, | 529 | static int vradio_newclick(t_gobj *z, struct _glist *glist, |
470 | int xpix, int ypix, int shift, int alt, int dbl, int doit) | 530 | int xpix, int ypix, int shift, int alt, int dbl, int doit) |
471 | { | 531 | { |
532 | #ifdef ROCKBOX | ||
533 | (void) glist; | ||
534 | (void) dbl; | ||
535 | #endif | ||
472 | if(doit) | 536 | if(doit) |
473 | vradio_click((t_vradio *)z, (t_floatarg)xpix, (t_floatarg)ypix, | 537 | vradio_click((t_vradio *)z, (t_floatarg)xpix, (t_floatarg)ypix, |
474 | (t_floatarg)shift, 0, (t_floatarg)alt); | 538 | (t_floatarg)shift, 0, (t_floatarg)alt); |
@@ -502,6 +566,9 @@ static void vradio_number(t_vradio *x, t_floatarg num) | |||
502 | 566 | ||
503 | static void vradio_size(t_vradio *x, t_symbol *s, int ac, t_atom *av) | 567 | static void vradio_size(t_vradio *x, t_symbol *s, int ac, t_atom *av) |
504 | { | 568 | { |
569 | #ifdef ROCKBOX | ||
570 | (void) s; | ||
571 | #endif | ||
505 | x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); | 572 | x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); |
506 | x->x_gui.x_h = x->x_gui.x_w; | 573 | x->x_gui.x_h = x->x_gui.x_w; |
507 | iemgui_size((void *)x, &x->x_gui); | 574 | iemgui_size((void *)x, &x->x_gui); |
@@ -546,11 +613,21 @@ static void *vradio_donew(t_symbol *s, int argc, t_atom *argv, int old) | |||
546 | { | 613 | { |
547 | t_vradio *x = (t_vradio *)pd_new(old? vradio_old_class : vradio_class); | 614 | t_vradio *x = (t_vradio *)pd_new(old? vradio_old_class : vradio_class); |
548 | int bflcol[]={-262144, -1, -1}; | 615 | int bflcol[]={-262144, -1, -1}; |
616 | #ifdef ROCKBOX | ||
617 | int a=IEM_GUI_DEFAULTSIZE, on=0; | ||
618 | #else | ||
549 | int a=IEM_GUI_DEFAULTSIZE, on=0, f=0; | 619 | int a=IEM_GUI_DEFAULTSIZE, on=0, f=0; |
620 | #endif | ||
550 | int ldx=0, ldy=-6, chg=1, num=8; | 621 | int ldx=0, ldy=-6, chg=1, num=8; |
551 | int fs=8; | 622 | int fs=8; |
623 | #ifndef ROCKBOX | ||
552 | int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, fthold=IEM_BNG_DEFAULTHOLDFLASHTIME; | 624 | int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, fthold=IEM_BNG_DEFAULTHOLDFLASHTIME; |
553 | char str[144]; | 625 | char str[144]; |
626 | #endif | ||
627 | |||
628 | #ifdef ROCKBOX | ||
629 | (void) s; | ||
630 | #endif | ||
554 | 631 | ||
555 | if((argc == 15)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2) | 632 | if((argc == 15)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2) |
556 | &&IS_A_FLOAT(argv,3) | 633 | &&IS_A_FLOAT(argv,3) |
@@ -632,7 +709,9 @@ static void vradio_ff(t_vradio *x) | |||
632 | { | 709 | { |
633 | if(x->x_gui.x_fsf.x_rcv_able) | 710 | if(x->x_gui.x_fsf.x_rcv_able) |
634 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); | 711 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); |
712 | #ifndef ROCKBOX | ||
635 | gfxstub_deleteforkey(x); | 713 | gfxstub_deleteforkey(x); |
714 | #endif | ||
636 | } | 715 | } |
637 | 716 | ||
638 | void g_vradio_setup(void) | 717 | void g_vradio_setup(void) |
diff --git a/apps/plugins/pdbox/PDa/src/g_vslider.c b/apps/plugins/pdbox/PDa/src/g_vslider.c index ee02236769..f01dcfdf6d 100644 --- a/apps/plugins/pdbox/PDa/src/g_vslider.c +++ b/apps/plugins/pdbox/PDa/src/g_vslider.c | |||
@@ -6,6 +6,13 @@ | |||
6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ | 6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ |
7 | 7 | ||
8 | 8 | ||
9 | #ifdef ROCKBOX | ||
10 | #include "plugin.h" | ||
11 | #include "pdbox.h" | ||
12 | #include "m_pd.h" | ||
13 | #include "g_canvas.h" | ||
14 | #include "g_all_guis.h" | ||
15 | #else /* ROCKBOX */ | ||
9 | #include <stdlib.h> | 16 | #include <stdlib.h> |
10 | #include <string.h> | 17 | #include <string.h> |
11 | #include <stdio.h> | 18 | #include <stdio.h> |
@@ -21,6 +28,7 @@ | |||
21 | #else | 28 | #else |
22 | #include <unistd.h> | 29 | #include <unistd.h> |
23 | #endif | 30 | #endif |
31 | #endif /* ROCKBOX */ | ||
24 | 32 | ||
25 | 33 | ||
26 | /* ------------ vsl gui-vertical slider ----------------------- */ | 34 | /* ------------ vsl gui-vertical slider ----------------------- */ |
@@ -32,6 +40,10 @@ static t_class *vslider_class; | |||
32 | 40 | ||
33 | static void vslider_draw_update(t_vslider *x, t_glist *glist) | 41 | static void vslider_draw_update(t_vslider *x, t_glist *glist) |
34 | { | 42 | { |
43 | #ifdef ROCKBOX | ||
44 | (void) x; | ||
45 | (void) glist; | ||
46 | #else /* ROCKBOX */ | ||
35 | if (glist_isvisible(glist)) | 47 | if (glist_isvisible(glist)) |
36 | { | 48 | { |
37 | int r = text_ypix(&x->x_gui.x_obj, glist) + x->x_gui.x_h - (x->x_val + 50)/100; | 49 | int r = text_ypix(&x->x_gui.x_obj, glist) + x->x_gui.x_h - (x->x_val + 50)/100; |
@@ -41,10 +53,15 @@ static void vslider_draw_update(t_vslider *x, t_glist *glist) | |||
41 | glist_getcanvas(glist), x, xpos+1, r, | 53 | glist_getcanvas(glist), x, xpos+1, r, |
42 | xpos + x->x_gui.x_w, r); | 54 | xpos + x->x_gui.x_w, r); |
43 | } | 55 | } |
56 | #endif /* ROCKBOX */ | ||
44 | } | 57 | } |
45 | 58 | ||
46 | static void vslider_draw_new(t_vslider *x, t_glist *glist) | 59 | static void vslider_draw_new(t_vslider *x, t_glist *glist) |
47 | { | 60 | { |
61 | #ifdef ROCKBOX | ||
62 | (void) x; | ||
63 | (void) glist; | ||
64 | #else /* ROCKBOX */ | ||
48 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 65 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
49 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 66 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
50 | int r = ypos + x->x_gui.x_h - (x->x_val + 50)/100; | 67 | int r = ypos + x->x_gui.x_h - (x->x_val + 50)/100; |
@@ -74,10 +91,15 @@ static void vslider_draw_new(t_vslider *x, t_glist *glist) | |||
74 | xpos, ypos-2, | 91 | xpos, ypos-2, |
75 | xpos+7, ypos-1, | 92 | xpos+7, ypos-1, |
76 | x, 0); | 93 | x, 0); |
94 | #endif /* ROCKBOX */ | ||
77 | } | 95 | } |
78 | 96 | ||
79 | static void vslider_draw_move(t_vslider *x, t_glist *glist) | 97 | static void vslider_draw_move(t_vslider *x, t_glist *glist) |
80 | { | 98 | { |
99 | #ifdef ROCKBOX | ||
100 | (void) x; | ||
101 | (void) glist; | ||
102 | #else /* ROCKBOX */ | ||
81 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 103 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
82 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 104 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
83 | int r = ypos + x->x_gui.x_h - (x->x_val + 50)/100; | 105 | int r = ypos + x->x_gui.x_h - (x->x_val + 50)/100; |
@@ -102,10 +124,15 @@ static void vslider_draw_move(t_vslider *x, t_glist *glist) | |||
102 | canvas, x, 0, | 124 | canvas, x, 0, |
103 | xpos, ypos-2, | 125 | xpos, ypos-2, |
104 | xpos+7, ypos-1); | 126 | xpos+7, ypos-1); |
127 | #endif /* ROCKBOX */ | ||
105 | } | 128 | } |
106 | 129 | ||
107 | static void vslider_draw_erase(t_vslider* x,t_glist* glist) | 130 | static void vslider_draw_erase(t_vslider* x,t_glist* glist) |
108 | { | 131 | { |
132 | #ifdef ROCKBOX | ||
133 | (void) x; | ||
134 | (void) glist; | ||
135 | #else /* ROCKBOX */ | ||
109 | t_canvas *canvas=glist_getcanvas(glist); | 136 | t_canvas *canvas=glist_getcanvas(glist); |
110 | 137 | ||
111 | sys_vgui(".x%x.c delete %xBASE\n", canvas, x); | 138 | sys_vgui(".x%x.c delete %xBASE\n", canvas, x); |
@@ -115,10 +142,15 @@ static void vslider_draw_erase(t_vslider* x,t_glist* glist) | |||
115 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); | 142 | sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0); |
116 | if(!x->x_gui.x_fsf.x_rcv_able) | 143 | if(!x->x_gui.x_fsf.x_rcv_able) |
117 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 144 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
145 | #endif /* ROCKBOX */ | ||
118 | } | 146 | } |
119 | 147 | ||
120 | static void vslider_draw_config(t_vslider* x,t_glist* glist) | 148 | static void vslider_draw_config(t_vslider* x,t_glist* glist) |
121 | { | 149 | { |
150 | #ifdef ROCKBOX | ||
151 | (void) x; | ||
152 | (void) glist; | ||
153 | #else /* ROCKBOX */ | ||
122 | t_canvas *canvas=glist_getcanvas(glist); | 154 | t_canvas *canvas=glist_getcanvas(glist); |
123 | 155 | ||
124 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", | 156 | sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n", |
@@ -129,10 +161,16 @@ static void vslider_draw_config(t_vslider* x,t_glist* glist) | |||
129 | x, x->x_gui.x_fcol); | 161 | x, x->x_gui.x_fcol); |
130 | sys_vgui(".x%x.c itemconfigure %xBASE -fill #%6.6x\n", canvas, | 162 | sys_vgui(".x%x.c itemconfigure %xBASE -fill #%6.6x\n", canvas, |
131 | x, x->x_gui.x_bcol); | 163 | x, x->x_gui.x_bcol); |
164 | #endif /* ROCKBOX */ | ||
132 | } | 165 | } |
133 | 166 | ||
134 | static void vslider_draw_io(t_vslider* x,t_glist* glist, int old_snd_rcv_flags) | 167 | static void vslider_draw_io(t_vslider* x,t_glist* glist, int old_snd_rcv_flags) |
135 | { | 168 | { |
169 | #ifdef ROCKBOX | ||
170 | (void) x; | ||
171 | (void) glist; | ||
172 | (void) old_snd_rcv_flags; | ||
173 | #else /* ROCKBOX */ | ||
136 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 174 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
137 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 175 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
138 | t_canvas *canvas=glist_getcanvas(glist); | 176 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -153,10 +191,15 @@ static void vslider_draw_io(t_vslider* x,t_glist* glist, int old_snd_rcv_flags) | |||
153 | x, 0); | 191 | x, 0); |
154 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) | 192 | if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able) |
155 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 193 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
194 | #endif /* ROCKBOX */ | ||
156 | } | 195 | } |
157 | 196 | ||
158 | static void vslider_draw_select(t_vslider *x, t_glist *glist) | 197 | static void vslider_draw_select(t_vslider *x, t_glist *glist) |
159 | { | 198 | { |
199 | #ifdef ROCKBOX | ||
200 | (void) x; | ||
201 | (void) glist; | ||
202 | #else /* ROCKBOX */ | ||
160 | t_canvas *canvas=glist_getcanvas(glist); | 203 | t_canvas *canvas=glist_getcanvas(glist); |
161 | 204 | ||
162 | if(x->x_gui.x_fsf.x_selected) | 205 | if(x->x_gui.x_fsf.x_selected) |
@@ -169,6 +212,7 @@ static void vslider_draw_select(t_vslider *x, t_glist *glist) | |||
169 | sys_vgui(".x%x.c itemconfigure %xBASE -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL); | 212 | sys_vgui(".x%x.c itemconfigure %xBASE -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL); |
170 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol); | 213 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol); |
171 | } | 214 | } |
215 | #endif /* ROCKBOX */ | ||
172 | } | 216 | } |
173 | 217 | ||
174 | void vslider_draw(t_vslider *x, t_glist *glist, int mode) | 218 | void vslider_draw(t_vslider *x, t_glist *glist, int mode) |
@@ -270,6 +314,10 @@ void vslider_check_minmax(t_vslider *x, double min, double max) | |||
270 | 314 | ||
271 | static void vslider_properties(t_gobj *z, t_glist *owner) | 315 | static void vslider_properties(t_gobj *z, t_glist *owner) |
272 | { | 316 | { |
317 | #ifdef ROCKBOX | ||
318 | (void) z; | ||
319 | (void) owner; | ||
320 | #else /* ROCKBOX */ | ||
273 | t_vslider *x = (t_vslider *)z; | 321 | t_vslider *x = (t_vslider *)z; |
274 | char buf[800]; | 322 | char buf[800]; |
275 | t_symbol *srl[3]; | 323 | t_symbol *srl[3]; |
@@ -292,6 +340,7 @@ static void vslider_properties(t_gobj *z, t_glist *owner) | |||
292 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, | 340 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, |
293 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol); | 341 | 0xffffff & x->x_gui.x_bcol, 0xffffff & x->x_gui.x_fcol, 0xffffff & x->x_gui.x_lcol); |
294 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); | 342 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); |
343 | #endif | ||
295 | } | 344 | } |
296 | 345 | ||
297 | static void vslider_bang(t_vslider *x) | 346 | static void vslider_bang(t_vslider *x) |
@@ -321,6 +370,10 @@ static void vslider_dialog(t_vslider *x, t_symbol *s, int argc, t_atom *argv) | |||
321 | int steady = (int)atom_getintarg(17, argc, argv); | 370 | int steady = (int)atom_getintarg(17, argc, argv); |
322 | int sr_flags; | 371 | int sr_flags; |
323 | 372 | ||
373 | #ifdef ROCKBOX | ||
374 | (void) s; | ||
375 | #endif | ||
376 | |||
324 | if(lilo != 0) lilo = 1; | 377 | if(lilo != 0) lilo = 1; |
325 | x->x_lin0_log1 = lilo; | 378 | x->x_lin0_log1 = lilo; |
326 | if(steady) | 379 | if(steady) |
@@ -341,6 +394,10 @@ static void vslider_motion(t_vslider *x, t_floatarg dx, t_floatarg dy) | |||
341 | { | 394 | { |
342 | int old = x->x_val; | 395 | int old = x->x_val; |
343 | 396 | ||
397 | #ifdef ROCKBOX | ||
398 | (void) dx; | ||
399 | #endif | ||
400 | |||
344 | if(x->x_gui.x_fsf.x_finemoved) | 401 | if(x->x_gui.x_fsf.x_finemoved) |
345 | x->x_pos -= (int)dy; | 402 | x->x_pos -= (int)dy; |
346 | else | 403 | else |
@@ -368,6 +425,11 @@ static void vslider_motion(t_vslider *x, t_floatarg dx, t_floatarg dy) | |||
368 | static void vslider_click(t_vslider *x, t_floatarg xpos, t_floatarg ypos, | 425 | static void vslider_click(t_vslider *x, t_floatarg xpos, t_floatarg ypos, |
369 | t_floatarg shift, t_floatarg ctrl, t_floatarg alt) | 426 | t_floatarg shift, t_floatarg ctrl, t_floatarg alt) |
370 | { | 427 | { |
428 | #ifdef ROCKBOX | ||
429 | (void) shift; | ||
430 | (void) ctrl; | ||
431 | (void) alt; | ||
432 | #endif | ||
371 | if(!x->x_steady) | 433 | if(!x->x_steady) |
372 | x->x_val = (int)(100.0 * (x->x_gui.x_h + text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist) - ypos)); | 434 | x->x_val = (int)(100.0 * (x->x_gui.x_h + text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist) - ypos)); |
373 | if(x->x_val > (100*x->x_gui.x_h - 100)) | 435 | if(x->x_val > (100*x->x_gui.x_h - 100)) |
@@ -386,6 +448,11 @@ static int vslider_newclick(t_gobj *z, struct _glist *glist, | |||
386 | { | 448 | { |
387 | t_vslider* x = (t_vslider *)z; | 449 | t_vslider* x = (t_vslider *)z; |
388 | 450 | ||
451 | #ifdef ROCKBOX | ||
452 | (void) glist; | ||
453 | (void) dbl; | ||
454 | #endif | ||
455 | |||
389 | if(doit) | 456 | if(doit) |
390 | { | 457 | { |
391 | vslider_click( x, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, | 458 | vslider_click( x, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, |
@@ -434,6 +501,9 @@ static void vslider_float(t_vslider *x, t_floatarg f) | |||
434 | 501 | ||
435 | static void vslider_size(t_vslider *x, t_symbol *s, int ac, t_atom *av) | 502 | static void vslider_size(t_vslider *x, t_symbol *s, int ac, t_atom *av) |
436 | { | 503 | { |
504 | #ifdef ROCKBOX | ||
505 | (void) s; | ||
506 | #endif | ||
437 | x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); | 507 | x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); |
438 | if(ac > 1) | 508 | if(ac > 1) |
439 | vslider_check_height(x, (int)atom_getintarg(1, ac, av)); | 509 | vslider_check_height(x, (int)atom_getintarg(1, ac, av)); |
@@ -448,6 +518,9 @@ static void vslider_pos(t_vslider *x, t_symbol *s, int ac, t_atom *av) | |||
448 | 518 | ||
449 | static void vslider_range(t_vslider *x, t_symbol *s, int ac, t_atom *av) | 519 | static void vslider_range(t_vslider *x, t_symbol *s, int ac, t_atom *av) |
450 | { | 520 | { |
521 | #ifdef ROCKBOX | ||
522 | (void) s; | ||
523 | #endif | ||
451 | vslider_check_minmax(x, (double)atom_getfloatarg(0, ac, av), | 524 | vslider_check_minmax(x, (double)atom_getfloatarg(0, ac, av), |
452 | (double)atom_getfloatarg(1, ac, av)); | 525 | (double)atom_getfloatarg(1, ac, av)); |
453 | } | 526 | } |
@@ -506,10 +579,20 @@ static void *vslider_new(t_symbol *s, int argc, t_atom *argv) | |||
506 | t_vslider *x = (t_vslider *)pd_new(vslider_class); | 579 | t_vslider *x = (t_vslider *)pd_new(vslider_class); |
507 | int bflcol[]={-262144, -1, -1}; | 580 | int bflcol[]={-262144, -1, -1}; |
508 | int w=IEM_GUI_DEFAULTSIZE, h=IEM_SL_DEFAULTSIZE; | 581 | int w=IEM_GUI_DEFAULTSIZE, h=IEM_SL_DEFAULTSIZE; |
582 | #ifdef ROCKBOX | ||
583 | int lilo=0, ldx=0, ldy=-8; | ||
584 | #else | ||
509 | int lilo=0, f=0, ldx=0, ldy=-8; | 585 | int lilo=0, f=0, ldx=0, ldy=-8; |
586 | #endif | ||
510 | int fs=8, v=0, steady=1; | 587 | int fs=8, v=0, steady=1; |
511 | double min=0.0, max=(double)(IEM_SL_DEFAULTSIZE-1); | 588 | double min=0.0, max=(double)(IEM_SL_DEFAULTSIZE-1); |
589 | #ifndef ROCKBOX | ||
512 | char str[144]; | 590 | char str[144]; |
591 | #endif | ||
592 | |||
593 | #ifdef ROCKBOX | ||
594 | (void) s; | ||
595 | #endif | ||
513 | 596 | ||
514 | iem_inttosymargs(&x->x_gui.x_isa, 0); | 597 | iem_inttosymargs(&x->x_gui.x_isa, 0); |
515 | iem_inttofstyle(&x->x_gui.x_fsf, 0); | 598 | iem_inttofstyle(&x->x_gui.x_fsf, 0); |
@@ -581,7 +664,9 @@ static void vslider_free(t_vslider *x) | |||
581 | { | 664 | { |
582 | if(x->x_gui.x_fsf.x_rcv_able) | 665 | if(x->x_gui.x_fsf.x_rcv_able) |
583 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); | 666 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); |
667 | #ifndef ROCKBOX | ||
584 | gfxstub_deleteforkey(x); | 668 | gfxstub_deleteforkey(x); |
669 | #endif | ||
585 | } | 670 | } |
586 | 671 | ||
587 | void g_vslider_setup(void) | 672 | void g_vslider_setup(void) |
diff --git a/apps/plugins/pdbox/PDa/src/g_vumeter.c b/apps/plugins/pdbox/PDa/src/g_vumeter.c index fb3a8fafa4..2c43fbd120 100644 --- a/apps/plugins/pdbox/PDa/src/g_vumeter.c +++ b/apps/plugins/pdbox/PDa/src/g_vumeter.c | |||
@@ -5,7 +5,13 @@ | |||
5 | /* g_7_guis.c written by Thomas Musil (c) IEM KUG Graz Austria 2000-2001 */ | 5 | /* g_7_guis.c written by Thomas Musil (c) IEM KUG Graz Austria 2000-2001 */ |
6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ | 6 | /* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */ |
7 | 7 | ||
8 | 8 | #ifdef ROCKBOX | |
9 | #include "plugin.h" | ||
10 | #include "pdbox.h" | ||
11 | #include "m_pd.h" | ||
12 | #include "g_canvas.h" | ||
13 | #include "g_all_guis.h" | ||
14 | #else /* ROCKBOX */ | ||
9 | #include <stdlib.h> | 15 | #include <stdlib.h> |
10 | #include <string.h> | 16 | #include <string.h> |
11 | #include <stdio.h> | 17 | #include <stdio.h> |
@@ -21,6 +27,7 @@ | |||
21 | #else | 27 | #else |
22 | #include <unistd.h> | 28 | #include <unistd.h> |
23 | #endif | 29 | #endif |
30 | #endif /* ROCKBOX */ | ||
24 | 31 | ||
25 | /* ----- vu gui-peak- & rms- vu-meter-display ---------- */ | 32 | /* ----- vu gui-peak- & rms- vu-meter-display ---------- */ |
26 | 33 | ||
@@ -31,6 +38,10 @@ static t_class *vu_class; | |||
31 | 38 | ||
32 | static void vu_update_rms(t_vu *x, t_glist *glist) | 39 | static void vu_update_rms(t_vu *x, t_glist *glist) |
33 | { | 40 | { |
41 | #ifdef ROCKBOX | ||
42 | (void) x; | ||
43 | (void) glist; | ||
44 | #else /* ROCKBOX */ | ||
34 | if(glist_isvisible(glist)) | 45 | if(glist_isvisible(glist)) |
35 | { | 46 | { |
36 | int w4=x->x_gui.x_w/4, off=text_ypix(&x->x_gui.x_obj, glist)-1; | 47 | int w4=x->x_gui.x_w/4, off=text_ypix(&x->x_gui.x_obj, glist)-1; |
@@ -40,10 +51,15 @@ static void vu_update_rms(t_vu *x, t_glist *glist) | |||
40 | glist_getcanvas(glist), x, quad1, off, quad3, | 51 | glist_getcanvas(glist), x, quad1, off, quad3, |
41 | off + (x->x_led_size+1)*(IEM_VU_STEPS-x->x_rms)); | 52 | off + (x->x_led_size+1)*(IEM_VU_STEPS-x->x_rms)); |
42 | } | 53 | } |
54 | #endif /* ROCKBOX */ | ||
43 | } | 55 | } |
44 | 56 | ||
45 | static void vu_update_peak(t_vu *x, t_glist *glist) | 57 | static void vu_update_peak(t_vu *x, t_glist *glist) |
46 | { | 58 | { |
59 | #ifdef ROCKBOX | ||
60 | (void) x; | ||
61 | (void) glist; | ||
62 | #else /* ROCKBOX */ | ||
47 | t_canvas *canvas=glist_getcanvas(glist); | 63 | t_canvas *canvas=glist_getcanvas(glist); |
48 | 64 | ||
49 | if(glist_isvisible(glist)) | 65 | if(glist_isvisible(glist)) |
@@ -74,10 +90,15 @@ static void vu_update_peak(t_vu *x, t_glist *glist) | |||
74 | mid, ypos+20); | 90 | mid, ypos+20); |
75 | } | 91 | } |
76 | } | 92 | } |
93 | #endif /* ROCKBOX */ | ||
77 | } | 94 | } |
78 | 95 | ||
79 | static void vu_draw_new(t_vu *x, t_glist *glist) | 96 | static void vu_draw_new(t_vu *x, t_glist *glist) |
80 | { | 97 | { |
98 | #ifdef ROCKBOX | ||
99 | (void) x; | ||
100 | (void) glist; | ||
101 | #else /* ROCKBOX */ | ||
81 | t_canvas *canvas=glist_getcanvas(glist); | 102 | t_canvas *canvas=glist_getcanvas(glist); |
82 | 103 | ||
83 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 104 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
@@ -151,11 +172,16 @@ static void vu_draw_new(t_vu *x, t_glist *glist) | |||
151 | xpos+x->x_gui.x_w+1, ypos-1, | 172 | xpos+x->x_gui.x_w+1, ypos-1, |
152 | x, 1); | 173 | x, 1); |
153 | } | 174 | } |
175 | #endif /* ROCKBOX */ | ||
154 | } | 176 | } |
155 | 177 | ||
156 | 178 | ||
157 | static void vu_draw_move(t_vu *x, t_glist *glist) | 179 | static void vu_draw_move(t_vu *x, t_glist *glist) |
158 | { | 180 | { |
181 | #ifdef ROCKBOX | ||
182 | (void) x; | ||
183 | (void) glist; | ||
184 | #else /* ROCKBOX */ | ||
159 | t_canvas *canvas=glist_getcanvas(glist); | 185 | t_canvas *canvas=glist_getcanvas(glist); |
160 | 186 | ||
161 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 187 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
@@ -212,10 +238,15 @@ static void vu_draw_move(t_vu *x, t_glist *glist) | |||
212 | xpos+x->x_gui.x_w+1-IOWIDTH, ypos-2, | 238 | xpos+x->x_gui.x_w+1-IOWIDTH, ypos-2, |
213 | xpos+x->x_gui.x_w+1, ypos-1); | 239 | xpos+x->x_gui.x_w+1, ypos-1); |
214 | } | 240 | } |
241 | #endif /* ROCKBOX */ | ||
215 | } | 242 | } |
216 | 243 | ||
217 | static void vu_draw_erase(t_vu* x,t_glist* glist) | 244 | static void vu_draw_erase(t_vu* x,t_glist* glist) |
218 | { | 245 | { |
246 | #ifdef ROCKBOX | ||
247 | (void) x; | ||
248 | (void) glist; | ||
249 | #else /* ROCKBOX */ | ||
219 | int i; | 250 | int i; |
220 | t_canvas *canvas=glist_getcanvas(glist); | 251 | t_canvas *canvas=glist_getcanvas(glist); |
221 | 252 | ||
@@ -244,10 +275,15 @@ static void vu_draw_erase(t_vu* x,t_glist* glist) | |||
244 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 275 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
245 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 1); | 276 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 1); |
246 | } | 277 | } |
278 | #endif /* ROCKBOX */ | ||
247 | } | 279 | } |
248 | 280 | ||
249 | static void vu_draw_config(t_vu* x, t_glist* glist) | 281 | static void vu_draw_config(t_vu* x, t_glist* glist) |
250 | { | 282 | { |
283 | #ifdef ROCKBOX | ||
284 | (void) x; | ||
285 | (void) glist; | ||
286 | #else /* ROCKBOX */ | ||
251 | int i; | 287 | int i; |
252 | t_canvas *canvas=glist_getcanvas(glist); | 288 | t_canvas *canvas=glist_getcanvas(glist); |
253 | 289 | ||
@@ -277,10 +313,16 @@ static void vu_draw_config(t_vu* x, t_glist* glist) | |||
277 | x, x->x_gui.x_bcol, x->x_gui.x_bcol); | 313 | x, x->x_gui.x_bcol, x->x_gui.x_bcol); |
278 | sys_vgui(".x%x.c itemconfigure %xPLED -width %d\n", canvas, x, | 314 | sys_vgui(".x%x.c itemconfigure %xPLED -width %d\n", canvas, x, |
279 | x->x_led_size); | 315 | x->x_led_size); |
316 | #endif /* ROCKBOX */ | ||
280 | } | 317 | } |
281 | 318 | ||
282 | static void vu_draw_io(t_vu* x, t_glist* glist, int old_snd_rcv_flags) | 319 | static void vu_draw_io(t_vu* x, t_glist* glist, int old_snd_rcv_flags) |
283 | { | 320 | { |
321 | #ifdef ROCKBOX | ||
322 | (void) x; | ||
323 | (void) glist; | ||
324 | (void) old_snd_rcv_flags; | ||
325 | #else /* ROCKBOX */ | ||
284 | int xpos=text_xpix(&x->x_gui.x_obj, glist); | 326 | int xpos=text_xpix(&x->x_gui.x_obj, glist); |
285 | int ypos=text_ypix(&x->x_gui.x_obj, glist); | 327 | int ypos=text_ypix(&x->x_gui.x_obj, glist); |
286 | t_canvas *canvas=glist_getcanvas(glist); | 328 | t_canvas *canvas=glist_getcanvas(glist); |
@@ -321,10 +363,15 @@ static void vu_draw_io(t_vu* x, t_glist* glist, int old_snd_rcv_flags) | |||
321 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); | 363 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0); |
322 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 1); | 364 | sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 1); |
323 | } | 365 | } |
366 | #endif /* ROCKBOX */ | ||
324 | } | 367 | } |
325 | 368 | ||
326 | static void vu_draw_select(t_vu* x,t_glist* glist) | 369 | static void vu_draw_select(t_vu* x,t_glist* glist) |
327 | { | 370 | { |
371 | #ifdef ROCKBOX | ||
372 | (void) x; | ||
373 | (void) glist; | ||
374 | #else /* ROCKBOX */ | ||
328 | int i; | 375 | int i; |
329 | t_canvas *canvas=glist_getcanvas(glist); | 376 | t_canvas *canvas=glist_getcanvas(glist); |
330 | 377 | ||
@@ -362,6 +409,7 @@ static void vu_draw_select(t_vu* x,t_glist* glist) | |||
362 | } | 409 | } |
363 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol); | 410 | sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol); |
364 | } | 411 | } |
412 | #endif /* ROCKBOX */ | ||
365 | } | 413 | } |
366 | 414 | ||
367 | void vu_draw(t_vu *x, t_glist *glist, int mode) | 415 | void vu_draw(t_vu *x, t_glist *glist, int mode) |
@@ -425,6 +473,10 @@ void vu_check_height(t_vu *x, int h) | |||
425 | 473 | ||
426 | static void vu_scale(t_vu *x, t_floatarg fscale) | 474 | static void vu_scale(t_vu *x, t_floatarg fscale) |
427 | { | 475 | { |
476 | #ifdef ROCKBOX | ||
477 | (void) x; | ||
478 | (void) fscale; | ||
479 | #else /* ROCKBOX */ | ||
428 | int i, scale = (int)fscale; | 480 | int i, scale = (int)fscale; |
429 | 481 | ||
430 | if(scale != 0) scale = 1; | 482 | if(scale != 0) scale = 1; |
@@ -446,7 +498,11 @@ static void vu_scale(t_vu *x, t_floatarg fscale) | |||
446 | } | 498 | } |
447 | if(!x->x_scale && scale) | 499 | if(!x->x_scale && scale) |
448 | { | 500 | { |
501 | #ifdef ROCKBOX | ||
502 | int end=text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist)+x->x_gui.x_w+4; | ||
503 | #else /* ROCKBOX */ | ||
449 | int w4=x->x_gui.x_w/4, end=text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist)+x->x_gui.x_w+4; | 504 | int w4=x->x_gui.x_w/4, end=text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist)+x->x_gui.x_w+4; |
505 | #endif /* ROCKBOX */ | ||
450 | int k1=x->x_led_size+1, k2=IEM_VU_STEPS+1, k3=k1/2; | 506 | int k1=x->x_led_size+1, k2=IEM_VU_STEPS+1, k3=k1/2; |
451 | int yyy, k4=text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist)-k3; | 507 | int yyy, k4=text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist)-k3; |
452 | t_canvas *canvas=glist_getcanvas(x->x_gui.x_glist); | 508 | t_canvas *canvas=glist_getcanvas(x->x_gui.x_glist); |
@@ -471,10 +527,15 @@ static void vu_scale(t_vu *x, t_floatarg fscale) | |||
471 | x->x_gui.x_lcol, x, i); | 527 | x->x_gui.x_lcol, x, i); |
472 | } | 528 | } |
473 | } | 529 | } |
530 | #endif /* ROCKBOX */ | ||
474 | } | 531 | } |
475 | 532 | ||
476 | static void vu_properties(t_gobj *z, t_glist *owner) | 533 | static void vu_properties(t_gobj *z, t_glist *owner) |
477 | { | 534 | { |
535 | #ifdef ROCKBOX | ||
536 | (void) z; | ||
537 | (void) owner; | ||
538 | #else /* ROCKBOX */ | ||
478 | t_vu *x = (t_vu *)z; | 539 | t_vu *x = (t_vu *)z; |
479 | char buf[800]; | 540 | char buf[800]; |
480 | t_symbol *srl[3]; | 541 | t_symbol *srl[3]; |
@@ -496,6 +557,7 @@ static void vu_properties(t_gobj *z, t_glist *owner) | |||
496 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, | 557 | x->x_gui.x_fsf.x_font_style, x->x_gui.x_fontsize, |
497 | 0xffffff & x->x_gui.x_bcol, -1/*no front-color*/, 0xffffff & x->x_gui.x_lcol); | 558 | 0xffffff & x->x_gui.x_bcol, -1/*no front-color*/, 0xffffff & x->x_gui.x_lcol); |
498 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); | 559 | gfxstub_new(&x->x_gui.x_obj.ob_pd, x, buf); |
560 | #endif /* ROCKBOX */ | ||
499 | } | 561 | } |
500 | 562 | ||
501 | static void vu_dialog(t_vu *x, t_symbol *s, int argc, t_atom *argv) | 563 | static void vu_dialog(t_vu *x, t_symbol *s, int argc, t_atom *argv) |
@@ -506,6 +568,10 @@ static void vu_dialog(t_vu *x, t_symbol *s, int argc, t_atom *argv) | |||
506 | int scale = (int)atom_getintarg(4, argc, argv); | 568 | int scale = (int)atom_getintarg(4, argc, argv); |
507 | int sr_flags; | 569 | int sr_flags; |
508 | 570 | ||
571 | #ifdef ROCKBOX | ||
572 | (void) s; | ||
573 | #endif | ||
574 | |||
509 | srl[0] = gensym("empty"); | 575 | srl[0] = gensym("empty"); |
510 | sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); | 576 | sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); |
511 | x->x_gui.x_fsf.x_snd_able = 0; | 577 | x->x_gui.x_fsf.x_snd_able = 0; |
@@ -523,6 +589,9 @@ static void vu_dialog(t_vu *x, t_symbol *s, int argc, t_atom *argv) | |||
523 | 589 | ||
524 | static void vu_size(t_vu *x, t_symbol *s, int ac, t_atom *av) | 590 | static void vu_size(t_vu *x, t_symbol *s, int ac, t_atom *av) |
525 | { | 591 | { |
592 | #ifdef ROCKBOX | ||
593 | (void) s; | ||
594 | #endif | ||
526 | x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); | 595 | x->x_gui.x_w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); |
527 | if(ac > 1) | 596 | if(ac > 1) |
528 | vu_check_height(x, (int)atom_getintarg(1, ac, av)); | 597 | vu_check_height(x, (int)atom_getintarg(1, ac, av)); |
@@ -608,9 +677,14 @@ static void *vu_new(t_symbol *s, int argc, t_atom *argv) | |||
608 | t_vu *x = (t_vu *)pd_new(vu_class); | 677 | t_vu *x = (t_vu *)pd_new(vu_class); |
609 | int bflcol[]={-66577, -1, -1}; | 678 | int bflcol[]={-66577, -1, -1}; |
610 | int w=IEM_GUI_DEFAULTSIZE, h=IEM_VU_STEPS*IEM_VU_DEFAULTSIZE; | 679 | int w=IEM_GUI_DEFAULTSIZE, h=IEM_VU_STEPS*IEM_VU_DEFAULTSIZE; |
680 | #ifdef ROCKBOX | ||
681 | int ldx=-1, ldy=-8, fs=8, scale=1; | ||
682 | (void) s; | ||
683 | #else /* ROCKBOX */ | ||
611 | int ldx=-1, ldy=-8, f=0, fs=8, scale=1; | 684 | int ldx=-1, ldy=-8, f=0, fs=8, scale=1; |
612 | int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, fthold=IEM_BNG_DEFAULTHOLDFLASHTIME; | 685 | int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, fthold=IEM_BNG_DEFAULTHOLDFLASHTIME; |
613 | char str[144]; | 686 | char str[144]; |
687 | #endif /* ROCKBOX */ | ||
614 | 688 | ||
615 | iem_inttosymargs(&x->x_gui.x_isa, 0); | 689 | iem_inttosymargs(&x->x_gui.x_isa, 0); |
616 | iem_inttofstyle(&x->x_gui.x_fsf, 0); | 690 | iem_inttofstyle(&x->x_gui.x_fsf, 0); |
@@ -678,7 +752,9 @@ static void vu_free(t_vu *x) | |||
678 | { | 752 | { |
679 | if(x->x_gui.x_fsf.x_rcv_able) | 753 | if(x->x_gui.x_fsf.x_rcv_able) |
680 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); | 754 | pd_unbind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); |
755 | #ifndef ROCKBOX | ||
681 | gfxstub_deleteforkey(x); | 756 | gfxstub_deleteforkey(x); |
757 | #endif | ||
682 | } | 758 | } |
683 | 759 | ||
684 | void g_vumeter_setup(void) | 760 | void g_vumeter_setup(void) |
diff --git a/apps/plugins/pdbox/PDa/src/m_atom.c b/apps/plugins/pdbox/PDa/src/m_atom.c index f2ed3a0b65..4d30c1b3de 100644 --- a/apps/plugins/pdbox/PDa/src/m_atom.c +++ b/apps/plugins/pdbox/PDa/src/m_atom.c | |||
@@ -3,8 +3,14 @@ | |||
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | 3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ |
4 | 4 | ||
5 | #include "m_pd.h" | 5 | #include "m_pd.h" |
6 | |||
7 | #ifdef ROCKBOX | ||
8 | #include "plugin.h" | ||
9 | #include "pdbox.h" | ||
10 | #else /* ROCKBOX */ | ||
6 | #include <stdio.h> | 11 | #include <stdio.h> |
7 | #include <string.h> | 12 | #include <string.h> |
13 | #endif /* ROCKBOX */ | ||
8 | 14 | ||
9 | /* convenience routines for checking and getting values of | 15 | /* convenience routines for checking and getting values of |
10 | atoms. There's no "pointer" version since there's nothing | 16 | atoms. There's no "pointer" version since there's nothing |
@@ -23,7 +29,9 @@ t_int atom_getint(t_atom *a) | |||
23 | 29 | ||
24 | t_symbol *atom_getsymbol(t_atom *a) /* LATER think about this more carefully */ | 30 | t_symbol *atom_getsymbol(t_atom *a) /* LATER think about this more carefully */ |
25 | { | 31 | { |
32 | #ifndef ROCKBOX | ||
26 | char buf[30]; | 33 | char buf[30]; |
34 | #endif | ||
27 | if (a->a_type == A_SYMBOL) return (a->a_w.w_symbol); | 35 | if (a->a_type == A_SYMBOL) return (a->a_w.w_symbol); |
28 | else return (&s_float); | 36 | else return (&s_float); |
29 | } | 37 | } |
@@ -33,7 +41,11 @@ t_symbol *atom_gensym(t_atom *a) /* this works better for graph labels */ | |||
33 | char buf[30]; | 41 | char buf[30]; |
34 | if (a->a_type == A_SYMBOL) return (a->a_w.w_symbol); | 42 | if (a->a_type == A_SYMBOL) return (a->a_w.w_symbol); |
35 | else if (a->a_type == A_FLOAT) | 43 | else if (a->a_type == A_FLOAT) |
44 | #ifdef ROCKBOX | ||
45 | ftoan(a->a_w.w_float, buf, sizeof(buf)-1); | ||
46 | #else | ||
36 | sprintf(buf, "%g", a->a_w.w_float); | 47 | sprintf(buf, "%g", a->a_w.w_float); |
48 | #endif | ||
37 | else strcpy(buf, "???"); | 49 | else strcpy(buf, "???"); |
38 | return (gensym(buf)); | 50 | return (gensym(buf)); |
39 | } | 51 | } |
@@ -76,7 +88,11 @@ void atom_string(t_atom *a, char *buf, unsigned int bufsize) | |||
76 | strcpy(buf, "(pointer)"); | 88 | strcpy(buf, "(pointer)"); |
77 | break; | 89 | break; |
78 | case A_FLOAT: | 90 | case A_FLOAT: |
91 | #ifdef ROCKBOX | ||
92 | ftoan(a->a_w.w_float, tbuf, sizeof(tbuf)-1); | ||
93 | #else | ||
79 | sprintf(tbuf, "%g", a->a_w.w_float); | 94 | sprintf(tbuf, "%g", a->a_w.w_float); |
95 | #endif | ||
80 | if (strlen(tbuf) < bufsize-1) strcpy(buf, tbuf); | 96 | if (strlen(tbuf) < bufsize-1) strcpy(buf, tbuf); |
81 | else if (a->a_w.w_float < 0) strcpy(buf, "-"); | 97 | else if (a->a_w.w_float < 0) strcpy(buf, "-"); |
82 | else strcat(buf, "+"); | 98 | else strcat(buf, "+"); |
@@ -118,10 +134,10 @@ void atom_string(t_atom *a, char *buf, unsigned int bufsize) | |||
118 | } | 134 | } |
119 | break; | 135 | break; |
120 | case A_DOLLAR: | 136 | case A_DOLLAR: |
121 | sprintf(buf, "$%d", a->a_w.w_index); | 137 | snprintf(buf, bufsize-1, "$%d", a->a_w.w_index); |
122 | break; | 138 | break; |
123 | case A_DOLLSYM: | 139 | case A_DOLLSYM: |
124 | sprintf(buf, "$%s", a->a_w.w_symbol->s_name); | 140 | snprintf(buf, bufsize-1, "$%s", a->a_w.w_symbol->s_name); |
125 | break; | 141 | break; |
126 | default: | 142 | default: |
127 | bug("atom_string"); | 143 | bug("atom_string"); |
diff --git a/apps/plugins/pdbox/PDa/src/m_binbuf.c b/apps/plugins/pdbox/PDa/src/m_binbuf.c index 03a560db7b..224d269559 100644 --- a/apps/plugins/pdbox/PDa/src/m_binbuf.c +++ b/apps/plugins/pdbox/PDa/src/m_binbuf.c | |||
@@ -10,9 +10,15 @@ | |||
10 | * change marked with IOhannes | 10 | * change marked with IOhannes |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifdef ROCKBOX | ||
14 | #include "plugin.h" | ||
15 | #include "pdbox.h" | ||
16 | #ifdef SIMULATOR | ||
17 | int printf(const char *fmt, ...); | ||
18 | void perror(const char*); | ||
19 | #endif | ||
20 | #else /* ROCKBOX */ | ||
13 | #include <stdlib.h> | 21 | #include <stdlib.h> |
14 | #include "m_pd.h" | ||
15 | #include "s_stuff.h" | ||
16 | #include <stdio.h> | 22 | #include <stdio.h> |
17 | #ifdef UNIX | 23 | #ifdef UNIX |
18 | #include <unistd.h> | 24 | #include <unistd.h> |
@@ -21,8 +27,13 @@ | |||
21 | #include <io.h> | 27 | #include <io.h> |
22 | #endif | 28 | #endif |
23 | #include <fcntl.h> | 29 | #include <fcntl.h> |
30 | |||
24 | #include <string.h> | 31 | #include <string.h> |
25 | #include <stdarg.h> | 32 | #include <stdarg.h> |
33 | #endif /* ROCKBOX */ | ||
34 | |||
35 | #include "m_pd.h" | ||
36 | #include "s_stuff.h" | ||
26 | 37 | ||
27 | struct _binbuf | 38 | struct _binbuf |
28 | { | 39 | { |
@@ -72,7 +83,9 @@ void binbuf_text(t_binbuf *x, char *text, size_t size) | |||
72 | x->b_n = 0; | 83 | x->b_n = 0; |
73 | while (1) | 84 | while (1) |
74 | { | 85 | { |
86 | #ifndef ROCKBOX | ||
75 | int type; | 87 | int type; |
88 | #endif | ||
76 | /* skip leading space */ | 89 | /* skip leading space */ |
77 | while ((textp != etext) && (*textp == ' ' || *textp == '\n' | 90 | while ((textp != etext) && (*textp == ' ' || *textp == '\n' |
78 | || *textp == '\r' || *textp == '\t')) textp++; | 91 | || *textp == '\r' || *textp == '\t')) textp++; |
@@ -158,6 +171,7 @@ void binbuf_text(t_binbuf *x, char *text, size_t size) | |||
158 | #if 0 | 171 | #if 0 |
159 | post("buf %s", buf); | 172 | post("buf %s", buf); |
160 | #endif | 173 | #endif |
174 | |||
161 | if (*buf == '$' && buf[1] >= '0' && buf[1] <= '9' && !firstslash) | 175 | if (*buf == '$' && buf[1] >= '0' && buf[1] <= '9' && !firstslash) |
162 | { | 176 | { |
163 | for (bufp = buf+2; *bufp; bufp++) | 177 | for (bufp = buf+2; *bufp; bufp++) |
@@ -219,7 +233,7 @@ void binbuf_gettext(t_binbuf *x, char **bufp, int *lengthp) | |||
219 | } | 233 | } |
220 | if (length && buf[length-1] == ' ') | 234 | if (length && buf[length-1] == ' ') |
221 | { | 235 | { |
222 | if (newbuf = t_resizebytes(buf, length, length-1)) | 236 | if((newbuf = t_resizebytes(buf, length, length-1))) |
223 | { | 237 | { |
224 | buf = newbuf; | 238 | buf = newbuf; |
225 | length--; | 239 | length--; |
@@ -236,8 +250,8 @@ void binbuf_add(t_binbuf *x, int argc, t_atom *argv) | |||
236 | { | 250 | { |
237 | int newsize = x->b_n + argc, i; | 251 | int newsize = x->b_n + argc, i; |
238 | t_atom *ap; | 252 | t_atom *ap; |
239 | if (ap = t_resizebytes(x->b_vec, x->b_n * sizeof(*x->b_vec), | 253 | if((ap = t_resizebytes(x->b_vec, x->b_n * sizeof(*x->b_vec), |
240 | newsize * sizeof(*x->b_vec))) | 254 | newsize * sizeof(*x->b_vec)))) |
241 | x->b_vec = ap; | 255 | x->b_vec = ap; |
242 | else | 256 | else |
243 | { | 257 | { |
@@ -310,11 +324,19 @@ void binbuf_addbinbuf(t_binbuf *x, t_binbuf *y) | |||
310 | SETSYMBOL(ap, gensym(",")); | 324 | SETSYMBOL(ap, gensym(",")); |
311 | break; | 325 | break; |
312 | case A_DOLLAR: | 326 | case A_DOLLAR: |
327 | #ifdef ROCKBOX | ||
328 | snprintf(tbuf, sizeof(tbuf)-1, "$%d", ap->a_w.w_index); | ||
329 | #else /* ROCKBOX */ | ||
313 | sprintf(tbuf, "$%d", ap->a_w.w_index); | 330 | sprintf(tbuf, "$%d", ap->a_w.w_index); |
331 | #endif /* ROCKBOX */ | ||
314 | SETSYMBOL(ap, gensym(tbuf)); | 332 | SETSYMBOL(ap, gensym(tbuf)); |
315 | break; | 333 | break; |
316 | case A_DOLLSYM: | 334 | case A_DOLLSYM: |
335 | #ifdef ROCKBOX | ||
336 | snprintf(tbuf, sizeof(tbuf)-1, "$%s", ap->a_w.w_symbol->s_name); | ||
337 | #else /* ROCKBOX */ | ||
317 | sprintf(tbuf, "$%s", ap->a_w.w_symbol->s_name); | 338 | sprintf(tbuf, "$%s", ap->a_w.w_symbol->s_name); |
339 | #endif /* ROCKBOX */ | ||
318 | SETSYMBOL(ap, gensym(tbuf)); | 340 | SETSYMBOL(ap, gensym(tbuf)); |
319 | break; | 341 | break; |
320 | case A_SYMBOL: | 342 | case A_SYMBOL: |
@@ -346,8 +368,8 @@ void binbuf_restore(t_binbuf *x, int argc, t_atom *argv) | |||
346 | { | 368 | { |
347 | int newsize = x->b_n + argc, i; | 369 | int newsize = x->b_n + argc, i; |
348 | t_atom *ap; | 370 | t_atom *ap; |
349 | if (ap = t_resizebytes(x->b_vec, x->b_n * sizeof(*x->b_vec), | 371 | if((ap = t_resizebytes(x->b_vec, x->b_n * sizeof(*x->b_vec), |
350 | newsize * sizeof(*x->b_vec))) | 372 | newsize * sizeof(*x->b_vec)))) |
351 | x->b_vec = ap; | 373 | x->b_vec = ap; |
352 | else | 374 | else |
353 | { | 375 | { |
@@ -374,7 +396,11 @@ void binbuf_restore(t_binbuf *x, int argc, t_atom *argv) | |||
374 | else | 396 | else |
375 | { | 397 | { |
376 | int dollar = 0; | 398 | int dollar = 0; |
399 | #ifdef ROCKBOX | ||
400 | dollar = atoi(argv->a_w.w_symbol->s_name + 1); | ||
401 | #else | ||
377 | sscanf(argv->a_w.w_symbol->s_name + 1, "%d", &dollar); | 402 | sscanf(argv->a_w.w_symbol->s_name + 1, "%d", &dollar); |
403 | #endif | ||
378 | SETDOLLAR(ap, dollar); | 404 | SETDOLLAR(ap, dollar); |
379 | } | 405 | } |
380 | } | 406 | } |
@@ -430,10 +456,18 @@ t_symbol *binbuf_realizedollsym(t_symbol *s, int ac, t_atom *av, int tonew) | |||
430 | { | 456 | { |
431 | if (!tonew) | 457 | if (!tonew) |
432 | return (0); | 458 | return (0); |
459 | #ifdef ROCKBOX | ||
460 | else snprintf(buf, sizeof(buf)-1, "$%d", argno); | ||
461 | #else /* ROCKBOX */ | ||
433 | else sprintf(buf, "$%d", argno); | 462 | else sprintf(buf, "$%d", argno); |
463 | #endif /* ROCKBOX */ | ||
434 | } | 464 | } |
435 | else if (argno == 0) | 465 | else if (argno == 0) |
466 | #ifdef ROCKBOX | ||
467 | snprintf(buf, sizeof(buf)-1, "%d", canvas_getdollarzero()); | ||
468 | #else /* ROCKBOX */ | ||
436 | sprintf(buf, "%d", canvas_getdollarzero()); | 469 | sprintf(buf, "%d", canvas_getdollarzero()); |
470 | #endif /* ROCKBOX */ | ||
437 | else | 471 | else |
438 | atom_string(av+(argno-1), buf, MAXPDSTRING/2-1); | 472 | atom_string(av+(argno-1), buf, MAXPDSTRING/2-1); |
439 | strncat(buf, sp, MAXPDSTRING/2-1); | 473 | strncat(buf, sp, MAXPDSTRING/2-1); |
@@ -582,6 +616,10 @@ void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv) | |||
582 | if (nargs == 1) pd_float(target, stackwas->a_w.w_float); | 616 | if (nargs == 1) pd_float(target, stackwas->a_w.w_float); |
583 | else pd_list(target, 0, nargs, stackwas); | 617 | else pd_list(target, 0, nargs, stackwas); |
584 | break; | 618 | break; |
619 | #ifdef ROCKBOX | ||
620 | default: | ||
621 | break; | ||
622 | #endif | ||
585 | } | 623 | } |
586 | } | 624 | } |
587 | msp = stackwas; | 625 | msp = stackwas; |
@@ -606,12 +644,14 @@ static int binbuf_doopen(char *s, int mode) | |||
606 | return (open(namebuf, mode)); | 644 | return (open(namebuf, mode)); |
607 | } | 645 | } |
608 | 646 | ||
647 | #ifndef ROCKBOX | ||
609 | static FILE *binbuf_dofopen(char *s, char *mode) | 648 | static FILE *binbuf_dofopen(char *s, char *mode) |
610 | { | 649 | { |
611 | char namebuf[MAXPDSTRING]; | 650 | char namebuf[MAXPDSTRING]; |
612 | sys_bashfilename(s, namebuf); | 651 | sys_bashfilename(s, namebuf); |
613 | return (fopen(namebuf, mode)); | 652 | return (fopen(namebuf, mode)); |
614 | } | 653 | } |
654 | #endif | ||
615 | 655 | ||
616 | int binbuf_read(t_binbuf *b, char *filename, char *dirname, int crflag) | 656 | int binbuf_read(t_binbuf *b, char *filename, char *dirname, int crflag) |
617 | { | 657 | { |
@@ -620,30 +660,51 @@ int binbuf_read(t_binbuf *b, char *filename, char *dirname, int crflag) | |||
620 | int readret; | 660 | int readret; |
621 | char *buf; | 661 | char *buf; |
622 | char namebuf[MAXPDSTRING]; | 662 | char namebuf[MAXPDSTRING]; |
623 | 663 | ||
624 | namebuf[0] = 0; | 664 | namebuf[0] = 0; |
625 | if (*dirname) | 665 | if (*dirname) |
626 | strcat(namebuf, dirname), strcat(namebuf, "/"); | 666 | strcat(namebuf, dirname), strcat(namebuf, "/"); |
627 | strcat(namebuf, filename); | 667 | strcat(namebuf, filename); |
628 | 668 | ||
629 | if ((fd = binbuf_doopen(namebuf, 0)) < 0) | 669 | if ((fd = binbuf_doopen(namebuf, 0)) < 0) |
630 | { | 670 | { |
671 | #ifdef ROCKBOX | ||
672 | #ifdef SIMULATOR | ||
673 | printf("open: "); | ||
674 | perror(namebuf); | ||
675 | #endif /* SIMULATOR */ | ||
676 | #else /* ROCKBOX */ | ||
631 | fprintf(stderr, "open: "); | 677 | fprintf(stderr, "open: "); |
632 | perror(namebuf); | 678 | perror(namebuf); |
679 | #endif /* ROCKBOX */ | ||
633 | return (1); | 680 | return (1); |
634 | } | 681 | } |
635 | if ((length = lseek(fd, 0, SEEK_END)) < 0 || lseek(fd, 0, SEEK_SET) < 0 | 682 | if ((length = lseek(fd, 0, SEEK_END)) < 0 || lseek(fd, 0, SEEK_SET) < 0 |
636 | || !(buf = t_getbytes(length))) | 683 | || !(buf = t_getbytes(length))) |
637 | { | 684 | { |
685 | #ifdef ROCKBOX | ||
686 | #ifdef SIMULATOR | ||
687 | printf("lseek: "); | ||
688 | perror(namebuf); | ||
689 | #endif /* SIMULATOR */ | ||
690 | #else /* ROCKBOX */ | ||
638 | fprintf(stderr, "lseek: "); | 691 | fprintf(stderr, "lseek: "); |
639 | perror(namebuf); | 692 | perror(namebuf); |
693 | #endif /* ROCKBOX */ | ||
640 | close(fd); | 694 | close(fd); |
641 | return(1); | 695 | return(1); |
642 | } | 696 | } |
643 | if ((readret = read(fd, buf, length)) < length) | 697 | if ((readret = read(fd, buf, length)) < length) |
644 | { | 698 | { |
699 | #ifdef ROCKBOX | ||
700 | #ifdef SIMULATOR | ||
701 | printf("read (%d %ld) -> %d\n", fd, length, readret); | ||
702 | perror(namebuf); | ||
703 | #endif /* SIMULATOR */ | ||
704 | #else /* ROCKBOX */ | ||
645 | fprintf(stderr, "read (%d %ld) -> %d\n", fd, length, readret); | 705 | fprintf(stderr, "read (%d %ld) -> %d\n", fd, length, readret); |
646 | perror(namebuf); | 706 | perror(namebuf); |
707 | #endif /* ROCKBOX */ | ||
647 | close(fd); | 708 | close(fd); |
648 | t_freebytes(buf, length); | 709 | t_freebytes(buf, length); |
649 | return(1); | 710 | return(1); |
@@ -691,7 +752,11 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd); | |||
691 | semicolons. */ | 752 | semicolons. */ |
692 | int binbuf_write(t_binbuf *x, char *filename, char *dir, int crflag) | 753 | int binbuf_write(t_binbuf *x, char *filename, char *dir, int crflag) |
693 | { | 754 | { |
755 | #ifdef ROCKBOX | ||
756 | int f = 0; | ||
757 | #else /* ROCKBOX */ | ||
694 | FILE *f = 0; | 758 | FILE *f = 0; |
759 | #endif /* ROCKBOX */ | ||
695 | char sbuf[WBUFSIZE], fbuf[MAXPDSTRING], *bp = sbuf, *ep = sbuf + WBUFSIZE; | 760 | char sbuf[WBUFSIZE], fbuf[MAXPDSTRING], *bp = sbuf, *ep = sbuf + WBUFSIZE; |
696 | t_atom *ap; | 761 | t_atom *ap; |
697 | int indx, deleteit = 0; | 762 | int indx, deleteit = 0; |
@@ -707,9 +772,19 @@ int binbuf_write(t_binbuf *x, char *filename, char *dir, int crflag) | |||
707 | deleteit = 1; | 772 | deleteit = 1; |
708 | } | 773 | } |
709 | 774 | ||
775 | #ifdef ROCKBOX | ||
776 | if(!(f = binbuf_doopen(fbuf, O_WRONLY|O_CREAT|O_TRUNC))) | ||
777 | #else /* ROCKBOX */ | ||
710 | if (!(f = binbuf_dofopen(fbuf, "w"))) | 778 | if (!(f = binbuf_dofopen(fbuf, "w"))) |
779 | #endif /* ROCKBOX */ | ||
711 | { | 780 | { |
781 | #ifdef ROCKBOX | ||
782 | #ifdef SIMULATOR | ||
783 | printf("open: "); | ||
784 | #endif /* SIMULATOR */ | ||
785 | #else /* ROCKBOX */ | ||
712 | fprintf(stderr, "open: "); | 786 | fprintf(stderr, "open: "); |
787 | #endif /* ROCKBOX */ | ||
713 | sys_unixerror(fbuf); | 788 | sys_unixerror(fbuf); |
714 | goto fail; | 789 | goto fail; |
715 | } | 790 | } |
@@ -723,7 +798,11 @@ int binbuf_write(t_binbuf *x, char *filename, char *dir, int crflag) | |||
723 | else length = 40; | 798 | else length = 40; |
724 | if (ep - bp < length) | 799 | if (ep - bp < length) |
725 | { | 800 | { |
801 | #ifdef ROCKBOX | ||
802 | if(write(f, sbuf, bp-sbuf) < 1) | ||
803 | #else /* ROCKBOX */ | ||
726 | if (fwrite(sbuf, bp-sbuf, 1, f) < 1) | 804 | if (fwrite(sbuf, bp-sbuf, 1, f) < 1) |
805 | #endif /* ROCKBOX */ | ||
727 | { | 806 | { |
728 | sys_unixerror(fbuf); | 807 | sys_unixerror(fbuf); |
729 | goto fail; | 808 | goto fail; |
@@ -750,20 +829,32 @@ int binbuf_write(t_binbuf *x, char *filename, char *dir, int crflag) | |||
750 | ncolumn++; | 829 | ncolumn++; |
751 | } | 830 | } |
752 | } | 831 | } |
832 | #ifdef ROCKBOX | ||
833 | if(write(f, sbuf, bp-sbuf) < 1) | ||
834 | #else /* ROCKBOX */ | ||
753 | if (fwrite(sbuf, bp-sbuf, 1, f) < 1) | 835 | if (fwrite(sbuf, bp-sbuf, 1, f) < 1) |
836 | #endif /* ROCKBOX */ | ||
754 | { | 837 | { |
755 | sys_unixerror(fbuf); | 838 | sys_unixerror(fbuf); |
756 | goto fail; | 839 | goto fail; |
757 | } | 840 | } |
758 | if (deleteit) | 841 | if (deleteit) |
759 | binbuf_free(x); | 842 | binbuf_free(x); |
843 | #ifdef ROCKBOX | ||
844 | close(f); | ||
845 | #else /* ROCKBOX */ | ||
760 | fclose(f); | 846 | fclose(f); |
847 | #endif /* ROCKBOX */ | ||
761 | return (0); | 848 | return (0); |
762 | fail: | 849 | fail: |
763 | if (deleteit) | 850 | if (deleteit) |
764 | binbuf_free(x); | 851 | binbuf_free(x); |
765 | if (f) | 852 | if (f) |
766 | fclose(f); | 853 | #ifdef ROCKBOX |
854 | close(f); | ||
855 | #else /* ROCKBOX */ | ||
856 | fclose(f); | ||
857 | #endif /* ROCKBOX */ | ||
767 | return (1); | 858 | return (1); |
768 | } | 859 | } |
769 | 860 | ||
@@ -816,13 +907,21 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) | |||
816 | if (nextmess[i].a_type == A_DOLLAR) | 907 | if (nextmess[i].a_type == A_DOLLAR) |
817 | { | 908 | { |
818 | char buf[100]; | 909 | char buf[100]; |
910 | #ifdef ROCKBOX | ||
911 | snprintf(buf, sizeof(buf)-1, "$%d", nextmess[i].a_w.w_index); | ||
912 | #else /* ROCKBOX */ | ||
819 | sprintf(buf, "$%d", nextmess[i].a_w.w_index); | 913 | sprintf(buf, "$%d", nextmess[i].a_w.w_index); |
914 | #endif /* ROCKBOX */ | ||
820 | SETSYMBOL(nextmess+i, gensym(buf)); | 915 | SETSYMBOL(nextmess+i, gensym(buf)); |
821 | } | 916 | } |
822 | else if (nextmess[i].a_type == A_DOLLSYM) | 917 | else if (nextmess[i].a_type == A_DOLLSYM) |
823 | { | 918 | { |
824 | char buf[100]; | 919 | char buf[100]; |
920 | #ifdef ROCKBOX | ||
921 | snprintf(buf, sizeof(buf)-1, "$%s", nextmess[i].a_w.w_symbol->s_name); | ||
922 | #else /* ROCKBOX */ | ||
825 | sprintf(buf, "$%s", nextmess[i].a_w.w_symbol->s_name); | 923 | sprintf(buf, "$%s", nextmess[i].a_w.w_symbol->s_name); |
924 | #endif /* ROCKBOX */ | ||
826 | SETSYMBOL(nextmess+i, gensym(buf)); | 925 | SETSYMBOL(nextmess+i, gensym(buf)); |
827 | } | 926 | } |
828 | } | 927 | } |
@@ -846,7 +945,11 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) | |||
846 | atom_getfloatarg(2, natom, nextmess), | 945 | atom_getfloatarg(2, natom, nextmess), |
847 | atom_getfloatarg(5, natom, nextmess) - | 946 | atom_getfloatarg(5, natom, nextmess) - |
848 | atom_getfloatarg(3, natom, nextmess), | 947 | atom_getfloatarg(3, natom, nextmess), |
948 | #ifdef ROCKBOX | ||
949 | 10.0); | ||
950 | #else | ||
849 | (float)sys_defaultfont); | 951 | (float)sys_defaultfont); |
952 | #endif | ||
850 | } | 953 | } |
851 | } | 954 | } |
852 | if (!strcmp(first, "#P")) | 955 | if (!strcmp(first, "#P")) |
@@ -1157,13 +1260,13 @@ int binbuf_match(t_binbuf *inbuf, t_binbuf *searchbuf) | |||
1157 | t_atom *a1 = &inbuf->b_vec[indexin + nmatched], | 1260 | t_atom *a1 = &inbuf->b_vec[indexin + nmatched], |
1158 | *a2 = &searchbuf->b_vec[nmatched]; | 1261 | *a2 = &searchbuf->b_vec[nmatched]; |
1159 | if (a1->a_type != a2->a_type || | 1262 | if (a1->a_type != a2->a_type || |
1160 | a1->a_type == A_SYMBOL && a1->a_w.w_symbol != a2->a_w.w_symbol | 1263 | (a1->a_type == A_SYMBOL && a1->a_w.w_symbol != a2->a_w.w_symbol) |
1161 | || | 1264 | || |
1162 | a1->a_type == A_FLOAT && a1->a_w.w_float != a2->a_w.w_float | 1265 | (a1->a_type == A_FLOAT && a1->a_w.w_float != a2->a_w.w_float) |
1163 | || | 1266 | || |
1164 | a1->a_type == A_DOLLAR && a1->a_w.w_index != a2->a_w.w_index | 1267 | (a1->a_type == A_DOLLAR && a1->a_w.w_index != a2->a_w.w_index) |
1165 | || | 1268 | || |
1166 | a1->a_type == A_DOLLSYM && a1->a_w.w_symbol != a2->a_w.w_symbol) | 1269 | (a1->a_type == A_DOLLSYM && a1->a_w.w_symbol != a2->a_w.w_symbol)) |
1167 | goto nomatch; | 1270 | goto nomatch; |
1168 | } | 1271 | } |
1169 | return (1); | 1272 | return (1); |
@@ -1183,9 +1286,12 @@ void binbuf_evalfile(t_symbol *name, t_symbol *dir) | |||
1183 | /* set filename so that new canvases can pick them up */ | 1286 | /* set filename so that new canvases can pick them up */ |
1184 | int dspstate = canvas_suspend_dsp(); | 1287 | int dspstate = canvas_suspend_dsp(); |
1185 | glob_setfilename(0, name, dir); | 1288 | glob_setfilename(0, name, dir); |
1289 | |||
1186 | if (binbuf_read(b, name->s_name, dir->s_name, 0)) | 1290 | if (binbuf_read(b, name->s_name, dir->s_name, 0)) |
1187 | { | 1291 | { |
1292 | #if !defined(ROCKBOX) || (defined(ROCKBOX) && defined(SIMULATOR)) | ||
1188 | perror(name->s_name); | 1293 | perror(name->s_name); |
1294 | #endif | ||
1189 | } | 1295 | } |
1190 | else | 1296 | else |
1191 | { | 1297 | { |
@@ -1205,6 +1311,10 @@ void binbuf_evalfile(t_symbol *name, t_symbol *dir) | |||
1205 | void glob_evalfile(t_pd *ignore, t_symbol *name, t_symbol *dir) | 1311 | void glob_evalfile(t_pd *ignore, t_symbol *name, t_symbol *dir) |
1206 | { | 1312 | { |
1207 | t_pd *x = 0; | 1313 | t_pd *x = 0; |
1314 | |||
1315 | #ifdef ROCKBOX | ||
1316 | (void) ignore; | ||
1317 | #endif | ||
1208 | /* even though binbuf_evalfile appears to take care of dspstate, | 1318 | /* even though binbuf_evalfile appears to take care of dspstate, |
1209 | we have to do it again here, because canvas_startdsp() assumes | 1319 | we have to do it again here, because canvas_startdsp() assumes |
1210 | that all toplevel canvases are visible. LATER check if this | 1320 | that all toplevel canvases are visible. LATER check if this |
diff --git a/apps/plugins/pdbox/PDa/src/m_class.c b/apps/plugins/pdbox/PDa/src/m_class.c index 66cb34d921..98fe9be23d 100644 --- a/apps/plugins/pdbox/PDa/src/m_class.c +++ b/apps/plugins/pdbox/PDa/src/m_class.c | |||
@@ -2,10 +2,23 @@ | |||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | 2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL |
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | 3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ |
4 | 4 | ||
5 | #if 0 | ||
6 | //#ifdef ROCKBOX | ||
7 | #include "plugin.h" | ||
8 | #include "pdbox.h" | ||
9 | #endif | ||
10 | |||
5 | #define PD_CLASS_DEF | 11 | #define PD_CLASS_DEF |
6 | #include "m_pd.h" | 12 | #include "m_pd.h" |
7 | #include "m_imp.h" | 13 | #include "m_imp.h" |
8 | #include "s_stuff.h" | 14 | #include "s_stuff.h" |
15 | |||
16 | #ifdef ROCKBOX | ||
17 | |||
18 | #include "plugin.h" | ||
19 | #include "pdbox.h" | ||
20 | |||
21 | #else /* ROCKBOX */ | ||
9 | #include <stdlib.h> | 22 | #include <stdlib.h> |
10 | #ifdef UNIX | 23 | #ifdef UNIX |
11 | #include <unistd.h> | 24 | #include <unistd.h> |
@@ -16,6 +29,7 @@ | |||
16 | 29 | ||
17 | #include <stdarg.h> | 30 | #include <stdarg.h> |
18 | #include <string.h> | 31 | #include <string.h> |
32 | #endif /* ROCKBOX */ | ||
19 | 33 | ||
20 | static t_symbol *class_loadsym; /* name under which an extern is invoked */ | 34 | static t_symbol *class_loadsym; /* name under which an extern is invoked */ |
21 | static void pd_defaultfloat(t_pd *x, t_float f); | 35 | static void pd_defaultfloat(t_pd *x, t_float f); |
@@ -27,6 +41,10 @@ static t_symbol *class_extern_dir = &s_; | |||
27 | 41 | ||
28 | static void pd_defaultanything(t_pd *x, t_symbol *s, int argc, t_atom *argv) | 42 | static void pd_defaultanything(t_pd *x, t_symbol *s, int argc, t_atom *argv) |
29 | { | 43 | { |
44 | #ifdef ROCKBOX | ||
45 | (void) argc; | ||
46 | (void) argv; | ||
47 | #endif | ||
30 | pd_error(x, "%s: no method for '%s'", (*x)->c_name->s_name, s->s_name); | 48 | pd_error(x, "%s: no method for '%s'", (*x)->c_name->s_name, s->s_name); |
31 | } | 49 | } |
32 | 50 | ||
@@ -422,6 +440,10 @@ char *class_gethelpdir(t_class *c) | |||
422 | 440 | ||
423 | static void class_nosavefn(t_gobj *z, t_binbuf *b) | 441 | static void class_nosavefn(t_gobj *z, t_binbuf *b) |
424 | { | 442 | { |
443 | #ifdef ROCKBOX | ||
444 | (void) z; | ||
445 | (void) b; | ||
446 | #endif | ||
425 | bug("save function called but not defined"); | 447 | bug("save function called but not defined"); |
426 | } | 448 | } |
427 | 449 | ||
@@ -465,7 +487,7 @@ t_symbol *dogensym(char *s, t_symbol *oldsym) | |||
465 | s2++; | 487 | s2++; |
466 | } | 488 | } |
467 | sym1 = symhash + (hash2 & (HASHSIZE-1)); | 489 | sym1 = symhash + (hash2 & (HASHSIZE-1)); |
468 | while (sym2 = *sym1) | 490 | while ((sym2 = *sym1)) |
469 | { | 491 | { |
470 | if (!strcmp(sym2->s_name, s)) return(sym2); | 492 | if (!strcmp(sym2->s_name, s)) return(sym2); |
471 | sym1 = &sym2->s_next; | 493 | sym1 = &sym2->s_next; |
@@ -485,10 +507,14 @@ t_symbol *dogensym(char *s, t_symbol *oldsym) | |||
485 | 507 | ||
486 | t_symbol *gensym(char *s) | 508 | t_symbol *gensym(char *s) |
487 | { | 509 | { |
510 | printf("gensym: %s\n", s); | ||
488 | return(dogensym(s, 0)); | 511 | return(dogensym(s, 0)); |
489 | } | 512 | } |
490 | 513 | ||
491 | static t_symbol *addfileextent(t_symbol *s) | 514 | #ifndef ROCKBOX |
515 | static | ||
516 | #endif | ||
517 | t_symbol *addfileextent(t_symbol *s) | ||
492 | { | 518 | { |
493 | char namebuf[MAXPDSTRING], *str = s->s_name; | 519 | char namebuf[MAXPDSTRING], *str = s->s_name; |
494 | int ln = strlen(str); | 520 | int ln = strlen(str); |
@@ -608,7 +634,9 @@ typedef t_pd *(*t_fun6)(t_int i1, t_int i2, t_int i3, t_int i4, t_int i5, t_int | |||
608 | 634 | ||
609 | void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv) | 635 | void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv) |
610 | { | 636 | { |
637 | #ifndef ROCKBOX | ||
611 | t_method *f; | 638 | t_method *f; |
639 | #endif | ||
612 | t_class *c = *x; | 640 | t_class *c = *x; |
613 | t_methodentry *m; | 641 | t_methodentry *m; |
614 | t_atomtype *wp, wanttype; | 642 | t_atomtype *wp, wanttype; |
@@ -617,7 +645,7 @@ void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv) | |||
617 | t_floatarg ad[MAXPDARG+1], *dp = ad; | 645 | t_floatarg ad[MAXPDARG+1], *dp = ad; |
618 | int narg = 0; | 646 | int narg = 0; |
619 | t_pd *bonzo; | 647 | t_pd *bonzo; |
620 | 648 | ||
621 | /* check for messages that are handled by fixed slots in the class | 649 | /* check for messages that are handled by fixed slots in the class |
622 | structure. We don't catch "pointer" though so that sending "pointer" | 650 | structure. We don't catch "pointer" though so that sending "pointer" |
623 | to pd_objectmaker doesn't require that we supply a pointer value. */ | 651 | to pd_objectmaker doesn't require that we supply a pointer value. */ |
@@ -658,9 +686,10 @@ void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv) | |||
658 | else (*((t_messgimme)(m->me_fun)))(x, s, argc, argv); | 686 | else (*((t_messgimme)(m->me_fun)))(x, s, argc, argv); |
659 | return; | 687 | return; |
660 | } | 688 | } |
689 | |||
661 | if (argc > MAXPDARG) argc = MAXPDARG; | 690 | if (argc > MAXPDARG) argc = MAXPDARG; |
662 | if (x != &pd_objectmaker) *(ap++) = (t_int)x, narg++; | 691 | if (x != &pd_objectmaker) *(ap++) = (t_int)x, narg++; |
663 | while (wanttype = *wp++) | 692 | while((wanttype = *wp++)) |
664 | { | 693 | { |
665 | switch (wanttype) | 694 | switch (wanttype) |
666 | { | 695 | { |
@@ -712,6 +741,11 @@ void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv) | |||
712 | } | 741 | } |
713 | narg++; | 742 | narg++; |
714 | ap++; | 743 | ap++; |
744 | #ifdef ROCKBOX | ||
745 | break; | ||
746 | default: | ||
747 | break; | ||
748 | #endif | ||
715 | } | 749 | } |
716 | } | 750 | } |
717 | switch (narg) | 751 | switch (narg) |
diff --git a/apps/plugins/pdbox/PDa/src/m_conf.c b/apps/plugins/pdbox/PDa/src/m_conf.c index a3f1c70ec4..6f3fe7f795 100644 --- a/apps/plugins/pdbox/PDa/src/m_conf.c +++ b/apps/plugins/pdbox/PDa/src/m_conf.c | |||
@@ -51,6 +51,9 @@ void d_osc_setup(void); | |||
51 | void d_soundfile_setup(void); | 51 | void d_soundfile_setup(void); |
52 | void d_ugen_setup(void); | 52 | void d_ugen_setup(void); |
53 | 53 | ||
54 | /* PD anywhere specific. -- W.B. */ | ||
55 | void d_intern_setup(void); | ||
56 | |||
54 | void conf_init(void) | 57 | void conf_init(void) |
55 | { | 58 | { |
56 | g_array_setup(); | 59 | g_array_setup(); |
@@ -81,11 +84,15 @@ void conf_init(void) | |||
81 | x_time_setup(); | 84 | x_time_setup(); |
82 | x_arithmetic_setup(); | 85 | x_arithmetic_setup(); |
83 | 86 | ||
87 | #ifndef ROCKBOX | ||
84 | x_midi_setup(); | 88 | x_midi_setup(); |
89 | #endif | ||
85 | x_misc_setup(); | 90 | x_misc_setup(); |
86 | x_net_setup(); | 91 | x_net_setup(); |
87 | x_qlist_setup(); | 92 | x_qlist_setup(); |
93 | #ifndef ROCKBOX | ||
88 | x_gui_setup(); | 94 | x_gui_setup(); |
95 | #endif | ||
89 | d_arithmetic_setup(); | 96 | d_arithmetic_setup(); |
90 | d_dac_setup(); | 97 | d_dac_setup(); |
91 | d_fft_setup(); | 98 | d_fft_setup(); |
diff --git a/apps/plugins/pdbox/PDa/src/m_fixed.c b/apps/plugins/pdbox/PDa/src/m_fixed.c index 7beaa8077a..374f92cbca 100644 --- a/apps/plugins/pdbox/PDa/src/m_fixed.c +++ b/apps/plugins/pdbox/PDa/src/m_fixed.c | |||
@@ -1,9 +1,14 @@ | |||
1 | 1 | ||
2 | #ifdef ROCKBOX | ||
3 | #include "plugin.h" | ||
4 | #include "pdbox.h" | ||
5 | #else /* ROCKBOX */ | ||
2 | #include <sys/socket.h> | 6 | #include <sys/socket.h> |
3 | #include <netinet/in.h> | 7 | #include <netinet/in.h> |
4 | #include <netinet/tcp.h> | 8 | #include <netinet/tcp.h> |
5 | #include <netdb.h> | 9 | #include <netdb.h> |
6 | #include <stdio.h> | 10 | #include <stdio.h> |
11 | #endif /* ROCKBOX */ | ||
7 | 12 | ||
8 | #include "m_pd.h" | 13 | #include "m_pd.h" |
9 | #include "m_imp.h" | 14 | #include "m_imp.h" |
@@ -21,8 +26,19 @@ static t_int x_fd = -1; | |||
21 | 26 | ||
22 | 27 | ||
23 | 28 | ||
24 | static void ipod_connect() | 29 | static void ipod_connect(void) |
25 | { | 30 | { |
31 | #ifdef ROCKBOX | ||
32 | if (x_fd >= 0) | ||
33 | { | ||
34 | error("ipod_connect: already connected"); | ||
35 | return; | ||
36 | } | ||
37 | else | ||
38 | { | ||
39 | x_fd++; | ||
40 | } | ||
41 | #else /* ROCKBOX */ | ||
26 | struct sockaddr_in server; | 42 | struct sockaddr_in server; |
27 | struct hostent *hp; | 43 | struct hostent *hp; |
28 | int sockfd; | 44 | int sockfd; |
@@ -65,6 +81,7 @@ static void ipod_connect() | |||
65 | } | 81 | } |
66 | post("connected %s %d",hostname,portno); | 82 | post("connected %s %d",hostname,portno); |
67 | x_fd = sockfd; | 83 | x_fd = sockfd; |
84 | #endif /* ROCKBOX */ | ||
68 | } | 85 | } |
69 | 86 | ||
70 | 87 | ||
@@ -72,8 +89,13 @@ static void ipod_connect() | |||
72 | static void ipod_bang(t_ipod *x) | 89 | static void ipod_bang(t_ipod *x) |
73 | { | 90 | { |
74 | static char sendme[200]; | 91 | static char sendme[200]; |
92 | #ifdef ROCKBOX | ||
93 | snprintf(sendme, sizeof(sendme)-1, "%s bang;\n", x->x_what->s_name); | ||
94 | SEND_FROM_CORE(sendme); | ||
95 | #else /* ROCKBOX */ | ||
75 | sprintf(sendme,"%s bang;\n",x->x_what->s_name); | 96 | sprintf(sendme,"%s bang;\n",x->x_what->s_name); |
76 | send(x_fd,sendme,strlen(sendme),0); | 97 | send(x_fd,sendme,strlen(sendme),0); |
98 | #endif /*ROCKBOX */ | ||
77 | 99 | ||
78 | // if (x->x_sym->s_thing) pd_bang(x->x_sym->s_thing); | 100 | // if (x->x_sym->s_thing) pd_bang(x->x_sym->s_thing); |
79 | } | 101 | } |
@@ -81,9 +103,19 @@ static void ipod_bang(t_ipod *x) | |||
81 | static void ipod_float(t_ipod *x, t_float f) | 103 | static void ipod_float(t_ipod *x, t_float f) |
82 | { | 104 | { |
83 | static char sendme[200]; | 105 | static char sendme[200]; |
106 | #ifdef ROCKBOX | ||
107 | char f_buf[32]; | ||
108 | |||
109 | ftoan(f, f_buf, sizeof(f_buf)-1); | ||
110 | strcpy(sendme, x->x_what->s_name); | ||
111 | strcat(sendme, " "); | ||
112 | strcat(sendme, f_buf); | ||
84 | 113 | ||
114 | SEND_FROM_CORE(sendme); | ||
115 | #else /* ROCKBOX */ | ||
85 | sprintf(sendme,"%s %f;\n",x->x_what->s_name,f); | 116 | sprintf(sendme,"%s %f;\n",x->x_what->s_name,f); |
86 | send(x_fd,sendme,strlen(sendme),0); | 117 | send(x_fd,sendme,strlen(sendme),0); |
118 | #endif /* ROCKBOX */ | ||
87 | 119 | ||
88 | // post("forwarding float %s",x->x_what->s_name); | 120 | // post("forwarding float %s",x->x_what->s_name); |
89 | // if (x->x_sym->s_thing) pd_float(x->x_sym->s_thing, f); | 121 | // if (x->x_sym->s_thing) pd_float(x->x_sym->s_thing, f); |
diff --git a/apps/plugins/pdbox/PDa/src/m_glob.c b/apps/plugins/pdbox/PDa/src/m_glob.c index 2ec584a33d..9a036a984e 100644 --- a/apps/plugins/pdbox/PDa/src/m_glob.c +++ b/apps/plugins/pdbox/PDa/src/m_glob.c | |||
@@ -83,6 +83,7 @@ void glob_init(void) | |||
83 | gensym("audiostatus"), 0); | 83 | gensym("audiostatus"), 0); |
84 | class_addmethod(glob_pdobject, (t_method)glob_finderror, | 84 | class_addmethod(glob_pdobject, (t_method)glob_finderror, |
85 | gensym("finderror"), 0); | 85 | gensym("finderror"), 0); |
86 | #ifndef ROCKBOX | ||
86 | class_addmethod(glob_pdobject, (t_method)glob_audio_properties, | 87 | class_addmethod(glob_pdobject, (t_method)glob_audio_properties, |
87 | gensym("audio-properties"), A_DEFFLOAT, 0); | 88 | gensym("audio-properties"), A_DEFFLOAT, 0); |
88 | class_addmethod(glob_pdobject, (t_method)glob_audio_dialog, | 89 | class_addmethod(glob_pdobject, (t_method)glob_audio_dialog, |
@@ -93,6 +94,7 @@ void glob_init(void) | |||
93 | gensym("midi-properties"), A_DEFFLOAT, 0); | 94 | gensym("midi-properties"), A_DEFFLOAT, 0); |
94 | class_addmethod(glob_pdobject, (t_method)glob_midi_dialog, | 95 | class_addmethod(glob_pdobject, (t_method)glob_midi_dialog, |
95 | gensym("midi-dialog"), A_GIMME, 0); | 96 | gensym("midi-dialog"), A_GIMME, 0); |
97 | #endif /* ROCKBOX */ | ||
96 | class_addmethod(glob_pdobject, (t_method)glob_start_path_dialog, | 98 | class_addmethod(glob_pdobject, (t_method)glob_start_path_dialog, |
97 | gensym("start-path-dialog"), A_DEFFLOAT, 0); | 99 | gensym("start-path-dialog"), A_DEFFLOAT, 0); |
98 | class_addmethod(glob_pdobject, (t_method)glob_path_dialog, | 100 | class_addmethod(glob_pdobject, (t_method)glob_path_dialog, |
diff --git a/apps/plugins/pdbox/PDa/src/m_memory.c b/apps/plugins/pdbox/PDa/src/m_memory.c index f9ee378f87..2a05d72d2d 100644 --- a/apps/plugins/pdbox/PDa/src/m_memory.c +++ b/apps/plugins/pdbox/PDa/src/m_memory.c | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | #ifdef ROCKBOX | 5 | #ifdef ROCKBOX |
6 | #include "plugin.h" | 6 | #include "plugin.h" |
7 | #define memset rb->memset | 7 | #include "pdbox.h" |
8 | #else /* ROCKBOX */ | 8 | #else /* ROCKBOX */ |
9 | #include <stdlib.h> | 9 | #include <stdlib.h> |
10 | #include <string.h> | 10 | #include <string.h> |
diff --git a/apps/plugins/pdbox/PDa/src/m_obj.c b/apps/plugins/pdbox/PDa/src/m_obj.c index 785fd240bf..fa17a9052b 100644 --- a/apps/plugins/pdbox/PDa/src/m_obj.c +++ b/apps/plugins/pdbox/PDa/src/m_obj.c | |||
@@ -53,9 +53,9 @@ t_inlet *inlet_new(t_object *owner, t_pd *dest, t_symbol *s1, t_symbol *s2) | |||
53 | else x->i_symto = s2; | 53 | else x->i_symto = s2; |
54 | x->i_symfrom = s1; | 54 | x->i_symfrom = s1; |
55 | x->i_next = 0; | 55 | x->i_next = 0; |
56 | if (y = owner->ob_inlet) | 56 | if((y = owner->ob_inlet)) |
57 | { | 57 | { |
58 | while (y2 = y->i_next) y = y2; | 58 | while((y2 = y->i_next)) y = y2; |
59 | y->i_next = x; | 59 | y->i_next = x; |
60 | } | 60 | } |
61 | else owner->ob_inlet = x; | 61 | else owner->ob_inlet = x; |
@@ -106,7 +106,9 @@ static void inlet_symbol(t_inlet *x, t_symbol *s) | |||
106 | 106 | ||
107 | static void inlet_list(t_inlet *x, t_symbol *s, int argc, t_atom *argv) | 107 | static void inlet_list(t_inlet *x, t_symbol *s, int argc, t_atom *argv) |
108 | { | 108 | { |
109 | #ifndef ROCKBOX | ||
109 | t_atom at; | 110 | t_atom at; |
111 | #endif | ||
110 | if (x->i_symfrom == &s_list || x->i_symfrom == &s_float | 112 | if (x->i_symfrom == &s_list || x->i_symfrom == &s_float |
111 | || x->i_symfrom == &s_symbol || x->i_symfrom == &s_pointer) | 113 | || x->i_symfrom == &s_symbol || x->i_symfrom == &s_pointer) |
112 | typedmess(x->i_dest, x->i_symto, argc, argv); | 114 | typedmess(x->i_dest, x->i_symto, argc, argv); |
@@ -154,9 +156,9 @@ t_inlet *pointerinlet_new(t_object *owner, t_gpointer *gp) | |||
154 | x->i_symfrom = &s_pointer; | 156 | x->i_symfrom = &s_pointer; |
155 | x->i_pointerslot = gp; | 157 | x->i_pointerslot = gp; |
156 | x->i_next = 0; | 158 | x->i_next = 0; |
157 | if (y = owner->ob_inlet) | 159 | if((y = owner->ob_inlet)) |
158 | { | 160 | { |
159 | while (y2 = y->i_next) y = y2; | 161 | while((y2 = y->i_next)) y = y2; |
160 | y->i_next = x; | 162 | y->i_next = x; |
161 | } | 163 | } |
162 | else owner->ob_inlet = x; | 164 | else owner->ob_inlet = x; |
@@ -176,9 +178,9 @@ t_inlet *floatinlet_new(t_object *owner, t_float *fp) | |||
176 | x->i_symfrom = &s_float; | 178 | x->i_symfrom = &s_float; |
177 | x->i_floatslot = fp; | 179 | x->i_floatslot = fp; |
178 | x->i_next = 0; | 180 | x->i_next = 0; |
179 | if (y = owner->ob_inlet) | 181 | if((y = owner->ob_inlet)) |
180 | { | 182 | { |
181 | while (y2 = y->i_next) y = y2; | 183 | while((y2 = y->i_next)) y = y2; |
182 | y->i_next = x; | 184 | y->i_next = x; |
183 | } | 185 | } |
184 | else owner->ob_inlet = x; | 186 | else owner->ob_inlet = x; |
@@ -198,9 +200,9 @@ t_inlet *symbolinlet_new(t_object *owner, t_symbol **sp) | |||
198 | x->i_symfrom = &s_symbol; | 200 | x->i_symfrom = &s_symbol; |
199 | x->i_symslot = sp; | 201 | x->i_symslot = sp; |
200 | x->i_next = 0; | 202 | x->i_next = 0; |
201 | if (y = owner->ob_inlet) | 203 | if((y = owner->ob_inlet)) |
202 | { | 204 | { |
203 | while (y2 = y->i_next) y = y2; | 205 | while((y2 = y->i_next)) y = y2; |
204 | y->i_next = x; | 206 | y->i_next = x; |
205 | } | 207 | } |
206 | else owner->ob_inlet = x; | 208 | else owner->ob_inlet = x; |
@@ -217,6 +219,11 @@ void obj_list(t_object *x, t_symbol *s, int argc, t_atom *argv) | |||
217 | t_atom *ap; | 219 | t_atom *ap; |
218 | int count; | 220 | int count; |
219 | t_inlet *ip = ((t_object *)x)->ob_inlet; | 221 | t_inlet *ip = ((t_object *)x)->ob_inlet; |
222 | |||
223 | #ifdef ROCKBOX | ||
224 | (void) s; | ||
225 | #endif | ||
226 | |||
220 | if (!argc) return; | 227 | if (!argc) return; |
221 | for (count = argc-1, ap = argv+1; ip && count--; ap++, ip = ip->i_next) | 228 | for (count = argc-1, ap = argv+1; ip && count--; ap++, ip = ip->i_next) |
222 | { | 229 | { |
@@ -296,9 +303,9 @@ t_outlet *outlet_new(t_object *owner, t_symbol *s) | |||
296 | t_outlet *x = (t_outlet *)getbytes(sizeof(*x)), *y, *y2; | 303 | t_outlet *x = (t_outlet *)getbytes(sizeof(*x)), *y, *y2; |
297 | x->o_owner = owner; | 304 | x->o_owner = owner; |
298 | x->o_next = 0; | 305 | x->o_next = 0; |
299 | if (y = owner->ob_outlet) | 306 | if((y = owner->ob_outlet)) |
300 | { | 307 | { |
301 | while (y2 = y->o_next) y = y2; | 308 | while((y2 = y->o_next)) y = y2; |
302 | y->o_next = x; | 309 | y->o_next = x; |
303 | } | 310 | } |
304 | else owner->ob_outlet = x; | 311 | else owner->ob_outlet = x; |
@@ -474,7 +481,7 @@ doit: | |||
474 | freebytes(oc, sizeof(*oc)); | 481 | freebytes(oc, sizeof(*oc)); |
475 | goto done; | 482 | goto done; |
476 | } | 483 | } |
477 | while (oc2 = oc->oc_next) | 484 | while((oc2 = oc->oc_next)) |
478 | { | 485 | { |
479 | if (oc2->oc_to == to) | 486 | if (oc2->oc_to == to) |
480 | { | 487 | { |
diff --git a/apps/plugins/pdbox/PDa/src/m_pd.c b/apps/plugins/pdbox/PDa/src/m_pd.c index e686c2cb52..25f5f2d212 100644 --- a/apps/plugins/pdbox/PDa/src/m_pd.c +++ b/apps/plugins/pdbox/PDa/src/m_pd.c | |||
@@ -2,10 +2,15 @@ | |||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | 2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL |
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | 3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ |
4 | 4 | ||
5 | #include <stdlib.h> | ||
6 | #include "m_pd.h" | 5 | #include "m_pd.h" |
7 | #include "m_imp.h" | 6 | #include "m_imp.h" |
8 | 7 | ||
8 | #ifdef ROCKBOX | ||
9 | void pd_checkgui(t_pd *x, t_symbol *s); | ||
10 | #else /* ROCKBOX */ | ||
11 | #include <stdlib.h> | ||
12 | #endif /* ROCKBOX */ | ||
13 | |||
9 | /* FIXME no out-of-memory testing yet! */ | 14 | /* FIXME no out-of-memory testing yet! */ |
10 | 15 | ||
11 | t_pd *pd_new(t_class *c) | 16 | t_pd *pd_new(t_class *c) |
@@ -166,7 +171,7 @@ void pd_unbind(t_pd *x, t_symbol *s) | |||
166 | b->b_list = e->e_next; | 171 | b->b_list = e->e_next; |
167 | freebytes(e, sizeof(t_bindelem)); | 172 | freebytes(e, sizeof(t_bindelem)); |
168 | } | 173 | } |
169 | else for (e = b->b_list; e2 = e->e_next; e = e2) | 174 | else for (e = b->b_list; (e2 = e->e_next); e = e2) |
170 | if (e2->e_who == x) | 175 | if (e2->e_who == x) |
171 | { | 176 | { |
172 | e->e_next = e2->e_next; | 177 | e->e_next = e2->e_next; |
@@ -194,8 +199,13 @@ t_pd *pd_findbyclass(t_symbol *s, t_class *c) | |||
194 | if (*s->s_thing == bindlist_class) | 199 | if (*s->s_thing == bindlist_class) |
195 | { | 200 | { |
196 | t_bindlist *b = (t_bindlist *)s->s_thing; | 201 | t_bindlist *b = (t_bindlist *)s->s_thing; |
202 | #ifdef ROCKBOX | ||
203 | t_bindelem *e; | ||
204 | #else /* ROCKBOX */ | ||
197 | t_bindelem *e, *e2; | 205 | t_bindelem *e, *e2; |
206 | #endif /* ROCKBOX */ | ||
198 | int warned = 0; | 207 | int warned = 0; |
208 | |||
199 | for (e = b->b_list; e; e = e->e_next) | 209 | for (e = b->b_list; e; e = e->e_next) |
200 | if (*e->e_who == c) | 210 | if (*e->e_who == c) |
201 | { | 211 | { |
@@ -288,6 +298,9 @@ void pd_symbol(t_pd *x, t_symbol *s) | |||
288 | 298 | ||
289 | void pd_list(t_pd *x, t_symbol *s, int argc, t_atom *argv) | 299 | void pd_list(t_pd *x, t_symbol *s, int argc, t_atom *argv) |
290 | { | 300 | { |
301 | #ifdef ROCKBOX | ||
302 | (void) s; | ||
303 | #endif | ||
291 | (*(*x)->c_listmethod)(x, &s_list, argc, argv); | 304 | (*(*x)->c_listmethod)(x, &s_list, argc, argv); |
292 | } | 305 | } |
293 | 306 | ||
diff --git a/apps/plugins/pdbox/PDa/src/m_sched.c b/apps/plugins/pdbox/PDa/src/m_sched.c index 9d3bed828a..104cc66c70 100644 --- a/apps/plugins/pdbox/PDa/src/m_sched.c +++ b/apps/plugins/pdbox/PDa/src/m_sched.c | |||
@@ -2,6 +2,11 @@ | |||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | 2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL |
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | 3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ |
4 | 4 | ||
5 | #ifdef ROCKBOX | ||
6 | #include "plugin.h" | ||
7 | #include "pdbox.h" | ||
8 | #endif | ||
9 | |||
5 | /* scheduling stuff */ | 10 | /* scheduling stuff */ |
6 | 11 | ||
7 | #include "m_pd.h" | 12 | #include "m_pd.h" |
@@ -14,13 +19,21 @@ | |||
14 | 19 | ||
15 | 20 | ||
16 | /* T.Grill - enable PD global thread locking - sys_lock, sys_unlock, sys_trylock functions */ | 21 | /* T.Grill - enable PD global thread locking - sys_lock, sys_unlock, sys_trylock functions */ |
17 | #define THREAD_LOCKING | 22 | #ifndef ROCKBOX |
23 | #define THREAD_LOCKING | ||
18 | #include "pthread.h" | 24 | #include "pthread.h" |
25 | #endif | ||
19 | 26 | ||
20 | 27 | ||
21 | static int sys_quit; | 28 | static int sys_quit; |
22 | static t_time sys_time; | 29 | #ifndef ROCKBOX |
23 | static t_time sys_time_per_msec = TIMEUNITPERSEC / 1000.; | 30 | static |
31 | #endif | ||
32 | t_time sys_time; | ||
33 | #ifndef ROCKBOX | ||
34 | static | ||
35 | #endif | ||
36 | t_time sys_time_per_msec = TIMEUNITPERSEC / 1000.; | ||
24 | 37 | ||
25 | int sys_schedblocksize = DEFDACBLKSIZE; | 38 | int sys_schedblocksize = DEFDACBLKSIZE; |
26 | int sys_usecsincelastsleep(void); | 39 | int sys_usecsincelastsleep(void); |
@@ -133,9 +146,12 @@ static int sys_bin[] = {0, 2, 5, 10, 20, 30, 50, 100, 1000}; | |||
133 | #define NBIN (sizeof(sys_bin)/sizeof(*sys_bin)) | 146 | #define NBIN (sizeof(sys_bin)/sizeof(*sys_bin)) |
134 | #define NHIST 10 | 147 | #define NHIST 10 |
135 | static int sys_histogram[NHIST][NBIN]; | 148 | static int sys_histogram[NHIST][NBIN]; |
149 | #ifndef ROCKBOX | ||
136 | static t_time sys_histtime; | 150 | static t_time sys_histtime; |
151 | #endif | ||
137 | static int sched_diddsp, sched_didpoll, sched_didnothing; | 152 | static int sched_diddsp, sched_didpoll, sched_didnothing; |
138 | 153 | ||
154 | #ifndef ROCKBOX | ||
139 | static void sys_clearhist( void) | 155 | static void sys_clearhist( void) |
140 | { | 156 | { |
141 | unsigned int i, j; | 157 | unsigned int i, j; |
@@ -144,6 +160,7 @@ static void sys_clearhist( void) | |||
144 | sys_histtime = sys_getrealtime(); | 160 | sys_histtime = sys_getrealtime(); |
145 | sched_diddsp = sched_didpoll = sched_didnothing = 0; | 161 | sched_diddsp = sched_didpoll = sched_didnothing = 0; |
146 | } | 162 | } |
163 | #endif | ||
147 | 164 | ||
148 | void sys_printhist( void) | 165 | void sys_printhist( void) |
149 | { | 166 | { |
@@ -169,10 +186,15 @@ void sys_printhist( void) | |||
169 | sched_diddsp, sched_didpoll, sched_didnothing); | 186 | sched_diddsp, sched_didpoll, sched_didnothing); |
170 | } | 187 | } |
171 | 188 | ||
189 | #ifndef ROCKBOX | ||
172 | static int sys_histphase; | 190 | static int sys_histphase; |
191 | #endif | ||
173 | 192 | ||
174 | int sys_addhist(int phase) | 193 | int sys_addhist(int phase) |
175 | { | 194 | { |
195 | #ifdef ROCKBOX | ||
196 | (void) phase; | ||
197 | #endif | ||
176 | #ifndef FIXEDPOINT | 198 | #ifndef FIXEDPOINT |
177 | int i, j, phasewas = sys_histphase; | 199 | int i, j, phasewas = sys_histphase; |
178 | t_time newtime = sys_getrealtime(); | 200 | t_time newtime = sys_getrealtime(); |
@@ -216,7 +238,11 @@ static char *(oss_errornames[]) = { | |||
216 | 238 | ||
217 | void glob_audiostatus(void) | 239 | void glob_audiostatus(void) |
218 | { | 240 | { |
241 | #ifdef ROCKBOX | ||
242 | int nresync, nresyncphase, i; | ||
243 | #else | ||
219 | int dev, nresync, nresyncphase, i; | 244 | int dev, nresync, nresyncphase, i; |
245 | #endif | ||
220 | nresync = (oss_nresync >= NRESYNC ? NRESYNC : oss_nresync); | 246 | nresync = (oss_nresync >= NRESYNC ? NRESYNC : oss_nresync); |
221 | nresyncphase = oss_resyncphase - 1; | 247 | nresyncphase = oss_resyncphase - 1; |
222 | post("audio I/O error history:"); | 248 | post("audio I/O error history:"); |
@@ -251,7 +277,9 @@ void sys_log_error(int type) | |||
251 | if (type != ERR_NOTHING && !sched_diored && | 277 | if (type != ERR_NOTHING && !sched_diored && |
252 | (sched_diddsp >= sched_dioredtime)) | 278 | (sched_diddsp >= sched_dioredtime)) |
253 | { | 279 | { |
280 | #ifndef ROCKBOX | ||
254 | sys_vgui("pdtk_pd_dio 1\n"); | 281 | sys_vgui("pdtk_pd_dio 1\n"); |
282 | #endif | ||
255 | sched_diored = 1; | 283 | sched_diored = 1; |
256 | } | 284 | } |
257 | sched_dioredtime = | 285 | sched_dioredtime = |
@@ -263,6 +291,7 @@ static int sched_lastinclip, sched_lastoutclip, | |||
263 | 291 | ||
264 | void glob_ping(t_pd *dummy); | 292 | void glob_ping(t_pd *dummy); |
265 | 293 | ||
294 | #ifndef ROCKBOX | ||
266 | static void sched_pollformeters( void) | 295 | static void sched_pollformeters( void) |
267 | { | 296 | { |
268 | int inclip, outclip, indb, outdb; | 297 | int inclip, outclip, indb, outdb; |
@@ -313,9 +342,13 @@ static void sched_pollformeters( void) | |||
313 | sched_nextmeterpolltime = | 342 | sched_nextmeterpolltime = |
314 | sched_diddsp + (int)(sys_dacsr /(double)sys_schedblocksize); | 343 | sched_diddsp + (int)(sys_dacsr /(double)sys_schedblocksize); |
315 | } | 344 | } |
345 | #endif /* ROCKBOX */ | ||
316 | 346 | ||
317 | void glob_meters(void *dummy, float f) | 347 | void glob_meters(void *dummy, float f) |
318 | { | 348 | { |
349 | #ifdef ROCKBOX | ||
350 | (void) dummy; | ||
351 | #endif | ||
319 | if (f == 0) | 352 | if (f == 0) |
320 | sys_getmeters(0, 0); | 353 | sys_getmeters(0, 0); |
321 | sched_meterson = (f != 0); | 354 | sched_meterson = (f != 0); |
@@ -335,7 +368,10 @@ void dsp_tick(void); | |||
335 | 368 | ||
336 | static int sched_usedacs = 1; | 369 | static int sched_usedacs = 1; |
337 | static t_time sched_referencerealtime, sched_referencelogicaltime; | 370 | static t_time sched_referencerealtime, sched_referencelogicaltime; |
338 | static t_time sys_time_per_dsp_tick; | 371 | #ifndef ROCKBOX |
372 | static | ||
373 | #endif | ||
374 | t_time sys_time_per_dsp_tick; | ||
339 | 375 | ||
340 | void sched_set_using_dacs(int flag) | 376 | void sched_set_using_dacs(int flag) |
341 | { | 377 | { |
@@ -344,14 +380,24 @@ void sched_set_using_dacs(int flag) | |||
344 | { | 380 | { |
345 | sched_referencerealtime = sys_getrealtime(); | 381 | sched_referencerealtime = sys_getrealtime(); |
346 | sched_referencelogicaltime = clock_getlogicaltime(); | 382 | sched_referencelogicaltime = clock_getlogicaltime(); |
383 | #ifndef ROCKBOX | ||
347 | post("schedsetuding"); | 384 | post("schedsetuding"); |
385 | #endif | ||
348 | } | 386 | } |
349 | sys_time_per_dsp_tick = (TIMEUNITPERSEC) * | 387 | sys_time_per_dsp_tick = (TIMEUNITPERSEC) * |
350 | ((double)sys_schedblocksize) / sys_dacsr; | 388 | ((double)sys_schedblocksize) / sys_dacsr; |
389 | /* | ||
390 | #ifdef SIMULATOR | ||
391 | printf("%f\n%f\n%f\n%f\n", (double)sys_time_per_dsp_tick, (double)TIMEUNITPERSEC, (double) sys_schedblocksize, (double)sys_dacsr); | ||
392 | #endif | ||
393 | */ | ||
351 | } | 394 | } |
352 | 395 | ||
353 | /* take the scheduler forward one DSP tick, also handling clock timeouts */ | 396 | /* take the scheduler forward one DSP tick, also handling clock timeouts */ |
354 | static void sched_tick(t_time next_sys_time) | 397 | #ifndef ROCKBOX |
398 | static | ||
399 | #endif | ||
400 | void sched_tick(t_time next_sys_time) | ||
355 | { | 401 | { |
356 | int countdown = 5000; | 402 | int countdown = 5000; |
357 | while (clock_setlist && clock_setlist->c_settime < next_sys_time) | 403 | while (clock_setlist && clock_setlist->c_settime < next_sys_time) |
@@ -364,7 +410,9 @@ static void sched_tick(t_time next_sys_time) | |||
364 | if (!countdown--) | 410 | if (!countdown--) |
365 | { | 411 | { |
366 | countdown = 5000; | 412 | countdown = 5000; |
413 | #ifndef ROCKBOX | ||
367 | sys_pollgui(); | 414 | sys_pollgui(); |
415 | #endif | ||
368 | } | 416 | } |
369 | if (sys_quit) | 417 | if (sys_quit) |
370 | return; | 418 | return; |
@@ -388,9 +436,11 @@ the audio I/O system is still busy with previous transfers. | |||
388 | void sys_pollmidiqueue( void); | 436 | void sys_pollmidiqueue( void); |
389 | void sys_initmidiqueue( void); | 437 | void sys_initmidiqueue( void); |
390 | 438 | ||
439 | #ifndef ROCKBOX | ||
391 | int m_scheduler_pda( void) | 440 | int m_scheduler_pda( void) |
392 | { | 441 | { |
393 | int idlecount = 0; | 442 | int idlecount = 0; |
443 | |||
394 | sys_time_per_dsp_tick = (TIMEUNITPERSEC) * | 444 | sys_time_per_dsp_tick = (TIMEUNITPERSEC) * |
395 | ((double)sys_schedblocksize) / sys_dacsr; | 445 | ((double)sys_schedblocksize) / sys_dacsr; |
396 | 446 | ||
@@ -402,13 +452,18 @@ int m_scheduler_pda( void) | |||
402 | sys_sleepgrain = 100; | 452 | sys_sleepgrain = 100; |
403 | else if (sys_sleepgrain > 5000) | 453 | else if (sys_sleepgrain > 5000) |
404 | sys_sleepgrain = 5000; | 454 | sys_sleepgrain = 5000; |
455 | |||
405 | sys_initmidiqueue(); | 456 | sys_initmidiqueue(); |
457 | |||
406 | while (!sys_quit) | 458 | while (!sys_quit) |
407 | { | 459 | { |
460 | |||
408 | int didsomething = 0; | 461 | int didsomething = 0; |
462 | |||
409 | int timeforward; | 463 | int timeforward; |
410 | 464 | ||
411 | sys_addhist(0); | 465 | sys_addhist(0); |
466 | |||
412 | waitfortick: | 467 | waitfortick: |
413 | if (sched_usedacs) | 468 | if (sched_usedacs) |
414 | { | 469 | { |
@@ -564,7 +619,7 @@ int sys_trylock(void) | |||
564 | 619 | ||
565 | void sys_lock(void) {} | 620 | void sys_lock(void) {} |
566 | void sys_unlock(void) {} | 621 | void sys_unlock(void) {} |
567 | int sys_trylock(void) {} | 622 | int sys_trylock(void) { return 0; } |
568 | 623 | ||
569 | #endif | 624 | #endif |
570 | 625 | ||
@@ -580,3 +635,4 @@ void sys_exit(void) | |||
580 | sys_quit = 1; | 635 | sys_quit = 1; |
581 | } | 636 | } |
582 | 637 | ||
638 | #endif /* ROCKBOX */ | ||
diff --git a/apps/plugins/pdbox/PDa/src/s_audio.c b/apps/plugins/pdbox/PDa/src/s_audio.c index 5f27d98671..61d1caa583 100644 --- a/apps/plugins/pdbox/PDa/src/s_audio.c +++ b/apps/plugins/pdbox/PDa/src/s_audio.c | |||
@@ -6,6 +6,13 @@ | |||
6 | audio settings from argparse routine and from dialog window. | 6 | audio settings from argparse routine and from dialog window. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #ifdef ROCKBOX | ||
10 | #include "plugin.h" | ||
11 | #include "pdbox.h" | ||
12 | #include "m_pd.h" | ||
13 | #include "s_stuff.h" | ||
14 | #define snprintf rb->snprintf | ||
15 | #else /* ROCKBOX */ | ||
9 | #include "m_pd.h" | 16 | #include "m_pd.h" |
10 | #include "s_stuff.h" | 17 | #include "s_stuff.h" |
11 | #include <stdio.h> | 18 | #include <stdio.h> |
@@ -17,6 +24,7 @@ | |||
17 | #include <stdlib.h> | 24 | #include <stdlib.h> |
18 | #include <string.h> | 25 | #include <string.h> |
19 | #include <errno.h> | 26 | #include <errno.h> |
27 | #endif /* ROCKBOX */ | ||
20 | 28 | ||
21 | #define SYS_DEFAULTCH 2 | 29 | #define SYS_DEFAULTCH 2 |
22 | #define SYS_MAXCH 100 | 30 | #define SYS_MAXCH 100 |
@@ -116,7 +124,11 @@ static void sys_save_audio_params( | |||
116 | void oss_init(void); | 124 | void oss_init(void); |
117 | #endif | 125 | #endif |
118 | 126 | ||
127 | #ifdef ROCKBOX | ||
128 | static void pd_audio_init(void) | ||
129 | #else | ||
119 | static void audio_init( void) | 130 | static void audio_init( void) |
131 | #endif | ||
120 | { | 132 | { |
121 | static int initted = 0; | 133 | static int initted = 0; |
122 | if (initted) | 134 | if (initted) |
@@ -131,7 +143,9 @@ static void audio_init( void) | |||
131 | 143 | ||
132 | static void sys_setchsr(int chin, int chout, int sr) | 144 | static void sys_setchsr(int chin, int chout, int sr) |
133 | { | 145 | { |
146 | #ifndef ROCKBOX | ||
134 | int nblk; | 147 | int nblk; |
148 | #endif | ||
135 | int inbytes = (chin ? chin : 2) * (DEFDACBLKSIZE*sizeof(float)); | 149 | int inbytes = (chin ? chin : 2) * (DEFDACBLKSIZE*sizeof(float)); |
136 | int outbytes = (chout ? chout : 2) * (DEFDACBLKSIZE*sizeof(float)); | 150 | int outbytes = (chout ? chout : 2) * (DEFDACBLKSIZE*sizeof(float)); |
137 | 151 | ||
@@ -144,12 +158,20 @@ static void sys_setchsr(int chin, int chout, int sr) | |||
144 | 158 | ||
145 | if (sys_soundin) | 159 | if (sys_soundin) |
146 | free(sys_soundin); | 160 | free(sys_soundin); |
161 | #ifdef ROCKBOX | ||
162 | sys_soundin = (t_sample*) malloc(inbytes); | ||
163 | #else | ||
147 | sys_soundin = (t_float *)malloc(inbytes); | 164 | sys_soundin = (t_float *)malloc(inbytes); |
165 | #endif | ||
148 | memset(sys_soundin, 0, inbytes); | 166 | memset(sys_soundin, 0, inbytes); |
149 | 167 | ||
150 | if (sys_soundout) | 168 | if (sys_soundout) |
151 | free(sys_soundout); | 169 | free(sys_soundout); |
170 | #ifdef ROCKBOX | ||
171 | sys_soundout = (t_sample*) malloc(outbytes); | ||
172 | #else | ||
152 | sys_soundout = (t_float *)malloc(outbytes); | 173 | sys_soundout = (t_float *)malloc(outbytes); |
174 | #endif | ||
153 | memset(sys_soundout, 0, outbytes); | 175 | memset(sys_soundout, 0, outbytes); |
154 | 176 | ||
155 | if (sys_verbose) | 177 | if (sys_verbose) |
@@ -169,12 +191,20 @@ void sys_open_audio(int naudioindev, int *audioindev, int nchindev, | |||
169 | int *chindev, int naudiooutdev, int *audiooutdev, int nchoutdev, | 191 | int *chindev, int naudiooutdev, int *audiooutdev, int nchoutdev, |
170 | int *choutdev, int rate, int advance, int enable) | 192 | int *choutdev, int rate, int advance, int enable) |
171 | { | 193 | { |
194 | #ifdef ROCKBOX | ||
195 | int i; | ||
196 | #else | ||
172 | int i, *ip; | 197 | int i, *ip; |
198 | #endif | ||
173 | int defaultchannels = SYS_DEFAULTCH; | 199 | int defaultchannels = SYS_DEFAULTCH; |
174 | int inchans, outchans; | 200 | int inchans, outchans; |
175 | if (rate < 1) | 201 | if (rate < 1) |
176 | rate = SYS_DEFAULTSRATE; | 202 | rate = SYS_DEFAULTSRATE; |
203 | #ifdef ROCKBOX | ||
204 | pd_audio_init(); | ||
205 | #else | ||
177 | audio_init(); | 206 | audio_init(); |
207 | #endif | ||
178 | /* Since the channel vector might be longer than the | 208 | /* Since the channel vector might be longer than the |
179 | audio device vector, or vice versa, we fill the shorter one | 209 | audio device vector, or vice versa, we fill the shorter one |
180 | in to match the longer one. Also, if both are empty, we fill in | 210 | in to match the longer one. Also, if both are empty, we fill in |
@@ -330,6 +360,11 @@ else | |||
330 | naudiooutdev, audiooutdev, nchoutdev, choutdev, rate); | 360 | naudiooutdev, audiooutdev, nchoutdev, choutdev, rate); |
331 | else | 361 | else |
332 | #endif | 362 | #endif |
363 | #ifdef USEAPI_ROCKBOX | ||
364 | if (sys_audioapi == API_ROCKBOX) | ||
365 | rockbox_open_audio(rate); | ||
366 | else | ||
367 | #endif | ||
333 | post("unknown audio API specified"); | 368 | post("unknown audio API specified"); |
334 | } | 369 | } |
335 | sys_save_audio_params(naudioindev, audioindev, chindev, | 370 | sys_save_audio_params(naudioindev, audioindev, chindev, |
@@ -337,7 +372,9 @@ else | |||
337 | if (sys_inchannels == 0 && sys_outchannels == 0) | 372 | if (sys_inchannels == 0 && sys_outchannels == 0) |
338 | enable = 0; | 373 | enable = 0; |
339 | audio_state = enable; | 374 | audio_state = enable; |
375 | #ifndef ROCKBOX | ||
340 | sys_vgui("set pd_whichapi %d\n", (audio_isopen() ? sys_audioapi : 0)); | 376 | sys_vgui("set pd_whichapi %d\n", (audio_isopen() ? sys_audioapi : 0)); |
377 | #endif | ||
341 | sched_set_using_dacs(enable); | 378 | sched_set_using_dacs(enable); |
342 | } | 379 | } |
343 | 380 | ||
@@ -370,6 +407,11 @@ void sys_close_audio(void) | |||
370 | mmio_close_audio(); | 407 | mmio_close_audio(); |
371 | else | 408 | else |
372 | #endif | 409 | #endif |
410 | #ifdef USEAPI_ROCKBOX | ||
411 | if (sys_audioapi == API_ROCKBOX) | ||
412 | rockbox_close_audio(); | ||
413 | else | ||
414 | #endif | ||
373 | post("sys_close_audio: unknown API %d", sys_audioapi); | 415 | post("sys_close_audio: unknown API %d", sys_audioapi); |
374 | sys_inchannels = sys_outchannels = 0; | 416 | sys_inchannels = sys_outchannels = 0; |
375 | } | 417 | } |
@@ -435,6 +477,11 @@ int sys_send_dacs(void) | |||
435 | return (mmio_send_dacs()); | 477 | return (mmio_send_dacs()); |
436 | else | 478 | else |
437 | #endif | 479 | #endif |
480 | #ifdef USEAPI_ROCKBOX | ||
481 | if (sys_audioapi == API_ROCKBOX) | ||
482 | return (rockbox_send_dacs()); | ||
483 | else | ||
484 | #endif | ||
438 | post("unknown API"); | 485 | post("unknown API"); |
439 | return (0); | 486 | return (0); |
440 | } | 487 | } |
@@ -482,11 +529,17 @@ void sys_reportidle(void) | |||
482 | #define MAXNDEV 20 | 529 | #define MAXNDEV 20 |
483 | #define DEVDESCSIZE 80 | 530 | #define DEVDESCSIZE 80 |
484 | 531 | ||
532 | #ifndef ROCKBOX | ||
485 | static void audio_getdevs(char *indevlist, int *nindevs, | 533 | static void audio_getdevs(char *indevlist, int *nindevs, |
486 | char *outdevlist, int *noutdevs, int *canmulti, | 534 | char *outdevlist, int *noutdevs, int *canmulti, |
487 | int maxndev, int devdescsize) | 535 | int maxndev, int devdescsize) |
488 | { | 536 | { |
537 | #ifdef ROCKBOX | ||
538 | (void) maxndev; | ||
539 | pd_audio_init(); | ||
540 | #else | ||
489 | audio_init(); | 541 | audio_init(); |
542 | #endif /* ROCKBOX */ | ||
490 | #ifdef USEAPI_OSS | 543 | #ifdef USEAPI_OSS |
491 | if (sys_audioapi == API_OSS) | 544 | if (sys_audioapi == API_OSS) |
492 | { | 545 | { |
@@ -519,6 +572,13 @@ static void audio_getdevs(char *indevlist, int *nindevs, | |||
519 | } | 572 | } |
520 | else | 573 | else |
521 | #endif | 574 | #endif |
575 | #ifdef USEAPI_ROCKBOX | ||
576 | if (sys_audioapi == API_ROCKBOX) | ||
577 | { | ||
578 | /* Rockbox devices are known in advance. (?) */ | ||
579 | } | ||
580 | else | ||
581 | #endif | ||
522 | { | 582 | { |
523 | /* this shouldn't happen once all the above get filled in. */ | 583 | /* this shouldn't happen once all the above get filled in. */ |
524 | int i; | 584 | int i; |
@@ -531,6 +591,7 @@ static void audio_getdevs(char *indevlist, int *nindevs, | |||
531 | *canmulti = 0; | 591 | *canmulti = 0; |
532 | } | 592 | } |
533 | } | 593 | } |
594 | #endif | ||
534 | 595 | ||
535 | #ifdef MSW | 596 | #ifdef MSW |
536 | #define DEVONSET 0 /* microsoft device list starts at 0 (the "mapper"). */ | 597 | #define DEVONSET 0 /* microsoft device list starts at 0 (the "mapper"). */ |
@@ -538,6 +599,7 @@ static void audio_getdevs(char *indevlist, int *nindevs, | |||
538 | #define DEVONSET 1 /* To agree with command line flags, normally start at 1 */ | 599 | #define DEVONSET 1 /* To agree with command line flags, normally start at 1 */ |
539 | #endif | 600 | #endif |
540 | 601 | ||
602 | #ifndef ROCKBOX | ||
541 | static void sys_listaudiodevs(void ) | 603 | static void sys_listaudiodevs(void ) |
542 | { | 604 | { |
543 | char indevlist[MAXNDEV*DEVDESCSIZE], outdevlist[MAXNDEV*DEVDESCSIZE]; | 605 | char indevlist[MAXNDEV*DEVDESCSIZE], outdevlist[MAXNDEV*DEVDESCSIZE]; |
@@ -564,8 +626,10 @@ static void sys_listaudiodevs(void ) | |||
564 | } | 626 | } |
565 | post("API number %d\n", sys_audioapi); | 627 | post("API number %d\n", sys_audioapi); |
566 | } | 628 | } |
629 | #endif | ||
567 | 630 | ||
568 | /* start an audio settings dialog window */ | 631 | /* start an audio settings dialog window */ |
632 | #ifndef ROCKBOX | ||
569 | void glob_audio_properties(t_pd *dummy, t_floatarg flongform) | 633 | void glob_audio_properties(t_pd *dummy, t_floatarg flongform) |
570 | { | 634 | { |
571 | char buf[1024 + 2 * MAXNDEV*(DEVDESCSIZE+4)]; | 635 | char buf[1024 + 2 * MAXNDEV*(DEVDESCSIZE+4)]; |
@@ -645,8 +709,10 @@ void glob_audio_properties(t_pd *dummy, t_floatarg flongform) | |||
645 | gfxstub_deleteforkey(0); | 709 | gfxstub_deleteforkey(0); |
646 | gfxstub_new(&glob_pdobject, glob_audio_properties, buf); | 710 | gfxstub_new(&glob_pdobject, glob_audio_properties, buf); |
647 | } | 711 | } |
712 | #endif | ||
648 | 713 | ||
649 | /* new values from dialog window */ | 714 | /* new values from dialog window */ |
715 | #ifndef ROCKBOX | ||
650 | void glob_audio_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) | 716 | void glob_audio_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) |
651 | { | 717 | { |
652 | int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; | 718 | int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; |
@@ -696,6 +762,7 @@ void glob_audio_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) | |||
696 | noutdev, newaudiooutdev, noutdev, newaudiooutchan, | 762 | noutdev, newaudiooutdev, noutdev, newaudiooutchan, |
697 | newrate, newadvance, 1); | 763 | newrate, newadvance, 1); |
698 | } | 764 | } |
765 | #endif | ||
699 | 766 | ||
700 | void sys_listdevs(void ) | 767 | void sys_listdevs(void ) |
701 | { | 768 | { |
@@ -724,6 +791,13 @@ void sys_listdevs(void ) | |||
724 | sys_listaudiodevs(); | 791 | sys_listaudiodevs(); |
725 | else | 792 | else |
726 | #endif | 793 | #endif |
794 | #ifdef USEAPI_ROCKBOX | ||
795 | if (sys_audioapi == API_ROCKBOX) | ||
796 | { | ||
797 | /* Nothing to list, IMO. */ | ||
798 | } | ||
799 | else | ||
800 | #endif | ||
727 | post("unknown API"); | 801 | post("unknown API"); |
728 | 802 | ||
729 | sys_listmididevs(); | 803 | sys_listmididevs(); |
@@ -746,9 +820,11 @@ void sys_set_audio_api(int which) | |||
746 | post("sys_audioapi %d", sys_audioapi); | 820 | post("sys_audioapi %d", sys_audioapi); |
747 | } | 821 | } |
748 | 822 | ||
823 | #ifndef ROCKBOX | ||
749 | void glob_audio_setapi(void *dummy, t_floatarg f) | 824 | void glob_audio_setapi(void *dummy, t_floatarg f) |
750 | { | 825 | { |
751 | int newapi = f; | 826 | int newapi = f; |
827 | |||
752 | if (newapi) | 828 | if (newapi) |
753 | { | 829 | { |
754 | if (newapi == sys_audioapi) | 830 | if (newapi == sys_audioapi) |
@@ -775,6 +851,7 @@ void glob_audio_setapi(void *dummy, t_floatarg f) | |||
775 | sched_set_using_dacs(0); | 851 | sched_set_using_dacs(0); |
776 | } | 852 | } |
777 | } | 853 | } |
854 | #endif | ||
778 | 855 | ||
779 | /* start or stop the audio hardware */ | 856 | /* start or stop the audio hardware */ |
780 | void sys_set_audio_state(int onoff) | 857 | void sys_set_audio_state(int onoff) |
@@ -842,6 +919,10 @@ void alsa_printstate( void); | |||
842 | void glob_foo(void *dummy, t_symbol *s, int argc, t_atom *argv) | 919 | void glob_foo(void *dummy, t_symbol *s, int argc, t_atom *argv) |
843 | { | 920 | { |
844 | t_symbol *arg = atom_getsymbolarg(0, argc, argv); | 921 | t_symbol *arg = atom_getsymbolarg(0, argc, argv); |
922 | #ifdef ROCKBOX | ||
923 | (void) dummy; | ||
924 | (void) s; | ||
925 | #endif | ||
845 | if (arg == gensym("restart")) | 926 | if (arg == gensym("restart")) |
846 | { | 927 | { |
847 | int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; | 928 | int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; |
diff --git a/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c b/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c new file mode 100644 index 0000000000..7f9b0e03e1 --- /dev/null +++ b/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c | |||
@@ -0,0 +1,144 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 Wincent Balin | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "plugin.h" | ||
23 | #include "pdbox.h" | ||
24 | |||
25 | #include "m_pd.h" | ||
26 | #include "s_stuff.h" | ||
27 | |||
28 | /* Sound output buffer. */ | ||
29 | #define AUDIO_OUTPUT_BLOCKS 3 | ||
30 | static struct pdbox_audio_block audio_output[AUDIO_OUTPUT_BLOCKS]; | ||
31 | static unsigned int output_head; | ||
32 | static unsigned int output_tail; | ||
33 | static unsigned int output_fill; | ||
34 | |||
35 | /* Open audio. */ | ||
36 | void rockbox_open_audio(int rate) | ||
37 | { | ||
38 | unsigned int i; | ||
39 | |||
40 | /* Initialize output buffer. */ | ||
41 | for(i = 0; i < AUDIO_OUTPUT_BLOCKS; i++) | ||
42 | audio_output[i].fill = 0; | ||
43 | |||
44 | output_head = 0; | ||
45 | output_tail = 0; | ||
46 | output_fill = 0; | ||
47 | |||
48 | #if INPUT_SRC_CAPS != 0 | ||
49 | /* Select playback */ | ||
50 | rb->audio_set_input_source(AUDIO_SRC_PLAYBACK, SRCF_PLAYBACK); | ||
51 | rb->audio_set_output_source(AUDIO_SRC_PLAYBACK); | ||
52 | #endif | ||
53 | |||
54 | /* Set sample rate of the audio buffer. */ | ||
55 | rb->pcm_set_frequency(rate); | ||
56 | } | ||
57 | |||
58 | /* Close audio. */ | ||
59 | void rockbox_close_audio(void) | ||
60 | { | ||
61 | /* Stop playback. */ | ||
62 | rb->pcm_play_stop(); | ||
63 | |||
64 | /* Restore default sampling rate. */ | ||
65 | rb->pcm_set_frequency(HW_SAMPR_DEFAULT); | ||
66 | } | ||
67 | |||
68 | /* Rockbox audio callback. */ | ||
69 | void pdbox_get_more(unsigned char** start, size_t* size) | ||
70 | { | ||
71 | if(output_fill > 0) | ||
72 | { | ||
73 | /* Store output data address and size. */ | ||
74 | *start = (unsigned char*) audio_output[output_tail].data; | ||
75 | *size = audio_output[output_tail].fill; | ||
76 | |||
77 | /* Advance tail index. */ | ||
78 | audio_output[output_tail].fill = 0; | ||
79 | output_fill--; | ||
80 | if(output_tail == AUDIO_OUTPUT_BLOCKS-1) | ||
81 | output_tail = 0; | ||
82 | else | ||
83 | output_tail++; | ||
84 | } | ||
85 | else | ||
86 | { | ||
87 | /* Nothing to play. */ | ||
88 | *start = NULL; | ||
89 | *size = 0; | ||
90 | return; | ||
91 | } | ||
92 | } | ||
93 | |||
94 | /* Audio I/O. */ | ||
95 | int rockbox_send_dacs(void) | ||
96 | { | ||
97 | |||
98 | |||
99 | /* Start playback if needed and possible. */ | ||
100 | if(output_fill > 1 && | ||
101 | audio_output[output_tail].fill == PD_AUDIO_BLOCK_SIZE) | ||
102 | { | ||
103 | /* Start playback. */ | ||
104 | rb->pcm_play_data(pdbox_get_more, | ||
105 | (unsigned char*) audio_output[output_tail].data, | ||
106 | PD_AUDIO_BLOCK_SIZE); | ||
107 | |||
108 | /* Advance tail index. */ | ||
109 | audio_output[output_tail].fill = PD_AUDIO_BLOCK_SIZE; | ||
110 | output_fill--; | ||
111 | if(output_tail == AUDIO_OUTPUT_BLOCKS-1) | ||
112 | output_tail = 0; | ||
113 | else | ||
114 | output_tail++; | ||
115 | } | ||
116 | |||
117 | |||
118 | |||
119 | |||
120 | #if 0 | ||
121 | if (sys_getrealtime() > timebefore + 0.002) | ||
122 | { | ||
123 | /* post("slept"); */ | ||
124 | return (SENDDACS_SLEPT); | ||
125 | } | ||
126 | else | ||
127 | #endif | ||
128 | return (SENDDACS_YES); | ||
129 | } | ||
130 | |||
131 | /* Placeholder. */ | ||
132 | void rockbox_listdevs(void) | ||
133 | { | ||
134 | } | ||
135 | |||
136 | #if 0 | ||
137 | /* Scanning for devices */ | ||
138 | void rockbox_getdevs(char *indevlist, int *nindevs, | ||
139 | char *outdevlist, int *noutdevs, int *canmulti, | ||
140 | int maxndev, int devdescsize) | ||
141 | { | ||
142 | } | ||
143 | #endif | ||
144 | |||
diff --git a/apps/plugins/pdbox/PDa/src/s_file.c b/apps/plugins/pdbox/PDa/src/s_file.c index 27825d5948..f98741cf2a 100644 --- a/apps/plugins/pdbox/PDa/src/s_file.c +++ b/apps/plugins/pdbox/PDa/src/s_file.c | |||
@@ -6,14 +6,32 @@ | |||
6 | * this file contains file-handling routines. | 6 | * this file contains file-handling routines. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #ifdef ROCKBOX | ||
10 | #include "plugin.h" | ||
11 | #include "pdbox.h" | ||
12 | #include "m_pd.h" | ||
13 | #include "s_stuff.h" | ||
14 | #else /* ROCKBOX */ | ||
9 | #include "m_pd.h" | 15 | #include "m_pd.h" |
10 | #include "s_stuff.h" | 16 | #include "s_stuff.h" |
11 | #include <sys/types.h> | 17 | #include <sys/types.h> |
12 | #include <sys/stat.h> | 18 | #include <sys/stat.h> |
19 | #endif /* ROCKBOX */ | ||
13 | 20 | ||
14 | /* LATER delete this? -- replaced by find_via_path() in s_path.c */ | 21 | /* LATER delete this? -- replaced by find_via_path() in s_path.c */ |
15 | int sys_isreadablefile(const char *s) | 22 | int sys_isreadablefile(const char *s) |
16 | { | 23 | { |
24 | #ifdef ROCKBOX | ||
25 | int fd; | ||
26 | |||
27 | if((fd = open(s, O_RDONLY))) | ||
28 | { | ||
29 | close(fd); | ||
30 | return 1; | ||
31 | } | ||
32 | else | ||
33 | return 0; | ||
34 | #else /* ROCKBOX */ | ||
17 | struct stat statbuf; | 35 | struct stat statbuf; |
18 | int mode; | 36 | int mode; |
19 | if (stat(s, &statbuf) < 0) return (0); | 37 | if (stat(s, &statbuf) < 0) return (0); |
@@ -22,13 +40,14 @@ int sys_isreadablefile(const char *s) | |||
22 | if (S_ISDIR(mode)) return (0); | 40 | if (S_ISDIR(mode)) return (0); |
23 | #endif | 41 | #endif |
24 | return (1); | 42 | return (1); |
43 | #endif /* ROCKBOX */ | ||
25 | } | 44 | } |
26 | 45 | ||
27 | /* change '/' characters to the system's native file separator */ | 46 | /* change '/' characters to the system's native file separator */ |
28 | void sys_bashfilename(const char *from, char *to) | 47 | void sys_bashfilename(const char *from, char *to) |
29 | { | 48 | { |
30 | char c; | 49 | char c; |
31 | while (c = *from++) | 50 | while((c = *from++)) |
32 | { | 51 | { |
33 | #ifdef MSW | 52 | #ifdef MSW |
34 | if (c == '/') c = '\\'; | 53 | if (c == '/') c = '\\'; |
@@ -43,7 +62,7 @@ void sys_bashfilename(const char *from, char *to) | |||
43 | void sys_unbashfilename(const char *from, char *to) | 62 | void sys_unbashfilename(const char *from, char *to) |
44 | { | 63 | { |
45 | char c; | 64 | char c; |
46 | while (c = *from++) | 65 | while((c = *from++)) |
47 | { | 66 | { |
48 | #ifdef MSW | 67 | #ifdef MSW |
49 | if (c == '\\') c = '/'; | 68 | if (c == '\\') c = '/'; |
diff --git a/apps/plugins/pdbox/PDa/src/s_loader.c b/apps/plugins/pdbox/PDa/src/s_loader.c index c5a8677f71..7f47b1f8f8 100644 --- a/apps/plugins/pdbox/PDa/src/s_loader.c +++ b/apps/plugins/pdbox/PDa/src/s_loader.c | |||
@@ -2,6 +2,10 @@ | |||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | 2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL |
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | 3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ |
4 | 4 | ||
5 | #ifdef ROCKBOX | ||
6 | #include "plugin.h" | ||
7 | #include "pdbox.h" | ||
8 | #else /* ROCKBOX */ | ||
5 | #ifdef DL_OPEN | 9 | #ifdef DL_OPEN |
6 | #include <dlfcn.h> | 10 | #include <dlfcn.h> |
7 | #endif | 11 | #endif |
@@ -17,12 +21,14 @@ | |||
17 | #include <mach-o/dyld.h> | 21 | #include <mach-o/dyld.h> |
18 | #endif | 22 | #endif |
19 | #include <string.h> | 23 | #include <string.h> |
24 | #include <stdio.h> | ||
25 | #endif /* ROCKBOX */ | ||
20 | #include "m_pd.h" | 26 | #include "m_pd.h" |
21 | #include "s_stuff.h" | 27 | #include "s_stuff.h" |
22 | #include <stdio.h> | ||
23 | 28 | ||
24 | typedef void (*t_xxx)(void); | 29 | typedef void (*t_xxx)(void); |
25 | 30 | ||
31 | #ifndef ROCKBOX | ||
26 | static char sys_dllextent[] = | 32 | static char sys_dllextent[] = |
27 | #ifdef __FreeBSD__ | 33 | #ifdef __FreeBSD__ |
28 | ".pd_freebsd"; | 34 | ".pd_freebsd"; |
@@ -43,12 +49,22 @@ static char sys_dllextent[] = | |||
43 | #ifdef MSW | 49 | #ifdef MSW |
44 | ".dll"; | 50 | ".dll"; |
45 | #endif | 51 | #endif |
52 | #endif /* ROCKBOX */ | ||
46 | 53 | ||
47 | void class_set_extern_dir(t_symbol *s); | 54 | void class_set_extern_dir(t_symbol *s); |
48 | 55 | ||
49 | #ifdef STATIC | 56 | #ifdef STATIC |
50 | int sys_load_lib(char *dirname, char *classname) | 57 | int sys_load_lib(char *dirname, char *classname) |
58 | #ifdef ROCKBOX | ||
59 | { | ||
60 | (void) dirname; | ||
61 | (void) classname; | ||
62 | |||
63 | return 0; | ||
64 | } | ||
65 | #else /* ROCKBOX */ | ||
51 | { return 0;} | 66 | { return 0;} |
67 | #endif /* ROCKBOX */ | ||
52 | #else | 68 | #else |
53 | int sys_load_lib(char *dirname, char *classname) | 69 | int sys_load_lib(char *dirname, char *classname) |
54 | { | 70 | { |
diff --git a/apps/plugins/pdbox/PDa/src/s_path.c b/apps/plugins/pdbox/PDa/src/s_path.c index f40f1f6e49..da4fc94782 100644 --- a/apps/plugins/pdbox/PDa/src/s_path.c +++ b/apps/plugins/pdbox/PDa/src/s_path.c | |||
@@ -14,6 +14,26 @@ | |||
14 | #define DEBUG(x) | 14 | #define DEBUG(x) |
15 | void readsf_banana( void); /* debugging */ | 15 | void readsf_banana( void); /* debugging */ |
16 | 16 | ||
17 | #ifdef ROCKBOX | ||
18 | |||
19 | #include "plugin.h" | ||
20 | #include "pdbox.h" | ||
21 | |||
22 | #include "m_pd.h" | ||
23 | #include "m_imp.h" | ||
24 | #include "s_stuff.h" | ||
25 | |||
26 | #define open rb->open | ||
27 | #define close rb->close | ||
28 | #define strcpy rb->strcpy | ||
29 | #define strcat rb->strcat | ||
30 | #define strlen rb->strlen | ||
31 | #define strcmp rb->strcmp | ||
32 | #define strncpy rb->strncpy | ||
33 | #define strrchr rb->strrchr | ||
34 | #define strncat rb_strncat | ||
35 | |||
36 | #else /* ROCKBOX */ | ||
17 | #include <stdlib.h> | 37 | #include <stdlib.h> |
18 | #ifdef UNIX | 38 | #ifdef UNIX |
19 | #include <unistd.h> | 39 | #include <unistd.h> |
@@ -29,6 +49,7 @@ void readsf_banana( void); /* debugging */ | |||
29 | #include "s_stuff.h" | 49 | #include "s_stuff.h" |
30 | #include <stdio.h> | 50 | #include <stdio.h> |
31 | #include <fcntl.h> | 51 | #include <fcntl.h> |
52 | #endif /* ROCKBOX */ | ||
32 | 53 | ||
33 | static t_namelist *pd_path, *pd_helppath; | 54 | static t_namelist *pd_path, *pd_helppath; |
34 | 55 | ||
@@ -85,6 +106,10 @@ t_namelist *namelist_append(t_namelist *listwas, const char *s) | |||
85 | char temp[MAXPDSTRING]; | 106 | char temp[MAXPDSTRING]; |
86 | t_namelist *nl = listwas, *rtn = listwas; | 107 | t_namelist *nl = listwas, *rtn = listwas; |
87 | 108 | ||
109 | #ifdef ROCKBOX | ||
110 | (void) rtn; | ||
111 | #endif | ||
112 | |||
88 | npos = s; | 113 | npos = s; |
89 | do | 114 | do |
90 | { | 115 | { |
@@ -138,6 +163,10 @@ int open_via_path(const char *dir, const char *name, const char* ext, | |||
138 | int fd = -1; | 163 | int fd = -1; |
139 | char listbuf[MAXPDSTRING]; | 164 | char listbuf[MAXPDSTRING]; |
140 | 165 | ||
166 | #ifdef ROCKBOX | ||
167 | (void) bin; | ||
168 | #endif | ||
169 | |||
141 | if (name[0] == '/' | 170 | if (name[0] == '/' |
142 | #ifdef MSW | 171 | #ifdef MSW |
143 | || (name[1] == ':' && name[2] == '/') | 172 | || (name[1] == ':' && name[2] == '/') |
@@ -191,6 +220,7 @@ int open_via_path(const char *dir, const char *name, const char* ext, | |||
191 | char *slash; | 220 | char *slash; |
192 | if (sys_verbose) post("tried %s and succeeded", dirresult); | 221 | if (sys_verbose) post("tried %s and succeeded", dirresult); |
193 | sys_unbashfilename(dirresult, dirresult); | 222 | sys_unbashfilename(dirresult, dirresult); |
223 | |||
194 | slash = strrchr(dirresult, '/'); | 224 | slash = strrchr(dirresult, '/'); |
195 | if (slash) | 225 | if (slash) |
196 | { | 226 | { |
@@ -199,7 +229,7 @@ int open_via_path(const char *dir, const char *name, const char* ext, | |||
199 | } | 229 | } |
200 | else *nameresult = dirresult; | 230 | else *nameresult = dirresult; |
201 | 231 | ||
202 | return (fd); | 232 | return (fd); |
203 | } | 233 | } |
204 | } | 234 | } |
205 | else | 235 | else |
@@ -245,7 +275,9 @@ static int do_open_via_helppath(const char *realname, t_namelist *listp) | |||
245 | else | 275 | else |
246 | #endif | 276 | #endif |
247 | { | 277 | { |
278 | #ifndef ROCKBOX | ||
248 | char *slash; | 279 | char *slash; |
280 | #endif | ||
249 | if (sys_verbose) post("tried %s and succeeded", dirresult); | 281 | if (sys_verbose) post("tried %s and succeeded", dirresult); |
250 | sys_unbashfilename(dirresult, dirresult); | 282 | sys_unbashfilename(dirresult, dirresult); |
251 | close (fd); | 283 | close (fd); |
@@ -266,8 +298,12 @@ static int do_open_via_helppath(const char *realname, t_namelist *listp) | |||
266 | search attempts. */ | 298 | search attempts. */ |
267 | void open_via_helppath(const char *name, const char *dir) | 299 | void open_via_helppath(const char *name, const char *dir) |
268 | { | 300 | { |
301 | #ifdef ROCKBOX | ||
302 | t_namelist thislist, *listp; | ||
303 | #else /*ROCKBOX */ | ||
269 | t_namelist *nl, thislist, *listp; | 304 | t_namelist *nl, thislist, *listp; |
270 | int fd = -1; | 305 | int fd = -1; |
306 | #endif /* ROCKBOX */ | ||
271 | char dirbuf2[MAXPDSTRING], realname[MAXPDSTRING]; | 307 | char dirbuf2[MAXPDSTRING], realname[MAXPDSTRING]; |
272 | 308 | ||
273 | /* if directory is supplied, put it at head of search list. */ | 309 | /* if directory is supplied, put it at head of search list. */ |
@@ -380,6 +416,10 @@ int sys_rcfile(void) | |||
380 | /* start an audio settings dialog window */ | 416 | /* start an audio settings dialog window */ |
381 | void glob_start_path_dialog(t_pd *dummy, t_floatarg flongform) | 417 | void glob_start_path_dialog(t_pd *dummy, t_floatarg flongform) |
382 | { | 418 | { |
419 | #ifdef ROCKBOX | ||
420 | (void) dummy; | ||
421 | (void) flongform; | ||
422 | #else /* ROCKBOX */ | ||
383 | char buf[MAXPDSTRING]; | 423 | char buf[MAXPDSTRING]; |
384 | int i; | 424 | int i; |
385 | t_namelist *nl; | 425 | t_namelist *nl; |
@@ -391,12 +431,19 @@ void glob_start_path_dialog(t_pd *dummy, t_floatarg flongform) | |||
391 | 431 | ||
392 | sprintf(buf, "pdtk_path_dialog %%s\n"); | 432 | sprintf(buf, "pdtk_path_dialog %%s\n"); |
393 | gfxstub_new(&glob_pdobject, glob_start_path_dialog, buf); | 433 | gfxstub_new(&glob_pdobject, glob_start_path_dialog, buf); |
434 | #endif /* ROCKBOX */ | ||
394 | } | 435 | } |
395 | 436 | ||
396 | /* new values from dialog window */ | 437 | /* new values from dialog window */ |
397 | void glob_path_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) | 438 | void glob_path_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) |
398 | { | 439 | { |
399 | int i; | 440 | int i; |
441 | |||
442 | #ifdef ROCKBOX | ||
443 | (void) dummy; | ||
444 | (void) s; | ||
445 | #endif /* ROCKBOX */ | ||
446 | |||
400 | namelist_free(pd_path); | 447 | namelist_free(pd_path); |
401 | pd_path = 0; | 448 | pd_path = 0; |
402 | for (i = 0; i < argc; i++) | 449 | for (i = 0; i < argc; i++) |
diff --git a/apps/plugins/pdbox/PDa/src/s_print.c b/apps/plugins/pdbox/PDa/src/s_print.c index 40f881f00e..c71dcb7845 100644 --- a/apps/plugins/pdbox/PDa/src/s_print.c +++ b/apps/plugins/pdbox/PDa/src/s_print.c | |||
@@ -79,7 +79,7 @@ void poststring(char *s) | |||
79 | #ifdef SIMULATOR | 79 | #ifdef SIMULATOR |
80 | printf(" %s", s); | 80 | printf(" %s", s); |
81 | #else /* SIMULATOR */ | 81 | #else /* SIMULATOR */ |
82 | (void)s; | 82 | (void) s; |
83 | #endif /* SIMULATOR */ | 83 | #endif /* SIMULATOR */ |
84 | #else /* ROCKBOX */ | 84 | #else /* ROCKBOX */ |
85 | fprintf(stderr, " %s", s); | 85 | fprintf(stderr, " %s", s); |
@@ -167,7 +167,7 @@ void pd_error(void *object, char *fmt, ...) | |||
167 | saidit = 1; | 167 | saidit = 1; |
168 | } | 168 | } |
169 | #else /* SIMULATOR */ | 169 | #else /* SIMULATOR */ |
170 | (void)object; | 170 | (void) object; |
171 | (void) fmt; | 171 | (void) fmt; |
172 | #endif /* SIMULATOR */ | 172 | #endif /* SIMULATOR */ |
173 | #else /* ROCKBOX */ | 173 | #else /* ROCKBOX */ |
@@ -191,7 +191,7 @@ void pd_error(void *object, char *fmt, ...) | |||
191 | void glob_finderror(t_pd *dummy) | 191 | void glob_finderror(t_pd *dummy) |
192 | { | 192 | { |
193 | #ifdef ROCKBOX | 193 | #ifdef ROCKBOX |
194 | (void)dummy; | 194 | (void) dummy; |
195 | #endif /* ROCKBOX */ | 195 | #endif /* ROCKBOX */ |
196 | if (!error_object) | 196 | if (!error_object) |
197 | post("no findable error yet."); | 197 | post("no findable error yet."); |
@@ -250,8 +250,12 @@ void sys_logerror(char *object, char *s) | |||
250 | 250 | ||
251 | void sys_unixerror(char *object) | 251 | void sys_unixerror(char *object) |
252 | { | 252 | { |
253 | #ifdef ROCKBOX | ||
254 | (void) object; | ||
255 | #else | ||
253 | errobject = object; | 256 | errobject = object; |
254 | errstring = strerror(errno); | 257 | errstring = strerror(errno); |
258 | #endif /* ROCKBOX */ | ||
255 | } | 259 | } |
256 | 260 | ||
257 | void sys_ouch(void) | 261 | void sys_ouch(void) |
diff --git a/apps/plugins/pdbox/PDa/src/s_stuff.h b/apps/plugins/pdbox/PDa/src/s_stuff.h index 2c7ae8b209..566df34773 100644 --- a/apps/plugins/pdbox/PDa/src/s_stuff.h +++ b/apps/plugins/pdbox/PDa/src/s_stuff.h | |||
@@ -130,8 +130,9 @@ void sys_setvirtualalarm( void); | |||
130 | #define API_MMIO 3 | 130 | #define API_MMIO 3 |
131 | #define API_PORTAUDIO 4 | 131 | #define API_PORTAUDIO 4 |
132 | #define API_JACK 5 | 132 | #define API_JACK 5 |
133 | #define API_ROCKBOX 6 | ||
133 | 134 | ||
134 | #ifdef __linux__ | 135 | #if defined(__linux__) && !defined(ROCKBOX) |
135 | #define API_DEFAULT API_OSS | 136 | #define API_DEFAULT API_OSS |
136 | #define API_DEFSTRING "OSS" | 137 | #define API_DEFSTRING "OSS" |
137 | #endif | 138 | #endif |
@@ -143,6 +144,10 @@ void sys_setvirtualalarm( void); | |||
143 | #define API_DEFAULT API_PORTAUDIO | 144 | #define API_DEFAULT API_PORTAUDIO |
144 | #define API_DEFSTRING "portaudio" | 145 | #define API_DEFSTRING "portaudio" |
145 | #endif | 146 | #endif |
147 | #ifdef ROCKBOX | ||
148 | #define API_DEFAULT API_ROCKBOX | ||
149 | #define API_DEFSTRING "Rockbox" | ||
150 | #endif | ||
146 | #define DEFAULTAUDIODEV 0 | 151 | #define DEFAULTAUDIODEV 0 |
147 | 152 | ||
148 | #define MAXAUDIOINDEV 4 | 153 | #define MAXAUDIOINDEV 4 |
@@ -204,6 +209,11 @@ void mmio_getdevs(char *indevlist, int *nindevs, | |||
204 | char *outdevlist, int *noutdevs, int *canmulti, | 209 | char *outdevlist, int *noutdevs, int *canmulti, |
205 | int maxndev, int devdescsize); | 210 | int maxndev, int devdescsize); |
206 | 211 | ||
212 | void rockbox_open_audio(int rate); | ||
213 | void rockbox_close_audio(void); | ||
214 | int rockbox_send_dacs(void); | ||
215 | void rockbox_getdevs(void); | ||
216 | |||
207 | void sys_listmididevs(void); | 217 | void sys_listmididevs(void); |
208 | void sys_set_audio_api(int whichapi); | 218 | void sys_set_audio_api(int whichapi); |
209 | void sys_get_audio_apis(char *buf); | 219 | void sys_get_audio_apis(char *buf); |
diff --git a/apps/plugins/pdbox/PDa/src/x_acoustics.c b/apps/plugins/pdbox/PDa/src/x_acoustics.c index 9c5cd07495..cb2b01fe41 100644 --- a/apps/plugins/pdbox/PDa/src/x_acoustics.c +++ b/apps/plugins/pdbox/PDa/src/x_acoustics.c | |||
@@ -5,6 +5,11 @@ | |||
5 | /* utility functions for signals | 5 | /* utility functions for signals |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #ifdef ROCKBOX | ||
9 | #include "plugin.h" | ||
10 | #include "pdbox.h" | ||
11 | #endif | ||
12 | |||
8 | #include "m_pd.h" | 13 | #include "m_pd.h" |
9 | #include <math.h> | 14 | #include <math.h> |
10 | #define LOGTEN 2.302585092994 | 15 | #define LOGTEN 2.302585092994 |
diff --git a/apps/plugins/pdbox/PDa/src/x_arithmetic.c b/apps/plugins/pdbox/PDa/src/x_arithmetic.c index f060f2fd49..3ac5b5f075 100644 --- a/apps/plugins/pdbox/PDa/src/x_arithmetic.c +++ b/apps/plugins/pdbox/PDa/src/x_arithmetic.c | |||
@@ -6,6 +6,11 @@ | |||
6 | done on floats; the logical and bitwise binops convert their | 6 | done on floats; the logical and bitwise binops convert their |
7 | inputs to int and their outputs back to float. */ | 7 | inputs to int and their outputs back to float. */ |
8 | 8 | ||
9 | #ifdef ROCKBOX | ||
10 | #include "plugin.h" | ||
11 | #include "pdbox.h" | ||
12 | #endif | ||
13 | |||
9 | #include "m_pd.h" | 14 | #include "m_pd.h" |
10 | #include <math.h> | 15 | #include <math.h> |
11 | 16 | ||
diff --git a/apps/plugins/pdbox/PDa/src/x_connective.c b/apps/plugins/pdbox/PDa/src/x_connective.c index 52bc0920a1..8ad2f605cf 100644 --- a/apps/plugins/pdbox/PDa/src/x_connective.c +++ b/apps/plugins/pdbox/PDa/src/x_connective.c | |||
@@ -4,10 +4,18 @@ | |||
4 | 4 | ||
5 | /* connective objects */ | 5 | /* connective objects */ |
6 | 6 | ||
7 | #ifdef ROCKBOX | ||
8 | #include "plugin.h" | ||
9 | #include "pdbox.h" | ||
10 | #endif | ||
11 | |||
7 | #include "m_pd.h" | 12 | #include "m_pd.h" |
8 | 13 | ||
14 | #ifndef ROCKBOX | ||
9 | #include <string.h> | 15 | #include <string.h> |
10 | #include <stdio.h> | 16 | #include <stdio.h> |
17 | #endif | ||
18 | |||
11 | extern t_pd *newest; | 19 | extern t_pd *newest; |
12 | 20 | ||
13 | /* -------------------------- int ------------------------------ */ | 21 | /* -------------------------- int ------------------------------ */ |
@@ -62,6 +70,9 @@ typedef struct _pdfloat | |||
62 | 70 | ||
63 | static void *pdfloat_new(t_pd *dummy, t_float f) | 71 | static void *pdfloat_new(t_pd *dummy, t_float f) |
64 | { | 72 | { |
73 | #ifdef ROCKBOX | ||
74 | (void) dummy; | ||
75 | #endif | ||
65 | t_pdfloat *x = (t_pdfloat *)pd_new(pdfloat_class); | 76 | t_pdfloat *x = (t_pdfloat *)pd_new(pdfloat_class); |
66 | x->x_f = f; | 77 | x->x_f = f; |
67 | outlet_new(&x->x_obj, &s_float); | 78 | outlet_new(&x->x_obj, &s_float); |
@@ -105,6 +116,9 @@ typedef struct _pdsymbol | |||
105 | 116 | ||
106 | static void *pdsymbol_new(t_pd *dummy, t_symbol *s) | 117 | static void *pdsymbol_new(t_pd *dummy, t_symbol *s) |
107 | { | 118 | { |
119 | #ifdef ROCKBOX | ||
120 | (void) dummy; | ||
121 | #endif | ||
108 | t_pdsymbol *x = (t_pdsymbol *)pd_new(pdsymbol_class); | 122 | t_pdsymbol *x = (t_pdsymbol *)pd_new(pdsymbol_class); |
109 | x->x_s = s; | 123 | x->x_s = s; |
110 | outlet_new(&x->x_obj, &s_symbol); | 124 | outlet_new(&x->x_obj, &s_symbol); |
@@ -125,6 +139,10 @@ static void pdsymbol_symbol(t_pdsymbol *x, t_symbol *s) | |||
125 | 139 | ||
126 | static void pdsymbol_anything(t_pdsymbol *x, t_symbol *s, int ac, t_atom *av) | 140 | static void pdsymbol_anything(t_pdsymbol *x, t_symbol *s, int ac, t_atom *av) |
127 | { | 141 | { |
142 | #ifdef ROCKBOX | ||
143 | (void) ac; | ||
144 | (void) av; | ||
145 | #endif | ||
128 | outlet_symbol(x->x_obj.ob_outlet, x->x_s = s); | 146 | outlet_symbol(x->x_obj.ob_outlet, x->x_s = s); |
129 | } | 147 | } |
130 | 148 | ||
@@ -147,6 +165,9 @@ typedef struct _bang | |||
147 | 165 | ||
148 | static void *bang_new(t_pd *dummy) | 166 | static void *bang_new(t_pd *dummy) |
149 | { | 167 | { |
168 | #ifdef ROCKBOX | ||
169 | (void) dummy; | ||
170 | #endif | ||
150 | t_bang *x = (t_bang *)pd_new(bang_class); | 171 | t_bang *x = (t_bang *)pd_new(bang_class); |
151 | outlet_new(&x->x_obj, &s_bang); | 172 | outlet_new(&x->x_obj, &s_bang); |
152 | newest = &x->x_obj.ob_pd; | 173 | newest = &x->x_obj.ob_pd; |
@@ -155,6 +176,9 @@ static void *bang_new(t_pd *dummy) | |||
155 | 176 | ||
156 | static void *bang_new2(t_bang f) | 177 | static void *bang_new2(t_bang f) |
157 | { | 178 | { |
179 | #ifdef ROCKBOX | ||
180 | (void) f; | ||
181 | #endif | ||
158 | return (bang_new(0)); | 182 | return (bang_new(0)); |
159 | } | 183 | } |
160 | 184 | ||
@@ -383,6 +407,9 @@ static void sel2_free(t_sel2 *x) | |||
383 | 407 | ||
384 | static void *select_new(t_symbol *s, int argc, t_atom *argv) | 408 | static void *select_new(t_symbol *s, int argc, t_atom *argv) |
385 | { | 409 | { |
410 | #ifdef ROCKBOX | ||
411 | (void) s; | ||
412 | #endif | ||
386 | t_atom a; | 413 | t_atom a; |
387 | if (argc == 0) | 414 | if (argc == 0) |
388 | { | 415 | { |
@@ -484,6 +511,9 @@ static void route_anything(t_route *x, t_symbol *sel, int argc, t_atom *argv) | |||
484 | 511 | ||
485 | static void route_list(t_route *x, t_symbol *sel, int argc, t_atom *argv) | 512 | static void route_list(t_route *x, t_symbol *sel, int argc, t_atom *argv) |
486 | { | 513 | { |
514 | #ifdef ROCKBOX | ||
515 | (void) sel; | ||
516 | #endif | ||
487 | t_routeelement *e; | 517 | t_routeelement *e; |
488 | int nelement; | 518 | int nelement; |
489 | if (x->x_type == A_FLOAT) | 519 | if (x->x_type == A_FLOAT) |
@@ -562,6 +592,9 @@ static void route_free(t_route *x) | |||
562 | 592 | ||
563 | static void *route_new(t_symbol *s, int argc, t_atom *argv) | 593 | static void *route_new(t_symbol *s, int argc, t_atom *argv) |
564 | { | 594 | { |
595 | #ifdef ROCKBOX | ||
596 | (void) s; | ||
597 | #endif | ||
565 | int n; | 598 | int n; |
566 | t_routeelement *e; | 599 | t_routeelement *e; |
567 | t_route *x = (t_route *)pd_new(route_class); | 600 | t_route *x = (t_route *)pd_new(route_class); |
@@ -610,6 +643,9 @@ typedef struct _pack | |||
610 | 643 | ||
611 | static void *pack_new(t_symbol *s, int argc, t_atom *argv) | 644 | static void *pack_new(t_symbol *s, int argc, t_atom *argv) |
612 | { | 645 | { |
646 | #ifdef ROCKBOX | ||
647 | (void) s; | ||
648 | #endif | ||
613 | t_pack *x = (t_pack *)pd_new(pack_class); | 649 | t_pack *x = (t_pack *)pd_new(pack_class); |
614 | t_atom defarg[2], *ap, *vec, *vp; | 650 | t_atom defarg[2], *ap, *vec, *vp; |
615 | t_gpointer *gp; | 651 | t_gpointer *gp; |
@@ -737,6 +773,9 @@ static void pack_symbol(t_pack *x, t_symbol *s) | |||
737 | 773 | ||
738 | static void pack_list(t_pack *x, t_symbol *s, int ac, t_atom *av) | 774 | static void pack_list(t_pack *x, t_symbol *s, int ac, t_atom *av) |
739 | { | 775 | { |
776 | #ifdef ROCKBOX | ||
777 | (void) s; | ||
778 | #endif | ||
740 | obj_list(&x->x_obj, 0, ac, av); | 779 | obj_list(&x->x_obj, 0, ac, av); |
741 | } | 780 | } |
742 | 781 | ||
@@ -793,6 +832,9 @@ typedef struct _unpack | |||
793 | 832 | ||
794 | static void *unpack_new(t_symbol *s, int argc, t_atom *argv) | 833 | static void *unpack_new(t_symbol *s, int argc, t_atom *argv) |
795 | { | 834 | { |
835 | #ifdef ROCKBOX | ||
836 | (void) s; | ||
837 | #endif | ||
796 | t_unpack *x = (t_unpack *)pd_new(unpack_class); | 838 | t_unpack *x = (t_unpack *)pd_new(unpack_class); |
797 | t_atom defarg[2], *ap; | 839 | t_atom defarg[2], *ap; |
798 | t_unpackout *u; | 840 | t_unpackout *u; |
@@ -841,6 +883,9 @@ static void *unpack_new(t_symbol *s, int argc, t_atom *argv) | |||
841 | 883 | ||
842 | static void unpack_list(t_unpack *x, t_symbol *s, int argc, t_atom *argv) | 884 | static void unpack_list(t_unpack *x, t_symbol *s, int argc, t_atom *argv) |
843 | { | 885 | { |
886 | #ifdef ROCKBOX | ||
887 | (void) s; | ||
888 | #endif | ||
844 | t_atom *ap; | 889 | t_atom *ap; |
845 | t_unpackout *u; | 890 | t_unpackout *u; |
846 | int i; | 891 | int i; |
@@ -907,6 +952,9 @@ typedef struct _trigger | |||
907 | 952 | ||
908 | static void *trigger_new(t_symbol *s, int argc, t_atom *argv) | 953 | static void *trigger_new(t_symbol *s, int argc, t_atom *argv) |
909 | { | 954 | { |
955 | #ifdef ROCKBOX | ||
956 | (void) s; | ||
957 | #endif | ||
910 | t_trigger *x = (t_trigger *)pd_new(trigger_class); | 958 | t_trigger *x = (t_trigger *)pd_new(trigger_class); |
911 | t_atom defarg[2], *ap; | 959 | t_atom defarg[2], *ap; |
912 | t_triggerout *u; | 960 | t_triggerout *u; |
@@ -953,6 +1001,9 @@ static void *trigger_new(t_symbol *s, int argc, t_atom *argv) | |||
953 | 1001 | ||
954 | static void trigger_list(t_trigger *x, t_symbol *s, int argc, t_atom *argv) | 1002 | static void trigger_list(t_trigger *x, t_symbol *s, int argc, t_atom *argv) |
955 | { | 1003 | { |
1004 | #ifdef ROCKBOX | ||
1005 | (void) s; | ||
1006 | #endif | ||
956 | t_triggerout *u; | 1007 | t_triggerout *u; |
957 | int i; | 1008 | int i; |
958 | t_atom at; | 1009 | t_atom at; |
@@ -1204,14 +1255,22 @@ static void *makefilename_new(t_symbol *s) | |||
1204 | static void makefilename_float(t_makefilename *x, t_floatarg f) | 1255 | static void makefilename_float(t_makefilename *x, t_floatarg f) |
1205 | { | 1256 | { |
1206 | char buf[MAXPDSTRING]; | 1257 | char buf[MAXPDSTRING]; |
1258 | #ifdef ROCKBOX | ||
1259 | snprintf(buf, sizeof(buf), x->x_format->s_name, (int)f); | ||
1260 | #else | ||
1207 | sprintf(buf, x->x_format->s_name, (int)f); | 1261 | sprintf(buf, x->x_format->s_name, (int)f); |
1262 | #endif | ||
1208 | outlet_symbol(x->x_obj.ob_outlet, gensym(buf)); | 1263 | outlet_symbol(x->x_obj.ob_outlet, gensym(buf)); |
1209 | } | 1264 | } |
1210 | 1265 | ||
1211 | static void makefilename_symbol(t_makefilename *x, t_symbol *s) | 1266 | static void makefilename_symbol(t_makefilename *x, t_symbol *s) |
1212 | { | 1267 | { |
1213 | char buf[MAXPDSTRING]; | 1268 | char buf[MAXPDSTRING]; |
1269 | #ifdef ROCKBOX | ||
1270 | snprintf(buf, sizeof(buf), x->x_format->s_name, s->s_name); | ||
1271 | #else | ||
1214 | sprintf(buf, x->x_format->s_name, s->s_name); | 1272 | sprintf(buf, x->x_format->s_name, s->s_name); |
1273 | #endif | ||
1215 | outlet_symbol(x->x_obj.ob_outlet, gensym(buf)); | 1274 | outlet_symbol(x->x_obj.ob_outlet, gensym(buf)); |
1216 | } | 1275 | } |
1217 | 1276 | ||
diff --git a/apps/plugins/pdbox/PDa/src/x_interface.c b/apps/plugins/pdbox/PDa/src/x_interface.c index 227ca0f4fd..9939c6bdf0 100644 --- a/apps/plugins/pdbox/PDa/src/x_interface.c +++ b/apps/plugins/pdbox/PDa/src/x_interface.c | |||
@@ -30,6 +30,9 @@ static void print_bang(t_print *x) | |||
30 | 30 | ||
31 | static void print_pointer(t_print *x, t_gpointer *gp) | 31 | static void print_pointer(t_print *x, t_gpointer *gp) |
32 | { | 32 | { |
33 | #ifdef ROCKBOX | ||
34 | (void) gp; | ||
35 | #endif | ||
33 | post("%s(gpointer)", x->x_sym->s_name); | 36 | post("%s(gpointer)", x->x_sym->s_name); |
34 | } | 37 | } |
35 | 38 | ||
@@ -40,8 +43,12 @@ static void print_float(t_print *x, t_float f) | |||
40 | 43 | ||
41 | static void print_list(t_print *x, t_symbol *s, int argc, t_atom *argv) | 44 | static void print_list(t_print *x, t_symbol *s, int argc, t_atom *argv) |
42 | { | 45 | { |
46 | #ifdef ROCKBOX | ||
47 | (void) s; | ||
48 | #else | ||
43 | int i; | 49 | int i; |
44 | char buf[80]; | 50 | char buf[80]; |
51 | #endif | ||
45 | if (argc && argv->a_type != A_SYMBOL) startpost("%s:", x->x_sym->s_name); | 52 | if (argc && argv->a_type != A_SYMBOL) startpost("%s:", x->x_sym->s_name); |
46 | else startpost("%s%s", x->x_sym->s_name, | 53 | else startpost("%s%s", x->x_sym->s_name, |
47 | (argc > 1 ? s_list.s_name : (argc == 1 ? s_symbol.s_name : | 54 | (argc > 1 ? s_list.s_name : (argc == 1 ? s_symbol.s_name : |
@@ -52,8 +59,10 @@ static void print_list(t_print *x, t_symbol *s, int argc, t_atom *argv) | |||
52 | 59 | ||
53 | static void print_anything(t_print *x, t_symbol *s, int argc, t_atom *argv) | 60 | static void print_anything(t_print *x, t_symbol *s, int argc, t_atom *argv) |
54 | { | 61 | { |
62 | #ifndef ROCKBOX | ||
55 | int i; | 63 | int i; |
56 | char buf[80]; | 64 | char buf[80]; |
65 | #endif | ||
57 | startpost("%s%s", x->x_sym->s_name, s->s_name); | 66 | startpost("%s%s", x->x_sym->s_name, s->s_name); |
58 | postatom(argc, argv); | 67 | postatom(argc, argv); |
59 | endpost(); | 68 | endpost(); |
diff --git a/apps/plugins/pdbox/PDa/src/x_misc.c b/apps/plugins/pdbox/PDa/src/x_misc.c index e7d0005421..e929646e7c 100644 --- a/apps/plugins/pdbox/PDa/src/x_misc.c +++ b/apps/plugins/pdbox/PDa/src/x_misc.c | |||
@@ -4,6 +4,13 @@ | |||
4 | 4 | ||
5 | /* misc. */ | 5 | /* misc. */ |
6 | 6 | ||
7 | #ifdef ROCKBOX | ||
8 | #include "plugin.h" | ||
9 | #include "pdbox.h" | ||
10 | #include "m_pd.h" | ||
11 | #include "s_stuff.h" | ||
12 | extern uint64_t runningtime; | ||
13 | #else /* ROCKBOX */ | ||
7 | #include "m_pd.h" | 14 | #include "m_pd.h" |
8 | #include "s_stuff.h" | 15 | #include "s_stuff.h" |
9 | #include <math.h> | 16 | #include <math.h> |
@@ -19,6 +26,7 @@ | |||
19 | #include <wtypes.h> | 26 | #include <wtypes.h> |
20 | #include <time.h> | 27 | #include <time.h> |
21 | #endif | 28 | #endif |
29 | #endif /* ROCKBOX */ | ||
22 | 30 | ||
23 | #if defined (MACOSX) || defined (__FreeBSD__) | 31 | #if defined (MACOSX) || defined (__FreeBSD__) |
24 | #define HZ CLK_TCK | 32 | #define HZ CLK_TCK |
@@ -68,6 +76,9 @@ static void random_bang(t_random *x) | |||
68 | 76 | ||
69 | static void random_seed(t_random *x, float f, float glob) | 77 | static void random_seed(t_random *x, float f, float glob) |
70 | { | 78 | { |
79 | #ifdef ROCKBOX | ||
80 | (void) glob; | ||
81 | #endif | ||
71 | x->x_state = f; | 82 | x->x_state = f; |
72 | } | 83 | } |
73 | 84 | ||
@@ -155,6 +166,10 @@ typedef struct _serial | |||
155 | 166 | ||
156 | static void serial_float(t_serial *x, t_float f) | 167 | static void serial_float(t_serial *x, t_float f) |
157 | { | 168 | { |
169 | #ifdef ROCKBOX | ||
170 | (void) x; | ||
171 | (void) f; | ||
172 | #else /* ROCKBOX */ | ||
158 | int n = f; | 173 | int n = f; |
159 | char message[MAXSERIAL * 4 + 100]; | 174 | char message[MAXSERIAL * 4 + 100]; |
160 | if (!x->x_open) | 175 | if (!x->x_open) |
@@ -164,6 +179,7 @@ static void serial_float(t_serial *x, t_float f) | |||
164 | } | 179 | } |
165 | sprintf(message, "com%d_send \"\\%3.3o\"\n", x->x_portno, n); | 180 | sprintf(message, "com%d_send \"\\%3.3o\"\n", x->x_portno, n); |
166 | sys_gui(message); | 181 | sys_gui(message); |
182 | #endif /* ROCKBOX */ | ||
167 | } | 183 | } |
168 | 184 | ||
169 | static void *serial_new(t_floatarg fportno) | 185 | static void *serial_new(t_floatarg fportno) |
@@ -190,6 +206,9 @@ static t_class *cputime_class; | |||
190 | typedef struct _cputime | 206 | typedef struct _cputime |
191 | { | 207 | { |
192 | t_object x_obj; | 208 | t_object x_obj; |
209 | #ifdef ROCKBOX | ||
210 | uint64_t x_runningtime; | ||
211 | #endif | ||
193 | #ifdef UNIX | 212 | #ifdef UNIX |
194 | struct tms x_setcputime; | 213 | struct tms x_setcputime; |
195 | #endif | 214 | #endif |
@@ -202,6 +221,9 @@ typedef struct _cputime | |||
202 | 221 | ||
203 | static void cputime_bang(t_cputime *x) | 222 | static void cputime_bang(t_cputime *x) |
204 | { | 223 | { |
224 | #ifdef ROCKBOX | ||
225 | x->x_runningtime = runningtime; | ||
226 | #endif | ||
205 | #ifdef UNIX | 227 | #ifdef UNIX |
206 | times(&x->x_setcputime); | 228 | times(&x->x_setcputime); |
207 | #endif | 229 | #endif |
@@ -221,9 +243,16 @@ static void cputime_bang(t_cputime *x) | |||
221 | #endif | 243 | #endif |
222 | } | 244 | } |
223 | 245 | ||
246 | #ifndef ROCKBOX | ||
224 | #define HZ 100 | 247 | #define HZ 100 |
248 | #endif | ||
225 | static void cputime_bang2(t_cputime *x) | 249 | static void cputime_bang2(t_cputime *x) |
226 | { | 250 | { |
251 | #ifdef ROCKBOX | ||
252 | float elapsedcpu = 1000 * | ||
253 | (runningtime - x->x_runningtime) / HZ; | ||
254 | outlet_float(x->x_obj.ob_outlet, elapsedcpu); | ||
255 | #endif | ||
227 | #ifdef UNIX | 256 | #ifdef UNIX |
228 | float elapsedcpu; | 257 | float elapsedcpu; |
229 | struct tms newcputime; | 258 | struct tms newcputime; |
diff --git a/apps/plugins/pdbox/PDa/src/x_net.c b/apps/plugins/pdbox/PDa/src/x_net.c index c4a004cc5c..aa19f78ec0 100644 --- a/apps/plugins/pdbox/PDa/src/x_net.c +++ b/apps/plugins/pdbox/PDa/src/x_net.c | |||
@@ -2,11 +2,17 @@ | |||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | 2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL |
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | 3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ |
4 | 4 | ||
5 | #ifdef ROCKBOX | ||
6 | #include "plugin.h" | ||
7 | #include "pdbox.h" | ||
8 | #endif | ||
9 | |||
5 | /* network */ | 10 | /* network */ |
6 | 11 | ||
7 | #include "m_pd.h" | 12 | #include "m_pd.h" |
8 | #include "s_stuff.h" | 13 | #include "s_stuff.h" |
9 | 14 | ||
15 | #ifndef ROCKBOX | ||
10 | #include <sys/types.h> | 16 | #include <sys/types.h> |
11 | #include <string.h> | 17 | #include <string.h> |
12 | #ifdef UNIX | 18 | #ifdef UNIX |
@@ -19,6 +25,7 @@ | |||
19 | #else | 25 | #else |
20 | #include <winsock.h> | 26 | #include <winsock.h> |
21 | #endif | 27 | #endif |
28 | #endif /* ROCKBOX */ | ||
22 | 29 | ||
23 | static t_class *netsend_class; | 30 | static t_class *netsend_class; |
24 | 31 | ||
@@ -31,16 +38,27 @@ typedef struct _netsend | |||
31 | 38 | ||
32 | static void *netsend_new(t_floatarg udpflag) | 39 | static void *netsend_new(t_floatarg udpflag) |
33 | { | 40 | { |
41 | #ifdef ROCKBOX | ||
42 | (void) udpflag; | ||
43 | #endif | ||
44 | |||
34 | t_netsend *x = (t_netsend *)pd_new(netsend_class); | 45 | t_netsend *x = (t_netsend *)pd_new(netsend_class); |
35 | outlet_new(&x->x_obj, &s_float); | 46 | outlet_new(&x->x_obj, &s_float); |
36 | x->x_fd = -1; | 47 | x->x_fd = -1; |
48 | #ifndef ROCKBOX | ||
37 | x->x_protocol = (udpflag != 0 ? SOCK_DGRAM : SOCK_STREAM); | 49 | x->x_protocol = (udpflag != 0 ? SOCK_DGRAM : SOCK_STREAM); |
50 | #endif | ||
38 | return (x); | 51 | return (x); |
39 | } | 52 | } |
40 | 53 | ||
41 | static void netsend_connect(t_netsend *x, t_symbol *hostname, | 54 | static void netsend_connect(t_netsend *x, t_symbol *hostname, |
42 | t_floatarg fportno) | 55 | t_floatarg fportno) |
43 | { | 56 | { |
57 | #ifdef ROCKBOX | ||
58 | (void) x; | ||
59 | (void) hostname; | ||
60 | (void) fportno; | ||
61 | #else /* ROCKBOX */ | ||
44 | struct sockaddr_in server; | 62 | struct sockaddr_in server; |
45 | struct hostent *hp; | 63 | struct hostent *hp; |
46 | int sockfd; | 64 | int sockfd; |
@@ -100,13 +118,16 @@ static void netsend_connect(t_netsend *x, t_symbol *hostname, | |||
100 | } | 118 | } |
101 | x->x_fd = sockfd; | 119 | x->x_fd = sockfd; |
102 | outlet_float(x->x_obj.ob_outlet, 1); | 120 | outlet_float(x->x_obj.ob_outlet, 1); |
121 | #endif /* ROCKBOX */ | ||
103 | } | 122 | } |
104 | 123 | ||
105 | static void netsend_disconnect(t_netsend *x) | 124 | static void netsend_disconnect(t_netsend *x) |
106 | { | 125 | { |
107 | if (x->x_fd >= 0) | 126 | if (x->x_fd >= 0) |
108 | { | 127 | { |
128 | #ifndef ROCKBOX | ||
109 | sys_closesocket(x->x_fd); | 129 | sys_closesocket(x->x_fd); |
130 | #endif | ||
110 | x->x_fd = -1; | 131 | x->x_fd = -1; |
111 | outlet_float(x->x_obj.ob_outlet, 0); | 132 | outlet_float(x->x_obj.ob_outlet, 0); |
112 | } | 133 | } |
@@ -114,6 +135,12 @@ static void netsend_disconnect(t_netsend *x) | |||
114 | 135 | ||
115 | static void netsend_send(t_netsend *x, t_symbol *s, int argc, t_atom *argv) | 136 | static void netsend_send(t_netsend *x, t_symbol *s, int argc, t_atom *argv) |
116 | { | 137 | { |
138 | #ifdef ROCKBOX | ||
139 | (void) x; | ||
140 | (void) s; | ||
141 | (void) argc; | ||
142 | (void) argv; | ||
143 | #else /* ROCKBOX */ | ||
117 | if (x->x_fd >= 0) | 144 | if (x->x_fd >= 0) |
118 | { | 145 | { |
119 | t_binbuf *b = binbuf_new(); | 146 | t_binbuf *b = binbuf_new(); |
@@ -159,11 +186,16 @@ static void netsend_send(t_netsend *x, t_symbol *s, int argc, t_atom *argv) | |||
159 | binbuf_free(b); | 186 | binbuf_free(b); |
160 | } | 187 | } |
161 | else error("netsend: not connected"); | 188 | else error("netsend: not connected"); |
189 | #endif /* ROCKBOX */ | ||
162 | } | 190 | } |
163 | 191 | ||
164 | static void netsend_free(t_netsend *x) | 192 | static void netsend_free(t_netsend *x) |
165 | { | 193 | { |
194 | #ifdef ROCKBOX | ||
195 | (void) x; | ||
196 | #else | ||
166 | netsend_disconnect(x); | 197 | netsend_disconnect(x); |
198 | #endif | ||
167 | } | 199 | } |
168 | 200 | ||
169 | static void netsend_setup(void) | 201 | static void netsend_setup(void) |
@@ -193,14 +225,23 @@ typedef struct _netreceive | |||
193 | int x_udp; | 225 | int x_udp; |
194 | } t_netreceive; | 226 | } t_netreceive; |
195 | 227 | ||
228 | #ifdef ROCKBOX | ||
229 | static t_netreceive* receiver; | ||
230 | static int receiver_port; | ||
231 | #endif /* ROCKBOX */ | ||
232 | |||
233 | #ifndef ROCKBOX | ||
196 | static void netreceive_notify(t_netreceive *x) | 234 | static void netreceive_notify(t_netreceive *x) |
197 | { | 235 | { |
198 | outlet_float(x->x_connectout, --x->x_nconnections); | 236 | outlet_float(x->x_connectout, --x->x_nconnections); |
199 | } | 237 | } |
238 | #endif /* ROCKBOX */ | ||
200 | 239 | ||
201 | static void netreceive_doit(void *z, t_binbuf *b) | 240 | static void netreceive_doit(void *z, t_binbuf *b) |
202 | { | 241 | { |
242 | #ifndef ROCKBOX | ||
203 | t_atom messbuf[1024]; | 243 | t_atom messbuf[1024]; |
244 | #endif | ||
204 | t_netreceive *x = (t_netreceive *)z; | 245 | t_netreceive *x = (t_netreceive *)z; |
205 | int msg, natom = binbuf_getnatom(b); | 246 | int msg, natom = binbuf_getnatom(b); |
206 | t_atom *at = binbuf_getvec(b); | 247 | t_atom *at = binbuf_getvec(b); |
@@ -234,6 +275,7 @@ static void netreceive_doit(void *z, t_binbuf *b) | |||
234 | } | 275 | } |
235 | } | 276 | } |
236 | 277 | ||
278 | #ifndef ROCKBOX | ||
237 | static void netreceive_connectpoll(t_netreceive *x) | 279 | static void netreceive_connectpoll(t_netreceive *x) |
238 | { | 280 | { |
239 | int fd = accept(x->x_connectsocket, 0, 0); | 281 | int fd = accept(x->x_connectsocket, 0, 0); |
@@ -247,11 +289,41 @@ static void netreceive_connectpoll(t_netreceive *x) | |||
247 | outlet_float(x->x_connectout, ++x->x_nconnections); | 289 | outlet_float(x->x_connectout, ++x->x_nconnections); |
248 | } | 290 | } |
249 | } | 291 | } |
292 | #endif | ||
250 | 293 | ||
251 | static void *netreceive_new(t_symbol *compatflag, | 294 | static void *netreceive_new(t_symbol *compatflag, |
252 | t_floatarg fportno, t_floatarg udpflag) | 295 | t_floatarg fportno, t_floatarg udpflag) |
253 | { | 296 | { |
254 | t_netreceive *x; | 297 | t_netreceive *x; |
298 | |||
299 | #ifdef ROCKBOX | ||
300 | int portno = fportno, udp = (udpflag != 0); | ||
301 | |||
302 | (void) compatflag; | ||
303 | |||
304 | /* Look whether callback is already taken. */ | ||
305 | if(receiver) | ||
306 | { | ||
307 | post("Receiver callback already taken!\n"); | ||
308 | return NULL; | ||
309 | } | ||
310 | |||
311 | /* Look whether TCP sockets are thought to exist. */ | ||
312 | if(!udp) | ||
313 | { | ||
314 | post("Trying to create TCP socket!\n"); | ||
315 | return NULL; | ||
316 | } | ||
317 | |||
318 | x = (t_netreceive *) pd_new(netreceive_class); | ||
319 | x->x_msgout = outlet_new(&x->x_obj, &s_anything); | ||
320 | x->x_nconnections = 0; | ||
321 | x->x_udp = udp; | ||
322 | |||
323 | receiver = x; | ||
324 | receiver_port = portno; | ||
325 | |||
326 | #else /* ROCKBOX */ | ||
255 | struct sockaddr_in server; | 327 | struct sockaddr_in server; |
256 | int sockfd, portno = fportno, udp = (udpflag != 0); | 328 | int sockfd, portno = fportno, udp = (udpflag != 0); |
257 | int old = !strcmp(compatflag->s_name , "old"); | 329 | int old = !strcmp(compatflag->s_name , "old"); |
@@ -333,20 +405,62 @@ static void *netreceive_new(t_symbol *compatflag, | |||
333 | x->x_connectsocket = sockfd; | 405 | x->x_connectsocket = sockfd; |
334 | x->x_nconnections = 0; | 406 | x->x_nconnections = 0; |
335 | x->x_udp = udp; | 407 | x->x_udp = udp; |
408 | #endif /* ROCKBOX */ | ||
336 | 409 | ||
337 | return (x); | 410 | return (x); |
338 | } | 411 | } |
339 | 412 | ||
340 | static void netreceive_free(t_netreceive *x) | 413 | static void netreceive_free(t_netreceive *x) |
341 | { | 414 | { |
415 | #ifdef ROCKBOX | ||
416 | if(receiver && receiver == x) | ||
417 | receiver = NULL; | ||
418 | #else /* ROCKBOX */ | ||
342 | /* LATER make me clean up open connections */ | 419 | /* LATER make me clean up open connections */ |
343 | if (x->x_connectsocket >= 0) | 420 | if (x->x_connectsocket >= 0) |
344 | { | 421 | { |
345 | sys_rmpollfn(x->x_connectsocket); | 422 | sys_rmpollfn(x->x_connectsocket); |
346 | sys_closesocket(x->x_connectsocket); | 423 | sys_closesocket(x->x_connectsocket); |
347 | } | 424 | } |
425 | #endif /* ROCKBOX */ | ||
348 | } | 426 | } |
349 | 427 | ||
428 | #ifdef ROCKBOX | ||
429 | /* Basically a reimplementation of socketreceiver_getudp() | ||
430 | from s_inter.c */ | ||
431 | t_binbuf* inbinbuf; | ||
432 | void outlet_setstacklim(void); | ||
433 | |||
434 | void rockbox_receive_callback(struct datagram* dg) | ||
435 | { | ||
436 | /* Check whether there is a receiver. */ | ||
437 | if(!receiver) | ||
438 | return; | ||
439 | |||
440 | /* Limit string. */ | ||
441 | dg->data[dg->size] = '\0'; | ||
442 | |||
443 | /* If complete line... */ | ||
444 | if(dg->data[dg->size-1] == '\n') | ||
445 | { | ||
446 | char* semi = strchr(dg->data, ';'); | ||
447 | |||
448 | /* Limit message. */ | ||
449 | if(semi) | ||
450 | *semi = '\0'; | ||
451 | |||
452 | /* Create binary buffer. */ | ||
453 | binbuf_text(inbinbuf, dg->data, strlen(dg->data)); | ||
454 | |||
455 | /* Limit outlet stack. */ | ||
456 | outlet_setstacklim(); | ||
457 | |||
458 | /* Execute receive function. */ | ||
459 | netreceive_doit(receiver, inbinbuf); | ||
460 | } | ||
461 | } | ||
462 | #endif /* ROCKBOX */ | ||
463 | |||
350 | static void netreceive_setup(void) | 464 | static void netreceive_setup(void) |
351 | { | 465 | { |
352 | netreceive_class = class_new(gensym("netreceive"), | 466 | netreceive_class = class_new(gensym("netreceive"), |
@@ -360,5 +474,3 @@ void x_net_setup(void) | |||
360 | netsend_setup(); | 474 | netsend_setup(); |
361 | netreceive_setup(); | 475 | netreceive_setup(); |
362 | } | 476 | } |
363 | |||
364 | |||
diff --git a/apps/plugins/pdbox/PDa/src/x_qlist.c b/apps/plugins/pdbox/PDa/src/x_qlist.c index 7dbec5e7b4..fc7866ff41 100644 --- a/apps/plugins/pdbox/PDa/src/x_qlist.c +++ b/apps/plugins/pdbox/PDa/src/x_qlist.c | |||
@@ -2,7 +2,14 @@ | |||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | 2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL |
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | 3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ |
4 | 4 | ||
5 | #ifdef ROCKBOX | ||
6 | #include "plugin.h" | ||
7 | #include "pdbox.h" | ||
8 | #endif | ||
9 | |||
5 | #include "m_pd.h" | 10 | #include "m_pd.h" |
11 | |||
12 | #ifndef ROCKBOX | ||
6 | #include <string.h> | 13 | #include <string.h> |
7 | #ifdef UNIX | 14 | #ifdef UNIX |
8 | #include <unistd.h> | 15 | #include <unistd.h> |
@@ -10,6 +17,7 @@ | |||
10 | #ifdef MSW | 17 | #ifdef MSW |
11 | #include <io.h> | 18 | #include <io.h> |
12 | #endif | 19 | #endif |
20 | #endif /* ROCKBOX */ | ||
13 | 21 | ||
14 | typedef struct _qlist | 22 | typedef struct _qlist |
15 | { | 23 | { |
@@ -32,7 +40,9 @@ static t_class *qlist_class; | |||
32 | 40 | ||
33 | static void *qlist_new( void) | 41 | static void *qlist_new( void) |
34 | { | 42 | { |
43 | #ifndef ROCKBOX | ||
35 | t_symbol *name, *filename = 0; | 44 | t_symbol *name, *filename = 0; |
45 | #endif | ||
36 | t_qlist *x = (t_qlist *)pd_new(qlist_class); | 46 | t_qlist *x = (t_qlist *)pd_new(qlist_class); |
37 | x->x_binbuf = binbuf_new(); | 47 | x->x_binbuf = binbuf_new(); |
38 | x->x_clock = clock_new(x, (t_method)qlist_tick); | 48 | x->x_clock = clock_new(x, (t_method)qlist_tick); |
@@ -151,6 +161,9 @@ static void qlist_tick(t_qlist *x) | |||
151 | 161 | ||
152 | static void qlist_add(t_qlist *x, t_symbol *s, int ac, t_atom *av) | 162 | static void qlist_add(t_qlist *x, t_symbol *s, int ac, t_atom *av) |
153 | { | 163 | { |
164 | #ifdef ROCKBOX | ||
165 | (void) s; | ||
166 | #endif | ||
154 | t_atom a; | 167 | t_atom a; |
155 | SETSEMI(&a); | 168 | SETSEMI(&a); |
156 | binbuf_add(x->x_binbuf, ac, av); | 169 | binbuf_add(x->x_binbuf, ac, av); |
@@ -159,6 +172,9 @@ static void qlist_add(t_qlist *x, t_symbol *s, int ac, t_atom *av) | |||
159 | 172 | ||
160 | static void qlist_add2(t_qlist *x, t_symbol *s, int ac, t_atom *av) | 173 | static void qlist_add2(t_qlist *x, t_symbol *s, int ac, t_atom *av) |
161 | { | 174 | { |
175 | #ifdef ROCKBOX | ||
176 | (void) s; | ||
177 | #endif | ||
162 | binbuf_add(x->x_binbuf, ac, av); | 178 | binbuf_add(x->x_binbuf, ac, av); |
163 | } | 179 | } |
164 | 180 | ||
@@ -239,7 +255,9 @@ typedef t_qlist t_textfile; | |||
239 | 255 | ||
240 | static void *textfile_new( void) | 256 | static void *textfile_new( void) |
241 | { | 257 | { |
258 | #ifndef ROCKBOX | ||
242 | t_symbol *name, *filename = 0; | 259 | t_symbol *name, *filename = 0; |
260 | #endif | ||
243 | t_textfile *x = (t_textfile *)pd_new(textfile_class); | 261 | t_textfile *x = (t_textfile *)pd_new(textfile_class); |
244 | x->x_binbuf = binbuf_new(); | 262 | x->x_binbuf = binbuf_new(); |
245 | outlet_new(&x->x_ob, &s_list); | 263 | outlet_new(&x->x_ob, &s_list); |
@@ -257,7 +275,11 @@ static void *textfile_new( void) | |||
257 | static void textfile_bang(t_textfile *x) | 275 | static void textfile_bang(t_textfile *x) |
258 | { | 276 | { |
259 | int argc = binbuf_getnatom(x->x_binbuf), | 277 | int argc = binbuf_getnatom(x->x_binbuf), |
278 | #ifdef ROCKBOX | ||
279 | onset = x->x_onset, onset2; | ||
280 | #else | ||
260 | count, onset = x->x_onset, onset2; | 281 | count, onset = x->x_onset, onset2; |
282 | #endif | ||
261 | t_atom *argv = binbuf_getvec(x->x_binbuf); | 283 | t_atom *argv = binbuf_getvec(x->x_binbuf); |
262 | t_atom *ap = argv + onset, *ap2; | 284 | t_atom *ap = argv + onset, *ap2; |
263 | while (onset < argc && | 285 | while (onset < argc && |
diff --git a/apps/plugins/pdbox/PDa/src/x_time.c b/apps/plugins/pdbox/PDa/src/x_time.c index 4cab8bc364..2d38369aa5 100644 --- a/apps/plugins/pdbox/PDa/src/x_time.c +++ b/apps/plugins/pdbox/PDa/src/x_time.c | |||
@@ -266,6 +266,9 @@ static void timer_bang2(t_timer *x) | |||
266 | 266 | ||
267 | static void *timer_new(t_floatarg f) | 267 | static void *timer_new(t_floatarg f) |
268 | { | 268 | { |
269 | #ifdef ROCKBOX | ||
270 | (void) f; | ||
271 | #endif | ||
269 | t_timer *x = (t_timer *)pd_new(timer_class); | 272 | t_timer *x = (t_timer *)pd_new(timer_class); |
270 | timer_bang(x); | 273 | timer_bang(x); |
271 | outlet_new(&x->x_obj, gensym("float")); | 274 | outlet_new(&x->x_obj, gensym("float")); |
@@ -314,6 +317,9 @@ typedef struct _pipe | |||
314 | 317 | ||
315 | static void *pipe_new(t_symbol *s, int argc, t_atom *argv) | 318 | static void *pipe_new(t_symbol *s, int argc, t_atom *argv) |
316 | { | 319 | { |
320 | #ifdef ROCKBOX | ||
321 | (void) s; | ||
322 | #endif | ||
317 | t_pipe *x = (t_pipe *)pd_new(pipe_class); | 323 | t_pipe *x = (t_pipe *)pd_new(pipe_class); |
318 | t_atom defarg, *ap; | 324 | t_atom defarg, *ap; |
319 | t_pipeout *vec, *vp; | 325 | t_pipeout *vec, *vp; |
@@ -412,7 +418,7 @@ static void hang_tick(t_hang *h) | |||
412 | int i; | 418 | int i; |
413 | union word *w; | 419 | union word *w; |
414 | if (x->x_hang == h) x->x_hang = h->h_next; | 420 | if (x->x_hang == h) x->x_hang = h->h_next; |
415 | else for (h2 = x->x_hang; h3 = h2->h_next; h2 = h3) | 421 | else for (h2 = x->x_hang; (h3 = h2->h_next); h2 = h3) |
416 | { | 422 | { |
417 | if (h3 == h) | 423 | if (h3 == h) |
418 | { | 424 | { |
@@ -432,6 +438,9 @@ static void hang_tick(t_hang *h) | |||
432 | outlet_pointer(p->p_outlet, w->w_gpointer); | 438 | outlet_pointer(p->p_outlet, w->w_gpointer); |
433 | else post("pipe: stale pointer"); | 439 | else post("pipe: stale pointer"); |
434 | break; | 440 | break; |
441 | #ifdef ROCKBOX | ||
442 | default: break; | ||
443 | #endif | ||
435 | } | 444 | } |
436 | } | 445 | } |
437 | hang_free(h); | 446 | hang_free(h); |
@@ -439,6 +448,9 @@ static void hang_tick(t_hang *h) | |||
439 | 448 | ||
440 | static void pipe_list(t_pipe *x, t_symbol *s, int ac, t_atom *av) | 449 | static void pipe_list(t_pipe *x, t_symbol *s, int ac, t_atom *av) |
441 | { | 450 | { |
451 | #ifdef ROCKBOX | ||
452 | (void) s; | ||
453 | #endif | ||
442 | t_hang *h = (t_hang *) | 454 | t_hang *h = (t_hang *) |
443 | getbytes(sizeof(*h) + (x->x_n - 1) * sizeof(*h->h_vec)); | 455 | getbytes(sizeof(*h) + (x->x_n - 1) * sizeof(*h->h_vec)); |
444 | t_gpointer *gp, *gp2; | 456 | t_gpointer *gp, *gp2; |
@@ -465,6 +477,10 @@ static void pipe_list(t_pipe *x, t_symbol *s, int ac, t_atom *av) | |||
465 | if (gp->gp_stub) gp->gp_stub->gs_refcount++; | 477 | if (gp->gp_stub) gp->gp_stub->gs_refcount++; |
466 | } | 478 | } |
467 | gp++; | 479 | gp++; |
480 | #ifdef ROCKBOX | ||
481 | break; | ||
482 | default: break; | ||
483 | #endif | ||
468 | } | 484 | } |
469 | } | 485 | } |
470 | for (i = 0, gp = x->x_gp, gp2 = h->h_gp, p = x->x_vec, w = h->h_vec; | 486 | for (i = 0, gp = x->x_gp, gp2 = h->h_gp, p = x->x_vec, w = h->h_vec; |
@@ -493,7 +509,7 @@ static void pipe_flush(t_pipe *x) | |||
493 | static void pipe_clear(t_pipe *x) | 509 | static void pipe_clear(t_pipe *x) |
494 | { | 510 | { |
495 | t_hang *hang; | 511 | t_hang *hang; |
496 | while (hang = x->x_hang) | 512 | while ((hang = x->x_hang)) |
497 | { | 513 | { |
498 | x->x_hang = hang->h_next; | 514 | x->x_hang = hang->h_next; |
499 | hang_free(hang); | 515 | hang_free(hang); |
diff --git a/apps/plugins/pdbox/SOURCES b/apps/plugins/pdbox/SOURCES index fa4aa92b1d..9f54273877 100644 --- a/apps/plugins/pdbox/SOURCES +++ b/apps/plugins/pdbox/SOURCES | |||
@@ -1,17 +1,18 @@ | |||
1 | pdbox.c | 1 | pdbox.c |
2 | pdbox-net.c | 2 | pdbox-net.c |
3 | pdbox-func.c | ||
3 | 4 | ||
4 | dbestfit-3.3/bmalloc.c | 5 | dbestfit-3.3/bmalloc.c |
5 | dbestfit-3.3/bysize.c | 6 | dbestfit-3.3/bysize.c |
6 | dbestfit-3.3/dmalloc.c | 7 | dbestfit-3.3/dmalloc.c |
7 | 8 | ||
8 | /* | 9 | PDa/src/s_audio_rockbox.c |
10 | |||
11 | |||
9 | PDa/src/g_canvas.c | 12 | PDa/src/g_canvas.c |
10 | PDa/src/g_graph.c | 13 | PDa/src/g_graph.c |
11 | PDa/src/g_text.c | 14 | PDa/src/g_text.c |
12 | */ | 15 | PDa/src/g_rtext.c |
13 | /* PDa/src/g_rtext.c Does not compile */ | ||
14 | /* | ||
15 | PDa/src/g_array.c | 16 | PDa/src/g_array.c |
16 | PDa/src/g_template.c | 17 | PDa/src/g_template.c |
17 | PDa/src/g_io.c | 18 | PDa/src/g_io.c |
@@ -34,27 +35,25 @@ PDa/src/m_pd.c | |||
34 | PDa/src/m_class.c | 35 | PDa/src/m_class.c |
35 | PDa/src/m_obj.c | 36 | PDa/src/m_obj.c |
36 | PDa/src/m_atom.c | 37 | PDa/src/m_atom.c |
37 | */ | ||
38 | PDa/src/m_memory.c | 38 | PDa/src/m_memory.c |
39 | 39 | ||
40 | /* PDa/src/m_binbuf.c Does not compile, file handling stuff */ | 40 | PDa/src/m_binbuf.c |
41 | /* | ||
42 | PDa/src/m_conf.c | 41 | PDa/src/m_conf.c |
43 | PDa/src/m_glob.c | 42 | PDa/src/m_glob.c |
44 | PDa/src/m_sched.c | 43 | PDa/src/m_sched.c |
45 | */ | ||
46 | /* PDa/src/s_main.c Does not compile, system reasons */ | 44 | /* PDa/src/s_main.c Does not compile, system reasons */ |
47 | /* PDa/src/s_inter.c Does not compile, BSD sockets */ | 45 | /* PDa/src/s_inter.c Does not compile, BSD sockets */ |
48 | /* PDa/src/s_file.c Does not compile, file handling stuff */ | 46 | PDa/src/s_file.c |
49 | PDa/src/s_print.c | 47 | PDa/src/s_print.c |
50 | /* | ||
51 | PDa/src/s_loader.c | 48 | PDa/src/s_loader.c |
52 | */ | 49 | PDa/src/s_path.c |
53 | /* PDa/src/s_path.c Does not compile, file handling stuff */ | ||
54 | /* | 50 | /* |
55 | PDa/src/s_entry.c | 51 | PDa/src/s_entry.c |
52 | */ | ||
56 | PDa/src/s_audio.c | 53 | PDa/src/s_audio.c |
54 | /* | ||
57 | PDa/src/s_midi.c | 55 | PDa/src/s_midi.c |
56 | */ | ||
58 | PDa/src/d_ugen.c | 57 | PDa/src/d_ugen.c |
59 | PDa/src/d_arithmetic.c | 58 | PDa/src/d_arithmetic.c |
60 | PDa/src/d_dac.c | 59 | PDa/src/d_dac.c |
@@ -65,35 +64,30 @@ PDa/src/d_fftroutine.c | |||
65 | PDa/src/d_global.c | 64 | PDa/src/d_global.c |
66 | PDa/src/d_resample.c | 65 | PDa/src/d_resample.c |
67 | PDa/src/d_ctl.c | 66 | PDa/src/d_ctl.c |
68 | */ | 67 | PDa/src/d_soundfile.c |
69 | /* PDa/src/d_soundfile.c Does not compile, file handling stuff */ | ||
70 | /* | ||
71 | PDa/src/x_arithmetic.c | 68 | PDa/src/x_arithmetic.c |
72 | PDa/src/x_connective.c | 69 | PDa/src/x_connective.c |
73 | PDa/src/x_interface.c | 70 | PDa/src/x_interface.c |
71 | /* | ||
74 | PDa/src/x_midi.c | 72 | PDa/src/x_midi.c |
73 | */ | ||
75 | PDa/src/x_misc.c | 74 | PDa/src/x_misc.c |
76 | PDa/src/x_time.c | 75 | PDa/src/x_time.c |
77 | PDa/src/x_acoustics.c | 76 | PDa/src/x_acoustics.c |
78 | */ | 77 | PDa/src/x_net.c |
79 | /* PDa/src/x_net.c Does not compile, BSD sockets */ | ||
80 | /* | ||
81 | PDa/src/x_qlist.c | 78 | PDa/src/x_qlist.c |
79 | /* | ||
82 | PDa/src/x_gui.c | 80 | PDa/src/x_gui.c |
83 | */ | 81 | */ |
84 | 82 | ||
85 | /* | ||
86 | PDa/src/d_imayer_fft.c | 83 | PDa/src/d_imayer_fft.c |
87 | */ | ||
88 | /* | ||
89 | PDa/src/m_fixed.c | 84 | PDa/src/m_fixed.c |
90 | */ | ||
91 | 85 | ||
92 | /* | ||
93 | PDa/intern/biquad~.c | 86 | PDa/intern/biquad~.c |
94 | PDa/intern/bp~.c | 87 | PDa/intern/bp~.c |
95 | PDa/intern/clip~.c | 88 | PDa/intern/clip~.c |
96 | PDa/intern/cos~.c | 89 | PDa/intern/cos~.c |
90 | PDa/intern/cos_table.c | ||
97 | PDa/intern/dbtopow~.c | 91 | PDa/intern/dbtopow~.c |
98 | PDa/intern/dbtorms~.c | 92 | PDa/intern/dbtorms~.c |
99 | PDa/intern/delread~.c | 93 | PDa/intern/delread~.c |
@@ -113,11 +107,11 @@ PDa/intern/print~.c | |||
113 | PDa/intern/rmstodb~.c | 107 | PDa/intern/rmstodb~.c |
114 | PDa/intern/rsqrt~.c | 108 | PDa/intern/rsqrt~.c |
115 | PDa/intern/samphold~.c | 109 | PDa/intern/samphold~.c |
116 | */ | 110 | PDa/intern/sfread~.c |
117 | /* PDa/intern/sfread~.c Does not compile, file handling stuff */ | 111 | PDa/intern/sfwrite~.c |
118 | /* PDa/intern/sfwrite~.c Does not compile, file handling stuff */ | ||
119 | /* | 112 | /* |
120 | PDa/intern/sig~.c | 113 | PDa/intern/sig~.c |
114 | */ | ||
121 | PDa/intern/snapshot~.c | 115 | PDa/intern/snapshot~.c |
122 | PDa/intern/sqrt~.c | 116 | PDa/intern/sqrt~.c |
123 | PDa/intern/tabosc4~.c | 117 | PDa/intern/tabosc4~.c |
@@ -135,14 +129,10 @@ PDa/intern/vd~.c | |||
135 | PDa/intern/vline~.c | 129 | PDa/intern/vline~.c |
136 | PDa/intern/vsnapshot~.c | 130 | PDa/intern/vsnapshot~.c |
137 | PDa/intern/wrap~.c | 131 | PDa/intern/wrap~.c |
138 | */ | ||
139 | 132 | ||
140 | /* | ||
141 | PDa/extra/OSCroute.c | 133 | PDa/extra/OSCroute.c |
142 | PDa/extra/bandpass.c | 134 | PDa/extra/bandpass.c |
143 | */ | ||
144 | /* PDa/extra/dumpOSC.c Does not compile, file handling stuff */ | 135 | /* PDa/extra/dumpOSC.c Does not compile, file handling stuff */ |
145 | /* | ||
146 | PDa/extra/equalizer.c | 136 | PDa/extra/equalizer.c |
147 | PDa/extra/gcanvas.c | 137 | PDa/extra/gcanvas.c |
148 | PDa/extra/highpass.c | 138 | PDa/extra/highpass.c |
@@ -153,12 +143,10 @@ PDa/extra/lowpass.c | |||
153 | PDa/extra/lowshelf.c | 143 | PDa/extra/lowshelf.c |
154 | PDa/extra/moog~.c | 144 | PDa/extra/moog~.c |
155 | PDa/extra/notch.c | 145 | PDa/extra/notch.c |
156 | */ | ||
157 | /* PDa/extra/sendOSC.c Does not compile, file handling stuff */ | 146 | /* PDa/extra/sendOSC.c Does not compile, file handling stuff */ |
158 | /* | 147 | /* |
159 | PDa/extra/shell.c | 148 | PDa/extra/shell.c |
160 | PDa/extra/slider.c | 149 | PDa/extra/slider.c |
161 | PDa/extra/sliderh.c | 150 | PDa/extra/sliderh.c |
162 | PDa/extra/zerox~.c | ||
163 | */ | 151 | */ |
164 | 152 | PDa/extra/zerox~.c | |
diff --git a/apps/plugins/pdbox/dbestfit-3.3/dmalloc.c b/apps/plugins/pdbox/dbestfit-3.3/dmalloc.c index bfc6bdb356..b46d4af926 100644 --- a/apps/plugins/pdbox/dbestfit-3.3/dmalloc.c +++ b/apps/plugins/pdbox/dbestfit-3.3/dmalloc.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #ifdef ROCKBOX | 26 | #ifdef ROCKBOX |
27 | #include "plugin.h" | 27 | #include "plugin.h" |
28 | #define memset rb->memset | 28 | #define memset rb->memset |
29 | #define memcpy rb->memcpy | ||
29 | #else /* ROCKBOX */ | 30 | #else /* ROCKBOX */ |
30 | #include <stdio.h> | 31 | #include <stdio.h> |
31 | #include <string.h> | 32 | #include <string.h> |
diff --git a/apps/plugins/pdbox/math.h b/apps/plugins/pdbox/math.h new file mode 100644 index 0000000000..dc0e25b1e4 --- /dev/null +++ b/apps/plugins/pdbox/math.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 Wincent Balin | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | /* Everything taken from <math.h> -- W.B. */ | ||
23 | |||
24 | #ifndef MATH_H | ||
25 | #define MATH_H | ||
26 | |||
27 | /* Useful constants. */ | ||
28 | # define M_E 2.7182818284590452354 /* e */ | ||
29 | # define M_LOG2E 1.4426950408889634074 /* log_2 e */ | ||
30 | # define M_LOG10E 0.43429448190325182765 /* log_10 e */ | ||
31 | # define M_LN2 0.69314718055994530942 /* log_e 2 */ | ||
32 | # define M_LN10 2.30258509299404568402 /* log_e 10 */ | ||
33 | # define M_PI 3.14159265358979323846 /* pi */ | ||
34 | # define M_PI_2 1.57079632679489661923 /* pi/2 */ | ||
35 | # define M_PI_4 0.78539816339744830962 /* pi/4 */ | ||
36 | # define M_1_PI 0.31830988618379067154 /* 1/pi */ | ||
37 | # define M_2_PI 0.63661977236758134308 /* 2/pi */ | ||
38 | # define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ | ||
39 | # define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ | ||
40 | # define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ | ||
41 | |||
42 | |||
43 | # define M_El 2.7182818284590452353602874713526625L /* e */ | ||
44 | # define M_LOG2El 1.4426950408889634073599246810018921L /* log_2 e */ | ||
45 | # define M_LOG10El 0.4342944819032518276511289189166051L /* log_10 e */ | ||
46 | # define M_LN2l 0.6931471805599453094172321214581766L /* log_e 2 */ | ||
47 | # define M_LN10l 2.3025850929940456840179914546843642L /* log_e 10 */ | ||
48 | # define M_PIl 3.1415926535897932384626433832795029L /* pi */ | ||
49 | # define M_PI_2l 1.5707963267948966192313216916397514L /* pi/2 */ | ||
50 | # define M_PI_4l 0.7853981633974483096156608458198757L /* pi/4 */ | ||
51 | # define M_1_PIl 0.3183098861837906715377675267450287L /* 1/pi */ | ||
52 | # define M_2_PIl 0.6366197723675813430755350534900574L /* 2/pi */ | ||
53 | # define M_2_SQRTPIl 1.1283791670955125738961589031215452L /* 2/sqrt(pi) */ | ||
54 | # define M_SQRT2l 1.4142135623730950488016887242096981L /* sqrt(2) */ | ||
55 | # define M_SQRT1_2l 0.7071067811865475244008443621048490L /* 1/sqrt(2) */ | ||
56 | |||
57 | |||
58 | |||
59 | #endif /* MATH_H */ | ||
diff --git a/apps/plugins/pdbox/pdbox-func.c b/apps/plugins/pdbox/pdbox-func.c new file mode 100644 index 0000000000..ee4a8fd166 --- /dev/null +++ b/apps/plugins/pdbox/pdbox-func.c | |||
@@ -0,0 +1,2428 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 Wincent Balin | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "plugin.h" | ||
23 | #include "pdbox.h" | ||
24 | #include "ctype.h" | ||
25 | |||
26 | #include "m_pd.h" | ||
27 | #include "s_stuff.h" | ||
28 | |||
29 | |||
30 | /* This implementation of strncat is taken from lua plug-in. */ | ||
31 | |||
32 | /* gcc is broken and has a non-SUSv2 compliant internal prototype. | ||
33 | * This causes it to warn about a type mismatch here. Ignore it. */ | ||
34 | char *rb_strncat(char *s, const char *t, size_t n) | ||
35 | { | ||
36 | char *dest = s; | ||
37 | register char *max; | ||
38 | s += strlen(s); | ||
39 | |||
40 | if((max = s + n) == s) | ||
41 | goto strncat_fini; | ||
42 | |||
43 | while(true) | ||
44 | { | ||
45 | if(!(*s = *t)) | ||
46 | break; | ||
47 | if(++s == max) | ||
48 | break; | ||
49 | ++t; | ||
50 | |||
51 | #ifndef WANT_SMALL_STRING_ROUTINES | ||
52 | if(!(*s = *t)) | ||
53 | break; | ||
54 | if(++s == max) | ||
55 | break; | ||
56 | ++t; | ||
57 | if(!(*s = *t)) | ||
58 | break; | ||
59 | if(++s == max) | ||
60 | break; | ||
61 | ++t; | ||
62 | if(!(*s = *t)) | ||
63 | break; | ||
64 | if(++s == max) | ||
65 | break; | ||
66 | ++t; | ||
67 | #endif | ||
68 | } | ||
69 | |||
70 | *s = 0; | ||
71 | |||
72 | strncat_fini: | ||
73 | return dest; | ||
74 | } | ||
75 | |||
76 | |||
77 | /* Implementation of floor, original. */ | ||
78 | float rb_floor(float value) | ||
79 | { | ||
80 | /* If value is negative, decrement value to match function's definition. */ | ||
81 | if(value < 0.0) | ||
82 | { | ||
83 | value -= 1.0; | ||
84 | } | ||
85 | |||
86 | /* Truncate fractional part (convert to integer) | ||
87 | and afterwards convert back to double. */ | ||
88 | return (float) ((int) value); | ||
89 | } | ||
90 | |||
91 | |||
92 | /* Implementation of strtod() and atof(), | ||
93 | taken from SanOS (http://www.jbox.dk/sanos/). */ | ||
94 | static int rb_errno = 0; | ||
95 | |||
96 | double rb_strtod(const char *str, char **endptr) | ||
97 | { | ||
98 | double number; | ||
99 | int exponent; | ||
100 | int negative; | ||
101 | char *p = (char *) str; | ||
102 | double p10; | ||
103 | int n; | ||
104 | int num_digits; | ||
105 | int num_decimals; | ||
106 | |||
107 | /* Reset Rockbox errno -- W.B. */ | ||
108 | #ifdef ROCKBOX | ||
109 | rb_errno = 0; | ||
110 | #endif | ||
111 | |||
112 | // Skip leading whitespace | ||
113 | while (isspace(*p)) p++; | ||
114 | |||
115 | // Handle optional sign | ||
116 | negative = 0; | ||
117 | switch (*p) | ||
118 | { | ||
119 | case '-': negative = 1; // Fall through to increment position | ||
120 | case '+': p++; | ||
121 | } | ||
122 | |||
123 | number = 0.; | ||
124 | exponent = 0; | ||
125 | num_digits = 0; | ||
126 | num_decimals = 0; | ||
127 | |||
128 | // Process string of digits | ||
129 | while (isdigit(*p)) | ||
130 | { | ||
131 | number = number * 10. + (*p - '0'); | ||
132 | p++; | ||
133 | num_digits++; | ||
134 | } | ||
135 | |||
136 | // Process decimal part | ||
137 | if (*p == '.') | ||
138 | { | ||
139 | p++; | ||
140 | |||
141 | while (isdigit(*p)) | ||
142 | { | ||
143 | number = number * 10. + (*p - '0'); | ||
144 | p++; | ||
145 | num_digits++; | ||
146 | num_decimals++; | ||
147 | } | ||
148 | |||
149 | exponent -= num_decimals; | ||
150 | } | ||
151 | |||
152 | if (num_digits == 0) | ||
153 | { | ||
154 | #ifdef ROCKBOX | ||
155 | rb_errno = 1; | ||
156 | #else | ||
157 | errno = ERANGE; | ||
158 | #endif | ||
159 | return 0.0; | ||
160 | } | ||
161 | |||
162 | // Correct for sign | ||
163 | if (negative) number = -number; | ||
164 | |||
165 | // Process an exponent string | ||
166 | if (*p == 'e' || *p == 'E') | ||
167 | { | ||
168 | // Handle optional sign | ||
169 | negative = 0; | ||
170 | switch(*++p) | ||
171 | { | ||
172 | case '-': negative = 1; // Fall through to increment pos | ||
173 | case '+': p++; | ||
174 | } | ||
175 | |||
176 | // Process string of digits | ||
177 | n = 0; | ||
178 | while (isdigit(*p)) | ||
179 | { | ||
180 | n = n * 10 + (*p - '0'); | ||
181 | p++; | ||
182 | } | ||
183 | |||
184 | if (negative) | ||
185 | exponent -= n; | ||
186 | else | ||
187 | exponent += n; | ||
188 | } | ||
189 | |||
190 | #ifndef ROCKBOX | ||
191 | if (exponent < DBL_MIN_EXP || exponent > DBL_MAX_EXP) | ||
192 | { | ||
193 | errno = ERANGE; | ||
194 | return HUGE_VAL; | ||
195 | } | ||
196 | #endif | ||
197 | |||
198 | // Scale the result | ||
199 | p10 = 10.; | ||
200 | n = exponent; | ||
201 | if (n < 0) n = -n; | ||
202 | while (n) | ||
203 | { | ||
204 | if (n & 1) | ||
205 | { | ||
206 | if (exponent < 0) | ||
207 | number /= p10; | ||
208 | else | ||
209 | number *= p10; | ||
210 | } | ||
211 | n >>= 1; | ||
212 | p10 *= p10; | ||
213 | } | ||
214 | |||
215 | #ifndef ROCKBOX | ||
216 | if (number == HUGE_VAL) errno = ERANGE; | ||
217 | #endif | ||
218 | if (endptr) *endptr = p; | ||
219 | |||
220 | return number; | ||
221 | } | ||
222 | |||
223 | double rb_atof(const char *str) | ||
224 | { | ||
225 | return rb_strtod(str, NULL); | ||
226 | } | ||
227 | |||
228 | |||
229 | /* Implementation of ftoa(), original. */ | ||
230 | void rb_ftoan(float f, char* out, int size) | ||
231 | { | ||
232 | #define SBUFSIZE 12 | ||
233 | char sbuf[SBUFSIZE]; | ||
234 | |||
235 | /* Zero out string. */ | ||
236 | *out = '\0'; | ||
237 | size--; | ||
238 | |||
239 | /* Handle negative numbers. */ | ||
240 | if(f < 0.0) | ||
241 | { | ||
242 | f = -f; | ||
243 | strcat(out, "-"); | ||
244 | size--; | ||
245 | } | ||
246 | |||
247 | /* Find and convert integer part. */ | ||
248 | int int_part = (int) f; | ||
249 | snprintf(sbuf, SBUFSIZE-1, "%d", int_part); | ||
250 | int int_part_len = strlen(sbuf); | ||
251 | if(size < int_part_len) | ||
252 | return; | ||
253 | |||
254 | /* Append integral part to output string. */ | ||
255 | strcat(out, sbuf); | ||
256 | size -= int_part_len; | ||
257 | |||
258 | /* Check whether further content is possible. */ | ||
259 | if(size <= 0) | ||
260 | return; | ||
261 | |||
262 | /* Append decimal point. */ | ||
263 | strcat(out, "."); | ||
264 | size--; | ||
265 | |||
266 | /* Calculate first rest and convert it. */ | ||
267 | float rest1 = (f - (float) int_part) * 1000000000.0; | ||
268 | int irest1 = (int) rest1; | ||
269 | snprintf(sbuf, SBUFSIZE-1, "%09d", irest1); | ||
270 | |||
271 | /* Append first rest to output string. */ | ||
272 | int rest1_len = strlen(sbuf); | ||
273 | int rest1_minlen = MIN(size, rest1_len); | ||
274 | strncat(out, sbuf, rest1_minlen); | ||
275 | size -= rest1_minlen; | ||
276 | |||
277 | /* Check whether output string still has enough space. */ | ||
278 | if(size <= 0) | ||
279 | return; | ||
280 | |||
281 | /* Calculate second rest and convert it. */ | ||
282 | float rest2 = (rest1 - (float) irest1) * 1000000000.0; | ||
283 | int irest2 = (int) rest2; | ||
284 | snprintf(sbuf, SBUFSIZE-1, "%09d", irest2); | ||
285 | |||
286 | /* Append second rest to the output string. */ | ||
287 | int rest2_len = strlen(sbuf); | ||
288 | int rest2_minlen = MIN(size, rest2_len); | ||
289 | strncat(out, sbuf, rest2_minlen); | ||
290 | } | ||
291 | |||
292 | |||
293 | /* Implementation of atol(), adapted from | ||
294 | the atoi() implementation in Rockbox. */ | ||
295 | long rb_atol(const char* str) | ||
296 | { | ||
297 | long value = 0L; | ||
298 | long sign = 1L; | ||
299 | |||
300 | while (isspace(*str)) | ||
301 | { | ||
302 | str++; | ||
303 | } | ||
304 | |||
305 | if ('-' == *str) | ||
306 | { | ||
307 | sign = -1L; | ||
308 | str++; | ||
309 | } | ||
310 | else if ('+' == *str) | ||
311 | { | ||
312 | str++; | ||
313 | } | ||
314 | |||
315 | while ('0' == *str) | ||
316 | { | ||
317 | str++; | ||
318 | } | ||
319 | |||
320 | while (isdigit(*str)) | ||
321 | { | ||
322 | value = (value * 10L) + (*str - '0'); | ||
323 | str++; | ||
324 | } | ||
325 | |||
326 | return value * sign; | ||
327 | } | ||
328 | |||
329 | |||
330 | /* Implementation of sin() and cos(), | ||
331 | adapted from http://lab.polygonal.de/2007/07/18/fast-and-accurate-sinecosine-approximation/ | ||
332 | */ | ||
333 | |||
334 | float rb_sin(float rad) | ||
335 | { | ||
336 | /* Trim input value to -PI..PI interval. */ | ||
337 | if(rad < -3.14159265) | ||
338 | rad += 6.28318531; | ||
339 | else if(rad > 3.14159265) | ||
340 | rad -= 6.28318531; | ||
341 | |||
342 | if(rad < 0) | ||
343 | return (1.27323954 * rad + 0.405284735 * rad * rad); | ||
344 | else | ||
345 | return (1.27323954 * rad - 0.405284735 * rad * rad); | ||
346 | } | ||
347 | |||
348 | float rb_cos(float rad) | ||
349 | { | ||
350 | /* Compute cosine: sin(x + PI/2) = cos(x) */ | ||
351 | rad += 1.57079632; | ||
352 | if(rad > 3.14159265) | ||
353 | rad -= 6.28318531; | ||
354 | |||
355 | return rb_sin(rad); | ||
356 | } | ||
357 | |||
358 | |||
359 | /* Emulation of fscanf(fd, "%f", (float*) xxx); | ||
360 | Basically a reimplementation of rb_strtod() above. */ | ||
361 | int rb_fscanf_f(int fd, float* f) | ||
362 | { | ||
363 | #define FSCANF_F_BUFSIZE 64 | ||
364 | char buf[FSCANF_F_BUFSIZE]; | ||
365 | |||
366 | /* Read line from file. */ | ||
367 | int bytes_read = rb->read_line(fd, buf, FSCANF_F_BUFSIZE-1); | ||
368 | |||
369 | /* Terminate string. */ | ||
370 | if(bytes_read >= FSCANF_F_BUFSIZE) | ||
371 | buf[FSCANF_F_BUFSIZE-1] = '\0'; | ||
372 | else | ||
373 | buf[bytes_read-1] = '\0'; | ||
374 | |||
375 | /* Convert buffer to float. */ | ||
376 | *f = rb_atof(buf); | ||
377 | |||
378 | /* If there was an error, no float was read. */ | ||
379 | if(rb_errno) | ||
380 | return 0; | ||
381 | |||
382 | return 1; | ||
383 | } | ||
384 | |||
385 | /* Emulation of fprintf(fd, "%f\n", (float*) xxx); */ | ||
386 | int rb_fprintf_f(int fd, float f) | ||
387 | { | ||
388 | #define FPRINTF_F_BUFSIZE 64 | ||
389 | char buf[FPRINTF_F_BUFSIZE]; | ||
390 | const char* next_line = "\n"; | ||
391 | |||
392 | /* Convert float to string. */ | ||
393 | rb_ftoan(f, buf, sizeof(buf)-1); | ||
394 | |||
395 | /* Add next line character. */ | ||
396 | strcat(buf, next_line); | ||
397 | |||
398 | /* Write string into file. */ | ||
399 | return write(fd, buf, strlen(buf)); | ||
400 | } | ||
401 | |||
402 | |||
403 | /* Natural logarithm. | ||
404 | Taken from glibc-2.8 */ | ||
405 | static const float | ||
406 | ln2_hi = 6.9313812256e-01, /* 0x3f317180 */ | ||
407 | ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */ | ||
408 | two25 = 3.355443200e+07, /* 0x4c000000 */ | ||
409 | Lg1 = 6.6666668653e-01, /* 3F2AAAAB */ | ||
410 | Lg2 = 4.0000000596e-01, /* 3ECCCCCD */ | ||
411 | Lg3 = 2.8571429849e-01, /* 3E924925 */ | ||
412 | Lg4 = 2.2222198546e-01, /* 3E638E29 */ | ||
413 | Lg5 = 1.8183572590e-01, /* 3E3A3325 */ | ||
414 | Lg6 = 1.5313838422e-01, /* 3E1CD04F */ | ||
415 | Lg7 = 1.4798198640e-01; /* 3E178897 */ | ||
416 | |||
417 | static const float zero = 0.0; | ||
418 | |||
419 | /* A union which permits us to convert between a float and a 32 bit | ||
420 | int. */ | ||
421 | |||
422 | typedef union | ||
423 | { | ||
424 | float value; | ||
425 | uint32_t word; | ||
426 | } ieee_float_shape_type; | ||
427 | |||
428 | /* Get a 32 bit int from a float. */ | ||
429 | |||
430 | #define GET_FLOAT_WORD(i,d) \ | ||
431 | do { \ | ||
432 | ieee_float_shape_type gf_u; \ | ||
433 | gf_u.value = (d); \ | ||
434 | (i) = gf_u.word; \ | ||
435 | } while (0) | ||
436 | |||
437 | /* Set a float from a 32 bit int. */ | ||
438 | |||
439 | #define SET_FLOAT_WORD(d,i) \ | ||
440 | do { \ | ||
441 | ieee_float_shape_type sf_u; \ | ||
442 | sf_u.word = (i); \ | ||
443 | (d) = sf_u.value; \ | ||
444 | } while (0) | ||
445 | |||
446 | |||
447 | float rb_log(float x) | ||
448 | { | ||
449 | float hfsq, f, s, z, R, w, t1, t2, dk; | ||
450 | int32_t k, ix, i, j; | ||
451 | |||
452 | GET_FLOAT_WORD(ix,x); | ||
453 | |||
454 | k=0; | ||
455 | if (ix < 0x00800000) { /* x < 2**-126 */ | ||
456 | if ((ix&0x7fffffff)==0) | ||
457 | return -two25/(x-x); /* log(+-0)=-inf */ | ||
458 | if (ix<0) return (x-x)/(x-x); /* log(-#) = NaN */ | ||
459 | k -= 25; x *= two25; /* subnormal number, scale up x */ | ||
460 | GET_FLOAT_WORD(ix,x); | ||
461 | } | ||
462 | if (ix >= 0x7f800000) return x+x; | ||
463 | k += (ix>>23)-127; | ||
464 | ix &= 0x007fffff; | ||
465 | i = (ix+(0x95f64<<3))&0x800000; | ||
466 | SET_FLOAT_WORD(x,ix|(i^0x3f800000)); /* normalize x or x/2 */ | ||
467 | k += (i>>23); | ||
468 | f = x-(float)1.0; | ||
469 | if((0x007fffff&(15+ix))<16) { /* |f| < 2**-20 */ | ||
470 | if(f==zero) { | ||
471 | if(k==0) | ||
472 | return zero; | ||
473 | else | ||
474 | { | ||
475 | dk=(float)k; | ||
476 | return dk*ln2_hi+dk*ln2_lo; | ||
477 | } | ||
478 | } | ||
479 | R = f*f*((float)0.5-(float)0.33333333333333333*f); | ||
480 | if(k==0) | ||
481 | return f-R; | ||
482 | else | ||
483 | { | ||
484 | dk=(float)k; | ||
485 | return dk*ln2_hi-((R-dk*ln2_lo)-f); | ||
486 | } | ||
487 | } | ||
488 | s = f/((float)2.0+f); | ||
489 | dk = (float)k; | ||
490 | z = s*s; | ||
491 | i = ix-(0x6147a<<3); | ||
492 | w = z*z; | ||
493 | j = (0x6b851<<3)-ix; | ||
494 | t1= w*(Lg2+w*(Lg4+w*Lg6)); | ||
495 | t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); | ||
496 | i |= j; | ||
497 | R = t2+t1; | ||
498 | if(i>0) { | ||
499 | hfsq=(float)0.5*f*f; | ||
500 | if(k==0) | ||
501 | return f-(hfsq-s*(hfsq+R)); | ||
502 | else | ||
503 | return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f); | ||
504 | } else { | ||
505 | if(k==0) | ||
506 | return f-s*(f-R); | ||
507 | else | ||
508 | return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f); | ||
509 | } | ||
510 | } | ||
511 | |||
512 | |||
513 | /* Logarithm for 10th base, | ||
514 | taken from glibc-2.8 */ | ||
515 | |||
516 | static const float | ||
517 | ivln10 = 4.3429449201e-01, /* 0x3ede5bd9 */ | ||
518 | log10_2hi = 3.0102920532e-01, /* 0x3e9a2080 */ | ||
519 | log10_2lo = 7.9034151668e-07; /* 0x355427db */ | ||
520 | |||
521 | float rb_log10(float x) | ||
522 | { | ||
523 | float y,z; | ||
524 | int32_t i,k,hx; | ||
525 | |||
526 | GET_FLOAT_WORD(hx,x); | ||
527 | |||
528 | k=0; | ||
529 | if (hx < 0x00800000) { /* x < 2**-126 */ | ||
530 | if ((hx&0x7fffffff)==0) | ||
531 | return -two25/(x-x); /* log(+-0)=-inf */ | ||
532 | if (hx<0) return (x-x)/(x-x); /* log(-#) = NaN */ | ||
533 | k -= 25; x *= two25; /* subnormal number, scale up x */ | ||
534 | GET_FLOAT_WORD(hx,x); | ||
535 | } | ||
536 | if (hx >= 0x7f800000) return x+x; | ||
537 | k += (hx>>23)-127; | ||
538 | i = ((uint32_t)k&0x80000000)>>31; | ||
539 | hx = (hx&0x007fffff)|((0x7f-i)<<23); | ||
540 | y = (float)(k+i); | ||
541 | SET_FLOAT_WORD(x,hx); | ||
542 | z = y*log10_2lo + ivln10*rb_log(x); | ||
543 | return z+y*log10_2hi; | ||
544 | } | ||
545 | |||
546 | |||
547 | /* Power function, | ||
548 | Taken from glibc-2.8 */ | ||
549 | |||
550 | int rb_isinf(float x) | ||
551 | { | ||
552 | int32_t ix, t; | ||
553 | GET_FLOAT_WORD(ix,x); | ||
554 | t = ix & 0x7fffffff; | ||
555 | t ^= 0x7f800000; | ||
556 | t |= -t; | ||
557 | return ~(t >> 31) & (ix >> 30); | ||
558 | } | ||
559 | |||
560 | float rb_copysignf(float x, float y) | ||
561 | { | ||
562 | uint32_t ix, iy; | ||
563 | GET_FLOAT_WORD(ix,x); | ||
564 | GET_FLOAT_WORD(iy,y); | ||
565 | SET_FLOAT_WORD(x,(ix&0x7fffffff)|(iy&0x80000000)); | ||
566 | return x; | ||
567 | } | ||
568 | |||
569 | static const float | ||
570 | huge = 1.0e+30, | ||
571 | tiny = 1.0e-30, | ||
572 | twom25 = 2.9802322388e-08; /* 0x33000000 */ | ||
573 | |||
574 | float rb_scalbnf(float x, int n) | ||
575 | { | ||
576 | int32_t k, ix; | ||
577 | GET_FLOAT_WORD(ix,x); | ||
578 | k = (ix&0x7f800000)>>23; /* extract exponent */ | ||
579 | if (k==0) { /* 0 or subnormal x */ | ||
580 | if ((ix&0x7fffffff)==0) return x; /* +-0 */ | ||
581 | x *= two25; | ||
582 | GET_FLOAT_WORD(ix,x); | ||
583 | k = ((ix&0x7f800000)>>23) - 25; | ||
584 | } | ||
585 | if (k==0xff) return x+x; /* NaN or Inf */ | ||
586 | k = k+n; | ||
587 | if (n> 50000 || k > 0xfe) | ||
588 | return huge*rb_copysignf(huge,x); /* overflow */ | ||
589 | if (n< -50000) | ||
590 | return tiny*rb_copysignf(tiny,x); /*underflow*/ | ||
591 | if (k > 0) /* normal result */ | ||
592 | {SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;} | ||
593 | if (k <= -25) | ||
594 | return tiny*rb_copysignf(tiny,x); /*underflow*/ | ||
595 | k += 25; /* subnormal result */ | ||
596 | SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); | ||
597 | return x*twom25; | ||
598 | } | ||
599 | |||
600 | |||
601 | static const float | ||
602 | bp[] = {1.0, 1.5,}, | ||
603 | dp_h[] = { 0.0, 5.84960938e-01,}, /* 0x3f15c000 */ | ||
604 | dp_l[] = { 0.0, 1.56322085e-06,}, /* 0x35d1cfdc */ | ||
605 | one = 1.0, | ||
606 | two = 2.0, | ||
607 | two24 = 16777216.0, /* 0x4b800000 */ | ||
608 | /* poly coefs for (3/2)*(log(x)-2s-2/3*s**3 */ | ||
609 | L1 = 6.0000002384e-01, /* 0x3f19999a */ | ||
610 | L2 = 4.2857143283e-01, /* 0x3edb6db7 */ | ||
611 | L3 = 3.3333334327e-01, /* 0x3eaaaaab */ | ||
612 | L4 = 2.7272811532e-01, /* 0x3e8ba305 */ | ||
613 | L5 = 2.3066075146e-01, /* 0x3e6c3255 */ | ||
614 | L6 = 2.0697501302e-01, /* 0x3e53f142 */ | ||
615 | P1 = 1.6666667163e-01, /* 0x3e2aaaab */ | ||
616 | P2 = -2.7777778450e-03, /* 0xbb360b61 */ | ||
617 | P3 = 6.6137559770e-05, /* 0x388ab355 */ | ||
618 | P4 = -1.6533901999e-06, /* 0xb5ddea0e */ | ||
619 | P5 = 4.1381369442e-08; /* 0x3331bb4c */ | ||
620 | |||
621 | static const float | ||
622 | lg2 = 6.9314718246e-01, /* 0x3f317218 */ | ||
623 | lg2_h = 6.93145752e-01, /* 0x3f317200 */ | ||
624 | lg2_l = 1.42860654e-06, /* 0x35bfbe8c */ | ||
625 | ovt = 4.2995665694e-08, /* -(128-log2(ovfl+.5ulp)) */ | ||
626 | cp = 9.6179670095e-01, /* 0x3f76384f =2/(3ln2) */ | ||
627 | cp_h = 9.6179199219e-01, /* 0x3f763800 =head of cp */ | ||
628 | cp_l = 4.7017383622e-06, /* 0x369dc3a0 =tail of cp_h */ | ||
629 | ivln2 = 1.4426950216e+00, /* 0x3fb8aa3b =1/ln2 */ | ||
630 | ivln2_h = 1.4426879883e+00, /* 0x3fb8aa00 =16b 1/ln2*/ | ||
631 | ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/ | ||
632 | |||
633 | float rb_pow(float x, float y) | ||
634 | { | ||
635 | float z, ax, z_h, z_l, p_h, p_l; | ||
636 | float y1, t1, t2, r, s, t, u, v, w; | ||
637 | int32_t i, j, k, yisint, n; | ||
638 | int32_t hx, hy, ix, iy, is; | ||
639 | |||
640 | GET_FLOAT_WORD(hx,x); | ||
641 | GET_FLOAT_WORD(hy,y); | ||
642 | ix = hx&0x7fffffff; | ||
643 | iy = hy&0x7fffffff; | ||
644 | |||
645 | /* y==zero: x**0 = 1 */ | ||
646 | if(iy==0) return one; | ||
647 | |||
648 | /* x==+-1 */ | ||
649 | if(x == 1.0) return one; | ||
650 | if(x == -1.0 && rb_isinf(y)) return one; | ||
651 | |||
652 | /* +-NaN return x+y */ | ||
653 | if(ix > 0x7f800000 || iy > 0x7f800000) | ||
654 | return x+y; | ||
655 | |||
656 | /* determine if y is an odd int when x < 0 | ||
657 | * yisint = 0 ... y is not an integer | ||
658 | * yisint = 1 ... y is an odd int | ||
659 | * yisint = 2 ... y is an even int | ||
660 | */ | ||
661 | yisint = 0; | ||
662 | if(hx<0) { | ||
663 | if(iy>=0x4b800000) yisint = 2; /* even integer y */ | ||
664 | else if(iy>=0x3f800000) { | ||
665 | k = (iy>>23)-0x7f; /* exponent */ | ||
666 | j = iy>>(23-k); | ||
667 | if((j<<(23-k))==iy) yisint = 2-(j&1); | ||
668 | } | ||
669 | } | ||
670 | |||
671 | /* special value of y */ | ||
672 | if (iy==0x7f800000) { /* y is +-inf */ | ||
673 | if (ix==0x3f800000) | ||
674 | return y - y; /* inf**+-1 is NaN */ | ||
675 | else if (ix > 0x3f800000)/* (|x|>1)**+-inf = inf,0 */ | ||
676 | return (hy>=0)? y: zero; | ||
677 | else /* (|x|<1)**-,+inf = inf,0 */ | ||
678 | return (hy<0)?-y: zero; | ||
679 | } | ||
680 | if(iy==0x3f800000) { /* y is +-1 */ | ||
681 | if(hy<0) return one/x; else return x; | ||
682 | } | ||
683 | if(hy==0x40000000) return x*x; /* y is 2 */ | ||
684 | if(hy==0x3f000000) { /* y is 0.5 */ | ||
685 | if(hx>=0) /* x >= +0 */ | ||
686 | return rb_sqrt(x); | ||
687 | } | ||
688 | |||
689 | ax = rb_fabs(x); | ||
690 | /* special value of x */ | ||
691 | if(ix==0x7f800000||ix==0||ix==0x3f800000){ | ||
692 | z = ax; /*x is +-0,+-inf,+-1*/ | ||
693 | if(hy<0) z = one/z; /* z = (1/|x|) */ | ||
694 | if(hx<0) { | ||
695 | if(((ix-0x3f800000)|yisint)==0) { | ||
696 | z = (z-z)/(z-z); /* (-1)**non-int is NaN */ | ||
697 | } else if(yisint==1) | ||
698 | z = -z; /* (x<0)**odd = -(|x|**odd) */ | ||
699 | } | ||
700 | return z; | ||
701 | } | ||
702 | |||
703 | /* (x<0)**(non-int) is NaN */ | ||
704 | if(((((uint32_t)hx>>31)-1)|yisint)==0) return (x-x)/(x-x); | ||
705 | |||
706 | /* |y| is huge */ | ||
707 | if(iy>0x4d000000) { /* if |y| > 2**27 */ | ||
708 | /* over/underflow if x is not close to one */ | ||
709 | if(ix<0x3f7ffff8) return (hy<0)? huge*huge:tiny*tiny; | ||
710 | if(ix>0x3f800007) return (hy>0)? huge*huge:tiny*tiny; | ||
711 | /* now |1-x| is tiny <= 2**-20, suffice to compute | ||
712 | log(x) by x-x^2/2+x^3/3-x^4/4 */ | ||
713 | t = x-1; /* t has 20 trailing zeros */ | ||
714 | w = (t*t)*((float)0.5-t*((float)0.333333333333-t*(float)0.25)); | ||
715 | u = ivln2_h*t; /* ivln2_h has 16 sig. bits */ | ||
716 | v = t*ivln2_l-w*ivln2; | ||
717 | t1 = u+v; | ||
718 | GET_FLOAT_WORD(is,t1); | ||
719 | SET_FLOAT_WORD(t1,is&0xfffff000); | ||
720 | t2 = v-(t1-u); | ||
721 | } else { | ||
722 | float s2, s_h, s_l, t_h, t_l; | ||
723 | n = 0; | ||
724 | /* take care subnormal number */ | ||
725 | if(ix<0x00800000) | ||
726 | {ax *= two24; n -= 24; GET_FLOAT_WORD(ix,ax); } | ||
727 | n += ((ix)>>23)-0x7f; | ||
728 | j = ix&0x007fffff; | ||
729 | /* determine interval */ | ||
730 | ix = j|0x3f800000; /* normalize ix */ | ||
731 | if(j<=0x1cc471) k=0; /* |x|<sqrt(3/2) */ | ||
732 | else if(j<0x5db3d7) k=1; /* |x|<sqrt(3) */ | ||
733 | else {k=0;n+=1;ix -= 0x00800000;} | ||
734 | SET_FLOAT_WORD(ax,ix); | ||
735 | |||
736 | /* compute s = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5) */ | ||
737 | u = ax-bp[k]; /* bp[0]=1.0, bp[1]=1.5 */ | ||
738 | v = one/(ax+bp[k]); | ||
739 | s = u*v; | ||
740 | s_h = s; | ||
741 | GET_FLOAT_WORD(is,s_h); | ||
742 | SET_FLOAT_WORD(s_h,is&0xfffff000); | ||
743 | /* t_h=ax+bp[k] High */ | ||
744 | SET_FLOAT_WORD(t_h,((ix>>1)|0x20000000)+0x0040000+(k<<21)); | ||
745 | t_l = ax - (t_h-bp[k]); | ||
746 | s_l = v*((u-s_h*t_h)-s_h*t_l); | ||
747 | /* compute log(ax) */ | ||
748 | s2 = s*s; | ||
749 | r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6))))); | ||
750 | r += s_l*(s_h+s); | ||
751 | s2 = s_h*s_h; | ||
752 | t_h = (float)3.0+s2+r; | ||
753 | GET_FLOAT_WORD(is,t_h); | ||
754 | SET_FLOAT_WORD(t_h,is&0xfffff000); | ||
755 | t_l = r-((t_h-(float)3.0)-s2); | ||
756 | /* u+v = s*(1+...) */ | ||
757 | u = s_h*t_h; | ||
758 | v = s_l*t_h+t_l*s; | ||
759 | /* 2/(3log2)*(s+...) */ | ||
760 | p_h = u+v; | ||
761 | GET_FLOAT_WORD(is,p_h); | ||
762 | SET_FLOAT_WORD(p_h,is&0xfffff000); | ||
763 | p_l = v-(p_h-u); | ||
764 | z_h = cp_h*p_h; /* cp_h+cp_l = 2/(3*log2) */ | ||
765 | z_l = cp_l*p_h+p_l*cp+dp_l[k]; | ||
766 | /* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */ | ||
767 | t = (float)n; | ||
768 | t1 = (((z_h+z_l)+dp_h[k])+t); | ||
769 | GET_FLOAT_WORD(is,t1); | ||
770 | SET_FLOAT_WORD(t1,is&0xfffff000); | ||
771 | t2 = z_l-(((t1-t)-dp_h[k])-z_h); | ||
772 | } | ||
773 | |||
774 | s = one; /* s (sign of result -ve**odd) = -1 else = 1 */ | ||
775 | if(((((uint32_t)hx>>31)-1)|(yisint-1))==0) | ||
776 | s = -one; /* (-ve)**(odd int) */ | ||
777 | |||
778 | /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */ | ||
779 | GET_FLOAT_WORD(is,y); | ||
780 | SET_FLOAT_WORD(y1,is&0xfffff000); | ||
781 | p_l = (y-y1)*t1+y*t2; | ||
782 | p_h = y1*t1; | ||
783 | z = p_l+p_h; | ||
784 | GET_FLOAT_WORD(j,z); | ||
785 | if (j>0x43000000) /* if z > 128 */ | ||
786 | return s*huge*huge; /* overflow */ | ||
787 | else if (j==0x43000000) { /* if z == 128 */ | ||
788 | if(p_l+ovt>z-p_h) return s*huge*huge; /* overflow */ | ||
789 | } | ||
790 | else if ((j&0x7fffffff)>0x43160000) /* z <= -150 */ | ||
791 | return s*tiny*tiny; /* underflow */ | ||
792 | else if ((uint32_t) j==0xc3160000){ /* z == -150 */ | ||
793 | if(p_l<=z-p_h) return s*tiny*tiny; /* underflow */ | ||
794 | } | ||
795 | /* | ||
796 | * compute 2**(p_h+p_l) | ||
797 | */ | ||
798 | i = j&0x7fffffff; | ||
799 | k = (i>>23)-0x7f; | ||
800 | n = 0; | ||
801 | if(i>0x3f000000) { /* if |z| > 0.5, set n = [z+0.5] */ | ||
802 | n = j+(0x00800000>>(k+1)); | ||
803 | k = ((n&0x7fffffff)>>23)-0x7f; /* new k for n */ | ||
804 | SET_FLOAT_WORD(t,n&~(0x007fffff>>k)); | ||
805 | n = ((n&0x007fffff)|0x00800000)>>(23-k); | ||
806 | if(j<0) n = -n; | ||
807 | p_h -= t; | ||
808 | } | ||
809 | t = p_l+p_h; | ||
810 | GET_FLOAT_WORD(is,t); | ||
811 | SET_FLOAT_WORD(t,is&0xfffff000); | ||
812 | u = t*lg2_h; | ||
813 | v = (p_l-(t-p_h))*lg2+t*lg2_l; | ||
814 | z = u+v; | ||
815 | w = v-(z-u); | ||
816 | t = z*z; | ||
817 | t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); | ||
818 | r = (z*t1)/(t1-two)-(w+z*w); | ||
819 | z = one-(r-z); | ||
820 | GET_FLOAT_WORD(j,z); | ||
821 | j += (n<<23); | ||
822 | if((j>>23)<=0) z = rb_scalbnf(z,n); /* subnormal output */ | ||
823 | else SET_FLOAT_WORD(z,j); | ||
824 | return s*z; | ||
825 | } | ||
826 | |||
827 | |||
828 | |||
829 | /* Square root function, original. */ | ||
830 | float rb_sqrt(float x) | ||
831 | { | ||
832 | float z; | ||
833 | int32_t sign = (int)0x80000000; | ||
834 | int32_t ix,s,q,m,t,i; | ||
835 | uint32_t r; | ||
836 | |||
837 | GET_FLOAT_WORD(ix,x); | ||
838 | |||
839 | /* take care of Inf and NaN */ | ||
840 | if((ix&0x7f800000)==0x7f800000) { | ||
841 | return x*x+x; /* sqrt(NaN)=NaN, sqrt(+inf)=+inf | ||
842 | sqrt(-inf)=sNaN */ | ||
843 | } | ||
844 | /* take care of zero */ | ||
845 | if(ix<=0) { | ||
846 | if((ix&(~sign))==0) return x;/* sqrt(+-0) = +-0 */ | ||
847 | else if(ix<0) | ||
848 | return (x-x)/(x-x); /* sqrt(-ve) = sNaN */ | ||
849 | } | ||
850 | /* normalize x */ | ||
851 | m = (ix>>23); | ||
852 | if(m==0) { /* subnormal x */ | ||
853 | for(i=0;(ix&0x00800000)==0;i++) ix<<=1; | ||
854 | m -= i-1; | ||
855 | } | ||
856 | m -= 127; /* unbias exponent */ | ||
857 | ix = (ix&0x007fffff)|0x00800000; | ||
858 | if(m&1) /* odd m, double x to make it even */ | ||
859 | ix += ix; | ||
860 | m >>= 1; /* m = [m/2] */ | ||
861 | |||
862 | /* generate sqrt(x) bit by bit */ | ||
863 | ix += ix; | ||
864 | q = s = 0; /* q = sqrt(x) */ | ||
865 | r = 0x01000000; /* r = moving bit from right to left */ | ||
866 | |||
867 | while(r!=0) { | ||
868 | t = s+r; | ||
869 | if(t<=ix) { | ||
870 | s = t+r; | ||
871 | ix -= t; | ||
872 | q += r; | ||
873 | } | ||
874 | ix += ix; | ||
875 | r>>=1; | ||
876 | } | ||
877 | |||
878 | /* use floating add to find out rounding direction */ | ||
879 | if(ix!=0) { | ||
880 | z = one-tiny; /* trigger inexact flag */ | ||
881 | if (z>=one) { | ||
882 | z = one+tiny; | ||
883 | if (z>one) | ||
884 | q += 2; | ||
885 | else | ||
886 | q += (q&1); | ||
887 | } | ||
888 | } | ||
889 | ix = (q>>1)+0x3f000000; | ||
890 | ix += (m <<23); | ||
891 | SET_FLOAT_WORD(z,ix); | ||
892 | return z; | ||
893 | } | ||
894 | |||
895 | /* Absolute value, | ||
896 | taken from glibc-2.8 */ | ||
897 | float rb_fabs(float x) | ||
898 | { | ||
899 | uint32_t ix; | ||
900 | GET_FLOAT_WORD(ix,x); | ||
901 | SET_FLOAT_WORD(x,ix&0x7fffffff); | ||
902 | return x; | ||
903 | } | ||
904 | |||
905 | /* Arc tangent, | ||
906 | taken from glibc-2.8. */ | ||
907 | |||
908 | static const float atanhi[] = { | ||
909 | 4.6364760399e-01, /* atan(0.5)hi 0x3eed6338 */ | ||
910 | 7.8539812565e-01, /* atan(1.0)hi 0x3f490fda */ | ||
911 | 9.8279368877e-01, /* atan(1.5)hi 0x3f7b985e */ | ||
912 | 1.5707962513e+00, /* atan(inf)hi 0x3fc90fda */ | ||
913 | }; | ||
914 | |||
915 | static const float atanlo[] = { | ||
916 | 5.0121582440e-09, /* atan(0.5)lo 0x31ac3769 */ | ||
917 | 3.7748947079e-08, /* atan(1.0)lo 0x33222168 */ | ||
918 | 3.4473217170e-08, /* atan(1.5)lo 0x33140fb4 */ | ||
919 | 7.5497894159e-08, /* atan(inf)lo 0x33a22168 */ | ||
920 | }; | ||
921 | |||
922 | static const float aT[] = { | ||
923 | 3.3333334327e-01, /* 0x3eaaaaaa */ | ||
924 | -2.0000000298e-01, /* 0xbe4ccccd */ | ||
925 | 1.4285714924e-01, /* 0x3e124925 */ | ||
926 | -1.1111110449e-01, /* 0xbde38e38 */ | ||
927 | 9.0908870101e-02, /* 0x3dba2e6e */ | ||
928 | -7.6918758452e-02, /* 0xbd9d8795 */ | ||
929 | 6.6610731184e-02, /* 0x3d886b35 */ | ||
930 | -5.8335702866e-02, /* 0xbd6ef16b */ | ||
931 | 4.9768779427e-02, /* 0x3d4bda59 */ | ||
932 | -3.6531571299e-02, /* 0xbd15a221 */ | ||
933 | 1.6285819933e-02, /* 0x3c8569d7 */ | ||
934 | }; | ||
935 | |||
936 | |||
937 | float rb_atan(float x) | ||
938 | { | ||
939 | float w,s1,s2,z; | ||
940 | int32_t ix,hx,id; | ||
941 | |||
942 | GET_FLOAT_WORD(hx,x); | ||
943 | ix = hx&0x7fffffff; | ||
944 | if(ix>=0x50800000) { /* if |x| >= 2^34 */ | ||
945 | if(ix>0x7f800000) | ||
946 | return x+x; /* NaN */ | ||
947 | if(hx>0) return atanhi[3]+atanlo[3]; | ||
948 | else return -atanhi[3]-atanlo[3]; | ||
949 | } if (ix < 0x3ee00000) { /* |x| < 0.4375 */ | ||
950 | if (ix < 0x31000000) { /* |x| < 2^-29 */ | ||
951 | if(huge+x>one) return x; /* raise inexact */ | ||
952 | } | ||
953 | id = -1; | ||
954 | } else { | ||
955 | x = rb_fabs(x); | ||
956 | if (ix < 0x3f980000) { /* |x| < 1.1875 */ | ||
957 | if (ix < 0x3f300000) { /* 7/16 <=|x|<11/16 */ | ||
958 | id = 0; x = ((float)2.0*x-one)/((float)2.0+x); | ||
959 | } else { /* 11/16<=|x|< 19/16 */ | ||
960 | id = 1; x = (x-one)/(x+one); | ||
961 | } | ||
962 | } else { | ||
963 | if (ix < 0x401c0000) { /* |x| < 2.4375 */ | ||
964 | id = 2; x = (x-(float)1.5)/(one+(float)1.5*x); | ||
965 | } else { /* 2.4375 <= |x| < 2^66 */ | ||
966 | id = 3; x = -(float)1.0/x; | ||
967 | } | ||
968 | }} | ||
969 | /* end of argument reduction */ | ||
970 | z = x*x; | ||
971 | w = z*z; | ||
972 | /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ | ||
973 | s1 = z*(aT[0]+w*(aT[2]+w*(aT[4]+w*(aT[6]+w*(aT[8]+w*aT[10]))))); | ||
974 | s2 = w*(aT[1]+w*(aT[3]+w*(aT[5]+w*(aT[7]+w*aT[9])))); | ||
975 | if (id<0) return x - x*(s1+s2); | ||
976 | else { | ||
977 | z = atanhi[id] - ((x*(s1+s2) - atanlo[id]) - x); | ||
978 | return (hx<0)? -z:z; | ||
979 | } | ||
980 | } | ||
981 | |||
982 | /* Arc tangent from two variables, original. */ | ||
983 | |||
984 | static const float | ||
985 | pi_o_4 = 7.8539818525e-01, /* 0x3f490fdb */ | ||
986 | pi_o_2 = 1.5707963705e+00, /* 0x3fc90fdb */ | ||
987 | pi = 3.1415927410e+00, /* 0x40490fdb */ | ||
988 | pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */ | ||
989 | |||
990 | float rb_atan2(float x, float y) | ||
991 | { | ||
992 | float z; | ||
993 | int32_t k,m,hx,hy,ix,iy; | ||
994 | |||
995 | GET_FLOAT_WORD(hx,x); | ||
996 | ix = hx&0x7fffffff; | ||
997 | GET_FLOAT_WORD(hy,y); | ||
998 | iy = hy&0x7fffffff; | ||
999 | if((ix>0x7f800000)|| | ||
1000 | (iy>0x7f800000)) /* x or y is NaN */ | ||
1001 | return x+y; | ||
1002 | if(hx==0x3f800000) return rb_atan(y); /* x=1.0 */ | ||
1003 | m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */ | ||
1004 | |||
1005 | /* when y = 0 */ | ||
1006 | if(iy==0) { | ||
1007 | switch(m) { | ||
1008 | case 0: | ||
1009 | case 1: return y; /* atan(+-0,+anything)=+-0 */ | ||
1010 | case 2: return pi+tiny;/* atan(+0,-anything) = pi */ | ||
1011 | case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ | ||
1012 | } | ||
1013 | } | ||
1014 | /* when x = 0 */ | ||
1015 | if(ix==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; | ||
1016 | |||
1017 | /* when x is INF */ | ||
1018 | if(ix==0x7f800000) { | ||
1019 | if(iy==0x7f800000) { | ||
1020 | switch(m) { | ||
1021 | case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */ | ||
1022 | case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */ | ||
1023 | case 2: return (float)3.0*pi_o_4+tiny;/*atan(+INF,-INF)*/ | ||
1024 | case 3: return (float)-3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/ | ||
1025 | } | ||
1026 | } else { | ||
1027 | switch(m) { | ||
1028 | case 0: return zero ; /* atan(+...,+INF) */ | ||
1029 | case 1: return -zero ; /* atan(-...,+INF) */ | ||
1030 | case 2: return pi+tiny ; /* atan(+...,-INF) */ | ||
1031 | case 3: return -pi-tiny ; /* atan(-...,-INF) */ | ||
1032 | } | ||
1033 | } | ||
1034 | } | ||
1035 | /* when y is INF */ | ||
1036 | if(iy==0x7f800000) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; | ||
1037 | |||
1038 | /* compute y/x */ | ||
1039 | k = (iy-ix)>>23; | ||
1040 | if(k > 60) z=pi_o_2+(float)0.5*pi_lo; /* |y/x| > 2**60 */ | ||
1041 | else if(hx<0&&k<-60) z=0.0; /* |y|/x < -2**60 */ | ||
1042 | else z=rb_atan(rb_fabs(y/x)); /* safe to do y/x */ | ||
1043 | switch (m) { | ||
1044 | case 0: return z ; /* atan(+,+) */ | ||
1045 | case 1: { | ||
1046 | uint32_t zh; | ||
1047 | GET_FLOAT_WORD(zh,z); | ||
1048 | SET_FLOAT_WORD(z,zh ^ 0x80000000); | ||
1049 | } | ||
1050 | return z ; /* atan(-,+) */ | ||
1051 | case 2: return pi-(z-pi_lo);/* atan(+,-) */ | ||
1052 | default: /* case 3 */ | ||
1053 | return (z-pi_lo)-pi;/* atan(-,-) */ | ||
1054 | } | ||
1055 | } | ||
1056 | |||
1057 | |||
1058 | /* Sine hyperbolic, | ||
1059 | taken from glibc-2.8 */ | ||
1060 | |||
1061 | static const float | ||
1062 | o_threshold = 8.8721679688e+01,/* 0x42b17180 */ | ||
1063 | invln2 = 1.4426950216e+00,/* 0x3fb8aa3b */ | ||
1064 | /* scaled coefficients related to expm1 */ | ||
1065 | Q1 = -3.3333335072e-02, /* 0xbd088889 */ | ||
1066 | Q2 = 1.5873016091e-03, /* 0x3ad00d01 */ | ||
1067 | Q3 = -7.9365076090e-05, /* 0xb8a670cd */ | ||
1068 | Q4 = 4.0082177293e-06, /* 0x36867e54 */ | ||
1069 | Q5 = -2.0109921195e-07; /* 0xb457edbb */ | ||
1070 | |||
1071 | float rb_expm1(float x) | ||
1072 | { | ||
1073 | float y,hi,lo,c=0,t,e,hxs,hfx,r1; | ||
1074 | int32_t k,xsb; | ||
1075 | uint32_t hx; | ||
1076 | |||
1077 | GET_FLOAT_WORD(hx,x); | ||
1078 | xsb = hx&0x80000000; /* sign bit of x */ | ||
1079 | if(xsb==0) y=x; else y= -x; /* y = |x| */ | ||
1080 | hx &= 0x7fffffff; /* high word of |x| */ | ||
1081 | |||
1082 | /* filter out huge and non-finite argument */ | ||
1083 | if(hx >= 0x4195b844) { /* if |x|>=27*ln2 */ | ||
1084 | if(hx >= 0x42b17218) { /* if |x|>=88.721... */ | ||
1085 | if(hx>0x7f800000) | ||
1086 | return x+x; /* NaN */ | ||
1087 | if(hx==0x7f800000) | ||
1088 | return (xsb==0)? x:-1.0;/* exp(+-inf)={inf,-1} */ | ||
1089 | if(x > o_threshold) return huge*huge; /* overflow */ | ||
1090 | } | ||
1091 | if(xsb!=0) { /* x < -27*ln2, return -1.0 with inexact */ | ||
1092 | if(x+tiny<(float)0.0) /* raise inexact */ | ||
1093 | return tiny-one; /* return -1 */ | ||
1094 | } | ||
1095 | } | ||
1096 | |||
1097 | /* argument reduction */ | ||
1098 | if(hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */ | ||
1099 | if(hx < 0x3F851592) { /* and |x| < 1.5 ln2 */ | ||
1100 | if(xsb==0) | ||
1101 | {hi = x - ln2_hi; lo = ln2_lo; k = 1;} | ||
1102 | else | ||
1103 | {hi = x + ln2_hi; lo = -ln2_lo; k = -1;} | ||
1104 | } else { | ||
1105 | k = invln2*x+((xsb==0)?(float)0.5:(float)-0.5); | ||
1106 | t = k; | ||
1107 | hi = x - t*ln2_hi; /* t*ln2_hi is exact here */ | ||
1108 | lo = t*ln2_lo; | ||
1109 | } | ||
1110 | x = hi - lo; | ||
1111 | c = (hi-x)-lo; | ||
1112 | } | ||
1113 | else if(hx < 0x33000000) { /* when |x|<2**-25, return x */ | ||
1114 | t = huge+x; /* return x with inexact flags when x!=0 */ | ||
1115 | return x - (t-(huge+x)); | ||
1116 | } | ||
1117 | else k = 0; | ||
1118 | |||
1119 | /* x is now in primary range */ | ||
1120 | hfx = (float)0.5*x; | ||
1121 | hxs = x*hfx; | ||
1122 | r1 = one+hxs*(Q1+hxs*(Q2+hxs*(Q3+hxs*(Q4+hxs*Q5)))); | ||
1123 | t = (float)3.0-r1*hfx; | ||
1124 | e = hxs*((r1-t)/((float)6.0 - x*t)); | ||
1125 | if(k==0) return x - (x*e-hxs); /* c is 0 */ | ||
1126 | else { | ||
1127 | e = (x*(e-c)-c); | ||
1128 | e -= hxs; | ||
1129 | if(k== -1) return (float)0.5*(x-e)-(float)0.5; | ||
1130 | if(k==1) { | ||
1131 | if(x < (float)-0.25) return -(float)2.0*(e-(x+(float)0.5)); | ||
1132 | else return one+(float)2.0*(x-e); | ||
1133 | } | ||
1134 | if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */ | ||
1135 | int32_t i; | ||
1136 | y = one-(e-x); | ||
1137 | GET_FLOAT_WORD(i,y); | ||
1138 | SET_FLOAT_WORD(y,i+(k<<23)); /* add k to y's exponent */ | ||
1139 | return y-one; | ||
1140 | } | ||
1141 | t = one; | ||
1142 | if(k<23) { | ||
1143 | int32_t i; | ||
1144 | SET_FLOAT_WORD(t,0x3f800000 - (0x1000000>>k)); /* t=1-2^-k */ | ||
1145 | y = t-(e-x); | ||
1146 | GET_FLOAT_WORD(i,y); | ||
1147 | SET_FLOAT_WORD(y,i+(k<<23)); /* add k to y's exponent */ | ||
1148 | } else { | ||
1149 | int32_t i; | ||
1150 | SET_FLOAT_WORD(t,((0x7f-k)<<23)); /* 2^-k */ | ||
1151 | y = x-(e+t); | ||
1152 | y += one; | ||
1153 | GET_FLOAT_WORD(i,y); | ||
1154 | SET_FLOAT_WORD(y,i+(k<<23)); /* add k to y's exponent */ | ||
1155 | } | ||
1156 | } | ||
1157 | return y; | ||
1158 | } | ||
1159 | |||
1160 | static const float shuge = 1.0e37; | ||
1161 | |||
1162 | float rb_sinh(float x) | ||
1163 | { | ||
1164 | float t,w,h; | ||
1165 | int32_t ix,jx; | ||
1166 | |||
1167 | GET_FLOAT_WORD(jx,x); | ||
1168 | ix = jx&0x7fffffff; | ||
1169 | |||
1170 | /* x is INF or NaN */ | ||
1171 | if(ix>=0x7f800000) return x+x; | ||
1172 | |||
1173 | h = 0.5; | ||
1174 | if (jx<0) h = -h; | ||
1175 | /* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */ | ||
1176 | if (ix < 0x41b00000) { /* |x|<22 */ | ||
1177 | if (ix<0x31800000) /* |x|<2**-28 */ | ||
1178 | if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */ | ||
1179 | t = rb_expm1(rb_fabs(x)); | ||
1180 | if(ix<0x3f800000) return h*((float)2.0*t-t*t/(t+one)); | ||
1181 | return h*(t+t/(t+one)); | ||
1182 | } | ||
1183 | |||
1184 | /* |x| in [22, log(maxdouble)] return 0.5*exp(|x|) */ | ||
1185 | if (ix < 0x42b17180) return h*rb_exp(rb_fabs(x)); | ||
1186 | |||
1187 | /* |x| in [log(maxdouble), overflowthresold] */ | ||
1188 | if (ix<=0x42b2d4fc) { | ||
1189 | w = rb_exp((float)0.5*rb_fabs(x)); | ||
1190 | t = h*w; | ||
1191 | return t*w; | ||
1192 | } | ||
1193 | |||
1194 | /* |x| > overflowthresold, sinh(x) overflow */ | ||
1195 | return x*shuge; | ||
1196 | } | ||
1197 | |||
1198 | |||
1199 | /* Tangent, | ||
1200 | taken from glibc-2.8 */ | ||
1201 | |||
1202 | static const float | ||
1203 | pio4 = 7.8539812565e-01, /* 0x3f490fda */ | ||
1204 | pio4lo= 3.7748947079e-08, /* 0x33222168 */ | ||
1205 | T[] = { | ||
1206 | 3.3333334327e-01, /* 0x3eaaaaab */ | ||
1207 | 1.3333334029e-01, /* 0x3e088889 */ | ||
1208 | 5.3968254477e-02, /* 0x3d5d0dd1 */ | ||
1209 | 2.1869488060e-02, /* 0x3cb327a4 */ | ||
1210 | 8.8632395491e-03, /* 0x3c11371f */ | ||
1211 | 3.5920790397e-03, /* 0x3b6b6916 */ | ||
1212 | 1.4562094584e-03, /* 0x3abede48 */ | ||
1213 | 5.8804126456e-04, /* 0x3a1a26c8 */ | ||
1214 | 2.4646313977e-04, /* 0x398137b9 */ | ||
1215 | 7.8179444245e-05, /* 0x38a3f445 */ | ||
1216 | 7.1407252108e-05, /* 0x3895c07a */ | ||
1217 | -1.8558637748e-05, /* 0xb79bae5f */ | ||
1218 | 2.5907305826e-05, /* 0x37d95384 */ | ||
1219 | }; | ||
1220 | |||
1221 | float kernel_tan(float x, float y, int iy) | ||
1222 | { | ||
1223 | float z,r,v,w,s; | ||
1224 | int32_t ix,hx; | ||
1225 | GET_FLOAT_WORD(hx,x); | ||
1226 | ix = hx&0x7fffffff; /* high word of |x| */ | ||
1227 | if(ix<0x31800000) /* x < 2**-28 */ | ||
1228 | {if((int)x==0) { /* generate inexact */ | ||
1229 | if((ix|(iy+1))==0) return one/rb_fabs(x); | ||
1230 | else return (iy==1)? x: -one/x; | ||
1231 | } | ||
1232 | } | ||
1233 | if(ix>=0x3f2ca140) { /* |x|>=0.6744 */ | ||
1234 | if(hx<0) {x = -x; y = -y;} | ||
1235 | z = pio4-x; | ||
1236 | w = pio4lo-y; | ||
1237 | x = z+w; y = 0.0; | ||
1238 | } | ||
1239 | z = x*x; | ||
1240 | w = z*z; | ||
1241 | /* Break x^5*(T[1]+x^2*T[2]+...) into | ||
1242 | * x^5(T[1]+x^4*T[3]+...+x^20*T[11]) + | ||
1243 | * x^5(x^2*(T[2]+x^4*T[4]+...+x^22*[T12])) | ||
1244 | */ | ||
1245 | r = T[1]+w*(T[3]+w*(T[5]+w*(T[7]+w*(T[9]+w*T[11])))); | ||
1246 | v = z*(T[2]+w*(T[4]+w*(T[6]+w*(T[8]+w*(T[10]+w*T[12]))))); | ||
1247 | s = z*x; | ||
1248 | r = y + z*(s*(r+v)+y); | ||
1249 | r += T[0]*s; | ||
1250 | w = x+r; | ||
1251 | if(ix>=0x3f2ca140) { | ||
1252 | v = (float)iy; | ||
1253 | return (float)(1-((hx>>30)&2))*(v-(float)2.0*(x-(w*w/(w+v)-r))); | ||
1254 | } | ||
1255 | if(iy==1) return w; | ||
1256 | else { /* if allow error up to 2 ulp, | ||
1257 | simply return -1.0/(x+r) here */ | ||
1258 | /* compute -1.0/(x+r) accurately */ | ||
1259 | float a,t; | ||
1260 | int32_t i; | ||
1261 | z = w; | ||
1262 | GET_FLOAT_WORD(i,z); | ||
1263 | SET_FLOAT_WORD(z,i&0xfffff000); | ||
1264 | v = r-(z - x); /* z+v = r+x */ | ||
1265 | t = a = -(float)1.0/w; /* a = -1.0/w */ | ||
1266 | GET_FLOAT_WORD(i,t); | ||
1267 | SET_FLOAT_WORD(t,i&0xfffff000); | ||
1268 | s = (float)1.0+t*z; | ||
1269 | return t+a*(s+t*v); | ||
1270 | } | ||
1271 | } | ||
1272 | |||
1273 | |||
1274 | |||
1275 | static const int init_jk[] = {4,7,9}; /* initial value for jk */ | ||
1276 | |||
1277 | static const float PIo2[] = { | ||
1278 | 1.5703125000e+00, /* 0x3fc90000 */ | ||
1279 | 4.5776367188e-04, /* 0x39f00000 */ | ||
1280 | 2.5987625122e-05, /* 0x37da0000 */ | ||
1281 | 7.5437128544e-08, /* 0x33a20000 */ | ||
1282 | 6.0026650317e-11, /* 0x2e840000 */ | ||
1283 | 7.3896444519e-13, /* 0x2b500000 */ | ||
1284 | 5.3845816694e-15, /* 0x27c20000 */ | ||
1285 | 5.6378512969e-18, /* 0x22d00000 */ | ||
1286 | 8.3009228831e-20, /* 0x1fc40000 */ | ||
1287 | 3.2756352257e-22, /* 0x1bc60000 */ | ||
1288 | 6.3331015649e-25, /* 0x17440000 */ | ||
1289 | }; | ||
1290 | |||
1291 | static const float | ||
1292 | two8 = 2.5600000000e+02, /* 0x43800000 */ | ||
1293 | twon8 = 3.9062500000e-03; /* 0x3b800000 */ | ||
1294 | |||
1295 | int kernel_rem_pio2(float *x, float *y, int e0, int nx, int prec, const int32_t *ipio2) | ||
1296 | { | ||
1297 | int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih; | ||
1298 | float z,fw,f[20],fq[20],q[20]; | ||
1299 | |||
1300 | /* initialize jk*/ | ||
1301 | jk = init_jk[prec]; | ||
1302 | jp = jk; | ||
1303 | |||
1304 | /* determine jx,jv,q0, note that 3>q0 */ | ||
1305 | jx = nx-1; | ||
1306 | jv = (e0-3)/8; if(jv<0) jv=0; | ||
1307 | q0 = e0-8*(jv+1); | ||
1308 | |||
1309 | /* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */ | ||
1310 | j = jv-jx; m = jx+jk; | ||
1311 | for(i=0;i<=m;i++,j++) f[i] = (j<0)? zero : (float) ipio2[j]; | ||
1312 | |||
1313 | /* compute q[0],q[1],...q[jk] */ | ||
1314 | for (i=0;i<=jk;i++) { | ||
1315 | for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw; | ||
1316 | } | ||
1317 | |||
1318 | jz = jk; | ||
1319 | recompute: | ||
1320 | /* distill q[] into iq[] reversingly */ | ||
1321 | for(i=0,j=jz,z=q[jz];j>0;i++,j--) { | ||
1322 | fw = (float)((int32_t)(twon8* z)); | ||
1323 | iq[i] = (int32_t)(z-two8*fw); | ||
1324 | z = q[j-1]+fw; | ||
1325 | } | ||
1326 | |||
1327 | /* compute n */ | ||
1328 | z = rb_scalbnf(z,q0); /* actual value of z */ | ||
1329 | z -= (float)8.0*rb_floor(z*(float)0.125); /* trim off integer >= 8 */ | ||
1330 | n = (int32_t) z; | ||
1331 | z -= (float)n; | ||
1332 | ih = 0; | ||
1333 | if(q0>0) { /* need iq[jz-1] to determine n */ | ||
1334 | i = (iq[jz-1]>>(8-q0)); n += i; | ||
1335 | iq[jz-1] -= i<<(8-q0); | ||
1336 | ih = iq[jz-1]>>(7-q0); | ||
1337 | } | ||
1338 | else if(q0==0) ih = iq[jz-1]>>8; | ||
1339 | else if(z>=(float)0.5) ih=2; | ||
1340 | |||
1341 | if(ih>0) { /* q > 0.5 */ | ||
1342 | n += 1; carry = 0; | ||
1343 | for(i=0;i<jz ;i++) { /* compute 1-q */ | ||
1344 | j = iq[i]; | ||
1345 | if(carry==0) { | ||
1346 | if(j!=0) { | ||
1347 | carry = 1; iq[i] = 0x100- j; | ||
1348 | } | ||
1349 | } else iq[i] = 0xff - j; | ||
1350 | } | ||
1351 | if(q0>0) { /* rare case: chance is 1 in 12 */ | ||
1352 | switch(q0) { | ||
1353 | case 1: | ||
1354 | iq[jz-1] &= 0x7f; break; | ||
1355 | case 2: | ||
1356 | iq[jz-1] &= 0x3f; break; | ||
1357 | } | ||
1358 | } | ||
1359 | if(ih==2) { | ||
1360 | z = one - z; | ||
1361 | if(carry!=0) z -= rb_scalbnf(one,q0); | ||
1362 | } | ||
1363 | } | ||
1364 | |||
1365 | /* check if recomputation is needed */ | ||
1366 | if(z==zero) { | ||
1367 | j = 0; | ||
1368 | for (i=jz-1;i>=jk;i--) j |= iq[i]; | ||
1369 | if(j==0) { /* need recomputation */ | ||
1370 | for(k=1;iq[jk-k]==0;k++); /* k = no. of terms needed */ | ||
1371 | |||
1372 | for(i=jz+1;i<=jz+k;i++) { /* add q[jz+1] to q[jz+k] */ | ||
1373 | f[jx+i] = (float) ipio2[jv+i]; | ||
1374 | for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; | ||
1375 | q[i] = fw; | ||
1376 | } | ||
1377 | jz += k; | ||
1378 | goto recompute; | ||
1379 | } | ||
1380 | } | ||
1381 | |||
1382 | /* chop off zero terms */ | ||
1383 | if(z==(float)0.0) { | ||
1384 | jz -= 1; q0 -= 8; | ||
1385 | while(iq[jz]==0) { jz--; q0-=8;} | ||
1386 | } else { /* break z into 8-bit if necessary */ | ||
1387 | z = rb_scalbnf(z,-q0); | ||
1388 | if(z>=two8) { | ||
1389 | fw = (float)((int32_t)(twon8*z)); | ||
1390 | iq[jz] = (int32_t)(z-two8*fw); | ||
1391 | jz += 1; q0 += 8; | ||
1392 | iq[jz] = (int32_t) fw; | ||
1393 | } else iq[jz] = (int32_t) z ; | ||
1394 | } | ||
1395 | |||
1396 | /* convert integer "bit" chunk to floating-point value */ | ||
1397 | fw = rb_scalbnf(one,q0); | ||
1398 | for(i=jz;i>=0;i--) { | ||
1399 | q[i] = fw*(float)iq[i]; fw*=twon8; | ||
1400 | } | ||
1401 | |||
1402 | /* compute PIo2[0,...,jp]*q[jz,...,0] */ | ||
1403 | for(i=jz;i>=0;i--) { | ||
1404 | for(fw=0.0,k=0;k<=jp&&k<=jz-i;k++) fw += PIo2[k]*q[i+k]; | ||
1405 | fq[jz-i] = fw; | ||
1406 | } | ||
1407 | |||
1408 | /* compress fq[] into y[] */ | ||
1409 | switch(prec) { | ||
1410 | case 0: | ||
1411 | fw = 0.0; | ||
1412 | for (i=jz;i>=0;i--) fw += fq[i]; | ||
1413 | y[0] = (ih==0)? fw: -fw; | ||
1414 | break; | ||
1415 | case 1: | ||
1416 | case 2: | ||
1417 | fw = 0.0; | ||
1418 | for (i=jz;i>=0;i--) fw += fq[i]; | ||
1419 | y[0] = (ih==0)? fw: -fw; | ||
1420 | fw = fq[0]-fw; | ||
1421 | for (i=1;i<=jz;i++) fw += fq[i]; | ||
1422 | y[1] = (ih==0)? fw: -fw; | ||
1423 | break; | ||
1424 | case 3: /* painful */ | ||
1425 | for (i=jz;i>0;i--) { | ||
1426 | fw = fq[i-1]+fq[i]; | ||
1427 | fq[i] += fq[i-1]-fw; | ||
1428 | fq[i-1] = fw; | ||
1429 | } | ||
1430 | for (i=jz;i>1;i--) { | ||
1431 | fw = fq[i-1]+fq[i]; | ||
1432 | fq[i] += fq[i-1]-fw; | ||
1433 | fq[i-1] = fw; | ||
1434 | } | ||
1435 | for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; | ||
1436 | if(ih==0) { | ||
1437 | y[0] = fq[0]; y[1] = fq[1]; y[2] = fw; | ||
1438 | } else { | ||
1439 | y[0] = -fq[0]; y[1] = -fq[1]; y[2] = -fw; | ||
1440 | } | ||
1441 | } | ||
1442 | return n&7; | ||
1443 | } | ||
1444 | |||
1445 | |||
1446 | static const int32_t two_over_pi[] = { | ||
1447 | 0xA2, 0xF9, 0x83, 0x6E, 0x4E, 0x44, 0x15, 0x29, 0xFC, | ||
1448 | 0x27, 0x57, 0xD1, 0xF5, 0x34, 0xDD, 0xC0, 0xDB, 0x62, | ||
1449 | 0x95, 0x99, 0x3C, 0x43, 0x90, 0x41, 0xFE, 0x51, 0x63, | ||
1450 | 0xAB, 0xDE, 0xBB, 0xC5, 0x61, 0xB7, 0x24, 0x6E, 0x3A, | ||
1451 | 0x42, 0x4D, 0xD2, 0xE0, 0x06, 0x49, 0x2E, 0xEA, 0x09, | ||
1452 | 0xD1, 0x92, 0x1C, 0xFE, 0x1D, 0xEB, 0x1C, 0xB1, 0x29, | ||
1453 | 0xA7, 0x3E, 0xE8, 0x82, 0x35, 0xF5, 0x2E, 0xBB, 0x44, | ||
1454 | 0x84, 0xE9, 0x9C, 0x70, 0x26, 0xB4, 0x5F, 0x7E, 0x41, | ||
1455 | 0x39, 0x91, 0xD6, 0x39, 0x83, 0x53, 0x39, 0xF4, 0x9C, | ||
1456 | 0x84, 0x5F, 0x8B, 0xBD, 0xF9, 0x28, 0x3B, 0x1F, 0xF8, | ||
1457 | 0x97, 0xFF, 0xDE, 0x05, 0x98, 0x0F, 0xEF, 0x2F, 0x11, | ||
1458 | 0x8B, 0x5A, 0x0A, 0x6D, 0x1F, 0x6D, 0x36, 0x7E, 0xCF, | ||
1459 | 0x27, 0xCB, 0x09, 0xB7, 0x4F, 0x46, 0x3F, 0x66, 0x9E, | ||
1460 | 0x5F, 0xEA, 0x2D, 0x75, 0x27, 0xBA, 0xC7, 0xEB, 0xE5, | ||
1461 | 0xF1, 0x7B, 0x3D, 0x07, 0x39, 0xF7, 0x8A, 0x52, 0x92, | ||
1462 | 0xEA, 0x6B, 0xFB, 0x5F, 0xB1, 0x1F, 0x8D, 0x5D, 0x08, | ||
1463 | 0x56, 0x03, 0x30, 0x46, 0xFC, 0x7B, 0x6B, 0xAB, 0xF0, | ||
1464 | 0xCF, 0xBC, 0x20, 0x9A, 0xF4, 0x36, 0x1D, 0xA9, 0xE3, | ||
1465 | 0x91, 0x61, 0x5E, 0xE6, 0x1B, 0x08, 0x65, 0x99, 0x85, | ||
1466 | 0x5F, 0x14, 0xA0, 0x68, 0x40, 0x8D, 0xFF, 0xD8, 0x80, | ||
1467 | 0x4D, 0x73, 0x27, 0x31, 0x06, 0x06, 0x15, 0x56, 0xCA, | ||
1468 | 0x73, 0xA8, 0xC9, 0x60, 0xE2, 0x7B, 0xC0, 0x8C, 0x6B, | ||
1469 | }; | ||
1470 | |||
1471 | static const int32_t npio2_hw[] = { | ||
1472 | 0x3fc90f00, 0x40490f00, 0x4096cb00, 0x40c90f00, 0x40fb5300, 0x4116cb00, | ||
1473 | 0x412fed00, 0x41490f00, 0x41623100, 0x417b5300, 0x418a3a00, 0x4196cb00, | ||
1474 | 0x41a35c00, 0x41afed00, 0x41bc7e00, 0x41c90f00, 0x41d5a000, 0x41e23100, | ||
1475 | 0x41eec200, 0x41fb5300, 0x4203f200, 0x420a3a00, 0x42108300, 0x4216cb00, | ||
1476 | 0x421d1400, 0x42235c00, 0x4229a500, 0x422fed00, 0x42363600, 0x423c7e00, | ||
1477 | 0x4242c700, 0x42490f00 | ||
1478 | }; | ||
1479 | |||
1480 | /* | ||
1481 | * invpio2: 24 bits of 2/pi | ||
1482 | * pio2_1: first 17 bit of pi/2 | ||
1483 | * pio2_1t: pi/2 - pio2_1 | ||
1484 | * pio2_2: second 17 bit of pi/2 | ||
1485 | * pio2_2t: pi/2 - (pio2_1+pio2_2) | ||
1486 | * pio2_3: third 17 bit of pi/2 | ||
1487 | * pio2_3t: pi/2 - (pio2_1+pio2_2+pio2_3) | ||
1488 | */ | ||
1489 | |||
1490 | static const float | ||
1491 | half = 5.0000000000e-01, /* 0x3f000000 */ | ||
1492 | invpio2 = 6.3661980629e-01, /* 0x3f22f984 */ | ||
1493 | pio2_1 = 1.5707855225e+00, /* 0x3fc90f80 */ | ||
1494 | pio2_1t = 1.0804334124e-05, /* 0x37354443 */ | ||
1495 | pio2_2 = 1.0804273188e-05, /* 0x37354400 */ | ||
1496 | pio2_2t = 6.0770999344e-11, /* 0x2e85a308 */ | ||
1497 | pio2_3 = 6.0770943833e-11, /* 0x2e85a300 */ | ||
1498 | pio2_3t = 6.1232342629e-17; /* 0x248d3132 */ | ||
1499 | |||
1500 | int32_t rem_pio2(float x, float *y) | ||
1501 | { | ||
1502 | float z,w,t,r,fn; | ||
1503 | float tx[3]; | ||
1504 | int32_t e0,i,j,nx,n,ix,hx; | ||
1505 | |||
1506 | GET_FLOAT_WORD(hx,x); | ||
1507 | ix = hx&0x7fffffff; | ||
1508 | if(ix<=0x3f490fd8) /* |x| ~<= pi/4 , no need for reduction */ | ||
1509 | {y[0] = x; y[1] = 0; return 0;} | ||
1510 | if(ix<0x4016cbe4) { /* |x| < 3pi/4, special case with n=+-1 */ | ||
1511 | if(hx>0) { | ||
1512 | z = x - pio2_1; | ||
1513 | if((ix&0xfffffff0)!=0x3fc90fd0) { /* 24+24 bit pi OK */ | ||
1514 | y[0] = z - pio2_1t; | ||
1515 | y[1] = (z-y[0])-pio2_1t; | ||
1516 | } else { /* near pi/2, use 24+24+24 bit pi */ | ||
1517 | z -= pio2_2; | ||
1518 | y[0] = z - pio2_2t; | ||
1519 | y[1] = (z-y[0])-pio2_2t; | ||
1520 | } | ||
1521 | return 1; | ||
1522 | } else { /* negative x */ | ||
1523 | z = x + pio2_1; | ||
1524 | if((ix&0xfffffff0)!=0x3fc90fd0) { /* 24+24 bit pi OK */ | ||
1525 | y[0] = z + pio2_1t; | ||
1526 | y[1] = (z-y[0])+pio2_1t; | ||
1527 | } else { /* near pi/2, use 24+24+24 bit pi */ | ||
1528 | z += pio2_2; | ||
1529 | y[0] = z + pio2_2t; | ||
1530 | y[1] = (z-y[0])+pio2_2t; | ||
1531 | } | ||
1532 | return -1; | ||
1533 | } | ||
1534 | } | ||
1535 | if(ix<=0x43490f80) { /* |x| ~<= 2^7*(pi/2), medium size */ | ||
1536 | t = rb_fabs(x); | ||
1537 | n = (int32_t) (t*invpio2+half); | ||
1538 | fn = (float)n; | ||
1539 | r = t-fn*pio2_1; | ||
1540 | w = fn*pio2_1t; /* 1st round good to 40 bit */ | ||
1541 | if(n<32&&(int32_t)(ix&0xffffff00)!=npio2_hw[n-1]) { | ||
1542 | y[0] = r-w; /* quick check no cancellation */ | ||
1543 | } else { | ||
1544 | uint32_t high; | ||
1545 | j = ix>>23; | ||
1546 | y[0] = r-w; | ||
1547 | GET_FLOAT_WORD(high,y[0]); | ||
1548 | i = j-((high>>23)&0xff); | ||
1549 | if(i>8) { /* 2nd iteration needed, good to 57 */ | ||
1550 | t = r; | ||
1551 | w = fn*pio2_2; | ||
1552 | r = t-w; | ||
1553 | w = fn*pio2_2t-((t-r)-w); | ||
1554 | y[0] = r-w; | ||
1555 | GET_FLOAT_WORD(high,y[0]); | ||
1556 | i = j-((high>>23)&0xff); | ||
1557 | if(i>25) { /* 3rd iteration need, 74 bits acc */ | ||
1558 | t = r; /* will cover all possible cases */ | ||
1559 | w = fn*pio2_3; | ||
1560 | r = t-w; | ||
1561 | w = fn*pio2_3t-((t-r)-w); | ||
1562 | y[0] = r-w; | ||
1563 | } | ||
1564 | } | ||
1565 | } | ||
1566 | y[1] = (r-y[0])-w; | ||
1567 | if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} | ||
1568 | else return n; | ||
1569 | } | ||
1570 | /* | ||
1571 | * all other (large) arguments | ||
1572 | */ | ||
1573 | if(ix>=0x7f800000) { /* x is inf or NaN */ | ||
1574 | y[0]=y[1]=x-x; return 0; | ||
1575 | } | ||
1576 | /* set z = scalbn(|x|,ilogb(x)-7) */ | ||
1577 | e0 = (ix>>23)-134; /* e0 = ilogb(z)-7; */ | ||
1578 | SET_FLOAT_WORD(z, ix - ((int32_t)(e0<<23))); | ||
1579 | for(i=0;i<2;i++) { | ||
1580 | tx[i] = (float)((int32_t)(z)); | ||
1581 | z = (z-tx[i])*two8; | ||
1582 | } | ||
1583 | tx[2] = z; | ||
1584 | nx = 3; | ||
1585 | while(tx[nx-1]==zero) nx--; /* skip zero term */ | ||
1586 | n = kernel_rem_pio2(tx,y,e0,nx,2,two_over_pi); | ||
1587 | if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} | ||
1588 | return n; | ||
1589 | } | ||
1590 | |||
1591 | float rb_tan(float x) | ||
1592 | { | ||
1593 | float y[2],z=0.0; | ||
1594 | int32_t n, ix; | ||
1595 | |||
1596 | GET_FLOAT_WORD(ix,x); | ||
1597 | |||
1598 | /* |x| ~< pi/4 */ | ||
1599 | ix &= 0x7fffffff; | ||
1600 | if(ix <= 0x3f490fda) return kernel_tan(x,z,1); | ||
1601 | |||
1602 | /* tan(Inf or NaN) is NaN */ | ||
1603 | else if (ix>=0x7f800000) return x-x; /* NaN */ | ||
1604 | |||
1605 | /* argument reduction needed */ | ||
1606 | else { | ||
1607 | n = rem_pio2(x,y); | ||
1608 | return kernel_tan(y[0],y[1],1-((n&1)<<1)); /* 1 -- n even | ||
1609 | -1 -- n odd */ | ||
1610 | } | ||
1611 | } | ||
1612 | |||
1613 | |||
1614 | |||
1615 | /* Exponential function, | ||
1616 | taken from glibc-2.8 | ||
1617 | As it uses double values and udefines some symbols, | ||
1618 | it was moved to the end of the source code */ | ||
1619 | |||
1620 | #define W52 (2.22044605e-16) | ||
1621 | #define W55 (2.77555756e-17) | ||
1622 | #define W58 (3.46944695e-18) | ||
1623 | #define W59 (1.73472348e-18) | ||
1624 | #define W60 (8.67361738e-19) | ||
1625 | const float __exp_deltatable[178] = { | ||
1626 | 0*W60, 16558714*W60, -10672149*W59, 1441652*W60, | ||
1627 | -15787963*W55, 462888*W60, 7291806*W60, 1698880*W60, | ||
1628 | -14375103*W58, -2021016*W60, 728829*W60, -3759654*W60, | ||
1629 | 3202123*W60, -10916019*W58, -251570*W60, -1043086*W60, | ||
1630 | 8207536*W60, -409964*W60, -5993931*W60, -475500*W60, | ||
1631 | 2237522*W60, 324170*W60, -244117*W60, 32077*W60, | ||
1632 | 123907*W60, -1019734*W60, -143*W60, 813077*W60, | ||
1633 | 743345*W60, 462461*W60, 629794*W60, 2125066*W60, | ||
1634 | -2339121*W60, -337951*W60, 9922067*W60, -648704*W60, | ||
1635 | 149407*W60, -2687209*W60, -631608*W60, 2128280*W60, | ||
1636 | -4882082*W60, 2001360*W60, 175074*W60, 2923216*W60, | ||
1637 | -538947*W60, -1212193*W60, -1920926*W60, -1080577*W60, | ||
1638 | 3690196*W60, 2643367*W60, 2911937*W60, 671455*W60, | ||
1639 | -1128674*W60, 593282*W60, -5219347*W60, -1941490*W60, | ||
1640 | 11007953*W60, 239609*W60, -2969658*W60, -1183650*W60, | ||
1641 | 942998*W60, 699063*W60, 450569*W60, -329250*W60, | ||
1642 | -7257875*W60, -312436*W60, 51626*W60, 555877*W60, | ||
1643 | -641761*W60, 1565666*W60, 884327*W60, -10960035*W60, | ||
1644 | -2004679*W60, -995793*W60, -2229051*W60, -146179*W60, | ||
1645 | -510327*W60, 1453482*W60, -3778852*W60, -2238056*W60, | ||
1646 | -4895983*W60, 3398883*W60, -252738*W60, 1230155*W60, | ||
1647 | 346918*W60, 1109352*W60, 268941*W60, -2930483*W60, | ||
1648 | -1036263*W60, -1159280*W60, 1328176*W60, 2937642*W60, | ||
1649 | -9371420*W60, -6902650*W60, -1419134*W60, 1442904*W60, | ||
1650 | -1319056*W60, -16369*W60, 696555*W60, -279987*W60, | ||
1651 | -7919763*W60, 252741*W60, 459711*W60, -1709645*W60, | ||
1652 | 354913*W60, 6025867*W60, -421460*W60, -853103*W60, | ||
1653 | -338649*W60, 962151*W60, 955965*W60, 784419*W60, | ||
1654 | -3633653*W60, 2277133*W60, -8847927*W52, 1223028*W60, | ||
1655 | 5907079*W60, 623167*W60, 5142888*W60, 2599099*W60, | ||
1656 | 1214280*W60, 4870359*W60, 593349*W60, -57705*W60, | ||
1657 | 7761209*W60, -5564097*W60, 2051261*W60, 6216869*W60, | ||
1658 | 4692163*W60, 601691*W60, -5264906*W60, 1077872*W60, | ||
1659 | -3205949*W60, 1833082*W60, 2081746*W60, -987363*W60, | ||
1660 | -1049535*W60, 2015244*W60, 874230*W60, 2168259*W60, | ||
1661 | -1740124*W60, -10068269*W60, -18242*W60, -3013583*W60, | ||
1662 | 580601*W60, -2547161*W60, -535689*W60, 2220815*W60, | ||
1663 | 1285067*W60, 2806933*W60, -983086*W60, -1729097*W60, | ||
1664 | -1162985*W60, -2561904*W60, 801988*W60, 244351*W60, | ||
1665 | 1441893*W60, -7517981*W60, 271781*W60, -15021588*W60, | ||
1666 | -2341588*W60, -919198*W60, 1642232*W60, 4771771*W60, | ||
1667 | -1220099*W60, -3062372*W60, 628624*W60, 1278114*W60, | ||
1668 | 13083513*W60, -10521925*W60, 3180310*W60, -1659307*W60, | ||
1669 | 3543773*W60, 2501203*W60, 4151*W60, -340748*W60, | ||
1670 | -2285625*W60, 2495202*W60 | ||
1671 | }; | ||
1672 | |||
1673 | const double __exp_atable[355] /* __attribute__((mode(DF))) */ = { | ||
1674 | 0.707722561055888932371, /* 0x0.b52d4e46605c27ffd */ | ||
1675 | 0.709106182438804188967, /* 0x0.b587fb96f75097ffb */ | ||
1676 | 0.710492508843861281234, /* 0x0.b5e2d649899167ffd */ | ||
1677 | 0.711881545564593931623, /* 0x0.b63dde74d36bdfffe */ | ||
1678 | 0.713273297897442870573, /* 0x0.b699142f945f87ffc */ | ||
1679 | 0.714667771153751463236, /* 0x0.b6f477909c4ea0001 */ | ||
1680 | 0.716064970655995725059, /* 0x0.b75008aec758f8004 */ | ||
1681 | 0.717464901723956938193, /* 0x0.b7abc7a0eea7e0002 */ | ||
1682 | 0.718867569715736398602, /* 0x0.b807b47e1586c7ff8 */ | ||
1683 | 0.720272979947266023271, /* 0x0.b863cf5d10e380003 */ | ||
1684 | 0.721681137825144314297, /* 0x0.b8c01855195c37ffb */ | ||
1685 | 0.723092048691992950199, /* 0x0.b91c8f7d213740004 */ | ||
1686 | 0.724505717938892290800, /* 0x0.b97934ec5002d0007 */ | ||
1687 | 0.725922150953176470431, /* 0x0.b9d608b9c92ea7ffc */ | ||
1688 | 0.727341353138962865022, /* 0x0.ba330afcc29e98003 */ | ||
1689 | 0.728763329918453162104, /* 0x0.ba903bcc8618b7ffc */ | ||
1690 | 0.730188086709957051568, /* 0x0.baed9b40591ba0000 */ | ||
1691 | 0.731615628948127705309, /* 0x0.bb4b296f931e30002 */ | ||
1692 | 0.733045962086486091436, /* 0x0.bba8e671a05617ff9 */ | ||
1693 | 0.734479091556371366251, /* 0x0.bc06d25dd49568001 */ | ||
1694 | 0.735915022857225542529, /* 0x0.bc64ed4bce8f6fff9 */ | ||
1695 | 0.737353761441304711410, /* 0x0.bcc33752f915d7ff9 */ | ||
1696 | 0.738795312814142124419, /* 0x0.bd21b08af98e78005 */ | ||
1697 | 0.740239682467211168593, /* 0x0.bd80590b65e9a8000 */ | ||
1698 | 0.741686875913991849885, /* 0x0.bddf30ebec4a10000 */ | ||
1699 | 0.743136898669507939299, /* 0x0.be3e38443c84e0007 */ | ||
1700 | 0.744589756269486091620, /* 0x0.be9d6f2c1d32a0002 */ | ||
1701 | 0.746045454254026796384, /* 0x0.befcd5bb59baf8004 */ | ||
1702 | 0.747503998175051087583, /* 0x0.bf5c6c09ca84c0003 */ | ||
1703 | 0.748965393601880857739, /* 0x0.bfbc322f5b18b7ff8 */ | ||
1704 | 0.750429646104262104698, /* 0x0.c01c2843f776fffff */ | ||
1705 | 0.751896761271877989160, /* 0x0.c07c4e5fa18b88002 */ | ||
1706 | 0.753366744698445112140, /* 0x0.c0dca49a5fb18fffd */ | ||
1707 | 0.754839601988627206827, /* 0x0.c13d2b0c444db0005 */ | ||
1708 | 0.756315338768691947122, /* 0x0.c19de1cd798578006 */ | ||
1709 | 0.757793960659406629066, /* 0x0.c1fec8f623723fffd */ | ||
1710 | 0.759275473314173443536, /* 0x0.c25fe09e8a0f47ff8 */ | ||
1711 | 0.760759882363831851927, /* 0x0.c2c128dedc88f8000 */ | ||
1712 | 0.762247193485956486805, /* 0x0.c322a1cf7d6e7fffa */ | ||
1713 | 0.763737412354726363781, /* 0x0.c3844b88cb9347ffc */ | ||
1714 | 0.765230544649828092739, /* 0x0.c3e626232bd8f7ffc */ | ||
1715 | 0.766726596071518051729, /* 0x0.c44831b719bf18002 */ | ||
1716 | 0.768225572321911687194, /* 0x0.c4aa6e5d12d078001 */ | ||
1717 | 0.769727479119219348810, /* 0x0.c50cdc2da64a37ffb */ | ||
1718 | 0.771232322196981678892, /* 0x0.c56f7b41744490001 */ | ||
1719 | 0.772740107296721268087, /* 0x0.c5d24bb1259e70004 */ | ||
1720 | 0.774250840160724651565, /* 0x0.c6354d95640dd0007 */ | ||
1721 | 0.775764526565368872643, /* 0x0.c6988106fec447fff */ | ||
1722 | 0.777281172269557396602, /* 0x0.c6fbe61eb1bd0ffff */ | ||
1723 | 0.778800783068235302750, /* 0x0.c75f7cf560942fffc */ | ||
1724 | 0.780323364758801041312, /* 0x0.c7c345a3f1983fffe */ | ||
1725 | 0.781848923151573727006, /* 0x0.c8274043594cb0002 */ | ||
1726 | 0.783377464064598849602, /* 0x0.c88b6cec94b3b7ff9 */ | ||
1727 | 0.784908993312207869935, /* 0x0.c8efcbb89cba27ffe */ | ||
1728 | 0.786443516765346961618, /* 0x0.c9545cc0a88c70003 */ | ||
1729 | 0.787981040257604625744, /* 0x0.c9b9201dc643bfffa */ | ||
1730 | 0.789521569657452682047, /* 0x0.ca1e15e92a5410007 */ | ||
1731 | 0.791065110849462849192, /* 0x0.ca833e3c1ae510005 */ | ||
1732 | 0.792611669712891875319, /* 0x0.cae8992fd84667ffd */ | ||
1733 | 0.794161252150049179450, /* 0x0.cb4e26ddbc207fff8 */ | ||
1734 | 0.795713864077794763584, /* 0x0.cbb3e75f301b60003 */ | ||
1735 | 0.797269511407239561694, /* 0x0.cc19dacd978cd8002 */ | ||
1736 | 0.798828200086368567220, /* 0x0.cc8001427e55d7ffb */ | ||
1737 | 0.800389937624300440456, /* 0x0.cce65ade24d360006 */ | ||
1738 | 0.801954725261124767840, /* 0x0.cd4ce7a5de839fffb */ | ||
1739 | 0.803522573691593189330, /* 0x0.cdb3a7c79a678fffd */ | ||
1740 | 0.805093487311204114563, /* 0x0.ce1a9b563965ffffc */ | ||
1741 | 0.806667472122675088819, /* 0x0.ce81c26b838db8000 */ | ||
1742 | 0.808244534127439906441, /* 0x0.cee91d213f8428002 */ | ||
1743 | 0.809824679342317166307, /* 0x0.cf50ab9144d92fff9 */ | ||
1744 | 0.811407913793616542005, /* 0x0.cfb86dd5758c2ffff */ | ||
1745 | 0.812994243520784198882, /* 0x0.d0206407c20e20005 */ | ||
1746 | 0.814583674571603966162, /* 0x0.d0888e4223facfff9 */ | ||
1747 | 0.816176213022088536960, /* 0x0.d0f0ec9eb3f7c8002 */ | ||
1748 | 0.817771864936188586101, /* 0x0.d1597f377d6768002 */ | ||
1749 | 0.819370636400374108252, /* 0x0.d1c24626a46eafff8 */ | ||
1750 | 0.820972533518165570298, /* 0x0.d22b41865ff1e7ff9 */ | ||
1751 | 0.822577562404315121269, /* 0x0.d2947170f32ec7ff9 */ | ||
1752 | 0.824185729164559344159, /* 0x0.d2fdd60097795fff8 */ | ||
1753 | 0.825797039949601741075, /* 0x0.d3676f4fb796d0001 */ | ||
1754 | 0.827411500902565544264, /* 0x0.d3d13d78b5f68fffb */ | ||
1755 | 0.829029118181348834154, /* 0x0.d43b40960546d8001 */ | ||
1756 | 0.830649897953322891022, /* 0x0.d4a578c222a058000 */ | ||
1757 | 0.832273846408250750368, /* 0x0.d50fe617a3ba78005 */ | ||
1758 | 0.833900969738858188772, /* 0x0.d57a88b1218e90002 */ | ||
1759 | 0.835531274148056613016, /* 0x0.d5e560a94048f8006 */ | ||
1760 | 0.837164765846411529371, /* 0x0.d6506e1aac8078003 */ | ||
1761 | 0.838801451086016225394, /* 0x0.d6bbb1204074e0001 */ | ||
1762 | 0.840441336100884561780, /* 0x0.d72729d4c28518004 */ | ||
1763 | 0.842084427144139224814, /* 0x0.d792d8530e12b0001 */ | ||
1764 | 0.843730730487052604790, /* 0x0.d7febcb61273e7fff */ | ||
1765 | 0.845380252404570153833, /* 0x0.d86ad718c308dfff9 */ | ||
1766 | 0.847032999194574087728, /* 0x0.d8d727962c69d7fff */ | ||
1767 | 0.848688977161248581090, /* 0x0.d943ae49621ce7ffb */ | ||
1768 | 0.850348192619261200615, /* 0x0.d9b06b4d832ef8005 */ | ||
1769 | 0.852010651900976245816, /* 0x0.da1d5ebdc22220005 */ | ||
1770 | 0.853676361342631029337, /* 0x0.da8a88b555baa0006 */ | ||
1771 | 0.855345327311054837175, /* 0x0.daf7e94f965f98004 */ | ||
1772 | 0.857017556155879489641, /* 0x0.db6580a7c98f7fff8 */ | ||
1773 | 0.858693054267390953857, /* 0x0.dbd34ed9617befff8 */ | ||
1774 | 0.860371828028939855647, /* 0x0.dc4153ffc8b65fff9 */ | ||
1775 | 0.862053883854957292436, /* 0x0.dcaf90368bfca8004 */ | ||
1776 | 0.863739228154875360306, /* 0x0.dd1e0399328d87ffe */ | ||
1777 | 0.865427867361348468455, /* 0x0.dd8cae435d303fff9 */ | ||
1778 | 0.867119807911702289458, /* 0x0.ddfb9050b1cee8006 */ | ||
1779 | 0.868815056264353846599, /* 0x0.de6aa9dced8448001 */ | ||
1780 | 0.870513618890481399881, /* 0x0.ded9fb03db7320006 */ | ||
1781 | 0.872215502247877139094, /* 0x0.df4983e1380657ff8 */ | ||
1782 | 0.873920712852848668986, /* 0x0.dfb94490ffff77ffd */ | ||
1783 | 0.875629257204025623884, /* 0x0.e0293d2f1cb01fff9 */ | ||
1784 | 0.877341141814212965880, /* 0x0.e0996dd786fff0007 */ | ||
1785 | 0.879056373217612985183, /* 0x0.e109d6a64f5d57ffc */ | ||
1786 | 0.880774957955916648615, /* 0x0.e17a77b78e72a7ffe */ | ||
1787 | 0.882496902590150900078, /* 0x0.e1eb5127722cc7ff8 */ | ||
1788 | 0.884222213673356738383, /* 0x0.e25c63121fb0c8006 */ | ||
1789 | 0.885950897802399772740, /* 0x0.e2cdad93ec5340003 */ | ||
1790 | 0.887682961567391237685, /* 0x0.e33f30c925fb97ffb */ | ||
1791 | 0.889418411575228162725, /* 0x0.e3b0ecce2d05ffff9 */ | ||
1792 | 0.891157254447957902797, /* 0x0.e422e1bf727718006 */ | ||
1793 | 0.892899496816652704641, /* 0x0.e4950fb9713fc7ffe */ | ||
1794 | 0.894645145323828439008, /* 0x0.e50776d8b0e60fff8 */ | ||
1795 | 0.896394206626591749641, /* 0x0.e57a1739c8fadfffc */ | ||
1796 | 0.898146687421414902124, /* 0x0.e5ecf0f97c5798007 */ | ||
1797 | 0.899902594367530173098, /* 0x0.e660043464e378005 */ | ||
1798 | 0.901661934163603406867, /* 0x0.e6d3510747e150006 */ | ||
1799 | 0.903424713533971135418, /* 0x0.e746d78f06cd97ffd */ | ||
1800 | 0.905190939194458810123, /* 0x0.e7ba97e879c91fffc */ | ||
1801 | 0.906960617885092856864, /* 0x0.e82e92309390b0007 */ | ||
1802 | 0.908733756358986566306, /* 0x0.e8a2c6845544afffa */ | ||
1803 | 0.910510361377119825629, /* 0x0.e9173500c8abc7ff8 */ | ||
1804 | 0.912290439722343249336, /* 0x0.e98bddc30f98b0002 */ | ||
1805 | 0.914073998177417412765, /* 0x0.ea00c0e84bc4c7fff */ | ||
1806 | 0.915861043547953501680, /* 0x0.ea75de8db8094fffe */ | ||
1807 | 0.917651582652244779397, /* 0x0.eaeb36d09d3137ffe */ | ||
1808 | 0.919445622318405764159, /* 0x0.eb60c9ce4ed3dffff */ | ||
1809 | 0.921243169397334638073, /* 0x0.ebd697a43995b0007 */ | ||
1810 | 0.923044230737526172328, /* 0x0.ec4ca06fc7768fffa */ | ||
1811 | 0.924848813220121135342, /* 0x0.ecc2e44e865b6fffb */ | ||
1812 | 0.926656923710931002014, /* 0x0.ed39635df34e70006 */ | ||
1813 | 0.928468569126343790092, /* 0x0.edb01dbbc2f5b7ffa */ | ||
1814 | 0.930283756368834757725, /* 0x0.ee2713859aab57ffa */ | ||
1815 | 0.932102492359406786818, /* 0x0.ee9e44d9342870004 */ | ||
1816 | 0.933924784042873379360, /* 0x0.ef15b1d4635438005 */ | ||
1817 | 0.935750638358567643520, /* 0x0.ef8d5a94f60f50007 */ | ||
1818 | 0.937580062297704630580, /* 0x0.f0053f38f345cffff */ | ||
1819 | 0.939413062815381727516, /* 0x0.f07d5fde3a2d98001 */ | ||
1820 | 0.941249646905368053689, /* 0x0.f0f5bca2d481a8004 */ | ||
1821 | 0.943089821583810716806, /* 0x0.f16e55a4e497d7ffe */ | ||
1822 | 0.944933593864477061592, /* 0x0.f1e72b028a2827ffb */ | ||
1823 | 0.946780970781518460559, /* 0x0.f2603cd9fb5430001 */ | ||
1824 | 0.948631959382661205081, /* 0x0.f2d98b497d2a87ff9 */ | ||
1825 | 0.950486566729423554277, /* 0x0.f353166f63e3dffff */ | ||
1826 | 0.952344799896018723290, /* 0x0.f3ccde6a11ae37ffe */ | ||
1827 | 0.954206665969085765512, /* 0x0.f446e357f66120000 */ | ||
1828 | 0.956072172053890279009, /* 0x0.f4c12557964f0fff9 */ | ||
1829 | 0.957941325265908139014, /* 0x0.f53ba48781046fffb */ | ||
1830 | 0.959814132734539637840, /* 0x0.f5b66106555d07ffa */ | ||
1831 | 0.961690601603558903308, /* 0x0.f6315af2c2027fffc */ | ||
1832 | 0.963570739036113010927, /* 0x0.f6ac926b8aeb80004 */ | ||
1833 | 0.965454552202857141381, /* 0x0.f728078f7c5008002 */ | ||
1834 | 0.967342048278315158608, /* 0x0.f7a3ba7d66a908001 */ | ||
1835 | 0.969233234469444204768, /* 0x0.f81fab543e1897ffb */ | ||
1836 | 0.971128118008140250896, /* 0x0.f89bda33122c78007 */ | ||
1837 | 0.973026706099345495256, /* 0x0.f9184738d4cf97ff8 */ | ||
1838 | 0.974929006031422851235, /* 0x0.f994f284d3a5c0008 */ | ||
1839 | 0.976835024947348973265, /* 0x0.fa11dc35bc7820002 */ | ||
1840 | 0.978744770239899142285, /* 0x0.fa8f046b4fb7f8007 */ | ||
1841 | 0.980658249138918636210, /* 0x0.fb0c6b449ab1cfff9 */ | ||
1842 | 0.982575468959622777535, /* 0x0.fb8a10e1088fb7ffa */ | ||
1843 | 0.984496437054508843888, /* 0x0.fc07f5602d79afffc */ | ||
1844 | 0.986421160608523028820, /* 0x0.fc8618e0e55e47ffb */ | ||
1845 | 0.988349647107594098099, /* 0x0.fd047b83571b1fffa */ | ||
1846 | 0.990281903873210800357, /* 0x0.fd831d66f4c018002 */ | ||
1847 | 0.992217938695037382475, /* 0x0.fe01fead3320bfff8 */ | ||
1848 | 0.994157757657894713987, /* 0x0.fe811f703491e8006 */ | ||
1849 | 0.996101369488558541238, /* 0x0.ff007fd5744490005 */ | ||
1850 | 0.998048781093141101932, /* 0x0.ff801ffa9b9280007 */ | ||
1851 | 1.000000000000000000000, /* 0x1.00000000000000000 */ | ||
1852 | 1.001955033605393285965, /* 0x1.0080200565d29ffff */ | ||
1853 | 1.003913889319761887310, /* 0x1.0100802aa0e80fff0 */ | ||
1854 | 1.005876574715736104818, /* 0x1.01812090377240007 */ | ||
1855 | 1.007843096764807100351, /* 0x1.020201541aad7fff6 */ | ||
1856 | 1.009813464316352327214, /* 0x1.0283229c4c9820007 */ | ||
1857 | 1.011787683565730677817, /* 0x1.030484836910a000e */ | ||
1858 | 1.013765762469146736174, /* 0x1.0386272b9c077fffe */ | ||
1859 | 1.015747708536026694351, /* 0x1.04080ab526304fff0 */ | ||
1860 | 1.017733529475172815584, /* 0x1.048a2f412375ffff0 */ | ||
1861 | 1.019723232714418781378, /* 0x1.050c94ef7ad5e000a */ | ||
1862 | 1.021716825883923762690, /* 0x1.058f3be0f1c2d0004 */ | ||
1863 | 1.023714316605201180057, /* 0x1.06122436442e2000e */ | ||
1864 | 1.025715712440059545995, /* 0x1.06954e0fec63afff2 */ | ||
1865 | 1.027721021151397406936, /* 0x1.0718b98f41c92fff6 */ | ||
1866 | 1.029730250269221158939, /* 0x1.079c66d49bb2ffff1 */ | ||
1867 | 1.031743407506447551857, /* 0x1.082056011a9230009 */ | ||
1868 | 1.033760500517691527387, /* 0x1.08a487359ebd50002 */ | ||
1869 | 1.035781537016238873464, /* 0x1.0928fa93490d4fff3 */ | ||
1870 | 1.037806524719013578963, /* 0x1.09adb03b3e5b3000d */ | ||
1871 | 1.039835471338248051878, /* 0x1.0a32a84e9e5760004 */ | ||
1872 | 1.041868384612101516848, /* 0x1.0ab7e2eea5340ffff */ | ||
1873 | 1.043905272300907460835, /* 0x1.0b3d603ca784f0009 */ | ||
1874 | 1.045946142174331239262, /* 0x1.0bc3205a042060000 */ | ||
1875 | 1.047991002016745332165, /* 0x1.0c4923682a086fffe */ | ||
1876 | 1.050039859627715177527, /* 0x1.0ccf698898f3a000d */ | ||
1877 | 1.052092722826109660856, /* 0x1.0d55f2dce5d1dfffb */ | ||
1878 | 1.054149599440827866881, /* 0x1.0ddcbf86b09a5fff6 */ | ||
1879 | 1.056210497317612961855, /* 0x1.0e63cfa7abc97fffd */ | ||
1880 | 1.058275424318780855142, /* 0x1.0eeb23619c146fffb */ | ||
1881 | 1.060344388322010722446, /* 0x1.0f72bad65714bffff */ | ||
1882 | 1.062417397220589476718, /* 0x1.0ffa9627c38d30004 */ | ||
1883 | 1.064494458915699715017, /* 0x1.1082b577d0eef0003 */ | ||
1884 | 1.066575581342167566880, /* 0x1.110b18e893a90000a */ | ||
1885 | 1.068660772440545025953, /* 0x1.1193c09c267610006 */ | ||
1886 | 1.070750040138235936705, /* 0x1.121cacb4959befff6 */ | ||
1887 | 1.072843392435016474095, /* 0x1.12a5dd543cf36ffff */ | ||
1888 | 1.074940837302467588937, /* 0x1.132f529d59552000b */ | ||
1889 | 1.077042382749654914030, /* 0x1.13b90cb250d08fff5 */ | ||
1890 | 1.079148036789447484528, /* 0x1.14430bb58da3dfff9 */ | ||
1891 | 1.081257807444460983297, /* 0x1.14cd4fc984c4a000e */ | ||
1892 | 1.083371702785017154417, /* 0x1.1557d910df9c7000e */ | ||
1893 | 1.085489730853784307038, /* 0x1.15e2a7ae292d30002 */ | ||
1894 | 1.087611899742884524772, /* 0x1.166dbbc422d8c0004 */ | ||
1895 | 1.089738217537583819804, /* 0x1.16f9157586772ffff */ | ||
1896 | 1.091868692357631731528, /* 0x1.1784b4e533cacfff0 */ | ||
1897 | 1.094003332327482702577, /* 0x1.18109a360fc23fff2 */ | ||
1898 | 1.096142145591650907149, /* 0x1.189cc58b155a70008 */ | ||
1899 | 1.098285140311341168136, /* 0x1.1929370751ea50002 */ | ||
1900 | 1.100432324652149906842, /* 0x1.19b5eecdd79cefff0 */ | ||
1901 | 1.102583706811727015711, /* 0x1.1a42ed01dbdba000e */ | ||
1902 | 1.104739294993289488947, /* 0x1.1ad031c69a2eafff0 */ | ||
1903 | 1.106899097422573863281, /* 0x1.1b5dbd3f66e120003 */ | ||
1904 | 1.109063122341542140286, /* 0x1.1beb8f8fa8150000b */ | ||
1905 | 1.111231377994659874592, /* 0x1.1c79a8dac6ad0fff4 */ | ||
1906 | 1.113403872669181282605, /* 0x1.1d0809445a97ffffc */ | ||
1907 | 1.115580614653132185460, /* 0x1.1d96b0effc9db000e */ | ||
1908 | 1.117761612217810673898, /* 0x1.1e25a001332190000 */ | ||
1909 | 1.119946873713312474002, /* 0x1.1eb4d69bdb2a9fff1 */ | ||
1910 | 1.122136407473298902480, /* 0x1.1f4454e3bfae00006 */ | ||
1911 | 1.124330221845670330058, /* 0x1.1fd41afcbb48bfff8 */ | ||
1912 | 1.126528325196519908506, /* 0x1.2064290abc98c0001 */ | ||
1913 | 1.128730725913251964394, /* 0x1.20f47f31c9aa7000f */ | ||
1914 | 1.130937432396844410880, /* 0x1.21851d95f776dfff0 */ | ||
1915 | 1.133148453059692917203, /* 0x1.2216045b6784efffa */ | ||
1916 | 1.135363796355857157764, /* 0x1.22a733a6692ae0004 */ | ||
1917 | 1.137583470716100553249, /* 0x1.2338ab9b3221a0004 */ | ||
1918 | 1.139807484614418608939, /* 0x1.23ca6c5e27aadfff7 */ | ||
1919 | 1.142035846532929888057, /* 0x1.245c7613b7f6c0004 */ | ||
1920 | 1.144268564977221958089, /* 0x1.24eec8e06b035000c */ | ||
1921 | 1.146505648458203463465, /* 0x1.258164e8cea85fff8 */ | ||
1922 | 1.148747105501412235671, /* 0x1.26144a5180d380009 */ | ||
1923 | 1.150992944689175123667, /* 0x1.26a7793f5de2efffa */ | ||
1924 | 1.153243174560058870217, /* 0x1.273af1d712179000d */ | ||
1925 | 1.155497803703682491111, /* 0x1.27ceb43d81d42fff1 */ | ||
1926 | 1.157756840726344771440, /* 0x1.2862c097a3d29000c */ | ||
1927 | 1.160020294239811677834, /* 0x1.28f7170a74cf4fff1 */ | ||
1928 | 1.162288172883275239058, /* 0x1.298bb7bb0faed0004 */ | ||
1929 | 1.164560485298402170388, /* 0x1.2a20a2ce920dffff4 */ | ||
1930 | 1.166837240167474476460, /* 0x1.2ab5d86a4631ffff6 */ | ||
1931 | 1.169118446164539637555, /* 0x1.2b4b58b36d5220009 */ | ||
1932 | 1.171404112007080167155, /* 0x1.2be123cf786790002 */ | ||
1933 | 1.173694246390975415341, /* 0x1.2c7739e3c0aac000d */ | ||
1934 | 1.175988858069749065617, /* 0x1.2d0d9b15deb58fff6 */ | ||
1935 | 1.178287955789017793514, /* 0x1.2da4478b627040002 */ | ||
1936 | 1.180591548323240091978, /* 0x1.2e3b3f69fb794fffc */ | ||
1937 | 1.182899644456603782686, /* 0x1.2ed282d76421d0004 */ | ||
1938 | 1.185212252993012693694, /* 0x1.2f6a11f96c685fff3 */ | ||
1939 | 1.187529382762033236513, /* 0x1.3001ecf60082ffffa */ | ||
1940 | 1.189851042595508889847, /* 0x1.309a13f30f28a0004 */ | ||
1941 | 1.192177241354644978669, /* 0x1.31328716a758cfff7 */ | ||
1942 | 1.194507987909589896687, /* 0x1.31cb4686e1e85fffb */ | ||
1943 | 1.196843291137896336843, /* 0x1.32645269dfd04000a */ | ||
1944 | 1.199183159977805113226, /* 0x1.32fdaae604c39000f */ | ||
1945 | 1.201527603343041317132, /* 0x1.339750219980dfff3 */ | ||
1946 | 1.203876630171082595692, /* 0x1.3431424300e480007 */ | ||
1947 | 1.206230249419600664189, /* 0x1.34cb8170b3fee000e */ | ||
1948 | 1.208588470077065268869, /* 0x1.35660dd14dbd4fffc */ | ||
1949 | 1.210951301134513435915, /* 0x1.3600e78b6bdfc0005 */ | ||
1950 | 1.213318751604272271958, /* 0x1.369c0ec5c38ebfff2 */ | ||
1951 | 1.215690830512196507537, /* 0x1.373783a718d29000f */ | ||
1952 | 1.218067546930756250870, /* 0x1.37d3465662f480007 */ | ||
1953 | 1.220448909901335365929, /* 0x1.386f56fa770fe0008 */ | ||
1954 | 1.222834928513994334780, /* 0x1.390bb5ba5fc540004 */ | ||
1955 | 1.225225611877684750397, /* 0x1.39a862bd3c7a8fff3 */ | ||
1956 | 1.227620969111500981433, /* 0x1.3a455e2a37bcafffd */ | ||
1957 | 1.230021009336254911271, /* 0x1.3ae2a8287dfbefff6 */ | ||
1958 | 1.232425741726685064472, /* 0x1.3b8040df76f39fffa */ | ||
1959 | 1.234835175450728295084, /* 0x1.3c1e287682e48fff1 */ | ||
1960 | 1.237249319699482263931, /* 0x1.3cbc5f151b86bfff8 */ | ||
1961 | 1.239668183679933477545, /* 0x1.3d5ae4e2cc0a8000f */ | ||
1962 | 1.242091776620540377629, /* 0x1.3df9ba07373bf0006 */ | ||
1963 | 1.244520107762172811399, /* 0x1.3e98deaa0d8cafffe */ | ||
1964 | 1.246953186383919165383, /* 0x1.3f3852f32973efff0 */ | ||
1965 | 1.249391019292643401078, /* 0x1.3fd816ffc72b90001 */ | ||
1966 | 1.251833623164381181797, /* 0x1.40782b17863250005 */ | ||
1967 | 1.254280999953110153911, /* 0x1.41188f42caf400000 */ | ||
1968 | 1.256733161434815393410, /* 0x1.41b943b42945bfffd */ | ||
1969 | 1.259190116985283935980, /* 0x1.425a4893e5f10000a */ | ||
1970 | 1.261651875958665236542, /* 0x1.42fb9e0a2df4c0009 */ | ||
1971 | 1.264118447754797758244, /* 0x1.439d443f608c4fff9 */ | ||
1972 | 1.266589841787181258708, /* 0x1.443f3b5bebf850008 */ | ||
1973 | 1.269066067469190262045, /* 0x1.44e183883e561fff7 */ | ||
1974 | 1.271547134259576328224, /* 0x1.45841cecf7a7a0001 */ | ||
1975 | 1.274033051628237434048, /* 0x1.462707b2c43020009 */ | ||
1976 | 1.276523829025464573684, /* 0x1.46ca44023aa410007 */ | ||
1977 | 1.279019475999373156531, /* 0x1.476dd2045d46ffff0 */ | ||
1978 | 1.281520002043128991825, /* 0x1.4811b1e1f1f19000b */ | ||
1979 | 1.284025416692967214122, /* 0x1.48b5e3c3edd74fff4 */ | ||
1980 | 1.286535729509738823464, /* 0x1.495a67d3613c8fff7 */ | ||
1981 | 1.289050950070396384145, /* 0x1.49ff3e396e19d000b */ | ||
1982 | 1.291571087985403654081, /* 0x1.4aa4671f5b401fff1 */ | ||
1983 | 1.294096152842774794011, /* 0x1.4b49e2ae56d19000d */ | ||
1984 | 1.296626154297237043484, /* 0x1.4befb10fd84a3fff4 */ | ||
1985 | 1.299161101984141142272, /* 0x1.4c95d26d41d84fff8 */ | ||
1986 | 1.301701005575179204100, /* 0x1.4d3c46f01d9f0fff3 */ | ||
1987 | 1.304245874766450485904, /* 0x1.4de30ec21097d0003 */ | ||
1988 | 1.306795719266019562007, /* 0x1.4e8a2a0ccce3d0002 */ | ||
1989 | 1.309350548792467483458, /* 0x1.4f3198fa10346fff5 */ | ||
1990 | 1.311910373099227200545, /* 0x1.4fd95bb3be8cffffd */ | ||
1991 | 1.314475201942565174546, /* 0x1.50817263bf0e5fffb */ | ||
1992 | 1.317045045107389400535, /* 0x1.5129dd3418575000e */ | ||
1993 | 1.319619912422941299109, /* 0x1.51d29c4f01c54ffff */ | ||
1994 | 1.322199813675649204855, /* 0x1.527bafde83a310009 */ | ||
1995 | 1.324784758729532718739, /* 0x1.5325180cfb8b3fffd */ | ||
1996 | 1.327374757430096474625, /* 0x1.53ced504b2bd0fff4 */ | ||
1997 | 1.329969819671041886272, /* 0x1.5478e6f02775e0001 */ | ||
1998 | 1.332569955346704748651, /* 0x1.55234df9d8a59fff8 */ | ||
1999 | 1.335175174370685002822, /* 0x1.55ce0a4c5a6a9fff6 */ | ||
2000 | 1.337785486688218616860, /* 0x1.56791c1263abefff7 */ | ||
2001 | 1.340400902247843806217, /* 0x1.57248376aef21fffa */ | ||
2002 | 1.343021431036279800211, /* 0x1.57d040a420c0bfff3 */ | ||
2003 | 1.345647083048053138662, /* 0x1.587c53c5a630f0002 */ | ||
2004 | 1.348277868295411074918, /* 0x1.5928bd063fd7bfff9 */ | ||
2005 | 1.350913796821875845231, /* 0x1.59d57c9110ad60006 */ | ||
2006 | 1.353554878672557082439, /* 0x1.5a8292913d68cfffc */ | ||
2007 | 1.356201123929036356254, /* 0x1.5b2fff3212db00007 */ | ||
2008 | 1.358852542671913132777, /* 0x1.5bddc29edcc06fff3 */ | ||
2009 | 1.361509145047255398051, /* 0x1.5c8bdd032ed16000f */ | ||
2010 | 1.364170941142184734180, /* 0x1.5d3a4e8a5bf61fff4 */ | ||
2011 | 1.366837941171020309735, /* 0x1.5de9176042f1effff */ | ||
2012 | 1.369510155261156381121, /* 0x1.5e9837b062f4e0005 */ | ||
2013 | 1.372187593620959988833, /* 0x1.5f47afa69436cfff1 */ | ||
2014 | 1.374870266463378287715, /* 0x1.5ff77f6eb3f8cfffd */ | ||
2015 | 1.377558184010425845733, /* 0x1.60a7a734a9742fff9 */ | ||
2016 | 1.380251356531521533853, /* 0x1.6158272490016000c */ | ||
2017 | 1.382949794301995272203, /* 0x1.6208ff6a8978a000f */ | ||
2018 | 1.385653507605306700170, /* 0x1.62ba3032c0a280004 */ | ||
2019 | 1.388362506772382154503, /* 0x1.636bb9a994784000f */ | ||
2020 | 1.391076802081129493127, /* 0x1.641d9bfb29a7bfff6 */ | ||
2021 | 1.393796403973427855412, /* 0x1.64cfd7545928b0002 */ | ||
2022 | 1.396521322756352656542, /* 0x1.65826be167badfff8 */ | ||
2023 | 1.399251568859207761660, /* 0x1.663559cf20826000c */ | ||
2024 | 1.401987152677323100733, /* 0x1.66e8a14a29486fffc */ | ||
2025 | 1.404728084651919228815, /* 0x1.679c427f5a4b6000b */ | ||
2026 | 1.407474375243217723560, /* 0x1.68503d9ba0add000f */ | ||
2027 | 1.410226034922914983815, /* 0x1.690492cbf6303fff9 */ | ||
2028 | 1.412983074197955213304, /* 0x1.69b9423d7b548fff6 */ | ||
2029 | }; | ||
2030 | |||
2031 | /* All floating-point numbers can be put in one of these categories. */ | ||
2032 | enum | ||
2033 | { | ||
2034 | FP_NAN, | ||
2035 | # define FP_NAN FP_NAN | ||
2036 | FP_INFINITE, | ||
2037 | # define FP_INFINITE FP_INFINITE | ||
2038 | FP_ZERO, | ||
2039 | # define FP_ZERO FP_ZERO | ||
2040 | FP_SUBNORMAL, | ||
2041 | # define FP_SUBNORMAL FP_SUBNORMAL | ||
2042 | FP_NORMAL | ||
2043 | # define FP_NORMAL FP_NORMAL | ||
2044 | }; | ||
2045 | |||
2046 | |||
2047 | int | ||
2048 | __fpclassifyf (float x) | ||
2049 | { | ||
2050 | uint32_t wx; | ||
2051 | int retval = FP_NORMAL; | ||
2052 | |||
2053 | GET_FLOAT_WORD (wx, x); | ||
2054 | wx &= 0x7fffffff; | ||
2055 | if (wx == 0) | ||
2056 | retval = FP_ZERO; | ||
2057 | else if (wx < 0x800000) | ||
2058 | retval = FP_SUBNORMAL; | ||
2059 | else if (wx >= 0x7f800000) | ||
2060 | retval = wx > 0x7f800000 ? FP_NAN : FP_INFINITE; | ||
2061 | |||
2062 | return retval; | ||
2063 | } | ||
2064 | |||
2065 | |||
2066 | int | ||
2067 | __isinff (float x) | ||
2068 | { | ||
2069 | int32_t ix,t; | ||
2070 | GET_FLOAT_WORD(ix,x); | ||
2071 | t = ix & 0x7fffffff; | ||
2072 | t ^= 0x7f800000; | ||
2073 | t |= -t; | ||
2074 | return ~(t >> 31) & (ix >> 30); | ||
2075 | } | ||
2076 | |||
2077 | /* Return nonzero value if arguments are unordered. */ | ||
2078 | # define fpclassify(x) \ | ||
2079 | (sizeof (x) == sizeof (float) ? __fpclassifyf (x) : __fpclassifyf (x)) | ||
2080 | |||
2081 | # ifndef isunordered | ||
2082 | # define isunordered(u, v) \ | ||
2083 | (__extension__ \ | ||
2084 | ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \ | ||
2085 | fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; })) | ||
2086 | # endif | ||
2087 | |||
2088 | /* Return nonzero value if X is less than Y. */ | ||
2089 | # ifndef isless | ||
2090 | # define isless(x, y) \ | ||
2091 | (__extension__ \ | ||
2092 | ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ | ||
2093 | !isunordered (__x, __y) && __x < __y; })) | ||
2094 | # endif | ||
2095 | |||
2096 | /* Return nonzero value if X is greater than Y. */ | ||
2097 | # ifndef isgreater | ||
2098 | # define isgreater(x, y) \ | ||
2099 | (__extension__ \ | ||
2100 | ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ | ||
2101 | !isunordered (__x, __y) && __x > __y; })) | ||
2102 | # endif | ||
2103 | |||
2104 | union ieee754_double | ||
2105 | { | ||
2106 | double d; | ||
2107 | |||
2108 | /* This is the IEEE 754 double-precision format. */ | ||
2109 | struct | ||
2110 | { | ||
2111 | #if defined(ROCKBOX_BIG_ENDIAN) | ||
2112 | unsigned int negative:1; | ||
2113 | unsigned int exponent:11; | ||
2114 | /* Together these comprise the mantissa. */ | ||
2115 | unsigned int mantissa0:20; | ||
2116 | unsigned int mantissa1:32; | ||
2117 | #else | ||
2118 | # if __FLOAT_WORD_ORDER == __BIG_ENDIAN | ||
2119 | unsigned int mantissa0:20; | ||
2120 | unsigned int exponent:11; | ||
2121 | unsigned int negative:1; | ||
2122 | unsigned int mantissa1:32; | ||
2123 | # else | ||
2124 | /* Together these comprise the mantissa. */ | ||
2125 | unsigned int mantissa1:32; | ||
2126 | unsigned int mantissa0:20; | ||
2127 | unsigned int exponent:11; | ||
2128 | unsigned int negative:1; | ||
2129 | # endif | ||
2130 | #endif /* Little endian. */ | ||
2131 | } ieee; | ||
2132 | |||
2133 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | ||
2134 | struct | ||
2135 | { | ||
2136 | #if defined(ROCKBOX_BIG_ENDIAN) | ||
2137 | unsigned int negative:1; | ||
2138 | unsigned int exponent:11; | ||
2139 | unsigned int quiet_nan:1; | ||
2140 | /* Together these comprise the mantissa. */ | ||
2141 | unsigned int mantissa0:19; | ||
2142 | unsigned int mantissa1:32; | ||
2143 | #else | ||
2144 | # if __FLOAT_WORD_ORDER == __BIG_ENDIAN | ||
2145 | unsigned int mantissa0:19; | ||
2146 | unsigned int quiet_nan:1; | ||
2147 | unsigned int exponent:11; | ||
2148 | unsigned int negative:1; | ||
2149 | unsigned int mantissa1:32; | ||
2150 | # else | ||
2151 | /* Together these comprise the mantissa. */ | ||
2152 | unsigned int mantissa1:32; | ||
2153 | unsigned int mantissa0:19; | ||
2154 | unsigned int quiet_nan:1; | ||
2155 | unsigned int exponent:11; | ||
2156 | unsigned int negative:1; | ||
2157 | # endif | ||
2158 | #endif | ||
2159 | } ieee_nan; | ||
2160 | }; | ||
2161 | |||
2162 | |||
2163 | static const volatile float TWOM100 = 7.88860905e-31; | ||
2164 | static const volatile float TWO127 = 1.7014118346e+38; | ||
2165 | |||
2166 | float rb_exp(float x) | ||
2167 | { | ||
2168 | static const float himark = 88.72283935546875; | ||
2169 | static const float lomark = -103.972084045410; | ||
2170 | /* Check for usual case. */ | ||
2171 | if (isless (x, himark) && isgreater (x, lomark)) | ||
2172 | { | ||
2173 | static const float THREEp42 = 13194139533312.0; | ||
2174 | static const float THREEp22 = 12582912.0; | ||
2175 | /* 1/ln(2). */ | ||
2176 | #undef M_1_LN2 | ||
2177 | static const float M_1_LN2 = 1.44269502163f; | ||
2178 | /* ln(2) */ | ||
2179 | #undef M_LN2 | ||
2180 | static const double M_LN2 = .6931471805599452862; | ||
2181 | |||
2182 | int tval; | ||
2183 | double x22, t, result, dx; | ||
2184 | float n, delta; | ||
2185 | union ieee754_double ex2_u; | ||
2186 | #ifndef ROCKBOX | ||
2187 | fenv_t oldenv; | ||
2188 | |||
2189 | feholdexcept (&oldenv); | ||
2190 | #endif | ||
2191 | |||
2192 | #ifdef FE_TONEAREST | ||
2193 | fesetround (FE_TONEAREST); | ||
2194 | #endif | ||
2195 | |||
2196 | /* Calculate n. */ | ||
2197 | n = x * M_1_LN2 + THREEp22; | ||
2198 | n -= THREEp22; | ||
2199 | dx = x - n*M_LN2; | ||
2200 | |||
2201 | /* Calculate t/512. */ | ||
2202 | t = dx + THREEp42; | ||
2203 | t -= THREEp42; | ||
2204 | dx -= t; | ||
2205 | |||
2206 | /* Compute tval = t. */ | ||
2207 | tval = (int) (t * 512.0); | ||
2208 | |||
2209 | if (t >= 0) | ||
2210 | delta = - __exp_deltatable[tval]; | ||
2211 | else | ||
2212 | delta = __exp_deltatable[-tval]; | ||
2213 | |||
2214 | /* Compute ex2 = 2^n e^(t/512+delta[t]). */ | ||
2215 | ex2_u.d = __exp_atable[tval+177]; | ||
2216 | ex2_u.ieee.exponent += (int) n; | ||
2217 | |||
2218 | /* Approximate e^(dx+delta) - 1, using a second-degree polynomial, | ||
2219 | with maximum error in [-2^-10-2^-28,2^-10+2^-28] | ||
2220 | less than 5e-11. */ | ||
2221 | x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta; | ||
2222 | |||
2223 | /* Return result. */ | ||
2224 | #ifndef ROCKBOX | ||
2225 | fesetenv (&oldenv); | ||
2226 | #endif | ||
2227 | |||
2228 | result = x22 * ex2_u.d + ex2_u.d; | ||
2229 | return (float) result; | ||
2230 | } | ||
2231 | /* Exceptional cases: */ | ||
2232 | else if (isless (x, himark)) | ||
2233 | { | ||
2234 | if (__isinff (x)) | ||
2235 | /* e^-inf == 0, with no error. */ | ||
2236 | return 0; | ||
2237 | else | ||
2238 | /* Underflow */ | ||
2239 | return TWOM100 * TWOM100; | ||
2240 | } | ||
2241 | else | ||
2242 | /* Return x, if x is a NaN or Inf; or overflow, otherwise. */ | ||
2243 | return TWO127*x; | ||
2244 | } | ||
2245 | |||
2246 | |||
2247 | /* Division with rest, original. */ | ||
2248 | div_t div(int x, int y) | ||
2249 | { | ||
2250 | div_t result; | ||
2251 | |||
2252 | result.quot = x / y; | ||
2253 | result.rem = x % y; | ||
2254 | |||
2255 | /* Addition from glibc-2.8: */ | ||
2256 | if(x >= 0 && result.rem < 0) | ||
2257 | { | ||
2258 | result.quot += 1; | ||
2259 | result.rem -= y; | ||
2260 | } | ||
2261 | |||
2262 | return result; | ||
2263 | } | ||
2264 | |||
2265 | |||
2266 | /* Placeholder function. */ | ||
2267 | /* Originally defined in s_midi.c */ | ||
2268 | void sys_listmididevs(void) | ||
2269 | { | ||
2270 | } | ||
2271 | |||
2272 | /* Placeholder function, | ||
2273 | as we do sleep in the core thread | ||
2274 | and not in the scheduler function. */ | ||
2275 | /* Originally defined in s_inter.c */ | ||
2276 | void sys_microsleep(int microsec) | ||
2277 | { | ||
2278 | (void) microsec; | ||
2279 | } | ||
2280 | |||
2281 | /* Get running time in milliseconds. */ | ||
2282 | /* Originally defined in s_inter.c */ | ||
2283 | extern uint64_t runningtime; | ||
2284 | t_time sys_getrealtime(void) | ||
2285 | { | ||
2286 | return runningtime; | ||
2287 | } | ||
2288 | |||
2289 | /* Place holder, as we do no IPC. */ | ||
2290 | /* Originally defined in s_inter.c */ | ||
2291 | void glob_ping(void* dummy) | ||
2292 | { | ||
2293 | (void) dummy; | ||
2294 | } | ||
2295 | |||
2296 | /* Call to quit. */ | ||
2297 | /* Originally defined in s_inter.c */ | ||
2298 | extern bool quit; | ||
2299 | void glob_quit(void* dummy) | ||
2300 | { | ||
2301 | (void) dummy; | ||
2302 | |||
2303 | static bool reentered = false; | ||
2304 | |||
2305 | if(!reentered) | ||
2306 | { | ||
2307 | reentered = true; | ||
2308 | |||
2309 | /* Close audio subsystem. */ | ||
2310 | sys_close_audio(); | ||
2311 | |||
2312 | /* Stop main loop. */ | ||
2313 | quit = true; | ||
2314 | } | ||
2315 | } | ||
2316 | |||
2317 | /* Open file. Originally in s_main.c */ | ||
2318 | void glob_evalfile(t_pd *ignore, t_symbol *name, t_symbol *dir); | ||
2319 | void openit(const char *dirname, const char *filename) | ||
2320 | { | ||
2321 | char dirbuf[MAXPDSTRING], *nameptr; | ||
2322 | |||
2323 | /* Workaround: If the file resides in the root directory, | ||
2324 | add a trailing slash to prevent directory part | ||
2325 | of the filename from being removed. */ | ||
2326 | char ffilename[MAXPDSTRING]; | ||
2327 | ffilename[0] = '/'; | ||
2328 | ffilename[1] = '\0'; | ||
2329 | strcat(ffilename, filename); | ||
2330 | |||
2331 | int fd = open_via_path(dirname, ffilename, "", dirbuf, &nameptr, | ||
2332 | MAXPDSTRING, 0); | ||
2333 | if (fd) | ||
2334 | { | ||
2335 | close (fd); | ||
2336 | glob_evalfile(0, gensym(nameptr), gensym(dirbuf)); | ||
2337 | } | ||
2338 | else | ||
2339 | error("%s: can't open", filename); | ||
2340 | } | ||
2341 | |||
2342 | |||
2343 | /* Get current working directory. */ | ||
2344 | extern char* filename; | ||
2345 | char* rb_getcwd(char* buf, ssize_t size) | ||
2346 | { | ||
2347 | char* end_of_dir = strrchr(filename, '/'); | ||
2348 | |||
2349 | /* Check whether buffer may hold enough data. */ | ||
2350 | if(size < end_of_dir - filename) | ||
2351 | return NULL; | ||
2352 | |||
2353 | /* Copy current working directory to buffer. */ | ||
2354 | strncpy(buf, filename, end_of_dir - filename); | ||
2355 | return buf; | ||
2356 | } | ||
2357 | |||
2358 | |||
2359 | /* Execute instructions supplied on command-line. | ||
2360 | Basically a placeholder, because the only | ||
2361 | command line argument we get is the name of the .pd file. */ | ||
2362 | /* Originally defined in s_main.c */ | ||
2363 | extern t_namelist* sys_openlist; | ||
2364 | void glob_initfromgui(void *dummy, t_symbol *s, int argc, t_atom *argv) | ||
2365 | { | ||
2366 | (void) dummy; | ||
2367 | (void) s; | ||
2368 | (void) argc; | ||
2369 | (void) argv; | ||
2370 | |||
2371 | t_namelist *nl; | ||
2372 | char cwd[MAXPDSTRING]; | ||
2373 | |||
2374 | /* Get current working directory. */ | ||
2375 | rb_getcwd(cwd, MAXPDSTRING); | ||
2376 | |||
2377 | /* open patches specifies with "-open" args */ | ||
2378 | for(nl = sys_openlist; nl; nl = nl->nl_next) | ||
2379 | openit(cwd, nl->nl_string); | ||
2380 | namelist_free(sys_openlist); | ||
2381 | sys_openlist = 0; | ||
2382 | } | ||
2383 | |||
2384 | /* Fake GUI start. Originally in s_inter.c */ | ||
2385 | static int defaultfontshit[] = { | ||
2386 | 8, 5, 9, 10, 6, 10, 12, 7, 13, 14, 9, 17, 16, 10, 19, 24, 15, 28, | ||
2387 | 24, 15, 28}; | ||
2388 | extern t_binbuf* inbinbuf; | ||
2389 | int sys_startgui(const char *guidir) | ||
2390 | { | ||
2391 | unsigned int i; | ||
2392 | t_atom zz[23]; | ||
2393 | char cmdbuf[4*MAXPDSTRING]; | ||
2394 | |||
2395 | (void) guidir; | ||
2396 | |||
2397 | inbinbuf = binbuf_new(); | ||
2398 | |||
2399 | if(!rb_getcwd(cmdbuf, MAXPDSTRING)) | ||
2400 | strcpy(cmdbuf, "."); | ||
2401 | SETSYMBOL(zz, gensym(cmdbuf)); | ||
2402 | for (i = 1; i < 22; i++) | ||
2403 | SETFLOAT(zz + i, defaultfontshit[i-1]); | ||
2404 | SETFLOAT(zz+22,0); | ||
2405 | |||
2406 | glob_initfromgui(0, 0, 23, zz); | ||
2407 | |||
2408 | return 0; | ||
2409 | } | ||
2410 | |||
2411 | /* Return default DAC block size. */ | ||
2412 | /* Originally defined in s_main.c */ | ||
2413 | int sys_getblksize(void) | ||
2414 | { | ||
2415 | return (DEFDACBLKSIZE); | ||
2416 | } | ||
2417 | |||
2418 | /* Find library directory and set it. */ | ||
2419 | void sys_findlibdir(const char* filename) | ||
2420 | { | ||
2421 | char sbuf[MAXPDSTRING]; | ||
2422 | |||
2423 | (void) filename; | ||
2424 | |||
2425 | /* Make current working directory the system library directory. */ | ||
2426 | rb_getcwd(sbuf, MAXPDSTRING); | ||
2427 | sys_libdir = gensym(sbuf); | ||
2428 | } | ||
diff --git a/apps/plugins/pdbox/pdbox-net.c b/apps/plugins/pdbox/pdbox-net.c index 83d9bd3b7d..f0f7013488 100644 --- a/apps/plugins/pdbox/pdbox-net.c +++ b/apps/plugins/pdbox/pdbox-net.c | |||
@@ -68,7 +68,7 @@ bool send_datagram(struct event_queue* route, | |||
68 | return false; | 68 | return false; |
69 | 69 | ||
70 | /* Copy datagram to the buffer. */ | 70 | /* Copy datagram to the buffer. */ |
71 | rb->memcpy(datagrams[i].data, data, size); | 71 | memcpy(datagrams[i].data, data, size); |
72 | datagrams[i].size = size; | 72 | datagrams[i].size = size; |
73 | 73 | ||
74 | /* Mark datagram buffer as used. */ | 74 | /* Mark datagram buffer as used. */ |
@@ -101,7 +101,7 @@ bool receive_datagram(struct event_queue* route, | |||
101 | return false; | 101 | return false; |
102 | 102 | ||
103 | /* Copy datagram. */ | 103 | /* Copy datagram. */ |
104 | rb->memcpy(buffer, (struct datagram*) event.data, sizeof(struct datagram)); | 104 | memcpy(buffer, (struct datagram*) event.data, sizeof(struct datagram)); |
105 | 105 | ||
106 | /* Free datagram buffer. */ | 106 | /* Free datagram buffer. */ |
107 | ((struct datagram*) event.data)->used = false; | 107 | ((struct datagram*) event.data)->used = false; |
diff --git a/apps/plugins/pdbox/pdbox.c b/apps/plugins/pdbox/pdbox.c index d6e25ca3fa..0f3728e586 100644 --- a/apps/plugins/pdbox/pdbox.c +++ b/apps/plugins/pdbox/pdbox.c | |||
@@ -22,31 +22,76 @@ | |||
22 | #include "plugin.h" | 22 | #include "plugin.h" |
23 | #include "pdbox.h" | 23 | #include "pdbox.h" |
24 | 24 | ||
25 | #include "m_pd.h" | ||
26 | #include "s_stuff.h" | ||
27 | |||
25 | /* Welcome to the PDBox plugin */ | 28 | /* Welcome to the PDBox plugin */ |
26 | PLUGIN_HEADER | 29 | PLUGIN_HEADER |
27 | PLUGIN_IRAM_DECLARE | 30 | PLUGIN_IRAM_DECLARE |
28 | 31 | ||
32 | /* Name of the file to open. */ | ||
33 | char* filename; | ||
34 | |||
35 | /* Running time. */ | ||
36 | uint64_t runningtime = 0; | ||
37 | |||
38 | /* Variables for Pure Data. */ | ||
39 | int sys_verbose; | ||
40 | int sys_noloadbang; | ||
41 | t_symbol *sys_libdir; | ||
42 | t_namelist *sys_openlist; | ||
43 | int sys_nsoundin = 0; | ||
44 | int sys_soundindevlist[MAXAUDIOINDEV]; | ||
45 | int sys_nchin = 0; | ||
46 | int sys_chinlist[MAXAUDIOINDEV]; | ||
47 | int sys_nsoundout = 1; | ||
48 | int sys_soundoutdevlist[MAXAUDIOOUTDEV]; | ||
49 | int sys_nchout = 2; | ||
50 | int sys_choutlist[MAXAUDIOOUTDEV]; | ||
51 | static int sys_main_srate = PD_SAMPLERATE; | ||
52 | static int sys_main_advance = PD_SAMPLES_PER_HZ; | ||
53 | |||
54 | /* References for scheduler variables and functions. */ | ||
55 | extern t_time sys_time; | ||
56 | extern t_time sys_time_per_dsp_tick; | ||
57 | extern void sched_tick(t_time next_sys_time); | ||
58 | |||
59 | #define SAMPLES_SIZE 1000 | ||
60 | t_sample samples[SAMPLES_SIZE]; | ||
61 | |||
29 | /* Quit flag. */ | 62 | /* Quit flag. */ |
30 | bool quit = false; | 63 | bool quit = false; |
31 | 64 | ||
32 | /* Thread IDs. */ | 65 | /* Thread IDs. */ |
33 | unsigned int core_thread_id; | 66 | unsigned int core_thread_id; |
34 | unsigned int gui_thread_id; | 67 | unsigned int gui_thread_id; |
68 | unsigned int time_thread_id; | ||
35 | 69 | ||
36 | /* Stacks for threads. */ | 70 | /* Stacks for threads. */ |
37 | #define STACK_SIZE 16384 | 71 | #define STACK_SIZE 16384 |
38 | uint32_t core_stack[STACK_SIZE / sizeof(uint32_t)]; | 72 | uint32_t core_stack[STACK_SIZE / sizeof(uint32_t)]; |
39 | uint32_t gui_stack[STACK_SIZE / sizeof(uint32_t)]; | 73 | uint32_t gui_stack[STACK_SIZE / sizeof(uint32_t)]; |
74 | uint32_t time_stack[256 / sizeof(uint32_t)]; | ||
40 | 75 | ||
41 | 76 | ||
42 | /* Core thread */ | 77 | /* Core thread, scheduler. */ |
43 | void core_thread(void) | 78 | void core_thread(void) |
44 | { | 79 | { |
45 | struct datagram ping; | 80 | /* struct datagram ping; */ |
81 | |||
82 | /* LATER consider making this variable. It's now the LCM of all sample | ||
83 | rates we expect to see: 32000, 44100, 48000, 88200, 96000. */ | ||
84 | #define TIMEUNITPERSEC (32.*441000.) | ||
85 | |||
86 | sys_time = 0; | ||
87 | sys_time_per_dsp_tick = (TIMEUNITPERSEC) * | ||
88 | ((double)sys_schedblocksize) / sys_dacsr; | ||
89 | |||
46 | 90 | ||
47 | /* Main loop */ | 91 | /* Main loop */ |
48 | while(!quit) | 92 | while(!quit) |
49 | { | 93 | { |
94 | #if 0 | ||
50 | /* Wait for request. */ | 95 | /* Wait for request. */ |
51 | while(!RECEIVE_TO_CORE(&ping)) | 96 | while(!RECEIVE_TO_CORE(&ping)) |
52 | rb->yield(); | 97 | rb->yield(); |
@@ -56,8 +101,13 @@ void core_thread(void) | |||
56 | SEND_FROM_CORE("Pong!"); | 101 | SEND_FROM_CORE("Pong!"); |
57 | break; | 102 | break; |
58 | } | 103 | } |
104 | #endif | ||
105 | |||
106 | /* Use sys_send_dacs() function as timer. */ | ||
107 | if(sys_send_dacs() != SENDDACS_NO) | ||
108 | sched_tick(sys_time + sys_time_per_dsp_tick); | ||
59 | 109 | ||
60 | rb->yield(); | 110 | rb->sleep(1); |
61 | } | 111 | } |
62 | 112 | ||
63 | rb->thread_exit(); | 113 | rb->thread_exit(); |
@@ -66,11 +116,12 @@ void core_thread(void) | |||
66 | /* GUI thread */ | 116 | /* GUI thread */ |
67 | void gui_thread(void) | 117 | void gui_thread(void) |
68 | { | 118 | { |
69 | struct datagram pong; | 119 | /* struct datagram pong; */ |
70 | 120 | ||
71 | /* GUI loop */ | 121 | /* GUI loop */ |
72 | while(!quit) | 122 | while(!quit) |
73 | { | 123 | { |
124 | #if 0 | ||
74 | /* Send ping to the core. */ | 125 | /* Send ping to the core. */ |
75 | SEND_TO_CORE("Ping!"); | 126 | SEND_TO_CORE("Ping!"); |
76 | rb->splash(HZ, "Sent ping."); | 127 | rb->splash(HZ, "Sent ping."); |
@@ -86,8 +137,22 @@ void gui_thread(void) | |||
86 | quit = true; | 137 | quit = true; |
87 | break; | 138 | break; |
88 | } | 139 | } |
140 | #endif | ||
141 | |||
142 | rb->sleep(1); | ||
143 | } | ||
144 | |||
145 | rb->thread_exit(); | ||
146 | } | ||
89 | 147 | ||
90 | rb->yield(); | 148 | /* Running time thread. */ |
149 | void time_thread(void) | ||
150 | { | ||
151 | while(!quit) | ||
152 | { | ||
153 | /* Add time slice in milliseconds. */ | ||
154 | runningtime += (1000 / HZ); | ||
155 | rb->sleep(1); | ||
91 | } | 156 | } |
92 | 157 | ||
93 | rb->thread_exit(); | 158 | rb->thread_exit(); |
@@ -99,11 +164,12 @@ enum plugin_status plugin_start(const void* parameter) | |||
99 | { | 164 | { |
100 | PLUGIN_IRAM_INIT(rb) | 165 | PLUGIN_IRAM_INIT(rb) |
101 | 166 | ||
167 | /* Memory pool variables. */ | ||
102 | size_t mem_size; | 168 | size_t mem_size; |
103 | void* mem_pool; | 169 | void* mem_pool; |
104 | 170 | ||
105 | /* Get the file name. */ | 171 | /* Get the file name. */ |
106 | const char* filename = (const char*) parameter; | 172 | filename = (char*) parameter; |
107 | 173 | ||
108 | /* Allocate memory; check it's size; add to the pool. */ | 174 | /* Allocate memory; check it's size; add to the pool. */ |
109 | mem_pool = rb->plugin_get_audio_buffer(&mem_size); | 175 | mem_pool = rb->plugin_get_audio_buffer(&mem_size); |
@@ -117,7 +183,35 @@ enum plugin_status plugin_start(const void* parameter) | |||
117 | /* Initialize net. */ | 183 | /* Initialize net. */ |
118 | net_init(); | 184 | net_init(); |
119 | 185 | ||
186 | /* Initialize Pure Data, as does sys_main in s_main.c */ | ||
187 | pd_init(); | ||
188 | |||
189 | /* Add the directory the called .pd resides in to lib directories. */ | ||
190 | sys_findlibdir(filename); | ||
191 | |||
192 | /* Open the parameter file. */ | ||
193 | sys_openlist = namelist_append(sys_openlist, filename); | ||
194 | |||
195 | /* Set audio API. */ | ||
196 | sys_set_audio_api(API_ROCKBOX); | ||
197 | |||
198 | /* Fake a GUI start. */ | ||
199 | sys_startgui(NULL); | ||
200 | |||
201 | /* Initialize audio subsystem. */ | ||
202 | sys_open_audio(sys_nsoundin, sys_soundindevlist, sys_nchin, sys_chinlist, | ||
203 | sys_nsoundout, sys_soundoutdevlist, sys_nchout, sys_choutlist, | ||
204 | sys_main_srate, sys_main_advance, 1); | ||
205 | |||
120 | /* Start threads. */ | 206 | /* Start threads. */ |
207 | time_thread_id = | ||
208 | rb->create_thread(&time_thread, | ||
209 | time_stack, | ||
210 | sizeof(time_stack), | ||
211 | 0, /* FIXME Which flags? */ | ||
212 | "PD running time" | ||
213 | IF_PRIO(, PRIORITY_REALTIME) | ||
214 | IF_COP(, COP)); | ||
121 | core_thread_id = | 215 | core_thread_id = |
122 | rb->create_thread(&core_thread, | 216 | rb->create_thread(&core_thread, |
123 | core_stack, | 217 | core_stack, |
@@ -142,11 +236,12 @@ enum plugin_status plugin_start(const void* parameter) | |||
142 | 236 | ||
143 | /* Wait for quit flag. */ | 237 | /* Wait for quit flag. */ |
144 | while(!quit) | 238 | while(!quit) |
145 | rb->yield(); | 239 | yield(); |
146 | 240 | ||
147 | /* Wait for threads to complete. */ | 241 | /* Wait for threads to complete. */ |
148 | rb->thread_wait(gui_thread_id); | 242 | rb->thread_wait(gui_thread_id); |
149 | rb->thread_wait(core_thread_id); | 243 | rb->thread_wait(core_thread_id); |
244 | rb->thread_wait(time_thread_id); | ||
150 | 245 | ||
151 | /* Destroy net. */ | 246 | /* Destroy net. */ |
152 | net_destroy(); | 247 | net_destroy(); |
diff --git a/apps/plugins/pdbox/pdbox.h b/apps/plugins/pdbox/pdbox.h index 640bc43aca..fbca4989dc 100644 --- a/apps/plugins/pdbox/pdbox.h +++ b/apps/plugins/pdbox/pdbox.h | |||
@@ -26,9 +26,69 @@ | |||
26 | #include "bmalloc.h" | 26 | #include "bmalloc.h" |
27 | #include "dmalloc.h" | 27 | #include "dmalloc.h" |
28 | 28 | ||
29 | /* Pure Data */ | ||
30 | #include "m_pd.h" | ||
31 | |||
32 | |||
33 | /* dbestfit declarations. */ | ||
34 | |||
29 | /* Minimal memory size. */ | 35 | /* Minimal memory size. */ |
30 | #define MIN_MEM_SIZE (4 * 1024 * 1024) | 36 | #define MIN_MEM_SIZE (4 * 1024 * 1024) |
31 | 37 | ||
38 | |||
39 | /* Audio declarations. */ | ||
40 | #define PD_SAMPLERATE 32000 | ||
41 | #define PD_SAMPLES_QUOT (PD_SAMPLERATE / HZ) | ||
42 | #define PD_SAMPLES_REM (PD_SAMPLERATE % HZ) | ||
43 | #if PD_SAMPLES_REM == 0 | ||
44 | #define PD_SAMPLES_PER_HZ (PD_SAMPLES_QUOT) | ||
45 | #else | ||
46 | #define PD_SAMPLES_PER_HZ (PD_SAMPLES_QUOT + 1) | ||
47 | #endif | ||
48 | |||
49 | /* Audio data types. */ | ||
50 | #define PD_AUDIO_BLOCK_SIZE PD_SAMPLES_PER_HZ | ||
51 | struct pdbox_audio_block | ||
52 | { | ||
53 | unsigned int fill; | ||
54 | int32_t data[PD_AUDIO_BLOCK_SIZE]; | ||
55 | }; | ||
56 | |||
57 | |||
58 | /* Additional functions. */ | ||
59 | char *rb_strncat(char *s, const char *t, size_t n); | ||
60 | double rb_strtod(const char*, char**); | ||
61 | double rb_atof(const char*); | ||
62 | void rb_ftoan(float, char*, int); | ||
63 | float rb_floor(float); | ||
64 | long rb_atol(const char* s); | ||
65 | float rb_sin(float rad); | ||
66 | float rb_cos(float rad); | ||
67 | int rb_fscanf_f(int fd, float* f); | ||
68 | int rb_fprintf_f(int fd, float f); | ||
69 | float rb_log10(float); | ||
70 | float rb_log(float); | ||
71 | float rb_exp(float); | ||
72 | float rb_pow(float, float); | ||
73 | float rb_sqrt(float); | ||
74 | float rb_fabs(float); | ||
75 | float rb_atan(float); | ||
76 | float rb_atan2(float, float); | ||
77 | float rb_sinh(float); | ||
78 | float rb_tan(float); | ||
79 | typedef struct | ||
80 | { | ||
81 | int quot; | ||
82 | int rem; | ||
83 | } | ||
84 | div_t; | ||
85 | div_t div(int x, int y); | ||
86 | void sys_findlibdir(const char* filename); | ||
87 | int sys_startgui(const char *guidir); | ||
88 | |||
89 | |||
90 | /* Network declarations. */ | ||
91 | |||
32 | /* Maximal size of the datagram. */ | 92 | /* Maximal size of the datagram. */ |
33 | #define MAX_DATAGRAM_SIZE 255 | 93 | #define MAX_DATAGRAM_SIZE 255 |
34 | 94 | ||
@@ -40,7 +100,7 @@ struct datagram | |||
40 | char data[MAX_DATAGRAM_SIZE]; | 100 | char data[MAX_DATAGRAM_SIZE]; |
41 | }; | 101 | }; |
42 | 102 | ||
43 | /* Network functions prototypes. */ | 103 | /* Prototypes of network functions. */ |
44 | void net_init(void); | 104 | void net_init(void); |
45 | void net_destroy(void); | 105 | void net_destroy(void); |
46 | bool send_datagram(struct event_queue* route, int port, | 106 | bool send_datagram(struct event_queue* route, int port, |
@@ -58,13 +118,43 @@ extern struct event_queue core_to_gui; | |||
58 | 118 | ||
59 | /* Convinience macros. */ | 119 | /* Convinience macros. */ |
60 | #define SEND_TO_CORE(data) \ | 120 | #define SEND_TO_CORE(data) \ |
61 | send_datagram(&gui_to_core, PD_CORE_PORT, data, rb->strlen(data)) | 121 | send_datagram(&gui_to_core, PD_CORE_PORT, data, strlen(data)) |
62 | #define RECEIVE_TO_CORE(buffer) \ | 122 | #define RECEIVE_TO_CORE(buffer) \ |
63 | receive_datagram(&gui_to_core, PD_CORE_PORT, buffer) | 123 | receive_datagram(&gui_to_core, PD_CORE_PORT, buffer) |
64 | #define SEND_FROM_CORE(data) \ | 124 | #define SEND_FROM_CORE(data) \ |
65 | send_datagram(&core_to_gui, PD_GUI_PORT, data, rb->strlen(data)) | 125 | send_datagram(&core_to_gui, PD_GUI_PORT, data, strlen(data)) |
66 | #define RECEIVE_FROM_CORE(buffer) \ | 126 | #define RECEIVE_FROM_CORE(buffer) \ |
67 | receive_datagram(&core_to_gui, PD_GUI_PORT, buffer) | 127 | receive_datagram(&core_to_gui, PD_GUI_PORT, buffer) |
68 | 128 | ||
69 | #endif | 129 | /* PD core message callback. */ |
130 | void rockbox_receive_callback(struct datagram* dg); | ||
131 | |||
132 | |||
133 | /* Pure Data declarations. */ | ||
70 | 134 | ||
135 | /* Pure Data function prototypes. */ | ||
136 | void pd_init(void); | ||
137 | |||
138 | |||
139 | /* Redefinitons of ANSI C functions. */ | ||
140 | #include "lib/wrappers.h" | ||
141 | |||
142 | #define strncat rb_strncat | ||
143 | #define floor rb_floor | ||
144 | #define atof rb_atof | ||
145 | #define atol rb_atol | ||
146 | #define ftoan rb_ftoan | ||
147 | #define sin rb_sin | ||
148 | #define cos rb_cos | ||
149 | #define log10 rb_log10 | ||
150 | #define log rb_log | ||
151 | #define exp rb_exp | ||
152 | #define pow rb_pow | ||
153 | #define sqrt rb_sqrt | ||
154 | #define fabs rb_fabs | ||
155 | #define atan rb_atan | ||
156 | #define atan2 rb_atan2 | ||
157 | #define sinh rb_sinh | ||
158 | #define tan rb_tan | ||
159 | |||
160 | #endif | ||
diff --git a/apps/plugins/pdbox/pdbox.make b/apps/plugins/pdbox/pdbox.make index f2a3e4c646..83147bbbae 100644 --- a/apps/plugins/pdbox/pdbox.make +++ b/apps/plugins/pdbox/pdbox.make | |||
@@ -16,17 +16,17 @@ PDBOX_SRC := $(call preprocess, $(PDBOXSRCDIR)/SOURCES) | |||
16 | PDBOX_OBJ := $(call c2obj, $(PDBOX_SRC)) | 16 | PDBOX_OBJ := $(call c2obj, $(PDBOX_SRC)) |
17 | 17 | ||
18 | # add source files to OTHERSRC to get automatic dependencies | 18 | # add source files to OTHERSRC to get automatic dependencies |
19 | OTHER_SRC += $(PDBOX_SRC) | 19 | OTHERSRC += $(PDBOX_SRC) |
20 | 20 | ||
21 | $(PDBOXBUILDDIR)/pdbox.rock: $(PDBOX_OBJ) | 21 | $(PDBOXBUILDDIR)/pdbox.rock: $(PDBOX_OBJ) |
22 | 22 | ||
23 | PDBOXFLAGS = $(PLUGINFLAGS) \ | 23 | PDBOXFLAGS = $(PLUGINFLAGS) \ |
24 | -DFIXEDPOINT -DSTATIC -DPD \ | 24 | -DFIXEDPOINT -DSTATIC -DPD -DUSEAPI_ROCKBOX \ |
25 | -I$(PDBOXSRCDIR) -I$(PDBOXSRCDIR)/PDa/src \ | 25 | -I$(PDBOXSRCDIR) -I$(PDBOXSRCDIR)/PDa/src \ |
26 | -DBMALLOC -I$(PDBOXSRCDIR)/dbestfit-3.3 | 26 | -DBMALLOC -I$(PDBOXSRCDIR)/dbestfit-3.3 |
27 | 27 | ||
28 | # Compile PDBox with extra flags (adapted from ZXBox) | 28 | # Compile PDBox with extra flags (adapted from ZXBox) |
29 | $(PDBOXBUILDDIR)/%.o: $(PDBOXSRCDIR)/%.c $(PDBOXSRCDIR)/pdbox.h $(PDBOXSRCDIR)/pdbox.make | 29 | $(PDBOXBUILDDIR)/%.o: $(PDBOXSRCDIR)/%.c $(PLUGINBITMAPLIB) $(PDBOXSRCDIR)/pdbox.make |
30 | $(SILENT)mkdir -p $(dir $@) | 30 | $(SILENT)mkdir -p $(dir $@) |
31 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PDBOXFLAGS) -c $< -o $@ | 31 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PDBOXFLAGS) -c $< -o $@ |
32 | 32 | ||