Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Commodore 128
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Modes == === C128 === [[file:C128mobo.jpg|thumb|C128 main board]] In 1984, a year before the release of the Commodore 128, Commodore released the Plus/4. Although targeted at a low-end business market that could not afford the relatively high cost and training requirements of early IBM PC compatibles, it was perceived by the Commodore press as a follow-up to the 64 and would be expected to improve upon that model's capabilities. While the C64's graphics and sound capabilities were generally considered excellent, the response to the Plus/4 was one of disappointment. Upon the Plus/4's introduction, repeated recommendations were made in the Commodore press 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 POKE]]s, a new disk drive that improved upon the [[Commodore 1541|1541]]'s notoriously slow default transfer rate (without fastloader), as well as total C64 compatibility.<ref>{{cite web|url=http://www.commodore.ca/gallery/magazines/misc/Plus_4_C-16_Disappointing_TPUG_Feb_1985.pdf|title=Plus/4 and C-16: Disappointingly Mediocre}}</ref><ref>{{cite web|url=http://www.atarimagazines.com/creative/v10n12/216_Commodores_port_preview.php|title=Commodore's port; preview of the Plus 4, the Amiga, and Alphacom printers}}</ref> A new chip, the [[MOS Technology 8563|VDC]], provides the C128 with an 80-column color [[Color Graphics Adapter|CGA]]-compatible display (also called ''RGBI'' for ''red-green-blue plus intensity''). The then-new 8502 microprocessor is completely backward-compatible with the C64's 6510, but can run at double the speed if desired. The C64's Commodore BASIC 2.0 was replaced with BASIC 7.0, which includes [[structured programming]] commands from the Plus/4's BASIC 3.5, as well as keywords designed specifically to take advantage of the machine's capabilities. A [[sprite (computer graphics)|sprite]] editor and [[machine language monitor]] were added. The screen-editor part of the [[KERNAL|Kernal]] was further improved to support an [[insert mode]] and other features accessed through ESC-key combinations, as well as a rudimentary windowing feature, and was relocated to a separate [[read-only memory|ROM]]. The VIC-II chip which controls the 40-column display can only operate at 1 MHz, so the 40-column display appears jumbled in <CODE>FAST</CODE> mode. In 80-column mode the editor takes advantage of VDC features to provide blinking and underlined text, activated through [[escape code]]s, in addition to the standard Commodore reverse text.<ref>{{cite web |url=http://www.commodore.ca/manuals/128_system_guide/app-i.htm |title=C128 System Guide{{snd}} Appendix I |publisher=Commodore.ca |access-date=18 April 2012 |archive-url=https://web.archive.org/web/20120531135501/http://www.commodore.ca/manuals/128_system_guide/app-i.htm |archive-date=31 May 2012 |url-status=dead }}</ref> The C128's 80-column mode can display lowercase characters along with [[PETSCII]] graphics characters; 40-column mode is subject to the same "upper- and lowercase" or "uppercase-plus-graphics" restriction as earlier Commodores.<ref>{{harvnb|Waite|Lafore|Volpe|1982}}</ref> The 40- and 80-column modes are independent and both can be active at the same time. A programmer with both a composite and RGB display can use one of the screens as a "scratchpad" or for rudimentary multiple buffer support. The active display can be switched with {{Key press|ESC|X}}.<ref>{{cite magazine|url=https://archive.org/stream/run-magazine-1986-special/Run_Issue_Special_2_1986#page/n69/mode/2up|title=Missing Link Uncovered |pages=66–68 |magazine=[[Run (magazine)|RUN]] | issue=Special Issue 2 |year=1986}}</ref> A hardware reset button was added to the system. The keyboard, however, was not switched to the [[IBM Selectric typewriter|Selectric]] layout as had become standard, instead retaining the same [[ADM-3A]]-derived design as on Commodore's prior models. [[file:Commodore-128-Computer-BL-Low.jpg|thumb|The back of the Commodore 128]] NTSC C128s will work with any [[CGA monitor|CGA-type monitor]] ([[Transistor–transistor logic|TTL]] RGB @ 15 kHz/60 Hz) such as the IBM 5153. However, PAL models of the C128 operate at 50 Hz and aren't compatible with most CGA monitors, which expect a 60 Hz refresh rate. Two new disk drives were introduced in conjunction with the C128: the short-lived single-sided [[Commodore 1570|1570]] and the double-sided [[Commodore 1571|1571]]. A dual-disk [[Commodore 1572|1572]] model was announced but never produced. Later on, the 3.5-inch [[Commodore 1581|1581]] was introduced.{{citation needed|date=December 2023}} The 1581 drive also has more on-board RAM than its predecessors, making it possible to open a larger number of files at one time. BASIC 7.0 includes <code>DLOAD</code> and <code>DSAVE</code> commands to support loading and saving to disk without using the <code>,8</code> or other device number, and also a <code>DIRECTORY</code> command that reads a disk's catalog information directly to screen memory without overwriting BASIC memory as in BASIC 2.0. In addition, the C128 introduces auto-booting of disk software, a feature standard on most personal computers, but absent from Commodore machines up to that point. Users no longer have to type <code>LOAD"*",8,1</code>. BASIC also added a <code>COLLECT</code> command for removing "splat" files (files that were not closed properly and truncated to zero length).{{citation needed|date=December 2023}} All 1571 drives will normally start up in native mode on the C128. If the user switches to C64 mode by typing <code>GO 64</code>, the drive remains in native mode. But if C64 mode is activated by holding the Commodore key down when powering up, the 1571 then goes into 1541 mode. This routine is necessary for software that performs low-level drive access.{{citation needed|date=December 2023}} The C128 has twice the RAM of the C64, a far higher proportion of which is available for BASIC programming, due to the new [[Memory management unit|MMU]] bank-switching chip. This allows BASIC program code to be stored separately from variables, greatly enhancing the machine's ability to handle complex programs, speeding [[garbage collection (computer science)|garbage collection]] and easing debugging for the programmer. An executing program can be <CODE>STOP</CODE>ped, its code edited, variable values inspected or altered in [[direct mode]], and program execution resumed with the variable table intact using BASIC's <CODE>GOTO</CODE> command.{{sfn|Simmonds|Borden|1986|p=84}} Although other BASICs support the <code>CONT</code> command to restart execution without clearing variables, editing any code causes them to be cleared.<ref>{{cite web|url=http://www.antonis.de/qbebooks/gwbasman/|title=GW-BASIC User's Guide}}</ref> Different memory configurations can be loaded using BASIC's <code>BANK</code> command.{{citation needed|date=December 2023}} BASIC 7.0 has a full complement of graphics and sound-handling commands, as well as BASIC 4.0's disk commands and improved garbage cleanup, and support for structured programming via <code>IF...THEN...ELSE, DO...WHILE</code>, and <code>WHILE...WEND</code> loops.{{citation needed|date=December 2023}} On the downside, BASIC 7.0 ran considerably slower than BASIC 2.0 unless 2 MHz mode was used due to its 28 KB size (a 250% increase over BASIC 2.0) and having to bank switch to access program variables and BASIC program text (if greater than 16k in length).{{citation needed|date=December 2023}} The 128's ROM contains an [[List of Easter eggs in Microsoft products|easter egg]]: Entering the command <code>SYS 32800,123,45,6</code> in native mode reveals a screen with a listing of the machine's main developers followed by the message <code>Link arms, don't make them."</code> Also, entering the keywords <code>QUIT</code> or <code>OFF</code> will produce an <code>?UNIMPLEMENTED COMMAND ERROR</code>. These commands are holdovers from the BASIC interpreter intended for a planned but never-produced [[Commodore LCD|LCD portable computer]] and had been intended to exit from the BASIC interpreter and to ignore keyboard input during sensitive program execution, respectively.{{citation needed|date=December 2023}} The C128's greater hardware capabilities, especially the increased RAM, screen display resolution, and serial bus speed, made it a more capable platform than the C64 for running the [[GEOS (8-bit operating system)|GEOS]] graphical operating system.{{citation needed|date=December 2023}} === CP/M === [[file:c128cpmboot.jpg|thumb|Using CP/M mode requires use of a boot diskette. The diskette was included with the computer, which did not include a disk drive.]] The second of the C128's two CPUs is the Zilog Z80, which allows the C128 to run CP/M. The C128 was shipped with CP/M 3.0 (a.k.a. CP/M Plus, which is backward-compatible with CP/M 2.2) and ADM31/3A [[computer terminal|terminal]] emulation. A CP/M cartridge had been available for the C64, but it was expensive and of limited use since the 1541 drive cannot read the MFM-formatted disks that CP/M software was distributed on. Software had to be made available on Commodore-specific disks formatted using the [[Group coded recording|GCR]] encoding scheme.{{citation needed|date=December 2023}} Commodore made versions of ''PerfectCalc'' and the [[EMACS]]-derived ''PerfectWriter'' available,<ref>[http://www.commodore.ca/gallery/magazines/cpm/cp_m_compute_april85_d.jpg Compute! April 1985]</ref> and Commodore [[user group]]s sometimes had a selection of CP/M diskettes, but the limited software availability negated one of CP/M's chief attractions—its huge software library. In addition, the cartridges only work on early model C64s from 1982 and are incompatible with later units. Since they were also incompatible with the C128, the design team decided to support CP/M by putting the Z80 on the main system board.{{citation needed|date=December 2023}} The C128 runs CP/M noticeably slower than most dedicated CP/M systems, as the Z80 processor runs at an effective speed of only {{val|2|ul=MHz}}. This was because the C128's system bus was designed around the 65xx CPUs. These CPUs handle data and memory addressing very differently from the Z80. CP/M also ran more slowly for several reasons, such as needing to pass control to the 8502 for any I/O or interrupt processing. For these reasons, few users actually ran CP/M software on the C128.{{original research inline|date=December 2023}} When the C128 is powered on, the Z80 is active first and executes a small boot loader ROM at $0-$FFF to check for the presence of a CP/M disk. If one is not detected, control is passed to the 8502 and C128 native mode is started.{{citation needed|date=December 2023}} CP/M mode in practice requires a 1571 or 1581 drive to be useful, since a 1541 cannot read MFM disks and will run much slower due to not supporting the C128's burst mode. CP/M boot disks nonetheless must be in the drive's native GCR format; MFM disks cannot be booted from, only read once the user is already in CP/M. This is because the code necessary to operate the drive in MFM mode is loaded as part of the boot process. In addition, 80-column mode is generally required since most CP/M software expects an 80-column screen. The C128 emulates an [[ADM-3A]] terminal {{citation needed|date=September 2020}} in CP/M mode, so software will have to be set up for that. Aside from the standard ADM-3A terminal commands, a number of extra ones are available to use the VIC-II and VDC's features, including setting the text and background color. The CP/M command interpreter (although not application software) includes a safeguard to prevent the user from issuing a control code to make the text and background the same color, which would render text invisible and force the user to reset the computer. If this happens, it will default to a gray background with brown text.{{citation needed|date=December 2023}} CP/M mode is very different from the operating environments familiar to Commodore users. While [[Commodore DOS]] is built into the ROM of Commodore disk drives and is usually accessed through BASIC, CP/M requires the use of a boot diskette and requires entry of terse commands inherited from [[minicomputer]] platforms. CP/M programs tend to lack the [[user-friendly]] nature of most Commodore applications.{{original research inline|date=February 2025}} In CP/M mode, it is possible to run [[MBASIC]], Microsoft's release of BASIC-80 for CP/M. Compared with the native mode BASIC 7.0, MBASIC is terse and limited in its capabilities, requiring the use of terminal-style key combinations to edit program lines or move the text cursor and lacking any sound or graphics features. Moreover, Commodore BASIC has 40-bit floating point which serves as a middle ground between MBASIC's 32-bit floating point and 64-bit double precision variables. MBASIC also offers only 34k of free program space against BASIC 7.0's approximately 90k.{{citation needed|date=December 2023}} The CP/M CBIOS (the part of CP/M that interfaces with the hardware) does not directly interface with the hardware like on most CP/M implementations; rather, it calls the kernal routines for interrupt handling and I/O—when the kernel needs to be used, the Z80 uses routines at {{mono|$FFD0}}-{{mono|$FFEF}} to pass parameter data to the 8502, which is then activated and the Z80 deactivated. After the kernel routine is finished executing, control is passed back to the Z80. It was reported that the programmer in charge of porting CP/M to the C128 had intended to have the CBIOS interface with the hardware directly in Z80 machine language, but had great difficulty with the VDU chips as they were prone to overheating and self-destructing. The VDU also underwent numerous hardware revisions while the C128 was in development and the CP/M programmer was unable to get his code working properly, so the C128 engineering team requested instead that he simply rewrite the CBIOS to pass function calls to the 8502.<ref>{{cite web|url=https://retrocomputing.stackexchange.com/questions/2361/why-does-the-commodore-c128-perform-poorly-when-running-cp-m |title=Why does the Commodore C128 perform poorly when running CP/M? |website=Stack Exchange}}</ref><ref>{{cite web|url=http://web.mit.edu/randy/www/antigrav/supercharge.html|title=Supercharging CP/M|quote=C128 CP/M programmers who want to add or change operating system features should try to make changes to the BIOS. For one thing, BIOS source code is available, but not available for the BDOS or CCP.}}</ref> === C64 === [[file:Commodore 128 set-up with a 1541, 1571, 1200 baud Modem, and two displays (filtered).jpg|thumb|Photo from the 1980s showing a C128 setup with two disk drives and two monitors displaying the independent 40- and 80-column screens. Many users continued to use the 1541 inherited from their C64 system as a second drive.]] By incorporating the original C64 BASIC and Kernal ROMs in their entirety (16 KB total), the C128 achieves almost 100 percent compatibility with the Commodore 64. The C64 mode can be accessed in three ways: # Holding down the Commodore-logo key when booting. # Entering the <CODE>GO 64</CODE> command, then responding <code>Y</code> to the <code>ARE YOU SURE?</code> prompt, in BASIC 7.0.<ref>{{Cite web|url=http://www.commodore.ca/manuals/128_system_guide/sect-02.htm|title=C128 System Guide – 2.2.1 MODE SWITCHING CHART|website=commodore.ca|access-date=8 August 2016}}</ref> # Booting 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's behavior when a cartridge (such as [[Simons' BASIC]]) is plugged into the port and asserts either of these lines but, unlike an actual 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 kernel polling defined locations in the memory map.{{citation needed|date=December 2023}} C64 mode almost exactly duplicates the features of a hardware C64. The MMU, Z80, and IEC burst mode are disabled in C64 mode, however all other C128 hardware features including the VDU and 2 MHz mode are still accessible. The extended keys of the C128 keyboard may be read from machine language, although the kernal routines only recognize the keys that exist on the C64. A few games are capable of detecting if a C128 is running and switching to 2 MHz mode during the vertical retrace for faster performance.{{citation needed|date=December 2023}} On North American C128s, when in C64 mode, even the character (font) ROM changes 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 will fail in various ways on a C128. Thus, the C128 was given a double-sized character ROM, which delivers the C128 font in C128 mode, and the C64 font in C64 mode. International models of the C128 use the unmodified C64 font in both modes, since the second half of the character ROM is instead dedicated to the international font (containing such things as accented characters or German [[Diaeresis (diacritic)|umlaut]]s).{{citation needed|date=December 2023}} Some of the few C64 programs that fail on a C128 will run correctly when the {{keypress|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 {{keypress|SHIFT LOCK}} key found on both C64 and C128 is simply a mechanical latch for the left {{keypress|SHIFT}} key, the {{keypress|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 {{keypress|CAPS LOCK}} key in the down position will force the I/O line low, matching the C64's configuration and resolving the issue.{{citation needed|date=December 2023}} A handful of C64 programs write to <code>[[Hexadecimal|$]]D030 (53296)</code>, often as part of a loop initializing the [[MOS Technology VIC-II|VIC-II]] chip registers. This memory-mapped register, unused in the C64, determines the system clock rate. Since this register is fully functional in C64 mode, an inadvertent write can scramble the 40-column display by switching the CPU over to 2–MHz, at which clock rate the VIC-II video processor cannot produce a coherent display. Fortunately, few programs suffer 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 is maintained while increasing overall execution speed by about 20 percent.<ref>[http://www.devili.iki.fi/pub/Commodore/docs/magazines/gazette/1986/07jul/jul86-64ModeSpeed-UpForThe128A.jpg jul86-64 ModeSpeed (A)]</ref><ref>[http://www.devili.iki.fi/pub/Commodore/docs/magazines/gazette/1986/07jul/jul86-64ModeSpeed-UpForThe128B.jpg jul86-64 ModeSpeed (B)]</ref> A few C64 programs would lack sound effects and music because on a C64 the SID chip $D4xx memory page was also mirrored on $D5xx, $D6xx and $D7xx pages, while on a C128 it was only accessible through $D4xx page. This is not a common issue, since the C64 reference guide only describes registers in $D4xx in details while describing $D5xx-$D8xx just as "SID IMAGES", making most programs accessing them through $D4xx page and hence have the sound getting played as intended on a C128.{{citation needed|date=December 2023}} 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 <code>$FF (255)</code> to [[memory address]] <code>$D02F (53295)</code>, a register which is used to decode the extra keys of the C128 (the numerical keypad and some other keys). On the C64 this memory location will always contain the value <code>$FF</code> no matter what is written to it, but on a C128 in C64 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.{{citation needed|date=December 2023}} === RAM setup === To handle the relatively large amounts of [[read-only memory|ROM]] and [[random-access memory|RAM]] (tenfold the size of 8502's {{val|64|u=KB}} address space) the C128 uses the 8722 [[memory management unit|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 configuration register at [[memory address]] {{mono|$FF00}}. Another feature of the memory management unit is to allow relocation of [[zero page]] and the [[stack (data structure)|stack]].{{citation needed|date=December 2023}} Although the C128 can theoretically support 256k of RAM in four blocks, the PCB has no provisions to add this extra RAM, nor can the MMU actually access more than 128k. Therefore, if the MMU is programmed to access blocks 2 or 3, all that results is a mirror of the RAM in blocks 0 and 1.{{citation needed|date=December 2023}} Since the I/O registers and system ROMs can be disabled or enabled freely, as well as being locatable in either RAM bank and the VIC-II set to use either bank for its memory space, up to 256 memory configurations are possible, although the vast majority of them are useless (for example, unworkable combinations like the kernal ROM in bank 0 and the I/O registers in bank 1 are possible). Because of this, BASIC's BANK statement allows the user to select 15 of the most useful arrangements, with the power-on default being Bank 15. This default places the system ROMs, I/O registers, and BASIC program text in block 0, with block 1 being used by BASIC program variables. BASIC program text and variables can extend all the way to {{mono|$FFEF}}. But since block 0 contains the ROMs and I/O registers from {{mono|$4000}} onward, BASIC uses an internal switching routine to read program text higher than {{mono|$3FFF}}.{{citation needed|date=December 2023}} The top and bottom 1k of RAM ({{mono|$0}}–{{mono|$3FF}} and {{mono|$FF00}}-{{mono|$FFFF}}) are "shared" RAM, visible from both blocks. The MMU allows either to be expanded in increments up to 16k. The {{mono|$0}}–{{mono|$3FF}} range contains the zero page and stack while {{mono|$FF00}}-{{mono|$FFFF}} contains the MMU registers and reset vectors. These areas are always shared and cannot be switched to non-shared RAM. Shared RAM is always the opposite bank from the one currently being used by the CPU, thus if bank 0 is selected, any read or write to shared RAM will refer to the corresponding locations in bank 1 and vice versa. The VIC-II can be set to use either RAM bank and from there, its normal 16k window. While on the C64, the VIC-II can only see the character ROM in banks 2 and 4 of its memory space, the C128, on the other hand, makes it possible to enable or disable the character ROM for any VIC-II bank via the register at {{mono|$1}}. Also, there are two sets of color RAM—one visible to the CPU, the other to the VIC-II and the user may select what chip sees what.{{citation needed|date=December 2023}} In CP/M mode, the Program Segment Prefix and Transient Program Area reside in Bank 1 and the I/O registers and CP/M system code in Bank 0.{{citation needed|date=December 2023}} The C128's RAM is expandable from the standard 128 KB to 256, 512 or even 1,024 KB, either by using commercial memory expansion modules, or by making one based on schematics available on the internet.<ref>[http://www.ktverkko.fi/~msmakela/8bit/memory/memory-c128.pdf Memory expansions for the Commodore 128]</ref> Commodore's RAM Expansion Units use an external 8726 [[direct memory access|DMA]] controller to transfer data between the C128's RAM and the RAM in the expansion unit.{{citation needed|date=December 2023}}
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Commodore 128
(section)
Add topic