HOME

TheInfoList



OR:

Super Expander 64 is a cartridge-based extension to the built in
BASIC Basic or BASIC may refer to: Science and technology * BASIC, a computer programming language * Basic (chemistry), having the properties of a base * Basic access authentication, in HTTP Entertainment * Basic (film), ''Basic'' (film), a 2003 film ...
interpreter Interpreting is translation from a spoken or signed language into another language, usually in real time to facilitate live communication. It is distinguished from the translation of a written text, which can be more deliberative and make use o ...
of
Commodore 64 The Commodore 64, also known as the C64, is an 8-bit computing, 8-bit home computer introduced in January 1982 by Commodore International (first shown at the Consumer Electronics Show, January 7–10, 1982, in Las Vegas). It has been listed in ...
home computer Home computers were a class of microcomputers that entered the market in 1977 and became common during the 1980s. They were marketed to consumers as affordable and accessible computers that, for the first time, were intended for the use of a s ...
. It was published by
Commodore Business Machines Commodore International Corporation was a home computer and electronics manufacturer with its head office in The Bahamas and its executive office in the United States founded in 1976 by Jack Tramiel and Irving Gould. It was the successor comp ...
in 1983. The built-in BASIC of the C64,
Commodore BASIC Commodore BASIC, also known as PET BASIC or CBM-BASIC, is the Dialect (computing), dialect of the BASIC programming language used in Commodore International's 8-bit home computer line, stretching from the Commodore PET, PET (1977) to the Commodore ...
, was adapted from the
PET A pet, or companion animal, is an animal kept primarily for a person's company or entertainment rather than as a working animal, livestock, or a laboratory animal. Popular pets are often considered to have attractive/ cute appearances, inte ...
and VIC 20, and the language does not have direct support for the system's sound and graphics hardware. Access to the hardware had to be done though directly accessing the memory locations mapped to the specific
hardware register In digital electronics, especially computing, hardware registers are circuits typically composed of flip-flops, often with many characteristics similar to memory, such as: * Using an memory or port address to select a particular register in a ma ...
s using
PEEK Polyether ether ketone (PEEK) is a beige coloured organic thermoplastic polymer in the polyaryletherketone (PAEK) family, used in engineering applications. It was invented in November 1978 and brought to market in the early 1980s by part of I ...
and
POKE Poke may refer to: Arts, entertainment, and media * Poke (Ender's Game), Poke (''Ender's Game''), a fictional character * Poke (game), a two-player card game * Poke, a fictional bar owner in the television series ''Treme (season 2), Treme'' * The ...
statements. Super Expander 64 adds functions for drawing graphics, using sprites, reading joysticks, playing audio, and other features. The extra code is mapped into the "lower cartridge" 8 kilobytes area at $8000-$9FFF, reducing the 38,911 bytes for user programs by said 8K.


Graphics

After initializing the screen for "high-resolution" (320 × 200 monochrome pixels) or multicolor (160 wide × 200 pixels in four colors) graphics with the GRAPHIC command, one could draw lines, circles, ellipses, arcs, boxes and more using the DRAW, CIRCLE, and BOX commands. PAINT would "flood-fill" an area enclosed by lines, e.g. the interior of a CIRCLE or BOX. A CHAR command was used to "print" characters from the
character generator A character generator, often abbreviated as CG, is a device or software that produces static or animated text (such as news crawls and credits rolls) for keying into a video stream. Modern character generators are computer-based, and they can ...
ROM Rom, or ROM may refer to: Biomechanics and medicine * Risk of mortality, a medical classification to estimate the likelihood of death for a patient * Rupture of membranes, a term used during pregnancy to describe a rupture of the amniotic sac * ...
onto the
bitmap graphics upright=1, The Smiley, smiley face in the top left corner is a raster image. When enlarged, individual pixels appear as squares. Enlarging further, each pixel can be analyzed, with their colors constructed through combination of the values for ...
screen. SSHAPE and GSHAPE would store the contents of a rectangular area of the high-res graphics into a
string String or strings may refer to: *String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects Arts, entertainment, and media Films * ''Strings'' (1991 film), a Canadian anim ...
variable, and GSHAPE would "stamp" it back onto the screen at arbitrary locations. Such "graphics-in-a-string" could also be used to transfer something drawn on the hi-res screen into one of the eight sprite patterns.


Sprites

Besides a range of commands to initialize, position and move sprites (or Movable Object Blocks as Commodore called them; hardware-supported graphic elements that could move freely on the screen independently of other graphics and text on the screen), Super Expander had a built in tool to edit the pattern of 8 sprites (called upon with the SPRDEF command), either in high-res (24 × 21 pixels) or multicolor (12 wide × 21 pixels) mode. There was even a way of implementing "interrupts" in the BASIC program if two sprites collided, if a sprite collided with other graphics and/or text on the screen, or if an attached light pen was activated. A COLINT command set up the interrupt, pointing to the beginning BASIC line number of the "
interrupt handler In computer systems programming, an interrupt handler, also known as an interrupt service routine (ISR), is a special block of code associated with a specific interrupt condition. Interrupt handlers are initiated by hardware interrupts, software ...
", which had to end in a RETURN statement (part of standard, unexpanded BASIC) in order to transfer control back to the interrupted, "mainline" part of the program.


Sound

Playing a sequence of musical notes was hooked onto the standard BASIC PRINT command by the use of a special "control character", much like the cursor control, color changes and other control characters. E.g. played a rising scale. Commands like TEMPO and TUNE was used to set the playback tempo and the timbre of the note sequence. A "quirk" of this feature is that by typing the special control character (by pressing ) along with a quote mark, then deleting the quote mark, the machine would "play" whatever was typed while editing the program; hit the G key, and the machine played a "Pling!" with the pitch of a G note...!


Hardware I/O

Functions like RJOY, RPEN and RPOT would read the state of a connected joystick,
light pen A light pen is a computer input device in the form of a light-sensitive wand used in conjunction with a computer's cathode-ray tube (CRT) display. It allows the user to point to displayed objects or draw on the screen in a similar way to a to ...
, or analog
paddle A paddle is a handheld tool with an elongated handle and a flat, widened end (the ''blade'') used as a lever to apply force onto the bladed end. It most commonly describes a completely handheld tool used to propel a human-powered watercraft by p ...
. In combination with the sprite-motion-related commands, it only took a single line of BASIC code to make a sprite move in the direction indicated by a connected joystick.


Miscellaneous

A KEY command was available, which would set up the four function keys on the 64's keyboard to "enter" an arbitrary string. By default, these keys were set up to type commands like RUN, LIST, SPRDEF, GRAPHICS and others, but the user could change this using the KEY command in either direct mode or under program control.


Technical issues

All the versions of BASIC on Commodore's 8-bit machines used a scheme of replacing BASIC keywords with single-byte code -- e.g. the word "" would be substituted by a single byte value, or ''token'', rather than the five ASCII-codes for the five letters in the word. Super Expander added more commands than this system could accommodate, so a system of two-byte tokens for the new commands was implemented. Because of a quirk in the BASIC interpreter (the handling of the "THEN-part" of an IF/THEN construct didn't jump through a vector in RAM but instead took a direct JuMP to the standard, unexpanded BASIC command decoding routine), IF/THEN statements needed to have an extra colon (:) inserted right after the THEN keyword, if the following command was one of Super Expander's non-standard BASIC keywords. For instance, would yield a message — one had to write it like — note the colon between THEN and the Super Expander-added command DRAW. The manual is available online as an etext.


References

{{BASIC CBM software Commodore 64 BASIC extensions Commodore 64 software