1
1
#include <furi.h>
2
+
3
+
4
+ #include <m-string.h>
2
5
#include <furi_hal.h>
3
6
#include <furi_hal_delay.c>
4
7
#include <gui/gui.h>
5
8
#include <gui/gui_i.h>
6
9
#include <input/input.h>
7
10
#include <notification/notification_messages.h>
11
+ #include "assets_icons.h"
8
12
13
+ #include <gui/icon_i.h>
9
14
#include "fast_chess.h"
10
15
11
16
static bool flag = true;
@@ -66,8 +71,22 @@ const uint8_t* const _I_Chess_rb[] = {_I_Chess_rb_0};
66
71
const uint8_t _I_Chess_rw_0 [] = {0x00 ,0x2D ,0x2D ,0x12 ,0x12 ,0x12 ,0x3F ,};
67
72
const uint8_t * const _I_Chess_rw [] = {_I_Chess_rw_0 };
68
73
69
- const uint8_t _I_ButtonCenter_7x7_0 [] = {0x00 ,0x1C ,0x22 ,0x5D ,0x5D ,0x5D ,0x22 ,0x1C ,};
70
- const uint8_t * const _I_ButtonCenter_7x7 [] = {_I_ButtonCenter_7x7_0 };
74
+ extern const Icon I_Chess_Selection2 ;
75
+ extern const Icon I_Chess_old ;
76
+ extern const Icon I_Chess_Selection1 ;
77
+ extern const Icon I_Chess ;
78
+ extern const Icon I_Chess_kb ;
79
+ extern const Icon I_Chess_rw ;
80
+ extern const Icon I_Chess_rb ;
81
+ extern const Icon I_Chess_kw ;
82
+ extern const Icon I_Chess_qb ;
83
+ extern const Icon I_Chess_qw ;
84
+ extern const Icon I_Chess_pw ;
85
+ extern const Icon I_Chess_pb ;
86
+ extern const Icon I_Chess_nb ;
87
+ extern const Icon I_Chess_bw ;
88
+ extern const Icon I_Chess_bb ;
89
+ extern const Icon I_Chess_nw ;
71
90
72
91
const Icon I_Chess_Selection2 = {.width = 8 ,.height = 8 ,.frame_count = 1 ,.frame_rate = 0 ,.frames = _I_Chess_Selection2 };
73
92
const Icon I_Chess_old = {.width = 128 ,.height = 64 ,.frame_count = 1 ,.frame_rate = 0 ,.frames = _I_Chess_old };
@@ -233,7 +252,7 @@ static void make_move(uint8_t file1, uint8_t rank1, uint8_t file2, uint8_t rank2
233
252
move2str (white_move_str , game , game -> moveListLen - 1 );
234
253
notify_click ();
235
254
black_move_str [0 ] = 0 ;
236
- anim = millis ();
255
+ anim = furi_hal_get_tick ();
237
256
thinking = true;
238
257
}
239
258
@@ -247,7 +266,7 @@ static int32_t make_ai_move(void* context) {
247
266
move2str (black_move_str , game , game -> moveListLen - 1 );
248
267
notify_click ();
249
268
thinking = false;
250
- anim = millis ();
269
+ anim = furi_hal_get_tick ();
251
270
return 0 ;
252
271
}
253
272
@@ -335,7 +354,7 @@ static void chess_draw_callback(Canvas* canvas, void* ctx) {
335
354
int x = col * 8 ;
336
355
int y = row * 8 ;
337
356
338
- int dt = millis () - anim ;
357
+ int dt = furi_hal_get_tick () - anim ;
339
358
if (anim && dt >= 300 ) {
340
359
anim = 0 ;
341
360
}
0 commit comments