From 9ffd3035834b4109dd81f29f5854cc9647d462cf Mon Sep 17 00:00:00 2001 From: Karol Stasiak Date: Tue, 31 Mar 2020 19:07:35 +0200 Subject: [PATCH] Update and reorganize documentation --- CHANGELOG.md | 8 +++- docs/README.md | 36 +++++++++++------ docs/api/custom-platform.md | 2 + docs/doc_index.md | 36 ++++++++++------- docs/lang/preprocessor.md | 35 +++++++++-------- docs/lang/preprocessor_cbm.md | 38 ++++++++++++++++++ docs/stdlib/c64.md | 4 +- docs/stdlib/cbm_pet.md | 26 +++++++++++++ docs/stdlib/frequent.md | 15 ------- docs/stdlib/gb.md | 2 +- docs/stdlib/input.md | 73 ----------------------------------- docs/stdlib/joy.md | 35 +++++++++++++++++ docs/stdlib/keyboard.md | 34 ++++++++++++++++ docs/stdlib/lynx.md | 4 +- docs/stdlib/mouse.md | 41 ++++++++++++++++++++ docs/stdlib/nes.md | 4 +- docs/stdlib/other.md | 29 -------------- docs/stdlib/stdio.md | 7 +++- docs/stdlib/stdlib.md | 18 +++++++++ docs/stdlib/string.md | 4 +- docs/stdlib/x16.md | 8 ++-- mkdocs.yml | 9 +++-- 22 files changed, 293 insertions(+), 175 deletions(-) create mode 100644 docs/lang/preprocessor_cbm.md create mode 100644 docs/stdlib/cbm_pet.md delete mode 100644 docs/stdlib/input.md create mode 100644 docs/stdlib/joy.md create mode 100644 docs/stdlib/keyboard.md create mode 100644 docs/stdlib/mouse.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 61d381f2..493924fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,11 +8,15 @@ * Various improvements to the C64 libraries (thanks to @bsutherland). +* Added detection for various PET variants and implemented `readkey` for PET. + * Added `breakpoint` macro (#44). * **Potentially breaking change!** Added `min`, `max` and `if` compile-time functions. -* Added experimental `signed16` and `unsigned16` types. +* Added experimental `signed16` and `unsigned16` types. Added `putsigned16` function. + +* Fixed `scrstr2word` in some rare encoding combinations. * Added warnings for calling from one segment to another overlapping one. @@ -20,6 +24,8 @@ * Create output directories when needed (#21). +* Allow defining different output formats for different segments when outputting one file per segment. + * Fixed multiple optimization bugs (#32, #38, #41, #46 and others) – thanks to @agg23 for detailed bug reports! * 6502: Fix boolean arrays and pointers (#28). diff --git a/docs/README.md b/docs/README.md index 877ea881..f1e0ff56 100644 --- a/docs/README.md +++ b/docs/README.md @@ -34,6 +34,8 @@ * [Inline 8080/LR35902/Z80 assembly syntax](lang/assemblyz80.md) +* [Inline 6809 assembly syntax](lang/assembly6809.md) + * [Important guidelines regarding reentrancy](lang/reentrancy.md) * [List of keywords](lang/keywords.md) @@ -46,23 +48,35 @@ * [`stdio` module](stdlib/stdio.md) -* [Modules for reading input devices](stdlib/input.md) +* Reading input devices: + + * [`joy` module](stdlib/joy.md) + + * [`keyboard` module](stdlib/keyboard.md) + + * [`mouse` module](stdlib/mouse.md) * [`encconv` module](stdlib/encconv.md) -* [Other cross-platform modules (`keyboard`, `err`, `random`)](stdlib/other.md) +* [Other cross-platform modules (`err`, `random`)](stdlib/other.md) -* [Definitions available on only some platforms](stdlib/frequent.md) +* Platform-specific modules: -* [C64-only modules](stdlib/c64.md) + * [Definitions available on only some platforms](stdlib/frequent.md) -* [`cbm_file` module](stdlib/cbm_file.md) - -* [NES-only modules](stdlib/nes.md) - -* [Game Boy–only modules](stdlib/gb.md) - -* [X16–only modules](stdlib/x16.md) + * [C64-only modules](stdlib/c64.md) + + * [PET-only modules](stdlib/cbm_pet.md) + + * [`cbm_file` module](stdlib/cbm_file.md) + + * [NES-only modules](stdlib/nes.md) + + * [Atari Lynx-only modules](stdlib/lynx.md) + + * [Game Boy–only modules](stdlib/gb.md) + + * [X16–only modules](stdlib/x16.md) ## Implementation details diff --git a/docs/api/custom-platform.md b/docs/api/custom-platform.md index 2a0511e2..2a9cc5b4 100644 --- a/docs/api/custom-platform.md +++ b/docs/api/custom-platform.md @@ -219,6 +219,8 @@ Default: `main,*` * `d88` - a D88 floppy disk image for PC-88 * `tap` - a tape disk image for ZX Spectrum + +* `format_segment_NAME` – if using the `per_segment` style, overrides the format for the given segment * `extension` – target file extension, with or without the dot diff --git a/docs/doc_index.md b/docs/doc_index.md index d85fae76..f1e0ff56 100644 --- a/docs/doc_index.md +++ b/docs/doc_index.md @@ -48,25 +48,35 @@ * [`stdio` module](stdlib/stdio.md) -* [Modules for reading input devices](stdlib/input.md) +* Reading input devices: + + * [`joy` module](stdlib/joy.md) + + * [`keyboard` module](stdlib/keyboard.md) + + * [`mouse` module](stdlib/mouse.md) * [`encconv` module](stdlib/encconv.md) -* [Other cross-platform modules (`keyboard`, `err`, `random`)](stdlib/other.md) +* [Other cross-platform modules (`err`, `random`)](stdlib/other.md) -* [Definitions available on only some platforms](stdlib/frequent.md) +* Platform-specific modules: -* [C64-only modules](stdlib/c64.md) + * [Definitions available on only some platforms](stdlib/frequent.md) -* [`cbm_file` module](stdlib/cbm_file.md) - -* [NES-only modules](stdlib/nes.md) - -* [Atari Lynx-only modules](stdlib/lynx.md) - -* [Game Boy–only modules](stdlib/gb.md) - -* [X16–only modules](stdlib/x16.md) + * [C64-only modules](stdlib/c64.md) + + * [PET-only modules](stdlib/cbm_pet.md) + + * [`cbm_file` module](stdlib/cbm_file.md) + + * [NES-only modules](stdlib/nes.md) + + * [Atari Lynx-only modules](stdlib/lynx.md) + + * [Game Boy–only modules](stdlib/gb.md) + + * [X16–only modules](stdlib/x16.md) ## Implementation details diff --git a/docs/lang/preprocessor.md b/docs/lang/preprocessor.md index e305fc65..da866df0 100644 --- a/docs/lang/preprocessor.md +++ b/docs/lang/preprocessor.md @@ -54,10 +54,12 @@ The following features are defined based on the chosen CPU and compilation optio `CPUFEATURE_8080`, `CPUFEATURE_8085`, `CPUFEATURE_GAMEBOY`, `CPUFEATURE_Z80`, `CPUFEATURE_6502_ILLEGALS`, `CPUFEATURE_8085_ILLEGALS`, `CPUFEATURE_Z80_ILLEGALS`, `CPUFEATURE_Z80_NEXT` – 1 if given instruction subset is enabled, 0 otherwise -* `ENCCONV_SUPPORTED` - 1 if the module `encconv` supports the function `to_screencode` and other related funtions, 0 otherwise. +* `ENCCONV_SUPPORTED` - 1 if the module `encconv` supports the function `to_screencode` and other related functions, 0 otherwise. * `ENCODING_SAME` - 1 if the encodings `default` and `src` are the same, 0 otherwise. +* `DECIMALS_SAME` - 1 if the encodings `default` and `src` have the same string terminator and decimal digits `'0'`-`'9'`, 0 otherwise. + * `NULLCHAR_SAME` - 1 if the encodings `default` and `src` have the same string terminator, 0 otherwise. * `NULLCHAR` – the value of the `nullchar` constant @@ -90,38 +92,37 @@ See [the ROM vs RAM guide](../api/rom-vs-ram.md) for more information. ### Commonly used features +These features are frequently defined in the platform definition file. +Some libraries may require that some of these be defined. + * `WIDESCREEN` – 1 if the horizontal screen resolution, ignoring borders, is greater than 256, 0 otherwise -* `CBM` – 1 if the target is an 8-bit Commodore computer (or a compatible one), 0 otherwise - -* `CBM_64_COMPAT` – 1 if the target is an 8-bit Commodore computer compatible with Commodore 64, 0 otherwise - -* `CBM_64_CRT` – 1 if the target is a cartridge for Commodore 64, 0 otherwise - -* `CBM_264` – 1 if the target is an 8-bit Commodore computer from the 264 line, 0 otherwise - * `KEYBOARD` – 1 if the target has a keyboard, 0 otherwise * `JOYSTICKS` – the maximum number of joysticks using standard hardware configurations, may be 0 * `HAS_BITMAP_MODE` – 1 if the target has a display mode with every pixel addressable, 0 otherwise -* `MOS_6510` – 1 if the target uses a MOS 6510-compatible processor (with an I/O port at $0000/$0001) - -* `CPM` – 1 if the target is CP/M, 0 otherwise - -* `IBM_PC` – 1 if the target is IBM PC, 0 otherwise - -* `MSX` – 1 if the target is MSX, 0 otherwise - * `NTSC` – 1 if the target is NTSC, 0 otherwise * `PAL` – 1 if the target is PAL, 0 otherwise * `NULLPTR` – physical value of `nullptr`, default 0 +### Target-specific features + +These features are used to identify the target machine in multiplatform programs and libraries: + +* `CBM` – 1 if the target is an 8-bit Commodore computer (or a compatible one), 0 otherwise +(for more Commodore-related preprocessor options, see [Preprocessor options for Commodore computer targets](./preprocessor_cbm.md)) + +* `AMSTRAD_CPC`, `ATARI_2600`, `ATARI_8`, `ATARI_LYNX`, `APPLE_2`, `BBC_MICRO`, +`COMMANDER_X16`, `CPM`, `GAMEBOY`, `IBM_PC`, `MSX`, `NEC_PC_88`, `NES`, `ZX_SPECTRUM` +– 1 if the target is the machine in question, 0 otherwise + * `VERA_VERSION` – on Commander X16, the version of the VERA chip: `7` for 0.7, `8` for 0.8 + ### Built-in preprocessor functions and operators The `defined` function returns 1 if the feature is defined, 0 otherwise. diff --git a/docs/lang/preprocessor_cbm.md b/docs/lang/preprocessor_cbm.md new file mode 100644 index 00000000..4ba146b9 --- /dev/null +++ b/docs/lang/preprocessor_cbm.md @@ -0,0 +1,38 @@ +[< back to index](../doc_index.md) + +# Preprocessor options for Commodore computer targets + +All Commodore targets define the `CBM` feature as 1. + +### Target detection + +* `CBM_PET` – 1 if the target is PET, 0 otherwise + +* `CBM_VIC` – 1 if the target is VIC-20, 0 otherwise + +* `CBM_264` – 1 if the target is an 8-bit Commodore computer from the 264 line, 0 otherwise + +* `MOS_6510` – 1 if the target uses a MOS 6510-compatible processor (with an I/O port at $0000/$0001) + +* `CBM_64` – 1 if the target is Commodore 64, 0 otherwise + +* `CBM_64_CRT` – 1 if the target is a cartridge for Commodore 64, 0 otherwise + +* `LUNIX` – 1 if the target is Commodore 64 running Lunix, 0 otherwise + +* `CBM_128` – 1 if the target is Commodore 128, 0 otherwise + +* `CBM_64_COMPAT` – 1 if the target is an 8-bit Commodore computer compatible with Commodore 64 +(for example, C128, C65, Mega 65), but not Commodore 64 itself, 0 otherwise + +### Feature enabling + +Due to incompatibilities between different versions of Commodore PET, +certain libraries can be configured to support only some ROM revisions. +By default, all of these are enabled: + +* `PET2000_SUPPORT` – set this to 1 to enable support for PET 2001 with the original ROMs (BASIC 1.0), set it to 0 to disable it + +* `PET3000_SUPPORT` – set this to 1 to enable support for PET 3000 series with the upgraded ROMs (BASIC 2.0), set it to 0 to disable it + +* `PET4000_SUPPORT` – set this to 1 to enable support for PET 4000 with the 4.0 ROMs (BASIC 4.0), set it to 0 to disable it \ No newline at end of file diff --git a/docs/stdlib/c64.md b/docs/stdlib/c64.md index b6f32eff..64e307e1 100644 --- a/docs/stdlib/c64.md +++ b/docs/stdlib/c64.md @@ -22,7 +22,7 @@ TODO ## c1531 -The `c1531` module implements a Commodore 1531 proportional mouse driver compatible with the `mouse` module. +The `c1531` module implements a Commodore 1531 proportional mouse driver compatible with the [`mouse` module](./mouse.md). #### `void c1531_mouse()` @@ -36,7 +36,7 @@ Defines the `c1531` module as the default module for reading mouse input. ## c64_joy -The `c64_joy` module implements a joystick driver compatible with the `joy` module. +The `c64_joy` module implements a joystick driver compatible with the [`joy` module](./joy.md). #### `void read_joy2()` diff --git a/docs/stdlib/cbm_pet.md b/docs/stdlib/cbm_pet.md new file mode 100644 index 00000000..5bb68b6f --- /dev/null +++ b/docs/stdlib/cbm_pet.md @@ -0,0 +1,26 @@ +[< back to index](../doc_index.md) + +# Commodore PET-oriented modules + +## pet_kernal module + +The `pet_kernal` module is imported automatically on the PET target. +It provides access to Kernal routines. + +TODO + + +#### asm set_zero is_pet2000() + +Returns true if the current machine has the original ROM (usually, the PET 2000 series). +When calling from assembly, the result is stored in the Z flag. + +#### asm set_zero is_pet3000() + +Returns true if the current machine has the upgraded ROM (usually, the PET 3000 series). +When calling from assembly, the result is stored in the Z flag. + +#### asm set_zero is_pet4000() + +Returns true if the current machine has the 4.0 ROM (usually, the PET 4000 series). +When calling from assembly, the result is stored in the Z flag. diff --git a/docs/stdlib/frequent.md b/docs/stdlib/frequent.md index 44918d52..05fe55b3 100644 --- a/docs/stdlib/frequent.md +++ b/docs/stdlib/frequent.md @@ -87,21 +87,6 @@ Various colour constants. Available for: VIC-20, C64, C128, C264 series, ZX Spectrum. -#### `macro void memory_barrier()` - -Informs the optimizer that at this point arbitrary memory has been accessed and either read or written by an external device. -The optimizer should not optimize any memory accesses across that macro. - -Available for: all targets. - -#### `macro void breakpoint()` - -If the `-fbreakpoints` option is selected (default), then it emits a memory barrier, -and also outputs a breakpoint to the label file (if the format of the label file allows it). - -If the `-fno-breakpoints` option is selected, then it does nothing. - -Available for: all targets. diff --git a/docs/stdlib/gb.md b/docs/stdlib/gb.md index f0a1a931..9a39c77a 100644 --- a/docs/stdlib/gb.md +++ b/docs/stdlib/gb.md @@ -15,7 +15,7 @@ It contains the default header for 32K Game Boy programs. ## gb_joy -Provides an interface for reading joypads that is compatible with the `joy` module. +Provides an interface for reading joypads that is compatible with the [`joy` module](./joy.md). #### `alias input_a = input_btn` diff --git a/docs/stdlib/input.md b/docs/stdlib/input.md deleted file mode 100644 index e9351fb2..00000000 --- a/docs/stdlib/input.md +++ /dev/null @@ -1,73 +0,0 @@ -[< back to index](../doc_index.md) - -## joy - -The module contains global variables representing the state of the one-button joystick. -If the program is not using any joystick driver, the state of these variables is undefined. - -To actually use this module, an appropriate joystick module must be used, such as `c64_joy`, `nes_joy` or `gb_joy`. - -#### `sbyte input_dx` - -Horizontal joystick movement. 1 if right, -1 if left, 0 if neither. - -#### `sbyte input_dy` - -Vertical joystick movement. 1 if down, -1 if up, 0 if neither. - -#### `byte input_btn` - -1 if main button pressed, 0 if not pressed. - -#### `void reset_joy()` - -Resets the state variables. -The default implementation resets only the main button. -May be overridden by a strong alias on some platforms that have more buttons. - -## null_joy_default - -This module set the default joystick to no joystick. - -#### `alias read_joy` - -A reserved name for reading the default joystick. - -## mouse - -The `mouse` module automatically imports the `x_coord` module. - -The module contains global variables representing the state of the mouse. -If the program is not using any mouse driver, the state of these variables is undefined. - -To actually use this module, an appropriate mouse module must be used, such as `c1531`. - -#### `x_coord mouse_x` - -Mouse X position. - -#### `byte mouse_y` - -Mouse Y position. - -#### `byte mouse_lbm` - -1 if the left mouse button is being pressed, 0 otherwise - -#### `byte mouse_rbm` - -1 if the right mouse button is being pressed, 0 otherwise - -## `x_coord` module - -#### `alias x_coord` - -The type for representing horizontal screen coordinates. -It's `byte` if the screen is 256 pixels wide or less, -or `word` if the screen is more that 256 pixels wide. - -## null_mouse_default - -This module set the default mouse to no mouse. - -#### `void read_mouse()` diff --git a/docs/stdlib/joy.md b/docs/stdlib/joy.md new file mode 100644 index 00000000..af594c7a --- /dev/null +++ b/docs/stdlib/joy.md @@ -0,0 +1,35 @@ +[< back to index](../doc_index.md) + +## joy + +The module contains global variables representing the state of the one-button joystick. +If the program is not using any joystick driver, the state of these variables is undefined. + +To actually use this module, an appropriate joystick module must be used, +such as [`c64_joy`](./c64.md), [`nes_joy`](./nes.md), [`gb_joy`](./gb.md) or [`x16_joy`](./x16.md). + +#### `sbyte input_dx` + +Horizontal joystick movement. 1 if right, -1 if left, 0 if neither. + +#### `sbyte input_dy` + +Vertical joystick movement. 1 if down, -1 if up, 0 if neither. + +#### `byte input_btn` + +1 if main button pressed, 0 if not pressed. + +#### `void reset_joy()` + +Resets the state variables. +The default implementation resets only the main button. +May be overridden by a strong alias on some platforms that have more buttons. + +## null_joy_default + +This module set the default joystick to no joystick. + +#### `alias read_joy` + +A reserved name for reading the default joystick. diff --git a/docs/stdlib/keyboard.md b/docs/stdlib/keyboard.md new file mode 100644 index 00000000..20ecf181 --- /dev/null +++ b/docs/stdlib/keyboard.md @@ -0,0 +1,34 @@ +[< back to index](../doc_index.md) + +## keyboard + +The `keyboard` module provides support for reading keypresses from the keyboard. +Not supported on all targets. + +For reading entire lines of text from the keyboard, see the `readline` and `readword` functions +in [the frequently provided definitions](./frequent.md). + +#### `byte readkey()` + +Waits for and reads a single keypress. + +The returning values may vary between platforms: + +* letters may be uppercase or lowercase + +* modifier keys may be applied or ignored + +Available for: +Commodore 64 (requires KERNAL), +Commodore 16 or Plus/4 (requires KERNAL), +Commodore 128 (requires KERNAL), +Commodore PET (requires KERNAL), +VIC 20 (requires KERNAL), +Atari, +Amstrad CPC, +ZX Spectrum, +NEC PC-88. + +#### `const byte KEY_ENTER` + +Key code for the Enter/Return key. Usually 13, but not always. diff --git a/docs/stdlib/lynx.md b/docs/stdlib/lynx.md index d601f190..3f365a01 100644 --- a/docs/stdlib/lynx.md +++ b/docs/stdlib/lynx.md @@ -4,9 +4,9 @@ ## atari_lynx_hardware -The `atari_lynx_hardware` module is imported automatically on NES targets. +The `atari_lynx_hardware` module is imported automatically on Atari Lynx targets. -It also implements a joystick API compatible with the `joy` module. +It also implements a joystick API compatible with the [`joy` module](./joy.md). TODO diff --git a/docs/stdlib/mouse.md b/docs/stdlib/mouse.md new file mode 100644 index 00000000..c47840a3 --- /dev/null +++ b/docs/stdlib/mouse.md @@ -0,0 +1,41 @@ +[< back to index](../doc_index.md) + +## mouse + +The `mouse` module automatically imports the `x_coord` module. + +The module contains global variables representing the state of the mouse. +If the program is not using any mouse driver, the state of these variables is undefined. + +To actually use this module, an appropriate mouse module must be used, such as [`c1531`](./c64.md). + +#### `x_coord mouse_x` + +Mouse X position. + +#### `byte mouse_y` + +Mouse Y position. + +#### `byte mouse_lbm` + +1 if the left mouse button is being pressed, 0 otherwise + +#### `byte mouse_rbm` + +1 if the right mouse button is being pressed, 0 otherwise + +## x_coord + +#### `alias x_coord` + +The type for representing horizontal screen coordinates. +It's `byte` if the screen is 256 pixels wide or less, +or `word` if the screen is more that 256 pixels wide. + +## null_mouse_default + +This module set the default mouse to null mouse. +The null mouse has no button pressed and the cursos is fixed at coordinates (0,0). + +#### `void read_mouse()` diff --git a/docs/stdlib/nes.md b/docs/stdlib/nes.md index bac7d39d..9e508fe1 100644 --- a/docs/stdlib/nes.md +++ b/docs/stdlib/nes.md @@ -26,7 +26,7 @@ Available variables: #### `byte strobe_joypad()` -Updates joypad1 by querying for new button states. +Strobes joypads in preparation for reading new joypad states. #### `byte read_joypad1()` @@ -99,7 +99,7 @@ Switches nametable mirroring to horizontal. ## nes_joy -Provides an interface for reading joypads that is compatible with the `joy` module. +Provides an interface for reading joypads that is compatible with the [`joy` module](./joy.md). #### `alias input_a = input_btn` diff --git a/docs/stdlib/other.md b/docs/stdlib/other.md index 5cef5c1a..6a3dfa42 100644 --- a/docs/stdlib/other.md +++ b/docs/stdlib/other.md @@ -1,34 +1,5 @@ [< back to index](../doc_index.md) -## keyboard - -The `keyboard` module provides support for reading keypresses from the keyboard. -Not supported on all targets. - -#### `byte readkey()` - -Waits for and reads a single keypress. - -The returning values may vary between platforms: - -* letters may be uppercase or lowercase - -* modifier keys may be applied or ignored - -Available for: -Commodore 64 (requires KERNAL), -Commodore 16 or Plus/4 (requires KERNAL), -Commodore 128 (requires KERNAL), -VIC 20 (requires KERNAL), -Atari, -Amstrad CPC, -ZX Spectrum, -NEC PC-88. - -#### `const byte KEY_ENTER` - -Key code for the Enter/Return key. Usually 13, but not always. - ## err #### `enum error_number` diff --git a/docs/stdlib/stdio.md b/docs/stdlib/stdio.md index 83ebbacd..6b7d246d 100644 --- a/docs/stdlib/stdio.md +++ b/docs/stdlib/stdio.md @@ -3,7 +3,8 @@ ## stdio The `stdio` module automatically imports the `string` and `err` modules. -It requires an implementation of `void putchar(byte a)` and therefore works only on targets with console output. +It requires an implementation of `void putchar(byte a)` and therefore works only on targets with console output +(see [the frequently provided definitions](./frequent.md) for details). On targets with idiosyncratic behaviour of `putchar`, functions in this module inherit that behaviour. #### `void putstr(pointer str, byte len)` @@ -19,6 +20,10 @@ If the string is longer than 255 bytes, then the behaviour is undefined (might e Prints the decimal representation of the 16-bit unsigned integer `w`. +#### `void putsigned16(signed16 w)` + +Prints the decimal representation of the 16-bit signed integer `w`. + #### `void ensure_mixedcase()` On targets that have separate all-caps and mixed-case modes (like most Commodore machines), switches to the mixed-case mode. diff --git a/docs/stdlib/stdlib.md b/docs/stdlib/stdlib.md index 8d86e00c..341c8682 100644 --- a/docs/stdlib/stdlib.md +++ b/docs/stdlib/stdlib.md @@ -31,3 +31,21 @@ Returns an ASCII representation of the lower nibble of the given byte. #### `macro asm void panic()` Crashes the program. + +## Standard macros available without any import + +#### `macro void memory_barrier()` + +Informs the optimizer that at this point arbitrary memory has been accessed and either read or written by an external device. +The optimizer should not optimize any memory accesses across that macro. + +Available for: all targets. + +#### `macro void breakpoint()` + +If the `-fbreakpoints` option is selected (default), then it emits a memory barrier, +and also outputs a breakpoint to the label file (if the format of the label file allows it). + +If the `-fno-breakpoints` option is selected, then it does nothing. + +Available for: all targets. diff --git a/docs/stdlib/string.md b/docs/stdlib/string.md index 59bd3ce9..3efc6db2 100644 --- a/docs/stdlib/string.md +++ b/docs/stdlib/string.md @@ -2,7 +2,7 @@ ## string -The `string` module automatically imports the `err` module. +The `string` module automatically imports the [`err` module](./other.md). All the functions are designed to work for the strings in the default encoding. If passed a string in an encoding that has a different null terminator, @@ -40,7 +40,7 @@ Modifies the given null-terminated buffer by appending a null-terminated string ## scrstring -The `scrstring` module automatically imports the `string` and `err` modules. +The `scrstring` module automatically imports the `string` and [`err`](./other.md). modules. It contains functions for handling strings in the screen encoding with the same semantics as the functions from the string module. diff --git a/docs/stdlib/x16.md b/docs/stdlib/x16.md index 019f28cb..a1596ea1 100644 --- a/docs/stdlib/x16.md +++ b/docs/stdlib/x16.md @@ -5,13 +5,14 @@ **WARNING!** Commander X16 is not yet a finalised design. Therefore, both the device itself and the modules for its support may change at any moment. -## x16_kernal module +## x16_kernal The `x16_kernal` module is imported automatically on the X16 target. Currently, it automatically imports the [`c64_kernal` module](./c64.md). -## `x16_hardware` module + +## x16_hardware The `x16_hardware` module is imported automatically on the X16 target. @@ -78,7 +79,8 @@ Hardware register values for a sprite: Various addresses in the VERA memory space. -## `x16_joy` module + +## x16_joy The `x16_joy` module implements a joystick driver compatible with the `joy` module. diff --git a/mkdocs.yml b/mkdocs.yml index 9d86575e..5736ea30 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -36,12 +36,15 @@ nav: - stdlib module: stdlib/stdlib.md - string and scrstring modules: stdlib/string.md - stdio module: stdlib/stdio.md - - keyboard, err, random: stdlib/other.md - - joy, mouse, x_coord: stdlib/input.md + - err and random modules: stdlib/other.md + - keyboard module: stdlib/keyboard.md + - mouse and x_coord modules: stdlib/mouse.md + - joy module: stdlib/joy.md - encconv module: stdlib/encconv.md - - Platform-dependent modules: stdlib/frequent.md + - Platform-dependent definitions: stdlib/frequent.md - cbm_file module: stdlib/cbm_file.md - C64-only modules: stdlib/c64.md + - PET-only modules: stdlib/cbm_pet.md - NES-only modules: stdlib/nes.md - Lynx-only modules: stdlib/lynx.md - Game Boy–only modules: stdlib/gb.md