A good starting point to learn ugBASIC
for the c16
platform is the examples page.
The examples provide insight into the syntax and usage of many of the commands
and statements available for the
language.
Since ugBASIC is an isomorphic language, which does not provide abstractions, it
is possible that not all examples work on all targets: those labeled c16 can
be compiled to generate executable files.
If you need help and support, the best place is the official forum, where you can
find answers to your questions and receive help.
The ugBASIC language provides access to all documented graphics modes of the VIC-II chipset,
that can be selected using the SCREEN #
command, and used with graphics primitives. This is the value of the various constants in the various versions:
MODE | DESCRIPTION | WIDTHxHEIGHTxCOLORS |
---|---|---|
0 | Standard Character Mode | 40x25x16 |
2 | Standard Bitmap Mode | 320x200x2 |
3 | Multicolor Bitmap Mode | 160x200x4 |
4 | Extended Multicolor Character Mode | 40x25x20 |
With the c16
target you can include assembly code
for the MOS 6502 processor. The code will be placed within the code bank.
The ugBASIC compiler supports both the Commodore PLUS/4 PAL
(working frequency: 50 Hz) and NTSC
(working frequency: 60 Hz)
versions, and automatically detects the working frequency to calibrate the
delays. In particular, it defines two constants with the same name, and
initializes the constant TICKS PER SECOND
.
This is the value of the various constants in the various versions:
VERSIONE | NTSC | PAL | TICKS PER SECOND |
---|---|---|---|
Commodore 16 PAL | 0 (FALSE ) | -1 (TRUE ) | 50 |
Commodore 16 NTSC | -1 (TRUE ) | 0 (FALSE ) | 60 |