Codex Gamicus
Advertisement


The Commodore 128 (C128, CBM 128, C=128) home/personal computer was the last 8-bit machine commercially released by Commodore Business Machines (CBM). Introduced in January 1985 at the CES in Las Vegas, it appeared three years after its predecessor, the bestselling Commodore 64.

The C128 was a significantly expanded successor to the C64 and unlike the earlier Commodore Plus/4, nearly full compatibility with the C64 was retained, in both hardware and software. The new machine featured 128 KB of RAM, in two 64 KB banks and an 80-column RGBI video output (driven by the 8563 VDC chip with 16 KB dedicated video RAM), as well as a substantially redesigned case and keyboard. Also included was a Zilog Z80 CPU which allowed the C128 to run CP/M, as an alternate to the usual Commodore BASIC environment.

The primary hardware designer of the C128 was Bil Herd, who had worked on the Plus/4. Other hardware engineers were Dave Haynie and Frank Palaia, while the IC design work was done by Dave DiOrio. The main Commodore system software was developed by Fred Bowen and Terry Ryan, while the CP/M subsystem was developed by Von Ertwine.[1]

Contents[ | ]

 [1] *1 Technical overview

editTechnical overview[ | ]

The C128's keyboard included four cursor keys (previous Commodores had two, which required using the shift key to move the cursor up or left. These were retained on the 128, for C64 compatibility), an Alt key, Help key, Esc key, Tab key (not present on prior models) and a numeric keypad. The lack of a numeric keypad, Alt key and Esc key on the C-64 were an issue with some CP/M productivity software when used with the 64's Z-80 cartridge. Many of the added keys matched ones present on the IBM PC's keyboard. While the 128's 40 column mode closely duplicated that of the C64, an extra 1K of color RAM was made available to the programmer, as it was multiplexed through memory address 1. The 128's power supply was vastly improved over the 64's unreliable design, being much larger and equipped with cooling vents and a replaceable fuse. Instead of the single 6510 microprocessor of the C64, the C128 incorporated a two-CPU design. The primary CPU, the 8502, was a slightly improved version of the 6510 capable of being clocked at 2 MHz. The second CPU was a Zilog Z80 which was used to run CP/M software, as well as to initiate operating mode selection at boot time. The two processors could not run concurrently, thus the C128 was not a multiprocessing system.

The C128's complex[2][3] architecture includes four differently accessed kinds of RAM (128 kB main RAM, 64 kB VDC Video RAM, 2 kNibbles VIC-II Color RAM, 2 kB floppy drive RAM, 128 or 512 kB REU RAM), two CPUs (main 8502, Z80 for CP/M; the 128D also incorporated a 6502 in the disk drive) and two different video chips (VIC-IIe and VDC) for its various operational modes.[4][5]

The C128 had three operating modes: C128 Mode (native mode), which ran at 1 or 2 MHz with the 8502 CPU and had both 40- and 80-column text modes available; CP/M Mode, which used the Z80 in either 40- or 80-column text mode; and C64 Mode, which was nearly 100 percent compatible with the earlier computer. Selection of these modes was implemented via the Z80 chip. The Z80 controls the bus on initial boot-up and checks to see if there is a CP/M disk in the drive, if there are any C64/C128 cartridges present, and if the Commodore key (C64-mode selector) is active on boot-up. Based on what it finds, it will switch to the appropriate mode of operation.

editC128 Mode[ | ]

[2][3] C128 Main board

While the C64's graphics and sound capabilities were generally considered excellent, the response to the Plus/4, which was perceived by the Commodore press as a follow-on model, was that of disappointment. Repeated recommendations were made for a new computer called the "C-128" with increased RAM capacity, an 80-column display as was standard in business computers, a new BASIC programming language that made it easy for programmers to use the computer's graphics and sound without resorting to PEEK and POKEs, a new disk drive that improved upon the 1541's abysmal transfer rate, as well as total C-64 compatibility[6][7]

The designers of the C128 succeeded in addressing most of these concerns. A new chip, the VDC, provided the C128 with an 80-column color CGA-compatible display (also called RGBI for red-green-blue plus intensity). The new 8502 microprocessor was completely backward-compatible with the C64's 6510, but could run at double the speed if desired. However, the VIC-II chip which controlled the 40-column display could not operate at the faster clock rate, so the 40 column display appears jumbled in FAST mode. The C64's BASIC 2.0 was replaced with BASIC 7.0, which included structured programming commands from the Plus/4's BASIC 4.5, as well as keywords designed specifically to take advantage of the machine's capabilities. A sprite editor and machine language monitor were added. The screen editor part of the Kernal was further improved to support a rudimentary windowing feature and was relocated to a separate ROM. In 80-column mode the editor took advantage of VDC features to provide blinking and underlined text, activated through escape codes.[1] A hardware reset button was added to the system.

The VDC chip was largely useless for gaming since it had no sprites or raster interrupts. NTSC C128s will work with any CGA-type monitor (TTL RGB @ 15Khz/60Hz) such as the IBM 5153. However, PAL models of the C128 operate at 50Hz and aren't compatible with most CGA monitors (trying to use them will cause uncontrolled rolling of the picture) since they expect a 60Hz refresh rate. Pin 7 of the VDC output (normally unused on CGA monitors) produces a monochrome NTSC/PAL signal, but no cable was provided for it and users had to make their own homemade one.

Two new disk drives were introduced in conjunction with the C128, the short-lived single-sided 1570 and the dual-sided 1571. Later on, the 3.5 inch 1581 was introduced. All of these drives were more reliable than the 1541 and promised much better performance via a new "burst mode" feature. The 1581 drive also had more on-board RAM than its predecessors, making it possible to open a larger number of files at one time. BASIC 7.0 included DLOAD and DSAVE commands to support loading and saving to disk without using the ",8" device number, and also a DIRECTORY command that read a disk's catalog information directly to screen memory without overwriting BASIC memory as in BASIC 2.0. In addition, the C128 introduced auto-booting of disk software, a feature standard on most personal computers, but absent from Commodore machines up to that point (users no longer had to type LOAD"*",8,1). 1571 drives normally will start up in native mode on the C128. If the user switches to C64 mode by typing "GO 64", the drive stays like this, but if C64 mode is activated by holding the C= key down on power-up, 1571s go into 1541 mode (1541 mode is necessary for software that performs low-level drive access),

The C128 also had twice the RAM of the C64, and a far higher proportion was available for BASIC programming, due to the new MMU bank-switching chip. This allowed BASIC program code to be stored separately from variables, greatly enhancing the machine's ability to handle complex programs, speeding garbage collection and easing debugging for the programmer. An executing program could be STOPped, variable values inspected or altered in direct mode, and program execution resumed with the variable table intact using BASIC's GOTO command.

The 128's ROM contained an easter egg: Entering the command "SYS 32800,123,45,6" in native mode reveals a 40-column screen with a listing of, and a message from, the machine's main developers. Also, entering the keywords QUIT or OFF will produce an "?UNIMPLEMENTED COMMAND ERROR". These commands are holdovers from the BASIC interpreter intended for a planned but never produced LCD-display portable computer and were intended to exit from the BASIC interpreter and to ignore keyboard input during sensitive program execution, respectively.

The C128's greater hardware capabilities, especially the increased RAM, screen display resolution, and serial bus speed, made it the preferred platform for running the GEOS graphical operating system.[who?]

editCP/M Mode[ | ]

[4][5] Using CP/M mode required use of a boot diskette

The second of the C128's two CPUs was the Zilog Z80, which allowed the C128 to run CP/M. The C128 was shipped with CP/M 3.0 (aka CP/M Plus, which was backward compatible with CP/M 2.2) and ADM31/3A terminal emulation. The C64 had had a CP/M cartridge, but it was expensive and of limited usability since the 1541 drives could not read standard MFM-formatted disks that CP/M software was distributed on. In addition, the cartridges only worked on early-model C64s from 1982 and were incompatible with later units. Since they also wouldn't work with the C128, the design team decided to get around this problem by putting the Z80 on the main system board.

Unfortunately, the C128 ran CP/M noticeably slower than most dedicated CP/M systems, as the Z80 processor ran at an effective speed of only 2 MHz (instead of the more common 4 MHz), and because it used CP/M 3.0, whose complexity made it inherently slower than the earlier, more widespread, CP/M 2.2 system. From the source code of the C128 CP/M implementation, it is clear that the engineers originally planned to make it possible to run CP/M in the "fast" mode as well, with the 40-column output turned off and the Z80 running at an effective 4 MHz; however, this feature did not correctly function on the first generation C128 hardware.

An unusual feature of the C128 among CP/M systems was that some of the low-level BIOS services were executed by the 8502 instead of the Z80. The latter transferred control to the 8502 after having placed the pertinent parameter values in designated memory locations. The Z80 then turned itself off, being awoken by the 8502 at completion of the BIOS routine, with status value(s) available in RAM for inspection. The reason for this was so that the Commodore development team would not have to rewrite the OS routines for two completely different CPU instruction sets.

CP/M mode was very different from the operating environments Commodore users had become familiar with. While Commodore DOS was built into the ROM of Commodore disk drives and was usually accessed through BASIC, CP/M required the use of a boot diskette and required entry of terse commands inherited from minicomputer platforms. CP/M programs tended to lack the user-friendly nature of most Commodore applications. Intended to give the new computer a large library of professional-grade business software that Commodore lacked, CP/M was an old operating system in decline by the late 1980s (having since been overtaken by MS-DOS and PC compatibles), and so it was seldom used on the C128.

editC64 Mode[ | ]

By incorporating the original C64 BASIC and kernal ROMs in their entirety (16 KB total), the C128 achieved almost 100 percent compatibility with the Commodore 64. The C64 mode can be accessed in one of three ways:

  • Hold down the Commodore logo key when booting the system
  • Enter the GO64 command in BASIC 7.0
  • Boot with a C64 cartridge plugged in

Grounding the cartridge port's /EXROM and/or /GAME lines will cause the computer to automatically start up in C64 mode. This feature faithfully duplicates the C64 behavior when a cartridge (such as Simons' BASIC) is plugged into the port and asserts either of these lines, but unlike the C64, where the Memory-map changing action of these lines is implemented directly in hardware, the C128's Z80 firmware startup code polls these lines on power-up and then switches modes as necessary. C128 native mode cartridges are recognized and started by the kernal polling defined locations in the memory map.

C64 mode almost exactly duplicated the features of a hardware 64; many of the 128's additional features were disabled or unavailable in this mode. The 80 column display, fast mode, MMU, and BASIC 7.0 were not available in 64 mode. The 4 cursor keys at the top of the keyboard were unrecognized, forcing the user to use the 64's cumbersome shifted key arrangement, which were included at the bottom of the 128 keyboard. Also ignored were the 128's numeric keypad and added top-row keys (the only top row keys that were functional in 64 mode were the f1-f8 keys above the keypad.) Some of these features could be turned back on by user software but most commercial programs would ignore them at best, or be completely nonfunctional with these user "wedge" programs in memory.

When in C64 mode, even the character (font) ROM changed from that of C128 mode. Early C128 prototypes had a single ROM, with a slightly improved character set over that of the C64. But some C64 programs read the character ROM as data, and would fail in various ways on a C128. Thus, the C128 was given a double-sized character ROM, which delivered the C128 font in C128 mode, the C64 font in C64 mode.

Some of the few C64 programs that fail on a C128 run correctly when the CAPS LOCK key is pressed down (or the ASCII/National key on international C128 models). This has to do with the larger built-in I/O port of the C128's CPU. Whereas the SHIFT LOCK key found on both C64 and C128 is simply a mechanical latch for the left SHIFT key, the CAPS LOCK key on the C128 can be read via the 8502's built-in I/O port. A few C64 programs are confused by this extra I/O bit; keeping the CAPS LOCK key in the down position will force the I/O line low, matching the C64's configuration and resolving the issue. he main reason that the C128 still sold fairly well was probably that it was a much better machine for hobbyist programming than the C64. A handful of C64 programs wrote to $ D030 (53296), often as part of a loop initializing the VIC-II chip registers. This memory-mapped register, unused in the C64, determined the system clock rate. Since this register was fully functional in C64 mode, an inadvertent write could scramble the 40-column display by switching the CPU over to 2–MHz, at which clock rate the VIC-II video processor could not produce a coherent display. Fortunately, few programs suffered from this flaw. In July 1986, COMPUTE!'s Gazette published a type-in program that exploited this difference by using a raster interrupt to enable fast mode when the bottom of the visible screen was reached, and then disable it when screen rendering began again at the top. By using the higher clock rate during the vertical blank period, standard video display was maintained while increasing overall execution speed by about 20 percent.[8][9]

An easy way to differentiate between a hardware C64 and a C128 operating in C64 mode, typically used from within a running program, is to write a value different from $ FF (255) to memory address$D02F (53295), a register which is used to decode the extra keys of the C128 (the numerical keypad and some other keys). On the 64 this memory location will always contain the value $FF no matter what is written to it, but on a C128 in 64 mode the value of the location—a memory-mapped register—can be changed. Thus, checking the location's value after writing to it will reveal the actual hardware platform.

editRAM setup[ | ]

To handle the relatively large amounts of ROM and RAM, tenfold the 8502's 64 KB address space, the C128 used the 8722 MMU chip to create different memory maps, in which different combinations of RAM and ROM would appear according to bit patterns written into the MMU's confguration register at memory address $FF00.

Commodore's RAM Expansion Units utilized an external DMA controller to read and write one or more bytes (up to entire ranges of bytes) between the C-128's RAM and the RAM in the expansion unit.

Another feature of the memory management unit was to allow relocation of Zero page and the Stack, which, thanks to the Direct Page register.

editCommodore 128D[ | ]

[6][7] Commodore 128D on display at the Musée Bolo, EPFL, Lausanne.

Late in 1985, Commodore released to the European market a new version of the C128 with a redesigned chassis. Called the Commodore 128D, this new European model featured a plastic chassis with a carrying handle on the side, incorporated a 1571 disk drive into the main chassis, replaced the built-in keyboard with a detachable one, and added a cooling fan. The keyboard featured two folding legs for changing the typing angle.

In the latter part of 1986, Commodore released a version of the C128D in North America and Europe referred to as the C128DCR ("cost reduced"). The DCR model featured a stamped steel chassis in place of the plastic version of the C128D (with no carrying handle), a modular switched-mode power supply similar to that of the C128D, as well as a removable keyboard and internal 1571 floppy drive. On the mainboard, Commodore consolidated some of the components to save production costs and replaced the 8563 video controller with the more technically advanced MOS Technology 8568 (which was also fitted to a few D-models). As a cost-saving measure, the cooling fan that was fitted to the D model was removed, although the mounting provisions on the power supply subchassis were retained.

Inside, the C128DCR ROMs, the "1986 ROMs," so-named from the copyright date displayed on the startup screen, contained fixes for several bugs —including an infamous one where the 'Q' character would remain lowercase when CAPS LOCK was active—and the 8568 VDC was equipped with 64 KB of video RAM—the maximum amount addressable by the chip, equal to four times that of the original C128. The increase in video RAM made it possible, among other things, to generate higher-resolution graphics with a more flexible color palette, although little commercial software took advantage of this capability.

Despite the improvement in the RGB video capabilities, Commodore did not enhance BASIC 7.0 with the ability to manipulate RGB graphics. Driving the VDC in graphics mode continued to require the use of calls to screen editor ROM primitives (or their assembly language equivalents), or by using third-party BASIC language extensions. The most popular such toolkit was Free Spirit Software's "BASIC 8", which added high-resolution VDC graphics commands to BASIC 7.0. BASIC 8 was available on two disks (editor disk and runtime disk) and with a ROM chip for installation in the C128's internal Function ROM socket.

editMarket performance[ | ]

Because the C128 would run virtually all C64 software, and because the next-generation, 32/16-bit home computers, primarily the Commodore Amiga and Atari ST, were gaining ground, relatively little software for the C128's native mode appeared (probably on the order of 100–200 commercial titles, plus the usual share of public domain and magazine type-in programs). While the C128 sold a total number of 4 million units between 1985 and 1989, its popularity paled in comparison to that of its predecessor. This has been blamed on the lack of native software and on Commodore's less-aggressive marketing, which was mostly focused on the Amiga by this time.[citation needed] In addition, since the C128 used the same unaltered VIC-II and SID chips as the C64, it offered relatively little improvement for gaming. Games that did exist for it were all C64 titles with C128 "enhanced mode" support, including Infocom text adventures, Kikstart 2, Ultima V and VI, and The Last V8. Overall, most C128-specific software consisted of productivity titles such as Paperclip Writer.[10] This software used the extra memory, 80 column screen and large capacity disk drives to provide features that were considered essential for business use. The C128 was certainly a better business machine than the C64, but not really a better gaming machine. As a productivity machine, it couldn't compete with PC compatibles in the corporate market, but it was never really intended to anyway. Commodore mainly pitched the C128 at home users who wanted both to play games and do work tasks, but they also had to content with a rising wave of low-cost PC compatibles from Asia such as Leading Edge and Acer, plus Tandy 1000s, all of which were able to run the same applications like Wordperfect and Lotus 123 as their more expensive brethren. There was a professional-level CAD program, Home Designer by BRiWALL,[11] but again, most of this work was done on PCs by the 128s era. That the C128 still became the second best-selling Commodore 8-bit computer had to do with its C64 compatibility plus offering much more convenience/ease-of-use features.

Like the rest of its 8-bit generation however, it ultimately could not compete with the new 16/32-bit systems. When the C128(D/DCR) was discontinued in 1989, it was reported to cost nearly as much to manufacture as the Amiga 500, even though the C128D had to sell for several hundred dollars less to keep the Amiga's high-end marketing image intact.

Bil Herd has stated that the design goals of the 128 did not initially include 100% compatibility with the C64. Some form of compatibility was always intended after Herd was approached at the Plus/4's introduction by a woman who was disappointed that the educational software package she had written for the C-64 would not run on Commodore's new computer, but when Commodore's marketing department learned of this, they demanded total compatibility. Herd gave the reason for the 128's inclusion of a Z-80 processor as to ensure this "100% compatibility" claim, since supporting the 64's Z-80 cartridge would have meant the 128 supplying additional power to the cartridge port. He also stated that the VDC video chip and Z80 were sources of trouble during the machine's design. Herd added that "I only expected the C128 to be sold for about a year, we figured a couple of million would be nice and of course it wouldn’t undercut Amiga or even the C64"[12]

editReliability concerns[ | ]

Early versions of the C128 occasionally experienced temperature-related reliability issues due to the use of an electromagnetic shield over the main circuit board. The shield was equipped with fingers that contacted the tops of the major chips, ostensibly causing the shield to act as a large heat sink. A combination of poor contact between the shield and the chips, the inherently limited heat conductivity of plastic chip packages, as well as the relatively poor thermal conductivity of the shield itself, resulted in overheating and failure in some cases. The SID sound chip was particularly vulnerable in this respect. The most common remedy was to remove the shield, which Commodore had only added in order to comply with FCC radio frequency regulations.

The Commodore 128's BASIC 7.0, the programming language which comes built-in with the computer, can be crashed or cause the computer to reboot by executing PRINT""+-0. This bug is present in all 8-bit Commodore machines.[13]

editSpecifications[ | ]

  • CPUs:[14]
  • MMU: Memory Management Unit controls 8502/Z80 processor selection; ROM/RAM banking; common RAM areas; relocation of zero page and stack
  • RAM: 128 KB system RAM, 2 KB 4-bit dedicated color RAM (for the VIC-II E), 16 KB or 64 KB dedicated video RAM (for the VDC), up to 512 KB REU expansion RAM
  • ROM: 72 KB
    • 28 KB BASIC 7.0
    • 4 KB MLM
    • 8 KB C128 KERNAL
    • 4 KB screen editor
    • 4 KB Z80 BIOS
    • 16 KB C64 ROM: ≈9 KB C64 BASIC 2.0 + ≈7 KB C64 KERNAL
    • 4 KB C64 (or international) character generator
    • 4 KB C128 (or national) character generator
    • 32 KB Internal Function ROM (optional: for placement in motherboard socket)
    • 32 KB External Function ROM (optional: for placement in REU socket)
  • Video:
    • MOS 8564/8566 VIC-II E (NTSC/PAL) for 40-column composite video (a TV set can be used instead of a monitor if desired)
      • Direct register access through memory-mapped I/O
      • Text mode: 40×25, 16 colors
      • Graphics modes: 160×200, 320×200
      • 8 hardware sprites
      • 2 KB dedicated 4-bit color RAM, otherwise uses main memory as video RAM
    • MOS 8563 VDC (or, in C128DCR, the 8568) for 80-column digital RGBI component video, compatible with IBM PC CGA monitors, monochrome display also possible on composite video monitors; usable with TV sets only when the set has SCART and/or baseband video-in sockets in addition to the antenna connector. Color is possible through SCART, only monochrome through baseband video-in.
      • Indirect register access (address register, data register in mapped memory)
      • Text mode: Fully programmable, typically 80×25 or 80x50, 16 RGBI colors (not the same palette as the VIC-II)
      • Graphics modes: Fully programmable, typical modes are 320x200, 640×200, and 640×400 (interlaced).
      • 16 KB dedicated video RAM (64 KB standard in C128DCR, C128/C128D could be upgraded to 64 KB), accessible to the CPU only in a doubly indirect method (address register, data register on VDC, which in turn are addressed through address register, data register in mapped memory)
      • Limited blitter functionality
  • Sound:
  • I/O Ports:
    • All Commodore 64 ports with 100 percent compatibility, plus the following:
    • Higher "burst mode" speed possible on the serial bus
    • Expansion port more flexibly programmable
    • RGBI video output (DE9-connector) logically similar to the IBM PC CGA connector, but with an added monochrome composite signal. This added signal causes a minor incompatibility with certain CGA monitors that can be rectified by removing pin 7 from the plug at one end of the connecting cable.
    • External keyboard input (DB25-connector) (C128D(CR) only)
Advertisement