TMS9918AITMS9928AITMS9929A Video Display Processors Data Manual IMPORTANT NOTICES Texas Instruments reserves the right to make changes at any time in order to improve design and to supply the best product possible. TI cannot assume any responsibility for any circuits shown or represent that they are free from patent infringement. Copyright © 1982 Texas Instruments Incorporated TABLE OF CONTENTS SECTION PAGE 1. INTRODUCTION .•............................................................................. 1-1 1. 1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-1 1 .2 Features ........................................................................................... 1-1 1.3 Typical Applications ................................................................................. 1-2 1 .4 Acronyms and Glossary .............................................................................. 1-3 2. ARCHITECTURE ...............................................................................2-1 2.1 CPU Interface .......................................................................................2-1 2.1.1 CPU Interfaca Control Signals ................................................................... 2-1 2.1.2 CPU Write to VDP Register .....................................................................2-1 2.1.3 CPU Write to VRAM ...........................................................................2-3 2.1.4 CPU Read from VDPStatus Register ............................................................. 2-4 2.1.5 CPU ReadfromVRAM .........................................................................2-4 2.1.6 VDP Interrupt .................................................................................2-5 2.1 .7 VDP Initialization ..............................................................................2-5 2.2 Write-Only Registers .................................................................................2-5 2.2.1 RegisterO ......................................................................................2-5 2.2.2 Register 1 ................................ , .................................................... 2-5 2.2.3 Register 2 .....................................................................................2-7 2.2.4 Register 3 ......................................................................................2-7 2.2.5 Register 4 .....................................................................................2-7 2.2.6 Register 5 .....................................................................................2-7 2.2.7 Register 6 ......................................................................................2-7 2.2.S Register 7 .....................................................................................2-7 2.2.9 Setup Values for VDP Registers 2 through 6 .......................................................2-7 2.3 Status Register ....................................................................................2-11 2.3.1 Interrupt Flag (F) .............................................................................2-11 2.3.2 Coincidence Flag (C) .......................................... '................................ 2-11 2.3.3 Fifth Sprite Flag (5S) and Number ..............................................................2-11 2.4 Video Display Modes ...............................................................................2-12 2.4.1 GraphicsIMode ..............................................................................2-17 2.4.2 Graphics II Mode .............................................................................2-19. 2.4.3 Multicolor Mode ..............................................................................2-21 2.4.4 Text Mode ...................................................................................2-23 2.4.5 Sprites ......................................................................................2-25 2.4.6 A Step-by-Step Approach to Create Patterns and Sprites .......................................... 2-29 3. VDP INTERFACES AND OPERATION .............................................................3-1 3.1 VDP/VRAM Interface ................................................................................3-1 3.1.1 VRAM Interface Control Signals ................................................................. 3-1 3.1.2 VRAM Memory Types ..........................................................................3-1 3.1 .3 VDP to DRAM Address Connections .............................................................3-1 3.2 VRAM Memory Address Derivation ....................................................................3-3 3.3 VRAM Addressing Example ..........................................................................3-4 3.4 Monitor Interfaces ........................... '" ..... " .. , .................... , ...................... 3-5 3.4.1 TMS991SA Monitor Interface ...................................................................3-5 3.4.2 TMS992SA/9929A Monitor Interface ............................................................3-6 3.5 TMS991SA External VDP Operation ...................................................................3-7 3.6 Oscillator and Clock Generation .................................................................' ...... 3-S 3.6.1 TMS991SA Color Phase Generation .............................................................. 3-S 3.6.2 Video Sync and Control Generation .............................................................. 3-8 iii TABLE OF CONTENTS (continued) SECTION PAGE 3.7 VDP Terminal Assignments ...........................................................................3-9 3.7.1 TMS9918ATerminaIAssignments ............................................................... 3-9 3.7.2 TMS9928A/9929A Terminal Assignments ....................................................... 3-11 3.7.3 TMS9918A/9928A/9929ACrystals ............................................................ 3-12 4. DEVICE APPLICATIONS ........................................................................ 4-1 4.1 VDP to TMS9900 Interface ...........................................................................4-1 4.2 TMS9918A/9928A/9929A Interface ................................................................. . 4.2.1 TM990 (TMS9918A/9928A/9929A) Parts List ................................................... .4-4 4.2.2 Composite Video Output .......................................................................4-4 4.2.3 Oscillator and Timing .......................................................................... .4-4 4.2.4 VRAM Connections ..................... , ..................................................... .4-5 4.3 VDP Initialization ................................................................................... .4-5 4.4 Typical Software Program ........................................................................... .4-6 4.4.1 General .......................................................................................4-6 4.5 TMS9900 Software SubRoutines ................................................................... .4-6 5. TMS9918A/9928A/9929A ELECTRICAL SPECiFiCATIONS ........................................ 5-1 5.1 Absolute Maximum Ratings .......................................................................... 5-1 5.2 Recommended Operating Conditions .................................................................. 5-1 5.3 Electrical Characteristics ............................................................................ , .5-2 5.4 Timing Requirements ................................................................................5-4 5.5 Switching Characteristics ............................................................................5-5 LIST OF APPENDICES APPENDIX PAGE A ASCII Character Set ......................................................•..........................A-l 8 Choosing VRAM Memory ............................................................................ 8-1 C Pattern and Screen Worksheets ....................................................................... C-1 iv LIST OF ILLUSTRATIONS FIGURE PAGE 1-1 System Block Diagram .................................................................................... 1-2 2-1 VDP Block Diagram .......................................................................................2-2 2-2 VDP to CPU Interface .....................................................................................2-3 2-3 VDP Registers ............................................................................................2-6 2-4 VDP Display Planes (Definition) ............................................................................2-12 2-5 VDP Display Planes (First 32 Planes) .......................................................................2-13 2-6 TMS9928A/9929A Signal Waveforms for Multiple VDP Operation ............................................. 2-14 2-7 Using Color Difference Signals to Mix External Color Difference Type Source .................................... 2-15 2-8 Using Color Difference Signals to Mix External Video Sources .................................................2-15 2-9 Pattern Graphics Name Table Mapping .....................................................................2-17 2-10 Graphics I Mode Mapping .................................................................................2-' 8 2-11 Pattern Display Mapping ..................................................................................2-18 2-12 Graphics II Mode Mapping ................................................................................2-20 2-13 Pattern Display Mapping ..................................................................................2-21 2-14 Multicolor List Mapping ..................................................................................2-21 2-15 Multicolor Block Display ..................................................................................2-22 2-16 Multicolor Mode Mapping ................................................................................2-23 2-17 Text Mode Name Table Pattern Positions ...................................................................2-23 2-18 Mapping of VRAM into the Pattern Plane in Text Mode .......................................................2-24 2-19 Sprite Attribute Table Entry ...............................................................................2-25 2-20 Sprite Mapping ........................................................................... , .............. 2-26 2-21 Size 1 Sprite Mapping ....................................................................................2-28 3-1 VRAM Interface ..........................................................................................3-2 3-2 VDP-VRAM Memory Allocation ............................................................................ 3-5 3-3 Composite Video Pull-Down Circuit .........................................................................3-5 3-4 Use of TMS9928A/9929A with Different Monitors ............................................................ 3-6 3-5 Cascading Two TMS9918A VDPs .......................................................................... 3-7 3-6 Cascading Two TMS9918A/9929A VDPs ...................................................................3-7 4-1 Minimum System Interface to TMS9900 ..................................................................... 4-1 4-2 TMS9918A/9928A/9929A Interface ....................................................................... ,4-2 4-3 TM990 (TMS9918A/9928A/9929A) Demo Board ............................................................4-3 4-4 RF Modulator Connection .................................................................................4-4 4-5 External Frequency Source .................................................................................4-5 4-6 VDP Register Initialization Procedure ........................................................................4-5 5-1 Load Circuit for COMVID (All Devices) and R-Y, Y, S- Y Switching Characteristics (TMS9928A/9929A) ............. 5-9 5-2 Load Circuits for All Outputs Except COMVID, R-Y, Y, B-Y ..................................................... 5-9 5-3 CPU-VDP Write Cycle (All Devices) ........................................................................ 5-1 0 5-4 CPU-VDP Read Cycle (All Devices) .........................................................................5-10 5-5 VRAM Write Cycle .......................................................................................5-11 5-6 VRAM Read Cycle .......................................................................................5-11 5-7 External Clock Timing Waveform ..........................................................................5-12 5-8 TMS9918A COMVID Horizontal Timing ....................................................................5-12 5-9 TMS9918A Vertical Timing ................ ; ............................................................... 5-12 v LIST OF ILLUSTRATIONS (continued) FIGURE PAGE 5-10 TMS9928A/9929A Y Horizontal Timing ....................................................................5-13 5-11 TMS9928A/9929A R- Y Horizontal Timing ..................................................................5-13 5-12 TMS9928A/9929A B-Y Horizontal Timing ..................................................................5-14 5-13 TMS9929A Vertical Timing ............................................................................... 5-14 LIST OF TABLES TABLE PAGE 2-1 CPUIVDP Data Transfers ..................................................................................2-3 2-2 Memory Access Delay Times ...............................................................................2-4 2-3 Color Assignments .......................................................................................2-17 2-4 Graphics I Mode Color Table ..............................................................................2-19 2-5 Sprite Pattern Formats ...................................................................................2-25 3-1 VDP to DRAM Address Connections ........................................................................3-1 3-2 Pattern Graphics Address Location Tables .................................................................... 3-3 3-3 Screen Display Parameters .................................................................................3-8 4-1 VDP Port Addresses for Figure 4-1 ..........................................................................4-1 vi 1. INTRODUCTION 1.1 Description The TMS9918A/9928A/9929A video display processors (VDPI are N-channel MOS LSI devices used in video systems where data display on a raster-scanned home color television set or color monitor is desired. These devices generate all necessary video, control, and synchronization signals and also control the storage, retrieval, and refresh of display data in the dynamic screen refresh memory. The interfaces to the microprocessor, refresh memory, and the TV require a minimum of additional electronics for the TMS9918A. In Section 1.4, there is a list of acronyms and a glossary of terms used in this manual. The TMS9928A/9929A VDPs are functionally identical to the TMS9918A except that the NTSC color encoding circuitry has been removed and replaced with luminance and color difference signals. The TMS9918A is pin-for-pin compatible with the TMS9928A/9929A, except for three pins, the composite video output, the external video input and the CPU clock output. These pins are replaced with the Black/White luminance and composite sync (V) output and two color dif- ference pins, Blue (B-VI and Red (R-VI outputs, respectively. The color difference outputs allow the user to generate Red- Green-Blue (R-G-BI drive for direct color gun control, or composite video for use with NTSC or PAL video color monitor. However~ to connect these three outputs to a R-G-B or monitor requires additional R-G-B or encoder circuitry. The TMS9918A/9928A have a 525-line format for U.S. televisions while the TMS9929A has a 625-line format for use with the European PAL system. The VDP has four video display modes: Graphics I, Graphics II, Multicolor and Text mode. The Text mode provides twenty- four 40-character rows in two colors and is intended to maximize the capacity of the TV screen to display alphanumeric character. The Multicolor mode provides an unrestricted 64 x 48 color-dot display employing 15 colors plus transparent. The Graphics I mode provides a 256 x 192 pixel display for generating pattern graphics in 15 colors plus transpatent. The Graphics II mode is an enhancement of Graphics I mode, Iillowing it to generate more complex color and pattern displays. The four video display modes are described in detail in Section 2.4. The video display consists of 35 planes: external VDP, backdrop, pattern plane, and 32 Sprite Planes. The planes are ver- tically stacked with the external VDP being the bottom or innermost plane. The backdrop plane is the next plane followed by the pattern plane that contains Graphics I and Graphics II patterns with the 32 Sprite Planes as the top planes. The TMS9918A/9928A/9929A VDPs use either a 4K, 8K, or 16K-type low-cost dynamic memory (TMS4027, TMS4108, TMS41161 for storage of the display parameters. The TMS9918A, TMS9928A, and TMS9929A interface identically to the host. microprocessor making them software compatible. Thus, all references to VDP in this document apply to all three devices, except where noted. 1.2 FEATURES • Single-chip solution for interfacing color TVs (excluding Random-Access Memory (RAM) and Radio Frequency (RFI modulator (TMS9918A onlyl • 256 x 192 resolution on TV screen • 15 unique colors plus transparent • General 8-bit bidirectional interface to Central Processor Unit (CPUI • Direct wiring to 4K, 8K, or 16K dynamic RAM memories • Automatic and transparent refresh of dynamic RAMs • Multiple VDP systems capability • External VDP input capability (TMS9918A only) • Composite video output (TMS9918A onlyl • Unique planar representation for 3D simulation • Standard 40-pin package • Color difference outputs allow RGB drive - TMS9928A/9929A 1-1 1.3 TYPICAL APPLICATIONS • Color computer terminals • Home computers • Drafting/design aids • Teaching aids • Industrial process monitoring • Home educational systems • Animation aids • European 625-line TV (TMS9929A only) The following example of a typical application may help introduce the user to the TMS9918A VDP. Figure 1-1 is a block diagram of a typical application. Each of the concepts presented in the example is described more fully in later sections of this manual. TMS9918A DRIVE CIRCUITRY - VIDEO MONITOR - HOME TV WITH VIDEO INPUT TMS9928AI9929A VIDEO ENCODER - VIDEO MONITOR - HOME TV WITH VIDEO INPUT TMS8928A19929A ROB ENCODER - ROB MONITOR DYNAMIC TMS8918Af RAM 9928Af RF (VRAMI 9929A MODULATOR DRIVENIDEO ENCODER - HOME TV WITHOUT VIDEO INPUT FIGURE 1-1 - SYSTEM BLOCK DIAGRAM The VDP basically has three interfaces: CPU, color monitor, and dynamic refresh RAM (VRAM), the contents of which define the TV image. The TMS9918A al80 has eight write-only registers and a read-only status register. The VDP communicates with the CPU via an 8-bit bidirectional data bus. Three control lines, decoded from the CPU address and enable lines, determine interpretation of the bus. Through the bus, the CPU can write to VRAM, read from VRAM, write to VDP registers, and read the VDP status. The VDP also generates an interrupt signal after every refresh of the TV display. The dynamic RAM interface consists of direct wiring of eight 4K .x 1, 8K x 1, or 16K x 1 dynamic RAS/CAS-type RAMs to the VDP. The amount of RAM required is dependent upon the features selected for use in the application. The interface to the monitor can consist of either Wiring the TMS9918A's composite video output pin (suitably buffered) to the input of a color or black-and-white monitor, or using an appropriate RF modulator to feed the signal into a TV anten- na terminal. The TMS9928A/9929A requira additional encoder circuitry to interface to a RGB or to a composite video monitor. 1-2 The VDP operates in four modes, and each one can affect the way the VRAM is mapped onto the television screen. In Graphics I and II modes, characters are mapped onto the screen in 8 x 8 pixel blocks, yielding 24 lines of 32 blocks (pat- tern positions) each. In Text mode, there are 24 lines of 40 blocks, each of which is 6 x 8 pixels. In Multicolor mode, there are 48 lines of 64 blocks, each of which is composed of 4 x 4 picture elements (pixels), all of one solid color. In addition to these, sprites can be superimposed onto the television image in Graphics I, II, and Multicolor mode. Furthermore, signals entering the TMS9918A through the external VDP input can be used as a background to the TMS9918A. ACRONYMS AND GLOSSARY B-Y Blue color difference output COMVID Contains luminance, chrominance and all sync pulse necessary for horizontal and vertical timing (Composite Video) CAS Column Address Strobe CPU Central Processor Unit CSR CPU from VDP read select CSW CPU to VDP write select CPUCLK XTAL - 3 GROMCLK XTAL - 24 LSB Least Significant Bit LSI Large Scale Integration MOS Metal Oxide Semiconductor MHz Megahertz MSB Most Significant Bit NTSC National Television Standards Committee which specifies television signal standards for the USA PAL Phase Alternating Line Pixel Picture Element - the smallest point on the TV screen that can be independently controlled. RAM Random-Access Memory RAS Row-Address Strobe RASTER The area in which an image is reproduced RF Radio Frequency R-G-B Red-Green-Blue ROM Read-Only Memory R/W. Read/Write R-Y Red color difference output Sprite An object whose pattern is relative to a specified X, Y coordinate and whose position can therefore be controlled by that coordinate with a positional resolution of one pixel VDP Video Display Processor VRAM Video RAM; refers to the dynamic RAMs that connect to the VDP and whose contents define the TV image Y Black/white luminance and composite sync 1-3 2. ARCHITECTURE The TMS991 SA video display processor (VDP) is designed to provide a simple interface between a microprocessor and a raster-scanned color television. The TMS9928A/9929A VDPs are designed as a simple interface between a microprocessor, and R-G-B monitor or video encoder which produces the video for a video monitor. Figure 2-1 is a block diagram of the major portions of the VDP architecture interfaces to the VDP, CPU, VRAM, and color television. 2.1 CPU INTERFACE The VDP interface to the CPU using an 8-bit bidirectional data bus, three control lines, and an interrupt is shown in Figure 2-2. Through this interface the CPU can conduct four operations: (1) Write data bytes to VRAM (2) Read data bytes from VRAM (3) Write to one of the eight VDP write-only registers (4) Read the VDP Status Register. Each of these operations requires one or more data transfers to take place over the CPU/VDP data bus interface. The interpretation of the data transfer is determined by the three control lines of the VDP. NOTE The CPU can communicate with the VDP simultaneously and asynchronously with the VDP'g TV screen refresh operations. The VDP performs memory management and allows periodic intervals of CPU access to VRAM even in the middle of a raster scan. 2.1.1 CPU Interface Control Signals The type and direction of data transfers are controlled by the CSW, CSR, and MODE inputs. CSW is the CPU to VDP write select. When it is active (low), the eight bits on CDO-CD7 are strobed into the VDP. CSR is the CPU from VDP read select. When it is active (low), the VDP outputs eight bits on CDO-CD7 to the CPU. CSW and CSR should never be simultaneous- ly low at the same time. If both are low, the VDP outputs data on CDO-CD7 and latches in invalid data. MODE determines the source or destination of a read or write data transfer. MODE is normally tied to a CPU low order address line (A14 for TMS9900). 2.1.2 CPU Write to VDP Register The VDP has eight write-only registers and one read-only status register. The write-only registers control the VDP opera- tion and determine the way in which VRAM is allocated. The status register contains interrupt, sprite coincidence and fifth sprite status flags. Each of the eight VDP write-only registers can be loaded using two 8-bit data transfers from the CPU. Table 2-1 describes the required format for the two bytes. The first byte transferred is the data byte, and the second byte transferred controls the destination. The MSB of the second byte must be a 1. The next four bits are Os, and the lowest three bits make up the destination register number. The MODE input is high for both byte transfers. To rewrite the data in an internal register after a byte of data has already been loaded, the status register must be read so that internal CPU interface logic is reinitialized and will accept the next byte as data and not as a register destination. This situation may be encountered in interrupt-driven program environments. Whenever the status of VDP write parameters is in question, this procedure should be used. NOTE The CPU address is destroyed by writing to the VDP register. 2-1 INTERRUPT CONTROL REGISTEfl 8US 81 o m"m Om" ,g~~ :0 .... :;: n .. :0:0 m'" "m -:0 :: :0'" 0 0 [; :0 :oZ ml> e~ l> :::: .!Q ~:o :00 mO ,,;: :0 0 mO ,,;: m ... m :a=t ... m ~Z mm m ~; m", Cm C;;;: "'l> ~~ ~ :0 :0 0 :o~ mz mz :0 :D~ ;;1 :00 :00 8~ C'" ..... Z~ FIFTH ~ mC SPRITE :0;;1 FOREGROUND COLOR 8/ }-I SPRITE .1 BACKGROUND SHIFT REG. COLOR ~ SPRITE #1 SPRITE .2 SPRITE #1 COLOR ST/XSYN DOWN eNTR. SHIFT REG. COLOR DECODER :0 COMP, VIDEO l> ~ ;: 0 EXTN. VO . ...l>l> ... Z C SPRITE #2 DOWNCNTR. SPRITE -3 SHIFT REG. SPRITE _2 COLOR VIDEO LOGIC _________________~R-VI}~i U! c;; ::! SPRITE -3 DOWN CNTR. SPRITE #4 SHIFT REG. SPRITE #3 COLOR -=-=---:...--=--=-= =====-= ==:;-Cil 1-1 B-V! ~~ ~ SPRITE #4 DOWNCNTR.\ PATT. SHIFT REGISTER SPRITE #4 COLOR 00 FIGURE 2-1 - VDP BLOCK DIAGRAM iN'f STATUS REGISTERS SCREEN ADDRESS & CONTROL REGISTERS DATA CPU DO- 07 B ADDRESS r-- REGISTER f-- VRAM READ DATA REGISTER I--- WRITE DATA REGISTER r-- CSR=E CSW :J CONTROL MODE FIGURE 2-2 - VDP TO CPU INTERFACE 2.1.3 CPU Write to VRAM The CPU transfers data to the VRAM through the VDP using a 14-bit autoincrementing address register. The address register setup requires 2-byte transfers. A 1-byte transfer is then required to write the data to the addressed VRAM byte. The address register is then autoincremented. Sequential VRAM writes require only 1-byte transfers since the address register is already set up. During setup of the address register, the two MSBs of the second address byte must be 0 and 1 respectively. MODE is high for both address transfers and low for the data transfer. CSW is used in all transfers to strobe the 8 bits into the VDP. See Table 2-1. TABLE 2-1 - CPUIVDP DATA TRANSFERS BIT OPERATION CSW CSR MODE 0 1 2 3 4 5 6 7 WRITE TO VDP REGISTER BYTE 1 DATA WRITE DO 01 02 03 04 05 06 07 0 1 1 BYTE 2 REGISTER SELECT 1 0 0 0 0 RSO RS1 RS2 0 1 1 WRITE TO VRAM BYTE 1 ADDRESS SETUP A6 A7 AS Ag A10 A11 A12 A13 0 1 1 BYTE 2 ADDRESS SETUP 0 1 AO A1 A2 A3 A4 A5 0 1 1 BYTE 3 DATA WRITE DO 01 02 03 04 05 06 07 0 1 0 READ FROM VOP REGISTER BYTE 1 DATA READ DO 01 02 03 04 05 06 07 1 0 1 READ FROM VRAM BYTE 1 ADDRESS SETUP As A7 AS Ag A10 A11 A12 A13 0 1 1 BYTE 2 ADDRESS SETUP 0 0 AO A1 A2 A3 A4 A5 0 1 1 BYTE 3 DATA READ DO 01 02 03 04 05 06 07 1 0 0 2-3 2.1.4 CPU Read from VDP Status Register The CPU can read the contents of the status register with a single-byte transfer. MODE is high for the transfer. CSR is used to signal the VDP that a read operation is required. 2.1.5 CPU Read from VRAM The CPU reads from the VRAM through the VDP using the autoincrementing address register. A 1-byte transfer is then re- quired to read the data from the addressed VRAM byte. The address register is then autoincremented. Sequential VRAM data reads require only a 1-byte transfer since the address register is already set up. During setup of the address register, the two MSBs of the second address byte must be O. By setting up the address this way, a read cycle to VRAM is initiated and read data will be available for the first data transfer to the CPU. (See Table 2-1). MODE is high for the address byte transfers and low for the data transfers. The VDP requires approximately 8 microseconds to fetch the VRAM byte follow- ing the last data transfer and 2 microseconds following address setup. The CPU interacts with VRAM memory through the VDP. The amount of time necessary for the CPU to transfer a byte of data to or from VRAM memory can vary from 2 to 8 microseconds. Once the VDP has been told to read or write a byte of data to or from VRAM it takes approximately 2 microseconds until the VDP is ready to make the data transfer. In addition to this 2 microsecond delay, the VDP must wait for a CPU access window; i.e., the period of time when the VDP is not occupied with memory refresh or screen display and is available to read or write data. The worst case time between windows occurs during the Graphics I or Graphics II mode when sprites are being used. Dur- ing the active display, CPU windows occur once every 16 memory cycles giving a maximum delay of 6 microseconds (a memory cycle takes about 372 nanoseconds). In the Text mode the CPU windows occur at least once out of every three memory cycles or a worst case delay of about 1.1 microseconds. Finally, in the Multicolor mode, CPU windows occur at least once out of every four memory cycles. If the user needs to access memory in 2 microseconds, two situations occur where the time waiting for an access window is effectively zero. Both of these are independent of the display mode being used. The first situation occurs when the blank bit of register 1 is O. With' this bit low, the entire screen will show only border color and the VDP does not have to wait for a CPU access window at any time. The second situation occurs when the VDP is in the vertical refresh mode. The VDP issues an interrupt output at the end of each active area. This signal indicates that the VDP is enterin,g the vertical refresh mode and that for the next 4.3 milliseconds there is no waiting for an access window. If the user wants the CPU to access memory during this interval, it is necessary for the controlling CPU to monitor the interrupt output of the VDP (the CPU can either poll this output or use it as an interrupt input). The program that monitors the interrupt output must allow for its own delays in responding to the interrupt signal and recognize how much time it has left during the 4300 microsecond refresh period. The CPU must write a 1 to the interrupt enable bit of Register 1 in order to enable the interrupt for each frame, and then read the status register each time an inter- rupt is issued to clear the interrupt output. A summary of these delay times is presented in Table 2-2. TABLE 2-2 - MEMORY ACCESS DELAY TIMES VDP TIME WAITING FOR TOTAL CONDITION MODE DELAY AN ACCESS WINDOW TIME Active Display Area Text 2/.ls 0-1.1/.ls 2-3.1tJS Active Display Area Graphics 2tJS 0- 5.95 /.ls 2 - 8 /.lS I, II 4300 tJS after Vertical All 2/.ls o /.ls 2/.ls Interrupt Signal Register I All 2/.ls O/.lS 2tJS Blank Bit 0 Active Display Area Multicolor 2tJS o - 1.5 /.ls 2 - 3.5 /.lS 2-4 2.1.6 VDP Interrupt The VDP INT output pin is used to generate an interrupt at the end of each active-display scan, which is about every 1/60 second for the TMS991SA/992SA and 1/50 second for the TMS9929A. The INT output is active wl;len the Interrupt Enable bit (IE) in VDP Register 1 is a 1 and the F bit of the status register is a 1. Interrupts are cleared when the status register is read. 2.1.7 VDP Initialization The VDP is extemally initialized whenever the RESET input is active (low) and must be held low for a minimum of 3 microseconds. The extemal reset synchronizes all clocks with its falling edge, sets the horizontal and vertical counters to known states, and clears VDP registers 0 and 1. The video display is automatically blanked since the BLANK bit in VDP register 1 becomes a O. The VDP, however, continues to refresh the VRAM even though the display is blanked. While the RESET line is active, the VDP does not refresh the VRAM. 2.2 WRITE-ONLV REGISTERS • The eight VDP write-only registers are shown in Figure 2-3. They are loaded by the CPU as described in Section 2.1.2. Registers 0 and 1 contain flags to enable or disable various VDP features and modes. Registers 2 through 6 contain values that specify starting locations of various sub-blocks of VRAM. The definitions of these sub-blocks are described in Section 2.4. Register 7 is used to define backdrop and text colors. Each register is described in the following paragraphs. 2.2.1 Register 0 Register 0 contains two VDP option control bits. All other bits are reserved for future use and must be Os. BIT 6 M3 (mode bit 3) (see Section 2.3.2 for table and description) BIT 7 Extemal VDP enable/disable o disables extemal VDP input 1 enables extemal VDP input NOTE Enabling bit 7 in the TMS992SA/9929A causes A-V and B-V to go to the sync level only when all planes in front of the pixel under question are transparent. 2.2.2 Register 1 (contains 8 VDP option control bits) BIT 0 4/16K selection o selects. 4027 RAM operation 1 selects 41 OS/4116 RAM operation BIT 1 BLANK enable/disable o causes the active display area to blank 1 enables the active display Blanking causes the display to show border color only BIT 2 IE (Interrupt Enable) o disables VDP interrupt 1 enables VDP interrupt BIT 3,4 M1, M2 (mode bits 1 and 2) M1, M2 and M3 determine the operating mode of the VDP: M1 M2 M3 0 0 0 Graphics I mode 0 0 1 Graphics " mode 0 1 0 Multicolor Mode 1 0 0 Text mode BIT 5 Reserved 2-5 BIT6 Size (sprite size select) o selects Size 0 sprites (8 x 8 bit) 1 selects Size 1 sprites (16 x 16 bits) BIT7 MAG (Magnification option for sprites) o selects MAGO sprites (1 X) 1 selects MAG1 sprites (2X) REGISTER MSB lSB 0 I 0 0 0 0 0 0 M3 EV I 4/16K IBCAN'I IE Ml M2 I 0 I SIZE MAG 2 0 0 0 0 NAM~ "m ~" AD~",~ 3 : : oo,~. "B'~ BA" A~D.'SS PATTE'RN GENE'RATOR 0 0 0 0 0 4 BASE ~DDRESSI , I I I , I 5 o SPRITE ATTRIBUTE TABLE BASE ADDRESS I I I I I I SPRITI~ PA TTER~ 0 GENERATOR BASE 6 0 0 0 0 ADDR~SS I , , , • , 7 TEXT COLORl TEXT COLORO/BACKDROP COLOR I I I I I STATUS I I" Ie",," ~.m NUMB,. : (READ-ONLY)~____~_____~_____~L-____L-____~;~__-l;____-J_~__--' F FIGURE 2-3 - VDP REGISTERS 2-6 2.2.3 Register 2 Register 2 defines the base address of the Name Table sub-block. The range of its contents is from 0 to 15. The contents of the register form the upper 4 bits of the 14-bit Name Table addresses; thus the Name Table base address is equal to (Register 2) *400(hex). 2.2.4 Register 3 Register 3 defines the base address of the Color Table sub-block. The range of its contents is from 0 to 255. The contents of the register form the upper 8 bits of the 14-bit Color Table addresses; thus the Color Table base address is equal to (Register 3) *40(hex). 2.2.5 Register 4 Register 4 defines the base address of the Pattern, Text or Multicolor Generator sub-block. The range of its contents is 0 through 7. The contents of the register form the upper 3 bits of the 14-bit Generator addresses; thus the Generator base address is equal to (Register 4) *800(hex). 2.2.6 Register 5 Register 5 defines the base address of the Sprite Attribute Table sub-block. The range of its contents is from 0 through 127. The contents of the register form the upper 7 bits of the 14-bit Sprite Attribute Table addresses; thus the base address is equal to (Register 5) *80(hex). 2.2.7 Register 6 Register 6 defines the base address of the Sprite Pattern Generator sub-block. The range of its contents is 0 through 7. The contents of the register form the upper 3 bits of the 14-bit Sprite Pattern Generator addresses; thus the Sprite Pattern Generator base address is equal to (Register 6) *800(hex). 2.2.8 Register 7 The upper 4 bits of Register 7 contain the color code of color 1 in the Text mode. The lower 4 bits contain the color code for color 0 in the Text mode and the backdrop color in all modes. 2.2.9 Setup Values for VDP Registers 2 through 6. VRAM TABLE ADDRESSING Register 2 in the VDP contains the starting address for the Name Table SUb-block. R2 * 400(16) = START ADDRESS R2 ADDRESS 00 0000 01 0400 02 0800 03 OCOO - MAXIMUM NUMBER FOR 4K RAMS 04 1000 05 1400 06 1800 07 1COO 08 2000 09 2400 OA 2800 OB 2COO OC 3000 00 3400 OE 3800 OF 3COO - MAXIMUM NUMBER 2-1 Register 3 in the VOP contains the starting address for the Color Table. (R3) * 40(16) STARTING ADDRESS START START START R3 ADDRESS R3 ADDRESS R3 ADDRESS 00 0000 28 OAOO 50 1400 01 0040 29 OA40 51 1440 02 0080 2A OA80 52 1480 03 OOCO 28 OACO 53 14CO 04 0100 2C 0800 54 1500 05 0140 20 OB40 55 1540 06 0180 2E OB80 56 1580 07 OtCO 2F OBCO 57 15CO 08 0200 30 OCOO 58 1600 09 0240 31 OC40 59 1640 OA 0280 32 OC80 5A 1680 OB 02CO 33 OCCO 5B 16CO OC 0300 34 0000 5C 1700 00 0340 35 0040 50 1740 OE 0380 36 0080 5E 1780 OF 03CO 37 OOCO 5F 17CO 10 0400 38 OEOO 60 1800 11 0440 39 OE40 61 1840 12 0480 3A OE80 62 1880 13 O4CO 3B OECO 63 18CO 14 0500 3C OFOO 64 1900 15 0540 3D OF40 65 1940 16 0580 3E OF80 66 1980 17 05CO 3F OFCO* 67 19CO 18 0600 40 1000 68 1ADO 19 0640 41 1040 69 lA40 lA 0680 42 1080 6A lA80 lB 06CO 43 lOCO 6B lACO lC 0700 44 1100 6C 1800 10 0740 45 1140 60 1840 tE 0780 46 1180 6E lB80 tF 07CO 47 l1CO 6F 1BCD 20 0800 48 1200 70 1COO 21 0840 49 1240 71 1C40 22 0880 4A 1280 72 lC80 23 08CO 4B 12CO 73 lCCO 24 0900 4C 1300 74 1000 25 0940 40 1340 75 1040 26 0980 4E 1380 76 1080 27 09CO 4F 13CO 77 lOCO *Maxlmum number for 4K RAMS 2-8 (R3)* 40(16) STARTING ADDRESS (Concluded) START START START R3 ADDRESS R3 ADDRESS R3 ADDRESS 78 1EOO A6 2980 03 34CO 79 1E40 A7 29CO 04 3500 7A 1E80 A8 2Aoo 05 3540 7B 1ECO A9 2A40 06 3580 7C 1Foo AA 2A80 07 35C0 70 1F40 AB 2ACO 08 3600 7E 1F80 AC 2Boo 09 3640 7F 1FCO AD 2B40 DA 3680 80 2000 AE 2B80 DB 36CO 81 2040 AF 2BCO DC 3700 82 2080 BO 2COO DO 3740 83 20CO B1 2C40 DE 3780 84 2100 B2 2C80 OF 37CO 85 2140 B3 2CCO EO 2800 86 2180 B4 2000 E1 3840 87 21CO B5 2040 E2 3880 88 2200 B6 2080 E3 38CO 89 2240 B7 2DCO E4 3900 8A 2280 B8 2Eoo E5 3940 8B 22CO B9 2E40 E6 3980 8C 2300 BA 2E80 E7 39CO· 80 2340 BB 2ECO E8 3Aoo 8E 2380 BC 2Foo E9 1A40 8F 23CO BD 2F40 EA 3A80 90 2400 BE 2F80 EB 3ACO 91 2440 BF 2FCO EC 3Boo 92 2480 CO 3000 ED 3840 93 24CO C1 3040 EE 3B80 94 2500 C2 3080 EF 3BCD 95 2540 C3 30c0 FO 3COO 96 2580 C4 3100 F1 3C40 97 25CO C5 3140 F2 3C80 98 2600 3180 F3 3CCO C6 99 2640 C7 31CO F4 2000 9A 2680 9B 26CO C8 3200 F5 3040 9C 2700 C9 3240 F6 3080 90 2740 CA 3280 F7 3DCO 9E 2780 CB 32CO F8 3Eoo 9F 27CO CC 3300 F9 3E40 AO 2800 CD 3340 FA 3E80 A1 2840 CE 3380 FB 3ECO A2 2880 CF 33CO FC 3FoO A3 28CO DO 3400 FD 3F40 A4 2900 01 3440 FE 3F80 A5 2940 02 3480 FF 3FCO 2-9 Register 4 in the VDP contains the starting address for the Pattern Generator Sub-block_ (R4) * 800(16) =STARTADDRESS START R4 ADDRESS 00 0000 01 0800 - Max # for 4K RAMS 02 1000 03 1800 04 2000 05 2800 06 3000 07 3800 - Max #for 16K RAMS Register 5 in the VDP contains the starting address for the Sprite Attribute Table. (R5) * 80(16) = START ADDRESS START START START START R5 ADDRESS R5 ADDRESS R5 ADDRESS R5 ADDRESS 00 0000 21 1080 40 '2000 60 3000 01 0080 22 1100 41 2080 61 3080 02 0400 23 1180 42 2100 62 3100 03 0180 24 1200 43 2180 63 3180 04 0200 25 1280 44 2200 64 3200 05 0280 26 1300 45 2280 65 3280 06 0300 1380 2300 66 3300 27 46 07 0380 67 3380 28 1400 47 2380 08 0400 68 3400 0480 29 14,80 48 2400 09 69 3480 0500 2A 1500 49 2480 OA 6A 3500 OB 0580 2B 1580 4A 2500 2C 1600 4B 2580 6B 3580 OC 0600 0680 2D 1680 4C 2600 6C 3600 OD 0700 1700 4D 2680 6D 3680 OE 2E OF 0780 4E 2700 6E 3700 2F 1780 10 0800 4F 2780 6F 3780 30 1800 11 0880 50 2800 70 3800 31 1880 12 0900 51 2880 71 3880 32 1900 13 0980 52 2900 72 3900 33 1980 73 3980 14 OAOO 53 2980 34 lAOO 2AOO 74 3AOO 15 OA80 54 OBOO 35 lA80 55 2A80 75 3A80 16 17 0880 36 1800 56 2800 76 3BOO 18 OCOO 37 1880 57 2B80 77 3880 19 OC80 38 lCOO 58 2COO 78 3COO lA ODOO 39 lC80 59 2C80 79 3C80 18 OD80 3A lDOO 5A 2DOO 7A 3DOO lC OEOO 3B 1080 58 2080 7B 3080 lD OE80 3C lEOO 5C 2EOO 7C 3EOO lE OFOO 3D lE80 5D 2E80 7D 3E80 IF OF80* 3E 1 FOO 5E 2FOO 7E 3FOO 20 1000 3F lF80 5F 2F80 7F 3F80 'Maximum numbar for 4K RAMS 2-10 Register 6 contains the value for the starting address of the Sprite Pattern Generator sub-block. STARTING ADDRESS = R6 *<800 START R6 ADDRESS 00 0000 01 0800 - Max # for 4K DRAMS 02 1000 03 1800 04 2000 06 2800 06 3000 07 3800 - Max # for 16K RAMS 2.3 STATUS REGISTER The VDP has a single 8-bit status register that can be accessed by the CPU. The status register contains the interrupt pend- ing flag, the sprite coincidence flag, the fifth sprite flag, and the fifth sprite number, if one exists. The format of the status register is shown in Figure 2-3 and is discussed in the following paragraphs. The status register may be read at any time to test the F, C, and 6S status bits. Reading the status register will clear the interrupt flag, F. However, asynchronous reads will cause the frame flag (F) bit to be reset and therefore missed. Conse- quently, the status register should be read only when the VDP interrupt is pending. 2.3.1 Interrupt Flag (F) The F status flag in the status register is set to 1 at the end of the raster scan of the last line of the active display. It is reset to a 0 after the status register is read or when the VDP is externally reset. If the Interrupt Enable bit in VDP Register 1 is active (1), the VDP interrupt output (lNT) will be active (low) whenever the F status flag is a 1. Note that the status register needs to be read frame by frame in order to clear the interrupt and receive the new interrupt of the next frame. 2.3.2 Coincidence Flag (el The C status flag in the status register is set to a 1 if two or more sprites coincide. Coincidence occurs if any two sprites on the screen have one overlapping pixel. Transparent colored sprites, as well as those that are partially or completely off the screen, are also considered. Sprites beyond the Sprite Attribute Table terminator (0016) are not considered. The C flag is cleared to a 0 after the status register is read or the VDP is externally reset. The status register should be read immediately upon powerup to ensure that the coincidence flag is reset. The VDP checks each pixel position for coincidence during the generation of the pixel regardless of where it is located on the screen_ This occurs every 1/60th of a second for the TMS9918A and TM59928A and every 1/50th of a second for the TMS9929A. Thus, when moving sprites more than one pixel position during these intervals, it is possible for the sprites to have multiple pixels overlapping or even to have passed completely over one another when the VDP checks for coin- cidence. 2.3.3 Fifth Sprite Flag (55) and Number The 55 status flag in the status register is set to a 1 whenever there are five or more sprites on a horizontal line (lines 0 to 1921 and the frame flag is equal to a O. The 55 status flag is cleared to a 0 after the status register is read or the VDP is externally reset. The number of the fifth sprite is placed into the lower 5 bits of the status register when the 55 flag is set and is valid whenever the 55 flag is 1. The setting of the fifth sprite flag will not cause an interrupt. 2-11 2.4 VIDEO DISPLAY MODES The VDP displays an image on the screen that can bast be envisioned as a set of display planas sandwiched together. Figure 2-4 shows the definition of each of the planes. Objects on planas closest to the viewer have higher priority. In cases where two entitlas on two different planas are occupying the same spot on the screen, the entity on the higher priority plane will show at that point. For an entity on a specific plane to show through, all planes in front of that plane must be transparent at that point. The first 32 planes (Figure 2-5) each may contain a single sprite. The areas of the Sprite Planes, outside of the sprite itself, are trensp8rent. Since the coorclinatas of the sprite are in terms of pixels, the sprite can be posi- tioned and moved about very accurately. Sprites are available in three sizas: 8 x 8 pixels, 16 x 16 pixels, and 32 x 32 ~x.s. . Behind the Sprita PIenas is the Pattern Plane. The Pattem Plane is used for textual and graphics images generated by the Text, Graphics I, Graphics II, or Multicolor modes. Behind the Pattern Plane is the backdrop, which is larger in area than the other planas so that it forms a border around the other planes. The last and lowast priority plane is the External VDP Plane. Its image is defined by the extemal VDP input pin which allows the TMS9918A to mix the externel video signal internal to the chip. This mixing must occur outside of the chip for the TMS9928A and TMS9929A. This is achieved through the color dif- ference outputs SWinging to a special I~ (sync level is shown in Figure 2-6) not used by the color difference signals in normal operation. This occurs when bit 7 of Register 0 is set high. External mixing circuitry is required to detect this change in the level of the color difference signals and then switch from the VDP signals to an external source's signals (see Figuras 2-7 and 2-8). VDPCHIP ....- ..... BAC:;K[JRCIP (SOLID COLOR) I o PA RNS : (CHARACTER·ORIENTED) I ROP I~,,_ _-v-""---") SPRITES (OBJECT-ORIENTE D)- FIGURE 2.... - VDP DISPLAY PLANES IDEFINITIONI 2-12 EXTERNAL VDP BACKDROP PLANE ~ ....w • FIGURE 2-5 - VDP DISPLAY PLANES (FIRST 32 PLANES) VWHITE - - - Y V BLACK V SYNC - VWHITE - R-Y V BLACK - DETECTION V SYNC - LEVEL VWHITE - B-Y V BLACK - I --- V SYNC - -- - - - - - - - - - - - I DETECTION LEVEL I I I NORMAL OPERATIONS I REGISTER o,IVDP SELECTEd EXT VIDEO SIGNALS I BIT 7 HIGH I IREGISTER IBIT 7 LOW °I SELECTED REGISTER 0, I BIT 7 HIGH I I I * ONLY PRESENT IN TMS9929A I FIGURE 2-6 - TMS9928A/9929A SIGNAL WAVEFORMS FOR MULTIPLE VDP OPERATION 2-14 r-----------. SELECTED R-Y , . . . . . . . - - - - - - -... SELECTED B-Y SELECTED Y EXT ...-_ _ _ _-., R-Y R-Y EXT B-Y .......-'2"'"---, B-Y SOURCE TMS9928A > ....-t---< OR TMS9929A Y TMS9928A/ Y 9929A VREFo-~~r--'------~ FIGURE 2-7 - USING COLOR DIFFERENCE SIGNALS TO MIX EXTERNAL COLOR DIFFERENCE TYPE SOURCE VDP R-Y VDP r-----. SELECTED VIDEO VIDEO TMS9928A B-Y VIDEO EXTERNAL TMS9929A ENCODER VIDEO Y VREF O--JV""--4.... -----f,..... FIGURE 2-8 - USING COLOR DIFFERENCE SIGNALS TO MIX EXTERNAL VIDEO SOURCES 2-15 The backdrop consists of a single color used for the display borders and as the default color for the active display area. The default color is stored in the VDP Register 7. When the backdrop color register contains the transparent code, the backdrop automatically defaults to black if the external VDP mode is not selected. The 32 Sprite Planes are used for the 32 sprites in the Multicolor and Graphics modes. They are not used in the Text mode and are automatically transparent. Each of the sprites can cover an 8 x 8, 16 x 16, or 32 x 32 pixel area on its plane. Any part of the plane not covered by the sprite is transparent. All or part of each sprite may also be transparent. Sprite 0 is on the outside or highest plane, and sprite 31 is on the plane immediately adjacent to Pattern Plane. Whenever a pixel in a Sprite Plane is transparent, the color of the next plane can be seen through that plane. If, however, the sprite pixel is non- transparent, the colors of the lower planes are automatically replaced by the sprite color. There is also a restriction on the number of sprites on a line. Only four sprites can be active on any horizontal line. Addi- tional sprites on a line will be automatically made transparent for that line. Only those sprites that are active on the display will cause the coincidence flag to set. The VDP status register provides a flag bit and the number of the fifth sprite whenever this occurs. The Pattern Plane is used in the Text,. Multicolor, and Graphics modes for display of the graphic pat- terns of characters. Whenever a pixel on the Pattern Plane is nontransparent, the backdrop color is automatically replaced by the Pattern Plane color. When a pixel in the Pattern Plane is transparent, the backdrop color can be seen through the Pattern Plane. The VDP has four video color display modes that appear on the Pattern Plane: Graphics I mode, Graphics II mode, Text mode, and Multicolor mode. Graphics I and Graphics II modes cause the Pattern Plane to be broken up into groups of 8 x 8 pixels, called pattern pOSitions. Since the full image is 256 x 192 pixels, there are 32 x 24 pattern positions on the screen in the Graphics modes. In Graphics I mode, 256 possible patterns may be defined for the 768 pattern positions with two unique colors allowed for each line of a pattern definition. Thus, all 15 colors plus transparent may be used in a single pattern position. In Text mode, the Pattern Plane is broken into groups of 6 x 8 pixels, called text positions. There are 40 x 24 text posi- tions on the screen in this mode. In Text mode, sprites do not appear on the screen and two colors are defined for the entire screen by VDP Register 7. In Multicolor mode, the screen is broken into a grid of 64 x 48 positions, each of which is a 4 x 4 pixel. Within each posi- tion, one unique color is allowed. The VDP registers define the base addresses for several sub-blocks within VRAM. These SUb-blocks form tables which are used to produce the desired image on the TV screen. The Sprite Pattern Generator Table and the Sprite Attribute Table are used to form sprites. The contents of these tables must all be provided by the microprocessor. Animation is achieved by altering the contents of VRAM in real time. The VDP can display the 15 colors shown in Table 2-3. The VDP colors also provide eight different gray levels for displays on monochrome television; the luminance value in the table indicates these levels, 0.00 being black and 1.00 being white. All other values in the table are expressed as percentages of the white/black voltage swing. NOTE The gray levels differ slightly for the TMS9918A when compared to the TMS9928A/9929A. Whenever all planes are of the transparent color at a given point, and external video is not selected, the color shown at that point will be black. 2·16 TABLE 2-3 - COLOR ASSIGNMENTS TMS9918A TMS9928A/9!I29A COLOR COLOR LUMINANCE CHROMINANCE COLOR HEX (DC) (ACVALUE) DIFFERENCE VALUE Y R-Y B-Y 0 TRANSPARENT 0.00 - - - - 1 BLACK 0.00 - 0.00 .47 .47 2 MEDIUM GREEN .53 .53 .53 .07 .20 3 LIGHT GREEN .67 .40 .67 .17 .27 4 DARK BLUE .40 .60 .40 .4 1.00 5 LIGHT BLUE .53 .53 .53 .43 .93 6 DARK RED .47 .47 .47 .83 .30 7 CYAN .67 .60 .73 0.00 .70 8 MEDIUM RED .53 .60 .53 .93 .27 9 LIGHT RED .67 .60 .67 :93 .27 A DARK YELLOW .73 .47 .73 .57 .07 B LIGHT YELLOW .80 .33 .80 .57 .17 C DARK GREEN .46 .47 .47 .13 .23 0 MAGENTA .53 .40 .53 .73 .67 E GRAY .80 - .SO .47 .47 F WHITE 1.00 - 1.00 .47 .47 - BLACK LEVEL 0.00 - 0.00 .47 .47 - COLOR BURST 0.00 .40 0.00 47 (28A) .1 (28A) 73(29A) .2(29A) - SYNC LEVEL -0.40 - -.46 .47 .47 - EXTERNAL VIDEO - - 0.00 .47 .47 - LEVEL - - 0.00 -.46 -.46 2.4.1 Graphics I Mode The VDP is in Graphics I mode when M1, M2, and M3 bits in VDP registers 1 and 0 are zero. When in this mode the Pat- tern Plane is divided into a grid of 32 columns by 24 rows of pattern positions as shown in Figure 2-9). Each of the pattern positions contains 8 x 8 pixel. The tables in VRAM used to generate the Pattern Plane are the Pattern Generator, Name, and Color Tables which require 2848 VRAM bytes. Figure 2-9 illustrates the mapping of these tables into the Pattern Plane. Less memory is required if all 256 possible pattern definitions are not required. The tables can be overlapped to reduce the amount of VRAM needed for pattern generation. Examples of VRAM memory allocation are provided in Section 3.3. ROW 0 0 , • • • 30 31 • • • ROW 1 32 33 62 63 • • • ACTIVE DISPLAY AREA • • • ROW 22 704 705 734 735 • • • ROW 23 735 737 • • • 786 767 FIGURE 2-9 - PATTERN GRAPHICS NAME TABLE MAPPING 2-17 r-- PATTERN POSITION 0 rPATTERN POSITION 1 32 POSITIONS r PATTERN POSITION 31 .QLlJ LL PATTERN ~~~~ITION PATTERN :t 2 8 BYTES) r PATTERN PLANE "A TTERN POS ITiON 767 PATTERN GENERATOR TABLE o ~(M/8) COlOR1(COlORO I--- 31 PATTERN eUlOR TABLE FIGURE 2-10 - GRAPHICS I MODE MAPPING The Pattern Generator Table contains a library of patterns that can be displayed in the pattern positions. It is 2048 bytes long and is arranged into 256 patterns, each of which is 8 bytes long, yielding 8 x 8 bits. All of the 1s in the 8-byte pattern can designate one color (color 1), while all the Os can designate another color (color 0). The full 8-bit pattern name is used to select one of the 256 pattern definitions in the Pattern Generator Table. The table is a 2048-byte block in VRAM beginning on a 2-kilobyte boundary. The starting address of the table is determined by the generator base address in VDP Register 4. The base address forms the three MSBs of the 14-bit VRAM address for each Pattern Generator Table entry. The next 8 bits indicate the 8-bit name of the selected pattern definition. The lowest 3 bits of the VRAM address indicate the row number within the pattern definition. There are 8 bytes required for each of the 256 possible unique 8 x 8 pattern definitions. The first byte defines the first row of the pattern, and the second byte defines the second row. The first bit of each of the eight bytes defines the first column of the pattern. The remaining rows and columns are similarly defined. Each bit entry in the pattern definition selects one of the two colors for that pattern. A 1 bit selects the color code (color 1) contained in the most significant 4 bits of the cor- responding color table byte. A 0 bit selects the other color code (color 0). An example of pattern definition mapping is pro- vided in Figure 2-11. COLUMN BIT ROW/BYTE (PATTERN) (PATTERN DEFINITION) 0 1 2 3 4 5 0 1 2 3 4 5 6 7 - 0 C C C C C 0 1 1 1 1 1 0 0 1 C 0 0 0 0 0 1 0 0 2 C 0 0 0 0 0 1 0 0 3 C C C C 0 0 1 1 1 1 0 0 4 C 0 0 0 0 0 1 0 0 5 C 0 0 0 0 0 1 0 0 6 C C C C C 0 1 1 1 1 1 0 0 7 0 0 0 0 0 0 0 0 NOTES: VDP register 7 entry: 7116' Color code 7 is cyan (signified above by 'C'). Color code 1 is black (signified above by a space). Bit 0 is the most significant bit of each data byte. FIGURE 2-11 - PATTERN DISPLAY MAPPING 2-18 The color of the 1s and Os is defined by the Pattern Color Table that contains 32 entries, each of which is 1 byte long. Each entry defines two colors: the most significant 4 bits of each entry define the color of the 1s, and the least significant 4 bits define the color of the Os. The first entry in the color table defines the colors for patterns 0 to 7; the next entry for patterns 8 to 15, and so on. (See Table 2-4 for assignments.) Thus, 32 different pairs of colors may be displayed simultaneously. The Pattern Name Table is located in a contiguous 768-byte block in VRAM beginning on a 1-kilobyte boundary. The start- ing address of the Name Table is determined by the 4-bit Name Table base address field in VDP Register 2. The base address forms the upper 4 bits of the 14-bit VRAM address. The lower 10 bits of the VRAM address are formed from the row and column counters. An example of pattern name table addressing is given in Section 3.3. TABLE 2-4 - GRAPHICS I MODE COLOR TABLE Byte No. Pattern No. Byte No. Pattern No. 0 0.. 7 16 128 .. 135 1 8.. 15 17 136 .. 143 2 16 .. 23 18 144 .. 151 3 24.. 31 19 152 .. 159 4 32 .. 39 20 160 .. 167 5 40 .. 47 21 168 .. 175 6 48 .. 55 22 176 .. 183 7 56 .. 63 23 184.. 191 8 64.. 71 24 192 .. 199 9 72 .. 79 25 280 .. 207 10 80 .. 87 26 208.. 215 11 88.. 95 27 216.. 223 12 96 .. 103 28 224.. 231 13 104.. 111 29 232 .. 239 14 112.. 119 30 240 .. 247 15 120 .. 127 31 248-255 Each byte entry in the Name Table is either the name of or the pointer to a pattern definition in the Pattern Generator Table. The upper 5 bits of the 8-bit name identify the color group of the pattern. There are 32 groups of 8 patterns. The same two colors are used for all eight patterns in a group; the color codes are stored in the VDP Color Table. The Color Table is located in a 32-byte clock in VRAM beginning on a 64-byte boundary. The table starting address is determined by the 8-bit Color Table base address in VDP Register 3. The base address forms the upper 8 bits of the 14-bit Color Table entry VRAM address. The next bit is a 0 and the lowest 5 bits are equal to the upper 5 bits of the corresponding Name Table entries. Since the tables in VRAM have their base addresses defined by the VDP registers, a complete switch of the values in the tables can be made by simply changing the values in the VDP registers. This is especially useful when one wishes to time- slice between two or more screens of graphics. When the Pattern Generator Table is loaded with a pattern set, manipulation of the Pattern Name Table contents can change the appearance of the screen. Alternatively, a dynamically changing set of patterns throughout the course of a graphics session is easily accomplished since all tables are in VRAM. A total of 2848 VRAM bytes are required for the Pat- tern, Name, Color and Generator tables. Less memory is needed if all 256 possible pattern definitions are not required; the tables can be overlapped to reduce the amount of VRAM needed for pattern generation. Examples of VRAM memory allocation are provided in Section 3.3. 2.4.2 Graphics II Mode The VDP is in the Graphics II mode bits (M1 = 0, M2 = 0 and M3 = 1). The Graphics II mode is similar to Graphics I mode except it allows a larger library of patterns so that a unique pattern generator entry may be made for each of the 768 (32 x 24) pattern positions on the video screen. Additionally, more color information is included in each 8 x 8 graphics pattern. Thus, two unique colors may be specified for each byte of the 8 x 8 pattern. A larger amount of VRAM (12 kilobytes) is required to implement the full usage of the Graphics II mode. Like Graphics I mode, the Graphics II mode Pattern Name Table contains 768 entries which correspond to the 768 pattern positions on the display screen. Because the Graphics I mode pattern names are only 8 bits in length, a maximum of 256 pattern definitions may be addressed using the addressing scheme discussed in Section 2.4.10. Graphics II mode, however, segments the display screen into three equal parts of 256 pattern positions each and also segments the Pattern 2-19 Generator Table into three equal blocks of 2048 bytes each. Pattern definitions in the first third of the display screen cor- respond to pattern positions in the upper third. Likewise, pattern definitions in the second and third blocks of the Pattern Generator Table correspond to the second and third areas of the Pattern Plane. The Pattern Name Table is also segmented into three blocks of 256 names each so that names found in the upper third reference pattern definitions are found in the upper 2048 bytes in Pattern Generator Table. Similarly, the second and third blocks reference pattern definitions in the second 2048-byte block and third-2048 byte block, respectively. Thus, if 768 patterns are uniquely specified, an 8-bit pattern name will be used three times, once in each segment of the Pattern Name Table. The Pattern Generator Table fal/s on 8-kilobyte boundaries and may be located in the upper or lower half of 16K memory based on the MSB of the pattern generator base in VDP Register 4. The LSBs must be set to al/ 1s. The Color Table is also 6144 bytes long and is segmented into three equal blocks of 2048 bytes. Each entry in the Pattern Color Table is 8 bytes which provides the capability to Uniquely specify color 1 and color 0 for each of the 8 bytes of the corresponding pattern definition. The addressing scheme is exactly like that of the Pattern Generator Table except for the location of the table in VRAM. This is controlled by the loading of the MSB of the color base in VDP Register 3. The LSBs must be set to all 1s. Figure 2-12 illustrates the Graphics /I mode mapping scheme. Note that pattern names, Pl, P2, and P3, correspond to pat- tern generator entries in the three blocks of the Pattern Generator Table. Note also how these three names map to the display screen. Figure 2-13 is an example of a Pattern Generator and Pattern Color Table entry. 0 PATTERN#Ml (S BYTES) 2047 2048 r [JPATTERN POSITION 0 PATTERN POSITION 1 r PATTERN POSITION 3 ~ PATTERN #M2 -LJ L (SBYTES) PI .... PATTERN POSITION -- ··Nl·· 4095 PATTERN r I- - Nl PI 4096 POSITION 255 ~ PATTERN POSITION 256 PATTERN#M3 (8 BYTES) - P2~ PATTE~.~~SITION N2 P2 - 8143 PATTERN GENERATOR TABLE .....J--PATTERN POSITION 512 r I- PATTERN POSITION 511 511 Pa).- PATTE~.~:~SITlON 512 0 PATTERN N3 Pa PATTERN #Ml r I- POSITION 767 (8 BYTES) PATTERN PLANE 2047 767 PATTERN NAME TABLE ..... - 2048 4096 4096 PATTERN #M2 (8 BYTES) ~ PATTERN #M3 (8 BYTES) - 6143 PATTERN COLOR TABLE FIGURE 2-12 - GRAPHICS II MODE MAPPING 2-20 o 3 4 7 ROWO o o 000 0 B B B B B B 1 (BLACK) B (LT. YELLOW) OROW 0 0 1 0 0 0 1 0 B B 7 B B B 7 B 7 (CYAN) B (LT. YELLOW) 2 0 0 0 1 0 1 0 0 B B B C B C B B C (GREEN) B (LT. YELLOW) 2 3 0 0 0 0 1 0 0 0 B B B B E B B B E (GRAY) B (LT. YELLOW) 3 4 0 0 0 0 1 0 0 0 B B B B 8 B B B 8 (MEO. RED) B (LT. YELLOW) 4 5 0 0 0 0 1 0 0 0 B B B B 5 B B B 5 (LT. BLUE) B (LT. YELLOW) 5 6 0 0 0 0 1 0 0 0 B B B B 6 B B B 6 (OK. RED) B (LT. YELLOW) 6 7 0 0 0 0 1 0 0 0 B B B B 0 B B B o (MAGENTA) B (LT. YELLOW) 7 PATTERN GENERATOR PATTERN COLOR PATTERN TABLE ENTRY TABLE ENTRY FIGURE 2-13 - PATTERN DISPLAY MAPPING 2.4.3 Multicolor Mode The VDP is in Multicolor mode when mode bits M1 = 0, M2 = 1, and M3 = O. Multicolor mode provides an unrestricted 64 x 48 color square display. Each color square contains a 4 x 4 block of pixels. The color of each of the color squares can be anyone of the 15 video display colors plus transparent. Consequently, all 15 colors can be used simultaneously in the Multicolor mode. The Backdrop and Sprite Planes are still active in the Multicolor mode. The Multicolor Name Table is the same as that for the graphics modes, consisting of 768 name entries, although the name no longer points to a color list. Color is now derived from the Pattern Generator Table. The name points to an 8-byte seg- ment of VRAM in the Pattern Generator Table. Only 2 bytes of the 8-byte segment are used to specify the screen image. These 2 bytes specify four colors, each color oc- cupying a 4 x 4-pixel area. The 4 MSBs of the first byte define the color of the upper left quarter of the multicolor pattern; the LSBs define the color of the upper right quarter. The second byte similarly defines the lower left and right quarters of the multicolor pattern. The 2 bytes thus map into an 8 x 8-pixel multicolor pattern. (See Figure 2-14). ...1.....- 8 PIXELS -I COLOR A COLOR B 8 T A B _ _ _ _ _ _ PIXELS COLOR C COLOR D 2 BYTES FROM PATTERN GENERATOR TABLE 1 C MULTICOLOR PATTERN D FIGURE 2-14 - MULTICOLOR LIST MAPPING 2-21 The location of the 2 bytes within the a-byte segment pointed to by the name is dependent upon the screen position where the name is mapped. For names in the top row (names 0-31), the 2 bytes are the first two within the groups of a-byte segments pointed to by the names. The next row of names (32-63) uses the bytes 3 and 4 within the 8-byte segments. The next row of names uses bytes 5 and 6 while the last row of names uses bytes 7 and 8. This series repeats for the remainder of the screen. For example, referring to Figure 2-15 if Name Table entry 0 (pattern position 0) multicolor block #N (name = N), the multicolor pattern displayed will be an 8 x 8-pixel block consisting of colors A, B, C, and D which comprise the first two bytes of the Multicolor Table. If, however, name #N is located in Name Table entry 33, (Pattern position 33), the colors displayed will be colors E, F, G, and H as specified by bytes 3 and 4 of the multicolor block pointed to by the name. Likewise, pattern positions which lie in rows 2 and 3 would cause colors I, J, K, L and colors M, N, 0, P, respectively, to be displayed. Thus, it cah be seen that the color displayed from the multicolor generator block is dependent upon pattern position on the screen. Figure 2-16 illustrates the Multicolor mode mapping scheme. VIDEO DISPLAY VRAM COLOR COLOR A B o A B ROWS 0, 4, 8, 12, 16, 20 COLOR COLOR C D C D COLOR COLOR E F 2 E F ROWS " 5, 9,13,17,21 COLOR COLOR G H 3 G H COLOR COLOR I J 4 I J ROWS 2, 6, 10, 14, 18, 22 COLOR COLOR K L 5 K L 6 COLOR COLOR M N M N ROWS 3, 7, " , 15, 19, 23 7 COLOR COLOR 0 P 0 P MSB LSB MUL TlCOLOR BLOCK #N GENERATOR BLOCK #N 2 SQUARES WIDE 8 SQUARES HIGH 8 BYTES FIGURE 2·15 - MULTICOLOR BLOCK DISPLAY 2-22 f±EEROWO o ROW 0 o U COLUMN 0 ~ROW1 A B ROW 0 C D NAME E F ~I----------f ROW 1 G H / I J 8 BYTES ROW 2 K L M N \§§J ROW 3 0 P 767 ROW 23 2047~ _ _ _ _...... K L ROW 2 PATTERN NAME PATTERN GENERATOR TABLE VIDEO DISPLAY TABLE ~ IfH3 ROW3 BYTES POINTED TO BY NAMES FIGURE 2-16 - MULTICOLOR MODE MAPPING The mapping of VRAM contents to screen image is simplified by using duplicate names in the Name Table since the series of bytes used within the 8-byte segment specifies a 2 x 8 color square pattern on the screen as a straightforward transla- tion from the 8-byte segment in VRAM pointed to by the common name. When used in this manner, 768 bytes are still used for the Name Table and 1536 bytes are used for the color information in the Pattern Generator Table (24 rows x 32 columns x 8 bytes/pattern position). Thus, a total of 1728 bytes in VRAM are required. It should be noted that the tables begin on eve,n 1 K and 2K boundaries and are therefore not contiguous. An ex- ample of multicolor VRAM memory allocation is given in Section 3.3. 2.4.4 Text Mode The VDP is in Text mode when mode bits Ml = 1, M2 = 0, and M3 = 0. In this mode, the screen is divided into a grid of 40 text positions across and 24 down. (See Figure 2-17). Each of the text positions contains 6 pixels across and 8 pixels down. The tables used to generate the Pattern Plane are the Pattern Name Table and the Pattern Generator Table. There can be up to 256 unique patterns defined at any time. The pattern definitions are stored in the Pattern Generator Table in VRAM and can be dynamically changed. The VRAM contains a Pattern Name Table which maps the pattern definition into each of the 960 pattern cells on the Pattern Plane (Figure 2-18). Sprites are not available in Text mode. 0 1 • • • 38 39 • • • 4D 41 18 ,. • • • • • •• ACTIVE DISPLAY AREA •• •• •• 880 881 918 919 920 921 • • • • • • 958 .5. FIGURE 2-17 - TEXT MODE NAME TABLE PATTERN POSITIONS 2-23 As with the Graphics modes, the Pattern Generator Table contains a library of text patterns that can be displayed in the text positions. It is 2048 bytes long and is arranged in 256 text patterns, each of which is 8 bytes long. Since each text position on the screen is only 6 pixels across, the least significant 2 bits of each text pattern are ignored, yielding 6 x 8 bits in each text pattern. Each 8-byte block defines a text pattern in which all the 15 in the text pattern take on one color when displayed on the screen, while all the Os take on another color. These colors are chosen by loading VDP Register 7 with the color 1 and color 0 in the left and right nibbles. respectively (see Section 2.21. 0 TEXT POSITION 0 1 2 I -40 POSITIONS - 1E XT POSITION 39 o L 1 W 2 N M 8M 8M + 7 . II - TEXT 9 TEXT POSITION "N" 'i f POSITIONS 958 PATTERN 959 "M" r PATTERN NAME TABLE 2046 2047 TEXTPOSI~I ON 959 PATTERN GENERATOR TABLE COLOR 1 COLOR 0 VDP REGISTER 7 FIGURE 2-18 - MAPPING OF VRAM INTO THE PATTERN PLANE IN TEXT MODE In the Text mode, the Pattern Name Table determines the position of the text pattern on the screen as shown in Figure 2-18. There are 960 entries in the Pattern Name Table, each 1 byte long. There is a one-to-one correspondence between text pattern positions on the screen and entries in the Pattern Name Table (40 x 24 = 960). The first 40 entries corre- spond to the top row of text pattern positions on the screen, the next 40 to the second row, and so on. The value of an entry in the Pattern Name Table indicates which of the 256 text patterns is to be placed at that spot on the Pattern plane. The Pattern Name Table is located in a contiguous 960-byte block in VRAM, beginning on a 1-kilobyte boundary. The starting address of the name table is determined by the 4-bit name table base address field in VDP Register 2. The base address forms the upper 4 bits of the 14-bit VRAM address. The lower 10 bits of the VRAM address point to 1 of 960 pat- tern cells. The name table is organized by rows. An exarnple of Pattern Name Table addressing is given in Section 4. Each byte entry in the name table is the pointer to a pattern definition in the Pattern Generator Table. The same two colors are used for all 256 patterns; the color codes are stored in VDP Register 7. As the name implies, the Text mode is intended mainly for textual applications, especially those in which the 32 patterns- per-line in Graphics modes is insufficient. The advantage is that eight more patterns can be fitted onto one line; the disad- vantages are that sprites cannot be used, and only two colors are available for the entire screen. With care, the same text pattern set that is used in Text mode can be also used in Graphics I mode .. This is done byensur- ing that the least significant 2 bits of all the character patterns are O. Thus, a switch from Text mode to Pattern mode results in a stretching of the space between characters, and a reduction of the number of characters per line from 40 to 32. As with the Graphics Modes, once a character set has been defined and placed into the Pattern Generator, updating the Pattern Name Table will produce and manipulate textual material on the screen. The full 8-bit pattern name is used to select 1 of the 256 .pattern definitions in the pattern generator table. The table is a 2048-byte block in VRAM, beginning on a 2-kilobyte boundary. The starting address of the table is determined by the generator base address in VDP Register 4. The base address forms the 3 MSBs of the 14-bit VRAM address for each Pat- tern Generator Table entry. The next 8 bits are equal to the 8-bit name of the selected pattern definition. The lowest 3 bits of the VRAM address are equal to the row number within the pattern definition. There are 8 bytes required for each of the 256 possible unique 6 x 8 pattern definitions. The first byte defines the first row of the pattern, and the second byte defines the second row. The least significant 2 bits in each byte are not used. However, it is strongly recommended that these bits be Os. Each bit entry in the pattern definition selects one of the two colors for 2-24 that pattern. A 1 bit selects the color code (color 1) contained in the most significant 4 bits of VDP Register 7. A 0 bit selects the other color code (color 0) which is in the least significant 4 bits of the same VDP Register. Figure 2-18 is an ex- ample of pattern definition mapping. A total of 3008 VRAM bytes are required for the Pattern Name Generator Tables. Less memory is required if all 256 possi- ble pattern definitions are not required; the tables can be overlapped to reduce the amount of VRAM needed for pattern generation. Examples of VRAM memory allocation are provided in Section 3.3. 2.4.5 Sprites The video display can have up to 32 sprites on the highest priority video planes. The sprites are special animation patterns which provide smooth motion and multilevel pattern overlaying. The location of a sprite is defined by the top left-hand cor- ner of the sprite pattern. The sprite can be easily moved pixel-by-pixel by redefining the sprite origin. This provides a simple but powerful method of quickly and smoothly moving special patterns. The sprites are not active in the Text mode. The 32 Sprite Planes are fully transparent outside of the sprite itself. The sub-blocks in VRAM that define sprites are the Sprite Attribute Table (see Figure 2-19) and the Sprite Generator Table (see Section 4.4). These tables are similar to their equivalents in the pattern realm in that the Sprite Attribute Table specifies where the sprite goes on the screen, while the Sprite Generator Table describes what the sprite looks like. Sprite Pattern formats are given in Table 2-5. BIT o 2 3 4 5 6 7 o VERTICAL POSITION HORIZONTAL POSITION BYTE 2 NAME EARLY 3 CLOCK 0 0 0 COLOR CODE BIT FIGURE 2-19 - SPRITE ATTRIBUTE TABLE ENTRY TABLE 2-5 - SPRITE PATTERN FORMATS SIZE MAG AREA RESOLUTION BYTES/PATTERN 0 0 axa single pixel a 1 0 16 x 16 single pixel 32 0 1 16 x 16 2 x 2 pixels a 1 1 32 x 32 2 x 2 pixels 32 Figure 2-20 illustrates the manner in which the VRAM tables map into the existence of sprites on the display. Since there are 32 sprites available for display, there are 32 entries in the Sprite Attribute Table. Each entry consists of four bytes. The entries are ordered so that the first entry corresponds to the sprite on the sprite 0 plane, the next to the sprite on the sprite 1 plane, and so on. The Sprite Attribute Table is 4 x 32 = 128 and is located in a contiguous 128-byte block in VRAM, beginning on a 128-byte boundary. 2-25 The starting address of the table is determined by the 7-bit Sprite Attribute Table base address in VDP Register 5. The base address forms the upper 7 bits of the 14-bit VRAM address. The next 5 bits of the VRAM address are equal to the sprite number. The lowest 2 bits select 1 of the 4 bytes in Sprite 2 Attribute Table entry for each sprite. Each table entry contains 4 bytes which specify the sprite position, sprite pattern name, and color, as shown in Figure 2-19. VRAM SPRITE ATTRIBUTE TABLE SPRITE GENERATOR TABLE FIGURE 2-20 - SPRITE MAPPING The first two bytes of each entry of the Sprite Attribute Table determine the position of the sprite on the display. The first byte indicates the vertical distance of the sprite from the top of the screen, in pixels. It is defined such that a value of -1 puts the sprite butted up at the top of the screen, touching the backdrop area. The second byte describes the horizontal displacement of the sprite from the left edge of the display. A value of 0 butts the sprite up against the left edge of the backdrop. Note that all measurements are taken from the upper left pixel of the sprite. When the first two bytes of an entry position a sprite so it overlaps backdrop, the part of the sprite that is within the backdrop is displayed normally. The part of the sprite that overlaps the backdrop is hidden from view by the backdrop. This allows the animator to move a sprite into display from behind the backdrop. The displacement in the first byte is partially signed, in that values for vertical displacement between -31 and 0 (E116 to 01 allow a sprite to bleed-in from the top edge of the backdrop. Similarly, horizontal displacement values in the vicinity of 255 allow a sprite to bleed-in from the right side of the screen. To allow sprites to bleed-in from the left edge of the backdrop, a special bit in the third byte of the Sprite Attribute Table entry is used. Byte 3 of the Sprite Attribute Table entry contains the pointer to the Sprite Generator Table that specifies what the sprite should look like. This is an 8-bit pointer to the sprite patterns definition, the Sprite Generator Table. The sprite name is similar to that in the Graphics Modes. Byte 4 of the Sprite Attribute Table entry contains the color of the sprite in its lower 4 bits (see Table 2-3 for color assignmentsl. The MSB is the Early Clock (Eel bit. When set to 0, this bit does nothing. When set to 1, the horizontal poSition of the sprite is shifted to the left by 32 pixels. This allows a sprite to bleed-in from the left edge of the backdrop. Values for horizontal displacement (byte 2 in the entryl in the range 0 to 32 cause the sprite to overlap with the left-hand border of the backdrop. The Sprite Generator Table is a maximum of 2048 bytes long beginning on the 2-kilobyte boundaries. It is arranged into 256 blocks of 8 bytes each. The third byte of the Sprite Attribute Table entry, then specifies which 8-byte block to use to specify a sprite's shape. The 1s in the Sprite Generator cause the sprite to be defined at the point; Os cause the transperent color to be used. The starting address of the table is determined by the sprite generator base address in VDP Register 6. The base address forms the 3 MSB of the 14-bitVRAM address. The next 8 bits of the address are equal to sprite name, and the last 3 bits ate equai to the row number within the sprite pattern. The address formation is slightly modified for SIZE 1 sprites. There is a maximum limit of four sprites that can be displayed on one horizontal line. If this rule is violated, the four highest- priority sprites on the line are displayed normally. The fifth and subsequent sprites are not displayed on that line. Further- more, the fifth-sprite bit in the VDP status register is set to a 1, and the number of the violating fifth sprite is loaded into the status register (see Section 2.31. 2-26 Larger sprites than 8 x 8 pixels can be used if desired. The MAG and SIZE bits in VOP register 1 are used to select the various options described in the following paragraphs. MAG=O,SIZE=O: No options chosen MAG=1,SIZE=O The Sprite Generator Table uses 8 bytes to describe the sprite; however, each bit in the Sprite Generator maps into 2 x 2 pixels on the TV screen, effectively doubling the size of the sprite to 16 x 16. MAG=O,SIZE= 1: The Sprite Generator Table uses 31 bytes to define the sprite shape; the result is a 16 x 16-pixel sprite. The mapping of the 32 bytes into the sprite image is as shown in Figure 2-21. Mapping is still 1 bit to 1 pixel. MAG=1,SIZE=1: Same as MAG = 0, SIZE = 1 except each bit now maps into a 2 x 2-pixel area, yielding a 32 x 32 sprite. The VOP provides sprite coincidence checking. The coincidence status flag in the VOP status register is set to a 1 whenever two active sprites have 1 bits at the same screen location. Sprite processing is terminated if the VOP finds a value of 208 (0016) in the vertical position field of any entry in the Sprite Attribute Table. This permits the Sprite Attribute Table to be shortened to the minimum size required; it also permits the user to blank out part or all of the sprites by simply changing one byte in VRAM. A total of 2176 VRAM bytes are required for the Sprite Name and Pattern Generator Tables. Significantly less memory is required if all 256 possible sprite pattern definitions are not required. The Sprite Attribute Table can also be shortened as described in the preceding paragraph. The tables can be overlapped to reduce the amount of VRAM required for sprite generation. Examples of VRAM memory allocation are provided in Section 3.3. 2-27 VRAM GENERATOR TABLE BLOCK BYTE 00 01 02 PATTERN 03 SCREEN DISPLAY FOR 04 QUADRANT A 05 06 07 QUADRANT QUADRANT A C 08 09 QUADRANT QUADRANT OA PATTERN 8 D OB FOR OC QUADRANT B OD DE SPRITE PATTERN OF SIZE 1 16x16 (MAGOI 32x32 (MAG 11 10 11 PATTERN 12 FOR 13 QUADRANT C 14 15 16 17 18 19 1A PATTERN 1B FOR 1C QUADRANT D 10 1E 1F FIGURE 2-21 - SIZE 1 SPRITE MAPPING 2-28 2.4.8 A Step-by-Step Approach to Create Patterns and Sprites PATTERNS 1. Use an 8 x 8 pattern similar to that in Figure A. Each small square represents one pixel on the screen. FIGURE A 2. Fill in the blocks to create your text character or graphics pattern. Examples of the letter A and an ARROW are shown in Figures Band C. FIGUREB FIGUREC NOTE If these patterns are to be used in the Text mode, (40 patterns per line), the pattern should be inside a left-justified 6 x 8 block like the A shown in Figure B. If all of the Text patterns are inside this 6 x 8 block, they can be used for Text and Graphics 1 and 2 modes. 2-29 3. Assign 1s to the filled-in areas and Os to the blanks. Then convert the 1s and Os to their hexadecimal equivalents, as shown in Figure D. = 00100000 = 20(16) -f-----iHH = 01010000 = 50(16) = 10001000 = 88(16) -----iHH -----iHH = 10001000 = 88(16) = 11111000 = F8(16) -----iHH = 10001000 = 88(16) r--........I-i r--........I-i = 10001000 = 88(16) 1.-01..-01..-'--........'""--01..-&-..1 = 00000000 = 00(16) = 00(16) t-H.....t-t-t-t-t-t = 00(16) = 04(16) =06(16) = FF(16) = 06(16) = 04(16) ..............01.0-........&..."""-_......... = 00(16) = 80(16) ~+-+-+-+--+--I =CO(16) r--ir--ir--t--l--l--l = 80 (16) HHH..........~ = CO(16) = 80(16) ~+-+-+-+--+--4 H H - f - l - l - l = CO(16) = 80(16) = FC(16) FIGURE 0 2-30 4. Now place the eight bytes defining the pattern into the Pattern Generator Table. Assume the Pattern Generator Table sub-block is located at 80016 and the arrow pattern is to be named 0016' Then place the eight pattern bytes as follows: 800 801 00 802 04 803 06 PATTERN 804 FF NAME 00 805 06 806 04 807 00 808 809 < 80A 80B PATTERN 80C NAME 01 800 80E 80F ./' 810 ,::- ,~ 900 00 ........ 901 00 902 00 903 00 PATTERN 904 00 NAME 20 905 00 906 00 907 00 /' 908 ,~ A08 20 1"- A09 50 AOA 88 PATTERN AOS 88 > NAME 41 AOC F8 AOD 88 AOE 88 1/ NOTE When using text in your applications, you can place the eight bytes of the text character in its ASCII number location. Example: ASCII SPACE = 2016 ? = 3F 16 A = 41 16 B = 42 16 C = 43 16 Etc. This simplifies writing text to the screen. Simply write the ASCII name directly to the Pattern Name Table. A space character is shown in Pattern Generator Table position 20, and A is shown in pattern name 41. 2·31 SPRITES 1. Determine whether to use 8 x 8 or 16 x 16 sprite patterns .. Then use the appropriate work pattern, as shown in Figures E and F. FI(3URE E FIGURE F 2. Fill in the blocks to create Y9ur sprite pattern. Examples are shown in Figures G and H. FIGUREG r"'1""11!D1'!'" U rlUvnlO.l1 2-32 3. Next encode the sprite patterns as in the Pattern Section. The a x a sprite encodes exactly as the a x a pattern, but the 16 x 16 sprite encodes as shown in Figure J. OF= = FF 1F= .. FF 30- =00 30= =00 3F= = FO 3F= = Fa 3F" = Fa 3F = = Fa = 81 3F= = F8 =42 3F= = F8 =24 1F = = Fa = 18 00= = 18 -18 = 18 00= =24 00= = 18 =42 = F8 FF= =81 = FO FF= FIGURE I FIGUREJ Break the 16 x 16 block pattern into four a x a patterns. Next, encode the a x a patterns starting in the upper left corner, then do the lower left, upper right, and lower right. 2-33 4. Place the 8 bytes for 8 x 8 sprites or 32 bytes for 16 x 16 sprites in the Sprite Generator Table. Assuming the sprite generator table is located at location 0000. Figures K and Lshow how the tables should look for 8 x 8 and 16 x 16 sprites. 8X8 16 X 16 ....... 000 81 000 OF 001 42 001 1F 002 24 002 30 003 18 SPRITE 003 30 004 18 NAME 00 004 3F 005 24 005 3F 006 42 006 3F UPPER L EFT 007 81 007 3F CORNER Il 008 008 3F 009 009 3F OOA SPRITE OOA 1F OOB NAME 01 OOB 00 OOC OOC 00 000 000 00 LOWER OOE OOE FF LEFT SPRITE OOF OOF FF CORNER NAME 00 010 1/ 010 FF 011 FF 012 00 FIGUREK 013 00 014 FO 015 F8 UPPER 016 F8 RIGHT 017 F8 CORNER 018 F8 01A F8 01B 18 01C 18 LOWER 010 18 RIGHT 01E F8 CORNER 01F FO 020 XX SPRITE NAME 04 FIGURE L 16 x 16 sprite patterns start in the table with the byte from the upper left-hand corner. Then start with the upper right, going to'vvaid the IOv-wsr right. 2-34 3. VDP INTERFACES AND OPERATION 3.1 VDPIVRAM INTERFACE The VDP can access up to 16,3S4 bytes of VRAM using a 14-bit VRAM address. The VDP fetches data from the VRAM in order to process the video image described later. The VDP also stores data in or reads in data from the VRAM during a CPU-VRAM data transfer. The VDP automatically refreshes the VRAM. 3.1.1 VRAM Interface Control Signals The VDP-VRAM interface consists of two S-bit data buses (RDO-RD7 unidirectional, ADO-AD7 bidirectional) and three control lines, as shown in Figure 3-1. The VRAM outputs data to the VDP on the VRAM read data bus (RDO-RD7). The VDP outputs both the address and data to the VRAM over the VRAM address/data bus (ADO-AD7). The VRAM row address is output when RAS is active (low). The column address is output when CAS is active (low). Data is output to the VRAM when R /W is active (low). 3.1.2 VRAM Memory Types The VDP can use 4027-type 4K, 41 OS-type SK, or 4116-type 16K dynamic RAMs. The 4/16K bit in VDP register 1 is a 0 for 4027-type RAMs and a 1 for 41 OS- and 4116-~e RAMs. There is a minor difference between the way 4027s and 4108s/4116s are wired to the VDP. In the 4027, all CE pins are tied to ground. In the 410S/4116 the A6 lines on the 4116 and410S (the same pin as CE on 4027's) are all tied to AD1. on the TMS991SA. A jumper can be used to select the VRAM type. 3.1.3 VDP to DRAM Address Connections The VDP can be easily connected to either the 4027 or 4116 DRAMs. However, due to different pin numbering standards, it is possible to connect the VDP to the DRAMs incorrectly. Table 3-1 shows the recommended way to connect a VDP to either DRAM. Other DRAMs, such as the single + 5 V supply type, can also be used by following the 4K or 16K columns in Table 3-1. TABLE 3-1 - VDP TO DRAM ADDRESS CONNECTIONS 4116 4027 VDP or 16K or4K ADO DATA ONLY DATA ONLY AD1 A6 DATA ONLY AD2 A5 A5 AD3 A4 A4 AD4 A3 A3 AD5 A2 A2 AD6 A1 A1 AD7 AO AO When connecting the data ports together, ensure that corresponding RAMs (assuming S by 1 DRAMs) are properly con- nected to the corresponding input or output of the VDP. For example, ADO of the corresponding input or output 0 input of the RAM, and ROO of the VDP should connect to the Q output of the same RAM. The same is true for all AD and RD corresponding pins for each of the eight DRAMs. NOTE COO is the MSB of the CD bus; CD7 is the LSB. ADO is the MSB of the AD bus; AD7 is the LSB. ROO is the MSB of the RD bus; RD7 is the LSB. RAMs have the reverse convention. AD7 is the MSB of the AD bus, and ADO is the LSB. Therefore, AD7 of the VDP connects to AD of the 4116, and AD1 connects to A6. Data coming into the VOP on COO goes to VRAM on ADO and returns to the VDP on ROO. 3-1 RAS I1AS CAS CAS R/W ~------------------------~-+~w RD7 Q AD7 RD6 D a: RD5 /,-------------~,~;-;-~ AO-A6 ~o RD4 / O)Ul NUl O)W RD3 • 0)0 --0 ~a: RD2 • ~o.. RDl • 0»- O)~ :::;'..J RDO • ...... 0.. ~Ul AD7 ..... "RAS mo UlO AD6 ~I- CAS ~w AD5 '-+-+--f W 1-0 AD4 Q > AD3 1 - - - - ' . / ,... AD2 D AD2 / AO-A6 ADl ADO ~ RAS ~I- CAS .....+-..... w ~ ADl ~ I \.'-_ _ _ _ _ _.-~ '_+_+_+~ AO-A6 - - CAS RAS 0 w '*" Q .... CD .... D o:t \ "- AO-A6 ,... "- • FIGURE 3-1 - VRAM INTERFACE 3-2 3.2 VRAM MEMORY ADDRESS DERIVATION Table 3-2 summarizes the VRAM address derivation for all VDP modes of operation. Section 4 of this manual contains examples of how typical VRAM addresses are computed by the VDP. TABLE 3-2 - PATTERN GRAPHICS ADDRESS LOCATION TABLES GRAPHICS I MODE ADDRESS LOCATION ADDRESS TYPE o /1/2/3/4/5J&171819/10111112J13 COMMENTS 1) PATTERN NTB I PATTERN NAME TABLE BASE (VDP REG2) NAME I ROW I PATTERN POSITION ADDRESS I COLUMN 2) PATTERN COLB I PATTERN COLOR TABLE BASE (VDP REG3) COLOR [01 ALWAYS "O"IN BIT 8 ADDRESS I NAME (0-4) FIVE MOST SIGNIFICANT BITS OF NAME 3) PATTERN PGB I PATTERN GENERATOR BASE (VDP REG4) GENERATOR I NAME I ALL 8 BITS OF NAME ADDRESS XXX THREE LSB'S FORM PATTERN ROW POSITION GRAPHICS II MODE ADDRESS LOCATION ADDRESS TYPE 011121314151&1718J9110111112113 COMMENTS 1) PATTERN NTB , ROW PATTERN NAME TABLE BASE (VDP REG2) PATTERN POSITION ROW NAME I J ADDRESS I COLUMN PATTERN POSITION COLUMN 2) PATTERN h PATTERN COLOR TABLE BASE MSB (VDP REG3) COLOR I XX I TWO MSB FROM VERTICAL COUNTER ADDRESS I NAME J ALL 8 BITS OF NAME I XXX COLOR TABLE BYTE/LINE 3) PATTERN h PATTERN NAME TABLE BASE MSB (VDP REG4) GENERATOR I XX I TWO MSB FROM VERTICAL COUNTER ADDRESS L NAME J ALL 8 BITS OF NAME I XXX PATTERN GENERATOR BYTE/LINE NUMBER TEXT MODE ADDRESS LOCATION ADDRESS TYPE o 11/213/415J&1718191101"112113 COMMENTS TEXT MODE NTB J PATTERN NAME TABLE BASE (VDP REG2) NAME ADDRESS I TEXT POSITION EQUAL (TEXT POSITION ROW # TIMES 40) PLUS (TEXT POSITION COLUMN NUMBER) TEXT MODE PGB I PATTERN GENERATOR BASE (VDP REG4) PATTERN I NAME I NAME ADDRESS J XXX BYTE/LINE NUMBER 3-3 TABLE 3-2 - PATTERN GRAPHICS ADDRESS LOCATION TABLES (CONTINUED) SPRITE ADDRESS LOCATION ADDRESS TYPE 01 112 13141516171819110111112113 COMMENTS SPRITE SAB I SPRITE ATTRIBUTE TABLE BASE (VDP REGS) ATTRIBUTE L SPRITE I SPRITE NUMBER ADDRESS ~ ATTRIBUTE NUMBER: 00 FOR VERTICAL POSITION 01 FOR HORIZONTAL POSITION 10 FOR NAME 11 FOR TAG (EARLY CLOCK AND COLOR) SIZE = 0 SPGB I SPRITE PATTERN GENERATOR BASE (VDP REG4) SPRITE PATTERN I NAME I NAME ATTRIBUTE OF SPRITE GENERATOR I XXX THREE LSB'S GIVE BYTE/LINE NUMBER SIZE = 1 SPGB I SPRITE PATTERN GENERATOR BASE (VDP REG4) SPRITE PATTERN INAME (0·5) I SIX MSB OF NAME GENERATOR XXXXX SIZE = 1 SPRITE BYTE NUMBER (SEE FIGURE 4-4) MUL TICOLOR ADDRESS LOCATION ADDRESS TYPE 01 11213141516171819110111112113 COMMENTS 4) MULTICOLOR NTB 1 NAME TABLE BASE (VDP REG2) NAME I ROW I PATTERN POSITION ROW ADDRESS I COLUMN PATTERN POSITION COLUMN 5) MULTICOLOR PGB I PATTERN GENERATOR BASE (VDP REG4) COLOR I NAME I NAME FROM NAME FETCH GENERATOR I XXX THREE LSB'S FORM BYTE/SQUARE ROW ADDRESS The TM S9918A/9928A operates at 262 lines per frame and approximately 60 frames per second in a noninterlaced mode of operation. The TMS9929A operates at 313 lines per frame and approximately 50 frames per second in a noninterlaced mode of operation. 3.3 VRAM ADDRESSING EXAMPLE A typical application might require up to 256 unique 8 x 8 patterns with no more than 2 colors per pattern and up to 32 8 x 8 sprites. These conditions dictate in which mode the VDP is to be used. The sprite requirement and the 8 x 8 pattern blocks eliminate the text and multicolor modes, respectively. This leaves only the Graphics I and Graphics" modes, and since two colors per block are all that are necessary, Graphics I is employed due to its ease of use. Figure 3·2 shows a memory map that allows these functions to fit into a 4K memory area. Register values for Figure 3·2 are as follows: Register 0 = 00 External VDP disabled, M3 = 0 Register 1 = CO 16K DRAM selected, Blank = 1, Graphics 1 mode selected, SIZE = 0, MAG = 0 Register 2 = 01 Name Table Start Address @ >400 Register 3 = 08 Color Table Start Address @ >0200 Register 4 = 01 Pattern Generator Start Address @ > 800 Register 5 = 02 Sprite Attribute Table Start Address> 100 Register 6 = 00 Sprite Pattern Generato; Start AddieSS @>OOOO Register 7 = XX Determined by user. 3-4 If the same application required 16 x 16 bit sprites, then the 0000 SPRITE 328 X 8 PATTERNS memory map could be modified as follows: GENERATOR = 256 BYTES TABLE OOFF 0000 SPRITE 3218 X 16 SPRITES 0100 GENERATOR 32 SPR X 32 BYTES SPRITE 32 SPRITES X 4 BYTES ATTRIBUTE =80 BYTES TABLE 03FF =1024 BYTES TABLE 017F 0400 PATTERN 0180 24 LINES X 32 CHAR NAME UNUSED TABLE =768 CHAR 01FF 06FF 0200 0700 COLOR SPRITE 32 SPRITES X 4 BYTES 32 BYTES ATTRIBUTE TABLE =128 BYTES 021F TABLE 073F 0220 UNUSED 0740 03FF COLOR TABLE 32 BYTES 0400 PATTERN 24 LINES X 32 CHARACTERS 075F NAME =768 BYTES 0760 TABLE UNUSED 06FF 0700 0800 UNUSED PATTERN 256 PATTERNS X 8 BYTES 07FF GENERATOR EACH = 2048 BYTES 0800 SUB·BLOCK PATTERN 256 PATTERNS X 8 BYTES/PATTERN OFFF GENERATOR =2048 BYTES SUB·BLOCK OFFF FIGURE 3-2 - VDP·VRAM MEMORY ALLOCATION 3.4 MONITOR INTERFACES 3.4.1 TMS9918A Monitor Interfece The composite video output signal from the TMs9918A drives a color monitor. This signal incorporates all necessary horizontal and vertical synchronization signals as well as luminance and chrominance information. In monitor applications, the requirements of the monitor should be studied to determine if the VDP can be connected directly to it. The internal out· put buffer device on the composite video pin is a source-follower MOs transistor that requires an external pull-down resistor to V sS as shown in Figure 3-3. Typically a 330-ohm resistor is recommended to provide a 1.9-volt synchronization level. The loaef resistor (RLl defines the sharpness of the edges on the video signals. A lower resistor value gives faster fall times and a sharper picture. In some cases, it may be necessary to provide a simple interface circuit to match the VDP output voltages with the monitor specifications. To drive a standard television that is not outfitted with a composite video input, the signal can be run into the television antenna terminals by using an appropriate RF modulator on the VDP output. Take care to ensure a proper match between VDP, RF modulator, and TV. Vce TMS9918A - VDP COMPOSITE VIDEO OUTPUT Rext 330.n TYP FIGURE 3-3 - COMPOSITE VIDEO PULL-DOWN CIRCUIT 3-5 3.4.2 TMS9928A/9929A Monitor Interface The Y, R-Yand B-Y output signals require external encoder circuitry to drive a video color monitor; an R~G-B matrix cir- cuitry is req1Jired to drive R-G-B color monitors. The Y output signal contains all necessary horizontal and vertical syn- chronization signals as well as luminance while the R-Y and B-Y signals contain the unmodulated chrominance information and are used in the NT5C and PAL systems to modulate two carriers in quadrature. The internal output buffer devices on these pins are source-follower M05 transistors that require an external pull-down resistor to V 55' as shown in Figure 3-4. A 330 ohm resistor is recommended. VDPCRYSTAL D R-Y R 470 G VDP RGB TMS9928A/9929A -1 B-Y ENCODERI B 470 DRIVER SYNC ---- (OPTIONAL) .J Y RGBMONITOR 470 BURST CRYSTAL VDPCRYSTAL (4,43 MHz TMS9929A) PAL 10.738 MHz (adjustable) color (3.58 MHz TMS9.928A) NTSC D R-Y 470 COMPOSITE VIDEO VIDEO B-Y ENCODERI VDP .J DRIVER (NTSC/PAL) TMS9928A/9929A 470 VIDEO MONITOR .J V 470 NOTE: The LM1889 is tYplcaliV used in the video encoder clrcuitrv. FIGURE 3-4 - USE OF TMS992SA/9929A WITH OIFFERENT MONITORS 3-6 3.5 TMS9918A EXTERNAL VDP OPERATION The external VDP interface allows cascading multiple VDPs. Figures 3-5 and 3-6 illustrate cascading two VDPs. Note that the VDPs must be reset by a common reset source to assure synchronization on an open loop basis. This reset source should have fast edges so that rise and fall times are less than 30 ns. Occasionally, synchronization is not obtained after reset, in which case, reset should be reapplied. The video matching circuit ensures that the video signal of external VDP is biased correctly and of the proper amplitude. This ensures the luminance levels of the external and VDP colors are matched and external VDP video does not bleed through into the composite video output of the first VDP. The internal circuit assures that a perfect match results if the external video is of the same amplitude as the composite video of the VDP and its dc level is increased by a MOS threshold voltage (typically 0.7 volts). This adjustment can be varied to change the relative luminance levels of the two video signals and thus modify the picture appearance. XTAL 10.738635 MHz ~ --r- - I J XTAL2 XTAL1 XTAL2 XTAL1 TMS9918A TMS9918A COMVID -- VIDEO MATCHING -- EXTVDP COMVID r---. ORTORFMONITOR MONITOR , CIRCUIT RESET/SYNC RESET/SYNC t FROM RESET SOURCE FIGURE 3-5 - CASCADING TWO TMS9918A VDPs A - XTAL 10.738635 MHz T I I -- EXT MODE VDP R-Y .. - R-Y VDP SLAVE -- MASTER 8-Y _ DETECT (EXTERNAL) - AND B-Y SOURCE RESET/SYNC Y -- I I I SELECT Y RESET/SYNC ~ B-Y Y I~ R-Y (SELECTED) FROM RESET SOURCE FIGURE 3-6 - CASCADING TWO TMS9918A/9929A VDPs 3-7 For the External VDP input plane to be visible, the External VDP Enable bit in VDP Register 0 (EXVID) should be set to a 1. The backdrop color (VDP Register 7, lower 4 bits) should be set to transparent (0). For the external VDP plane to show through at a given spot on the screen, the pattern color at that spot should be transparent, and all sprites should not be in the way (alternatively, a sprite that was in the way could be made transparent in color). Note that the external VDP feature can be used in either Graphics I, Graphics II, Text, or Multicolor mode. 3.6 OSCILLATOR AND CLOCK GENERATION The VDP is designed to operate with a 10.738635 (± 0.005) MHz crystal input to generate the required internal clock signals. A fundamental-frequency parallel-mode crystal is the frequency reference for the internal clock oscillator, which is the master time base for all system operations. This master clock is divided by two to generate the pixel clock (5.3 MHz) and by three to provide the CPUCLK (3.58 MHz for TMS9918A only). The GROMCLK is developed from the master clock frequency divided by 24 (3.58 MHz for TMS9928A only). 3.6.1 TMS9918A Color Phase Generation The 10.7 + MHz master clock and its complement generate an internal six-phase 3.579545 MHz (± 10 Hz) clock to pro- vide the video color signals and the color burst reference used in developing the composite video output signal. While the VDP signals are not exact equivalents to the standard NTSC colors, the differences can easily be adjusted with the color and tint controls of the target color monitor. 3.6.2 Video Sync and Control Generation Decoding the outputs of the horizontal and vertical counters generates the horizontal and vertical control signals. The pixel clock drives the horizontal counter which in turn increments the vertical counter. Table 3-3 gives the relative count values of the screen display parameters. Within the active display area during Graphics I mode, the three LSBs of the horizontal counter address the individual picture element of each pattern displayed. Also, dur- ing the vertical active display period, the three LSBs of the vertical counter address each individual line in the 8 x 8 pat- terns. The Graphics II, Multicolor and Text modes use the counters similarly. The TMS9918A/9929A operates at 262 lines per frame and approximately 60 frames per second in a noninterlaced mode of operation. The TMS9929A operates at 313 lines per frame and approximately 50 frames per second in a noninterlaced mode of operation. TABLE 3-3 - SCREEN DISPLAY PARAMETERS PARAMETER PIXEL CLOCK CYCLES PATTERN OR HORIZONTAL TEXT MULTICOLOR HORIZONTAL ACTIVE DISPLAY 256 240 RIGHT BORDER 15 25 RIGHT BLANKING 8 8 HORIZONTAL SYNC 26 26 LEFT BLANKING 2 2 COLOR BURST 14 14 LEFT BLANKING 8 8 LEFT BORDER 13 19 342 342 VERTICAL LINE VERTICAL ACTIVE DISPLAY 192 BOTTOM BORDER 24 BOTTOM BLANKING 3 VERTICAL SYNC 3 .~ TOP BLANKING '" TOP BORDER 27 262 3-8 3.7 VDP TERMINAL ASSIGNMENTS 3.7.1 TMS9918A Terminal Assignments SIGNATURE TERMINAL I/O DESCRIPTION XTAL1, XTAL2 40,39 I 10.7 + MHz crystal inputs* RAS [ 1 40 J XTA l2 CAS [ 2 39 J XTA II CPUCLK 38 0 VDP color burst frequency clock. AD7 [ 3 38 J CPU ClK Typically not used on the AD6 [ 4 37 J GRO MCLK TMS9918A, this is the color burst AD5 [ 5 36 J COM VID frequency clock. AD4 [ 6 35 J EXTVDP AD3 [ 7 34 J RES ---n'/SYNC GROMCLK 37 0 VDP output clock = XTALl24. AD2 [ 8 33 J vcc Typically not used. ADl [ 9 32 J ROO ADO [ 10 31 J RDl COMVID 36 0 Composite video output for the R/W ( 11 30 J RD2 TMS9918A. VSS [ 12 29 J RD3 MODE ( 13 28 J RD4 EXTVDP 35 I/O On the TMS9918A, this is the exter- CSW [ 14 21 J RD5 nal VDP input. CSR [ 15 26 J RD6 INT [ 16 25 J RD7 RESETI CD7 ( 17 24 J COO SYNC 34 I The RESET pin is a trilevel input pin. CD6 ( 18 23 J COl When it is below 0.8 volts, RESET CD5 ( 19 22 J CO2 initializes the VDP. When it is above CD4 ( 20 21 JCD3 9 volts, RESET is the synchronizing input for external video. VCC 33 I + 5 volt supply RDO MSB 32 I VRAM read data bus RD1 31 I RD2 30 I RD3 29 I RD4 28 I RD5 27 I RD6 26 I RD7 25 I COO MSB 24 I/O CPU data bus; (CDO) is the most significant bit CDl 23 I/O CD2 22 I/O CD3 21 I/O CD4 20 I/O CD5 19 I/O CD6 18 I/O CD7 LSB 17 110 INT 16 0 CPU interrupt output. CSR 15 I CPU-VDP read strobe CSW 14 I CPU-VDP write strobe MODE 13 I CPU interface mode select; usually a processor address line * When driven externally, both inputs must be driven. The least significant address bit (AD71 is wired to AO of the dynamic RAMs. Likewise, AD6 is wired to A 1 of the RAMs. Care must be exercised in assuring proper orientation of the TMS 9918A address outputs to the dynamic RAM address in- puts. 3-9 TMS9918A Terminal Assignments (continued) SIGNATURE TERMINAL I/O DESCRIPTION VSS 12 Ground References R/W 11 0 VRAM write strobe ADO MSB 10 0 VRAM address/data bus (multiplexed high and low order VRAM address and output data bytes) AD' 9 0 ADO is the most significant bit and is used only for data and not for addressing. ** AD2 8 0 AD3 7 0 AD4 6 0 ADS 5 0 ADS 4 0 AD7 3 0 CAS 2 0 VRAM column address strobe RAS 0 VRAM row address strobe • When driven externaUy, both inputs must be driven. •• The least signiftcant address bit (A07) is wired to AO of the dynamic RAMs. Likewise, A06 is wired to A 1 of the RAMs. Care must be exercised in assuring proper orientation of the TMS 9918A eddress outputs to the dynamic RAM address in- puts. 3-10 3.7.2 TMS9928A/9929A Terminal AssIgnments SIGNATURE TERMINAL I/O DESCRIPTION XTAL1, XTAL2 40,39 I 10.7 + MHz crystal inputs- RAs 1 40 ~ XTAL2 CAs 2 39 P XTAL1 R-Y 38 0 VOP color burst frequency clock. On AD7 3 38 J R-Y the TMS9928A/9929A, this is the ADS 4 37 P GROMCLK R-Y color difference output. ADS 5 36 P Y AD4 6 35 P B-Y GROMCLK 37 0 VOP output clock - XTAL/24. AD3 7 34 P RES'Ei'ISV NC Typically not used. AD2 8 33 P VCC AD1 I 9 32 P ROO Y 36 0 Composite video output. On the ADO I 10 31 P RD1 TMS9928A/9929A, this is the Y Rml 11 30 P RD2 (black/white luminance and Com- vSS I 12 29 P RD3 posite sync) output. MODE 13 28 P RD4 CSW I 14 21 P RD5 B-Y 35 I/O External VOP Input. On the CsR 1& 26 pROS TMS9928A/9929A, this is the B-Y INT I 16 25P RD7 color difference output. CD7 I 17 24 PCDO CDS ( 18 23 PCD1 RESET/ CDS ( 19 22 PCD2 SYNC 34 I The RESET pin is a trilevel input pin. CD4 I 20 21 PCD3 When it Is below 0.8 volts, RESET initializes the VDP. When it is above 9 volts, RESET is the synchronizing input for external video. VCC 33 I + 5 volt supply ROO MSB 32 I VRAM read data bus RD1 31 I RD2 30 I RD3 29 I RD4 28 I RD5 27 I ROO 26 I RD7 25 I COO MSB 24 1/0 CPU data bus; (COO) is the most significant bit CD1 23 I/O CO2 22 I/O CD3 21 I/O CD4 20 1/0 CD5 19 I/O COO 18 I/O CD7 LSB 17 I/O INT 16 0 CPU interrupt output. CSR 15 I CPU-VDP read strobe CSW 14 I CPU-VDP write strobe MODE 13 I CPU interface mode select; usually a processor address line • When driven externally, both inputs must be driven. *" The least significant address bit IAD7) is wired to AO of the dynamic RAMs. Likewise, ADS is wired to A1 of the RAMs. 3-11 SIGNATURE TERMINAL I/O DESCRIPTION VSS 12 Ground References R/W 11 o VRAM write strobe ADO MSB 10 o VRAM address/data bus (multiplexed high and low order VRAM address and output data bytes) AD1 9 o ADO is the most significant bit and is used only for data and not for addressing. ** AD2 8 o AD3 7 o AD4 6 o AD5 5 o AD6 4 o AD7 3 o CAS 2 o VRAM row address strobe RAS o VRam row address strobe • When driven externally, both inputs must be driven. The least significant address bit (AD7) is wired to AO of the dynamic RAMs. Likewise, AD6 is wired to A 1 of the RAMs. 3.7.3 TMS9918A/9928A/9929A Crystals Crystals for the TMS9918A/9928A/9929A can be purchased from the following: NDK 10080 North Wolfe Rd Suite 220 Cuppertino, CA 95014 Telephone: (408)255-0831 Telex: 352057 CTS Knights, Inc. 400 Reiman Ave Sandwich, III 60548 Telephone: (815)786-8411 3-12 4. DEVICE APPLICATIONS This section describes the hardware and software interface between a TMS9918A/9928A/9929A VOP and a TMS9900 microprocessor. Some considerations in the use of the VOP for text and graphics applications are also described. 4.1 VOP TO TMS9900 INTERFACE The circuit shown in Figure 4-1 illustrates a very simple interface between a TMS9900 microprocessor and a TMS9918A/9928A/9929A. In this circuit, the VOP 8-bit data bus is connected to the 8 MSBs of the TMS9900 16-bit data bus. For mode selection, A 14 of the TMS9900 is connected to the mode input pin. Read and write signals to the VOP are as follows: CSR =AO*A13*OBIN CSW=AO*WE WE - r--"\.. .r CSW AO 1 - I I A13 OBIN J .r CSR TMS9918A vOP TMS9900CPU A14 MODE C07 C07 D6 06 05 05 04 04 03 03 02 02 01 01 COO COO FIGURE 4-1 - MINIMUM SYSTEM INTERFACE TO TMS9900 OBIN andWEare signals from the TMS9900 which indicate direction flow on the data bus. DB IN is high when the CPU is attempting to do a read data operation, whileWEis low when the CPU is outputting data onto the data bus. AO is used as a VOP select signal. Thus, the VOP is activated whenever the CPU is reading or writing data in the upper half of its address space (>8000 and above). All addresses above >8000 then become VDP port addresses. However, in a more sophisticated design, more decoding of the address lines would be done to select only those unique addresses required by the VOP. The purpose of A 13 and decoding logic is to generate unique addresses for read and write operations and to block out the read data operation that occurs on the TMS9900 before a write data operation. Without this blockout logiC, a pulse on the CSR input would occur before any desired pulsing of the CSW input, thus causing unwanted opera- tion of the VOP. Referring to Table 4-1 and Figure 4-1, the following port addresses can be defined. TABLE 4-1 - VDP PORT ADDRESSES FOR FIGURE 4-1 OPERATION CSW CSR MODE PORT Write data to VRAM 0 1 0 >8000 Write address to VRAM 0 1 1 >8002 or Write to VDP register Read data from VRAM 1 0 0 >8004 Read VDP status 1 0 1 >8006 4-1 4.2 TMS9918A/9928A/9929A INTERFACE Figures 4-2 and 4-3 show the hardware components necessary to make the VDP operate with a typical TM990 16-bit bus application. The CPU can be connected as shown to any general-purpose 8-bit data bus and control signals that work with most microprocessors. The VDP interface timing is similar to that of static memories and occupies eight unique memory address locations within the CPU memory address space. ~ + 3 RDa 29 A13S 1 ~15~ CSR RD2 13.!t. A12B A11S 3BV1~C§i C 14 6 RD1 31 BOARD SEl 6 G1 U9 + ". Ir' G2A 5 J ~: MEMEN B A149 .If .... - G2B 13 MODE ROO 32 ADO 10 14 2 0 a ~ U2 MSB "'''' :#!C'oj<~C c( w 0 4116 I a 0 4116 4116 J r ~ TMS9918AI 1 1 7 4 3 TMS9928AI WEB TMS9929A 1 ~ ADt 9 DBINS AD2 8 2 UtO DIRSEL AD3 7 CPU AD4 6 INTERFACE AD. 24 COO AD6 4 ~,,{ 23 CD1 22 CO2 AD7 3 , C03 RAS 1 BUS CD4 CAS 2 CDS AM 11 1 CD. CD7 , yo I I I~: I 0 0 4116 4116 4116 4116lSB 34 RESET R04 28 I/O RESET 0 0 ,0 11Q Cl 40 XTALl RDS 27 RD6 26 39 )(TAL2 AD7 25 -= C2 35 CQMVIO I :38 361 I I I ,, COMPOSITE VIDEO ITMS9918A ONL VI I I ,, I I I I , R1170" 'la~5% I I : I I L _____________ ':" :!...} I_'-=: =- :..-_ -=.. :.. -_- ~ .= ==- -_-_-_-!LV: R·Y TO ENCODER (9928A/9929A ONLvt FIGURE 4-2 - TMS9918A/9928A/9929A INTERFACE 4-2 TM990 BUS--__ P1 +5V U1 .... AO 2 3 '_U6 57 ,,>-+;:-.----~ U1 R2 2-).)~3;....--. ... _+A_';..-._ _ _ _ _ _4~ 58> 5 .... ~6=::: U6 ., U1 R3 51. lO-4~.... ... _-r-: 59>- A:,2_ _ _ _ _6-.. 7 - 4 ~ 8~6'0 ,. U1 R4 9 • /"b-':'::"_. ... -~A3~-------'~0 60>- ~9;..-.---+_------~~~-~-¥-'~~~~~~-~lU6 ·, U1 /_ R5 12 • ~l:).:1:.:.1_. >----.j-:A4=-_ _ _.....;.1~2 61 ... 11 j ~ 1~7 3 ·, U1 R6 2·1. f'b-.=--.... 62~>--+A..;;5;.....-----'.:.;4~ 13 - ~6~ 74 U2 R7 - 51- ./"~~..... +5 >-_...J..:.A.;:6;....._ _ _ _.;;2_4 63 ... 3 - ~ S:::::"'U7 ,, R8 9 • f 10 BOARD U2 - SELECT 64 >-_f-:A:..:.:7:...-_ _ _ _ _4~ ~..:::5:...---~-----... ~.;..~-""'~13~~~7~1!11-~R1,;.;.3....- -...-~ ~ M~2.J • 65 ... >--FA8;....----.:t.t6 7 ..... ~~1 ~83 , U2./ R10 21. ~.....~-. >-_......,:;A~9;....._ _ _ _.._;1.;.0... 66 ... 9 4~6= US , U2 R11 5 .",,"»;;:.4_... 67 ~>--~A..;.;1:..;:;0-----':.:2~ 11 .... 4~8~ U8 , U2 R12 91. '" 0 A11 -- I ~ ••T ~ A11B 68~>--~~------'~4... ~~1~3--__-----~~~-----------~~~.~. . U3 A12 2 3 A12B 69~>--~~;..-.-------~ ~~------------------------------------~~~~~ U3 >---~A..;.;1:..;:;3---------~4~ ~~5------------------------------------~A..;.;1~3~B~~~ 70 ... U3 >-__~A..;.;1..;;4--------...;;;6... 71 ,.... 7 A14B U3 78'>-__~W..;;E~---------'~0... ~~9__------------------------------..-;W..;.;E~B~-~ " . DBIN 12 U3 11 DBINB 82;>---~~~------~... ~~-------------------------------~~~~•• U3 80.... MEMEN 14 13 MEMENB _ ,. ~~-------------------------~~-~. U4 >---~D~8~--------'~1_4'B 33 .... 1A~3-------------------------------=DO~B~. . · .::~--+D::;:9::.-----------'.:.:0:..t 2B 2A 4 01 B -: 34; ~---------------------------------=~~ 35.... 010 9 38 3A~5-------------------------------=D=2B~. . 3~; 011 S 4B 4A~6-----------------------------=D~3B~~. . ~~!:~'3t-,---------------------JD~I~R~S~E~L~-. . U5 p 1 __-+__________________________ 37,>---+D::;:1.:.:2~------~11~1B 1A~3 .. D_4B~- ·~ 013 10 2B 2A 4 D5B _ 38,>--+~---------~~ ~~-+----------------------------~~~ 39'" 014 9 3B 3A 5 D6B _ .~ 015 8 4B 4A~6---+------------------------------~D7";';B~" 40,.>--~~---------~~ 1 13 FIGURE 4-3 - TM990 ITMS9918A/9928A/9929A1 DEMO BOARD 4-3 4.2.1 TM990 (TMS9918A/9928A/9929A) Parts List U1,2,3 74LS367 U4,5 74LS243 U6,7,8 74LS266 U9 74LS138 U10 74LSOO U11 TMS9918A/9928A/9929A U12-19 TMS4116 C1,2 33 pF Y1 10.738635 MHz Crystal SW1·3 4-position DIP Switches R1 470n5%1/4W R2·R13 Bourns XXXX or equivalent NOTE: All power supply pins of each Ie should be bypassed with a .1j.1F capacitor. 4.2.2 Composite Video Output The TMS9918A composite video output pin (36), is driven by a source-follower MOS transistor that requires an external pull-down resistor to V SS. A 470-ohm resistor is typically used to provide a 1.9 volt peak-to-peak signal on the output. This output will drive most color directly, although in some cases it may be necessary to provide a simple interface circuit to match the monitor's input requirements. If a color video monitor is not available, an RF modulator can be used to drive the antenna terminals of a standard color television, as shown in Figure 4-4. TMS9918A COMVID .. VIDEO IN RF -- TO ANTENNA TERMINALS OF COLOR TV FIGURE 4-4 - RF MODULATOR CONNECTION 4.2.3 Oscillator and Timing The TMS9918A/9928A/9929A internal timing generation is controlled by a self-contained oscillator and timing circuits. A 10.738635 (± 0.005%) MHz fundamental-frequency parallel-mode crystal is used to drive the basic oscillator frequency. C1 and C2 are load capacitors for the parallel-resonant crystal. C1 and C2 values may be varied slightly to obtain more accuracy in timing and color generation and also to compensate for stray capacitance on the PC board. Typical values for C1 and C2 range between 15 pF and 39 pF. A trimmer capacitor with a value of 5 pF to 50 pF may also be used instead of C1 and adjusted to provid~ proper colore to the video monitor. The VDP may also be operated with an external oscillator source. The VDP connections for this external source are shown in Figure 4-5. 4-4 +5V 470n 470n ~~----- ..--+--....... XTAL 1 TMS9918A/9928A/9929A ;.0---+---1 XTAL 2 FIGURE 4-5 - EXTERNAL FREQUENCY SOURCE There may be a slight color shift or a complete color loss in applications of RF modulators if there are mismatches in voltages levels or impedances between the VDP and the RF modulator. See Figure 3-4 for the TMS9928A/9929A inter- face. 4.2.4 VRAM Connections The VRAM used in Figure 4-2 are 4116-type dynamic RAMs that meet the specifications in Section 5. Addressing of the VRAM is done through the address bus and the memory control lines, AD1-AD7 and RAS, CAS, and WR, respectively. Data written to the VRAM is also sent over the address bus. ADO is a MSB, and AD7 is the LSB. Data written from the VRAM is brought into the VDP via the read data bus, RDO-RD7. The TMS9918A automatically refreshes the VRAM with no interaction necessary from the host CPU. Note that address 0 (ADO) and data 0 (DO) are the MSBs for the TMS9918A and all other TMS9900 family members. The VRAM pin designations (AO and DO) referenced in the data manual are shown as being the LSBs to be consistent with 4116-type dynamic RAM data sheets. 4.3 VDP INITIALIZATION After powerup and proper reset timing, the VRAM allocation backdrop color and type of dynamic RAM need to be loaded into the VDP registers. The values to be loaded can be calculated by using the examples and tables shown in Appendix A. The following flowchart (Figure 4-6) shows a procedure for loading all eight VDP registers. Setting 4.4 contains a typical TMS9900 software pro- gram designed to work on the demo board, shown in Figure 4-3. SETUP ADDRESS OF VDP IN HOST SYSTEM FETCH DATA FROM SYSTEM MEMORY AND WRITE TO VDP WRITE REGISTER NO. TO VDP INCREMENT REGISTER NO. AND INCREMENT TABLE POINTER NO. CONTINUE FIGURE 4-6 - VDP REGISTER INITIALIZATION PROCEDURE 4-5 4.4 TYPICAL SOFlWARE PROGRAM 4.4.1 General This program Initializes the TMS9918A and loads the Pattern Generator with the upper case character set. It then loads the color table, clears the screen and prints a sign-on message. After initialization, a user program address can be inserted at location OOM. DEM0991S SDSMAC 3.4.8 Sl.117 15:45:22 MONDAY, SEP 27, 1982. PAGE ""82 8881 IDT 'DEM09918' 8882 8888 ACRG >11888 ''''83 90811 VRAMW EQU >9""" ADDRESS TO WRITE DATA TO VRAM 8884 9"02 VDPW EQU >9882 ADDRESS TO. WRITE DATA TO VDP "885 9084 VRAMR EQU >9884 ADDRESS TO READ DATA FROM VRAM 8886 9886 VDPR EQU >9886 ADDRESS TO READ VDP STATUS REGISTER 8087 * 8888 *****.******************************************************* 'UJ89 * INITIALIZE THE 9918 WITH THE FOLLOWING: 1IJ1IJ18 * 811J11 * REG II .. 811 EXT VID OFF, GRAPH 2 OFF 8812 * 0813 * REG 1 • "2 4116, INT DIS, VID ON, GRAPH 1 8014 * SIZE 1, MAG OFF 8815 * 81116 * REG 2 .. "1 NAME TABLE SUB BLOCK @>4118 8817 * 0018 * REG 3 .. 88 COLOR TABLE SUB BLOCK @>21111 IIU9 * 882" * REG 4 = 81 PATTERN GEN SUB BLOCK @>88" ""21 8822 * REG 5 • 116 .SPRITE NAME TAB SUB BLK @>31111 8823 * 8824 * REG 6 110 SPRITE PATT GEN SUB BLK @>880 ""25 * II * REG 7 .. 87 BACKDROP COLOR IS CYAN ""26 8827 * 8828 * .************************************************************* 8829 * ""3" 8031 * * NOTE 8032 * THIS SOFTWARE ASSUMES THAT THE DATA· BUS OF THE IIJ033 * TMS9918A IS CONNECTED TO THE LEAST SIGNIFICANT 8834 * BYTE OF THE TMS99811, WITH D7 AS THE MOST 8035 * SIGNIFICANT BIT AND DIS AS THE LEAST SIGNIFICANT 11836 * BIT ""37 * 1IJ1I38 *INIT IIJII39 1111118 11281 LI Rl,VDPW VDP WRITE ADDRESS 1IJ811 2 9" II 2 8048 """4 "202 LI R2,SUTA "SET UP TABLE" ADDRESS 118"6 88B8 811 41 8088 82113 LI R3, >8" ADDRESS OF FIRST VDP REGISTER 8GIIA 81180 811J42 "811e C472 LPIIl '·IOV *R2+,*Rl GET DATA FROf.l ~tEM, SEND TO 9918 "" 43 08SE C443 MOV R3,*Rl SEND REG' TO 9918 ""44 "818 11583 INC R3 INCREMENT REGISTER COUNT 8845 11812 8283 CI R3,>88 ALL REGS LOADED? 8014 08 8 8 8846 8016 16FA JNE LPn NO, GO AGAIN 11047 * 11848 * 8849 * LOAD PROGRAM LOADS THE TEXT PATTERNS FROM 1185" * A TABLE IN MEMORY TO THE PATTERN GENE:P_~'!'OR ""51 '*" SUB-'SLOCK IN VRAM. ""52 ASCII >2" TO >5F ARE INCLUDED IN THIS TABLE. 81153 * 11854 * 111155 111118 0201 LPGl LI Rl,VRAMW ADDRESS TO WRITE DATA TO VRAM ""lA 9""8 DEM09918 SDSMAC 3.4.0 81.117 15:45:22 MONDAY, SEP 27, 1982. PAGE U03 0056 00lC 0202 LI R2,VDPW ADDRESS TO WRITE TO VDP 0"IE 9002 0057 0020 0203 LI R3,PATT MEM ADDR OF PATTERNS 0"22 00CO 0058 0024 0204 LI R4,512 64 CHAR X 8 BYTES - 512 BYTES 0026 0200 0059 0028 0205 LI R5, >4900 ADDRESS TO LOAD PATS IN VRAM 002A 4900 0060 902C C485 MOV R5,*R2 SEND LSB OF VRAl-t ADDRESS TO VDP 0061 002E 96C5 SWPB R5 REVERSE BYTES 0062 9030 C445 MOV R5,*Rl SEND DATA TO VRAM 0063 0032 D173 LPG2 MOVB *R3+,R5 GET BYTE FROM MEM 0064 0034 06C5 st'lPB R5 REVERSE BYTES 0065 0036 C445 ~IOV R5, *RI SEND DATA TO VRAM 0"66 0038 0604 DEC R4 ALL DONE .YET? 0067 003A 16FB JNE LPG2 NO, GO AGAIN 0068 ******************************************************** 0"69 . ""70 * LOAD COLOR TABLE 0071 * 0072 * THIS ROUTINE LOADS THE COLOR TABLE FOR THE 0073 * TEXT PATTERNS JUST ENTERED. 0074 * 0075 * IHn6 003C 1121H LI Rl,VRAMW ADDRESS TO WRITE DATA TO VRAM 003E 9000 0077 0040 0202 LI R2,VDPW ADDRESS TO WRITE TO VDP 0042 9rHJ2 0078 0044 0203 LI R3,>4204 START ADDRESS OF TEXT COLOR TABL 0046 4204 0079 0048 0204 LI R4,>5F CHARACTERS WILL BE BLUE ON WHITE 004A 005F 0080 004C C483 MOV R3,*R2 SEND LSB OF VRAM ADDRESS TO VDP 0081 094E 0205 LI R5,8 LOAD COUNT VALUE, 64CHAR/8 = 8 0050 9008 0082 0052 C444 LCTL folOV R4, *Rl SEND COLOR INFO TO VRAM 0083 ""54 0605 DEC R5 TABLE LAODED YET? 0984 0056 16FD JNE LCTL NO, GO AGAIN 0085 * 0086 *********************************************************** 0087 * CLEAR SCREEN 0088 * IHf89 * THIS ROUTINE CLEARS THE SCREEN BY WRITING A SPACE 0090 * CHARACTER (ASCII >20) TO ALL LOCATIONS IN THE 0091 * NMIE TABLE. 0092 * 0093 * 0094 0058 0201 LI- Rl , VRAMW ADDRESS TO I·TRITE DATA TO VRAM 005A 9000 0095 005C 0202 LI R2,VDPW ADDRESS TO WRITE TO VDP 005E 9002 0096 0060 0203 LI R3,>4400 START ADDRESS IN NAME TABLE 0062 4400 0" 97 0064 C483 r40V R3, *R2 SEND MSB OF VRAM ADDRESS TO VDP 0"98 0066 0202 LI R2, 768 tOF POSITIONS ON SCREEN 0068 0300 0099 006A 0203 LI R3,>2" ASCI I SPACE CHAR 006C 13020 010" "06E C443 CSLI HOV R3,*Rl SEND SPACE TO SCREEN 0101 "070 0602 DEC R2 ARE ALL LOCATIONS CLEAR? 4-7 DEH09918 SDSMAC 3.4.0 81.117 15:45:22 MONDAY, SEP 27, 1982. PAGE 111004 0102 0072 16FD JNE CSL1 NO, GO AGAIN 0U3 * 0104 ********************************************************* 0105 * PRINT SIGN ON ~IESSAGE 0106 * AND BRANCH TO USERS PROGRAM 0107 * 0108 * 0109 0074 0201 LI Rl,VRAMW ADDRESS TO WRITE DATA TO VRAM 0076 91HJO 0110 0078 0202 LI R2,VDPW ADDRESS TO WRITE TO VDP 007A 9002 0111 007C 0203 LI R3,>4400 POSITION OF ~tESSAGE ON SCREEN 007E 4400 0112 0080 C483 MOV R3,*R2 SEND ~lSB OF VRAM ADDRESS TO VDP 0113 0082 06C3 SWPB R3 REVERSE BYTES 0114 0084 C483 MOV R3,*R2 SEND MSB OF VRAM ADDRESS TO VDP 0115 0086 0203 LI R3,MSG0 ADDRESS OF SIGN ON MESSAGE 0088 009E 0116 008A 04C4 PRNT CLR R4 CLEAR RECEPTION REGISTER 1n17 008C D113 MOVB *R3,R4 GET A BYTE OF TEXT 0118 008E 0284 CI R4,>FF00 IS IT THE Eml CHARACTER? 0090 FF00 0119 0092 1303 JEQ DONE YES, GOTO NEXT PROGRAM SEGl>tENT 0120 0094 06C4 SWPB R4 REVERSE BYTES 0121 0096 C444 MOV R4,*Rl SEND CHAR TO VRAM 0122 0098 10F8 JMP PRNT GET NEXT CHARACTER 0123 009A 0460 DONE B @DONE INSERT BRANCH TO USERS PROGRAM 009C 009A 0124 * AT THIS POINT 0125 009E 54 MSG0 TEXT 'TEXAS INSTRUMENTS TMS9918' 009F 45 00Aa 58 00Al 41 0M2 53 00A3 20 00A4 49 OOA5 4E 00A6 53 OOA7 54 00A8 52 00A9 55 00AA 4D 00AB 45 00AC 4E 00AD 54 0filAE 53 0filAF 20 "fil B0 54 00Bl 4D 00B2 53 00B3 39 00B4 39 00B5 31 00B6 38 0126 00B7 FF BYTE >FF 0127 00B8 EVEN 0128 ************************************************************** 0129 In30 * THIS TABLE CONTAINS THE VALUES FOR 0131 * INITIALIZING THE REGISTERS IN THE 9918A DEM09918 SDSMAC 3.4.0 81.117 15:45:22 MONDAY, SEP 27, 1982. PAGE 0005 0132 * 0133 ""B8 ''0 SUTA BYTE >"0 0134 ""B9 "2 BYTE >02 0135 ""BA 01 BYTE >01 0136 00BB 08 BYTE >08 0137 00BC 01 BYTE >01 0138 00BD 06 BYTE >06 "139 O"BE 00 BYTE >00 0140 00BF 07 BYTE >"7 "141 * 0142 ************************************************************* 0143 * 9918A TEXT PATTERNS 0144 * 0145 * THESE PATTERNS FROM A 5X7 CHARACTER IN THE 0146 * 8X8 PATTERN BLOCK THAT IS UPPER AND LEFT 0147 * JUSTIFIED 0148 * 0149 00CO "000 PATT DATA >0000 CHARACTER SPACE ASCII 20 0150 00C2 0000 DATA >0"00 0151 00C4 0000 DATA >""00 0152 00C6 000" DATA >0000 0153 OOC8 2020 DATA >2020 CHARACTER 1 ASCII 21 0154 00CA 2020 DATA >2020 0155 00CC 2000 DATA >2000 0156 00CE 2000 DATA >200" 0157 00D" 5050 DATA >5"50 CHARACTER • ASCII 22 0158 0"D2 500" DATA >5"0" 0159 OOD4 0000 DATA >0000 0160 00D6 0000 DATA >000" 0161 00D8 5050 DATA >5050 CHARACTER t ASCII 23 0162 OODA F850 DATA >F850 0163 00DC F850 DATA >F850 0164 00DE 5000 DATA >5000 0165 00Ed 2078 DATA >2078 CHARACTER $ ASCII 24 0166 00E2 A070 DATA >A070 0167 00E4 28F" DATA >28F9 9168 00E6 2000 DATA >2000 0169 00E8 C0C8 DATA >COC8 CHARACTER , ASCII 25 0170 00EA 1020 DATA >1020 0171 00EC 4098 DATA >4098 0172 00EE 1800 DATA >1890 0173 00FO 40AO DATA >40AO CHARACTER & ASCII 26 O174 OOF2 A040 DATA >A040 0175 OON A890 DATA >A890 0176 00F6 6800 DATA >6800 0177 00F8 2020 DATA >2020 CHARACTER I ASCII 27 0178 00FA 2000 DATA >2000 0179 00FC 0000 DATA >0000 0180 OOFE 0"00 DAT-A >0000 0181 0100 2040 DATA >2040 CHARACTER ( ASCII 28 0182 0102 8080 DATA >8080 0183 0104 813413 DATA >80413 13184 IH06 20"0 DATA >2000 0185 0108 21310 DATA >2010 CHARACTER ) ASCII 29 0186 010A 0808 DATA >0808 0187 010C 0810 DATA >0810 0188 010E 2000 DATA >2"00 0189 0110 20A8 DATA >213A8 CHARACTER * ASCII 2A 0190 0112 7020 DATA >71320 0191 0114 70A8 DATA >70A8 4-9 DEM09918 SDSfolAC 3.4.0 81.117 15:45:22 MONDAY, SEP 27, 1982. PAGE 0006 0192 0116 2000 DATA >2000 0193 0118 0020 DATA >0020 CHARACTER + ASCII 2B 0194 011A 20F8 DATA >20F8 0195 011C 2020 DATA >2020 0196 OllE 0000 DATA >0000 0197 0120 0000 DATA >0000 CHARACTER , ASCII 2C 0198 0122 0000 DATA >0000 0199 0124 2020 DATA >2020 021Hl 0126 4000 DATA >4000 0201 0128 0000 DATA >0000 CHARACTER - ASCII 2D 0202 012A 00F8 DATA >00F8 0203 012C 0000 DATA >0000 0204 012E 0000 DATA >0000 0205 0130 0000 DATA >0000 CHARACTER • ASCII 2E 0206 0132 0000 DATA >0800 0207 0134 0800 DATA >0800 0208 0136 2000 DATA >2000 0209 0138 0008 DATA >0008 CHARACTER / ASCII 2F 0210 013A 1020 DATA >1020 0211 0l3C 4080 DATA >4080 0212 0l3E 0000 DATA >0000 0213 0140 7088 DATA >7088 CHARACTER 0 ASCII 30 0214 0142 98A8 DATA >98A8 0215 0144 C888 DATA >C888 0216 0146 7000 DATA >7000 0217 0148 2060 DATA >2860 CHARACTER 1 ASCII 31 8218 014A 2020 DATA >2020 0219 014C 2020 DATA >2020 0228 014E 7000 DATA >7000 0221 0150 7088 DATA >7088 CHARACTER 2 ASCII 32 0222 0152 0830 DATA >0830 0223 0154 4080 DATA >4080 0224 0156 F800 DATA >F800 0225 0158 F808 DATA >F808 CHARACTER 3 ASCII 33 0226 015A 1030 DATA >1030 0227 015C 13888 DATA >0888 0228 015E 7000 DATA >7800 0229 8160 1030 DATA >10313 CHARACTER 4 ASCII 34 0230 0162 5090 DATA >5090 0231 0164 F810 DATA >F810 0232 0166 1000 DATA >1000 8233 0168 F880 DATA >F888 CHARACTER 5 ASCII 35 0234 016A FOO8 DATA >F008 0235 016C 0888 DATA >0888 0236 016E 7000 DATA >7000 8237 In 70 3840 DATA >3840 CHARACTER 6 ASCII 36 0238 0172 80FO DATA >80FO 8239 0174 8888 DATA >8888 0240 0176 7800 D~TA >7000 0241 0178 F808 DATA >F808 CHARACTER 7 ASCII 37 0242 017A 1020 DATA >1020 0243 0l7C 4040 DATA >4040 0244 017E 4001) DATA >4000 0245 0180 7088 DATA >7088 CHARACTER 8 ASCII 38 0246 0182 8870 DATA >8870 0247 0184 8888 DATA >8888 0248 0186 7000 DATA >7000 0249 0188 7088 DATA >7088 CHARACTER 9 ASCII 39 0250 tH8A 8878 DATA >8878 0251 U8C 0810 DATA >0810 4-10 DEM09918 SDSf.lAC 3.4.0 81.117 15:45:22 MONDAY, SEP 27, 1982. PAGE 0007 0252 018E E000 DATA >E000 0253 0190 0000 DATA >0000 CHARACTER ASCII 3A 0254 0192 2000 DATA >2000 0255 0194 2000 DATA >2000 0256 0196 0000 DATA >0000 0257 0198 0000 DATA >0000 CHARACTER ASCII 3B 0258 019A 2000 DATA >2000 0259 019C 2020 DATA >2020 0260 019E 4000 DATA >4000 0261 01AO 1020 DATA >1020 CHARACTER < ASCII 3C 0262 01A2 4080 DATA >4080 0263 01A4 4020 DATA >4020 0264 01A6 1000 DATA >1000 0265 nA8 0000 DATA >0000 CHARACTER = ASCII 3D 0266 0lAA F800 DATA >F800 0267 01AC F800 DATA >F800 0268 01AE 0000 DATA >0000 0269 01B0 4020 DATA >4020 CHARACTER > ASCII 3E 0270 01B2 1008 DATA >1008 0271 01B4 1020 DATA >1020 0272 01B6 4000 DATA >4000 0273 01B8 7088 DATA >7088 CHARACTER ? ASCII 3F 13274 01BA 1020 DATA >1020 0275 01BC 2000 DATA >2000 0276 IJ1BE 2000 DATA >2000 0277 IJ1CIJ 7088 DATA >7088 CHARACTER @ ASCII 40 0278 01C2 A8B8 DATA >A8B8 0279 01C4 B080 DATA >B080 0280 01C6 7800 DATA >7800 0281 01C8 2050 DATA >2050 CHARACTER A ASCII 41 0282 nCA 8888 DATA >8888 0283 01CC F888 DATA >F888 0284 0lCE 8800 DATA >8800 0285 01D0 F088 DATA >F088 CHARACTER B ASCII 42 0286 01D2 88F0 DATA >88F0 0287 01D4 8888 DATA >8888 0288 0lD6 F000 DATA >F000 0289 0lD8 7088 DATA >7088 CHARACTER C ASCII 43 0290 0lDA 8080 DATA >8080 0291 0lDC 8088 DATA >8088 0292 01DE 7000 DATA >7000 0293 01E0 F088 DATA >F088 CHARACTER D ASCII 44 0294 0lE2 8888 DATA >8888 0295 01E4 8888 DATA >8888 0296 01E6 F000 DATA >F000 0297 01E8 F880 DATA >F880 CHARACTER E ASCII 45 0298 01EA 80F0 DATA >80F9 0299 0lEC 8080 DATA >8080 0300 0lEE F800 DATA >F800 0301 01F0 F880 DATA >F880 CHARACTER F ASCII 46 0302 0lF2 80F0 DATA >80F0 0303 0lF4 8080 DATA >80.80 0304 0lF6 8000 DATA >8000 0305 01F8 7880 DATA >7880 CHARACTER G ASCII 47 0306 01FA 8080 DATA >8080 0307 01FC 9888 DATA >9888 0308 01FE 7800 DATA >7800 0309 0200 8888 DATA >8888 CHARACTER H ASCII 48 0310 0202 88F8 DATA >88F8 0311 0204 8888 DATA >8888 4-11 DEM09918 SDSMAC 3.4.0 81.117 15:45:22 MONDAY, SEP 27, 1982. PAGE "'88 0312 0206 88SS DATA >88SS 0313 0288 7828 DATA >7020 CHARACTER I ASCII 49 8314 020A 2828 DATA >2020 0315 028C 2028 DATA >2028 031"6 028E 7800 DATA >7SS8 0317 82IS 0808 DATA >11888 CHARACTER J ASCII 4A 0318 0212 0808 DATA >88118 0319 0214 0888 DATA >0888 8320 0216 7SS8 DATA >7SS0 0321 0218 8890 DATA >8898 CHARACTER K ASCII 4B 0322 021A AOCO DATA >AOCO 8323 021C A090 DATA >A890 0324 021E 8880 DATA >8800 8325 0220 8880 DATA >8080 CHARACTER L ASCII 4C 8326 0222 8088 DATA >8080 8327 0224 8080 DATA >8080 0328 0226 F808 DATA >F800 8329 0228 88D8 DATA >88D8 CHARACTER M ASCII olD 8330 822A A8A8 DATA >A8A8 0331 022C 8888 DATA >8888 0332 022E 88SS DATA >8800 8333 0230 8888 DATA >8888 CHARACTER N ASCII 4E 0334 0232 C8A8 DATA >C8AS 0335 0234 9888 DATA >9888 0336 0236 8800 DATA >8800 0337 0238 7088 DATA >7088 CHARACTER 0 ASCII 4F 0338 023A 8888 DATA >8888 0339 923C 8888 DATA >8888 0340 023E 7000 DATA >7SS0 0341 0240 F088 DATA >F088 CHARACTER P ASCII 58 0342 0242 88FO DATA >88FO 0343 0244 8080 DATA >8080 0344 0246 8000 DATA >8000 0345 0248 7088 DATA >7088 CHARACTER Q ASCII 51 0346 024A 8888 DATA >8888 0347 824C A890 DATA >A890 0348 024E 6800 DATA >6800 0349 0250 F088 DATA >F088 CHARACTER R ASCII 52 0350 0252 88FO DATA >88F0 0351 0254 A090 DATA >A090 0352 0256 881H' DATA >8800 0353 0258 7088 DATA >7088 CHARACTER S ASCII 53 0354 025A 8070 DATA >8070 6355 025C 0888 DATA >0888 0356 "25E 700" DATA >7000 0357 0260 F820 DATA >F820 CHARACTER T ASCII 54 0358 0262 2020 DATA >2020 0359 0264 2020 DATA >2020 0360 0266 2000 DATA >2000 0361 0268 8888 DATA >8888 CHARACTER U ASCII 55 0362 026A 8888 DATA >8888 0363 026C 8888 DATA >8888 0364 026E 7000 DATA >7000 0365 0270 8888 DATA >8888 CHARACTER V ASCII 56 0366 9272 8888 DATA >8888 0367 0274 8850 DATA >8850 9368 0276 2000 DATA >2000 0369 0278 8888 DATA >8888 CHARACTER W ASCII 57 0370 027A 88A8 DATA >88A8 0371 027C A8D8 DATA >A8D8 4-12 DEf409918 SDSMAC 3.4.0 81.117 15:45:22 MONDAY, SEP 27, 1982. PAGE 8009 0372 027E 8880 DATA >8808 0373 0280 8888 DATA >8888 CHARACTER X ASCII 58 0374 0282 5020 DATA >5028 0375 0284 5088 DATA >5088 0376 0286 8800 DATA >8880 0377 0288 8888 DATA >8888 CHARACTER Y ASCII 59 0378 028A 5020 DATA >5020 0379 028C 2020 DATA >2020 0380 028E 2000 DATA >2000 9381 0299 F808 DATA >F808 CHARACTER Z ASCII 5A 0382 0292 1020 DATA >1020 9383 0294 4080 DATA >4080 0384 0296 F800 DATA >F880 0385 0298 F8C" DATA >F8C0 CHARACTER [ ASCII 58 0386 029A C0CO DATA >C9CO 0387 029C COCO DATA >C0C0 0388 029E F8U DATA >F800 0389 02A0 0086 DATA >8080 CHARACTER ASCII 5C "390 0 2A2 4020 DATA >4020 0391 02M 1008 DATA >1008 0392 02A6 0000 DATA >0000 0393 02A8 F818 DATA >F818 CHARACTER I ASCII 5D 0394 02M 1818 DATA >1818 0395 02AC 1818 DATA >1818 0396 02AE F800 DATA >F800 0397 0280 0000 DATA >1"'00 CHARACTER ASCII 5E 0398 9282 2950 DATA >2950 0399 9284 8890 DATA >8800 0401!1 9286 0090 DATA >9000 041!1l 9288 0'''''' DATA >8000 CHARACTER _ ASCII 5F 0402 028A 9009 DATA >1!1090 0403 928C ""'HI 0494 "28E F800 DATA >9090 DATA >F800 0405 92CO 4020 DATA >4020 CHARACTER ASCII 69 0406 92C2 100" DATA >1090 0407 92C4 990" DATA >01!100 0408 02C6 0999 DATA >0000 0409 02C8 0000 DATA >01!100 CHARACTER a ASCII 61 0410 02CA 7088 DATA >7088 0411 02CC F888 DATA >F888 0412 02CE 880O DATA >88"" 0413 02D0 900O DATA >00"'0 CHARACTER b ASCII 62 0414 02D2 F048 DATA >F048 0415 92D4 7048 DATA >7048 0416 02D6 F009 DATA >F000 9417 02D8 0"00 DATA >9009 CHARACTER c ASCII 63 0418 02DA 7889 DATA >7880 0419 92DC 8089 DATA >8080 0420 02DE 7800 DATA >7800 0421 92E0 0099 DATA >9009 CHARACTER d ASCII 64 0422 92E2 F048 DATA >F048 0423 02E4 4848 DATA >4848 0424 02E6 F000 DATA >F009 0425 02E8 0909 DATA >0009 CHARACTER e ASCII 65 0426 92EA F080 DATA >F989 0427 92EC E080 DATA >E989 0428 02EE F900 DATA >F0"0 0429 02'0 ~H199 DATA >0000 CHARACTER f ASCII 66 0430 92F2 F080 DATA >F080 0431 02F4 EB8" DATA >E080 4-13 DEM09918 SDSMAC 3.4.9 81.117 15:45:22 MONDAY, SEP 27, 1982. PAGE 9910 0432 92F6 8999 DATA >8999 9433 92F8 9000 DATA >0990 CHARACTER 9 ASCII 67 0434 02FA 7880 DATA >7880 0435 02FC B888 DATA >B888 9436 02FE 7000 DATA >7000 0437 0390 9009 DATA >9000 CHARACTER h ASCII 68 9438 9302 8888 DATA >8888 0439 0304 F888 DATA >F888 9440 9396 880" DATA >88"0 9441 0308 0099 DATA >9909 CHARACTER i ASCII 69 9442 030A F829 DATA >F829 "443 "39C 2929 DATA >2929 0444 030E F8"0 DATA >F809 9445 0310 0000 DATA >0000 CHARACTER j ASCII 6A 0446 0312 7020 DATA >7020 9447 0314 20M DATA >20AO 0448" 9316 E999 DATA >E900 9449 0318 9990 DATA >0000 CHARACTER k ASCII6B 0459 031A 90A0 DATA >90M 0451 931C A9C0 DATA >A0C0 0452 931E 911190 DATA >990" 0453 0320 9090 DATA >9000 CHARACTER 1 ASCII 6C 0454 9322 8080 DATA >8080 9455 9324 8080 DATA >8080 0456 0326 F800 DATA >F800 0457 0328 IHl00 DATA >0000 CHARACTER m ASCII 60 0458 032A 8808 DATA >8808 0459 032C A888 DATA >A888 0460 032E 8800 DATA >88011l 0461 0339 0000 DATA >0000 CHARACTER n ASCII 6E 0462 9332 88C8 DATA >88C8 9463 0334 A898 DATA >A898 9464 9336 8800 DATA >8809 0465 0338 9"00 DATA >0090 ClIARACTER 0 ASCII 6F 0466 033A F888 DATA >F888 9467 033C 8888 DATA >8888 0468 033E F80" DATA >F890 0469 03411l IH!J011l DATA >1Il000 CHARACTER p ASCII 70 0470 0342 F088 DATA >F"88 0471 0344 F980 DATA >F080 0472 0346 80011l DATA >8000 0473 0348 0000 DATA >1"'00 CHARACTER q ASCII 71 0474 034A F888 DATA >F888 0475 034C A890 DATA >A890 0476 034E E0011l DATA >E000 0477 0350 0'H~0 DATA >0900 CHARACTER r ASCII 72 0478 0352 F888 DATA >F888 0479 0354 F8A0 DATA >F8AO 0480 0356 9000 DATA >9000 0481 0358 0000 DATA >CHH'0 CHARACTER s ASCII 73 0482 035A 7880 DATA >7880 "483 035C 7008 DATA >7308 0484 035E F000 DATA >F000 0485 036" 0"00 DATA >0000 CHARACTER t ASCII 74 0486 0362 F820 DATA >F820 0487 0364 2020 DATA >2020 9488 9366 2099 DATA >2990 0489 0368 0000 DATA >99"" CHARACTER u ASCII 75 049" 936A 8888 DATA >8888 0491 936C 8888 DATA >8888 4-14 DEM09918 SDSMAC 3.4.0 81.117 15:45:22 MONDAY, SEP 27, 1982. PAGE 0011 0492 036E 7000 DATA >7000 0493 0370 0000 DATA >0000 CHARACTER v ASCII 76 0494 0372 8888 DATA >8888 0495 0374 90A0 DATA >90A0 0496 0376 4000 DATA >4000 0497 .0378 0000 DATA >0000 CHARACTER w ASCII 77 0498 037A 8888 DATA >8888 0499 037C A8D8 DATA >A8D8 0500 037E 8800 DATA >8800 0501 0380 0000 DATA >0000 CHARACTER x ASCII 78 0502 0382 8860 DATA >8860 0503 0384 2060 DATA >2060 0504 0386 8800 DATA >8800 0505 0388 0000 DATA >0000 CHARACTER Y ASCII 79 0506 038A 8850 DATA >8850 0507 038C 2020 DATA >2020 0508 038E 2000 DATA >2000 0509 0399 0000 DATA >0000 CHARACTER z ASCII 7A 0510 0392 F810 DATA >F810 0511 0394 2040 DATA >2040 0512 0396 F800 DATA >F800 0513 0398 3840 DATA >3840 CHARACTER ASCII 7B 0514 039A 20CO DATA >20C0 0515 039C 2040 DATA >2040 0516 039E 3800 DATA >38'Hl 0517 03AIil 41il21il DATA >4020 CHARACTER ASCII 7C 1il518 03A2 1008 DATA >1008 0519 03A4 1020 DATA >1020 0520 03A6 4000 DATA >4000 0521 03A8 E010 DATA >E010 CHARACTER ASCII 7D 0522 03AA 2018 DATA >2018 0523 03AC 2010 DATA >2010 0524 03AE E000 DATA >E000 0525 03B0 40A8 DATA >40A8 CHARACTER ASCII 7E 0526 03B2 1090 DATA >1000 0527 03B4 0000 DATA >00"0 0528 03B6 0000 DATA >"0"0 0529 03B8 A850 DATA >A850 CHARACTER ASCII 7F 0530 03BA A850 DATA >A85" 0531 03BC A850 DATA >A850 0532 03BE A800 DATA >A80" 0533 END NO ERRORS, NO WARNINGS 4-15 4.5 TMS9900 SOFTWARE SUBROUTINES NOTE: Before using any of the line drawing subroutines. the "Load Line Drawing Patterns" subroutine must be executed. PATTERN PATTERN PATTERN 00 01 02 =00 =18 =00 =00 =18 =00 =00 = 18 =00 = FF = 18 = F8 = FF = 18 = F8 =00 =18 =18 =00 =18 = 18 =00 = 18 = 18 PATTERN PATTERN PATTERN 03 04 05 =00 =18 = 18 =00 = 18 = 18 =00 = 18 = 18 =1F =F8 = 1F =1F = F8 =1F ~~--t = 18 =00 =00 = 18 =00 =00 =18 ..........................................r.......I =00 =00 PATTERN 06 =18 -+-+-..... = 18 --41--1--4 =18 = FF = FF HH-t =18 .....1--1..... = 18 ~ ........ = 18 4-16 SEm-tENTS 13:36:55 TUESDAY, SEP 21, 1982. PAGE 'HHJ2 0"01 IDT 'SEGHEt~TS' 9002 ********************************************************** ""03 * * "094 * Tf-tS9918A SUBROUTINES * 0"05 *********************************************************** * OOB6 OfHIJ7 0008 9"' 90f/J2' VDPt'l VRAMl'I EQU >9900 ADDRESS TO t"7RITE DATA TO VRAl·1 EQU >9002 ADDRESS TO URITE DATA TO VDP 0009 9004 VRAtlR EQU >9fHJ4 ADDRESS TO READ DATA FROB VRAH 0010 9996 VDPR EQU >9006 ADDRESS TO READ STATUS FROIl VDP 0011 ********************************************************** "012 * LOAD LInE DRAWING PATTERNS * 0"13 0014 * * 11015 * REGISTERS USED: * * * 8016 * * REG 1 • RESERVED ** IHl17 "018 * REG 2 = RESERVED * "019 * REG 3 = ADDRESS OF PATTERN GENERATOR * "020 * REG 4 = PATTERN LOCATIOll IN llEf'lORY * 0021 * REG 5 .. COLORS OF DRAlHNG PATTERNS * 0022 * (USER DEFINED) * 0023 ********************************************************** 0924 ** 0025 0.026 0090 0201 LI R1,VRAf-ll'1 ADDRESS TO l'7RITE DATA TO VRAH 9"02 9""0 0027 fHH.J4 0202 LI R2,VDP'I'l ADDRESS TO l'TRITE TO VDP 0006 9002 0028 0lBJ8 02"3 LI R3,)4800 ADDRESS IN PATT GEN FOR PATT " IHIOA 481Hl oa29 DOOC 0204 LI R4,PATD DRANIHG PATTERNS LOCATED IN UEn "DOE C"J2E' 0030 "OHI C483 nov R3,*lt2 SEND f.1SB OF VRAf.l ADDRESS TO VDP 0031 0012 06C3 St'lPB R3 REVERSE BYTES 0032 IH1l4 C483 nov R3,*R2 SEND LSB OF VRAM ADDRESS TO VDP 0033 0616 0203 LI n3,56 7 PATTERUS X 8 BYTES EACH 9018 "038 {HJ34 00lA D474 LLD1 r·IOVB *n4+, *R1 SEND BYTE TO VRMI 0035 onc 0603 DEC R3 DECREl1ENT BYTE COUllT 0036 00lF. 16FD JHE LLDl IF NOT DOllE, GET NEXT BYTE 0037 0029 0203 LI R3, >421H1 ADDRESS OF COLOR TABLE CH122 4200 £1038 0024 C483 nov R3,*n2 SEND LSD OF VRAl,i ADDRESS TO VDP "039 0026 "6C3 SUPB R3 REVERSE BYTES 0040 OB28 C403 nov R3,*R2 SEND I1SB OF VRl\~I ADDRESS TO VDP 0041 OD2A C445 nov R5,*Rl SEnD COLOR BYTE TO VRAn 0042 092C 04513 B *Rll RETURU TO CALLInG PROGRAH 0043 * 0"44 * ,;H'45 * PATTERns FOR LINE DRANIUG ("'46 * 'HI 47 *PATD 9048 0132E COOO DATA >OOSO PATTERn Gil IHJ49 OD3£! "OFF DATA >{lfJFF 0050 0032FFIHI DATA >FFfW ""51 0034 0000 DATA )(jOO" IHI52 CH!l36 1818 DATA >1818 PATTERn CJl 0053 0038 1818 DATA >1818 CO 54 "03A 1810 DATA >1818 4-17 SEGl'lENTS SDSMAC 3.4.0 81.117 13:36:55 TUESDAY, SEP 21, 1982. PAGE 0003 0055 0Cl3C 1818 DATA >1818 'HJ56 ""3E 0000 DATA >OOlHl PATTERN 02 1"'57 0040 OOF8 DATA >OOF8 0058 0042 F818 DATA >F818 0059' 0044 1818 DATA >1818 0060 0046 0000 DATA >O'HHl PATTERN 03 0061 0048 00lF DATA >OOlF 0062 004A IF18 DATA >lF18 0063 004C 1818 DATA >1818 0064 004E 1818 DATA >1818 PATTERN 04 0065 0050 laF8 DATA >18F8 0066 0052 FBOO DATA >F800 0067 0054 0000 DATA >0000 0068 0056 1818 DATA >1818 PATTERN OS 0069 0058 lRlF DATA >181F 0070 005A IFOQ DJ\TA >1F00 0071 D05C 0000 DATA >0000 0072 005 E 1818 DATA >1818 PATTERN 0G 0073 0060 laFF DATA >18FF 0074 0062 FF18 DATA >FF18 0075 0064 1818 DAT]\ >181H 0076 * 0077 * 0078 ********************************************************** 0079 * * 0080 * LOAD SPRITES SUBROUTINE * C081 * * 0082 * REGIS'l'ERS USED: * 0083 * * 0084 * R1 = RESERVED * OOB5 * R2 RESERVED * 0086 * R3 ADDRESS OF SPRITE TABLE In VRAH * 0087 * R4 HEIIORY ADDRESS OF SPRITE TABLE (USER DEF) * 00B8 * R5 ImlIBER OF BYTES TO TRAnSFER (USER DEP) * 0089 * * 0090 ********************************************************** con * 0092 0066 0201 LI R1,VRAf.iH ADDRESS TO VlRITE DATA TO VRAH 0068 9000 0093 006A 0202 LI R2,VDPl'l ADDRESS TO ~1RITE TO VDP D06e 9002 0094 D06E 0203 LI R3, >4000 ADDRESS OF SPRITE TABLE In VRAH 0070 4000 00950072 C483 nov R3,*R2 SEND LSB OF VAAl'l ADDRESS TO VDP 0096 0074 06C3 m'7PB R3 REVERSE BYTES 0097 0076 C483 nov n3,*P.2 SEND nSB OF VRAII ADDRESS TO VDP 0098 D078 D0F4 LDPL nOVE *R4+,R3 GET BYTE OF DATA PROII !lEll 0099 007 A 06C3 SHPB R3 REVERSE BYTES lHD0 007C C443 nov R3, *R1 SEND DATA TO VRAH 0101 OG7E 0605 DEC R5 ARE HE Dotm YET? 0102 0080 16FD JNE LDPL no, GO AGAIN (1103 0082 045B B *Rll YES, RETURN TO CALLING PROGRAH 4-18 SEGHENTS SDSHAC 3.4.0 8l.ll7 13:36:55 TUESDAY, SEP 21, 1982. PAGE 0004 0105 ********************************************************** 0106 * * fJ107 * CLEAR SCREEN SUBROUTINE * 0108 * * 0109 * REGISTERS USED: * OllO * * Olll * Rl = RESERVED * O1l2 * R2 = RESERVED * 0113 * R3 = START ADDRESS ON SCREEN * 0114 * * 0115 ********************************************************** O1l6 0117 * * D1l8 0084 0201 CLSC LI Rl,VRAllW ADDRESS TO URITE DATA TO VRAH 0086 9000 0119 0088 0202 LI R2,VDPN ADDRESS TO t'1RITE TO VDP 008A 9002 (H20 D08C 0203 LI R3,)4400 START LOCATION OF THE NAHE TABLE "08E 44('" 0121 01390 C483 HOV R3,*R2 SEND LSB OF VRAH ADDRESS TO VDP 0122 0092 06C3 Sl:lPB R3 REVERSE BYTES 0123 0094 C483 nov R3, *R2 SEND fISB OF VRAlt ADDRESS TO VDP 0124 0'096 0202 LI R2,768 #OF POSITIONS ON SCREEN 0098 0300 0125 009A 0203 LI R3,)20 ASCII SPACE CHAR 009C 0020 0126 009E C443 CSL1 ~10V R3,*Rl SEND SPACE CHAR TO VRAH 0127 DOAO 0602 DEC R2 ARE ALL LOCATIons CLEAR? 0128 00A2 16FD JNE CSLI NO, GO AGAIN 0129 00M 045B B *Rll YES, RETURN TO CALLING PROGRAH 0130 * 0131 * 0132 ********************************************************** 0133 * * 0134 * PRINT HESSAGE SUBROUTINE * 0135 * AnD BlU\.NCHTO USERS PROGRl\I>1 * 0136 * * 0137 * REGISTERS USED: * 0138 * * 0139 * R1 = RESERVED * 0140 * R2 = RESERVED * 0141 * R3 = STARTING ADDRESS OF l-lESSAGE IN NAHE * 0142 * TABLE (USER DEFINED) * 0143 * R4 HEHORY ADDRESS OF ~lESSAGE (USER DEFINED) * 0144 * * 0145 * NOTE: END HESSAGE STRING \HTH A BYTE 00 * 0146 * * 0147 ********************************************************** 0148 * 0149 * 0150 00A6 0201 PRUT LI R1,VRAHW ADDRESS TO t'7RITE DATA TO VRAfl f.H:lA8 9000 0151 DOAA 0202 LI R2,VDPI1 ADDRESS TO l'1RITE TO VDP OOAC 9002 0152 OOAE C483 ~-1OV R3, *R2 SEND LSB OF VRAH ADDRESS TO VDP 0153 (H3BG (J6C3 SWPB R3 REVERSE BYTES 0154 OOB2 C483 HOV R3, *R2 SEND HSB OF VRAll ADDRESS TO VDP 0155 G13B4 D(JB4 PRL1 novo *R4+,R2 GET BYTE OF TEXT FROB NEH 0156 00B6 1303 JEQ PRL2 IF ZERO, THEN EHD OP HESS 0157 00B8 06C2 SI'1PB R2 INDEX BYTE INTO POSITION 4-19 SEGHENTS SDSMAC 3.4.0 81.117 13:36:55 TUESDAY, SEP 21, 1982. PAGE 0005 0158 00BA C442 nov R2,*Rl SEND CHAR TO VRAM 0159 00BC 10FB Jf.1P PRLI GET NEXT CHAR 0160 OOBE 045B PRL2 B *Rll RETURN TO CALLING PROGRAM 016-l * 0162 * 0163 ********************************************************** 0164 ** ** 0165 ERASE TO END OF SCREEN SUBROUTINE 0166 * * IH67 * REGIS.TERS USED: * 0168 * * 0169 * Rl = RESERVED * 0170 * R2 = RESERVED * 0171 * R3 = ADDRESS IN NAr-1E TABLE TO START ERASURE * 0172 * (USER DEFINED), R3 MUST BE EQUAL TO * 0173 * OR GREATER THAN >4400, AND fclUST BE LESS * 0174 * THAN OR EQUAL TO >46FF * 0175 * * 0176 ********************************************************** 0177 * 0178 OOCI:) 0201 BEOS LI Rl,VRA1·nq ADDRESS TO HRITE DATA TO VRAH OOC2 9000 0179 00C4 0202 LI R2, VDPl'1 ADDRESS TO t'1RITE TO VDP OOC6 913132 0180 (lDCB C483 HOV R3, *R2 SEND LSB OF VRAN ADDRESS TO VDP 0181 DOCA 06C3 St-TPB R3 REVERSE BYTES 0182 OOCC C483 ~lOV R3,*R2 SEND nSB OF VRAM ADDRESS TO VDP 0183 OOCE O202 LI R2,>20 LOAD R2 WITH 'SPACE' CHAR 01300 01320 0184 13002 C442 EESI HOV R2,*Rl SEND 'SPACE' TO SCREEN 0185 17004 0583 INC R3 INCREHENT CHAR COUNT 0186 0006 0283 CI R3,>4700 ARE tTE AT THE END OF SCREEN 0(lD8 4700 0187 ''''OA lAPD JL EESI IF NOT GO AGAIN 0188 (JODC 045B B *Rll YES, RETURn TO CALLING PROGRAM 0189 * 0190 * 0191 ********************************************************** 0192 * * 0193 * ERASE LINE SUB * 0194 * * 'H95 * REGISTERS USED: * C196 ** ** 0197 Rl = RESERVED 0198 * R2 = RESERVED * 0199 * R3 = STARTING ADDRESS IN LINE IN NAI·1E * 020" * TABLE TO BE ERASED (USER DEFINED) * 0201 ********************************************************** 0202 * 0203 *ERLN 0204 OODE 02" 1 LI Rl,VRAf.Ul ADDRESS TO l'1RITE DATA TO VRAH ("'Ea 9000 02135 OOE2 0202 LI R2, VDP~l ADDRESS TO ~lRITE TO VDP 00 E4 9rHJ2 0206 oaE6 C483 nov R3,*R2 SEND LSB OF VRAH ADDRESS TO VDP 0207 00E8 06C3 SHPB R3 REVERSE BYTES 0208 IHlEA C483 HOV R3,*R2 SEND nSB OF VRAH ADDRESS TO VDP 0209 00EC 0202 LI R2,>20 LOAD R2 WITH 'SPACE' CHAR OOEE 0020 0210 "OFO 0203 LI R3,32 LOAD R3 lHTH # OF POSTIONS 4-20 SEGIIENTS SDsr·IAC 3.4." 81.117 13:36:55 TUESDAY, SEP 21, 1982. PAGE "006 00F2 0020 0211 00F4 C442 ERL1 l-10V R2, *R1 SEND 'SPACE' CAHR TO NAf.1E TABLE 02], 2 OOF6 0603 DEC R3 DECREf.1ENT CHAR COUNT 0213 "'BF8 16FD JNE ERL1 IF NOT DONE, GO ACAIN 0214 00FA 045B D *Rll DOnE, RETURN TO CALLING PROG D215 * 0216 * 0217 ********************************************************** 0218 * * 0219 * DRAt'l A HORIZ LINE * 0220 * * 0221 * REGISTERS USED: * 0222 * * 0223 * R3 = ADDRESS OF UPPER LEFT CORNER * 0224 * R4 = # OF HORIZ POSITIONS * 0225 * R5 = # OF VERT POSITIONS * 0226 * R9 = PATTERN # OFFSET * 0227 * * 022G ********************************************************** 0229 * [J230 * rJ231 'HlFC 0201 DBOX LI R1, >9000 ADDRESS OF DATA TO 9918 OOFE 9000 fl232 0100 0202 LI R2, >9002 ADDRESS OF ADDRESSES TO 9918 0102 9002 0233 OHl4 C483 nov R3,*R2 SEND LSB OF ADDRESS TO 9918 0234 0106 06C3 StTPD R3 REVERSE BYTES 0235 0U8 C483 !lOV R3, *R2 SEND !-ISB OF ADDRESS TO 9918 0236 {HOA 06C3 StJPB R3 REVERSE BYTES 0237 0l0C C189 HOV R9,R6 GET OFFSET 0238 010E 0226 AI R6,>Ol POINT TO UPPER LEFT CORHER PATTE 0110 0001 0239 0112 C446 nov R6, *R1 SEnD IT TO THE 9918 0240 0114 C1C4 liOV R4,R7 STORE I10RIZ COUNT IN TEl1P REG 0241 13116 0647 DECT R7 DETERIUNE (LENGTH - CORNERS) (;242 1'118 1304 JEQ DBL2 110 LENGTH OTHER THAN CORNERS 0243 011A C189 HOV R9,R6 PATTERN 00 + OFFSET 0244 011C C446 DBL1 /lOV R6,*Rl SEND LINE SEGNENT TO 9918 0245 011E 1'607 DEC R7 DEC LINE COUNT 0246 'H20 16FD JNE DDL1 NOT DONE YET, GO AGAIN 0247 0122 C189 DBL2 nov R9,R6 GET OFFSET 0248 0124 0226 AI R6,>05 POINT TO UPPER RIGHT CORNER 0126 0005 0249 0128 C446 nov R6,*R1 SEND IT TO 9918 0250 012A C203 HOV R3,RS SEND ADDRESS OF UPPER LEFT TO TE 0251 012C C1C5 nov R5,R7 SEND VERT COUNT TO TEHP 0252 CH2E 0647 DECT R7 DETERHINE (HEIGTH - CORNERS) 0253 0130 130C jEo. DBL4 no HEIGTH OTHER THAN CORNERS 13254 0132 C189 nov R9,R6 GET OFFSET 0255 0134 0226 AI R6,>03 POINT TO VERT LHIE PATTERN 0136 0003 0256 0138 0228 DOL3 AI R8,>20 INC VERT POSITION BY 1 CHAR 013A ~HJ20 0257 013C C488 nov R8,*R2 SEND ADDRESS TO 9918 0258 013E 06C8 S'ilPB R8 REVERSE I3YTES 0259 0140 C488 NOV R8,*R2 SEnD ADDRESS TO 9918 0260 0142 06C8 mlPB R8 REVERSE BYTES 0261 0144 C046 nov R6,nI SEUD VERT LINE SEGrlENT TO 9918 0262 0146 0607 DEC R7 DECRElIENT VERT COUNT 0263 0148 16F7 JNE DBL3 nOT DONE YET, GO AGAIN 4-21 SEGNENTS SDsnAC 3.4.0 81.11 7 13:36:55 TUESDAY, SEP 21, 1982. PAGE 0007 0264 014A 0228 DBL4 AI R8,>20 INC VERT POSITION BY 1 CHAR 014C 'Hl20 0265 014E C488 NOV R8,*R2 SEND ADDRESS TO 9918A 0266 0150 06C8 SHPB R8 REVERSE BYTES 0267 0152 C088 IvlOV R8,R2 SEND ADDRESS TO 9918 0268 0154 06C8 SNPB R8 REVERSE BYTES 0269 0156 C189 110V R9,R6 GET OFFSET 0270 0158 0226 AI R6,>02 POINT TO LOHER LEFT CORNER PATT 015A 0002 0271 015C C446 nov R6,*R1 SEND IT TO 9918 0272 (lISE C1C4 HOV R4,R7 SEND HORIZ COUNT TO TEfc1P 0273 0160 0647 DECT R7 DETERlUNE (HORIZ - CORNERS) "274 0162 1304 JEQ DDL6 no HORIZ OTHER THAN CORNERS 0275 0164 C189 llOV R9,R6 GET OFFSET 0276 0166 C446 DDLS nov R6,*Rl SEND HORIZ PATTERN TO 9918 0277 0168 0607 DEC R7 DECREflENT HORIZ COUNT 0278 016A 16FD JNE DBLS IF NOT DONE, GO AGAIN 0279 016C C189 DBL6 nov R9,R6 GET OFFSET 0280 016B 0226 AI R6,>04 POINT TO LmiER RIGHT PATTERN 0170 0004 0281 0172 C446 HOV R6,*Rl SEND PATTERrJ TO 9918 0282 017 4 C1C5 rIOV R5,R7 STORE VERT COUNT IN TEl·IP 0283 0176 0647 DECT R7 DECREHENT VERT COUNT 0284 0178 1312 JEQ DBL8 IF NO VERT SEGr-lENTS, DONE 0285 017A CIC4 HOV R4,R7 STORE HORIZ counT IN TErIP 0286 017C 0607 DEC P..7 DECREMENT HORIZ COUNT 0287 017E C203 llOV R3,R8 STORE ADDRESS OF UPPER LEFT COR 0288 0180 A207 A R7,R8 FIND UPPER RIGHT CORNER LOCATION 0289 0182 C189 HOV R9,R6 GET OFFSET 0290 (H84 0226 AI R6,>03 POINT TO VERTICAL LINE PATTERN 0186 001'3 0291 0188 C1CS nov R5,R7 STORE VERT COUNT IN TE~lP 0292 018A 0647 DEC'l' R7 DETERlUNE (HEIGHT - CORHERS) 0293 OleC 0228 DBL7 AI R8,>20 INCREf.lENT VERT POSITION BY 1 CHA 018E 0020 0294 0190 C488 f.lOV R8,*R2 SEND ADDRESS TO 9918 0295 0192 06CS SHPB R8 REVERSE BYTES 0296 0194 C488 !·lOV R8,*R2 SEND ADDRESS TO 9918 0297 0196 06C8 SHPB R8 REVERSE BYTES 0298 0198 C446 nov R6, *Rl SEND PATTERN TO 9918 0299 019A 0607 DEC R7 DECREHENT VERT COUNT 0300 019C 16F7 JUE DBL7 IF NOT DONE, GO AGAIn fl301 019E 045B DBL8 B *Rll SUB DONE RETURN TO CALLING PROG 0302 * 0303 * 0304 ********************************************************** 0305 * * 0306 * LOAD TEXT COLORS SUBROUTINE * 0307 * * 0308 * REGISTERS USED: * 0309 * * 0310 * R4 = COLORS FOR TEXT CHARACTERS * 0311 * * 0312 ********************************************************** 0313 * 0314 DIAD 0201 LDTC LI R1,>9000 01A2 9000 0315 01M 0202 LI R2,>9002 01M 9002 0316 01A8 0203 LI R3,>4204 ADDRESS FOR TEXT COLORS IN 9918 4-22 SEGf.tEUTS SDSf-IAC 3.4." 81.117 13:36:55 TUESDAY, SEP 21, 1982. PAGE """8 0lAA 4204 0317 "lAC C483 r-tOV R3,*R2 SEND ADDRESS TO 9918 0318 BlAE 06C3 SHPB R3 REVERSE BYTES 0319 0lBO C483 tolOV R3,*R2 8 COLOR CHAR X 8 TEXT/CHAR = 64 0320 (HB2 C444 LCLI MOV R4,*R1 SEND ~'10RD TO 9918 "321 "lB4 0602 DEC R2 DECREr-lENT COUNT 0322 OlB6 16FD JNE LCLI IF NOT DONE, GO AGAIN 0323 (llB8 045B B *R11 DONE, RETURN TO CALLING PROG 0324 * 0325 * 0326 ********************************************************** 0327 * * 0328 * DRAW A VERTICAL LINE SUB * 0329 * * 0330 * REGISTERS USED: * 0331 * * 0332 * R3 = ADDRESS ON SCREEN * 0333 * R4 = It OF POSITIONS * 0334 * R9 = PATTERN OFFSET * 0335 * * 0336 ********************************************************** 0337 * 0338 OlBA C483 DVLU MOV R3, *R2 SEND ADDRESS TO 9918 0339 01BC 06C3 SHPB R3 REVERSE BYTES 0340 01BE C483 I·lOV R3,*R2 SEND ADDRESS TO 9918 0341 01CO 06C3 SHPB R3 REVERSE BYTES 0342 01C2 C445 HOV R5,*Rl SEnD PATTERN TO 9918 0343 EnD NO ERRORS, NO WARNINGS 4-23 6. TMS9918A/9928A/9929A ELECTRICAL SPECIFICATIONS 5.1 ABSOLUTE MAXIMUM RATINGS OVER OPERATING FREE-AIR TEMPERATURE RANGE (unless otherwise noted)* Supply voltage, V CC ........................................................................ , - 0.3 to 20 V All input voltages ................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... . . . . . . . . . . . . . . . . . . . . . . . . .. - 0.3 to 20 V Output voltage ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 2 to 7 V Continuous power dissipation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1.3 W Operating free-air temperature range ............................................................ O°C to 70°C Storage temperature range ............................................................ ,. - 55°C to + 150°C ·Stresses beyond those listed under Absolute Maximum Ratings may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions beyond those indicated in the Recommended Operating Conditions section of this specification is not implied. Exposure to absolute maximum rated conditions for extended periods may affect device reliabili- ty. 5.2 RECOMMENDED OPERATING CONDtnONS* PARAMETER MIN NOM MAX UNIT Supply voltage, VCC 4.75 5.25 V Supply voltage, VSS 0 V SYNC active 10 12 V Input Voltage, VI, RESET active 0.6 V RESET/SYNC pin SYNC and RESET inactive 3 6 V XTAL1, XTAL2 2.75 V High-level input, VIH All other inputs 2.2 V Input Voltage, VI, SYNC level 2.6 V EXTVDP pin White level 3.7 V (TMS9918A only) Black level 3 V Low-level input voltage, VIL 0.8 V Operating free-air temperature, TA 0 70 °c * All voltage values are with respect to VSS. 5-1 6.3 ELECTRICAL CHARACTERISTICS OVER FULL RANGES OF RECOMMENDED OPERATING CONDITIONS (unless otherwise noted) . TMS9918A/9928A/9929A PARAMETER TEST CONDITIONS MIN TYPt MAX UNIT High-level RAS, CAS, R/W 2.7 3.4 VOH IOH = 400 tAA V output All other 2.4 3.2 voltage outputs Low-level CPU data IOL = 1.2 mA 0.3 0.6 VOL V output DRAM IOL = 800 tAA 0.6 voltage interface IOZH Off-state output current high-level voltage Vo = 5.25 V 1 100 tAA applied, 00-07 outputs IOZL Off-state output current high-level voltage Vo = 0.4 V 1 -100 tAA applied, 00-07 outputs IIH High-level input current V, = 5.25 V, all other pins at 10 tAA OV IlL Low-level input current V,= 0 V, All other pins at -10 tAA OV TMS9918A Only (Figure 5-1) PARAMETER TEST CONDITIONS MIN NOM MAX UNIT Vwhite Video voltage level of white, COMVIO 2.8 3.0 3.2 V Vblack Video voltage level of black (blank), RL = 470 Q 2.1 2.3 2.5V COMVIO Vsync Video voltage level of sync, eOMVIO 1.85 2.0 2.1 V t All typical values are at Vee = 5.25 V. TA = 25°e. 5-2 5.3 ELECTRICAL CHARACTERISTICS OVER FULL RANGES OF RECOMMENDED OPERATING CONDITIONS (unless otherwise noted) (Continued) TMS9928A/9929A Only (Figure 5-1) PARAMETER TEST CONDITIONS MIN NOM MAX UNIT Vwhite Video voltage level of white, Y, R-Y, B-Y 2.5 3 3.6 V outputs Vblack Video voltage level of black (blank), Y, RL == 470 Q 1.6 2.3 2.5 V R-Y, B-Youtputs Vsync Video voltage level of sync, Y output 1.2 1.8 2 V TMS9929A Only PARAMETER TEST CONDITIONS MIN TYP MAX UNIT VpS Color burst video voltage level with respect R-Youtput 0.25 V to V no color Vneg Color burst video voltage level with respect B-Youtput -0.25 V to V no color TMS9918A/9928A/9929A (Figure 5-2) PARAMETER TEST CONDITIONS MIN NOM MAX UNIT Video voltage difference, white-black, Y, 0.7 1.0 V R-Y, B-Youtputs ICC Average supply current from VCC TA = 25°C 200 250 mA 00-07 Input unmeasured 20 Ci capacitance All other f=ll MHz, pins 10 pF inputs atOV 10 unmeasured Co Output capacitance f = 11 MHz, pins 20 pF at 0 V t All typical values are at VCC = 5.25 V, TA = 25°C. 5-3 5.4 TIMING REQUIREMENTS OVER FULL RANGES OF RECOMMENDED OPERATING CONDITIONS (TMS9918A/9928A/_A) CPU· VDP Interface (Figures 5-3 and 5-41 PARAMETER MIN NOM MAX UNIT tsu(A-RL) Address setup time before CSR low 0 ns tsu(A-WL) Address setup time before CSW low 30 ns th(WL-A) Address hold time after CSW low 30 ns tsu(D-WH) Data setup time before CSW high 100 ns th(WH-D) Data hold time after CSW high 30 ns tw(WL) Pulse width, CSW low 200 ns tw (CS-H1) Pulse width, chip select high 8 IJS (requesting memory access) tw (CS-H2) Pulse width, chip select high 2 JAS (not requesting memory access) VDP-VRAM Interface (Figure 5-5 and 5-6) PARAMETER MIN NOM MAX UNIT tc Memory read or write cycle time 372 ns tsu(D-CH) Input data setup time before CAS high 60 ns th(CH-D) Input data hold time after CAS high 0 ns External Clock Source (Figure 5-7) PARAMETER MIN TYP MAX UNIT fext External source frequency 10 ~ 738098 .1 MHz 10.738635 10.739172 tr/tf External source rise/fall time 10 15 ns twH External source high-level pulse width 42 47 52 ns twL External source low-level pulse width 42 47 52 ns tpD External source phase delay from XTAL 1 42 47 52 ns falling edge to XTAL2 falling edge 5-4 5.5 SWITCHING CHARACTERISTICS OVER FULL RANGE OF RECOMMENDED OPERATING CONDITIONS (TMS9918A/9928A/'BJJ)A) CPU-VDP Interface PARAMETER TEST CONDITIONS MIN TVP MAX UNIT TA(CSR) Data access time from CSR low 100 150 ns tpvx Data disable time after CSR high 65 100 ns tPVX.A Data invalid time from address changes 0 ns CL = 300 pF fCPUCLK CPU clock output clock frequency (text -<- 3) 3.4 3.58 3.76 MHz fGROMCLK GROM clock output clock frequency (fext -<- 24) 425.12 447.5 469.88 kHz VDP-VRAM Interface (Figures 5-5 and 5-6) PARAMETER TEST CONDITIONS MIN TVP MAX UNIT tw Pulse width, CAS high 80 100 120 ns tw(CL) Pulse width, CAS low 220 230 250 ns tw(RH) Pulse width, RAS high 100 125 150 ns twIRL) Pulse width, RAS low 190 210 230 ns tw(W) Pulse width, write pulse 170 190 210 ns CL = 50 pF tCA-CL Delay time, column address to CAS -10 -2 ns low tRA-RL Delay time, row address to RAS low 25 45 65 ns td-WL Delay time, data to R/W low 0 6 20 ns twH-CL Delay time, R/W high to CAS low 25 50 75 ns tw-CH Delay time, R/W low to CAS high 120 140 160 ns tW-RH Delay time, R/W low to RAS high 60 75 90 ns 5-5 5.5 SWITCHING CHARACTERISTICS OVER FULL RANGE OF RECOMMENDED OPERATING CONDITIONS (TMS9918A/9928A/9929A) (Continued) TMS9918A Composite video output (Figures 5-8 and 5-9) PARAMETER TEST CONDITIONS MIN TYP MAX UNIT tCL-CA Column address valid after CAS low 45 65 85 ns tRL-RA Row address valid after RAS low 20 25 30 ns tRL-CA Column address valid after RAS low 95 110 130 ns tCL-D Data valid after CAS low 240 260 280 ns tRL-D Data valid after RAS low CL = 50 pF 95 110 125 ns tWL-D Data valid after RIW low 135 165 195 ns tCH-WL Read command valid after CAS high 0 ns tCL-W Write command valid after CAS low 270 290 310 ns tCH-RL Delay time, CAS high to RAS low 45 65 ns tCL-RH Delay time, CAS low to RAS high 150 170 190 ns tRL-CL Delay time, RAS low to CAS low 30 40 50 ns 5-6 5.5 SWITCHING CHARACTERISTICS OVER FULL RANGE OF RECOMMENDED OPERATING CONDITIONS (TMS9918A/9928A/9929A) (Continued) TMS9918A Composite video output (Figures 5-8 and 5-9) PARAMETER TEST CONDITIONS MIN TYP MAX UNIT tfl Fall time, Vblack to Vsync 10 ns tw(HS) Pulse width, horizontal sync 4.84 IJS trl Rise time, Vsync to Vblack 20 ns tHS-CD Delay time, sync to color burst 372 ns twlCB) Width, color burst 261 IJS tCB-LB Delay time, color burst to left border 1.49 jAs RL = 470 Q tr2 Rise time, Vblack to Vwhite 60 ns CL = 150 pF tw(LB) Left border video width 2.42 IJS tf2 Fall time, Vwhite to Vblack 110 ns tw(AD) Width of active display area 47.68 IJS tw(RB) Right border video width 2.79 f.lS tRB-HS Delay time, right border to horizontal IJS sync 1.49 IJS tvFB Vertical front blanking 191.1 f.ls tvs Vertical sync- 191.1 f.lS VVBB Vertical back blanking 828 f.lS tABA Active plus border area time 18.8 ms -- NOTE: Fall times depend on external pull-down resistor 5-7 5.5 SWITCHING CHARACTERISTICS OVER FULL RANGE OF RECOMMENDED OPERATING CONDITIONS (TMS9918A/9928A/9929A) (Continued) TMS9928A/9929A y, R-Y, B-Y outputs (Figures 5-10 through 5-13) PARAMETER TEST CONDITIONS MIN TYP MAX UNIT tf3 Fall time, Vblackto Vsync 100 ns tw(HSII Pulse width, horizontal sync 4.84 J.IS tr3 Rise time, Vsync to Vblack 150 ns tw(BP) Width, back porch 4.47 J.IS tw(LBI) Width, left border 2.8 /As tw(P) Pulse width, pixel 186.24 ns tw(horz) Width, horizontal line 63.695 J.IS tw(ADI) Width, active display area 47.67 /AS tr4 Rise time, Vb lack to Vwhite 75 ns tr4 Fall time, Vwhite to Vblack 50 ns tw(RBI) Width, right border 2.42 /As tw(FP) Width, front porch 1.49 /As RL = 470 Q t r5 Rise time, V no color to V pas CB 150 ns CL = 15 pF tw (CB1 ) Pulse width, pas color burst 2.6 /As tf5 Fall time, V pas CB to V no color 100 ns tw(CB-LBI) Delay time, pas CB to left border 1.49 /AS tf6 Fall time, V no color to V neg CB 100 ns tr6 Rise time, V neg CB to V no color 150 ns tw(VSI) Pulse width, vertical sync 465 ns tvFBI Vertical front blanking 191.09 J.IS tvSI Vertical sync 191.09 J.IS tVBBI Vertical back blanking 828.04 J.IS tABAI Active area plus border area total 18.70 mS Vertical time 19.91 mS NOTE: Fall times depend on external pull-down resistor. 5-8 4700 15 pF +/-1% I FIGURE 5-' - LOAD CIRCUIT FOR COMVID IALL DEVICES) AND R-V, V, B-V SWITCHING CHARACTERISTICS 1TMS8928A/9928AI WHERE VL = 1_95 V FROM OUTPUT 0 - - " - 0 TEST POINT UNDER TEST = RL 1.1 kO CL = 300pF } FOR CD BUS RL = 1_6kO CL = 50pF } FOR DRAM INTERFACE FIGURE 5-2 - LOAD CIRCUITS FOR ALL OUTPUTS EXCEPT COMVID, R-V, V, B-V 5-9 WRITE CYCLE CsW ~~ __________ ~_(W_L_) ___________ :¥'r I I I I MODE X~~--~1K~--------------~i_:- ,,- ,. ts~(A-WL) I I I I --t .....----1-1-*- th(WL-A) I I I I DATA --~)(~--~~:---~ ts~(D-WH) I I I I -I1----4-J.,. "'r-~--4-J"""th(WH-D) FIGURE 5-3 - CPU-VDP WRITE CYCLE FOR TMS9918A/9928A/9929A READ CYCLE !\I I ss A ~E~ ~ ts~(A-R L) --III~I-----4" I I I I ________________ .t II :: X tPVX,A...t t-- DATA -----------C I I ( V7;DATA ~ ) t- ..f ta(CSR) I.-tpvx --...j NOTE: All meesurements ere mede et 10% end 90% points. FIGURE 5-4 - CPU-VDP READ CYCLE FOR TMS9918A/9928A/9929A 5-10 , ,~~~------------------------~----------------------~.~II , I t- .. telllll----tw(RH)--~.. tw(RL\----------....., ~ , RAS ---~ , \i. 1 t RL.CL }tl ,(.i \'.~, __ "'tRL-CA' .. : : , ~ I tCL·RH --------~.... I I, " ..1----+I-tcH·RL--------I.... 1III CAS -----i!----.t\t, ' : 1 tw(CL\ 1: lIIj4t------!--------tw(CH) - - - - - - - -...... 111, ~ tCA·CL....... l-e ~ tCL·CA I I ... I' ,tRL·D - - - - , : ! ~ I tCL·D -----...: : tRA·RL ... • ... tRL.RAl I I I I ADO·All7 ~ ROW )(IDCC~LUMN lOOt DATA ~....t!""'lr""""'.pll'"'t : ,, 'I I, tw.CH I .- " tHRD --------1;. I ... I II ....- ....-twL·D I , .1 : I, tw.RH .. I I " __________~eJ~ 1 , tD·WL -.! I ... ....:JMt-;_-_-_-_-_-_-_-_-_-_-_tw_H_._C_L_ _ _ _ _ _ _-.~ tw-(-W \ R/W I I I I ..~---tCL·D 1III FIGURE 5-5 - VRAM WRITE CYCLE ~~I------------------~------------------~~~I !I.- tw(RL\ ~ ...~~-----tw(RH\------t~~: 1: ',.'----- RAS --"!!I\l.-tRL-CL - : I'"'tcL.RH~ tRL.RAI ..l'RA.RL : ....- tRL·CA I I ~ r. i -X-I". -_-_-_-_-_-_ .. 14.-1 !---I-tCA.CL "'CL' tCL·CA "'II.-HI---- tCH·RL :-' I -~ ----t-tllit 1-:' -:--t-W-(C-H-l-----------_---_-_---_-.... ADO·AD7 XX" ROW ~ COLUMN 'XX-X"'ft""l'XXX~XXX~XXXXXY.'lXX~~____ ~tCH.WL I I XXXYXXY --...1.., l V;xXXXXXXXXXXXXX'IYJ. : J,." tsu(D-CH\ ........ th(CH·D) RDO· RD7 lI"_D_A_T_A_XZK NOTE: All measurements are made at 10% and 90% points. FIGURE 5·6 - VRAM READ CYCLE 5-11 1,--1 ,.. VH--t,-- VL f ..-twH--.I I I NOTE: All mea.urements are mada at '0" and 90" points. FIOURE 6·7 - EXTERNAL CLOCK TIMINO WAVEFORM VWHITE _ _ _ _ _ _ _ ._ _ _ _ _ _ Vea tf11 L ____ 11 ____ 11_. r --Il--tR1 1 VSLACK I , - - - - - ---- -I I ,....--------4 III tf2-'t-- VSYNC- - --. II tCBoLS--t /!- II I--twlHSH 1 J I II Ieola---twIADI---" ....-~tRBoHS lHSoCS--j ' - - I II I-tw1C81-f II tr2--11-- FIOURE 6-8 - TMS9I1BA COMVID HORIZONTAL TIMINO I I I I ~tyFB--" .. r4I---tyBB----1.., ... ---~~~ f4-- tvs-----.f 141------ ... I I ~---lrirlrlJ-- LINE NO. 242 243 244 245 246 247 249 250 251 282 1 2 3 VERTICAL VERTICAL END BOTTOM VERTICAL START TOP FRONT BACK BORDER SYNC BLANKING- BORDER BLANKINO- -Color burst output IUpprlllad FIOURE &-9 - TMS9I1BA VERTICAL TIMINO 5-12 I IjooII ~1 ..t - - - - - - - - - - - - - - t w ( H O R Z ) - - - - - - - - - - - - - - -... I I VWHITE --j ------ ----- I I I I tw(P) -111..__..... I I I I I I I I I ...,J ~tr3 '-~ I tf3 i I ~ II I II I I I I II I I I I VBLACK VSVNC ---5....1 - - - ....---1 I II II I' 'I II ..; ~tf411 II I 1 1\ I --- tw(HsJ)i-t~ ....- - !..~I....1tw(LBI) I t4 tw(RBJ)' I.. ~. I ...- I... ......1 1 tw(BP) .1 I I ......1 - - - - tw(AOI) - - - - - 1.....1 I i4-tw (FP).1 FIGURE 5-10 - TMS9928A/!I929A Y HORIZONTAL TIMING VWHITE-- - Vpos COLOR BURST" - VNOCOLOR - - - - -1.!.. h tr ....... - - ._ 5 . i -tf5~ 14- II - II - - -.~-... II _ n II _-----:#-~------ I VBLACK - - - - - - tw(CBI)'" +- -IL U- - .11 114 ~ !w(LBI) H- - I, 114 I .11 tw(RBI) VSVNC - - - - I I4........ 114 ~ltW(CB.LBI~I ... ---tw(ADI) ~II * Absent for the TMS9928A FIGURE 5-11 - TMS9928A/9929A R-Y HORIZONTAL TIMING VWHITE - - - - - - - - - - - - - VNOCOLOR--------------~ I --, ~---f VNEG COLOR BURST* - -- - _:w;.._.:r I I U I VBLACK---------:-- L1 --1;--+ II I I I 1"- ., 1tw(LBI) I L. .' VSYNC--- tw(CBI) I- -t r- .,!tw(CB-LBI' ....t-----tw(ADI) .,. t I tw(RBI) * Absent for the TMS9928A FIGURE 5-12 - TMS9928A/9929A B-Y HORIZONTAL TIMING tvFBI---I1it .....- - - tvBBI----I~ M-----tABAI- 293 294 295 296 297 I 298 300 301 302 313 1 2 3 END BOTTOM VERTICAL I VERTICAL VERTICAL START TOP FRONT BORDER BLANKING* I SYNC* BACK BLANKING* BORDER I *Color burst output suppressed FIGURE 5-13 - TMS9929A VERTICAL TIMING 6. MECHANICAL DATA 6.1 TMS9918 4O-PIN PLASTIC DUAL·IN-LiNE PACKAGE r : - - - - - - - - 2 . 0 9 O (53,1) M A X - - - - - - - - - . j I~:t------------ EITHER...,.--~,-------, INDEX r, j 4t. 0.600 • 0.010 (15,24 • .0. ~ O'26)~ Ii. 0.020 (0,51) .- -""ON"CAN'~ .. '~~~~'-r ,~~~,~:.,~~tO~95 I~""'M," to: - -'- T I 0.200 (5,08) MAX 0.1 5 (3,17) MIN PIN SPACING 0.100 (2,54) T.P. (2,42) (See Note b) 0.055 (1,39) 0.060 (1,52) NOM NOTES: a. All linear dimensions are in inches and parenthetically in millimeters. Inch dimensions goven. b. Each pin centerline is located within 0.010 (0.25) of its true longitudinal position. 6.2 TMS9918 4O-PIN CERAMIC DUAL-IN-LiNE PACKAGE ~-----------2.020 151.3) MAX -----------..t4 ~-.- - - - - ® I L 0.600 • 0.010 J INDEX DOT D 0) - - - - - - - - - - - - - - - -..... ® 1 F9 rr= 115.24' 026) ~ SEA:I:: -PLANE T 0 ) MIN .OlS' 0.003 --I L..... U- j~ 10.46 • O.OS) ....., r 0.01010.25) NOM PIN SPACING 0.100 12.541 r.p. 11.27 ± 0.51) (See Note b) NOTES: a. All linear dimensions are in inches and parenthetically in millimeters. Inch dimensions goven. b. Each pin centerline is located within 0.010 (0.25) of its true longitudinal position. 6-1 APPENDIX A ASCII CHARACTER SET Software programs apply to all three VDPs (TMS9918A/9928A/9929AI. A·1 This appendix contains the diagrams and software listing of an upper and lower case ASCII character set. The character matrix is 5 X 7 in the 8 X 8 pixel block. These characters are left-justified so they can be used in the text (6 X 8 pixels) mode. PATTERN PATTERN PATTERN PATTERN 20 =00 r-- 21 =20 r- r- 22 =50 23 -r...,..,.., r-r-~~~~~~=oo l- i- I-- -50 =20 -50 i-- =20 I-- I-- ....-++~ -F8 =50 HI-I-+++++-f = 00 l- i- i- =20 -50 ......H H........-+-+-+-~ = 00 I- -00 ....-+-+-I. F8 -20 =00 r-HH-+-+~+-I = 00 i-- =00 ......HH-+-+~+-I = 00 =00 +-t-t-I - 50 HI-I-+++++-f=OO ~~~~~~~-oo • =20 =00 =00 -00 -+-+-+-1 - 50 L...II-.I......L-&......L.....L. . ...1 - 00 PATTERN PATTERN PATTERN PATTERN 24 25 26 27 =20 ........-+-+-1 =78 =co = C8 -+-+-++~ = AO =40 --I -20 =AO -+-++~ =70 .....-+-+-1 =28 = 10 =20 =40 -+-+-++-1 = AO _-+-+-~ =40 ...-+-+-~ -A8 -- I-- -20 -00 -00 =98 _-++-1=90 -00 -+-++-1 =FO = 18 ...-++-1 =68 -00 ........-+-++-1 = 20 L-L...I'-----I......L......L......L.....- I = 00 =00 L-L....J'-----I......L....L.....L.-'-..1 • 00 ·00 PATTERN PATTERN PATTERN PATTERN 28 29 2A =20 = 20 -20 """"IH-+-++-I = 40 -~+-I =A8 ~-+++-I-OO =10 -+-+-++-1 - 20 ................-+-+-+-1--1 = 80 =08 ........-+-+-~ =70 t - H - f -20 =08 -+~+-I -20 ~I-I-f -F8 -+-+-+-+++-1 = 80 -IH-+-++-I = 80 =08 _~+-I =70 -+-+-+-11--1 - 20 --+-+-+-+--1 = 40 = 10 ...-+-+-~ =A8 -++MH -20 -+~++-I=2O =20 -+++-H -20 r-~r-~HH.......-t-OO L-L...I~L...IL...II-I'-----I""'" = 00 =00 .....................................~...... =00 ...............-.L_.......~........ -00 PATTERN PATTERN PATTERN PATTERN 2C 20 2E 2F =00 =00 =00 -00 =00 =00 HH-+- .r-+-II-I. 08 =00 I I I I I I -00 I I I I I I =00 =00 -10 =00 = F8 =00 ~"""'-+-I·20 ~ =20 -00 =00 -40 1-1- -00 =00 -+-++++-t -ao =20 • _33 =40 -00 =20 HH-+-++++-t - 00 I =00 =00 =00 L-JI......I-L.........L....L...&.-I - 00 PATTERN PATTERN PATTERN PATTERN 30 31 -rooor-,....., =70 =20 =70 • F8 =88 =60 =88 -08 = 98 =20 =08 ........-+-+--1 - 10 =A8 =20 -30 -+-+-+-1 = 30 =ca =20 -f~-+++-t = 40 -08 =88 =20 =80 -88 -++-+-1=70 =70 = F8 -+--+-+-I - 70 L-J--I.-'--'-.........-'--'--' = 00 =00 L...II-I'-----I......L~......-'-..I = 00 '-'.........~........'-'-'-..I • 00 - PATTERN PATTERN PATTERN 35 36 37 --1................--1 = 10 = F8 =38 • F8 =80 ............-t-H =40 -08 ~-+-+~=30 -++-+-1=50 = FO -t--t-t-I • 80 -+-+-+-1 - 10 ....++~=90 =08 -FO -+++-H -20 -40 ...-+-+~=F8 =08 =88 --1................--1 = 10 = 88 =88 -40 -+++~ =10 =70 ~-++-I =70 -40 L-J--L--I.~~~~=oo =00 -00 A-2 PATTERN PATTERN PATTERN PATTERN 38 39 3A 38 =70 -r-r-.,...... =70 =00 =00 = 88 = 88 =00 =00 =88 =70 =88 -78 • =20 =00 • =20 =00 • ~ =88 =08 ~20 =20 = 88 r-r- =20 -4-+-+-1 = 10 =00 -4-4-+-1 = 70 -t-+-+-+-I = EO =00 =40 L-L....IL.....I-L....L.....L.....L...J = 00 ................L.......................... =00 =00 i -00 PATTERN PATTERN PATTERN PATTERN 3F 3C ~-4-++-I = 10 3D 3E r---,,...,,...,...,.-r-, =40 IT...,.....,., =70 HI-t-t--t-+-+-t-I = 00 = 20 = 88 -4-4-++-1 = 20 H-4-+++-4 = 40 • . .t:n:l=oo = F8 1-+-+-+-1 =10 =08 ....-++-1=10 =20 -+-+-+-+-+-1 = 80 =00 ....-++-1 =10 -+-t--t-H = 20 -4-4-+-+-1 = 40 = F8 ...-+-++-1 = 20 ~H-+-+-+-+-+-I = 00 H-+-++-I ·20 -t'-t--t-H = 00 ~-4-+-+-I = 10 .....HH-4-+++-I = 00 H-+-+-++-I ·40 -t'-t--t-H = 20 L...JL....L......L....L....L....L...L...J = 00 ' - -...............-I....L................. 00 L-L...I........-..L...L-.L.......... = 00 .......~~.......~............. =OO PATTERN PATTERN PATTERN PATTERN 40 -r-r-T-. =70 -20 = FO = 70 =88 I-t-+-+-I = 50 =88 = 88 = A8 =88 =88 =80 = 88 =88 = FO -+-+++-+-t-I = 80 -4-+-+-1 = BO = F8 =88 = 80 =88 = 88 ...1-t-t-""1 = 88 •••••j j j =80 =78 =88 = FO Hr-It-1H = 70 \ -......L-......L-L...J"-'"-' = 00 ' - - ' - -........-I....L-.L........... =00 =00 ..............--0--"'-'--'-............ = 00 PATTERN PATTERN PATTERN PATTERN 44 45 46 47 = FO = F8 = F8 =78 = 88 =80 =80 =80 = 88 =80 -+-+-+-+-+-t-I = 80 =80 = FO = 88 = 88 =80 ...,..,..,...+-+-t-I ==80FO =80 =98 =88 =80 =80 = 88 1-+-+-+-1 = FO = F8 =78 =00 H-++-+-+-+-I =00 = 80 \-.L-...............-.L-I....L..... = 00 '--_................--"'-'"........... =00 PATTERN PATTERN PATTERN PATTERN 4A 48 48 = 88 =70 =08 ......,.""T'", =88 =88 ....-+++-1 = 20 =08 = 90 = 88 "'""'1-;1-1-1 =AO =08 -+-+++-1 = 20 = F8 -+-+++-1 = 20 =08 =co = 88 -t-+-+-+-I = AD -+-+++-1 = 20 =08 = 88 _-+++-1 =20 = 88 =90 = 88 =70 = 88 ....-+++-1 = 70 .......................................... =88 = 00 L...IL.....I........-L-L....L.....L....J = 00 L...IL-I........-L....L.....L.-'-... = 00 PATTERN PATTERN PATTERN 4C 40 4E =80 =88 = 88 =70 =80 = 08 = 88 = 88 I =80 =A8 = C8 =88 =80 =AS = A8 = 88 =80 =88 =98 =-88 =80 = 88 = 88 = 88 ~ I I II = F8 =00 L-............-.L-.L....L......... = 00 =88 = 88 ................................................ =00 H-++-I =00 =70 A-3 PATTERN 52 • FO -70 -r-...,......... .. FO -88 -88 -88 -88 =88 -88 ....-++-t. 88 -88 -+-++-1:: ............-+~ -80 - FO -+-++.... FO -A8 -AO -08 -80 -80 -+-+-+-1 • 80 -88 ......-+++-+-H _ 80 ....-+-+-1. 68 ...-I-+-t -88 -+-++~-70 L-I......,.....L...L...L....L..L~ - 00 I-.IL....L................."'-........ 00 ,-~~ .............................. -oo PATTERN PATTERN PATTERN 55 56 57 = F8 -88 -88 -88 ..,....-t-H =20 -88 -88 -88 =88 =88 = 88 -+-+-+-+-1 - 20 -88 -88 -AS -+-+--t-t-t = 20 -88 -+-+--t-t-t =20 -88 -AS =88 -+-+-+-+-1 = 20 -++-+-1- 50 -08 =70 -+++H- 2O -00 -+-+-+-1--1 - 20 =88 1-.11-.1...................._....... - 00 .................L...&..................... 00 1-.1........................"'-....... - 00 PATTERN PATTERN PATTERN PATTERN 58 59 5A 58 -88 =88 - F8 = F8 -88 =88 =08 -co ......-++... =50 =50 -+-+-i-+--H -co ......-++... -20 ......-++... -10 -+-+-+-+-+-1 = CO =20 -+-+-+-1 • 50 =20 -+++-H- 2O -CO =88 -+-+-+-+-1 = 20 -+-+-+++-1 = 40 --I--I-++-H = CO -80 -88 -+-+-+-+-1 = 20 • •::t:1:::1 = F8 .........-++~=F8 1-.1............................................. 00 '--I-.I...........L~~.......... = 00 "-L-..I................................J - 00 .................................................... -00 PATTERN PATTERN. PATTERN PATTERN 5C 50 6E 5F -00 - F8 -00 -00 -+++-HH-I _ 80 = 18 1--1-+-+++-+-+-1 .. 00 t-HHH-+-++~ = 00 -40 = 18 =20 H-+++-Hf-+-I = 00 -+-+--+--+-1 = 20 -+-++... =50 = 18 t-HHH-+-++~· 00 --+-+-~ =08 -10 -18 =88 HH-+-+-+-++-I- OO I--+-++- -18 HH-+-++++-1 = 00 H-+++-Hf-+-I--00 00 HH-+-+--t--t-+-I = 00 - F8 I-+-+-++......-I-If-I=OO 10-1-.1................................... - 00 I-.IL....L................."'-....... - 00 .............................................J=OO • •:t:lj=F8 -40 =00 -00 -00 -20 =00 -00 =00 =10 -70 = FO =78 =00 -88 -48 -80 -00 = F8 -70 =80 =00 -88 -48 -80 =00 =88 - FO =78 -00 =00 =00 =00 PATTERN 64 -00 -00 -00 -00 -FO -78 -80 -SO - EO -88 -80 -88 • FO -70 -00 =00 A-4 PATTERN PATTERN PATTERN 68 SA 68 -00 -00 HH-+-+++-H _00 H~-+~+-~~-OO H-+++-H-+-i -00 HH-+-++-I-H .00 -88 ........HH- OO .....+-1-1-1 -00 ......-+-+"1- FB .....+-1-1-1 -70 .........-1-1-1 -90 -88 -AO • F8 ~""I-I-+-"1 - 20 -+++-H- 2O -++-1-1-1 • CO -+-++-+--1 - 20 -++-H--I -20 -88 .......+--~.2O ~-II-I-+-" - AO -++H· AO -88 ......+-+--I- F8 -+++-H· EO ................._ ......_ ....... -00 -++H- 90 L...I~...L.-L-"""""'L...I • 00 L..I-L.-L...L....L-I-L...... - 00 L-I...........................&.......... -00 PATTERN PATTERN PATTERN 6C 6F -00 -OIl -00 -00 ...+-+-+....-+~-IH.OO ·so -88 -88 -so -DB -cs -so -AB -AB -so -88 -88 ~IIII • F8 -OIl -88 -00 -88 PATTERN PATTERN PATTERN 70 71 =00 -00 -00 H-++HH-+-I .00 ...+++-+-+--1-iH .00 HH-+-+++.f......I -00 -OIl • FO -+-+-+--t .FB - FB • •O ! : l = 7 8 -88 -88 -88 =SO =FO ·AB ...-++-t. FB -70 -SO ...-+-+--t -OB ....-++-1- 90 ·SO 1IIII1-1-+--1 ·EO -+-+-+--t ·FO -00 L...I-L.-'-......L.....t.-L..... = 00 ............................................. -00 PATTERN PATTERN PATTERN PATTERN 74 75 76 77 '-''''"'T--r-r"''T'"'''''''r''1 _ 00 -OIl ,-,"'"'T-r""T'""T""""""'" _ 00 -00 -00 =00 -88 -88 -88 -88 -88 -88 -88 =AB -88 =D8 -+-++-1 • 70 =88 L..I-L.-L...L....L-I-L...... -00 L...I~...L.-L-...........L...I = 00 PATTERN PATTERN PATTERN PATTERN 78 79 7A 78 =00 -OIl -00 =38 =00 HH-+-+++.f......I_ 00 H-++HH+-I· OO =40 =88 --+-+"1. 88 ....-+-+"1- F8 ....-+++-+--t .20 =60 -60 -10 ~-++++-t • CO -20 -+--IH--I _ 20 -+-++-1.20 -20 -60 -20 =40 ....+-+-HH. 4O =88 -i1-1-++"1 _ 20 ...........+ + - t . F8 =38 ...,.......-++-t =00 =00 L...I~...L.-'-.......&....'--' ·00 PATTERN PATTERN PATTERN PATTERN 7C 7D 7E 7F -40 • EO -40 _-r-r.., = A8 =20 .-+-+-+--1 • 10 -AB .-++--t =50 =10 -10 =08 =20 ........-+-+--1 .18 -If-I-+--t .00 ....+H·-50 AB -10 -20 -00 .-++--t -A8 -20 ....+~H.10 H-+++-H-+-I _00 -50 -40 =AB -00 -+-+-+-+--1 - EO HI-+-+++-+-H -00 =00 L-IL....L...L.-L-...........&....I - 00 L-I..........L.-L-...........&....I - 00 A·5 APPENDIX 8 CHOOSING VRAM MEMORY When choosing the VRAM memory, the user must take into consideration the propagation delay times of the system in addition to the access time of the memory and data setup time of the VDP. After the VDP outputs a low level signal on RAS, there is a delay time (td(RAS)) for this low level to reach the VRAM memory; there is a similar delay (td(CAS)) for a signal output on the CAS pin to reach the VRAM memory. Finally, there is a delay (td(data)) for data output by the memory to reach the VDP. These delays (shown in Figure B1) depend on the length of the wires between VDP and memory, and on the capacitive load being driven. Valid data appearing on RDO-RD7 is strobed into the VDP when CAS is brought high. Therefore, the memory chosen must have fast enough access times, ta(R) and ta(C)' so that valid data is present on RDO-RD7 when a positive transition occurs on CAS. For 16-K memories from Texas Instruments (TMS4116-XX), the ti,:"~: t RL-CL an~ talC)' can vary, but their sum is equal to ta(R) (t RL-CL + talC) = t aIR ))· Thus, when tdlRASI ~ td(CAS)' the limIting access tIme IS t alR )' After the memory receives a negative transition on the RAS input, the memory access time, t aIR ), must be fast enough so that valid data is present on RDO-RD7 when CAS goes high Isee Figure B2). The equation for this is: t RL- CL + t wCL ~ t dlR ) + tdldata) + tsulD-CHI Under worst case conditions, this equation can be used to find out how much time is allowed for system delays using different memories. TABLE B-1 - WORST CASE TIMING FOR VDP. MEMORIES SYSTEM DELAYS twCL 230 ns MIN tRL-CL 40 ns MIN tsuID-CH) 60 ns MAX If the values from Table B1 are placed in the equation, we find It RL- CL + ~CL) VDP MIN ~ [ltdlRAS) + tdldata)1 SYS + t alR ) MEM +tsuD-CH VDP MAX] 210 ns - t alR ) MEM MAX ~ [tdIRAS) + tdldata)] SYS MAX TABLE B-2 - DRAM SYSTEM DELAYS PART NO. talR) SYSTEM DELAYS 4116-15 150 ns 60 ns MAX 4116-20 200 ns 10 ns MAX 4116-25 150 ns -40 ns MAX From the data given here, the VDP will work with both -15 and -20 TMS4116 dynamic RAMs provided the system delays are small enough. The VDP does not meet the t I ) specifications for the -25 TMS4116 and is unable to use the -25 under worst case condi- tions. The VDP has been verified to ;o~ with both -15 and -20 TMS4116s in a system application. Note that in addition to the equation derived above, that all memory timing requirements must be met as specified in a memory data book. 8-1 - RAS ... -. VOP -CAS ..... ...• VRAM 9918A! MEMORY 9928A/ 4116-XX 9929A ROO t.. ,. ... ~ (8 in parallel) ... ... R07 - ~ FIGURE B-1 - MEMORY CONFIGURATION SHOWING DELAY TIMES 14 twIRL) ~ VDP TIMING RAS '\ I y I I I ~ CAS tw(CL) ! ,. tRL·CL. \j I I I DATA I I I I I I qI ! I I I I I td(DATA) 14 .'-I • tsu(D·CH) I I I I I I VRAM RAS I I I TIMING I I ~ \ I I I I I I / td(RAS) ~ I I I I I I CAS I I I I I I I I I I I \ I I / I I I ~ ~ td(CAS) I I DATA I I I I I