pagetop.c
27.4 KB
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
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
#include "viewer.h"
#include "status.h"
#include "uilogic.h"
#include "font.h"
#include "gzip.h"
#include "texrect.h"
#include "page.h"
#include "pagetop.h"
#include "pagegame.h"
#include "pagecontrol.h"
#include "pagegpak.h"
#include "pagecpak.h"
#include "texture.h"
#include "gameticket.h"
#ifndef DEBUG
#include "texture/bg_gz.c"
#endif
#include "texture/newyear_gz.c"
#include "texture/b1_gz.c"
#include "texture/b3_gz.c"
#include "texture/b4_gz.c"
#include "texture/b5_gz.c"
#include "texture/b6_gz.c"
#include "texture/hb1_gz.c"
#include "texture/hb3_gz.c"
#include "texture/hb4_gz.c"
#include "texture/hb5_gz.c"
#include "texture/hb6_gz.c"
#include "texture/welcome_gz.c"
#include "texture/topbar_gz.c"
#include "texture/spacebar_gz.c"
#include "texture/spacebar1_gz.c"
#include "texture/spacebar2_gz.c"
#include "texture/bottombar_gz.c"
#include "texture/a_gz.c"
#include "texture/b_gz.c"
#include "texture/z_gz.c"
#include "texture/snum_gz.c"
#include "texture/glyph_gz.c"
#include "texture/char1_gz.c"
#include "texture/char2_gz.c"
#include "texture/char3_gz.c"
#include "texture/char4_gz.c"
#include "texture/healthad4_gz.c"
#include "texture/ique_home_gz.c"
#include "texture/logo8_gz.c"
#include "texture/board_gz.c"
#include "texture/bind_gz.c"
#include "texture/birthday_gz.c"
#include "texture/cpaks_gz.c"
#include "texture/player_gz.c"
#include "texture/cpakrow_gz.c"
#include "texture/cpakrowh_gz.c"
#include "texture/cpakbg_gz.c"
#include "audrenderer.h"
#include "texture/cyes_gz.c"
#include "texture/cyesh_gz.c"
#include "texture/cno_gz.c"
#include "texture/cnoh_gz.c"
#include "texture/cancel_gz.c"
#include "texture/cancelh_gz.c"
#include "texture/pcpwdin_gz.c"
#include "texture/uparrow_gz.c"
#include "texture/downarrow_gz.c"
#include "texture/dstar_gz.c"
#include "texture/scard_gz.c"
#include "texture/dcard_gz.c"
extern const char gSaClubTitle[];
extern PCTimer gTimer;
#define PAGE_TOP_TOTAL_ROWS 2
int gCardUnits;
int gPGameUnits;
int gLPGameUnits;
int gClubTicketIdx = -1;
int gPageTopInit = 0;
int gBgIdx = 0;
int gLogoCnt = 0;
UiImage gBgImg[4];
UiImage gControllerImg;
UiImage gCpakrowImg;
UiImage gCpakrowhImg;
char gTmpStrBuf[256];
UiTable gConfirmTable;
UiImage gCYesImg;
UiImage gCYeshImg;
UiImage gCNoImg;
UiImage gCNohImg;
UiImage gCancelImg;
UiImage gCancelhImg;
UiRow gConfirmRow[3];
UiImage gDstarImg;
u8 contVal[MAX_CONT_FIELDS];
u8 lower[MAX_CONT_FIELDS] = {0, 0, 0, 0, 3, 1, 1, 0, 0, 0, 3, 1, 1};
u8 upper[MAX_CONT_FIELDS] = {9, 9, 9, 9, 99, 12, 31, 23, 59, 80, 99, 12, 31};
int gWhich;
int gPcFound = 0;
int pwd_x[]={ (SCREEN_WD-TEX_BOARD_W)/2+(TEX_BOARD_W-64)/2,
(SCREEN_WD-TEX_BOARD_W)/2+(TEX_BOARD_W-64)/2+16,
(SCREEN_WD-TEX_BOARD_W)/2+(TEX_BOARD_W-64)/2+32,
(SCREEN_WD-TEX_BOARD_W)/2+(TEX_BOARD_W-64)/2+48};
int pwd_y[]={(SCREEN_HT-TEX_BOARD_H)/2 + 70,
(SCREEN_HT-TEX_BOARD_H)/2 + 70,
(SCREEN_HT-TEX_BOARD_H)/2 + 70,
(SCREEN_HT-TEX_BOARD_H)/2 + 70};
/* this set of data is to support variable sizes of buttons iQue has */
u8* button_tex[] = {texB1, texB3, texB4, texB5, texB6};
u8* button_tex_h[] = {texHB1, texHB3, texHB4, texHB5, texHB6};
int button_idx[] = {PAGE_GAME, PAGE_MANAGE, PAGE_CONTROL, PAGE_CPAK, PAGE_GPAK};
int button_x[] = {B1_X, B3_X, B4_X, B5_X, B6_X};
int button_y[] = {B1_Y, B3_Y, B4_Y, B5_Y, B6_Y};
int button_w[] = {TOP_BUTTON_W, TOP_BUTTON_W, TOP_BUTTON_W2, TOP_BUTTON_W2,TOP_BUTTON_W2};
int button_h[] = {TOP_BUTTON_H, TOP_BUTTON_H, TOP_BUTTON_H2, TOP_BUTTON_H2, TOP_BUTTON_H2};
void updateTopTable();
void drawTopTable();
#ifdef PAK_COPY
void updateManageTable();
void drawManageTable();
#endif
void drawPageTopBg();
void initPageTopAssets();
void initGames();
void initConfirmTable(int num);
void drawLogo();
void updatePwdFields();
void drawPwdFields();
static int gTopWhich = PAGE_GAME;
static int gManageWhich = PAGE_CONTROL;
int isBirthday = 0;
#ifdef SHOW_BBID
static u8 gTmpBuf[256];
#endif
void initPageTop(int row)
{
int outsize;
gPageNo = PAGE_TOP;
osBbRtcGet(gpDate+0, gpDate+1, gpDate+2, gpDate+3,
gpDate+4, gpDate+5, gpDate+6);
gPcFound = uiInitContVal(contVal, lower, upper);
isBirthday = uiCheckBirthday();
bzero(texWelcome, TEX_WELCOME_W*TEX_WELCOME_H+512);
if (isBirthday)
outsize = expand_gzip( gzTexBirthday, texWelcome, gzTexBirthdaySize, TEX_WELCOME_W*TEX_WELCOME_H+512);
else
outsize = expand_gzip( gzTexWelcome, texWelcome, gzTexWelcomeSize, TEX_WELCOME_W*TEX_WELCOME_H+512);
initPageTopAssets();
initGames();
gTopWhich = row;
gWhich = 0;
gManageWhich = PAGE_CONTROL;
}
void initConfirmTable(int num)
{
int i;
for (i=0; i<num; i++) {
gConfirmRow[i].col_cnt = 1;
gConfirmRow[i].cell_h = TEX_CYES_H + 2;
gConfirmRow[i].txt_color = GPACK_RGBA5551(200, 200, 200, 1);
gConfirmRow[i].bg_color = 0;
gConfirmRow[i].bg = NULL;
if (num==2)
gConfirmRow[i].cell_w[0] = TEX_CYES_W + 2*TEX_CYES_W;
else if (num==3)
gConfirmRow[i].cell_w[0] = TEX_CYES_W + TEX_CANCEL_W;
gConfirmRow[i].cell_x[0] = 0;
gConfirmRow[i].cell_y[0] = 0;
gConfirmRow[i].type[0] = CELL_TYPE_TEXTURE;
gConfirmRow[i].data[0] = (i==0) ? (void*)(&gCYesImg) :
((i==1) ? (void*)(&gCNoImg) : (void*)(&gCancelImg));
}
if (num==3) {
gConfirmTable.x = (SCREEN_WD-TEX_BOARD_W)/2 + TEX_BOARD_W/4 - 20;
gConfirmTable.y = (SCREEN_HT-TEX_BOARD_H)/2 + TEX_BOARD_H/2 + 10;
} else if (num==2) {
gConfirmTable.x = (SCREEN_WD-TEX_BOARD_W)/2 + TEX_BOARD_W/4;
gConfirmTable.y = (SCREEN_HT-TEX_BOARD_H)/2 + TEX_BOARD_H/2 + 20;
}
gConfirmTable.total_rows = num;
gConfirmTable.screen_rows = num;
if (num==2)
gConfirmTable.hilite_row = 1;
else if (num==3)
gConfirmTable.hilite_row = 0;
gConfirmTable.top_row = 0;
gConfirmTable.rows = gConfirmRow;
gConfirmTable.row_layout = ROW_LAYOUT_HORIZONTAL;
}
void doPageTop()
{
if (gLogoCnt>=MAX_LOGO_COUNT)
drawPageTopBg();
#ifdef SHOW_BBID
if (gLogoCnt>=MAX_LOGO_COUNT && gStatus!=VW_ERR_NO_CLUB) {
sprintf(gTmpBuf, "%d %d:%x", gBBID, gFlashErr, gFlashErrAddr);
drawColorString(gTmpBuf, 150, 416, 0xFFFF);
}
#endif
switch (gStatus) {
case VW_OK:
if (gLogoCnt<MAX_LOGO_COUNT) {
if (osViGetStatus() & VI_CTRL_GAMMA_ON)
osViSetSpecialFeatures(OS_VI_GAMMA_OFF);
drawLogo();
gLogoCnt ++;
} else {
if (!(osViGetStatus() & VI_CTRL_GAMMA_ON))
osViSetSpecialFeatures(OS_VI_GAMMA_ON);
if (gWarn) {
if (gButton==CONT_A) {
gButton = 0;
gWarn = 0;
playSound(SOUND_MENU_DOWN, AUDIO_WAIT);
gStatus = VW_OK;
return;
}
drawError( gsError_10,
(TEX_BOARD_W - 11*(TEX_ZH_GLYPH_W+1))/2,
(TEX_BOARD_H - 4*(TEX_ZH_GLYPH_H+2))/2 );
} else {
updateTopTable();
drawTopTable();
if (gButton==CONT_A) {
gButton = 0;
gStatus = VW_OK;
playSound(SOUND_MENU_DOWN, AUDIO_WAIT);
switch (gTopWhich) {
case PAGE_GAME: initPageGame(0, 0); break;
#ifdef PAK_COPY
case PAGE_MANAGE: gStatus=VW_MANAGE; break;
#else
case PAGE_MANAGE: gStatus=VW_PC_PWD; break;
#endif
}
}
}
}
break;
#ifdef PAK_COPY
case VW_MANAGE:
updateManageTable();
drawManageTable();
if (gButton==CONT_A) {
gButton = 0;
playSound(SOUND_MENU_DOWN, AUDIO_WAIT);
switch (gManageWhich) {
case PAGE_CONTROL: gStatus = VW_PC_PWD; break;
case PAGE_CPAK: initPageCpak(0); break;
case PAGE_GPAK: initPageGpak(0, 0); break;
}
} else if (gButton==CONT_B) {
gButton = 0;
playSound(SOUND_MENU_UP, AUDIO_WAIT);
gStatus = VW_OK;
}
break;
#endif /* PAK_COPY */
case VW_PC_PWD:
if (gPcFound) {
updatePwdFields();
drawPwdFields();
if (gButton==CONT_A) {
gButton = 0;
if (contVal[0]==gTimer.pwd[0] &&
contVal[1]==gTimer.pwd[1] &&
contVal[2]==gTimer.pwd[2] &&
contVal[3]==gTimer.pwd[3]) {
gStatus = VW_OK;
playSound(SOUND_MENU_DOWN, AUDIO_WAIT);
initPageControl();
} else {
gStatus = VW_ERR_WRONG_PWD;
}
} else if (gButton==CONT_B) {
gButton = 0;
playSound(SOUND_MENU_UP, AUDIO_WAIT);
gStatus = VW_OK;
}
} else {
gStatus = VW_OK;
initPageControl();
}
break;
case VW_ERR_NO_CLUB:
if (gButton==CONT_B) {
gButton = 0;
playSound(SOUND_MENU_UP, AUDIO_WAIT);
gStatus = VW_OK;
return;
}
drawError(gsError_9,
(TEX_BOARD_W - 6*(TEX_ZH_GLYPH_W+1))/2,
(TEX_BOARD_H - 2*(TEX_ZH_GLYPH_H+2))/2 );
break;
case VW_ERR_FATAL:
drawError(gsError_2,
(TEX_BOARD_W - 8*(TEX_ZH_GLYPH_W+1))/2,
(TEX_BOARD_H - (TEX_ZH_GLYPH_H+2))/2 );
break;
case VW_ERR_FS:
drawError(gsError_3,
(TEX_BOARD_W - 8*(TEX_ZH_GLYPH_W+1))/2,
(TEX_BOARD_H - (TEX_ZH_GLYPH_H+2))/2 );
break;
case VW_ERR_ID_MISMATCH:
drawError( gsError_4,
(TEX_BOARD_W - 11*(TEX_ZH_GLYPH_W+1))/2,
(TEX_BOARD_H - 2*(TEX_ZH_GLYPH_H+2))/2 );
break;
case VW_ERR_NO_CARD:
drawError( gsError_5,
(TEX_BOARD_W - 11*(TEX_ZH_GLYPH_W+1))/2,
(TEX_BOARD_H - 2*(TEX_ZH_GLYPH_H+2))/2 );
break;
case VW_ERR_WRONG_PWD:
if (gButton==CONT_B) {
gButton = 0;
playSound(SOUND_MENU_UP, AUDIO_WAIT);
gStatus = VW_OK;
return;
}
drawError( gsError_11,
(TEX_BOARD_W - 5*(TEX_ZH_GLYPH_W+1))/2,
(TEX_BOARD_H - (TEX_ZH_GLYPH_H+2))/2 );
break;
}
}
void updateTopTable()
{
switch (gMove) {
case VW_MOVE_UP:
if (gTopWhich==PAGE_GAME)
gTopWhich = PAGE_MANAGE;
else
gTopWhich --;
playSound(SOUND_SELECTION_MOVE, AUDIO_NOWAIT);
break;
case VW_MOVE_DOWN:
if (gTopWhich==PAGE_MANAGE)
gTopWhich = PAGE_GAME;
else
gTopWhich ++;
playSound(SOUND_SELECTION_MOVE, AUDIO_NOWAIT);
break;
}
gMove = VW_MOVE_STILL;
}
void drawTopTable()
{
int i;
u8* tex;
for (i=0; i<PAGE_TOP_TOTAL_ROWS; i++) {
if (gTopWhich==i+1)
tex = button_tex_h[i];
else
tex = button_tex[i];
drawTexRect( tex,
G_IM_FMT_RGBA, G_IM_SIZ_16b,
button_w[i], button_h[i],
32, 32, 1<<10, 1<<10,
button_w[i], button_h[i],
button_x[i], button_y[i]);
}
}
#ifdef PAK_COPY
void updateManageTable()
{
switch (gMove) {
case VW_MOVE_UP:
if (gManageWhich==PAGE_CONTROL)
gManageWhich = PAGE_GPAK;
else
gManageWhich --;
playSound(SOUND_SELECTION_MOVE, AUDIO_NOWAIT);
break;
case VW_MOVE_DOWN:
if (gManageWhich==PAGE_GPAK)
gManageWhich = PAGE_CONTROL;
else
gManageWhich ++;
playSound(SOUND_SELECTION_MOVE, AUDIO_NOWAIT);
break;
}
gMove = VW_MOVE_STILL;
}
void drawManageTable()
{
int i;
u8* tex;
drawTopTable();
drawTexRectCI ( texBoard,
G_IM_FMT_CI, G_IM_SIZ_8b,
TEX_BOARD_W, TEX_BOARD_H,
32, 32, 1<<10, 1<<10,
TEX_BOARD_W, TEX_BOARD_H,
(SCREEN_WD-TEX_BOARD_W)/2, (SCREEN_HT-TEX_BOARD_H)/2);
for (i=PAGE_CONTROL-1; i<PAGE_GPAK; i++) {
if (gManageWhich==i+1)
tex = button_tex_h[i];
else
tex = button_tex[i];
drawTexRect( tex,
G_IM_FMT_RGBA, G_IM_SIZ_16b,
button_w[i], button_h[i],
32, 32, 1<<10, 1<<10,
button_w[i], button_h[i],
(SCREEN_WD-TEX_BOARD_W)/2+button_x[i],
(SCREEN_HT-TEX_BOARD_H)/2+button_y[i]);
}
}
#endif /* PAK_COPY */
void updatePwdFields()
{
switch (gMove) {
case VW_MOVE_RIGHT:
if (gWhich==3) gWhich=0;
else gWhich++;
break;
case VW_MOVE_LEFT:
if (gWhich==0) gWhich=3;
else gWhich--;
break;
case VW_MOVE_UP:
if (contVal[gWhich]==upper[gWhich])
contVal[gWhich] = lower[gWhich];
else
contVal[gWhich] ++;
break;
case VW_MOVE_DOWN:
if (contVal[gWhich]==lower[gWhich])
contVal[gWhich] = upper[gWhich];
else
contVal[gWhich] --;
break;
}
gMove = VW_MOVE_STILL;
}
void drawPwdFields()
{
int i;
drawTopTable();
drawTexRectCI ( texBoard,
G_IM_FMT_CI, G_IM_SIZ_8b,
TEX_BOARD_W, TEX_BOARD_H,
32, 32, 1<<10, 1<<10,
TEX_BOARD_W, TEX_BOARD_H,
(SCREEN_WD-TEX_BOARD_W)/2, (SCREEN_HT-TEX_BOARD_H)/2);
drawTexRect( texPcPwdIn,
G_IM_FMT_RGBA, G_IM_SIZ_16b,
TEX_PC_PWDIN_W, TEX_PC_PWDIN_H,
32, 32, 1<<10, 1<<10,
TEX_PC_PWDIN_W, TEX_PC_PWDIN_H,
(SCREEN_WD-TEX_BOARD_W)/2 +(TEX_BOARD_W-TEX_PC_PWDIN_W)/2,
(SCREEN_HT-TEX_BOARD_H)/2 + 20);
for (i=0; i<4; i++) {
sprintf(gTmpStrBuf, "%d", contVal[i]);
if (gWhich==i) {
drawColorString(gTmpStrBuf, pwd_x[i], pwd_y[i],
GPACK_RGBA5551(240, 50, 0, 0));
drawTexRect ( texUpArrow,
G_IM_FMT_RGBA, G_IM_SIZ_16b,
TEX_ARROW_W, TEX_ARROW_H,
32, 32, 1<<10, 1<<10,
TEX_ARROW_W, TEX_ARROW_H,
pwd_x[i]+1, pwd_y[i]-10);
drawTexRect ( texDownArrow,
G_IM_FMT_RGBA, G_IM_SIZ_16b,
TEX_ARROW_W, TEX_ARROW_H,
32, 32, 1<<10, 1<<10,
TEX_ARROW_W, TEX_ARROW_H,
pwd_x[i]+1, pwd_y[i]+18);
} else {
drawColorString(gTmpStrBuf, pwd_x[i], pwd_y[i], 0xFFFF);
}
}
}
void initGames()
{
int i;
if (!gCardInit && gStatus!=VW_ERR_NO_CARD) {
gPGameUnits = 0;
gLPGameUnits = 0;
gClubTicketIdx = -1;
gTicketStatus = uiParseTickets();
PRINTF("number of tickets: %d\n", gpTickets->numTickets);
for (i=0; i<gpTickets->numTickets; i++) {
if (gClubTicketIdx==-1) {
if (!strcmp(gpGameMeta[i].title, gSaClubTitle)) {
gClubTicketIdx = i;
PRINTF("gClubTicketIdx=%d\n", gClubTicketIdx);
PRINTF("Title %s\n", gpGameMeta[i].title);
} else {
PRINTF("Title %s\n", gpGameMeta[i].title);
}
}
if (i!=gClubTicketIdx && (gpGameMeta[i].type & SA_META_TYPE_ONCARD)) {
if ((gpGameMeta[i].type & SA_META_TYPE_TRIAL) >> 1)
gLPGameUnits += (gpGameMeta[i].size+BB_USER_BLOCK_SIZE-1)/BB_USER_BLOCK_SIZE;
else
gPGameUnits += (gpGameMeta[i].size+BB_USER_BLOCK_SIZE-1)/BB_USER_BLOCK_SIZE;
}
}
PRINTF("gLPGameUnits=%d gPGameUnits=%d\n",
gLPGameUnits, gPGameUnits);
gCardInit = 1;
}
}
void initPageTopAssets()
{
int outsize;
if (!gPageTopInit) {
bzero(texBg, SCREEN_WD * TEX_BG_H2 * 2);
#ifndef DEBUG
outsize = expand_gzip( gzTexBg, texBg, gzTexBgSize, SCREEN_WD * TEX_BG_H2 * 2);
#endif
bzero(texNewyear, SCREEN_WD * TEX_BG_H2 * 2);
outsize = expand_gzip( gzTexNewyear, texNewyear, gzTexNewyearSize, SCREEN_WD * TEX_BG_H2 * 2);
bzero(texB1, TOP_BUTTON_W * TOP_BUTTON_H * 2);
outsize = expand_gzip( gzTexB1, texB1, gzTexB1Size, TOP_BUTTON_W * TOP_BUTTON_H * 2);
bzero(texB3, TOP_BUTTON_W * TOP_BUTTON_H * 2);
outsize = expand_gzip( gzTexB3, texB3, gzTexB3Size, TOP_BUTTON_W * TOP_BUTTON_H * 2);
bzero(texB4, TOP_BUTTON_W2 * TOP_BUTTON_H2 * 2);
outsize = expand_gzip( gzTexB4, texB4, gzTexB4Size, TOP_BUTTON_W2 * TOP_BUTTON_H2 * 2);
bzero(texB5, TOP_BUTTON_W2 * TOP_BUTTON_H2 * 2);
outsize = expand_gzip( gzTexB5, texB5, gzTexB5Size, TOP_BUTTON_W2 * TOP_BUTTON_H2 * 2);
bzero(texB6, TOP_BUTTON_W2 * TOP_BUTTON_H2 * 2);
outsize = expand_gzip( gzTexB6, texB6, gzTexB6Size, TOP_BUTTON_W2 * TOP_BUTTON_H2 * 2);
bzero(texHB1, TOP_BUTTON_W * TOP_BUTTON_H * 2);
outsize = expand_gzip( gzTexHB1, texHB1, gzTexHB1Size, TOP_BUTTON_W * TOP_BUTTON_H * 2);
bzero(texHB3, TOP_BUTTON_W * TOP_BUTTON_H * 2);
outsize = expand_gzip( gzTexHB3, texHB3, gzTexHB3Size, TOP_BUTTON_W * TOP_BUTTON_H * 2);
bzero(texHB4, TOP_BUTTON_W2 * TOP_BUTTON_H2 * 2);
outsize = expand_gzip( gzTexHB4, texHB4, gzTexHB4Size, TOP_BUTTON_W2 * TOP_BUTTON_H2 * 2);
bzero(texHB5, TOP_BUTTON_W2 * TOP_BUTTON_H2 * 2);
outsize = expand_gzip( gzTexHB5, texHB5, gzTexHB5Size, TOP_BUTTON_W2 * TOP_BUTTON_H2 * 2);
bzero(texHB6, TOP_BUTTON_W2 * TOP_BUTTON_H2 * 2);
outsize = expand_gzip( gzTexHB6, texHB6, gzTexHB6Size, TOP_BUTTON_W2 * TOP_BUTTON_H2 * 2);
bzero(texTopBar, SCREEN_WD*TOP_BAR_H+512);
outsize = expand_gzip( gzTexTopBar, texTopBar, gzTexTopBarSize, SCREEN_WD*TOP_BAR_H+512);
bzero(texSpaceBar, SPACE_BAR_W * SPACE_BAR_H * 2);
outsize = expand_gzip( gzTexSpaceBar, texSpaceBar, gzTexSpaceBarSize, SPACE_BAR_W * SPACE_BAR_H * 2);
bzero(texSpaceBar1, SPACE_BAR1_W * SPACE_BAR_H * 2);
outsize = expand_gzip( gzTexSpaceBar1, texSpaceBar1, gzTexSpaceBar1Size, SPACE_BAR1_W * SPACE_BAR_H * 2);
bzero(texSpaceBar2, SPACE_BAR2_W * SPACE_BAR_H * 2);
outsize = expand_gzip( gzTexSpaceBar2, texSpaceBar2, gzTexSpaceBar2Size, SPACE_BAR2_W * SPACE_BAR_H * 2);
bzero(texBottomBar, SCREEN_WD*BOTTOM_BAR_H+512);
outsize = expand_gzip( gzTexBottomBar, texBottomBar, gzTexBottomBarSize, SCREEN_WD*BOTTOM_BAR_H+512);
bzero(texA, BUTTON_A_W * BUTTON_A_H * 2);
outsize = expand_gzip( gzTexA, texA, gzTexASize, BUTTON_A_W * BUTTON_A_H * 2);
bzero(texB, BUTTON_A_W * BUTTON_A_H * 2);
outsize = expand_gzip( gzTexB, texB, gzTexBSize, BUTTON_A_W * BUTTON_A_H * 2);
bzero(texZ, BUTTON_Z_W * BUTTON_A_H * 2);
outsize = expand_gzip( gzTexZ, texZ, gzTexZSize, BUTTON_Z_W * BUTTON_A_H * 2);
bzero(texSnum, 16*16*11*2);
outsize = expand_gzip( gzTexSnum, texSnum, gzTexSnumSize, 16*16*11*2);
bzero(texZhglyph, TEX_ZH_GLYPH_W*TEX_ZH_GLYPH_H*ZH_GLYPH_COUNT*2);
outsize = expand_gzip( gzTexZhglyph, texZhglyph, gzTexZhglyphSize, TEX_ZH_GLYPH_W*TEX_ZH_GLYPH_H*ZH_GLYPH_COUNT*2);
bzero(texBoard, TEX_BOARD_W*TEX_BOARD_H+512);
outsize = expand_gzip( gzTexBoard, texBoard, gzTexBoardSize, TEX_BOARD_W*TEX_BOARD_H+512);
bzero(texLogo, TEX_LOGO_W*TEX_LOGO_H + 1024);
outsize = expand_gzip( gzTexLogo8, texLogo, gzTexLogo8Size, TEX_LOGO_W*TEX_LOGO_H + 1024);
bzero(texHealthad4, HEALTHAD_SIZE);
outsize = expand_gzip(gzHeathad4, texHealthad4, gzTexHealthad4Size, HEALTHAD_SIZE);
bzero(texIQueHomeLogo, TEX_IQUEHOMELOGO_W * TEX_IQUEHOMELOGO_H * 2);
outsize = expand_gzip( gzTexIQueHomeLogo, texIQueHomeLogo, gzTexIQueHomeLogoSize,
TEX_IQUEHOMELOGO_W * TEX_IQUEHOMELOGO_H * 2);
bzero(texChar1, TEX_CHAR1_W*TEX_CHAR1_H+512);
outsize = expand_gzip( gzTexChar1, texChar1, gzTexChar1Size, TEX_CHAR1_W*TEX_CHAR1_H+512);
bzero(texChar2, TEX_CHAR2_W*TEX_CHAR2_H+512);
outsize = expand_gzip( gzTexChar2, texChar2, gzTexChar2Size, TEX_CHAR2_W*TEX_CHAR2_H+512);
bzero(texChar3, TEX_CHAR3_W*TEX_CHAR3_H+512);
outsize = expand_gzip( gzTexChar3, texChar3, gzTexChar3Size, TEX_CHAR3_W*TEX_CHAR3_H+512);
bzero(texChar4, TEX_CHAR4_W*TEX_CHAR4_H+512);
outsize = expand_gzip( gzTexChar4, texChar4, gzTexChar4Size, TEX_CHAR4_W*TEX_CHAR4_H+512);
bzero(texBind, TEX_BIND_H*TEX_BIND_W*2);
outsize = expand_gzip( gzTexBind, texBind, gzTexBindSize, TEX_BIND_H*TEX_BIND_W*2);
bzero(texConfirmYes, TEX_CYES_W*TEX_CYES_H*2);
outsize = expand_gzip( gzTexConfirmYes, texConfirmYes, gzTexConfirmYesSize, TEX_CYES_W*TEX_CYES_H*2);
bzero(texConfirmYesH, TEX_CYES_W*TEX_CYES_H*2);
outsize = expand_gzip( gzTexConfirmYesH, texConfirmYesH, gzTexConfirmYesHSize, TEX_CYES_W*TEX_CYES_H*2);
bzero(texConfirmNo, TEX_CNO_W*TEX_CNO_H*2);
outsize = expand_gzip( gzTexConfirmNo, texConfirmNo, gzTexConfirmNoSize, TEX_CNO_W*TEX_CNO_H*2);
bzero(texConfirmNoH, TEX_CNO_W*TEX_CNO_H*2);
outsize = expand_gzip( gzTexConfirmNoH, texConfirmNoH, gzTexConfirmNoHSize, TEX_CNO_W*TEX_CNO_H*2);
bzero(texCancel, TEX_CANCEL_W*TEX_CANCEL_H*2);
outsize = expand_gzip( gzTexCancel, texCancel, gzTexCancelSize, TEX_CANCEL_W*TEX_CANCEL_H*2);
bzero(texCancelH, TEX_CANCEL_W*TEX_CANCEL_H*2);
outsize = expand_gzip( gzTexCancelH, texCancelH, gzTexCancelHSize, TEX_CANCEL_W*TEX_CANCEL_H*2);
bzero(texPcPwdIn, TEX_PC_PWDIN_W * TEX_PC_PWDIN_H * 2);
outsize = expand_gzip( gzTexPcPwdIn, texPcPwdIn, gzTexPcPwdInSize, TEX_PC_PWDIN_W * TEX_PC_PWDIN_H * 2);
bzero(texUpArrow, TEX_ARROW_W * TEX_ARROW_H * 2);
outsize = expand_gzip( gzTexUpArrow, texUpArrow, gzTexUpArrowSize, TEX_ARROW_W * TEX_ARROW_H * 2);
bzero(texDownArrow, TEX_ARROW_W * TEX_ARROW_H * 2);
outsize = expand_gzip( gzTexDownArrow, texDownArrow, gzTexDownArrowSize, TEX_ARROW_W * TEX_ARROW_H * 2);
outsize = expand_gzip( gzTexCpak, texCpak, gzTexCpakSize, sizeof(texCpak));
bzero(texPlayer, TEX_PLAYER_H*TEX_PLAYER_W*2);
outsize = expand_gzip( gzTexPlayer, texPlayer, gzTexPlayerSize, TEX_PLAYER_H*TEX_PLAYER_W*2);
bzero(texCpakrow, TEX_PAKROW_H*TEX_PAKROW_W*2);
outsize = expand_gzip( gzTexCpakrow, texCpakrow, gzTexCpakrowSize, TEX_PAKROW_H*TEX_PAKROW_W*2);
bzero(texCpakrowh, TEX_PAKROW_H*TEX_PAKROW_W*2);
outsize = expand_gzip( gzTexCpakrowh, texCpakrowh, gzTexCpakrowhSize, TEX_PAKROW_H*TEX_PAKROW_W*2);
bzero(texCpakbg, SCREEN_WD*TEX_CPAKBG_H*2);
outsize = expand_gzip( gzTexCpakbg, texCpakbg, gzTexCpakbgSize, SCREEN_WD*TEX_CPAKBG_H*2);
bzero(texDstar, 16*16*2);
outsize = expand_gzip( gzTexDstar, texDstar, gzTexDstarSize, 16*16*2);
#ifdef PAK_COPY
bzero(texScard, TEX_SCARD_W*TEX_SCARD_H*2);
outsize = expand_gzip( gzTexScard, texScard, gzTexScardSize, TEX_SCARD_W*TEX_SCARD_H*2);
bzero(texDcard, TEX_DCARD_W*TEX_DCARD_H*2);
outsize = expand_gzip( gzTexDcard, texDcard, gzTexDcardSize, TEX_DCARD_W*TEX_DCARD_H*2);
#endif
gBgImg[0].w = TEX_CHAR1_W;
gBgImg[0].h = TEX_CHAR1_H;
gBgImg[0].img = (u16*)texChar1;
gBgImg[1].w = TEX_CHAR2_W;
gBgImg[1].h = TEX_CHAR2_H;
gBgImg[1].img = (u16*)texChar2;
gBgImg[2].w = TEX_CHAR3_W;
gBgImg[2].h = TEX_CHAR3_H;
gBgImg[2].img = (u16*)texChar3;
gBgImg[3].w = TEX_CHAR4_W;
gBgImg[3].h = TEX_CHAR4_H;
gBgImg[3].img = (u16*)texChar4;
gBgIdx = osGetCount() & 0x3;
gControllerImg.w = TEX_PLAYER_W;
gControllerImg.h = TEX_PLAYER_H;
gControllerImg.img = (u16*)texPlayer;
gCpakrowImg.w = TEX_PAKROW_W;
gCpakrowImg.h = TEX_PAKROW_H;
gCpakrowImg.img = (u16*)texCpakrow;
gCpakrowhImg.w = TEX_PAKROW_W;
gCpakrowhImg.h = TEX_PAKROW_H;
gCpakrowhImg.img = (u16*)texCpakrowh;
gCYesImg.w = TEX_CYES_W;
gCYesImg.h = TEX_CYES_H;
gCYesImg.img = (u16*)texConfirmYes;
gCYeshImg.w = TEX_CYES_W;
gCYeshImg.h = TEX_CYES_H;
gCYeshImg.img = (u16*)texConfirmYesH;
gCNoImg.w = TEX_CNO_W;
gCNoImg.h = TEX_CNO_H;
gCNoImg.img = (u16*)texConfirmNo;
gCNohImg.w = TEX_CNO_W;
gCNohImg.h = TEX_CNO_H;
gCNohImg.img = (u16*)texConfirmNoH;
gCancelImg.w = TEX_CANCEL_W;
gCancelImg.h = TEX_CANCEL_H;
gCancelImg.img = (u16*)texCancel;
gCancelhImg.w = TEX_CANCEL_W;
gCancelhImg.h = TEX_CANCEL_H;
gCancelhImg.img = (u16*)texCancelH;
gDstarImg.w = 16;
gDstarImg.h = 16;
gDstarImg.img = (u16*)texDstar;
gPageTopInit = 1;
}
}
void drawPageTopBg()
{
if ((gStatus==VW_OK||gStatus==VW_PC_PWD||gStatus==VW_MANAGE) && !gWarn) {
if ( !((gpDate[VW_DATE_YEAR]==4) &&
((gpDate[VW_DATE_MON]==1 && gpDate[VW_DATE_DAY]>=20 && gpDate[VW_DATE_DAY]<=31) ||
(gpDate[VW_DATE_MON]==2 && gpDate[VW_DATE_DAY]>=1 && gpDate[VW_DATE_DAY]<=5))))
{
drawTexRect( texBg,
G_IM_FMT_RGBA, G_IM_SIZ_16b,
SCREEN_WD, TEX_BG_H2,
32, 32,
1<<10, 1<<10,
SCREEN_WD, TEX_BG_H2,
0, FRAME_Y+TOP_BAR_H);
drawTexRectCI ( gBgImg[gBgIdx].img,
G_IM_FMT_CI, G_IM_SIZ_8b,
gBgImg[gBgIdx].w, gBgImg[gBgIdx].h,
32, 32, 1<<10, 1<<10,
gBgImg[gBgIdx].w, gBgImg[gBgIdx].h,
SCREEN_WD-gBgImg[gBgIdx].w, FRAME_Y+TOP_BAR_H);
} else {
drawTexRect( texNewyear,
G_IM_FMT_RGBA, G_IM_SIZ_16b,
SCREEN_WD, TEX_BG_H2,
32, 32,
1<<10, 1<<10,
SCREEN_WD, TEX_BG_H2,
0, FRAME_Y+TOP_BAR_H);
}
drawTexRectCI( texWelcome,
G_IM_FMT_CI, G_IM_SIZ_8b,
TEX_WELCOME_W, TEX_WELCOME_H,
32, 32,
1<<10, 1<<10,
TEX_WELCOME_W, TEX_WELCOME_H,
FRAME_X, FRAME_Y + TOP_BAR_H + 5);
}
drawFrame(PAGE_TOP);
}
void drawLogo()
{
drawTexRect_logo( texLogo,
G_IM_FMT_RGBA, G_IM_SIZ_16b,
TEX_LOGO_W, TEX_LOGO_H,
32, 32, 1<<10, 1<<10,
TEX_LOGO_W, TEX_LOGO_H,
(SCREEN_WD-TEX_LOGO_W)/2,
(SCREEN_HT-TEX_LOGO_H)/2 );
return;
}