1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-05-31 18:41:30 +00:00
millfork/docs/stdlib/frequent.md

101 lines
2.8 KiB
Markdown
Raw Permalink Normal View History

2019-07-15 12:21:50 +00:00
[< back to index](../doc_index.md)
2018-12-17 16:18:29 +00:00
Definitions on the following list are frequently provided by the default automatically-imported modules.
However, as they are not the part of the standard library, they might not be available on all targets:
#### `void init_rw_memory()`
Initializes all writable arrays and variables with their initial values.
If the preprocessor feature `INIT_RW_MEMORY` is defined and non-zero,
then `init_rw_memory` is available and should be called before accessing any preinitialized writable object.
If the preprocessor feature `INIT_RW_MEMORY` is not defined or is zero,
then `init_rw_memory` is not available.
2018-12-17 16:18:29 +00:00
#### `void putchar(byte char)`
Prints a single character.
Available for: all computer targets.
Uses ROM routines, so requires the appropriate ROM to be enabled if applicable.
2018-12-17 16:18:29 +00:00
Note that this function may obey typical platform idiosyncrasies, for example:
* on Commodore PET targets the quote character toggles the quotation mode
* printing past the end of line might insert a blank line below the current one
* printing past the end of the screen might ask the user to confirm scrolling
The exact behaviour is platform-dependent.
Future library versions will strive to eliminate those issues.
2019-06-24 19:26:08 +00:00
2018-12-17 16:18:29 +00:00
#### `void new_line()`
Moves the cursor to the next line.
Available for: all computer targets.
Uses ROM routines, so requires the appropriate ROM to be enabled if applicable.
2018-12-19 18:01:53 +00:00
#### `pointer readline()`
Reads a line from the console and returns a pointer to a null-terminated string.
The string is valid only until next read from the console.
2018-12-19 21:32:55 +00:00
Available for:
ZX Spectrum,
2018-12-19 23:47:42 +00:00
NEC PC-88,
2019-06-05 11:31:43 +00:00
MSX,
Apple II,
Robotron Z1013 (always trims trailing spaces),
TRS-80,
VIC-20 (except for `vic20_a000`),
Commodore 64 with `c64_basic` module (requires KERNAL and BASIC; empty input is treated like a single space),
Commodore 16 or Plus/4 with `c264_basic` module (requires KERNAL and BASIC; empty input is treated like a single space).
2018-12-19 18:01:53 +00:00
#### `word readword()`
Reads a 16-bit unsigned integer from the console.
2018-12-19 21:32:55 +00:00
Available for:
ZX Spectrum,
2018-12-19 23:47:42 +00:00
NEC PC-88,
2019-06-05 11:31:43 +00:00
MSX,
Apple II,
Robotron Z1013,
TRS-80,
VIC-20 (except for `vic20_a000`),
Commodore 64 with `c64_basic` module (requires KERNAL and BASIC),
Commodore 16 or Plus/4 with `c264_basic` module (requires KERNAL and BASIC).
2018-12-19 18:01:53 +00:00
2018-12-17 16:18:29 +00:00
#### `void bell()`
Beeps.
Available for: Apple 2, ZX Spectrum.
Uses ROM routines, so requires the appropriate ROM to be enabled if applicable.
2018-12-17 16:18:29 +00:00
#### `void set_bg_color(byte color)`
Sets the screen background color.
2019-06-26 15:06:55 +00:00
Available for: C64, VIC-20, C64, C128, C264 series.
2018-12-17 16:18:29 +00:00
#### `void set_border(byte color)`
Sets the screen border color.
2019-06-26 15:06:55 +00:00
Available for: VIC-20, C64, C128, C264 series, ZX Spectrum.
2018-12-17 16:18:29 +00:00
#### `const byte black, white, red, green, blue, cyan, purple, yellow`
Various colour constants.
2019-06-26 15:06:55 +00:00
Available for: VIC-20, C64, C128, C264 series, ZX Spectrum.
2018-12-17 16:18:29 +00:00
2018-12-31 12:20:32 +00:00