The Pedigree Project
0.1
|
#include <Vga.h>
Public Member Functions | |
virtual void | setControl (VgaControl which) |
virtual void | clearControl (VgaControl which) |
virtual bool | setMode (int mode) |
virtual bool | setLargestTextMode () |
virtual bool | isMode (size_t nCols, size_t nRows, bool bIsText, size_t nBpp=0) |
virtual bool | isLargestTextMode () |
virtual size_t | getNumCols () |
virtual size_t | getNumRows () |
virtual void | rememberMode () |
virtual void | restoreMode () |
virtual void | pokeBuffer (uint8_t *pBuffer, size_t nBufLen) |
virtual void | peekBuffer (uint8_t *pBuffer, size_t nBufLen) |
virtual void | moveCursor (size_t nX, size_t nY) |
bool | initialise () |
operator uint16_t * () const | |
Private Member Functions | |
HostedVga (const HostedVga &) | |
HostedVga & | operator= (const HostedVga &) |
Static Private Member Functions | |
static void | printAttrAsAnsi (uint8_t attr) |
static uint8_t | ansiColourFixup (uint8_t colour) |
Private Attributes | |
size_t | m_nWidth |
size_t | m_nHeight |
size_t | m_CursorX |
size_t | m_CursorY |
int | m_ModeStack |
int | m_nMode |
uint8_t | m_nControls |
uint16_t * | m_pBackbuffer |
Additional Inherited Members | |
Public Types inherited from Vga | |
enum | VgaControl { LineGraphics = 2, Blink = 3 } |
Vga device abstraction.
Definition at line 28 of file kernel/machine/hosted/Vga.h.
|
staticprivate |
Fix up the given colour into a proper ANSI colour.
Definition at line 146 of file kernel/machine/hosted/Vga.cc.
Referenced by getNumRows().
|
virtual |
Clears the given attribute mode control.
Implements Vga.
Definition at line 41 of file kernel/machine/hosted/Vga.cc.
|
inlinevirtual |
Implements Vga.
Definition at line 68 of file kernel/machine/hosted/Vga.h.
References m_nWidth.
|
inlinevirtual |
Implements Vga.
Definition at line 76 of file kernel/machine/hosted/Vga.h.
References ansiColourFixup(), m_nHeight, m_pBackbuffer, moveCursor(), peekBuffer(), pokeBuffer(), printAttrAsAnsi(), rememberMode(), and restoreMode().
|
virtual |
Tests if the current video mode is the largest text mode.
Implements Vga.
Definition at line 64 of file kernel/machine/hosted/Vga.cc.
|
virtual |
Tests the current video mode.
Implements Vga.
Definition at line 57 of file kernel/machine/hosted/Vga.cc.
|
virtual |
Moves the cursor to the position specified by the parameters.
nX | The column to move to. |
nY | The row to move to. |
Implements Vga.
Definition at line 122 of file kernel/machine/hosted/Vga.cc.
Referenced by getNumRows().
|
virtual |
Copies the current framebuffer into the given buffer.
The buffer is assumed to be in the correct format for directly copying from video memory. This will obviously depend on the current mode (text/graphical) as well as resolution and bits per pixel (graphics mode only).
pBuffer | A pointer to the buffer. |
nBufLen | The length of pBuffer. |
Implements Vga.
Definition at line 111 of file kernel/machine/hosted/Vga.cc.
Referenced by getNumRows().
|
virtual |
Copies the given buffer into video memory, replacing the current framebuffer.
The buffer is assumed to be in the correct format for directly copying into video memory. This will obviously depend on the current mode (text/graphical) as well as resolution and bits per pixel (graphics mode only).
pBuffer | A pointer to the buffer to swap into video memory. |
nBufLen | The length of pBuffer. |
Implements Vga.
Definition at line 77 of file kernel/machine/hosted/Vga.cc.
References ArmVersatileVga::moveCursor(), and printAttrAsAnsi().
Referenced by getNumRows().
|
staticprivate |
Print the given VGA attribute as an ANSI escape sequence.
Definition at line 180 of file kernel/machine/hosted/Vga.cc.
Referenced by getNumRows(), and pokeBuffer().
|
virtual |
Stores the current video mode.
Implements Vga.
Definition at line 69 of file kernel/machine/hosted/Vga.cc.
Referenced by getNumRows().
|
virtual |
Restores the saved video mode from a rememberMode() call.
Implements Vga.
Definition at line 73 of file kernel/machine/hosted/Vga.cc.
Referenced by getNumRows().
|
virtual |
Sets the given attribute mode control.
Implements Vga.
Definition at line 36 of file kernel/machine/hosted/Vga.cc.
|
virtual |
Sets the largest possible text mode.
Implements Vga.
Definition at line 52 of file kernel/machine/hosted/Vga.cc.
|
virtual |
Changes the mode the VGA device is in.
nCols | The number of columns required. |
nRows | The number of rows required. |
bIsText | True if the caller requires a text mode, false if graphical. |
nBpp | Only applicable for graphics modes - the number of bits per pixel. |
Implements Vga.
Definition at line 46 of file kernel/machine/hosted/Vga.cc.
|
private |
Cursor X.
Definition at line 155 of file kernel/machine/hosted/Vga.h.
|
private |
Cursor Y.
Definition at line 160 of file kernel/machine/hosted/Vga.h.
|
private |
We keep a count of the number of times we've entered the debugger without leaving it - when we enter the debugger, we increment this. When we leave, we decrement. If we leave and it reaches zero, we change out of mode 0x3 into the current video mode.
Definition at line 168 of file kernel/machine/hosted/Vga.h.
Referenced by X86Vga::rememberMode(), and X86Vga::restoreMode().
|
private |
Most recent VGA controls (as these get reset on mode change).
Definition at line 178 of file kernel/machine/hosted/Vga.h.
Referenced by X86Vga::moveCursor(), X86Vga::rememberMode(), and X86Vga::restoreMode().
|
private |
The height of the current mode.
Definition at line 150 of file kernel/machine/hosted/Vga.h.
Referenced by getNumRows().
|
private |
Current video mode.
Definition at line 173 of file kernel/machine/hosted/Vga.h.
Referenced by X86Vga::restoreMode(), and X86Vga::setMode().
|
private |
The width of the current mode.
Definition at line 145 of file kernel/machine/hosted/Vga.h.
Referenced by getNumCols(), and X86Vga::moveCursor().
|
private |
Backbuffer for text.
Definition at line 183 of file kernel/machine/hosted/Vga.h.
Referenced by getNumRows().