Add another paging mode to onscreen debug output. Activated by pressing "t" it
will show the next page after a timeout of 3 seconds instead of waiting for a key to be pressed. This allows you to enjoy onscreen debug output even when you only have a USB keyboard. Should be enough time to take a quick look or take a photo. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31814 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -49,6 +49,7 @@ struct screen_info {
|
|||||||
bool reverse_attr;
|
bool reverse_attr;
|
||||||
int32 in_command_rows;
|
int32 in_command_rows;
|
||||||
bool paging;
|
bool paging;
|
||||||
|
bool paging_timeout;
|
||||||
bool boot_debug_output;
|
bool boot_debug_output;
|
||||||
bool ignore_output;
|
bool ignore_output;
|
||||||
|
|
||||||
@@ -121,37 +122,43 @@ next_line(void)
|
|||||||
if (sScreen.paging && ((sScreen.in_command_rows > 0
|
if (sScreen.paging && ((sScreen.in_command_rows > 0
|
||||||
&& ((sScreen.in_command_rows + 3) % sScreen.rows) == 0)
|
&& ((sScreen.in_command_rows + 3) % sScreen.rows) == 0)
|
||||||
|| (sScreen.boot_debug_output && sScreen.y == sScreen.rows - 1))) {
|
|| (sScreen.boot_debug_output && sScreen.y == sScreen.rows - 1))) {
|
||||||
// Use the paging mechanism: either, we're in the debugger, and a
|
if (sScreen.paging_timeout)
|
||||||
// command is being executed, or we're currently showing boot debug
|
spin(1000 * 1000 * 3);
|
||||||
// output
|
else {
|
||||||
const char *text = in_command_invocation()
|
// Use the paging mechanism: either, we're in the debugger, and a
|
||||||
? "Press key to continue, Q to quit, S to skip output"
|
// command is being executed, or we're currently showing boot debug
|
||||||
: "Press key to continue, S to skip output, P to disable paging";
|
// output
|
||||||
int32 length = strlen(text);
|
const char *text = in_command_invocation()
|
||||||
if (sScreen.x + length > sScreen.columns) {
|
? "Press key to continue, Q to quit, S to skip output"
|
||||||
// make sure we don't overwrite too much
|
: "Press key to continue, S to skip output, P to disable paging";
|
||||||
text = "P";
|
int32 length = strlen(text);
|
||||||
length = 1;
|
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 = kgetc();
|
||||||
|
if (c == 's') {
|
||||||
|
sScreen.ignore_output = true;
|
||||||
|
} else if (c == 'q' && in_command_invocation()) {
|
||||||
|
abortCommand = true;
|
||||||
|
sScreen.ignore_output = true;
|
||||||
|
} else if (c == 'p' && !in_command_invocation())
|
||||||
|
sScreen.paging = false;
|
||||||
|
else if (c == 't' && !in_command_invocation())
|
||||||
|
sScreen.paging_timeout = true;
|
||||||
|
|
||||||
|
// remove on screen text again
|
||||||
|
sModule->fill_glyph(sScreen.columns - length, sScreen.y, length,
|
||||||
|
1, ' ', sScreen.attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = kgetc();
|
|
||||||
if (c == 's') {
|
|
||||||
sScreen.ignore_output = true;
|
|
||||||
} else if (c == 'q' && in_command_invocation()) {
|
|
||||||
abortCommand = true;
|
|
||||||
sScreen.ignore_output = true;
|
|
||||||
} else if (c == 'p' && !in_command_invocation())
|
|
||||||
sScreen.paging = false;
|
|
||||||
|
|
||||||
// remove on screen text again
|
|
||||||
sModule->fill_glyph(sScreen.columns - length, sScreen.y, length,
|
|
||||||
1, ' ', sScreen.attr);
|
|
||||||
}
|
}
|
||||||
if (sScreen.y == sScreen.rows - 1) {
|
if (sScreen.y == sScreen.rows - 1) {
|
||||||
sScreen.y = 0;
|
sScreen.y = 0;
|
||||||
@@ -580,6 +587,7 @@ blue_screen_init(void)
|
|||||||
|
|
||||||
sModule = &gFrameBufferConsoleModule;
|
sModule = &gFrameBufferConsoleModule;
|
||||||
sScreen.paging = true;
|
sScreen.paging = true;
|
||||||
|
sScreen.paging_timeout = false;
|
||||||
|
|
||||||
add_debugger_command("paging", set_paging, "Enable or disable paging");
|
add_debugger_command("paging", set_paging, "Enable or disable paging");
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user