summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-04-17 02:21:08 +0000
committerJens Arnold <amiconn@rockbox.org>2006-04-17 02:21:08 +0000
commita5af06b580f55f8339d1bf135365993b4db5287c (patch)
tree8a9621708add9bcfd28a5577e729bf08591354a9 /apps
parentcc8f80ad9bce251ca8f7a7d8161b165466d3a4eb (diff)
downloadrockbox-a5af06b580f55f8339d1bf135365993b4db5287c.tar.gz
rockbox-a5af06b580f55f8339d1bf135365993b4db5287c.zip
Bubbles adapted to archos recorder & Ondio. Gfx work by Marianne Arnold.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9699 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/SOURCES2
-rw-r--r--apps/plugins/bitmaps/mono/SOURCES4
-rwxr-xr-xapps/plugins/bitmaps/mono/bubbles_bubble.112x64x1.bmpbin0 -> 92 bytes
-rw-r--r--apps/plugins/bitmaps/native/SOURCES6
-rwxr-xr-xapps/plugins/bitmaps/native/bubbles_emblem.112x64x1.bmpbin0 -> 222 bytes
-rwxr-xr-xapps/plugins/bubbles.c273
6 files changed, 171 insertions, 114 deletions
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 9ca5f89ad1..1f64e9140b 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -36,9 +36,7 @@ plasma.c
36#endif 36#endif
37 37
38bounce.c 38bounce.c
39#if ((LCD_WIDTH >= 138) && (LCD_HEIGHT >= 110))
40bubbles.c 39bubbles.c
41#endif
42#if LCD_WIDTH != 128 40#if LCD_WIDTH != 128
43/* These need adjusting for the iRiver if'p screen */ 41/* These need adjusting for the iRiver if'p screen */
44brickmania.c 42brickmania.c
diff --git a/apps/plugins/bitmaps/mono/SOURCES b/apps/plugins/bitmaps/mono/SOURCES
index 0e8abd86f6..0a463c714e 100644
--- a/apps/plugins/bitmaps/mono/SOURCES
+++ b/apps/plugins/bitmaps/mono/SOURCES
@@ -1,7 +1,9 @@
1#ifdef HAVE_LCD_BITMAP 1#ifdef HAVE_LCD_BITMAP
2 2
3/* Bubbles */ 3/* Bubbles */
4#if (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) 4#if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64)
5bubbles_bubble.112x64x1.bmp
6#elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128)
5bubbles_bubble.160x128x1.bmp 7bubbles_bubble.160x128x1.bmp
6#elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 132) 8#elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 132)
7bubbles_bubble.160x128x1.bmp 9bubbles_bubble.160x128x1.bmp
diff --git a/apps/plugins/bitmaps/mono/bubbles_bubble.112x64x1.bmp b/apps/plugins/bitmaps/mono/bubbles_bubble.112x64x1.bmp
new file mode 100755
index 0000000000..70d3c8451e
--- /dev/null
+++ b/apps/plugins/bitmaps/mono/bubbles_bubble.112x64x1.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index dc2b774328..a8d24ee196 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -1,10 +1,12 @@
1#ifdef HAVE_LCD_BITMAP 1#ifdef HAVE_LCD_BITMAP
2 2
3/* Bubbles */ 3/* Bubbles */
4#if (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && !defined(HAVE_LCD_COLOR) 4#if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64)
5bubbles_emblem.160x128x2.bmp 5bubbles_emblem.112x64x1.bmp
6#elif (LCD_WIDTH == 138) && (LCD_HEIGHT == 110) 6#elif (LCD_WIDTH == 138) && (LCD_HEIGHT == 110)
7bubbles_emblem.138x110x2.bmp 7bubbles_emblem.138x110x2.bmp
8#elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && !defined(HAVE_LCD_COLOR)
9bubbles_emblem.160x128x2.bmp
8#elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && defined(HAVE_LCD_COLOR) 10#elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && defined(HAVE_LCD_COLOR)
9bubbles_emblem.160x128x16.bmp 11bubbles_emblem.160x128x16.bmp
10bubbles_left.160x128x16.bmp 12bubbles_left.160x128x16.bmp
diff --git a/apps/plugins/bitmaps/native/bubbles_emblem.112x64x1.bmp b/apps/plugins/bitmaps/native/bubbles_emblem.112x64x1.bmp
new file mode 100755
index 0000000000..fa882403e7
--- /dev/null
+++ b/apps/plugins/bitmaps/native/bubbles_emblem.112x64x1.bmp
Binary files differ
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c
index 19bc7a12f1..2f74e44c72 100755
--- a/apps/plugins/bubbles.c
+++ b/apps/plugins/bubbles.c
@@ -94,75 +94,120 @@ PLUGIN_HEADER
94#define BUBBLES_SELECT BUTTON_SELECT 94#define BUBBLES_SELECT BUTTON_SELECT
95#define BUBBLES_RESUME BUTTON_MENU 95#define BUBBLES_RESUME BUTTON_MENU
96 96
97#elif CONFIG_KEYPAD == RECORDER_PAD
98#define BUBBLES_LEFT BUTTON_LEFT
99#define BUBBLES_RIGHT BUTTON_RIGHT
100#define BUBBLES_UP BUTTON_UP
101#define BUBBLES_DOWN BUTTON_DOWN
102#define BUBBLES_QUIT BUTTON_OFF
103#define BUBBLES_START BUTTON_ON
104#define BUBBLES_SELECT BUTTON_PLAY
105#define BUBBLES_RESUME BUTTON_F1
106
107#elif CONFIG_KEYPAD == ONDIO_PAD
108#define BUBBLES_LEFT BUTTON_LEFT
109#define BUBBLES_RIGHT BUTTON_RIGHT
110#define BUBBLES_UP BUTTON_RIGHT
111#define BUBBLES_DOWN BUTTON_LEFT
112#define BUBBLES_QUIT BUTTON_OFF
113#define BUBBLES_START BUTTON_MENU
114#define BUBBLES_SELECT BUTTON_UP
115#define BUBBLES_RESUME BUTTON_DOWN
116
97#else 117#else
98 #error BUBBLES: Unsupported keypad 118 #error BUBBLES: Unsupported keypad
99#endif 119#endif
100 120
101/* bubbles will consume height of 10*ROW_HEIGHT+2*(BUBBLE_SZ-1)+BUBBLE_SZ/2 */ 121/* bubbles will consume height of 10*ROW_HEIGHT+2*(BUBBLE_HEIGHT-1)+BUBBLE_HEIGHT/2 */
102/* 24x24 bubbles (iPod Video) */ 122/* 24x24 bubbles (iPod Video) */
103#if (LCD_HEIGHT == 240) && (LCD_WIDTH == 320) 123#if (LCD_HEIGHT == 240) && (LCD_WIDTH == 320)
104#define BUBBLE_SZ 22 124#define BUBBLE_WIDTH 22
105#define EMBLEM_SZ 16 125#define BUBBLE_HEIGHT 22
106#define XOFS 72 126#define EMBLEM_WIDTH 16
107#define ROW_HEIGHT 18 127#define EMBLEM_HEIGHT 16
108#define ROW_INDENT 11 128#define XOFS 72
109#define MAX_FPS 40 129#define ROW_HEIGHT 18
130#define ROW_INDENT 11
131#define MAX_FPS 40
110 132
111/* 16x16 bubbles (H300, iPod Color) */ 133/* 16x16 bubbles (H300, iPod Color) */
112#elif (LCD_HEIGHT == 176) && (LCD_WIDTH == 220) 134#elif (LCD_HEIGHT == 176) && (LCD_WIDTH == 220)
113#define BUBBLE_SZ 16 135#define BUBBLE_WIDTH 16
114#define EMBLEM_SZ 12 136#define BUBBLE_HEIGHT 16
115#define XOFS 46 137#define EMBLEM_WIDTH 12
116#define ROW_HEIGHT 14 138#define EMBLEM_HEIGHT 12
117#define ROW_INDENT 8 139#define XOFS 46
118#define MAX_FPS 30 140#define ROW_HEIGHT 14
141#define ROW_INDENT 8
142#define MAX_FPS 30
119 143
120/* 16x16 bubbles (Gigabeat) */ 144/* 16x16 bubbles (Gigabeat) */
121#elif (LCD_HEIGHT == 320) && (LCD_WIDTH == 240) 145#elif (LCD_HEIGHT == 320) && (LCD_WIDTH == 240)
122#define BUBBLE_SZ 16 146#define BUBBLE_WIDTH 16
123#define EMBLEM_SZ 12 147#define BUBBLE_HEIGHT 16
124#define XOFS 56 148#define EMBLEM_WIDTH 12
125#define ROW_HEIGHT 14 149#define EMBLEM_HEIGHT 12
126#define ROW_INDENT 8 150#define XOFS 56
127#define MAX_FPS 20 151#define ROW_HEIGHT 14
152#define ROW_INDENT 8
153#define MAX_FPS 20
128 154
129/* 12x12 bubbles (iPod Nano) */ 155/* 12x12 bubbles (iPod Nano) */
130#elif (LCD_HEIGHT == 132) && (LCD_WIDTH == 176) 156#elif (LCD_HEIGHT == 132) && (LCD_WIDTH == 176)
131#define BUBBLE_SZ 12 157#define BUBBLE_WIDTH 12
132#define EMBLEM_SZ 8 158#define BUBBLE_HEIGHT 12
133#define XOFS 40 159#define EMBLEM_WIDTH 8
134#define ROW_HEIGHT 10 160#define EMBLEM_HEIGHT 8
135#define ROW_INDENT 6 161#define XOFS 40
136#define MAX_FPS 40 162#define ROW_HEIGHT 10
163#define ROW_INDENT 6
164#define MAX_FPS 40
137 165
138/* 12x12 bubbles (H100, iAudio X5, iPod 3G, iPod 4G grayscale) */ 166/* 12x12 bubbles (H100, iAudio X5, iPod 3G, iPod 4G grayscale) */
139#elif (LCD_HEIGHT == 128) && (LCD_WIDTH == 160) 167#elif (LCD_HEIGHT == 128) && (LCD_WIDTH == 160)
140#define BUBBLE_SZ 12 168#define BUBBLE_WIDTH 12
141#define EMBLEM_SZ 8 169#define BUBBLE_HEIGHT 12
142#define XOFS 33 170#define EMBLEM_WIDTH 8
143#define ROW_HEIGHT 10 171#define EMBLEM_HEIGHT 8
144#define ROW_INDENT 6 172#define XOFS 33
145#define MAX_FPS 30 173#define ROW_HEIGHT 10
174#define ROW_INDENT 6
175#define MAX_FPS 30
146 176
147/* 10x10 bubbles (iPod Mini) */ 177/* 10x10 bubbles (iPod Mini) */
148#elif (LCD_HEIGHT == 110) && (LCD_WIDTH == 138) 178#elif (LCD_HEIGHT == 110) && (LCD_WIDTH == 138)
149#define BUBBLE_SZ 10 179#define BUBBLE_WIDTH 10
150#define EMBLEM_SZ 6 180#define BUBBLE_HEIGHT 10
151#define XOFS 33 181#define EMBLEM_WIDTH 6
152#define ROW_HEIGHT 8 182#define EMBLEM_HEIGHT 6
153#define ROW_INDENT 6 183#define XOFS 33
154#define MAX_FPS 30 184#define ROW_HEIGHT 8
185#define ROW_INDENT 6
186#define MAX_FPS 30
187
188/* 8x7 bubbles (Archos recorder, Ondio) */
189#elif (LCD_HEIGHT == 64) && (LCD_WIDTH == 112)
190#define BUBBLE_WIDTH 8
191#define BUBBLE_HEIGHT 7
192#define EMBLEM_WIDTH 7
193#define EMBLEM_HEIGHT 5
194#define XOFS 33
195#define ROW_HEIGHT 5
196#define ROW_INDENT 4
197#define MAX_FPS 20
155 198
156#else 199#else
157 #error BUBBLES: Unsupported LCD type 200 #error BUBBLES: Unsupported LCD type
158#endif 201#endif
159 202
203#define TEXT_LINES (LCD_HEIGHT/8)
204
160/* shot position */ 205/* shot position */
161#define SHOTX XOFS+ROW_INDENT+BUBBLE_SZ*3 206#define SHOTX XOFS+ROW_INDENT+BUBBLE_WIDTH*3
162#define SHOTY ROW_HEIGHT*(BB_HEIGHT-1)+BUBBLE_SZ/2 207#define SHOTY ROW_HEIGHT*(BB_HEIGHT-1)+BUBBLE_HEIGHT/2
163 208
164/* collision distance squared */ 209/* collision distance squared */
165#define MIN_DISTANCE ((BUBBLE_SZ*8)/10)*((BUBBLE_SZ*8)/10) 210#define MIN_DISTANCE ((BUBBLE_WIDTH*8)/10)*((BUBBLE_HEIGHT*8)/10)
166 211
167/* external bitmaps */ 212/* external bitmaps */
168extern const fb_data bubbles_bubble[]; 213extern const fb_data bubbles_bubble[];
@@ -1449,8 +1494,8 @@ static void bubbles_drawboard(struct game_context* bb) {
1449 /* draw sidebars */ 1494 /* draw sidebars */
1450#ifdef HAVE_LCD_COLOR 1495#ifdef HAVE_LCD_COLOR
1451 rb->lcd_bitmap(bubbles_left, 0, 0, XOFS, LCD_HEIGHT); 1496 rb->lcd_bitmap(bubbles_left, 0, 0, XOFS, LCD_HEIGHT);
1452 rb->lcd_bitmap(bubbles_right, XOFS-1+BB_WIDTH*BUBBLE_SZ, 0, 1497 rb->lcd_bitmap(bubbles_right, XOFS-1+BB_WIDTH*BUBBLE_WIDTH, 0,
1453 LCD_WIDTH-(XOFS-1+BB_WIDTH*BUBBLE_SZ), LCD_HEIGHT); 1498 LCD_WIDTH-(XOFS-1+BB_WIDTH*BUBBLE_WIDTH), LCD_HEIGHT);
1454#endif 1499#endif
1455 1500
1456 /* display play board */ 1501 /* display play board */
@@ -1467,15 +1512,15 @@ static void bubbles_drawboard(struct game_context* bb) {
1467 for(j=0; j<colmax; j++) { 1512 for(j=0; j<colmax; j++) {
1468 if(bb->playboard[i][j].type >= 0 && !bb->playboard[i][j].delete) { 1513 if(bb->playboard[i][j].type >= 0 && !bb->playboard[i][j].delete) {
1469 rb->lcd_bitmap_part(bubbles_emblem, 1514 rb->lcd_bitmap_part(bubbles_emblem,
1470 0, EMBLEM_SZ*bb->playboard[i][j].type, EMBLEM_SZ, 1515 0, EMBLEM_HEIGHT*bb->playboard[i][j].type, EMBLEM_WIDTH,
1471 XOFS+indent+BUBBLE_SZ*j+(BUBBLE_SZ-EMBLEM_SZ)/2, 1516 XOFS+indent+BUBBLE_WIDTH*j+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
1472 ROW_HEIGHT*i+(BUBBLE_SZ-EMBLEM_SZ)/2+bb->compress*ROW_HEIGHT, 1517 ROW_HEIGHT*i+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2+bb->compress*ROW_HEIGHT,
1473 EMBLEM_SZ, EMBLEM_SZ); 1518 EMBLEM_WIDTH, EMBLEM_HEIGHT);
1474 rb->lcd_set_drawmode(DRMODE_FG); 1519 rb->lcd_set_drawmode(DRMODE_FG);
1475 rb->lcd_mono_bitmap((const unsigned char *)bubbles_bubble, 1520 rb->lcd_mono_bitmap((const unsigned char *)bubbles_bubble,
1476 XOFS+indent+BUBBLE_SZ*j, 1521 XOFS+indent+BUBBLE_WIDTH*j,
1477 ROW_HEIGHT*i+bb->compress*ROW_HEIGHT, 1522 ROW_HEIGHT*i+bb->compress*ROW_HEIGHT,
1478 BUBBLE_SZ, BUBBLE_SZ); 1523 BUBBLE_WIDTH, BUBBLE_HEIGHT);
1479 rb->lcd_set_drawmode(DRMODE_SOLID); 1524 rb->lcd_set_drawmode(DRMODE_SOLID);
1480 } 1525 }
1481 } 1526 }
@@ -1483,49 +1528,49 @@ static void bubbles_drawboard(struct game_context* bb) {
1483 1528
1484 /* display bubble to be shot */ 1529 /* display bubble to be shot */
1485 rb->lcd_bitmap_part(bubbles_emblem, 1530 rb->lcd_bitmap_part(bubbles_emblem,
1486 0, EMBLEM_SZ*bb->queue[bb->nextinq], EMBLEM_SZ, 1531 0, EMBLEM_HEIGHT*bb->queue[bb->nextinq], EMBLEM_WIDTH,
1487 SHOTX+(BUBBLE_SZ-EMBLEM_SZ)/2, 1532 SHOTX+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
1488 SHOTY+(BUBBLE_SZ-EMBLEM_SZ)/2, 1533 SHOTY+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2,
1489 EMBLEM_SZ, EMBLEM_SZ); 1534 EMBLEM_WIDTH, EMBLEM_HEIGHT);
1490 rb->lcd_set_drawmode(DRMODE_FG); 1535 rb->lcd_set_drawmode(DRMODE_FG);
1491 rb->lcd_mono_bitmap((const unsigned char *)bubbles_bubble, 1536 rb->lcd_mono_bitmap((const unsigned char *)bubbles_bubble,
1492 SHOTX, SHOTY, 1537 SHOTX, SHOTY,
1493 BUBBLE_SZ, BUBBLE_SZ); 1538 BUBBLE_WIDTH, BUBBLE_HEIGHT);
1494 rb->lcd_set_drawmode(DRMODE_SOLID); 1539 rb->lcd_set_drawmode(DRMODE_SOLID);
1495 1540
1496 /* display next bubble to be shot */ 1541 /* display next bubble to be shot */
1497 rb->lcd_bitmap_part(bubbles_emblem, 1542 rb->lcd_bitmap_part(bubbles_emblem,
1498 0, EMBLEM_SZ*bb->queue[(bb->nextinq+1)%NUM_QUEUE], EMBLEM_SZ, 1543 0, EMBLEM_HEIGHT*bb->queue[(bb->nextinq+1)%NUM_QUEUE], EMBLEM_WIDTH,
1499 XOFS/2-BUBBLE_SZ/2+(BUBBLE_SZ-EMBLEM_SZ)/2, 1544 XOFS/2-BUBBLE_WIDTH/2+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
1500 SHOTY+(BUBBLE_SZ-EMBLEM_SZ)/2, 1545 SHOTY+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2,
1501 EMBLEM_SZ, EMBLEM_SZ); 1546 EMBLEM_WIDTH, EMBLEM_HEIGHT);
1502 rb->lcd_set_drawmode(DRMODE_FG); 1547 rb->lcd_set_drawmode(DRMODE_FG);
1503 rb->lcd_mono_bitmap((const unsigned char *)bubbles_bubble, 1548 rb->lcd_mono_bitmap((const unsigned char *)bubbles_bubble,
1504 XOFS/2-BUBBLE_SZ/2, SHOTY, 1549 XOFS/2-BUBBLE_WIDTH/2, SHOTY,
1505 BUBBLE_SZ, BUBBLE_SZ); 1550 BUBBLE_WIDTH, BUBBLE_HEIGHT);
1506 rb->lcd_set_drawmode(DRMODE_SOLID); 1551 rb->lcd_set_drawmode(DRMODE_SOLID);
1507 1552
1508 /* draw bounding lines */ 1553 /* draw bounding lines */
1509#ifndef HAVE_LCD_COLOR 1554#ifndef HAVE_LCD_COLOR
1510 rb->lcd_vline(XOFS-1, 0, LCD_HEIGHT); 1555 rb->lcd_vline(XOFS-1, 0, LCD_HEIGHT);
1511 rb->lcd_vline(XOFS+BUBBLE_SZ*BB_WIDTH, 0, LCD_HEIGHT); 1556 rb->lcd_vline(XOFS+BUBBLE_WIDTH*BB_WIDTH, 0, LCD_HEIGHT);
1512#endif 1557#endif
1513 rb->lcd_hline(XOFS, XOFS+BUBBLE_SZ*BB_WIDTH-1, bb->compress*ROW_HEIGHT-1); 1558 rb->lcd_hline(XOFS, XOFS+BUBBLE_WIDTH*BB_WIDTH-1, bb->compress*ROW_HEIGHT-1);
1514 rb->lcd_hline(XOFS, XOFS+BUBBLE_SZ*BB_WIDTH-1, 1559 rb->lcd_hline(XOFS, XOFS+BUBBLE_WIDTH*BB_WIDTH-1,
1515 ROW_HEIGHT*(BB_HEIGHT-2)+BUBBLE_SZ); 1560 ROW_HEIGHT*(BB_HEIGHT-2)+BUBBLE_HEIGHT);
1516 1561
1517 /* draw arrow */ 1562 /* draw arrow */
1518 tipx = SHOTX+BUBBLE_SZ/2+(((sin(bb->angle)>>4)*BUBBLE_SZ*3/2)>>10); 1563 tipx = SHOTX+BUBBLE_WIDTH/2+(((sin(bb->angle)>>4)*BUBBLE_WIDTH*3/2)>>10);
1519 tipy = SHOTY+BUBBLE_SZ/2-(((cos(bb->angle)>>4)*BUBBLE_SZ*3/2)>>10); 1564 tipy = SHOTY+BUBBLE_HEIGHT/2-(((cos(bb->angle)>>4)*BUBBLE_HEIGHT*3/2)>>10);
1520 1565
1521 rb->lcd_drawline(SHOTX+BUBBLE_SZ/2+(((sin(bb->angle)>>4)*BUBBLE_SZ/2)>>10), 1566 rb->lcd_drawline(SHOTX+BUBBLE_WIDTH/2+(((sin(bb->angle)>>4)*BUBBLE_WIDTH/2)>>10),
1522 SHOTY+BUBBLE_SZ/2-(((cos(bb->angle)>>4)*BUBBLE_SZ/2)>>10), 1567 SHOTY+BUBBLE_HEIGHT/2-(((cos(bb->angle)>>4)*BUBBLE_HEIGHT/2)>>10),
1523 tipx, tipy); 1568 tipx, tipy);
1524 xlcd_filltriangle(tipx, tipy, 1569 xlcd_filltriangle(tipx, tipy,
1525 tipx+(((sin(bb->angle-135)>>4)*BUBBLE_SZ/3)>>10), 1570 tipx+(((sin(bb->angle-135)>>4)*BUBBLE_WIDTH/3)>>10),
1526 tipy-(((cos(bb->angle-135)>>4)*BUBBLE_SZ/3)>>10), 1571 tipy-(((cos(bb->angle-135)>>4)*BUBBLE_HEIGHT/3)>>10),
1527 tipx+(((sin(bb->angle+135)>>4)*BUBBLE_SZ/3)>>10), 1572 tipx+(((sin(bb->angle+135)>>4)*BUBBLE_WIDTH/3)>>10),
1528 tipy-(((cos(bb->angle+135)>>4)*BUBBLE_SZ/3)>>10)); 1573 tipy-(((cos(bb->angle+135)>>4)*BUBBLE_HEIGHT/3)>>10));
1529 1574
1530 /* draw text */ 1575 /* draw text */
1531 rb->lcd_getstringsize(level, &w, &h); 1576 rb->lcd_getstringsize(level, &w, &h);
@@ -1570,8 +1615,8 @@ static int bubbles_fire(struct game_context* bb) {
1570 1615
1571 /* get current bubble */ 1616 /* get current bubble */
1572 bubblecur = bb->queue[bb->nextinq]; 1617 bubblecur = bb->queue[bb->nextinq];
1573 shotxinc = ((sin(bb->angle)>>4)*BUBBLE_SZ)/3; 1618 shotxinc = ((sin(bb->angle)>>4)*BUBBLE_WIDTH)/3;
1574 shotyinc = ((-1*(cos(bb->angle)>>4))*BUBBLE_SZ)/3; 1619 shotyinc = ((-1*(cos(bb->angle)>>4))*BUBBLE_HEIGHT)/3;
1575 shotxofs = shotyofs = 0; 1620 shotxofs = shotyofs = 0;
1576 1621
1577 /* advance the queue */ 1622 /* advance the queue */
@@ -1592,9 +1637,9 @@ static int bubbles_fire(struct game_context* bb) {
1592 if(SHOTX+(shotxofs>>10) < XOFS) { 1637 if(SHOTX+(shotxofs>>10) < XOFS) {
1593 shotxofs += 2*((XOFS<<10)-(((SHOTX)<<10)+shotxofs)); 1638 shotxofs += 2*((XOFS<<10)-(((SHOTX)<<10)+shotxofs));
1594 shotxdirec *= -1; 1639 shotxdirec *= -1;
1595 } else if(SHOTX+(shotxofs>>10) > XOFS+(BB_WIDTH-1)*BUBBLE_SZ) { 1640 } else if(SHOTX+(shotxofs>>10) > XOFS+(BB_WIDTH-1)*BUBBLE_WIDTH) {
1596 shotxofs -= 2*((((SHOTX)<<10)+shotxofs)- 1641 shotxofs -= 2*((((SHOTX)<<10)+shotxofs)-
1597 ((XOFS<<10)+(((BB_WIDTH-1)*BUBBLE_SZ)<<10))); 1642 ((XOFS<<10)+(((BB_WIDTH-1)*BUBBLE_WIDTH)<<10)));
1598 shotxdirec *= -1; 1643 shotxdirec *= -1;
1599 } 1644 }
1600 1645
@@ -1603,16 +1648,16 @@ static int bubbles_fire(struct game_context* bb) {
1603 1648
1604 /* display shot */ 1649 /* display shot */
1605 bubbles_drawboard(bb); 1650 bubbles_drawboard(bb);
1606 rb->lcd_bitmap_part(bubbles_emblem, 0, EMBLEM_SZ*bubblecur, EMBLEM_SZ, 1651 rb->lcd_bitmap_part(bubbles_emblem, 0, EMBLEM_HEIGHT*bubblecur, EMBLEM_WIDTH,
1607 SHOTX+tempxofs+(BUBBLE_SZ-EMBLEM_SZ)/2, 1652 SHOTX+tempxofs+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
1608 SHOTY+tempyofs+(BUBBLE_SZ-EMBLEM_SZ)/2, 1653 SHOTY+tempyofs+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2,
1609 EMBLEM_SZ, EMBLEM_SZ); 1654 EMBLEM_WIDTH, EMBLEM_HEIGHT);
1610 rb->lcd_set_drawmode(DRMODE_FG); 1655 rb->lcd_set_drawmode(DRMODE_FG);
1611 rb->lcd_mono_bitmap((const unsigned char *)bubbles_bubble, 1656 rb->lcd_mono_bitmap((const unsigned char *)bubbles_bubble,
1612 SHOTX+tempxofs, SHOTY+tempyofs, 1657 SHOTX+tempxofs, SHOTY+tempyofs,
1613 BUBBLE_SZ, BUBBLE_SZ); 1658 BUBBLE_WIDTH, BUBBLE_HEIGHT);
1614 rb->lcd_set_drawmode(DRMODE_SOLID); 1659 rb->lcd_set_drawmode(DRMODE_SOLID);
1615 rb->lcd_update_rect(XOFS, 0, BB_WIDTH*BUBBLE_SZ, LCD_HEIGHT); 1660 rb->lcd_update_rect(XOFS, 0, BB_WIDTH*BUBBLE_WIDTH, LCD_HEIGHT);
1616 1661
1617 /* find nearest position */ 1662 /* find nearest position */
1618 nearrow = ((SHOTY+tempyofs)- 1663 nearrow = ((SHOTY+tempyofs)-
@@ -1623,10 +1668,10 @@ static int bubbles_fire(struct game_context* bb) {
1623 if(nearrow%2) { /* odd row */ 1668 if(nearrow%2) { /* odd row */
1624 nearcol = ((SHOTX+tempxofs)- 1669 nearcol = ((SHOTX+tempxofs)-
1625 (XOFS+ROW_INDENT)+ 1670 (XOFS+ROW_INDENT)+
1626 (BUBBLE_SZ/2))/BUBBLE_SZ; 1671 (BUBBLE_WIDTH/2))/BUBBLE_WIDTH;
1627 if(nearcol >= BB_WIDTH-1) nearcol = BB_WIDTH-2; 1672 if(nearcol >= BB_WIDTH-1) nearcol = BB_WIDTH-2;
1628 } else { /* even row */ 1673 } else { /* even row */
1629 nearcol = ((SHOTX+tempxofs)-XOFS+(BUBBLE_SZ/2))/BUBBLE_SZ; 1674 nearcol = ((SHOTX+tempxofs)-XOFS+(BUBBLE_WIDTH/2))/BUBBLE_WIDTH;
1630 if(nearcol >= BB_WIDTH) nearcol = BB_WIDTH-1; 1675 if(nearcol >= BB_WIDTH) nearcol = BB_WIDTH-1;
1631 } 1676 }
1632 if(nearcol < 0) nearcol = 0; 1677 if(nearcol < 0) nearcol = 0;
@@ -1699,7 +1744,7 @@ static bool bubbles_collision(struct game_context* bb, int y, int x,
1699 /* check neighbors */ 1744 /* check neighbors */
1700 if(nearcol-1 >= 0) { 1745 if(nearcol-1 >= 0) {
1701 if(bb->playboard[nearrow][nearcol-1].type >= 0) { 1746 if(bb->playboard[nearrow][nearcol-1].type >= 0) {
1702 nx = XOFS+(nearrow%2 ? ROW_INDENT : 0)+BUBBLE_SZ*(nearcol-1); 1747 nx = XOFS+(nearrow%2 ? ROW_INDENT : 0)+BUBBLE_WIDTH*(nearcol-1);
1703 ny = ROW_HEIGHT*nearrow+bb->compress*ROW_HEIGHT; 1748 ny = ROW_HEIGHT*nearrow+bb->compress*ROW_HEIGHT;
1704 if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true; 1749 if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true;
1705 } 1750 }
@@ -1709,7 +1754,7 @@ static bool bubbles_collision(struct game_context* bb, int y, int x,
1709 if(nearrow-1 >= 0) { 1754 if(nearrow-1 >= 0) {
1710 if(bb->playboard[nearrow-1][nearcol-1+adj].type >= 0) { 1755 if(bb->playboard[nearrow-1][nearcol-1+adj].type >= 0) {
1711 nx = XOFS+((nearrow-1)%2 ? ROW_INDENT : 0)+ 1756 nx = XOFS+((nearrow-1)%2 ? ROW_INDENT : 0)+
1712 BUBBLE_SZ*(nearcol-1+adj); 1757 BUBBLE_WIDTH*(nearcol-1+adj);
1713 ny = ROW_HEIGHT*(nearrow-1)+bb->compress*ROW_HEIGHT; 1758 ny = ROW_HEIGHT*(nearrow-1)+bb->compress*ROW_HEIGHT;
1714 if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true; 1759 if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true;
1715 } 1760 }
@@ -1718,7 +1763,7 @@ static bool bubbles_collision(struct game_context* bb, int y, int x,
1718 if(nearrow+1 < BB_HEIGHT) { 1763 if(nearrow+1 < BB_HEIGHT) {
1719 if(bb->playboard[nearrow+1][nearcol-1+adj].type >= 0) { 1764 if(bb->playboard[nearrow+1][nearcol-1+adj].type >= 0) {
1720 nx = XOFS+((nearrow+1)%2 ? ROW_INDENT : 0)+ 1765 nx = XOFS+((nearrow+1)%2 ? ROW_INDENT : 0)+
1721 BUBBLE_SZ*(nearcol-1+adj); 1766 BUBBLE_WIDTH*(nearcol-1+adj);
1722 ny = ROW_HEIGHT*(nearrow+1)+bb->compress*ROW_HEIGHT; 1767 ny = ROW_HEIGHT*(nearrow+1)+bb->compress*ROW_HEIGHT;
1723 if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true; 1768 if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true;
1724 } 1769 }
@@ -1729,7 +1774,7 @@ static bool bubbles_collision(struct game_context* bb, int y, int x,
1729 if(nearrow-1 >= 0) { 1774 if(nearrow-1 >= 0) {
1730 if(bb->playboard[nearrow-1][nearcol+adj].type >= 0) { 1775 if(bb->playboard[nearrow-1][nearcol+adj].type >= 0) {
1731 nx = XOFS+((nearrow-1)%2 ? ROW_INDENT : 0)+ 1776 nx = XOFS+((nearrow-1)%2 ? ROW_INDENT : 0)+
1732 BUBBLE_SZ*(nearcol+adj); 1777 BUBBLE_WIDTH*(nearcol+adj);
1733 ny = ROW_HEIGHT*(nearrow-1)+bb->compress*ROW_HEIGHT; 1778 ny = ROW_HEIGHT*(nearrow-1)+bb->compress*ROW_HEIGHT;
1734 if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true; 1779 if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true;
1735 } 1780 }
@@ -1738,7 +1783,7 @@ static bool bubbles_collision(struct game_context* bb, int y, int x,
1738 if(nearrow+1 < BB_HEIGHT) { 1783 if(nearrow+1 < BB_HEIGHT) {
1739 if(bb->playboard[nearrow+1][nearcol+adj].type >= 0) { 1784 if(bb->playboard[nearrow+1][nearcol+adj].type >= 0) {
1740 nx = XOFS+((nearrow+1)%2 ? ROW_INDENT : 0)+ 1785 nx = XOFS+((nearrow+1)%2 ? ROW_INDENT : 0)+
1741 BUBBLE_SZ*(nearcol+adj); 1786 BUBBLE_WIDTH*(nearcol+adj);
1742 ny = ROW_HEIGHT*(nearrow+1)+bb->compress*ROW_HEIGHT; 1787 ny = ROW_HEIGHT*(nearrow+1)+bb->compress*ROW_HEIGHT;
1743 if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true; 1788 if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true;
1744 } 1789 }
@@ -1747,7 +1792,7 @@ static bool bubbles_collision(struct game_context* bb, int y, int x,
1747 1792
1748 if(nearcol+1 < BB_WIDTH-adj) { 1793 if(nearcol+1 < BB_WIDTH-adj) {
1749 if(bb->playboard[nearrow][nearcol+1].type >= 0) { 1794 if(bb->playboard[nearrow][nearcol+1].type >= 0) {
1750 nx = XOFS+(nearrow%2 ? ROW_INDENT : 0)+BUBBLE_SZ*(nearcol+1); 1795 nx = XOFS+(nearrow%2 ? ROW_INDENT : 0)+BUBBLE_WIDTH*(nearcol+1);
1751 ny = ROW_HEIGHT*nearrow+bb->compress*ROW_HEIGHT; 1796 ny = ROW_HEIGHT*nearrow+bb->compress*ROW_HEIGHT;
1752 if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true; 1797 if((x-nx)*(x-nx)+(y-ny)*(y-ny) < MIN_DISTANCE) return true;
1753 } 1798 }
@@ -2055,9 +2100,9 @@ static int bubbles_fall(struct game_context* bb) {
2055 for(j=0; j<BB_WIDTH; j++) { 2100 for(j=0; j<BB_WIDTH; j++) {
2056 if(bb->playboard[i][j].delete) { 2101 if(bb->playboard[i][j].delete) {
2057 indent = (i%2 ? ROW_INDENT : 0); 2102 indent = (i%2 ? ROW_INDENT : 0);
2058 xofs = ((bb->playboard[i][j].fallx*count)*BUBBLE_SZ)/48; 2103 xofs = ((bb->playboard[i][j].fallx*count)*BUBBLE_WIDTH)/48;
2059 yofs = ((count*count - bb->playboard[i][j].fallvel*count)* 2104 yofs = ((count*count - bb->playboard[i][j].fallvel*count)*
2060 BUBBLE_SZ)/20; 2105 BUBBLE_HEIGHT)/20;
2061 2106
2062 /* draw bubble if it is still on the screen */ 2107 /* draw bubble if it is still on the screen */
2063 if(ROW_HEIGHT*i+bb->compress*ROW_HEIGHT+yofs 2108 if(ROW_HEIGHT*i+bb->compress*ROW_HEIGHT+yofs
@@ -2065,18 +2110,18 @@ static int bubbles_fall(struct game_context* bb) {
2065 onscreen = true; 2110 onscreen = true;
2066 2111
2067 rb->lcd_bitmap_part(bubbles_emblem, 0, 2112 rb->lcd_bitmap_part(bubbles_emblem, 0,
2068 EMBLEM_SZ*bb->playboard[i][j].type, EMBLEM_SZ, 2113 EMBLEM_HEIGHT*bb->playboard[i][j].type, EMBLEM_WIDTH,
2069 XOFS+indent+BUBBLE_SZ*j+ 2114 XOFS+indent+BUBBLE_WIDTH*j+
2070 (BUBBLE_SZ-EMBLEM_SZ)/2+xofs, 2115 (BUBBLE_WIDTH-EMBLEM_WIDTH)/2+xofs,
2071 ROW_HEIGHT*i+(BUBBLE_SZ-EMBLEM_SZ)/2+ 2116 ROW_HEIGHT*i+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2+
2072 bb->compress*ROW_HEIGHT+yofs, 2117 bb->compress*ROW_HEIGHT+yofs,
2073 EMBLEM_SZ, EMBLEM_SZ); 2118 EMBLEM_WIDTH, EMBLEM_HEIGHT);
2074 rb->lcd_set_drawmode(DRMODE_FG); 2119 rb->lcd_set_drawmode(DRMODE_FG);
2075 rb->lcd_mono_bitmap( 2120 rb->lcd_mono_bitmap(
2076 (const unsigned char *)bubbles_bubble, 2121 (const unsigned char *)bubbles_bubble,
2077 XOFS+indent+BUBBLE_SZ*j+xofs, 2122 XOFS+indent+BUBBLE_WIDTH*j+xofs,
2078 ROW_HEIGHT*i+bb->compress*ROW_HEIGHT+yofs, 2123 ROW_HEIGHT*i+bb->compress*ROW_HEIGHT+yofs,
2079 BUBBLE_SZ, BUBBLE_SZ); 2124 BUBBLE_WIDTH, BUBBLE_HEIGHT);
2080 rb->lcd_set_drawmode(DRMODE_SOLID); 2125 rb->lcd_set_drawmode(DRMODE_SOLID);
2081 } 2126 }
2082 } 2127 }
@@ -2441,25 +2486,35 @@ static int bubbles(struct game_context* bb) {
2441 rb->lcd_puts(0, 6, " and show high scores"); 2486 rb->lcd_puts(0, 6, " and show high scores");
2442 rb->lcd_puts(0, 7, "LEFT/RIGHT to aim"); 2487 rb->lcd_puts(0, 7, "LEFT/RIGHT to aim");
2443 rb->lcd_puts(0, 8, "UP/DOWN to change level"); 2488 rb->lcd_puts(0, 8, "UP/DOWN to change level");
2489#elif CONFIG_KEYPAD == RECORDER_PAD
2490 rb->lcd_puts_scroll(0, 2, "ON to start/pause, "
2491 "F1 to save/resume, "
2492 "OFF to exit, "
2493 "PLAY to fire and show high scores, "
2494 "LEFT/RIGHT to aim, "
2495 "UP/DOWN to change level.");
2496#elif CONFIG_KEYPAD == ONDIO_PAD
2497 rb->lcd_puts_scroll(0, 2, "MODE to start/pause, "
2498 "DOWN to save/resume, "
2499 "OFF to exit, "
2500 "UP to fire and show high scores, "
2501 "LEFT/RIGHT to aim and to change level.");
2444#endif 2502#endif
2503#if LCD_WIDTH >= 138
2445 rb->snprintf(str, 28, "Start on level %d of %d", startlevel+1, 2504 rb->snprintf(str, 28, "Start on level %d of %d", startlevel+1,
2446 bb->highlevel+1); 2505 bb->highlevel+1);
2447 rb->lcd_puts(0, 10, str); 2506#else
2448#if LCD_HEIGHT > 110 2507 rb->snprintf(str, 28, "Start on lvl %d/%d", startlevel+1,
2449 rb->lcd_puts(0, 12, "High Score:"); 2508 bb->highlevel+1);
2450#else
2451 rb->lcd_puts(0, 11, "High Score:");
2452#endif 2509#endif
2510 rb->lcd_puts(0, MIN(TEXT_LINES-3,10), str);
2511 rb->lcd_puts(0, MIN(TEXT_LINES-2,12), "High Score:");
2453 rb->snprintf(str, 30, "%d, Lvl %d", 2512 rb->snprintf(str, 30, "%d, Lvl %d",
2454 bb->highscores[0].score, bb->highscores[0].level); 2513 bb->highscores[0].score, bb->highscores[0].level);
2455#if LCD_HEIGHT > 110 2514 rb->lcd_puts(2, MIN(TEXT_LINES-1,13), str);
2456 rb->lcd_puts(2, 13, str);
2457#else
2458 rb->lcd_puts(2, 12, str);
2459#endif
2460 } else { 2515 } else {
2461 /* show high scores */ 2516 /* show high scores */
2462 rb->snprintf(str, 12, "%s", "High Scores"); 2517 rb->snprintf(str, 12, "High Scores");
2463 rb->lcd_getstringsize(str, &w, &h); 2518 rb->lcd_getstringsize(str, &w, &h);
2464 rb->lcd_putsxy((LCD_WIDTH-w)/2, 0, str); 2519 rb->lcd_putsxy((LCD_WIDTH-w)/2, 0, str);
2465 2520