summaryrefslogtreecommitdiff
path: root/apps/plugins/sudoku/sudoku.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/sudoku/sudoku.c')
-rw-r--r--apps/plugins/sudoku/sudoku.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c
index 69c41f476e..413be298ea 100644
--- a/apps/plugins/sudoku/sudoku.c
+++ b/apps/plugins/sudoku/sudoku.c
@@ -337,7 +337,7 @@ void sudoku_init(Sudoku* sud);
337void sudoku_set(Sudoku* sud, int x, int y, int num, bool original); 337void sudoku_set(Sudoku* sud, int x, int y, int num, bool original);
338int sudoku_get(Sudoku* sud, int x, int y, bool* original); 338int sudoku_get(Sudoku* sud, int x, int y, bool* original);
339 339
340#define BIT(n) ((Bitset)(1<<(n))) 340#define BIT(n) ((Bitset)BIT_N(n))
341#define BIT_TEST(v,n) ((((Bitset)v) & BIT(n)) != 0) 341#define BIT_TEST(v,n) ((((Bitset)v) & BIT(n)) != 0)
342#define BIT_CLEAR(v,n) (v) &= ~BIT(n) 342#define BIT_CLEAR(v,n) (v) &= ~BIT(n)
343#define MARK_BIT BIT(0) 343#define MARK_BIT BIT(0)
@@ -965,7 +965,7 @@ void display_board(struct sudoku_state_t* state)
965 rb->lcd_vline(XOFS+cellxpos[r]-2,YOFSSCRATCHPAD, 965 rb->lcd_vline(XOFS+cellxpos[r]-2,YOFSSCRATCHPAD,
966 YOFSSCRATCHPAD+CELL_HEIGHT+1); 966 YOFSSCRATCHPAD+CELL_HEIGHT+1);
967#endif 967#endif
968 if ((r>0) && state->possiblevals[state->y][state->x]&(1<<(r))) 968 if ((r>0) && state->possiblevals[state->y][state->x]&BIT_N(r))
969 rb->lcd_bitmap_part(sudoku_normal,NUMBER_TYPE,BITMAP_HEIGHT*r, 969 rb->lcd_bitmap_part(sudoku_normal,NUMBER_TYPE,BITMAP_HEIGHT*r,
970 BITMAP_STRIDE,XOFS+cellxpos[r-1], 970 BITMAP_STRIDE,XOFS+cellxpos[r-1],
971 YOFSSCRATCHPAD+1,CELL_WIDTH,CELL_HEIGHT); 971 YOFSSCRATCHPAD+1,CELL_WIDTH,CELL_HEIGHT);
@@ -976,7 +976,7 @@ void display_board(struct sudoku_state_t* state)
976 rb->lcd_vline(XOFS+cellxpos[8]+CELL_WIDTH+1,YOFSSCRATCHPAD, 976 rb->lcd_vline(XOFS+cellxpos[8]+CELL_WIDTH+1,YOFSSCRATCHPAD,
977 YOFSSCRATCHPAD+CELL_HEIGHT+1); 977 YOFSSCRATCHPAD+CELL_HEIGHT+1);
978#endif 978#endif
979 if (state->possiblevals[state->y][state->x]&(1<<(r))) 979 if (state->possiblevals[state->y][state->x]&BIT_N(r))
980 rb->lcd_bitmap_part(sudoku_normal,NUMBER_TYPE,BITMAP_HEIGHT*r, 980 rb->lcd_bitmap_part(sudoku_normal,NUMBER_TYPE,BITMAP_HEIGHT*r,
981 BITMAP_STRIDE,XOFS+cellxpos[8],YOFSSCRATCHPAD+1, 981 BITMAP_STRIDE,XOFS+cellxpos[8],YOFSSCRATCHPAD+1,
982 CELL_WIDTH,CELL_HEIGHT); 982 CELL_WIDTH,CELL_HEIGHT);
@@ -1004,7 +1004,7 @@ void display_board(struct sudoku_state_t* state)
1004 rb->lcd_hline(XOFSSCRATCHPAD,XOFSSCRATCHPAD+CELL_WIDTH+1, 1004 rb->lcd_hline(XOFSSCRATCHPAD,XOFSSCRATCHPAD+CELL_WIDTH+1,
1005 YOFS+cellypos[r]-2); 1005 YOFS+cellypos[r]-2);
1006#endif 1006#endif
1007 if ((r>0) && state->possiblevals[state->y][state->x]&(1<<(r))) 1007 if ((r>0) && state->possiblevals[state->y][state->x]&BIT_N(r))
1008 rb->lcd_bitmap_part(sudoku_normal,NUMBER_TYPE,BITMAP_HEIGHT*r, 1008 rb->lcd_bitmap_part(sudoku_normal,NUMBER_TYPE,BITMAP_HEIGHT*r,
1009 BITMAP_STRIDE,XOFSSCRATCHPAD+1, 1009 BITMAP_STRIDE,XOFSSCRATCHPAD+1,
1010 YOFS+cellypos[r-1],CELL_WIDTH,CELL_HEIGHT); 1010 YOFS+cellypos[r-1],CELL_WIDTH,CELL_HEIGHT);
@@ -1015,7 +1015,7 @@ void display_board(struct sudoku_state_t* state)
1015 rb->lcd_hline(XOFSSCRATCHPAD,XOFSSCRATCHPAD+CELL_WIDTH+1, 1015 rb->lcd_hline(XOFSSCRATCHPAD,XOFSSCRATCHPAD+CELL_WIDTH+1,
1016 YOFS+cellypos[8]+CELL_HEIGHT+1); 1016 YOFS+cellypos[8]+CELL_HEIGHT+1);
1017#endif 1017#endif
1018 if (state->possiblevals[state->y][state->x]&(1<<(r))) 1018 if (state->possiblevals[state->y][state->x]&BIT_N(r))
1019 rb->lcd_bitmap_part(sudoku_normal,NUMBER_TYPE,BITMAP_HEIGHT*r, 1019 rb->lcd_bitmap_part(sudoku_normal,NUMBER_TYPE,BITMAP_HEIGHT*r,
1020 BITMAP_STRIDE,XOFSSCRATCHPAD+1,YOFS+cellypos[8], 1020 BITMAP_STRIDE,XOFSSCRATCHPAD+1,YOFS+cellypos[8],
1021 CELL_WIDTH,CELL_HEIGHT); 1021 CELL_WIDTH,CELL_HEIGHT);
@@ -1552,7 +1552,7 @@ enum plugin_status plugin_start(const void* parameter)
1552 /* Toggle current number in the possiblevals structure */ 1552 /* Toggle current number in the possiblevals structure */
1553 if (state.currentboard[state.y][state.x]!='0') { 1553 if (state.currentboard[state.y][state.x]!='0') {
1554 state.possiblevals[state.y][state.x]^= 1554 state.possiblevals[state.y][state.x]^=
1555 (1 << (state.currentboard[state.y][state.x] - '0')); 1555 BIT_N(state.currentboard[state.y][state.x] - '0');
1556 } 1556 }
1557 break; 1557 break;
1558#endif 1558#endif