Skip to content

Commit f73dc83

Browse files
authored
Add files via upload
1 parent fa5be99 commit f73dc83

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

applications/chess/chess_app.c

+24-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
#include <furi.h>
2+
3+
4+
#include <m-string.h>
25
#include <furi_hal.h>
36
#include <furi_hal_delay.c>
47
#include <gui/gui.h>
58
#include <gui/gui_i.h>
69
#include <input/input.h>
710
#include <notification/notification_messages.h>
11+
#include "assets_icons.h"
812

13+
#include <gui/icon_i.h>
914
#include "fast_chess.h"
1015

1116
static bool flag = true;
@@ -66,8 +71,22 @@ const uint8_t* const _I_Chess_rb[] = {_I_Chess_rb_0};
6671
const uint8_t _I_Chess_rw_0[] = {0x00,0x2D,0x2D,0x12,0x12,0x12,0x3F,};
6772
const uint8_t* const _I_Chess_rw[] = {_I_Chess_rw_0};
6873

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;
7190

7291
const Icon I_Chess_Selection2 = {.width=8,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Chess_Selection2};
7392
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
233252
move2str(white_move_str, game, game->moveListLen - 1);
234253
notify_click();
235254
black_move_str[0] = 0;
236-
anim = millis();
255+
anim = furi_hal_get_tick();
237256
thinking = true;
238257
}
239258

@@ -247,7 +266,7 @@ static int32_t make_ai_move(void* context) {
247266
move2str(black_move_str, game, game->moveListLen - 1);
248267
notify_click();
249268
thinking = false;
250-
anim = millis();
269+
anim = furi_hal_get_tick();
251270
return 0;
252271
}
253272

@@ -335,7 +354,7 @@ static void chess_draw_callback(Canvas* canvas, void* ctx) {
335354
int x = col * 8;
336355
int y = row * 8;
337356

338-
int dt = millis() - anim;
357+
int dt = furi_hal_get_tick() - anim;
339358
if (anim && dt >= 300) {
340359
anim = 0;
341360
}

applications/chess/fast_chess.c

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include "fast_chess.h"
1919

20-
2120
char FILES[8] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'};
2221
char RANKS[8] = {'1', '2', '3', '4', '5', '6', '7', '8'};
2322

0 commit comments

Comments
 (0)