diff --git a/basic1.cpp b/basic1.cpp index edfa4f6..3e91c86 100644 --- a/basic1.cpp +++ b/basic1.cpp @@ -259,7 +259,7 @@ int main() // Initialize standard I/O for debugging with timeout // This prevents hanging when USB is not connected stdio_init_all(); - sleep_ms(5000); // Wait for USB connection (if present) + sleep_ms(100); // Wait for USB connection (if present) printf("\n=== %s Demo ===\n", BOARD_NAME); printf("Starting dual-core system...\n"); diff --git a/display/low_level_render.cpp b/display/low_level_render.cpp index 0c71a3d..5eda240 100644 --- a/display/low_level_render.cpp +++ b/display/low_level_render.cpp @@ -56,7 +56,7 @@ Font font_tama_mini02_obj(reinterpret_cast(font_tama_mini0 Font font_zxpix_obj(reinterpret_cast(font_zxpix), 96, 6, 8); LowLevelRenderer::LowLevelRenderer(uint8_t* buffer, int width, int height) - : bit_buffer(buffer), V_WIDTH(width), V_HEIGHT(height), current_font(nullptr), + : bit_buffer(buffer), V_WIDTH(width), V_HEIGHT(height), current_font(&font_5x5_obj), clipping_enabled(false), clip_x(0), clip_y(0), clip_width(width), clip_height(height), text_color(true) {} void LowLevelRenderer::set_font(const Font* font) { diff --git a/games/demo_game.cpp b/games/demo_game.cpp index e9aa42c..55a3912 100644 --- a/games/demo_game.cpp +++ b/games/demo_game.cpp @@ -4,6 +4,7 @@ // Simple demo game to test the launcher #include "demo_game.h" +#include "board_config.h" #include #include @@ -53,7 +54,11 @@ void DemoGame::draw() { // Instructions if (tap_count < 3) { +#ifdef BUTTON_KEY0_PIN + renderer->draw_string(width/2 - 80, y + 80, "Tap or press 3 times", true); +#else renderer->draw_string(width/2 - 80, y + 80, "Tap 3 times to exit", true); +#endif } else { renderer->draw_string(width/2 - 70, y + 80, "Exiting to menu...", true); } diff --git a/games/tic_tac_toe.cpp b/games/tic_tac_toe.cpp index 5e5b77f..b47bc3b 100644 --- a/games/tic_tac_toe.cpp +++ b/games/tic_tac_toe.cpp @@ -220,12 +220,20 @@ void TicTacToeGame::draw() { } else { renderer->draw_string(20, 40, "TIE GAME!", true); } +#ifdef BUTTON_KEY0_PIN renderer->draw_string(20, 55, "Touch or KEY0 to restart", true); +#else + renderer->draw_string(20, 55, "Touch to restart", true); +#endif } else { char turn_text[30]; snprintf(turn_text, sizeof(turn_text), "Turn: %s", state.current_player == 1 ? "X" : "O"); renderer->draw_string(20, 40, turn_text, true); +#ifdef BUTTON_KEY0_PIN renderer->draw_string(20, 55, "Touch cell or use keys", true); +#else + renderer->draw_string(20, 55, "Touch cell to play", true); +#endif } // Draw game board (use same layout as touch detection!) diff --git a/lib/game_launcher.cpp b/lib/game_launcher.cpp index 6263043..f49cac1 100644 --- a/lib/game_launcher.cpp +++ b/lib/game_launcher.cpp @@ -4,6 +4,7 @@ // Menu system for selecting and launching games #include "game_launcher.h" +#include "board_config.h" #include "display/low_level_render.h" #include "display/low_level_gui.h" #include @@ -27,27 +28,25 @@ void GameLauncher::register_game(const char* name, const char* description, void GameLauncher::draw() { // Draw main window - gui->draw_new_window(10, 10, width - 20, height - 20, "Game Launcher"); + LowLevelWindow* window = gui->draw_new_window(10, 10, width - 20, height - 20, "Game Launcher"); + + renderer->set_font(&font_5x5_obj); // Draw title - renderer->draw_string(30, 30, "Select a Game:", true); + renderer->draw_string_scaled(30, 40, "Select a Game:", 2); - // Draw game list + // Draw game list with GUI buttons for (size_t i = 0; i < games.size(); i++) { int y = MENU_Y_START + (i * MENU_ITEM_HEIGHT); - // Highlight selected item - if ((int)i == selected_index) { - // Draw selection box - renderer->draw_rectangle(20, y - 5, width - 40, MENU_ITEM_HEIGHT - 10, true, 2); - renderer->draw_string(30, y + 2, ">", true); - } + // Draw button (pressed/highlighted if selected) + bool is_selected = ((int)i == selected_index); + gui->draw_button(window, 20, y, games[i].name, is_selected, true); - // Draw game name - renderer->draw_string(45, y + 2, games[i].name, true); - - // Draw description (smaller, below name) - renderer->draw_string(45, y + 15, games[i].description, true); + // Draw description below button + renderer->set_font(&font_5x5_obj); // Restore small font for description + renderer->set_text_color(true); // Normal text color + renderer->draw_string_scaled(50, y + 36, games[i].description, 1); } // Draw instructions at bottom @@ -57,7 +56,8 @@ void GameLauncher::draw() { #else instructions = "Touch game to play"; #endif - renderer->draw_string(30, height - 35, instructions, true); + renderer->set_font(&font_5x5_obj); + renderer->draw_string_scaled(30, height - 35, instructions, 2); } bool GameLauncher::update(const InputEvent& event) {