From 9a57ed036fce99e36ecd1df2ebe1efcb4b11cd7e Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Fri, 17 Jul 2015 11:25:19 -0500 Subject: [PATCH] Some minor UI improvements to ensure the user always knows what is going on. There should be no more blank screens for any significant period of time. --- a2sudoku/ui.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/a2sudoku/ui.c b/a2sudoku/ui.c index fcb8b75..181c42f 100644 --- a/a2sudoku/ui.c +++ b/a2sudoku/ui.c @@ -176,6 +176,7 @@ void shutdownUI(void) void textMode(void) { + clrscr(); asm ("STA %w", 0xc051); } @@ -252,8 +253,6 @@ bool setOptions(void) saveOptions(); } - clrscr(); - return shouldUpdate; } @@ -523,9 +522,10 @@ bool playGame(void) initUI(); - clrscr(); textMode(); + printf("\n\nChecking for a saved puzzle..."); + if (loadGame(updatePos)) { bool gotAnswer = false; @@ -571,7 +571,6 @@ bool playGame(void) while (true) { bool shouldNotBeep = true; - bool shouldRefresh = false; if (isPuzzleSolved()) { youWon(); @@ -591,7 +590,8 @@ bool playGame(void) case 'o': case 'O': textMode(); - shouldRefresh = setOptions(); + if (setOptions()) + refreshAllPos(); graphicsMode(); break; @@ -762,8 +762,6 @@ bool playGame(void) if (!shouldNotBeep) { printf("\007"); } - if (shouldRefresh) - refreshAllPos(); } return false;