mirror of
https://github.com/KarolS/millfork.git
synced 2025-08-15 04:27:21 +00:00
Updated examples
This commit is contained in:
@@ -21,13 +21,19 @@ Available for: all computer targets.
|
|||||||
Reads a line from the console and returns a pointer to a null-terminated string.
|
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.
|
The string is valid only until next read from the console.
|
||||||
|
|
||||||
Available for: Commodore 64 with `c64_basic` module.
|
Available for:
|
||||||
|
ZX Spectrum,
|
||||||
|
Commodore 64 with `c64_basic` module,
|
||||||
|
Commodore 16 or Plus/4 with `c264_basic`.
|
||||||
|
|
||||||
#### `word readword()`
|
#### `word readword()`
|
||||||
|
|
||||||
Reads a 16-bit unsigned integer from the console.
|
Reads a 16-bit unsigned integer from the console.
|
||||||
|
|
||||||
Available for: Commodore 64 with `c64_basic` module.
|
Available for:
|
||||||
|
ZX Spectrum,
|
||||||
|
Commodore 64 with `c64_basic` module,
|
||||||
|
Commodore 16 or Plus/4 with `c264_basic`.
|
||||||
|
|
||||||
#### `void bell()`
|
#### `void bell()`
|
||||||
|
|
||||||
|
@@ -2,22 +2,18 @@
|
|||||||
|
|
||||||
## Cross-platform examples
|
## Cross-platform examples
|
||||||
|
|
||||||
* [Hello world](hello_world/hello_world.mfk) (C64/C16/PET/VIC-20/Atari/Apple II/BBC Micro/PC-88/Armstrad CPC) – simple text output
|
* [Hello world](crossplatform/hello_world.mfk) (C64/C16/PET/VIC-20/Atari/Apple II/BBC Micro/ZX Spectrum/PC-88/Armstrad CPC) – simple text output
|
||||||
|
|
||||||
* [Text encodings](c64/text_encodings.mfk) (C64/ZX Spectrum) – examples of text encoding features
|
* [Text encodings](crossplatform/text_encodings.mfk) (C64/ZX Spectrum) – examples of text encoding features
|
||||||
|
|
||||||
* [Bell](apple2/bell.mfk) (Apple II/ZX Spectrum) – a program that goes \*ding!\*
|
* [Echo](crossplatform/echo.mfk) (C64/C16/ZX Spectrum)– simple text input and output
|
||||||
|
|
||||||
|
* [Calculator](crossplatform/calculator.mfk) (C64/C16/ZX Spectrum) – simple numeric input and output
|
||||||
|
|
||||||
|
* [Bell](crossplatform/bell.mfk) (Apple II/ZX Spectrum) – a program that goes \*ding!\*
|
||||||
|
|
||||||
## Commodore 64 examples
|
## Commodore 64 examples
|
||||||
|
|
||||||
### Console I/O examples
|
|
||||||
|
|
||||||
* [Echo](c64/echo.mfk) – simple text input and output
|
|
||||||
|
|
||||||
* [Calculator](c64/calculator.mfk) – simple numeric input and output
|
|
||||||
|
|
||||||
* [Panic](c64/panic_test.mfk) – how panic works on C64, showing the address of where it happened
|
|
||||||
|
|
||||||
### Graphical examples
|
### Graphical examples
|
||||||
|
|
||||||
* [Rasterbar](c64/rasterbar.mfk) – simple rasterbar effect
|
* [Rasterbar](c64/rasterbar.mfk) – simple rasterbar effect
|
||||||
@@ -26,6 +22,10 @@
|
|||||||
|
|
||||||
* [Galencia starfield](c64/galencia.mfk) – a port of the starfield effect from the game *Galencia*
|
* [Galencia starfield](c64/galencia.mfk) – a port of the starfield effect from the game *Galencia*
|
||||||
|
|
||||||
|
### Other examples
|
||||||
|
|
||||||
|
* [Panic](c64/panic_test.mfk) – how panic works on C64, showing the address of where it happened
|
||||||
|
|
||||||
## Famicom/NES examples
|
## Famicom/NES examples
|
||||||
|
|
||||||
* [NES 101 tutorial example](nes/nestest.mfk) – a port of the tutorial example from the NES 101 tutorial by Michael Martin
|
* [NES 101 tutorial example](nes/nestest.mfk) – a port of the tutorial example from the NES 101 tutorial by Michael Martin
|
||||||
|
@@ -1,5 +1,14 @@
|
|||||||
import stdio
|
import stdio
|
||||||
import c64_basic
|
|
||||||
|
#if CBM_64
|
||||||
|
import c64_basic
|
||||||
|
#elseif CBM_264
|
||||||
|
import c264_basic
|
||||||
|
#elseif ZX_SPECTRUM
|
||||||
|
// no imports needed
|
||||||
|
#else
|
||||||
|
#error Unsupported platform
|
||||||
|
#endif
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
word a
|
word a
|
@@ -1,5 +1,16 @@
|
|||||||
import c64_basic
|
|
||||||
|
#if CBM_64
|
||||||
|
import c64_basic
|
||||||
|
#elseif CBM_264
|
||||||
|
import c264_basic
|
||||||
|
#elseif ZX_SPECTRUM
|
||||||
|
// no imports needed
|
||||||
|
#else
|
||||||
|
#error Unsupported platform
|
||||||
|
#endif
|
||||||
|
|
||||||
import stdio
|
import stdio
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
while true {
|
while true {
|
||||||
readline()
|
readline()
|
Reference in New Issue
Block a user