summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/CATEGORIES4
-rw-r--r--apps/plugins/puzzles/SOURCES.games6
-rw-r--r--apps/plugins/puzzles/puzzles.make11
-rw-r--r--apps/plugins/puzzles/rbwrappers.c95
-rw-r--r--apps/plugins/puzzles/rockbox.c4
5 files changed, 26 insertions, 94 deletions
diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES
index 4b1b8d635c..98920195f9 100644
--- a/apps/plugins/CATEGORIES
+++ b/apps/plugins/CATEGORIES
@@ -102,6 +102,7 @@ sgt-filling,games
102sgt-flip,games 102sgt-flip,games
103sgt-flood,games 103sgt-flood,games
104sgt-galaxies,games 104sgt-galaxies,games
105sgt-group,games
105sgt-guess,games 106sgt-guess,games
106sgt-inertia,games 107sgt-inertia,games
107sgt-keen,games 108sgt-keen,games
@@ -119,10 +120,13 @@ sgt-pegs,games
119sgt-range,games 120sgt-range,games
120sgt-rect,games 121sgt-rect,games
121sgt-samegame,games 122sgt-samegame,games
123sgt-separate,games
122sgt-signpost,games 124sgt-signpost,games
123sgt-singles,games 125sgt-singles,games
124sgt-sixteen,games 126sgt-sixteen,games
125sgt-slant,games 127sgt-slant,games
128sgt-slide,games
129sgt-sokoban,games
126sgt-solo,games 130sgt-solo,games
127sgt-tents,games 131sgt-tents,games
128sgt-towers,games 132sgt-towers,games
diff --git a/apps/plugins/puzzles/SOURCES.games b/apps/plugins/puzzles/SOURCES.games
index d228138528..26f74e4005 100644
--- a/apps/plugins/puzzles/SOURCES.games
+++ b/apps/plugins/puzzles/SOURCES.games
@@ -39,3 +39,9 @@ twiddle.c
39/*unequal.c*/ 39/*unequal.c*/
40unruly.c 40unruly.c
41/*untangle.c*/ 41/*untangle.c*/
42
43/* disabled for now */
44/*unfinished/group.c*/
45/*unfinished/separate.c*/
46/*unfinished/slide.c*/
47/*unfinished/sokoban.c*/
diff --git a/apps/plugins/puzzles/puzzles.make b/apps/plugins/puzzles/puzzles.make
index 4e1f3a1001..4052423fb9 100644
--- a/apps/plugins/puzzles/puzzles.make
+++ b/apps/plugins/puzzles/puzzles.make
@@ -45,7 +45,7 @@ endif
45# Hack to suppress all warnings: 45# Hack to suppress all warnings:
46PUZZLESFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -Os \ 46PUZZLESFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -Os \
47 -Wno-unused-parameter -Wno-sign-compare -Wno-strict-aliasing -w \ 47 -Wno-unused-parameter -Wno-sign-compare -Wno-strict-aliasing -w \
48 -DFOR_REAL 48 -DFOR_REAL -I$(PUZZLES_SRCDIR)
49ifdef PUZZLES_COMBINED 49ifdef PUZZLES_COMBINED
50PUZZLESFLAGS += -DCOMBINED 50PUZZLESFLAGS += -DCOMBINED
51endif 51endif
@@ -106,9 +106,18 @@ $(PUZZLES_OBJDIR)/sgt-undead.rock: $(PUZZLES_OBJDIR)/undead.o $(PUZZLES_SHARED_O
106$(PUZZLES_OBJDIR)/sgt-unequal.rock: $(PUZZLES_OBJDIR)/unequal.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB) 106$(PUZZLES_OBJDIR)/sgt-unequal.rock: $(PUZZLES_OBJDIR)/unequal.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB)
107$(PUZZLES_OBJDIR)/sgt-unruly.rock: $(PUZZLES_OBJDIR)/unruly.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB) 107$(PUZZLES_OBJDIR)/sgt-unruly.rock: $(PUZZLES_OBJDIR)/unruly.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB)
108$(PUZZLES_OBJDIR)/sgt-untangle.rock: $(PUZZLES_OBJDIR)/untangle.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB) 108$(PUZZLES_OBJDIR)/sgt-untangle.rock: $(PUZZLES_OBJDIR)/untangle.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB)
109
110$(PUZZLES_OBJDIR)/sgt-group.rock: $(PUZZLES_OBJDIR)/unfinished/group.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB)
111$(PUZZLES_OBJDIR)/sgt-separate.rock: $(PUZZLES_OBJDIR)/unfinished/separate.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB)
112$(PUZZLES_OBJDIR)/sgt-slide.rock: $(PUZZLES_OBJDIR)/unfinished/slide.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB)
113$(PUZZLES_OBJDIR)/sgt-sokoban.rock: $(PUZZLES_OBJDIR)/unfinished/sokoban.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB)
109endif 114endif
110 115
111# special pattern rule for compiling puzzles with extra flags 116# special pattern rule for compiling puzzles with extra flags
112$(PUZZLES_OBJDIR)/%.o: $(PUZZLES_SRCDIR)/%.c $(PUZZLES_SRCDIR)/puzzles.make 117$(PUZZLES_OBJDIR)/%.o: $(PUZZLES_SRCDIR)/%.c $(PUZZLES_SRCDIR)/puzzles.make
113 $(SILENT)mkdir -p $(dir $@) 118 $(SILENT)mkdir -p $(dir $@)
114 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PUZZLESFLAGS) -c $< -o $@ 119 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PUZZLESFLAGS) -c $< -o $@
120
121$(PUZZLES_OBJDIR)/unfinished/%.o: $(PUZZLES_SRCDIR)/unfinished/%.c $(PUZZLES_SRCDIR)/puzzles.make
122 $(SILENT)mkdir -p $(dir $@)
123 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PUZZLESFLAGS) -c $< -o $@
diff --git a/apps/plugins/puzzles/rbwrappers.c b/apps/plugins/puzzles/rbwrappers.c
index b553a66dfc..2762194de3 100644
--- a/apps/plugins/puzzles/rbwrappers.c
+++ b/apps/plugins/puzzles/rbwrappers.c
@@ -1013,101 +1013,10 @@ float sqrt_wrapper(float x)
1013 return z; 1013 return z;
1014} 1014}
1015 1015
1016/* @(#)e_acos.c 1.3 95/01/18 */ 1016/* hack, simple trig */
1017/*
1018 * ====================================================
1019 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
1020 *
1021 * Developed at SunSoft, a Sun Microsystems, Inc. business.
1022 * Permission to use, copy, modify, and distribute this
1023 * software is freely granted, provided that this notice
1024 * is preserved.
1025 * ====================================================
1026 */
1027
1028/* __ieee754_acos(x)
1029 * Method :
1030 * acos(x) = pi/2 - asin(x)
1031 * acos(-x) = pi/2 + asin(x)
1032 * For |x|<=0.5
1033 * acos(x) = pi/2 - (x + x*x^2*R(x^2)) (see asin.c)
1034 * For x>0.5
1035 * acos(x) = pi/2 - (pi/2 - 2asin(sqrt((1-x)/2)))
1036 * = 2asin(sqrt((1-x)/2))
1037 * = 2s + 2s*z*R(z) ...z=(1-x)/2, s=sqrt(z)
1038 * = 2f + (2c + 2s*z*R(z))
1039 * where f=hi part of s, and c = (z-f*f)/(s+f) is the correction term
1040 * for f so that f+c ~ sqrt(z).
1041 * For x<-0.5
1042 * acos(x) = pi - 2asin(sqrt((1-|x|)/2))
1043 * = pi - 0.5*(s+s*z*R(z)), where z=(1-|x|)/2,s=sqrt(z)
1044 *
1045 * Special cases:
1046 * if x is NaN, return x itself;
1047 * if |x|>1, return NaN with invalid signal.
1048 *
1049 * Function needed: sqrt
1050 */
1051
1052#ifdef __STDC__
1053static const double
1054#else
1055static double
1056#endif
1057pio2_hi = 1.57079632679489655800e+00, /* 0x3FF921FB, 0x54442D18 */
1058pio2_lo = 6.12323399573676603587e-17, /* 0x3C91A626, 0x33145C07 */
1059pS0 = 1.66666666666666657415e-01, /* 0x3FC55555, 0x55555555 */
1060pS1 = -3.25565818622400915405e-01, /* 0xBFD4D612, 0x03EB6F7D */
1061pS2 = 2.01212532134862925881e-01, /* 0x3FC9C155, 0x0E884455 */
1062pS3 = -4.00555345006794114027e-02, /* 0xBFA48228, 0xB5688F3B */
1063pS4 = 7.91534994289814532176e-04, /* 0x3F49EFE0, 0x7501B288 */
1064pS5 = 3.47933107596021167570e-05, /* 0x3F023DE1, 0x0DFDF709 */
1065qS1 = -2.40339491173441421878e+00, /* 0xC0033A27, 0x1C8A2D4B */
1066qS2 = 2.02094576023350569471e+00, /* 0x40002AE5, 0x9C598AC8 */
1067qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */
1068qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
1069
1070double acos_wrapper(double x) 1017double acos_wrapper(double x)
1071{ 1018{
1072 double z,p,q,r,w,s,c,df; 1019 return atan2_wrapper(sqrt_wrapper(1.0 - x * x), x);
1073 int hx,ix;
1074 hx = __HI(x);
1075 ix = hx&0x7fffffff;
1076 if(ix>=0x3ff00000) { /* |x| >= 1 */
1077 if(((ix-0x3ff00000)|__LO(x))==0) { /* |x|==1 */
1078 if(hx>0) return 0.0; /* acos(1) = 0 */
1079 else return pi+2.0*pio2_lo; /* acos(-1)= pi */
1080 }
1081 return (x-x)/(x-x); /* acos(|x|>1) is NaN */
1082 }
1083 if(ix<0x3fe00000) { /* |x| < 0.5 */
1084 if(ix<=0x3c600000) return pio2_hi+pio2_lo;/*if|x|<2**-57*/
1085 z = x*x;
1086 p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
1087 q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
1088 r = p/q;
1089 return pio2_hi - (x - (pio2_lo-x*r));
1090 } else if (hx<0) { /* x < -0.5 */
1091 z = (one+x)*0.5;
1092 p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
1093 q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
1094 s = sqrt_wrapper(z);
1095 r = p/q;
1096 w = r*s-pio2_lo;
1097 return pi - 2.0*(s+w);
1098 } else { /* x > 0.5 */
1099 z = (one-x)*0.5;
1100 s = sqrt_wrapper(z);
1101 df = s;
1102 __LO(df) = 0;
1103 c = (z-df*df)/(s+df);
1104 p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
1105 q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
1106 r = p/q;
1107 w = r*s+c;
1108 return 2.0*(df+w);
1109 }
1110
1111} 1020}
1112 1021
1113/* 1022/*
diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c
index aac2781c5d..b64ab7559f 100644
--- a/apps/plugins/puzzles/rockbox.c
+++ b/apps/plugins/puzzles/rockbox.c
@@ -699,6 +699,10 @@ static void do_configure_item(config_item *cfg)
699 { 699 {
700 bool res = cfg->ival != 0; 700 bool res = cfg->ival != 0;
701 rb->set_bool(cfg->name, &res); 701 rb->set_bool(cfg->name, &res);
702
703 /* seems to reset backdrop */
704 rb->lcd_set_backdrop(NULL);
705
702 cfg->ival = res; 706 cfg->ival = res;
703 break; 707 break;
704 } 708 }