V9938 MSX-VIDEO Technical Data Book . ASCII CORPORATION/NIPPON GAKKI CO., LTD. V9938 MSX-VIDEO Technical Data Book ASCII CORPORATION/NIPPON GAKKI CO., LTD. @YAMAHA NIPPON GAKKI CO., L TO. © 1985 ASCII CORP./NIPPON GAKKI CO., LTD. PREFACE The V9938 introduced in this manual is a Very Large-Scale Integrated Circuit (VLSI) that was developed as a Video Display Processor (VDP) for the MSX2. The MSX personal computer standard was introduced in 1983 by ASCII Corporation and Microsoft Incorporated. At present, the MSX is manufactured and marketed worldwide. In 1985, out of the desire to strengthen some of the functions of the original MSX, the MSX2 standard was developed. In addition to being software-compatible with the MSX, the MSX2 supports new media and has video processing capabilities that are not available on conventional 8-bit personal computers. To make the MSX2 a reality, two requirements for the Video Processor were upward compatiblity with the existing TMS9918A (the VDP for the MSX) software while increasing the number of functions. The V9938 was developed through the joint efforts of ASCII Corporation, Microsoft Incorporated, and YAMAHA. The following functions are supported on the V9938. - Full bit-mapped mode - 80-column text display - Access using X- and Y-coordinates. The load of the IIO driver has been lightened. The X-Y coordinates are independent of the screen mode. - Fundamental commands implemented by hardware to decrease the processing time of the IIO driver: AREA MOVE, LINE, SEARCH, RASTER OPERATION, etc. - Digitize and external synchronization - Color palette (9 bits x 16 patterns) - Linear RGB video output - More sprites per horizonatal line Because the V9938 has the above functions, it provides for superior video capabilities that make it possible for its use in a variety of applications, including the MSX2. CAPTAIN terminals and NAPLPS terminals using the V9938 have already been developed. We hope that the V9938 will be a standard video processing device on a worldwide basis. This manual was written so as to explain how to set the parameters of the V9938 and is a reference for developing applications and systems software for it. We are pleased that you have chosen to develop software for the V9938 and that you have referred to this manual for assistance. Finally, we would like to express our deep gratitude to the people at NTT as well as the other related manufacturers for their valuable opinions which contributed to the development of the V9938. August, 1985 ASCII Corporation CONTENTS PART 1 MSX-VIDEO DATA PROCESSOR V9938 USER'S MANUAL BAS IC INPUT AND OUTPUT •••••••••••••••••••••• 1 1. Accessing the Control Registers .•••.•.•......•.... ...... 1 2. Accessing the Pallete Registers ..•....•.........•. ...... 1 3. Accessing the Status Registers •••••••••••••••••••••••••• 2 4. Accessing the Video RAM ••••••••••••••••••••••••••••••••• 2 REG ISTER FUNCTION S. • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• 4 1. CONTROL REGISTERS #0 to #23 (Wri te only) 4 2. STATUS REGISTERS #0 to #9 (Read only) ••••••••••••••• 9 TEXT 1 MODE •• 11 TEXT 2 MODE •• 15 MULTICOLOR roDE ••• 20 GRAPHIC 1 MODE ••••••••••••••••• 25 GRAPHIC 2 AND GRAPHIC 3 MODES •• 30 GRAPHIC 4 MODE ••• 37 GRAPHIC 5 roDE •••••••••• 41 GRAPH IC 6 MODE ••••••• 46 GRAPH Ie 7 MODE................................................ 50 COM.MANDS ••••••••••••••••••••••••••••••••••••••• 54 1. Types of Commands •••••••••••••••••• 54 2. Page Concept ........................... ". . . . . . . . . . . . . . .. 55 3. Logical Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 4. Explanations of Commands ••••••••••••••••••••••••••••••• 57 4.1 HMMC (High- speed move CPU to VRAM) • ............... 57 4.2 YMMM (High-speed move V RAM to V RAM, y only) ••••••• 4.3 4.4 HMMM (High- speed move V RAM to VRAM) HMMV (High- speed move VDP to VRAM) •••••••••••••••• ............... 60 62 64 4.5 LMMC (Logical move CPU to VRAM) ••••••••••••••••••• 66 4.6 LMCM (Logical move V RAM to CPU) ••••••••••••••••••• 69 4.7 LMMM (Logical move V RAM to V RAM) ••••••••••••••••••72 4.8 LMMV (Logical move VDP to V RAM) ••••••••••••••••••• 74 4.9 LINE •••••••••••••••••••••••••••••••••••••••••••••• 76 4.10 SRCH •••••••••••••••••••••••••••••••••••••••••••••• 78 4.11 PSET •••••••••••••••••••••••••••••••••••••••••••••• 81 4.12 ro INT •••••••••••••••••••••.•••••••••••...•.•.•.••• 83 5. Speeding up the processing of commands ••••••••••••••••• 84 6. Conditions of registers after command execution •••••••• 85 SPRITES. • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • . • • • • • • • • • • • • • • • • • • • • • •• 86 1. SPRITE mDE 1 (Gl, G2, MC) •••••••••••.••••••••.•••••••. 87 2. SPRITE MODE 2 (G3, G4, G5, G6, G7)..................... 91 3. Setting the Sprite Colors •••••••••••••••••••••••••••••• 98 POINTING DEVICES •••••••••••••••••••••••.••••••••••••••••.••••• 99 1. Light pen •••••••••••••••••••••••••••••••••••.•••••••••• 99 2• Mo us e. • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• 1 01 SPECIAL FUNCTIONS •••••••••••••••••••••••••••••••••••••••••••• 102 1. Alternate display of two graphics screen pages •••••••• 102 2. Interlace display ••••••••••••••••••••••.•••••••••••••. 103 3. External Synchronization •••••••••••••••••••••••••••••. 104 4. Superimpose •.•••••••••••••••••••.•••••.••••••••••••••• 105 5. Digitize function •••••••••••••••••••••••••••••••••••.• 106 6. Color bus .•••••..•••••.••••••••.•...•••••••••••••••••• 109 PART 2 MSX-VIDEO DATA PROCESSOR LSI DATA SHEET 1. MSX-VIDEO •••••••••••••••••••••••••••••••••••••••••••••••• III 1-1 OVerv iew ••••••••••••••••••••••••••••••••••••••••••••• III 1-2 Features ••••••••••••••••••••••••••••••••••••••••••••• III 1-3 MSX-VIDEO Block diagram •••••••••••••••••••••••••••••• 112 1-4 MSX-VIDEO circuit example •••••••••••••••••••••••••••• 113 2. Pin assignments and functions •••••••••••••••••••••••••••• 114 3. Electrical characteristics and timing chart •••••••••••••• 116 3-1 Absol ute maximum ratings ••••••••••••••••••••••••••••• 116 3-2 Recommended operating conditions ••••••••••••••••••••• 116 3-3 Electrical characteristics under recommended operating conditions •••••••• 117 External input clock timing ••••••••••••••••••••••••••••• 117 *RESET Input timing ••••••••••••••••••••••••••••••••••••• 118 DC characteristics •••••••••••••••••••••••••••••••••••••• 118 Input/output power capacities ••••••••••••••••••••••••••• 118 External output clock timing •••••••••••••••••••••••••••• 119 CPU-MSX-VIDEO Interface •.••••••••••••••••••••••••••••••• 121 MSX-VIDEO- VRAN interf ace. . • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• 123 Composite video signal output level ••••••••••••••••••••• 126 RGB output level •••••••••••••••••••••••••••••••••••••••• 127 Synchronize signal output level ••••••••••••••••••••••••• 127 Composi te video signal ••••••••••••••.••••••••••••••••••• 128 RGB signal •••••••••••••••••••••••••••••••••••••••••••••• 128 Synchroniz e si gnal s. • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• 129 Color bus ••••••••••••••••••••••••••••••••••••••••••••••• 132 VDS ••••••••••••..••••••••.•.•••...••••••.••••••.••••.... 133 4. External measurements of package ••••••••••••••••••••••• 134 5. Version identif ication ••••••••••••••••••••••••••••••••• 134 APPENDIX 1. Refresh .••..•••••••.••••••••• 135 2. Examples of VRAM Interface •••••••••••••••••••••••••••• 137 3. Clock oscillation internal circui try. 142 4. Usage of unused pins ••••••••.••••••••••.•••••••••••• 143 5. C::i cl e mode •••••••••••••• 144 6. C::i cl e input .......................................... . 145 7. Display parameters •••.•• 146 8. Color palette ••••••••••• 148 9. Compo si te v ideo color bur st. • • • • • • • • • • • • • . • . • • • • • • • • •• 149 10. Color bus ••••••••••.••..•.•••••••••••••. 150 11. Sprites in G5 mode . . . . . . . • • • . . . . . . . . . . . . . . . . . . . . . . • . . . 151 PART 1 MSX-VIDEO DATA PROCESSOR V9938 USER'S MANUAL © 1985 ASCII CORP./NIPPON GAKKI CO., LTD. V9938 MSX-VIDEO USER'S MANUAL BASIC INPUT AND OUTPUT 1. Accessing the Control Registers There are two ways to set data in the MSX-VIDEO control registers (R#O to R#46), which we will describe below. 1.1 Direct access Output the data and the register number in sequence to port #1. Since this order is always used, be careful when you access the MSX-VIDEO for an interrupt routine. MSB 7 6 S 4 3 2 1 0 LSB Port #1 Fi rst byte ID7 ID6 IDS ID4 ID3 ID2 IDI IDO I DATA Second byte 1 0 IRS I R4 I R3 1R2 IRl IRO REGISTER # I 1.2 Indirect access Specify the register number in control register R#17 (Control Register Pointer> • First set the register number in R#17 (using direct addressing) by sending data to Port #3. When you set the data in RU7, you can also set its MSB (All, the autoincrement bit) to control autoincrementing. The data in R#17 cannot be changed by indirect addressing. If autoincrementing is prohibited, the contents of R#17 will be unchanged, and thus you do not have to reset R#17. MSB 7 6 S 4 3 2 1 o LSB Register #17 REGISTER # Port #3 First byte DATA Port #3 Second byte DATA I Port #3 nth byte DATA I 2. Accessing the Pallete Registers To set data in the MSX-VIDEO palette registers (p#O to P#lS/9 bit), you must first set the palette register number in register R#16 (Color palette address pointer) and subsequently output the two bytes of data (in order) through port #2. 1 V9938 MSX-VIOEO USER'S MANUAL MSB 7 6 5 4 3 2 1 0 LSB Regi ster U6 I 0 I 0 I 0 le3 le2 leI leo I Pallete # 0 i I Port #2 Fi rst byte 0 IR2 IRl IRO 0 IB2 IBI IBO OATA i i i I I I Red data Blue data Port #2 Second byte I 0 0 0 0 0 IG2 IGI IGO OATA ~--~--~--~--~--~~i===Ci===ri~ Green data 3. Accessing the Status Registers To read the status registers of the MSX-VIOEO (S#O to S#9), you must first set the register number in R#15 (Status register pointer) apd read the data through Port U. MSB 7 6 5 4 3 2 1 o LSB Register US I 0 I 0 I 0 I 0 IS3 IS2 ISl ISO I Status register # Port #1 Read data 107 106 105 104 103 /02 101 100 I OATA 4. Accessing the Video RAM A Video RAM of 128K bytes plus an expansion RAM of 64K bytes can be connected to the MSX-VIOEO. The memory maps for these cases are shown in the map below. Address counter IFFFFH OFFFFH Video RAM (For display) OOOOOH D Expansion RAM (For data I/O registers) Accessing memory To access memory, follow the procedure below. 1. SWitch banks (VRAM to Expansion RAM) 2. Set the address counter (A16 to Al4) 3. Set the address counter (A7 to AO) 4. Set the address counter (A13 to A8), and specify read or write 5. Read or write the data 2 V9938 MSX-VIDEO USER'S MANUAL 1. Switching banks (VRAM to Expansion RAM) Since the contents of R#45 (Argument register) do not change each time that memory is accessed, it is not necessary to respecify bit 6 of register R#45 (which specifies banking) every time that you are to do banking. MSB 7 6 5 4 3 2 1 o LSB Regi ster #45 Argument register 2. Setting the.address counter (A16-Al4) Set the high-order three bits (A16 to Al4) of the address counter using register R#14 (VRAM Access base address register). MSB 7 6 5 4 3 2 1 o LSB Register 4114 o o o o o IAl61A151Al41 VRAM ~__~__~__~__~__~__~__-L__~ Access, base address reg1ster 3. Setting the address counter (A7 to AO) Set the low-order eight bits (A7 to AO) of the address counter by outputting data to Port U. MSB 7 6 5 4 3 2 1 0 LSB Port 411 IA7 IA6 IA5 IA4 1A3 111.2 IAl lAO First byte 4. Setting the address counter (A13 to A8) and specifying read or write Set the remaining six bits (A13 to A8) of the address counter and specify read or write by outputting data to Port #1. MSB 7 6 5 4 3 2 1 0 LSB Port 411 X X IA131A121 AII IAloIA9 lAS Second byte i i 0 0: Read 0 1: write 5. Reading or writing data Since the address counter is automatically incremented when data is read from or written to Port #0, you may continually access blocks of data. * To access the VRAl-l, you can also use commands. These commands will be explained in a later chapter. * Refer to the data sheet for access timings. 3 V9938 MSX-VIDEO USER'S MANUAL REGISTER FUNCTIONS 1- CONTROL REGISTERS #0 to #23 (Write only) #32 to #46 (Write only) 1.1 Mode Registers MSB 7 6 5 4 3 2 1 0 LSB R#O 0 IDG IE2 lEI M5 M4 0 Mode Register 0 1M3 R#l 0 IBL lEO Ml M2 0 lSI IMAG Mode Register 1 R#8 MS ILP TP CB VR 0 ISPDIBW Mode Register 2 R#9 0 Sl SO LN IL EO I*NTloc Mode Register 3 I * Indicates negative logJ.c. R#O DG: Sets the color bus to input mode, and inputs data into the VRAM. IE2: Enables interrupt from Lightpen by Interrupt Enable 2. lEI: Enables interrupt from Horizontal scanning line by Interrupt Enable 1. M5 Used to change the display mode. M4 Used to change the display mode. M3 Used to change the display mode. R#l BL When 1, screen display enabled. When 0, screen disabled. lEO: Enables interrupt from Horizontal scanning line by Interrupt Enable O. Ml Used to change the display mode. M2 Used to change the display mode. SI When 1, sprite size is 16 x 16. When 0, 8 x 8. MA Sprite expansion; when 1: expanded. When 0, normal. R#8 MS When 1, sets the color bus to input mode and enables mouse. When 0, sets the color bus to output mode and disables mouse. LP When 1, enables light pen. When 0, disables light pen. TP Sets the color of code 0 to the color of the palette. CB When 1, sets the color bus to input mode. When 0, sets the color bus to output mode. VR Selects the type of Video RAM. 1 = 64K x 1 bit or 64K x 4 bits. o = 16K x 1 bit or 16K x 4 bits. SPD: When 1, disables display of sprite. When 0, displays spri teo BW: When 1, sets black and white in 32 tones. When 0, sets color (available only with a composite encoder) • R#9 LN When 1, sets the horizontal dot count to 212. When 0, sets the horizontal dot count to 192. Sl Selects simul taneous mode. SO Selects simultaneous mode. 4 V993S MSX-VIDEO USER'S MANUAL IL When 1, interlace (Complete NTSC timing) When 0, non-interlace (Incomplete NTSC timing) EO When 1, displays two graphic screens interchangably by Even field/Odd field. When 0, displays the same graphic screen by Even field/Odd field. *NT When 1, PAL <313 lines): when 0, NTSC (262 lines). (For RGB output only) DC When 1, sets *DLCLK to input mode: when 0, sets *DLCLK to output mode. 1.2 Table Base Address Registers The table base address registers are a set of registers to declare the addresses of tables in the VRAM to be used by MSX-VIDEO. Note that when these registers are accessed, the control codes that the screen may receive depends on the display mode. For this purpose, you must mask the unwanted bits. MSB 7654321 a LSB R#2 a IA161A1SIA141A131A121AIIIAIoI Pattern name table base address register R#3 IAl3lAl21AlliAlOlA9 lAS IA71A6 I Color table base address register low RUO a a 10 1 0 10 IAl61AlsIAl41 Color table base address register high R#4 a a IAl61AlsIAl41Al31Al21Alli Pattern generator table base address register R#S IAl41Al31Al21 AlI I AlO IA91AsIA71 Sprite attribute table base address register low R#ll a a I a I a I a I a IAl61AlsI Sprite attribute table base address register high R#6 a a IAl61AlsIAl41Al31Al21Alli Sprite pattern generator table base address register 1.3 Color Registers The color registers are used to control the MSX-VIDEO's text and background screen colors as well as blinking, etc. MSB 7 6 5 4 3 2 1 a LSB R#7 ITC 3 1TC21 TCII TCol BD3 1BD21BD11 BDO I Text color/Back drop color register TC3 to TCO: Specifies the text color according to TEXT 1 and TEXT 2 modes. BD3 to BDO: Specifies the back drop color in all display modes. 5 V9938 MSX-VIDEO USER'S MANUAL MSB 7 6 5 4 3 2 1 o LSB R#12 IT23lT22lT21lT20lBc3lBC21BCIIBCoI Text color/Back color register In TEXT 2 mode, if the attributes for blinking are set, the color set in this register and set in R#7 are displayed alternately. T23 to T20 : Specif ies the color of part 1 of the pattern. BC3 to BCO: Specif ies the color of part 0 of the pattern. MSB 7 6 5 4 3 2 1 0 LSB RU3 ION310N210NIIONOIOF31OF21OFIIOFOI Blinking period register In the bit map modes of GRAPH4 to GRAPH7, the two pages are alternately displayed (bl inked) . Place data in this register to set the display page to an odd page to begin blinking. This register is also used in the TEXT2 mode. ON3 to ONO: Display time for even page OF3 to OFO: Display time for odd page MSB 7 6 5 4 3 2 1 0 LSB R#2O 0 0 0 0 0 0 0 0 Color burst register 1 R#21 0 0 1 1 1 0 1 1 Color burst register 2 R#22 0 0 0 0 0 1 0 1 Color burst register 3 The above values are preset when the power is applied. If all values in the above three registers are set to 0, the color burst signal of the composite video output will be erased. If the above values are subsequently reset to the preset values, the normal color burst signal will be output. 1.4 Display Registers The display registers are used to control the display position on the CRT. MSB 7 6 5 4 3 2 1 o LSB RU8 IV3 1V2 IVI Iva 1H3 IH2 IHI IHO I Display adjust register The above register is used to adjust the display position on the CRT. H= 7 ( Left) ...H 1, H = 0, H = 15 . . H= 8 (Center) (Right) V = 8 . .V 15, V = 0, V 1 . V=7 (Bottom) (Center) (TOp) 6 V9938 MSX-VIDEO USER'S MANUAL MSB 7 6 5 4 3 2 1 0 LSB R#23 ID07ID06ID05ID04ID03/D02IDOIIDOol Display offset register The above register sets the location of the line to begin display. VRAM (Line) TOP 0 CRT Screen BOTTOM 192 or 212 R#23 0 255 0 CRT Screen BOTTOM 136 or 156 R#23 200 TOP 200 CRT Screen 255 MSB 7 6 5 4 3 2 1 0 LSB R#19 IIL71IL61IL51IL41IL31IL21ILIIILOI Interrupt line register You may specify interrupts when the MSX-VIDEO begins to display a specified scanning line. To enable the interrupt, use the above register to set the scanning line. 1.5 ACCESS REGISTERS The access registers are a set of registers used when accessing the MSX-VIDEO registers or the VRAM. MSB 7 6 5 4 3 2 1 o LSB R#l4 ~ o o o o o IAl61A151Al41 __~__~__~__~__~__- L__~__~ VRA~ Access base address reg~ster When accessing the MSX-VIDEO and the Video RAM (VRAM), set the high- order three bits of the address in the VRAH access base address register. When data is set in this register, and the VRAM is accessed, if there is a carry from Al3, the data in the register is automatically incremented. In GRAPHICl, GRAPHIC2, MULTICOLOR, and TEXTI modes, the data in the register is not automatically incremented. R#15 I 0 I 0 I 0 I 0 IS3 IS2 lSI Iso I Status register pointer When reading the MSX-VIDEO status registers (S#O to S#9), set the contents of the Status register pointer. 7 V9938 MSX-VIDEO USER'S MANUAL MSB 7 6 5 4 3 2 I a LSB RU6 a a a a IC3 IC2 ICI Ico I Col~r palette address regl.ster When setting the color palette of the MSX-VIDEO, set the number of the palette in the Color palette address register. MSB 7 6 5 4 3 2 I a LSB RU7 IAIllo IRSsIRS41RS31RS21RSIIRSoI Control register pointer In the MSX-VIDEO, the above control register pointer may be used to access another register. In addition, according to the setting of the All bit, the data can be automatically incremented. All 1: Auto increment disabled All = 0: Auto increment enabled 1.6 COMMAND REGISTERS The following command registers are used when executing a command on the MSX-VIDEO. Details on the use of these command registers will be presented in a later chapter. MSB 7 6 5 4 3 2 1 a LSB R#32 SX7 SX6 SXS SX4 SX3 SX2 SXl sxOI Source X low register R#33 a a a a a a a SX81 Source X high register R#34 SY7 SY6 SYS SY4 SY3 SY2 SYl Source Y low register R#3S a a a a a a SY9 Sysl Source Y high register R#36 DX7 DX6 DXS DX4 DX3 DX2 DXl DXOI Destination X low register R#37 o a a a o a a DX81 Destination X high register R#38 DY7 DY6 DYS DY4 DY3 DY2 DYl Destination Y low register R#39 a a a o a a DY9 Destination Y high register R#40 NX71NX6 NxsINX4 NX3 NX2 NXl NXO Number of dots X low register R#41 a I 0 a Ia a a a NX8 Number of dots X high register R#42 NY7\NY6 NYSINY4 NY3 NY2 NYl NYO Number of dots Y low register R#43 o I a a Ia a a NY9 NY8 Number of dots Y high register R#44 ICH31cH21CHlicHOlcL31cL21CLliCLOI Color register R#4S I a IMXclMXDIMXSIDIylDIXIEQ IMAJI Argument register R#46 ICM31CM21cMlicMOIL031L021LOlILOoI Command register 8 V9938 MSX-VIDEO USER'S MANUAL 2. STATUS REGISTERS #0 to #9 (Read only) The following status registers are read-only registers for reporting the status when the MSX-VIDEO is read. MSB 7 6 5 4 3 2 1 0 LSB S#O F Iss C IFif~h S~ri t~ n~ber I Status register 0 I F: Vertical scanning interrupt flag When S#O is read, this flag is reset. 5S: Flag for the fifth sprite Five sprites are aligned on the first horizontal line (In the G3 to G7 modes, 9 sprites are allowed) C: Collision flag Two sprites have collided. Fifth sprite number: The number of the fifth (or ninth) sprite. MSB 7 6 5 4 3 2 1 o LSB S#l IFL ILPsl Id~nti~ica~ion:# IFH Status register 1 FL: Lightpen flag (Lightpen flag set) If the lightpen is to detect light, this bit as well as the IE2 bit must be both set in order for an interrupt to be enabled. When S#l is read, FL is reset. Mouse switch 2 (Mouse flag set) The second switch on the mouse was pressed. In this case, when S#l is read, FL is not reset. LPS: Lightpen switch (Lightpen flag set) The lightpen switch was pressed. In this case, when S#l is read, LPS is not reset. Mouse switch 1 (Mouse flag set) The first switch on the mouse was pressed. In this case, when S#l is read, LPS is not reset. Identification number: The identification number (ID #) of the MSX-VIDEO. FH: Horizontal scanning interrupt flag Horizontal scanning interrupt (which is specified in R#19) flag. If lEI is set, an interrupt is enabled. When S#l is read, FH is reset. MSB 7 6 5 4 3 2 1 o LSB S#2 ~IT_R~I_V_R~I_H_R~IB_D~I~l~__l~IE_O__I~C_E~I Status register 2 TR: Transfer ready flag When the CPU sends commands to the VRAM and other devices, the CPU checks this flag while transferring data. When this flag is set to l, transfer may be done. 9 V9938 M8X-VIDEO U8ER'8 MANUAL VR: Vertical scanning line timing flag During vertical scanning, this flag is set to 1. HR: Horizontal scanning line timing flag During horizontal scanning, this flag is set to 1. BD: Boundary color detect flag When the search command is executed, this flag detects whether the boundary color was detected or not. EO: Display field flag When 0, indicates the first field. When 1, indicates the second field. CE: Command execution flag Indicates that a command is being executed. M8B 7 6 S 4 3 2 1 0 LSB 8#3 X7 IX6 Ixs IX4 X3 X2 Xl Ixo Col umn register low 8#4 1 I 1 I 1 I I I 1 I IX8 Col umn register high 8#5 Y7 IY6 lyS IY4 Y3 Y2 Yl lyO Row register low 8#6 1 1 1 1 I 1 EO Iys Row register high I I I The above registers are set to indicate the collision location of spri tes, the location of lightpen detection, and the relative movement of the mouse. 8#7 IC7 IC6 Ics I C4 I C3 IC2 ICl Ico I Color register The above color register is used when the POINT and VRAH to CPU commands are executed. The VRMI data is set in this register. 8#8 IBX71BX61BxslBX41BX31BX21BXIIBxoi Border X register low 8#9 I 1 I 1 I 1 I 1 I 1 I I I I IBX8 1 Border X register high When the search command is executed and the border color has been detected, the X coordinate is set in the above registers. 10 V9938 MSX-VIDEO USER'S MANUAL TEXT 1 NODE Character istics - Pattern size 6 dots (w) x 8 dots (h) - Patterns 256 types - Screen pattern count 40 (w) x 24 (h) patterns - Pattern colors Two colors out of 512 colors (per screen) - VRAJI'I area per screen 4K bytes Controls - Pattern font VRAJI'l pattern generator table - Screen pattern location VRAN pattern name table - Pattern color code 1 High-order four bits of R#7 - Pattern color code 0 Low-order four bits of R#7 - Background color code Low-order four bits of R#7 Ini tial Settings 1. Mode and Register Settings NSB 7 6 5 4 3 2 1 0 LSB R#O 0 DG IIE2 lEI 1 0* 0*1 0* I 0 Mode register 0 R#l 0 BL IIEO 1*1 0* 0 lSI IMAG Mode register 1 R#8 ~1S LP ITP CB IVR 0 I SPD IBW Mode register 2 R#9 LN 0 lSI SO IlL EO ~*NT IDC Mode register 3 * Examples of sett1ngs in TEXT 1 mode ** Indicates negative logic All other bits are set accordingly 11 V9938 MSX-VIDEO USER'S MANUAL 2. Pattern Generator Table Settings - The pattern generator table is an area that stores the pattern fonts. - Each pattern has a number from PNO to PN255. - The font for each pattern is constructed from 8 bytes, and the lower two bits of each of the eight bytes is not displayed. - Set the beginning (head) address of the pattern generator table in register R#4. MSB 7 6 5 4 3 2 1 o LSB RH o o IAl61A151Al41Al31Al21Alli Pattern generato: table base address reglster Pattern generator table (X=l, 0=0) These bits are not displayed. II MSB 76543210 LSB o OOXOOOOO 1 OXOXOOOO 2 XOOOXOOO 3 XOOOXOOO Pattern number 0 4 XXXXXOOO 5 XOOOXOOO 6 XOOOXOOO 7 00000000 ----~ 8 XXXXOOOO ----~ 9 XOOOXOOO 10 XOOOXOOO 11 XXXXOOOO Pattern number 1 12 XOOOXOOO 13 XOOOXOOO 14 XXXXOOOO 15 00000000 ----~ 2040 XOXOXOOO ----~ 2041 OXOXOXOO 2042 XOXOXOOO 2043 OXOXOXOO Pattern number 255 2044 XOXOXOOO 2045 OXOXOXOO 2046 XOXOXOOO 2047 OXOXOXOO 12 V9938 MSX-VIDEO USER'S MANUAL 3. Pattern name table settings - The pattern name table is composed of one byte for each screen pattern. Each byte specifies a unique pattern. Set the beginning (head) address of the pattern name table in register R#2. MSB 7 6 5 4 3 2 1 o LSB R#2 Pattern name table base address register Pattern name table Base address ( 0, 0) o o 1 2 3 39 X 'H ( 1, 0) 1 o 0 1 2 3 ( 2, 0) 2 1 40 41 42 43 • 79 (39, 0) ( 0, 1) 39 40 22 23 y 880 920 881 921 Screen display correspondence ·m . 959 ~ 959 13 V9938 MSX-VIDEO USER'S MANUAL 4. Color register settings MSB 7 6 5 4 3 2 1 o LSB R#7 Text color/Back drop color register ~--~--~--~ Specifies pattern color code 0 or back drop coler Specifies pattern color code 1 Example of VRMI allocation in TEXT 1 mode OOOOOH f>1SB 7 6 5 4 3 2 1 0 LSB Pattern Name R#2 0 0 0 0 0 0 0 a Table 0 A16 A1S Al4 Al3 Al2 All AlO 003COH 00800H f..1SB 7 6 5 4 3 2 1 0 LSB Pattern Generator R#4 0 0 0 0 0 0 0 1 Table 0 A16 A15 Al4 Al3 Al2 All OlOOOH MSB 7 6 5 4 3 2 1 0 LSB Pattern Name R#2 0 0 0 0 0 1 0 0 Table 1 A16 AIS Al4 Al3 Al2 All Ala 013COH 01800H MSB 7 6 5 4 3 2 1 o LSB Pattern Generator R#4 a a o o o o 1 1 Table 1 A16 A1S Al4 Al3 Al2 All 02000H A maximum of 32 pages may be allocated in the same manner (using a 128K-byte VRAM). IFFFFH 14 V9938 MSX-VIDEO USER'S MANUAL TEXT 2 MODE Characteristics - Pattern size 6 dots (w) x 8 dots (h) - Patterns 256 types - Screen pattern count 80 (w) x 24 (h) patterns 80 (w) x 26.5 (h) patterns - Pattern blinking Possible for each character - Pattern colors Two colors out of 512 colors (per screen), four if using blinking - VRAr.1 area per screen 8K bytes Controls - Pattern font VRAM pattern generator table - Screen pattern location VRAM pattern name table - Blink attributes VRAM color table - Pattern color code 1 High-order four bits of R#7 - Pattern color code a Low-order four bits .of R#7 - Background color code Low-order four bits of R#7 - Pattern color code 1 High-order four bits of R#12 (Used for blinking) - Pattern color code a Low-order four bits of R#12 (Used for blinking) Initial Settings l. Mode and Register Settings l-1SB 7 6 5 4 3 2 1 a LSB R:fl:O a IDG IE2 IEll 0* 1*1 0*1 a Mode register a R:fl:l a IBL lEO 1*1 0* 0 lSI IMAG Mode register 1 R:fl:8 Ir.1S ILP TP CB IVR a ~PD IBW 110de register 2 R:fl:9 ILN I 0 Sl SO IlL EO ~*NTIDC Hode register 3 * Examples of settings in TEXT 2 mode ** Indicates negative logic In this display mode, if LN is set to 1, 26.5 lines are selected, and if LN is set to 0, 24 lines are selected. All other bits are set accordingly 2. Pattern Generator Table Settings - The pattern generator table is an area that stores the pattern fonts. - Each pattern has a number from PNO to PN255. - Set the beginning (head) address of the pattern generator table in register R#4. MSB 7 6 5 4 3 2 1 a LSB R#4 a Pattern generator table base address register 15 V9938 MSX-VIDEO USER'S MANUAL - The font for each pattern is constructed from 8 bytes, and the lower two bits of each of the eight bytes is not displayed. Pattern generator table (X=l, 0=0) These bits are not displayed. " r.ISB 76543210 LSB o OOXOOOOO 1 OXOXOOOO 2 XOOOXOOO 3 XOOOXOOO Pattern number 0 4 XXXXXOOO 5 XOOOXOOO 6 XOOOXOOO 7 00000000 8 XXXXOOOO 9 XOOOXOOO 10 XOOOXOOO 11 XXXXOOOO Pattern number 1 12 XOOOXOOO 13 XOOOXOOO 14 XXXXOOOO 15 00000000 2040 XOXOXOOO 2041 OXOXOXOO 2042 XOXOXOOO 2043 OXOXOXOO Pattern number 255 2044 XOXOXOOO 2045 OXOXOXOO 2046 XOXOXOOO 2047 OXOXOXOO 3. Pattern name table settings - The pattern name table is composed of one byte for each screen pattern. Each byte specifies a unique pattern. - If LN is set to 0, the screen display pattern is 80 (w) x 24 (h); and if LN is set to 1, the screen display pattern is 80 (w) x 26.5 (h). The upper half of the 27th pattern (h) is displayed. - Set the beginning (head) address of the pattern name table in register R#2. MSB 7 6 5 4 3 2 1 o LSB R#2 1 Pattern name table base address register 16 V9938 MSX-VIDEO USER'S MANUAL Pattern name table Base address ( 0, 0) o o 1 2 3 79 X ( 1, 0) 1 o 0 1 2 3 .r?!] ( 2, 0) 2 1 80 81 82 83 .~ (79, 0) 79 25 2000 2001 ·M ( 0, 1) 80 26 y 2080 2081 ·E Screen display correspondence (79,26) 2159 4. Color table settings - In TEXT 2 mode, each pattern has a separate bit for the attribute area, and if this bit is set to 1, the pattern blink attribute will be set. - Set the beginning (head) address of the color table in registers R#3 and RHO. MSB 7 6 5 4 3 2 1 o LSB R#3 IAl31Al21AlliAlOIA9 1 1 1 I Color table ~~==~~~~~~~~~ RHO ~1_0__1~0__1~0~1~0~1~0~I~Al__6~I_A_l_5~I~Al__4~1 base address registers COLOR TABLE MSB 7 6 5 4 3 2 1 o LSB o ( 0, 0) ( 1, 0) ( 2, 0) ( 3, 0) ( 4, 0) ( 5, 0) ( 6, 0) ( 7, 0) Base address 1 ( 8, 0) ( 9, 0) (10, 0) (ll , 0) (12, 0) (13, 0) (14, 0) (15, 0) 17 V9938 MSX-VIDEO USER'S MANUAL 5. Color register settings - Set the color for pattern 1 in the high-order bits of register R#7. - Set the color for pattern 0 in the low-order bits of register R#7. MSB 7 6 5 4 3 2 1 o LSB R#7 Text color/Back drop color register - Set the blink attribute for the corresponding pattern by setting an alternate color code in register R#12. The pattern will be blinked by using the color codes set in registers R#7 and R#12. MSB 7 6 5 4 3 2 1 0 LSB R#12 'T231T22 'T21 1T20 IBC3' BC2' Bel' BCO I Text color/Back color register 6. Blink register settings - The color codes set in registers R#7 and R#12 will be alternately displayed for b1inking~ however, the blinking period attribute (time on and time off) can also be set in register R#13. R #12 R #7 R #12 I~ On time ~I~ Off time ~I MSB 7 6 5 4 3 2 1 0 LSB R#13 ION310N210N110NOIOF31oF21oF110FOI Blinking period register I I I I ON time OFF time - The data for the ON and OFF times are shown below. (NTSC) DATA (Binary) TIME (ms) 0 0 0 0 0 0 0 0 1 166.9 0 0 1 0 333.8 0 0 1 1 500.6 0 1 0 0 667.5 0 1 0 1 834.4 0 1 1 0 1001.3 0 1 1 1 1168.2 1 0 0 0 1335.1 1 0 0 1 1501.9 1 0 1 0 1668.8 1 0 1 1 1835.7 1 1 0 0 2002.6 1 1 0 1 2169.5 1 1 1 0 2336.3 1 1 1 1 2503.2 18 V9938 MSX-VIDEO USER'S MANUAL Example of VRAM allocation in TEXT 2 mode Pattern name table base address OOOOOH HSB 7 6 5 4 3 2 1 0 LSB Pattern Name R#2 0 0 0 0 0 0 1 1 Table 0 00870H Al6 AlS Al4 Al3 Al2 OOAOOH Color Table 0 - Color table base address OOBOEH OlOOOH MSB 7 6 5 4 3 2 1 0 LSB Pattern Grnerator R#3 0 0 1 0 1 1 1 1 Table 0 01800H Al3 Al2 All AlO A9 R#lO 0 0 0 0 0 0 0 0 02000H Al6 AlS Al4 Pattern Name Table 1 Pattern generator table base address 02870H 02AOOH -Color Table 1 - MSB 7 6 5 4 3 2 1 0 LSB 02BOEH R#4 0 0 0 0 0 0 1 0 03000H Pattern A16 Al 5 Al 4 Al3 Al2 All Generator Tabl e 0 03800H 04000H A maximum of 16 pages may be allocated in the same manner (using a 128K-byte VRA}l). IFFFFH 19 V9938 MSX-VIDEO USER'S MANUAL MULTlCOLOR MODE Characteristics - Screen composition 64 (w) x 48 (h) color blocks - Color blocks Sixteen colors out of 512 colors - Spr i te mode Spri te mode 1 - VRAM area per screen 4K bytes Controls - Color block color code VRAN pattern generator table - Color block location VRAM pattern name table - Background color code Low-order four bits of R#7 - Sprites VRAl'1 sprite attribute table VRAM sprite pattern table Initial Settings l. Mode and Register Settings MSB 7 6 5 4 3 2 1 0 LSB R#O 0 IDG IE21 IEll 0* 0*1 0*1 0 Mode register 0 R#l 0 IBL IEol 0*1 1* 0 lSI IMAG Mode register 1 R#8 IHS ILP TP ICB IVR 0 I SPD IBW Mode register 2 R#9 ILN I 0 Sl Iso IlL EO ~*NTIDC Mode register 3 * Examples of settings the di spl ay mode to the MULTI COLOR mode ** Indicates negative logic 2. Pattern Generator Table Settings - The pattern generator table is an area that stores the colors of the color blocks. - Each pattern is made up of four color blocks. These patterns are approximately 8 x 8 when the dots available for the screen display area is 256 x 192 dots. ~ 8 dots --- A B I 8 dots For each block A, B, C, and D, sixteen colors may be specif ied. C D I 20 V9938 MSX-VIDEO USER'S MANUAL - In the MULTICOLOR mode, two bytes are used for each pattern, and each pattern includes four color blocks. MSB 7 6 5 4 3 2 1 0 LSB C~lor : COd~ A C~lor :COd~ B C~lor : COd~ C C~lor :COd~ D - In the MULTICOLOR mode, for each pattern name, there are four corresponding color blocks, and according to the y-coordinate, the pattern names are automatically set. MSB 7 6 5 4 3 2 1 o LSB Color code A Color code B Pattern when r tHE Y=O, 4, 8, 12, 16, Color code C Color code D or 20 is selected name tHE Pattern liN Color code E Color code G Color code Color code H F Pattern when Y=l, 5, 9, 13, 17, or 21 is selected [2lD Color code I Color code J Pattern when Y=2, 6, 10, 14, 18, ~ Color code K Color code L or 22 is selected ~ Color code M Color code N Pattern when Y=3, 7, 11, 15, 19, ~ Color code 0 Color code P or 23 is selected Set the beginning (head) address of the pattern generator table in register RH. MSB 7 6 5 4 3 210 LSB R#4 o Pattern generator table base address register Pattern generator table o Base address Pattern name #0 (Eight bytes) 8 Pattern name #1 (Eight bytes) 16 2040 Pattern name #255 (Eight bytes) 2048 21 V9938 MSX-VIDEO USER'S MANUAL 3. Pattern name table settings - The pattern name table is composed of one byte for each screen pattern. Each byte specifies a unique pattern number. Pattern name table o 1 2 3 31 X o 1 32 0 33 1 34 2 35 3 °H • 63 22 23 704 736 705 737 o§ • 767 y - Set the beginning (head) address of the pattern name table in register R#2. MSB 7 6 5 4 3 2 1 0 LSB R#2 0 IAl6IA15IAl4IAl3IAl2I All IAl 0 I Pattern name table base address register Pattern name table Base address ( 0, 0) o ( 1, 0) 1 ( 2, 0) 2 (31, 0) 31 ( 0, 1) 32 (31,23) 767 22 V9938 MSX-VIDEO USER'S MANUAL 4. Color register settings LSB R#7 Text color/Back drop color register Specifies backdrop color Ignored 5. Sprite settings - Set the beginning (head) address of the sprite attribute table in registers R#5 and R#ll; and set the beginning (head) address of the sprite pattern generator table in register R#6. For details about sprites, see the section on SPRITE MODE 1. MSB 7 6 5 4 3 2 1 o LSB R#5 IAl41Al31Al21AlliAlO IA9 IA8 IA7 I Sprite attribute table R#ll I 0 I 0 I 0 I 0 I 0 I 0 IAl61A15 I base address register R#6 I I 0 0 1Al61 A151 Al 41 Al31 Al21 All I Sprite pattern generator table base address register 23 V9938 MSX-VIDEO USER'S MANUAL Example of VRMI allocation in MULTICOLOR mode OOOOOH Sprite Generator Table (1024 bytes) 00400H Pattern Name 00700H Table Sprite (768 ............... attribute bytes) table 00700H (128 bytes) 00780H 00800H 00800H Pattern OOCOOH Generator Table (2048 bytes) OlOOOH A maximum of 32 pages may be allocated in the same manner (using a l28K-byte VRAl>l). lFFFFH 24 V9938 MSX-VIDEO USER'S MANUAL GRAPHIC 1 MODE Characteristics - Pattern size 8 dots (w) x 8 dots (h) - Patterns 256 types - Screen pattern count 32 (w) x 24 (h) patterns - Pattern colors 16 colors out of 512 colors (per screen) - Spr i te mode Sprite mode 1 - VRAM area per screen 4K bytes Controls - Pattern font : VRAM pattern generator table - Screen pattern location : VRA~I pattern name table - Pattern color codes 1 & o : Can be specified as a group for each 8-pattern set, in the VRAM color table - Background color code Low-order four bits of R#7 - Sprites VRAM sprite attribute table, VRAM sprite pattern table Ini tial Settings 1. Mode and Register Settings MSB 7 6 5 4 3 2 1 0 LSB R#O I 0 DG 1IE21 IEll 0* 0*1 0*1 0 Mode register 0 R#l I0 BL 1lEO 1 0*1 0* 0 1SI 1fi'.AG Mode register 1 R#8 IMS LP ITP ICB IVR 0 ISPDIBW Mode register 2 R#9 ILN 0 lSI I SO IlL EO :*NTIDC Hode register 3 * Examples of settings in GRAPH IC 1 mode ** Indicates negative logic 25 V9938 MSX-VIDEO USER'S MANUAL 2. Pattern Generator Table Settings - The pattern generator table is an area that stores the pattern fonts. - Each pattern has a number from PNO to PN255. - The font for each pattern is constructed from 8 bytes. - Set the beginning (head) address of the pattern generator table in register R#4. MSB 7 6 5 4 3 2 1 o loSB R#4 o Pattern generator table base address register Pattern generator table (X=l, 0=0) MSB 76543210 LSB 0 OOXXXOOO Base address 1 OXOOOXOO 2 XOOOOOXO 3 XOOOOOXO Pattern number 0 4 XXXXXXXO 5 XOOOOOXO 6 XOOOOOXO 7 00000000 8 XXXXXXOO 9 XOOOOOXO 10 XOOOOOXO 11 XXXXXXOO Pattern number 1 12 XOOOOOXO 13 XOOOOOXO 14 XXXXXXOO 15 00000000 2040 XOXOXOXO 2041 OXOXOXOX 2042 XOXOXOXO 2043 OXOXOXOX Pattern number 255 2044 XOXOXOXO 2045 OXOXOXOX 2046 XOXOXOXO 2047 OXOXOXOX 26 V9938 MSX-VIDEO USER'S MANUAL 3. Pattern name table settings - The pattern name table is composed of one byte for each screen pattern. Each byte specifies a unique pattern. Set the beginning (head) address of the pattern name table in register R#2. MSB 7 6 5 4 3 2 1 o LSB R#2 Pattern name table base address register Pattern name table Base address ( 0, 0) o o 1 2 3 31 X 1, 0) o 0 1 2 3 "H ( 1 ( 2, 0) 2 1 32 33 34 35 · 63 · "±~ 22 704 705 (31, 0) 31 23 736 737 • 767 ( 0, 1) 32 y Screen display correspondence (31,23) 767 (byte) 4. Color register settings MSB 7 6 5 4 3 2 1 o LSB R#7 Text color/Back drop color register Specifies backdrop color code Ignored 5. Color table settings - The colors for pattern color 1 and pattern color 0 are set in groups of eight patterns. - Set the beginning (head) address of the color table in registers R#3 and RUO. 27 V9938 MSX-VIDEO USER'S MANUAL MSB 7 6 S 4 3 2 1 0 LSB R#3 IA131A121 AII IAIOIA9 IA8 IA7 1A6 I Color table base address RUO I 0 I 0 I 0 I 0 I 0 IAl61AlSIAl41 register Color table Color code for part 1 MSB 7 I I 6 S 4 3 2 1 o Color code for part 0 LSB Base address o FC3 FC2 FCI FCO BC3 BC2 BCl BCO Pattern Nos. 0 to 7 1 FC3 FC2 FCI FCO BC3 BC2 BCl BCO Pattern Nos. 8 to IS . .. .. .... . 31 IFC3iFC 2 1FC I IFcolBC3jBC2jBCIIB CO I Pattern Nos. 248 to 2SS 6. Sprite settings - Set the beginning (head) address of the sprite attribute table in registers R#S and R#ll: and set the beginning (head) address of the sprite pattern generator table in register R#6. For details on sprites, see the section on SPRITE MODE 1. MSB 7 6 S 4 3 2 1 o LSB R#5 IAl 41 Al31 Al21 All I Al I A9 I A8 I A7 I Sprite attribute table 0 R#ll I I I I I I IAl61AlSI base address register 0 0 0 0 0 0 R#6 o I 0 IA161AlSJA141A131A121Alli Sprite pattern generator table base address register 28 V9938 MSX-VIDEO USER'S MANUAL Example of VRAM allocation in GRAPHIC 1 mode OOOOOH Sprite Generator Table Cl024 bytes) 00400H Pattern Name 00700H Table Spri te (768 attribute bytes) table 00700H Cl28 bytes) 007 SOH 00800H .. .. Color table (32 bytes) 007AOH .. .. 00800H Pattern OOCOOH Generator Table (2048 bytes) OlOOOH A maximum of 32 pages may be allocated in the same manner (using a 128K-byte V~l). IFFFFH I 29 V9938 MSX-VIDEO USER'S MANUAL GRAPHIC 2 AND GRAPHIC 3 MODES Characteristics - Pattern size 8 dots (w) x 8 dots (h) - Patterns 768 types - Screen pattern count 32 (w) x 24 (h) patterns - Pattern colors 16 colors out of 512 colors (per screen) - Spr i te mode s Sprite mode 1 (GRAPHIC 2) Sprite mode 2 (GRAPHIC 3) - VRAM area per screen 16K bytes * The GRAPHIC 2 and GRAPHIC 3 modes are identical except for the sprite modes. Controls - Pattern font : VRAM pattern generator table - Screen pattern location : VRAM pattern name table - Pattern color codes 1 & a : Can be specified as a group for each raster, in the VRAM color table - Background color code Low-order four bits of R#7 - Sprites VRAM sprite attribute table, VRAM sprite pattern table Initial Settings 1. Mode and Register Settings MSB 7 6 5 4 3 2 1 a LSB R#O a IDG IIE21 IEll 0*1 %* I %* I a Mode register a I I 0, 1 for GRAPHIC 2 mode 1, a for GRAPHIC 3 mode R#l 0 IBL IIEOI 0*1 0*1 a lSI I MAG I Mode register 1 R#8 IMS ILP ITP ICB IVR I a I SPDIBW I Mode register 2 R#9 ILN I a lSI Iso IIL lEO ~*NTIDC I f.1ode register 3 * Examples of settings in GRAPHIC 2 mode or GRAPH IC 3 mode ** Indicates negative logic All other bits are set accordingly. 30 V9938 MSX-VIDEO USER'S MANUAL 2. Pattern Generator Table Settings - The pattern generator table is an area that stores the pattern fonts. - Each pattern group has a number from PNO to PN255; and since each group may have three members, 768 patterns may be specified. - The font for each pattern is constructed from 8 bytes. - Set the beginning (head) address of the pattern generator table in register R#4. MSB 7 6 5 4 3 2 1 o LSB R#4 o 1 Pattern generator table base address register 3. Color table settings - The colors for pattern color 1 and pattern color 0 are set as a group of one raster. - The color table corresponds to the pattern generator table on a one- to-one basis. - Set the beginning (head) address of the color table in registers R#3 and RHO. MSB 7 6 5 4 3 2 1 0 LSB R#3 IAl31 1 1 1 1 I I I I Color table base address 1 1 1 RHO I I0 0 0 0 0 IAl61 Al 51 Al 41 register 4. Color register settings ~lSB 7 6 5 4 3 2 1 o LSB R#7 Text color/Back drop color register Specifies backdrop color code Ignored 31 V9938 MSX-VIDEO USER'S MANUAL Pattern generator table (X=l, 0=0) MSB 76543210 LSB MSB 76543210 LSB 0 OOXXXOOO 00000000 1 OXOOOXOO 00000000 2 XOOOOOXO 00000000 Pattern number 0 3 XOOOOOXO 00000000 4 XXXXXXXO 00000000 5 XOOOOOXO 00000000 6 XOOOOOXO 00000000 7 00000000 00000000 8 XXXXXXOO 00000000 9 XOOOOOXO 00000000 10 XOOOOOXO 00000000 Pattern number 1 11 XXXXXXOO 00000000 12 XOOOOOXO 00000000 13 XOOOOOXO 00000000 14 XXXXXXOO 00000000 15 00000000 00000000 .----2040 XOXOXOXO 00000000 2041 OXOXOXOX 00000000 2042 XOXOXOXO 00000000 Pattern number 255 2043 OXOXOXOX 00000000 2044 XOXOXOXO 00000000 2045 OXOXOXOX 00000000 2046 XOXOXOXO 00000000 ~---2047 OXOXOXOX 00000000 Color pattern 1 -~I--III I Color pattern 0 Pattern generator Color table table o Base address 256 patterns 256 colors for upper for upper third of third of screen screen ........ (2048 bytes) (2048 bytes) --. Upper 2048 Third 256 patterns 256 colors for middle for middle Middle third of third of Third screen screen (2048 bytes) (2048 bytes) Lower 4096 Third 256 patterns 256 colors for lower for lower ...... third of third of Display screen screen screen (2048 bytes) (2048 bytes) 6144 32 V9938 MSX-VIDEO USER'S MANUAL 3. Pattern name table settings - The pattern name table is composed of one byte for each screen pattern. Each byte specifies a unique pattern. - The upper, middle, and lower parts of the screen can be used as three different parts, for a total of 768 patterns. Pattern name table ( 0, 0) Pattern display area for upper (31, 0) third of screen (256 bytes) ( 0, 7) (31, 7) ( 0, 8) Pattern display area for middle (31, 8) third of screen (256 bytes) ( 0,15) (31,15) ( 0,16 ) Pattern display area for lower (31,16) third of screen (256 bytes) ( 0,23) (31,23) Set the beginning (head) address of the pattern name table in register R#2. MSB 7 6 5 4 3 210 LSB R#2 o IA161A151A141A131A121AIIIAIOI Pattern name table base address register Pattern name table 33 V9938 MSX-VIDEO USER'S MANUAL 4. Sprite settings - Set the beginning (head) address of the sprite attribute table in registers R#S and R#ll; and set the beginning (head) address of the sprite pattern generator table in register R#6. For details about sprites pertaining to GRAPHIC 2 mode, see the section on SPRITE MODE 1, and for details about sprites pertaining to GRAPHIC 3 mode, see the section on SPRITE MODE 2. MSB 7 6 5 4 3 2 1 0 LSB R#S IAl41Al31Al21AlliAlOI A91 A81 A71 Sprite attribute table R#ll I 0 I 0 I 0 I 0 I 0 I 0 IAl61A1SI base address register R#6 o o IAl61A1SIAl41Al31Al21Alli Sprite pattern generator table base address register 34 V9938 MSX-VIDEO USER'S MANUAL Example of VRMI allocation in GRAPHIC 2 mode OOOOOH Pattern Generator Table Upper D0800H Pattern Generator Table Middle OlOOOH 01800H Pattern Spri te Generator generator Table .. table Lower 01800H OlCOOH 02000H Sprite Color attribute Table table Upper OlC80H 02800H Color Table Middle 02000H 03000H Color Table Lower 03800H Pattern Name Table 03BOOH 04000H A maximum of 8 pages may be allocated in the same manner (using a 128K-byte VRAr-J). lFFFFH 35 V9938 MSX-VIDEO USER'S MANUAL Example of VRAM. allocation in GRAPH IC 3 mode OOOOOH Pattern Generator Table Upper 00800H Pattern Generator Table Middle OlOOOH 01800H Pattern Sprite Generator generator Table table Lower .. 01800H OICOOR 02000H Spri te Color .. color Table table Upper OIEOOH 02800H Sprite Color attribute Table table I-liddle 0lE80H 03000H Color Table 02000H Lower 03800H Pattern Name Table 03BOOH 04000H A maximum of 8 pages may be allocated in the same manner (using a 12BK-byte VRAl-I). lFFFFH 36 V9938 MSX-VIDEO USER'S MANUAL GRAPH IC 4 MODE Characteristics - Bit-mapped Graphics Mode - Screen siz e 256 (w) x 212 (h) dots 256 (w) x 192 (h) dots - Screen colors 16 colors out of 512 colors (per screen) - Sprite mode Spr i te mode 2 - VRAM area per screen 32K bytes Controls - Graphics VRAlil pattern name table - Background color code Low-order four bits of R#7 - Spri tes VRAM sprite attribute table, VRAM sprite pattern table Initial Settings l. Mode and Register settings MSB 7 6 5 4 3 2 1 0 LSB R#O a DG IE21IEli 0* I 1*1 1* a Mode register 0 R#l a BL IEol 0* I 0*1 0 lSI MAG Mode register 1 R#8 IHS LP TP I CB IVR 0 ISPD BW Mode register 2 I R#9 ILN 0 81 I SO IlL lEO ~*N'I' DC Mode register 3 * Examples of settings in GRAPHIC 4 mode ** Indicates negative logic In GRAPHIC 4 mode, if LN is set to 1, the screen height is 212 dots, and if LN is set to 0, the screen height is 192 dots. All other bits are set accordingly. 37 V9938 MSX-VIDEO USER'S MANUAL 2. Pattern name table settings - The pattern name table is composed of one byte for every two dots on the screen. A color can be assigned for each dot from a selection of 16 colors out of 512 colors. ~x OJ (1,0) ........................... .,------..-------, I (254, 0) (255, 0) (0, 1) (255, 1) y x , Y (0,191) (255,191) L -_ _--L . . . . . . . . . . . • . • . . . , . • . . . • . • . . • . . . . . . . • . . . . . . . • . -'--_ _ _- - ' LN o ~ ~"""""'''''''''''''''''''''''''''''''''''''.L- (255,211) _ _ _ _'''' LN 1 - Set the beginning (head) address of the pattern name table in register R#2. MSB 7 6 5 4 3 2 1 0 LSB R#2 0 IAl61A151 1 1 1 1 1 Pattern name table base address register I I These two bits specify the page to display 38 V9938 MSX-VIDEO USER'S MANUAL Pattern name table MSB 7 6 5 4 3 2 1 o LSB 1 ( 0, 0) ( 1, 0) Base address 2 ( 2, 0) ( 3, 0) Set the color code for each dot in this table. 127 (254, 0) (255, 0) 128 ( 0, 1) ( 1, 1) 27134 (252,211) (253,211) 27135 (254,211) 3. Color register settings l<1SB 7 6 5 4 3 2 1 o LSB Rtf7 Text color/Back drop color register Specifies backdrop color code Ignored 39 V9938 MSX-VIDEO USER'S MANUAL 4. Sprite settings Set the beginning (head) address of the sprite attribute table in registers R#5 and R#ll~ and set the beginning (head) address of the sprite pattern generator table in register R#6. For details about sprites, see the section on SPRITE MODE 2. MSB 7 6 5 4 3 2 1 0 LSB R#5 IAl41 Al31 Al21 All IAlO I 1 1 I1 Sprite attribute table R#ll 0 0 0 0 0 0 IAl61A151 base address register I I I I R#6 o Sprite pattern generator table base address register Example of VRAM allocation in GRAPHIC 4 mode OOOOOH 02000H Pattern name table 04000H 192 lines 06000H 07000H Sprite 212 lines generator 06AOOH table (2048 07000H bytes) 07800H Spr i te color table (512 bytes) 07AOOH Sprite attribute table 08000H (128 '. bytes) 07A80H o8000H A maximum of 4 pages may be allocated in IFFFFH the same manner (using a 128K-byte VRAM) • 40 V9938 MSX-VIDEO USER'S MANUAL GRAPH IC 5 MODE Characteristics - Bit-mapped Graphics Mode - Screen size 512 (w) x 212 (h) dots 512 (w) x 192 (h) dots - Screen colors 4 colors out of 512 colors (per screen) - Spr i te mode Spri te mode 2 - VRAM area per screen 32K bytes Controls - Graphics VRAM pattern name table - Background color code Low-order four bits of R:fI7 - Sprites VRAM spri te attribute table, VRAM sprite pattern table Initial Settings 1. Mode and Register Settings MSB 7 6 5 4 3 2 1 0 LSB RiO 0 IDG IE2 IEll 1* 0*1 0* I 0 I Mode register 0 R:fIl 0 IBL lEO 0*1 0* I 0 lSI I MAG Mode register 1 R:fI8 HS ILP TP CB IVR 0 ISPDIBW I Mode register 2 R:fI9 0 Sl SO 1 IL EO ~*NTIDC LN Mode register 3 1 1 * Examples of settings in GRAPHIC 5 mode ** Indicates negative logic In GRAPHIC 5 mode, if LN is set to 1, the screen height is 212 dots, and if LN is set to 0, the screen height is 192 dots. All other bits are set accordingly. 41 V9938 MSX-VIDEO USER'S MANUAL 2. Pattern name table settings - The pattern name table is composed of one byte for every four dots on the screen. A color can be assigned for each dot from a selection of 4 colors out of 512 colors. ~_X_O_)-+-(1_,_0_)---' ........................ ·L..I(_5_1_0_,~0_)--t-(_5_1_1_' _O_)-i (0, 1) (511, 1) y (X, y) (0,191 ) (511 ,191) ' - -_ _---'- . • . . . . • • • • • • • . • . • • • . • . • • • • . • , . • • • • • . • • • • • . I -_ _ _--J LN o ~ ~ (511 ,211) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1--_ _ _- - ' LN 1 Set the beginning (head) address of the pattern name table in register R#2. MSB 7 6 5 4 3 2 1 0 LSB R#2 0 IAl61 AlS I 1 1 1 1 1 Pattern name table base address register I I These two bits specify the page to display 42 V9938 MSX-VIDEO USER'S MANUAL Pattern name table MSB 7 6 5 4 3 2 1 o LSB o ( 0, 0) ( 1, 0) ( 2, 0) ( 3, 0) Base address 1 ( 4, 0) ( 5, 0) ( 6, 0) ( 7, 0) Set the color code for each dot in this table. 127 (508,0) (509,0) (510,0) (511,0) 128 ( 0, 1) ( 1, 1) ( 2, 1) ( 3, 1) 27135 3. Color register settings 6 5 4 3 2 1 o LSB R#7 Text color/Back drop color register Specifies backdrop color code Ignored 4. Sprite settings - Set the beginning (head) address of the sprite attribute table in registers R#5 and R#ll~ and set the beginning (head) address of the sprite pattern generator table in register R#6. For details about spri tes, see the section on SPRITE f.l0DE 2. MSB 7 6 5 4 3 2 1 0 LSB R#5 i I 1 I 1 I 1 I Sprite attribute table IAl41Al31Al21 All AlO RUl I 0 I 0 I 0 I 0 I o I 0 IAl61 A151 base address register R#6 o Sprite pattern generator table base address register 43 V9938 MSX-VIDEO USER'S MANUAL 5. Hardware tiling function - In GRAPHIC 5 mode, a hardware tiling function processes the sprite and background colors. For these colors, you can specify four bits~ however, of these four bits, the higher-order two bits specify the color code of the even dots, and the lower-order two bi ts specify the color code of the odd dots of the x-coordinate (0 to 511) • - In GRAPHIC 5 mode, the size of one dot of a sprite is approximately twice that of a graphics dot; however, when this tiling function is used, one dot of a sprite may be displayed in two colors. - The even and odd dots of the background color may also be specified in the same manner. Even dots (0, 2, • 510) Odd dots (I, 3, 511) Two graphics dots A sprite dot MSB LSB Bits specifying sprite colors(4 bits) 44 V9938 MSX-VIDEO USER'S MANUAL Example of VRAM allocation in GRAPHIC 5 mode OOOOOH Pattern name 02000H table 04000H 192 lines 06000H 07000H Spri te 212 lines generator 06AOOH table (2048 07000H L' bytes) 07800 H Sprite color table (512 bytes 07AOOH Spri te attribute table (128 bytes) 07A80H 08000H o8000H A maximum of 4 pages may be allocated in the same manner (using a 128K-byte VRMI). lFFFFH 45 V9938 MSX-VIDEO USER'S MANUAL GRAPHIC 6 MODE Characteristics - Bit-mapped Graphics Mode - Screen size 512 (w) x 212 (h) dots 512 (w) x 192 (h) dots - Screen colors 16 colors out of 512 colors (per screen) - Sprite mode Spr i te mode 2 - VRAM area per screen 128K bytes (Two screens) * To use this mode, the VRAM must have 128K bytes. Controls - Graphics VRAM pattern name table - Background color code Low-order four bits of R#7 - Sprites VRAM sprite attribute table, VRAM sprite pattern table Initial Settings 1. Mode and Register Settings NSB 7 6 5 4 3 2 1 o LSB R#O o IDG IE2 IEll 1* 0* I 1* I 0 Mode register 0 R#l lEO 0*10* o lSI lr-lAG Mode register 1 R#8 TP CB IVR o ISPDIBW Mode register 2 R#9 LN I0 Sl SO IlL Mode register 3 * Examples of settings in GRAPHIC 6 mode ** Indicates negative logic In GRAPHIC 6 mode, if LN is set to 1, the screen height is 212 dots, and if LN is set to 0, the screen height is 192 dots. All other bits are set accordingly. 46 V9938 MSX-VIDEO USER'S MANUAL 2. Pattern name table settings - The pattern name table is composed of one byte for every two dots on the screen. A color can be assigned for each dot from a selection of 16 colors out of 512 colors. ~XO) (1,0) · .. ·····················l(510, 0) (511, 0) (0, 1) (511, 1) y (X, y) (0,191) (511 ,191) ~ _ _~ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...L-_ _ _---l LN o ~ ~ ......................................... . (511 ,211) LN = 1 Set the beginning (head) address of the pattern name table in register R#2. MSB 7 6 5 4 3 2 1 0 LSB R#2 0 0 IAl6 11 1 1 1 1 Ipattern name table 1 base address register I Specif ies the page to display (In G6 and G7 modes, the position of Al6 differs) . 47 V9938 MSX-VIDEO USER'S MANUAL Pattern name table MSB 7 6 5 4 3 2 1 o LSB o ( 0, 0) ( 1, 0) Base address 1 ( 2, 0) ( 3, 0) Set the color code for each dot in this table. 255 (510, 0) (511 ; 0) 256 ( 0, 1) ( 1, 1) 54270 (508,211> (509,211) 54271 (510,211) (511,211) 3. Color register settings l'1SB 7 6 5 4 3 2 1 o LSB R#7 Text color/Back drop color register Specifies backdrop color code Ignored 4. Sprite settings - Set the beginning (head) address of the sprite attribute table in registers R#5 and R#ll; and set the beginning (head) address of the sprite pattern generator table in register R#6. For details about sprites, see the section on SPRITE MODE 2. MSB 7 6 5 4 3 2 I o LSB R#5 IAl41Al3 IAl2IA11IAlO I 1 11 11 I Sprite attribute table R#ll \ 0 I 0 I 0 \ 0 I 0 I 0 \Al6IA15\ base address register R#6 o o IAl61 Al51 Al41 Al3 IAl21 AlII Sprite pattern generator table base address register 48 V9938 MSX-VIDEO USER'S MANUAL Example of VRAM allocation in GRAPHIC 6 mode OOOOOH Pattern Name Table 04000H 08000H OFOOOH Spri te 192 line generator OCOOOH table 212 line (2048 OD400H bytes) OF800H Spri te color table ( 512 bytes) OFAOOH Spri te attribute table <128 . bytes) OFOOOH OFA80H 10000H 10000H A maximum of 2 pages may be allocated in the same manner (using a l28K-byte VRAH). 1FFFFH I 49 V9938 MSX-VIDEO USER'S MANUAL GRAPHIC 7 MODE Character istics - Bit-mapped Graphics Mode - Screen siz e 256 (w) x 212 (h) dots 256 (w) x 192 (h) dots - Screen colors 256 colors (per screen) - Spr i te mode Sprite mode 2 - VRAM area per screen 128K bytes (Two screens) * To use this mode, the VRAN must have 128K bytes. Controls - Graphics VRMI pattern name table - Background color code Low-order four bits of R#7 - Sprites VRA/III sprite attribute table, VRA/Ill sprite pattern table Ini tial Settings 1. Mode and Register Settings MSB 7 6 5 4 3 2 1 0 LSB R#O I 0 DG IIE2 IEll 1* 1*1 1* 0 Mode register 0 R#l 0 BL IIEO 0*1 0* 0 lSI MAG Mode register 1 I R#8 IMS LP ITP CB IVR 0 ISPD BW Mode register 2 R#9 ILN 0 lSI SO IlL EO ~*NT DC Node register 3 * Examples of settings in GRAPHIC 7 mode ** Indicates negative logic In GRAPHIC 7 mode, if LN is set to 1, the screen height is 212 dots, and if LN is set to 0, the screen height is 192 dots. All other bits are set accordingly. 50 V9938 MSX-VIDEO USER'S MANUAL 2. Pattern name table settings - The pattern name table is composed of one byte for every dot on the screen. A color can be assigned for each dot from a selection of 256 colors. ~XOl n,O) ....................... - r - - - - - " T " " - - - - , l (254, 0) (255, 0) (0, 1) (255, 1) y (X, y) (0,191) (255,191) L.-._ _~ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1...-_ _ _- - ' LN o ~ ~ (255,211) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1...-_ _ _- - ' LN 1 Set the beginning (head) address of the pattern name table in r egi ster R#2. MSB 7 6 5 4 3 2 1 0 LSB R#2 0 0 It: 11 I 1 1 1 I Pattern name table base address register Specifies the page to display; in the G6 and G7 modes only, the location of the Al6 bit differs. 51 V9938 MSX-VIDEO USER'S MANUAL Pattern name table MSB 7 6 5 4 3 2 1 o LSB 0 1 I I I :::: :j I I I Base address Set the color code for each dot in this table. G~EEN : :RED: 255 256 I I :5:: : :1 I I 54270 54271 II II 3. Color register settings MSB 7 6 5 4 3 2 1 o LSB R#7 Text color/Back drop color register Specifies backdrop color code 4. Sprite settings - Set the beginning (head) address of the sprite attribute table in registers R#5 and R#ll; and set the beginning (head) address of the sprite pattern generator table in register Ri6. For details about sprites, see the section on SPRITE MODE 2. MSB 7 6 5 4 3 2 1 0 LSB R#5 IAl41Al31Al21AlliAlO I 1 1 1 Sprite attr ibute tabl e R#ll I 0 I 0 I 0 I 0 I 0 I 0 IAl61Al51 base address register R#6 o Sprite pattern generator table base address register 52 V9938 MSX-VIDEO USER'S MANUAL . Example of VRAM allocation in GRAPH IC 7 mode OOOOOH Pattern Name Table 04000H o8000H OFOOOH Sprite 192 line generator OCOOOH table 212 line (2048 OD400H bytes) OF800H Spri te color table (512 bytes OFAOOH Sprite attribute table (128 : bytes) OFOOOH OFA80H 10000H lOOOOH A maximum of 2 pages may be allocated in the same manner (using a 128K-byte VRAM). IFFFFH 53 CO Ml-1ANDS 1. Types of Commands It is very easy to use MSX-VIDEO commands to perform functions such as LINE and PSET for use with graphics, and for transferring parts of the screen. Summary of Commands Command Name Destination Source Late Mnemonic crn CM2 CMl CMO High-speed VRAM CPU Byte HMtllC 1 1 1 1 move VRAM VRAM Byte YMMM 1 1 1 0 VRAM VRAr-1 Byte HMMM 1 1 0 1 VRAM VDP Byte HMMV 1 1 0 0 Logical move VRAM CPU Dot LMMC 1 0 1 1 CPU VRAN Dot LMCM 1 0 1 0 VRAM VRAM Dot Lr-IMM 1 0 0 1 VRAM VDP Dot LMMV 1 0 0 0 Line VRA~l VDP Dot LINE 0 1 1 1 Search VRAM VDP Dot SRCH 0 1 1 0 Pset VRAr-1 VDP Dot PSET 0 1 0 1 Point VDP VRAM Dot POINT 0 1 0 0 Invalid 0 0 1 1 Invalid 0 0 1 0 Inval id 0 0 0 1 Stop 0 0 0 0 - Commands are executed in the MSX-VIDEO by writing the data into R#46 (the Command Register, hereafter abbreviated CMR), and setting bit 0 of status register S#2 (CE/Command Execute) to 1. Before this can be done, the necessary parameters must be first have been set in registers R#32 to R#45. - When the command execution is complete, CE is set to o. - To abort a command while it is being executed, execute a STOP. - The results of command execution are only guaranteed during bit map mode (Graph4 to Graph?) • 54 V9938 MSX-VIDEO USER'S MANUAL 2. Page Concept The parameters used for the MSX-VIDEO are all x-y coordinates. In other words, the internal command processor of the MSX-VIDEO accesses the entire VRAN area as x-y coordinates of the display mode. When a screen is to be displayed, 212 lines of the same page are displayed (selected by R#23). To select the page to be displayed, use R#2. When a command is being executed, the contents of the display screen are ignored. The display modes and their relationships to the coordinates are shown in the table below. GRAPH 4 Address GRAPH 5 OOOOOH (0,0) (255,0) (0,0) (511 ,0) (0,255) Page 0 (255,255) I o8000H (0,255) Page 0 (511 ,255) (0,256) (255,256) (0,256) (511,256) (0,511) Page 1 (255,511) I 10000H (0,511) Page 1 (511,511) (0,512) (255,512) (0,512) (511 ,512) ( 0,767) page 2 (255,767) I 18000H (0,767) Page 2 (511,767 ) (0,768) (255,768) (0,768) (511,768) (0,1023) Page 3 (255,1023) I IFFFFH (0,1023) Page 3 (511,1023) GRAPH 7 GRAPH 6 OOOOOH (0,0) (255,0) (0,0) (511,0) (0,255) Page 0 (255,255) I 10000H (0,255) Page 0 (511 ,255) (0,256) (255,256) (0,256) (511,256) (0,511) Page 1 (255,511) I IFFFFH (0,511) Page 1 (511 ,511) 55 V9938 MSX-VIDEO USER'S MANUAL 3. Logical Operations When the LINE, PSET, and LOGICAL MOVE commands are executed on the MSX-VIDEO, the operations may be performed on the color on the screen. To do logical operations on the MSX-VIDEO, write the lower four bits of R#46 (Command register) simultaneously when you specify the com- mand. Summary of Logical Operations Name Operation L03 L02 LOI LOO IMP DC=SC 0 0 0 0 AND DC=SC*DC 0 0 0 I OR DC=SC+DC 0 0 I 0 EOR DC= SC *DC+ SC *DC 0 0 1 I NOT DC=SC 0 I 0 0 --- 0 I 0 I --- 0 1 1 0 --- 0 I 1 I TIMP if Sc=o then DC=DC else DC=SC I 0 0 0 TAND if Sc=o then DC=DC else DC=SC*DC 1 0 0 I TOR if Sc=o then DC=DC else DC=SC+DC I 0 1 0 TEOR if Sc=o then DC=DC else DC=SC*DC+SC*DC I 0 1 I TNOT if SC=O then DC=DC else DC=SC I I 0 0 --- I I 0 I --- I 1 1 0 --- I 1 1 1 * SC = Source Color code * DC = Destination Color code * EOR = Exclusive OR 56 V9938 MSX-VIDEO USER'S MANUAL 4. Explanations of Commands 4.1 HMMC (High-speed move CPU to VRMI) The HMMC command transfers data from the CPU to the Video or expansion RAM in a specified rectangular area (in x-y coordinates) via the MSX- VIDEO. Since the data to be transferred is done in units of one byte, there is a limitation, according to the display mode, on the value for x. Video or Expansion RAM (Ox, DY) NX .J. DIY 4.1.1 HMMC Execution Order 1. First, set the necessary parameters in the command register of the MSX-VIDEO. MXD: Select destination memory 0: Video RAM 1: Expansion RAM DX: Basic x-coordinate of destination (0 to 511) *1 DY: Basic y-coordinate of destination (0 to 1023) NX: Dots to move in x-direction (0 to 511) *1 NY: Dots to move in y-direction (0 to 1023) *1 Note that in the G4 and G6 modes, the lower one bit, and in the G5 mode, the lower two bits, are lost. DIX: Direction for NX from x-coordinate of destination 0: Right 1: Left DIY: Direction for NY from y-coordinate of destination 0: Down 1: Up CLR (R#44:Color register): First byte of data to be transferred 2. After you specify the above data, execute the command by writ- ing 1 1 1 1 0 0 0 0 B into the CMR(R#46:Command register). 3. While checking TR and CE in Status Register S#2, send the second byte and all bytes following into the CLR register. 57 V9938 MSX-VIDEO USER'S MANUAL 4.1.2 Setting up the HMMC register MSB 7 6 5 4 3 2 1 o LSB RB6 DX7 DX6 DX5 DX4 DX3 DX2 DXl DXO R#37 0 0 0 0 0 0 0 DX8 DX } ~:~Unation RB8 DY7 DY6 DY5 DY4 DY3 DY2 DYl DYO point DY RB9 0 0 0 0 0 0 DY9 DY8 RHO NX7 NX6 NX5 NX4 NX3 NX2 NXl NXO NX -- Number of dots R#41 0 0 0 0 0 0 0 NX8 to transfer, x-direction R#42 NY7 NY6 NY5 NY4 NY3 NY2 NYl NYO NY -- Number of dots R#43 0 0 0 0 0 0 NY9 NY8 to transfer, y-direction R#44 CLR (G4, G6) X=2N X=2N+l (N=O,1, .•. 127) CLR (G5) Data to transfer X=4N X=4N+l X=4N+2 X=4N+3 (N=O,l, •• . 127) CLR (G7) One dot R#45 0 I - IMXDI - IDIYIDIXI - - I ARG - Argument register I I Data transfer direction (x) I Data transfer direction (y) Data destination select 58 V9938 MSX-VIDEO USER'S MANUAL 4.1.3 Execution of HMMC commands MSB 7 6 5 4 3 2 1 0 LSB R#46 1 1 1 1 I- I- I- I- CMR 4.1.4 Flowchart of HMMC execution HMMC START Read Status Register #2 =:>----.yes (CE=O) No (TR=O) HMMC END 59 V9938 MSX-VIDEO USER'S MANUAL 4.2 YMMM (High-speed move VRAM to VRAM, y only) The YMMM command transfers data from the area specified by DX, SY, NY, DIX, DIY and the right (or left) edge of the Video RAM, in the y- direction determined by DY. Video or Expansion RAM (Ox, DY) I r (OX, SY) I NY ~ DIX DIY 4.2.1 YMMM Execution Order 1. First, set the necessary parameters in the command register of the MSX-VIDEO. MXD: Select destination memory 0: Video RAM 1: Expansion RAM DY: Basic y-coordinate of destination (0 to 1023) DX: Basic x-coordinate of source point (0 to 511) *1 SX: Basic y-coordinate of source point (0 to 1023) NY: Dots to move in y-direction (0 to 1023) *1 Note that in the G4 and G6 modes, the lower one bit, and in the G5 mode, the lower two bits, are lost. DIX: Direction for x-coordinate of source point to the right or left end of screen 0: Right 1: Left DIY: Direction of source point from NY 0: Down 1: Up 2. After you specify the above data, execute the command by writing 1 1 1 1 0 0 0 0 B into the CMR(R#46:Command register). 3. The above procedure will execute the YMMM command in the MSX- VIDEO. rlhile executing the YMMM command, the CE bi t of the status register (S#2) will be set to 1, and when the command is complete, it will be reset to o. 60 V9938 MSX-VIDEO USER'S MANUAL 4.2.2 Setting up the YMMM register MSB 7 6 5. 4 3 2 1 o LSB R#34 SY7 SY6 SY5 SY4 SY3 SY2 SYl SYO R#35 0 0 0 0 0 0 SY9 SY8 SYJ- Basic transfer R#36 DX7 DX6 DX5 DX4 DX3 DX2 DXl DXO point DX R#37 0 0 0 0 0 0 0 DX8 R#38 DY7 DY6 DY5 DY4 DY3 DY2 DYl DYO DY Destination R#39 0 0 0 0 0 0 DY9 DY8 transfer point R#42 NY7 NY6 NY5 NY4 NY3 NY2 NYl NYO NY -- Number of dots RU3 0 0 0 0 0 0 NY9 NY8 to tr ansf er , y-direction R#45 0 I - 11I1XD I - IDIYIDIXI - I - ARG -- Argument register I I Data transfer direction (x) I Data transfer direction (y) Data destination select 4.2.3 Execution of YMMM Commands MSB 7 6 5 4 3 2 1 o LSB RU6 1 1 1 o -I - I - I -I CMR 61 V9938 MSX-VIDEO USER'S MANUAL 4.3 HMMM (High- speed move VRAlvI to VRA~D The HMMM command transfers data in a specified rectangular area from the VRAM or the expansion RAl-l to the VRAM or the expansion RAM. Since the data to be transferred is done in units of one byte, there is a limitation, according to the display mode, on the value for x. Video or Expansion RAM (SX,SY) r - - NX NY DIY 4.3.1 HMMM Execution Order 1. First, set the necessary parameters in the command register of the MSX-VIDEO. MXS: Select source memory 0: Video RAM 1: Expansion RAM MXD: Select destination memory 0: Video RAM 1: Expansion RAM SX: Source point x-coordinate (0 to 511) *1 SY: Source point y-coordinate (0 to 1023) NX: Dots to move in x-direction (0 to 511) *1 NY: Dots to move in y-direction (0 to 1023) DIX: Direction for NX from source point 0: Right 1: Left DIY: Direction for NY from source point 0: Down 1: Up DX: Basic x-coordinate of destination (0 to 511) *1 DY: Basic y-coordinate of destination (0 to 1023) *1 Note that in the G4 and G6 modes, the lower one bit, and in the G5 mode, the lower two bits of SX, DX, and NX, are lost. 2. After you specify the above data, execute the command by wri t- ing 1 1 0 1 0 0 0 0 B into the CMR(R#46:Command register). 62 V9938 MSX-VIDEO USER'S MANUAL 3. The above procedure will execute the HMMM command in the MSX- VIDEO. While executing the HMMM command, the CE bit of the status register (S#2) will be set to 1, and when the command is complete, it will be reset to O. 4.3.2 Setting up the HMMM register MSB 7 6 5 4 3 2 1 0 LSB R#32 SX7 SX6 SXS SX4 SX3 SX2 SXl SXO R#33 0 0 0 0 0 0 0 SX8 S X } Basic transfer point R#34 SY7 SY6 SYS SY4 SY3 SY2 SYl SYO SY R#3S 0 0 0 0 0 0 SY9 SY8 R#36 DX7 DX6 DXS DX4 DX3 DX2 DXl DXO R#37 0 0 0 0 0 0 0 DX8 D X } Destination transfer point R#38 DY7 DY6 DYS DY4 DY3 DY2 DYl DYO DY R#39 0 0 0 0 0 0 DY9 DY8 R#40 NX7 NX6 NXS NX4 NX3 NX2 NXl NXO NX -- Number of dots R#41 0 0 0 0 0 0 0 NX8 to tr ansf er, x-direction R#42 NY7 NY6 NYS NY4 NY3 NY2 NYl NYO NY -- Number of dots R#43 0 0 0 0 0 0 NY9 NY8 to tr ansf er, y-direction R#4S ARG Data transfer direction (x) Data transfer direction (y) Source memory select Destination memory select 4.3.3 Executing the HMMM command MSB 7 6 5 4 3 2 1 o LSB R#46 1 1 o 1 - I - I - I - I CMR 63 V9938 MSX-VIDEO USER'S MANUAL 4.4 HMMV (High-speed move VDP to VRAM) The HMMV command is used to paint in a specified rectangular area of the VRAM or the expansion RAM. Since the data to be transferred is done in units of one byte, there is a limitation, according to the display mode, on the value for x. Video or Expansion RAM (DX,DY) ~ DIX NX MSX- INY VIDEO I ~ DIY 4.4.1 HMMV Execution Order 1. First, set the necessary parameters in the command register of the MSX-VIDEO. MXD: Select destination memory 0: Video RAM 1: Expansion RAM NX: Dots to move in x-direction (0 to 511) *1 NY: Dots to move in y-direction (0 to 1023) DIX: Direction for NX from source point 0: Right 1: Left DIY: Direction for NY from source point 0: Down 1: Up DX: Basic x-coordinate of destination (0 to 511) *1 DY: Basic y-coordinate of destination (0 to 1023) *1 Note that in the G4 and G6 modes, the lower one bit, and in the G5 mode, the lower two bits of DX and NX, are lost. CLR: Color code data 2. After you specify the above data, execute the command by writ- ing 1 10 0 0 0 0 0 into the CMR. 3. The above procedure will execute the HMMV command in the MSX- VIDEO. While executing the HMMV command, the CE bit of the status register (S#2) will be set to 1, and when the command is complete, it will be reset to O. 64 V9938 MSX-VIDEO USER'S MANUAL 4.4.2 Setting up the HMMV register MSB 7 6 5 4 3 2 1 o LSB R#36 DX7 DX6 DX5 DX4 DX3 DX2 DXl DXO RIJ:37 0 0 0 0 0 0 0 DX8 DX} Destnation transfer point RIJ:38 DY7 DY6 DY5 DY4 DY3 DY2 DYI DYO DY ---I RIJ:39 0 0 0 0 0 0 DY9 DY8 RHO NX7 NX6 NX5 NX4 NX3 NX2 NXI NXO NX -- Number of dots RHI 0 0 0 0 0 0 0 NX8 to tr ansf er , x-·direction R#42 NY7 NY6 NY5 NY4 NY3 NY2 NYI NYO NY - Number of dots R#43 0 0 0 0 0 0 NY9 NY8 to tr ansf er, y-direction R#44 CLR (G4, G6) X=2N X=2N+l (N=O,l, ••• 127) CLR (G5) Data to transfer X=4N X=4N+l X=4N+2 X=4N+3 (N=O,l, •.• 127) CLR (G7) Cne dot R#45 0 - I MXDI - IDIYID1Xl - I - I ARG I I I Data transfer direction (x) Data transfer direction (y) Destination memory select 4.4.3 Executing the HMMV command MSB 7 6 5 4 3 2 1 0 LSB R#46 1 1 0 0 I - I- I- I- CMR 65 V9938 MSX-VIDEO USER'S MANUAL 4.5 LMMC (Logical move CPU to VRAM) The LMCC command transfers data from the CPU to the Video or expansion RAM in a specified rectangular area (in x-y coordinates) via the MSX- VIDEO. Since the data to be transferred is done in units of dots, logical operations may be done on the destination points. Video or Expansion RAM (DX, DY) NX ~ DIY 4.5.1 LMMC Execution Order 1. First, set the necessary parameters in the command register of the MSX-VIDEO. JI1XD: Select destination memory 0: Video RAM 1: Expansion RAM DX: Basic x-coordinate of destination (0 to 511) DY: Basic y-coordinate of destination (0 to 1023) NX: Dots to move in x-direction (0 to 511) NY: Dots to move in y-direction (0 to 1023) DIX: Direction for NX from x-coordinate of destination 0: Right 1: Left DIY: Direction for NY from y-coordinate of destination 0: Down 1: Up CLR: First byte of data to be transferred 2. After you specify the above data, execute the command. write 1 o 1 1 B into the higher four bits of the command register (CMR), and place the logical operation code in the lower four bits of CMR. 3. While checking TR and CE in Status Register S#2, send the second byte and all bytes following into the CLR register. 66 V9938 MSX-VIDEO USER'S MANUAL 4.S.2 Setting up the LMMC register MSB 7 6 S 4 3 2 I a LSB R#36 DX7 DX6 DXS DX4 DX3 DX2 DXI Dxa R#37 a a a a a a a DX8 DX }BaSiC destination point RB8 DY7 DY6 DYS DY4 DY3 DY2 DYl Dya DY R#39 a a a a a a DY9 DY8 Rua NX7 NX6 NXS NX4 NX3 NX2 NXI Nxa NX -- Number of dots R#41 a a a 0 a a a NX8 to transfer, x-direction RU2 NY7 NY6 NYS NY4 NY3 NY2 NYI Nya NY -- Number of dots RU3 a a a a a 0 NY9 NY8 to tr ansf er, y-direction RU4 CR3 CR2 CRI CRa CLR (G4, CR7 CR6 CRS CR4 CR3 CR2 CRI CRa CRI CRa CLR (GS) CLR (G7) ~ Data to transfer RUS a MXD DIY DIX ARG Data transfer direction (x) Data transfer direction (y) Data destination select 4.S.3 Execution of LMl-1C commands MSB 7 6 S 4 3 2 I a LSB R#46 I a I· I I IL031L021LOIILoai CMR I I I I Logical operation 67 V9938 MSX-VIDEO USER'S MANUAL 4.5.4 Flowchart of LMMC execution LMMC START Read Status Register #2 ~>----, Yes (CE=O) No (TR=O) Yes (TR=l) Transmi t Data LMMC END 68 V9938 MSX-VIDEO USER'S MANUAL 4.6 LMCM (Logical move VRAM to CPU) The LMCM command transfers data f rom the Video or expansion RAl-i to the CPU, in a specified rectangular area (in x-y coordinates) via the MSX-VIDEO. The data is transferred in units of dots. Video or Expansion RAM (SX,Sy) NX ~ DIX r=l I:l • DIY L:J---4U 4.6.1 LMCM Execution Order 1. First, set the necessary parameters in the command register of the MSX-VIDEO. ~1XS: Select source memory 0: V ideo RAt-1 1: Expansion RAM SX: Basic x-coordinate of source point (0 to 511) SY: Basic y-coordinate of source point (0 to 1023) NX: Dots to move from source point in x-direction (0 to 511) NY: Dots to move from source point in y-direction (0 to 1023) DIX: Direction for NX from x-coordinate of source point 0: Right 1: Left DIY: Direction for NY from y-coordinate of source point 0: Down 1: Up 2. After you specify the above data, execute the command by writ- ing 1 0 1 0 0 0 0 0 B into the CMR. 3. While checking TR and CE in Status Register S#2, read Status Register S#7. 69 V9938 MSX-VIDEO USER'S MANUAL 4.6.2 Setting up the LMCM register 1>lSB 7 6 5 4 3 2 1 o LSB R#32 SX7 SX6 SX5 SX4 SX3 SX2 SXl SXO R#33 0 0 0 0 0 0 0 SX8 Basic S X } source point R#34 SY7 SY6 SY5 SY4 8Y3 SY2 SYI SYO SY R#35 0 0 0 0 0 0 SY9 8Y8 R#40 NX7 NX6 NX5 NX4 NX3 NX2 NXI NXO NX -- Number of dots R#4l 0 0 0 0 0 0 0 NX8 to transfer, x-direction R#42 NY7 NY6 NY5 NY4 NY3 NY2 NYI NYO NY -- Number of dots R#43 0 0 0 0 0 0 NY9 NY8 to transfer, y-direction R#45 o I - I - Ir.iXS IDIYIDIXI - I - I ARG II , - - - - I Data transfer direction (x) Data transfer direction (y) Source memory select 4.6.3 Execution of LMCM commands MSB 7 6 5 4 3 2 1 0 LSB Rii46 I1 0 1 0 I - CMR S#7 C2 Cl CO Status Register 8#7 (G4, I0 0 0 0 IC3 G6) 8#7 I0 0 0 0 I 0 0 Cl CO Status Register 8#7 (G5) 8#7 IC7 C6 C5 C4 IC3 C2 Cl CO status Register S#7 (G7 ) 70 V9938 MSX-VIDEO USER'S MANUAL 4.6.4 Flowchart of LMCM execution LMCM START Read Status Register #2 Ready? No (TR 0) Yes (TR=l) Read Status Register #7 No (CE = 1) Yes (CE 0) LMCM END Notes 1. TR must be reset before the command is executed. Read Status Register #7 when you set up the MSX-VIDEO. 2. Even though the data is set in Status Register #7 and TR=l, the command will be completed within the MSX-VIDEO and CE is set to o. 71 V9938 MSX-VIDEO USER'S MANUAL 4.7 LMMM (Logical move VRAM to VRAM) The LMMM command transfers data in a specified rectangular area from the VRAM or the expansion RAM to the VRAM or the expansion RAH. Since the data to be transferred is done in units of dots, logical operations may be done on the destination data. Video or Expansion RAH (SX,SY) 4.7.1 LHMH Execution Order 1. First, set the necessary parameters in the command register of the MSX-VIDEO. MXS: Select source memory 0: V ideo RAl-1 1: Expansion RAH MXD: Select destination memory 0: Video RAM 1: Expansion RAH SX: Source point x-coordinate (0 to 511) SY: Source point y-coordinate (0 to 1023) NX: Dots to move in x-direction (0 to 511) NY: Dots to move in y-direction (0 to 1023) DIX: Direction for NX from source point 0: Right 1: Left DIY: Direction for NY from source point 0: Down 1: Up DX: Basic x-coordinate of destination (0 to 511) DY: Basic y-coordinate of destination (0 to 1023) 2. After you specify the above data, execute the command. write 1 o 0 1 B into the upper four bits of the command register (CMR) and the logical operation into the lower four bits. 72 V9938 MSX-VIDEO USER'S MANUAL 3. The above procedure will execute the LMMM command in the MSX- VIDEO. While executing the LMMM command, the CE bi t of the status register (S#2) will be set to 1, and when the command is complete, it will be reset to O. 4.7.2 Setting up the LMMM register MSB 7 6 5 4 3 2 1 o LSB R#32 SX7 SX6 SX5 SX4 SX3 SX2 SXl SXO R#33 0 0 0 0 0 0 0 SX8 S X } Basic transfer point R#34 SY7 SY6 SY5 SY4 SY3 SY2 SYl SYO SY R#35 0 0 0 0 0 0 SY9 SY8 R#36 DX7 DX6 DXS DX4 DX3 DX2 DXl DXO R#37 0 0 0 0 0 0 0 DX8 D X } Destination transfer point R#38 DY7 DY6 DY5 DY4 DY3 DY2 DYl DYO DY R#39 0 0 0 0 0 0 DY9 DY8 RHO NX7 NX6 NXS NX4 NX3 NX2 NXl NXO NX -- Number of dots R#41 0 0 0 0 0 0 0 NX8 to tr an sf er, x-direction R#42 NY7 NY6 NYS NY4 NY3 NY2 NYl NYO NY -- Number of dots R#43 0 0 0 0 0 0 NY9 NY8 to tr ansf er , y-direction R#45 ARG Data transfer direction (x) Data transfer direction (y) Source memory select Destination memory select 4.7.3 Executing the L!IlHM command MSB 7 6 5 4 3 2 1 0 LSB R#46 1 0 0 1 IL031L021LOIILOoI CMR I I I I Logical operation 73 V9938 M8X-VIDEO USER'S MANUAL 4.8 LMMV (Logical move VDP to VRAl-I> The LMMV command paints in a specified rectangular area of the Video or Expansion RAM according to a specified color code. The data is transferred in units of one dot, and a logical operation may be done on the destination data. Video or Expansion RAM (DX, DY) NX ~ DIX r:l ~--------------~-----~ DIY 4.8.1 LMMV Execution Order 1. First, set the necessary parameters in the command register of the M8X-VIDEO. MXD: Select destination memory 0: Video RAH 1: Expansion RAM NX: Dots to move in x-direction (0 to 511) NY: Dots to move in y-direction (0 to 1023) DIX: Direction for NX from source point 0: Right 1: Left DIY: Direction for NY from source point 0: Down 1: Up DX: Basic x-coordinate of destination (0 to 511) DY: Basic y-coordinate of destination (0 to 1023) CLR: Color code data 2. After you specify the above data, execute the command. write 1 o 0 0 B into the upper four bits of the command register (CMR), and the logical operation into the lower four bits of the CMR. 3. The above procedure will execute the LMMV command in the M8X- VIDEO. While executing the LMMV command, the CE bit of the status register (8#2) will be set to 1, and when the command is complete, it will be reset to O. 74 V9938 MSX-VIDEO USER'S MANUAL 4.8.2 Setting up the LMMV register 1'1SB 7 6 5 4 3 2 1 o LSB R#36 DX7 DX6 DX5 DX4 DX3 DX2 DXl DXO R#37 0 0 0 0 0 0 0 DX8 D X } Destination transfer point R#38 DY7 DY6 DY5 DY4 DY3 DY2 DYl DYO DY R#39 0 0 0 0 0 0 DY9 DY8 R#40 NX7 NX6 NX5 NX4 NX3 NX2 NXl NXO NX - Number of dots R#41 0 0 0 0 0 0 0 NX8 to tr ansf er , x-direction R#42 NY7 NY6 NY5 NY4 NY3 NY2 NYI NYO NY - Number of dots R#43 0 0 0 0 0 0 NY9 NY8 to transfer, y-direction R#44 0 0 CLR (G4, ~ 0 0 IC3 IC2 ICl Ico 1 0 0 0 0 0 0 ICl Ico I CLR (G5l Data to I I C7 C6 I C5 I C4 IC3 IC2 ICl Ico 1 CLR (G7l transfer R#45 ARG Data transfer direction (xl Data transfer direction (yl Destination memory select 4.8.3 Executing the LMMV command MSB 7 6 5 4 3 2 1 0 LSB R#46 1 0 0 0 IL031L021LOIILOoI CMR I I 1 1 Logical operation 75 V9938 MSX-VIDEO USER'S MANUAL 4.9 LINE The LINE command draws a straight line in the Video or Expansion RAM. The line drawn is the hypotenuse that results after the long and short sides of a triangle are defined. The two sides are defined as distances from a single point. Video or Expansion RAM r DIY (DX,DY) ~ Maj Min ~ DIX 4.9.1 LINE Execution Order 1. First, set the necessary parameters in the command register of the MSX-VIDEO. MXD: Select destination memory 0: Video RAM 1: Expansion RAM Maj: Number of dots in long side (0 to 1023) Min: Number of dots in short side (0 to 511) MAJ: Direction for long side 0: Long side is in x-axis 1: Long side is in y-axis (or x-axis = y-axis) DIX: Direction from source point to end point 0: Right 1: Left DIY: Direction from source point to end point 0: Down 1: Up DX: Basic x-coordinate (0 to 511) DY: Basic y-coordinate (0 to 1023) 2. After you specify the above data, execute the command. Write 0 1 l I B into the upper four bits of the command register (CMR) , and the logical operation into the lower four bits of the CMR. 3. The above procedure will execute the LINE command in the MSX- VIDEO. While executing the LINE command, the CE bit of the status register (S#2) will be set to 1, and when the command is complete, it will be reset to o. 76 V9938 MSX-VIDEO USER'S MANUAL 4.9.2 Setting up the LINE register MSB 7 6 5 4 3 2 1 o LSB R#36 DX7 DX6 DX5 DX4 DX3 DX2 DXl DXO R#37 0 0 0 0 0 0 0 DX8 D X } Basic point R#38 DY7 DY6 DY5 DY4 DY3 DY2 DYl DYO DY R#39 0 0 0 0 0 0 DY9 DY8 R#40 MJ7 MJ6 ~1J5 MJ4 MJ3 MJ2 MJl MJO Maj (NX) -Number of dots R#4l 0 0 0 0 0 0 MJ9 MJ8 in long side R#42 MI7 MI6 MI5 MI4 MI3 MI2 MIl MIO ~Un (NY) -Number of dots R#43 0 0 0 0 0 0 0 MI8 in short side R#44 o o o o o o o IC3 IC2 ICI Ico o I 0 I 0 ICl Ico I I CLR (G4, CLR (G5) CLR (G7) 3 6) Data to transfer R#45 ARG Long side direction select End point direction (x) End point direction (y) Destination memory select 4.9.3 Executing the LINE command MSB 7 6 5 4 3 2 1 0 LSB R#46 0 1 1 1 IL031L021LOI1LOoI CMR I I I I Logical operation 77 V9938 MSX-VIDEO USER'S MANUAL 4.10 SRCH The SRCH command searches for a border color in the Video or Expansion RAM to the right or left of a basic point. Video or Expansion RAM (SX,SY) DIX ---------------> Border . Color Point 4.10.1 SRCH Execution Order 1. First, set the necessary parameters in the command register of the MSX-VIDEO. MXD: Select search memory 0: Video RAM 1: Expansion RAM DIX: Direction from source point to search 0: Right 1: Left EQ: When 1, ends execution when border color is found. When 0, ends 'execution when a color other than the border color is found. SX: Basic x-coordinate for search ( 0 to 511) SY: Basic y-coordinate for search (0 to 1023) CLR: Color code data 2. After you specify the above data, execute the command by wri ting 0 1 1 0 0 0 0 0 B into the CMR. 3. The above procedure will execute the SRCH command in the MSX- VIDEO. While executing the SRCH command, the CE bit of the status register (S#2) will be set to 1, and when the command is complete, it will be reset to O. If the color is found the BD bit is set to 1. 78 V9938 ,MSX-VIDEO USER'S MANUAL 4.10.2 Setting up the SRCH register MSB 7 6 5 4 3 2 1 o LSB R#32 SX7 SX6 SX5 SX4 SX3 SX2 SX1 SXO R#33 0 0 0 0 0 0 0 SX8 S X } Basic point for search R#34 SY7 SY6 SY5 SY4 SY3 SY2 SY1 SYO SY R#35 0 0 0 0 0 0 SY9 SY8 R#44 0 0 0 0 C2 C1 CO CLR (G4, ~ 1C3 Border 0 0 0 0 10 0 C1 CO CLR (G5) color for search C7 C6 C5 C4 IC3 C2 Cl CO CLR (G7) R#45 ~iXD - 1- DIX EQ ARG Command end condition Search direction (x) Search memory select 4.10.3 Executing the SRCH command MSB 7 6 5 4 3 2 1 o LSB R#46 o 1 1 o 1- I- I- I- CMR Status registers S#2 1- I - I - IBD I - I - I - ICE I I L Set to 0 at end of command Set to 1 i f border color is found S#8 BX7 BX6 BX5 BX4 BX3 BX2 BX1 BXO Location where border color was found S#9 1 1 1 1 1 1 1 BX8 (x-coordina te) 79 V9938 MSX-VIDEO USER'S MANUAL 4.10.4 Flowchart of SRCH execution SRCH START Read Status Register #2 Command? =::::o-~ No (CE=l) Yes (CE=O) No (BD=O) Yes (BD=l) Read Status register #8 Read Status Register #9 SRCH END 80 V9938 MSX-VIDEO USER'S MANUAL 4.11 PSET The PSET command draws a dot in the Video or Expansion RAM. A logical operation is done on the data of a dot that is already displayed. Video or Expansion RAItl (Ox, DY) 4.11.1 PSET Execution Order 1. First, set the necessary parameters in the command register of the MSX-VIDEO. MXD: Select memory 0: Video RAItl 1: Expansion RAM DX: x-coordinate of dot (0 to 511) DY: y-coordinate of dot (0 to 1023) 2. After you specify the above data, execute the command. Write 0 1 o 1 B into the high-order four bits of the command register (CMR) and the logical operation into the low-order four bits of CMR. 3. The above procedure will execute the PSET command in the MSX- VIDEO. While executing the PSET command, the CE bi t of the status register (S#2) will be set to 1, and when the command is complete, it will be reset to O. 81 V9938 MSX-VIDEO USER'S MANUAL 4.11.2 Setting up the PSET register MSB 7 6 5 4 3 2 1 o LSB R#36 DX7 DX6 DX5 DX4 DX3 DX2 DXl DXO R#37 0 0 0 0 0 0 0 DX8 D X } Basic point R#38 DY7 DY6 DY5 DY4 DY3 DY2 DYI DYO DY R#39 0 0 0 0 0 0 DY9 DY8 R#44 o o o o C3 co CLR (G4, :1 C2 ICI 0 0 0 0 0 0 ICl CO CLR (G5) =rPSET data C7 C6 IC5 I C4 C3 C2 ICI CO CLR (G7) R#45 0 - If.1XDI - - I- ARG 1 Memory sel ect 4.11.3 Executing the PSET command MSB 7 6 5 4 3 2 1 0 LSB R#46 0 1 0 1 IL031L021LOIILOoI CMR I I I I Logical operation 82 V9938 MSX-VIDEO USER'S MANUAL 4.12 POINT The POINT command draws a dot of the color specified in the Video or Expansion RAM. Video or Expansion RAf.1 (SX, SY) 4.12.1 POINT Execution Order 1. First, set the necessary parameters in the command register of the MSX-VIDEO. MXS: Select memory 0: Video RAM 1: Expansion RAM SX: x-coordinate of dot (0 to 511) SY: y-coordinate of dot (0 to 1023) 2. After you specify the above data, execute the command by writing 0 1 0 0 0 0 0 0 B into the CMR. 3. The above procedure will execute the POINT command in the MSX- VIDEO. While executing the POINT command, the CE bit of the status register (S#2) will be set to 1, and when the command is complete, it will be reset to O. The color code data is set to status register (S#7). 4.12.2 Setting up the POINT register HSB 7 6 5 4 3 2 1 o LSB R#32 SX7 SX6 SX5 SX4 SX3 SX2 SXl SXO R#33 0 0 0 0 0 0 0 SX8 SX} Basic point R#34 SY7 SY6 SY5 SY4 SY3 SY2 SYl SYO SY R#35 0 0 0 0 0 0 SY9 SY8 R#45 I - I - I - 1r:1XS I- I - I - I - ARG I Memory select 83 V9938 MSX-VIDEO USER'S MANUAL 4.12.3 Executing the POINT command MSB 7 6 5 4 3 2 1 0 LSB R#46 0 1 0 0 I- I- I- - I CMR Status registers S#2 I- - I- I- I- - I -I~ Set to 0 at end of command S#7 0 0 0 0 C3 C2 Cl CO Color code (G4, G6) S#7 0 0 0 0 0 0 Cl CO Color code (G5) S#7 C7 C6 C5 C4 C3 C2 Cl CO Color code (G7) 5. Speeding up the processing of commands The processing of commands can be speeded up by the following two methods. 5.1 Inhibit the display of sprites If bit 1 of Register R#8 (SPD) is set to 1, processing for sprites can be used for commands instead: and therefore the command execution is faster. 5.2 Inhibit the screen display If bit 6 of Register R#l (BL) is set to 0, processing for the screen can be used for commands instead; and therefore the command execution is faster. 84 V9938 MSX-VIDEO USER'S MANUAL 6. Conditions of registers after command execution After commands on the MSX-VIDEO are executed, the conditions of the registers will be as listed in the following table. SX SY DX DY NX NY CLR CMR H CLR L ARG HMMC - - - * - # - 0 - - YMMM - * - * - # - 0 - - HMMM - * - * _. # - 0 - - HMMV - - - * - # - 0 - - LMMC - - - * - # - 0 - - LMCM - * - - - # * 0 - - LMMM - * - * - # - 0 - - L~1MV - - - * - # - 0 - - LINE - - - * - - - 0 - - SRCH - - - - - - - 0 - - FSET - - - - - - - 0 - - FaINT - - - - - - * 0 - - - Unchanged * Coordinate at command end (SY*, DY*) or color code # The count (NYB) when the end of the screen was detected Note: The values for SY*, DY* and NYB are the dots, as substituted for N in the equations below. sy* SY + N DY* DY + N (DIY 0) sy* SY - N DY* DY - N (DIY 1) NYB NY-N ( "LINE"command ==> i f MAJ=O then N=N-l ) 85 V9938 MSX-VIDEO USER'S MANUAL SPRITES The MSX-VIDEO can be used to display 32 sprites. The size of the sprites are 8 x 8 dots or 16 x 16 dots. The size in the horizontal direction of a sprite is 1/256 of the screen. The sprites may be placed anywhere on the screen. Since the sprites are handled in a conceptually independent screen, they do not affect the data within other screens. (Sprite Screen) (0,255)* (255,255)* (X, y) D Sprite 1 I Sprite I (0,191) I I CRT .re·ldiSPl.yed (255,191) or ~--------~ (0,211) t ~------------~----------------~ L____ J Sprite or (255,211) CRT area undisplayed + (0 ,254) (255,254) *The y-coordinate of the upper edge of a sprite is 255. The MSX-VIDEO has two sprite display modes. 'l'he sprite display mode is automatically selected according to the screen display mode. SPRITE MODE 1: GRAPHIC 1, GRAPHIC 2, MULTICOLOR SPRITE MODE 2: GRAPHIC 3, GRAPHIC 4, GRAPHIC 5, GRAPHIC 6, GRAPHIC 7 86 V9938 MSX-VIDEO USER'S MANUAL 1. SPRITE MODE 1 (Gl, G2, MC) 1.1 Characteristics of SPRITE MODE 1 In SPRITE MODE 1, there are 32 sprites, numbered #0 to #31. The sprites assigned the lower numbers have a higher priority. On a single CRT horizontal line, up to 4 sprites with the highest priority are displayed, and the overlapping portions of sprites with lower priorities are not displayed. r .......· .. ~ ;#6: o When two sprites collide (their pattern color 1 portions have overlapped), this condition may be detected since bi t 5 of status register S#O is set to 1. In addition, if there are five or more sprites on one horizontal line, bit 6 of status register S#O will be set to 1, and the lower-order five bits will be set to the number of the fifth sprite. 1.2 SPRITE MODE 1 display (Gl, G2, MC) To display sprites, use the following controls. - Spr i te siz e R#l bit 1 SI = 1: 16 x 16 dots S I = 0: 8 x 8 do t s - Sprite magnification R#l bit 0 MAG 1: Double-size MAG = 0: Normal - Setting the sprite pattern generator table Set the sprite's pattern in the Sprite Pattern Generator Table of the VRAM (#0 to #255). - Setting the sprite attribute table Set the sprite's attributes (its coordinates, pattern number, and colors) in the Sprite Attribute Table of the VRAM (#0 to #31). 1.3 Sprite Attribute Table (Gl, G2, MC) The Sprite Attribute Table is an area in the VRAM that contains the display (x- and y-) coordinates, colors, and pattern numbers of the 32 sprites. Each sprite has four bytes of attribute data. 87 V9938 l-lSX-VIDEO USER'S MANUAL MSB 7 6 5 4 3 2 1 o LSB Y-coordinate (0 to 255) Sprite attribute table base address X-coordinate (0 to 255) Pattern number (0 to 255) Attribute area for sprite :ftO EC I I I I 0 0 0 Color code Attribute area for : T: I sprite n .------jJ- II 'I Attribute area for spri te #31 - Y-coordinate (0 to 255) Specify the y-coordinate of the sprite. If the value for the sprite's y-coordinate is set to 208, all sprites with lower priority will not be displayed. For example, if spri te no's y-coordinate is set to 208, sprites UO to :ft31 will not be displayed. - X-coordinate (0 to 255) Specify the x-coordinate of the sprite. - Pattern number (0 to 255) Specify the sprite ~attern number in the sprite pattern generator table. If the sJ.ze of the sprite is 16 x 16, there will be four sprite pattern numbers corresponding to one sprite. In this case, you may specify anyone of the four sprite pattern numbers. In the above manner, if all sprites are 8 x 8, there will be 256 possible patterns; however, if all sprites are 16 x 16, there will be 64 possible patterns. - Color code (0 to 15) Specify the color code for pattern color 1. The color code for pattern color 0 will be transparent. - EC (Early clock) When this bit is set to 1, the 32 dots of the sprite are shifted to the left. In other words, when this function is used, the sprite is moved to the left, one dot at a time, from the left edge of the screen. I Left edge of CRT :~ 32 dots ~ Sprite 88 V9938 MSX-VIDEO USER'S MANUAL 1.4 Sprite Pattern Generator Table (Gl, G2, Me) The Sprite Pattern Generator Table is an area in the VRAH to specify the sprite patterns (its appearance). The beginning (head) address of this area must be specified in register R#6 (Sprite Pattern Generator Table Base Address Register). The pattern for each sprite must be written in this area. Eight bytes are used for each pattern, for a total of 256 patterns. Each of the 256 patterns are assigned a sprite pattern number from #0 to #255; if the sprite size is 8 x 8 dots, each sprite has one pattern, and if the sprite size is 16 x 16 dots, each sprite has four patterns. VRAM - 1 byte- Sprite Pattern Generator Table Base Address Pattern #0 Pattern #1 Pattern #255 (Maximum) 89 V9938 MSX-VIDEO USER'S MANUAL 1.5 Example of Data Setting for Sprite Pattern Generator Table (Gl, G2, Me) (X=l, 0=0) N=O, 1, • • • , 255 (Pattern Name Table Base Address for N=O) MSB LSB 76543210 Address Example of 16 x 16 Sprite OOOOOOOX 8N OOOOOXXX 8N+! OOOOOOOXXOOOOOOO OOOXXXXX OOOOOXXXXXXOOOOO OOOOXXXO Pattern number 0 OOOXXXXXXXXXXOOo OOOOXXOX OOOOXXXOOXXXOOOo OOOOXXOX OOOOXXOXXOXXOOOo OOOOXXXO OOOXXXXX . 8N+7 OOOOXXOXXOXXOOOo OOOOXXXOOXXXOOOo OOOXXXXXXXXXXOOo OOXXXXXX OOXXXXXXXXXXXXOo OXXXXXXX OXXXXXXXXXXXXXXo XXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXX Pattern number 1 XXXXXXXXXXXXXXXx OOXXXXOO OOXXXXOOOOXXXXOo OOOXXOOO OOOXXOOOOOOXXOOo 00000000 0000000000000000 00000000 0000000000000000 XOOOOOOO XXXOOOOO XXXXXOOO OXXXOOOO XOXXOOOO Pattern number 2 ~ XOXXOOOO OXXXOOOO ~ XXXXXOOO XXXXXXOO XXXXXXXO XXXXXXXX XXXXXXXX Pattern number 3 OOXXXXOO OOOXXOOO 00000000 00000000 If the sprite size is 16 x 16, the pattern number specif ied in the sprite attribute table can be any of the numbers from #0 to #3. 90 V9938 MSX-VIDEO USER'S MANUAL 2. SPRITE MODE 2 (G3, G4, G5, G6, G7) 2.1 Characteristics of SPRITE MODE 2 In SPRITE MODE 2, there are 32 sprites, numbered #0 to #31. The sprites assigned the lower numbers have a higher priority. On a single CRT horizontal line, up to 8 sprites with the highest priority are displayed, and the overlapping portions of sprites with lower priorities are not displayed. When two sprites collide (their solid portions have overlapped), this condition may be detected since bit 5 of status register S#O is set to 1. When this occurs, the coordinates of the collision will be set in status registers S#3 to S#5. In addition, if there are nine or more sprites on one horizontal line, bit 6 of status register S#O will be set to 1, and the lower-order five bits will be set to the number of the ninth sprite. The colors of the sprite may be specified for each horizontal line. The sprite priorities may be cancelled by setting the CC bit of the attribute table, and if sprites overlap, a logical OR may be done on the colors of the sprite. In other words, in SPRITE MODE 1, while only two colors may be displayed, in SPRITE MODE 2, four colors may be displayed. 2.2 SPRITE MODE 2 display (G3, G4, G5, G6, G7) To display sprites, use the following controls. - Sprite size R#l bit 1 SI 1: 16 x 16 dots 81 = 0: 8 x 8 dots 91 V9938 MSX-VIDEO USER'S MANUAL - Sprite magnif ication R#l bit a MAG = 1 : Double-size MAG = 0: Normal - Sprite display R#8 bit 1 SPD = 1: Disable SPD = 0: Enable - Setting the sprite pattern generator table Set the sprite's pattern in the Sprite Pattern Generator Table of the VRAM (#0 to #255). - Setting the sprite color table Set the sprites' color, EC, CC, and IC in separate lines of the Spri te Color Table of the VRAM. - Setting the sprite attribute table Set the sprite's attributes (its coordinates, pattern number, and colors) in the Sprite Attribute Table of the VRAH (#0 to #31). 2.3 Relationships between the VRAM Tables (G3,G4,G5,G6,G7) Sprite Sprite Sprite Pattern Color Table Attribute Table Generator Table a Base #0 (4 bytes) Address Pattern itO #0 4 (8 bytes) (16 bytes) #1 (4 bytes) 8 8 All possible Pattern #l • combinations (8 bytes) 16 16 Pattern #2 (8 bytes) #l 24 (16 bytes) 32 496 #31 (16 bytes) 2040 124 Pattern #255 # 31 (4 by te s) (8 bytes) 512 128 2048 2.4 Sprite Attribute Table (G3, G4, G5, G6, G7) The Sprite Attribute Table is an area in the VRAM that contains the 92 V9938 MSX-VIDEO USER'S ~mNUAL display (x- and y-) coordinates, and pattern numbers of the 32 sprites. Each sprite has four bytes of attribute data. MSB 7 6 5 4 3 2 1 o Lffi Sprite attribute table Y-coordinate (0 to 255) base address X-coordinate (0 to 255) Pattern number (0 to 255) Attribute area for sprite #0 Reserved Attribute area for sprite #1 Attribute area for sprite #31 - Y-coordinate (0 to 255) Specify the y-coordinate of the sprite. If the value for the sprite's y-coordinateis set to 216, all sprites with lower priority will not be displayed. For example, if sprite #lO's y-coordinate is set to 216, sprites #10 to #31 will not be displayed. - X-coordinate (0 to 255) Specify the x-coordinate of the sprite. - Pattern number (0 to 255) Specify the sprite ~attern number in the sprite pattern generator table. If the SIze of the sprite is 16 x 16, there will be four sprite pattern numbers corresponding to one sprite. In this case, you may specify anyone of the four sprite pattern numbers. In the above manner, if all sprites are 8 x 8, there will be 256 possible patterns; however, if all sprites are 16 x 16, there will be 64 possible patterns. r-- This bit is always set to 1. R#5 rIA-1-4~I-A-1-3rIA-1-2~I-A-l-lrIA-l-O~I-A~~~-l~l~l~1 Spirte attribute table R#ll o 0 0 0 0 0 IAl61A151 base address register 93 V9938 MSX-VIDEO USER'S MANUAL 2.5 Sprite Pattern Generator Table (G3,G4,G5,G6,G7) The Sprite Pattern Generator Table is an area in the VRAM to specify the sprite patterns (its appearance). The beginning (head) address of this area must be specified in register R#6 (Sprite Pattern Generator Table Base Address Register). The pattern for each sprite must be written in this area. Eight bytes are used for each pattern, for a total of 256 patterns. Each of the 256 patterns are assigned a sprite pattern number from #0 to #255~ if the sprite size is 8 x 8 dots, each sprite has one pattern, and if the sprite size is 16 x 16 dots, each sprite has four patterns. VAAM ~ 1 byte ~ Sprite Pattern Generator Table Base Address Pattern #0 Pattern #1 Pattern #255 (Maximum) 94 V9938 MSX-VIDEO USER'S MANUAL 2.6 Sprite Color Table (G3, G4, G5, G6, G7) - In SPRITE MODE 2, the color for sprite color pattern 1 may be specified on each line (sprite color pattern 0 will always be transparent). In addition, the sprite priority, collision detection, and EC (Early Clock) may be cancelled or enabled. The base address of the Sprite Color Table will always be automatically calculated by subtracting 512 (decimal) from the base address of the Sprite Attribute Table. MSB 7 6 5 4 3 2 1 o LSB o EC CC IC 0 Color code Line 1 1 EC CC IC 0 Color code Line 2 Color Table for Sprite #0 15 EC Icc IIC I 0 Line 16 , 496 EC CC IC 0 Color code Line 1 497 EC CC IC 0 Color code Line 2 Color Table for Spri te #31 511 I EC Icc IIC I I Color code 0 I Line 16 Sprite Attribute Table Base Address Sprite Color Code (0 to 15) f or each 1 ine Collision Detect l=No O=Yes Prior i ty Enable l=No O=Yes Display 32-dot shift left l=Yes O=No 95 V9938 MSX-VIDEO USER'S MANUAL 2.7 About the Sprite Priority Order In SPRI'I'E t-l0DE 2, if the CC bit of the Color Table is set to 1, the sprite priority order is cancelled. In the above manner, the portions where CC is set to 1 (for each line) will be displayed only on horizontal lines where sprites with a lower number exist. This is diagrammed in the figure below. Note that in this case, if there are more than 8 sprites on the same line, the ninth sprite and above will not be displayed as explained earlier. :0: Sprite #X-l r---------------, ; ; . ~~~!_t_:_!~_~: r~~:~::--~~---, , I I • "0' ....... ! .......... ! ..... I I I I I I !........ !..... !.I ....... I.! ...... . I I I I I I I I II I I • • I I • • I I • • I I • • I CC=All 0 I I • •••••••• • I I I I • ••••••••• • I I L _ _ _ _ _ _ _ _ _ _ _ _ .I 1._------------"' CC=All 1 CC=All 1 For the portions of the sprite in which CC is set to 1, even if a sprite having the number which is closest to that sprite has CC=O overlaps the sprite, the collision is not detected. For overlapping sprites, a logical OR is done on the color codes for display. Example of three sprites being displayed in seven colors Spri te #X 0 CC=All 0 ----1 -----' MSB 11 I 0 I 0 I 0 I LSB Color codes all 8 r-----I 4 MSB LSB Spri te #X+l I 0 11 I 0 I 0 I Color codes all 4 .: I L.. _ _ _ _ _ _ _ _ _ _ _ _ _ _ ...J , CC=All 1 .,,,..--- ..... ---- - .. _-_ .......,,, MSB LSB Spri te #X+2 l_________ G I 0 I 0 11 I 0 I Color codes all 2 CC=All 1 96 V9938 MSX-VIDEO USER'S ~~NUAL Example of overlapping the above sprites 12 4 4 14 6 8 8 10 2 2 In SPRITE r.IODE 2 In SPRITE MODE 1 -No collision -Collision detection detection 2.8 Sprite Collision If CC is set to 0 and the sprite with color portion non-O overlaps, a sprite collision is detected. If sprite collision is detected, bit 5 of status register S#O is set to 1. This bit is reset to 0 when S#O is read. MSB 7 6 5 4 3 2 1 o LSB S#O C If a sprite collision occurs and neither the mouse flag (MO) nor the light pen flag (LP) of register R#8 are set, status registers S#3 to S#6 will be set to the coordinates of the collision. MSB 7 6 5 4 3 2 1 o LSB S#3 X7 X6 X5 X4 X3 X2 Xl XO S#4 S#5 1 1 1 1 1 1 1 X8 0- Collision x-coordinate Y7 Y6 Y5 Y4 Y3 Y2 Yl YO S#6 1 1 1 1 1 1 Y9 Y8 0- Collision y-coordinate If status register S#5 is read, the contents of status registers S#3 to S#6 are reset. The values that are contained in status registers S#3 to S#5 will contain offsets according to the following formulas. X (S#4,S#3) Y (S#6, S#5) Collision coordinates X=XC+12 Y=YC+8 97 V9938 MSX-VIDEO USER'S MANUAL 3. Setting the Sprite Colors In all GRAPHICS modes other than GRAPHICS 7 mode, the color codes for sprites are common to all modes. The sprite display color is determined by the value in the palette register. In GRAPHICS 7 mode, the sprite colors are fixed and are not affected by the palette register. The sprite colors in GRAPHICS 7 mode are shown in the following table. Color code Green Red Blue C31 C21 CII CO G21 GIl GO R21 RII RO B21 BII BO a a a a a a a a a a a a a a a a 1 0 a 0 0 a 0 a 1 a 0 0 1 a a a a a 1 1 a a a a a 1 1 a a a a I I 0 I a a 1 a a a 1 1 a a a a a a a 1 a 1 a 1 1 a a a a I a a 1 1 a a 1 1 0 I 1 a 0 a a I 1 1 a 1 1 a 1 1 a I a I a a a 1 a a 1 1 1 a I a I a a 1 a a a a a a I I 1 I a 1 a a 0 a 1 1 1 a 0 a I a 1 1 a a a 1 1 1 I I 1 I 1 a a 1 1 1 a a a a a a 1 1 a 1 1 1 1 a a a 1 1 1 1 1 1 a 1 I 1 1 1 1 a a a 1 1 1 1 1 1 1 1 1 1 1 I 1 TP and Sprites By controlling TP (Bit 5 of register R#8), color code a will be specified in the following manner. The color will affect the sprites. TP=O Color code a will be treated as invisible. Sprite color part a will not be displayed, and if sprites overlap, a sprite collision will not be detected. TP=1 Color code a will be the color that is specified in the palette register. (In GRAPHICS 7 mode only, R=O, G=O, and B=O will be always set). If the sprite color part a overlaps, a sprite collision will be detected. 98 V9938 MSX-VIDEO USER'S MANUAL POINTING DEVICES 1. Light pen We will explain the light pen function of the MSX-VIDEO below. To use the light pen, set bit 7 of register R#8 to 0 and bit 6 to 1. MSB 7 6 5 4 3 2 1 o LSB R#8 Mode register 2 I Light pen enable o Mouse disable In addition, if you want to enable an interrupt when the light pen has detected light, set bit 5 of register R#O to 1. This interrupt is reset if status register S#l is read. MSB 7 6 5 4 3 2 1 o LSB su StatuE register 1 1: Switch pressed 0: Switch not pressed 1: Light detected 0: Light not detected The coordinates at which the light pen detected light will be set in status registers S#3 to S#6. The data set in these registers are correct as long as status register S#5 is not read. MSB 7 6 5 4 3 2 1 o LSB S#3 IX7 X6 X5 IX4 X3 X2 Xl Ixo Column register low S#4 I 1 1 1 I 1 1 1 1 IX8 Column register high S#5 Row register low S#6 1 1 1 1 1 1 y2 Y8 Row register high This bit shows the FIELD number when read. 0: 1st field 1: 2nd field 99 V9938 MSX-VIDEO USER'S MANUAL Flowchart of using light pen to detect coordinates LIGHT PEN Enable light pen (Ria bit 7=0, bit 6=1) FI ash Detect r-------------------~~ Read status register il NO(FL=O) Read status register i3 Read status register i4 Read status register i6 Read status register i5 100 V9938 MSX-VIDEO USER'S MANUAL 2. Mouse We will explain the mouse function of the MSX-VIDEO below. Because the mouse uses the Color Bus of the MSX-VIDEO, when you use the mouse, you cannot use the MSX-VIDEO Color Bus for any other purpose. To use the mouse, set bit 7 of register R#8 to 1 and bit 6 to O. MSB 7 6 5 4 3 2 1 o LSB R#8 Mode register 2 Light pen disable Mouse enable When bit 7 of register R#8 is set to 1, the direction of the Color Bus is automatically changed to input. You may know if the mouse button has been switched ON and OFF by reading status register S#l. These register will be reset to 0 after being read. MSB 7 6 5 4 3 2 1 o LSB su Status register 1 1: Switch 1 pressed 0: Switch 1 not pressed 1: Switch 2 pressed 0: Switch 2 not pressed The relative coordinates of the mouse's movement are set as two's complement data in status registers S#3 and S#5. MSB 7 6 5 4 3 2 1 o LSB S:ff3 IX7 IX6 IX5 IX4 IX3 IX2 IXI Ixo I Column register low 8#5 IY7 IY6 IY5 IY4 IY3 IY2 IYl lyO I Row register low When 3 or 5 is set in register R#15, the mouse count is not done. When status registers S#3 and S#5 are read or when counting is to begin, the value in register R#15 must be changed. 101 V9938 MSX-VIDEO USER'S MANUAL SPECIAL FUNCTIONS 1. Alternate display of two graphics screen pages Two graphics screen pages may be alternately displayed (in GRAPHIC 4 to GRAPHIC 7 modes) automatically. The pages that will be alternately displayed are as follows. GRAPH IC 4 and GRAPH IC 6 and GRAPHIC 5 modes GRAPH IC 7 modes PAGE 0 ] PAGE 0 PAGE 1 PAGE 2 PAGE 3 ] PAGE 1 ] 1.1 How to use register R#13 A display time period of between 166 ms and 2053 ms may be specified for each page. - Specify the odd page in the pattern name table base address (register R#2). Specify the ON time (the interval in which the even page is displayed) and the OFF time (the interval in which the odd page is displayed) in register R#13. * For the values used in the timings, refer to the chart in the section on TEXT 2 MODE. l>'!SB 7 6 5 4 3 2 1 o LSB R#l3 Blinking Period register ON time OFF time 102 V9938 MSX-VIDEO USER'S MANUAL 1.2 How to use the EO bit The EO bit, bit 2 of register R#9, is used to alternately display the two graphics screen pages at 60 Hz. - Set the odd page in the Pattern Name Table Base Address (register R#2). - Set bit 2 of register R#9 to 1. MSB 7 6 5 4 3 2 1 o L~ M9 Mode register 3 2. Interlace display The MSX-VIDEO has an interlace display function. 2.1 Displaying the first and second fields on the same page Set the IL bit, bit 3 of register R#9, to 1. 2.2 Displaying the even page in the first field and the odd page in the second field - Set the IL bit, bit 3 of register R#9, to 1. Set the EO bit, bit 2 of register R#9, to 1. - Set the odd page in the pattern name table base address (register R#2). 103 V9938 MSX-VIDEO USER'S MANUAL 3. External Synchronization 3.1 GENLOCK method The GENLOCK method detects the phase differnce between the HSYNC output signal of the MSX-VIDEO and an external HSYNC signal and feeds it back to the system clock. T MSX-VlDEO )--[>0 CSYNC OUT CSYNC OUT V-RESET IN ,t ~VSYNCIN HSYNC OUT t--~',I\I\,------i HSYNC IN H-RESET IN Xtall Xtal2 3.2 Choosing the synchronization mode The Sl and SO bits, bits 4 and 5 of register Ri9, are used to set the synchronization mode of the MSX-VIDEO. MSB 7 6 5 4 3 2 1 o LSB Ri9 lSI Iso I Mode register 3 Sl IsO Sync mode *Ys Purpose 0 0 PC SYNC Sel ect s Normal Display the MSX-VIDEO MSX-VIDEO ( 0) screen 0 1 STD SYNC Appears for transparent S upe r impo se , digi tiz e, parts etc. 1 0 STD SYNC Selects external Display external screen signal (1) 1 1 -- -- -- 104 V9938 MSX-VIDEO USER'S MANUAL 4. Superimpose The MSX-VIDEO can originate a switch signal (*Ys) for superimposing an external video signal and the output of the MSX-VIDEO. - The synchronization of the MSX-VIDEO must be adjusted to the signal to be superimposed. - To input an interlaced video signal, the MSX-VIDEO may also be set up for an interlace display. Output R G B MSX-VIDEO r r r R . , R G External RGB Input G B , B o SW 1 - Ys t VIDEO OSW • 1 I, External Video Input + V ideo Output *Ys selects the external video signal when scanning the transparent portion of the MSX-VIDEO screen. 105 V9938 MSX-VIDEO USER'S MANUAL 5. Digitize function The MSX-VIDEO has a function to read external data over the color bus into the VRAM. The digitize function is available in GRAPHIC 4 to GRAPHIC 7 modes only. - When using a digitizer, the MSX-VIDEO must be synchronized with the external signal as necessary. Digitize Block Diagram (GRAPHIC 7 mode) MSX-VlDEO 4bit AID C7 D3 Green Analog input C6 D2 C5 Dl C4 - DO C3 Ill::: ~ C2 I C1 Red Analog input CO I-- CBDlR f-- Dl - DO DLCLK I I D3 Blue Analog input D2 - Dl - DO OE t r CLOCK Digitize Block Diagram (GRAPHIC 4 mode) MSX-VlDEO C7 f--- C6 f--- C5 f-.-. 4bit AID C4 f---- C3 D3 Video A nalog input C2 D2 C1 Dl CO DO OE t CBDlR DLCLK CLOCK i 106 V9938 MSX-VIDEO USER'S MANUAL Digitize Block Diagram (GRAPHIC 6 model MSX-VIDEO LATCH AID ~------------~D3 VIDEO input ~------------~D2 ~------------~D1 ~------------~DO L--+-----I m '--____1--__---1 D2 '-__+ __ -1 Dl '-______+-____-1 DO CBDIR 1--__----1 DLCLKI--------~----------~--------~ Digitize Block Diagram (GRAPHIC 5 model MSX-VIDEO C7 I- D3 C6 r- D2 C5 r- LATCH - Dl C4 r- - DO C3 ~ C2 ~ C1 ~ -- ----[> t ~ D3 OE CK ~ D2 - Dl - DO J CBDIR DLCLK t 107 V9938 MSX-VIDEO USER'S MANUAL Di gi tiz e contr 01 When the DG bit (bit 6 of register R#O) is set to 1, the MSX-VIDEO initiates input of data from the color bus. This action is automatically performed internally by synchronization with VSYNC. DG from CPU VSYNC Digitize Successive reads into the first and second fields DG from CPU E o E o E o E VSYNC FLAME Digitize Even Odd page page - Bit mask of the color bus The color bus may be a masked using a register R#7. When a bit of R#7 is set to zero, the input value of the corresponding bit on the color bus is set to zero. MSB 7 6 5 4 3 2 1 0 LSB R#7 IM7 IM6 IM5 IM4 1M3 1M2 IMI IMO I The relationships of the bit vary according to the mode as follows. color bus C7 C6 C5 C4 C3 C2 Cl CO GRAPHIC 4 MODE l>13 M2 Ml MO GRAPHIC 5 MODE l>13 M2 Ml MO GRAPHIC 6 MODE M3 M2 Ml MO M3 M2 Ml MO GRAPHIC 7 MODE M7 M6 M5 M4 M3 M2 Ml MO 108 V9938 MSX-VIDEO USER'S MANUAL 6. Color bus The color bus of the MSX-VIDEO is controlled by the MS, DG, and CB bits. The bits and the data flow will be illustrated below. 6.1 Normal di spl ay -- ---- --- - --- - - ---- ---- - -- ---- -------, , , ,, Me; 0(; CR Look up table ~R & ~G () 0 D/A CONVERTER f-------..:B , ~--~---~~ ,,, , I , MOUSE I , External palette re gister LOGIC I , I , D! A converter, etc, I ,, ,,, I , VRAM , ,, I , , I L_ -- _------ __ ----- __ ----- ------- ----- -------' 6.2 Mouse - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --I ,, MS DG CB Look up table R f-------.: & G f-------.: 1 X X DI A COr\VERTER f-------..: B , I I MOUSE I , , LOGIC • I I Mouse I I !, VRAM , ,,,- _____________________________________ J I I 109 V9938 MSX-VIDEO USER'S MANUAL 6.3 Displaying external signals i ----- -- -- - - ---- -- -- -- --------- -------- ---; , MS DG Look up table ~R & r----------: G 0 0 01 A CONVERTER ~B, ,, MOUSE LOGIC II , , , AID converter, etc. ,, : I ,, , VRAM : , :, ------------------------------------, 6.4 Digitize ,r----------------------------------,,, MS DG CB Look up table ~R & f-----+iG 0 1 x 01A CONVERTER f----iB , ,, , MOUSE I I LOGIC ' AID converter, etc. I VRAM ------- - -- - - - - - -- - --- - - - - - - - - - - - - 110 PART 2 MSX-VIDEO DATA PROCESSOR LSI DATA SHEET © NIPPON GAKKI CO., LTD. V9938 MSX-VIDEO Data Sheet 1. MSX-VIDEO 1-1 Overview V9938 (MSX-VIDEO) is a N-channel Silicon Gate MOS, 64-pin shrink DIL plastic package Video Display Processor (VDP). The V9938 is software-compatible with the TMS9918A. 1-2 Features - 5V single power - Output of both Linear RGB and Composite Video signals - 512 colors possible with built-in color palette - Maximum 512 x 424 pixels, 16 colors - Bit-mapped graphics - 256 simultaneously-displayed colors - Supports 16K- to 128K-byte video memory - May be used with 16K x 1 bit, 16K x 4 bit, 64K x 1 bit, and 64K x 4 bit DRAMs - DRAM auto refresh function: 256 addresses, 4 ms - May support an extension video memory - Interfaces for mouse and light pen - Maximum 8 sprites per horizontal line - Different color for each horizontal line of the sprite - Area move, line, and search commands - Logical operation function - Addresses may be specified by coordinates - External synchronization possible - Superimpose possible - Digitization possible - Multi-MSX-VIDEO architecture possible - External color palette by using color bus Note: In this manual, negative logic will be indicated by an asterisk preceding the signal names. III <: \0 \0 W (X) :s: til ><: I <: H CPU I:-ITERNAL DATA BUS V RAM ADR t:J :s: til t"1 0 ><: I t:J <: III H rt CLT INTERFACE tI III INTERFACE t"1 0 til tJ:I ::r CI> VIDEO CPU i-' CI> 0 rt ("J ;0;- MOUSE MOUSE TMG & ....a. TIMING LIGHT PEN LIGHT PEN III \Q i-' 1"1 i-' CONTROL III IV S INTERNAL COLOR BUS COLOR COLOR COLOR BUS I/O COLOR PALETTE ENCODER SPRITE BUS CONTROL CONTROL G R (LINEAR) B 9VIDEO (COMP.) <: ~ ~ W OJ ::=: CIl :>< 21.47727MHz I <: H t:l t"l 0 XTALl XTAU t:l III WR Ri5 ~. ____+=:a::~---__j CSR R/\\· RAS CASO WE:I RAS CAS I I I I tJ All ::=: rt III CIl ::r CASl~ CIl C1) VRAM 128K byte :>< C1) I Decoder I ADO-71+++1I-""*+H-++< III ::l ,---, '"0 GI----' 1-__ J , • G ..... C1) RI----' I • R L __ -l BI----I I • B CSY:;Cr-----, L __ ~ to TV SET '--_ _ _ _ _ _ _ _....JI I Ir--'I ~5 L~ V9938 MSX-VIDEO Data Sheet 2. Pin assignments and functions Pin Pin name no. I/O Function CDO LSB 40 I/O - CPU data bus CDI 39 I/O CD2 38 I/O ~ GND 1 64 XTAL 2 CD3 37 I/O IlJ!CI] 2 63 XTAL 1 CD4 36 I/O mn 3 62 1m vns 4 61 CAS 0 CDS 35 I/O HSYNC 5 6C CiiS1 CSYNC 6 59 CASX CD6 34 I/O BLED 7 58 VCC CD7 MSB 32 I/O - CPUCLK IlmT 8 9 57 56 R/W AD 7 r·10DE 0 29 I - CPU interface mode YS 10 55 AD 6 HODE 1 28 I - select CBDR C7 11 12 54 53 AD 5 AD 4 *CSR 31 I CPU-MSX-VIDEO read strobe C6 C5 13 14 52 51 AD 3 AD 2 *CSW 30 I CPU-MSX-VIDEO write strobe C4 15 50 AD 1 RDO LSB C3 16 49 AD 0 41 1/0 - VRAM data bus C2 17 48 RD 7 RDI 42 I/O C1 18 47 RD 6 RD2 43 I/O co 19 46 RD 5 GND / DAC 20 45 RD 4 RD3 44 I/O VIDEO G 21 22 44 43 RD 3 RD 2 RD4 45 1/0 R B 23 24 42 41 RD 1 RD 0 RD5 46 I/O iNT 25 40 CD 0 RD6 47 I/O D'S 26 39 CD 1 [pjj 27 38 CD 2 RD7 MSB 48 I/O - MODE 1 28 37 CD 3 ADO LSB 49 0 - VRAM address bus MODE 0 csw 29 30 36 35 CD 4 CD 5 ADI 50 0 CSll 31 34 CD 6 VBB CD7 32 33 AD2 51 0 AD3 52 0 AD4 53 0 ADS 54 0 AD6 55 0 AD7 MSB 56 0 - *RAS 62 0 VRAM row address strobe *CASO 61 0 VRAM col umn address strobe 0 (VRAM first half) *CASI 60 0 VRAM col umn addr ess strobe 1 (VRAM second half) *CASX 59 0 VRAM column address strobe X (Expansion VRAM) R/*W 57 0 VRAM write strobe *VDS 4 0 VRAM data select *VDS = Low: Access to VRAM is for display data *VDS = High :Access to VRAM is for other than the above VIDEO 21 0 Composite video signal output G 22 0 - Linear RGB signal output R 23 0 B 24 0 - *YS 10 0 Signal to switch between MSX-VIDEO RGB output and external video signal (When superimposing) *YS = High: MSX-VIDEO output transparent *YS = Low: MSX-VIDEO output opaque BLEO 7 0 Tri-level output (Open drain); primary/secondary field and blanking interval High: Secondary field, active Middle: First field, active Low: Blanking interval 114 V9938 MSX-VIDEO Data Sheet HSYNC 5 I/O Tri-level logic; upper levels (high to middle) for output, lower levels (middle to low) for input High: Non-HSYNC, color burst period Middle: HSYNC or non-color burst period Low: HSYNC input CSYNC 6 I/O Tri-level logic; High: Composi te SYNC output Low: VSYNC input CBDR II a Color bus direction High: Input Low: Output co LSB 19 I/O - Color bus Cl 18 I/O Usually the color code is output; C2 17 I/O during digitize, this bus is used as C3 16 I/O the input port. The high-order bits C4 15 I/O are for mouse input when using the C5 14 I/O mouse. C6 l3 I/O C4 = XA C5 = XB C7 MSB 12 I/O C6 = YA C7 = YB *LPS 26 I Light pen or mouse SW input Low: SW on High: SW off *LPD 27 I Light pen detection input or mouse SW input Low: Light detected or SW on High: Any other condition *DHCLK 2 a Dot clock output for high resolution; 10.74 MHz open drain *DLCLK 3 I/O Dot clock output for low resolution; 5.37 MHz open drain Input may also be done the mode register. This is used for a mul ti-MSX-VIDEO system. XTAL 1 63 I Connect to XTAL or use for connection of an external oscillator XTAL 2 64 I CPUCLK 8 a Outputs 1/6 of XTAL frequency *INT 25 a CPU interrupt output; open drain output Low: interrupt *RESET 9 I Initialize all MSX-VIDEO circuits VCC 58 I 5V power supply GND 1 I Ground Ov GND DAC 20 I Ground OV VBB 33 a Back bias (No connection) ll5 V9938 MSX-VIDEO Data Sheet 3. Electrical characteristics and timing chart 3-1 Absolute maximum ratings Symbol Parameter Rating Unit vee Supply voltage -0.5 to +7.0 V Yin Input vol tage -0.5 to +7.0 V Ts Storage temperature -50 to +125 °e To Operating temperature 0 to + 70 "C 3-2 Recommended operating conditions Symbol Parameter Min. Typ. Max. Unit vee Supply vol tage 4.75 5.00 5.25 V Vss Supply voltage 0 V Ta Ambient temperature 0 70 °e VIL 1 Low-level input vol tage (group 1) -0.3 0.8 V VIL 2 Low-level input vol tage (group 2) -0.3 0.8 V VIL 3 External clock low-level input vol tage (group 3) -0.3 0.8 V VIH 1 High-level input vol tage (group 1) 2.2 vee v VIH 2 High-level input vol tage (group 2) 2.2 vec V .VIH 3 External clock high-level input vol tage (group 3) 3.5 VCC V Notes: Group 1: *CSR, RDO to RD7, CO to C7, *LPS, *LPD, *RESET, *DLCLK Group 2: eDO to CD7, MODE 0, MODE 1, *CSW Group 3: XTAL 1, XTAL 2 The video signals are listed separately Versions A and B of the MSX-VIDEO differ in the following items: Symbol Parameter Min. Typ. Max. Unit VIL 2 Low-level input vol tage (group 2) -0.3 0.6 V VIL 3 External clock low-level input vol tage (group 3) -0.3 0.3 V 116 V9938 MSX-VIDEO Data Sheet 3-3 Electrical characteristics under recommended operating conditions External input clock timing No. Symbol Parameter Min. Typ. Max. Unit 1 fXTAL XTAL clock frequency 20.26 21.48 22.55 MHz 2 TXWH XTAL clock high-level pulse width 5 ns 3 TXWL XTAL clock low-level pulse width 5 ns 4 TXR XTAL clock rise time 10 ns 5 TXF XTAL clock fall time 10 ns 6 TXD2l XTAL clock delay time 2 - 7 1 0 ns 7 TXD12 XTAL clock delay time 1 - 7 2 0 ns 8 TLIXD *DLCLK (input) - XTAL clock delay time 20 50 ns 9 'IWl XTALl pulse width 12 ns 10 'IW2 XTAL2 pulse width 20 ns 11 TPD XTAL1-XTAL2 relative delay time 15 24 ns I. I I 4i~2-U--5 I I ~~'====:\',..iI~====l3~===~I---E-:r--..====\--_______ :3.c\r XTAL 1 ----.Y1 :-7-1 ~\ I f-- 6 --I ~.;V 4 -.J f-- 2 ---J ~" I ,jlJr----..:===,,1~1:-:.===~3L====.--:'--/r---"\==.......,\_--3.5V XTAL 2 _ _ _ _ _ _ _.Jl!if-:I ,. t-I --\J--,lc''" ==========:::;;;tVL-.----\--'t--- ~ O.8V I i--S---J I DLCLK (input) _ _ _ _ _ _ _ _ _- J X',-===========;;;;;---3.SV . _ O.8V r--9-1 , , :r---..: r---\ F~----''<__------+-I------' \.---------2.0V XTALl ---.J: I \'--_ _--'7~ , ' - - 11---,,- 10 ----: XTAL2 \ i;--\j \. .____...J/-'I'-------'I..-\========-::.-::..----- 2.IlV 117 V9938 MSX-VIDEO Data Sheet *RESET Input timing No. Symbol Parameter Min. Typ. Max. Unit 1 TRESET *RESET low-level pulse width 10 ms ~--_/ RESET I DC characteristics Symbol Parameter Condition Min. Max. Unit VOL 4 Low-level output voltage (group 4) IOL = 1.6 rnA 0.4 V VOL5 Low-level output voltage (group 5) IOL = 1.6 rnA 0.4 V VOL 6 Low-level output voltage (group 6) IOL = 10 rnA 0.4 V VOL7 Low-level output voltage (group 7) IOL = 1.6 rnA 0.4 V VOH4 High-level output voltage (group 4) IOH = 100 uA 2.4 V VOH5 High-level output voltage (group 5) IOH = 60 uA 2.7 V ILl Input leak current 10 uA ILO Output leak current (floating) 25 uA ICC Current consumption 230 rnA Notes: Group 4: CDO to CD7, RDO to RD7, ADO to AD7, *VDS, CBDR, CPUCLK, CO to C7 Group 5: *RAS, *CASO, *CASl, *CASX, RI*W Group 6: *DLCLK, *DHCLK Group 7: *INT Input/output power capacities Symbol Parameter Condition Min. Max. Unit CIN Input power capacity VIN = 0 V 10 pF COUT Output power capacity VOUT = 0 V 10 pF 118 V9938 MSX-VIDEO Data Sheet External output clock timing No. Symbol Parameter Condition Min. Typ. Max. Unit 8 fDHCLK *DHCLK frequency 10.13 10.74 11.28 MHz 9 THWL *DHCLK low-level pulse width 20 ns 10 THF *DHCLK fall time 25 ns 11 fDLCLK *DLCLK frequency CL = 50 pF 5.06 5.37 5.64 MHz 12 TLCML *DLCLK (output) low- level pulse width 60 ns 13 TLOF *DLCLK (output) fall time 15 ns 14 THLOD *DHCLK-*DLCLK (output) delay time -15 15 ns 15 fCPUCLK CPUCLK frequency 3.37 3.58 3.76 MHz 16 TOlH CPUCLK high-level pulse width CL = 110 ns 17 TOlL CPUCLK low-level 100 pF pulse width 110 ns 18 TCR CPUCLK rise time 25 ns 19 TCF CPUCLK fall time 25 ns 20 TLOHXD *DLCLK (output) high- XTAL delay time CL = 50 pF 20 50 ns 21 TLOLXD *DLCLK (output) low- XTAL delay time 20 50 ns Note: The values shown for *DHCLK and *DLCLK assume that RL 1 k ohm. 119 V9938 MSX-VIDEO Data Sheet I 8-----1·1 10--:I ~9-i :' DHCLK N ,, I I '-----' Y I \ . .___ I 14-1 ~I~--------------- II ----------------~ : IJ--j r-- I I ~----- 12 ' g:~~~ ____~ ~-.---------J~ ro' I -J 20 r-- f-- 21--1I I I XTAL2 I. , ]5 -I I I I. ..I , :--19 , ,t r 18-j 16 I I I I 17 CPUCLKJ External output clock timing 120 V9938 MSX-VIDEO Data Sheet CPU-MSX-Video Interface No. Symbol Parameter Condition Min. Typ. Max. Unit 1 TASR Address setup time (related to *CSR) 0 ns 2 TASW Address setup time (related to *CSw) 30 ns 3 TAHW Address hold time 50 ns 4 TDSW Da ta setup time 30 ns 5 TDHW Data hold time 30 ns 6 TCSW *CSW pulse width 186 700 2000 ns 7 TCSR *CSR pulse width 186 700 2000 ns 8 TRAC Data access time CL = 100 150 ns 9 TPlTX, A Data invalid time 300 pF 0 ns 10 TPlTX Data disable time 65 100 ns 11 'lWIW *CSW pul se width high, 2nd-1st, 1st-2nd byte 2 us 12 'lW2W *CSW pulse width high, 2nd-3 rd, 3rd-3 rd, 3 rd-lst byte 8 us 13 TSIRW *CSR-*CSW setup time, 1st-1st byte 2 us 14 TS2RW *CSR-*CSW setup time, 3 rd-lst byte 8 us 15 TSIWR *CSW-*CSR setup time, 2nd-1st byte 2 us 16 TS2WR *CSW-*CSR setup time, 2nd-3 rd byte 8 us 17 TWIR *CSR pulse width high, 1st-1st byte 2 us 18 'lW2R *CSR pulse width high, 3rd-lst, 3 rd-3 rd byte 8 us N~~----- I I -_-_-_-_-_- _-"J-tY: _ 6_-_-_-_-_-_-_-_- I I I I I-- 2 -1 I - - 3 -----I I I I : MODE _ _ -J){ )( : DATA CPU-MSX-VIDEO write cycle interface 121 V9938 MSX-VIDEO Data Sheet N I : ,,,,",- - - - - - - - - / 1 ,~I- - - - - - - - - 1 , t VII 1--1--1: I I MODE _---JX,-----+---------1~;I---~X'-----I--- I , ' , I I I ~ 8 ----' 9 --.-- t-- 10 --' I " DATA ------------~{~__V_AL~~;~-D-~-A-~>c~----~1- CPU-MSX-VIDEO read cycle interface ,'-11.-4, :--14 ---: w-w , I I I :--16 ----: ~ 18 - - { Wi I I i I I U V- t-- 18 ~ "1 ~ t--17----: w I-- 13 15 -- -U \J \J Note: The numbers n (where n = 1, 2, 3) marked in the pulses show the byte order (lst, 2nd, 3rd) sent from the cpu. MSX-VIDEO register read timing ,_ 1 2 _, , , -11-. I I 10.----12_ I I , t---12~ , I I I I I Note: The numbers n (where n = 1, 2, 3) marked in the pulses show the byte order (lst, 2nd, 3rd) sent from the cpu. MSX-VIDEO register write timing 122 V9938 MSX-VIDEO Data Sheet MSX-VIDEO-VRAM interface No. Symbol Parameter Condition Min. Typ. Max. Unit 1 TRC Memory read/wri te cycle time 266 279 2 TPC Page mode cycle time 177 186 4 TDSC Read data setup time 20 5 TDHC Read data hold time 0 6 TRP *RAS precharge time 90 7 TRAS *RAS pulse width 130 8 TRSH *RAS hold time 60 9 TCAS *CAS pulse width 85 10 TCSH *CAS hol d time 140 11 TRCD *RAS-*CAS delay time 40 12 TCRP *CAS-*RAS precharge time 90 13 TRARD Row address-*RAS delay time 50 14 TRAH Row address hold time 12 15 TCACD Column address-*CAS delay time 0 16 TCAH Column address hold CL = time 150 pF 100 ns 17 TCAR Column address hold time (for *RAS) 130 18 TRCD Read command-*CAS delay time 30 19 TRCH Read command hold time 30 20 WCH Write command hold time 70 21 WRH Write command hol d time (for *RAS) 150 22 WP Write command pulse width 120 23 TRWL Write command-*RAS read width 150 24 TOVL Write command-*CAS read width 120 25 TDCD Write data-*CAS delay time 0 26 TDH Write data hold time 50 27 TDHR Write data hold time (for *RAS) 110 28 WCD Write command-*CAS delay time 30 29 TCP *CAS precharge time (page mode cycle) 70 Note: The above specifications apply to version C of the V9938. The following items apply to Versions A and B. To distinguish Versions A, B, and C, refer to page 134 of this data sheet. 123 V9938 MSX-VIDEO Data Sheet Version No. Symbol Parameter A B 14 TRAH Row address hold time 10 10 15 TCACD Column address-*CAS delay time -5 0 26 TDH .Write data hold time 30 30 27 TDHR write data hold time (for *RAS) 70 70 - TRSH* *RAS hold time during read only 15 No rating - TRAS* *RAS width dur ing *RAS ref resh only 60 No rating I I I I i ---~ :-11 I I : -I 7 s 11 I I L : - - 6-------1 I I I 110 •' : : :: 17~ : : 12 I I I ~9~ ' r - - . ; . I - - - - - - - - - IiI N I " I I y I ' II I I ' ' I I I ~ I I I I I lS, ' I , 13 -11--:-14 - I - l 1-1-16---: ' i ADO-7 200t iRe. Xl+o= ~ I r: I I I '24 I I I ,23 •I R/W f..zs.J \'1, , 20 22 :yI I , 21 I , • i RDO-7 -Open : l : I : I- >--- 14 --<... I - f-- 16 --' : 1 A[)O-7 X: ',m I , C"I"m« XxxXxxxx I , I I r- 1H -1 : ~19-: R(Vi' __J ~i :: ~ >--- I I '....I :--4 ---t ... ,) I RDO-7 -------open--------<{ Valid Data VRAM read cycle , I , I 1 !. , ------------....: ~ 6----i -----~N'~11~ , : : : I I I I : i , ' ? '-' ' I II Y L CASO,l,X :: I I : I -17 I I \ r-- ~r-N:, ---Jy: I, i i i ;,\:': I ,. ! • I 9 I 0--29---'I I I [. : ', 1 I I :-9 J II : I::: : 15 " I ' 1 I 15, I , , ~ 13--1 1-:--14----1~ t-t--16--, : 1 -; t-r-16--l I' ~ : I I : .,.."'~I........".,-"..,,.-,or'7 XXXXXX I , -_ _ _ _ : I: ADO-7 zyX Row ~ I I : I : I I I I I ,.,18"" , I ...-19 ....... R/W ----------..1. -; , :: " : : I :i " : :' : ~ I I I ~4~ ~5~I I ~4~ ~5~I I I I I I RDO-7 ---------- Open ------«valid Data) ~----- VRAM page mode cycle 125 V9938 MSX-VIDEO Data Sheet Composite video signal output level Versions A and B Symbol Parameter Condition Min. Typ. Max. Unit VWHITE White level output vol tage 2.20 2.55 2.90 V VWHITE White level output voltage (B/W) (using Black & white) 2.30 2.65 3.00 V VB LACK Black level output vol tage 2.00 2.30 2.70 V VSYNC Sync level output vol tage RL = 1.90 2.20 2.60 V VCB Color burst pulse width 470 ohms 0.14 0.19 0.24 V VP-P Electric potential difference between white and sync levels 0.24 0.35 0.44 V VP-P Electric potential (B/W) difference between white and sync levels (using black & whi tel 0.34 0.45 0.54 V Note: The typical values listed in the above table assume that VCC = 5.00 V and TA = 25 ~. Version C Symbol Parameter Condi tion Min. Typ. Max. Unit VWHITE White level output voltage 2.20 2.60 3.00 V VWHITE White level output vol tage (B/w) (using Black & white) 2.50 2.80 3.20 V VBLACK Black level output vol tage 1.80 2.20 2.50 V VSYNC Sync level output vol tage RL = 1.60 2.00 2.30 V VCB Color burst pul se width 470 ohms 0.16 0.22 0.28 V VP-P Electric potential difference between white and sync levels 0.40 0.60 0.75 V VP-P Electric potential (B/W) difference between white and sync levels (using black & white) 0.60 0.80 0.95 V Note: The typical values listed in the above table assume that VCC = 5.00 V and TA = 25 DC. 126 V9938 MSX-VIDEO Data Sheet RGB output level Symbol Parameter Condition Min. Typ. Max. Unit VRGB 7 RGB maximum output Vol tage RL = 470 ohms 2.5 2.8 3.2 V VRGB 0 RGB minimum output voltage RL = (Black level> 470 ohms 1.7 2.0 2.4 V VP-P RGB el ectr ical potential RL= difference VRGB7-VRGBO 470 ohms 0.65 0.8 1.00 V DRGB RGB electrical potential RL= difference P-P 470 ohms 5.0 % Note: The typical values listed in the above table assume that VCC = 5.00 V and TA = 25 ~. Synchronize signal output level Symbol Parameter Condition Min. Typ. Max. Unit VTLVH 1 Tri-level output high- RL = level BLED 1 k ohm 4.5 VCC V VTLVM 1 Tri-level output RL = intermediate level BLED 1 k ohm 2.5 3.5 V VTLVL 1 Tri-level output 1 ow- RL = level BLED 1 k ohm 0.4 V VTLVH 2 Tri-level output high- level HSYNC, CSYNC No load 4.5 VCC V VTLVM 2 Tr i-level output intermediate level HSYNC, CSYNC No load 2.7 3.7 V VTLVL 2 Tri-level output low- level HSYNC, CSYNC No load 0.8 V VYH *Ys output high level IOB = 100 uA 2.4 V VYL *Ys output low level IOB = 1.6 rnA 0.4 V ITLVB High-level input current VI = HSYNC, CSYNC 0.4 V -4.0 rnA ITLVL Intermediate level input VI = current BSYNC, CSYNC 0.4 V -2.0 rnA 127 V9938 MSX-VIDEO Data Sheet Composite video signal No. Symbol Parameter Condition Min. Typ. Max. Unit 1 TfCV 1 HSYNC fall time 110 ns 2 '!WHS HSYNC pulse width 4.50 4.70 us 3 TrCV 1 HSYNC rise time 90 ns 4 THS-CB HSYNC color burst delay time 0.40 0.60 us 5 '!WCB Color burst width RL= 2.60 3.30 us 6 TCB-LB Color burst-left border 470 ohms delay time 1.10 1.50 us 7 TrCV 2 VBLACK-VWHITE rise time 90 ns 8 TwLB Left border width CL = 2.4 2.7 us 9 TfCV 2 VWHITE-VBLACK fall time 150 pF 100 ns 10 TwAD Active display area 47.00 47.68 48.00 us 11 TwRB Right border width 2.50 2.80 us 12 TRB-HS Right border-horizontal synchronous delay time 1.20 1.50 us Note: Items 8 and 11 are when Display Adjust is o. RGB signal No. Symbol Parameter Condition Min. Typ. Max. Unit 13 TrRGB RGB signal rise time RL = (VRGBO ~ VRGB7) 470 ohms 60 ns 14 TfRGB RGB signal fall time CL = (VRGB7 ~ VRGBO) 150 pF 60 ns Note: Measurements are 10% to 90%. VWIIITE ---- - - - - - - - - Composite Video 3 4 8 9 10 R,G,B 128 V9938 MSX-VIDEO Data Sheet Synchronize signals No. Symbol Parameter Condi tion Min. Typ. Max. Unit 1 TfSY 1 BLEO intermediate level- low level fall time 100 ns 2 TrSY 1 BLEO low level- intermediate level rise time 140 ns 3 TrSY 2 BLEO low level-high level rise time 220 ns 4 TfSY 2 BLEO high level-low level CL = fall time 50 pF 110 ns 5 TrSY 3 SYNC intermediate level- 6 high level rise time TfSY 3 SYNC high level-intermediate - 300 ns level fall time 1100 ns 7 TrST 4 SYNC low level-intermediate level rise time r- 200 ns 8 TrSY 5 SYNC low level-high level rise time 400 ns 9 TrSY 6 *YS low level-high level rise time 25 ns 10 TfSY 6 *YS high level-low level fall time 25 ns Note: BLEO is the value when RL = 1 k ohm. Times shown are 10 to 90%. 129 V9938 MSX-VIDEO Data Sheet -------VTLYIlI BLEO ------------VTLVMI -- ----- - ---- - VTLVL I 1 __________________________ VTLVI12 ~-----""""'- - - - - - - - - - - - - VTLV:\!2 HSYNC -------VTLVL2 I I I n r--------------- , VTLVH2 , I HSYNC - - - - - - -:- - - - - - - - - - --------VTLV\12 I , I , I I I I --+-- ----- --- -- -- ---- i , VTLVL '2 , I ;---; H 6 t------------------VTLVH2 CSYNC I I , I ,, I !-----II I --i ----- --- - -- -- --- -- -- ----- VTLVL2 I , :-i ~ I , 5 I \ , n _ n n n __ n __ '", ----~, , I I' ------- VYL , I I I ,~, :--;I , 9 10 130 V9938 MSX-VIDEO Data Sheet CSYNC First field CSYNC ,, ; I "'I Ii Ii I: " " ,I Ii --rr- " 4.661:5ec -H---- 4.66 lst'c ~ .1 2.42/1sec j Second field HSYNC 'I II T 2.42/lsec 131 V9938 MSX-VIDEO Data Sheet Color bus No. Symbol Parameter Condition Min. Typ. Max. Unit 1 TDCBO *DLCLK-color bus output CL= delay time 50 pF 100 ns 2 THCBO *DLCLK-color bus output CL= hold time 50 pF 20 ns 3 TSCBI Color bus input setup time - 0 ns 4 THCBI Color bus input hold time - 20 ns I 1 ·1 1 . .: I 1 (~~;I?~' BUS ____~X,.- ------r-~X'- __________ I 1 I 3' :-: I 1 I I ~n~~~r X. . ___________X"'_________ Bus _ _ _ _ _ _ 132 V9938 MSX-VIDEO Data Sheet VDS No. Symbol Parameter Condition Min. Typ. Max. Unit 1 TDVDSL *DLCLK-*VDS low level delay time CL = 50 pF 50 100 ns 2 TDVDSH *DLCLK-*VDS high level delay time 50 100 ns 3 TSVDS *VDS setup time (for *CASO and *CASl) 20 ns 4 THVDS *VDS hoI d time (for *CASO and *CASl) 0 ns I I I I I H, H ---x~' ____________________________~r CASO (or CASl) I I iI I I 4 ~ I I ~ r I VDS ~ 133 V9938 MSX-VIDEO Data Sheet 4. External measurements of package P l.778TYP 64 Pin shrink DIP Note:There are two types (I,II) of section A. J,---19_.05 --.!l TYP A 0-15 Lead material: 42 alloy Lead coating process: solder DIP or Tin (Sn) plating Note: The specifications for this product are subject to change without notice as improvements are made. 5. Version identification INDEX Version indication A version: None B version:B C version:C 134 APPENDIX © NIPPON GAKKI CO., LTD. V9938 MSX-VIDEO Appendix 1. Refresh The V9938 has a Dynamic RAM (DRAM) auto-refresh function which repeats cycl es every 4 ms for 256 addresses. Special consideration must be given when using a 128 address-2 ms cycle, as the usage depends on whether the DRAMs used are 16K or 64K. 1. 16K DRAMs (VR = 0) When the row address and column addresses are seven bits, connect pins ADI to AD7 on the V9938 to DRAM address pins AO to A6. When the row address is eight bits and the column address is six bits, connect pins ADI to AD6 on the V9938 to DRAM address pins Al to A6. Also connect pin ADO to pin A7. When this configuration is used, only addresses AO to A6 of the DRAM are refreshed. 2. 64K DRAMs (VR = 1) Connect pins ADO to ADS and AD7 of the V9938 to pins AD to A6 of the DRAM. Also connect pin AD6 to pin A7. hen this configuration is used, only addresses AD to A6 of the DRAM are refreshed. 1-1 V9938 Refresh Address Output The method of outputting refresh addresses on the V9938 differs depending on the mode being VR or display. Considering the refresh address as (MSB) R7 R6 R5 R4 R3 R2 Rl RO, 256 addresses are refreshed within 4 ms. Refresh address output method V9938 adderss AD7 AD6 ADS AD4 AD3 AD2 ADI ADO VR = '0 ' R5 R4 R3 R2 Rl RO R7 R6 VR = '0 ' , G6, G7 modes Ro R7 R6 R5 R4 R3 R2 Rl VR = '0 ' , non-G6, G7 modes R7 R6 R5 R4 R3 R2 Rl Ro l-1aximum Refresh Cycle 1. 256 cycl e ref resh 4 ms 2. 128 cycle refresh Using addresses other than R7 1.25 ms Using addresses other than R6 1.9 ms Using addresses other than R5 2.2 ms Using addresses other than R4 2.5 ms (worst case) 135 V9938 MSX-VIDEO Appendix 1-2 Example of V9938-DRAM address pin connection and maximum refresh cycle 1. VR = '0' DRAM construction with 7-bit row and column addresses Maximum refresh cycle DRM-I addresses A6 A5 A4 A3A2 Al AO V9938 addresses (AD) 7 I I I I I I I 6 5 4 3 2 1 1.9 ms DRAM construction with 8-bit row address and 6-bit col umn address Maximum refresh cycle DRAM addresses A7 A6 A5 A4 A3 A2 Al AO V9938 addresses (AD) 7 6 5 4 3 2 1 o 2.2 ms (AD) o 6 5 4 3 2 1 7 1.9 ms 2. VR 'I' Maximum ref resh cy cl e G6/G7 Non-G6/G7 DRM-I addresses A7 A6 A5 A4 A3 A2 Al AO Modes Modes V9938 addresses (AD) I7 6 5 4 3 2 1 0 2.5 ms 1.25 ms (AD) I6 7 5 4 3 2 1 0 1.25 ms 1.9 ms (AD) I5 7 6 4 3 2 1 0 1.9 ms 2.2 ms Note: The maximum ref resh cycl e is the value when the DRAM refresh addresses are A6 to AO. 136 V9938 M8X-VIDEO Appendix 2. Examples of VRAM Interface 2-1 16K bytes (l6K x 1) x 8 -= '"""= I i- ~ ~ = i- i- I- ~ = i- I- = = i- I- -- = == - = --- = -- = = - (D l!ill- '" ,..- """ 15r- - - ~I~ ::: eo'" =0'" ~:z: Q 0 Q i- ~~~~E 1(1' I r:'~ O ...... c:t:) (I) C"-lM~Ll":lc.or- ~:::II::~C:::I.I::::H::::::'QQQ c:tc::z::c:tc::::c::t-=tc::t o::cr:c;:t::o::c:t:O:::et::o::o::c::c:t::: u 137 V9938 MSX-VIDEO Appendix - (16K x 4) x 2 V9938 AD7 AD6 AD5 AD4 AD3 A02 ADI ADO IIII 1111 11 AO 1 2 3 4 5 6 7 ~ RAS CAS WE 00012 I I I ~ I I RAS CASll Rlil IJ ROO RDI RD2 RD3 R04 R05 RD6 RD7 77 2-2 32K bytes - 0\ "'" ",":"l :"l :s: (f.l 0- :x: x'<: I n- o:::: I-'ro H ~{Il t:I t<:I X 0 ex> ~ '0 '0 V9938 ro - ::s p.. AD7 1-'. AD6 X AD5 AD4 AD3 ill AD2 ADI ADO IIII IU IIII 1111 III 1111 1111 AO 123 4 56 7 DIN I-' DOUT W RAS CAS WE \.0 RAS CASO RlW I I II I III III III III III ;Qf RDO I - - RD~ RD RD RDg RD RD6 RD7 V9938 MSX-VIDEO Appendix - (64K x 4) x 2 v 9938 AD7 AD6 AD5 AD4 AD3 AD2 ADI ADO 1 III I J & 11 RAS A0123 567 RAS CAS WEDQO 12 I I I W l JJ 1 I CIiSll RM RDO RDI RD2 RD~ RD RD5 RD6 RD7 r'-r 2-4 128K bytes - (64K x 4) x 4 V9938 AD7 AD6 AD5 AD4 AD3 AD2 ADI ADO III III III III }l AD 12 3 4 56 7 mCAS WE DUOI 2 3 I I I OE I Ij } II ~ RAS CASO CAsl RM j I Jj I I J JJ RDO RDI RD2 RD3 RD4 RD5 RD6 RD7 7:7- 140 <: \0 \0 W ex:> 0'1 ~ :;>;i ffi >:: X I I-' <: H v 99 3 8 t:l - RlW X ttl 0 CASO I-' :J:o I 0'1 '0 RAS '0 I I I UI Jlt J11 III III HI I (1) ;:l RASCAS WE DIN .... 0., DOUT X AOl234567 AD7 AD6 AD5 AD4 AD~ AD I-' ADb AD ~ I-' AO 1 2 3 456 7 DIN DOUT RASCAS WE CASl I I I III III III III III III I I RDO RDl RD~ RD RD4 RD5 RD~ RD - V9938 MSX-VIDEO Appendix 3. Clock oscillation internal circuitry Rl Approximately 1 k ohms R2 Approximately 500 k ohms TRl Depletion transistor TR2 Enhancement transistor V9938 - - - - - p _ _ - - - - C X T A L 2 (64) TRI TR2 Vee ft, +- ,.t, ~2 T"'Rl ...- - - - " - -.....~--iJ XTALl (63) 142 V9938 MSX-VIDEO Appendix 4. Usage of unused pins Output pins All unused output pins may be left open. Input or input/output pins *DLCLK (3) Pull up with a resistor HSYNC (5) Open CSYNC (6) Open C7 to CO (12) to (19) Open *LPS (26) Connect to VCC *LPD (27) Connect to VCC VBB (33) Open or connect to GND (1) through a capacitor 143 V9938 MSX-VIDEO Appendix 5. Cycle mode The V9938 has three cycle modes, which may be specified according to the following settings of bits SO and Sl in register #9. HSYNC S Cycle Screen *YS fH 1 0 mode mode High level Low level 0 0 0 PC only Burst flag H counter Low fXTAL/1368 reset input 0 1 1 Mixed HSYNC H counter Highl fXTAL/1365 reset input Low 1 0 2 Ext. HSYNC H counter High fXTAL/1365 Video reset input 144 V9938 MSX-VIDEO Appendix 6. Cycle input HSYNC input When the V counter is set to 6, input from HSYNC is received, and the H counter is reset on the edge of the transition from High --) Low. When the HSYNC Gate signal is Low, in other words, the V counter is set to a number other than 6, input signals to the HSYNC input are ignored. H :l:lK I -,- ')') 2:31 I () I 2:)1 Counter I I I HSYNC Gate ~I I I I NSYNC (Out) U VCollilter X x= V Reset input (CSYNC) The V Reset signal is a signal that is internal to the V9938 that cycles at 2.98 us. When three consecutive Lows are received, the V counter is reset. Simultaneously, the first field is selected. Sampling Clock 16DLCLK I i~ After Sampling \7 Reset Pulse \T Counter X x=I::. Field x X 1st 145 V9938 MSX-VIDEO Appendix 7. Display parameters 7-1 Horizontal display parameters Unit: XTAL Cycles Mul ticolor mode Text I mode Gl to G7 modes Text II mode Sl, SO (Rjf:9) 1, 2 0 1, 2 0 Display cycle 1024 1024 960 960 Right border 57 59 85 87 Right erase time 26 27 26 27 Synchronize signal 100 100 100 100 Left erase time 102 102 102 102 Left border 56 56 92 92 Total 1365 1368 1365 1368 Note: The above table shows the relationship between the RGB signal and HSYNC when the Display Adjust Register (Register Number 18) is set to o. RGB Display time IRight border , , Left border I HSYKC Right erase time Left erase time Synchronize signal 7-2 Vertical display parameters (NTSC) Unit: Lines Lines 192 lines 212 lines LN = 0 LN = 1 Interlace Interlace Field Field Non- Non- Interlace 1st 2nd Interlace 1st 2nd Synchronize signal 3 3 3 3 3 3 Top erase time 13 13 13.5 13 13 13 .5 Top border 26 26 26 16 16 16 Display time 192 192 192 212 212 212 Bottom border 25 25.5 25 15 15.5 15 Bot tom er ase time 3 3 3 3 3 3 Total 262 262.5 262.5 262 262.5 262.5 146 V9938 MSX-VIDEO Appendix 7-3 Vertical display parameters (PAL) unit: Lines Lines 192 lines 212 lines LN = 0 LN = 1 Interlace Interlace Field Field Non- Non- Interlace 1st 2nd Interlace 1st 2nd Synchronize signal 3 3 3 3 3 3 Top erase time 13 13 13 .5 13 13 13 .5 Top border 53 53 53 43 43 43 Display time 192 192 192 212 212 212 Bottom border 49 48.5 48 39 38.5 38 Bottom erase time 3 3 3 3 3 3 Total 313 312.5 312.5 313 312.5 312.5 Note: The above table shows the relationship between RGB and VSYNC when the Display Adjust Register (Register Number 18) is set to o. RGB Display time I , '--' I VSYNC Top erase time Bottom erase time Synchronize signal 147 V9938 MSX-VIDEO Appendix 8. Color palette G R B The color palette is set as shown in the table when a RESET is done. This table has 0 0 0 0 no meaning in G7 mode since the color 1 0 0 0 palette is not used. 2 6 1 1 3 7 3 3 In addition, since there are only four 4 1 1 7 colors available in GS mode, values from 4 5 3 2 7 to F have no meaning. Color 6 1 5 1 code 7 6 2 7 In this table, 0 means that the GRB 8 1 7 1 intensity is 0, and 7 means that the GRB 9 3 7 3 intensity is set to maximum. A 6 6 1 B 6 6 4 C 4 1 1 D 2 6 5 E 5 5 5 F 7 7 7 148 V9938 MSX-VIDEO Appendix 9. Composite video color burst The phase of the color brust is set according to the contents of register numbers 20, 21, and 22. These registers are initialized on the transition between Low --> High of the *Reset signal. Register Value upon number initialization 20 &H 00 21 &H 3B 22 &H 05 In addition, when the values of all of the above registers are set to 00, the color burst effect may be removed. Note: Do not set values other than those listed above in registers 20 to 22. 149 V9938 MSX-VIDEO Appendix 10. Color bus Color bus 1'10 de 7 6 5 4 3 2 1 0 Text I, I I Mul ticolor X X X X CC3 CC2 CCI CCO Gl to G4 ~Even 4 ~ Odd ~ G5 X X X X CCI CCO CCI CCO E Even ~ E Odd ~ G6 CC3 CC2 CCI CCO CC3 CC2 CCI CCO G7 CC7 CC6 CC5 CC4 CC3 CC2 CCI CCO The color bus is used as listed above whether doing input or output. For example, in G4 mode, the lower four bits (CCO to CC3) output the color code. These bits must be set before the signals are placed on the color bus. In this case, the upper four bits are ignored. In addition, during input, since the lower four bits have the color code, that signal is displayed, and i f DG = "I", the information is also stored in the VRAM. When using high resolution modes such as G5 and G6 modes, the even and odd dots are handled together as in 0-1, 2-3, 4-5, etc. (This is the same during input and output). 150 V9938 MSX-VIDEO Appendix 11. Sprites in G5 mode In the G5 mode, the static screen has a resolution of 512 dots in the horizontal direction. In addition, each pixel has two bits for the color code. Sprites are displayed using half the resolution of a static screen. As a result, the sprite pattern has a resolution of 256 dots in the horizontal direction, and the coordinates are x = 0 to 255. In order to display a sprite pattern as shown in Fig. 1, you must create a sprite pattern generator table as shown in Fig. 2. o 1 2 3 4 5 6 7 o A B A B ,.... - 1 C D C D 2 E FIE FIE F E F E F E F E F E F 3 G HIG HIG H G H G H G H G H G H 4 I J I J 5 I- K L K L - I- - 6 M N MN I- - 7 10 P 0 P 0 POP Fig. 1 Sprite pattern ~B L~ o 0 0 0 1 1 0 0 0 1 0 0 0 1 1 0 0 0 2 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 4 0 0 0 1 1 0 0 0 5 0 0 0 1 1 0 0 0 6 0 0 0 1 1 0 0 0 7 0 0 1 1 1 1 0 0 Fig. 2 Pattern generator table 151 V9938 MSX-VIDEO Appendix The colors of the sprites depend on the settings of the sprite color table. The upper four bits of the color table use controls such as the Early Clock. The lower four bits are divided into two groups of two bits. The upper two-bit group is for the color of the even pixels, and the lower two-bit group is for the color of odd pixels. If the bits are set individually for each two-bit group and the two groups have different colors, the resolution for sprite colors can be considered as being 512 dots. If the color table is written as shown in Fig. 3, the sprite pattern will be as shown in Fig. 1. MSB o A I B 1 C I C 2 E I F 3 G I H 4 I I J 5 K I L 6 M I N 7 0 I p Fig. 3 Color table 152 @¥AMAMA NIPPON GAKKI CO., LTO. PRINTED IN JAPAN