diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/CATEGORIES | 4 | ||||
-rw-r--r-- | apps/plugins/puzzles/SOURCES.games | 6 | ||||
-rw-r--r-- | apps/plugins/puzzles/puzzles.make | 11 | ||||
-rw-r--r-- | apps/plugins/puzzles/rbwrappers.c | 95 | ||||
-rw-r--r-- | apps/plugins/puzzles/rockbox.c | 4 |
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 | |||
102 | sgt-flip,games | 102 | sgt-flip,games |
103 | sgt-flood,games | 103 | sgt-flood,games |
104 | sgt-galaxies,games | 104 | sgt-galaxies,games |
105 | sgt-group,games | ||
105 | sgt-guess,games | 106 | sgt-guess,games |
106 | sgt-inertia,games | 107 | sgt-inertia,games |
107 | sgt-keen,games | 108 | sgt-keen,games |
@@ -119,10 +120,13 @@ sgt-pegs,games | |||
119 | sgt-range,games | 120 | sgt-range,games |
120 | sgt-rect,games | 121 | sgt-rect,games |
121 | sgt-samegame,games | 122 | sgt-samegame,games |
123 | sgt-separate,games | ||
122 | sgt-signpost,games | 124 | sgt-signpost,games |
123 | sgt-singles,games | 125 | sgt-singles,games |
124 | sgt-sixteen,games | 126 | sgt-sixteen,games |
125 | sgt-slant,games | 127 | sgt-slant,games |
128 | sgt-slide,games | ||
129 | sgt-sokoban,games | ||
126 | sgt-solo,games | 130 | sgt-solo,games |
127 | sgt-tents,games | 131 | sgt-tents,games |
128 | sgt-towers,games | 132 | sgt-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*/ |
40 | unruly.c | 40 | unruly.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: |
46 | PUZZLESFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -Os \ | 46 | PUZZLESFLAGS = $(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) |
49 | ifdef PUZZLES_COMBINED | 49 | ifdef PUZZLES_COMBINED |
50 | PUZZLESFLAGS += -DCOMBINED | 50 | PUZZLESFLAGS += -DCOMBINED |
51 | endif | 51 | endif |
@@ -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) | ||
109 | endif | 114 | endif |
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__ | ||
1053 | static const double | ||
1054 | #else | ||
1055 | static double | ||
1056 | #endif | ||
1057 | pio2_hi = 1.57079632679489655800e+00, /* 0x3FF921FB, 0x54442D18 */ | ||
1058 | pio2_lo = 6.12323399573676603587e-17, /* 0x3C91A626, 0x33145C07 */ | ||
1059 | pS0 = 1.66666666666666657415e-01, /* 0x3FC55555, 0x55555555 */ | ||
1060 | pS1 = -3.25565818622400915405e-01, /* 0xBFD4D612, 0x03EB6F7D */ | ||
1061 | pS2 = 2.01212532134862925881e-01, /* 0x3FC9C155, 0x0E884455 */ | ||
1062 | pS3 = -4.00555345006794114027e-02, /* 0xBFA48228, 0xB5688F3B */ | ||
1063 | pS4 = 7.91534994289814532176e-04, /* 0x3F49EFE0, 0x7501B288 */ | ||
1064 | pS5 = 3.47933107596021167570e-05, /* 0x3F023DE1, 0x0DFDF709 */ | ||
1065 | qS1 = -2.40339491173441421878e+00, /* 0xC0033A27, 0x1C8A2D4B */ | ||
1066 | qS2 = 2.02094576023350569471e+00, /* 0x40002AE5, 0x9C598AC8 */ | ||
1067 | qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */ | ||
1068 | qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */ | ||
1069 | |||
1070 | double acos_wrapper(double x) | 1017 | double 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 | } |