Esteban Fuentealba 2 лет назад
Родитель
Сommit
0abb846ac3

+ 191 - 0
.clang-format

@@ -0,0 +1,191 @@
+---
+Language:        Cpp
+AccessModifierOffset: -4
+AlignAfterOpenBracket: AlwaysBreak
+AlignArrayOfStructures: None
+AlignConsecutiveMacros: None
+AlignConsecutiveAssignments: None
+AlignConsecutiveBitFields: None
+AlignConsecutiveDeclarations: None
+AlignEscapedNewlines: Left
+AlignOperands:   Align
+AlignTrailingComments: false
+AllowAllArgumentsOnNextLine: true
+AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortEnumsOnASingleLine: true
+AllowShortBlocksOnASingleLine: Never
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortLambdasOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: WithoutElse
+AllowShortLoopsOnASingleLine: true
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: Yes
+AttributeMacros:
+  - __capability
+BinPackArguments: false
+BinPackParameters: false
+BraceWrapping:
+  AfterCaseLabel:  false
+  AfterClass:      false
+  AfterControlStatement: Never
+  AfterEnum:       false
+  AfterFunction:   false
+  AfterNamespace:  false
+  AfterObjCDeclaration: false
+  AfterStruct:     false
+  AfterUnion:      false
+  AfterExternBlock: false
+  BeforeCatch:     false
+  BeforeElse:      false
+  BeforeLambdaBody: false
+  BeforeWhile:     false
+  IndentBraces:    false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeConceptDeclarations: true
+BreakBeforeBraces: Attach
+BreakBeforeInheritanceComma: false
+BreakInheritanceList: BeforeColon
+BreakBeforeTernaryOperators: false
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeComma
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: false
+ColumnLimit:     99
+CommentPragmas:  '^ IWYU pragma:'
+QualifierAlignment: Leave
+CompactNamespaces: false
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DeriveLineEnding: true
+DerivePointerAlignment: false
+DisableFormat:   false
+EmptyLineAfterAccessModifier: Never
+EmptyLineBeforeAccessModifier: LogicalBlock
+ExperimentalAutoDetectBinPacking: false
+PackConstructorInitializers: BinPack
+BasedOnStyle:    ''
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+AllowAllConstructorInitializersOnNextLine: true
+FixNamespaceComments: false
+ForEachMacros:
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
+IfMacros:
+  - KJ_IF_MAYBE
+IncludeBlocks:   Preserve
+IncludeCategories:
+  - Regex:           '.*'
+    Priority:        1
+    SortPriority:    0
+    CaseSensitive:   false
+  - Regex:           '^(<|"(gtest|gmock|isl|json)/)'
+    Priority:        3
+    SortPriority:    0
+    CaseSensitive:   false
+  - Regex:           '.*'
+    Priority:        1
+    SortPriority:    0
+    CaseSensitive:   false
+IncludeIsMainRegex: '(Test)?$'
+IncludeIsMainSourceRegex: ''
+IndentAccessModifiers: false
+IndentCaseLabels: false
+IndentCaseBlocks: false
+IndentGotoLabels: true
+IndentPPDirectives: None
+IndentExternBlock: AfterExternBlock
+IndentRequires:  false
+IndentWidth:     4
+IndentWrappedFunctionNames: true
+InsertTrailingCommas: None
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: Signature
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBinPackProtocolList: Auto
+ObjCBlockIndentWidth: 4
+ObjCBreakBeforeNestedBlockParam: true
+ObjCSpaceAfterProperty: true
+ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 10
+PenaltyBreakBeforeFirstCallParameter: 30
+PenaltyBreakComment: 10
+PenaltyBreakFirstLessLess: 0
+PenaltyBreakOpenParenthesis: 0
+PenaltyBreakString: 10
+PenaltyBreakTemplateDeclaration: 10
+PenaltyExcessCharacter: 100
+PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyIndentedWhitespace: 0
+PointerAlignment: Left
+PPIndentWidth:   -1
+ReferenceAlignment: Pointer
+ReflowComments:  false
+RemoveBracesLLVM: false
+SeparateDefinitionBlocks: Leave
+ShortNamespaceLines: 1
+SortIncludes:    Never
+SortJavaStaticImport: Before
+SortUsingDeclarations: false
+SpaceAfterCStyleCast: false
+SpaceAfterLogicalNot: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeCaseColon: false
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
+SpaceBeforeParens: Never
+SpaceBeforeParensOptions:
+  AfterControlStatements: false
+  AfterForeachMacros: false
+  AfterFunctionDefinitionName: false
+  AfterFunctionDeclarationName: false
+  AfterIfMacros:   false
+  AfterOverloadedOperator: false
+  BeforeNonEmptyParentheses: false
+SpaceAroundPointerQualifiers: Default
+SpaceBeforeRangeBasedForLoopColon: true
+SpaceInEmptyBlock: false
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles:  Never
+SpacesInConditionalStatement: false
+SpacesInContainerLiterals: false
+SpacesInCStyleCastParentheses: false
+SpacesInLineCommentPrefix:
+  Minimum:         1
+  Maximum:         -1
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+SpaceBeforeSquareBrackets: false
+BitFieldColonSpacing: Both
+Standard:        c++03
+StatementAttributeLikeMacros:
+  - Q_EMIT
+StatementMacros:
+  - Q_UNUSED
+  - QT_REQUIRE_VERSION
+TabWidth:        4
+UseCRLF:         false
+UseTab:          Never
+WhitespaceSensitiveMacros:
+  - STRINGIZE
+  - PP_STRINGIZE
+  - BOOST_PP_STRINGIZE
+  - NS_SWIFT_NAME
+  - CF_SWIFT_NAME
+...
+

+ 2 - 2
README.md

@@ -1,4 +1,4 @@
-# [MALVEKE] ***GAME BOY*** PHOTO
+# ***GAME BOY*** PHOTO MALVEKE
 
 
 <div align="center">
 <div align="center">
 
 
@@ -38,7 +38,7 @@ These instructions assume that you are starting at the Flipper Zero desktop. Oth
         <br />
         <br />
     </p>
     </p>
 
 
-- For the next step, you'll need a `.SAV` file extracted from the GAME BOY Camera's RAM. If you don't have one, you can use the [**[MALVEKE] GAME BOY Cartridge (GB/GBC)**](/flipper_companion_apps/applications/external/malveke_gb_cartridge/README.md#instructions-for-use) app to save the RAM.
+- For the next step, you'll need a `.SAV` file extracted from the GAME BOY Camera's RAM. If you don't have one, you can use the [**GAME BOY Cartridge (GB/GBC) MALVEKE**](/flipper_companion_apps/applications/external/malveke_gb_cartridge/README.md#instructions-for-use) app to save the RAM.
 
 
     <p align='center'>
     <p align='center'>
         <br />
         <br />

+ 1 - 1
application.fam

@@ -1,6 +1,6 @@
 App(
 App(
     appid="malveke_gb_photo",
     appid="malveke_gb_photo",
-    name="[GB] GAME BOY PHOTO",
+    name="GAME BOY PHOTO MALVEKE",
     apptype=FlipperAppType.EXTERNAL,
     apptype=FlipperAppType.EXTERNAL,
     entry_point="boilerplate_app",
     entry_point="boilerplate_app",
     cdefines=["APP_GB_PHOTO"],
     cdefines=["APP_GB_PHOTO"],

+ 10 - 19
helpers/bmp.c

@@ -1,11 +1,10 @@
 #include "bmp.h"
 #include "bmp.h"
-void bmp_init(void *buf, long width, long height)
-{
+void bmp_init(void* buf, long width, long height) {
     long pad;
     long pad;
     unsigned long size;
     unsigned long size;
     unsigned long uw = width;
     unsigned long uw = width;
     unsigned long uh = -height;
     unsigned long uh = -height;
-    unsigned char *p = (unsigned char *)buf;
+    unsigned char* p = (unsigned char*)buf;
 
 
 #ifdef BMP_COMPAT
 #ifdef BMP_COMPAT
     uh = height;
     uh = height;
@@ -97,22 +96,15 @@ void bmp_init(void *buf, long width, long height)
     *p++ = 0x00;
     *p++ = 0x00;
     *p = 0x00;
     *p = 0x00;
 }
 }
-void bmp_set(void *buf, long x, long y, unsigned long color)
-{
-    unsigned char *p;
-    unsigned char *hdr = (unsigned char *)buf;
-    unsigned long width =
-        (unsigned long)hdr[18] << 0 |
-        (unsigned long)hdr[19] << 8 |
-        (unsigned long)hdr[20] << 16 |
-        (unsigned long)hdr[21] << 24;
+void bmp_set(void* buf, long x, long y, unsigned long color) {
+    unsigned char* p;
+    unsigned char* hdr = (unsigned char*)buf;
+    unsigned long width = (unsigned long)hdr[18] << 0 | (unsigned long)hdr[19] << 8 |
+                          (unsigned long)hdr[20] << 16 | (unsigned long)hdr[21] << 24;
     long pad = (width * -3UL) & 3;
     long pad = (width * -3UL) & 3;
 #ifdef BMP_COMPAT
 #ifdef BMP_COMPAT
-    unsigned long height =
-        (unsigned long)hdr[22] << 0 |
-        (unsigned long)hdr[23] << 8 |
-        (unsigned long)hdr[24] << 16 |
-        (unsigned long)hdr[25] << 24;
+    unsigned long height = (unsigned long)hdr[22] << 0 | (unsigned long)hdr[23] << 8 |
+                           (unsigned long)hdr[24] << 16 | (unsigned long)hdr[25] << 24;
     y = height - y - 1;
     y = height - y - 1;
 #endif
 #endif
     p = hdr + 14 + 40 + y * (width * 3 + pad) + x * 3;
     p = hdr + 14 + 40 + y * (width * 3 + pad) + x * 3;
@@ -120,8 +112,7 @@ void bmp_set(void *buf, long x, long y, unsigned long color)
     p[1] = color >> 8;
     p[1] = color >> 8;
     p[2] = color >> 16;
     p[2] = color >> 16;
 }
 }
-unsigned long bmp_encode(unsigned long color_hex)
-{
+unsigned long bmp_encode(unsigned long color_hex) {
     unsigned char r = (color_hex >> 16) & 0xFF;
     unsigned char r = (color_hex >> 16) & 0xFF;
     unsigned char g = (color_hex >> 8) & 0xFF;
     unsigned char g = (color_hex >> 8) & 0xFF;
     unsigned char b = color_hex & 0xFF;
     unsigned char b = color_hex & 0xFF;

+ 3 - 4
helpers/bmp.h

@@ -3,11 +3,10 @@
 #ifndef BMP_H
 #ifndef BMP_H
 #define BMP_H
 #define BMP_H
 
 
-    
-#define BMP_SIZE(w, h) ((h) * ((w) * 3 + (((w) * -3UL) & 3)) + 14 + 40)
+#define BMP_SIZE(w, h) ((h) * ((w)*3 + (((w) * -3UL) & 3)) + 14 + 40)
 
 
-void bmp_init(void *buf, long width, long height);
-void bmp_set(void *buf, long x, long y, unsigned long color);
+void bmp_init(void* buf, long width, long height);
+void bmp_set(void* buf, long x, long y, unsigned long color);
 unsigned long bmp_encode(unsigned long color_hex);
 unsigned long bmp_encode(unsigned long color_hex);
 
 
 #endif /* BMP_H */
 #endif /* BMP_H */

+ 2 - 1
helpers/boilerplate_custom_event.h

@@ -41,7 +41,8 @@ static inline uint32_t boilerplate_custom_menu_event_pack(uint16_t type, int16_t
     BoilerplateCustomEventMenu event = {.content = {.type = type, .value = value}};
     BoilerplateCustomEventMenu event = {.content = {.type = type, .value = value}};
     return event.packed_value;
     return event.packed_value;
 }
 }
-static inline void boilerplate_custom_menu_event_unpack(uint32_t packed_value, uint16_t* type, int16_t* value) {
+static inline void
+    boilerplate_custom_menu_event_unpack(uint32_t packed_value, uint16_t* type, int16_t* value) {
     BoilerplateCustomEventMenu event = {.packed_value = packed_value};
     BoilerplateCustomEventMenu event = {.packed_value = packed_value};
     if(type) *type = event.content.type;
     if(type) *type = event.content.type;
     if(value) *value = event.content.value;
     if(value) *value = event.content.value;

+ 1 - 2
helpers/malveke_photo.c

@@ -1,7 +1,6 @@
 #include "malveke_photo.h"
 #include "malveke_photo.h"
 
 
-void get_timefilename(FuriString *name, int index)
-{
+void get_timefilename(FuriString* name, int index) {
     FuriHalRtcDateTime datetime = {0};
     FuriHalRtcDateTime datetime = {0};
     furi_hal_rtc_get_datetime(&datetime);
     furi_hal_rtc_get_datetime(&datetime);
     furi_string_printf(
     furi_string_printf(

+ 1 - 1
helpers/malveke_photo.h

@@ -5,6 +5,6 @@
 
 
 #include "../malveke_gb_photo.h"
 #include "../malveke_gb_photo.h"
 
 
-void get_timefilename(FuriString *name, int index);
+void get_timefilename(FuriString* name, int index);
 
 
 #endif /* MALVEKE_PHOTO_H */
 #endif /* MALVEKE_PHOTO_H */

+ 31 - 26
malveke_gb_photo.c

@@ -25,30 +25,30 @@ Boilerplate* boilerplate_app_alloc() {
     app->gui = furi_record_open(RECORD_GUI);
     app->gui = furi_record_open(RECORD_GUI);
     app->notification = furi_record_open(RECORD_NOTIFICATION);
     app->notification = furi_record_open(RECORD_NOTIFICATION);
     app->storage = furi_record_open(RECORD_STORAGE);
     app->storage = furi_record_open(RECORD_STORAGE);
-    
+
     //Turn backlight on, believe me this makes testing your app easier
     //Turn backlight on, believe me this makes testing your app easier
     notification_message(app->notification, &sequence_display_backlight_on);
     notification_message(app->notification, &sequence_display_backlight_on);
 
 
-
     //Scene additions
     //Scene additions
     app->view_dispatcher = view_dispatcher_alloc();
     app->view_dispatcher = view_dispatcher_alloc();
     view_dispatcher_enable_queue(app->view_dispatcher);
     view_dispatcher_enable_queue(app->view_dispatcher);
 
 
     app->scene_manager = scene_manager_alloc(&boilerplate_scene_handlers, app);
     app->scene_manager = scene_manager_alloc(&boilerplate_scene_handlers, app);
     view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
     view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
-    view_dispatcher_set_navigation_event_callback(app->view_dispatcher, boilerplate_navigation_event_callback);
-    view_dispatcher_set_tick_event_callback(app->view_dispatcher, boilerplate_tick_event_callback, 100);
-    view_dispatcher_set_custom_event_callback(app->view_dispatcher, boilerplate_custom_event_callback);
+    view_dispatcher_set_navigation_event_callback(
+        app->view_dispatcher, boilerplate_navigation_event_callback);
+    view_dispatcher_set_tick_event_callback(
+        app->view_dispatcher, boilerplate_tick_event_callback, 100);
+    view_dispatcher_set_custom_event_callback(
+        app->view_dispatcher, boilerplate_custom_event_callback);
     app->submenu = submenu_alloc();
     app->submenu = submenu_alloc();
 
 
-
     app->palette = BoilerplatePaletteBlackAndWhite;
     app->palette = BoilerplatePaletteBlackAndWhite;
     app->info = BoilerplateInfoOn;
     app->info = BoilerplateInfoOn;
     app->palette_color_hex_a = 0xFFFFFF;
     app->palette_color_hex_a = 0xFFFFFF;
     app->palette_color_hex_b = 0xAAAAAA;
     app->palette_color_hex_b = 0xAAAAAA;
     app->palette_color_hex_c = 0x555555;
     app->palette_color_hex_c = 0x555555;
     app->palette_color_hex_d = 0x000000;
     app->palette_color_hex_d = 0x000000;
-    
 
 
     app->file_path = furi_string_alloc();
     app->file_path = furi_string_alloc();
     app->camera_ram_sav = storage_file_alloc(app->storage);
     app->camera_ram_sav = storage_file_alloc(app->storage);
@@ -57,23 +57,33 @@ Boilerplate* boilerplate_app_alloc() {
     app->pos_y = 0;
     app->pos_y = 0;
     app->show_instructions = true;
     app->show_instructions = true;
 
 
-   
-
     // Used for File Browser
     // Used for File Browser
     app->dialogs = furi_record_open(RECORD_DIALOGS);
     app->dialogs = furi_record_open(RECORD_DIALOGS);
     app->file_path = furi_string_alloc();
     app->file_path = furi_string_alloc();
 
 
-
-    view_dispatcher_add_view(app->view_dispatcher, BoilerplateViewIdMenu, submenu_get_view(app->submenu));
+    view_dispatcher_add_view(
+        app->view_dispatcher, BoilerplateViewIdMenu, submenu_get_view(app->submenu));
     app->boilerplate_startscreen = boilerplate_startscreen_alloc();
     app->boilerplate_startscreen = boilerplate_startscreen_alloc();
-    view_dispatcher_add_view(app->view_dispatcher, BoilerplateViewIdStartscreen, boilerplate_startscreen_get_view(app->boilerplate_startscreen));
+    view_dispatcher_add_view(
+        app->view_dispatcher,
+        BoilerplateViewIdStartscreen,
+        boilerplate_startscreen_get_view(app->boilerplate_startscreen));
     app->boilerplate_scene_1 = boilerplate_scene_1_alloc();
     app->boilerplate_scene_1 = boilerplate_scene_1_alloc();
-    view_dispatcher_add_view(app->view_dispatcher, BoilerplateViewIdScene1, boilerplate_scene_1_get_view(app->boilerplate_scene_1));
+    view_dispatcher_add_view(
+        app->view_dispatcher,
+        BoilerplateViewIdScene1,
+        boilerplate_scene_1_get_view(app->boilerplate_scene_1));
     app->boilerplate_scene_2 = boilerplate_scene_2_alloc();
     app->boilerplate_scene_2 = boilerplate_scene_2_alloc();
-    view_dispatcher_add_view(app->view_dispatcher, BoilerplateViewIdScene2, boilerplate_scene_2_get_view(app->boilerplate_scene_2));
-    
+    view_dispatcher_add_view(
+        app->view_dispatcher,
+        BoilerplateViewIdScene2,
+        boilerplate_scene_2_get_view(app->boilerplate_scene_2));
+
     app->variable_item_list = variable_item_list_alloc();
     app->variable_item_list = variable_item_list_alloc();
-    view_dispatcher_add_view(app->view_dispatcher, BoilerplateViewIdSettings, variable_item_list_get_view(app->variable_item_list));
+    view_dispatcher_add_view(
+        app->view_dispatcher,
+        BoilerplateViewIdSettings,
+        variable_item_list_get_view(app->variable_item_list));
 
 
     //End Scene Additions
     //End Scene Additions
 
 
@@ -82,7 +92,7 @@ Boilerplate* boilerplate_app_alloc() {
 
 
 void boilerplate_app_free(Boilerplate* app) {
 void boilerplate_app_free(Boilerplate* app) {
     furi_assert(app);
     furi_assert(app);
-    
+
     // Scene manager
     // Scene manager
     scene_manager_free(app->scene_manager);
     scene_manager_free(app->scene_manager);
 
 
@@ -100,12 +110,9 @@ void boilerplate_app_free(Boilerplate* app) {
         storage_file_free(app->camera_ram_sav);
         storage_file_free(app->camera_ram_sav);
     }
     }
 
 
-
     furi_record_close(RECORD_GUI);
     furi_record_close(RECORD_GUI);
     furi_record_close(RECORD_STORAGE);
     furi_record_close(RECORD_STORAGE);
 
 
-
-    
     app->gui = NULL;
     app->gui = NULL;
     app->notification = NULL;
     app->notification = NULL;
     app->storage = NULL;
     app->storage = NULL;
@@ -121,10 +128,11 @@ void boilerplate_app_free(Boilerplate* app) {
 int32_t boilerplate_app(void* p) {
 int32_t boilerplate_app(void* p) {
     UNUSED(p);
     UNUSED(p);
     Boilerplate* app = boilerplate_app_alloc();
     Boilerplate* app = boilerplate_app_alloc();
-    
+
     view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
     view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
-    
-    scene_manager_next_scene(app->scene_manager, BoilerplateSceneStartscreen); //Start with start screen
+
+    scene_manager_next_scene(
+        app->scene_manager, BoilerplateSceneStartscreen); //Start with start screen
 
 
     furi_hal_power_suppress_charge_enter();
     furi_hal_power_suppress_charge_enter();
 
 
@@ -135,6 +143,3 @@ int32_t boilerplate_app(void* p) {
 
 
     return 0;
     return 0;
 }
 }
-
-
-

+ 0 - 5
malveke_gb_photo.h

@@ -19,10 +19,8 @@
 #include "views/boilerplate_scene_1.h"
 #include "views/boilerplate_scene_1.h"
 #include "views/boilerplate_scene_2.h"
 #include "views/boilerplate_scene_2.h"
 
 
-
 #include <string.h>
 #include <string.h>
 
 
-
 #define TAG "GBPHOTO"
 #define TAG "GBPHOTO"
 
 
 #define MALVEKE_APP_RAM_EXTENSION ".sav"
 #define MALVEKE_APP_RAM_EXTENSION ".sav"
@@ -32,8 +30,6 @@
 #define MALVEKE_APP_FOLDER_RAMS MALVEKE_APP_FOLDER "/rams"
 #define MALVEKE_APP_FOLDER_RAMS MALVEKE_APP_FOLDER "/rams"
 #define MALVEKE_APP_FOLDER_PHOTOS MALVEKE_APP_FOLDER "/photos"
 #define MALVEKE_APP_FOLDER_PHOTOS MALVEKE_APP_FOLDER "/photos"
 
 
-
-
 typedef struct {
 typedef struct {
     Gui* gui;
     Gui* gui;
     NotificationApp* notification;
     NotificationApp* notification;
@@ -57,7 +53,6 @@ typedef struct {
     uint8_t tile_data[16];
     uint8_t tile_data[16];
     uint8_t scratchpad1[0x11FC]; // 0000 - 11fb
     uint8_t scratchpad1[0x11FC]; // 0000 - 11fb
 
 
-
     unsigned long palette_color_hex_a;
     unsigned long palette_color_hex_a;
     unsigned long palette_color_hex_b;
     unsigned long palette_color_hex_b;
     unsigned long palette_color_hex_c;
     unsigned long palette_color_hex_c;

+ 30 - 14
scenes/boilerplate_scene_menu.c

@@ -17,13 +17,29 @@ void boilerplate_scene_menu_submenu_callback(void* context, uint32_t index) {
 void boilerplate_scene_menu_on_enter(void* context) {
 void boilerplate_scene_menu_on_enter(void* context) {
     Boilerplate* app = context;
     Boilerplate* app = context;
 
 
-    submenu_add_item(app->submenu, "Photo Viewer", SubmenuIndexScene1, boilerplate_scene_menu_submenu_callback, app);
-    submenu_add_item(app->submenu, "Export All", SubmenuIndexScene2, boilerplate_scene_menu_submenu_callback, app);
+    submenu_add_item(
+        app->submenu,
+        "Photo Viewer",
+        SubmenuIndexScene1,
+        boilerplate_scene_menu_submenu_callback,
+        app);
+    submenu_add_item(
+        app->submenu,
+        "Export All",
+        SubmenuIndexScene2,
+        boilerplate_scene_menu_submenu_callback,
+        app);
     // submenu_add_item(app->submenu, "Scene 3 (Buttonmenu)", SubmenuIndexScene3, boilerplate_scene_menu_submenu_callback, app);
     // submenu_add_item(app->submenu, "Scene 3 (Buttonmenu)", SubmenuIndexScene3, boilerplate_scene_menu_submenu_callback, app);
     // submenu_add_item(app->submenu, "Scene 4 (File Browser)", SubmenuIndexScene4, boilerplate_scene_menu_submenu_callback, app);
     // submenu_add_item(app->submenu, "Scene 4 (File Browser)", SubmenuIndexScene4, boilerplate_scene_menu_submenu_callback, app);
-    submenu_add_item(app->submenu, "Settings", SubmenuIndexSettings, boilerplate_scene_menu_submenu_callback, app);
+    submenu_add_item(
+        app->submenu,
+        "Settings",
+        SubmenuIndexSettings,
+        boilerplate_scene_menu_submenu_callback,
+        app);
 
 
-    submenu_set_selected_item(app->submenu, scene_manager_get_scene_state(app->scene_manager, BoilerplateSceneMenu));
+    submenu_set_selected_item(
+        app->submenu, scene_manager_get_scene_state(app->scene_manager, BoilerplateSceneMenu));
 
 
     view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdMenu);
     view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdMenu);
 }
 }
@@ -42,20 +58,20 @@ bool boilerplate_scene_menu_on_event(void* context, SceneManagerEvent event) {
                 app->scene_manager, BoilerplateSceneMenu, SubmenuIndexScene1);
                 app->scene_manager, BoilerplateSceneMenu, SubmenuIndexScene1);
             scene_manager_next_scene(app->scene_manager, BoilerplateSceneScene_1);
             scene_manager_next_scene(app->scene_manager, BoilerplateSceneScene_1);
             return true;
             return true;
-        } else if (event.event == SubmenuIndexScene2) {
+        } else if(event.event == SubmenuIndexScene2) {
             scene_manager_set_scene_state(
             scene_manager_set_scene_state(
                 app->scene_manager, BoilerplateSceneMenu, SubmenuIndexScene2);
                 app->scene_manager, BoilerplateSceneMenu, SubmenuIndexScene2);
             scene_manager_next_scene(app->scene_manager, BoilerplateSceneScene_2);
             scene_manager_next_scene(app->scene_manager, BoilerplateSceneScene_2);
             return true;
             return true;
-        // } else if (event.event == SubmenuIndexScene3) {
-        //     scene_manager_set_scene_state(
-        //         app->scene_manager, BoilerplateSceneMenu, SubmenuIndexScene3);
-        //     scene_manager_next_scene(app->scene_manager, BoilerplateSceneScene_3);
-        // } else if (event.event == SubmenuIndexScene4) {
-        //     scene_manager_set_scene_state(
-        //         app->scene_manager, BoilerplateSceneMenu, SubmenuIndexScene4);
-        //     scene_manager_next_scene(app->scene_manager, BoilerplateSceneScene_4);
-        } else if (event.event == SubmenuIndexSettings) {
+            // } else if (event.event == SubmenuIndexScene3) {
+            //     scene_manager_set_scene_state(
+            //         app->scene_manager, BoilerplateSceneMenu, SubmenuIndexScene3);
+            //     scene_manager_next_scene(app->scene_manager, BoilerplateSceneScene_3);
+            // } else if (event.event == SubmenuIndexScene4) {
+            //     scene_manager_set_scene_state(
+            //         app->scene_manager, BoilerplateSceneMenu, SubmenuIndexScene4);
+            //     scene_manager_next_scene(app->scene_manager, BoilerplateSceneScene_4);
+        } else if(event.event == SubmenuIndexSettings) {
             scene_manager_set_scene_state(
             scene_manager_set_scene_state(
                 app->scene_manager, BoilerplateSceneMenu, SubmenuIndexSettings);
                 app->scene_manager, BoilerplateSceneMenu, SubmenuIndexSettings);
             scene_manager_next_scene(app->scene_manager, BoilerplateSceneSettings);
             scene_manager_next_scene(app->scene_manager, BoilerplateSceneSettings);

+ 19 - 19
scenes/boilerplate_scene_scene_1.c

@@ -18,29 +18,29 @@ void boilerplate_scene_scene_1_on_enter(void* context) {
 bool boilerplate_scene_scene_1_on_event(void* context, SceneManagerEvent event) {
 bool boilerplate_scene_scene_1_on_event(void* context, SceneManagerEvent event) {
     Boilerplate* app = context;
     Boilerplate* app = context;
     bool consumed = false;
     bool consumed = false;
-    
+
     if(event.type == SceneManagerEventTypeCustom) {
     if(event.type == SceneManagerEventTypeCustom) {
         switch(event.event) {
         switch(event.event) {
-            case BoilerplateCustomEventScene1Left:
-            case BoilerplateCustomEventScene1Right:
-                break;
-            case BoilerplateCustomEventScene1Up:
-            case BoilerplateCustomEventScene1Down:
-                break;
-            case BoilerplateCustomEventScene1Back:
-                notification_message(app->notification, &sequence_reset_red);
-                notification_message(app->notification, &sequence_reset_green);
-                notification_message(app->notification, &sequence_reset_blue);
-                if(!scene_manager_search_and_switch_to_previous_scene(
-                    app->scene_manager, BoilerplateSceneMenu)) {
-                        scene_manager_stop(app->scene_manager);
-                        view_dispatcher_stop(app->view_dispatcher);
-                    }
-                consumed = true;
-                break;
+        case BoilerplateCustomEventScene1Left:
+        case BoilerplateCustomEventScene1Right:
+            break;
+        case BoilerplateCustomEventScene1Up:
+        case BoilerplateCustomEventScene1Down:
+            break;
+        case BoilerplateCustomEventScene1Back:
+            notification_message(app->notification, &sequence_reset_red);
+            notification_message(app->notification, &sequence_reset_green);
+            notification_message(app->notification, &sequence_reset_blue);
+            if(!scene_manager_search_and_switch_to_previous_scene(
+                   app->scene_manager, BoilerplateSceneMenu)) {
+                scene_manager_stop(app->scene_manager);
+                view_dispatcher_stop(app->view_dispatcher);
+            }
+            consumed = true;
+            break;
         }
         }
     }
     }
-    
+
     return consumed;
     return consumed;
 }
 }
 
 

+ 17 - 18
scenes/boilerplate_scene_scene_2.c

@@ -21,23 +21,23 @@ bool boilerplate_scene_scene_2_on_event(void* context, SceneManagerEvent event)
 
 
     if(event.type == SceneManagerEventTypeCustom) {
     if(event.type == SceneManagerEventTypeCustom) {
         switch(event.event) {
         switch(event.event) {
-            case BoilerplateCustomEventScene2Left:
-            case BoilerplateCustomEventScene2Right:
-                break;
-            case BoilerplateCustomEventScene2Up:
-            case BoilerplateCustomEventScene2Down:
-                break;
-            case BoilerplateCustomEventScene2Back:
-                notification_message(app->notification, &sequence_reset_red);
-                notification_message(app->notification, &sequence_reset_green);
-                notification_message(app->notification, &sequence_reset_blue);
-                if(!scene_manager_search_and_switch_to_previous_scene(
-                    app->scene_manager, BoilerplateSceneMenu)) {
-                        scene_manager_stop(app->scene_manager);
-                        view_dispatcher_stop(app->view_dispatcher);
-                    }
-                consumed = true;
-                break;
+        case BoilerplateCustomEventScene2Left:
+        case BoilerplateCustomEventScene2Right:
+            break;
+        case BoilerplateCustomEventScene2Up:
+        case BoilerplateCustomEventScene2Down:
+            break;
+        case BoilerplateCustomEventScene2Back:
+            notification_message(app->notification, &sequence_reset_red);
+            notification_message(app->notification, &sequence_reset_green);
+            notification_message(app->notification, &sequence_reset_blue);
+            if(!scene_manager_search_and_switch_to_previous_scene(
+                   app->scene_manager, BoilerplateSceneMenu)) {
+                scene_manager_stop(app->scene_manager);
+                view_dispatcher_stop(app->view_dispatcher);
+            }
+            consumed = true;
+            break;
         }
         }
     }
     }
 
 
@@ -48,4 +48,3 @@ void boilerplate_scene_scene_2_on_exit(void* context) {
     Boilerplate* app = context;
     Boilerplate* app = context;
     UNUSED(app);
     UNUSED(app);
 }
 }
-

+ 188 - 268
scenes/boilerplate_scene_settings.c

@@ -1,20 +1,70 @@
 #include "../malveke_gb_photo.h"
 #include "../malveke_gb_photo.h"
 #include <lib/toolbox/value_index.h>
 #include <lib/toolbox/value_index.h>
 
 
-enum SettingsIndex
-{
+enum SettingsIndex {
     SettingsIndexHaptic = 10,
     SettingsIndexHaptic = 10,
     SettingsIndexValue1,
     SettingsIndexValue1,
     SettingsIndexValue2,
     SettingsIndexValue2,
 };
 };
 
 
-const char *const palette_text[57] = {
+const char* const palette_text[57] = {
     "B&W",
     "B&W",
     "Original",
     "Original",
     "Splash Up",
     "Splash Up",
     "GB Light",
     "GB Light",
     "Pocket",
     "Pocket",
-    "aqpp", "azc", "banana", "bgb", "blackzero", "cctr", "cfp", "cga1", "cga2", "chig", "cmyk", "cybl", "d2kr", "datn", "dhg", "dimwm", "ffs", "fsil", "gbcd", "gbcda", "gbcdb", "gbceuus", "gbcl", "gbcla", "gbclb", "gbcr", "gbcrb", "gbcua", "gbcub", "gelc", "glmo", "grafixkidgray", "grafixkidgreen", "hipster", "kditw", "llawk", "marmx", "nc", "ppr", "rcs", "roga", "sfh", "shmgy", "shzol", "slmem", "spezi", "tdoyc", "tpa", "tsk", "vb85", "wtfp", "yirl"};
+    "aqpp",
+    "azc",
+    "banana",
+    "bgb",
+    "blackzero",
+    "cctr",
+    "cfp",
+    "cga1",
+    "cga2",
+    "chig",
+    "cmyk",
+    "cybl",
+    "d2kr",
+    "datn",
+    "dhg",
+    "dimwm",
+    "ffs",
+    "fsil",
+    "gbcd",
+    "gbcda",
+    "gbcdb",
+    "gbceuus",
+    "gbcl",
+    "gbcla",
+    "gbclb",
+    "gbcr",
+    "gbcrb",
+    "gbcua",
+    "gbcub",
+    "gelc",
+    "glmo",
+    "grafixkidgray",
+    "grafixkidgreen",
+    "hipster",
+    "kditw",
+    "llawk",
+    "marmx",
+    "nc",
+    "ppr",
+    "rcs",
+    "roga",
+    "sfh",
+    "shmgy",
+    "shzol",
+    "slmem",
+    "spezi",
+    "tdoyc",
+    "tpa",
+    "tsk",
+    "vb85",
+    "wtfp",
+    "yirl"};
 const uint32_t palette_value[57] = {
 const uint32_t palette_value[57] = {
     BoilerplatePaletteBlackAndWhite,
     BoilerplatePaletteBlackAndWhite,
     BoilerplatePaletteOriginal,
     BoilerplatePaletteOriginal,
@@ -72,10 +122,9 @@ const uint32_t palette_value[57] = {
     BoilerplatePaletteThestarryknight,
     BoilerplatePaletteThestarryknight,
     BoilerplatePaletteVirtualBoy1985,
     BoilerplatePaletteVirtualBoy1985,
     BoilerplatePaletteWaterfrontPlaza,
     BoilerplatePaletteWaterfrontPlaza,
-    BoilerplatePaletteYouthIkarusreloaded
-};
+    BoilerplatePaletteYouthIkarusreloaded};
 
 
-const char *const info_text[2] = {
+const char* const info_text[2] = {
     "OFF",
     "OFF",
     "ON",
     "ON",
 };
 };
@@ -84,409 +133,294 @@ const uint32_t info_value[2] = {
     BoilerplateInfoOn,
     BoilerplateInfoOn,
 };
 };
 
 
-
-static void boilerplate_scene_settings_set_palette(VariableItem *item)
-{
-    Boilerplate *app = variable_item_get_context(item);
+static void boilerplate_scene_settings_set_palette(VariableItem* item) {
+    Boilerplate* app = variable_item_get_context(item);
     UNUSED(app);
     UNUSED(app);
     uint8_t index = variable_item_get_current_value_index(item);
     uint8_t index = variable_item_get_current_value_index(item);
 
 
     variable_item_set_current_value_text(item, palette_text[index]);
     variable_item_set_current_value_text(item, palette_text[index]);
     app->palette = palette_value[index];
     app->palette = palette_value[index];
-    if (app->palette == BoilerplatePaletteBlackAndWhite)
-    {
+    if(app->palette == BoilerplatePaletteBlackAndWhite) {
         app->palette_color_hex_a = 0xFFFFFF;
         app->palette_color_hex_a = 0xFFFFFF;
         app->palette_color_hex_b = 0xAAAAAA;
         app->palette_color_hex_b = 0xAAAAAA;
         app->palette_color_hex_c = 0x555555;
         app->palette_color_hex_c = 0x555555;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteOriginal)
-    {
+    } else if(app->palette == BoilerplatePaletteOriginal) {
         app->palette_color_hex_a = 0x9bbc0f;
         app->palette_color_hex_a = 0x9bbc0f;
         app->palette_color_hex_b = 0x77a112;
         app->palette_color_hex_b = 0x77a112;
         app->palette_color_hex_c = 0x306230;
         app->palette_color_hex_c = 0x306230;
         app->palette_color_hex_d = 0x0f380f;
         app->palette_color_hex_d = 0x0f380f;
-    }
-    else if (app->palette == BoilerplatePaletteSplashUp)
-    {
+    } else if(app->palette == BoilerplatePaletteSplashUp) {
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_b = 0xffad63;
         app->palette_color_hex_b = 0xffad63;
         app->palette_color_hex_c = 0x833100;
         app->palette_color_hex_c = 0x833100;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteGBLight)
-    {
+    } else if(app->palette == BoilerplatePaletteGBLight) {
         app->palette_color_hex_a = 0x1ddece;
         app->palette_color_hex_a = 0x1ddece;
         app->palette_color_hex_b = 0x19c7b3;
         app->palette_color_hex_b = 0x19c7b3;
         app->palette_color_hex_c = 0x16a596;
         app->palette_color_hex_c = 0x16a596;
         app->palette_color_hex_d = 0x0b7a6d;
         app->palette_color_hex_d = 0x0b7a6d;
-    }
-    else if (app->palette == BoilerplatePalettePocket)
-    {
+    } else if(app->palette == BoilerplatePalettePocket) {
         app->palette_color_hex_a = 0xc4cfa1;
         app->palette_color_hex_a = 0xc4cfa1;
         app->palette_color_hex_b = 0x8b956d;
         app->palette_color_hex_b = 0x8b956d;
         app->palette_color_hex_c = 0x4d533c;
         app->palette_color_hex_c = 0x4d533c;
         app->palette_color_hex_d = 0x1f1f1f;
         app->palette_color_hex_d = 0x1f1f1f;
-    }
-    else if (app->palette == BoilerplatePaletteAudiQuattroPikesPeak)
-    {
+    } else if(app->palette == BoilerplatePaletteAudiQuattroPikesPeak) {
         app->palette_color_hex_a = 0xebeee7;
         app->palette_color_hex_a = 0xebeee7;
         app->palette_color_hex_b = 0x868779;
         app->palette_color_hex_b = 0x868779;
         app->palette_color_hex_c = 0xfa2b25;
         app->palette_color_hex_c = 0xfa2b25;
         app->palette_color_hex_d = 0x2a201e;
         app->palette_color_hex_d = 0x2a201e;
-    }
-    else if (app->palette == BoilerplatePaletteAzureClouds)
-    {
+    } else if(app->palette == BoilerplatePaletteAzureClouds) {
         app->palette_color_hex_a = 0x47ff99;
         app->palette_color_hex_a = 0x47ff99;
         app->palette_color_hex_b = 0x32b66d;
         app->palette_color_hex_b = 0x32b66d;
         app->palette_color_hex_c = 0x124127;
         app->palette_color_hex_c = 0x124127;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteTheresalwaysmoney)
-    {
+    } else if(app->palette == BoilerplatePaletteTheresalwaysmoney) {
         app->palette_color_hex_a = 0xfdfe0a;
         app->palette_color_hex_a = 0xfdfe0a;
         app->palette_color_hex_b = 0xfed638;
         app->palette_color_hex_b = 0xfed638;
         app->palette_color_hex_c = 0x977b25;
         app->palette_color_hex_c = 0x977b25;
         app->palette_color_hex_d = 0x221a09;
         app->palette_color_hex_d = 0x221a09;
-    }
-    else if (app->palette == BoilerplatePaletteBGBEmulator)
-    {
+    } else if(app->palette == BoilerplatePaletteBGBEmulator) {
         app->palette_color_hex_a = 0xe0f8d0;
         app->palette_color_hex_a = 0xe0f8d0;
         app->palette_color_hex_b = 0x88c070;
         app->palette_color_hex_b = 0x88c070;
         app->palette_color_hex_c = 0x346856;
         app->palette_color_hex_c = 0x346856;
         app->palette_color_hex_d = 0x081820;
         app->palette_color_hex_d = 0x081820;
-    }
-    else if (app->palette == BoilerplatePaletteGameBoyBlackZeropalette)
-    {
+    } else if(app->palette == BoilerplatePaletteGameBoyBlackZeropalette) {
         app->palette_color_hex_a = 0x7e8416;
         app->palette_color_hex_a = 0x7e8416;
         app->palette_color_hex_b = 0x577b46;
         app->palette_color_hex_b = 0x577b46;
         app->palette_color_hex_c = 0x385d49;
         app->palette_color_hex_c = 0x385d49;
         app->palette_color_hex_d = 0x2e463d;
         app->palette_color_hex_d = 0x2e463d;
-    }
-    else if (app->palette == BoilerplatePaletteCandyCottonTowerRaid)
-    {
+    } else if(app->palette == BoilerplatePaletteCandyCottonTowerRaid) {
         app->palette_color_hex_a = 0xe6aec4;
         app->palette_color_hex_a = 0xe6aec4;
         app->palette_color_hex_b = 0xe65790;
         app->palette_color_hex_b = 0xe65790;
         app->palette_color_hex_c = 0x8f0039;
         app->palette_color_hex_c = 0x8f0039;
         app->palette_color_hex_d = 0x380016;
         app->palette_color_hex_d = 0x380016;
-    }
-    else if (app->palette == BoilerplatePaletteCaramelFudgeParanoia)
-    {
+    } else if(app->palette == BoilerplatePaletteCaramelFudgeParanoia) {
         app->palette_color_hex_a = 0xcf9255;
         app->palette_color_hex_a = 0xcf9255;
         app->palette_color_hex_b = 0xcf7163;
         app->palette_color_hex_b = 0xcf7163;
         app->palette_color_hex_c = 0xb01553;
         app->palette_color_hex_c = 0xb01553;
         app->palette_color_hex_d = 0x3f1711;
         app->palette_color_hex_d = 0x3f1711;
-    }
-    else if (app->palette == BoilerplatePaletteCGAPaletteCrush1)
-    {
+    } else if(app->palette == BoilerplatePaletteCGAPaletteCrush1) {
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_b = 0x55ffff;
         app->palette_color_hex_b = 0x55ffff;
         app->palette_color_hex_c = 0xff55ff;
         app->palette_color_hex_c = 0xff55ff;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteCGAPaletteCrush2)
-    {
+    } else if(app->palette == BoilerplatePaletteCGAPaletteCrush2) {
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_b = 0x55ffff;
         app->palette_color_hex_b = 0x55ffff;
         app->palette_color_hex_c = 0xff5555;
         app->palette_color_hex_c = 0xff5555;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteChildhoodinGreenland)
-    {
+    } else if(app->palette == BoilerplatePaletteChildhoodinGreenland) {
         app->palette_color_hex_a = 0xd0d058;
         app->palette_color_hex_a = 0xd0d058;
         app->palette_color_hex_b = 0xa0a840;
         app->palette_color_hex_b = 0xa0a840;
         app->palette_color_hex_c = 0x708028;
         app->palette_color_hex_c = 0x708028;
         app->palette_color_hex_d = 0x405010;
         app->palette_color_hex_d = 0x405010;
-    }
-    else if (app->palette == BoilerplatePaletteCMYKeystone)
-    {
+    } else if(app->palette == BoilerplatePaletteCMYKeystone) {
         app->palette_color_hex_a = 0xffff00;
         app->palette_color_hex_a = 0xffff00;
         app->palette_color_hex_b = 0x0be8fd;
         app->palette_color_hex_b = 0x0be8fd;
         app->palette_color_hex_c = 0xfb00fa;
         app->palette_color_hex_c = 0xfb00fa;
         app->palette_color_hex_d = 0x373737;
         app->palette_color_hex_d = 0x373737;
-    }
-    else if (app->palette == BoilerplatePaletteCyanideBlues)
-    {
+    } else if(app->palette == BoilerplatePaletteCyanideBlues) {
         app->palette_color_hex_a = 0x9efbe3;
         app->palette_color_hex_a = 0x9efbe3;
         app->palette_color_hex_b = 0x21aff5;
         app->palette_color_hex_b = 0x21aff5;
         app->palette_color_hex_c = 0x1e4793;
         app->palette_color_hex_c = 0x1e4793;
         app->palette_color_hex_d = 0x0e1e3d;
         app->palette_color_hex_d = 0x0e1e3d;
-    }
-    else if (app->palette == BoilerplatePaletteDune2000remastered)
-    {
+    } else if(app->palette == BoilerplatePaletteDune2000remastered) {
         app->palette_color_hex_a = 0xfbf1cd;
         app->palette_color_hex_a = 0xfbf1cd;
         app->palette_color_hex_b = 0xc09e7d;
         app->palette_color_hex_b = 0xc09e7d;
         app->palette_color_hex_c = 0x725441;
         app->palette_color_hex_c = 0x725441;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteDrowningatnight)
-    {
+    } else if(app->palette == BoilerplatePaletteDrowningatnight) {
         app->palette_color_hex_a = 0xa9b0b3;
         app->palette_color_hex_a = 0xa9b0b3;
         app->palette_color_hex_b = 0x586164;
         app->palette_color_hex_b = 0x586164;
         app->palette_color_hex_c = 0x20293f;
         app->palette_color_hex_c = 0x20293f;
         app->palette_color_hex_d = 0x030c22;
         app->palette_color_hex_d = 0x030c22;
-    }
-    else if (app->palette == BoilerplatePaletteDeepHazeGreen)
-    {
+    } else if(app->palette == BoilerplatePaletteDeepHazeGreen) {
         app->palette_color_hex_a = 0xa1d909;
         app->palette_color_hex_a = 0xa1d909;
         app->palette_color_hex_b = 0x467818;
         app->palette_color_hex_b = 0x467818;
         app->palette_color_hex_c = 0x27421f;
         app->palette_color_hex_c = 0x27421f;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteDiesistmeineWassermelone)
-    {
+    } else if(app->palette == BoilerplatePaletteDiesistmeineWassermelone) {
         app->palette_color_hex_a = 0xffdbcb;
         app->palette_color_hex_a = 0xffdbcb;
         app->palette_color_hex_b = 0xf27d7a;
         app->palette_color_hex_b = 0xf27d7a;
         app->palette_color_hex_c = 0x558429;
         app->palette_color_hex_c = 0x558429;
         app->palette_color_hex_d = 0x222903;
         app->palette_color_hex_d = 0x222903;
-    }
-    else if (app->palette == BoilerplatePaletteFlowerfeldstrabe)
-    {
+    } else if(app->palette == BoilerplatePaletteFlowerfeldstrabe) {
         app->palette_color_hex_a = 0xe9d9cc;
         app->palette_color_hex_a = 0xe9d9cc;
         app->palette_color_hex_b = 0xc5c5ce;
         app->palette_color_hex_b = 0xc5c5ce;
         app->palette_color_hex_c = 0x75868f;
         app->palette_color_hex_c = 0x75868f;
         app->palette_color_hex_d = 0x171f62;
         app->palette_color_hex_d = 0x171f62;
-    }
-    else if (app->palette == BoilerplatePaletteFloydSteinberginLove)
-    {
+    } else if(app->palette == BoilerplatePaletteFloydSteinberginLove) {
         app->palette_color_hex_a = 0xeaf5fa;
         app->palette_color_hex_a = 0xeaf5fa;
         app->palette_color_hex_b = 0x5fb1f5;
         app->palette_color_hex_b = 0x5fb1f5;
         app->palette_color_hex_c = 0xd23c4e;
         app->palette_color_hex_c = 0xd23c4e;
         app->palette_color_hex_d = 0x4c1c2d;
         app->palette_color_hex_d = 0x4c1c2d;
-    }
-    else if (app->palette == BoilerplatePaletteGameBoyColorSplashDown)
-    {
+    } else if(app->palette == BoilerplatePaletteGameBoyColorSplashDown) {
         app->palette_color_hex_a = 0xffffa5;
         app->palette_color_hex_a = 0xffffa5;
         app->palette_color_hex_b = 0xfe9494;
         app->palette_color_hex_b = 0xfe9494;
         app->palette_color_hex_c = 0x9394fe;
         app->palette_color_hex_c = 0x9394fe;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteGameBoyColorSplashDownA)
-    {
+    } else if(app->palette == BoilerplatePaletteGameBoyColorSplashDownA) {
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_b = 0xffff00;
         app->palette_color_hex_b = 0xffff00;
         app->palette_color_hex_c = 0xfe0000;
         app->palette_color_hex_c = 0xfe0000;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteGameBoyColorSplashDownB)
-    {
+    } else if(app->palette == BoilerplatePaletteGameBoyColorSplashDownB) {
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_b = 0xffff00;
         app->palette_color_hex_b = 0xffff00;
         app->palette_color_hex_c = 0x7d4900;
         app->palette_color_hex_c = 0x7d4900;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteGameBoyColorSplashRightAGameBoyCamera)
-    {
+    } else if(app->palette == BoilerplatePaletteGameBoyColorSplashRightAGameBoyCamera) {
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_b = 0x7bff30;
         app->palette_color_hex_b = 0x7bff30;
         app->palette_color_hex_c = 0x0163c6;
         app->palette_color_hex_c = 0x0163c6;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteGameBoyColorSplashLeft)
-    {
+    } else if(app->palette == BoilerplatePaletteGameBoyColorSplashLeft) {
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_b = 0x65a49b;
         app->palette_color_hex_b = 0x65a49b;
         app->palette_color_hex_c = 0x0000fe;
         app->palette_color_hex_c = 0x0000fe;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteGameBoyColorSplashLeftA)
-    {
+    } else if(app->palette == BoilerplatePaletteGameBoyColorSplashLeftA) {
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_b = 0x8b8cde;
         app->palette_color_hex_b = 0x8b8cde;
         app->palette_color_hex_c = 0x53528c;
         app->palette_color_hex_c = 0x53528c;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteGameBoyColorSplashLeftB)
-    {
+    } else if(app->palette == BoilerplatePaletteGameBoyColorSplashLeftB) {
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_b = 0xa5a5a5;
         app->palette_color_hex_b = 0xa5a5a5;
         app->palette_color_hex_c = 0x525252;
         app->palette_color_hex_c = 0x525252;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteGameBoyColorSplashRight)
-    {
+    } else if(app->palette == BoilerplatePaletteGameBoyColorSplashRight) {
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_b = 0x51ff00;
         app->palette_color_hex_b = 0x51ff00;
         app->palette_color_hex_c = 0xff4200;
         app->palette_color_hex_c = 0xff4200;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteGameBoyColorSplashRightB)
-    {
+    } else if(app->palette == BoilerplatePaletteGameBoyColorSplashRightB) {
         app->palette_color_hex_a = 0x000000;
         app->palette_color_hex_a = 0x000000;
         app->palette_color_hex_b = 0x008486;
         app->palette_color_hex_b = 0x008486;
         app->palette_color_hex_c = 0xffde00;
         app->palette_color_hex_c = 0xffde00;
         app->palette_color_hex_d = 0xffffff;
         app->palette_color_hex_d = 0xffffff;
-    }
-    else if (app->palette == BoilerplatePaletteGameBoyColorSplashUpA)
-    {
+    } else if(app->palette == BoilerplatePaletteGameBoyColorSplashUpA) {
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_a = 0xffffff;
         app->palette_color_hex_b = 0xff8f84;
         app->palette_color_hex_b = 0xff8f84;
         app->palette_color_hex_c = 0x943a3a;
         app->palette_color_hex_c = 0x943a3a;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteGameBoyColorSplashUpB)
-    {
+    } else if(app->palette == BoilerplatePaletteGameBoyColorSplashUpB) {
         app->palette_color_hex_a = 0xffe7c5;
         app->palette_color_hex_a = 0xffe7c5;
         app->palette_color_hex_b = 0xce9c85;
         app->palette_color_hex_b = 0xce9c85;
         app->palette_color_hex_c = 0x846b29;
         app->palette_color_hex_c = 0x846b29;
         app->palette_color_hex_d = 0x5b3109;
         app->palette_color_hex_d = 0x5b3109;
-    }
-    else if (app->palette == BoilerplatePaletteGoldenElephantCurry)
-    {
+    } else if(app->palette == BoilerplatePaletteGoldenElephantCurry) {
         app->palette_color_hex_a = 0xff9c00;
         app->palette_color_hex_a = 0xff9c00;
         app->palette_color_hex_b = 0xc27600;
         app->palette_color_hex_b = 0xc27600;
         app->palette_color_hex_c = 0x4f3000;
         app->palette_color_hex_c = 0x4f3000;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteGlowingMountains)
-    {
+    } else if(app->palette == BoilerplatePaletteGlowingMountains) {
         app->palette_color_hex_a = 0xffbf98;
         app->palette_color_hex_a = 0xffbf98;
         app->palette_color_hex_b = 0xa1a8b8;
         app->palette_color_hex_b = 0xa1a8b8;
         app->palette_color_hex_c = 0x514f6c;
         app->palette_color_hex_c = 0x514f6c;
         app->palette_color_hex_d = 0x2f1c35;
         app->palette_color_hex_d = 0x2f1c35;
-    }
-    else if (app->palette == BoilerplatePaletteGrafixkidGray)
-    {
+    } else if(app->palette == BoilerplatePaletteGrafixkidGray) {
         app->palette_color_hex_a = 0xe0dbcd;
         app->palette_color_hex_a = 0xe0dbcd;
         app->palette_color_hex_b = 0xa89f94;
         app->palette_color_hex_b = 0xa89f94;
         app->palette_color_hex_c = 0x706b66;
         app->palette_color_hex_c = 0x706b66;
         app->palette_color_hex_d = 0x2b2b26;
         app->palette_color_hex_d = 0x2b2b26;
-    }
-    else if (app->palette == BoilerplatePaletteGrafixkidGreen)
-    {
+    } else if(app->palette == BoilerplatePaletteGrafixkidGreen) {
         app->palette_color_hex_a = 0xdbf4b4;
         app->palette_color_hex_a = 0xdbf4b4;
         app->palette_color_hex_b = 0xabc396;
         app->palette_color_hex_b = 0xabc396;
         app->palette_color_hex_c = 0x7b9278;
         app->palette_color_hex_c = 0x7b9278;
         app->palette_color_hex_d = 0x4c625a;
         app->palette_color_hex_d = 0x4c625a;
-    }
-    else if (app->palette == BoilerplatePaletteArtisticCaffeinatedLactose)
-    {
+    } else if(app->palette == BoilerplatePaletteArtisticCaffeinatedLactose) {
         app->palette_color_hex_a = 0xfdfef5;
         app->palette_color_hex_a = 0xfdfef5;
         app->palette_color_hex_b = 0xdea963;
         app->palette_color_hex_b = 0xdea963;
         app->palette_color_hex_c = 0x9e754f;
         app->palette_color_hex_c = 0x9e754f;
         app->palette_color_hex_d = 0x241606;
         app->palette_color_hex_d = 0x241606;
-    }
-    else if (app->palette == BoilerplatePaletteKneeDeepintheWood)
-    {
+    } else if(app->palette == BoilerplatePaletteKneeDeepintheWood) {
         app->palette_color_hex_a = 0xfffe6e;
         app->palette_color_hex_a = 0xfffe6e;
         app->palette_color_hex_b = 0xd5690f;
         app->palette_color_hex_b = 0xd5690f;
         app->palette_color_hex_c = 0x3c3ca9;
         app->palette_color_hex_c = 0x3c3ca9;
         app->palette_color_hex_d = 0x2c2410;
         app->palette_color_hex_d = 0x2c2410;
-    }
-    else if (app->palette == BoilerplatePaletteLinkslateAwakening)
-    {
+    } else if(app->palette == BoilerplatePaletteLinkslateAwakening) {
         app->palette_color_hex_a = 0xffffb5;
         app->palette_color_hex_a = 0xffffb5;
         app->palette_color_hex_b = 0x7bc67b;
         app->palette_color_hex_b = 0x7bc67b;
         app->palette_color_hex_c = 0x6b8c42;
         app->palette_color_hex_c = 0x6b8c42;
         app->palette_color_hex_d = 0x5a3921;
         app->palette_color_hex_d = 0x5a3921;
-    }
-    else if (app->palette == BoilerplatePaletteMetroidAranremixed)
-    {
+    } else if(app->palette == BoilerplatePaletteMetroidAranremixed) {
         app->palette_color_hex_a = 0xaedf1e;
         app->palette_color_hex_a = 0xaedf1e;
         app->palette_color_hex_b = 0x047e60;
         app->palette_color_hex_b = 0x047e60;
         app->palette_color_hex_c = 0xb62558;
         app->palette_color_hex_c = 0xb62558;
         app->palette_color_hex_d = 0x2c1700;
         app->palette_color_hex_d = 0x2c1700;
-    }
-    else if (app->palette == BoilerplatePaletteNortoriousComandante)
-    {
+    } else if(app->palette == BoilerplatePaletteNortoriousComandante) {
         app->palette_color_hex_a = 0xfcfe54;
         app->palette_color_hex_a = 0xfcfe54;
         app->palette_color_hex_b = 0x54fefc;
         app->palette_color_hex_b = 0x54fefc;
         app->palette_color_hex_c = 0x04aaac;
         app->palette_color_hex_c = 0x04aaac;
         app->palette_color_hex_d = 0x0402ac;
         app->palette_color_hex_d = 0x0402ac;
-    }
-    else if (app->palette == BoilerplatePalettePurpleRain)
-    {
+    } else if(app->palette == BoilerplatePalettePurpleRain) {
         app->palette_color_hex_a = 0xadfffc;
         app->palette_color_hex_a = 0xadfffc;
         app->palette_color_hex_b = 0x8570b2;
         app->palette_color_hex_b = 0x8570b2;
         app->palette_color_hex_c = 0xff0084;
         app->palette_color_hex_c = 0xff0084;
         app->palette_color_hex_d = 0x68006a;
         app->palette_color_hex_d = 0x68006a;
-    }
-    else if (app->palette == BoilerplatePaletteRustedCitySign)
-    {
+    } else if(app->palette == BoilerplatePaletteRustedCitySign) {
         app->palette_color_hex_a = 0xedb4a1;
         app->palette_color_hex_a = 0xedb4a1;
         app->palette_color_hex_b = 0xa96868;
         app->palette_color_hex_b = 0xa96868;
         app->palette_color_hex_c = 0x764462;
         app->palette_color_hex_c = 0x764462;
         app->palette_color_hex_d = 0x2c2137;
         app->palette_color_hex_d = 0x2c2137;
-    }
-    else if (app->palette == BoilerplatePaletteRomerosGarden)
-    {
+    } else if(app->palette == BoilerplatePaletteRomerosGarden) {
         app->palette_color_hex_a = 0xebc4ab;
         app->palette_color_hex_a = 0xebc4ab;
         app->palette_color_hex_b = 0x649a57;
         app->palette_color_hex_b = 0x649a57;
         app->palette_color_hex_c = 0x574431;
         app->palette_color_hex_c = 0x574431;
         app->palette_color_hex_d = 0x323727;
         app->palette_color_hex_d = 0x323727;
-    }
-    else if (app->palette == BoilerplatePaletteSunflowerHolidays)
-    {
+    } else if(app->palette == BoilerplatePaletteSunflowerHolidays) {
         app->palette_color_hex_a = 0xffff55;
         app->palette_color_hex_a = 0xffff55;
         app->palette_color_hex_b = 0xff5555;
         app->palette_color_hex_b = 0xff5555;
         app->palette_color_hex_c = 0x881400;
         app->palette_color_hex_c = 0x881400;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteSuperHyperMegaGameboy)
-    {
+    } else if(app->palette == BoilerplatePaletteSuperHyperMegaGameboy) {
         app->palette_color_hex_a = 0xf7e7c6;
         app->palette_color_hex_a = 0xf7e7c6;
         app->palette_color_hex_b = 0xd68e49;
         app->palette_color_hex_b = 0xd68e49;
         app->palette_color_hex_c = 0xa63725;
         app->palette_color_hex_c = 0xa63725;
         app->palette_color_hex_d = 0x331e50;
         app->palette_color_hex_d = 0x331e50;
-    }
-    else if (app->palette == BoilerplatePaletteSpaceHazeOverload)
-    {
+    } else if(app->palette == BoilerplatePaletteSpaceHazeOverload) {
         app->palette_color_hex_a = 0xf8e3c4;
         app->palette_color_hex_a = 0xf8e3c4;
         app->palette_color_hex_b = 0xcc3495;
         app->palette_color_hex_b = 0xcc3495;
         app->palette_color_hex_c = 0x6b1fb1;
         app->palette_color_hex_c = 0x6b1fb1;
         app->palette_color_hex_d = 0x0b0630;
         app->palette_color_hex_d = 0x0b0630;
-    }
-    else if (app->palette == BoilerplatePaletteStarlitMemories)
-    {
+    } else if(app->palette == BoilerplatePaletteStarlitMemories) {
         app->palette_color_hex_a = 0x869ad9;
         app->palette_color_hex_a = 0x869ad9;
         app->palette_color_hex_b = 0x6d53bd;
         app->palette_color_hex_b = 0x6d53bd;
         app->palette_color_hex_c = 0x6f2096;
         app->palette_color_hex_c = 0x6f2096;
         app->palette_color_hex_d = 0x4f133f;
         app->palette_color_hex_d = 0x4f133f;
-    }
-    else if (app->palette == BoilerplatePaletteMyFriendfromBavaria)
-    {
+    } else if(app->palette == BoilerplatePaletteMyFriendfromBavaria) {
         app->palette_color_hex_a = 0xfeda1b;
         app->palette_color_hex_a = 0xfeda1b;
         app->palette_color_hex_b = 0xdf7925;
         app->palette_color_hex_b = 0xdf7925;
         app->palette_color_hex_c = 0xb60077;
         app->palette_color_hex_c = 0xb60077;
         app->palette_color_hex_d = 0x382977;
         app->palette_color_hex_d = 0x382977;
-    }
-    else if (app->palette == BoilerplatePaletteThedeathofYungColumbus)
-    {
+    } else if(app->palette == BoilerplatePaletteThedeathofYungColumbus) {
         app->palette_color_hex_a = 0xb5ff32;
         app->palette_color_hex_a = 0xb5ff32;
         app->palette_color_hex_b = 0xff2261;
         app->palette_color_hex_b = 0xff2261;
         app->palette_color_hex_c = 0x462917;
         app->palette_color_hex_c = 0x462917;
         app->palette_color_hex_d = 0x1d1414;
         app->palette_color_hex_d = 0x1d1414;
-    }
-    else if (app->palette == BoilerplatePaletteTramontoalParcodegliAcquedotti)
-    {
+    } else if(app->palette == BoilerplatePaletteTramontoalParcodegliAcquedotti) {
         app->palette_color_hex_a = 0xf3c677;
         app->palette_color_hex_a = 0xf3c677;
         app->palette_color_hex_b = 0xe64a4e;
         app->palette_color_hex_b = 0xe64a4e;
         app->palette_color_hex_c = 0x912978;
         app->palette_color_hex_c = 0x912978;
         app->palette_color_hex_d = 0x0c0a3e;
         app->palette_color_hex_d = 0x0c0a3e;
-    }
-    else if (app->palette == BoilerplatePaletteThestarryknight)
-    {
+    } else if(app->palette == BoilerplatePaletteThestarryknight) {
         app->palette_color_hex_a = 0xf5db37;
         app->palette_color_hex_a = 0xf5db37;
         app->palette_color_hex_b = 0x37cae5;
         app->palette_color_hex_b = 0x37cae5;
         app->palette_color_hex_c = 0x0f86b6;
         app->palette_color_hex_c = 0x0f86b6;
         app->palette_color_hex_d = 0x123f77;
         app->palette_color_hex_d = 0x123f77;
-    }
-    else if (app->palette == BoilerplatePaletteVirtualBoy1985)
-    {
+    } else if(app->palette == BoilerplatePaletteVirtualBoy1985) {
         app->palette_color_hex_a = 0xff0000;
         app->palette_color_hex_a = 0xff0000;
         app->palette_color_hex_b = 0xdb0000;
         app->palette_color_hex_b = 0xdb0000;
         app->palette_color_hex_c = 0x520000;
         app->palette_color_hex_c = 0x520000;
         app->palette_color_hex_d = 0x000000;
         app->palette_color_hex_d = 0x000000;
-    }
-    else if (app->palette == BoilerplatePaletteWaterfrontPlaza)
-    {
+    } else if(app->palette == BoilerplatePaletteWaterfrontPlaza) {
         app->palette_color_hex_a = 0xcecece;
         app->palette_color_hex_a = 0xcecece;
         app->palette_color_hex_b = 0x6f9edf;
         app->palette_color_hex_b = 0x6f9edf;
         app->palette_color_hex_c = 0x42678e;
         app->palette_color_hex_c = 0x42678e;
         app->palette_color_hex_d = 0x102533;
         app->palette_color_hex_d = 0x102533;
-    }
-    else if (app->palette == BoilerplatePaletteYouthIkarusreloaded)
-    {
+    } else if(app->palette == BoilerplatePaletteYouthIkarusreloaded) {
         app->palette_color_hex_a = 0xcef7f7;
         app->palette_color_hex_a = 0xcef7f7;
         app->palette_color_hex_b = 0xf78e50;
         app->palette_color_hex_b = 0xf78e50;
         app->palette_color_hex_c = 0x9e0000;
         app->palette_color_hex_c = 0x9e0000;
@@ -494,102 +428,88 @@ static void boilerplate_scene_settings_set_palette(VariableItem *item)
     }
     }
 }
 }
 
 
-    static void boilerplate_scene_settings_set_info(VariableItem * item)
-    {
-        Boilerplate *app = variable_item_get_context(item);
-        UNUSED(app);
-        uint8_t index = variable_item_get_current_value_index(item);
-        variable_item_set_current_value_text(item, info_text[index]);
-        app->info = info_value[index];
-    }
+static void boilerplate_scene_settings_set_info(VariableItem* item) {
+    Boilerplate* app = variable_item_get_context(item);
+    UNUSED(app);
+    uint8_t index = variable_item_get_current_value_index(item);
+    variable_item_set_current_value_text(item, info_text[index]);
+    app->info = info_value[index];
+}
 
 
-    // static void boilerplate_scene_settings_set_led(VariableItem* item) {
-    //     Boilerplate* app = variable_item_get_context(item);
-    //     uint8_t index = variable_item_get_current_value_index(item);
-    //     variable_item_set_current_value_text(item, led_text[index]);
-    //     app->led = led_value[index];
-    // }
+// static void boilerplate_scene_settings_set_led(VariableItem* item) {
+//     Boilerplate* app = variable_item_get_context(item);
+//     uint8_t index = variable_item_get_current_value_index(item);
+//     variable_item_set_current_value_text(item, led_text[index]);
+//     app->led = led_value[index];
+// }
 
 
-    // static void boilerplate_scene_settings_set_save_settings(VariableItem* item) {
-    //     Boilerplate* app = variable_item_get_context(item);
-    //     uint8_t index = variable_item_get_current_value_index(item);
-    //     variable_item_set_current_value_text(item, settings_text[index]);
-    //     app->save_settings = settings_value[index];
-    // }
+// static void boilerplate_scene_settings_set_save_settings(VariableItem* item) {
+//     Boilerplate* app = variable_item_get_context(item);
+//     uint8_t index = variable_item_get_current_value_index(item);
+//     variable_item_set_current_value_text(item, settings_text[index]);
+//     app->save_settings = settings_value[index];
+// }
 
 
-    void boilerplate_scene_settings_submenu_callback(void *context, uint32_t index)
-    {
-        Boilerplate *app = context;
-        view_dispatcher_send_custom_event(app->view_dispatcher, index);
-    }
+void boilerplate_scene_settings_submenu_callback(void* context, uint32_t index) {
+    Boilerplate* app = context;
+    view_dispatcher_send_custom_event(app->view_dispatcher, index);
+}
 
 
-    void boilerplate_scene_settings_on_enter(void *context)
-    {
-        Boilerplate *app = context;
-        VariableItem *item;
-        uint8_t value_index;
+void boilerplate_scene_settings_on_enter(void* context) {
+    Boilerplate* app = context;
+    VariableItem* item;
+    uint8_t value_index;
 
 
-        // Palette
-        item = variable_item_list_add(
-            app->variable_item_list,
-            "Palette:",
-            57,
-            boilerplate_scene_settings_set_palette,
-            app);
-        value_index = value_index_uint32(app->palette, palette_value, 1);
-        variable_item_set_current_value_index(item, value_index);
-        variable_item_set_current_value_text(item, palette_text[value_index]);
+    // Palette
+    item = variable_item_list_add(
+        app->variable_item_list, "Palette:", 57, boilerplate_scene_settings_set_palette, app);
+    value_index = value_index_uint32(app->palette, palette_value, 1);
+    variable_item_set_current_value_index(item, value_index);
+    variable_item_set_current_value_text(item, palette_text[value_index]);
 
 
-        // Info
-        item = variable_item_list_add(
-            app->variable_item_list,
-            "Info:",
-            2,
-            boilerplate_scene_settings_set_info,
-            app);
-        value_index = value_index_uint32(app->info, info_value, 2);
-        variable_item_set_current_value_index(item, value_index);
-        variable_item_set_current_value_text(item, info_text[value_index]);
+    // Info
+    item = variable_item_list_add(
+        app->variable_item_list, "Info:", 2, boilerplate_scene_settings_set_info, app);
+    value_index = value_index_uint32(app->info, info_value, 2);
+    variable_item_set_current_value_index(item, value_index);
+    variable_item_set_current_value_text(item, info_text[value_index]);
 
 
-        // // LED Effects on/off
-        // item = variable_item_list_add(
-        //     app->variable_item_list,
-        //     "Save Prefix",
-        //     2,
-        //     boilerplate_scene_settings_set_led,
-        //     app);
-        // value_index = value_index_uint32(app->led, led_value, 2);
-        // variable_item_set_current_value_index(item, value_index);
-        // variable_item_set_current_value_text(item, led_text[value_index]);
+    // // LED Effects on/off
+    // item = variable_item_list_add(
+    //     app->variable_item_list,
+    //     "Save Prefix",
+    //     2,
+    //     boilerplate_scene_settings_set_led,
+    //     app);
+    // value_index = value_index_uint32(app->led, led_value, 2);
+    // variable_item_set_current_value_index(item, value_index);
+    // variable_item_set_current_value_text(item, led_text[value_index]);
 
 
-        // // Save Settings to File
-        // item = variable_item_list_add(
-        //     app->variable_item_list,
-        //     "Save Settings",
-        //     2,
-        //     boilerplate_scene_settings_set_save_settings,
-        //     app);
-        // value_index = value_index_uint32(app->save_settings, settings_value, 2);
-        // variable_item_set_current_value_index(item, value_index);
-        // variable_item_set_current_value_text(item, settings_text[value_index]);
+    // // Save Settings to File
+    // item = variable_item_list_add(
+    //     app->variable_item_list,
+    //     "Save Settings",
+    //     2,
+    //     boilerplate_scene_settings_set_save_settings,
+    //     app);
+    // value_index = value_index_uint32(app->save_settings, settings_value, 2);
+    // variable_item_set_current_value_index(item, value_index);
+    // variable_item_set_current_value_text(item, settings_text[value_index]);
 
 
-        view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdSettings);
-    }
+    view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdSettings);
+}
 
 
-    bool boilerplate_scene_settings_on_event(void *context, SceneManagerEvent event)
-    {
-        Boilerplate *app = context;
-        UNUSED(app);
-        bool consumed = false;
-        if (event.type == SceneManagerEventTypeCustom)
-        {
-        }
-        return consumed;
+bool boilerplate_scene_settings_on_event(void* context, SceneManagerEvent event) {
+    Boilerplate* app = context;
+    UNUSED(app);
+    bool consumed = false;
+    if(event.type == SceneManagerEventTypeCustom) {
     }
     }
+    return consumed;
+}
 
 
-    void boilerplate_scene_settings_on_exit(void *context)
-    {
-        Boilerplate *app = context;
-        variable_item_list_set_selected_item(app->variable_item_list, 0);
-        variable_item_list_reset(app->variable_item_list);
-    }
+void boilerplate_scene_settings_on_exit(void* context) {
+    Boilerplate* app = context;
+    variable_item_list_set_selected_item(app->variable_item_list, 0);
+    variable_item_list_reset(app->variable_item_list);
+}

+ 25 - 24
scenes/boilerplate_scene_startscreen.c

@@ -11,40 +11,41 @@ void boilerplate_scene_startscreen_callback(BoilerplateCustomEvent event, void*
 void boilerplate_scene_startscreen_on_enter(void* context) {
 void boilerplate_scene_startscreen_on_enter(void* context) {
     furi_assert(context);
     furi_assert(context);
     Boilerplate* app = context;
     Boilerplate* app = context;
-    boilerplate_startscreen_set_callback(app->boilerplate_startscreen, boilerplate_scene_startscreen_callback, app);
+    boilerplate_startscreen_set_callback(
+        app->boilerplate_startscreen, boilerplate_scene_startscreen_callback, app);
     view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdStartscreen);
     view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdStartscreen);
 }
 }
 
 
 bool boilerplate_scene_startscreen_on_event(void* context, SceneManagerEvent event) {
 bool boilerplate_scene_startscreen_on_event(void* context, SceneManagerEvent event) {
     Boilerplate* app = context;
     Boilerplate* app = context;
     bool consumed = false;
     bool consumed = false;
-    
+
     if(event.type == SceneManagerEventTypeCustom) {
     if(event.type == SceneManagerEventTypeCustom) {
         switch(event.event) {
         switch(event.event) {
-            case BoilerplateCustomEventStartscreenLeft:
-            case BoilerplateCustomEventStartscreenRight:
-                break;
-            case BoilerplateCustomEventStartscreenUp:
-            case BoilerplateCustomEventStartscreenDown:
-                break;
-            case BoilerplateCustomEventStartscreenOk:
-                scene_manager_next_scene(app->scene_manager, BoilerplateSceneFileselect);
-                consumed = true;
-                break;
-            case BoilerplateCustomEventStartscreenBack:
-                notification_message(app->notification, &sequence_reset_red);
-                notification_message(app->notification, &sequence_reset_green);
-                notification_message(app->notification, &sequence_reset_blue);
-                if(!scene_manager_search_and_switch_to_previous_scene(
-                    app->scene_manager, BoilerplateSceneStartscreen)) {
-                        scene_manager_stop(app->scene_manager);
-                        view_dispatcher_stop(app->view_dispatcher);
-                    }
-                consumed = true;
-                break;
+        case BoilerplateCustomEventStartscreenLeft:
+        case BoilerplateCustomEventStartscreenRight:
+            break;
+        case BoilerplateCustomEventStartscreenUp:
+        case BoilerplateCustomEventStartscreenDown:
+            break;
+        case BoilerplateCustomEventStartscreenOk:
+            scene_manager_next_scene(app->scene_manager, BoilerplateSceneFileselect);
+            consumed = true;
+            break;
+        case BoilerplateCustomEventStartscreenBack:
+            notification_message(app->notification, &sequence_reset_red);
+            notification_message(app->notification, &sequence_reset_green);
+            notification_message(app->notification, &sequence_reset_blue);
+            if(!scene_manager_search_and_switch_to_previous_scene(
+                   app->scene_manager, BoilerplateSceneStartscreen)) {
+                scene_manager_stop(app->scene_manager);
+                view_dispatcher_stop(app->view_dispatcher);
+            }
+            consumed = true;
+            break;
         }
         }
     }
     }
-    
+
     return consumed;
     return consumed;
 }
 }
 
 

+ 14 - 22
scenes/scene_file_select.c

@@ -20,8 +20,7 @@
 
 
 // }
 // }
 
 
-static bool file_select(Boilerplate *app)
-{
+static bool file_select(Boilerplate* app) {
     furi_assert(app);
     furi_assert(app);
 
 
     furi_string_set(app->file_path, MALVEKE_APP_FOLDER_RAMS);
     furi_string_set(app->file_path, MALVEKE_APP_FOLDER_RAMS);
@@ -32,14 +31,13 @@ static bool file_select(Boilerplate *app)
     browser_options.skip_assets = true;
     browser_options.skip_assets = true;
 
 
     // Input events and views are managed by file_browser
     // Input events and views are managed by file_browser
-    bool res = dialog_file_browser_show(
-        app->dialogs, app->file_path, app->file_path, &browser_options);
+    bool res =
+        dialog_file_browser_show(app->dialogs, app->file_path, app->file_path, &browser_options);
     return res;
     return res;
 }
 }
 
 
-void boilerplate_scene_fileselect_on_enter(void *context)
-{
-    Boilerplate *app = context;
+void boilerplate_scene_fileselect_on_enter(void* context) {
+    Boilerplate* app = context;
 
 
     // if(app->script) {
     // if(app->script) {
     //     script_close(app->script);
     //     script_close(app->script);
@@ -49,34 +47,28 @@ void boilerplate_scene_fileselect_on_enter(void *context)
     //     storage_file_close(app->camera_ram_sav);
     //     storage_file_close(app->camera_ram_sav);
     // }
     // }
     // app->camera_ram_sav = storage_file_alloc(app->storage);
     // app->camera_ram_sav = storage_file_alloc(app->storage);
-    if (file_select(app))
-    {
-        if (storage_file_open(
-                app->camera_ram_sav,
-                furi_string_get_cstr(app->file_path),
-                FSAM_READ,
-                FSOM_OPEN_EXISTING))
-        {
+    if(file_select(app)) {
+        if(storage_file_open(
+               app->camera_ram_sav,
+               furi_string_get_cstr(app->file_path),
+               FSAM_READ,
+               FSOM_OPEN_EXISTING)) {
             storage_file_read(app->camera_ram_sav, app->scratchpad1, sizeof(app->scratchpad1));
             storage_file_read(app->camera_ram_sav, app->scratchpad1, sizeof(app->scratchpad1));
             scene_manager_next_scene(app->scene_manager, BoilerplateSceneMenu);
             scene_manager_next_scene(app->scene_manager, BoilerplateSceneMenu);
         }
         }
-    }
-    else
-    {
+    } else {
         view_dispatcher_stop(app->view_dispatcher);
         view_dispatcher_stop(app->view_dispatcher);
     }
     }
 }
 }
 
 
-bool boilerplate_scene_fileselect_on_event(void *context, SceneManagerEvent event)
-{
+bool boilerplate_scene_fileselect_on_event(void* context, SceneManagerEvent event) {
     UNUSED(context);
     UNUSED(context);
     UNUSED(event);
     UNUSED(event);
     // Boilerplate* app = context;
     // Boilerplate* app = context;
     return false;
     return false;
 }
 }
 
 
-void boilerplate_scene_fileselect_on_exit(void *context)
-{
+void boilerplate_scene_fileselect_on_exit(void* context) {
     UNUSED(context);
     UNUSED(context);
     // Boilerplate* app = context;
     // Boilerplate* app = context;
 }
 }

+ 0 - 1
u8g2_font_5x7_mf.h

@@ -12,7 +12,6 @@
   BBX Build Mode: 2
   BBX Build Mode: 2
 */
 */
 
 
-
 const uint8_t u8g2_font_5x7_mf[1911] =
 const uint8_t u8g2_font_5x7_mf[1911] =
     "\277\2\3\2\3\3\1\1\4\5\7\0\377\6\377\6\0\1*\2r\7Z \5}}\36!\10}\255"
     "\277\2\3\2\3\3\1\1\4\5\7\0\377\6\377\6\0\1*\2r\7Z \5}}\36!\10}\255"
     "\260\35\312\1\42\11}\235R\22%\71\3#\13}\355$\31\224\312\240\224\1$\11}\355\245\266%\311"
     "\260\35\312\1\42\11}\235R\22%\71\3#\13}\355$\31\224\312\240\224\1$\11}\355\245\266%\311"

+ 81 - 339
views/boilerplate_scene_1.c

@@ -8,272 +8,60 @@
 extern const uint8_t u8g2_font_5x7_mf[1911]; // Declare as extern
 extern const uint8_t u8g2_font_5x7_mf[1911]; // Declare as extern
 
 
 const uint8_t _I_DolphinCommon_56x48_0[] = {
 const uint8_t _I_DolphinCommon_56x48_0[] = {
-    0x01,
-    0x00,
-    0xdf,
-    0x00,
-    0x00,
-    0x1f,
-    0xfe,
-    0x0e,
-    0x05,
-    0x3f,
-    0x04,
-    0x06,
-    0x78,
-    0x06,
-    0x30,
-    0x20,
-    0xf8,
-    0x00,
-    0xc6,
-    0x12,
-    0x1c,
-    0x04,
-    0x0c,
-    0x0a,
-    0x38,
-    0x08,
-    0x08,
-    0x0c,
-    0x60,
-    0xc0,
-    0x21,
-    0xe0,
-    0x04,
-    0x0a,
-    0x18,
-    0x02,
-    0x1b,
-    0x00,
-    0x18,
-    0xa3,
-    0x00,
-    0x21,
-    0x90,
-    0x01,
-    0x8a,
-    0x20,
-    0x02,
-    0x19,
-    0x80,
-    0x18,
-    0x80,
-    0x64,
-    0x09,
-    0x20,
-    0x89,
-    0x81,
-    0x8c,
-    0x3e,
-    0x41,
-    0xe2,
-    0x80,
-    0x50,
-    0x00,
-    0x43,
-    0x08,
-    0x01,
-    0x0c,
-    0xfc,
-    0x68,
-    0x40,
-    0x61,
-    0xc0,
-    0x50,
-    0x30,
-    0x00,
-    0x63,
-    0xa0,
-    0x7f,
-    0x80,
-    0xc4,
-    0x41,
-    0x19,
-    0x07,
-    0xff,
-    0x02,
-    0x06,
-    0x18,
-    0x24,
-    0x03,
-    0x41,
-    0xf3,
-    0x2b,
-    0x10,
-    0x19,
-    0x38,
-    0x10,
-    0x30,
-    0x31,
-    0x7f,
-    0xe0,
-    0x34,
-    0x08,
-    0x30,
-    0x19,
-    0x60,
-    0x80,
-    0x65,
-    0x86,
-    0x0a,
-    0x4c,
-    0x0c,
-    0x30,
-    0x81,
-    0xb9,
-    0x41,
-    0xa0,
-    0x54,
-    0x08,
-    0xc7,
-    0xe2,
-    0x06,
-    0x8a,
-    0x18,
-    0x25,
-    0x02,
-    0x21,
-    0x0f,
-    0x19,
-    0x88,
-    0xd8,
-    0x6e,
-    0x1b,
-    0x01,
-    0xd1,
-    0x1b,
-    0x86,
-    0x39,
-    0x66,
-    0x3a,
-    0xa4,
-    0x1a,
-    0x50,
-    0x06,
-    0x48,
-    0x18,
-    0x18,
-    0xd0,
-    0x03,
-    0x01,
-    0x41,
-    0x98,
-    0xcc,
-    0x60,
-    0x39,
-    0x01,
-    0x49,
-    0x2d,
-    0x06,
-    0x03,
-    0x50,
-    0xf8,
-    0x40,
-    0x3e,
-    0x02,
-    0xc1,
-    0x82,
-    0x86,
-    0xc7,
-    0xfe,
-    0x0f,
-    0x28,
-    0x2c,
-    0x91,
-    0xd2,
-    0x90,
-    0x9a,
-    0x18,
-    0x19,
-    0x3e,
-    0x6d,
-    0x73,
-    0x12,
-    0x16,
-    0x00,
-    0x32,
-    0x49,
-    0x72,
-    0xc0,
-    0x7e,
-    0x5d,
-    0x44,
-    0xba,
-    0x2c,
-    0x08,
-    0xa4,
-    0xc8,
-    0x82,
-    0x06,
-    0x17,
-    0xe0,
-    0x81,
-    0x90,
-    0x2a,
-    0x40,
-    0x61,
-    0xe1,
-    0xa2,
-    0x44,
-    0x0c,
-    0x76,
-    0x2b,
-    0xe8,
-    0x89,
-    0x26,
-    0x43,
-    0x83,
-    0x31,
-    0x8c,
-    0x78,
-    0x0c,
-    0xb0,
-    0x48,
-    0x10,
-    0x1a,
-    0xe0,
-    0x00,
-    0x63,
+    0x01, 0x00, 0xdf, 0x00, 0x00, 0x1f, 0xfe, 0x0e, 0x05, 0x3f, 0x04, 0x06, 0x78, 0x06, 0x30, 0x20,
+    0xf8, 0x00, 0xc6, 0x12, 0x1c, 0x04, 0x0c, 0x0a, 0x38, 0x08, 0x08, 0x0c, 0x60, 0xc0, 0x21, 0xe0,
+    0x04, 0x0a, 0x18, 0x02, 0x1b, 0x00, 0x18, 0xa3, 0x00, 0x21, 0x90, 0x01, 0x8a, 0x20, 0x02, 0x19,
+    0x80, 0x18, 0x80, 0x64, 0x09, 0x20, 0x89, 0x81, 0x8c, 0x3e, 0x41, 0xe2, 0x80, 0x50, 0x00, 0x43,
+    0x08, 0x01, 0x0c, 0xfc, 0x68, 0x40, 0x61, 0xc0, 0x50, 0x30, 0x00, 0x63, 0xa0, 0x7f, 0x80, 0xc4,
+    0x41, 0x19, 0x07, 0xff, 0x02, 0x06, 0x18, 0x24, 0x03, 0x41, 0xf3, 0x2b, 0x10, 0x19, 0x38, 0x10,
+    0x30, 0x31, 0x7f, 0xe0, 0x34, 0x08, 0x30, 0x19, 0x60, 0x80, 0x65, 0x86, 0x0a, 0x4c, 0x0c, 0x30,
+    0x81, 0xb9, 0x41, 0xa0, 0x54, 0x08, 0xc7, 0xe2, 0x06, 0x8a, 0x18, 0x25, 0x02, 0x21, 0x0f, 0x19,
+    0x88, 0xd8, 0x6e, 0x1b, 0x01, 0xd1, 0x1b, 0x86, 0x39, 0x66, 0x3a, 0xa4, 0x1a, 0x50, 0x06, 0x48,
+    0x18, 0x18, 0xd0, 0x03, 0x01, 0x41, 0x98, 0xcc, 0x60, 0x39, 0x01, 0x49, 0x2d, 0x06, 0x03, 0x50,
+    0xf8, 0x40, 0x3e, 0x02, 0xc1, 0x82, 0x86, 0xc7, 0xfe, 0x0f, 0x28, 0x2c, 0x91, 0xd2, 0x90, 0x9a,
+    0x18, 0x19, 0x3e, 0x6d, 0x73, 0x12, 0x16, 0x00, 0x32, 0x49, 0x72, 0xc0, 0x7e, 0x5d, 0x44, 0xba,
+    0x2c, 0x08, 0xa4, 0xc8, 0x82, 0x06, 0x17, 0xe0, 0x81, 0x90, 0x2a, 0x40, 0x61, 0xe1, 0xa2, 0x44,
+    0x0c, 0x76, 0x2b, 0xe8, 0x89, 0x26, 0x43, 0x83, 0x31, 0x8c, 0x78, 0x0c, 0xb0, 0x48, 0x10, 0x1a,
+    0xe0, 0x00, 0x63,
 };
 };
-const uint8_t *const _I_DolphinCommon_56x48[] = {_I_DolphinCommon_56x48_0};
-const Icon I_DolphinCommon_56x48 = {.width = 56, .height = 48, .frame_count = 1, .frame_rate = 0, .frames = _I_DolphinCommon_56x48};
-
-struct BoilerplateScene1
-{
-    View *view;
+const uint8_t* const _I_DolphinCommon_56x48[] = {_I_DolphinCommon_56x48_0};
+const Icon I_DolphinCommon_56x48 = {
+    .width = 56,
+    .height = 48,
+    .frame_count = 1,
+    .frame_rate = 0,
+    .frames = _I_DolphinCommon_56x48};
+
+struct BoilerplateScene1 {
+    View* view;
     BoilerplateScene1Callback callback;
     BoilerplateScene1Callback callback;
-    void *context;
+    void* context;
 };
 };
 
 
-typedef struct
-{
-    BoilerplateScene1 *instance;
+typedef struct {
+    BoilerplateScene1* instance;
 } BoilerplateScene1Model;
 } BoilerplateScene1Model;
 
 
 void boilerplate_scene_1_set_callback(
 void boilerplate_scene_1_set_callback(
-    BoilerplateScene1 *instance,
+    BoilerplateScene1* instance,
     BoilerplateScene1Callback callback,
     BoilerplateScene1Callback callback,
-    void *context)
-{
+    void* context) {
     furi_assert(instance);
     furi_assert(instance);
     furi_assert(callback);
     furi_assert(callback);
     instance->callback = callback;
     instance->callback = callback;
     instance->context = context;
     instance->context = context;
 }
 }
 
 
-void boilerplate_scene_1_draw(Canvas *canvas, BoilerplateScene1Model *model)
-{
+void boilerplate_scene_1_draw(Canvas* canvas, BoilerplateScene1Model* model) {
     UNUSED(model);
     UNUSED(model);
-    BoilerplateScene1 *instance = model->instance;
-    Boilerplate *app = instance->context;
+    BoilerplateScene1* instance = model->instance;
+    Boilerplate* app = instance->context;
     canvas_clear(canvas);
     canvas_clear(canvas);
     // Prepare canvas
     // Prepare canvas
     canvas_set_color(canvas, ColorBlack);
     canvas_set_color(canvas, ColorBlack);
     canvas_draw_frame(canvas, 0, 0, FRAME_WIDTH, FRAME_HEIGTH);
     canvas_draw_frame(canvas, 0, 0, FRAME_WIDTH, FRAME_HEIGTH);
 
 
-    if (app->show_instructions)
-    {
+    if(app->show_instructions) {
         canvas_draw_icon(canvas, 71, 15, &I_DolphinCommon_56x48);
         canvas_draw_icon(canvas, 71, 15, &I_DolphinCommon_56x48);
         canvas_set_font(canvas, FontSecondary);
         canvas_set_font(canvas, FontSecondary);
         canvas_draw_str_aligned(canvas, (128 / 2), 4, AlignCenter, AlignTop, "INSTRUCTIONS");
         canvas_draw_str_aligned(canvas, (128 / 2), 4, AlignCenter, AlignTop, "INSTRUCTIONS");
@@ -281,36 +69,29 @@ void boilerplate_scene_1_draw(Canvas *canvas, BoilerplateScene1Model *model)
         canvas_set_custom_u8g2_font(canvas, u8g2_font_5x7_mf); // 5x7 font, 9 lines
         canvas_set_custom_u8g2_font(canvas, u8g2_font_5x7_mf); // 5x7 font, 9 lines
 
 
         canvas_draw_icon_ex(canvas, 15, 18, &I_arrow_13x6, IconRotation180); // DOWN
         canvas_draw_icon_ex(canvas, 15, 18, &I_arrow_13x6, IconRotation180); // DOWN
-        canvas_draw_icon(canvas, 28, 18, &I_arrow_13x6);                     // UP
+        canvas_draw_icon(canvas, 28, 18, &I_arrow_13x6); // UP
         canvas_draw_str_aligned(canvas, 47, 21, AlignLeft, AlignCenter, "SCROLL");
         canvas_draw_str_aligned(canvas, 47, 21, AlignLeft, AlignCenter, "SCROLL");
         canvas_draw_icon_ex(canvas, 33, 26, &I_arrow_13x6, IconRotation270); // PREV
         canvas_draw_icon_ex(canvas, 33, 26, &I_arrow_13x6, IconRotation270); // PREV
-        canvas_draw_icon_ex(canvas, 22, 36, &I_arrow_13x6, IconRotation90);  // NEXT
+        canvas_draw_icon_ex(canvas, 22, 36, &I_arrow_13x6, IconRotation90); // NEXT
         canvas_draw_str_aligned(canvas, 47, 32, AlignLeft, AlignCenter, "LEFT");
         canvas_draw_str_aligned(canvas, 47, 32, AlignLeft, AlignCenter, "LEFT");
         canvas_draw_str_aligned(canvas, 47, 43, AlignLeft, AlignCenter, "RIGHT");
         canvas_draw_str_aligned(canvas, 47, 43, AlignLeft, AlignCenter, "RIGHT");
 
 
         canvas_set_font(canvas, FontPrimary);
         canvas_set_font(canvas, FontPrimary);
         elements_button_center(canvas, "OK");
         elements_button_center(canvas, "OK");
-    }
-    else
-    {
+    } else {
         int count = (app->page + 1) * 0x1000;
         int count = (app->page + 1) * 0x1000;
         uint8_t status = app->scratchpad1[0x11B2 + app->page];
         uint8_t status = app->scratchpad1[0x11B2 + app->page];
 
 
         storage_file_seek(app->camera_ram_sav, count, true);
         storage_file_seek(app->camera_ram_sav, count, true);
 
 
-        for (int y = app->pos_y; y < 14; y++)
-        {
-            for (int x = app->pos_x; x < 16; x++)
-            {
+        for(int y = app->pos_y; y < 14; y++) {
+            for(int x = app->pos_x; x < 16; x++) {
                 storage_file_read(app->camera_ram_sav, app->tile_data, sizeof(app->tile_data));
                 storage_file_read(app->camera_ram_sav, app->tile_data, sizeof(app->tile_data));
-                for (int row = 0; row < 8; row++)
-                {
+                for(int row = 0; row < 8; row++) {
                     uint8_t temp1 = app->tile_data[row * 2];
                     uint8_t temp1 = app->tile_data[row * 2];
                     uint8_t temp2 = app->tile_data[row * 2 + 1];
                     uint8_t temp2 = app->tile_data[row * 2 + 1];
-                    for (int pixel = 7; pixel >= 0; pixel--)
-                    {
-                        if (((temp1 & 1) + ((temp2 & 1) * 2)) >= 2)
-                        {
+                    for(int pixel = 7; pixel >= 0; pixel--) {
+                        if(((temp1 & 1) + ((temp2 & 1) * 2)) >= 2) {
                             canvas_draw_dot(canvas, (x * 8) + pixel, (y * 8) + row);
                             canvas_draw_dot(canvas, (x * 8) + pixel, (y * 8) + row);
                         }
                         }
                         temp1 >>= 1;
                         temp1 >>= 1;
@@ -320,10 +101,8 @@ void boilerplate_scene_1_draw(Canvas *canvas, BoilerplateScene1Model *model)
             }
             }
         }
         }
 
 
-        if (app->info)
-        {
-            if (status == 0xFF)
-            {
+        if(app->info) {
+            if(status == 0xFF) {
                 canvas_draw_rbox(canvas, 100, 4, 20, 11, 4);
                 canvas_draw_rbox(canvas, 100, 4, 20, 11, 4);
                 canvas_invert_color(canvas);
                 canvas_invert_color(canvas);
                 canvas_draw_str_aligned(canvas, 110, 10, AlignCenter, AlignCenter, "D");
                 canvas_draw_str_aligned(canvas, 110, 10, AlignCenter, AlignCenter, "D");
@@ -333,43 +112,38 @@ void boilerplate_scene_1_draw(Canvas *canvas, BoilerplateScene1Model *model)
     }
     }
 }
 }
 
 
-static void boilerplate_scene_1_model_init(BoilerplateScene1Model *const model, void *context)
-{
-    BoilerplateScene1 *instance = context;
+static void boilerplate_scene_1_model_init(BoilerplateScene1Model* const model, void* context) {
+    BoilerplateScene1* instance = context;
     UNUSED(model);
     UNUSED(model);
     UNUSED(instance);
     UNUSED(instance);
     model->instance = context;
     model->instance = context;
 }
 }
 
 
-void save_image(void *context)
-{
-    Boilerplate *app = context;
+void save_image(void* context) {
+    Boilerplate* app = context;
     furi_assert(app);
     furi_assert(app);
-    NotificationApp *notifications = furi_record_open(RECORD_NOTIFICATION);
+    NotificationApp* notifications = furi_record_open(RECORD_NOTIFICATION);
 
 
     //  Create MALVEKE dir
     //  Create MALVEKE dir
-    if (storage_common_stat(app->storage, MALVEKE_APP_FOLDER, NULL) == FSE_NOT_EXIST)
-    {
+    if(storage_common_stat(app->storage, MALVEKE_APP_FOLDER, NULL) == FSE_NOT_EXIST) {
         storage_simply_mkdir(app->storage, MALVEKE_APP_FOLDER);
         storage_simply_mkdir(app->storage, MALVEKE_APP_FOLDER);
     }
     }
     //  Create MALVEKE Photos dir
     //  Create MALVEKE Photos dir
-    if (storage_common_stat(app->storage, MALVEKE_APP_FOLDER_PHOTOS, NULL) == FSE_NOT_EXIST)
-    {
+    if(storage_common_stat(app->storage, MALVEKE_APP_FOLDER_PHOTOS, NULL) == FSE_NOT_EXIST) {
         storage_simply_mkdir(app->storage, MALVEKE_APP_FOLDER_PHOTOS);
         storage_simply_mkdir(app->storage, MALVEKE_APP_FOLDER_PHOTOS);
     }
     }
 
 
     int count = (app->page + 1) * 0x1000;
     int count = (app->page + 1) * 0x1000;
     storage_file_seek(app->camera_ram_sav, count, true);
     storage_file_seek(app->camera_ram_sav, count, true);
     // create file name
     // create file name
-    FuriString *file_name = furi_string_alloc();
+    FuriString* file_name = furi_string_alloc();
     get_timefilename(file_name, app->page);
     get_timefilename(file_name, app->page);
 
 
-    File *file = storage_file_alloc(app->storage);
+    File* file = storage_file_alloc(app->storage);
     bool result =
     bool result =
         storage_file_open(file, furi_string_get_cstr(file_name), FSAM_WRITE, FSOM_OPEN_ALWAYS);
         storage_file_open(file, furi_string_get_cstr(file_name), FSAM_WRITE, FSOM_OPEN_ALWAYS);
 
 
-    if (result)
-    {
+    if(result) {
         static char bmp[BMP_SIZE(WIDTH, HEIGHT)];
         static char bmp[BMP_SIZE(WIDTH, HEIGHT)];
         bmp_init(bmp, WIDTH, HEIGHT);
         bmp_init(bmp, WIDTH, HEIGHT);
 
 
@@ -382,18 +156,14 @@ void save_image(void *context)
 
 
         UNUSED(palette);
         UNUSED(palette);
 
 
-        for (int y = 0; y < 14; y++)
-        {
-            for (int x = 0; x < 16; x++)
-            {
+        for(int y = 0; y < 14; y++) {
+            for(int x = 0; x < 16; x++) {
                 storage_file_read(app->camera_ram_sav, app->tile_data, sizeof(app->tile_data));
                 storage_file_read(app->camera_ram_sav, app->tile_data, sizeof(app->tile_data));
-                for (int row = 0; row < 8; row++)
-                {
+                for(int row = 0; row < 8; row++) {
                     uint8_t temp1 = app->tile_data[row * 2];
                     uint8_t temp1 = app->tile_data[row * 2];
                     uint8_t temp2 = app->tile_data[row * 2 + 1];
                     uint8_t temp2 = app->tile_data[row * 2 + 1];
 
 
-                    for (int pixel = 7; pixel >= 0; pixel--)
-                    {
+                    for(int pixel = 7; pixel >= 0; pixel--) {
                         bmp_set(
                         bmp_set(
                             bmp,
                             bmp,
                             (x * 8) + pixel,
                             (x * 8) + pixel,
@@ -416,15 +186,12 @@ void save_image(void *context)
     storage_file_free(file);
     storage_file_free(file);
     notification_message(notifications, result ? &sequence_success : &sequence_error);
     notification_message(notifications, result ? &sequence_success : &sequence_error);
 }
 }
-bool boilerplate_scene_1_input(InputEvent *event, void *context)
-{
+bool boilerplate_scene_1_input(InputEvent* event, void* context) {
     furi_assert(context);
     furi_assert(context);
-    BoilerplateScene1 *instance = context;
-    Boilerplate *app = instance->context;
-    if (event->type == InputTypeRelease)
-    {
-        switch (event->key)
-        {
+    BoilerplateScene1* instance = context;
+    Boilerplate* app = instance->context;
+    if(event->type == InputTypeRelease) {
+        switch(event->key) {
         case InputKeyBack:
         case InputKeyBack:
             with_view_model(
             with_view_model(
                 instance->view,
                 instance->view,
@@ -444,12 +211,9 @@ bool boilerplate_scene_1_input(InputEvent *event, void *context)
                     app->pos_y = 0;
                     app->pos_y = 0;
                     app->pos_x = 0;
                     app->pos_x = 0;
 
 
-                    if (app->page > 0)
-                    {
+                    if(app->page > 0) {
                         app->page--;
                         app->page--;
-                    }
-                    else
-                    {
+                    } else {
                         app->page = 29;
                         app->page = 29;
                     }
                     }
                 },
                 },
@@ -463,12 +227,9 @@ bool boilerplate_scene_1_input(InputEvent *event, void *context)
                     UNUSED(model);
                     UNUSED(model);
                     app->pos_y = 0;
                     app->pos_y = 0;
                     app->pos_x = 0;
                     app->pos_x = 0;
-                    if (app->page < 29)
-                    {
+                    if(app->page < 29) {
                         app->page++;
                         app->page++;
-                    }
-                    else
-                    {
+                    } else {
                         app->page = 0;
                         app->page = 0;
                     }
                     }
                 },
                 },
@@ -480,8 +241,7 @@ bool boilerplate_scene_1_input(InputEvent *event, void *context)
                 BoilerplateScene1Model * model,
                 BoilerplateScene1Model * model,
                 {
                 {
                     UNUSED(model);
                     UNUSED(model);
-                    if (app->pos_y < 0)
-                    {
+                    if(app->pos_y < 0) {
                         app->pos_y++;
                         app->pos_y++;
                     }
                     }
                 },
                 },
@@ -493,8 +253,7 @@ bool boilerplate_scene_1_input(InputEvent *event, void *context)
                 BoilerplateScene1Model * model,
                 BoilerplateScene1Model * model,
                 {
                 {
                     UNUSED(model);
                     UNUSED(model);
-                    if (app->pos_y > -6)
-                    {
+                    if(app->pos_y > -6) {
                         app->pos_y--;
                         app->pos_y--;
                     }
                     }
                 },
                 },
@@ -506,12 +265,9 @@ bool boilerplate_scene_1_input(InputEvent *event, void *context)
                 BoilerplateScene1Model * model,
                 BoilerplateScene1Model * model,
                 {
                 {
                     UNUSED(model);
                     UNUSED(model);
-                    if (app->show_instructions)
-                    {
+                    if(app->show_instructions) {
                         app->show_instructions = false;
                         app->show_instructions = false;
-                    }
-                    else
-                    {
+                    } else {
                         save_image(app);
                         save_image(app);
                     }
                     }
                 },
                 },
@@ -524,28 +280,23 @@ bool boilerplate_scene_1_input(InputEvent *event, void *context)
     return true;
     return true;
 }
 }
 
 
-void boilerplate_scene_1_exit(void *context)
-{
+void boilerplate_scene_1_exit(void* context) {
     furi_assert(context);
     furi_assert(context);
 }
 }
 
 
-void boilerplate_scene_1_enter(void *context)
-{
+void boilerplate_scene_1_enter(void* context) {
     furi_assert(context);
     furi_assert(context);
-    BoilerplateScene1 *instance = (BoilerplateScene1 *)context;
+    BoilerplateScene1* instance = (BoilerplateScene1*)context;
 
 
     with_view_model(
     with_view_model(
         instance->view,
         instance->view,
         BoilerplateScene1Model * model,
         BoilerplateScene1Model * model,
-        {
-            boilerplate_scene_1_model_init(model, instance);
-        },
+        { boilerplate_scene_1_model_init(model, instance); },
         true);
         true);
 }
 }
 
 
-BoilerplateScene1 *boilerplate_scene_1_alloc()
-{
-    BoilerplateScene1 *instance = malloc(sizeof(BoilerplateScene1));
+BoilerplateScene1* boilerplate_scene_1_alloc() {
+    BoilerplateScene1* instance = malloc(sizeof(BoilerplateScene1));
     instance->view = view_alloc();
     instance->view = view_alloc();
     view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(BoilerplateScene1Model));
     view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(BoilerplateScene1Model));
     view_set_context(instance->view, instance); // furi_assert crashes in events without this
     view_set_context(instance->view, instance); // furi_assert crashes in events without this
@@ -557,31 +308,22 @@ BoilerplateScene1 *boilerplate_scene_1_alloc()
     with_view_model(
     with_view_model(
         instance->view,
         instance->view,
         BoilerplateScene1Model * model,
         BoilerplateScene1Model * model,
-        {
-            boilerplate_scene_1_model_init(model, instance);
-        },
+        { boilerplate_scene_1_model_init(model, instance); },
         true);
         true);
 
 
     return instance;
     return instance;
 }
 }
 
 
-void boilerplate_scene_1_free(BoilerplateScene1 *instance)
-{
+void boilerplate_scene_1_free(BoilerplateScene1* instance) {
     furi_assert(instance);
     furi_assert(instance);
 
 
     with_view_model(
     with_view_model(
-        instance->view,
-        BoilerplateScene1Model * model,
-        {
-            UNUSED(model);
-        },
-        true);
+        instance->view, BoilerplateScene1Model * model, { UNUSED(model); }, true);
     view_free(instance->view);
     view_free(instance->view);
     free(instance);
     free(instance);
 }
 }
 
 
-View *boilerplate_scene_1_get_view(BoilerplateScene1 *instance)
-{
+View* boilerplate_scene_1_get_view(BoilerplateScene1* instance) {
     furi_assert(instance);
     furi_assert(instance);
     return instance->view;
     return instance->view;
 }
 }

+ 2 - 2
views/boilerplate_scene_1.h

@@ -8,8 +8,8 @@
 #include "../helpers/bmp.h"
 #include "../helpers/bmp.h"
 #include "../helpers/malveke_photo.h"
 #include "../helpers/malveke_photo.h"
 
 
-#define WIDTH   128L
-#define HEIGHT  112L
+#define WIDTH 128L
+#define HEIGHT 112L
 
 
 #define FRAME_WIDTH 128
 #define FRAME_WIDTH 128
 #define FRAME_HEIGTH 64
 #define FRAME_HEIGTH 64

+ 66 - 99
views/boilerplate_scene_2.c

@@ -5,64 +5,59 @@
 #include <gui/elements.h>
 #include <gui/elements.h>
 #include <dolphin/dolphin.h>
 #include <dolphin/dolphin.h>
 
 
-struct BoilerplateScene2
-{
-    View *view;
+struct BoilerplateScene2 {
+    View* view;
     BoilerplateScene2Callback callback;
     BoilerplateScene2Callback callback;
-    void *context;
+    void* context;
 };
 };
 
 
-typedef struct
-{
+typedef struct {
     bool in_progress;
     bool in_progress;
     int page;
     int page;
-    BoilerplateScene2 *instance;
+    BoilerplateScene2* instance;
 } BoilerplateScene2Model;
 } BoilerplateScene2Model;
 
 
 void boilerplate_scene_2_set_callback(
 void boilerplate_scene_2_set_callback(
-    BoilerplateScene2 *instance,
+    BoilerplateScene2* instance,
     BoilerplateScene2Callback callback,
     BoilerplateScene2Callback callback,
-    void *context)
-{
+    void* context) {
     furi_assert(instance);
     furi_assert(instance);
     furi_assert(callback);
     furi_assert(callback);
     instance->callback = callback;
     instance->callback = callback;
     instance->context = context;
     instance->context = context;
 }
 }
 
 
-void draw_thumbnail(void *context, Canvas *canvas, int page){
-    BoilerplateScene2 *instance = context;
-    Boilerplate *app = instance->context;
+void draw_thumbnail(void* context, Canvas* canvas, int page) {
+    BoilerplateScene2* instance = context;
+    Boilerplate* app = instance->context;
     UNUSED(app);
     UNUSED(app);
     //  Gallery
     //  Gallery
     // for (int s=0;s< 8 * (page+1);s++) {
     // for (int s=0;s< 8 * (page+1);s++) {
-        int count = ((page + 2) * 0x1000) + 0x0e00;
-        storage_file_seek(app->camera_ram_sav, count, true);
-        for (int y = 0; y < 4; y++) {
-            for (int x = 0; x < 4; x++) {
-
-                storage_file_read(app->camera_ram_sav, app->tile_data, sizeof(app->tile_data));
-                for (int row = 0; row < 8; row++) {
-                    uint8_t temp1 = app->tile_data[row * 2];
-                    uint8_t temp2 = app->tile_data[row * 2 + 1];
-                    for (int pixel = 7; pixel >= 0; pixel--) {
-                        int colorIndex = ((temp1 & 1)+((temp2 & 1)*2));
-                        if (colorIndex >=2) {
-                            canvas_draw_dot(canvas, (x*8)+ (pixel+47), (y*8)+row+17);
-                        }
-                        temp1 >>= 1;
-                        temp2 >>= 1;
+    int count = ((page + 2) * 0x1000) + 0x0e00;
+    storage_file_seek(app->camera_ram_sav, count, true);
+    for(int y = 0; y < 4; y++) {
+        for(int x = 0; x < 4; x++) {
+            storage_file_read(app->camera_ram_sav, app->tile_data, sizeof(app->tile_data));
+            for(int row = 0; row < 8; row++) {
+                uint8_t temp1 = app->tile_data[row * 2];
+                uint8_t temp2 = app->tile_data[row * 2 + 1];
+                for(int pixel = 7; pixel >= 0; pixel--) {
+                    int colorIndex = ((temp1 & 1) + ((temp2 & 1) * 2));
+                    if(colorIndex >= 2) {
+                        canvas_draw_dot(canvas, (x * 8) + (pixel + 47), (y * 8) + row + 17);
                     }
                     }
+                    temp1 >>= 1;
+                    temp2 >>= 1;
                 }
                 }
             }
             }
         }
         }
+    }
     // }
     // }
 }
 }
-void boilerplate_scene_2_draw(Canvas *canvas, BoilerplateScene2Model *model)
-{
+void boilerplate_scene_2_draw(Canvas* canvas, BoilerplateScene2Model* model) {
     UNUSED(model);
     UNUSED(model);
-    BoilerplateScene2 *instance = model->instance;
-    Boilerplate *app = instance->context;
+    BoilerplateScene2* instance = model->instance;
+    Boilerplate* app = instance->context;
     UNUSED(app);
     UNUSED(app);
     canvas_clear(canvas);
     canvas_clear(canvas);
     canvas_set_color(canvas, ColorBlack);
     canvas_set_color(canvas, ColorBlack);
@@ -74,63 +69,57 @@ void boilerplate_scene_2_draw(Canvas *canvas, BoilerplateScene2Model *model)
     snprintf(totalText, sizeof(totalText), "%02d/29", model->page);
     snprintf(totalText, sizeof(totalText), "%02d/29", model->page);
 
 
     draw_thumbnail(instance, canvas, model->page);
     draw_thumbnail(instance, canvas, model->page);
-    if (!model->in_progress)
-    {
-        
+    if(!model->in_progress) {
         elements_button_center(canvas, "OK");
         elements_button_center(canvas, "OK");
-    }
-    else
-    {
+    } else {
         float dict_progress = (float)(model->page * 1) / (float)(29);
         float dict_progress = (float)(model->page * 1) / (float)(29);
         int progress_width = 128 / 2;
         int progress_width = 128 / 2;
         int position_x = (128 / 2);
         int position_x = (128 / 2);
         int position_y = 52;
         int position_y = 52;
-        elements_progress_bar_with_text(canvas, position_x - (progress_width / 2), position_y, progress_width, dict_progress, totalText);
+        elements_progress_bar_with_text(
+            canvas,
+            position_x - (progress_width / 2),
+            position_y,
+            progress_width,
+            dict_progress,
+            totalText);
     }
     }
 }
 }
 
 
-static void boilerplate_scene_2_model_init(BoilerplateScene2Model *const model, void *context)
-{
-    BoilerplateScene2 *instance = context;
+static void boilerplate_scene_2_model_init(BoilerplateScene2Model* const model, void* context) {
+    BoilerplateScene2* instance = context;
     model->instance = instance;
     model->instance = instance;
     model->page = 0;
     model->page = 0;
     model->in_progress = false;
     model->in_progress = false;
 }
 }
-void save_all_image(void *context)
-{
-    BoilerplateScene2 *instance = context;
-    Boilerplate *app = instance->context;
+void save_all_image(void* context) {
+    BoilerplateScene2* instance = context;
+    Boilerplate* app = instance->context;
     UNUSED(app);
     UNUSED(app);
     furi_assert(app);
     furi_assert(app);
-    NotificationApp *notifications = furi_record_open(RECORD_NOTIFICATION);
+    NotificationApp* notifications = furi_record_open(RECORD_NOTIFICATION);
 
 
     //  Create MALVEKE dir
     //  Create MALVEKE dir
-    if (storage_common_stat(app->storage, MALVEKE_APP_FOLDER, NULL) == FSE_NOT_EXIST)
-    {
+    if(storage_common_stat(app->storage, MALVEKE_APP_FOLDER, NULL) == FSE_NOT_EXIST) {
         storage_simply_mkdir(app->storage, MALVEKE_APP_FOLDER);
         storage_simply_mkdir(app->storage, MALVEKE_APP_FOLDER);
     }
     }
     //  Create MALVEKE Photos dir
     //  Create MALVEKE Photos dir
-    if (storage_common_stat(app->storage, MALVEKE_APP_FOLDER_PHOTOS, NULL) == FSE_NOT_EXIST)
-    {
+    if(storage_common_stat(app->storage, MALVEKE_APP_FOLDER_PHOTOS, NULL) == FSE_NOT_EXIST) {
         storage_simply_mkdir(app->storage, MALVEKE_APP_FOLDER_PHOTOS);
         storage_simply_mkdir(app->storage, MALVEKE_APP_FOLDER_PHOTOS);
     }
     }
 
 
-    for (int page = 0; page < 30; page++)
-    {
-
+    for(int page = 0; page < 30; page++) {
         int count = (page + 1) * 0x1000;
         int count = (page + 1) * 0x1000;
         storage_file_seek(app->camera_ram_sav, count, true);
         storage_file_seek(app->camera_ram_sav, count, true);
         // create file name
         // create file name
-        FuriString *file_name = furi_string_alloc();
+        FuriString* file_name = furi_string_alloc();
         get_timefilename(file_name, page);
         get_timefilename(file_name, page);
 
 
-        File *file = storage_file_alloc(app->storage);
+        File* file = storage_file_alloc(app->storage);
         bool result =
         bool result =
             storage_file_open(file, furi_string_get_cstr(file_name), FSAM_WRITE, FSOM_OPEN_ALWAYS);
             storage_file_open(file, furi_string_get_cstr(file_name), FSAM_WRITE, FSOM_OPEN_ALWAYS);
 
 
-        if (result)
-        {
-
+        if(result) {
             static char bmp[BMP_SIZE(WIDTH, HEIGHT)];
             static char bmp[BMP_SIZE(WIDTH, HEIGHT)];
             bmp_init(bmp, WIDTH, HEIGHT);
             bmp_init(bmp, WIDTH, HEIGHT);
 
 
@@ -143,18 +132,14 @@ void save_all_image(void *context)
 
 
             UNUSED(palette);
             UNUSED(palette);
 
 
-            for (int y = 0; y < 14; y++)
-            {
-                for (int x = 0; x < 16; x++)
-                {
+            for(int y = 0; y < 14; y++) {
+                for(int x = 0; x < 16; x++) {
                     storage_file_read(app->camera_ram_sav, app->tile_data, sizeof(app->tile_data));
                     storage_file_read(app->camera_ram_sav, app->tile_data, sizeof(app->tile_data));
-                    for (int row = 0; row < 8; row++)
-                    {
+                    for(int row = 0; row < 8; row++) {
                         uint8_t temp1 = app->tile_data[row * 2];
                         uint8_t temp1 = app->tile_data[row * 2];
                         uint8_t temp2 = app->tile_data[row * 2 + 1];
                         uint8_t temp2 = app->tile_data[row * 2 + 1];
 
 
-                        for (int pixel = 7; pixel >= 0; pixel--)
-                        {
+                        for(int pixel = 7; pixel >= 0; pixel--) {
                             bmp_set(
                             bmp_set(
                                 bmp,
                                 bmp,
                                 (x * 8) + pixel,
                                 (x * 8) + pixel,
@@ -187,30 +172,20 @@ void save_all_image(void *context)
     }
     }
     notification_message(notifications, &sequence_success);
     notification_message(notifications, &sequence_success);
     with_view_model(
     with_view_model(
-        instance->view,
-        BoilerplateScene2Model * model,
-        {
-            model->in_progress = false;
-        },
-        true);
+        instance->view, BoilerplateScene2Model * model, { model->in_progress = false; }, true);
 }
 }
-bool boilerplate_scene_2_input(InputEvent *event, void *context)
-{
+bool boilerplate_scene_2_input(InputEvent* event, void* context) {
     furi_assert(context);
     furi_assert(context);
-    BoilerplateScene2 *instance = context;
+    BoilerplateScene2* instance = context;
     // Boilerplate *app = instance->context;
     // Boilerplate *app = instance->context;
 
 
-    if (event->type == InputTypeRelease)
-    {
-        switch (event->key)
-        {
+    if(event->type == InputTypeRelease) {
+        switch(event->key) {
         case InputKeyOk:
         case InputKeyOk:
             with_view_model(
             with_view_model(
                 instance->view,
                 instance->view,
                 BoilerplateScene2Model * model,
                 BoilerplateScene2Model * model,
-                {
-                    model->in_progress = true;
-                },
+                { model->in_progress = true; },
                 true);
                 true);
 
 
             save_all_image(instance);
             save_all_image(instance);
@@ -230,20 +205,16 @@ bool boilerplate_scene_2_input(InputEvent *event, void *context)
     return true;
     return true;
 }
 }
 
 
-void boilerplate_scene_2_exit(void *context)
-{
+void boilerplate_scene_2_exit(void* context) {
     furi_assert(context);
     furi_assert(context);
-    Boilerplate *app = context;
+    Boilerplate* app = context;
     UNUSED(app);
     UNUSED(app);
     // boilerplate_stop_all_sound(app);
     // boilerplate_stop_all_sound(app);
     // boilerplate_led_reset(app);
     // boilerplate_led_reset(app);
 }
 }
 
 
-
-
-BoilerplateScene2 *boilerplate_scene_2_alloc()
-{
-    BoilerplateScene2 *instance = malloc(sizeof(BoilerplateScene2));
+BoilerplateScene2* boilerplate_scene_2_alloc() {
+    BoilerplateScene2* instance = malloc(sizeof(BoilerplateScene2));
     instance->view = view_alloc();
     instance->view = view_alloc();
     view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(BoilerplateScene2Model));
     view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(BoilerplateScene2Model));
     view_set_context(instance->view, instance);
     view_set_context(instance->view, instance);
@@ -254,24 +225,20 @@ BoilerplateScene2 *boilerplate_scene_2_alloc()
     with_view_model(
     with_view_model(
         instance->view,
         instance->view,
         BoilerplateScene2Model * model,
         BoilerplateScene2Model * model,
-        {
-            boilerplate_scene_2_model_init(model, instance);
-        },
+        { boilerplate_scene_2_model_init(model, instance); },
         true);
         true);
 
 
     return instance;
     return instance;
 }
 }
 
 
-void boilerplate_scene_2_free(BoilerplateScene2 *instance)
-{
+void boilerplate_scene_2_free(BoilerplateScene2* instance) {
     furi_assert(instance);
     furi_assert(instance);
 
 
     view_free(instance->view);
     view_free(instance->view);
     free(instance);
     free(instance);
 }
 }
 
 
-View *boilerplate_scene_2_get_view(BoilerplateScene2 *instance)
-{
+View* boilerplate_scene_2_get_view(BoilerplateScene2* instance) {
     furi_assert(instance);
     furi_assert(instance);
 
 
     return instance->view;
     return instance->view;

+ 1 - 1
views/boilerplate_scene_2.h

@@ -13,7 +13,7 @@ typedef void (*BoilerplateScene2Callback)(BoilerplateCustomEvent event, void* co
 void boilerplate_scene_2_set_callback(
 void boilerplate_scene_2_set_callback(
     BoilerplateScene2* instance,
     BoilerplateScene2* instance,
     BoilerplateScene2Callback callback,
     BoilerplateScene2Callback callback,
-    void * context);
+    void* context);
 
 
 BoilerplateScene2* boilerplate_scene_2_alloc();
 BoilerplateScene2* boilerplate_scene_2_alloc();
 
 

+ 22 - 44
views/boilerplate_startscreen.c

@@ -6,31 +6,27 @@
 
 
 extern const uint8_t u8g2_font_5x7_mf[1911]; // Declare as extern
 extern const uint8_t u8g2_font_5x7_mf[1911]; // Declare as extern
 
 
-struct BoilerplateStartscreen
-{
-    View *view;
+struct BoilerplateStartscreen {
+    View* view;
     BoilerplateStartscreenCallback callback;
     BoilerplateStartscreenCallback callback;
-    void *context;
+    void* context;
 };
 };
 
 
-typedef struct
-{
+typedef struct {
     int some_value;
     int some_value;
 } BoilerplateStartscreenModel;
 } BoilerplateStartscreenModel;
 
 
 void boilerplate_startscreen_set_callback(
 void boilerplate_startscreen_set_callback(
-    BoilerplateStartscreen *instance,
+    BoilerplateStartscreen* instance,
     BoilerplateStartscreenCallback callback,
     BoilerplateStartscreenCallback callback,
-    void *context)
-{
+    void* context) {
     furi_assert(instance);
     furi_assert(instance);
     furi_assert(callback);
     furi_assert(callback);
     instance->callback = callback;
     instance->callback = callback;
     instance->context = context;
     instance->context = context;
 }
 }
 
 
-void boilerplate_startscreen_draw(Canvas *canvas, BoilerplateStartscreenModel *model)
-{
+void boilerplate_startscreen_draw(Canvas* canvas, BoilerplateStartscreenModel* model) {
     UNUSED(model);
     UNUSED(model);
     canvas_clear(canvas);
     canvas_clear(canvas);
     canvas_set_color(canvas, ColorBlack);
     canvas_set_color(canvas, ColorBlack);
@@ -43,19 +39,15 @@ void boilerplate_startscreen_draw(Canvas *canvas, BoilerplateStartscreenModel *m
     elements_button_center(canvas, "Start");
     elements_button_center(canvas, "Start");
 }
 }
 
 
-static void boilerplate_startscreen_model_init(BoilerplateStartscreenModel *const model)
-{
+static void boilerplate_startscreen_model_init(BoilerplateStartscreenModel* const model) {
     model->some_value = 1;
     model->some_value = 1;
 }
 }
 
 
-bool boilerplate_startscreen_input(InputEvent *event, void *context)
-{
+bool boilerplate_startscreen_input(InputEvent* event, void* context) {
     furi_assert(context);
     furi_assert(context);
-    BoilerplateStartscreen *instance = context;
-    if (event->type == InputTypeRelease)
-    {
-        switch (event->key)
-        {
+    BoilerplateStartscreen* instance = context;
+    if(event->type == InputTypeRelease) {
+        switch(event->key) {
         case InputKeyBack:
         case InputKeyBack:
             with_view_model(
             with_view_model(
                 instance->view,
                 instance->view,
@@ -80,27 +72,22 @@ bool boilerplate_startscreen_input(InputEvent *event, void *context)
     return true;
     return true;
 }
 }
 
 
-void boilerplate_startscreen_exit(void *context)
-{
+void boilerplate_startscreen_exit(void* context) {
     furi_assert(context);
     furi_assert(context);
 }
 }
 
 
-void boilerplate_startscreen_enter(void *context)
-{
+void boilerplate_startscreen_enter(void* context) {
     furi_assert(context);
     furi_assert(context);
-    BoilerplateStartscreen *instance = (BoilerplateStartscreen *)context;
+    BoilerplateStartscreen* instance = (BoilerplateStartscreen*)context;
     with_view_model(
     with_view_model(
         instance->view,
         instance->view,
         BoilerplateStartscreenModel * model,
         BoilerplateStartscreenModel * model,
-        {
-            boilerplate_startscreen_model_init(model);
-        },
+        { boilerplate_startscreen_model_init(model); },
         true);
         true);
 }
 }
 
 
-BoilerplateStartscreen *boilerplate_startscreen_alloc()
-{
-    BoilerplateStartscreen *instance = malloc(sizeof(BoilerplateStartscreen));
+BoilerplateStartscreen* boilerplate_startscreen_alloc() {
+    BoilerplateStartscreen* instance = malloc(sizeof(BoilerplateStartscreen));
     instance->view = view_alloc();
     instance->view = view_alloc();
     view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(BoilerplateStartscreenModel));
     view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(BoilerplateStartscreenModel));
     view_set_context(instance->view, instance); // furi_assert crashes in events without this
     view_set_context(instance->view, instance); // furi_assert crashes in events without this
@@ -109,30 +96,21 @@ BoilerplateStartscreen *boilerplate_startscreen_alloc()
     with_view_model(
     with_view_model(
         instance->view,
         instance->view,
         BoilerplateStartscreenModel * model,
         BoilerplateStartscreenModel * model,
-        {
-            boilerplate_startscreen_model_init(model);
-        },
+        { boilerplate_startscreen_model_init(model); },
         true);
         true);
 
 
     return instance;
     return instance;
 }
 }
 
 
-void boilerplate_startscreen_free(BoilerplateStartscreen *instance)
-{
+void boilerplate_startscreen_free(BoilerplateStartscreen* instance) {
     furi_assert(instance);
     furi_assert(instance);
     with_view_model(
     with_view_model(
-        instance->view,
-        BoilerplateStartscreenModel * model,
-        {
-            UNUSED(model);
-        },
-        true);
+        instance->view, BoilerplateStartscreenModel * model, { UNUSED(model); }, true);
     view_free(instance->view);
     view_free(instance->view);
     free(instance);
     free(instance);
 }
 }
 
 
-View *boilerplate_startscreen_get_view(BoilerplateStartscreen *instance)
-{
+View* boilerplate_startscreen_get_view(BoilerplateStartscreen* instance) {
     furi_assert(instance);
     furi_assert(instance);
     return instance->view;
     return instance->view;
 }
 }