summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugin.c5
-rw-r--r--apps/plugin.h6
-rw-r--r--apps/plugins/SOURCES3
-rw-r--r--apps/plugins/metronome.c674
-rw-r--r--apps/plugins/metronome.h605
-rw-r--r--firmware/export/timer.h6
-rw-r--r--uisimulator/sdl/SOURCES1
-rw-r--r--uisimulator/sdl/timer.c60
8 files changed, 715 insertions, 645 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 14519e1799..dbd7d7b4fb 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -24,6 +24,7 @@
24#include "debug.h" 24#include "debug.h"
25#include "i2c.h" 25#include "i2c.h"
26#include "lang.h" 26#include "lang.h"
27#include "led.h"
27#include "keyboard.h" 28#include "keyboard.h"
28#include "buffer.h" 29#include "buffer.h"
29#include "backlight.h" 30#include "backlight.h"
@@ -252,10 +253,11 @@ static const struct plugin_api rockbox_api = {
252 cpu_boost, 253 cpu_boost,
253#endif 254#endif
254#endif 255#endif
256#endif
255 timer_register, 257 timer_register,
256 timer_unregister, 258 timer_unregister,
257 timer_set_period, 259 timer_set_period,
258#endif 260
259 queue_init, 261 queue_init,
260 queue_delete, 262 queue_delete,
261 queue_post, 263 queue_post,
@@ -493,6 +495,7 @@ static const struct plugin_api rockbox_api = {
493#ifdef HAVE_LCD_BITMAP 495#ifdef HAVE_LCD_BITMAP
494 screen_clear_area, 496 screen_clear_area,
495#endif 497#endif
498 led,
496}; 499};
497 500
498int plugin_load(const char* plugin, void* parameter) 501int plugin_load(const char* plugin, void* parameter)
diff --git a/apps/plugin.h b/apps/plugin.h
index 961ad22b0d..5ec0174c52 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -112,7 +112,7 @@
112#define PLUGIN_MAGIC 0x526F634B /* RocK */ 112#define PLUGIN_MAGIC 0x526F634B /* RocK */
113 113
114/* increase this every time the api struct changes */ 114/* increase this every time the api struct changes */
115#define PLUGIN_API_VERSION 66 115#define PLUGIN_API_VERSION 67
116 116
117/* update this to latest version if a change to the api struct breaks 117/* update this to latest version if a change to the api struct breaks
118 backwards compatibility (and please take the opportunity to sort in any 118 backwards compatibility (and please take the opportunity to sort in any
@@ -345,12 +345,13 @@ struct plugin_api {
345 void (*cpu_boost)(bool on_off); 345 void (*cpu_boost)(bool on_off);
346#endif 346#endif
347#endif 347#endif
348#endif
348 bool (*timer_register)(int reg_prio, void (*unregister_callback)(void), 349 bool (*timer_register)(int reg_prio, void (*unregister_callback)(void),
349 long cycles, int int_prio, 350 long cycles, int int_prio,
350 void (*timer_callback)(void)); 351 void (*timer_callback)(void));
351 void (*timer_unregister)(void); 352 void (*timer_unregister)(void);
352 bool (*timer_set_period)(long count); 353 bool (*timer_set_period)(long count);
353#endif 354
354 void (*queue_init)(struct event_queue *q, bool register_queue); 355 void (*queue_init)(struct event_queue *q, bool register_queue);
355 void (*queue_delete)(struct event_queue *q); 356 void (*queue_delete)(struct event_queue *q);
356 void (*queue_post)(struct event_queue *q, long id, intptr_t data); 357 void (*queue_post)(struct event_queue *q, long id, intptr_t data);
@@ -615,6 +616,7 @@ struct plugin_api {
615 void (*screen_clear_area)(struct screen * display, int xstart, int ystart, 616 void (*screen_clear_area)(struct screen * display, int xstart, int ystart,
616 int width, int height); 617 int width, int height);
617#endif 618#endif
619 void (*led)(bool on);
618}; 620};
619 621
620/* plugin header */ 622/* plugin header */
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 7915465df4..48d9417e7a 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -20,8 +20,7 @@ stopwatch.c
20vbrfix.c 20vbrfix.c
21viewer.c 21viewer.c
22 22
23/* plugins built for all targets, but not for the simulator */ 23#if CONFIG_CODEC == SWCODEC
24#if !defined(SIMULATOR)
25metronome.c 24metronome.c
26#endif 25#endif
27 26
diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c
index 3255ad3b93..0fb94c1af1 100644
--- a/apps/plugins/metronome.c
+++ b/apps/plugins/metronome.c
@@ -16,18 +16,18 @@
16 * KIND, either express or implied. 16 * KIND, either express or implied.
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19#include "plugin.h"
20#include "pluginlib_actions.h" 19#include "pluginlib_actions.h"
20#include "metronome.h"
21 21
22PLUGIN_HEADER 22PLUGIN_HEADER
23 23
24#define METRONOME_QUIT PLA_QUIT 24#define METRONOME_QUIT PLA_QUIT
25#define METRONOME_VOL_UP PLA_UP 25#define METRONOME_VOL_UP PLA_UP
26#define METRONOME_VOL_DOWN PLA_DOWN 26#define METRONOME_VOL_DOWN PLA_DOWN
27#define METRONOME_VOL_UP_REP PLA_UP_REPEAT 27#define METRONOME_VOL_UP_REP PLA_UP_REPEAT
28#define METRONOME_VOL_DOWN_REP PLA_DOWN_REPEAT 28#define METRONOME_VOL_DOWN_REP PLA_DOWN_REPEAT
29#define METRONOME_LEFT PLA_LEFT 29#define METRONOME_LEFT PLA_LEFT
30#define METRONOME_RIGHT PLA_RIGHT 30#define METRONOME_RIGHT PLA_RIGHT
31#define METRONOME_LEFT_REP PLA_LEFT_REPEAT 31#define METRONOME_LEFT_REP PLA_LEFT_REPEAT
32#define METRONOME_RIGHT_REP PLA_RIGHT_REPEAT 32#define METRONOME_RIGHT_REP PLA_RIGHT_REPEAT
33enum { 33enum {
@@ -88,89 +88,23 @@ static int tap_timeout = 0;
88 88
89int bpm_step_counter = 0; 89int bpm_step_counter = 0;
90 90
91void led(bool on)
92{
93#if CONFIG_CPU == SH7034
94 if(on)
95 or_b(0x40, &PBDRL);
96 else
97 and_b(~0x40, &PBDRL);
98#else
99 (void)on;
100#endif
101}
102
103#if CONFIG_CODEC != SWCODEC 91#if CONFIG_CODEC != SWCODEC
104 92
105#define MET_IS_PLAYING rb->mp3_is_playing() 93#define MET_IS_PLAYING rb->mp3_is_playing()
106#define MET_PLAY_STOP rb->mp3_play_stop() 94#define MET_PLAY_STOP rb->mp3_play_stop()
107 95
108/* tick sound from a metronome */ 96
109static unsigned char sound[] = {
110255,251, 80,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
111 0, 73,110,102,111, 0, 0, 0, 15, 0, 0, 0, 4, 0, 0, 4, 19, 0, 64, 64,
112 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
113 64, 64, 64,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
114128,128,128,128,128,128,128,128,192,192,192,192,192,192,192,192,192,192,192,192,
115192,192,192,192,192,192,192,192,192,192,192,192,192,255,255,255,255,255,255,255,
116255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0,
117 58, 76, 65, 77, 69, 51, 46, 57, 50, 32, 1,137, 0, 0, 0, 0, 0, 0, 0, 0,
118 2, 64, 36, 5,191, 65, 0, 0, 0, 0, 0, 4, 19,168,187,153, 93, 0, 0, 0,
119 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
120 0, 0, 0, 0, 0, 0, 0, 0,255,251, 80,196, 0, 0, 10, 81, 57, 65,184,120,
121128, 1, 95,159,239,191,144, 96, 0, 0,128, 0, 0, 0, 0, 0, 0, 48, 24, 12,
122 0, 0, 15,175,185,222, 39, 7,126, 46, 50,191,243,197,255,247, 62, 92,111,252,
123115, 15, 27,140,153,159,247,242,124, 44, 92,164,177, 57,175,255,236, 79,164, 98,
124 68,205, 69,160, 64, 15,251,127,128,168, 38, 92,138, 17, 67,196, 80,184,223,255,
125255,161,117, 33, 55, 83,191,255,193,240, 33, 57,114, 17, 0, 2, 0, 0, 0, 10,
126191, 10, 8,196,209, 75, 55,236,177,115,238,223,203, 61,176, 89, 78,101,219,118,
127118, 65,154,126,187,239,241,127,247,245, 59, 18,219, 94,105,245,221,161,173, 91,
128191, 27,255,247, 18,124, 71,117,139,133,170,221,227,251,135,110,236,255,183,219,
129100, 78,184,125,212,131, 65, 95,212,245,145, 67, 77, 10,153,250,132,195, 4,138,
130224, 0, 0, 0,158,107, 42, 65,227,185, 90,158, 86, 6,155, 77,255,251, 82,196,
131 8, 0, 10,136,185,103, 4, 61, 48, 65,118,173, 44, 60,147, 10,152,107, 49, 74,
132 18,208, 91, 23,178,196,220, 25, 64,233,230, 36,170, 0,210,219,131, 40,165, 22,
133 86,195, 23,145, 33, 16,138, 99,109,117,245, 71,162, 69, 42,220,164, 91, 72,165,
134 26, 69,146,150,199,222, 73,102,148, 29, 19, 5, 65, 86, 6,150,120,180, 26, 88,
135 75, 18,191,255,250,171, 4, 8,132,140, 0, 0, 20,186,242,162, 66,100, 62, 86,
136206, 86,255, 26,203,201,255,255,141,128,166,196,175,133, 9, 70,188,146,175,133,
137 60, 17,217,229, 90, 27, 87, 93, 34, 76,113,185, 84,213, 56, 17,170, 83, 75,180,
138203,116,101, 93, 90, 99, 35,174,230, 42,125, 12,128, 79, 93, 81,234, 67, 66,137,
139105,157,157, 23, 71, 53, 40,250,204,105, 89,203,107,250, 63,174, 89,133, 81,140,
140 0, 52, 17, 16, 0, 0, 18,111, 20, 92, 32,213, 48,179, 50, 26,244,179, 27,230,
141154, 34,133,177, 88,255,251, 82,196, 13, 0, 10,125, 65, 85,244, 85, 0, 1,210,
142172,231, 7, 31, 32, 0, 37, 11, 68, 69, 13, 37, 48,210, 23, 69, 36,122,143,148,
143211,141, 44, 76,135, 72,148,195,135,174, 84,149,167, 30,198,183,255,213,111, 61,
144 27,155,191,177,207,246,163,255,230, 30,137,219,255,182,186,185,239, 52,148,171,
145 75, 63,167, 44, 0, 2, 81,190, 41,253,248,182,180, 23, 43,127,217,161, 41,191,
146 36,199, 40,153,108, 66,224,131,192,217, 12, 67,217, 6,218,240,108,112, 63, 33,
147 93, 12, 8, 43, 66, 42, 74, 12,215,135,100,172, 33, 65,172, 29, 98, 4, 83, 34,
148 40, 17,111,133,255, 18,145, 60, 59,136,145, 92,106,144, 34,185, 58, 76,154,254,
149146,144,115, 4, 84,180,142,178, 38, 79,253, 34,237,105, 31,106, 70, 73, 36,138,
150 73,164,181,127,253,182, 82,217, 26,245,117,163,255,219, 50,115,223,245, 92,198,
151165,173, 0, 15,249,132, 50, 19,157, 85,121,153,245, 51,255,251, 82,196, 6,131,
152 74, 96,134,156, 92, 19, 0, 8, 0, 0, 52,128, 0, 0, 0, 60,226, 73, 57, 26,
153249,253,122,211,128, 65, 86, 10, 1, 9,195,128, 36, 72,225,196,146,115, 73, 18,
154 75, 65, 77, 9, 5,200, 43, 16,163,129, 77, 9, 5,200,110, 39,127,255,255,255,
155255,255,255,255,252, 83, 66,142,140, 21,136, 46, 64,166,133, 28, 12, 21,136, 46,
156 64,166,133, 21, 6, 76, 65, 77, 69, 51, 46, 57, 50, 85, 85, 85, 85, 85, 85, 85,
157 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
158 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
159 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
160 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
161 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
162 85, 85, 85};
163 97
164void callback(unsigned char** start, size_t* size){ 98void callback(unsigned char** start, size_t* size){
165 (void)start; /* unused parameter, avoid warning */ 99 (void)start; /* unused parameter, avoid warning */
166 *size = NULL; /* end of data */ 100 *size = NULL; /* end of data */
167 sound_active = false; 101 sound_active = false;
168 led(0); 102 rb->led(0);
169} 103}
170 104
171void play_tock(void){ 105void play_tock(void){
172 sound_active = true; 106 sound_active = true;
173 led(1); 107 rb->led(1);
174 rb->mp3_play_data(sound, sizeof(sound), callback); 108 rb->mp3_play_data(sound, sizeof(sound), callback);
175 rb->mp3_play_pause(true); /* kickoff audio */ 109 rb->mp3_play_pause(true); /* kickoff audio */
176} 110}
@@ -180,532 +114,6 @@ void play_tock(void){
180#define MET_IS_PLAYING rb->pcm_is_playing() 114#define MET_IS_PLAYING rb->pcm_is_playing()
181#define MET_PLAY_STOP rb->audio_stop() 115#define MET_PLAY_STOP rb->audio_stop()
182 116
183static signed short sound[] = {
184 1, -1, 1, -1, 0, 0, 0, 1, -1, 0, 0,
185 0, -1, 2, -2, 2, -1, 0, 0, 0, 0, 1,
186 -1, 0, -1, 1, 0, 0, 0, 1, -1, 1, -2,
187 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
188 0, 0, -1, 2, -2, 2, -1, 0, 1, -1, 1,
189 -1, 0, 0, 0, 0, 1, -2, 2, -2, 1, 0,
190 1, -1, 0, 1, -1, 0, 1, -2, 2, -1, 0,
191 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0,
192 0, -1, 1, -1, 2, -2, 2, -2, 2, -2, 1,
193 0, 0, 0, 1, -2, 2, -2, 1, 0, 0, 0,
194 0, 0, 0, -1, 1, 0, -1, 2, -2, 2, -1,
195 0, 0, 0, -1, 1, -1, 1, -1, 2, -2, 1,
196 0, -1, 2, -2, 2, -2, 1, 0, 0, 0, 0,
197 0, 0, 0, 0, 1, -1, 0, 0, -1, 1, 0,
198 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0,
199 1, -2, 2, -1, 0, 0, 0, 0, 0, 1, -2,
200 1, 0, 0, 0, 0, 0, 1, -1, 0, 0, -1,
201 2, -2, 2, -2, 2, -1, 0, 0, -1, 1, -1,
202 1, -1, 1, -1, 1, -1, 1, 0, 0, -1, 2,
203 -2, 1, 0, 0, 0, 0, 0, 1, -1, 0, 0,
204 -1, 1, 0, 0, 0, 0, 0, 0, 1, -2, 2,
205 -2, 2, -1, 1, -1, 1, -2, 2, -2, 2, -2,
206 2, -2, 2, -2, 2, -1, 0, 0, 0, -1, 2,
207 -2, 2, -1, 1, -1, 1, -2, 2, -2, 1, 0,
208 1, -1, 1, -2, 1, -1, 1, 0, 0, 0, 0,
209 0, 0, 0, 0, -1, 1, 0, -1, 2, -1, 0,
210 0, -1, 1, 0, -1, 2, -2, 1, 0, 0, 0,
211 0, 0, 0, -1, 2, -1, 1, -1, 0, 0, 1,
212 -2, 2, -1, 1, -1, 0, 1, -1, 0, 0, 0,
213 0, 0, 0, -1, 1, 0, 0, 0, 0, -1, 2,
214 -2, 2, -1, 0, 1, -1, 0, 0, 0, 0, 0,
215 0, 0, 0, 1, -1, 1, -1, 0, 0, 0, 0,
216 0, 1, -1, 1, -1, 0, 1, -2, 2, -1, 0,
217 1, -2, 2, -2, 2, -2, 2, -1, 0, 1, -1,
218 0, 1, -1, 0, 0, 0, 0, 0, 0, 1, -2,
219 2, -2, 1, 0, -1, 2, -2, 1, 0, 0, 0,
220 0, -1, 1, 0, 0, 1, -1, 0, 0, 0, 0,
221 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0,
222 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1,
223 -1, 1, 0, 0, 0, 0, 0, 0, -1, 2, -1,
224 0, 0, 0, 0, 1, -1, 0, 0, 1, -2, 2,
225 -1, 0, 0, 0, 0, -1, 1, 0, 0, -1, 2,
226 -2, 1, 0, -1, 1, -1, 2, -2, 2, -2, 2,
227 -1, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0,
228 0, 0, 0, 0, 0, 0, -1, 1, 0, 1, -2,
229 2, -1, 0, 1, -1, 0, 0, 0, 0, 0, 0,
230 -1, 2, -2, 2, -2, 2, -1, 0, 0, 0, -1,
231 1, 0, -1, 1, 0, 0, 0, 0, 0, 0, 1,
232 -1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0,
233 1, -2, 2, -2, 1, 0, 0, 0, 0, 0, 0,
234 0, 1, -1, 0, 1, -1, 1, -1, 0, -1, 2,
235 -1, 0, 0, 0, -1, 1, -1, 1, 0, 1, -1,
236 1, -2, 1, 0, 0, 1, -2, 2, -2, 2, -2,
237 2, -2, 2, -1, 0, 0, 0, 0, 0, -1, 2,
238 -2, 2, -1, 0, 0, 0, 1, -1, 0, 0, 0,
239 0, -1, 1, -1, 1, 0, 0, 0, 1, -2, 1,
240 0, -1, 2, -2, 1, -1, 0, 2, -2, 2, 0,
241 -1, 0, 0, 0, -1, 2, -2, 2, -2, 2, -2,
242 2, -1, 0, 1, -2, 2, -1, 0, 0, 0, 0,
243 1, -1, 0, 0, 0, 0, 0, 0, 0, 1, -2,
244 1, 0, 0, 0, 0, 0, 0, -1, 1, -1, 1,
245 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1,
246 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
247 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, -1,
248 2, -2, 1, 0, 0, 0, 0, 0, -1, 2, -2,
249 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
250 0, 0, 0, -1, 2, -1, 0, 0, -1, 1, 0,
251 0, 0, 0, 0, 1, -1, 0, 0, -1, 1, 0,
252 0, 0, 0, -1, 1, 0, -1, 2, -1, 0, 0,
253 0, 1, -2, 2, -1, 0, 0, 0, -1, 1, -1,
254 1, 0, 0, 0, 0, 0, 0, 1, -1, 1, -1,
255 0, 0, -1, 2, -2, 1, 0, 0, 0, 0, 0,
256 0, 0, 0, 0, 0, 0, -1, 1, -1, 1, 0,
257 -1, 2, -2, 1, 1, -1, 0, 0, -1, 1, 0,
258 0, 0, 1, -2, 2, -2, 1, 0, 1, -2, 2,
259 -1, 0, 0, 0, -1, 2, -1, 0, 0, 0, 0,
260 0, 0, 0, 0, -1, 2, -2, 2, -1, 0, 0,
261 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
262 0, 0, 0, 0, -1, 2, -2, 2, -1, 0, 1,
263 -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -2,
264 2, -1, 0, 0, 0, -1, 2, -2, 2, -2, 1,
265 0, -1, 1, 0, -1, 1, 0, 0, 0, 0, 0,
266 -1, 1, -1, 2, -2, 2, -1, 1, -1, 0, 0,
267 0, 0, 1, -1, 0, 0, 0, 0, 1, -2, 2,
268 -2, 1, 1, -1, 1, -1, 1, -2, 2, -2, 1,
269 -1, 2, -2, 1, 0, 0, 0, 0, 0, -1, 2,
270 -2, 2, -1, -1, 1, -1, 1, -1, 2, -2, 2,
271 -1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 0,
272 0, 1, -2, 1, -1, 1, -1, 1, 0, 0, 0,
273 0, 0, -1, 1, 0, 0, 0, -1, 1, 0, 0,
274 1, -2, 2, -2, 1, 0, 0, 0, 0, 0, 0,
275 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
276 0, 0, 0, 0, 1, -1, 1, -2, 1, 0, 0,
277 0, 0, 0, 0, -1, 1, 0, 0, 0, -1, 1,
278 0, 0, 0, 0, 0, 0, 1, -2, 2, -1, 0,
279 0, 0, 0, 0, 0, 1, -2, 2, -1, 1, -1,
280 0, 0, 0, 1, -1, 0, 0, -1, 2, -1, 0,
281 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
282 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
283 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 1,
284 -1, 0, 0, 0, 0, 0, 0, -1, 2, -2, 2,
285 -1, 1, -1, 0, 0, -1, 2, -1, 1, -1, 1,
286 -2, 2, -2, 2, -2, 2, -1, 0, 0, 0, 0,
287 0, 0, 0, 0, 1, -1, 0, 0, 1, -2, 2,
288 -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
289 -1, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0,
290 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
291 0, 0, 0, 0, -1, 2, -2, 2, -1, 0, 1,
292 -2, 1, 0, 0, 1, -2, 2, -2, 2, -1, -1,
293 2, -2, 1, 0, 0, 0, 1, -2, 2, -1, 0,
294 0, 0, 0, 0, 0, 0, -1, 1, -1, 2, -1,
295 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 2,
296 -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1,
297 1, 0, 0, 1, -1, 1, -1, 0, 0, -1, 2,
298 -2, 2, -1, 0, 0, 0, 1, -1, 0, 0, 0,
299 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0,
300 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0,
301 0, -1, 2, -2, 1, 0, -1, 1, 0, 0, 1,
302 -1, 0, 0, -1, 2, -2, 1, 0, -1, 2, -1,
303 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0,
304 1, -2, 2, -2, 1, 0, 0, 0, 0, -1, 1,
305 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0,
306 -1, 1, 0, 0, 0, 1, -1, 0, 0, 0, 0,
307 1, -1, 0, 1, -1, 0, -1, 1, 0, -1, 2,
308 -2, 1, 0, 0, 0, -1, 2, -2, 1, 0, 0,
309 1, -2, 2, -1, 0, 1, -1, 0, 0, 0, -1,
310 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
311 0, -1, 1, 0, -1, 2, -2, 1, 0, 0, 0,
312 0, 0, 0, 0, 0, 0, 0, 0, -1, 2, -2,
313 1, -1, 1, -1, 2, -2, 1, 0, -1, 2, -2,
314 2, -1, 0, 0, 0, -1, 1, 0, 0, 0, 1,
315 -2, 2, -2, 2, -2, 1, 0, 0, 0, 0, 1,
316 -1, 1, -1, 0, 0, 0, 0, 0, 0, 1, -1,
317 0, 0, 0, 0, 1, -1, 0, 0, 0, -1, 2,
318 -2, 2, -1, 0, 1, -2, 1, 0, 0, 0, 0,
319 0, 0, 0, 0, 0, 0, 0, 0, -1, 2, -2,
320 2, -2, 1, 0, 0, 0, 0, 0, 0, -1, 2,
321 -2, 2, -1, 0, 1, -1, 0, 0, 0, 0, 0,
322 0, 1, -1, 0, 1, -2, 1, 0, -1, 1, 0,
323 -1, 1, 0, 0, 0, 0, 1, -1, 0, 0, 0,
324 0, 0, -1, 2, -2, 2, -2, 2, -2, 1, 0,
325 0, 0, 0, 1, -2, 2, -2, 2, -1, 0, 1,
326 -2, 2, -2, 1, 0, 0, 0, 1, -1, 0, 0,
327 -1, 1, 0, 0, 0, 0, -1, 2, -2, 2, -1,
328 0, 0, 0, -1, 2, -1, 0, 1, -1, 0, 0,
329 0, 0, 1, -2, 2, -1, 0, 0, 0, 0, 0,
330 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0,
331 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0,
332 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0,
333 0, 0, 0, -1, 1, 0, 0, -1, 1, -1, 2,
334 -2, 2, -2, 2, -1, 0, 0, -1, 1, -1, 1,
335 0, -1, 2, -2, 2, -1, 0, 0, 0, 0, 0,
336 0, 0, 1, -2, 2, -2, 1, 0, 0, 0, -1,
337 2, -2, 1, 0, 1, -1, 0, 0, 1, -1, 1,
338 -2, 1, 0, 0, 0, -1, 1, -1, 2, -2, 2,
339 -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1,
340 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
341 1, -2, 2, -1, 0, 1, -2, 2, -1, 0, 0,
342 0, 0, 1, -1, 1, -1, 0, -1, 2, -2, 2,
343 -2, 2, -1, 0, 0, 0, 0, 0, 0, 0, 1,
344 -1, 0, 0, 0, -1, 2, -2, 1, 1, -2, 2,
345 -1, 0, 1, -2, 1, 0, 0, 0, 0, 1, -1,
346 0, 1, -1, 0, 0, -1, 2, -2, 2, -2, 2,
347 -2, 2, -2, 2, -2, 2, -2, 2, -1, 1, -1,
348 1, -1, 1, 0, -1, 1, -1, 1, 0, 0, -1,
349 0, 1, 0, 1, -2, 2, -2, 1, 1, -2, 1,
350 0, 0, 0, 0, 0, 0, 0, -1, 2, -1, 0,
351 0, -1, 1, 0, 0, 0, -1, 0, 1, 0, 1,
352 -2, 0, -1, 1, 0, 1, 0, -1, 0, 0, 1,
353 -1, 1, -2, 1, 1, -1, 1, -1, -1, 0, 1,
354 0, 1, -1, 0, -1, 0, 1, 1, -2, 1, -1,
355 1, 1, 0, -1, 0, 0, 1, 1, 1, -1, 0,
356 -1, 0, 1, -1, 1, -2, 2, 0, 0, 1, -2,
357 -1, 0, 0, 1, -1, 0, -1, 1, 0, 0, 0,
358 0, 0, 0, 0, -1, 1, -1, 1, 0, 2, 1,
359 -1, 0, 0, 0, 1, 1, 1, -1, 1, 1, 0,
360 1, -2, 1, -1, 2, 2, 0, -1, -1, -1, 0,
361 1, -1, 1, -1, 1, 1, 1, 1, -3, 0, 3,
362 0, 0, -4, -2, 4, 5, 4, -3, -1, 1, -3,
363 -2, -5, -6, -1, 5, 2, 1, -3, -2, -5, 1,
364 -4, -5, 3, 5, 0, 1, 2, 0, -5, -1, 3,
365 5, 2, 1, 1, 6, 5, 3, -1, 0, 2, 5,
366 10, 8, 4, 2, -5, -5, 3, 11, 8, -4, -8,
367 -2, 2, -1, -1, 5, -6, -12, -11, -5, -9, -5,
368 10, 6, 3, -4, -3, -9, -8, -18, -9, 5, 13,
369 7, 13, 29, 17, -1, -1, 15, 21, 15, -9, -29,
370 -15, 10, 10, -15, -31, -48, -49, -30, -7, -1, -8,
371 -6, 15, 39, 43, 24, 16, 27, 28, 9, -16, -6,
372 34, 60, 41, 15, 11, 26, 14, -28, -77, -83, -60,
373 -32, 1, 10, -11, -59, -83, -49, 27, 93, 82, 11,
374 -27, -8, 9, 1, 12, 22, 6, -22, -15, 4, 8,
375 -19, -23, 49, 143, 139, 39, -31, -56, -101, -145, -102,
376 -10, 20, -61, -196, -258, -136, 70, 172, 112, 43, 55,
377 75, 12, -69, -33, 89, 114, -26, -137, -14, 239, 335,
378 202, 68, 115, 231, 169, -131, -459, -540, -338, -72, 43,
379 20, -53, -174, -290, -195, 192, 593, 628, 322, 95, 159,
380 264, 163, -50, -202, -229, -114, 18, -31, -212, -264, -36,
381 432, 807, 619, -52, -483, -452, -414, -404, -98, 228, -3,
382 -760, -1444, -1414, -458, 624, 732, 35, -209, 476, 1113, 586,
383 -785, -1405, -480, 753, 881, 280, 81, 441, 753, 687, 711,
384 1440, 2140, 1110, -1470, -2963, -1770, 607, 1427, -399, -3146, -3899,
385 -2064, 28, 715, 874, 1442, 1606, 394, -1483, -2014, -354, 1531,
386 1156, -984, -2108, -821, 1635, 3003, 2087, 186, -155, 1569, 3328,
387 3463, 2110, 9, -2200, -3876, -4298, -2871, -266, 1039, -393, -2357,
388 -1809, 1079, 4019, 5685, 5742, 4435, 3098, 2963, 3181, 2018, -691,
389 -3919, -6922, -9001, -8935, -6374, -3215, -1862, -2089, -1508, 731, 3186,
390 4763, 5160, 3629, 706, -712, 739, 2391, 1570, -1015, -3502, -4979,
391 -4798, -2615, 420, 2178, 1457, -602, -1287, 741, 3741, 5018, 3687,
392 934, -757, 497, 3094, 3163, 113, -2188, -1194, 911, 998, -254,
393 484, 3643, 4907, 1023, -4718, -6191, -1911, 3621, 4508, -687, -6491,
394 -6309, -1015, 3007, 3184, 1911, 471, -1763, -4048, -4414, -2046, 1179,
395 1513, -1919, -4522, -2259, 2368, 4547, 3613, 2320, 2847, 5035, 6432,
396 4390, -835, -5857, -7419, -5497, -2768, -1012, -27, -294, -2444, -3889,
397 -1911, 942, 1212, 859, 2879, 5141, 4107, 108, -3768, -4853, -2787,
398 -162, 142, -1594, -2490, -498, 3349, 5670, 4368, 1089, -1548, -3118,
399 -3936, -3319, -1583, -547, -360, 985, 3125, 2273, -1728, -2291, 4071,
400 10390, 9283, 3620, 79, -90, 1293, 1968, -2030,-10963,-16320,-10631,
401 1236, 8206, 6740, 2418, 1132, 3007, 3504, -1371, -8877, -9321, 2657,
402 17866, 22245, 14739, 4801, -2737, -7071, -2808, 12289, 25609, 19526, -6479,
403-30563,-29780, -6434, 13879, 13263, 83, -8239, -7874, -6445, -8032, -9180,
404 -7691, -7914,-12368,-13982, -7090, -1018, -8154,-21862,-22142, -3867, 14327,
405 14436, 1712, -5853, -2462, 3311, 4605, 1731, -3832,-11191,-17673,-17400,
406 -4049, 17643, 27851, 14373, -7582,-15759, -9573, -1277, 5996, 13903, 17168,
407 11276, 1603, -4763, -7550, -7537, -2186, 6709, 10980, 6990, -1127, -9765,
408-16805,-19102,-18420,-18687,-13775, 3373, 21405, 23456, 12651, 3319, -1287,
409 -4637, -3954, 3883, 11849, 8344, -6853,-17292, -7204, 16901, 31089, 21726,
410 1084, -7875, 1459, 15092, 20527, 18496, 10594, -3296,-12835, -6081, 9842,
411 15942, 3977,-16959,-26888,-12200, 13260, 20645, 6239, -5950, -2526, 6054,
412 8073, 3123, -4656,-11949,-15611,-12153, -2236, 4314, -2887,-19936,-30928,
413-23846, -1429, 17759, 15264, -1868, -7505, 5991, 19737, 18946, 8185, -600,
414 44, 6127, 5321, -4750,-11829, -8743, -1330, 3689, 3252, -3513,-11859,
415-14753,-10198, 72, 10949, 13370, 5735, -564, 2639, 9903, 13145, 11045,
416 6754, 3123, -724, -6600,-10509, -8340, -6244,-12133,-21055,-20385, -5186,
417 15105, 23034, 11762, -3750, -5737, 2612, 6060, 33, -7014, -4975, 7697,
418 18684, 12606, -7934,-23083,-20429, -7355, 2345, 4875, 7094, 14569, 22636,
419 22509, 13749, 4800, 2246, 4805, 7497, 7404, 4042, -3207,-13334,-19292,
420-12274, 5051, 15820, 7212,-12051,-20991,-11633, 3886, 11417, 10491, 8967,
421 9849, 9995, 8305, 7497, 7731, 5549, -49, -6582,-12286,-16545,-19489,
422-22478,-23536,-16116, -123, 14039, 19014, 16964, 11024, 3746, 1174, 5696,
423 10510, 9283, 3833, -1113, -4247, -7485,-11448,-12665, -9329, -7052,-10656,
424-14627,-10081, 3317, 16454, 18316, 6990, -6264,-10409, -7182, -2463, 3812,
425 10794, 12717, 7460, 215, -2353, 676, 983, -9207,-21161,-17629, 361,
426 11731, 2863,-15895,-22726, -8619, 11663, 17157, 7331, -255, 4522, 15016,
427 20742, 18465, 12205, 6509, 836, -6050,-10016, -8310, -6482, -9596,-13628,
428-12443, -6667, -1745, -487, 633, 6363, 14319, 17428, 14246, 9598, 6752,
429 5527, 5289, 5673, 6272, 5900, 2123, -5034,-10908,-12352,-12153,-13371,
430-14974,-15335,-14089, -9874, -1589, 8285, 14571, 13761, 7383, 1668, 1519,
431 4509, 3987, -1719, -7872,-10985,-12263,-12864,-11713, -9423, -8944,-10937,
432-12477,-11078, -6884, -1052, 5798, 13303, 20195, 23473, 20387, 12863, 7217,
433 6080, 4059, -3737,-13190,-17239,-15342,-11071, -5970, -543, 4259, 7968,
434 8781, 4097, -3427, -7041, -5374, -2595, 70, 4218, 8042, 8534, 7403,
435 8758, 12712, 15141, 12739, 6198, -414, -2420, 331, 780, -7211,-18274,
436-21587,-15771, -7472, 733, 9880, 17443, 19723, 16661, 10520, 4467, 1343,
437 308, -1550, -3368, -1921, 1564, 1426, -5086,-13434,-16483,-12675, -6499,
438 -2040, -586, -2374, -5424, -5786, -2131, 3305, 7892, 9432, 7024, 3000,
439 410, -274, 396, 1514, 785, -2873, -7609,-11931,-15458,-16897,-15275,
440-10823, -3469, 5396, 11785, 13505, 11686, 7478, 2801, 1972, 6978, 13591,
441 14815, 7016, -6127,-15851,-17122,-13183, -9425, -7273, -5029, -1087, 3485,
442 5516, 4834, 5156, 7648, 9472, 9387, 8481, 7313, 6847, 7922, 8488,
443 6309, 2375, -1821, -6179, -9633,-10798,-10521,-10565,-11165,-11055, -8661,
444 -3781, 1960, 6819, 9680, 9920, 8944, 9396, 10975, 10715, 7182, 861,
445 -7005,-13267,-15283,-15034,-15703,-15867,-12193, -5329, 829, 3996, 5377,
446 7152, 9312, 10386, 10275, 10167, 10500, 10694, 9601, 6318, 2012, -1381,
447 -4917,-10834,-17053,-18962,-15907,-11261, -7518, -4754, -2399, -32, 2969,
448 6930, 10871, 13043, 13087, 12045, 10546, 9003, 8103, 6739, 2241, -5153,
449-11768,-15213,-15636,-13473, -9655, -6045, -3220, -430, 2055, 3835, 6558,
450 11429, 15904, 16225, 12337, 7477, 3631, -122, -4854, -9898,-13734,-15118,
451-13861,-11287, -8854, -6458, -3768, -1724, -385, 2105, 5993, 8742, 9121,
452 8765, 8415, 6764, 3536, 104, -2912, -5635, -7580, -8217, -7502, -5362,
453 -2617, -1366, -2262, -3363, -3163, -2137, -589, 1870, 4595, 6301, 6764,
454 6718, 6520, 5842, 4638, 3882, 4279, 4700, 3357, 183, -2935, -3952,
455 -2906, -2493, -4469, -6460, -5616, -2932, -231, 3057, 6959, 9364, 9069,
456 6831, 4078, 2556, 2602, 2068, -153, -1834, -1310, -248, -795, -2717,
457 -4126, -3995, -3695, -4963, -6850, -7066, -5258, -2772, -846, 139, 1073,
458 2821, 4490, 5430, 6971, 8941, 8259, 3626, -2713, -8358,-12049,-13228,
459-12856,-12123,-10333, -7012, -3862, -1844, 527, 4263, 8105, 10304, 10453,
460 9346, 7786, 5793, 3181, 40, -3553, -7164, -9520, -9740, -8339, -6135,
461 -3335, 16, 3345, 5455, 5356, 3793, 2943, 3715, 4965, 5638, 6024,
462 6657, 7270, 6829, 4385, 593, -2392, -3644, -4633, -6185, -6575, -4682,
463 -2249, -1081, -648, 222, 1873, 4273, 6609, 7328, 6269, 5017, 4332,
464 3500, 2200, 704, -1135, -3367, -5373, -6705, -7346, -7055, -5618, -3596,
465 -1716, 117, 2133, 3576, 3514, 2437, 1568, 1147, 588, -490, -1976,
466 -3125, -2983, -1979, -1775, -2637, -2993, -2327, -2013, -2843, -4077, -4841,
467 -4778, -3915, -2756, -1663, -78, 2401, 4777, 5910, 6074, 5858, 4886,
468 2889, 688, -970, -2010, -2413, -2357, -2511, -3033, -3218, -2983, -2783,
469 -2022, 315, 3490, 5687, 6228, 5642, 4405, 3006, 2065, 1656, 1592,
470 2141, 3191, 3485, 2147, -131, -2437, -4663, -6289, -6118, -3991, -1098,
471 1550, 3446, 4204, 4186, 4379, 4801, 4654, 3956, 3267, 2297, 512,
472 -1660, -3571, -5057, -5713, -5051, -3695, -2719, -2075, -1180, -306, 43,
473 201, 527, 896, 1415, 2085, 2103, 1018, -171, -613, -825, -1316,
474 -1701, -1787, -1766, -1462, -922, -997, -1987, -2857, -2699, -1736, -514,
475 484, 696, 221, 24, 316, 48, -973, -1304, -49, 1921, 3426,
476 4026, 3875, 3529, 3327, 2659, 1002, -723, -1568, -2055, -2862, -3247,
477 -2368, -873, 62, 184, 58, 315, 1196, 2204, 2563, 2494, 2945,
478 3730, 3479, 1991, 500, -527, -1710, -3069, -4146, -4921, -5126, -4168,
479 -2410, -881, 287, 1399, 2210, 2737, 3559, 4435, 4390, 3402, 2338,
480 1278, -271, -1954, -2896, -3007, -2752, -2482, -2724, -3874, -5145, -5390,
481 -4613, -3122, -402, 3217, 5859, 6536, 6136, 5381, 4239, 3021, 1905,
482 465, -1127, -2074, -2588, -3532, -4652, -5131, -4876, -4054, -2586, -848,
483 525, 1727, 3291, 4715, 5094, 4595, 3990, 3426, 2642, 1618, 196,
484 -1676, -3238, -3809, -3789, -3482, -2326, -697, -239, -1207, -1820, -939,
485 863, 2740, 4260, 5221, 5856, 6299, 5671, 3229, -23, -2465, -3892,
486 -4948, -5454, -5047, -4443, -4355, -4055, -2592, -469, 1194, 2038, 2285,
487 2563, 3653, 5162, 5484, 4235, 2697, 1473, 27, -1754, -3674, -5673,
488 -6983, -6577, -4808, -2747, -690, 1257, 2527, 3071, 3338, 3313, 2895,
489 2726, 3203, 3522, 2793, 1295, -325, -2074, -3850, -4855, -4744, -4000,
490 -2801, -1095, 473, 1418, 2150, 2712, 2651, 2407, 2619, 2775, 2513,
491 2523, 2737, 2113, 659, -598, -1376, -2019, -2413, -2377, -2143, -1792,
492 -1119, -403, -404, -963, -894, 215, 1579, 2770, 3868, 4081, 2660,
493 398, -1501, -2862, -3573, -3200, -2109, -1097, -276, 295, 45, -1024,
494 -1953, -2120, -1736, -971, 274, 1597, 2369, 2667, 2840, 2417, 947,
495 -823, -1912, -2224, -1940, -1203, -452, 127, 811, 1272, 788, -366,
496 -1342, -1806, -1746, -1161, -266, 928, 2469, 3661, 3707, 2956, 2179,
497 1379, 340, -690, -1418, -1852, -2028, -1928, -1591, -1202, -864, -267,
498 806, 1949, 2658, 2868, 2653, 2202, 1866, 1534, 768, -230, -1027,
499 -1800, -2455, -2301, -1394, -707, -605, -610, -403, -39, 282, 371,
500 423, 917, 1881, 2543, 1980, 235, -1335, -1767, -1786, -2298, -2787,
501 -2689, -2421, -2133, -1460, -694, -214, 424, 1435, 2307, 2819, 3041,
502 2652, 1573, 324, -754, -1729, -2520, -2956, -2933, -2321, -1260, -306,
503 165, 305, 416, 646, 985, 1362, 1745, 2076, 2245, 2234, 1930,
504 1150, -10, -1337, -2785, -3969, -4138, -3350, -2371, -1256, 303, 1810,
505 2722, 3265, 3605, 3559, 3246, 2772, 1942, 766, -553, -1923, -2939,
506 -3124, -2592, -1721, -657, 340, 1033, 1514, 1616, 1076, 417, 322,
507 591, 787, 929, 1058, 1046, 827, 255, -548, -1069, -1232, -1508,
508 -1928, -2066, -1828, -1384, -836, -313, 165, 570, 710, 593, 549,
509 566, 338, -42, -215, -86, 93, -71, -692, -1242, -1361, -1405,
510 -1612, -1705, -1546, -1012, 64, 1202, 1774, 2110, 2444, 2028, 747,
511 -280, -586, -712, -687, -214, 222, 21, -651, -1402, -2075, -2301,
512 -1607, -374, 420, 528, 623, 906, 895, 646, 748, 1155, 1401,
513 1471, 1569, 1443, 829, -102, -1009, -1730, -2195, -2295, -1957, -1121,
514 235, 1663, 2296, 1932, 1429, 1359, 1289, 1045, 1074, 1308, 1229,
515 771, 13, -1126, -2275, -2863, -2931, -2658, -1849, -660, 316, 931,
516 1418, 1586, 1154, 592, 633, 1166, 1428, 1169, 759, 275, -489,
517 -1425, -2208, -2714, -2705, -2029, -1090, -367, 236, 886, 1413, 1728,
518 1903, 1867, 1576, 1097, 393, -463, -1157, -1465, -1417, -1112, -615,
519 82, 923, 1390, 889, -291, -1250, -1686, -1756, -1338, -411, 577,
520 1291, 1751, 1854, 1480, 897, 393, -43, -439, -733, -924, -979,
521 -751, -354, -58, 122, 314, 418, 311, 171, 225, 428, 678,
522 1000, 1304, 1263, 748, 37, -586, -1042, -1237, -1070, -664, -243,
523 97, 262, 167, -128, -402, -445, -184, 202, 446, 534, 519,
524 323, -11, -258, -385, -468, -463, -350, -191, -36, -2, -163,
525 -207, 82, 406, 588, 861, 1087, 900, 461, 73, -396, -872,
526 -917, -514, -44, 332, 667, 771, 490, -59, -620, -1123, -1495,
527 -1448, -811, 63, 751, 1214, 1446, 1336, 1005, 611, 60, -531,
528 -828, -837, -740, -478, -139, -25, -63, 30, 245, 481, 790,
529 1033, 1002, 750, 462, 140, -197, -433, -516, -516, -578, -715,
530 -818, -821, -742, -548, -228, 77, 233, 247, 183, 100, 60,
531 91, 155, 208, 257, 275, 154, -136, -387, -429, -428, -486,
532 -396, -72, 259, 435, 450, 397, 400, 373, 153, -57, 23,
533 181, 231, 390, 496, 87, -627, -1036, -1047, -785, -216, 465,
534 823, 761, 501, 269, 197, 282, 395, 502, 597, 684, 687,
535 440, -91, -581, -803, -853, -677, -155, 367, 520, 472, 351,
536 -35, -523, -708, -585, -312, 103, 471, 530, 378, 226, 51,
537 -164, -377, -542, -582, -404, -134, 42, 91, 4, -205, -400,
538 -488, -528, -548, -453, -157, 305, 794, 1106, 1134, 866, 307,
539 -368, -839, -979, -916, -721, -436, -226, -164, -84, 26, 32,
540 27, 249, 614, 889, 1016, 1036, 931, 663, 248, -235, -632,
541 -864, -967, -997, -965, -800, -394, 150, 614, 919, 1096, 1049,
542 791, 514, 271, 19, -107, -93, -145, -295, -384, -365, -257,
543 -96, -26, -115, -232, -332, -437, -400, -167, 106, 387, 655,
544 726, 536, 231, -134, -519, -793, -961, -1068, -1019, -800, -555,
545 -275, 62, 333, 543, 777, 937, 940, 888, 784, 519, 133,
546 -278, -630, -849, -905, -836, -598, -266, -41, 129, 370, 501,
547 401, 294, 265, 159, 100, 253, 410, 336, 166, 11, -162,
548 -313, -295, -159, -70, -82, -123, -159, -195, -141, 128, 547,
549 900, 1123, 1218, 1047, 565, -14, -513, -944, -1193, -1088, -735,
550 -411, -189, -17, 62, 33, 33, 114, 218, 335, 449, 434,
551 244, -53, -414, -720, -786, -594, -314, -119, -107, -289, -515,
552 -670, -755, -661, -218, 419, 945, 1257, 1343, 1140, 688, 146,
553 -364, -747, -941, -997, -923, -669, -334, -74, 97, 267, 439,
554 594, 715, 741, 715, 739, 823, 817, 615, 225, -241, -642,
555 -911, -1033, -958, -683, -356, -53, 232, 432, 478, 491, 616,
556 782, 862, 863, 794, 586, 230, -181, -534, -750, -738, -528,
557 -311, -238, -262, -256, -227, -207, -107, 83, 179, 121, 79,
558 115, 135, 168, 205, 147, 48, 78, 104, -77, -367, -617,
559 -883, -1084, -1016, -718, -373, -15, 361, 660, 801, 781, 677,
560 554, 320, -73, -437, -617, -681, -645, -434, -130, 113, 293,
561 396, 325, 127, -74, -166, -76, 183, 416, 509, 518, 451,
562 293, 114, -37, -135, -139, -66, 9, 69, 133, 172, 213,
563 302, 407, 464, 465, 362, 169, -59, -340, -635, -779, -688,
564 -447, -84, 362, 661, 681, 514, 221, -144, -386, -357, -167,
565 107, 375, 463, 237, -179, -650, -1045, -1222, -1130, -842, -392,
566 138, 538, 675, 607, 418, 190, 41, -18, -35, -35, -32,
567 -96, -207, -325, -456, -537, -470, -334, -214, -45, 183, 298,
568 318, 354, 397, 377, 383, 478, 558, 567, 484, 302, 21,
569 -283, -518, -634, -630, -538, -323, -11, 257, 390, 440, 384,
570 210, 120, 251, 418, 464, 415, 286, 41, -216, -388, -514,
571 -519, -335, -65, 96, 139, 108, -19, -217, -360, -319, -84,
572 209, 472, 622, 599, 404, 185, 16, -167, -362, -491, -580,
573 -659, -617, -457, -316, -190, 29, 245, 336, 321, 250, 116,
574 2, -41, -39, 27, 143, 200, 119, -28, -153, -219, -211,
575 -152, -101, -31, 29, 24, -42, -109, -150, -121, -8, 81,
576 114, 185, 282, 308, 280, 243, 149, 11, -54, -87, -184,
577 -283, -303, -254, -123, 83, 232, 239, 165, 62, -49, -140,
578 -173, -148, -67, 24, 67, 84, 92, 54, -41, -121, -154,
579 -114, -23, 33, -42, -166, -268, -347, -412, -399, -276, -56,
580 203, 449, 635, 747, 724, 565, 367, 166, -64, -263, -360,
581 -406, -447, -446, -403, -362, -295, -156, -16, 98, 230, 381,
582 493, 512, 456, 390, 345, 296, 223, 156, 56, -121, -320,
583 -500, -665, -754, -680, -487, -234, 79, 378, 518, 528, 469,
584 319, 127, 35, 48, 65, 106, 170, 121, -91, -334, -506,
585 -625, -686, -636, -473, -258, -40, 168, 349, 443, 477, 509,
586 514, 432, 311, 186, -4, -269, -460, -541, -600, -629, -558,
587 -432, -326, -227, -105, 34, 209, 394, 534, 582, 577, 524,
588 403, 246, 118, 23, -71, -157, -166, -96, -30, -27, -54,
589 -75, -74, -38, -12, -25, -9, 103, 245, 354, 449, 504,
590 459, 321, 148, -52, -248, -357, -383, -369, -327, -281, -274,
591 -281, -215, -56, 146, 351, 547, 692, 699, 525, 253, 5,
592 -185, -301, -328, -280, -255, -260, -282, -372, -505, -535, -391,
593 -184, 26, 233, 392, 410, 313, 173, 39, -67, -108, -93,
594 -70, -85, -151, -261, -381, -475, -495, -443, -313, -91, 211,
595 503, 688, 732, 648, 464, 220, -12, -159, -211, -226, -273,
596 -324, -329, -267, -147, -8, 120, 253, 422, 558, 570, 491,
597 394, 269, 115, 6, -26, -46, -102, -183, -263, -295, -279,
598 -200, -55, 104, 181, 191, 229, 264, 234, 170, 120, 23,
599 -99, -169, -217, -323, -368, -285, -173, -113, -33, 59, 81,
600 15, -85, -169, -191, -127, 0, 127, 178, 111, -6, -94,
601 -130, -110, -20, 82, 87, 38, 1, -73, -175, -203, -108,
602 24, 142, 243, 255, 154, 20, -64, -99, -88, -26, 73,
603 178, 230, 191, 70, -70, -165, -187, -142, -52, 49, 163,
604 267, 320, 304, 230, 146, 70, 6, -38, -84, -144, -224,
605 -289, -349, -368, -291, -88, 163, 372, 491, 466, 307, 89,
606 -105, -254, -332, -311, -217, -111, -19, -4, -66, -132, -161,
607 -159, -125, -50, -13, -36, -42, 14, 105, 212, 311, 353,
608 331, 264, 120, -101, -320, -487, -564, -501, -331, -168, -22,
609 130, 249, 281, 288, 283, 239, 225, 267, 268, 198, 126,
610 28, -139, -302, -389, -442, -438, -302, -96, 102, 291, 438,
611 476, 423, 334, 223, 106, 14, -82, -191, -290, -397, -494,
612 -518, -425, -238, -23, 164, 270, 324, 355, 319, 215, 89,
613 -27, -147, -236, -288, -347, -395, -360, -243, -125, -43, 25,
614 75, 85, 82, 119, 160, 166, 148, 130, 82, 8, -29,
615 -63, -124, -173, -166, -121, -63, 16, 87, 163, 235, 250,
616 217, 191, 187, 142, 76, 12, -71, -137, -169, -189, -183,
617 -106, 8, 87, 134, 154, 99, 45, 84, 178, 241, 277,
618 270, 209, 125, 50, -62, -190, -254, -235, -179, -106, -18,
619 33, 46, 32, 9, -22, -35, -13, 22, 64, 78, 29,
620 -63, -133, -169, -189, -166, -121, -98, -67, -3, 15, 5,
621 44, 100, 108, 108, 114, 64, -46, -141, -245, -316, -233,
622 -59, 21, -10, -20, -6, -7, -6, 7, -3, -2, 9,
623 -2, -25, -17, -1, 1, -8, -1, -5, -11, -13, -10,
624 -14, -12, -3, 11, 6, 2, 1, -9, -13, 0, 11,
625 12, 16, 17, 9, -4, -9, -13, -11, 1, 7, 2,
626 13, 13, -3, 0, 10, 9, 3, 6, 4, -4, -9,
627 -7, -2, 6, 5, -14, -19, -9, -11, -10, -5, -16,
628 -22, -4, 17, 16, 1, -14, -17, -6, 6, 3, -2,
629 -5, -10, -11, -1, -2, -12, -12, -4, 9, 14, 15,
630 6, 9, 13, 7, -6, -5, 5, 3, -6, -10, -14,
631 -11, -4, 4, 3, -1, 3, -1, -12, -13, 2, 9,
632 -1, -7, -1, 1, 1, 12, 7, 2, -1, 3, 3,
633 7, 7, 3, -1, 4, 8, 3, 6, 6, 2, -3,
634 -2, -5, -6, 1, -2, -6, -9, -10, -7, -5, 3,
635 -4, -10, -7, 5, 7, 1, 0, 0, -8, -7, -5,
636 -1, 2, 4, 6, -1, -2, 5, 5, 0, -1, 0,
637 1, -8, -8, -12, -9, -4, -2, -3, -4, -1, 2,
638 3, 3, -3, -4, -5, 3, 6, -1, -5, -14, -13,
639 -12, -13, -11, 0, 9, 13, 10, 9, 7, 1, 1,
640 -2, 1, 3, 3, 2, 0, -2, 0, 0, 3, 1,
641 4, 2, 4, 0, 1, -1, -1, -1, 0, -2, -2,
642 -1, -2, 2, -1, 1, 0, 1, 2, 2, 1, 1,
643 1, 0, -1, -1, 0, -1, 1, -2, 2, 0, 1,
644 0, -1, -1, -1, 1, 0, 0, -1, -2, -2, -1,
645 -2, -1, 2, 1, 3, 0, 3, 0, -1, 1, -1,
646 1, 0, 1, 0, -1, 1, -2, 2, -1, 1, 0,
647 1, 0, 0, 0, 0, 0, -1, 1, -2, 1, -1,
648 1, 0, 0, 0, 0, 0, 0, 1, -1, 1, 0,
649 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -1,
650 0, 0, 1, 0, 0, 0, -1, 0, -1, 1, -1,
651 1, 0, -1, 2, -1, 1, -1, 1, -1, 0, 1,
652 -1, 0, 1, -1, 2, -2, 1, -1, 1, -1, 0,
653 1, -1, 1, 0, -1, 1, 0, -1, 1, -1, 0,
654 1, -1, 1, 0, -1, 1, -1, 0, 0, 1, -1,
655 1, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1,
656 -1, 1, -1, 0, 1, -1, 1, -1, 1, -2, 2,
657 -1, 0, 1, -1, 0, 1, -1, 1, 0, 0, 0,
658 0, 0, 0, -1, 1, -1, 1, -1, 1, -1, 1,
659 -1, 1, -1, 0, 1, -2, 2, -1, 0, 0, 1,
660 -1, 1, 0, -1, 0, 0, 1, -2, 2, -1, 0,
661 1, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1,
662 1, -1, 0, 1, -1, 1, 0, -1, 0, 0, 1,
663 -1, 0, 0, 1, -1, 0, 0, 0, 1, -1, 1,
664 -1, 0, 1, -1, 1, -1, 0, 0, 0, 1, -1,
665 1, -1, 1, -1, 1, 0, 0, 0, -1, 0, 1,
666 -1, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1,
667 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1,
668 -1, 0, 1, -1, 1, 0, -1, 1, 0, -1, 1,
669 -1, 1, -1, 1, -1, 1, -1, 0, 1, -2, 2,
670 0, -1, 1, -1, 1, -1, 1, 0, -1, 1, -1,
671 0, 1, -2, 2, -1, 1, 0, 0, 0, -1, 1,
672 -1, 1, -1, 0, 0, 0, 1, -1, 1, 0, -1,
673 1, -1, 0, 1, -1, 1, -1, 1, -1, 0, 1,
674 -1, 1, -1, 0, 0, 1, -1, 1, -1, 0, 1,
675 -2, 2, -1, 0, 1, -2, 2, 0, 0, 0, -1,
676 1, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1,
677 0, 1, -1, 1, -1, 0, 0, 1, -1, 1, -2,
678 2, -2, 3, -3, 3, -2, 0, 1, -1, 0, 0,
679 1, -1, 1, -1, 0, 1, -1, 0, 0, 0, 1,
680 -1, 0, 1, -1, 1, -1, 0, 0, 0, 1, -1,
681 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, -1,
682 1, -1, 1, 0, -1, 1, 0, -1, 1, -1, 0,
683 1, -1, 1, -1, 1, 0, -1, 1, -1, 0, 1,
684 -1, 1, 0, 0, 0, -1, 1, -1, 0, 0, 0,
685 0, 1, -1, 1, 0, -1, 0, 1, -1, 0, 1,
686 -1, 1, -1, 1, -1, 0, 1, -2, 2, -1, 0,
687 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 1,
688 -1, 0, 1, -1, 1, -1, 1, 0, 0, -1, 1,
689 -1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1,
690 -1, 0, 1, -1, 1, -1, 1, -1, 0, 1, -1,
691 0, 1, -1, 1, 0, -1, 1, -1, 0, 1, -2,
692 2, -1, 0, 0, 0, 1, -1, 1, -1, 1, 0,
693 -1, 1, -1, 0, 1, -2, 2, -1, 0, 0, 0,
694 1, -1, 0, 0, 1, -1, 1, 0, -1, 0, 1,
695 -2, 2, -1, 1, 0, -1, 0, 1, -2, 3, -2,
696 1, -1, 1, -2, 2, -2, 2, -1, 1, -1, 1,
697 -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1,
698 0, 0, 1, -1, 1, -2, 2, -1, 1, -1, 1,
699 -1, 0, 1, -2, 2, -1, 1, -1, 0, 0, 0,
700 0, 1, -1, 1, -1, 1, -2, 2, -1, 1, 0,
701 -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 0,
702 1, -1, 1, -1, 1, -1, 0, 0, 0, 1, 0,
703 -1, 1, 0, -1, 1, -2, 2, -2, 2, -1, 0,
704 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 1,
705 0, 0, -1, 1, -1, 1, -1, 1, -1, 0, 0,
706 0, 0, 1, -1, 1, 0, -1, 0, 0, 0, 1,
707 -1, 1, -1, 0, 1, -1, 0
708};
709 117
710int tock; 118int tock;
711#if CONFIG_CODEC == SWCODEC 119#if CONFIG_CODEC == SWCODEC
@@ -737,64 +145,58 @@ void calc_period(void)
737} 145}
738 146
739 147
740void draw_display(void) 148void metronome_draw(struct screen* display)
741{ 149{
742 rb->lcd_clear_display(); 150 display->clear_display();
743#ifdef HAVE_REMOTE_LCD
744 rb->lcd_remote_clear_display();
745#endif
746 151
747#ifdef HAVE_LCD_BITMAP 152#ifdef HAVE_LCD_BITMAP
748 rb->lcd_setfont(FONT_SYSFIXED); 153 display->setfont(FONT_SYSFIXED);
749 rb->lcd_putsxy(1, 1, "Metronome"); 154 display->puts(0, 0, "Metronome");
750 rb->lcd_puts(0, 10, "Select to TAP"); 155 if(display->screen_type==SCREEN_MAIN)
751 rb->lcd_puts(0, 12, "Rec to SYNC"); 156 {
752#endif 157 display->puts(0, 5, "Select to TAP");
158 display->puts(0, 6, "Rec to SYNC");
159 }
753#ifdef HAVE_REMOTE_LCD 160#ifdef HAVE_REMOTE_LCD
754 rb->lcd_remote_putsxy(1, 1, "Metronome"); 161 else
755 rb->lcd_remote_putsxy(1, 42, "Rec to TAP"); 162 {
756 rb->lcd_remote_putsxy(1, 52, "Mode to SYNC"); 163 display->puts(0, 5, "Rec to TAP");
164 display->puts(0, 6, "Mode to SYNC");
165 }
166#endif
757#endif 167#endif
758 168
759 rb->snprintf(buffer, sizeof(buffer), "BPM: %d ",bpm); 169 rb->snprintf(buffer, sizeof(buffer), "BPM: %d ",bpm);
760#ifdef HAVE_LCD_BITMAP 170#ifdef HAVE_LCD_BITMAP
761 rb->lcd_puts(0,7, buffer); 171 display->puts(0,3, buffer);
762#else 172#else
763 rb->lcd_puts(0,0, buffer); 173 display->puts(0,0, buffer);
764#endif
765#ifdef HAVE_REMOTE_LCD
766 rb->lcd_remote_putsxy(1, 32, buffer);
767#endif 174#endif
768 175
769 rb->snprintf(buffer, sizeof(buffer), "Vol: %d", 176 rb->snprintf(buffer, sizeof(buffer), "Vol: %d",
770 rb->global_settings->volume); 177 rb->global_settings->volume);
771#ifdef HAVE_LCD_BITMAP 178#ifdef HAVE_LCD_BITMAP
772 rb->lcd_puts(10, 7, buffer); 179 display->puts(10, 3, buffer);
773#else 180#else
774 rb->lcd_puts(0,1, buffer); 181 rb->lcd_puts(0,1, buffer);
775#endif 182#endif
776#ifdef HAVE_REMOTE_LCD
777 rb->lcd_remote_putsxy(60, 32, buffer);
778#endif
779 183
780#ifdef HAVE_LCD_BITMAP 184#ifdef HAVE_LCD_BITMAP
781 rb->lcd_drawline(0, 12, 111, 12); 185 display->drawline(0, 12, 111, 12);
782 if(sound_paused) 186 if(sound_paused)
783 rb->lcd_puts(0,2,METRONOME_MSG_START); 187 display->puts(0,2,METRONOME_MSG_START);
784 else 188 else
785 rb->lcd_puts(0,2,METRONOME_MSG_STOP); 189 display->puts(0,2,METRONOME_MSG_STOP);
786#endif
787 rb->lcd_update();
788#ifdef HAVE_REMOTE_LCD
789 rb->lcd_remote_drawline(0, 12, 111, 12);
790 if(sound_paused)
791 rb->lcd_remote_putsxy(1,20,METRONOME_MSG_START);
792 else
793 rb->lcd_remote_putsxy(1,20,METRONOME_MSG_STOP);
794 rb->lcd_remote_update();
795#endif 190#endif
191 display->update();
796} 192}
797 193
194void draw_display()
195{
196 int i;
197 FOR_NB_SCREENS(i)
198 metronome_draw(rb->screens[i]);
199}
798/* helper function to change the volume by a certain amount, +/- 200/* helper function to change the volume by a certain amount, +/-
799 ripped from video.c */ 201 ripped from video.c */
800void change_volume(int delta){ 202void change_volume(int delta){
@@ -860,7 +262,7 @@ void cleanup(void *parameter)
860 262
861 rb->timer_unregister(); 263 rb->timer_unregister();
862 MET_PLAY_STOP; /* stop audio ISR */ 264 MET_PLAY_STOP; /* stop audio ISR */
863 led(0); 265 rb->led(0);
864} 266}
865 267
866void tap(void) 268void tap(void)
diff --git a/apps/plugins/metronome.h b/apps/plugins/metronome.h
new file mode 100644
index 0000000000..eece96c053
--- /dev/null
+++ b/apps/plugins/metronome.h
@@ -0,0 +1,605 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: metronome.c 13628 2007-06-14 15:07:54Z nls $
9 *
10 * Copyright (C) 2004 Matthias Wientapper
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "plugin.h"
21
22#if CONFIG_CODEC != SWCODEC
23/* tick sound from a metronome */
24static unsigned char sound[] = {
25255,251, 80,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
26 0, 73,110,102,111, 0, 0, 0, 15, 0, 0, 0, 4, 0, 0, 4, 19, 0, 64, 64,
27 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
28 64, 64, 64,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
29128,128,128,128,128,128,128,128,192,192,192,192,192,192,192,192,192,192,192,192,
30192,192,192,192,192,192,192,192,192,192,192,192,192,255,255,255,255,255,255,255,
31255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0,
32 58, 76, 65, 77, 69, 51, 46, 57, 50, 32, 1,137, 0, 0, 0, 0, 0, 0, 0, 0,
33 2, 64, 36, 5,191, 65, 0, 0, 0, 0, 0, 4, 19,168,187,153, 93, 0, 0, 0,
34 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
35 0, 0, 0, 0, 0, 0, 0, 0,255,251, 80,196, 0, 0, 10, 81, 57, 65,184,120,
36128, 1, 95,159,239,191,144, 96, 0, 0,128, 0, 0, 0, 0, 0, 0, 48, 24, 12,
37 0, 0, 15,175,185,222, 39, 7,126, 46, 50,191,243,197,255,247, 62, 92,111,252,
38115, 15, 27,140,153,159,247,242,124, 44, 92,164,177, 57,175,255,236, 79,164, 98,
39 68,205, 69,160, 64, 15,251,127,128,168, 38, 92,138, 17, 67,196, 80,184,223,255,
40255,161,117, 33, 55, 83,191,255,193,240, 33, 57,114, 17, 0, 2, 0, 0, 0, 10,
41191, 10, 8,196,209, 75, 55,236,177,115,238,223,203, 61,176, 89, 78,101,219,118,
42118, 65,154,126,187,239,241,127,247,245, 59, 18,219, 94,105,245,221,161,173, 91,
43191, 27,255,247, 18,124, 71,117,139,133,170,221,227,251,135,110,236,255,183,219,
44100, 78,184,125,212,131, 65, 95,212,245,145, 67, 77, 10,153,250,132,195, 4,138,
45224, 0, 0, 0,158,107, 42, 65,227,185, 90,158, 86, 6,155, 77,255,251, 82,196,
46 8, 0, 10,136,185,103, 4, 61, 48, 65,118,173, 44, 60,147, 10,152,107, 49, 74,
47 18,208, 91, 23,178,196,220, 25, 64,233,230, 36,170, 0,210,219,131, 40,165, 22,
48 86,195, 23,145, 33, 16,138, 99,109,117,245, 71,162, 69, 42,220,164, 91, 72,165,
49 26, 69,146,150,199,222, 73,102,148, 29, 19, 5, 65, 86, 6,150,120,180, 26, 88,
50 75, 18,191,255,250,171, 4, 8,132,140, 0, 0, 20,186,242,162, 66,100, 62, 86,
51206, 86,255, 26,203,201,255,255,141,128,166,196,175,133, 9, 70,188,146,175,133,
52 60, 17,217,229, 90, 27, 87, 93, 34, 76,113,185, 84,213, 56, 17,170, 83, 75,180,
53203,116,101, 93, 90, 99, 35,174,230, 42,125, 12,128, 79, 93, 81,234, 67, 66,137,
54105,157,157, 23, 71, 53, 40,250,204,105, 89,203,107,250, 63,174, 89,133, 81,140,
55 0, 52, 17, 16, 0, 0, 18,111, 20, 92, 32,213, 48,179, 50, 26,244,179, 27,230,
56154, 34,133,177, 88,255,251, 82,196, 13, 0, 10,125, 65, 85,244, 85, 0, 1,210,
57172,231, 7, 31, 32, 0, 37, 11, 68, 69, 13, 37, 48,210, 23, 69, 36,122,143,148,
58211,141, 44, 76,135, 72,148,195,135,174, 84,149,167, 30,198,183,255,213,111, 61,
59 27,155,191,177,207,246,163,255,230, 30,137,219,255,182,186,185,239, 52,148,171,
60 75, 63,167, 44, 0, 2, 81,190, 41,253,248,182,180, 23, 43,127,217,161, 41,191,
61 36,199, 40,153,108, 66,224,131,192,217, 12, 67,217, 6,218,240,108,112, 63, 33,
62 93, 12, 8, 43, 66, 42, 74, 12,215,135,100,172, 33, 65,172, 29, 98, 4, 83, 34,
63 40, 17,111,133,255, 18,145, 60, 59,136,145, 92,106,144, 34,185, 58, 76,154,254,
64146,144,115, 4, 84,180,142,178, 38, 79,253, 34,237,105, 31,106, 70, 73, 36,138,
65 73,164,181,127,253,182, 82,217, 26,245,117,163,255,219, 50,115,223,245, 92,198,
66165,173, 0, 15,249,132, 50, 19,157, 85,121,153,245, 51,255,251, 82,196, 6,131,
67 74, 96,134,156, 92, 19, 0, 8, 0, 0, 52,128, 0, 0, 0, 60,226, 73, 57, 26,
68249,253,122,211,128, 65, 86, 10, 1, 9,195,128, 36, 72,225,196,146,115, 73, 18,
69 75, 65, 77, 9, 5,200, 43, 16,163,129, 77, 9, 5,200,110, 39,127,255,255,255,
70255,255,255,255,252, 83, 66,142,140, 21,136, 46, 64,166,133, 28, 12, 21,136, 46,
71 64,166,133, 21, 6, 76, 65, 77, 69, 51, 46, 57, 50, 85, 85, 85, 85, 85, 85, 85,
72 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
73 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
74 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
75 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
76 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
77 85, 85, 85};
78#else
79static signed short sound[] = {
80 1, -1, 1, -1, 0, 0, 0, 1, -1, 0, 0,
81 0, -1, 2, -2, 2, -1, 0, 0, 0, 0, 1,
82 -1, 0, -1, 1, 0, 0, 0, 1, -1, 1, -2,
83 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
84 0, 0, -1, 2, -2, 2, -1, 0, 1, -1, 1,
85 -1, 0, 0, 0, 0, 1, -2, 2, -2, 1, 0,
86 1, -1, 0, 1, -1, 0, 1, -2, 2, -1, 0,
87 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0,
88 0, -1, 1, -1, 2, -2, 2, -2, 2, -2, 1,
89 0, 0, 0, 1, -2, 2, -2, 1, 0, 0, 0,
90 0, 0, 0, -1, 1, 0, -1, 2, -2, 2, -1,
91 0, 0, 0, -1, 1, -1, 1, -1, 2, -2, 1,
92 0, -1, 2, -2, 2, -2, 1, 0, 0, 0, 0,
93 0, 0, 0, 0, 1, -1, 0, 0, -1, 1, 0,
94 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0,
95 1, -2, 2, -1, 0, 0, 0, 0, 0, 1, -2,
96 1, 0, 0, 0, 0, 0, 1, -1, 0, 0, -1,
97 2, -2, 2, -2, 2, -1, 0, 0, -1, 1, -1,
98 1, -1, 1, -1, 1, -1, 1, 0, 0, -1, 2,
99 -2, 1, 0, 0, 0, 0, 0, 1, -1, 0, 0,
100 -1, 1, 0, 0, 0, 0, 0, 0, 1, -2, 2,
101 -2, 2, -1, 1, -1, 1, -2, 2, -2, 2, -2,
102 2, -2, 2, -2, 2, -1, 0, 0, 0, -1, 2,
103 -2, 2, -1, 1, -1, 1, -2, 2, -2, 1, 0,
104 1, -1, 1, -2, 1, -1, 1, 0, 0, 0, 0,
105 0, 0, 0, 0, -1, 1, 0, -1, 2, -1, 0,
106 0, -1, 1, 0, -1, 2, -2, 1, 0, 0, 0,
107 0, 0, 0, -1, 2, -1, 1, -1, 0, 0, 1,
108 -2, 2, -1, 1, -1, 0, 1, -1, 0, 0, 0,
109 0, 0, 0, -1, 1, 0, 0, 0, 0, -1, 2,
110 -2, 2, -1, 0, 1, -1, 0, 0, 0, 0, 0,
111 0, 0, 0, 1, -1, 1, -1, 0, 0, 0, 0,
112 0, 1, -1, 1, -1, 0, 1, -2, 2, -1, 0,
113 1, -2, 2, -2, 2, -2, 2, -1, 0, 1, -1,
114 0, 1, -1, 0, 0, 0, 0, 0, 0, 1, -2,
115 2, -2, 1, 0, -1, 2, -2, 1, 0, 0, 0,
116 0, -1, 1, 0, 0, 1, -1, 0, 0, 0, 0,
117 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0,
118 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1,
119 -1, 1, 0, 0, 0, 0, 0, 0, -1, 2, -1,
120 0, 0, 0, 0, 1, -1, 0, 0, 1, -2, 2,
121 -1, 0, 0, 0, 0, -1, 1, 0, 0, -1, 2,
122 -2, 1, 0, -1, 1, -1, 2, -2, 2, -2, 2,
123 -1, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0,
124 0, 0, 0, 0, 0, 0, -1, 1, 0, 1, -2,
125 2, -1, 0, 1, -1, 0, 0, 0, 0, 0, 0,
126 -1, 2, -2, 2, -2, 2, -1, 0, 0, 0, -1,
127 1, 0, -1, 1, 0, 0, 0, 0, 0, 0, 1,
128 -1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0,
129 1, -2, 2, -2, 1, 0, 0, 0, 0, 0, 0,
130 0, 1, -1, 0, 1, -1, 1, -1, 0, -1, 2,
131 -1, 0, 0, 0, -1, 1, -1, 1, 0, 1, -1,
132 1, -2, 1, 0, 0, 1, -2, 2, -2, 2, -2,
133 2, -2, 2, -1, 0, 0, 0, 0, 0, -1, 2,
134 -2, 2, -1, 0, 0, 0, 1, -1, 0, 0, 0,
135 0, -1, 1, -1, 1, 0, 0, 0, 1, -2, 1,
136 0, -1, 2, -2, 1, -1, 0, 2, -2, 2, 0,
137 -1, 0, 0, 0, -1, 2, -2, 2, -2, 2, -2,
138 2, -1, 0, 1, -2, 2, -1, 0, 0, 0, 0,
139 1, -1, 0, 0, 0, 0, 0, 0, 0, 1, -2,
140 1, 0, 0, 0, 0, 0, 0, -1, 1, -1, 1,
141 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1,
142 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
143 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, -1,
144 2, -2, 1, 0, 0, 0, 0, 0, -1, 2, -2,
145 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
146 0, 0, 0, -1, 2, -1, 0, 0, -1, 1, 0,
147 0, 0, 0, 0, 1, -1, 0, 0, -1, 1, 0,
148 0, 0, 0, -1, 1, 0, -1, 2, -1, 0, 0,
149 0, 1, -2, 2, -1, 0, 0, 0, -1, 1, -1,
150 1, 0, 0, 0, 0, 0, 0, 1, -1, 1, -1,
151 0, 0, -1, 2, -2, 1, 0, 0, 0, 0, 0,
152 0, 0, 0, 0, 0, 0, -1, 1, -1, 1, 0,
153 -1, 2, -2, 1, 1, -1, 0, 0, -1, 1, 0,
154 0, 0, 1, -2, 2, -2, 1, 0, 1, -2, 2,
155 -1, 0, 0, 0, -1, 2, -1, 0, 0, 0, 0,
156 0, 0, 0, 0, -1, 2, -2, 2, -1, 0, 0,
157 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
158 0, 0, 0, 0, -1, 2, -2, 2, -1, 0, 1,
159 -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -2,
160 2, -1, 0, 0, 0, -1, 2, -2, 2, -2, 1,
161 0, -1, 1, 0, -1, 1, 0, 0, 0, 0, 0,
162 -1, 1, -1, 2, -2, 2, -1, 1, -1, 0, 0,
163 0, 0, 1, -1, 0, 0, 0, 0, 1, -2, 2,
164 -2, 1, 1, -1, 1, -1, 1, -2, 2, -2, 1,
165 -1, 2, -2, 1, 0, 0, 0, 0, 0, -1, 2,
166 -2, 2, -1, -1, 1, -1, 1, -1, 2, -2, 2,
167 -1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 0,
168 0, 1, -2, 1, -1, 1, -1, 1, 0, 0, 0,
169 0, 0, -1, 1, 0, 0, 0, -1, 1, 0, 0,
170 1, -2, 2, -2, 1, 0, 0, 0, 0, 0, 0,
171 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
172 0, 0, 0, 0, 1, -1, 1, -2, 1, 0, 0,
173 0, 0, 0, 0, -1, 1, 0, 0, 0, -1, 1,
174 0, 0, 0, 0, 0, 0, 1, -2, 2, -1, 0,
175 0, 0, 0, 0, 0, 1, -2, 2, -1, 1, -1,
176 0, 0, 0, 1, -1, 0, 0, -1, 2, -1, 0,
177 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
178 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
179 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 1,
180 -1, 0, 0, 0, 0, 0, 0, -1, 2, -2, 2,
181 -1, 1, -1, 0, 0, -1, 2, -1, 1, -1, 1,
182 -2, 2, -2, 2, -2, 2, -1, 0, 0, 0, 0,
183 0, 0, 0, 0, 1, -1, 0, 0, 1, -2, 2,
184 -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
185 -1, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0,
186 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
187 0, 0, 0, 0, -1, 2, -2, 2, -1, 0, 1,
188 -2, 1, 0, 0, 1, -2, 2, -2, 2, -1, -1,
189 2, -2, 1, 0, 0, 0, 1, -2, 2, -1, 0,
190 0, 0, 0, 0, 0, 0, -1, 1, -1, 2, -1,
191 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 2,
192 -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1,
193 1, 0, 0, 1, -1, 1, -1, 0, 0, -1, 2,
194 -2, 2, -1, 0, 0, 0, 1, -1, 0, 0, 0,
195 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0,
196 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0,
197 0, -1, 2, -2, 1, 0, -1, 1, 0, 0, 1,
198 -1, 0, 0, -1, 2, -2, 1, 0, -1, 2, -1,
199 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0,
200 1, -2, 2, -2, 1, 0, 0, 0, 0, -1, 1,
201 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0,
202 -1, 1, 0, 0, 0, 1, -1, 0, 0, 0, 0,
203 1, -1, 0, 1, -1, 0, -1, 1, 0, -1, 2,
204 -2, 1, 0, 0, 0, -1, 2, -2, 1, 0, 0,
205 1, -2, 2, -1, 0, 1, -1, 0, 0, 0, -1,
206 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
207 0, -1, 1, 0, -1, 2, -2, 1, 0, 0, 0,
208 0, 0, 0, 0, 0, 0, 0, 0, -1, 2, -2,
209 1, -1, 1, -1, 2, -2, 1, 0, -1, 2, -2,
210 2, -1, 0, 0, 0, -1, 1, 0, 0, 0, 1,
211 -2, 2, -2, 2, -2, 1, 0, 0, 0, 0, 1,
212 -1, 1, -1, 0, 0, 0, 0, 0, 0, 1, -1,
213 0, 0, 0, 0, 1, -1, 0, 0, 0, -1, 2,
214 -2, 2, -1, 0, 1, -2, 1, 0, 0, 0, 0,
215 0, 0, 0, 0, 0, 0, 0, 0, -1, 2, -2,
216 2, -2, 1, 0, 0, 0, 0, 0, 0, -1, 2,
217 -2, 2, -1, 0, 1, -1, 0, 0, 0, 0, 0,
218 0, 1, -1, 0, 1, -2, 1, 0, -1, 1, 0,
219 -1, 1, 0, 0, 0, 0, 1, -1, 0, 0, 0,
220 0, 0, -1, 2, -2, 2, -2, 2, -2, 1, 0,
221 0, 0, 0, 1, -2, 2, -2, 2, -1, 0, 1,
222 -2, 2, -2, 1, 0, 0, 0, 1, -1, 0, 0,
223 -1, 1, 0, 0, 0, 0, -1, 2, -2, 2, -1,
224 0, 0, 0, -1, 2, -1, 0, 1, -1, 0, 0,
225 0, 0, 1, -2, 2, -1, 0, 0, 0, 0, 0,
226 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0,
227 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0,
228 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0,
229 0, 0, 0, -1, 1, 0, 0, -1, 1, -1, 2,
230 -2, 2, -2, 2, -1, 0, 0, -1, 1, -1, 1,
231 0, -1, 2, -2, 2, -1, 0, 0, 0, 0, 0,
232 0, 0, 1, -2, 2, -2, 1, 0, 0, 0, -1,
233 2, -2, 1, 0, 1, -1, 0, 0, 1, -1, 1,
234 -2, 1, 0, 0, 0, -1, 1, -1, 2, -2, 2,
235 -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1,
236 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
237 1, -2, 2, -1, 0, 1, -2, 2, -1, 0, 0,
238 0, 0, 1, -1, 1, -1, 0, -1, 2, -2, 2,
239 -2, 2, -1, 0, 0, 0, 0, 0, 0, 0, 1,
240 -1, 0, 0, 0, -1, 2, -2, 1, 1, -2, 2,
241 -1, 0, 1, -2, 1, 0, 0, 0, 0, 1, -1,
242 0, 1, -1, 0, 0, -1, 2, -2, 2, -2, 2,
243 -2, 2, -2, 2, -2, 2, -2, 2, -1, 1, -1,
244 1, -1, 1, 0, -1, 1, -1, 1, 0, 0, -1,
245 0, 1, 0, 1, -2, 2, -2, 1, 1, -2, 1,
246 0, 0, 0, 0, 0, 0, 0, -1, 2, -1, 0,
247 0, -1, 1, 0, 0, 0, -1, 0, 1, 0, 1,
248 -2, 0, -1, 1, 0, 1, 0, -1, 0, 0, 1,
249 -1, 1, -2, 1, 1, -1, 1, -1, -1, 0, 1,
250 0, 1, -1, 0, -1, 0, 1, 1, -2, 1, -1,
251 1, 1, 0, -1, 0, 0, 1, 1, 1, -1, 0,
252 -1, 0, 1, -1, 1, -2, 2, 0, 0, 1, -2,
253 -1, 0, 0, 1, -1, 0, -1, 1, 0, 0, 0,
254 0, 0, 0, 0, -1, 1, -1, 1, 0, 2, 1,
255 -1, 0, 0, 0, 1, 1, 1, -1, 1, 1, 0,
256 1, -2, 1, -1, 2, 2, 0, -1, -1, -1, 0,
257 1, -1, 1, -1, 1, 1, 1, 1, -3, 0, 3,
258 0, 0, -4, -2, 4, 5, 4, -3, -1, 1, -3,
259 -2, -5, -6, -1, 5, 2, 1, -3, -2, -5, 1,
260 -4, -5, 3, 5, 0, 1, 2, 0, -5, -1, 3,
261 5, 2, 1, 1, 6, 5, 3, -1, 0, 2, 5,
262 10, 8, 4, 2, -5, -5, 3, 11, 8, -4, -8,
263 -2, 2, -1, -1, 5, -6, -12, -11, -5, -9, -5,
264 10, 6, 3, -4, -3, -9, -8, -18, -9, 5, 13,
265 7, 13, 29, 17, -1, -1, 15, 21, 15, -9, -29,
266 -15, 10, 10, -15, -31, -48, -49, -30, -7, -1, -8,
267 -6, 15, 39, 43, 24, 16, 27, 28, 9, -16, -6,
268 34, 60, 41, 15, 11, 26, 14, -28, -77, -83, -60,
269 -32, 1, 10, -11, -59, -83, -49, 27, 93, 82, 11,
270 -27, -8, 9, 1, 12, 22, 6, -22, -15, 4, 8,
271 -19, -23, 49, 143, 139, 39, -31, -56, -101, -145, -102,
272 -10, 20, -61, -196, -258, -136, 70, 172, 112, 43, 55,
273 75, 12, -69, -33, 89, 114, -26, -137, -14, 239, 335,
274 202, 68, 115, 231, 169, -131, -459, -540, -338, -72, 43,
275 20, -53, -174, -290, -195, 192, 593, 628, 322, 95, 159,
276 264, 163, -50, -202, -229, -114, 18, -31, -212, -264, -36,
277 432, 807, 619, -52, -483, -452, -414, -404, -98, 228, -3,
278 -760, -1444, -1414, -458, 624, 732, 35, -209, 476, 1113, 586,
279 -785, -1405, -480, 753, 881, 280, 81, 441, 753, 687, 711,
280 1440, 2140, 1110, -1470, -2963, -1770, 607, 1427, -399, -3146, -3899,
281 -2064, 28, 715, 874, 1442, 1606, 394, -1483, -2014, -354, 1531,
282 1156, -984, -2108, -821, 1635, 3003, 2087, 186, -155, 1569, 3328,
283 3463, 2110, 9, -2200, -3876, -4298, -2871, -266, 1039, -393, -2357,
284 -1809, 1079, 4019, 5685, 5742, 4435, 3098, 2963, 3181, 2018, -691,
285 -3919, -6922, -9001, -8935, -6374, -3215, -1862, -2089, -1508, 731, 3186,
286 4763, 5160, 3629, 706, -712, 739, 2391, 1570, -1015, -3502, -4979,
287 -4798, -2615, 420, 2178, 1457, -602, -1287, 741, 3741, 5018, 3687,
288 934, -757, 497, 3094, 3163, 113, -2188, -1194, 911, 998, -254,
289 484, 3643, 4907, 1023, -4718, -6191, -1911, 3621, 4508, -687, -6491,
290 -6309, -1015, 3007, 3184, 1911, 471, -1763, -4048, -4414, -2046, 1179,
291 1513, -1919, -4522, -2259, 2368, 4547, 3613, 2320, 2847, 5035, 6432,
292 4390, -835, -5857, -7419, -5497, -2768, -1012, -27, -294, -2444, -3889,
293 -1911, 942, 1212, 859, 2879, 5141, 4107, 108, -3768, -4853, -2787,
294 -162, 142, -1594, -2490, -498, 3349, 5670, 4368, 1089, -1548, -3118,
295 -3936, -3319, -1583, -547, -360, 985, 3125, 2273, -1728, -2291, 4071,
296 10390, 9283, 3620, 79, -90, 1293, 1968, -2030,-10963,-16320,-10631,
297 1236, 8206, 6740, 2418, 1132, 3007, 3504, -1371, -8877, -9321, 2657,
298 17866, 22245, 14739, 4801, -2737, -7071, -2808, 12289, 25609, 19526, -6479,
299-30563,-29780, -6434, 13879, 13263, 83, -8239, -7874, -6445, -8032, -9180,
300 -7691, -7914,-12368,-13982, -7090, -1018, -8154,-21862,-22142, -3867, 14327,
301 14436, 1712, -5853, -2462, 3311, 4605, 1731, -3832,-11191,-17673,-17400,
302 -4049, 17643, 27851, 14373, -7582,-15759, -9573, -1277, 5996, 13903, 17168,
303 11276, 1603, -4763, -7550, -7537, -2186, 6709, 10980, 6990, -1127, -9765,
304-16805,-19102,-18420,-18687,-13775, 3373, 21405, 23456, 12651, 3319, -1287,
305 -4637, -3954, 3883, 11849, 8344, -6853,-17292, -7204, 16901, 31089, 21726,
306 1084, -7875, 1459, 15092, 20527, 18496, 10594, -3296,-12835, -6081, 9842,
307 15942, 3977,-16959,-26888,-12200, 13260, 20645, 6239, -5950, -2526, 6054,
308 8073, 3123, -4656,-11949,-15611,-12153, -2236, 4314, -2887,-19936,-30928,
309-23846, -1429, 17759, 15264, -1868, -7505, 5991, 19737, 18946, 8185, -600,
310 44, 6127, 5321, -4750,-11829, -8743, -1330, 3689, 3252, -3513,-11859,
311-14753,-10198, 72, 10949, 13370, 5735, -564, 2639, 9903, 13145, 11045,
312 6754, 3123, -724, -6600,-10509, -8340, -6244,-12133,-21055,-20385, -5186,
313 15105, 23034, 11762, -3750, -5737, 2612, 6060, 33, -7014, -4975, 7697,
314 18684, 12606, -7934,-23083,-20429, -7355, 2345, 4875, 7094, 14569, 22636,
315 22509, 13749, 4800, 2246, 4805, 7497, 7404, 4042, -3207,-13334,-19292,
316-12274, 5051, 15820, 7212,-12051,-20991,-11633, 3886, 11417, 10491, 8967,
317 9849, 9995, 8305, 7497, 7731, 5549, -49, -6582,-12286,-16545,-19489,
318-22478,-23536,-16116, -123, 14039, 19014, 16964, 11024, 3746, 1174, 5696,
319 10510, 9283, 3833, -1113, -4247, -7485,-11448,-12665, -9329, -7052,-10656,
320-14627,-10081, 3317, 16454, 18316, 6990, -6264,-10409, -7182, -2463, 3812,
321 10794, 12717, 7460, 215, -2353, 676, 983, -9207,-21161,-17629, 361,
322 11731, 2863,-15895,-22726, -8619, 11663, 17157, 7331, -255, 4522, 15016,
323 20742, 18465, 12205, 6509, 836, -6050,-10016, -8310, -6482, -9596,-13628,
324-12443, -6667, -1745, -487, 633, 6363, 14319, 17428, 14246, 9598, 6752,
325 5527, 5289, 5673, 6272, 5900, 2123, -5034,-10908,-12352,-12153,-13371,
326-14974,-15335,-14089, -9874, -1589, 8285, 14571, 13761, 7383, 1668, 1519,
327 4509, 3987, -1719, -7872,-10985,-12263,-12864,-11713, -9423, -8944,-10937,
328-12477,-11078, -6884, -1052, 5798, 13303, 20195, 23473, 20387, 12863, 7217,
329 6080, 4059, -3737,-13190,-17239,-15342,-11071, -5970, -543, 4259, 7968,
330 8781, 4097, -3427, -7041, -5374, -2595, 70, 4218, 8042, 8534, 7403,
331 8758, 12712, 15141, 12739, 6198, -414, -2420, 331, 780, -7211,-18274,
332-21587,-15771, -7472, 733, 9880, 17443, 19723, 16661, 10520, 4467, 1343,
333 308, -1550, -3368, -1921, 1564, 1426, -5086,-13434,-16483,-12675, -6499,
334 -2040, -586, -2374, -5424, -5786, -2131, 3305, 7892, 9432, 7024, 3000,
335 410, -274, 396, 1514, 785, -2873, -7609,-11931,-15458,-16897,-15275,
336-10823, -3469, 5396, 11785, 13505, 11686, 7478, 2801, 1972, 6978, 13591,
337 14815, 7016, -6127,-15851,-17122,-13183, -9425, -7273, -5029, -1087, 3485,
338 5516, 4834, 5156, 7648, 9472, 9387, 8481, 7313, 6847, 7922, 8488,
339 6309, 2375, -1821, -6179, -9633,-10798,-10521,-10565,-11165,-11055, -8661,
340 -3781, 1960, 6819, 9680, 9920, 8944, 9396, 10975, 10715, 7182, 861,
341 -7005,-13267,-15283,-15034,-15703,-15867,-12193, -5329, 829, 3996, 5377,
342 7152, 9312, 10386, 10275, 10167, 10500, 10694, 9601, 6318, 2012, -1381,
343 -4917,-10834,-17053,-18962,-15907,-11261, -7518, -4754, -2399, -32, 2969,
344 6930, 10871, 13043, 13087, 12045, 10546, 9003, 8103, 6739, 2241, -5153,
345-11768,-15213,-15636,-13473, -9655, -6045, -3220, -430, 2055, 3835, 6558,
346 11429, 15904, 16225, 12337, 7477, 3631, -122, -4854, -9898,-13734,-15118,
347-13861,-11287, -8854, -6458, -3768, -1724, -385, 2105, 5993, 8742, 9121,
348 8765, 8415, 6764, 3536, 104, -2912, -5635, -7580, -8217, -7502, -5362,
349 -2617, -1366, -2262, -3363, -3163, -2137, -589, 1870, 4595, 6301, 6764,
350 6718, 6520, 5842, 4638, 3882, 4279, 4700, 3357, 183, -2935, -3952,
351 -2906, -2493, -4469, -6460, -5616, -2932, -231, 3057, 6959, 9364, 9069,
352 6831, 4078, 2556, 2602, 2068, -153, -1834, -1310, -248, -795, -2717,
353 -4126, -3995, -3695, -4963, -6850, -7066, -5258, -2772, -846, 139, 1073,
354 2821, 4490, 5430, 6971, 8941, 8259, 3626, -2713, -8358,-12049,-13228,
355-12856,-12123,-10333, -7012, -3862, -1844, 527, 4263, 8105, 10304, 10453,
356 9346, 7786, 5793, 3181, 40, -3553, -7164, -9520, -9740, -8339, -6135,
357 -3335, 16, 3345, 5455, 5356, 3793, 2943, 3715, 4965, 5638, 6024,
358 6657, 7270, 6829, 4385, 593, -2392, -3644, -4633, -6185, -6575, -4682,
359 -2249, -1081, -648, 222, 1873, 4273, 6609, 7328, 6269, 5017, 4332,
360 3500, 2200, 704, -1135, -3367, -5373, -6705, -7346, -7055, -5618, -3596,
361 -1716, 117, 2133, 3576, 3514, 2437, 1568, 1147, 588, -490, -1976,
362 -3125, -2983, -1979, -1775, -2637, -2993, -2327, -2013, -2843, -4077, -4841,
363 -4778, -3915, -2756, -1663, -78, 2401, 4777, 5910, 6074, 5858, 4886,
364 2889, 688, -970, -2010, -2413, -2357, -2511, -3033, -3218, -2983, -2783,
365 -2022, 315, 3490, 5687, 6228, 5642, 4405, 3006, 2065, 1656, 1592,
366 2141, 3191, 3485, 2147, -131, -2437, -4663, -6289, -6118, -3991, -1098,
367 1550, 3446, 4204, 4186, 4379, 4801, 4654, 3956, 3267, 2297, 512,
368 -1660, -3571, -5057, -5713, -5051, -3695, -2719, -2075, -1180, -306, 43,
369 201, 527, 896, 1415, 2085, 2103, 1018, -171, -613, -825, -1316,
370 -1701, -1787, -1766, -1462, -922, -997, -1987, -2857, -2699, -1736, -514,
371 484, 696, 221, 24, 316, 48, -973, -1304, -49, 1921, 3426,
372 4026, 3875, 3529, 3327, 2659, 1002, -723, -1568, -2055, -2862, -3247,
373 -2368, -873, 62, 184, 58, 315, 1196, 2204, 2563, 2494, 2945,
374 3730, 3479, 1991, 500, -527, -1710, -3069, -4146, -4921, -5126, -4168,
375 -2410, -881, 287, 1399, 2210, 2737, 3559, 4435, 4390, 3402, 2338,
376 1278, -271, -1954, -2896, -3007, -2752, -2482, -2724, -3874, -5145, -5390,
377 -4613, -3122, -402, 3217, 5859, 6536, 6136, 5381, 4239, 3021, 1905,
378 465, -1127, -2074, -2588, -3532, -4652, -5131, -4876, -4054, -2586, -848,
379 525, 1727, 3291, 4715, 5094, 4595, 3990, 3426, 2642, 1618, 196,
380 -1676, -3238, -3809, -3789, -3482, -2326, -697, -239, -1207, -1820, -939,
381 863, 2740, 4260, 5221, 5856, 6299, 5671, 3229, -23, -2465, -3892,
382 -4948, -5454, -5047, -4443, -4355, -4055, -2592, -469, 1194, 2038, 2285,
383 2563, 3653, 5162, 5484, 4235, 2697, 1473, 27, -1754, -3674, -5673,
384 -6983, -6577, -4808, -2747, -690, 1257, 2527, 3071, 3338, 3313, 2895,
385 2726, 3203, 3522, 2793, 1295, -325, -2074, -3850, -4855, -4744, -4000,
386 -2801, -1095, 473, 1418, 2150, 2712, 2651, 2407, 2619, 2775, 2513,
387 2523, 2737, 2113, 659, -598, -1376, -2019, -2413, -2377, -2143, -1792,
388 -1119, -403, -404, -963, -894, 215, 1579, 2770, 3868, 4081, 2660,
389 398, -1501, -2862, -3573, -3200, -2109, -1097, -276, 295, 45, -1024,
390 -1953, -2120, -1736, -971, 274, 1597, 2369, 2667, 2840, 2417, 947,
391 -823, -1912, -2224, -1940, -1203, -452, 127, 811, 1272, 788, -366,
392 -1342, -1806, -1746, -1161, -266, 928, 2469, 3661, 3707, 2956, 2179,
393 1379, 340, -690, -1418, -1852, -2028, -1928, -1591, -1202, -864, -267,
394 806, 1949, 2658, 2868, 2653, 2202, 1866, 1534, 768, -230, -1027,
395 -1800, -2455, -2301, -1394, -707, -605, -610, -403, -39, 282, 371,
396 423, 917, 1881, 2543, 1980, 235, -1335, -1767, -1786, -2298, -2787,
397 -2689, -2421, -2133, -1460, -694, -214, 424, 1435, 2307, 2819, 3041,
398 2652, 1573, 324, -754, -1729, -2520, -2956, -2933, -2321, -1260, -306,
399 165, 305, 416, 646, 985, 1362, 1745, 2076, 2245, 2234, 1930,
400 1150, -10, -1337, -2785, -3969, -4138, -3350, -2371, -1256, 303, 1810,
401 2722, 3265, 3605, 3559, 3246, 2772, 1942, 766, -553, -1923, -2939,
402 -3124, -2592, -1721, -657, 340, 1033, 1514, 1616, 1076, 417, 322,
403 591, 787, 929, 1058, 1046, 827, 255, -548, -1069, -1232, -1508,
404 -1928, -2066, -1828, -1384, -836, -313, 165, 570, 710, 593, 549,
405 566, 338, -42, -215, -86, 93, -71, -692, -1242, -1361, -1405,
406 -1612, -1705, -1546, -1012, 64, 1202, 1774, 2110, 2444, 2028, 747,
407 -280, -586, -712, -687, -214, 222, 21, -651, -1402, -2075, -2301,
408 -1607, -374, 420, 528, 623, 906, 895, 646, 748, 1155, 1401,
409 1471, 1569, 1443, 829, -102, -1009, -1730, -2195, -2295, -1957, -1121,
410 235, 1663, 2296, 1932, 1429, 1359, 1289, 1045, 1074, 1308, 1229,
411 771, 13, -1126, -2275, -2863, -2931, -2658, -1849, -660, 316, 931,
412 1418, 1586, 1154, 592, 633, 1166, 1428, 1169, 759, 275, -489,
413 -1425, -2208, -2714, -2705, -2029, -1090, -367, 236, 886, 1413, 1728,
414 1903, 1867, 1576, 1097, 393, -463, -1157, -1465, -1417, -1112, -615,
415 82, 923, 1390, 889, -291, -1250, -1686, -1756, -1338, -411, 577,
416 1291, 1751, 1854, 1480, 897, 393, -43, -439, -733, -924, -979,
417 -751, -354, -58, 122, 314, 418, 311, 171, 225, 428, 678,
418 1000, 1304, 1263, 748, 37, -586, -1042, -1237, -1070, -664, -243,
419 97, 262, 167, -128, -402, -445, -184, 202, 446, 534, 519,
420 323, -11, -258, -385, -468, -463, -350, -191, -36, -2, -163,
421 -207, 82, 406, 588, 861, 1087, 900, 461, 73, -396, -872,
422 -917, -514, -44, 332, 667, 771, 490, -59, -620, -1123, -1495,
423 -1448, -811, 63, 751, 1214, 1446, 1336, 1005, 611, 60, -531,
424 -828, -837, -740, -478, -139, -25, -63, 30, 245, 481, 790,
425 1033, 1002, 750, 462, 140, -197, -433, -516, -516, -578, -715,
426 -818, -821, -742, -548, -228, 77, 233, 247, 183, 100, 60,
427 91, 155, 208, 257, 275, 154, -136, -387, -429, -428, -486,
428 -396, -72, 259, 435, 450, 397, 400, 373, 153, -57, 23,
429 181, 231, 390, 496, 87, -627, -1036, -1047, -785, -216, 465,
430 823, 761, 501, 269, 197, 282, 395, 502, 597, 684, 687,
431 440, -91, -581, -803, -853, -677, -155, 367, 520, 472, 351,
432 -35, -523, -708, -585, -312, 103, 471, 530, 378, 226, 51,
433 -164, -377, -542, -582, -404, -134, 42, 91, 4, -205, -400,
434 -488, -528, -548, -453, -157, 305, 794, 1106, 1134, 866, 307,
435 -368, -839, -979, -916, -721, -436, -226, -164, -84, 26, 32,
436 27, 249, 614, 889, 1016, 1036, 931, 663, 248, -235, -632,
437 -864, -967, -997, -965, -800, -394, 150, 614, 919, 1096, 1049,
438 791, 514, 271, 19, -107, -93, -145, -295, -384, -365, -257,
439 -96, -26, -115, -232, -332, -437, -400, -167, 106, 387, 655,
440 726, 536, 231, -134, -519, -793, -961, -1068, -1019, -800, -555,
441 -275, 62, 333, 543, 777, 937, 940, 888, 784, 519, 133,
442 -278, -630, -849, -905, -836, -598, -266, -41, 129, 370, 501,
443 401, 294, 265, 159, 100, 253, 410, 336, 166, 11, -162,
444 -313, -295, -159, -70, -82, -123, -159, -195, -141, 128, 547,
445 900, 1123, 1218, 1047, 565, -14, -513, -944, -1193, -1088, -735,
446 -411, -189, -17, 62, 33, 33, 114, 218, 335, 449, 434,
447 244, -53, -414, -720, -786, -594, -314, -119, -107, -289, -515,
448 -670, -755, -661, -218, 419, 945, 1257, 1343, 1140, 688, 146,
449 -364, -747, -941, -997, -923, -669, -334, -74, 97, 267, 439,
450 594, 715, 741, 715, 739, 823, 817, 615, 225, -241, -642,
451 -911, -1033, -958, -683, -356, -53, 232, 432, 478, 491, 616,
452 782, 862, 863, 794, 586, 230, -181, -534, -750, -738, -528,
453 -311, -238, -262, -256, -227, -207, -107, 83, 179, 121, 79,
454 115, 135, 168, 205, 147, 48, 78, 104, -77, -367, -617,
455 -883, -1084, -1016, -718, -373, -15, 361, 660, 801, 781, 677,
456 554, 320, -73, -437, -617, -681, -645, -434, -130, 113, 293,
457 396, 325, 127, -74, -166, -76, 183, 416, 509, 518, 451,
458 293, 114, -37, -135, -139, -66, 9, 69, 133, 172, 213,
459 302, 407, 464, 465, 362, 169, -59, -340, -635, -779, -688,
460 -447, -84, 362, 661, 681, 514, 221, -144, -386, -357, -167,
461 107, 375, 463, 237, -179, -650, -1045, -1222, -1130, -842, -392,
462 138, 538, 675, 607, 418, 190, 41, -18, -35, -35, -32,
463 -96, -207, -325, -456, -537, -470, -334, -214, -45, 183, 298,
464 318, 354, 397, 377, 383, 478, 558, 567, 484, 302, 21,
465 -283, -518, -634, -630, -538, -323, -11, 257, 390, 440, 384,
466 210, 120, 251, 418, 464, 415, 286, 41, -216, -388, -514,
467 -519, -335, -65, 96, 139, 108, -19, -217, -360, -319, -84,
468 209, 472, 622, 599, 404, 185, 16, -167, -362, -491, -580,
469 -659, -617, -457, -316, -190, 29, 245, 336, 321, 250, 116,
470 2, -41, -39, 27, 143, 200, 119, -28, -153, -219, -211,
471 -152, -101, -31, 29, 24, -42, -109, -150, -121, -8, 81,
472 114, 185, 282, 308, 280, 243, 149, 11, -54, -87, -184,
473 -283, -303, -254, -123, 83, 232, 239, 165, 62, -49, -140,
474 -173, -148, -67, 24, 67, 84, 92, 54, -41, -121, -154,
475 -114, -23, 33, -42, -166, -268, -347, -412, -399, -276, -56,
476 203, 449, 635, 747, 724, 565, 367, 166, -64, -263, -360,
477 -406, -447, -446, -403, -362, -295, -156, -16, 98, 230, 381,
478 493, 512, 456, 390, 345, 296, 223, 156, 56, -121, -320,
479 -500, -665, -754, -680, -487, -234, 79, 378, 518, 528, 469,
480 319, 127, 35, 48, 65, 106, 170, 121, -91, -334, -506,
481 -625, -686, -636, -473, -258, -40, 168, 349, 443, 477, 509,
482 514, 432, 311, 186, -4, -269, -460, -541, -600, -629, -558,
483 -432, -326, -227, -105, 34, 209, 394, 534, 582, 577, 524,
484 403, 246, 118, 23, -71, -157, -166, -96, -30, -27, -54,
485 -75, -74, -38, -12, -25, -9, 103, 245, 354, 449, 504,
486 459, 321, 148, -52, -248, -357, -383, -369, -327, -281, -274,
487 -281, -215, -56, 146, 351, 547, 692, 699, 525, 253, 5,
488 -185, -301, -328, -280, -255, -260, -282, -372, -505, -535, -391,
489 -184, 26, 233, 392, 410, 313, 173, 39, -67, -108, -93,
490 -70, -85, -151, -261, -381, -475, -495, -443, -313, -91, 211,
491 503, 688, 732, 648, 464, 220, -12, -159, -211, -226, -273,
492 -324, -329, -267, -147, -8, 120, 253, 422, 558, 570, 491,
493 394, 269, 115, 6, -26, -46, -102, -183, -263, -295, -279,
494 -200, -55, 104, 181, 191, 229, 264, 234, 170, 120, 23,
495 -99, -169, -217, -323, -368, -285, -173, -113, -33, 59, 81,
496 15, -85, -169, -191, -127, 0, 127, 178, 111, -6, -94,
497 -130, -110, -20, 82, 87, 38, 1, -73, -175, -203, -108,
498 24, 142, 243, 255, 154, 20, -64, -99, -88, -26, 73,
499 178, 230, 191, 70, -70, -165, -187, -142, -52, 49, 163,
500 267, 320, 304, 230, 146, 70, 6, -38, -84, -144, -224,
501 -289, -349, -368, -291, -88, 163, 372, 491, 466, 307, 89,
502 -105, -254, -332, -311, -217, -111, -19, -4, -66, -132, -161,
503 -159, -125, -50, -13, -36, -42, 14, 105, 212, 311, 353,
504 331, 264, 120, -101, -320, -487, -564, -501, -331, -168, -22,
505 130, 249, 281, 288, 283, 239, 225, 267, 268, 198, 126,
506 28, -139, -302, -389, -442, -438, -302, -96, 102, 291, 438,
507 476, 423, 334, 223, 106, 14, -82, -191, -290, -397, -494,
508 -518, -425, -238, -23, 164, 270, 324, 355, 319, 215, 89,
509 -27, -147, -236, -288, -347, -395, -360, -243, -125, -43, 25,
510 75, 85, 82, 119, 160, 166, 148, 130, 82, 8, -29,
511 -63, -124, -173, -166, -121, -63, 16, 87, 163, 235, 250,
512 217, 191, 187, 142, 76, 12, -71, -137, -169, -189, -183,
513 -106, 8, 87, 134, 154, 99, 45, 84, 178, 241, 277,
514 270, 209, 125, 50, -62, -190, -254, -235, -179, -106, -18,
515 33, 46, 32, 9, -22, -35, -13, 22, 64, 78, 29,
516 -63, -133, -169, -189, -166, -121, -98, -67, -3, 15, 5,
517 44, 100, 108, 108, 114, 64, -46, -141, -245, -316, -233,
518 -59, 21, -10, -20, -6, -7, -6, 7, -3, -2, 9,
519 -2, -25, -17, -1, 1, -8, -1, -5, -11, -13, -10,
520 -14, -12, -3, 11, 6, 2, 1, -9, -13, 0, 11,
521 12, 16, 17, 9, -4, -9, -13, -11, 1, 7, 2,
522 13, 13, -3, 0, 10, 9, 3, 6, 4, -4, -9,
523 -7, -2, 6, 5, -14, -19, -9, -11, -10, -5, -16,
524 -22, -4, 17, 16, 1, -14, -17, -6, 6, 3, -2,
525 -5, -10, -11, -1, -2, -12, -12, -4, 9, 14, 15,
526 6, 9, 13, 7, -6, -5, 5, 3, -6, -10, -14,
527 -11, -4, 4, 3, -1, 3, -1, -12, -13, 2, 9,
528 -1, -7, -1, 1, 1, 12, 7, 2, -1, 3, 3,
529 7, 7, 3, -1, 4, 8, 3, 6, 6, 2, -3,
530 -2, -5, -6, 1, -2, -6, -9, -10, -7, -5, 3,
531 -4, -10, -7, 5, 7, 1, 0, 0, -8, -7, -5,
532 -1, 2, 4, 6, -1, -2, 5, 5, 0, -1, 0,
533 1, -8, -8, -12, -9, -4, -2, -3, -4, -1, 2,
534 3, 3, -3, -4, -5, 3, 6, -1, -5, -14, -13,
535 -12, -13, -11, 0, 9, 13, 10, 9, 7, 1, 1,
536 -2, 1, 3, 3, 2, 0, -2, 0, 0, 3, 1,
537 4, 2, 4, 0, 1, -1, -1, -1, 0, -2, -2,
538 -1, -2, 2, -1, 1, 0, 1, 2, 2, 1, 1,
539 1, 0, -1, -1, 0, -1, 1, -2, 2, 0, 1,
540 0, -1, -1, -1, 1, 0, 0, -1, -2, -2, -1,
541 -2, -1, 2, 1, 3, 0, 3, 0, -1, 1, -1,
542 1, 0, 1, 0, -1, 1, -2, 2, -1, 1, 0,
543 1, 0, 0, 0, 0, 0, -1, 1, -2, 1, -1,
544 1, 0, 0, 0, 0, 0, 0, 1, -1, 1, 0,
545 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -1,
546 0, 0, 1, 0, 0, 0, -1, 0, -1, 1, -1,
547 1, 0, -1, 2, -1, 1, -1, 1, -1, 0, 1,
548 -1, 0, 1, -1, 2, -2, 1, -1, 1, -1, 0,
549 1, -1, 1, 0, -1, 1, 0, -1, 1, -1, 0,
550 1, -1, 1, 0, -1, 1, -1, 0, 0, 1, -1,
551 1, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1,
552 -1, 1, -1, 0, 1, -1, 1, -1, 1, -2, 2,
553 -1, 0, 1, -1, 0, 1, -1, 1, 0, 0, 0,
554 0, 0, 0, -1, 1, -1, 1, -1, 1, -1, 1,
555 -1, 1, -1, 0, 1, -2, 2, -1, 0, 0, 1,
556 -1, 1, 0, -1, 0, 0, 1, -2, 2, -1, 0,
557 1, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1,
558 1, -1, 0, 1, -1, 1, 0, -1, 0, 0, 1,
559 -1, 0, 0, 1, -1, 0, 0, 0, 1, -1, 1,
560 -1, 0, 1, -1, 1, -1, 0, 0, 0, 1, -1,
561 1, -1, 1, -1, 1, 0, 0, 0, -1, 0, 1,
562 -1, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1,
563 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1,
564 -1, 0, 1, -1, 1, 0, -1, 1, 0, -1, 1,
565 -1, 1, -1, 1, -1, 1, -1, 0, 1, -2, 2,
566 0, -1, 1, -1, 1, -1, 1, 0, -1, 1, -1,
567 0, 1, -2, 2, -1, 1, 0, 0, 0, -1, 1,
568 -1, 1, -1, 0, 0, 0, 1, -1, 1, 0, -1,
569 1, -1, 0, 1, -1, 1, -1, 1, -1, 0, 1,
570 -1, 1, -1, 0, 0, 1, -1, 1, -1, 0, 1,
571 -2, 2, -1, 0, 1, -2, 2, 0, 0, 0, -1,
572 1, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1,
573 0, 1, -1, 1, -1, 0, 0, 1, -1, 1, -2,
574 2, -2, 3, -3, 3, -2, 0, 1, -1, 0, 0,
575 1, -1, 1, -1, 0, 1, -1, 0, 0, 0, 1,
576 -1, 0, 1, -1, 1, -1, 0, 0, 0, 1, -1,
577 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, -1,
578 1, -1, 1, 0, -1, 1, 0, -1, 1, -1, 0,
579 1, -1, 1, -1, 1, 0, -1, 1, -1, 0, 1,
580 -1, 1, 0, 0, 0, -1, 1, -1, 0, 0, 0,
581 0, 1, -1, 1, 0, -1, 0, 1, -1, 0, 1,
582 -1, 1, -1, 1, -1, 0, 1, -2, 2, -1, 0,
583 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 1,
584 -1, 0, 1, -1, 1, -1, 1, 0, 0, -1, 1,
585 -1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1,
586 -1, 0, 1, -1, 1, -1, 1, -1, 0, 1, -1,
587 0, 1, -1, 1, 0, -1, 1, -1, 0, 1, -2,
588 2, -1, 0, 0, 0, 1, -1, 1, -1, 1, 0,
589 -1, 1, -1, 0, 1, -2, 2, -1, 0, 0, 0,
590 1, -1, 0, 0, 1, -1, 1, 0, -1, 0, 1,
591 -2, 2, -1, 1, 0, -1, 0, 1, -2, 3, -2,
592 1, -1, 1, -2, 2, -2, 2, -1, 1, -1, 1,
593 -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1,
594 0, 0, 1, -1, 1, -2, 2, -1, 1, -1, 1,
595 -1, 0, 1, -2, 2, -1, 1, -1, 0, 0, 0,
596 0, 1, -1, 1, -1, 1, -2, 2, -1, 1, 0,
597 -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 0,
598 1, -1, 1, -1, 1, -1, 0, 0, 0, 1, 0,
599 -1, 1, 0, -1, 1, -2, 2, -2, 2, -1, 0,
600 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 1,
601 0, 0, -1, 1, -1, 1, -1, 1, -1, 0, 0,
602 0, 0, 1, -1, 1, 0, -1, 0, 0, 0, 1,
603 -1, 1, -1, 0, 1, -1, 0
604};
605#endif
diff --git a/firmware/export/timer.h b/firmware/export/timer.h
index 63f0567165..e9c652da73 100644
--- a/firmware/export/timer.h
+++ b/firmware/export/timer.h
@@ -23,8 +23,6 @@
23#include <stdbool.h> 23#include <stdbool.h>
24#include "config.h" 24#include "config.h"
25 25
26#ifndef SIMULATOR
27
28#if defined(CPU_PP) 26#if defined(CPU_PP)
29 /* Portalplayer chips use a microsecond timer. */ 27 /* Portalplayer chips use a microsecond timer. */
30 #define TIMER_FREQ 1000000 28 #define TIMER_FREQ 1000000
@@ -35,10 +33,11 @@
35 #define TIMER_FREQ 3000000 33 #define TIMER_FREQ 3000000
36#elif CONFIG_CPU == S3C2440 34#elif CONFIG_CPU == S3C2440
37 #include "timer-target.h" 35 #include "timer-target.h"
36#elif SIMULATOR
37 #define TIMER_FREQ 1000000
38#else 38#else
39 #define TIMER_FREQ CPU_FREQ 39 #define TIMER_FREQ CPU_FREQ
40#endif 40#endif
41
42bool timer_register(int reg_prio, void (*unregister_callback)(void), 41bool timer_register(int reg_prio, void (*unregister_callback)(void),
43 long cycles, int int_prio, void (*timer_callback)(void)); 42 long cycles, int int_prio, void (*timer_callback)(void));
44bool timer_set_period(long cycles); 43bool timer_set_period(long cycles);
@@ -51,5 +50,4 @@ void timer_unregister(void);
51extern void (*pfn_timer)(void); 50extern void (*pfn_timer)(void);
52extern void (*pfn_unregister)(void); 51extern void (*pfn_unregister)(void);
53 52
54#endif /* !SIMULATOR */
55#endif /* __TIMER_H__ */ 53#endif /* __TIMER_H__ */
diff --git a/uisimulator/sdl/SOURCES b/uisimulator/sdl/SOURCES
index e563cb984d..7971c57163 100644
--- a/uisimulator/sdl/SOURCES
+++ b/uisimulator/sdl/SOURCES
@@ -10,5 +10,6 @@ lcd-remote-bitmap.c
10#endif 10#endif
11lcd-sdl.c 11lcd-sdl.c
12sound.c 12sound.c
13timer.c
13thread-sdl.c 14thread-sdl.c
14uisdl.c 15uisdl.c
diff --git a/uisimulator/sdl/timer.c b/uisimulator/sdl/timer.c
new file mode 100644
index 0000000000..f103ab5ebd
--- /dev/null
+++ b/uisimulator/sdl/timer.c
@@ -0,0 +1,60 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id: timer.h 13806 2007-07-06 21:36:32Z jethead71 $
9*
10* Copyright (C) 2005 Kévin Ferrare
11*
12* All files in this archive are subject to the GNU General Public License.
13* See the file COPYING in the source tree root for full license agreement.
14*
15* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16* KIND, either express or implied.
17*
18****************************************************************************/
19
20#include "timer.h"
21#include <SDL_timer.h>
22
23static int timer_prio = -1;
24void (*global_timer_callback)(void);
25SDL_TimerID timerId;
26
27Uint32 SDL_timer_callback(Uint32 interval, void *param){
28 (void)param;
29 global_timer_callback();
30 return(interval);
31}
32
33#define cycles_to_miliseconds(cycles) \
34 ((int)((1000*cycles)/TIMER_FREQ))
35
36bool timer_register(int reg_prio, void (*unregister_callback)(void),
37 long cycles, int int_prio, void (*timer_callback)(void))
38{
39 (void)int_prio;/* interrupt priority not used */
40 (void)unregister_callback;
41 if (reg_prio <= timer_prio || cycles == 0)
42 return false;
43 timer_prio=reg_prio;
44 global_timer_callback=timer_callback;
45 timerId=SDL_AddTimer(cycles_to_miliseconds(cycles), SDL_timer_callback, 0);
46 return true;
47}
48
49bool timer_set_period(long cycles)
50{
51 SDL_RemoveTimer (timerId);
52 timerId=SDL_AddTimer(cycles_to_miliseconds(cycles), SDL_timer_callback, 0);
53 return true;
54}
55
56void timer_unregister(void)
57{
58 SDL_RemoveTimer (timerId);
59 timer_prio = -1;
60}