Skip to content

Commit f97b1c2

Browse files
committed
fix: updates from Momentum
1 parent 322f7f2 commit f97b1c2

File tree

10 files changed

+96
-20
lines changed

10 files changed

+96
-20
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- develop
88

99
env:
10-
firmware_version: '0.86.1'
10+
firmware_version: '0.101.2'
1111

1212
jobs:
1313
build:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
77

88
env:
9-
firmware_version: '0.86.1'
9+
firmware_version: '0.101.2'
1010

1111
jobs:
1212
build:

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
![FLIPR](https://github.com/xtruan/flipper-chess/blob/main/icons/FLIPR_128x64.png)
88

99
## Chess game for Flipper Zero
10-
- Built against `0.86.1` Flipper Zero firmware release
10+
- Built against `0.101.2` Flipper Zero firmware release
1111
- Uses [smallchesslib](https://codeberg.org/drummyfish/smallchesslib)
12-
- Included in [RogueMaster Custom Firmware](https://github.com/RogueMaster/flipperzero-firmware-wPlugins)
1312

1413
### Installation
1514

flipchess.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ FlipChess* flipchess_app_alloc() {
7474
app->view_dispatcher, flipchess_tick_event_callback, 100);
7575
view_dispatcher_set_custom_event_callback(
7676
app->view_dispatcher, flipchess_custom_event_callback);
77-
app->submenu = submenu_alloc();
7877

7978
// Settings
8079
app->haptic = FlipChessHapticOn;
@@ -89,6 +88,7 @@ FlipChess* flipchess_app_alloc() {
8988
// Text input
9089
app->input_state = FlipChessTextInputDefault;
9190

91+
app->submenu = submenu_alloc();
9292
view_dispatcher_add_view(
9393
app->view_dispatcher, FlipChessViewIdMenu, submenu_get_view(app->submenu));
9494
app->flipchess_startscreen = flipchess_startscreen_alloc();
@@ -131,14 +131,17 @@ void flipchess_app_free(FlipChess* app) {
131131
// Scene manager
132132
scene_manager_free(app->scene_manager);
133133

134-
text_input_free(app->text_input);
135-
136134
// View Dispatcher
137135
view_dispatcher_remove_view(app->view_dispatcher, FlipChessViewIdMenu);
136+
submenu_free(app->submenu);
137+
view_dispatcher_remove_view(app->view_dispatcher, FlipChessViewIdStartscreen);
138+
flipchess_startscreen_free(app->flipchess_startscreen);
138139
view_dispatcher_remove_view(app->view_dispatcher, FlipChessViewIdScene1);
140+
flipchess_scene_1_free(app->flipchess_scene_1);
139141
view_dispatcher_remove_view(app->view_dispatcher, FlipChessViewIdSettings);
142+
variable_item_list_free(app->variable_item_list);
140143
view_dispatcher_remove_view(app->view_dispatcher, FlipChessViewIdTextInput);
141-
submenu_free(app->submenu);
144+
text_input_free(app->text_input);
142145

143146
view_dispatcher_free(app->view_dispatcher);
144147
furi_record_close(RECORD_GUI);

helpers/flipchess_file.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
bool flipchess_has_file(const FlipChessFile file_type, const char* file_name, const bool remove) {
1717
bool ret = false;
1818
const char* path;
19+
char path_buf[FILE_MAX_PATH_LEN] = {0};
1920
if(file_type == FlipChessFileBoard) {
2021
path = FLIPCHESS_BOARD_PATH;
2122
} else {
22-
char path_buf[FILE_MAX_PATH_LEN] = {0};
2323
strcpy(path_buf, FLIPCHESS_APP_BASE_FOLDER); // 22
2424
strcpy(path_buf + strlen(path_buf), "/");
2525
strcpy(path_buf + strlen(path_buf), file_name);
@@ -40,10 +40,10 @@ bool flipchess_has_file(const FlipChessFile file_type, const char* file_name, co
4040
bool flipchess_load_file(char* contents, const FlipChessFile file_type, const char* file_name) {
4141
bool ret = false;
4242
const char* path;
43+
char path_buf[FILE_MAX_PATH_LEN] = {0};
4344
if(file_type == FlipChessFileBoard) {
4445
path = FLIPCHESS_BOARD_PATH;
4546
} else {
46-
char path_buf[FILE_MAX_PATH_LEN] = {0};
4747
strcpy(path_buf, FLIPCHESS_APP_BASE_FOLDER); // 22
4848
strcpy(path_buf + strlen(path_buf), "/");
4949
strcpy(path_buf + strlen(path_buf), file_name);
@@ -99,11 +99,11 @@ bool flipchess_save_file(
9999
bool ret = false;
100100
const char* path;
101101
const char* path_bak;
102+
char path_buf[FILE_MAX_PATH_LEN] = {0};
102103
if(file_type == FlipChessFileBoard) {
103104
path = FLIPCHESS_BOARD_PATH;
104105
path_bak = FLIPCHESS_BOARD_PATH_BAK;
105106
} else {
106-
char path_buf[FILE_MAX_PATH_LEN] = {0};
107107
strcpy(path_buf, FLIPCHESS_APP_BASE_FOLDER); // 22
108108
strcpy(path_buf + strlen(path_buf), "/");
109109
strcpy(path_buf + strlen(path_buf), file_name);

helpers/flipchess_fonts.c

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#include "flipchess_fonts.h"
2+
3+
/*
4+
Fontname: -FreeType-LucasArts SCUMM Subtitle Roman Outline-Medium-R-Normal--32-320-72-72-P-107-ISO10646-1
5+
Copyright: Copyright Goatmeal 2013 LucasArts SCUMM - Subtitle - Roman
6+
Glyphs: 74/95
7+
BBX Build Mode: 0
8+
*/
9+
const uint8_t _u8g2_font_lucasarts_scumm_subtitle_o_tr[1941] U8G2_FONT_SECTION(
10+
"_u8g2_font_lucasarts_scumm_subtitle_o_tr") =
11+
"J\0\3\2\5\4\1\4\6\22\21\0\373\14\374\14\374\1\265\4\345\7x \5\0b\11!\21\246\237"
12+
"\231!\221F\307I\211\232\206\250\323\220\0\42\11\250>\212'\237\206\3'\11\244>\211A\62\15\2,"
13+
"\16\346\222\231A\311\222,\221N\312\20\1-\11in\212\207\34x\10.\11\204\36\211A\222\6\1/"
14+
"\26\253\337zd\7\224XJ\265P\363\37\63\65\222\23\35\330\21\0\60\42\255_\273aHm\322$E"
15+
"\212\224HY\64i\222\224F\66i\312\42%R\244H\232\64U\35\206\14\61\27\250\37\252!\223\42-"
16+
"\12\243)\214\302(\214\302(\214\242C<\34\62\34\253\337\252a\310TE:)\322 I\251$J\242"
17+
"$J\242$J\303\240C\303\3\63\35\253\337\252a\310TE:)\322 I\331\20i\241\70D\303\344"
18+
"\42\235\24U\33\206\10\64\36\253\337\352!\226R-\24\63\251dJ\244)\211\206h\207\206A\222\243\34"
19+
"\210r`H\0\65\35\253\337\212\357\220\64\234r \32\246\34P\206!\222\245A\213,\322IQ\265a"
20+
"\210\0\66\35\253\337\252a\310TE:)\222\64\334\1%\233&E\222\262\310\42\235\24U\33\206\10\67"
21+
"\35\253\337\212\357\320pJ%Q\22%\65\222\243\34\210r \312\201(\7\242\34\30B\0\70\33\253\337"
22+
"\252a\310TE:)\222E:)\252\42\235\24\311\42\235\24U\33\206\10\71\34\253\337\252a\310TE"
23+
":)\222\224E\26\351\226\350\300\223E:)\252\66\14\21\0:\14$#\211A\222\6q\220\244A;"
24+
"\17d\33\211A\222\6q\220\244E\31\24\0\77\36\253\337\252a\310TE:)\322 I\251$J\242"
25+
"\244Fr\224\3C\16D\71\60\204\0A%\257\337\353!\307\244\34\313tD\314\221H\221%)\216\206"
26+
"D\324\221\60\32\26I\12\243D\22\225\261\66\14\341 B\34\253\337\212\203\26KN\321T\232J\246X"
27+
"\212&%J\244$J\244w@\31N\0C\42\254\37\273\341\244&\211\264%\221\42M\231\42\211C\224"
28+
"#\221\16H\341\22)K\42MVq\30\42\0D#\254\37\213\267\34\220\244I\252H\235\224(\222\222"
29+
"(\213\222(\222\222\250\244D\211\224H\223\222\3\322p\3E\36\253\337\212\357\320!J\242A))C"
30+
"\22\25\323\60*F\312\220D\203\62\15\221\16\15\17F\36\253\337\212\357\320!J\242A))C\22\25"
31+
"\323\60*FJ\30\15\231\64\246\341\60\204\0G%\255_\273\341\246&\221\264E\221\42%R\246\224\304"
32+
"%\212\206AR\322)\231\224H\221\42i\313\304(\34.\0H\33\254\37\213\17\241\70\15\221\22\365\247"
33+
"!\252#Q\64D\375\213\64D\243\70<\4I\17\246\237\211C\70)Q\377/\322\70\14\1J\34\252"
34+
"\237\312a,Jj\24Gq\24G\321 %\222\224DS\222UTi\30\42\0K\34\254\37\213\17\241"
35+
"\70]\42[\24\211\241\32\252Q$F\266hR\244!\32\305\341!L\37\254\37\213CZ\225\346(G"
36+
"\242\34\211r$\312\221(G\242p\211\62e\32$\35\33\36\2M\42\257\337\213\333\60\204\212xT\302"
37+
"\61\352\177\322\244\222&\225\226\251\64\14Q\42i\322\230\205\303\220\15\3N#\255_\213\313\60\204I\270"
38+
"\15\221\22N-S\223TR\244\222\324\264D\245\61\221\206lL\302aH\206\1O\42\255_\273aH"
39+
"m\322$E\212\224HY\64i\222\224F\66i\312\42%R\244H\232\64U\35\206\14P\37\253\337\212"
40+
"\247\34P\244I\211\22)\211\22)\211&%\226\242A\213r \212%\65L\207\25Q'\355W\273a"
41+
"Hm\322$E\212\224HY\64i\222\224F\66i\312\42%\32\244HJ\42MU\247\35\320rd\220"
42+
"\0R\35\254\37\213\267\34\220\244I\252H-Ri\222b-\232\244\212\324\213\64D\243\70<\4S\36"
43+
"\253\337\252\341\242&\333$-\246!\31\264!{\310\6e\210\24e\222\266%U\206\23\0T\32\252\237"
44+
"\212\7\35\221J\212\244\14\322\220Eq\24Gq\24G\251$\26\207\11U\37\253\337\212\217\332\64$J"
45+
"T\211Z\242\226\250%j\211Z\242hH\242L\212Tm\30\42\0V\36\253\337\212\217\332\64$JT"
46+
"\211Z\242hH\42\213\26)a\244\204\232\232\305Y<h\0W(\260\37\214\37\304P\233\16\211\22%"
47+
"Q%\252D\225(:$\221\24*Z\24*a\24*\241f\315\264\70\323\342\341\220\1X\42\256\237\213"
48+
"\323\60\204Q\70\271HC\244IVQ\7$\35\20U\311&\15\221\42\231\306(\34\206h\30Y\36\254"
49+
"\37\213\17\241\70\15\221\22\15Q\344\26I\241U\322\201(G\242\34\220\344\60\36\66\0Z\27\253\337\212"
50+
"\357\220\64H\212mH\64\377e\310\24\323 \351\320\360\0_\12\213\336\212\357\220\16\15\17a\33+\337"
51+
"\232a\220d%\32\242d\30\242D\7\222h\210\222h\33\322(\31\16\1b\42\253\337\212A\316b)"
52+
"\7\242\34\210\6-\226\62I\211\206(\211Z\242!J\62I\211\62i\30$\0c\26*\237\252a\210"
53+
"\324!\232,\203\24G\312\60M\211*\15C\2d\37\253\337\332A\316b)\7\242l\220\42\71\221\264"
54+
"$\32\242$j\211\206(\221\64E+\15\7e\26*\237\252a\210\324!\232\244!\322\201i\70M\211"
55+
"*\15C\2f\31\251_\252a\22\225HJ\42\351\260F\322\26\245Q\32\205\222\26f\303\6g\35\253"
56+
"\323\352A\32\264D\35\244\223\42Y\244\313\42.\312\20M\212\244\35\322i\30\42\0h\37\254\37\213A"
57+
"\7\262\34\220r$\312\221h\20\243L\313$)\32\242\376E\32\242Q\34\36\2i\17\206\237\231!\352"
58+
"\64D\375\27i\34\206\0j\34\351S\332!\215\322(\35\322(\215\322(\215\322(\215\322h\30\42\333"
59+
"\252\14C\2k \254\37\213s\30K:\20\345H\64\14Q$F\321\62E\212\30eZ&)\322\20"
60+
"\215\342\360\20l\17\246\237\211A\311\22\251\377_\244q\30\2m\26.\237\213OY\224)Z\251d*"
61+
"\231J\246D\62\215Y\66|n\24+\337\212\247,S\64\251\64\265D-Q\42\35\265\341\1o\26+"
62+
"\337\252a\310TE:)\222\224E\26\351\244\250\332\60D\0p \253\317\212\247,S\64I\211\206("
63+
"\211Z\242!J\62I\211\62)\32\264(\226\324\60\35V\0q!\253\317\252a\220\264(\221\264$\32"
64+
"\242$j\211\206(\221\264H\213\262A\312\201(\226\324\60\35\6r\27+\337\212\207$\13\207PJ\262"
65+
")\211\224!\211bI\15\323a\5s\23)_\232\341\20&\322\244-\353\262I\223\22\16\207\4t\30"
66+
"\210\37\252Q\11\243LZ\322D\232\212Q\30\15I\244$\232\64(\0u\25,\37\213\7%\324\22i"
67+
"\210\372OCT\263\210Y\64\34\2v\25,\37\213\17\241\70\15\221\42\331\42)\264\206\261\244\3C\10"
68+
"w!\62\237\214/\303(&\331\64D\212\223\230$Z$.\241)QC)\211\245!\322\201!\32B"
69+
"\0x\31-_\213\313\60\204I\70D')R\65U\212\244\207\60\11\207!\31\6y\37\215S\213\313"
70+
"\60\204I\70)\312\42\15I(I\251\224\310Z\216D\332\60\205\221\321<\314\0z\24*\237\212\7\35"
71+
"\221.\223\62DC\42-\323\244#\303A\0\0\0\4\377\377\0";

helpers/flipchess_fonts.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#pragma once
2+
3+
#include <u8g2.h>
4+
5+
extern const uint8_t _u8g2_font_lucasarts_scumm_subtitle_o_tr[] U8G2_FONT_SECTION(
6+
"_u8g2_font_lucasarts_scumm_subtitle_o_tr");

icons/Background_128x11.png

-446 Bytes
Binary file not shown.

sam/stm32_sam.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4510,7 +4510,7 @@ void STM32SAM::AdjustLengths() {
45104510
mem56 = flags[index];
45114511

45124512
// not a consonant
4513-
if((flags[index] & 64) == 0) {
4513+
if((mem56 & 64) == 0) {
45144514
// RX or LX?
45154515
if((index == 18) || (index == 19)) // 'RX' & 'LX'
45164516
{
@@ -4519,7 +4519,7 @@ void STM32SAM::AdjustLengths() {
45194519
index = phonemeindex[X];
45204520

45214521
// next phoneme a consonant?
4522-
if((flags[index] & 64) != 0) {
4522+
if((mem56 & 64) != 0) {
45234523
// RULE: <VOWEL> RX | LX <CONSONANT>
45244524

45254525
// decrease length of vowel by 1 frame

views/flipchess_startscreen.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#include <input/input.h>
55
#include <gui/elements.h>
66
#include "flipchess_icons.h"
7+
#include "helpers/flipchess_fonts.h"
8+
9+
#include <assets_icons.h>
710

811
struct FlipChessStartscreen {
912
View* view;
@@ -32,15 +35,9 @@ void flipchess_startscreen_draw(Canvas* canvas, FlipChessStartscreenModel* model
3235

3336
canvas_draw_icon(canvas, 0, 0, &I_FLIPR_128x64);
3437

35-
#ifdef CANVAS_HAS_FONT_SCUMM_ROMAN_OUTLINE
3638
const uint8_t text_x_pos = 2;
3739
const uint8_t text_y_pos = 12;
38-
canvas_set_font(canvas, FontScummRomanOutline);
39-
#else
40-
const uint8_t text_x_pos = 4;
41-
const uint8_t text_y_pos = 11;
42-
canvas_set_font(canvas, FontPrimary);
43-
#endif
40+
canvas_set_custom_u8g2_font(canvas, _u8g2_font_lucasarts_scumm_subtitle_o_tr);
4441
canvas_draw_str(canvas, text_x_pos, text_y_pos, "Chess");
4542
canvas_set_font(canvas, FontSecondary);
4643
canvas_draw_str(canvas, 62, text_y_pos, FLIPCHESS_VERSION);

0 commit comments

Comments
 (0)