summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/puzzles/rbcompat.h13
-rw-r--r--apps/plugins/puzzles/rbwrappers.c660
-rw-r--r--apps/plugins/puzzles/src/Buildscr15
-rw-r--r--apps/plugins/puzzles/src/Makefile.doc14
-rw-r--r--apps/plugins/puzzles/src/README4
-rw-r--r--apps/plugins/puzzles/src/icons/tracks.sav2
-rw-r--r--apps/plugins/puzzles/src/loopy.c19
-rw-r--r--apps/plugins/puzzles/src/map.c2
-rw-r--r--apps/plugins/puzzles/src/midend.c2
-rw-r--r--apps/plugins/puzzles/src/misc.c17
-rw-r--r--apps/plugins/puzzles/src/net.c4
-rw-r--r--apps/plugins/puzzles/src/netslide.c4
-rw-r--r--apps/plugins/puzzles/src/puzzles.but10
-rw-r--r--apps/plugins/puzzles/src/puzzles.h4
-rw-r--r--apps/plugins/puzzles/src/range.c3
-rw-r--r--apps/plugins/puzzles/src/rect.c4
-rw-r--r--apps/plugins/puzzles/src/tracks.c2
-rw-r--r--apps/plugins/puzzles/src/untangle.c21
-rw-r--r--apps/plugins/puzzles/src/website.url2
-rwxr-xr-xapps/plugins/puzzles/src/winiss.pl2
20 files changed, 102 insertions, 702 deletions
diff --git a/apps/plugins/puzzles/rbcompat.h b/apps/plugins/puzzles/rbcompat.h
index 66c86f1cf4..ed1ae87653 100644
--- a/apps/plugins/puzzles/rbcompat.h
+++ b/apps/plugins/puzzles/rbcompat.h
@@ -7,6 +7,8 @@
7 7
8#include <tlsf.h> 8#include <tlsf.h>
9 9
10#undef STR
11
10int sprintf_wrapper(char *str, const char *fmt, ...); 12int sprintf_wrapper(char *str, const char *fmt, ...);
11char *getenv_wrapper(const char *c); 13char *getenv_wrapper(const char *c);
12int puts_wrapper(const char *s); 14int puts_wrapper(const char *s);
@@ -15,7 +17,6 @@ double cos_wrapper(double rads);
15int vsprintf_wrapper(char *s, const char *fmt, va_list ap); 17int vsprintf_wrapper(char *s, const char *fmt, va_list ap);
16float fabs_wrapper(float n); 18float fabs_wrapper(float n);
17float floor_wrapper(float n); 19float floor_wrapper(float n);
18int ftoa(char *buf, int len, float f);
19 20
20float atan_wrapper(float x); 21float atan_wrapper(float x);
21float atan2_wrapper(float y, float x); 22float atan2_wrapper(float y, float x);
@@ -60,14 +61,20 @@ double acos_wrapper(double x);
60#define strchr rb->strchr 61#define strchr rb->strchr
61#define strcmp rb->strcmp 62#define strcmp rb->strcmp
62#define strcpy rb->strcpy 63#define strcpy rb->strcpy
63#define strcspn strcspn_wrapper
64#define strlen rb->strlen 64#define strlen rb->strlen
65#define strspn strspn_wrapper
66#define strtol strtol_wrapper 65#define strtol strtol_wrapper
67#define strtoq strtoq_wrapper 66#define strtoq strtoq_wrapper
68#define strtouq strtouq_wrapper 67#define strtouq strtouq_wrapper
69#define vsprintf vsprintf_wrapper 68#define vsprintf vsprintf_wrapper
70 69
70#ifndef strcspn
71#define strcspn strcspn_wrapper
72#endif
73
74#ifndef strspn /* gcc has builtin */
75#define strspn strspn_wrapper
76#endif
77
71#define abs(x) ((x)<0?-(x):(x)) 78#define abs(x) ((x)<0?-(x):(x))
72 79
73/* work around compilation error */ 80/* work around compilation error */
diff --git a/apps/plugins/puzzles/rbwrappers.c b/apps/plugins/puzzles/rbwrappers.c
index feb1bf79de..ed1aa06f59 100644
--- a/apps/plugins/puzzles/rbwrappers.c
+++ b/apps/plugins/puzzles/rbwrappers.c
@@ -23,12 +23,6 @@ int puts_wrapper(const char *s)
23 return 0; 23 return 0;
24} 24}
25 25
26int ftoa(char *buf, int len, float f)
27{
28 /* biggest hack ever */
29 return rb->snprintf(buf, len, "%d.%06d", (int)f, (int)((f - (int)f)*1e6));
30}
31
32/* fixed-point wrappers */ 26/* fixed-point wrappers */
33static long lastphase = 0, lastsin = 0, lastcos = 0x7fffffff; 27static long lastphase = 0, lastsin = 0, lastcos = 0x7fffffff;
34 28
@@ -93,21 +87,11 @@ float floor_wrapper(float n)
93 return (int)n; 87 return (int)n;
94} 88}
95 89
96/* Natural logarithm. 90static float rb_log(float x)
97 Taken from glibc-2.8 */ 91{
98static const float 92 long x_f = x * 65536.0f;
99ln2_hi = 6.9313812256e-01, /* 0x3f317180 */ 93 return fp16_log(x_f) / 65536.0;
100ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */ 94}
101two25 = 3.355443200e+07, /* 0x4c000000 */
102Lg1 = 6.6666668653e-01, /* 3F2AAAAB */
103Lg2 = 4.0000000596e-01, /* 3ECCCCCD */
104Lg3 = 2.8571429849e-01, /* 3E924925 */
105Lg4 = 2.2222198546e-01, /* 3E638E29 */
106Lg5 = 1.8183572590e-01, /* 3E3A3325 */
107Lg6 = 1.5313838422e-01, /* 3E1CD04F */
108Lg7 = 1.4798198640e-01; /* 3E178897 */
109
110static const float zero = 0.0;
111 95
112/* A union which permits us to convert between a float and a 32 bit 96/* A union which permits us to convert between a float and a 32 bit
113 int. */ 97 int. */
@@ -148,71 +132,6 @@ do { \
148#define __LOp(x) *(1+(int*)x) 132#define __LOp(x) *(1+(int*)x)
149#endif 133#endif
150 134
151static float rb_log(float x)
152{
153 float hfsq, f, s, z, R, w, t1, t2, dk;
154 int32_t k, ix, i, j;
155
156 GET_FLOAT_WORD(ix,x);
157
158 k=0;
159 if (ix < 0x00800000) { /* x < 2**-126 */
160 if ((ix&0x7fffffff)==0)
161 return -two25/(x-x); /* log(+-0)=-inf */
162 if (ix<0) return (x-x)/(x-x); /* log(-#) = NaN */
163 k -= 25; x *= two25; /* subnormal number, scale up x */
164 GET_FLOAT_WORD(ix,x);
165 }
166 if (ix >= 0x7f800000) return x+x;
167 k += (ix>>23)-127;
168 ix &= 0x007fffff;
169 i = (ix+(0x95f64<<3))&0x800000;
170 SET_FLOAT_WORD(x,ix|(i^0x3f800000)); /* normalize x or x/2 */
171 k += (i>>23);
172 f = x-(float)1.0;
173 if((0x007fffff&(15+ix))<16) { /* |f| < 2**-20 */
174 if(f==zero) {
175 if(k==0)
176 return zero;
177 else
178 {
179 dk=(float)k;
180 return dk*ln2_hi+dk*ln2_lo;
181 }
182 }
183 R = f*f*((float)0.5-(float)0.33333333333333333*f);
184 if(k==0)
185 return f-R;
186 else
187 {
188 dk=(float)k;
189 return dk*ln2_hi-((R-dk*ln2_lo)-f);
190 }
191 }
192 s = f/((float)2.0+f);
193 dk = (float)k;
194 z = s*s;
195 i = ix-(0x6147a<<3);
196 w = z*z;
197 j = (0x6b851<<3)-ix;
198 t1= w*(Lg2+w*(Lg4+w*Lg6));
199 t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7)));
200 i |= j;
201 R = t2+t1;
202 if(i>0) {
203 hfsq=(float)0.5*f*f;
204 if(k==0)
205 return f-(hfsq-s*(hfsq+R));
206 else
207 return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f);
208 } else {
209 if(k==0)
210 return f-s*(f-R);
211 else
212 return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f);
213 }
214}
215
216union ieee754_double 135union ieee754_double
217 { 136 {
218 double d; 137 double d;
@@ -259,573 +178,10 @@ union ieee754_double
259static const volatile float TWOM100 = 7.88860905e-31; 178static const volatile float TWOM100 = 7.88860905e-31;
260static const volatile float TWO127 = 1.7014118346e+38; 179static const volatile float TWO127 = 1.7014118346e+38;
261 180
262/* Exponential function,
263 taken from glibc-2.8
264 As it uses double values and udefines some symbols,
265 it was moved to the end of the source code */
266
267#define W52 (2.22044605e-16)
268#define W55 (2.77555756e-17)
269#define W58 (3.46944695e-18)
270#define W59 (1.73472348e-18)
271#define W60 (8.67361738e-19)
272const float __exp_deltatable[178] = {
273 0*W60, 16558714*W60, -10672149*W59, 1441652*W60,
274 -15787963*W55, 462888*W60, 7291806*W60, 1698880*W60,
275 -14375103*W58, -2021016*W60, 728829*W60, -3759654*W60,
276 3202123*W60, -10916019*W58, -251570*W60, -1043086*W60,
277 8207536*W60, -409964*W60, -5993931*W60, -475500*W60,
278 2237522*W60, 324170*W60, -244117*W60, 32077*W60,
279 123907*W60, -1019734*W60, -143*W60, 813077*W60,
280 743345*W60, 462461*W60, 629794*W60, 2125066*W60,
281 -2339121*W60, -337951*W60, 9922067*W60, -648704*W60,
282 149407*W60, -2687209*W60, -631608*W60, 2128280*W60,
283 -4882082*W60, 2001360*W60, 175074*W60, 2923216*W60,
284 -538947*W60, -1212193*W60, -1920926*W60, -1080577*W60,
285 3690196*W60, 2643367*W60, 2911937*W60, 671455*W60,
286 -1128674*W60, 593282*W60, -5219347*W60, -1941490*W60,
287 11007953*W60, 239609*W60, -2969658*W60, -1183650*W60,
288 942998*W60, 699063*W60, 450569*W60, -329250*W60,
289 -7257875*W60, -312436*W60, 51626*W60, 555877*W60,
290 -641761*W60, 1565666*W60, 884327*W60, -10960035*W60,
291 -2004679*W60, -995793*W60, -2229051*W60, -146179*W60,
292 -510327*W60, 1453482*W60, -3778852*W60, -2238056*W60,
293 -4895983*W60, 3398883*W60, -252738*W60, 1230155*W60,
294 346918*W60, 1109352*W60, 268941*W60, -2930483*W60,
295 -1036263*W60, -1159280*W60, 1328176*W60, 2937642*W60,
296 -9371420*W60, -6902650*W60, -1419134*W60, 1442904*W60,
297 -1319056*W60, -16369*W60, 696555*W60, -279987*W60,
298 -7919763*W60, 252741*W60, 459711*W60, -1709645*W60,
299 354913*W60, 6025867*W60, -421460*W60, -853103*W60,
300 -338649*W60, 962151*W60, 955965*W60, 784419*W60,
301 -3633653*W60, 2277133*W60, -8847927*W52, 1223028*W60,
302 5907079*W60, 623167*W60, 5142888*W60, 2599099*W60,
303 1214280*W60, 4870359*W60, 593349*W60, -57705*W60,
304 7761209*W60, -5564097*W60, 2051261*W60, 6216869*W60,
305 4692163*W60, 601691*W60, -5264906*W60, 1077872*W60,
306 -3205949*W60, 1833082*W60, 2081746*W60, -987363*W60,
307 -1049535*W60, 2015244*W60, 874230*W60, 2168259*W60,
308 -1740124*W60, -10068269*W60, -18242*W60, -3013583*W60,
309 580601*W60, -2547161*W60, -535689*W60, 2220815*W60,
310 1285067*W60, 2806933*W60, -983086*W60, -1729097*W60,
311 -1162985*W60, -2561904*W60, 801988*W60, 244351*W60,
312 1441893*W60, -7517981*W60, 271781*W60, -15021588*W60,
313 -2341588*W60, -919198*W60, 1642232*W60, 4771771*W60,
314 -1220099*W60, -3062372*W60, 628624*W60, 1278114*W60,
315 13083513*W60, -10521925*W60, 3180310*W60, -1659307*W60,
316 3543773*W60, 2501203*W60, 4151*W60, -340748*W60,
317 -2285625*W60, 2495202*W60
318};
319
320const double __exp_atable[355] /* __attribute__((mode(DF))) */ = {
321 0.707722561055888932371, /* 0x0.b52d4e46605c27ffd */
322 0.709106182438804188967, /* 0x0.b587fb96f75097ffb */
323 0.710492508843861281234, /* 0x0.b5e2d649899167ffd */
324 0.711881545564593931623, /* 0x0.b63dde74d36bdfffe */
325 0.713273297897442870573, /* 0x0.b699142f945f87ffc */
326 0.714667771153751463236, /* 0x0.b6f477909c4ea0001 */
327 0.716064970655995725059, /* 0x0.b75008aec758f8004 */
328 0.717464901723956938193, /* 0x0.b7abc7a0eea7e0002 */
329 0.718867569715736398602, /* 0x0.b807b47e1586c7ff8 */
330 0.720272979947266023271, /* 0x0.b863cf5d10e380003 */
331 0.721681137825144314297, /* 0x0.b8c01855195c37ffb */
332 0.723092048691992950199, /* 0x0.b91c8f7d213740004 */
333 0.724505717938892290800, /* 0x0.b97934ec5002d0007 */
334 0.725922150953176470431, /* 0x0.b9d608b9c92ea7ffc */
335 0.727341353138962865022, /* 0x0.ba330afcc29e98003 */
336 0.728763329918453162104, /* 0x0.ba903bcc8618b7ffc */
337 0.730188086709957051568, /* 0x0.baed9b40591ba0000 */
338 0.731615628948127705309, /* 0x0.bb4b296f931e30002 */
339 0.733045962086486091436, /* 0x0.bba8e671a05617ff9 */
340 0.734479091556371366251, /* 0x0.bc06d25dd49568001 */
341 0.735915022857225542529, /* 0x0.bc64ed4bce8f6fff9 */
342 0.737353761441304711410, /* 0x0.bcc33752f915d7ff9 */
343 0.738795312814142124419, /* 0x0.bd21b08af98e78005 */
344 0.740239682467211168593, /* 0x0.bd80590b65e9a8000 */
345 0.741686875913991849885, /* 0x0.bddf30ebec4a10000 */
346 0.743136898669507939299, /* 0x0.be3e38443c84e0007 */
347 0.744589756269486091620, /* 0x0.be9d6f2c1d32a0002 */
348 0.746045454254026796384, /* 0x0.befcd5bb59baf8004 */
349 0.747503998175051087583, /* 0x0.bf5c6c09ca84c0003 */
350 0.748965393601880857739, /* 0x0.bfbc322f5b18b7ff8 */
351 0.750429646104262104698, /* 0x0.c01c2843f776fffff */
352 0.751896761271877989160, /* 0x0.c07c4e5fa18b88002 */
353 0.753366744698445112140, /* 0x0.c0dca49a5fb18fffd */
354 0.754839601988627206827, /* 0x0.c13d2b0c444db0005 */
355 0.756315338768691947122, /* 0x0.c19de1cd798578006 */
356 0.757793960659406629066, /* 0x0.c1fec8f623723fffd */
357 0.759275473314173443536, /* 0x0.c25fe09e8a0f47ff8 */
358 0.760759882363831851927, /* 0x0.c2c128dedc88f8000 */
359 0.762247193485956486805, /* 0x0.c322a1cf7d6e7fffa */
360 0.763737412354726363781, /* 0x0.c3844b88cb9347ffc */
361 0.765230544649828092739, /* 0x0.c3e626232bd8f7ffc */
362 0.766726596071518051729, /* 0x0.c44831b719bf18002 */
363 0.768225572321911687194, /* 0x0.c4aa6e5d12d078001 */
364 0.769727479119219348810, /* 0x0.c50cdc2da64a37ffb */
365 0.771232322196981678892, /* 0x0.c56f7b41744490001 */
366 0.772740107296721268087, /* 0x0.c5d24bb1259e70004 */
367 0.774250840160724651565, /* 0x0.c6354d95640dd0007 */
368 0.775764526565368872643, /* 0x0.c6988106fec447fff */
369 0.777281172269557396602, /* 0x0.c6fbe61eb1bd0ffff */
370 0.778800783068235302750, /* 0x0.c75f7cf560942fffc */
371 0.780323364758801041312, /* 0x0.c7c345a3f1983fffe */
372 0.781848923151573727006, /* 0x0.c8274043594cb0002 */
373 0.783377464064598849602, /* 0x0.c88b6cec94b3b7ff9 */
374 0.784908993312207869935, /* 0x0.c8efcbb89cba27ffe */
375 0.786443516765346961618, /* 0x0.c9545cc0a88c70003 */
376 0.787981040257604625744, /* 0x0.c9b9201dc643bfffa */
377 0.789521569657452682047, /* 0x0.ca1e15e92a5410007 */
378 0.791065110849462849192, /* 0x0.ca833e3c1ae510005 */
379 0.792611669712891875319, /* 0x0.cae8992fd84667ffd */
380 0.794161252150049179450, /* 0x0.cb4e26ddbc207fff8 */
381 0.795713864077794763584, /* 0x0.cbb3e75f301b60003 */
382 0.797269511407239561694, /* 0x0.cc19dacd978cd8002 */
383 0.798828200086368567220, /* 0x0.cc8001427e55d7ffb */
384 0.800389937624300440456, /* 0x0.cce65ade24d360006 */
385 0.801954725261124767840, /* 0x0.cd4ce7a5de839fffb */
386 0.803522573691593189330, /* 0x0.cdb3a7c79a678fffd */
387 0.805093487311204114563, /* 0x0.ce1a9b563965ffffc */
388 0.806667472122675088819, /* 0x0.ce81c26b838db8000 */
389 0.808244534127439906441, /* 0x0.cee91d213f8428002 */
390 0.809824679342317166307, /* 0x0.cf50ab9144d92fff9 */
391 0.811407913793616542005, /* 0x0.cfb86dd5758c2ffff */
392 0.812994243520784198882, /* 0x0.d0206407c20e20005 */
393 0.814583674571603966162, /* 0x0.d0888e4223facfff9 */
394 0.816176213022088536960, /* 0x0.d0f0ec9eb3f7c8002 */
395 0.817771864936188586101, /* 0x0.d1597f377d6768002 */
396 0.819370636400374108252, /* 0x0.d1c24626a46eafff8 */
397 0.820972533518165570298, /* 0x0.d22b41865ff1e7ff9 */
398 0.822577562404315121269, /* 0x0.d2947170f32ec7ff9 */
399 0.824185729164559344159, /* 0x0.d2fdd60097795fff8 */
400 0.825797039949601741075, /* 0x0.d3676f4fb796d0001 */
401 0.827411500902565544264, /* 0x0.d3d13d78b5f68fffb */
402 0.829029118181348834154, /* 0x0.d43b40960546d8001 */
403 0.830649897953322891022, /* 0x0.d4a578c222a058000 */
404 0.832273846408250750368, /* 0x0.d50fe617a3ba78005 */
405 0.833900969738858188772, /* 0x0.d57a88b1218e90002 */
406 0.835531274148056613016, /* 0x0.d5e560a94048f8006 */
407 0.837164765846411529371, /* 0x0.d6506e1aac8078003 */
408 0.838801451086016225394, /* 0x0.d6bbb1204074e0001 */
409 0.840441336100884561780, /* 0x0.d72729d4c28518004 */
410 0.842084427144139224814, /* 0x0.d792d8530e12b0001 */
411 0.843730730487052604790, /* 0x0.d7febcb61273e7fff */
412 0.845380252404570153833, /* 0x0.d86ad718c308dfff9 */
413 0.847032999194574087728, /* 0x0.d8d727962c69d7fff */
414 0.848688977161248581090, /* 0x0.d943ae49621ce7ffb */
415 0.850348192619261200615, /* 0x0.d9b06b4d832ef8005 */
416 0.852010651900976245816, /* 0x0.da1d5ebdc22220005 */
417 0.853676361342631029337, /* 0x0.da8a88b555baa0006 */
418 0.855345327311054837175, /* 0x0.daf7e94f965f98004 */
419 0.857017556155879489641, /* 0x0.db6580a7c98f7fff8 */
420 0.858693054267390953857, /* 0x0.dbd34ed9617befff8 */
421 0.860371828028939855647, /* 0x0.dc4153ffc8b65fff9 */
422 0.862053883854957292436, /* 0x0.dcaf90368bfca8004 */
423 0.863739228154875360306, /* 0x0.dd1e0399328d87ffe */
424 0.865427867361348468455, /* 0x0.dd8cae435d303fff9 */
425 0.867119807911702289458, /* 0x0.ddfb9050b1cee8006 */
426 0.868815056264353846599, /* 0x0.de6aa9dced8448001 */
427 0.870513618890481399881, /* 0x0.ded9fb03db7320006 */
428 0.872215502247877139094, /* 0x0.df4983e1380657ff8 */
429 0.873920712852848668986, /* 0x0.dfb94490ffff77ffd */
430 0.875629257204025623884, /* 0x0.e0293d2f1cb01fff9 */
431 0.877341141814212965880, /* 0x0.e0996dd786fff0007 */
432 0.879056373217612985183, /* 0x0.e109d6a64f5d57ffc */
433 0.880774957955916648615, /* 0x0.e17a77b78e72a7ffe */
434 0.882496902590150900078, /* 0x0.e1eb5127722cc7ff8 */
435 0.884222213673356738383, /* 0x0.e25c63121fb0c8006 */
436 0.885950897802399772740, /* 0x0.e2cdad93ec5340003 */
437 0.887682961567391237685, /* 0x0.e33f30c925fb97ffb */
438 0.889418411575228162725, /* 0x0.e3b0ecce2d05ffff9 */
439 0.891157254447957902797, /* 0x0.e422e1bf727718006 */
440 0.892899496816652704641, /* 0x0.e4950fb9713fc7ffe */
441 0.894645145323828439008, /* 0x0.e50776d8b0e60fff8 */
442 0.896394206626591749641, /* 0x0.e57a1739c8fadfffc */
443 0.898146687421414902124, /* 0x0.e5ecf0f97c5798007 */
444 0.899902594367530173098, /* 0x0.e660043464e378005 */
445 0.901661934163603406867, /* 0x0.e6d3510747e150006 */
446 0.903424713533971135418, /* 0x0.e746d78f06cd97ffd */
447 0.905190939194458810123, /* 0x0.e7ba97e879c91fffc */
448 0.906960617885092856864, /* 0x0.e82e92309390b0007 */
449 0.908733756358986566306, /* 0x0.e8a2c6845544afffa */
450 0.910510361377119825629, /* 0x0.e9173500c8abc7ff8 */
451 0.912290439722343249336, /* 0x0.e98bddc30f98b0002 */
452 0.914073998177417412765, /* 0x0.ea00c0e84bc4c7fff */
453 0.915861043547953501680, /* 0x0.ea75de8db8094fffe */
454 0.917651582652244779397, /* 0x0.eaeb36d09d3137ffe */
455 0.919445622318405764159, /* 0x0.eb60c9ce4ed3dffff */
456 0.921243169397334638073, /* 0x0.ebd697a43995b0007 */
457 0.923044230737526172328, /* 0x0.ec4ca06fc7768fffa */
458 0.924848813220121135342, /* 0x0.ecc2e44e865b6fffb */
459 0.926656923710931002014, /* 0x0.ed39635df34e70006 */
460 0.928468569126343790092, /* 0x0.edb01dbbc2f5b7ffa */
461 0.930283756368834757725, /* 0x0.ee2713859aab57ffa */
462 0.932102492359406786818, /* 0x0.ee9e44d9342870004 */
463 0.933924784042873379360, /* 0x0.ef15b1d4635438005 */
464 0.935750638358567643520, /* 0x0.ef8d5a94f60f50007 */
465 0.937580062297704630580, /* 0x0.f0053f38f345cffff */
466 0.939413062815381727516, /* 0x0.f07d5fde3a2d98001 */
467 0.941249646905368053689, /* 0x0.f0f5bca2d481a8004 */
468 0.943089821583810716806, /* 0x0.f16e55a4e497d7ffe */
469 0.944933593864477061592, /* 0x0.f1e72b028a2827ffb */
470 0.946780970781518460559, /* 0x0.f2603cd9fb5430001 */
471 0.948631959382661205081, /* 0x0.f2d98b497d2a87ff9 */
472 0.950486566729423554277, /* 0x0.f353166f63e3dffff */
473 0.952344799896018723290, /* 0x0.f3ccde6a11ae37ffe */
474 0.954206665969085765512, /* 0x0.f446e357f66120000 */
475 0.956072172053890279009, /* 0x0.f4c12557964f0fff9 */
476 0.957941325265908139014, /* 0x0.f53ba48781046fffb */
477 0.959814132734539637840, /* 0x0.f5b66106555d07ffa */
478 0.961690601603558903308, /* 0x0.f6315af2c2027fffc */
479 0.963570739036113010927, /* 0x0.f6ac926b8aeb80004 */
480 0.965454552202857141381, /* 0x0.f728078f7c5008002 */
481 0.967342048278315158608, /* 0x0.f7a3ba7d66a908001 */
482 0.969233234469444204768, /* 0x0.f81fab543e1897ffb */
483 0.971128118008140250896, /* 0x0.f89bda33122c78007 */
484 0.973026706099345495256, /* 0x0.f9184738d4cf97ff8 */
485 0.974929006031422851235, /* 0x0.f994f284d3a5c0008 */
486 0.976835024947348973265, /* 0x0.fa11dc35bc7820002 */
487 0.978744770239899142285, /* 0x0.fa8f046b4fb7f8007 */
488 0.980658249138918636210, /* 0x0.fb0c6b449ab1cfff9 */
489 0.982575468959622777535, /* 0x0.fb8a10e1088fb7ffa */
490 0.984496437054508843888, /* 0x0.fc07f5602d79afffc */
491 0.986421160608523028820, /* 0x0.fc8618e0e55e47ffb */
492 0.988349647107594098099, /* 0x0.fd047b83571b1fffa */
493 0.990281903873210800357, /* 0x0.fd831d66f4c018002 */
494 0.992217938695037382475, /* 0x0.fe01fead3320bfff8 */
495 0.994157757657894713987, /* 0x0.fe811f703491e8006 */
496 0.996101369488558541238, /* 0x0.ff007fd5744490005 */
497 0.998048781093141101932, /* 0x0.ff801ffa9b9280007 */
498 1.000000000000000000000, /* 0x1.00000000000000000 */
499 1.001955033605393285965, /* 0x1.0080200565d29ffff */
500 1.003913889319761887310, /* 0x1.0100802aa0e80fff0 */
501 1.005876574715736104818, /* 0x1.01812090377240007 */
502 1.007843096764807100351, /* 0x1.020201541aad7fff6 */
503 1.009813464316352327214, /* 0x1.0283229c4c9820007 */
504 1.011787683565730677817, /* 0x1.030484836910a000e */
505 1.013765762469146736174, /* 0x1.0386272b9c077fffe */
506 1.015747708536026694351, /* 0x1.04080ab526304fff0 */
507 1.017733529475172815584, /* 0x1.048a2f412375ffff0 */
508 1.019723232714418781378, /* 0x1.050c94ef7ad5e000a */
509 1.021716825883923762690, /* 0x1.058f3be0f1c2d0004 */
510 1.023714316605201180057, /* 0x1.06122436442e2000e */
511 1.025715712440059545995, /* 0x1.06954e0fec63afff2 */
512 1.027721021151397406936, /* 0x1.0718b98f41c92fff6 */
513 1.029730250269221158939, /* 0x1.079c66d49bb2ffff1 */
514 1.031743407506447551857, /* 0x1.082056011a9230009 */
515 1.033760500517691527387, /* 0x1.08a487359ebd50002 */
516 1.035781537016238873464, /* 0x1.0928fa93490d4fff3 */
517 1.037806524719013578963, /* 0x1.09adb03b3e5b3000d */
518 1.039835471338248051878, /* 0x1.0a32a84e9e5760004 */
519 1.041868384612101516848, /* 0x1.0ab7e2eea5340ffff */
520 1.043905272300907460835, /* 0x1.0b3d603ca784f0009 */
521 1.045946142174331239262, /* 0x1.0bc3205a042060000 */
522 1.047991002016745332165, /* 0x1.0c4923682a086fffe */
523 1.050039859627715177527, /* 0x1.0ccf698898f3a000d */
524 1.052092722826109660856, /* 0x1.0d55f2dce5d1dfffb */
525 1.054149599440827866881, /* 0x1.0ddcbf86b09a5fff6 */
526 1.056210497317612961855, /* 0x1.0e63cfa7abc97fffd */
527 1.058275424318780855142, /* 0x1.0eeb23619c146fffb */
528 1.060344388322010722446, /* 0x1.0f72bad65714bffff */
529 1.062417397220589476718, /* 0x1.0ffa9627c38d30004 */
530 1.064494458915699715017, /* 0x1.1082b577d0eef0003 */
531 1.066575581342167566880, /* 0x1.110b18e893a90000a */
532 1.068660772440545025953, /* 0x1.1193c09c267610006 */
533 1.070750040138235936705, /* 0x1.121cacb4959befff6 */
534 1.072843392435016474095, /* 0x1.12a5dd543cf36ffff */
535 1.074940837302467588937, /* 0x1.132f529d59552000b */
536 1.077042382749654914030, /* 0x1.13b90cb250d08fff5 */
537 1.079148036789447484528, /* 0x1.14430bb58da3dfff9 */
538 1.081257807444460983297, /* 0x1.14cd4fc984c4a000e */
539 1.083371702785017154417, /* 0x1.1557d910df9c7000e */
540 1.085489730853784307038, /* 0x1.15e2a7ae292d30002 */
541 1.087611899742884524772, /* 0x1.166dbbc422d8c0004 */
542 1.089738217537583819804, /* 0x1.16f9157586772ffff */
543 1.091868692357631731528, /* 0x1.1784b4e533cacfff0 */
544 1.094003332327482702577, /* 0x1.18109a360fc23fff2 */
545 1.096142145591650907149, /* 0x1.189cc58b155a70008 */
546 1.098285140311341168136, /* 0x1.1929370751ea50002 */
547 1.100432324652149906842, /* 0x1.19b5eecdd79cefff0 */
548 1.102583706811727015711, /* 0x1.1a42ed01dbdba000e */
549 1.104739294993289488947, /* 0x1.1ad031c69a2eafff0 */
550 1.106899097422573863281, /* 0x1.1b5dbd3f66e120003 */
551 1.109063122341542140286, /* 0x1.1beb8f8fa8150000b */
552 1.111231377994659874592, /* 0x1.1c79a8dac6ad0fff4 */
553 1.113403872669181282605, /* 0x1.1d0809445a97ffffc */
554 1.115580614653132185460, /* 0x1.1d96b0effc9db000e */
555 1.117761612217810673898, /* 0x1.1e25a001332190000 */
556 1.119946873713312474002, /* 0x1.1eb4d69bdb2a9fff1 */
557 1.122136407473298902480, /* 0x1.1f4454e3bfae00006 */
558 1.124330221845670330058, /* 0x1.1fd41afcbb48bfff8 */
559 1.126528325196519908506, /* 0x1.2064290abc98c0001 */
560 1.128730725913251964394, /* 0x1.20f47f31c9aa7000f */
561 1.130937432396844410880, /* 0x1.21851d95f776dfff0 */
562 1.133148453059692917203, /* 0x1.2216045b6784efffa */
563 1.135363796355857157764, /* 0x1.22a733a6692ae0004 */
564 1.137583470716100553249, /* 0x1.2338ab9b3221a0004 */
565 1.139807484614418608939, /* 0x1.23ca6c5e27aadfff7 */
566 1.142035846532929888057, /* 0x1.245c7613b7f6c0004 */
567 1.144268564977221958089, /* 0x1.24eec8e06b035000c */
568 1.146505648458203463465, /* 0x1.258164e8cea85fff8 */
569 1.148747105501412235671, /* 0x1.26144a5180d380009 */
570 1.150992944689175123667, /* 0x1.26a7793f5de2efffa */
571 1.153243174560058870217, /* 0x1.273af1d712179000d */
572 1.155497803703682491111, /* 0x1.27ceb43d81d42fff1 */
573 1.157756840726344771440, /* 0x1.2862c097a3d29000c */
574 1.160020294239811677834, /* 0x1.28f7170a74cf4fff1 */
575 1.162288172883275239058, /* 0x1.298bb7bb0faed0004 */
576 1.164560485298402170388, /* 0x1.2a20a2ce920dffff4 */
577 1.166837240167474476460, /* 0x1.2ab5d86a4631ffff6 */
578 1.169118446164539637555, /* 0x1.2b4b58b36d5220009 */
579 1.171404112007080167155, /* 0x1.2be123cf786790002 */
580 1.173694246390975415341, /* 0x1.2c7739e3c0aac000d */
581 1.175988858069749065617, /* 0x1.2d0d9b15deb58fff6 */
582 1.178287955789017793514, /* 0x1.2da4478b627040002 */
583 1.180591548323240091978, /* 0x1.2e3b3f69fb794fffc */
584 1.182899644456603782686, /* 0x1.2ed282d76421d0004 */
585 1.185212252993012693694, /* 0x1.2f6a11f96c685fff3 */
586 1.187529382762033236513, /* 0x1.3001ecf60082ffffa */
587 1.189851042595508889847, /* 0x1.309a13f30f28a0004 */
588 1.192177241354644978669, /* 0x1.31328716a758cfff7 */
589 1.194507987909589896687, /* 0x1.31cb4686e1e85fffb */
590 1.196843291137896336843, /* 0x1.32645269dfd04000a */
591 1.199183159977805113226, /* 0x1.32fdaae604c39000f */
592 1.201527603343041317132, /* 0x1.339750219980dfff3 */
593 1.203876630171082595692, /* 0x1.3431424300e480007 */
594 1.206230249419600664189, /* 0x1.34cb8170b3fee000e */
595 1.208588470077065268869, /* 0x1.35660dd14dbd4fffc */
596 1.210951301134513435915, /* 0x1.3600e78b6bdfc0005 */
597 1.213318751604272271958, /* 0x1.369c0ec5c38ebfff2 */
598 1.215690830512196507537, /* 0x1.373783a718d29000f */
599 1.218067546930756250870, /* 0x1.37d3465662f480007 */
600 1.220448909901335365929, /* 0x1.386f56fa770fe0008 */
601 1.222834928513994334780, /* 0x1.390bb5ba5fc540004 */
602 1.225225611877684750397, /* 0x1.39a862bd3c7a8fff3 */
603 1.227620969111500981433, /* 0x1.3a455e2a37bcafffd */
604 1.230021009336254911271, /* 0x1.3ae2a8287dfbefff6 */
605 1.232425741726685064472, /* 0x1.3b8040df76f39fffa */
606 1.234835175450728295084, /* 0x1.3c1e287682e48fff1 */
607 1.237249319699482263931, /* 0x1.3cbc5f151b86bfff8 */
608 1.239668183679933477545, /* 0x1.3d5ae4e2cc0a8000f */
609 1.242091776620540377629, /* 0x1.3df9ba07373bf0006 */
610 1.244520107762172811399, /* 0x1.3e98deaa0d8cafffe */
611 1.246953186383919165383, /* 0x1.3f3852f32973efff0 */
612 1.249391019292643401078, /* 0x1.3fd816ffc72b90001 */
613 1.251833623164381181797, /* 0x1.40782b17863250005 */
614 1.254280999953110153911, /* 0x1.41188f42caf400000 */
615 1.256733161434815393410, /* 0x1.41b943b42945bfffd */
616 1.259190116985283935980, /* 0x1.425a4893e5f10000a */
617 1.261651875958665236542, /* 0x1.42fb9e0a2df4c0009 */
618 1.264118447754797758244, /* 0x1.439d443f608c4fff9 */
619 1.266589841787181258708, /* 0x1.443f3b5bebf850008 */
620 1.269066067469190262045, /* 0x1.44e183883e561fff7 */
621 1.271547134259576328224, /* 0x1.45841cecf7a7a0001 */
622 1.274033051628237434048, /* 0x1.462707b2c43020009 */
623 1.276523829025464573684, /* 0x1.46ca44023aa410007 */
624 1.279019475999373156531, /* 0x1.476dd2045d46ffff0 */
625 1.281520002043128991825, /* 0x1.4811b1e1f1f19000b */
626 1.284025416692967214122, /* 0x1.48b5e3c3edd74fff4 */
627 1.286535729509738823464, /* 0x1.495a67d3613c8fff7 */
628 1.289050950070396384145, /* 0x1.49ff3e396e19d000b */
629 1.291571087985403654081, /* 0x1.4aa4671f5b401fff1 */
630 1.294096152842774794011, /* 0x1.4b49e2ae56d19000d */
631 1.296626154297237043484, /* 0x1.4befb10fd84a3fff4 */
632 1.299161101984141142272, /* 0x1.4c95d26d41d84fff8 */
633 1.301701005575179204100, /* 0x1.4d3c46f01d9f0fff3 */
634 1.304245874766450485904, /* 0x1.4de30ec21097d0003 */
635 1.306795719266019562007, /* 0x1.4e8a2a0ccce3d0002 */
636 1.309350548792467483458, /* 0x1.4f3198fa10346fff5 */
637 1.311910373099227200545, /* 0x1.4fd95bb3be8cffffd */
638 1.314475201942565174546, /* 0x1.50817263bf0e5fffb */
639 1.317045045107389400535, /* 0x1.5129dd3418575000e */
640 1.319619912422941299109, /* 0x1.51d29c4f01c54ffff */
641 1.322199813675649204855, /* 0x1.527bafde83a310009 */
642 1.324784758729532718739, /* 0x1.5325180cfb8b3fffd */
643 1.327374757430096474625, /* 0x1.53ced504b2bd0fff4 */
644 1.329969819671041886272, /* 0x1.5478e6f02775e0001 */
645 1.332569955346704748651, /* 0x1.55234df9d8a59fff8 */
646 1.335175174370685002822, /* 0x1.55ce0a4c5a6a9fff6 */
647 1.337785486688218616860, /* 0x1.56791c1263abefff7 */
648 1.340400902247843806217, /* 0x1.57248376aef21fffa */
649 1.343021431036279800211, /* 0x1.57d040a420c0bfff3 */
650 1.345647083048053138662, /* 0x1.587c53c5a630f0002 */
651 1.348277868295411074918, /* 0x1.5928bd063fd7bfff9 */
652 1.350913796821875845231, /* 0x1.59d57c9110ad60006 */
653 1.353554878672557082439, /* 0x1.5a8292913d68cfffc */
654 1.356201123929036356254, /* 0x1.5b2fff3212db00007 */
655 1.358852542671913132777, /* 0x1.5bddc29edcc06fff3 */
656 1.361509145047255398051, /* 0x1.5c8bdd032ed16000f */
657 1.364170941142184734180, /* 0x1.5d3a4e8a5bf61fff4 */
658 1.366837941171020309735, /* 0x1.5de9176042f1effff */
659 1.369510155261156381121, /* 0x1.5e9837b062f4e0005 */
660 1.372187593620959988833, /* 0x1.5f47afa69436cfff1 */
661 1.374870266463378287715, /* 0x1.5ff77f6eb3f8cfffd */
662 1.377558184010425845733, /* 0x1.60a7a734a9742fff9 */
663 1.380251356531521533853, /* 0x1.6158272490016000c */
664 1.382949794301995272203, /* 0x1.6208ff6a8978a000f */
665 1.385653507605306700170, /* 0x1.62ba3032c0a280004 */
666 1.388362506772382154503, /* 0x1.636bb9a994784000f */
667 1.391076802081129493127, /* 0x1.641d9bfb29a7bfff6 */
668 1.393796403973427855412, /* 0x1.64cfd7545928b0002 */
669 1.396521322756352656542, /* 0x1.65826be167badfff8 */
670 1.399251568859207761660, /* 0x1.663559cf20826000c */
671 1.401987152677323100733, /* 0x1.66e8a14a29486fffc */
672 1.404728084651919228815, /* 0x1.679c427f5a4b6000b */
673 1.407474375243217723560, /* 0x1.68503d9ba0add000f */
674 1.410226034922914983815, /* 0x1.690492cbf6303fff9 */
675 1.412983074197955213304, /* 0x1.69b9423d7b548fff6 */
676};
677
678/* All floating-point numbers can be put in one of these categories. */
679enum
680 {
681 FP_NAN,
682# define FP_NAN FP_NAN
683 FP_INFINITE,
684# define FP_INFINITE FP_INFINITE
685 FP_ZERO,
686# define FP_ZERO FP_ZERO
687 FP_SUBNORMAL,
688# define FP_SUBNORMAL FP_SUBNORMAL
689 FP_NORMAL
690# define FP_NORMAL FP_NORMAL
691 };
692
693
694int
695__fpclassifyf (float x)
696{
697 uint32_t wx;
698 int retval = FP_NORMAL;
699
700 GET_FLOAT_WORD (wx, x);
701 wx &= 0x7fffffff;
702 if (wx == 0)
703 retval = FP_ZERO;
704 else if (wx < 0x800000)
705 retval = FP_SUBNORMAL;
706 else if (wx >= 0x7f800000)
707 retval = wx > 0x7f800000 ? FP_NAN : FP_INFINITE;
708
709 return retval;
710}
711
712
713int
714__isinff (float x)
715{
716 int32_t ix,t;
717 GET_FLOAT_WORD(ix,x);
718 t = ix & 0x7fffffff;
719 t ^= 0x7f800000;
720 t |= -t;
721 return ~(t >> 31) & (ix >> 30);
722}
723
724/* Return nonzero value if arguments are unordered. */
725#define fpclassify(x) \
726 (sizeof (x) == sizeof (float) ? __fpclassifyf (x) : __fpclassifyf (x))
727
728#ifndef isunordered
729#define isunordered(u, v) \
730 (__extension__ \
731 ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \
732 fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; }))
733#endif
734
735/* Return nonzero value if X is less than Y. */
736#ifndef isless
737#define isless(x, y) \
738 (__extension__ \
739 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
740 !isunordered (__x, __y) && __x < __y; }))
741#endif
742
743/* Return nonzero value if X is greater than Y. */
744#ifndef isgreater
745#define isgreater(x, y) \
746 (__extension__ \
747 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
748 !isunordered (__x, __y) && __x > __y; }))
749#endif
750
751float rb_exp(float x) 181float rb_exp(float x)
752{ 182{
753 static const float himark = 88.72283935546875; 183 long x_f = x * 65536.0f;
754 static const float lomark = -103.972084045410; 184 return fp16_exp(x_f) / 65536.0f;
755 /* Check for usual case. */
756 if (isless (x, himark) && isgreater (x, lomark))
757 {
758 static const float THREEp42 = 13194139533312.0;
759 static const float THREEp22 = 12582912.0;
760 /* 1/ln(2). */
761#undef M_1_LN2
762 static const float M_1_LN2 = 1.44269502163f;
763 /* ln(2) */
764#undef M_LN2
765 static const double M_LN2 = .6931471805599452862;
766
767 int tval;
768 double x22, t, result, dx;
769 float n, delta;
770 union ieee754_double ex2_u;
771#ifndef ROCKBOX
772 fenv_t oldenv;
773
774 feholdexcept (&oldenv);
775#endif
776
777#ifdef FE_TONEAREST
778 fesetround (FE_TONEAREST);
779#endif
780
781 /* Calculate n. */
782 n = x * M_1_LN2 + THREEp22;
783 n -= THREEp22;
784 dx = x - n*M_LN2;
785
786 /* Calculate t/512. */
787 t = dx + THREEp42;
788 t -= THREEp42;
789 dx -= t;
790
791 /* Compute tval = t. */
792 tval = (int) (t * 512.0);
793
794 if (t >= 0)
795 delta = - __exp_deltatable[tval];
796 else
797 delta = __exp_deltatable[-tval];
798
799 /* Compute ex2 = 2^n e^(t/512+delta[t]). */
800 ex2_u.d = __exp_atable[tval+177];
801 ex2_u.ieee.exponent += (int) n;
802
803 /* Approximate e^(dx+delta) - 1, using a second-degree polynomial,
804 with maximum error in [-2^-10-2^-28,2^-10+2^-28]
805 less than 5e-11. */
806 x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
807
808 /* Return result. */
809#ifndef ROCKBOX
810 fesetenv (&oldenv);
811#endif
812
813 result = x22 * ex2_u.d + ex2_u.d;
814 return (float) result;
815 }
816 /* Exceptional cases: */
817 else if (isless (x, himark))
818 {
819 if (__isinff (x))
820 /* e^-inf == 0, with no error. */
821 return 0;
822 else
823 /* Underflow */
824 return TWOM100 * TWOM100;
825 }
826 else
827 /* Return x, if x is a NaN or Inf; or overflow, otherwise. */
828 return TWO127*x;
829} 185}
830 186
831/* Arc tangent, 187/* Arc tangent,
@@ -917,6 +273,8 @@ pi_o_2 = 1.5707963705e+00, /* 0x3fc90fdb */
917pi = 3.1415927410e+00, /* 0x40490fdb */ 273pi = 3.1415927410e+00, /* 0x40490fdb */
918pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */ 274pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */
919 275
276static const float zero = 0.0f;
277
920float atan2_wrapper(float y, float x) 278float atan2_wrapper(float y, float x)
921{ 279{
922 float z; 280 float z;
diff --git a/apps/plugins/puzzles/src/Buildscr b/apps/plugins/puzzles/src/Buildscr
index 910981f079..c72084477b 100644
--- a/apps/plugins/puzzles/src/Buildscr
+++ b/apps/plugins/puzzles/src/Buildscr
@@ -51,14 +51,10 @@ enddelegate
51 51
52# Build the Windows binaries and installer, and the CHM file. 52# Build the Windows binaries and installer, and the CHM file.
53in puzzles do make -f Makefile.doc clean 53in puzzles do make -f Makefile.doc clean
54in puzzles do make -f Makefile.doc chm 54in puzzles do make -f Makefile.doc # build help files for installer
55in puzzles do make -f Makefile.doc # build help file for installer
56in puzzles do mason.pl --args '{"version":"$(Version)","descfile":"gamedesc.txt"}' winwix.mc > puzzles.wxs 55in puzzles do mason.pl --args '{"version":"$(Version)","descfile":"gamedesc.txt"}' winwix.mc > puzzles.wxs
57in puzzles do perl winiss.pl $(Version) gamedesc.txt > puzzles.iss 56in puzzles do perl winiss.pl $(Version) gamedesc.txt > puzzles.iss
58delegate windows 57delegate windows
59 # Ignore the poorly controlled return value from HHC, and instead
60 # just test that the output file was generated.
61 in puzzles with htmlhelp do/win hhc puzzles.hhp & type puzzles.chm >nul
62 # FIXME: Cygwin alternative? 58 # FIXME: Cygwin alternative?
63 in puzzles with visualstudio do/win nmake -f Makefile.vc clean 59 in puzzles with visualstudio do/win nmake -f Makefile.vc clean
64 in puzzles with visualstudio do/win nmake -f Makefile.vc VER=-DVER=$(Version) 60 in puzzles with visualstudio do/win nmake -f Makefile.vc VER=-DVER=$(Version)
@@ -67,12 +63,11 @@ delegate windows
67 # provide a 'more info' URL, and an optional -n option to provide a 63 # provide a 'more info' URL, and an optional -n option to provide a
68 # program name, and that it can take multiple .exe filename 64 # program name, and that it can take multiple .exe filename
69 # arguments and sign them all in place. 65 # arguments and sign them all in place.
70 ifneq "$(winsigncode)" "" in puzzles do $(winsigncode) -i http://www.chiark.greenend.org.uk/~sgtatham/puzzles/ *.exe 66 ifneq "$(winsigncode)" "" in puzzles do $(winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ *.exe
71 # Build installers. 67 # Build installers.
72 in puzzles with wix do/win candle puzzles.wxs && light -ext WixUIExtension -sval puzzles.wixobj 68 in puzzles with wix do/win candle puzzles.wxs && light -ext WixUIExtension -sval puzzles.wixobj
73 in puzzles with innosetup do/win iscc puzzles.iss 69 in puzzles with innosetup do/win iscc puzzles.iss
74 ifneq "$(winsigncode)" "" in puzzles do $(winsigncode) -i http://www.chiark.greenend.org.uk/~sgtatham/puzzles/ -n "Simon Tatham's Portable Puzzle Collection Installer" puzzles.msi Output/installer.exe 70 ifneq "$(winsigncode)" "" in puzzles do $(winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ -n "Simon Tatham's Portable Puzzle Collection Installer" puzzles.msi Output/installer.exe
75 return puzzles/puzzles.chm
76 return puzzles/*.exe 71 return puzzles/*.exe
77 return puzzles/Output/installer.exe 72 return puzzles/Output/installer.exe
78 return puzzles/puzzles.msi 73 return puzzles/puzzles.msi
@@ -114,9 +109,7 @@ in puzzles do chmod +x *.exe
114# return puzzles/puzzles.armv4.cab 109# return puzzles/puzzles.armv4.cab
115#enddelegate 110#enddelegate
116 111
117# Build the help file and the HTML docs. 112# Build the HTML docs.
118in puzzles do make -f Makefile.doc clean # remove CHM-target HTML
119in puzzles do make -f Makefile.doc # and rebuild help file...
120in puzzles do mkdir doc 113in puzzles do mkdir doc
121in puzzles do mkdir devel 114in puzzles do mkdir devel
122in puzzles/doc do halibut --html -Chtml-contents-filename:index.html -Chtml-index-filename:indexpage.html -Chtml-template-filename:%k.html -Chtml-template-fragment:%k ../puzzles.but 115in puzzles/doc do halibut --html -Chtml-contents-filename:index.html -Chtml-index-filename:indexpage.html -Chtml-template-filename:%k.html -Chtml-template-fragment:%k ../puzzles.but
diff --git a/apps/plugins/puzzles/src/Makefile.doc b/apps/plugins/puzzles/src/Makefile.doc
index c7d6946cf1..0fd28db5ed 100644
--- a/apps/plugins/puzzles/src/Makefile.doc
+++ b/apps/plugins/puzzles/src/Makefile.doc
@@ -1,17 +1,17 @@
1all: puzzles.hlp puzzles.txt HACKING 1all: puzzles.chm puzzles.hlp puzzles.txt HACKING
2 2
3preprocessed.but: puzzles.but 3preprocessed.but: puzzles.but
4 sed 's/PREFIX-/$(BINPREFIX)/g' puzzles.but > preprocessed.but 4 sed 's/PREFIX-/$(BINPREFIX)/g' puzzles.but > preprocessed.but
5 5
6puzzles.hlp puzzles.txt: preprocessed.but 6puzzles.chm: preprocessed.but
7 halibut --winhelp=puzzles.hlp --text=puzzles.txt preprocessed.but 7 halibut --chm=puzzles.chm preprocessed.but
8puzzles.hlp: preprocessed.but
9 halibut --winhelp=puzzles.hlp preprocessed.but
10puzzles.txt: preprocessed.but
11 halibut --text=puzzles.txt preprocessed.but
8 12
9HACKING: devel.but 13HACKING: devel.but
10 halibut --text=HACKING devel.but 14 halibut --text=HACKING devel.but
11 15
12chm: puzzles.hhp
13puzzles.hhp: puzzles.but chm.but
14 halibut --html puzzles.but chm.but
15
16clean: 16clean:
17 rm -f puzzles.hlp puzzles.txt preprocessed.but HACKING *.html *.hh[pck] 17 rm -f puzzles.hlp puzzles.txt preprocessed.but HACKING *.html *.hh[pck]
diff --git a/apps/plugins/puzzles/src/README b/apps/plugins/puzzles/src/README
index 890db56771..00830126e8 100644
--- a/apps/plugins/puzzles/src/README
+++ b/apps/plugins/puzzles/src/README
@@ -1,6 +1,6 @@
1This is the README accompanying the source code to Simon Tatham's 1This is the README accompanying the source code to Simon Tatham's
2puzzle collection. The collection's web site is at 2puzzle collection. The collection's web site is at
3<http://www.chiark.greenend.org.uk/~sgtatham/puzzles/>. 3<https://www.chiark.greenend.org.uk/~sgtatham/puzzles/>.
4 4
5If you've obtained the source code by downloading a .tar.gz archive 5If you've obtained the source code by downloading a .tar.gz archive
6from the Puzzles web site, you should find several Makefiles in the 6from the Puzzles web site, you should find several Makefiles in the
@@ -51,4 +51,4 @@ application and for the web site. It is generated from a Halibut
51source file (puzzles.but), which is the preferred form for 51source file (puzzles.but), which is the preferred form for
52modification. To generate the manual in other formats, rebuild it, 52modification. To generate the manual in other formats, rebuild it,
53or learn about Halibut, visit the Halibut website at 53or learn about Halibut, visit the Halibut website at
54<http://www.chiark.greenend.org.uk/~sgtatham/halibut/>. 54<https://www.chiark.greenend.org.uk/~sgtatham/halibut/>.
diff --git a/apps/plugins/puzzles/src/icons/tracks.sav b/apps/plugins/puzzles/src/icons/tracks.sav
index ca30644506..d13ef95f06 100644
--- a/apps/plugins/puzzles/src/icons/tracks.sav
+++ b/apps/plugins/puzzles/src/icons/tracks.sav
@@ -1,6 +1,6 @@
1SAVEFILE:41:Simon Tatham's Portable Puzzle Collection 1SAVEFILE:41:Simon Tatham's Portable Puzzle Collection
2VERSION :1:1 2VERSION :1:1
3GAME :12:Train Tracks 3GAME :12:Tracks
4PARAMS :5:6x6dt 4PARAMS :5:6x6dt
5CPARAMS :5:6x6dt 5CPARAMS :5:6x6dt
6SEED :15:145870397370785 6SEED :15:145870397370785
diff --git a/apps/plugins/puzzles/src/loopy.c b/apps/plugins/puzzles/src/loopy.c
index 652b9ecc09..7d3436aacb 100644
--- a/apps/plugins/puzzles/src/loopy.c
+++ b/apps/plugins/puzzles/src/loopy.c
@@ -3054,6 +3054,24 @@ static char *interpret_move(const game_state *state, game_ui *ui,
3054 state->lines[e_next - g->edges] != state->lines[i]) 3054 state->lines[e_next - g->edges] != state->lines[i])
3055 break; 3055 break;
3056 3056
3057 if (e_next == e) {
3058 /*
3059 * Special case: we might have come all the
3060 * way round a loop and found our way back to
3061 * the same edge we started from. In that
3062 * situation, we must terminate not only this
3063 * while loop, but the 'for' outside it that
3064 * was tracing in both directions from the
3065 * starting edge, because if we let it trace
3066 * in the second direction then we'll only
3067 * find ourself traversing the same loop in
3068 * the other order and generate an encoded
3069 * move string that mentions the same set of
3070 * edges twice.
3071 */
3072 goto autofollow_done;
3073 }
3074
3057 dot = (e_next->dot1 != dot ? e_next->dot1 : e_next->dot2); 3075 dot = (e_next->dot1 != dot ? e_next->dot1 : e_next->dot2);
3058 if (movelen > movesize - 40) { 3076 if (movelen > movesize - 40) {
3059 movesize = movesize * 5 / 4 + 128; 3077 movesize = movesize * 5 / 4 + 128;
@@ -3064,6 +3082,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
3064 (int)(e_this - g->edges), button_char); 3082 (int)(e_this - g->edges), button_char);
3065 } 3083 }
3066 } 3084 }
3085 autofollow_done:;
3067 } 3086 }
3068 } 3087 }
3069 3088
diff --git a/apps/plugins/puzzles/src/map.c b/apps/plugins/puzzles/src/map.c
index f1af38ba5e..54073bad0d 100644
--- a/apps/plugins/puzzles/src/map.c
+++ b/apps/plugins/puzzles/src/map.c
@@ -2779,7 +2779,7 @@ static void draw_square(drawing *dr, game_drawstate *ds,
2779 2779
2780 draw_circle(dr, COORD(x) + (xo+1)*TILESIZE/5, 2780 draw_circle(dr, COORD(x) + (xo+1)*TILESIZE/5,
2781 COORD(y) + (yo+1)*TILESIZE/5, 2781 COORD(y) + (yo+1)*TILESIZE/5,
2782 TILESIZE/7, COL_0 + c, COL_0 + c); 2782 TILESIZE/4, COL_0 + c, COL_0 + c);
2783 } 2783 }
2784 2784
2785 /* 2785 /*
diff --git a/apps/plugins/puzzles/src/midend.c b/apps/plugins/puzzles/src/midend.c
index 6dbdd33905..f80a7fa19f 100644
--- a/apps/plugins/puzzles/src/midend.c
+++ b/apps/plugins/puzzles/src/midend.c
@@ -1701,7 +1701,7 @@ void midend_serialise(midend *me,
1701 */ 1701 */
1702 if (me->ourgame->is_timed) { 1702 if (me->ourgame->is_timed) {
1703 char buf[80]; 1703 char buf[80];
1704 ftoa(buf, 80, me->elapsed); 1704 ftoa(buf, me->elapsed);
1705 wr("TIME", buf); 1705 wr("TIME", buf);
1706 } 1706 }
1707 1707
diff --git a/apps/plugins/puzzles/src/misc.c b/apps/plugins/puzzles/src/misc.c
index 9904aee75e..2bf35d391b 100644
--- a/apps/plugins/puzzles/src/misc.c
+++ b/apps/plugins/puzzles/src/misc.c
@@ -361,16 +361,21 @@ void draw_text_outline(drawing *dr, int x, int y, int fonttype,
361 361
362} 362}
363 363
364/* kludge for non-compliant sprintf() */ 364/* kludge for sprintf() in Rockbox not supporting "%-8.8s" */
365void copy_left_justified(char *buf, size_t sz, const char *str) 365void copy_left_justified(char *buf, size_t sz, const char *str)
366{ 366{
367 size_t len = strlen(str);
368 assert(sz > 0);
367 memset(buf, ' ', sz - 1); 369 memset(buf, ' ', sz - 1);
368 int len = strlen(str); 370 assert(len <= sz - 1);
369 if(len <= sz - 1) 371 memcpy(buf, str, len);
370 memcpy(buf, str, len);
371 else
372 fatal("overrun");
373 buf[sz - 1] = 0; 372 buf[sz - 1] = 0;
374} 373}
375 374
375/* another kludge for platforms without %g support in *printf() */
376int ftoa(char *buf, float f)
377{
378 return sprintf(buf, "%d.%06d", (int)f, (int)((f - (int)f)*1e6));
379}
380
376/* vim: set shiftwidth=4 tabstop=8: */ 381/* vim: set shiftwidth=4 tabstop=8: */
diff --git a/apps/plugins/puzzles/src/net.c b/apps/plugins/puzzles/src/net.c
index 9289afb682..f479f03bb7 100644
--- a/apps/plugins/puzzles/src/net.c
+++ b/apps/plugins/puzzles/src/net.c
@@ -259,7 +259,7 @@ static char *encode_params(const game_params *params, int full)
259 if (full && params->barrier_probability) 259 if (full && params->barrier_probability)
260 { 260 {
261 len += sprintf(ret+len, "b"); 261 len += sprintf(ret+len, "b");
262 len += ftoa(ret + len, 400, params->barrier_probability); 262 len += ftoa(ret + len, params->barrier_probability);
263 } 263 }
264 if (full && !params->unique) 264 if (full && !params->unique)
265 ret[len++] = 'a'; 265 ret[len++] = 'a';
@@ -295,7 +295,7 @@ static config_item *game_configure(const game_params *params)
295 295
296 ret[3].name = "Barrier probability"; 296 ret[3].name = "Barrier probability";
297 ret[3].type = C_STRING; 297 ret[3].type = C_STRING;
298 ftoa(buf, 80, params->barrier_probability); 298 ftoa(buf, params->barrier_probability);
299 ret[3].sval = dupstr(buf); 299 ret[3].sval = dupstr(buf);
300 ret[3].ival = 0; 300 ret[3].ival = 0;
301 301
diff --git a/apps/plugins/puzzles/src/netslide.c b/apps/plugins/puzzles/src/netslide.c
index 96ac8e7eea..bb9b0999ea 100644
--- a/apps/plugins/puzzles/src/netslide.c
+++ b/apps/plugins/puzzles/src/netslide.c
@@ -243,7 +243,7 @@ static char *encode_params(const game_params *params, int full)
243 if (full && params->barrier_probability) 243 if (full && params->barrier_probability)
244 { 244 {
245 len += sprintf(ret+len, "b"); 245 len += sprintf(ret+len, "b");
246 len += ftoa(ret + len, 400, params->barrier_probability); 246 len += ftoa(ret + len, params->barrier_probability);
247 } 247 }
248 /* Shuffle limit is part of the limited parameters, because we have to 248 /* Shuffle limit is part of the limited parameters, because we have to
249 * provide the target move count. */ 249 * provide the target move count. */
@@ -281,7 +281,7 @@ static config_item *game_configure(const game_params *params)
281 281
282 ret[3].name = "Barrier probability"; 282 ret[3].name = "Barrier probability";
283 ret[3].type = C_STRING; 283 ret[3].type = C_STRING;
284 ftoa(buf, 80, params->barrier_probability); 284 ftoa(buf, params->barrier_probability);
285 ret[3].sval = dupstr(buf); 285 ret[3].sval = dupstr(buf);
286 ret[3].ival = 0; 286 ret[3].ival = 0;
287 287
diff --git a/apps/plugins/puzzles/src/puzzles.but b/apps/plugins/puzzles/src/puzzles.but
index 2508fe3337..2c448b8030 100644
--- a/apps/plugins/puzzles/src/puzzles.but
+++ b/apps/plugins/puzzles/src/puzzles.but
@@ -13,6 +13,12 @@
13\cfg{html-contents-depth-1}{2} 13\cfg{html-contents-depth-1}{2}
14\cfg{html-leaf-contains-contents}{true} 14\cfg{html-leaf-contains-contents}{true}
15 15
16\cfg{chm-filename}{puzzles.chm}
17\cfg{chm-contents-filename}{index.html}
18\cfg{chm-template-filename}{%k.html}
19\cfg{chm-head-end}{<link rel="stylesheet" type="text/css" href="chm.css">}
20\cfg{chm-extra-file}{chm.css}
21
16\cfg{info-filename}{puzzles.info} 22\cfg{info-filename}{puzzles.info}
17 23
18\cfg{ps-filename}{puzzles.ps} 24\cfg{ps-filename}{puzzles.ps}
@@ -65,13 +71,13 @@ with the game binaries or the code, except pretending you wrote them
65yourself, or suing me if anything goes wrong. 71yourself, or suing me if anything goes wrong.
66 72
67The most recent versions, and \i{source code}, can be found at 73The most recent versions, and \i{source code}, can be found at
68\I{website}\W{http://www.chiark.greenend.org.uk/~sgtatham/puzzles/}\cw{http://www.chiark.greenend.org.uk/~sgtatham/puzzles/}. 74\I{website}\W{https://www.chiark.greenend.org.uk/~sgtatham/puzzles/}\cw{https://www.chiark.greenend.org.uk/~sgtatham/puzzles/}.
69 75
70Please report \I{feedback}\i{bugs} to 76Please report \I{feedback}\i{bugs} to
71\W{mailto:anakin@pobox.com}\cw{anakin@pobox.com}. 77\W{mailto:anakin@pobox.com}\cw{anakin@pobox.com}.
72You might find it helpful to read this article before reporting a bug: 78You might find it helpful to read this article before reporting a bug:
73 79
74\W{http://www.chiark.greenend.org.uk/~sgtatham/bugs.html}\cw{http://www.chiark.greenend.org.uk/~sgtatham/bugs.html} 80\W{https://www.chiark.greenend.org.uk/~sgtatham/bugs.html}\cw{https://www.chiark.greenend.org.uk/~sgtatham/bugs.html}
75 81
76\ii{Patches} are welcome. Especially if they provide a new front end 82\ii{Patches} are welcome. Especially if they provide a new front end
77(to make all these games run on another platform), or a new game. 83(to make all these games run on another platform), or a new game.
diff --git a/apps/plugins/puzzles/src/puzzles.h b/apps/plugins/puzzles/src/puzzles.h
index 03af2ca186..fbfcfce4f8 100644
--- a/apps/plugins/puzzles/src/puzzles.h
+++ b/apps/plugins/puzzles/src/puzzles.h
@@ -381,6 +381,10 @@ void draw_text_outline(drawing *dr, int x, int y, int fonttype,
381 * less than buffer size. */ 381 * less than buffer size. */
382void copy_left_justified(char *buf, size_t sz, const char *str); 382void copy_left_justified(char *buf, size_t sz, const char *str);
383 383
384/* An ugly, but working float-to-string implementation for platforms
385 * that don't have one */
386int ftoa(char *buf, float f);
387
384/* 388/*
385 * dsf.c 389 * dsf.c
386 */ 390 */
diff --git a/apps/plugins/puzzles/src/range.c b/apps/plugins/puzzles/src/range.c
index 588178c003..4dd39b97cd 100644
--- a/apps/plugins/puzzles/src/range.c
+++ b/apps/plugins/puzzles/src/range.c
@@ -1159,7 +1159,8 @@ static int game_can_format_as_text_now(const game_params *params)
1159 1159
1160static char *game_text_format(const game_state *state) 1160static char *game_text_format(const game_state *state)
1161{ 1161{
1162 int cellsize, r, c, i, w_string, h_string, n_string; 1162 int r, c, i, w_string, h_string, n_string;
1163 char cellsize;
1163 char *ret, *buf, *gridline; 1164 char *ret, *buf, *gridline;
1164 1165
1165 int const w = state->params.w, h = state->params.h; 1166 int const w = state->params.w, h = state->params.h;
diff --git a/apps/plugins/puzzles/src/rect.c b/apps/plugins/puzzles/src/rect.c
index 0c06c74945..247138cedb 100644
--- a/apps/plugins/puzzles/src/rect.c
+++ b/apps/plugins/puzzles/src/rect.c
@@ -165,7 +165,7 @@ static char *encode_params(const game_params *params, int full)
165 if (full && params->expandfactor) 165 if (full && params->expandfactor)
166 { 166 {
167 sprintf(data + strlen(data), "e"); 167 sprintf(data + strlen(data), "e");
168 ftoa(data + strlen(data), 256, params->expandfactor); 168 ftoa(data + strlen(data), params->expandfactor);
169 } 169 }
170 if (full && !params->unique) 170 if (full && !params->unique)
171 strcat(data, "a"); 171 strcat(data, "a");
@@ -194,7 +194,7 @@ static config_item *game_configure(const game_params *params)
194 194
195 ret[2].name = "Expansion factor"; 195 ret[2].name = "Expansion factor";
196 ret[2].type = C_STRING; 196 ret[2].type = C_STRING;
197 ftoa(buf, 80, params->expandfactor); 197 ftoa(buf, params->expandfactor);
198 ret[2].sval = dupstr(buf); 198 ret[2].sval = dupstr(buf);
199 ret[2].ival = 0; 199 ret[2].ival = 0;
200 200
diff --git a/apps/plugins/puzzles/src/tracks.c b/apps/plugins/puzzles/src/tracks.c
index 43428a19e9..0c06c59ae9 100644
--- a/apps/plugins/puzzles/src/tracks.c
+++ b/apps/plugins/puzzles/src/tracks.c
@@ -2620,7 +2620,7 @@ static void game_print(drawing *dr, const game_state *state, int tilesize)
2620#endif 2620#endif
2621 2621
2622const struct game thegame = { 2622const struct game thegame = {
2623 "Train Tracks", "games.tracks", "tracks", 2623 "Tracks", "games.tracks", "tracks",
2624 default_params, 2624 default_params,
2625 game_fetch_preset, NULL, 2625 game_fetch_preset, NULL,
2626 decode_params, 2626 decode_params,
diff --git a/apps/plugins/puzzles/src/untangle.c b/apps/plugins/puzzles/src/untangle.c
index 47e839e875..441c8658ce 100644
--- a/apps/plugins/puzzles/src/untangle.c
+++ b/apps/plugins/puzzles/src/untangle.c
@@ -1122,6 +1122,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1122 1122
1123 if (bestd <= DRAG_THRESHOLD * DRAG_THRESHOLD) { 1123 if (bestd <= DRAG_THRESHOLD * DRAG_THRESHOLD) {
1124 ui->dragpoint = best; 1124 ui->dragpoint = best;
1125 ui->cursorpoint = -1;
1125 ui->newpoint.x = x; 1126 ui->newpoint.x = x;
1126 ui->newpoint.y = y; 1127 ui->newpoint.y = y;
1127 ui->newpoint.d = ds->tilesize; 1128 ui->newpoint.d = ds->tilesize;
@@ -1183,25 +1184,28 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1183 bestd = 0; 1184 bestd = 0;
1184 1185
1185 for (i = 0; i < n; i++) { 1186 for (i = 0; i < n; i++) {
1187 long px, py, dx, dy, d;
1188 float angle;
1189 int right_direction;
1186 if(i == ui->cursorpoint) 1190 if(i == ui->cursorpoint)
1187 continue; 1191 continue;
1188 1192
1189 long px = state->pts[i].x * ds->tilesize / state->pts[i].d; 1193 px = state->pts[i].x * ds->tilesize / state->pts[i].d;
1190 long py = state->pts[i].y * ds->tilesize / state->pts[i].d; 1194 py = state->pts[i].y * ds->tilesize / state->pts[i].d;
1191 long dx = px - state->pts[ui->cursorpoint].x * ds->tilesize / state->pts[ui->cursorpoint].d; 1195 dx = px - state->pts[ui->cursorpoint].x * ds->tilesize / state->pts[ui->cursorpoint].d;
1192 long dy = py - state->pts[ui->cursorpoint].y * ds->tilesize / state->pts[ui->cursorpoint].d; 1196 dy = py - state->pts[ui->cursorpoint].y * ds->tilesize / state->pts[ui->cursorpoint].d;
1193 long d = dx*dx + dy*dy; 1197 d = dx*dx + dy*dy;
1194 1198
1195 /* Figure out if this point falls into a 90 degree 1199 /* Figure out if this point falls into a 90 degree
1196 * range extending from the current point */ 1200 * range extending from the current point */
1197 1201
1198 float angle = atan2(-dy, dx); /* negate y to adjust for raster coordinates */ 1202 angle = atan2(-dy, dx); /* negate y to adjust for raster coordinates */
1199 1203
1200 /* offset to [0..2*PI] */ 1204 /* offset to [0..2*PI] */
1201 if(angle < 0) 1205 if(angle < 0)
1202 angle += 2*PI; 1206 angle += 2*PI;
1203 1207
1204 int right_direction = FALSE; 1208 right_direction = FALSE;
1205 1209
1206 if((button == CURSOR_UP && (1*PI/4 <= angle && angle <= 3*PI/4)) || 1210 if((button == CURSOR_UP && (1*PI/4 <= angle && angle <= 3*PI/4)) ||
1207 (button == CURSOR_LEFT && (3*PI/4 <= angle && angle <= 5*PI/4)) || 1211 (button == CURSOR_LEFT && (3*PI/4 <= angle && angle <= 5*PI/4)) ||
@@ -1284,7 +1288,10 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1284 return dupstr(buf); 1288 return dupstr(buf);
1285 } 1289 }
1286 else if(ui->cursorpoint < 0) 1290 else if(ui->cursorpoint < 0)
1291 {
1287 ui->cursorpoint = 0; 1292 ui->cursorpoint = 0;
1293 return "";
1294 }
1288 } 1295 }
1289 1296
1290 return NULL; 1297 return NULL;
diff --git a/apps/plugins/puzzles/src/website.url b/apps/plugins/puzzles/src/website.url
index 2ab37f6faf..2913e622c6 100644
--- a/apps/plugins/puzzles/src/website.url
+++ b/apps/plugins/puzzles/src/website.url
@@ -1,2 +1,2 @@
1[InternetShortcut] 1[InternetShortcut]
2URL=http://www.chiark.greenend.org.uk/~sgtatham/puzzles/ 2URL=https://www.chiark.greenend.org.uk/~sgtatham/puzzles/
diff --git a/apps/plugins/puzzles/src/winiss.pl b/apps/plugins/puzzles/src/winiss.pl
index eca02d3b15..3200337138 100755
--- a/apps/plugins/puzzles/src/winiss.pl
+++ b/apps/plugins/puzzles/src/winiss.pl
@@ -48,7 +48,7 @@ print 'VersionInfoTextVersion=Version '.$ver."\n";
48print 'AppVersion=r'.$ver."\n"; 48print 'AppVersion=r'.$ver."\n";
49print 'VersionInfoVersion=0.0.'.$integer_date.'.0'."\n"; 49print 'VersionInfoVersion=0.0.'.$integer_date.'.0'."\n";
50print 'AppPublisher=Simon Tatham'."\n"; 50print 'AppPublisher=Simon Tatham'."\n";
51print 'AppPublisherURL=http://www.chiark.greenend.org.uk/~sgtatham/puzzles/'."\n"; 51print 'AppPublisherURL=https://www.chiark.greenend.org.uk/~sgtatham/puzzles/'."\n";
52print 'DefaultDirName={pf}\Simon Tatham\'s Portable Puzzle Collection'."\n"; 52print 'DefaultDirName={pf}\Simon Tatham\'s Portable Puzzle Collection'."\n";
53print 'DefaultGroupName=Simon Tatham\'s Puzzles'."\n"; 53print 'DefaultGroupName=Simon Tatham\'s Puzzles'."\n";
54# print 'SetupIconFile=fixmethinkoneup.ico'."\n"; 54# print 'SetupIconFile=fixmethinkoneup.ico'."\n";