diff --git a/Marlin/src/feature/Max7219_Debug_LEDs.cpp b/Marlin/src/feature/Max7219_Debug_LEDs.cpp index 9ba67d6caac3..ccdfb265c48c 100644 --- a/Marlin/src/feature/Max7219_Debug_LEDs.cpp +++ b/Marlin/src/feature/Max7219_Debug_LEDs.cpp @@ -455,15 +455,19 @@ void Max7219::register_setup() { #ifdef MAX7219_INIT_TEST #if MAX7219_INIT_TEST == 2 + #define MAX7219_LEDS (MAX7219_X_LEDS * MAX7219_Y_LEDS) + void Max7219::spiral(const bool on, const uint16_t del) { - constexpr int8_t way[] = { 1, 0, 0, 1, -1, 0, 0, -1 }; + constexpr int8_t way[][2] = { { 1, 0 }, { 0, 1 }, { -1, 0 }, { 0, -1 } }; int8_t px = 0, py = 0, dir = 0; - for (uint8_t i = MAX7219_X_LEDS * MAX7219_Y_LEDS; i--;) { + for (IF<(MAX7219_LEDS > 255), uint16_t, uint8_t>::type i = MAX7219_LEDS; i--;) { led_set(px, py, on); delay(del); - const int8_t x = px + way[dir], y = py + way[dir + 1]; - if (!WITHIN(x, 0, MAX7219_X_LEDS - 1) || !WITHIN(y, 0, MAX7219_Y_LEDS - 1) || BIT_7219(x, y) == on) dir = (dir + 2) & 0x7; - px += way[dir]; py += way[dir + 1]; + const int8_t x = px + way[dir][0], y = py + way[dir][1]; + if (!WITHIN(x, 0, MAX7219_X_LEDS - 1) || !WITHIN(y, 0, MAX7219_Y_LEDS - 1) || BIT_7219(x, y) == on) + dir = (dir + 1) & 0x3; + px += way[dir][0]; + py += way[dir][1]; } } diff --git a/Marlin/src/lcd/menu/menu_game.cpp b/Marlin/src/lcd/menu/menu_game.cpp index 4f9748dc126d..68ccc39aff8d 100644 --- a/Marlin/src/lcd/menu/menu_game.cpp +++ b/Marlin/src/lcd/menu/menu_game.cpp @@ -29,7 +29,13 @@ void menu_game() { START_MENU(); - BACK_ITEM(MSG_MAIN); + BACK_ITEM( + #if ENABLED(LCD_INFO_MENU) + MSG_INFO_MENU + #else + MSG_MAIN + #endif + ); #if ENABLED(MARLIN_BRICKOUT) SUBMENU(MSG_BRICKOUT, brickout.enter_game); #endif diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index e7b4dbe7ce87..71467093ecde 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -302,19 +302,22 @@ void menu_info() { SKIP_ITEM(); SKIP_ITEM(); #endif - SUBMENU(MSG_GAMES, ( - #if HAS_GAME_MENU - menu_game - #elif ENABLED(MARLIN_BRICKOUT) - brickout.enter_game - #elif ENABLED(MARLIN_INVADERS) - invaders.enter_game - #elif ENABLED(MARLIN_SNAKE) - snake.enter_game - #elif ENABLED(MARLIN_MAZE) - maze.enter_game - #endif - )); + // Game sub-menu or the individual game + { + SUBMENU( + #if HAS_GAME_MENU + MSG_GAMES, menu_game + #elif ENABLED(MARLIN_BRICKOUT) + MSG_BRICKOUT, brickout.enter_game + #elif ENABLED(MARLIN_INVADERS) + MSG_INVADERS, invaders.enter_game + #elif ENABLED(MARLIN_SNAKE) + MSG_SNAKE, snake.enter_game + #elif ENABLED(MARLIN_MAZE) + MSG_MAZE, maze.enter_game + #endif + ); + } #endif END_MENU(); diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index fadf0ab0304c..5061ae6597a1 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -271,20 +271,24 @@ void menu_main() { #if ENABLED(GAMES_EASTER_EGG) SKIP_ITEM(); SKIP_ITEM(); + SKIP_ITEM(); #endif - SUBMENU(MSG_GAMES, ( - #if HAS_GAME_MENU - menu_game - #elif ENABLED(MARLIN_BRICKOUT) - brickout.enter_game - #elif ENABLED(MARLIN_INVADERS) - invaders.enter_game - #elif ENABLED(MARLIN_SNAKE) - snake.enter_game - #elif ENABLED(MARLIN_MAZE) - maze.enter_game - #endif - )); + // Game sub-menu or the individual game + { + SUBMENU( + #if HAS_GAME_MENU + MSG_GAMES, menu_game + #elif ENABLED(MARLIN_BRICKOUT) + MSG_BRICKOUT, brickout.enter_game + #elif ENABLED(MARLIN_INVADERS) + MSG_INVADERS, invaders.enter_game + #elif ENABLED(MARLIN_SNAKE) + MSG_SNAKE, snake.enter_game + #elif ENABLED(MARLIN_MAZE) + MSG_MAZE, maze.enter_game + #endif + ); + } #endif END_MENU();