Graphics BASIC

Last updated

Graphics BASIC is a third-party extension to the Commodore BASIC V2.0 programming language of the Commodore 64 computer. It was originally written in 1983 by Ron Gilbert and Tom McFarlane. The program was licensed to Hesware, which briefly sold the program in 1984 as part of its product line before going out of business. The program was later extended by Ken Rose and Jack Thornton, and repackaged and sold in 1985 by Epyx under the title Programmers BASIC Toolkit.

Graphics BASIC adds over 100 new commands to the BASIC language, providing an easy-to-use API to the relatively advanced (at the time) graphics and sound hardware capabilities of the Commodore 64. The only access to these features with Commodore BASIC alone is through the cumbersome use of PEEK and POKE commands. Graphics BASIC was delivered on a single 5.25" floppy disk, containing the language itself and numerous, very simple demo programs showing off the new features of the language. A cartridge version was also available.

Features

Graphics

Graphics BASIC's main feature is its easy-to-use graphics commands, including commands to draw dots, lines, circles, ellipses, rectangles, and polygons. The following gives an example of how the commands were used:

DOT160,100LINE80,50TO240,150BOX10,10TO20,20

As can be seen from the above, the syntax is somewhat similar to that of GW-BASIC's or AmigaBASIC's graphics commands, but different enough to prevent source-code compatibility.

The Commodore 64 has separate video modes for text and graphics. Switching between these is extremely easy in Graphics BASIC. TEXT switches to text mode, HIRES switches to 320×200 two-colour graphics, and MULTI switches to 160×200 four-colour graphics. Graphics BASIC also allows the screen to be horizontally split between multiple modes.

Using all 16 colours is possible in both HiRes and Multi modes, but if two incompatible colours are drawn onto the same 8×8 pixel block, the entire block fills with the colour drawn later. This is due to a technical limitation of the Commodore 64's VIC-II display chip.

One of the more unusual choices of syntax in Graphics BASIC was the setting of graphics colours. To set the foreground and background colours of the text mode, you use the commands COLOUR and BACKGROUND, followed by either a number from 0 to 15, or a pre-defined symbolic constant such as WHITE or BLACK. To set the colours of the graphics mode, the command syntax is of the form:

COLOURHIRESxONy

where x is the foreground colour and y is the background colour. (For example, COLOUR HIRES BLACK ON WHITE).

Sprites

Graphics BASIC also provides commands to manipulate the Commodore 64's eight sprites. These sprites are 24×21 pixels in size, drawn in either 2 colours (1 colour + background) or 4 colours (3 colours + background). Each sprite has one individual colour to its own. In 3-colour mode, the horizontal resolution is halved, and all 3-colour sprites share the same 2 extra colours.

The compact syntax of the sprite commands has more in common with the command-line options of Unix programs than conventional programming languages. In essence, several sprite manipulations can be combined into one command, starting with the word SPRITE and the sprite's number, from 1 to 8. This is then followed by any number of keywords, and the parameters they need. As an example,

SPRITE1ONAT160,100COLOURBLUEXYSIZE2,2

does a total of four things: set sprite 1 as visible, move it into the location (160, 100) on the screen, set its individual colour to blue, and double its physical size both horizontally and vertically.

Graphics BASIC also supports automatic sprite movement (change in place), animation (change in shape), and collision detection. This is implemented in the language core itself by adding hooks into the Commodore 64's software interrupt routines. (The language does not support adding your own interrupt hooks.)

Sprite shapes can be drawn by hand with a built-in sprite editor, accessed with the command EDIT. The editor, while simple to use, was somewhat rudimentary. Sprite shapes can be loaded or saved to disk with the SPRITE LOAD and SPRITE SAVE commands. Programmatically drawing new sprite shapes can be done by drawing the shapes on the normal hires or multicolor screen, then copying the shapes with the COPY HIRES TO SPRITE or COPY MULTI TO SPRITE command.

Sound

Graphics BASIC also provides various commands to control the Commodore 64's built-in audio synthesizer, allowing the selection of waveform type, tone (frequency), and amplitude envelopes. In addition, sequences of tones can be specified and played automatically in the background.

Other commands

In addition to graphics and sound commands, Graphics BASIC also provides various other useful commands such as DIR to list the file directory of a device, JOY to return the position of a joystick, KEY to program function keys, REN to renumber the current program line numbers. Graphics BASIC also added an ON ERROR command to perform error capturing, a PROCEDURE command that allowed variables to be passed to subroutines, and added ELSE to the IF/THEN command.

Related Research Articles

<span class="mw-page-title-main">Commodore 64</span> 8-bit home computer introduced in 1982

The Commodore 64, also known as the C64, is an 8-bit home computer introduced in January 1982 by Commodore International. It has been listed in the Guinness World Records as the highest-selling single computer model of all time, with independent estimates placing the number sold between 12.5 and 17 million units. Volume production started in early 1982, marketing in August for US$595. Preceded by the VIC-20 and Commodore PET, the C64 took its name from its 64 kilobytes(65,536 bytes) of RAM. With support for multicolor sprites and a custom chip for waveform generation, the C64 could create superior visuals and audio compared to systems without such custom hardware.

<span class="mw-page-title-main">Original Chip Set</span> Chipset used in Amiga personal computer

The Original Chip Set (OCS) is a chipset used in the earliest Commodore Amiga computers and defined the Amiga's graphics and sound capabilities. It was succeeded by the slightly improved Enhanced Chip Set (ECS) and the greatly improved Advanced Graphics Architecture (AGA).

GRASS is a programming language created to script 2D vector graphics animations. GRASS was similar to BASIC in syntax, but added numerous instructions for specifying 2D object animation, including scaling, translation and rotation over time. These functions were directly supported by the Vector General 3D graphics terminal GRASS was written for. It quickly became a hit with the artistic community who were experimenting with the new medium of computer graphics, and is most famous for its use by Larry Cuba to create the original "attacking the Death Star will not be easy" animation in Star Wars (1977).

<span class="mw-page-title-main">ILBM</span> File format

Interleaved Bitmap (ILBM) is an image file format conforming to the Interchange File Format (IFF) standard. The format originated on the Amiga platform, and on IBM-compatible systems, files in this format or the related PBM format are typically encountered in games from late 1980s and early 1990s that were either Amiga ports or had their graphical assets designed on Amiga machines.

<span class="mw-page-title-main">MOS Technology VIC-II</span> Video microchip in the Commodore 64 and C128 home computers

The VIC-II, specifically known as the MOS Technology 6567/6566/8562/8564, 6569/8565/8566 (PAL), is the microchip tasked with generating Y/C video signals and DRAM refresh signals in the Commodore 64 and Commodore 128 home computers.

<span class="mw-page-title-main">Color Graphics Adapter</span> IBM PC graphic adapter and display standard

The Color Graphics Adapter (CGA), originally also called the Color/Graphics Adapter or IBM Color/Graphics Monitor Adapter, introduced in 1981, was IBM's first color graphics card for the IBM PC and established a de facto computer display standard.

<span class="mw-page-title-main">VTech Laser 200</span>

The VTech Laser 200 is an 8-bit home computer from 1983, also sold as the Salora Fellow, the Seltron 200 in Hungary and Italy, the Smart-Alec Jr. by Dynasty Computer Corporation in Dallas, Texas for the USA, the Texet TX8000A, and the Dick Smith VZ 200 and the VTech VZ 200.

<span class="mw-page-title-main">Enterprise (computer)</span> Zilog Z80-based home computer

The Enterprise is a Zilog Z80-based home computer announced in 1983, but through a series of delays, not commercially available until 1985. It was developed by British company Intelligent Software and marketed by Enterprise Computers.

<span class="mw-page-title-main">MOS Technology 8563</span>

The 8563 Video Display Controller (VDC) was an integrated circuit produced by MOS Technology. It was used in the Commodore 128 (C128) computer to generate an 80-column RGB video display, running alongside a VIC-II which supported Commodore 64-compatible graphics. The DCR models of the C128 used the later and more technically advanced 8568 [D]VDC controller.

<span class="mw-page-title-main">TMS9918</span> Video display controller

The TMS9918 is a video display controller (VDC) manufactured by Texas Instruments, in manuals referenced as "Video Display Processor" (VDP) and introduced in 1979. The TMS9918 and its variants were used in the ColecoVision, CreatiVision, Memotech MTX, MSX, NABU Personal Computer, SG-1000/SC-3000, Spectravideo SV-318, SV-328, Sord M5, Tatung Einstein, TI-99/4, Casio PV-2000, Coleco Adam, Hanimex Pencil II, and Tomy Tutor.

<span class="mw-page-title-main">Attribute clash</span>

Attribute clash is a display artifact caused by limits in the graphics circuitry of some colour 8-bit home computers, most notably the ZX Spectrum, where it meant that only two colours could be used in any 8×8 tile of pixels. The effect was also noticeable on MSX software and in some Commodore 64 titles. Workarounds to prevent this limit from becoming apparent have since been considered an element of Spectrum programmer culture.

<span class="mw-page-title-main">CTIA and GTIA</span>

Color Television Interface Adaptor (CTIA) and its successor Graphic Television Interface Adaptor (GTIA) are custom chips used in the Atari 8-bit family of computers and in the Atari 5200 home video game console. In these systems, a CTIA or GTIA chip works together with ANTIC to produce the video display. ANTIC generates the playfield graphics while CTIA/GTIA provides the color for the playfield and adds overlay objects known as player/missile graphics (sprites). Under the direction of Jay Miner, the CTIA/GTIA chips were designed by George McLeod with technical assistance of Steve Smith.

BASIC 8 – "The Enhanced Graphics System For The C128" – was an American-designed graphics system developed by Walrusoft of Gainesville, Florida and published in 1986 by Patech Software of Somerset, New Jersey. The system was an extension of Commodore's BASIC 7.0 for the C128 home/personal computer. BASIC 8.0 provided commands lacking in BASIC 7.0 to generate (color) graphics in the C128's high-resolution 80-column mode for RGB monitors.

<span class="mw-page-title-main">Super Expander</span>

The VIC-1211 Super Expander is a cartridge for the VIC-20 home computer. It was designed to provide several extensions to the BASIC interpreter on the computer, mostly to help with programming graphics and sound. It also provided 3 kB of extra RAM. The cartridge was created by Commodore Business Machines (CBM) and released in 1981.

<span class="mw-page-title-main">Simons' BASIC</span>

Simons' BASIC is an extension to BASIC 2.0 for the Commodore 64 home computer. Written by British programmer David Simons in 1983, who was 16 years old at the time, it was distributed by Commodore as a cartridge.

<span class="mw-page-title-main">ZX Spectrum graphic modes</span> Graphic modes of the ZX Spectrum computer

The original ZX Spectrum computer outputs video through an RF modulator and was designed for use with contemporary 1980s television sets, for a simple colour graphic display.

Super Expander 64 is a cartridge-based extension to the built in BASIC interpreter of Commodore 64 home computer. It was published by Commodore Business Machines in 1983. The built-in BASIC of the C64 was adapted from the PET and VIC 20, and the language does not have direct support for the system's sound and graphics hardware. Super Expander 64 adds functions for drawing graphics, using sprites, reading joysticks, playing audio, and other features.

<span class="mw-page-title-main">Oric</span> UK-manufactured 8-bit computer

Oric was the name used by UK-based Tangerine Computer Systems for a series of 6502-based home computers sold in the 1980s, primarily in Europe.