@(#)gfx: Talking to TED: The MOS 7360/8360 Text Display ICs by Levente Harsfalvi (TLC@MSZI.PMMF.HU) @(A): Introduction This information file is based on my old books, descriptions, and especially my experiences while I was coding. That's no mistake. The Plus/4 series was not very famous in the world, but they were very poular in mideast Europe. In fact, there were even demo groups for the machine. I learned some of this information while writing demos for the machine in demo groups, while other things were gleaned from personal work on the machine. These computers did indeed play an important part in Commodore computer history. I started my first code development on a Plus/4 in late 1986. After I saw a HomeLab 3 (made in Hungary, U880 - GDR made Z80 compatible proc, B/W, 16K), I started writing demos and other software for the Plus/4 machine I owned. It actually wasn't that strange to see demo groups sprout up for all kinds of machines, including the Plus/4. All over, there were groups and individuals, writing software while trying to keep the flame lit for each machine. In fact, I know people currently working in groups writing for the Plus/4 in Hungary, Germany, and as far away as Alaska. @(A): Overview Let's discuss the TExt Editor (TED) IC and its environment. This DIL-48 IC was designed specifically for the 264 series of machines, which initially included the CV364 and the 264, evolving into the Plus/4, C16, and C116 machines. Unlike the CIA or ACIA or other machines, this IC isn't well suited to any other system. The TED contains all functions done by several chips in former Commodore computers. The TED is a complete video-interface and composite video signal generator, sound generator, keyboard input latch, timer, clock generator, memory manager and DRAM refresher in a single IC. It can address the full memory map of the 264 series machines, and it generates the RAS', CAS', and MUX signals for the DRAM memory used in that series. For ROM, it generates the chip select (CS) lines, depending on the state of the internal registers. So, in addition to all the above duties, the TED IC is a simplistic MMU as well. @(A): Video Information We see the TED chip shine as it does its primary job, displaying graphics. Its abilities mostly parallel those of the uniquitous VIC-II video IC in the C64. It has the following modes: * 40x25 screen (characters) * enhanced color mode * multicolor mode * 320x200 Hi-Res Graphics * 160x200 Multicolor Graphics Of course, there are differences. TED does not contain sprite support. To offset this omission, the TED chip can select 8 intensities for each of the 16 supported colors, giving 121 colors (the 8 shades of black are all black). Other features include a hardware cursor, hardware text blinking, and hardware inverse character support. Character sets, screen and color memory, and graphics bitplanes can be addressed directly, without additional logic as found on the C64. In fact, even RAM/ROM selection requires change of a single bit. Character modes need $800 bytes of RAM for screen and color memory. The first $400 bytes act as color memory (the memory permanently located at $d800 on the C64), with the lower 4 bits containing color codes, exactly as found on the 64. Bits 4-6 denote the intensity level of the color, while the high bit select flashing/no-flashing attributes. The other $400 bytes contain the screen codes for the displayed characters. If hardware character inversion is selected, the lower 7 bits hold the screen code and the high bit selects inversion for the character. If character inversion is not selected, all 8 bits denote the screen code. Extended Color Mode (ECM) and Multi Color Mode (MCM) modes work exactly as described on the 64. While these two modes are in effect, inversion and blinking are disabled. Things get a bit more complex in graphics mode (pun unintentional). In graphcis mode, the bitplane occupies $2000 bytes and is handled just like a VIC-II biplane. The colors are handled differently. $800 bytes are needed for color memory, which is laid out in $400 bytes of intensity memory and $400 bytes of color memory. An "off" bit in the bitplane uses the lowest nybble of the appropriate color memory location as the color and retreieves the intensity from bits 4-6 of the appropriate intensity memory location. For an "on" bit, the color is taken from the high nybble of the appropriate color memory location, while the intensity is taken from bits 0-2 of the intensity memory location. Bits 3 and 7 in intensity memory are unused. In multicolor mode, differences abound. The 64's VIC-II enabled one to utilize 3 different colors in each 8x8 cell and a single background. The TED simply cannot accomplish this due to the lack of adequate color memory. So, TED allows only 2 varying colors per 8x8 cell. Those colors are chosen from the palette of 121. The remaining 2 colors are chosen for the entire screen, again from the 121 color palette. The mapping is as follows: 00 background color 01 same as "off" color in hires mode 10 same as "on" color in hires mode 11 another "background" color The TED IC is able to generate both PAL and NTSC compatible signals from a single IC. Only the crystal need be changed to go from one standard to the other. In PAL mode, there are 312 lines hown, while NTSC only has 262 lines of display. The line synchronization is the same in either PAL or NTSC mode. It's always 57 clock cycles per rasterline. The TED divides the supplied crystal frequency by 20 for PAL display and by 16 for NTSC. For the serious video programmer, raster interrupts are implemented as on the VIC-II. However, the 0 line of the register corresponds to the first line of the character screen area, not the top of the border. In addition, the current raster line can be read from TED registers. you can modify the counter as well. Doing so will most likely affect the screen display. As a bonus, the horizontal location of the raster can be read and modified in the same way. Unfortunately, these registers provide the basis for most effects, as the TED can't handle sprites. @(A): Running The Show As earlier mentioned, the TED IC does more than produce graphics. One of its tasks involves generating the clock signal for the 7501/8501 microprocessor. The clock is not constant, as it switches from from 885 kHz and twice that speed, 1.773 Mhz. The speed depends on TED's current task. It generates the slower clock signal when refreshing DRAM or fetching data for the video screen. Otherwise, the high clock signal is generated. The user can disable fast clock generation via a register. The end result is a machine that operates at approximately 1 MHz, as the CPU runs in slow mode while the screen is displayed, and operates in fast mode when the TED starts drawing the top and bottom borders. @(A): Sound Advice As far as a sound device is concerned, the TED doesn't stack up to the SID in the 64. Just 2 squarewave generators, of which the second can be switched to generate white-noise, are available for sound generation. Volume control is available in 8 levels. To play samples, the TED can switch the sound generators to constant level outputs. D/A is then done by changing the volume register setting. Each generator can generate frequencies from 100Hz to 23kHz. @(A): Other features The timers available in the TED appear to be nothing more than 16 bit decrementing timers. They are always clocked with the slow clock. The first timer reloads its starting value when it reaches 0, the other 2 are free-running. Since it already does almost everything else, it's not unusual to notice the TED handles the keyboard matrix. A simple 8-bit imput latch handles keyboard interfacing. As noted above, a single bit in the register space will page ROM or RAM into the upper 32kB of the address map. Since the TED knows what is paged in at all times, it knows what to output to access the memory locations in this area. @(A): Conclusion Well, that about wraps up the TED IC. All that is left is a map of the registers. Assume all registers are read/write unless noted otherwise. If you have questions, I cna be reached at the Internet address listed above or at: Levente Harsfalvi 7200 Dombovar Gorkij 33. Hungary By the way, catch FLI ED. V1.0; Its info file may contain some more about TED's screen-handling. It may be retrieved as ftp://ftp.funet.fi/pub/cbm/plus4/tlc/cns.lzh