diff options
author | Zakk Roberts <midk@rockbox.org> | 2006-04-09 09:39:16 +0000 |
---|---|---|
committer | Zakk Roberts <midk@rockbox.org> | 2006-04-09 09:39:16 +0000 |
commit | d47e87e6ac3ddee0e45c16e24a22d9bc05c07bdd (patch) | |
tree | f80d8a7ac3b91427eec05bfa5b8a054c55031c7d /apps/plugins | |
parent | 72232bdc663f6437d77e8495c8b8c0ec1245f808 (diff) | |
download | rockbox-d47e87e6ac3ddee0e45c16e24a22d9bc05c07bdd.tar.gz rockbox-d47e87e6ac3ddee0e45c16e24a22d9bc05c07bdd.zip |
Patch FS#4952 by Tom Ross, with changes by me: Snake 2 now uses external bitmaps for build, and is fully adapted to larger LCDs. Also some keymapping changes and usability adjustments.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9572 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
32 files changed, 333 insertions, 454 deletions
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index 0718ffab86..d019cb8924 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES | |||
@@ -61,6 +61,45 @@ jewels.220x176x16.bmp | |||
61 | jewels.320x240x16.bmp | 61 | jewels.320x240x16.bmp |
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | /* Snake2 */ | ||
65 | #if (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) && (LCD_DEPTH >= 16) | ||
66 | snake2_header1.320x240x16.bmp | ||
67 | snake2_header2.320x240x16.bmp | ||
68 | snake2_left.320x240x16.bmp | ||
69 | snake2_right.320x240x16.bmp | ||
70 | snake2_bottom.320x240x16.bmp | ||
71 | #elif (LCD_WIDTH >= 240) && (LCD_HEIGHT >= 192) && (LCD_DEPTH >= 16) | ||
72 | snake2_header1.240x320x16.bmp | ||
73 | snake2_header2.240x320x16.bmp | ||
74 | snake2_left.240x320x16.bmp | ||
75 | snake2_right.240x320x16.bmp | ||
76 | snake2_bottom.240x320x16.bmp | ||
77 | #elif (LCD_WIDTH >= 220) && (LCD_HEIGHT >= 176) && (LCD_DEPTH >= 16) | ||
78 | snake2_header1.220x176x16.bmp | ||
79 | snake2_header2.220x176x16.bmp | ||
80 | snake2_left.220x176x16.bmp | ||
81 | snake2_right.220x176x16.bmp | ||
82 | snake2_bottom.220x176x16.bmp | ||
83 | #elif (LCD_WIDTH >= 176) && (LCD_HEIGHT >= 132) && (LCD_DEPTH >= 16) | ||
84 | snake2_header1.176x132x16.bmp | ||
85 | snake2_header2.176x132x16.bmp | ||
86 | snake2_left.176x132x16.bmp | ||
87 | snake2_right.176x132x16.bmp | ||
88 | snake2_bottom.176x132x16.bmp | ||
89 | #elif (LCD_WIDTH >= 160) && (LCD_HEIGHT >= 128) && (LCD_DEPTH >= 16) | ||
90 | snake2_header1.160x128x16.bmp | ||
91 | snake2_header2.160x128x16.bmp | ||
92 | snake2_left.160x128x16.bmp | ||
93 | snake2_right.160x128x16.bmp | ||
94 | snake2_bottom.160x128x16.bmp | ||
95 | #elif (LCD_WIDTH >= 160) && (LCD_HEIGHT >= 128) && (LCD_DEPTH >= 1) | ||
96 | snake2_header1.160x128x2.bmp | ||
97 | snake2_header2.160x128x2.bmp | ||
98 | snake2_left.160x128x2.bmp | ||
99 | snake2_right.160x128x2.bmp | ||
100 | snake2_bottom.160x128x2.bmp | ||
101 | #endif | ||
102 | |||
64 | /* Solitaire */ | 103 | /* Solitaire */ |
65 | #ifdef HAVE_LCD_COLOR | 104 | #ifdef HAVE_LCD_COLOR |
66 | #if (LCD_WIDTH >= 220) && (LCD_HEIGHT >= 176) | 105 | #if (LCD_WIDTH >= 220) && (LCD_HEIGHT >= 176) |
diff --git a/apps/plugins/bitmaps/native/snake2_bottom.160x128x16.bmp b/apps/plugins/bitmaps/native/snake2_bottom.160x128x16.bmp new file mode 100644 index 0000000000..9a4bda83eb --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_bottom.160x128x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_bottom.160x128x2.bmp b/apps/plugins/bitmaps/native/snake2_bottom.160x128x2.bmp new file mode 100644 index 0000000000..9b03cd0791 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_bottom.160x128x2.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_bottom.176x132x16.bmp b/apps/plugins/bitmaps/native/snake2_bottom.176x132x16.bmp new file mode 100644 index 0000000000..6849276b0c --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_bottom.176x132x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_bottom.220x176x16.bmp b/apps/plugins/bitmaps/native/snake2_bottom.220x176x16.bmp new file mode 100644 index 0000000000..51af40dd83 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_bottom.220x176x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_bottom.240x320x16.bmp b/apps/plugins/bitmaps/native/snake2_bottom.240x320x16.bmp new file mode 100644 index 0000000000..dae961a5e3 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_bottom.240x320x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_bottom.320x240x16.bmp b/apps/plugins/bitmaps/native/snake2_bottom.320x240x16.bmp new file mode 100644 index 0000000000..8eaa4ed3fb --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_bottom.320x240x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_header1.160x128x16.bmp b/apps/plugins/bitmaps/native/snake2_header1.160x128x16.bmp new file mode 100644 index 0000000000..8950429641 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_header1.160x128x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_header1.160x128x2.bmp b/apps/plugins/bitmaps/native/snake2_header1.160x128x2.bmp new file mode 100644 index 0000000000..5174f5ce02 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_header1.160x128x2.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_header1.176x132x16.bmp b/apps/plugins/bitmaps/native/snake2_header1.176x132x16.bmp new file mode 100644 index 0000000000..3f38d11129 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_header1.176x132x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_header1.220x176x16.bmp b/apps/plugins/bitmaps/native/snake2_header1.220x176x16.bmp new file mode 100644 index 0000000000..6e13c6b00d --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_header1.220x176x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_header1.240x320x16.bmp b/apps/plugins/bitmaps/native/snake2_header1.240x320x16.bmp new file mode 100644 index 0000000000..d1b87728dd --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_header1.240x320x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_header1.320x240x16.bmp b/apps/plugins/bitmaps/native/snake2_header1.320x240x16.bmp new file mode 100644 index 0000000000..54c0026219 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_header1.320x240x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_header2.160x128x16.bmp b/apps/plugins/bitmaps/native/snake2_header2.160x128x16.bmp new file mode 100644 index 0000000000..2d1c318799 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_header2.160x128x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_header2.160x128x2.bmp b/apps/plugins/bitmaps/native/snake2_header2.160x128x2.bmp new file mode 100644 index 0000000000..2b5e726d52 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_header2.160x128x2.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_header2.176x132x16.bmp b/apps/plugins/bitmaps/native/snake2_header2.176x132x16.bmp new file mode 100644 index 0000000000..73b031be8d --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_header2.176x132x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_header2.220x176x16.bmp b/apps/plugins/bitmaps/native/snake2_header2.220x176x16.bmp new file mode 100644 index 0000000000..3f71108eb7 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_header2.220x176x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_header2.240x320x16.bmp b/apps/plugins/bitmaps/native/snake2_header2.240x320x16.bmp new file mode 100644 index 0000000000..32e40227f1 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_header2.240x320x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_header2.320x240x16.bmp b/apps/plugins/bitmaps/native/snake2_header2.320x240x16.bmp new file mode 100644 index 0000000000..a7b9fe82cd --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_header2.320x240x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_left.160x128x16.bmp b/apps/plugins/bitmaps/native/snake2_left.160x128x16.bmp new file mode 100644 index 0000000000..1f35a950f6 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_left.160x128x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_left.160x128x2.bmp b/apps/plugins/bitmaps/native/snake2_left.160x128x2.bmp new file mode 100644 index 0000000000..32078ee995 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_left.160x128x2.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_left.176x132x16.bmp b/apps/plugins/bitmaps/native/snake2_left.176x132x16.bmp new file mode 100644 index 0000000000..3cf57d9d4d --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_left.176x132x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_left.220x176x16.bmp b/apps/plugins/bitmaps/native/snake2_left.220x176x16.bmp new file mode 100644 index 0000000000..aacb0dd9e2 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_left.220x176x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_left.240x320x16.bmp b/apps/plugins/bitmaps/native/snake2_left.240x320x16.bmp new file mode 100644 index 0000000000..a3a78a6b63 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_left.240x320x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_left.320x240x16.bmp b/apps/plugins/bitmaps/native/snake2_left.320x240x16.bmp new file mode 100644 index 0000000000..1a2eac252f --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_left.320x240x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_right.160x128x16.bmp b/apps/plugins/bitmaps/native/snake2_right.160x128x16.bmp new file mode 100644 index 0000000000..ccedcbde39 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_right.160x128x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_right.160x128x2.bmp b/apps/plugins/bitmaps/native/snake2_right.160x128x2.bmp new file mode 100644 index 0000000000..53361d7014 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_right.160x128x2.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_right.176x132x16.bmp b/apps/plugins/bitmaps/native/snake2_right.176x132x16.bmp new file mode 100644 index 0000000000..7a6a01af49 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_right.176x132x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_right.220x176x16.bmp b/apps/plugins/bitmaps/native/snake2_right.220x176x16.bmp new file mode 100644 index 0000000000..a7f60aba64 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_right.220x176x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_right.240x320x16.bmp b/apps/plugins/bitmaps/native/snake2_right.240x320x16.bmp new file mode 100644 index 0000000000..8fa2d95270 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_right.240x320x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/snake2_right.320x240x16.bmp b/apps/plugins/bitmaps/native/snake2_right.320x240x16.bmp new file mode 100644 index 0000000000..9fd9884195 --- /dev/null +++ b/apps/plugins/bitmaps/native/snake2_right.320x240x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c index da83c00f7d..1cfbdf972b 100644 --- a/apps/plugins/snake2.c +++ b/apps/plugins/snake2.c | |||
@@ -20,7 +20,7 @@ | |||
20 | /* | 20 | /* |
21 | Snake2! | 21 | Snake2! |
22 | 22 | ||
23 | Board consists of a WIDTHxHEIGHT grid. If board element is 0 then nothing is | 23 | Board consists of a WIDTHxHEIGHT grid. If board element is 0 then nothing is |
24 | there otherwise it is part of the snake or a wall. | 24 | there otherwise it is part of the snake or a wall. |
25 | 25 | ||
26 | Head and Tail are stored | 26 | Head and Tail are stored |
@@ -35,16 +35,106 @@ PLUGIN_HEADER | |||
35 | #define WIDTH 28 | 35 | #define WIDTH 28 |
36 | #define HEIGHT 16 | 36 | #define HEIGHT 16 |
37 | 37 | ||
38 | #if LCD_WIDTH >= 160 && LCD_HEIGHT >= 128 | 38 | #if (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) |
39 | #define MULTIPLIER 5 /*Modifier for porting on other screens*/ | 39 | #define MULTIPLIER 10 /*Modifier for porting on other screens*/ |
40 | #define MODIFIER_1 10 | ||
41 | #define MODIFIER_2 8 | ||
42 | #define CENTER_X 20 | ||
43 | #define CENTER_Y 55 | ||
44 | #define TOP_X1 34 /* x-coord of the upperleft item (game type) */ | ||
45 | #define TOP_X2 281 /* x-coord of the upperright item (maze type) */ | ||
46 | #define TOP_X3 42 /* x-coord of the lowerleft item (speed) */ | ||
47 | #define TOP_X4 274 /* x-coord of the lowerright item (hi-score) */ | ||
48 | #define TOP_Y1 4 /* y-coord of the top row of items */ | ||
49 | #define TOP_Y2 25 /* y-coord of the bottom row of items */ | ||
50 | #define BMPHEIGHT_snake2_header 38 | ||
51 | #define BMPWIDTH_snake2_header 320 | ||
52 | #define BMPHEIGHT_snake2_right 192 | ||
53 | #define BMPWIDTH_snake2_right 10 | ||
54 | #define BMPHEIGHT_snake2_left 192 | ||
55 | #define BMPWIDTH_snake2_left 10 | ||
56 | #define BMPHEIGHT_snake2_bottom 10 | ||
57 | #define BMPWIDTH_snake2_bottom 320 | ||
58 | #elif (LCD_WIDTH >= 240) && (LCD_HEIGHT >= 168) | ||
59 | #define MULTIPLIER 8 | ||
60 | #define MODIFIER_1 8 | ||
61 | #define MODIFIER_2 6 | ||
62 | #define CENTER_X 8 | ||
63 | #define CENTER_Y 34 | ||
64 | #define TOP_X1 34 | ||
65 | #define TOP_X2 201 | ||
66 | #define TOP_X3 42 | ||
67 | #define TOP_X4 194 | ||
68 | #define TOP_Y1 4 | ||
69 | #define TOP_Y2 25 | ||
70 | #define BMPHEIGHT_snake2_header 38 | ||
71 | #define BMPWIDTH_snake2_header 240 | ||
72 | #define BMPHEIGHT_snake2_right 120 | ||
73 | #define BMPWIDTH_snake2_right 10 | ||
74 | #define BMPHEIGHT_snake2_left 120 | ||
75 | #define BMPWIDTH_snake2_left 10 | ||
76 | #define BMPHEIGHT_snake2_bottom 10 | ||
77 | #define BMPWIDTH_snake2_bottom 240 | ||
78 | #elif (LCD_WIDTH >= 220) && (LCD_HEIGHT >= 176) | ||
79 | #define MULTIPLIER 7 | ||
80 | #define MODIFIER_1 7 | ||
81 | #define MODIFIER_2 5 | ||
82 | #define CENTER_X 12 | ||
83 | #define CENTER_Y 46 | ||
84 | #define TOP_X1 34 | ||
85 | #define TOP_X2 181 | ||
86 | #define TOP_X3 42 | ||
87 | #define TOP_X4 174 | ||
88 | #define TOP_Y1 4 | ||
89 | #define TOP_Y2 25 | ||
90 | #define BMPHEIGHT_snake2_header 38 | ||
91 | #define BMPWIDTH_snake2_header 220 | ||
92 | #define BMPHEIGHT_snake2_right 128 | ||
93 | #define BMPWIDTH_snake2_right 10 | ||
94 | #define BMPHEIGHT_snake2_left 128 | ||
95 | #define BMPWIDTH_snake2_left 10 | ||
96 | #define BMPHEIGHT_snake2_bottom 10 | ||
97 | #define BMPWIDTH_snake2_bottom 220 | ||
98 | #elif (LCD_WIDTH >= 176) && (LCD_HEIGHT >= 132) | ||
99 | #define MULTIPLIER 5 | ||
100 | #define MODIFIER_1 5 | ||
101 | #define MODIFIER_2 3 | ||
102 | #define CENTER_X 18 | ||
103 | #define CENTER_Y 40 | ||
104 | #define TOP_X1 34 | ||
105 | #define TOP_X2 137 | ||
106 | #define TOP_X3 42 | ||
107 | #define TOP_X4 130 | ||
108 | #define TOP_Y1 4 | ||
109 | #define TOP_Y2 25 | ||
110 | #define BMPHEIGHT_snake2_header 38 | ||
111 | #define BMPWIDTH_snake2_header 176 | ||
112 | #define BMPHEIGHT_snake2_right 84 | ||
113 | #define BMPWIDTH_snake2_right 10 | ||
114 | #define BMPHEIGHT_snake2_left 84 | ||
115 | #define BMPWIDTH_snake2_left 10 | ||
116 | #define BMPHEIGHT_snake2_bottom 10 | ||
117 | #define BMPWIDTH_snake2_bottom 176 | ||
118 | #elif (LCD_WIDTH >= 160) && (LCD_HEIGHT >= 128) | ||
119 | #define MULTIPLIER 5 | ||
40 | #define MODIFIER_1 5 | 120 | #define MODIFIER_1 5 |
41 | #define MODIFIER_2 3 | 121 | #define MODIFIER_2 3 |
42 | #define CENTER_X 10 | 122 | #define CENTER_X 10 |
43 | #define CENTER_Y 38 | 123 | #define CENTER_Y 38 |
44 | #define BMPHEIGHT_snakebmp 128 | 124 | #define TOP_X1 34 |
45 | #define BMPWIDTH_snakebmp 160 | 125 | #define TOP_X2 121 |
46 | #define BMPHEIGHT_snakeupbmp 36 | 126 | #define TOP_X3 42 |
47 | #define BMPWIDTH_snakeupbmp 160 | 127 | #define TOP_X4 114 |
128 | #define TOP_Y1 4 | ||
129 | #define TOP_Y2 25 | ||
130 | #define BMPHEIGHT_snake2_header 38 | ||
131 | #define BMPWIDTH_snake2_header 160 | ||
132 | #define BMPHEIGHT_snake2_right 80 | ||
133 | #define BMPWIDTH_snake2_right 10 | ||
134 | #define BMPHEIGHT_snake2_left 80 | ||
135 | #define BMPWIDTH_snake2_left 10 | ||
136 | #define BMPHEIGHT_snake2_bottom 10 | ||
137 | #define BMPWIDTH_snake2_bottom 160 | ||
48 | #else | 138 | #else |
49 | #define MULTIPLIER 4 | 139 | #define MULTIPLIER 4 |
50 | #define MODIFIER_1 4 | 140 | #define MODIFIER_1 4 |
@@ -54,21 +144,18 @@ PLUGIN_HEADER | |||
54 | 144 | ||
55 | #endif | 145 | #endif |
56 | 146 | ||
57 | |||
58 | |||
59 | |||
60 | /* variable button definitions */ | 147 | /* variable button definitions */ |
61 | #if CONFIG_KEYPAD == RECORDER_PAD | 148 | #if CONFIG_KEYPAD == RECORDER_PAD |
62 | #define SNAKE2_UP BUTTON_UP | 149 | #define SNAKE2_UP BUTTON_UP |
63 | #define SNAKE2_DOWN BUTTON_DOWN | 150 | #define SNAKE2_DOWN BUTTON_DOWN |
64 | #define SNAKE2_QUIT BUTTON_OFF | 151 | #define SNAKE2_QUIT BUTTON_OFF |
65 | #define SNAKE2_LEVEL_UP BUTTON_UP | 152 | #define SNAKE2_LEVEL_UP BUTTON_UP |
66 | #define SNAKE2_LEVEL_UP2 BUTTON_RIGHT | ||
67 | #define SNAKE2_LEVEL_DOWN BUTTON_DOWN | 153 | #define SNAKE2_LEVEL_DOWN BUTTON_DOWN |
68 | #define SNAKE2_LEVEL_DOWN2 BUTTON_LEFT | 154 | #define SNAKE2_MAZE_NEXT BUTTON_RIGHT |
69 | #define SNAKE2_SELECT_MAZE BUTTON_F1 | 155 | #define SNAKE2_MAZE_LAST BUTTON_LEFT |
70 | #define SNAKE2_SELECT_TYPE BUTTON_F3 | 156 | #define SNAKE2_SELECT_TYPE BUTTON_F3 |
71 | #define SNAKE2_PLAYPAUSE BUTTON_PLAY | 157 | #define SNAKE2_PLAYPAUSE BUTTON_PLAY |
158 | #define SNAKE2_PLAYPAUSE_TEXT "Play" | ||
72 | 159 | ||
73 | #elif CONFIG_KEYPAD == ONDIO_PAD | 160 | #elif CONFIG_KEYPAD == ONDIO_PAD |
74 | #define SNAKE2_UP BUTTON_UP | 161 | #define SNAKE2_UP BUTTON_UP |
@@ -76,9 +163,10 @@ PLUGIN_HEADER | |||
76 | #define SNAKE2_QUIT BUTTON_OFF | 163 | #define SNAKE2_QUIT BUTTON_OFF |
77 | #define SNAKE2_LEVEL_UP BUTTON_UP | 164 | #define SNAKE2_LEVEL_UP BUTTON_UP |
78 | #define SNAKE2_LEVEL_DOWN BUTTON_DOWN | 165 | #define SNAKE2_LEVEL_DOWN BUTTON_DOWN |
79 | #define SNAKE2_SELECT_MAZE BUTTON_LEFT | 166 | #define SNAKE2_MAZE_NEXT BUTTON_RIGHT |
80 | #define SNAKE2_SELECT_TYPE BUTTON_RIGHT | 167 | #define SNAKE2_SELECT_TYPE BUTTON_LEFT |
81 | #define SNAKE2_PLAYPAUSE BUTTON_MENU | 168 | #define SNAKE2_PLAYPAUSE BUTTON_MENU |
169 | #define SNAKE2_PLAYPAUSE_TEXT "Menu" | ||
82 | 170 | ||
83 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ | 171 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ |
84 | (CONFIG_KEYPAD == IRIVER_H300_PAD) | 172 | (CONFIG_KEYPAD == IRIVER_H300_PAD) |
@@ -86,12 +174,12 @@ PLUGIN_HEADER | |||
86 | #define SNAKE2_DOWN BUTTON_DOWN | 174 | #define SNAKE2_DOWN BUTTON_DOWN |
87 | #define SNAKE2_QUIT BUTTON_OFF | 175 | #define SNAKE2_QUIT BUTTON_OFF |
88 | #define SNAKE2_LEVEL_UP BUTTON_UP | 176 | #define SNAKE2_LEVEL_UP BUTTON_UP |
89 | #define SNAKE2_LEVEL_UP2 BUTTON_RIGHT | ||
90 | #define SNAKE2_LEVEL_DOWN BUTTON_DOWN | 177 | #define SNAKE2_LEVEL_DOWN BUTTON_DOWN |
91 | #define SNAKE2_LEVEL_DOWN2 BUTTON_LEFT | 178 | #define SNAKE2_MAZE_NEXT BUTTON_RIGHT |
92 | #define SNAKE2_SELECT_MAZE BUTTON_REC | 179 | #define SNAKE2_MAZE_LAST BUTTON_LEFT |
93 | #define SNAKE2_SELECT_TYPE BUTTON_MODE | 180 | #define SNAKE2_SELECT_TYPE BUTTON_MODE |
94 | #define SNAKE2_PLAYPAUSE BUTTON_ON | 181 | #define SNAKE2_PLAYPAUSE BUTTON_ON |
182 | #define SNAKE2_PLAYPAUSE_TEXT "Play" | ||
95 | 183 | ||
96 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \ | 184 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \ |
97 | (CONFIG_KEYPAD == IPOD_3G_PAD) | 185 | (CONFIG_KEYPAD == IPOD_3G_PAD) |
@@ -100,31 +188,35 @@ PLUGIN_HEADER | |||
100 | #define SNAKE2_QUIT (BUTTON_SELECT | BUTTON_MENU) | 188 | #define SNAKE2_QUIT (BUTTON_SELECT | BUTTON_MENU) |
101 | #define SNAKE2_LEVEL_UP BUTTON_SCROLL_FWD | 189 | #define SNAKE2_LEVEL_UP BUTTON_SCROLL_FWD |
102 | #define SNAKE2_LEVEL_DOWN BUTTON_SCROLL_BACK | 190 | #define SNAKE2_LEVEL_DOWN BUTTON_SCROLL_BACK |
103 | #define SNAKE2_SELECT_MAZE BUTTON_LEFT | 191 | #define SNAKE2_MAZE_NEXT BUTTON_RIGHT |
104 | #define SNAKE2_SELECT_TYPE BUTTON_RIGHT | 192 | #define SNAKE2_MAZE_LAST BUTTON_LEFT |
193 | #define SNAKE2_SELECT_TYPE BUTTON_PLAY | ||
105 | #define SNAKE2_PLAYPAUSE BUTTON_SELECT | 194 | #define SNAKE2_PLAYPAUSE BUTTON_SELECT |
195 | #define SNAKE2_PLAYPAUSE_TEXT "Select" | ||
106 | 196 | ||
107 | #elif (CONFIG_KEYPAD == IAUDIO_X5_PAD) | 197 | #elif (CONFIG_KEYPAD == IAUDIO_X5_PAD) |
108 | #define SNAKE2_UP BUTTON_UP | 198 | #define SNAKE2_UP BUTTON_UP |
109 | #define SNAKE2_DOWN BUTTON_DOWN | 199 | #define SNAKE2_DOWN BUTTON_DOWN |
110 | #define SNAKE2_QUIT BUTTON_POWER | 200 | #define SNAKE2_QUIT BUTTON_POWER |
111 | #define SNAKE2_LEVEL_UP BUTTON_REC | 201 | #define SNAKE2_LEVEL_UP BUTTON_UP |
112 | #define SNAKE2_LEVEL_DOWN BUTTON_PLAY | 202 | #define SNAKE2_LEVEL_DOWN BUTTON_DOWN |
113 | #define SNAKE2_SELECT_MAZE BUTTON_LEFT | 203 | #define SNAKE2_MAZE_NEXT BUTTON_RIGHT |
114 | #define SNAKE2_SELECT_TYPE BUTTON_RIGHT | 204 | #define SNAKE2_MAZE_LAST BUTTON_LEFT |
205 | #define SNAKE2_SELECT_TYPE BUTTON_PLAY | ||
115 | #define SNAKE2_PLAYPAUSE BUTTON_SELECT | 206 | #define SNAKE2_PLAYPAUSE BUTTON_SELECT |
207 | #define SNAKE2_PLAYPAUSE_TEXT "Select" | ||
116 | 208 | ||
117 | #elif (CONFIG_KEYPAD == GIGABEAT_PAD) | 209 | #elif (CONFIG_KEYPAD == GIGABEAT_PAD) |
118 | #define SNAKE2_UP BUTTON_UP | 210 | #define SNAKE2_UP BUTTON_UP |
119 | #define SNAKE2_DOWN BUTTON_DOWN | 211 | #define SNAKE2_DOWN BUTTON_DOWN |
120 | #define SNAKE2_QUIT BUTTON_A | 212 | #define SNAKE2_QUIT BUTTON_A |
121 | #define SNAKE2_LEVEL_UP BUTTON_UP | 213 | #define SNAKE2_LEVEL_UP BUTTON_UP |
122 | #define SNAKE2_LEVEL_UP2 BUTTON_RIGHT | ||
123 | #define SNAKE2_LEVEL_DOWN BUTTON_DOWN | 214 | #define SNAKE2_LEVEL_DOWN BUTTON_DOWN |
124 | #define SNAKE2_LEVEL_DOWN2 BUTTON_LEFT | 215 | #define SNAKE2_MAZE_NEXT BUTTON_RIGHT |
125 | #define SNAKE2_SELECT_MAZE BUTTON_POWER | 216 | #define SNAKE2_MAZE_LAST BUTTON_LEFT |
126 | #define SNAKE2_SELECT_TYPE BUTTON_MENU | 217 | #define SNAKE2_SELECT_TYPE BUTTON_MENU |
127 | #define SNAKE2_PLAYPAUSE BUTTON_SELECT | 218 | #define SNAKE2_PLAYPAUSE BUTTON_SELECT |
219 | #define SNAKE2_PLAYPAUSE_TEXT "Select" | ||
128 | 220 | ||
129 | #else | 221 | #else |
130 | #error "lacks keymapping" | 222 | #error "lacks keymapping" |
@@ -136,7 +228,7 @@ static char (*level_cache)[HEIGHT][WIDTH]; | |||
136 | /*Board itself - 2D int array*/ | 228 | /*Board itself - 2D int array*/ |
137 | static int board[WIDTH][HEIGHT]; | 229 | static int board[WIDTH][HEIGHT]; |
138 | /* | 230 | /* |
139 | Buffer for sorting movement (in case user presses two movements during a | 231 | Buffer for sorting movement (in case user presses two movements during a |
140 | single frame | 232 | single frame |
141 | */ | 233 | */ |
142 | static int ardirectionbuffer[2]; | 234 | static int ardirectionbuffer[2]; |
@@ -148,308 +240,38 @@ static int dir; | |||
148 | static int frames; | 240 | static int frames; |
149 | static int apple; | 241 | static int apple; |
150 | static int level = 4, speed = 5,dead = 0, quit = 0; | 242 | static int level = 4, speed = 5,dead = 0, quit = 0; |
151 | static int sillydir = 0, num_levels = 0; | 243 | static int sillydir = 0, num_levels = 0; |
152 | static int level_from_file = 1; | 244 | static int level_from_file = 0; |
153 | static struct plugin_api* rb; | 245 | static struct plugin_api* rb; |
154 | static int headx, heady, tailx, taily, applecountdown = 5; | 246 | static int headx, heady, tailx, taily, applecountdown = 5; |
155 | static int game_type = 0; | 247 | static int game_type = 0; |
156 | static int num_apples_to_get=1; | 248 | static int num_apples_to_get=1; |
157 | static int num_apples_to_got=0; | 249 | static int num_apples_to_got=0; |
158 | static int game_b_level=1; | 250 | static int game_b_level=0; |
159 | static int applecount=0; | 251 | static int applecount=0; |
160 | static char phscore[30]; | 252 | static char phscore[30]; |
161 | 253 | ||
162 | 254 | #if (LCD_WIDTH >= 160) && (LCD_HEIGHT >= 128) | |
163 | #ifdef BMPHEIGHT_snakebmp | 255 | #ifdef HAVE_LCD_COLOR |
164 | const unsigned char snakebmp[] = { | 256 | extern const unsigned short snake2_header1[]; |
165 | 0x00, 0x00, 0x00, 0xe0, 0x20, 0xa0, 0xa0, 0x00, 0xe0, 0xa0, 0xa0, 0xe0, 0x00, | 257 | extern const unsigned short snake2_header2[]; |
166 | 0xe0, 0x40, 0x80, 0x40, 0xe0, 0x00, 0xe0, 0xa0, 0xa0, 0xa0, 0x00, 0x00, 0xf0, | 258 | extern const unsigned short snake2_left[]; |
167 | 0x08, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, | 259 | extern const unsigned short snake2_right[]; |
168 | 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x04, 0x08, 0xf0, 0x00, 0x00, 0x00, | 260 | extern const unsigned short snake2_bottom[]; |
169 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x80, | 261 | #else |
170 | 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, | 262 | extern const unsigned char snake2_header1[]; |
171 | 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, | 263 | extern const unsigned char snake2_header2[]; |
172 | 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 264 | extern const unsigned char snake2_left[]; |
173 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x08, 0x04, 0x02, 0x02, 0x02, 0x02, | 265 | extern const unsigned char snake2_right[]; |
174 | 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, | 266 | extern const unsigned char snake2_bottom[]; |
175 | 0x02, 0x04, 0x08, 0xf0, 0x00, 0x00, 0xe0, 0x40, 0x80, 0x40, 0xe0, 0x00, 0xe0, | ||
176 | 0xa0, 0xa0, 0xe0, 0x00, 0x20, 0xa0, 0xa0, 0x60, 0x00, 0xe0, 0xa0, 0xa0, 0xa0, | ||
177 | 0x00, 0x00, 0x00, 0x00, | ||
178 | 0x00, 0x00, 0x00, 0x03, 0x02, 0x02, 0x03, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, | ||
179 | 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0xc3, 0x22, 0x22, 0x22, 0xc0, 0x00, 0x07, | ||
180 | 0x08, 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
181 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x08, 0x07, 0x00, 0x00, 0x00, | ||
182 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x27, 0x4c, 0x4c, 0x79, 0x3b, | ||
183 | 0x00, 0x40, 0x7f, 0x47, 0x0e, 0x1c, 0x38, 0x7f, 0x00, 0x40, 0x70, 0x5c, 0x13, | ||
184 | 0x13, 0x5f, 0x7c, 0x70, 0x40, 0x40, 0x7f, 0x7f, 0x48, 0x0c, 0x3e, 0x79, 0x60, | ||
185 | 0x40, 0x40, 0x7f, 0x7f, 0x44, 0x4e, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
186 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x20, 0x20, 0x20, 0x20, | ||
187 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
188 | 0x20, 0x10, 0x08, 0x07, 0x00, 0xe0, 0x13, 0x10, 0x10, 0xe0, 0x03, 0x00, 0x03, | ||
189 | 0x00, 0x00, 0x03, 0x00, 0x03, 0x02, 0x02, 0x02, 0x00, 0x03, 0x02, 0x02, 0x02, | ||
190 | 0x00, 0x00, 0x00, 0x00, | ||
191 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, | ||
192 | 0x80, 0x98, 0xa4, 0xa4, 0x98, 0x80, 0x81, 0x02, 0x82, 0x82, 0x01, 0x00, 0x00, | ||
193 | 0x00, 0x17, 0x15, 0x15, 0x1d, 0x80, 0x5f, 0x45, 0x45, 0x42, 0x40, 0x5f, 0x55, | ||
194 | 0x55, 0x55, 0x40, 0x5f, 0x55, 0x55, 0x55, 0x40, 0x5f, 0x51, 0x51, 0x4e, 0x40, | ||
195 | 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
196 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xf0, 0xf0, 0x10, | ||
197 | 0x00, 0x10, 0xf0, 0xf0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
198 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x04, 0x04, 0x1f, 0x80, 0x51, | ||
199 | 0x5f, 0x51, 0x44, 0x44, 0x44, 0x40, 0x57, 0x55, 0x55, 0x5d, 0x40, 0x5f, 0x51, | ||
200 | 0x51, 0x51, 0x40, 0x5f, 0x51, 0x51, 0x5f, 0x40, 0x5f, 0x45, 0x4d, 0x92, 0x00, | ||
201 | 0x1f, 0x15, 0x15, 0x15, 0x00, 0x00, 0x01, 0x81, 0x81, 0x00, 0x98, 0xa4, 0xa4, | ||
202 | 0x98, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
203 | 0x00, 0x00, 0x00, 0x00, | ||
204 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x30, 0xf8, 0x8c, 0x1a, 0x7f, 0xc0, | ||
205 | 0x90, 0x60, 0xc7, 0xce, 0x4c, 0x8f, 0x00, 0x47, 0x0e, 0x1e, 0x57, 0x90, 0xe0, | ||
206 | 0x00, 0x10, 0x28, 0xc6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
207 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
208 | 0x00, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
209 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0f, 0x0f, 0x08, | ||
210 | 0x00, 0x08, 0x0f, 0x0f, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
211 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, | ||
212 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
213 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, | ||
214 | 0xc6, 0x28, 0x10, 0x00, 0xe0, 0x90, 0x57, 0x1e, 0x0e, 0x47, 0x00, 0x8f, 0x4c, | ||
215 | 0xce, 0xc7, 0x60, 0x90, 0xc0, 0x7f, 0x1a, 0x8c, 0xf8, 0x30, 0x20, 0xc0, 0x00, | ||
216 | 0x00, 0x00, 0x00, 0x00, | ||
217 | 0x80, 0xf0, 0x9c, 0x16, 0x57, 0x4d, 0xe9, 0xa1, 0xf5, 0xfc, 0x36, 0x3b, 0x39, | ||
218 | 0x37, 0x33, 0x31, 0x30, 0x31, 0x32, 0x35, 0x35, 0x35, 0x35, 0x33, 0x30, 0x30, | ||
219 | 0x30, 0x30, 0x30, 0x30, 0x31, 0x32, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, | ||
220 | 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, | ||
221 | 0x34, 0x34, 0x32, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, | ||
222 | 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, | ||
223 | 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, | ||
224 | 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x32, 0x34, | ||
225 | 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, | ||
226 | 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x32, 0x31, | ||
227 | 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x35, 0x35, 0x35, 0x35, 0x32, 0x31, | ||
228 | 0x30, 0x31, 0x33, 0x37, 0x39, 0x3b, 0x36, 0xfc, 0xf5, 0xa1, 0xe9, 0x4d, 0x57, | ||
229 | 0x16, 0x9c, 0xf0, 0x80, | ||
230 | 0xff, 0x88, 0xad, 0x25, 0x77, 0x52, 0xda, 0x88, 0xff, 0xff, 0x00, 0x00, 0x00, | ||
231 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
232 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
233 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
234 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
235 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
236 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
237 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
238 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
239 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
240 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
241 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x88, 0xda, 0x52, 0x77, | ||
242 | 0x25, 0xad, 0x88, 0xff, | ||
243 | 0xff, 0x88, 0xad, 0x25, 0x77, 0x52, 0xda, 0x88, 0xff, 0xff, 0x00, 0x00, 0x00, | ||
244 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
245 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
246 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
247 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
248 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
249 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
250 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
251 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
252 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
253 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
254 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x88, 0xda, 0x52, 0x77, | ||
255 | 0x25, 0xad, 0x88, 0xff, | ||
256 | 0xff, 0x88, 0xad, 0x25, 0x77, 0x52, 0xda, 0x88, 0xff, 0xff, 0x00, 0x00, 0x00, | ||
257 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
258 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
259 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
260 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
261 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
262 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
263 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
264 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
265 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
266 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
267 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x88, 0xda, 0x52, 0x77, | ||
268 | 0x25, 0xad, 0x88, 0xff, | ||
269 | 0xff, 0x88, 0xad, 0x25, 0x77, 0x52, 0xda, 0x88, 0xff, 0xff, 0x00, 0x00, 0x00, | ||
270 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
271 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
272 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
273 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
274 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
275 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
276 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
277 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
278 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
279 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
280 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x88, 0xda, 0x52, 0x77, | ||
281 | 0x25, 0xad, 0x88, 0xff, | ||
282 | 0xff, 0x88, 0xad, 0x25, 0x77, 0x52, 0xda, 0x88, 0xff, 0xff, 0x00, 0x00, 0x00, | ||
283 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
284 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
285 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
286 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
287 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
288 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
289 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
290 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
291 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
292 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
293 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x88, 0xda, 0x52, 0x77, | ||
294 | 0x25, 0xad, 0x88, 0xff, | ||
295 | 0xff, 0x88, 0xad, 0x25, 0x77, 0x52, 0xda, 0x88, 0xff, 0xff, 0x00, 0x00, 0x00, | ||
296 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
297 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
298 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
299 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
300 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
301 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
302 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
303 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
304 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
305 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
306 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x88, 0xda, 0x52, 0x77, | ||
307 | 0x25, 0xad, 0x88, 0xff, | ||
308 | 0xff, 0x88, 0xad, 0x25, 0x77, 0x52, 0xda, 0x88, 0xff, 0xff, 0x00, 0x00, 0x00, | ||
309 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
310 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
311 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
312 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
313 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
314 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
315 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
316 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
317 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
318 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
319 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x88, 0xda, 0x52, 0x77, | ||
320 | 0x25, 0xad, 0x88, 0xff, | ||
321 | 0xff, 0x88, 0xad, 0x25, 0x77, 0x52, 0xda, 0x88, 0xff, 0xff, 0x00, 0x00, 0x00, | ||
322 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
323 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
324 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
325 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
326 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
327 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
328 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
329 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
330 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
331 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
332 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x88, 0xda, 0x52, 0x77, | ||
333 | 0x25, 0xad, 0x88, 0xff, | ||
334 | 0xff, 0x88, 0xad, 0x25, 0x77, 0x52, 0xda, 0x88, 0xff, 0xff, 0x00, 0x00, 0x00, | ||
335 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
336 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
337 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
338 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
339 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
340 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
341 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
342 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
343 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
344 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
345 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x88, 0xda, 0x52, 0x77, | ||
346 | 0x25, 0xad, 0x88, 0xff, | ||
347 | 0xff, 0x88, 0xad, 0x25, 0x77, 0x52, 0xda, 0x88, 0xff, 0xff, 0xc0, 0xc0, 0xc0, | ||
348 | 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, | ||
349 | 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, | ||
350 | 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, | ||
351 | 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, | ||
352 | 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, | ||
353 | 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, | ||
354 | 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, | ||
355 | 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, | ||
356 | 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, | ||
357 | 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, | ||
358 | 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xff, 0xff, 0x88, 0xda, 0x52, 0x77, | ||
359 | 0x25, 0xad, 0x88, 0xff, | ||
360 | 0x0f, 0x1c, 0x39, 0x6d, 0x77, 0xda, 0x8c, 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, | ||
361 | 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, | ||
362 | 0xb8, 0x8e, 0xe3, 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, 0xb8, 0x8e, | ||
363 | 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, | ||
364 | 0xe3, 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, 0xb8, 0x8e, 0xb8, 0xe3, | ||
365 | 0x8e, 0xb8, 0x8e, 0xe3, 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, 0xb8, | ||
366 | 0x8e, 0xb8, 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, 0xb8, 0x8e, 0xb8, | ||
367 | 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, | ||
368 | 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, | ||
369 | 0xb8, 0x8e, 0xe3, 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, 0xb8, 0x8e, | ||
370 | 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, | ||
371 | 0xe3, 0xb8, 0x8e, 0xb8, 0xe3, 0x8e, 0xb8, 0x8e, 0xe3, 0xb8, 0x8c, 0x5a, 0x77, | ||
372 | 0x6d, 0x39, 0x1c, 0x0f, | ||
373 | |||
374 | }; | ||
375 | #endif | 267 | #endif |
376 | |||
377 | #ifdef BMPHEIGHT_snakeupbmp | ||
378 | const unsigned char snakeupbmp[] = { | ||
379 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
380 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
381 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
382 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
383 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, | ||
384 | 0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, | ||
385 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, | ||
386 | 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
387 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
388 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
389 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
390 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
391 | 0x00, 0x00, 0x00, 0x00, | ||
392 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
393 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
394 | 0xc0, 0x40, 0x40, 0xc0, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x00, 0xc0, 0x40, 0x40, | ||
395 | 0x80, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x40, 0x00, 0xc0, | ||
396 | 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x27, 0x4c, 0x4c, 0x79, | ||
397 | 0x3b, 0x00, 0x40, 0x7f, 0x47, 0x0e, 0x1c, 0x38, 0x7f, 0x00, 0x40, 0x70, 0x5c, | ||
398 | 0x13, 0x13, 0x5f, 0x7c, 0x70, 0x40, 0x40, 0x7f, 0x7f, 0x48, 0x0c, 0x3e, 0x79, | ||
399 | 0x60, 0x40, 0x40, 0x7f, 0x7f, 0x44, 0x4e, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
400 | 0x00, 0x00, 0xc0, 0x40, 0x40, 0x40, 0x00, 0xc0, 0x40, 0x40, 0x40, 0x00, 0xc0, | ||
401 | 0x40, 0x40, 0xc0, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x00, 0xc0, 0x40, 0x40, 0x40, | ||
402 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
403 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
404 | 0x00, 0x00, 0x00, 0x00, | ||
405 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, | ||
406 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, | ||
407 | 0x07, 0x01, 0x01, 0x07, 0x00, 0x87, 0x41, 0x41, 0x40, 0x40, 0x47, 0x41, 0x41, | ||
408 | 0x40, 0x40, 0x47, 0x44, 0x44, 0x44, 0x40, 0x47, 0x45, 0x45, 0x45, 0x40, 0x45, | ||
409 | 0x45, 0x45, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
410 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xf0, 0xf0, | ||
411 | 0x10, 0x00, 0x10, 0xf0, 0xf0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
412 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, | ||
413 | 0x40, 0x40, 0x45, 0x45, 0x45, 0x47, 0x40, 0x47, 0x44, 0x44, 0x44, 0x40, 0x47, | ||
414 | 0x44, 0x44, 0x47, 0x40, 0x47, 0x41, 0x43, 0x44, 0x40, 0x47, 0x45, 0x85, 0x05, | ||
415 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, | ||
416 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
417 | 0x00, 0x00, 0x00, 0x00, | ||
418 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x30, 0xf8, 0x8c, 0x1a, 0x7f, 0xc0, | ||
419 | 0x90, 0x60, 0xc7, 0xce, 0x4c, 0x8f, 0x00, 0x47, 0x0e, 0x1e, 0x57, 0x90, 0xe0, | ||
420 | 0x00, 0x10, 0x28, 0xc6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
421 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
422 | 0x00, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
423 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0f, 0x0f, | ||
424 | 0x08, 0x00, 0x08, 0x0f, 0x0f, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
425 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, | ||
426 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
427 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, | ||
428 | 0xc6, 0x28, 0x10, 0x00, 0xe0, 0x90, 0x57, 0x1e, 0x0e, 0x47, 0x00, 0x8f, 0x4c, | ||
429 | 0xce, 0xc7, 0x60, 0x90, 0xc0, 0x7f, 0x1a, 0x8c, 0xf8, 0x30, 0x20, 0xc0, 0x00, | ||
430 | 0x00, 0x00, 0x00, 0x00, | ||
431 | 0x00, 0x00, 0x0c, 0x06, 0x07, 0x0d, 0x09, 0x01, 0x05, 0x0c, 0x06, 0x0b, 0x09, | ||
432 | 0x07, 0x03, 0x01, 0x00, 0x01, 0x02, 0x05, 0x05, 0x05, 0x05, 0x03, 0x00, 0x00, | ||
433 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | ||
434 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | ||
435 | 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
436 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
437 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
438 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, | ||
439 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | ||
440 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x01, | ||
441 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x05, 0x05, 0x05, 0x05, 0x02, 0x01, | ||
442 | 0x00, 0x01, 0x03, 0x07, 0x09, 0x0b, 0x06, 0x0c, 0x05, 0x01, 0x09, 0x0d, 0x07, | ||
443 | 0x06, 0x0c, 0x00, 0x00, | ||
444 | |||
445 | }; | ||
446 | #endif | 268 | #endif |
447 | 269 | ||
448 | #define NORTH 1 | 270 | #define NORTH 1 |
449 | #define EAST 2 | 271 | #define EAST 2 |
450 | #define SOUTH 4 | 272 | #define SOUTH 4 |
451 | #define WEST 8 | 273 | #define WEST 8 |
452 | #define HEAD 16 | 274 | #define HEAD 16 |
453 | 275 | ||
454 | #define EAST_NORTH 32 | 276 | #define EAST_NORTH 32 |
455 | #define EAST_SOUTH 64 | 277 | #define EAST_SOUTH 64 |
@@ -478,7 +300,7 @@ int load_all_levels(void) | |||
478 | max_levels = size / (HEIGHT*WIDTH); | 300 | max_levels = size / (HEIGHT*WIDTH); |
479 | 301 | ||
480 | num_levels = 0; | 302 | num_levels = 0; |
481 | 303 | ||
482 | /* open file */ | 304 | /* open file */ |
483 | if ((fd = rb->open(LEVELS_FILE, O_RDONLY)) < 0) | 305 | if ((fd = rb->open(LEVELS_FILE, O_RDONLY)) < 0) |
484 | { | 306 | { |
@@ -532,8 +354,8 @@ void iohiscore(void) | |||
532 | rb->fdprintf(fd, "%d\n", hiscore); | 354 | rb->fdprintf(fd, "%d\n", hiscore); |
533 | } | 355 | } |
534 | else | 356 | else |
535 | hiscore = compare; | 357 | hiscore = compare; |
536 | 358 | ||
537 | rb->close(fd); | 359 | rb->close(fd); |
538 | 360 | ||
539 | } | 361 | } |
@@ -545,9 +367,9 @@ void clear_board( void) | |||
545 | { | 367 | { |
546 | int x,y; | 368 | int x,y; |
547 | 369 | ||
548 | for (x = 0; x < WIDTH; x++) | 370 | for (x = 0; x < WIDTH; x++) |
549 | { | 371 | { |
550 | for (y = 0; y < HEIGHT; y++) | 372 | for (y = 0; y < HEIGHT; y++) |
551 | { | 373 | { |
552 | board[x][y] = 0; | 374 | board[x][y] = 0; |
553 | } | 375 | } |
@@ -606,7 +428,7 @@ void get_direction( void ) | |||
606 | } | 428 | } |
607 | 429 | ||
608 | /* | 430 | /* |
609 | ** Sets the direction | 431 | ** Sets the direction |
610 | */ | 432 | */ |
611 | void set_direction(int newdir) | 433 | void set_direction(int newdir) |
612 | { | 434 | { |
@@ -640,7 +462,7 @@ void new_level(int level) | |||
640 | tailx = headx - 4; | 462 | tailx = headx - 4; |
641 | taily = heady; | 463 | taily = heady; |
642 | applecountdown = 0; | 464 | applecountdown = 0; |
643 | /*Create a small snake to start off with*/ | 465 | /*Create a small snake to start off with*/ |
644 | board[headx][heady] = dir; | 466 | board[headx][heady] = dir; |
645 | board[headx-1][heady] = dir; | 467 | board[headx-1][heady] = dir; |
646 | board[headx-2][heady] = dir; | 468 | board[headx-2][heady] = dir; |
@@ -669,21 +491,18 @@ void draw_apple( void ) | |||
669 | #if LCD_WIDTH >= 160 && LCD_HEIGHT >= 128 | 491 | #if LCD_WIDTH >= 160 && LCD_HEIGHT >= 128 |
670 | char pscore[5], counter[4]; | 492 | char pscore[5], counter[4]; |
671 | 493 | ||
672 | rb->lcd_set_drawmode(DRMODE_FG); | 494 | rb->lcd_bitmap(snake2_header2,0,0,BMPWIDTH_snake2_header, BMPHEIGHT_snake2_header); |
673 | rb->lcd_mono_bitmap(snakebmp,0,0,BMPWIDTH_snakebmp,BMPHEIGHT_snakebmp); | 495 | rb->lcd_bitmap(snake2_left,0,BMPHEIGHT_snake2_header,BMPWIDTH_snake2_left, BMPHEIGHT_snake2_left); |
674 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 496 | rb->lcd_bitmap(snake2_right,LCD_WIDTH-BMPWIDTH_snake2_right,BMPHEIGHT_snake2_header,BMPWIDTH_snake2_right, BMPHEIGHT_snake2_right); |
675 | rb->lcd_fillrect(0,0,BMPWIDTH_snakeupbmp,BMPHEIGHT_snakeupbmp); | 497 | rb->lcd_bitmap(snake2_bottom,0,BMPHEIGHT_snake2_header+BMPHEIGHT_snake2_left,BMPWIDTH_snake2_bottom, BMPHEIGHT_snake2_bottom); |
676 | rb->lcd_set_drawmode(DRMODE_FG); | ||
677 | rb->lcd_mono_bitmap(snakeupbmp,0,0,BMPWIDTH_snakeupbmp,BMPHEIGHT_snakeupbmp); | ||
678 | rb->lcd_set_drawmode(DRMODE_SOLID); | ||
679 | 498 | ||
680 | rb->snprintf(counter,sizeof(counter),"%d",applecount); | 499 | rb->snprintf(counter,sizeof(counter),"%d",applecount); |
681 | rb->lcd_getstringsize(counter,&strwdt,&strhgt); | 500 | rb->lcd_getstringsize(counter,&strwdt,&strhgt); |
682 | rb->lcd_putsxy(42-strwdt/2,25,counter); | 501 | rb->lcd_putsxy(TOP_X3-strwdt/2,TOP_Y2,counter); |
683 | 502 | ||
684 | rb->snprintf(pscore,sizeof(pscore),"%d",score); | 503 | rb->snprintf(pscore,sizeof(pscore),"%d",score); |
685 | rb->lcd_getstringsize(pscore,&strwdt,&strhgt); | 504 | rb->lcd_getstringsize(pscore,&strwdt,&strhgt); |
686 | rb->lcd_putsxy(116-strwdt/2,25,pscore); | 505 | rb->lcd_putsxy(TOP_X4-strwdt/2,TOP_Y2,pscore); |
687 | #endif | 506 | #endif |
688 | 507 | ||
689 | if (!apple) | 508 | if (!apple) |
@@ -821,7 +640,7 @@ void draw_s_to_w_bit(int x, int y) | |||
821 | void draw_boundary ( void ) | 640 | void draw_boundary ( void ) |
822 | { | 641 | { |
823 | int x, y; | 642 | int x, y; |
824 | 643 | ||
825 | /*TODO: Load levels from file!*/ | 644 | /*TODO: Load levels from file!*/ |
826 | 645 | ||
827 | /*top and bottom line*/ | 646 | /*top and bottom line*/ |
@@ -830,7 +649,7 @@ void draw_boundary ( void ) | |||
830 | board[x][0] = EAST; | 649 | board[x][0] = EAST; |
831 | board[x][HEIGHT-1] = WEST; | 650 | board[x][HEIGHT-1] = WEST; |
832 | } | 651 | } |
833 | 652 | ||
834 | /*left and right lines*/ | 653 | /*left and right lines*/ |
835 | for(y=0; y < HEIGHT; y++) | 654 | for(y=0; y < HEIGHT; y++) |
836 | { | 655 | { |
@@ -851,13 +670,12 @@ void draw_boundary ( void ) | |||
851 | void redraw (void) | 670 | void redraw (void) |
852 | { | 671 | { |
853 | int x,y; | 672 | int x,y; |
854 | rb->lcd_clear_display(); | 673 | |
855 | 674 | for (x = 0; x < WIDTH; x++) | |
856 | for (x = 0; x < WIDTH; x++) | ||
857 | { | 675 | { |
858 | for (y = 0; y < HEIGHT; y++) | 676 | for (y = 0; y < HEIGHT; y++) |
859 | { | 677 | { |
860 | switch (board[x][y]) | 678 | switch (board[x][y]) |
861 | { | 679 | { |
862 | case -1: | 680 | case -1: |
863 | rb->lcd_fillrect((CENTER_X+x*MULTIPLIER)+1,CENTER_Y+y*MULTIPLIER,MODIFIER_2,MODIFIER_1); | 681 | rb->lcd_fillrect((CENTER_X+x*MULTIPLIER)+1,CENTER_Y+y*MULTIPLIER,MODIFIER_2,MODIFIER_1); |
@@ -865,25 +683,23 @@ void redraw (void) | |||
865 | break; | 683 | break; |
866 | case 0: | 684 | case 0: |
867 | break; | 685 | break; |
868 | 686 | ||
869 | case NORTH: | 687 | case NORTH: |
870 | case SOUTH: | 688 | case SOUTH: |
871 | draw_vertical_bit(x,y); | 689 | draw_vertical_bit(x,y); |
872 | break; | 690 | break; |
873 | 691 | ||
874 | case EAST: | 692 | case EAST: |
875 | case WEST: | 693 | case WEST: |
876 | draw_horizontal_bit(x,y); | 694 | draw_horizontal_bit(x,y); |
877 | break; | 695 | break; |
878 | 696 | ||
879 | default: | 697 | default: |
880 | rb->lcd_fillrect(CENTER_X+x*MULTIPLIER,CENTER_Y+y*MULTIPLIER,MODIFIER_1,MODIFIER_1); | 698 | rb->lcd_fillrect(CENTER_X+x*MULTIPLIER,CENTER_Y+y*MULTIPLIER,MODIFIER_1,MODIFIER_1); |
881 | break; | 699 | break; |
882 | } | 700 | } |
883 | } | 701 | } |
884 | } | 702 | } |
885 | rb->lcd_update(); | ||
886 | |||
887 | } | 703 | } |
888 | 704 | ||
889 | /* | 705 | /* |
@@ -905,7 +721,7 @@ void draw_snake_bit(int currentbit, int previousbit, int x, int y) | |||
905 | case(NORTH): | 721 | case(NORTH): |
906 | draw_vertical_bit(x,y); | 722 | draw_vertical_bit(x,y); |
907 | break; | 723 | break; |
908 | 724 | ||
909 | case(EAST): | 725 | case(EAST): |
910 | draw_e_to_n_bit(x,y); | 726 | draw_e_to_n_bit(x,y); |
911 | break; | 727 | break; |
@@ -922,8 +738,8 @@ void draw_snake_bit(int currentbit, int previousbit, int x, int y) | |||
922 | case(WEST): | 738 | case(WEST): |
923 | case(EAST): | 739 | case(EAST): |
924 | draw_horizontal_bit(x,y); | 740 | draw_horizontal_bit(x,y); |
925 | break; | 741 | break; |
926 | 742 | ||
927 | case(NORTH): | 743 | case(NORTH): |
928 | draw_n_to_e_bit(x,y); | 744 | draw_n_to_e_bit(x,y); |
929 | break; | 745 | break; |
@@ -941,7 +757,7 @@ void draw_snake_bit(int currentbit, int previousbit, int x, int y) | |||
941 | case(NORTH): | 757 | case(NORTH): |
942 | draw_vertical_bit(x,y); | 758 | draw_vertical_bit(x,y); |
943 | break; | 759 | break; |
944 | 760 | ||
945 | case(EAST): | 761 | case(EAST): |
946 | draw_e_to_s_bit(x,y); | 762 | draw_e_to_s_bit(x,y); |
947 | break; | 763 | break; |
@@ -952,13 +768,13 @@ void draw_snake_bit(int currentbit, int previousbit, int x, int y) | |||
952 | } | 768 | } |
953 | break; | 769 | break; |
954 | 770 | ||
955 | case(WEST): | 771 | case(WEST): |
956 | switch(previousbit) | 772 | switch(previousbit) |
957 | { | 773 | { |
958 | case(EAST): | 774 | case(EAST): |
959 | case(WEST): | 775 | case(WEST): |
960 | draw_horizontal_bit(x,y); | 776 | draw_horizontal_bit(x,y); |
961 | break; | 777 | break; |
962 | 778 | ||
963 | case(SOUTH): | 779 | case(SOUTH): |
964 | draw_s_to_w_bit(x,y); | 780 | draw_s_to_w_bit(x,y); |
@@ -977,50 +793,53 @@ void draw_snake_bit(int currentbit, int previousbit, int x, int y) | |||
977 | */ | 793 | */ |
978 | void die (void) | 794 | void die (void) |
979 | { | 795 | { |
980 | int n=100; | 796 | int button; |
981 | int count; | 797 | bool done=false; |
982 | char pscore[18]; | 798 | char pscore[20]; |
983 | /*Flashy death sequence (flashy as in 'flashes')*/ | 799 | |
984 | for(count=0;count<24;count++) | 800 | rb->splash(HZ*2, true, "Oops!"); |
985 | { | ||
986 | rb->sleep(HZ/n); | ||
987 | rb->lcd_clear_display(); | ||
988 | draw_apple(); | ||
989 | rb->lcd_update(); | ||
990 | 801 | ||
991 | rb->sleep(HZ/n); | ||
992 | redraw(); | ||
993 | rb->lcd_update(); | ||
994 | } | ||
995 | |||
996 | rb->lcd_clear_display(); | ||
997 | draw_apple(); | ||
998 | rb->lcd_update(); | ||
999 | rb->lcd_clear_display(); | 802 | rb->lcd_clear_display(); |
1000 | 803 | ||
1001 | applecount=0; | 804 | applecount=0; |
1002 | 805 | ||
1003 | rb->lcd_getstringsize("Dead",&strwdt,&strhgt); | 806 | rb->lcd_getstringsize("You died!",&strwdt,&strhgt); |
1004 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt,"Dead"); | 807 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt,"You died!"); |
1005 | 808 | ||
1006 | rb->snprintf(pscore,sizeof(pscore),"Your Score %d",score); | 809 | rb->snprintf(pscore,sizeof(pscore),"Your score: %d",score); |
1007 | rb->lcd_getstringsize(pscore,&strwdt,&strhgt); | 810 | rb->lcd_getstringsize(pscore,&strwdt,&strhgt); |
1008 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt * 2 + 2,pscore); | 811 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt * 2 + 2,pscore); |
1009 | 812 | ||
1010 | if (score>hiscore) | 813 | if (score>hiscore) |
1011 | { | 814 | { |
1012 | hiscore=score; | 815 | hiscore=score; |
1013 | rb->lcd_getstringsize("New High Score!",&strwdt,&strhgt); | 816 | rb->lcd_getstringsize("New high score!",&strwdt,&strhgt); |
1014 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt * 4 + 2,"New High Score!"); | 817 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt * 4 + 2,"New high score!"); |
1015 | } | 818 | } |
1016 | else | 819 | else |
1017 | { | 820 | { |
1018 | rb->snprintf(phscore,sizeof(phscore),"High Score: %d",hiscore); | 821 | rb->snprintf(phscore,sizeof(phscore),"High score: %d",hiscore); |
1019 | rb->lcd_getstringsize(phscore,&strwdt,&strhgt); | 822 | rb->lcd_getstringsize(phscore,&strwdt,&strhgt); |
1020 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt * 6,phscore); | 823 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt * 5,phscore); |
1021 | } | 824 | } |
825 | |||
826 | rb->snprintf(phscore,sizeof(phscore),"Press %s...",SNAKE2_PLAYPAUSE_TEXT); | ||
827 | rb->lcd_getstringsize(phscore,&strwdt,&strhgt); | ||
828 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt * 7,phscore); | ||
829 | |||
1022 | rb->lcd_update(); | 830 | rb->lcd_update(); |
1023 | rb->sleep(3*HZ); | 831 | |
832 | while(!done) | ||
833 | { | ||
834 | button=rb->button_get(true); | ||
835 | switch(button) | ||
836 | { | ||
837 | case SNAKE2_PLAYPAUSE: | ||
838 | done = true; | ||
839 | break; | ||
840 | } | ||
841 | } | ||
842 | |||
1024 | dead=1; | 843 | dead=1; |
1025 | } | 844 | } |
1026 | 845 | ||
@@ -1034,17 +853,17 @@ void collision ( int x, int y ) | |||
1034 | int bdeath=0; | 853 | int bdeath=0; |
1035 | 854 | ||
1036 | 855 | ||
1037 | switch (board[x][y]) | 856 | switch (board[x][y]) |
1038 | { | 857 | { |
1039 | case 0: | 858 | case 0: |
1040 | 859 | ||
1041 | break; | 860 | break; |
1042 | case -1: | 861 | case -1: |
1043 | score = score + (1 * level); | 862 | score = score + (1 * level); |
1044 | apple=0; | 863 | apple=0; |
1045 | applecountdown=2; | 864 | applecountdown=2; |
1046 | applecount++; | 865 | applecount++; |
1047 | 866 | ||
1048 | if(game_type==1) | 867 | if(game_type==1) |
1049 | { | 868 | { |
1050 | if(num_apples_to_get == num_apples_to_got) | 869 | if(num_apples_to_get == num_apples_to_got) |
@@ -1061,7 +880,9 @@ void collision ( int x, int y ) | |||
1061 | rb->splash(HZ, true, "Level Completed!"); | 880 | rb->splash(HZ, true, "Level Completed!"); |
1062 | rb->lcd_clear_display(); | 881 | rb->lcd_clear_display(); |
1063 | new_level(level_from_file); | 882 | new_level(level_from_file); |
883 | rb->lcd_clear_display(); | ||
1064 | redraw(); | 884 | redraw(); |
885 | rb->lcd_update(); | ||
1065 | } | 886 | } |
1066 | else | 887 | else |
1067 | num_apples_to_got++; | 888 | num_apples_to_got++; |
@@ -1086,7 +907,7 @@ void move( void ) | |||
1086 | /*this actually sets the dir variable.*/ | 907 | /*this actually sets the dir variable.*/ |
1087 | get_direction(); | 908 | get_direction(); |
1088 | /*draw head*/ | 909 | /*draw head*/ |
1089 | switch (dir) | 910 | switch (dir) |
1090 | { | 911 | { |
1091 | case (NORTH): | 912 | case (NORTH): |
1092 | board[headx][heady]=NORTH; | 913 | board[headx][heady]=NORTH; |
@@ -1094,7 +915,7 @@ void move( void ) | |||
1094 | break; | 915 | break; |
1095 | case (EAST): | 916 | case (EAST): |
1096 | board[headx][heady]=EAST; | 917 | board[headx][heady]=EAST; |
1097 | headx++; | 918 | headx++; |
1098 | break; | 919 | break; |
1099 | case (SOUTH): | 920 | case (SOUTH): |
1100 | board[headx][heady]=SOUTH; | 921 | board[headx][heady]=SOUTH; |
@@ -1105,7 +926,7 @@ void move( void ) | |||
1105 | headx--; | 926 | headx--; |
1106 | break; | 927 | break; |
1107 | } | 928 | } |
1108 | 929 | ||
1109 | if(headx == WIDTH) | 930 | if(headx == WIDTH) |
1110 | headx = 0; | 931 | headx = 0; |
1111 | else if(headx < 0) | 932 | else if(headx < 0) |
@@ -1115,11 +936,11 @@ void move( void ) | |||
1115 | heady = 0; | 936 | heady = 0; |
1116 | else if(heady < 0) | 937 | else if(heady < 0) |
1117 | heady = HEIGHT-1; | 938 | heady = HEIGHT-1; |
1118 | 939 | ||
1119 | rb->lcd_fillrect(CENTER_X+headx*MULTIPLIER,CENTER_Y+heady*MULTIPLIER,MODIFIER_1,MODIFIER_1); | 940 | rb->lcd_fillrect(CENTER_X+headx*MULTIPLIER,CENTER_Y+heady*MULTIPLIER,MODIFIER_1,MODIFIER_1); |
1120 | 941 | ||
1121 | /*clear tail*/ | 942 | /*clear tail*/ |
1122 | if(applecountdown <= 0) | 943 | if(applecountdown <= 0) |
1123 | { | 944 | { |
1124 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 945 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
1125 | rb->lcd_fillrect(CENTER_X+tailx*MULTIPLIER,CENTER_Y+taily*MULTIPLIER,MODIFIER_1,MODIFIER_1); | 946 | rb->lcd_fillrect(CENTER_X+tailx*MULTIPLIER,CENTER_Y+taily*MULTIPLIER,MODIFIER_1,MODIFIER_1); |
@@ -1146,7 +967,7 @@ void move( void ) | |||
1146 | tailx--; | 967 | tailx--; |
1147 | break; | 968 | break; |
1148 | } | 969 | } |
1149 | 970 | ||
1150 | if(tailx == WIDTH) | 971 | if(tailx == WIDTH) |
1151 | tailx = 0; | 972 | tailx = 0; |
1152 | else if(tailx < 0) | 973 | else if(tailx < 0) |
@@ -1166,7 +987,7 @@ void frame (void) | |||
1166 | int olddir, noldx, noldy, temp; | 987 | int olddir, noldx, noldy, temp; |
1167 | noldx = headx; | 988 | noldx = headx; |
1168 | noldy = heady; | 989 | noldy = heady; |
1169 | olddir = 0; | 990 | olddir = 0; |
1170 | switch(dir) | 991 | switch(dir) |
1171 | { | 992 | { |
1172 | case(NORTH): | 993 | case(NORTH): |
@@ -1174,7 +995,7 @@ void frame (void) | |||
1174 | temp = 0; | 995 | temp = 0; |
1175 | else | 996 | else |
1176 | temp = heady + 1; | 997 | temp = heady + 1; |
1177 | 998 | ||
1178 | olddir = board[headx][temp]; | 999 | olddir = board[headx][temp]; |
1179 | break; | 1000 | break; |
1180 | 1001 | ||
@@ -1207,34 +1028,36 @@ void frame (void) | |||
1207 | } | 1028 | } |
1208 | 1029 | ||
1209 | move(); | 1030 | move(); |
1210 | 1031 | ||
1211 | /* | 1032 | /* |
1212 | now redraw the bit that was | 1033 | now redraw the bit that was |
1213 | the tail, to something snake-like: | 1034 | the tail, to something snake-like: |
1214 | */ | 1035 | */ |
1215 | draw_snake_bit(dir, olddir, noldx, noldy); | 1036 | draw_snake_bit(dir, olddir, noldx, noldy); |
1216 | 1037 | ||
1217 | collision(headx, heady); | 1038 | collision(headx, heady); |
1218 | 1039 | ||
1219 | rb->lcd_update(); | 1040 | rb->lcd_update(); |
1220 | } | 1041 | } |
1221 | 1042 | ||
1222 | void game_pause (void) | 1043 | void game_pause (void) |
1223 | { | 1044 | { |
1224 | int button; | 1045 | int button; |
1225 | 1046 | ||
1226 | rb->lcd_clear_display(); | 1047 | rb->lcd_clear_display(); |
1227 | rb->lcd_getstringsize("Paused",&strwdt,&strhgt); | 1048 | rb->lcd_getstringsize("Paused",&strwdt,&strhgt); |
1228 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,LCD_HEIGHT/2,"Paused"); | 1049 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,LCD_HEIGHT/2,"Paused"); |
1229 | 1050 | ||
1230 | rb->lcd_update(); | 1051 | rb->lcd_update(); |
1231 | while (1) | 1052 | while (1) |
1232 | { | 1053 | { |
1233 | button = rb->button_get(true); | 1054 | button = rb->button_get(true); |
1234 | switch (button) | 1055 | switch (button) |
1235 | { | 1056 | { |
1236 | case SNAKE2_PLAYPAUSE: | 1057 | case SNAKE2_PLAYPAUSE: |
1058 | rb->lcd_clear_display(); | ||
1237 | redraw(); | 1059 | redraw(); |
1060 | rb->lcd_update(); | ||
1238 | rb->sleep(HZ/2); | 1061 | rb->sleep(HZ/2); |
1239 | return; | 1062 | return; |
1240 | 1063 | ||
@@ -1249,21 +1072,23 @@ void game_pause (void) | |||
1249 | } | 1072 | } |
1250 | } | 1073 | } |
1251 | 1074 | ||
1252 | void game (void) | 1075 | void game (void) |
1253 | { | 1076 | { |
1254 | int button; | 1077 | int button; |
1255 | 1078 | ||
1079 | rb->lcd_clear_display(); | ||
1256 | redraw(); | 1080 | redraw(); |
1081 | rb->lcd_update(); | ||
1257 | /*main loop:*/ | 1082 | /*main loop:*/ |
1258 | while (1) | 1083 | while (1) |
1259 | { | 1084 | { |
1260 | if(frames==5) | 1085 | if(frames==5) |
1261 | { | 1086 | { |
1262 | frame(); | 1087 | frame(); |
1263 | if(frames>0) frames=0; | 1088 | if(frames>0) frames=0; |
1264 | } | 1089 | } |
1265 | frames++; | 1090 | frames++; |
1266 | 1091 | ||
1267 | if(frames == 0) | 1092 | if(frames == 0) |
1268 | { | 1093 | { |
1269 | die(); | 1094 | die(); |
@@ -1279,24 +1104,24 @@ void game (void) | |||
1279 | } | 1104 | } |
1280 | } | 1105 | } |
1281 | } | 1106 | } |
1282 | 1107 | ||
1283 | if (dead) return; | 1108 | if (dead) return; |
1284 | 1109 | ||
1285 | draw_apple(); | 1110 | draw_apple(); |
1286 | 1111 | ||
1287 | rb->sleep(HZ/speed); | 1112 | rb->sleep(HZ/speed); |
1288 | 1113 | ||
1289 | button = rb->button_get(false); | 1114 | button = rb->button_get(false); |
1290 | switch (button) | 1115 | switch (button) |
1291 | { | 1116 | { |
1292 | case SNAKE2_UP: | 1117 | case SNAKE2_UP: |
1293 | case SNAKE2_UP | BUTTON_REPEAT: | 1118 | case SNAKE2_UP | BUTTON_REPEAT: |
1294 | if (dir != SOUTH) set_direction(NORTH); | 1119 | if (dir != SOUTH) set_direction(NORTH); |
1295 | break; | 1120 | break; |
1296 | 1121 | ||
1297 | case BUTTON_RIGHT: | 1122 | case BUTTON_RIGHT: |
1298 | case BUTTON_RIGHT | BUTTON_REPEAT: | 1123 | case BUTTON_RIGHT | BUTTON_REPEAT: |
1299 | if (dir != WEST) set_direction(EAST); | 1124 | if (dir != WEST) set_direction(EAST); |
1300 | break; | 1125 | break; |
1301 | 1126 | ||
1302 | case SNAKE2_DOWN: | 1127 | case SNAKE2_DOWN: |
@@ -1328,7 +1153,7 @@ void game (void) | |||
1328 | 1153 | ||
1329 | } | 1154 | } |
1330 | 1155 | ||
1331 | void game_init(void) | 1156 | void game_init(void) |
1332 | { | 1157 | { |
1333 | int button; | 1158 | int button; |
1334 | char plevel[30]; | 1159 | char plevel[30]; |
@@ -1340,41 +1165,42 @@ void game_init(void) | |||
1340 | 1165 | ||
1341 | clear_board(); | 1166 | clear_board(); |
1342 | load_level( level_from_file ); | 1167 | load_level( level_from_file ); |
1343 | 1168 | rb->lcd_clear_display(); | |
1344 | while (1) | 1169 | redraw(); |
1345 | { | 1170 | rb->lcd_update(); |
1346 | rb->lcd_clear_display(); | ||
1347 | redraw(); | ||
1348 | 1171 | ||
1172 | while (1) | ||
1173 | { | ||
1349 | #if LCD_WIDTH >= 160 && LCD_HEIGHT >= 128 | 1174 | #if LCD_WIDTH >= 160 && LCD_HEIGHT >= 128 |
1350 | 1175 | ||
1351 | rb->lcd_set_drawmode(DRMODE_FG); | 1176 | rb->lcd_bitmap(snake2_header1,0,0,BMPWIDTH_snake2_header, BMPHEIGHT_snake2_header); |
1352 | rb->lcd_mono_bitmap(snakebmp,0,0,BMPWIDTH_snakebmp,BMPHEIGHT_snakebmp); | 1177 | rb->lcd_bitmap(snake2_left,0,BMPHEIGHT_snake2_header,BMPWIDTH_snake2_left, BMPHEIGHT_snake2_left); |
1353 | rb->lcd_set_drawmode(DRMODE_SOLID); | 1178 | rb->lcd_bitmap(snake2_right,LCD_WIDTH-BMPWIDTH_snake2_right,BMPHEIGHT_snake2_header,BMPWIDTH_snake2_right, BMPHEIGHT_snake2_right); |
1179 | rb->lcd_bitmap(snake2_bottom,0,BMPHEIGHT_snake2_header+BMPHEIGHT_snake2_left,BMPWIDTH_snake2_bottom, BMPHEIGHT_snake2_bottom); | ||
1354 | 1180 | ||
1355 | rb->snprintf(plevel,sizeof(plevel),"%d",level); | 1181 | rb->snprintf(plevel,sizeof(plevel),"%d",level); |
1356 | rb->lcd_getstringsize(plevel,&strwdt,&strhgt); | 1182 | rb->lcd_getstringsize(plevel,&strwdt,&strhgt); |
1357 | rb->lcd_putsxy(42-strwdt/2,25, plevel); | 1183 | rb->lcd_putsxy(TOP_X3-strwdt/2,TOP_Y2, plevel); |
1358 | 1184 | ||
1359 | rb->snprintf(plevel,sizeof(plevel),"%d",level_from_file); | 1185 | rb->snprintf(plevel,sizeof(plevel),"%d",level_from_file); |
1360 | rb->lcd_getstringsize(plevel,&strwdt,&strhgt); | 1186 | rb->lcd_getstringsize(plevel,&strwdt,&strhgt); |
1361 | rb->lcd_putsxy(121-strwdt/2,4, plevel); | 1187 | rb->lcd_putsxy(TOP_X2-strwdt/2,TOP_Y1, plevel); |
1362 | 1188 | ||
1363 | if(game_type==0){ | 1189 | if(game_type==0){ |
1364 | rb->lcd_getstringsize("A",&strwdt,&strhgt); | 1190 | rb->lcd_getstringsize("A",&strwdt,&strhgt); |
1365 | rb->lcd_putsxy(34,4,"A"); | 1191 | rb->lcd_putsxy(TOP_X1,TOP_Y1,"A"); |
1366 | } | 1192 | } |
1367 | else{ | 1193 | else{ |
1368 | rb->lcd_getstringsize("B",&strwdt,&strhgt); | 1194 | rb->lcd_getstringsize("B",&strwdt,&strhgt); |
1369 | rb->lcd_putsxy(34,4,"B"); | 1195 | rb->lcd_putsxy(TOP_X1,TOP_Y1,"B"); |
1370 | } | 1196 | } |
1371 | 1197 | ||
1372 | rb->snprintf(phscore,sizeof(phscore),"%d",hiscore); | 1198 | rb->snprintf(phscore,sizeof(phscore),"%d",hiscore); |
1373 | rb->lcd_getstringsize(phscore,&strwdt,&strhgt); | 1199 | rb->lcd_getstringsize(phscore,&strwdt,&strhgt); |
1374 | rb->lcd_putsxy(114-strwdt/2,25, phscore); | 1200 | rb->lcd_putsxy(TOP_X4-strwdt/2,TOP_Y2, phscore); |
1375 | 1201 | ||
1376 | #else | 1202 | #else |
1377 | rb->snprintf(plevel,sizeof(plevel),"Speed: %d",level); | 1203 | rb->snprintf(plevel,sizeof(plevel),"Speed: %02d",level); |
1378 | rb->lcd_getstringsize("Speed: 00",&strwdt,&strhgt); | 1204 | rb->lcd_getstringsize("Speed: 00",&strwdt,&strhgt); |
1379 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt+4, plevel); | 1205 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt+4, plevel); |
1380 | 1206 | ||
@@ -1385,7 +1211,7 @@ void game_init(void) | |||
1385 | if(game_type==0){ | 1211 | if(game_type==0){ |
1386 | rb->lcd_getstringsize("Game Type: A ",&strwdt,&strhgt); | 1212 | rb->lcd_getstringsize("Game Type: A ",&strwdt,&strhgt); |
1387 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt*3+4,"Game Type: A"); | 1213 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt*3+4,"Game Type: A"); |
1388 | } | 1214 | } |
1389 | else{ | 1215 | else{ |
1390 | rb->lcd_getstringsize("Game Type: B ",&strwdt,&strhgt); | 1216 | rb->lcd_getstringsize("Game Type: B ",&strwdt,&strhgt); |
1391 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt*3+4,"Game Type: B"); | 1217 | rb->lcd_putsxy((LCD_WIDTH - strwdt)/2,strhgt*3+4,"Game Type: B"); |
@@ -1402,16 +1228,12 @@ void game_init(void) | |||
1402 | switch (button) | 1228 | switch (button) |
1403 | { | 1229 | { |
1404 | case SNAKE2_LEVEL_UP: | 1230 | case SNAKE2_LEVEL_UP: |
1405 | #ifdef SNAKE2_LEVEL_UP2 | 1231 | case SNAKE2_LEVEL_UP|BUTTON_REPEAT: |
1406 | case SNAKE2_LEVEL_UP2: | 1232 | if (level<10) |
1407 | #endif | ||
1408 | if (level<10) | ||
1409 | level+=1; | 1233 | level+=1; |
1410 | break; | 1234 | break; |
1411 | case SNAKE2_LEVEL_DOWN: | 1235 | case SNAKE2_LEVEL_DOWN: |
1412 | #ifdef SNAKE2_LEVEL_DOWN2 | 1236 | case SNAKE2_LEVEL_DOWN|BUTTON_REPEAT: |
1413 | case SNAKE2_LEVEL_DOWN2: | ||
1414 | #endif | ||
1415 | if (level>1) | 1237 | if (level>1) |
1416 | level-=1; | 1238 | level-=1; |
1417 | break; | 1239 | break; |
@@ -1426,17 +1248,32 @@ void game_init(void) | |||
1426 | case SNAKE2_SELECT_TYPE: | 1248 | case SNAKE2_SELECT_TYPE: |
1427 | if(game_type==0)game_type=1; else game_type=0; | 1249 | if(game_type==0)game_type=1; else game_type=0; |
1428 | break; | 1250 | break; |
1429 | case SNAKE2_SELECT_MAZE: | 1251 | case SNAKE2_MAZE_NEXT: |
1430 | 1252 | rb->lcd_set_drawmode(DRMODE_BG|DRMODE_INVERSEVID); | |
1431 | level_from_file++; | 1253 | rb->lcd_fillrect(CENTER_X, CENTER_Y, CENTER_X+WIDTH*MULTIPLIER, |
1432 | if(level_from_file > num_levels) | 1254 | CENTER_Y+HEIGHT*MULTIPLIER); |
1433 | { | 1255 | rb->lcd_set_drawmode(DRMODE_SOLID); |
1434 | level_from_file = 1; | 1256 | if(level_from_file < num_levels) |
1435 | } | 1257 | level_from_file++; |
1436 | 1258 | else | |
1259 | level_from_file = 0; | ||
1260 | load_level( level_from_file ); | ||
1261 | redraw(); | ||
1262 | break; | ||
1263 | #ifdef SNAKE2_MAZE_LAST | ||
1264 | case SNAKE2_MAZE_LAST: | ||
1265 | rb->lcd_set_drawmode(DRMODE_BG|DRMODE_INVERSEVID); | ||
1266 | rb->lcd_fillrect(CENTER_X, CENTER_Y, CENTER_X+WIDTH*MULTIPLIER, | ||
1267 | CENTER_Y+HEIGHT*MULTIPLIER); | ||
1268 | rb->lcd_set_drawmode(DRMODE_SOLID); | ||
1269 | if(level_from_file > 0) | ||
1270 | level_from_file--; | ||
1271 | else | ||
1272 | level_from_file = num_levels; | ||
1437 | load_level( level_from_file ); | 1273 | load_level( level_from_file ); |
1438 | 1274 | redraw(); | |
1439 | break; | 1275 | break; |
1276 | #endif | ||
1440 | default: | 1277 | default: |
1441 | if (rb->default_event_handler(button)==SYS_USB_CONNECTED) { | 1278 | if (rb->default_event_handler(button)==SYS_USB_CONNECTED) { |
1442 | quit = 2; | 1279 | quit = 2; |
@@ -1455,6 +1292,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
1455 | 1292 | ||
1456 | /* Lets use the default font */ | 1293 | /* Lets use the default font */ |
1457 | rb->lcd_setfont(FONT_SYSFIXED); | 1294 | rb->lcd_setfont(FONT_SYSFIXED); |
1295 | #ifdef HAVE_LCD_COLOR | ||
1296 | rb->lcd_set_background(LCD_WHITE); | ||
1297 | #endif | ||
1458 | load_all_levels(); | 1298 | load_all_levels(); |
1459 | 1299 | ||
1460 | if (num_levels == 0) { | 1300 | if (num_levels == 0) { |
@@ -1466,19 +1306,19 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
1466 | 1306 | ||
1467 | while(quit==0) | 1307 | while(quit==0) |
1468 | { | 1308 | { |
1469 | game_init(); | 1309 | game_init(); |
1470 | rb->lcd_clear_display(); | 1310 | rb->lcd_clear_display(); |
1471 | frames=1; | 1311 | frames=1; |
1472 | 1312 | ||
1473 | if(quit==0) | 1313 | if(quit==0) |
1474 | { | 1314 | { |
1475 | init_snake(); | 1315 | init_snake(); |
1476 | 1316 | ||
1477 | /*Start Game:*/ | 1317 | /*Start Game:*/ |
1478 | game(); | 1318 | game(); |
1479 | } | 1319 | } |
1480 | } | 1320 | } |
1481 | 1321 | ||
1482 | iohiscore(); | 1322 | iohiscore(); |
1483 | return (quit==1) ? PLUGIN_OK : PLUGIN_USB_CONNECTED; | 1323 | return (quit==1) ? PLUGIN_OK : PLUGIN_USB_CONNECTED; |
1484 | } | 1324 | } |