Egghead.page Logo

How Did the Commodore Plus/4 Render Reverse Video Characters?

The Commodore Plus/4 utilized its integrated TED chip to manage video output, handling reverse video through a specific bit flag within the character code itself. Unlike systems that rely on separate attribute memory, the Plus/4 inverted colors by toggling the most significant bit of the character byte, instructing the video controller to swap foreground and background colors during rendering. This article explores the technical memory mapping, the role of the TED chip, and the specific bitwise operations that enabled this classic text effect.

The Role of the TED Chip

At the heart of the Commodore Plus/4 video architecture lies the 7360 Text Editing Device, commonly known as the TED chip. Unlike the Commodore 64, which used a separate VIC-II chip for video and a CPU for logic, the Plus/4 integrated much of the system functionality into the TED. This chip was responsible for generating the video signal, managing DRAM refresh, and handling the keyboard interface. When rendering text, the TED continuously scans the screen memory to determine which character glyphs to display and how to color them.

Screen Memory and Bitwise Logic

The screen memory on the Plus/4 is typically located in the range from $0400 to $07FF. Each byte in this memory range corresponds to a specific character position on the display. To render a standard character, the CPU writes the ASCII or PETSCII code of the glyph into the corresponding screen memory address. To activate reverse video, the system sets the most significant bit, or bit 7, of that byte.

Mathematically, this means adding 128 to the standard character code. For example, if the character code for the letter “A” is 65, writing 65 to screen memory displays a normal “A”. Writing 193 (65 + 128) tells the TED chip to render the same glyph but with inverted colors. This bitwise flag allows the computer to store display attributes directly alongside the character data without requiring a separate color attribute map for every single character cell.

Color Swapping Mechanism

When the TED chip encounters a screen memory byte with bit 7 set, it triggers an internal logic switch for that specific character cell. Instead of using the standard foreground and background color registers defined in the TED’s control registers, the chip swaps them. The color designated as the background becomes the foreground, and the original foreground color becomes the background.

This hardware-level swap occurs during the video fetch cycle. Because the attribute is stored directly in the screen RAM byte, the TED can process this information on the fly without additional CPU intervention. This efficiency was crucial for the 8-bit era, allowing for smooth scrolling text and dynamic interface elements without burdening the 7501 or 8501 CPU with complex rendering calculations.

Comparison to Other Commodore Architectures

This method of reverse video rendering was consistent across many Commodore 8-bit machines, including the Commodore 64. However, the implementation within the TED chip offered slight variations in timing and color luminance compared to the VIC-II. While the C64 relied on the VIC-II to interpret bit 7 similarly, the Plus/4’s integrated design meant that video memory access patterns were tightly coupled with CPU cycles. Despite these architectural differences, the programmer’s interface remained largely the same, ensuring that software techniques for highlighting text via reverse video were portable across the Commodore ecosystem.

Legacy of the Technique

The use of bit 7 for reverse video remains a defining characteristic of Commodore PETSCII programming. It allowed developers to create menus, highlight selections, and draw simple graphical boxes using only text characters. By understanding how the TED chip interprets screen memory bytes, modern enthusiasts and retro developers can accurately emulate the Plus/4 display or write new software that leverages the original hardware capabilities. The simplicity of toggling a single bit to achieve a high-contrast visual effect stands as a testament to the efficient design philosophies of early home computer engineering.