From a39bfc19fd44e3c9cc853b718e9186fa082e190b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 22 Jan 2008 08:24:35 +0000 Subject: [PATCH] Made the paging mechanism a bit more useful for commands: it will now wait when the command would overwrite its own output, not always on the bottom of the screen. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23699 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/debug/blue_screen.cpp | 68 ++++++++++++++----------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/src/system/kernel/debug/blue_screen.cpp b/src/system/kernel/debug/blue_screen.cpp index 4e5e61ccb2..87deeccb35 100644 --- a/src/system/kernel/debug/blue_screen.cpp +++ b/src/system/kernel/debug/blue_screen.cpp @@ -103,46 +103,52 @@ scroll_up(void) static void next_line(void) { +#if USE_SCROLLING + // TODO: scrolling is usually too slow; we could probably just remove it + if (sScreen.y == sScreen.rows - 1) + scroll_up(); + else + sScreen.y++; +#else if (in_command_invocation()) sScreen.in_command_rows++; else sScreen.in_command_rows = 0; - if (sScreen.y == sScreen.rows - 1) { -#if USE_SCROLLING - scroll_up(); -#else - - if (sScreen.paging - && (sScreen.in_command_rows > 1 || sScreen.boot_debug_output)) { - // We're in the debugger, and a command is being executed - const char *text = "Press key to continue, Q to quit"; - int32 length = strlen(text); - if (sScreen.x + length > sScreen.columns) { - // make sure we don't overwrite too much - text = "P"; - length = 1; - } - - for (int32 i = 0; i < length; i++) { - sModule->put_glyph(sScreen.columns - length + i, sScreen.y, - text[i], sScreen.boot_debug_output ? 0x6f : 0xf0); - } - - char c = blue_screen_getchar(); - if (c == 'q') - sScreen.ignore_output = true; - - // remove on screen text again - sModule->fill_glyph(sScreen.columns - length, sScreen.y, length, - 1, ' ', sScreen.attr); + if (sScreen.paging && ((sScreen.in_command_rows > 0 + && ((sScreen.in_command_rows + 3) % sScreen.rows) == 0) + || (sScreen.boot_debug_output && sScreen.y == sScreen.rows - 1))) { + // Use the paging mechanism: either, we're in the debugger, and a + // command is being executed, or we're currently showing boot debug + // output + const char *text = "Press key to continue, Q to quit"; + int32 length = strlen(text); + if (sScreen.x + length > sScreen.columns) { + // make sure we don't overwrite too much + text = "P"; + length = 1; } + + for (int32 i = 0; i < length; i++) { + // yellow on black (or reverse, during boot) + sModule->put_glyph(sScreen.columns - length + i, sScreen.y, + text[i], sScreen.boot_debug_output ? 0x6f : 0xf6); + } + + char c = blue_screen_getchar(); + if (c == 'q') + sScreen.ignore_output = true; + + // remove on screen text again + sModule->fill_glyph(sScreen.columns - length, sScreen.y, length, + 1, ' ', sScreen.attr); + } + if (sScreen.y == sScreen.rows - 1) { sScreen.y = 0; sModule->fill_glyph(0, 0, sScreen.columns, 2, ' ', sScreen.attr); -#endif - } else if (sScreen.y < sScreen.rows - 1) { + } else sScreen.y++; - } +#endif #if NO_CLEAR if (sScreen.y + 2 < sScreen.rows) {