Targets supported by ugBASIC

TRS-80 Color Computer 3 (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.



How to start

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.

Games written for TRS-80 Color Computer 3 (more...)



HANGWORD!

Hangword! is the electronic version of a guessing game for one player. The computer chooses a word and the player tries to guess it by suggesting letters within seven (7) guesses. The game contains a vocabulary of 2.048 English words.
Italian version available.


SOKO64+

Sokoban (Japanese: 倉庫番 or "warehouse keeper") is a puzzle-type video game in which the player pushes crates through a maze and tries to place them in their assigned location.


4GRAVITY!

This game is a "Connect Four" clone. The objective of the game is to be the first to form a horizontal, vertical, or diagonal line of four of one's own tokens.

Examples for TRS-80 Color Computer 3 (more...)


















Plotting and graphic modes


The ugBASIC language provides access to all documented graphics modes of the Motorola 6847 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:

MODEDESCRIPTIONWIDTHxHEIGHTxCOLORS
0Alphanumeric 32 columns x 24 rows32x24x16
1Alphanumeric 32 columns x 25 rows32x25x16
2Alphanumeric 32 columns x 28 rows32x28x16
3Alphanumeric 40 columns x 24 rows40x24x16
4Alphanumeric 40 columns x 25 rows40x25x16
5Alphanumeric 40 columns x 28 rows40x28x16
6Alphanumeric 64 columns x 24 rows64x24x16
7Alphanumeric 64 columns x 25 rows64x25x16
8Alphanumeric 64 columns x 28 rows64x28x16
9Alphanumeric 80 columns x 24 rows80x24x16
10Alphanumeric 80 columns x 25 rows80x25x16
11Alphanumeric 80 columns x 28 rows80x28x16
64Graphic 128x192x2128x192x2
65Graphic 128x200x2128x200x2
66Graphic 128x225x2128x225x2
67Graphic 160x192x2160x192x2
68Graphic 160x200x2160x200x2
69Graphic 160x225x2160x225x2
70Graphic 256x192x2256x192x2
71Graphic 256x200x2256x200x2
72Graphic 256x225x2256x225x2
73Graphic 320x192x2320x192x2
74Graphic 320x200x2320x200x2
75Graphic 320x225x2320x225x2
76Graphic 512x192x2512x192x2
77Graphic 512x200x2512x200x2
78Graphic 512x225x2512x225x2
79Graphic 640x192x2640x192x2
80Graphic 640x200x2640x200x2
81Graphic 640x225x2640x225x2
96Graphic 64x192x464x192x4
97Graphic 64x200x464x200x4
98Graphic 64x225x464x225x4
99Graphic 80x192x480x192x4
100Graphic 80x200x480x200x4
101Graphic 80x225x480x225x4
102Graphic 128x192x4128x192x4
103Graphic 128x200x4128x200x4
104Graphic 128x225x4128x225x4
105Graphic 160x192x4160x192x4
106Graphic 160x200x4160x200x4
107Graphic 160x225x4160x225x4
108Graphic 256x192x4256x192x4
109Graphic 256x200x4256x200x4
110Graphic 256x225x4256x225x4
111Graphic 320x192x4320x192x4
112Graphic 320x200x4320x200x4
113Graphic 320x225x4320x225x4
114Graphic 512x192x4512x192x4
115Graphic 512x200x4512x200x4
116Graphic 512x225x4512x225x4
117Graphic 640x192x4640x192x4
118Graphic 640x200x4640x200x4
119Graphic 640x225x4640x225x4
224Graphic 64x192x1664x192x16
225Graphic 64x200x1664x200x16
226Graphic 64x225x1664x225x16
227Graphic 80x192x1680x192x16
228Graphic 80x200x1680x200x16
229Graphic 80x225x1680x225x16
230Graphic 128x192x16128x192x16
231Graphic 128x200x16128x200x16
232Graphic 128x225x16128x225x16
233Graphic 160x192x16160x192x16
234Graphic 160x200x16160x200x16
235Graphic 160x225x16160x225x16
236Graphic 256x192x16256x192x16
237Graphic 256x200x16256x200x16
238Graphic 256x225x16256x225x16
239Graphic 320x192x16320x192x16
240Graphic 320x200x16320x200x16
241Graphic 320x225x16320x225x16

Blitting images


Blitting operations are supported.

Calling and inlining assembly code

With the coco3 target you can include assembly code for the Motorola 6809 processor. The code will be placed within the code bank.

Supported video standard

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:

VERSIONNTSCPALTICKS PER SECOND
Tandy CoCo 3 (PAL)0 (FALSE)-1 (TRUE)50
Tandy CoCo 3 (NTSC)-1 (TRUE)0 (FALSE)60

Audio support

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.

Joystick and keyboard support

The ugBASIC language supports up to 2 joysticks, using the JOY(n) statement, and the keyboard. The left joystick is in port 0, while right joystick in port 1.