coco3
)
The coco3
target has been supported by ugBASIC
since version 1.15. The compiler can produce executable files in "bin"
format and entire "dsk" disks, including files that can be loaded using
the language's primitives.
You can use the SANDBOX to try the ugBASIC compiler, without download
anything. This tool has been designed to quickly test whether the code
you are writing compiles correctly and determines the desired results.
Since the source is compiled thanks to dedicated servers, separate from the
browser you are using, some commands are not available: for example, you
cannot load external files or resources by using the LOAD
command.
If you need to develop a program with a complete tool, we recommend installing the
command line executables (see below) or UGBASIC-IDE.
To write the source code you can use a simply text editor. You can save
the program in a text file and then to call the compiler, in order to convert it into an
form that your TRS-80 Color Computer 3 will
be able to execute.
Otherwise you can download and use command line compilers. Here are the direct links to the
compilers for the various operating systems. Select the most suitable one for your configuration:
In addition to compiling with the IDE, if you are using Linux or the command line version for
Microsoft Windows, you can compile the BASIC source "source.bas" into an executable file using the following command:
ugbc.coco3 -o executable.bin -O bin source.bas
ugbc.coco3 -o disk.dsk -O dsk source.bas
It is therefore possible to run everything with an emulator,
such as
XRoar
,
or to create a phisical storage, as well.
A good starting point to learn ugBASIC
for the coco3
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 coco3 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.
SCREEN #
command, and used with graphics primitives. This is the value of the various constants in the various versions:MODE | DESCRIPTION | WIDTHxHEIGHTxCOLORS |
---|---|---|
0 | Alphanumeric 32 columns x 24 rows | 32x24x16 |
1 | Alphanumeric 32 columns x 25 rows | 32x25x16 |
2 | Alphanumeric 32 columns x 28 rows | 32x28x16 |
3 | Alphanumeric 40 columns x 24 rows | 40x24x16 |
4 | Alphanumeric 40 columns x 25 rows | 40x25x16 |
5 | Alphanumeric 40 columns x 28 rows | 40x28x16 |
6 | Alphanumeric 64 columns x 24 rows | 64x24x16 |
7 | Alphanumeric 64 columns x 25 rows | 64x25x16 |
8 | Alphanumeric 64 columns x 28 rows | 64x28x16 |
9 | Alphanumeric 80 columns x 24 rows | 80x24x16 |
10 | Alphanumeric 80 columns x 25 rows | 80x25x16 |
11 | Alphanumeric 80 columns x 28 rows | 80x28x16 |
64 | Graphic 128x192x2 | 128x192x2 |
65 | Graphic 128x200x2 | 128x200x2 |
66 | Graphic 128x225x2 | 128x225x2 |
67 | Graphic 160x192x2 | 160x192x2 |
68 | Graphic 160x200x2 | 160x200x2 |
69 | Graphic 160x225x2 | 160x225x2 |
70 | Graphic 256x192x2 | 256x192x2 |
71 | Graphic 256x200x2 | 256x200x2 |
72 | Graphic 256x225x2 | 256x225x2 |
73 | Graphic 320x192x2 | 320x192x2 |
74 | Graphic 320x200x2 | 320x200x2 |
75 | Graphic 320x225x2 | 320x225x2 |
76 | Graphic 512x192x2 | 512x192x2 |
77 | Graphic 512x200x2 | 512x200x2 |
78 | Graphic 512x225x2 | 512x225x2 |
79 | Graphic 640x192x2 | 640x192x2 |
80 | Graphic 640x200x2 | 640x200x2 |
81 | Graphic 640x225x2 | 640x225x2 |
96 | Graphic 64x192x4 | 64x192x4 |
97 | Graphic 64x200x4 | 64x200x4 |
98 | Graphic 64x225x4 | 64x225x4 |
99 | Graphic 80x192x4 | 80x192x4 |
100 | Graphic 80x200x4 | 80x200x4 |
101 | Graphic 80x225x4 | 80x225x4 |
102 | Graphic 128x192x4 | 128x192x4 |
103 | Graphic 128x200x4 | 128x200x4 |
104 | Graphic 128x225x4 | 128x225x4 |
105 | Graphic 160x192x4 | 160x192x4 |
106 | Graphic 160x200x4 | 160x200x4 |
107 | Graphic 160x225x4 | 160x225x4 |
108 | Graphic 256x192x4 | 256x192x4 |
109 | Graphic 256x200x4 | 256x200x4 |
110 | Graphic 256x225x4 | 256x225x4 |
111 | Graphic 320x192x4 | 320x192x4 |
112 | Graphic 320x200x4 | 320x200x4 |
113 | Graphic 320x225x4 | 320x225x4 |
114 | Graphic 512x192x4 | 512x192x4 |
115 | Graphic 512x200x4 | 512x200x4 |
116 | Graphic 512x225x4 | 512x225x4 |
117 | Graphic 640x192x4 | 640x192x4 |
118 | Graphic 640x200x4 | 640x200x4 |
119 | Graphic 640x225x4 | 640x225x4 |
224 | Graphic 64x192x16 | 64x192x16 |
225 | Graphic 64x200x16 | 64x200x16 |
226 | Graphic 64x225x16 | 64x225x16 |
227 | Graphic 80x192x16 | 80x192x16 |
228 | Graphic 80x200x16 | 80x200x16 |
229 | Graphic 80x225x16 | 80x225x16 |
230 | Graphic 128x192x16 | 128x192x16 |
231 | Graphic 128x200x16 | 128x200x16 |
232 | Graphic 128x225x16 | 128x225x16 |
233 | Graphic 160x192x16 | 160x192x16 |
234 | Graphic 160x200x16 | 160x200x16 |
235 | Graphic 160x225x16 | 160x225x16 |
236 | Graphic 256x192x16 | 256x192x16 |
237 | Graphic 256x200x16 | 256x200x16 |
238 | Graphic 256x225x16 | 256x225x16 |
239 | Graphic 320x192x16 | 320x192x16 |
240 | Graphic 320x200x16 | 320x200x16 |
241 | Graphic 320x225x16 | 320x225x16 |
With the coco3
target you can include assembly code
for the Motorola 6809 processor. The code will be placed within the code bank.
The ugBASIC compiler supports both the TRS-80 Color Computer 3 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:
VERSION | NTSC | PAL | TICKS PER SECOND |
---|---|---|---|
Tandy CoCo 3 (PAL) | 0 (FALSE ) | -1 (TRUE ) | 50 |
Tandy CoCo 3 (NTSC) | -1 (TRUE ) | 0 (FALSE ) | 60 |
The ugBASIC music system allows soundtracks in
background to be added to any program. Music can be created from a
variety of sources, including MIDI and PSG files. The ugBASIC
support SN-76489 audio chipset used by external soundcard attached,
like the Game Master Cartridge.
The audio card is properly emulated by the latest version of XROAR emulator. If you are generating
binary images, you can use directly with this command line:
xroar -machine coco3p -cart gmc program.bin
If you are using a disk image, you need to use a MPI (Multi Pack Interface), to
attach both Game Master Cartridge (slot 0) and RS-DOS (slot 3). You should use
this command line:
xroar -machine coco3p -cart mpi -mpi-load-cart 0=gmc -mpi-load-cart 3=rsdos -mpi-slot 3 program.dsk
Click here to know more.