-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libraries/console][servers/console] Support double-buffering of cons…
…ole output This is mostly a quick hack to provide better support for applications doing a lot of updates to the screen content (i.e. the modplay program in my current use case) Only supports text mode, at the moment. For graphics modes, we should use some form of shared memory instead which is a lot more efficient than silly copying of bits from one address space to another.
- Loading branch information
Showing
14 changed files
with
261 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
// Abstract: Defines used by the console library. | ||
// Author: Per Lundberg <[email protected]> | ||
// | ||
// © Copyright 1999-2000, 2013 chaos development. | ||
// © Copyright 1999 chaos development | ||
|
||
#pragma once | ||
|
||
// Welcome, to the Real World. In this, we use EGA colors in the year of 2KAD... | ||
// FIXME: I wonder what this is, really. These are _neither_ EGA nor | ||
// ANSI colours in reality. They resemble ANSI more than EGA but not | ||
// 100%... | ||
enum | ||
{ | ||
CONSOLE_COLOUR_BLACK, | ||
|
@@ -18,6 +21,40 @@ enum | |
CONSOLE_COLOUR_GRAY, | ||
}; | ||
|
||
// These colours are used when working with buffered console output. | ||
// Note that their numeral values are different to the ones above; | ||
// this is used so that buffers can copied to EGA-compatible text | ||
// mode hardware without conversion. | ||
enum | ||
{ | ||
CONSOLE_BUFFER_COLOUR_BLACK, // 0 | ||
CONSOLE_BUFFER_COLOUR_BLUE, | ||
CONSOLE_BUFFER_COLOUR_GREEN, | ||
CONSOLE_BUFFER_COLOUR_CYAN, | ||
CONSOLE_BUFFER_COLOUR_RED, | ||
CONSOLE_BUFFER_COLOUR_MAGENTA, | ||
CONSOLE_BUFFER_COLOUR_BROWN, | ||
CONSOLE_BUFFER_COLOUR_LIGHT_GRAY, | ||
|
||
CONSOLE_BUFFER_COLOUR_DARK_GRAY, // 8 | ||
CONSOLE_BUFFER_COLOUR_BRIGHT_BLUE, | ||
CONSOLE_BUFFER_COLOUR_BRIGHT_GREEN, | ||
CONSOLE_BUFFER_COLOUR_BRIGHT_CYAN, | ||
CONSOLE_BUFFER_COLOUR_BRIGHT_RED, | ||
CONSOLE_BUFFER_COLOUR_BRIGHT_MAGENTA, | ||
CONSOLE_BUFFER_COLOUR_BRIGHT_YELLOW, | ||
CONSOLE_BUFFER_COLOUR_BRIGHT_WHITE, | ||
|
||
CONSOLE_BUFFER_BG_COLOUR_BLACK, // 0x10 | ||
CONSOLE_BUFFER_BG_COLOUR_BLUE, | ||
CONSOLE_BUFFER_BG_COLOUR_GREEN, | ||
CONSOLE_BUFFER_BG_COLOUR_CYAN, | ||
CONSOLE_BUFFER_BG_COLOUR_RED, | ||
CONSOLE_BUFFER_BG_COLOUR_MAGENTA, | ||
CONSOLE_BUFFER_BG_COLOUR_BROWN, | ||
CONSOLE_BUFFER_BG_COLOUR_LIGHT_GRAY | ||
}; | ||
|
||
enum | ||
{ | ||
CONSOLE_ATTRIBUTE_RESET = 0, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
// Abstract: Console library types. | ||
// Author: Per Lundberg <[email protected]> | ||
// | ||
// © Copyright 2000 chaos development. | ||
// © Copyright 1999 chaos development. | ||
|
||
#pragma once | ||
|
||
#include <ipc/ipc.h> | ||
|
||
typedef struct | ||
{ | ||
uint8_t character; | ||
uint8_t attribute; | ||
} PACKED console_character_type; | ||
|
||
typedef struct | ||
{ | ||
ipc_structure_type ipc_structure; | ||
|
@@ -16,4 +22,9 @@ typedef struct | |
unsigned int type; | ||
bool initialised; | ||
bool opened; | ||
|
||
// If ipc_console_attribute_type.enable_buffer was set when | ||
// console_open was called, this will be a non-NULL pointer that | ||
// will be used to double-buffer content. | ||
console_character_type *buffer; | ||
} console_structure_type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ OBJECTS = %w[ | |
connection.o | ||
console.o | ||
console_output.o | ||
console_output_all.o | ||
].freeze | ||
|
||
LIBRARIES = %w[ | ||
|
Oops, something went wrong.