diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-06-24 22:33:21 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-06-24 22:33:21 +0000 |
commit | 04daef17a1d180c68888c29d11a1b9087e9ace32 (patch) | |
tree | f2d794c196981fc605880e3bbb4447edbaba5f50 /apps/plugins | |
parent | 0e935bdf01aff1e3bc66221c9a0fcc80f935c3d6 (diff) |
First part of graphics api rework. Special functions, parameter handling, pixel functions, lines and filled primitives done for black & white core, main display.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6856 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/calculator.c | 58 | ||||
-rw-r--r-- | apps/plugins/calendar.c | 8 | ||||
-rw-r--r-- | apps/plugins/chessclock.c | 6 | ||||
-rw-r--r-- | apps/plugins/clock.c | 173 | ||||
-rw-r--r-- | apps/plugins/databox/databox.c | 7 | ||||
-rw-r--r-- | apps/plugins/flipit.c | 14 | ||||
-rw-r--r-- | apps/plugins/minesweeper.c | 6 | ||||
-rw-r--r-- | apps/plugins/mosaique.c | 17 | ||||
-rw-r--r-- | apps/plugins/oscillograph.c | 9 | ||||
-rw-r--r-- | apps/plugins/oscilloscope.c | 8 | ||||
-rw-r--r-- | apps/plugins/pong.c | 14 | ||||
-rw-r--r-- | apps/plugins/rockblox.c | 18 | ||||
-rw-r--r-- | apps/plugins/rockboy/Makefile | 2 | ||||
-rw-r--r-- | apps/plugins/rockboy/menu.c | 16 | ||||
-rw-r--r-- | apps/plugins/rockboy/rockmacros.h | 12 | ||||
-rw-r--r-- | apps/plugins/rockboy/sound.h | 1 | ||||
-rw-r--r-- | apps/plugins/sliding_puzzle.c | 4 | ||||
-rw-r--r-- | apps/plugins/snake.c | 4 | ||||
-rw-r--r-- | apps/plugins/snake2.c | 14 | ||||
-rw-r--r-- | apps/plugins/snow.c | 6 | ||||
-rw-r--r-- | apps/plugins/sokoban.c | 4 | ||||
-rw-r--r-- | apps/plugins/solitaire.c | 34 | ||||
-rw-r--r-- | apps/plugins/splitedit.c | 54 | ||||
-rw-r--r-- | apps/plugins/star.c | 4 | ||||
-rw-r--r-- | apps/plugins/vu_meter.c | 4 | ||||
-rw-r--r-- | apps/plugins/wormlet.c | 41 |
26 files changed, 374 insertions, 164 deletions
diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c index 5263ab3bd7..9d5ae205b9 100644 --- a/apps/plugins/calculator.c +++ b/apps/plugins/calculator.c @@ -394,9 +394,11 @@ void cal_initial (void) n = 1; prev_m = m; prev_n = n; - rb->lcd_invertrect( X_0_POS + n*REC_WIDTH + 1, - Y_1_POS + m*REC_HEIGHT + 1, - REC_WIDTH - 1, REC_HEIGHT - 1); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect( X_0_POS + n*REC_WIDTH + 1, + Y_1_POS + m*REC_HEIGHT + 1, + REC_WIDTH - 1, REC_HEIGHT - 1); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_update(); /* initial mem and output display*/ @@ -689,13 +691,15 @@ void moveButton(void){ break; } - rb->lcd_invertrect( X_0_POS + prev_n*REC_WIDTH + 1, - Y_1_POS + prev_m*REC_HEIGHT + 1, - REC_WIDTH - 1, REC_HEIGHT - 1); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect( X_0_POS + prev_n*REC_WIDTH + 1, + Y_1_POS + prev_m*REC_HEIGHT + 1, + REC_WIDTH - 1, REC_HEIGHT - 1); - rb->lcd_invertrect( X_0_POS + n*REC_WIDTH + 1, - Y_1_POS + m*REC_HEIGHT + 1, - REC_WIDTH - 1, REC_HEIGHT - 1); + rb->lcd_fillrect( X_0_POS + n*REC_WIDTH + 1, + Y_1_POS + m*REC_HEIGHT + 1, + REC_WIDTH - 1, REC_HEIGHT - 1); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_update_rect( X_0_POS + prev_n*REC_WIDTH + 1, Y_1_POS + prev_m*REC_HEIGHT + 1, @@ -718,9 +722,11 @@ void printButtonGroups(int group) for (i = 0; i < 5; i++){ for (j = 3; j <= 4; j++){ rb->lcd_getstringsize( buttonChar[group][i][j],&w,&h); - rb->lcd_clearrect( X_0_POS + j*REC_WIDTH + 1, - Y_1_POS + i*REC_HEIGHT + 1, - REC_WIDTH - 1, REC_HEIGHT - 1); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect( X_0_POS + j*REC_WIDTH + 1, + Y_1_POS + i*REC_HEIGHT + 1, + REC_WIDTH - 1, REC_HEIGHT - 1); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_putsxy( X_0_POS + j*REC_WIDTH + (REC_WIDTH - w)/2, TEXT_2_POS + i*REC_HEIGHT, buttonChar[group][i][j] ); @@ -729,17 +735,21 @@ void printButtonGroups(int group) for (i = 0; i <= 0; i++){ for (j = 0; j <= 2; j++){ rb->lcd_getstringsize( buttonChar[group][i][j],&w,&h); - rb->lcd_clearrect( X_0_POS + j*REC_WIDTH + 1, - Y_1_POS + i*REC_HEIGHT + 1, - REC_WIDTH - 1, REC_HEIGHT - 1); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect( X_0_POS + j*REC_WIDTH + 1, + Y_1_POS + i*REC_HEIGHT + 1, + REC_WIDTH - 1, REC_HEIGHT - 1); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_putsxy( X_0_POS + j*REC_WIDTH + (REC_WIDTH - w)/2, TEXT_2_POS + i*REC_HEIGHT, buttonChar[group][i][j] ); } } - rb->lcd_invertrect( X_0_POS + 2*REC_WIDTH + 1, - Y_1_POS + 0*REC_HEIGHT + 1, - REC_WIDTH - 1, REC_HEIGHT - 1); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect( X_0_POS + 2*REC_WIDTH + 1, + Y_1_POS + 0*REC_HEIGHT + 1, + REC_WIDTH - 1, REC_HEIGHT - 1); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_update_rect( X_0_POS, Y_1_POS, REC_WIDTH*5, REC_HEIGHT*5); } @@ -750,10 +760,11 @@ void flashButton(int b) { int i = b/5; int j = b - i*5; int k; + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); for (k=1*2;k>0;k--){ - rb->lcd_invertrect( X_0_POS + j*REC_WIDTH + 1, - Y_1_POS + i*REC_HEIGHT + 1, - REC_WIDTH - 1, REC_HEIGHT - 1); + rb->lcd_fillrect( X_0_POS + j*REC_WIDTH + 1, + Y_1_POS + i*REC_HEIGHT + 1, + REC_WIDTH - 1, REC_HEIGHT - 1); rb->lcd_update_rect( X_0_POS + j*REC_WIDTH + 1, Y_1_POS + i*REC_HEIGHT + 1, REC_WIDTH - 1, REC_HEIGHT - 1); @@ -762,6 +773,7 @@ void flashButton(int b) rb->sleep(HZ/22); } + rb->lcd_set_drawmode(DRMODE_SOLID); } /* ----------------------------------------------------------------------- @@ -778,7 +790,9 @@ void deleteAnimation(int pos) for (k=1;k<=4;k++){ rb->sleep(HZ/32); - rb->lcd_clearrect(1+pos*6, TEXT_1_POS, 6, 8); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(1+pos*6, TEXT_1_POS, 6, 8); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_fillrect(1+pos*6+1+k, TEXT_1_POS+k, (5-2*k)>0?(5-2*k):1, (7-2*k)>0?(7-2*k):1 ); rb->lcd_update_rect(1+pos*6, TEXT_1_POS, 6, 8); diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c index 8627c9a558..df23afd721 100644 --- a/apps/plugins/calendar.c +++ b/apps/plugins/calendar.c @@ -154,7 +154,9 @@ static void draw_calendar(struct shown *shown) rb->lcd_putsxy(ws, (row * h) + 5 ,buffer); if (shown->mday == j) { - rb->lcd_invertrect(ws, row*h+5, space, h); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(ws, row*h+5, space, h); + rb->lcd_set_drawmode(DRMODE_SOLID); shown->wday = pos; } ws += space; @@ -520,7 +522,9 @@ static void show_lines(int selected, struct shown *shown) k++; i++; } - rb->lcd_invertrect(0, (pos) * h, LCD_WIDTH, h); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(0, (pos) * h, LCD_WIDTH, h); + rb->lcd_set_drawmode(DRMODE_SOLID); } static void update_memos_shown(struct shown *shown) diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c index 766f0223a5..8485d40aae 100644 --- a/apps/plugins/chessclock.c +++ b/apps/plugins/chessclock.c @@ -216,7 +216,11 @@ static void show_pause_mode(bool enabled) if (enabled) rb->lcd_bitmap(pause_icon, 52, 0, 7, 8, true); else - rb->lcd_clearrect(52, 0, 7, 8); + { + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(52, 0, 7, 8); + rb->lcd_set_drawmode(DRMODE_SOLID); + } } #endif diff --git a/apps/plugins/clock.c b/apps/plugins/clock.c index 03ac0921a1..d58f746158 100644 --- a/apps/plugins/clock.c +++ b/apps/plugins/clock.c @@ -476,7 +476,9 @@ void save_settings(bool interface) if(interface) { - rb->lcd_clearrect(0, 56, 112, 8); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 56, 112, 8); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->snprintf(buf, sizeof(buf), "Saved Settings"); rb->lcd_getstringsize(buf, &buf_w, &buf_h); rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf); @@ -486,7 +488,9 @@ void save_settings(bool interface) { if(interface) { - rb->lcd_clearrect(0, 56, 112, 8); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 56, 112, 8); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->snprintf(buf, sizeof(buf), "Save Failed"); rb->lcd_getstringsize(buf, &buf_w, &buf_h); rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf); @@ -529,14 +533,18 @@ void load_settings(void) rb->read(fd, &settings, sizeof(struct saved_settings)); rb->close(fd); - rb->lcd_clearrect(0, 56, 112, 8); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 56, 112, 8); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->snprintf(buf, sizeof(buf), "Loaded Settings"); rb->lcd_getstringsize(buf, &buf_w, &buf_h); rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf); } else /* bail out */ { - rb->lcd_clearrect(0, 56, 112, 8); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 56, 112, 8); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->snprintf(buf, sizeof(buf), "Old Settings File"); rb->lcd_getstringsize(buf, &buf_w, &buf_h); rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf); @@ -545,7 +553,9 @@ void load_settings(void) } else /* bail out */ { - rb->lcd_clearrect(0, 56, 112, 8); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 56, 112, 8); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->snprintf(buf, sizeof(buf), "No Settings File"); rb->lcd_getstringsize(buf, &buf_w, &buf_h); rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf); @@ -1014,8 +1024,7 @@ void show_logo(bool animate, bool show_clock_text) { int y_position; - unsigned char *clogo = 0; - clogo = (unsigned char *)clocklogo; + unsigned char *clogo = (unsigned char *)clocklogo; rb->snprintf(buf, sizeof(buf), "Clock %s", CLOCK_VERSION); rb->lcd_getstringsize(buf, &buf_w, &buf_h); @@ -1026,8 +1035,10 @@ void show_logo(bool animate, bool show_clock_text) /* move down the screen */ for(y_position = 0; y_position <= 26; y_position++) { - rb->lcd_clearline(0, y_position/2-1, 111, y_position/2-1); - rb->lcd_clearline(0, y_position/2+38, 111, y_position/2+38); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawline(0, y_position/2-1, 111, y_position/2-1); + rb->lcd_drawline(0, y_position/2+38, 111, y_position/2+38); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_bitmap(clogo, 0, y_position/2, 112, 37, true); if(show_clock_text) rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 48, buf); @@ -1036,8 +1047,10 @@ void show_logo(bool animate, bool show_clock_text) /* bounce back up a little */ for(y_position = 26; y_position >= 16; y_position--) { - rb->lcd_clearline(0, y_position/2-1, 111, y_position/2-1); - rb->lcd_clearline(0, y_position/2+38, 111, y_position/2+38); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawline(0, y_position/2-1, 111, y_position/2-1); + rb->lcd_drawline(0, y_position/2+38, 111, y_position/2+38); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_bitmap(clogo, 0, y_position/2, 112, 37, true); if(show_clock_text) rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 48, buf); @@ -1046,8 +1059,10 @@ void show_logo(bool animate, bool show_clock_text) /* and go back down again */ for(y_position = 16; y_position <= 20; y_position++) { - rb->lcd_clearline(0, y_position/2-1, 111, y_position/2-1); - rb->lcd_clearline(0, y_position/2+38, 111, y_position/2+38); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawline(0, y_position/2-1, 111, y_position/2-1); + rb->lcd_drawline(0, y_position/2+38, 111, y_position/2+38); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_bitmap(clogo, 0, y_position/2, 112, 37, true); if(show_clock_text) rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 48, buf); @@ -1076,7 +1091,9 @@ void exit_logo(void) /* fly downwards */ for(y_position = 20; y_position <= 128; y_position++) { - rb->lcd_clearline(0, y_position/2-1, 111, y_position/2-1); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawline(0, y_position/2-1, 111, y_position/2-1); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_bitmap(clogo, 0, y_position/2, 112, 37, true); rb->lcd_update(); } @@ -1112,7 +1129,9 @@ bool roll_credits(void) /* fly in text from the left */ for(credits_pos = 0 - credits_w; credits_pos <= (LCD_WIDTH/2)-(credits_w/2); credits_pos++) { - rb->lcd_clearline(credits_pos-1, 0, credits_pos-1, 8); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawline(credits_pos-1, 0, credits_pos-1, 8); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_putsxy(credits_pos, 0, elapsednames); rb->lcd_update(); /* update the whole lcd to slow down the loop */ } @@ -1121,7 +1140,9 @@ bool roll_credits(void) for(progress_pos = LCD_WIDTH; progress_pos >= 40; progress_pos--) { rb->scrollbar(progress_pos, 9, LCD_WIDTH-progress_pos, 7, numnames*4, 0, progress_percent, HORIZONTAL); - rb->lcd_clearline(0, 0, 0, 30); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawline(0, 0, 0, 30); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_update(); /* update the whole lcd to slow down the loop */ } @@ -1146,7 +1167,9 @@ bool roll_credits(void) /* line 1 flies in */ for (namepos=0-name_w; namepos < (LCD_WIDTH/2)-(name_w/2)-2; namepos++) { - rb->lcd_clearrect(0, 48, 112, 8); /* clear any trails left behind */ + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 48, 112, 8); /* clear any trails left behind */ + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_putsxy(namepos, 48, name); rb->lcd_update(); @@ -1163,7 +1186,9 @@ bool roll_credits(void) /* now line 2 flies in */ for(jobpos=LCD_WIDTH; jobpos > (LCD_WIDTH/2)-(job_w+2)/2; jobpos--) /* we use (job_w+2) to ensure it fits on the LCD */ { - rb->lcd_clearrect(0, 56, 112, 8); /* clear trails */ + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 56, 112, 8); /* clear trails */ + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_putsxy(jobpos, 56, job); rb->lcd_update(); @@ -1185,7 +1210,9 @@ bool roll_credits(void) namepos++; jobpos--; - rb->lcd_clearrect(0, 48, 112, 16); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 48, 112, 16); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_putsxy(namepos, 48, name); rb->lcd_putsxy(jobpos, 56, job); rb->lcd_update(); @@ -1204,7 +1231,9 @@ bool roll_credits(void) jobpos=((LCD_WIDTH/2)-(job_w+2)/2)-8; while(namepos<LCD_WIDTH || jobpos > 0-job_w) { - rb->lcd_clearrect(0, 48, 112, 16); /* clear trails */ + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 48, 112, 16); /* clear trails */ + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_putsxy(namepos, 48, name); rb->lcd_putsxy(jobpos, 56, job); rb->lcd_update(); @@ -1233,7 +1262,9 @@ bool roll_credits(void) /* now make the text exit to the right */ for(credits_pos = (LCD_WIDTH/2)-(credits_w/2); credits_pos <= 112; credits_pos++) { - rb->lcd_clearline(credits_pos-1, 0, credits_pos-1, 8); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawline(credits_pos-1, 0, credits_pos-1, 8); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_putsxy(credits_pos, 0, elapsednames); rb->lcd_update(); } @@ -1241,7 +1272,9 @@ bool roll_credits(void) /* fold progressbar in to the right */ for(progress_pos = 42; progress_pos < 112; progress_pos++) { - rb->lcd_clearline(progress_pos-1, 8, progress_pos-1, 16); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawline(progress_pos-1, 8, progress_pos-1, 16); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->scrollbar(progress_pos, 9, LCD_WIDTH-progress_pos, 7, numnames*4, 0, progress_percent, HORIZONTAL); rb->lcd_update(); /* update the whole lcd to slow down the loop */ } @@ -1292,7 +1325,7 @@ bool show_credits(void) void cleanup(void *parameter) { - (void)parameter; /* unused */ + (void)parameter; if(settings.save_mode == 1) save_settings(true); @@ -1306,12 +1339,16 @@ void cleanup(void *parameter) *************/ void cursor(int x, int y, int w, int h) { - rb->lcd_invertrect(x, y, w, h); - - rb->lcd_clearpixel(x, y); - rb->lcd_clearpixel(x+w-1, y); - rb->lcd_clearpixel(x, y+h-1); - rb->lcd_clearpixel(x+w-1, y+h-1); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(x, y, w, h); + + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawpixel(x, y); + rb->lcd_drawpixel(x+w-1, y); + rb->lcd_drawpixel(x, y+h-1); + rb->lcd_drawpixel(x+w-1, y+h-1); + + rb->lcd_set_drawmode(DRMODE_SOLID); } /****************** @@ -1670,7 +1707,9 @@ bool f3_screen(void) analog_dummy = analog_y; for(; analog_y>analog_dummy-8; analog_y--) { - rb->lcd_clearrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID); draw_settings(); cursor(0, analog_y, 112, 8); rb->lcd_update(); @@ -1686,7 +1725,9 @@ bool f3_screen(void) analog_dummy = analog_y; for(; analog_y<analog_dummy+8; analog_y++) { - rb->lcd_clearrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID); draw_settings(); cursor(0, analog_y, 112, 8); rb->lcd_update(); @@ -1758,7 +1799,9 @@ bool f3_screen(void) digital_dummy = digital_y; for(; digital_y>digital_dummy-8; digital_y--) { - rb->lcd_clearrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID); draw_settings(); cursor(0, digital_y, 112, 8); rb->lcd_update(); @@ -1774,7 +1817,9 @@ bool f3_screen(void) digital_dummy = digital_y; for(; digital_y<digital_dummy+8; digital_y++) { - rb->lcd_clearrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID); draw_settings(); cursor(0, digital_y, 112, 8); rb->lcd_update(); @@ -1846,7 +1891,9 @@ bool f3_screen(void) lcd_dummy = lcd_y; for(; lcd_y>lcd_dummy-8; lcd_y--) { - rb->lcd_clearrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID); draw_settings(); cursor(0, lcd_y, 112, 8); rb->lcd_update(); @@ -1862,7 +1909,9 @@ bool f3_screen(void) lcd_dummy = lcd_y; for(; lcd_y<lcd_dummy+8; lcd_y++) { - rb->lcd_clearrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID); draw_settings(); cursor(0, lcd_y, 112, 8); rb->lcd_update(); @@ -1935,7 +1984,9 @@ bool f3_screen(void) full_dummy = full_y; for(; full_y>full_dummy-8; full_y--) { - rb->lcd_clearrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID); draw_settings(); cursor(0, full_y, 112, 8); rb->lcd_update(); @@ -1951,7 +2002,9 @@ bool f3_screen(void) full_dummy = full_y; for(; full_y<full_dummy+8; full_y++) { - rb->lcd_clearrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 32, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID); draw_settings(); cursor(0, full_y, 112, 8); rb->lcd_update(); @@ -2115,7 +2168,9 @@ void general_settings(void) cursor_dummy = cursor_y; for(; cursor_y>cursor_dummy-8; cursor_y--) { - rb->lcd_clearrect(0, 16, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 16, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_puts(2, 2, "Reset Settings"); rb->lcd_puts(2, 3, "Save Settings"); @@ -2150,7 +2205,9 @@ void general_settings(void) cursor_dummy = cursor_y; for(; cursor_y<cursor_dummy+8; cursor_y++) { - rb->lcd_clearrect(0, 16, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 16, 112, 32); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_puts(2, 2, "Reset Settings"); rb->lcd_puts(2, 3, "Save Settings"); @@ -2313,7 +2370,9 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second) /* Invert the whole LCD as the seconds go */ if(settings.digital_seconds == 3) { - rb->lcd_invertrect(0, 0, fill, 64); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(0, 0, fill, 64); + rb->lcd_set_drawmode(DRMODE_SOLID); } } else if(settings.clock == 3) /* LCD mode */ @@ -2349,7 +2408,9 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second) /* Invert the whole LCD as the seconds go */ if(settings.lcd_seconds == 3) { - rb->lcd_invertrect(0, 0, fill, 64); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(0, 0, fill, 64); + rb->lcd_set_drawmode(DRMODE_SOLID); } } else if(settings.clock == 4) /* Fullscreen mode */ @@ -2368,7 +2429,9 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second) } if(settings.fullscreen_invertseconds) { - rb->lcd_invertrect(0, 0, fill, 64); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(0, 0, fill, 64); + rb->lcd_set_drawmode(DRMODE_SOLID); } } } @@ -2424,7 +2487,9 @@ void select_mode(void) cursor_dummy = cursor_y; for(; cursor_y>cursor_dummy-8; cursor_y--) { - rb->lcd_clearrect(0, 8, 112, 40); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 8, 112, 40); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_puts(0, 0, "MODE SELECTOR"); rb->lcd_puts(2, 1, "Analog"); @@ -2456,7 +2521,9 @@ void select_mode(void) cursor_dummy = cursor_y; for(; cursor_y<cursor_dummy+8; cursor_y++) { - rb->lcd_clearrect(0, 8, 112, 40); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 8, 112, 40); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_puts(0, 0, "MODE SELECTOR"); rb->lcd_puts(2, 1, "Analog"); @@ -2516,7 +2583,9 @@ void counter_finished(void) rb->lcd_bitmap(times_up, 0, xpos, 112, 50, true); /* invert lcd */ - rb->lcd_invertrect(0, 0, 112, 64); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(0, 0, 112, 64); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_update(); @@ -2667,14 +2736,16 @@ void counter_options(void) rb->checkbox(1, 25, 8, 6, !counting_up); /* draw a cursor */ + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); switch(cursorpos) { - case 1: rb->lcd_invertrect(0, 16, 112, 8); break; - case 2: rb->lcd_invertrect(0, 24, 112, 8); break; - case 3: rb->lcd_invertrect(24, 40, 06, 8); break; - case 4: rb->lcd_invertrect(36, 40, 12, 8); break; - case 5: rb->lcd_invertrect(54, 40, 12, 8); break; + case 1: rb->lcd_fillrect(0, 16, 112, 8); break; + case 2: rb->lcd_fillrect(0, 24, 112, 8); break; + case 3: rb->lcd_fillrect(24, 40, 06, 8); break; + case 4: rb->lcd_fillrect(36, 40, 12, 8); break; + case 5: rb->lcd_fillrect(54, 40, 12, 8); break; } + rb->lcd_set_drawmode(DRMODE_SOLID); if(cursorpos > 2) editing_target = true; @@ -2807,7 +2878,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) TEST_PLUGIN_API(api); (void)parameter; rb = api; - + /* universal font */ rb->lcd_setfont(FONT_SYSFIXED); diff --git a/apps/plugins/databox/databox.c b/apps/plugins/databox/databox.c index 8fc8c0b499..4e3722b671 100644 --- a/apps/plugins/databox/databox.c +++ b/apps/plugins/databox/databox.c @@ -73,8 +73,11 @@ void print(char *word, int invert) { if (printing.font_h*printing.line >= LCD_HEIGHT) return; rb->lcd_putsxy(printing.font_w*printing.position,printing.font_h*printing.line,word); - if(invert) - rb->lcd_invertrect(printing.font_w*printing.position,printing.font_h*printing.line,printing.font_w*strlen,printing.font_h); + if(invert) { + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(printing.font_w*printing.position,printing.font_h*printing.line,printing.font_w*strlen,printing.font_h); + rb->lcd_set_drawmode(DRMODE_SOLID); + } rb->lcd_update_rect(printing.font_w*printing.position,printing.font_h*printing.line,printing.font_w*strlen,printing.font_h); printing.position=newpos; } diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c index 7238fa3f75..57cbad213d 100644 --- a/apps/plugins/flipit.c +++ b/apps/plugins/flipit.c @@ -92,10 +92,12 @@ static void clear_cursor(void) { int i,j; i = (cursor_pos%5)*16; j = (cursor_pos/5)*16; - rb->lcd_clearline(i, j, i+15, j); - rb->lcd_clearline(i, j+15, i+15, j+15); - rb->lcd_clearline(i, j, i, j+15); - rb->lcd_clearline(i+15, j, i+15, j+15); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawline(i, j, i+15, j); + rb->lcd_drawline(i, j+15, i+15, j+15); + rb->lcd_drawline(i, j, i, j+15); + rb->lcd_drawline(i+15, j, i+15, j+15); + rb->lcd_set_drawmode(DRMODE_SOLID); } /* check if the puzzle is finished */ @@ -167,7 +169,9 @@ static void flipit_init(void) { cursor_pos = 0; draw_cursor(); moves = 0; - rb->lcd_clearrect(80, 0, 32, 64); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(80, 0, 32, 64); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_drawrect(80, 0, 32, 64); rb->lcd_putsxy(81, 10, "Flips"); rb->snprintf(s, sizeof(s), "%d", moves); diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index c8d2c01a0d..bf71436464 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c @@ -383,8 +383,10 @@ int minesweeper(void) } /* display the cursor */ - rb->lcd_invertrect(x*8,y*8,8,8); - + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(x*8,y*8,8,8); + rb->lcd_set_drawmode(DRMODE_SOLID); + /* update the screen */ rb->lcd_update(); diff --git a/apps/plugins/mosaique.c b/apps/plugins/mosaique.c index af5f4d1c01..3d0bfb816a 100644 --- a/apps/plugins/mosaique.c +++ b/apps/plugins/mosaique.c @@ -63,6 +63,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) #ifdef HAVE_LCD_BITMAP rb->lcd_clear_display(); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); #else if (!pgfx_init(rb, 4, 2)) { @@ -101,10 +102,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) } #ifdef HAVE_LCD_BITMAP - rb->lcd_invertrect(LARGE-x, HAUT-y, 2*x+1, 1); - rb->lcd_invertrect(LARGE-x, HAUT+y, 2*x+1, 1); - rb->lcd_invertrect(LARGE-x, HAUT-y+1, 1, 2*y-1); - rb->lcd_invertrect(LARGE+x, HAUT-y+1, 1, 2*y-1); + rb->lcd_fillrect(LARGE-x, HAUT-y, 2*x+1, 1); + rb->lcd_fillrect(LARGE-x, HAUT+y, 2*x+1, 1); + rb->lcd_fillrect(LARGE-x, HAUT-y+1, 1, 2*y-1); + rb->lcd_fillrect(LARGE+x, HAUT-y+1, 1, 2*y-1); rb->lcd_update(); #else pgfx_invertrect(LARGE-x, HAUT-y, 2*x+1, 1); @@ -120,7 +121,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) switch (button) { case MOSAIQUE_QUIT: -#ifdef HAVE_LCD_CHARCELLS +#ifdef HAVE_LCD_BITMAP + rb->lcd_set_drawmode(DRMODE_SOLID); +#else pgfx_release(); #endif return PLUGIN_OK; @@ -148,7 +151,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) default: if (rb->default_event_handler(button) == SYS_USB_CONNECTED) { -#ifdef HAVE_LCD_CHARCELLS +#ifdef HAVE_LCD_BITMAP + rb->lcd_set_drawmode(DRMODE_SOLID); +#else pgfx_release(); #endif return PLUGIN_USB_CONNECTED; diff --git a/apps/plugins/oscillograph.c b/apps/plugins/oscillograph.c index 50e18e5a9f..1512e11389 100644 --- a/apps/plugins/oscillograph.c +++ b/apps/plugins/oscillograph.c @@ -65,7 +65,6 @@ static int drawMode = DRAW_MODE_FILLED; void cleanup(void *parameter) { (void)parameter; - /* restore to default roll position. Looks funny if you forget to do this... */ rb->lcd_roll(0); @@ -91,13 +90,13 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) int lastLeft = 0; int lastRight = 0; int lasty = 0; - + bool exit = false; TEST_PLUGIN_API(api); (void)parameter; rb = api; - + /* the main loop */ while (!exit) { @@ -106,8 +105,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) right = rb->mas_codec_readreg(0xD) / (MAX_PEAK / (LCD_WIDTH / 2 - 2)); /* delete current line */ - rb->lcd_clearline(0, y, LCD_WIDTH-1, y); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawline(0, y, LCD_WIDTH-1, y); + rb->lcd_set_drawmode(DRMODE_SOLID); switch (drawMode) { case DRAW_MODE_FILLED: rb->lcd_drawline(LCD_WIDTH / 2 + 1 , y, diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index 868a20547c..ae77f33369 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -146,7 +146,9 @@ void timer_isr(void) x = 0; } - rb->lcd_clearline(x, 0, x, LCD_HEIGHT-1); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawline(x, 0, x, LCD_HEIGHT-1); + rb->lcd_set_drawmode(DRMODE_SOLID); switch (draw_mode) { @@ -189,7 +191,7 @@ void timer_isr(void) void cleanup(void *parameter) { (void)parameter; - + rb->plugin_unregister_timer(); } @@ -202,7 +204,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) TEST_PLUGIN_API(api); (void)parameter; rb = api; - + rb->plugin_register_timer(FREQ / 67, 1, timer_isr); while (!exit) diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c index 2fec2e3a44..438bfbbc4e 100644 --- a/apps/plugins/pong.c +++ b/apps/plugins/pong.c @@ -72,10 +72,14 @@ struct pong { void singlepad(int x, int y, int set) { - if(set) + if(set) { rb->lcd_fillrect(x, y, PAD_WIDTH, PAD_HEIGHT); - else - rb->lcd_clearrect(x, y, PAD_WIDTH, PAD_HEIGHT); + } + else { + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(x, y, PAD_WIDTH, PAD_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID); + } } void pad(struct pong *p, int pad) @@ -241,7 +245,9 @@ void ball(struct pong *p) score(p, 0); /* clear old position */ - rb->lcd_clearrect(x, y, BALL_WIDTH, BALL_HEIGTH); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(x, y, BALL_WIDTH, BALL_HEIGTH); + rb->lcd_set_drawmode(DRMODE_SOLID); /* draw the new ball position */ rb->lcd_fillrect(newx, newy, BALL_WIDTH, BALL_HEIGTH); diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index eac6563601..a0623da314 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c @@ -110,13 +110,16 @@ static void draw_frame(int fstart_x,int fstop_x,int fstart_y,int fstop_y) static void draw_block(int x, int y, int block, int frame, bool clear) { int i, a, b; + for(i=0;i < 4;i++) { if (clear) { + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); for (a = 0; a < 3; a++) for (b = 0; b < 4; b++) - rb->lcd_clearpixel(start_x + x + block_data[block][frame][1][i] * 4 - b, + rb->lcd_drawpixel(start_x + x + block_data[block][frame][1][i] * 4 - b, start_y + y + block_data[block][frame][0][i] * 3 + a); + rb->lcd_set_drawmode(DRMODE_SOLID); } else { @@ -196,12 +199,19 @@ static bool valid_position(int x, int y, int block, int frame) static void from_virtual(void) { int x,y; + for(y = 0; y < max_y; y++) for(x = 1; x < max_x - 1; x++) if(*(virtual + (y * max_x) + x) != 0) + { rb->lcd_drawpixel(start_x + x, start_y + y); + } else - rb->lcd_clearpixel(start_x + x, start_y + y); + { + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_drawpixel(start_x + x, start_y + y); + rb->lcd_set_drawmode(DRMODE_SOLID); + } } static void move_block(int x,int y,int f) @@ -362,7 +372,9 @@ static int game_loop(void) if(gameover()) { - rb->lcd_clearrect(0, 52, LCD_WIDTH, LCD_HEIGHT - 52); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 52, LCD_WIDTH, LCD_HEIGHT - 52); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_putsxy(2, 52, "You lose!"); rb->lcd_update(); rb->sleep(HZ * 3); diff --git a/apps/plugins/rockboy/Makefile b/apps/plugins/rockboy/Makefile index 727daa7186..1d32e0a84c 100644 --- a/apps/plugins/rockboy/Makefile +++ b/apps/plugins/rockboy/Makefile @@ -8,7 +8,7 @@ # INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ - -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) + -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) CFLAGS = $(GCCOPTS) -O3 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ -DMEM=${MEMORYSIZE} -DPLUGIN diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c index 2334f0d17e..50f86c3408 100644 --- a/apps/plugins/rockboy/menu.c +++ b/apps/plugins/rockboy/menu.c @@ -356,12 +356,13 @@ static void select_item(char *title, int curr_item, size_t item_i) { x = MENU_X + MENU_ITEM_PAD; w = MENU_WIDTH - 2 * MENU_ITEM_PAD; + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); /* if there is a current item, then deselect it */ if (curr_item >= 0) { /* deselect old item */ y = MENU_Y + h + MENU_ITEM_PAD * 2; /* account for title */ y += h * curr_item; - rb->lcd_invertrect(x, y, w, h); + rb->lcd_fillrect(x, y, w, h); } /* select new item */ @@ -370,7 +371,8 @@ static void select_item(char *title, int curr_item, size_t item_i) { /* select new item */ y = MENU_Y + h + MENU_ITEM_PAD * 2; /* account for title */ y += h * curr_item; - rb->lcd_invertrect(x, y, w, h); + rb->lcd_fillrect(x, y, w, h); + rb->lcd_set_drawmode(DRMODE_SOLID); /* update the menu window */ rb->lcd_update_rect(MENU_RECT); @@ -392,7 +394,9 @@ static void draw_menu(char *title, char **items, size_t num_items) { /* draw the outline */ rb->lcd_fillrect(SHADOW_RECT); - rb->lcd_clearrect(MENU_RECT); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(MENU_RECT); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_drawrect(MENU_RECT); /* calculate x/y */ @@ -406,8 +410,10 @@ static void draw_menu(char *title, char **items, size_t num_items) { rb->lcd_drawline(MENU_X, i, MENU_X + MENU_WIDTH, i); /* clear title rect */ - rb->lcd_clearrect((LCD_WIDTH - w) / 2 - 2, y - 2, w + 4, h); - + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect((LCD_WIDTH - w) / 2 - 2, y - 2, w + 4, h); + rb->lcd_set_drawmode(DRMODE_SOLID); + /* draw centered title on screen */ rb->lcd_putsxy((LCD_WIDTH - w)/2, y, title); diff --git a/apps/plugins/rockboy/rockmacros.h b/apps/plugins/rockboy/rockmacros.h index 03a6810a55..e246086f05 100644 --- a/apps/plugins/rockboy/rockmacros.h +++ b/apps/plugins/rockboy/rockmacros.h @@ -17,7 +17,7 @@ * ****************************************************************************/ -#include <plugin.h> +#include "plugin.h" #include "autoconf.h" @@ -51,6 +51,16 @@ void savestate(int fd); #define isalpha(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && ((c) <= 'Z'))) #define isalnum(c) (isdigit(c) || (isalpha(c))) +/* FIXME: This is a q&d fix for these #defines not being available from + * rockbox' lcd.h because rockboy has its own lcd.h. Renaming the file and + * adapting the other files produced weird errors I couldn't figure out + * -- amiconn 20050624 -- */ +#define DRMODE_COMPLEMENT 0 +#define DRMODE_BG 1 +#define DRMODE_FG 2 +#define DRMODE_SOLID 3 +#define DRMODE_INVERSEVID 4 /* used as bit modifier for basic modes */ + #ifdef SIMULATOR #undef opendir #define opendir(a) rb->sim_opendir((a)) diff --git a/apps/plugins/rockboy/sound.h b/apps/plugins/rockboy/sound.h index 1a24ee600f..f4791127a8 100644 --- a/apps/plugins/rockboy/sound.h +++ b/apps/plugins/rockboy/sound.h @@ -3,6 +3,7 @@ #ifndef __SOUND_H__ #define __SOUND_H__ +#include "defs.h" struct sndchan { diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c index d6cbe48525..83f92b241b 100644 --- a/apps/plugins/sliding_puzzle.c +++ b/apps/plugins/sliding_puzzle.c @@ -151,7 +151,9 @@ static void draw_spot(int p, int x, int y) rb->lcd_bitmap (picture[p-1], x, y, 16, 16, true); } else { rb->lcd_drawrect(x, y, 16, 16); - rb->lcd_clearrect(x+1, y+1, 14, 14); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(x+1, y+1, 14, 14); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->snprintf(s, sizeof(s), "%d", p); rb->lcd_putsxy(x+2, y+4, s); } diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c index 5d1e02044b..e13fdf560b 100644 --- a/apps/plugins/snake.c +++ b/apps/plugins/snake.c @@ -142,7 +142,9 @@ void frame (void) default: if (board[x][y]==snakelength) { board[x][y]=0; - rb->lcd_clearrect(x*4,y*4,4,4); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(x*4,y*4,4,4); + rb->lcd_set_drawmode(DRMODE_SOLID); } else board[x][y]++; diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c index 0b0419bcf0..bd9792a23d 100644 --- a/apps/plugins/snake2.c +++ b/apps/plugins/snake2.c @@ -620,7 +620,9 @@ void draw_apple( void ) char pscore[5], counter[4]; rb->lcd_bitmap(snakebmp,0,0,BMPWIDTH_snakebmp,BMPHEIGHT_snakebmp,false); - rb->lcd_clearrect(0,0,BMPWIDTH_snakeupbmp,BMPHEIGHT_snakeupbmp); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0,0,BMPWIDTH_snakeupbmp,BMPHEIGHT_snakeupbmp); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_bitmap(snakeupbmp,0,0,BMPWIDTH_snakeupbmp,BMPHEIGHT_snakeupbmp,false); rb->snprintf(counter,sizeof(counter),"%d",applecount); @@ -838,7 +840,9 @@ void redraw (void) */ void draw_snake_bit(int currentbit, int previousbit, int x, int y) { - rb->lcd_clearrect(CENTER_X+x*MULTIPLIER,CENTER_Y+y*MULTIPLIER,MODIFIER_1,MODIFIER_1); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(CENTER_X+x*MULTIPLIER,CENTER_Y+y*MULTIPLIER,MODIFIER_1,MODIFIER_1); + rb->lcd_set_drawmode(DRMODE_SOLID); switch(currentbit) { @@ -1065,8 +1069,10 @@ void move( void ) /*clear tail*/ if(applecountdown <= 0) { - rb->lcd_clearrect(CENTER_X+tailx*MULTIPLIER,CENTER_Y+taily*MULTIPLIER,MODIFIER_1,MODIFIER_1); - + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(CENTER_X+tailx*MULTIPLIER,CENTER_Y+taily*MULTIPLIER,MODIFIER_1,MODIFIER_1); + rb->lcd_set_drawmode(DRMODE_SOLID); + taildir = board[tailx][taily]; board[tailx][taily] = 0; diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c index 0fc01eef6e..dd97abc4fb 100644 --- a/apps/plugins/snow.c +++ b/apps/plugins/snow.c @@ -82,8 +82,10 @@ static void snow_move(void) for (i=0; i<NUM_PARTICLES; i++) { if (particle_exists(i)) { #ifdef HAVE_LCD_BITMAP - rb->lcd_clearrect(particles[i][0],particles[i][1], - FLAKE_WIDTH,FLAKE_WIDTH); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(particles[i][0],particles[i][1], + FLAKE_WIDTH,FLAKE_WIDTH); + rb->lcd_set_drawmode(DRMODE_SOLID); #else pgfx_clearpixel(particles[i][0],particles[i][1]); #endif diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index 0e81f0f2d3..f7dc165a13 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c @@ -825,14 +825,16 @@ static bool sokoban_loop(void) if (current_info.level.level > current_info.max_level) { rb->lcd_putsxy(10, 20, "You WIN!!"); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); for (i = 0; i < 30000 ; i++) { - rb->lcd_invertrect(0, 0, 111, 63); + rb->lcd_fillrect(0, 0, 111, 63); rb->lcd_update(); button = rb->button_get(false); if (button && ((button & BUTTON_REL) != BUTTON_REL)) break; } + rb->lcd_set_drawmode(DRMODE_SOLID); return PLUGIN_OK; } diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index 9fc0062454..066af9da73 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c @@ -518,8 +518,11 @@ int solitaire_menu(unsigned char when) for(i = 0; i<MENU_LENGTH; i++){ rb->lcd_putsxy(1, 17+fh*i, menu[when][i]); - if(cursor == i) - rb->lcd_invertrect(0,17+fh*i, LCD_WIDTH, fh); + if(cursor == i) { + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(0,17+fh*i, LCD_WIDTH, fh); + rb->lcd_set_drawmode(DRMODE_SOLID); + } } rb->lcd_update(); @@ -877,12 +880,15 @@ int solitaire(void){ if(c==NOT_A_CARD) { /* draw the cursor on empty columns */ if(cur_col == i){ - rb->lcd_invertrect(i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+2, 2, CARD_WIDTH-3, CARD_HEIGHT-1); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+2, 2, CARD_WIDTH-3, CARD_HEIGHT-1); } break; } /* clear the card's spot */ - rb->lcd_clearrect(i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM, j+1, CARD_WIDTH, CARD_HEIGHT-1); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM, j+1, CARD_WIDTH, CARD_HEIGHT-1); + rb->lcd_set_drawmode(DRMODE_SOLID); /* known card */ if(deck[c].known){ rb->lcd_bitmap(numbers[deck[c].num], i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+1, j, 8, 8, true); @@ -896,7 +902,9 @@ int solitaire(void){ } /* cursor (or not) */ if(c == cur_card){ - rb->lcd_invertrect(i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+1, j+1, CARD_WIDTH-1, CARD_HEIGHT-1); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+1, j+1, CARD_WIDTH-1, CARD_HEIGHT-1); + rb->lcd_set_drawmode(DRMODE_SOLID); /* go to the next card */ c = deck[c].next; if(c == NOT_A_CARD) break; @@ -941,7 +949,9 @@ int solitaire(void){ rb->lcd_drawline(LCD_WIDTH - CARD_WIDTH+1,(i+1)*CARD_HEIGHT,LCD_WIDTH - 1,(i+1)*CARD_HEIGHT); /* draw the cursor on one of the stacks */ if(cur_col == STACKS_COL + i){ - rb->lcd_invertrect(LCD_WIDTH - CARD_WIDTH+1, i*CARD_HEIGHT + 1, CARD_WIDTH-1, CARD_HEIGHT-1); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(LCD_WIDTH - CARD_WIDTH+1, i*CARD_HEIGHT + 1, CARD_WIDTH-1, CARD_HEIGHT-1); + rb->lcd_set_drawmode(DRMODE_SOLID); } } @@ -952,16 +962,18 @@ int solitaire(void){ rb->lcd_drawline(LCD_WIDTH - CARD_WIDTH+1,LCD_HEIGHT-1,LCD_WIDTH - 1,LCD_HEIGHT-1); if(cur_rem != NOT_A_CARD){ rb->lcd_bitmap(numbers[deck[cur_rem].num], LCD_WIDTH - CARD_WIDTH+1, LCD_HEIGHT-CARD_HEIGHT, 8, 8, true); - rb->lcd_bitmap(colors[deck[cur_rem].color], LCD_WIDTH - CARD_WIDTH+7, LCD_HEIGHT-CARD_HEIGHT, 8, 8, true); - /* draw a selected card */ - if(sel_card == cur_rem){ + rb->lcd_bitmap(colors[deck[cur_rem].color], LCD_WIDTH - CARD_WIDTH+7, LCD_HEIGHT-CARD_HEIGHT, 8, 8, true); + /* draw a selected card */ + if(sel_card == cur_rem){ rb->lcd_drawrect(LCD_WIDTH - CARD_WIDTH+1, LCD_HEIGHT-CARD_HEIGHT,CARD_WIDTH-1, CARD_HEIGHT-1); - } + } } } /* draw the cursor */ if(cur_col == REM_COL){ - rb->lcd_invertrect(LCD_WIDTH - CARD_WIDTH+1, LCD_HEIGHT-CARD_HEIGHT,CARD_WIDTH-1, CARD_HEIGHT-1); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(LCD_WIDTH - CARD_WIDTH+1, LCD_HEIGHT-CARD_HEIGHT,CARD_WIDTH-1, CARD_HEIGHT-1); + rb->lcd_set_drawmode(DRMODE_SOLID); } diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c index e52ce244f1..20a9922a29 100644 --- a/apps/plugins/splitedit.c +++ b/apps/plugins/splitedit.c @@ -210,7 +210,9 @@ static void update_data(void) rb->lcd_getstringsize(buf, &w, &h); - rb->lcd_clearrect(0, 0, LCD_WIDTH, h); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 0, LCD_WIDTH, h); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_puts(0, 0, buf); rb->lcd_update_rect(0, 0, LCD_WIDTH, h); } @@ -253,7 +255,9 @@ int splitedit_get_loop_mode(void) */ static void update_icons(void) { - rb->lcd_clearrect(0, LCD_HEIGHT - BMPHEIGHT, LCD_WIDTH, BMPHEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, LCD_HEIGHT - BMPHEIGHT, LCD_WIDTH, BMPHEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID); /* The CUT icon */ rb->lcd_bitmap(CUT_BMP, @@ -380,9 +384,11 @@ void splitedit_set_split_x(int newx) /* remove old split point from screen, only if moved */ if (split_x != newx) { - rb->lcd_invertrect (minx, OSCI_Y, 5, 1); - rb->lcd_invertrect (split_x-1 > 0 ? split_x - 1: 0, OSCI_Y + 1, 3, 1); - rb->lcd_invertrect (split_x, OSCI_Y + 2, 1, OSCI_HEIGHT - 2); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(minx, OSCI_Y, 5, 1); + rb->lcd_fillrect(split_x-1 > 0 ? split_x - 1: 0, OSCI_Y + 1, 3, 1); + rb->lcd_fillrect(split_x, OSCI_Y + 2, 1, OSCI_HEIGHT - 2); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_update_rect(minx, OSCI_Y, 5, OSCI_HEIGHT); } @@ -398,9 +404,11 @@ void splitedit_set_split_x(int newx) /* display new split point */ minx = split_x - 2 > 0 ? split_x - 2: 0; - rb->lcd_invertrect (minx, OSCI_Y, 5, 1); - rb->lcd_invertrect (split_x - 1 > 0 ? split_x - 1: 0, OSCI_Y + 1, 3, 1); - rb->lcd_invertrect (split_x, OSCI_Y + 2, 1, OSCI_HEIGHT - 2); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(minx, OSCI_Y, 5, 1); + rb->lcd_fillrect(split_x - 1 > 0 ? split_x - 1: 0, OSCI_Y + 1, 3, 1); + rb->lcd_fillrect(split_x, OSCI_Y + 2, 1, OSCI_HEIGHT - 2); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_update_rect(minx, OSCI_Y, 5, OSCI_HEIGHT); } @@ -417,7 +425,9 @@ int splitedit_get_split_x(void) */ static void update_osci(void) { - rb->lcd_clearrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID); redraw_osci(); splitedit_set_split_x(splitedit_get_split_x()); rb->lcd_update_rect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT); @@ -485,7 +495,9 @@ static void scroll(struct mp3entry *mp3) */ void splitedit_zoom_in(struct mp3entry *mp3) { - rb->lcd_clearrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID); zoom(mp3, 3, 4); rb->lcd_update_rect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT); update_osci(); @@ -497,7 +509,9 @@ void splitedit_zoom_in(struct mp3entry *mp3) */ void splitedit_zoom_out(struct mp3entry *mp3) { - rb->lcd_clearrect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID); zoom(mp3, 4, 3); rb->lcd_update_rect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT); update_osci(); @@ -823,7 +837,9 @@ static void save_editor(struct mp3entry *mp3, int splittime) case SE_SAVE: rb->lcd_stop_scroll(); - rb->lcd_clearrect(0, 6*8, LCD_WIDTH, LCD_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(0, 6*8, LCD_WIDTH, LCD_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID); saved = save ( mp3, @@ -919,7 +935,9 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split, } /* make room */ - rb->lcd_clearrect(lastx + 1, OSCI_Y, x - lastx, OSCI_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(lastx + 1, OSCI_Y, x - lastx, OSCI_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID); /* draw a value */ if (osci_buffer[x - OSCI_X] > 0) { @@ -937,8 +955,10 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split, /* mark the current position */ if (lastx != x) { - rb->lcd_invertrect(lastx, OSCI_Y, 1, OSCI_HEIGHT); - rb->lcd_invertrect(x, OSCI_Y, 1, OSCI_HEIGHT); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(lastx, OSCI_Y, 1, OSCI_HEIGHT); + rb->lcd_fillrect(x, OSCI_Y, 1, OSCI_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID); } /* mark the split point */ @@ -946,11 +966,13 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split, { if ((lastx < split_x) && (x >= split_x)) { - rb->lcd_invertrect + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect ( split_x, OSCI_Y + 2, 1, OSCI_HEIGHT - 2 ); + rb->lcd_set_drawmode(DRMODE_SOLID); } rb->lcd_drawline(split_x -2, OSCI_Y, split_x + 2, OSCI_Y); rb->lcd_drawline(split_x-1, OSCI_Y+1, split_x +1,OSCI_Y+1); diff --git a/apps/plugins/star.c b/apps/plugins/star.c index 79f93ccba2..fbaf8aeed6 100644 --- a/apps/plugins/star.c +++ b/apps/plugins/star.c @@ -838,7 +838,9 @@ static int star_menu(void) for (i = 0 ; i < char_height ; i++) { - rb->lcd_clearrect (2, 30, 7, 4 * 8); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect (2, 30, 7, 4 * 8); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_bitmap(arrow_bmp[anim_arrow[(anim_state & 0x38) >> 3]], 2, menu_offset_y + menu_y * 8 + move_y * i, 7, 8, false); diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index afeaa83d90..1a6f723292 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c @@ -213,7 +213,9 @@ void change_settings(void) } } - rb->lcd_invertrect(0, selected_setting*8+8,111,8); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(0, selected_setting*8+8,111,8); + rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_update(); switch(rb->button_get_w_tmo(1)) diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c index 4c7d7ee950..e0e33b6801 100644 --- a/apps/plugins/wormlet.c +++ b/apps/plugins/wormlet.c @@ -535,9 +535,11 @@ static int make_food(int index) { static void clear_food(int index) { /* remove the old food from the screen */ - rb->lcd_clearrect(foodx[index] + FIELD_RECT_X, - foody[index] + FIELD_RECT_Y, - FOOD_SIZE, FOOD_SIZE); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(foodx[index] + FIELD_RECT_X, + foody[index] + FIELD_RECT_Y, + FOOD_SIZE, FOOD_SIZE); + rb->lcd_set_drawmode(DRMODE_SOLID); } /** @@ -550,11 +552,13 @@ static void draw_food(int index) { /* draw the food object */ rb->lcd_fillrect(foodx[index] + FIELD_RECT_X, - foody[index] + FIELD_RECT_Y, - FOOD_SIZE, FOOD_SIZE); - rb->lcd_clearrect(foodx[index] + FIELD_RECT_X + 1, - foody[index] + FIELD_RECT_Y + 1, - FOOD_SIZE - 2, FOOD_SIZE - 2); + foody[index] + FIELD_RECT_Y, + FOOD_SIZE, FOOD_SIZE); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(foodx[index] + FIELD_RECT_X + 1, + foody[index] + FIELD_RECT_Y + 1, + FOOD_SIZE - 2, FOOD_SIZE - 2); + rb->lcd_set_drawmode(DRMODE_SOLID); } /** @@ -742,8 +746,10 @@ static void init_wormlet(void) } /* draw the game field */ - rb->lcd_invertrect(0, 0, FIELD_RECT_WIDTH + 2, FIELD_RECT_HEIGHT + 2); - rb->lcd_invertrect(1, 1, FIELD_RECT_WIDTH, FIELD_RECT_HEIGHT); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(0, 0, FIELD_RECT_WIDTH + 2, FIELD_RECT_HEIGHT + 2); + rb->lcd_fillrect(1, 1, FIELD_RECT_WIDTH, FIELD_RECT_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID); /* make everything visible */ rb->lcd_update(); @@ -841,12 +847,15 @@ static void draw_worm(struct worm *w) rb->lcd_drawpixel(x + FIELD_RECT_X, y + FIELD_RECT_Y); } + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + /* clear the space behind the worm */ x = w->x[w->tail] ; y = w->y[w->tail] ; if (x >= 0 && x < FIELD_RECT_WIDTH && y >= 0 && y < FIELD_RECT_HEIGHT) { - rb->lcd_clearpixel(x + FIELD_RECT_X, y + FIELD_RECT_Y); + rb->lcd_drawpixel(x + FIELD_RECT_X, y + FIELD_RECT_Y); } + rb->lcd_set_drawmode(DRMODE_SOLID); } /** @@ -1155,7 +1164,9 @@ static void score_board(void) char* buf2 = NULL; int i; int y = 0; - rb->lcd_clearrect(FIELD_RECT_WIDTH + 2, 0, LCD_WIDTH - FIELD_RECT_WIDTH - 2, LCD_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_fillrect(FIELD_RECT_WIDTH + 2, 0, LCD_WIDTH - FIELD_RECT_WIDTH - 2, LCD_HEIGHT); + rb->lcd_set_drawmode(DRMODE_SOLID); for (i = 0; i < worm_count; i++) { int score = get_score(&worms[i]); @@ -1202,8 +1213,10 @@ static void score_board(void) rb->lcd_putsxy(FIELD_RECT_WIDTH + 3, y+8, buf2); if (!worms[i].alive){ - rb->lcd_invertrect(FIELD_RECT_WIDTH + 2, y, - LCD_WIDTH - FIELD_RECT_WIDTH - 2, 17); + rb->lcd_set_drawmode(DRMODE_COMPLEMENT); + rb->lcd_fillrect(FIELD_RECT_WIDTH + 2, y, + LCD_WIDTH - FIELD_RECT_WIDTH - 2, 17); + rb->lcd_set_drawmode(DRMODE_SOLID); } y += 19; } |