BBC Micro C library
|
BBC BASIC style API. More...
Go to the source code of this file.
Functions | |
static void | CLS (void) |
void | COLOUR (uint8_t colour) |
void | PLOT (uint8_t plotcode, uint16_t x, uint16_t y) |
static void | DRAW (uint16_t x, uint16_t y) |
static void | ENVELOPE (const void *block) |
void | GCOL (uint8_t action, uint8_t colour) |
uint8_t | INKEYNEG (int8_t key) |
void | MODE (uint8_t mode) |
static void | MOVE (uint16_t x, uint16_t y) |
static void | PRINT (const char *string) |
void | PRINTTAB (uint8_t x, uint8_t y, const char *string) |
void | SOUND (int16_t channel, int16_t amplitude, int16_t pitch, int16_t duration) |
BBC BASIC style API.
C wrappers in the style of BBC BASIC keywords
|
inlinestatic |
Clear the text area of the screen
void COLOUR | ( | uint8_t | colour | ) |
Set the text foreground and background colour
colour | 0-15 for foreground, 128-143 for background |
Draws lines on the screen in MODEs 0,1,2,4 and 5 draws from current graphics point set by MOVE or DRAW previously.
x | end of line x coordinate in osunits |
y | end of line y coordinate in osunits |
|
inlinestatic |
The envelope statement is used with the SOUND statement to control the volume and pitch of a sound while it is playing.
block | pointer to 14 byte block containing envelope parameters |
Selects the graphics foreground colour and the graphics background colour.
action | mode of action to use, 0 = plot, 1 = OR, 2 = AND, 3 = EOR, 4 = invert |
colour | logival colour to use |
INKEY with a negative number enables you to test whether a particular key is pressed at this instant
key negative key code
void MODE | ( | uint8_t | mode | ) |
Select which display mode the computer is about to use.
mode | number of new mode |
moves the graphics cursor to a particular absolute position without drawing a line
x | new x coordinate in osunits |
y | new y coordinate in osunits |
PLOT is the multi-purpose point, line and triangle drawing statement in BASIC. With the graphcis extension ROM fitted, it also provides shape and sprite plotting routines.
It is also the code behind the DRAW and MOVE keywords
plotcode | action to perform |
x | x coordinate in osunits |
y | y coordinate in osunits |
|
inlinestatic |
Text output routine
Note this is sumplified from the BASIC version and can only output single zero terminated strings.
string | string to output (zero terminated) |
Text output routine at a specific text coordinate
Note this is sumplified from the BASIC version and can only output single zero terminated strings.
x | text coordinate |
y | text coordinate |
string | string to output (zero terminated) |
Generate sounds
channel | 0-4, 0 = noise channel, 1-3 squarewave |
amplitude | loudness -15 (loudest) tp 0 (silence) |
pitch | 0-255 pitch, A440 = 89, 4 units per semi-tone, 48 per octave |
duration | -1 to 254 note duration in 20ths of a second |