From 090501845090bdd7502c06ffbb37aecf237522f6 Mon Sep 17 00:00:00 2001 From: Gregory Gauthier Date: Thu, 29 Jan 2026 16:45:06 +0000 Subject: [PATCH] adding some debug messages to the main --- src/main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main.c b/src/main.c index 9a4f5e0..9faead4 100644 --- a/src/main.c +++ b/src/main.c @@ -68,8 +68,21 @@ static int main_game_loop(int argc, char *argv[]) { /* Get command line arguments */ parse_arguments(argc, argv, filename, difficulty); +#ifdef PLATFORM_DOS + /* DEBUG: Print progress before curses takes over */ + printf("DEBUG: Parsed args, file=%s\n", filename); + printf("DEBUG: Calling initscr()...\n"); +#endif + /* Initialize ncurses */ stdscr = initscr(); + +#ifdef PLATFORM_DOS + /* DEBUG: If we get here, initscr worked */ + mvaddstr(0, 0, "DEBUG: initscr() OK"); + refresh(); +#endif + noecho(); /* Don't echo typed characters */ cbreak(); /* Disable line buffering */ curs_set(0); @@ -78,6 +91,9 @@ static int main_game_loop(int argc, char *argv[]) { keypad(stdscr, FALSE); /* Allow Ctrl+Break to work properly */ raw(); + + mvaddstr(1, 0, "DEBUG: curses init OK, loading words..."); + refresh(); #else keypad(stdscr, TRUE); /* Enable special key detection */ #endif @@ -95,6 +111,11 @@ static int main_game_loop(int argc, char *argv[]) { /* Initialize game */ init_game(&game); +#ifdef PLATFORM_DOS + mvaddstr(0, 0, "DEBUG: Loading words..."); + refresh(); +#endif + if (!load_words(&game, filename)) { /* Try fallback */ if (strcmp(filename, "default.txt") != 0 &&