aboutsummaryrefslogtreecommitdiffstats
path: root/demos/games/justget10/jg10.c
blob: 5ccf246ca3dfb688b83c5d948da6bf7df62602c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
#include "gfx.h"
#include "src/gwin/gwin_class.h"
#include "stdlib.h"
#include "string.h"
#include "jg10.h"

GEventMouse     ev;
GHandle         mainWin, Jg10SelectWidget;

typedef struct jg10WidgetObject_t {
    GWidgetObject w;  // Base Class
} jg10WidgetObject;

GHandle jg10SelectionWidgetGCreate(GDisplay* g, jg10WidgetObject* wo, GWidgetInit* pInit);
#define jg10SelectionWidgetCreate(wo, pInit) jg10SelectionWidgetGCreate(GDISP, wo, pInit)


typedef struct {          // Node properties
  gU8 num;            // Node number
  gBool check;           // Node needs to be checked or not
  gBool sel;             // Node selected or not
} nodeProps;

nodeProps             jg10Field[JG10_FIELD_WIDTH][JG10_FIELD_HEIGHT];   // jg10 field array
gBool                jg10GameOver                           = gFalse;
const char            *jg10Graph[] = {"background.bmp", "1.bmp","2.bmp","3.bmp","4.bmp","5.bmp","6.bmp","7.bmp","8.bmp", "9.bmp", "10.bmp", "11.bmp", "12.bmp", "13.bmp", "14.bmp", "15.bmp", "16.bmp", "17.bmp", "18.bmp", "19.bmp", "20.bmp"}; // 21 elements (0-20)
gImage            jg10Image[JG10_MAX_COUNT];
#define JG10_ANIM_IMAGES 5
#define JG10_ANIM_DELAY 60
const char            *jg10GraphAnim[] = {"a1.bmp","a2.bmp","a3.bmp","a4.bmp","background.bmp"}; // 5 elements (0-4)
gImage            jg10ImageAnim[JG10_ANIM_IMAGES];
gU8               jg10MaxVal=4;                                     // Max value in field...
gFont font;
#if JG10_SHOW_SPLASH
GTimer                jg10SplashBlink;
gBool                jg10SplashTxtVisible = gFalse;
gImage            jg10SplashImage;
#endif


static void initRng(void) {
    srand(gfxSystemTicks());
}

static gU32 randomInt(gU32 max) {
    return rand() % max;
}

static int uitoa(unsigned int value, char * buf, int max) {
  int n = 0;
  int i = 0;
  int tmp = 0;

  if (!buf) return -3;
  if (2 > max) return -4;
  i=1;
  tmp = value;
  if (0 > tmp) {
    tmp *= -1;
    i++;
  }
  for (;;) {
    tmp /= 10;
    if (0 >= tmp) break;
    i++;
  }
  if (i >= max) {
    buf[0] = '?';
    buf[1] = 0x0;
    return 2;
  }
  n = i;
  tmp = value;
  if (0 > tmp) {
    tmp *= -1;
  }
  buf[i--] = 0x0;
  for (;;) {
    buf[i--] = (tmp % 10) + '0';
    tmp /= 10;
    if (0 >= tmp) break;
  }
  if (-1 != i) {
    buf[i--] = '-';
  }
  return n;
}

static gBool inRange(gI16 x, gI16 y) {
    if ((x >= 0) && (x < JG10_FIELD_WIDTH) && (y >= 0) && (y < JG10_FIELD_HEIGHT)) return gTrue; else return gFalse;
}

static void clean_SelCheck(void) {
    gU16 i ,j;
    for (i = 0; i < JG10_FIELD_WIDTH; i++) {
        for (j = 0; j < JG10_FIELD_HEIGHT; j++) {
            jg10Field[i][j].check = gFalse;
            jg10Field[i][j].sel = gFalse;
        }
    }
}

static void remove_Selected(void) {
    gU16 i ,j, step;
    gTicks delay_start = 0;
    gTicks delay=0;
    for (step = 0; step < JG10_ANIM_IMAGES; step++) {
        delay_start = gfxSystemTicks();
        for (i = 0; i < JG10_FIELD_WIDTH; i++) {
            for (j = 0; j < JG10_FIELD_HEIGHT; j++) {
                if (jg10Field[i][j].sel) {
                    gdispImageDraw(&jg10ImageAnim[step], (i*JG10_CELL_HEIGHT)+1, (j*JG10_CELL_WIDTH)+1, JG10_CELL_WIDTH, JG10_CELL_HEIGHT, 0, 0);
                }
            }
        }
        delay = gfxSystemTicks()-delay_start;
        if (delay <= JG10_ANIM_DELAY) {
            gfxSleepMilliseconds(JG10_ANIM_DELAY-delay);
        }
    }
    for (i = 0; i < JG10_FIELD_WIDTH; i++) {
        for (j = 0; j < JG10_FIELD_HEIGHT; j++) {
            if (jg10Field[i][j].sel) {
                jg10Field[i][j].sel = gFalse;
                jg10Field[i][j].num = 0;
            }
        }
    }
//    gwinRedraw(mainWin);
}

static gU8 jg10_randomer(gU8 max, gU8 th) {
    gU32 r = randomInt((1<<max)-1);
	
    if (r != 0) {
        for (gI8 i = max; i >= 0; i--) {
            if (r >= (gU32)(1<<i)) {
                if ((max-i) >= th) {
                    return randomInt(max-i)+1;
                } else {
                    return randomInt(th)+1;
                }
            }
        }
    }
    return randomInt(max-1)+1;
}

static void movePiecesDown(void) {
    gU8 tmp = 0;
    gBool needToCheck = gTrue;
    while (needToCheck) {
        needToCheck = gFalse;
        for (gI8 y = (JG10_FIELD_HEIGHT-1); y >= 0; y--) {
            for (gU8 x = 0; x < JG10_FIELD_WIDTH; x++) {
                if (jg10Field[x][y].num == 0) {
                    // check if there is at least single none empty piece
                    tmp = 0;
                    for (gI8 tmpy = y; tmpy >= 0; tmpy--) {
                        if (jg10Field[x][tmpy].num != 0) tmp++;
                    }
                    if (tmp != 0) {
                        for (gI8 tmpy = y; tmpy > 0; tmpy--) {
                            jg10Field[x][tmpy].num = jg10Field[x][tmpy-1].num;
                        }
                        jg10Field[x][0].num = 0;
                        needToCheck = gTrue;
                    }
                }
            }
        }
    }
    gwinRedraw(mainWin);
    // Add new pieces
    needToCheck = gTrue;
    while (needToCheck) {
        needToCheck = gFalse;
        for (gI8 y = (JG10_FIELD_HEIGHT-1); y >= 0; y--) {
            for (gU8 x = 0; x < JG10_FIELD_WIDTH; x++) {
                if (jg10Field[x][y].num == 0) {
                    for (gI8 tmpy = y; tmpy > 0; tmpy--) {
                        jg10Field[x][tmpy].num = jg10Field[x][tmpy-1].num;
                    }
                    jg10Field[x][0].num = jg10_randomer(jg10MaxVal, 3);
                    needToCheck = gTrue;
                }
            }
        }
        gwinRedraw(mainWin);
        gfxSleepMilliseconds(50);
    }
}

static gBool checkForPossibleMove(void) {
    gBool canMove = gFalse;
    gU16 i ,j;
    for (i = 0; i < JG10_FIELD_WIDTH; i++) {
        for (j = 0; j < JG10_FIELD_HEIGHT; j++) {
            if ((inRange(i,j-1) && jg10Field[i][j-1].num == jg10Field[i][j].num) ||
                (inRange(i-1,j) && jg10Field[i-1][j].num == jg10Field[i][j].num) ||
                (inRange(i,j+1) && jg10Field[i][j+1].num == jg10Field[i][j].num) ||
                (inRange(i+1,j) && jg10Field[i+1][j].num == jg10Field[i][j].num)) {
                canMove = gTrue;
                return canMove;
            }
        }
    }
    return canMove;
}

static void printGameOver(void) {
    gdispFillArea(JG10_TOTAL_FIELD_WIDTH, (gdispGetHeight()/2)-10, gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH, 80, GFX_BLACK);
    if (jg10GameOver) {
        gdispDrawString(JG10_TOTAL_FIELD_WIDTH+((gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH)/2)-(gdispGetStringWidth("Game Over", font)/2), gdispGetHeight()/2, "Game Over", font, GFX_WHITE);
    }
}

static void printCongrats(void) {
    char pps_str[3];
    gdispFillArea(JG10_TOTAL_FIELD_WIDTH, (gdispGetHeight()/2)-10, gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH, 80, GFX_BLACK);
    gdispDrawString(JG10_TOTAL_FIELD_WIDTH+((gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH)/2)-(gdispGetStringWidth("Congrats, now try to get", font)/2), gdispGetHeight()/2, "Congrats, now try to get", font, GFX_WHITE);
    uitoa(jg10MaxVal+1, pps_str, sizeof(pps_str));
    gdispDrawString(JG10_TOTAL_FIELD_WIDTH+((gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH)/2)-(gdispGetStringWidth(pps_str, font)/2), (gdispGetHeight()/2)+20, pps_str, font, GFX_RED);
}

static GFX_THREAD_FUNCTION(thdJg10, msg) {
    (void)msg;
    gU16 x,y;
    while (!jg10GameOver) {
        srand(gfxSystemTicks());
        ginputGetMouseStatus(0, &ev);
        if (ev.buttons & GINPUT_MOUSE_BTN_LEFT) {
            x = ev.x/JG10_CELL_WIDTH;
            y = ev.y/JG10_CELL_HEIGHT;
            if (x < JG10_FIELD_WIDTH && y < JG10_FIELD_HEIGHT) {
                while (ev.buttons & GINPUT_MOUSE_BTN_LEFT) { // Wait until release
                    ginputGetMouseStatus(0, &ev);
                }
                if (!jg10Field[x][y].sel) {
                    // Check if we have at least two
                    if ((inRange(x,y-1) && jg10Field[x][y-1].num == jg10Field[x][y].num) ||
                        (inRange(x-1,y) && jg10Field[x-1][y].num == jg10Field[x][y].num) ||
                        (inRange(x,y+1) && jg10Field[x][y+1].num == jg10Field[x][y].num) ||
                        (inRange(x+1,y) && jg10Field[x+1][y].num == jg10Field[x][y].num)) {
                        gwinSetVisible(Jg10SelectWidget, gFalse);
                        clean_SelCheck();
                        jg10Field[x][y].check = gTrue;
                        gwinSetVisible(Jg10SelectWidget, gTrue);
                    }
                } else {
                    // already selected section clicked...
                    jg10Field[x][y].num++;
                    if (jg10Field[x][y].num > jg10MaxVal) {
                        jg10MaxVal = jg10Field[x][y].num;
                        if (jg10MaxVal >= 10) printCongrats();
                        if (jg10MaxVal == 20) { // Just in case someone got so far :D I cannot imaginge though 
                            jg10GameOver = gTrue;
                            printGameOver();
                        }
                    }
                    jg10Field[x][y].sel = gFalse;
                    gwinSetVisible(Jg10SelectWidget, gFalse);
                    remove_Selected();
                    movePiecesDown();
                    if (checkForPossibleMove()) {
                        clean_SelCheck();
                        //gwinRedraw(mainWin);
                    } else {
                        jg10GameOver = gTrue;
                        printGameOver();
                    }
                }
            }
        }
    }
    gfxThreadReturn(0);
}

static void initField(void) {
    jg10MaxVal = 4;
    for (gU8 x = 0; x < JG10_FIELD_WIDTH; x++) {
        for (gU8 y = 0; y < JG10_FIELD_HEIGHT; y++) {
          jg10Field[x][y].num = randomInt(jg10MaxVal)+1;
            //jg10Field[x][y].num = 1;      // good for animation testing
            //jg10Field[x][y].num = x+x+5;    // good to get high score fast
            //jg10Field[x][y].num = x+y+5;  // good demo to check out pieces :D
            jg10Field[x][y].check = gFalse;
            jg10Field[x][y].sel = gFalse;
        }
    }
    jg10GameOver = gFalse;
    printGameOver();
}

static void mainWinDraw(GWidgetObject* gw, void* param) {
	(void)param;
	
    for (gU8 x = 0; x < JG10_FIELD_WIDTH; x++) {
        for (gU8 y = 0; y < JG10_FIELD_HEIGHT; y++) {
            gdispGImageDraw(gw->g.display, &jg10Image[jg10Field[x][y].num], (x*JG10_CELL_HEIGHT)+1, (y*JG10_CELL_WIDTH)+1, JG10_CELL_WIDTH, JG10_CELL_HEIGHT, 0, 0);
        }
    }
}

static void jg10SelectionWidget_Draw(GWidgetObject* gw, void* param) {
    gI16 x, y;
    gBool needToCheck = gTrue;

	(void)param;

    while (needToCheck) {
        needToCheck = gFalse;
        for (x = 0; x < JG10_FIELD_WIDTH; x++) {
            for (y = 0; y < JG10_FIELD_HEIGHT; y++) {
                if (jg10Field[x][y].check && !jg10Field[x][y].sel) {
                    jg10Field[x][y].sel = gTrue;
                    jg10Field[x][y].check = gFalse;
                    // Up
                    if (inRange(x, y-1) && !jg10Field[x][y-1].sel && (jg10Field[x][y-1].num == jg10Field[x][y].num)) {
                        jg10Field[x][y-1].check = gTrue;
                        needToCheck = gTrue;
                    } else  if (!inRange(x, y-1) || (inRange(x, y-1) && !jg10Field[x][y-1].sel)) {
                        // We need longer line if this is wide corner inside shape
                        if (inRange(x+1, y) && inRange(x+1, y-1) && (jg10Field[x][y].num == jg10Field[x+1][y].num) && (jg10Field[x][y].num == jg10Field[x+1][y-1].num)) {
                            gdispGFillArea(gw->g.display, (x*JG10_CELL_WIDTH)+1, (y*JG10_CELL_HEIGHT)+1, JG10_CELL_WIDTH+2, 2, JG10_SEL_COLOR);
                        } else {
                            gdispGFillArea(gw->g.display, (x*JG10_CELL_WIDTH)+1, (y*JG10_CELL_HEIGHT)+1, JG10_CELL_WIDTH, 2, JG10_SEL_COLOR);
                        }
                    }
                    // Down
                    if (inRange(x, y+1) && !jg10Field[x][y+1].sel && (jg10Field[x][y+1].num == jg10Field[x][y].num)) {
                        jg10Field[x][y+1].check = gTrue;
                        needToCheck = gTrue;
                    } else if (!inRange(x, y+1) || (inRange(x, y+1) && !jg10Field[x][y+1].sel)) {
                        // We need longer line if this is wide corner inside shape
                        if (inRange(x-1, y) && inRange(x-1, y+1) && (jg10Field[x][y].num == jg10Field[x-1][y].num) && (jg10Field[x][y].num == jg10Field[x-1][y+1].num)) {
                            gdispGFillArea(gw->g.display, (x*JG10_CELL_WIDTH)-1, ((y+1)*JG10_CELL_HEIGHT)-1, JG10_CELL_WIDTH+2, 2, JG10_SEL_COLOR);
                        } else {
                            gdispGFillArea(gw->g.display, (x*JG10_CELL_WIDTH)+1, ((y+1)*JG10_CELL_HEIGHT)-1, JG10_CELL_WIDTH, 2, JG10_SEL_COLOR);
                        }
                    }
                    // Left
                    if (inRange(x-1, y) && !jg10Field[x-1][y].sel && (jg10Field[x-1][y].num == jg10Field[x][y].num)) {
                        jg10Field[x-1][y].check = gTrue;
                        needToCheck = gTrue;
                    } else if (!inRange(x-1, y) || (inRange(x-1, y) && !jg10Field[x-1][y].sel)) {
                        // We need longer line if this is wide corner inside shape
                        if (inRange(x, y-1) && inRange(x-1, y-1) && (jg10Field[x][y].num == jg10Field[x][y-1].num) && (jg10Field[x][y].num == jg10Field[x-1][y-1].num)) {
                            gdispGFillArea(gw->g.display, (x*JG10_CELL_WIDTH)+1, (y*JG10_CELL_HEIGHT)-1, 2, JG10_CELL_HEIGHT+2, JG10_SEL_COLOR);
                        } else {
                            gdispGFillArea(gw->g.display, (x*JG10_CELL_WIDTH)+1, (y*JG10_CELL_HEIGHT)+1, 2, JG10_CELL_HEIGHT, JG10_SEL_COLOR);
                        }
                    }
                    // Right
                    if (inRange(x+1, y) && !jg10Field[x+1][y].sel && (jg10Field[x+1][y].num == jg10Field[x][y].num)) {
                        jg10Field[x+1][y].check = gTrue;
                        needToCheck = gTrue;
                    } else if (!inRange(x+1, y) || (inRange(x+1, y) && !jg10Field[x+1][y].sel)) {
                        // We need longer line if this is wide corner inside shape
                        if (inRange(x, y+1) && inRange(x+1, y+1) && (jg10Field[x][y].num == jg10Field[x][y+1].num) && (jg10Field[x][y].num == jg10Field[x+1][y+1].num)) {
                            gdispGFillArea(gw->g.display, ((x+1)*JG10_CELL_WIDTH)-1, (y*JG10_CELL_HEIGHT)+1, 2, JG10_CELL_HEIGHT+2, JG10_SEL_COLOR);
                        } else {
                            gdispGFillArea(gw->g.display, ((x+1)*JG10_CELL_WIDTH)-1, (y*JG10_CELL_HEIGHT)+1, 2, JG10_CELL_HEIGHT, JG10_SEL_COLOR);
                        }
                    }
                }
            }
        }
    }
}

static const gwidgetVMT jg10SelectionWidgetVMT = {
    {
        "jg10SelectionWidget",        // The classname
        sizeof(jg10WidgetObject),     // The object size
        _gwidgetDestroy,              // The destroy routine
        _gwidgetRedraw,               // The redraw routine
        0,                            // The after-clear routine
    },
    jg10SelectionWidget_Draw,         // The default drawing routine
    #if GINPUT_NEED_MOUSE
        {
            0,                        // Process mouse down events
            0,                        // Process mouse up events
            0,                        // Process mouse move events
        },
    #endif
    #if GINPUT_NEED_KEYBOARD || GWIN_NEED_KEYBOARD
        {
            0                         // Process keyboard events
        },
    #endif
    #if GINPUT_NEED_TOGGLE
        {
            0,                        // Toggle role
            0,                        // Assign Toggles
            0,                        // Get Toggles
            0,                        // Process toggle off events
            0,                        // Process toggle on events
        },
    #endif
    #if GINPUT_NEED_DIAL
        {
            0,                        // No dial roles
            0,                        // Assign Dials
            0,                        // Get Dials
            0,                        // Process dial move events
        },
    #endif
};

GHandle jg10SelectionWidgetGCreate(GDisplay* g, jg10WidgetObject* wo, GWidgetInit* pInit) {
    if (!(wo = (jg10WidgetObject*)_gwidgetCreate(g, &wo->w, pInit, &jg10SelectionWidgetVMT))) {
        return 0;
    }
    gwinSetVisible((GHandle)wo, pInit->g.show);
    return (GHandle)wo;
}


static void createMainWin(void) {
    GWidgetInit wi;
    gwinWidgetClearInit(&wi);
    // Container - mainWin
    wi.g.show = gFalse;
    wi.g.x = 0;
    wi.g.y = 0;
    wi.g.width = gdispGetWidth();
    wi.g.height = gdispGetHeight();
    wi.g.parent = 0;
    wi.text = "Container";
    wi.customDraw = mainWinDraw;
    wi.customParam = 0;
    wi.customStyle = 0;
    mainWin = gwinContainerCreate(0, &wi, 0);

    // create selection widget
    wi.g.show = gFalse;
    wi.g.x = 0;
    wi.g.y = 0;
    wi.g.width = 272;
    wi.g.height = 480;
    wi.g.parent = mainWin;
    wi.customDraw = jg10SelectionWidget_Draw;
    Jg10SelectWidget = jg10SelectionWidgetCreate(0, &wi);
}

void guiCreate(void) {
    GWidgetInit wi;
    gwinWidgetClearInit(&wi);
    createMainWin();
    gwinHide(mainWin);
    gwinShow(mainWin);
}

void jg10Start(void) {
#if JG10_SHOW_SPLASH
    gtimerStop(&jg10SplashBlink);
    gdispClear(GFX_BLACK);
#endif
    initField();
    guiCreate();
    gfxThreadCreate(0, 1024, gThreadpriorityNormal, thdJg10, 0);
    while (!jg10GameOver) {
        gfxSleepMilliseconds(100);
    }
}

void jg10Init(void) {
    initRng();
    for (gU8 i = 0; i < JG10_MAX_COUNT; i++) {
         gdispImageOpenFile(&jg10Image[i], jg10Graph[i]);
         gdispImageCache(&jg10Image[i]);
    }
    for (gU8 i = 0; i < JG10_ANIM_IMAGES; i++) {
         gdispImageOpenFile(&jg10ImageAnim[i], jg10GraphAnim[i]);
         gdispImageCache(&jg10ImageAnim[i]);
    }
    font = gdispOpenFont("DejaVuSans16_aa");
}

#if JG10_SHOW_SPLASH
static void jg10SplashBlinker(void* arg) {
    (void)arg;
    jg10SplashTxtVisible = !jg10SplashTxtVisible;
    if (jg10SplashTxtVisible) {
        gdispImageOpenFile(&jg10SplashImage, "splashtxt.bmp");
    } else {
        gdispImageOpenFile(&jg10SplashImage, "splashclr.bmp");
    }
    gdispImageDraw(&jg10SplashImage, (gdispGetWidth()/2)-150+106, (gdispGetHeight()/2)-100+168, 89, 9, 0, 0);
    gdispImageClose(&jg10SplashImage);
}

void jg10ShowSplash(void) {
    gdispImageOpenFile(&jg10SplashImage, "splash.bmp");
    gdispImageDraw(&jg10SplashImage, (gdispGetWidth()/2)-150, (gdispGetHeight()/2)-100, 300, 200, 0, 0);
    gdispImageClose(&jg10SplashImage);
    gtimerStart(&jg10SplashBlink, jg10SplashBlinker, 0, gTrue, 400);
}
#endif