Displays text on a VGA monitor. To-do: Bring in features from Steve Denson's VgaText application: https://code.google.com/p/propgcc/source/browse/demos/#demos%2FVgaText Note, this library is still preliminary; revisions are pending.
More...
#include <stdint.h>
Go to the source code of this file.
|
#define | Cols (32) |
|
#define | Rows (15) |
|
#define | Screensize (480) |
|
#define | Lastrow (448) |
|
#define | Vga_count (21) |
|
#define | vgaSpin_Class_Defined__ |
|
#define | Paramcount (21) |
|
#define | Colortable (384) |
|
Displays text on a VGA monitor. To-do: Bring in features from Steve Denson's VgaText application: https://code.google.com/p/propgcc/source/browse/demos/#demos%2FVgaText Note, this library is still preliminary; revisions are pending.
- Author
- Spin + ASM by Chip Gracey Converted from Spin + ASM with Eric Smith's Spin2Cpp utility Commented and function names adjusted by Andy Lindsay
- Version
- 0.85
- Copyright
- Copyright (C) Parallax, Inc. 2013. All Rights MIT Licensed.
int32_t vga_text_bin |
( |
int32_t |
Value, |
|
|
int32_t |
Digits |
|
) |
| |
Display a value as binary text.
- Parameters
-
Value | The value to display. |
Digits | The number of digits to display. |
int32_t vga_text_dec |
( |
int32_t |
Value) | |
|
Display a value as decimal text.
- Parameters
-
Value | The value to display. |
int32_t vga_text_hex |
( |
int32_t |
Value, |
|
|
int32_t |
Digits |
|
) |
| |
Display a value as hexadecimal text.
- Parameters
-
Value | The value to display. |
Digits | The number of digits to display |
int32_t vga_text_out |
( |
int32_t |
C) | |
|
Display a character.
- Parameters
-
C | Character to print. This could be a printable character like 'a', 'b', 'Z', '&', '~', or non-printable control characters |
Non-Printable Control Characters (with simpletools constants when they match.)
CLS = 0 HOME = 1 BKSPC = 8 10 (next character should be a position number) 11 (next character should be a position number) 12 set color (color pointer value follows) CR = 13
int32_t vga_text_setcolors |
( |
int32_t |
Colorptr) | |
|
Override color palette.
- Parameters
-
Colorptr | Points to a list of up to 8 colors. |
Each color is two bytes: foreground, background. Red, green and blue can each be values from 0 to 3. char foreground = (red << 4) | (green << 2) | blue Example: If you want the foreground to have a red value of 2, a green value of 1 and a blue value of 3, use char foreground = (2 << 4) | (1 << 2) | 3
int32_t vga_text_start |
( |
int32_t |
Basepin) | |
|
Start the VGA text display.
- Parameters
-
Basepin | pin connected to VGA's V (vertical sync) input. Must be P0, P8, P16, or P24. Counting upward from this pin, the connections are: H, B0, B1, G0, G1, R0, R1. Example: if the Basepin is set to 8, P8 is connected to H, P9 to V, P10 to B0, and so on, up through P15 to R1. |
- Returns
- Nonzero if successfully launched, or zero if no cog available.
int32_t vga_text_str |
( |
char * |
Stringptr) | |
|
Display a string.
- Parameters
-
Stringptr | A pointer to a text string. |