-
Notifications
You must be signed in to change notification settings - Fork 24
/
MSX Banzai! - The MSX Worshipping Shrine - V9990 Programmers Manual.html
1584 lines (1467 loc) · 89.8 KB
/
MSX Banzai! - The MSX Worshipping Shrine - V9990 Programmers Manual.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><HTML><HEAD>
<TITLE>MSX Banzai! - The MSX Worshipping Shrine - V9990 Programmers Manual</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="StyleSheet" HREF="../banzai.css" TYPE="text/css">
<STYLE TYPE="text/css">
TABLE { margin-bottom: 1em; }
TD {
padding: 2px 0.5em 2px 0.5em;
border: 1px solid;
border-left: 0;
text-align: center;
}
TH {
padding: 2px 0.5em 2px 0.5em;
border: 1px solid;
border-left: 0;
text-align: center;
vertical-align: top;
}
TR.port TD, TD.port, TR.port TH {
border: 0;
text-align: left;
}
TH.port {
border: 0;
text-align: right;
}
TD.first { border: 1px solid; }
TH.first { border: 1px solid; text-align: left; }
TD.block, TR.block TD { border-bottom: 0; }
TR.block TH { border-bottom: 0; }
.center { text-align: center; }
div.center table { margin-left: auto; margin-right: auto; text-align: left; }
</STYLE>
</HEAD><BODY><!--#CONFIG TIMEFMT="%d %B %Y" -->
<div id="menu"><A HREF="http://msxbanzai.tni.nl/"><IMG SRC="../msxbanzai.png" ALT="MSX Banzai! - The MSX Worshipping Shrine" WIDTH=632 HEIGHT=96></A><BR>
<A HREF="/dev/">Development</A> | <A HREF="/computers/">Computers</A> | <A HREF="/magazine.html">Magazines</A> | <A HREF="/curiosity.html">Curiosities</A></div>
<DIV STYLE="margin-right: 2em;">
<H1>Yamaha V9990 E-VDP-III Programmers Manual</H1><DIV STYLE="margin-left: 1em;">
<P>Targeted at Gfx9000 and Video9000 cartridges for MSX. Written by Patriek Lesparre. Thanks go to Marcel Delorme and Dan Derpaux for help.</P></DIV>
<H1>CONTENTS</H1><DIV STYLE="margin-left: 1em;">
<OL>
<LI><A HREF="#outline">OUTLINE</A>
<LI><A HREF="#basicinputoutput">BASIC INPUT/OUTPUT</A>
<OL>
<LI><A HREF="#registeraccess">ACCESS OF REGISTERS R#0 to R#28, R#32 to R#54</A>
<LI><A HREF="#vramaccess">ACCESS OF VRAM</A>
<LI><A HREF="#paletteaccess">ACCESS OF PALETTE</A>
<LI><A HREF="#commandexecution">EXECUTION OF COMMAND</A>
<LI><A HREF="#statusport">STATUS PORT</A>
<LI><A HREF="#interruptport">INTERRUPT PORT</A>
<LI><A HREF="#systemcontrolport">SYSTEM CONTROL PORT</A>
</OL>
<LI><A HREF="#displaymodes">V9990 DISPLAY MODES</A>
<OL>
<LI><A HREF="#patternmode">PATTERN DISPLAY MODE</A>
<LI><A HREF="#bitmapmode">BIT MAP DISPLAY MODE</A>
<LI><A HREF="#registersettings">REGISTER SETTING VALUES FOR EACH DISPLAY MODE</A>
</OL>
<LI><A HREF="#palettecontrol">CONTROL OF PALETTE</A>
<OL>
<LI><A HREF="#displaytypeselection">SELECTION OF DISPLAY TYPE</A>
</OL>
<LI><A HREF="#vram">VRAM</A>
<OL>
<LI><A HREF="#p1vram">P1 VRAM</A>
<LI><A HREF="#p2vram">P2 VRAM</A>
<LI><A HREF="#bvram">B1-B6 VRAM</A>
</OL>
<LI><A HREF="#spritecursor">Sprite and Cursor</A>
<OL>
<LI><A HREF="#sprite">Sprite (P1-P2)</A>
<LI><A HREF="#cursor">Cursor (B1-B6)</A>
</OL>
<LI><A HREF="#command">COMMAND</A>
<OL>
<LI><A HREF="#commandmethod">Command execution method</A>
<LI><A HREF="#writeoperations">Write operations</A>
<LI><A HREF="#LMMC">LMMC (Logical Move to Memory from CPU)</A>
<LI><A HREF="#LMMV">LMMV (Logical Move to Memory from VDP)</A>
<LI><A HREF="#LMCM">LMCM (Logical Move to CPU from Memory)</A>
<LI><A HREF="#LMMM">LMMM (Logical Move to Memory from Memory)</A>
<LI><A HREF="#CMMC">CMMC (Character Move to Memory from CPU)</A>
<LI><A HREF="#CMMM">CMMM (Character Move to Memory from Memory)</A>
<LI><A HREF="#BMXL">BMXL (Byte Move to XY from Linear)</A>
<LI><A HREF="#BMLX">BMLX (Byte Move to Linear from XY)</A>
<LI><A HREF="#BMLL">BMLL (Byte Move to Linear from Linear)</A>
<LI><A HREF="#LINE">LINE</A>
<LI><A HREF="#SEARCH">SEARCH</A>
<LI><A HREF="#POINT">POINT</A>
<LI><A HREF="#PSET">PSET</A>
<LI><A HREF="#ADVANCE">ADVANCE</A>
</OL>
<LI><A HREF="#v9990regspec">V9990 REGISTER SPECIFICATIONS</A>
<OL>
<LI><A HREF="#ioportspec">I/O PORT SPECIFICATIONS</A>
<LI><A HREF="#regspec">Register specifications</A>
</OL>
<LI><A HREF="#timing">Timing</A>
</OL></DIV>
<H1 id="outline">OUTLINE</H1><DIV STYLE="margin-left: 1em;">
<P>The V9990 is a video display processor (VDP) which features as follows. Having a high-speed drawing and animation functions, it provides various screen modes which can be used widely for games, audio-visual, office automation and other purposes. Also, as a monitor, it supports many types of display units such as home TV sets, CRT for personal computers and liquid crystal panels.</P>
<H2><Game Specifications></H2><DIV STYLE="margin-left: 1em;">
<P>For this type, two pattern display modes are available as follows.</P>
<UL>
<LI>P1 (Display resolution 256x212, 2 layers)
<LI>P2 (Display resolution 512x212)
</UL>
<P>Various highly advanced functions are available such as powerful sprite function and dual-layer independent omnidirectional scroll function.</P></DIV>
<H2><AV Specifications></H2><DIV STYLE="margin-left: 1em;">
<P>For this type, four kinds of bit map display modes are available as follows.
They are capable of providing display on the NTSC or PAL frequency monitor.</P>
<UL>
<LI>B1 (Display resolution 256x212)
<LI>B2 (Display resolution 384x240)
<LI>B3 (Display resolution 512x212)
<LI>B4 (Display resolution 768X240)
</UL>
<UL style="list-style: square;">
<LI>Capable of doubling the resolution in the vertical direction by using the interlace.
<LI>Up to 32,768 colors/pixel can be displayed.
<LI>Built-in color palette (64 colors selected out of 32,768 colors)
<LI>Omnidirectional smooth scrolling is possible.
<LI>Superimposition and digitization are possible. (Video9000)
<LI>Allows use of the monitor screen to the full extent in four directions as the display range by using the over-scan mode (B2, B4) in such application as for the telopper.
<LI>Supports the high-speed hardware drawing commands such as the screen transfer, font color development and line.
<LI>The hardware cursor display function is available.
</UL></DIV>
<H2><OA Specifications></H2><DIV STYLE="margin-left: 1em;">
<P>For this type, two kinds of bit map display modes are available as follows. They can be displayed on the high resolution Monitor.</P>
<UL>
<LI>B5 (Display resolution 640X400)
<LI>B6 (Display resolution 640X480)
</UL>
<UL style="list-style: square;">
<LI>Up to 16 colors/pixel can be displayed. (Selectable out of 32,768 colors depending on the color palette)
<LI>Omnidirectional smooth scrolling is possible.
<LI>Supports the high-speed hardware drawing commands such as the screen transfer, font color development and line.
<LI>The hardware cursor display function is available.
</UL></DIV>
<H2><Others></H2><DIV STYLE="margin-left: 1em;">
<UL style="list-style: square;">
<LI>Built~in DA converter
<LI>Linear RGB output
<LI>Direct connection of CG ROM such as KANJI ROM is possible, but has not been implemented in Gfx9000 or Video9000. Further information regarding it is omitted from this manual.
<LI>Useable VRAM: Dual port DRAM (The access time is 120nS, but 100nS for the B6 mode.)
<UL style="list-style: none;">
<LI>64Kx4
<LI>128Kx8
<LI>256Kx4
</UL>
<LI>As the VRAM capacity, 128KB, 256KB and 512KB configurations are possible.
<LI>Capable of direct access from CPU to VRAM by means of the 16 bit bus.
<LI>Use of the LCD panel (1 screen panel and single drive type of 2 screen panel) is possible.
</UL></DIV>
</DIV>
<H1 id="basicinputoutput">BASIC INPUT/OUTPUT</H1><DIV STYLE="margin-left: 1em;">
<P>Data is input and output to and from the V9990 through the <a href="#ioportspec">I/O ports (P#0 to P#F)</a>. Basically, as an access, both Read and Write are possible at all ports. But only Read is possible with the <a href="#p5">STATUS port (P#5)</a> and Write only with the <a href="#p7">SYSTEM CONTROL port (P#7)</a>.</P>
<H2 id="registeraccess">ACCESS OF REGISTERS R#0 to R#28, R#32 to R#54</H2><DIV STYLE="margin-left: 1em;">
<P>To set a value in the register, have the register No. output at <a href="#p4">REGISTER SELECT port (P#4)</a> and then the data at <a href="#p3">REGISTER DATA port (P#3)</a>.<BR>To obtain the value from the register, have the register No. output at <a href="#p4">P#4</a> and then read <a href="#p3">P#3</a>.<BR>The register No. is specified by using the lower 6 bits of the value at <a href="#p4">P#4</a> and the bit 7 (MSB) functions as WII (Write Increment Inhibit) and bit 6 as RII (Read Increment Inhibit). If WII is "1", automatic increment of the register No. by writing the data to the register is prohibited. If RII is "1", automatic increment of the register No. by reading the data of the register is prohibited.</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>P#4 (Write)<TD CLASS=first>WII<TD>RII<TD COLSPAN=6>Register No. (R#n)
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#3 (Read/Write)<TD COLSPAN=8 CLASS=first>Register Data
<TR CLASS=port><TD><TD COLSPAN=8 STYLE="text-align: center;"><B>...</B>
</TABLE></DIV>
<H2 id="vramaccess">ACCESS OF VRAM</H2><DIV STYLE="margin-left: 1em;">
<P>To write a value in VRAM, set the target address to VRAM Write Base Address registers (R#0-R#2) and have the data output at <a href="#p0">VRAM DATA port (P#0)</a>. As the bit 7 (MSB) of R#2 functions as AII (Address Increment Inhibit), if it is "1", automatic address increment by writing the data is inhibited.</P>
<P>To read the data of VRAM, set the target address to VRAM Read Base Address registers (R#3-R#5) and read in the data of <a href="#p0">VRAM DATA port (P#0)</a>. As the bit 7 (MSB) of R#5 functions as AII (Address Increment Inhibit), if it is "1", automatic address increment by reading in the data is inhibited.</P>
<P>The address can be specified up to 19 bits (512K bytes), with lower 8 bits set to R#0 (or R#3), center 8 bits to R#1 (or R#4) and upper 3 bits to R#2 (or R#5).</P>
<P>Note: Always the full address must be written. Specifying partial addresses will not work correctly.</P>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI>VRAM Write
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>P#4 (Write)<TD CLASS=first>0<TD>0<TD>0<TD>0<TD>0<TD>0<TD>0<TD>0
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#3 (Write)<TD COLSPAN=8 CLASS=first>VRAM lower address<TD CLASS=port>(R#0 set)
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#3 (Write)<TD COLSPAN=8 CLASS=first>VRAM center address<TD CLASS=port>(R#1 set)
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#3 (Write)<TD CLASS=first>AII<TD COLSPAN=7>VRAM upper address<TD CLASS=port>(R#2 set)
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#0 (Write)<TD COLSPAN=8 CLASS=first>Data
<TR CLASS=port><TD><TD COLSPAN=8 STYLE="text-align: center;"><B>...</B>
</TABLE>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI>VRAM Read
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>P#4 (Write)<TD CLASS=first>0<TD>0<TD>0<TD>0<TD>0<TD>0<TD>1<TD>1
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#3 (Write)<TD COLSPAN=8 CLASS=first>VRAM lower address<TD CLASS=port>(R#3 set)
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#3 (Write)<TD COLSPAN=8 CLASS=first>VRAM center address<TD CLASS=port>(R#4 set)
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#3 (Write)<TD CLASS=first>AII<TD COLSPAN=7>VRAM upper address<TD CLASS=port>(R#5 set)
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#0 (Read)<TD COLSPAN=8 CLASS=first>Data
<TR CLASS=port><TD><TD COLSPAN=8 STYLE="text-align: center;"><B>...</B>
</TABLE>
</DIV>
<H2 id="paletteaccess">ACCESS OF PALETTE</H2><DIV STYLE="margin-left: 1em;">
<P>The palette data can be set or checked by setting the palette No. and RGB specification to the palette pointer (R#14) and reading or writing to the <a href="#p1">palette data port (P#1)</a>.</P>
<P>The palette No. is specified by using the upper 6 bits of R#14 and RGB by using the lower 2 bits (R=0, G=1, B=2). The lower 2 bits constitute a ternary counter which undergoes automatic increment in the order of RGB through the port access. Setting these counter bits to 3 manually will cause the next palette write to be ignored and the counter to wrap around to 0 on the same palette number.</P>
<P>It's possible to partially update the palette colors as changes to either Red, Green or Blue values take effect immediately.</P>
<P>It should be noted that how the palette setting is actually displayed also depends on the palette control register (R#13) setting.</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>P#4 (Write)<TD CLASS=first>0<TD>0<TD>0<TD>0<TD>1<TD>1<TD>1<TD>0
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#3 (Write)<TD COLSPAN=6 CLASS=first>Palette No.<TD>0<TD>0<TD CLASS=port>(R#14 set)
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#1 (Write)<TD CLASS=first style="text-decoration: overline;">YS<TD>-<TD>-<TD COLSPAN=5>RED data
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#1 (Write)<TD CLASS=first>-<TD>-<TD>-<TD COLSPAN=5>GREEN data
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>P#1 (Write)<TD CLASS=first>-<TD>-<TD>-<TD COLSPAN=5>BLUE data
</TABLE>
</DIV>
<H2 id="commandexecution">EXECUTION OF COMMAND</H2><DIV STYLE="margin-left: 1em;">
<P>With the necessary parameter set to the command registers, set the operation code. For transfer from CPU (or to CPU), the data is output to the <a href="#p2">command data port (P#2)</a> by the amount required after this stage.</P>
</DIV>
<H2 id="statusport">STATUS PORT</H2><DIV STYLE="margin-left: 1em;">
<P>Only by reading the <a href="#p5">status port (P#5, Read Only)</a>, the status of the V9990 can be checked.</P>
</DIV>
<H2 id="interruptport">INTERRUPT PORT</H2><DIV STYLE="margin-left: 1em;">
<P>The cause of interrupt can be determined by reading the <a href="#p6">interrupt flag port (P#6)</a>. As the flag is not reset automatically, "1" should be written to the applicable bit to reset it.</P>
</DIV>
<H2 id="systemcontrolport">SYSTEM CONTROL PORT</H2><DIV STYLE="margin-left: 1em;">
<P>The <a href="#p7">system control port (P#7)</a> is only for writing. It can be used to reset the system and to select the master clock.</P>
</DIV>
</DIV>
<H1 id="displaymodes">V9990 DISPLAY MODES</H1><DIV STYLE="margin-left: 1em;">
<H2 id="patternmode">PATTERN DISPLAY MODES</H2><DIV STYLE="margin-left: 1em;">
<P STYLE="text-decoration: underline;">Pattern Display Function</P>
<TABLE CELLSPACING=0>
<TR CLASS=block><TH CLASS=first>Mode name<TD>P1<TD>P2
<TR CLASS=block><TH CLASS=first>Master clock frequency<TD>21.5MHz<TD>21.5MHz
<TR CLASS=block><TH CLASS=first>Pixel clock frequency<TD>5.4MHz<TD>10.7MHz
<TR CLASS=block><TH CLASS=first>Horizontal cycle<TD>15.7kHz (NTSC)<TD>15.7kHz (NTSC)
<TR CLASS=block><TH CLASS=first>Display resolution<TD>32x26.5 patterns (256x212 pixels)<TD>64x26.5 patterns (512x212 pixels)
<TR CLASS=block><TH CLASS=first>Image space<TD>64x64 patterns<TD>128x64 patterns
<TR CLASS=block><TH CLASS=first>Number of layers<TD>2 layers with priority control<TD>1 layer
<TR CLASS=block><TH CLASS=first>Pattern size<TD>8x8 pixels<TD>8x8 pixels
<TR CLASS=block><TH CLASS=first>Simultaneously displayed colors<TD>30 colors + transparant<TD>30 colors + transparant
<TR CLASS=block><TH CLASS=first>Color palette<TD>4 palettes of 16 colors out of 32768 colors<TD>4 palettes of 16 colors out of 32768 colors
<TR><TH CLASS=first>Number of patterns<TD>Layer "A": 8160 units<BR>Layer "B": 7680 units<TD>15360 units
</TABLE>
<P STYLE="text-decoration: underline;">Sprite Display Function</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>Size<TD>16x16 pixels
<TR CLASS=port><TH>Limited No. of displayed units<TD>125 on 1 screen<BR>16 on 1 line
<TR CLASS=port><TH>Displayed colors<TD>15 colors + clear color (for each pixel)<BR>Palette can be selected for each sprite (1 palette selected out of 4)
<TR CLASS=port><TH>Specification of display priority<TD>Priority between sprite and pattern layer can be set for each sprite. The sprite No. order is used for priority order among sprites.
<TR CLASS=port><TH>Pattern<TD>Selected from among 256 patterns<BR>The pattern data is shared with the pattern layer (the base address should be set in register R#25.)
</TABLE>
</DIV>
<H2 id="bitmapmode">BIT MAP DISPLAY MODES</H2><DIV STYLE="margin-left: 1em;">
<P STYLE="text-decoration: underline;">Bit map screen display function</P>
<TABLE CELLSPACING=0>
<TR CLASS=block><TH CLASS=first ROWSPAN=2>Mode<TH rowspan=2>Master clock<BR>(MHz)<TH rowspan=2>Pixel clock<BR>(MHz)<TH rowspan=2>Display resolution () interlaced<BR>(pixel x pixel)<TH rowspan=2>Color depth<BR>(bits per pixel)<TH COLSPAN=4>Image size by width (lines)
<TR CLASS=block><TH>256 pixels<TH>512 pixels<TH>1024 pixels<th>2048 pixels
<TR CLASS=block><TD ROWSPAN=4 CLASS=first>*B0<TD ROWSPAN=4>14.3<TD ROWSPAN=4>3.6<TD ROWSPAN=4>Overscan NTSC<BR>192x240 (192x480)<BR>Overscan PAL<BR>192x290 (192x580)
<TD>16<TD>1024<td>512<td>256<td>
<TR CLASS=block><TD>8<TD>2048<td>1024<td>512<td>256
<TR CLASS=block><TD>4<TD>4096<td>2048<td>1024<td>512
<TR CLASS=block><TD>2<TD>8192<td>4096<td>2048<td>1024
<TR CLASS=block><TD ROWSPAN=4 CLASS=first>B1<TD ROWSPAN=4>21.5<TD ROWSPAN=4>5.4<TD ROWSPAN=4>NTSC/PAL<BR>256x212 (256x424)
<TD>16<TD>1024<td>512<td>256<td>
<TR CLASS=block><TD>8<TD>2048<td>1024<td>512<td>256
<TR CLASS=block><TD>4<TD>4096<td>2048<td>1024<td>512
<TR CLASS=block><TD>2<TD>8192<td>4096<td>2048<td>1024
<TR CLASS=block><TD ROWSPAN=4 CLASS=first>B2<TD ROWSPAN=4>14.3<TD ROWSPAN=4>7.2<TD ROWSPAN=4>Overscan NTSC<BR>384x240 (384x480)<BR>Overscan PAL<BR>384x290 (384x580)
<TD>16<td><td>512<td>256<td>
<TR CLASS=block><TD>8<td><td>1024<td>512<td>256
<TR CLASS=block><TD>4<td><td>2048<td>1024<td>512
<TR CLASS=block><TD>2<td><td>4096<td>2048<td>1024
<TR CLASS=block><TD ROWSPAN=4 CLASS=first>B3<TD ROWSPAN=4>21.5<TD ROWSPAN=4>10.7<TD ROWSPAN=4>NTSC/PAL<br>512x212 (512x424)
<TD>16<td><td>512<td>256<td>
<TR CLASS=block><TD>8<td><td>1024<td>512<td>256
<TR CLASS=block><TD>4<td><td>2048<td>1024<td>512
<TR CLASS=block><TD>2<td><td>4096<td>2048<td>1024
<TR CLASS=block><TD ROWSPAN=2 CLASS=first>B4<TD ROWSPAN=2>14.3<TD ROWSPAN=2>14.3<TD ROWSPAN=2>Overscan NTSC<BR>768x240 (768x480)<BR>Overscan PAL<BR>768x290 (768x580)
<TD>4<td><td><td>1024<td>512
<TR CLASS=block><TD>2<td><td><td>2048<td>1024
<TR CLASS=block><TD ROWSPAN=2 CLASS=first>B5<TD ROWSPAN=2>21.5<TD ROWSPAN=2>21.5<TD ROWSPAN=2>640x400 @ 25.3kHz
<TD>4<td><td><td>1024<td>512
<TR CLASS=block><TD>2<td><td><td>2048<td>1024
<TR CLASS=block><TD ROWSPAN=2 CLASS=first>B6<TD ROWSPAN=2>25.2<TD ROWSPAN=2>25.2<TD ROWSPAN=2>640x480 @ 31.5kHz
<TD>4<td><td><td>1024<td>512
<TR CLASS=block><TD>2<td><td><td>2048<td>1024
<TR><TD ROWSPAN=2 CLASS=first>*B7<TD ROWSPAN=2>21.5<TD ROWSPAN=2>21.5<TD ROWSPAN=2>NTSC/PAL<br>1024x212 (1024x424)
<TD CLASS=block>4<TD CLASS=block><TD CLASS=block><TD CLASS=block>1024<td class=block>512
<TR><TD>2<td><td><td>2048<td>1024
<TR CLASS=port><TD COLSPAN=7>* Undocumented mode
</TABLE>
<P>Displayed color (RGB conversion system)</P>
<TABLE CELLSPACING=0>
<TR CLASS=block><TH CLASS=first>bits per pixel<TH>Name<TH>RGB conversion system<TH>Number of displayed colors
<TR CLASS=block><TH CLASS=first>16<TD>BD16<TD>Direct RGB<BR>(<SPAN STYLE="text-decoration: overline;">YS</SPAN>:1bit, G:5bit, R:5bit, B:5bit)<TD>32768 colors
<TR CLASS=block><TH ROWSPAN=6 CLASS=first>8<TD>BD8<TD>Direct RGB<BR>(G:3bit,R:3bit,B:2bit)<TD>256 colors
<TR CLASS=block> <TD>BYJK<TD>YJK Decoder<TD>19268 colors
<TR CLASS=block> <TD>BYJKP<TD>YJK Decoder +<BR>Color palette<TD>12599 colors +<BR>16 colors out of 32768 colors
<TR CLASS=block> <TD>BYUV<TD>YUV Decoder<TD>19268 colors
<TR CLASS=block> <TD>BYUVP<TD>YUV Decoder +<BR>Color palette<TD>12599 colors +<BR>16 colors out of 32768 colors
<TR CLASS=block> <TD>BP6<TD>Color palette<TD>64 colors out of 32768 colors
<TR CLASS=block><TH CLASS=first>4<TD>BP4<TD>Color palette<TD>16 colors out of 32768 colors
<TR><TH CLASS=first>2<TD>BP2<TD>Color palette<TD>4 colors out of 32768 colors
</TABLE>
<P STYLE="text-decoration: underline;">Cursor Function
<TABLE CELLSPACING=0><TR CLASS=port>
<TH><UL>
<LI>Size
<LI>Number of displayed units
<LI>Displayed color
<LI>Pattern
</UL>
<TD><UL style="list-style: none;">
<LI>32x32 pixels
<LI>2 in 1 screen
<LI>3 colors + EOR color on bit map screen + clear color
<LI>Any form
</UL>
</TABLE>
</DIV>
<H2 id="registersettings">REGISTER SETTING VALUES FOR EACH DISPLAY MODE</H2><DIV STYLE="margin-left: 1em;">
<TABLE CELLSPACING=0>
<TR CLASS=block><TH ROWSPAN=2 CLASS=first>Mode<TH>P#7<TH COLSPAN=4>R#6<TH COLSPAN=7>R#7
<TR CLASS=block><TH>MCS<TH>DSPM<TH>DCKM<TH>XIMM<TH>CLRM<TH>C25M<TH>SM1<TH>SM<TH>PAL<TH>EO<TH>IL<TH>HSCN
<TR CLASS=block><TH CLASS=first>P1<TD>0<TD>0<TD>0<TD>1<TD>1<TD>0<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0
<TR CLASS=block><TH CLASS=first>P2<TD>0<TD>1<TD>1<TD>2<TD>1<TD>0<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0
<TR CLASS=block><TH CLASS=first>*B0<TD>1<TD>2<TD>0<TD>0-3<TD>0-3<TD>0<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0
<TR CLASS=block><TH CLASS=first>B1<TD>0<TD>2<TD>0<TD>0-3<TD>0-3<TD>0<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0
<TR CLASS=block><TH CLASS=first>B2<TD>1<TD>2<TD>1<TD>1-3<TD>0-3<TD>0<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0
<TR CLASS=block><TH CLASS=first>B3<TD>0<TD>2<TD>1<TD>1-3<TD>0-3<TD>0<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0
<TR CLASS=block><TH CLASS=first>B4<TD>1<TD>2<TD>2<TD>2-3<TD>0-1<TD>0<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0
<TR CLASS=block><TH CLASS=first>B5<TD>0<TD>2<TD>2<TD>2-3<TD>0-1<TD>0<TD>0<TD>0<TD>0<TD>0<TD>0<TD>1
<TR CLASS=block><TH CLASS=first>B6<TD>0<TD>2<TD>2<TD>2-3<TD>0-1<TD>1<TD>0<TD>0<TD>0<TD>0<TD>0<TD>1
<TR><TH CLASS=first>*B7<TD>0<TD>2<TD>2<TD>2-3<TD>0-1<TD>0<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0/1<TD>0
<TR CLASS=port><TD COLSPAN=13>* Undocumented mode
</TABLE>
</DIV>
</DIV>
<H1 id="palettecontrol">CONTROL OF PALETTE</H1><DIV STYLE="margin-left: 1em;">
<P>For the V9990, there are 10 types (display types) by which the data (2 to 16 bits) obtained from VRAM is transmitted to the D/A converter with 5 bits for each RGB as follows.</P>
<H2>1. PP</H2><DIV STYLE="margin-left: 1em;">
<P>Display type when the display mode is P1 or P2</P>
<P>Sprite colors are specified by Pattern data plus a palette offset specified in the Sprite Attribute Table.</P>
<P>Background colors are specified by Pattern data plus a palette offset in R#13. P1 layer "A" and P2 pattern pixels 0,1,4,5 use offset specified in R#13 PLTO3-2. P1 layer "B" and P2 pattern pixels 2,3,6,7 use offset specified in R#13 PLTO5-4.</P>
</DIV>
<H2>2. BYJK</H2><DIV STYLE="margin-left: 1em;">
<P>Display type when the display mode uses full YJK on the bit map. This mode is the same as V9958 YJK mode.</P>
<P>Cursor colors are specified by the Cursor Attribute Table plus a palette offset specified by R#28 CSPO5-2.</P>
<P>Background colors are specified by YJK bitmap data. Base color, specified by JK values, is shared among 4 pixels, each pixel has an individual Y (luminance) value.</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR CLASS=block><TD CLASS=port>1st pixel<TD CLASS=first COLSPAN=5>Y<TD COLSPAN=3>K (low)
<TR CLASS=block><TD CLASS=port>2nd pixel<TD CLASS=first COLSPAN=5>Y<TD COLSPAN=3>K (high)
<TR CLASS=block><TD CLASS=port>3rd pixel<TD CLASS=first COLSPAN=5>Y<TD COLSPAN=3>J (low)
<TR><TD CLASS=port>4th pixel<TD CLASS=first COLSPAN=5>Y<TD COLSPAN=3>J (high)
</TABLE>
<P>RGB-YJK conversion:
<TABLE CELLSPACING=0>
<TR CLASS=port><TD>R = Y + J<TD>Y = B/2 + R/4 + G/8
<TR CLASS=port><TD>G = Y + K<TD>J = R - Y
<TR CLASS=port><TD>B = 5/4Y - J/2 - K/4<TD>K = G - Y
</TABLE>
</DIV>
<H2>3. BYJKP</H2><DIV STYLE="margin-left: 1em;">
<P>Display type when the display mode uses YJK and palette mixed on the bit map. This mode is the same as V9958 YJKP (aka YAE) mode.</P>
<P>Same as BYJK, except that for each pixel bit A selects YJK or Palette mode. In Palette mode, colors are specified by Y value plus a palette offset specified in R#13 PLTO5-4.</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR CLASS=block><TD CLASS=port>1st pixel<TD CLASS=first COLSPAN=4>Y<TD>A<TD COLSPAN=3>K (low)
<TR CLASS=block><TD CLASS=port>2nd pixel<TD CLASS=first COLSPAN=4>Y<TD>A<TD COLSPAN=3>K (high)
<TR CLASS=block><TD CLASS=port>3rd pixel<TD CLASS=first COLSPAN=4>Y<TD>A<TD COLSPAN=3>J (low)
<TR><TD CLASS=port>4th pixel<TD CLASS=first COLSPAN=4>Y<TD>A<TD COLSPAN=3>J (high)
</TABLE>
</DIV>
<H2>4. BYUV</H2><DIV STYLE="margin-left: 1em;">
<P>Display type when the display mode uses full YUV on the bit map</P>
<P>Same as BYJK, but GREEN and BLUE channels are swapped, often resulting in better image quality.</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR CLASS=block><TD CLASS=port>1st pixel<TD CLASS=first COLSPAN=5>Y<TD COLSPAN=3>V (low)
<TR CLASS=block><TD CLASS=port>2nd pixel<TD CLASS=first COLSPAN=5>Y<TD COLSPAN=3>V (high)
<TR CLASS=block><TD CLASS=port>3rd pixel<TD CLASS=first COLSPAN=5>Y<TD COLSPAN=3>U (low)
<TR><TD CLASS=port>4th pixel<TD CLASS=first COLSPAN=5>Y<TD COLSPAN=3>U (high)
</TABLE>
<P>RGB-YUV conversion:
<TABLE CELLSPACING=0>
<TR CLASS=port><TD>R = Y + U<TD>Y = G/2 + R/4 + B/8
<TR CLASS=port><TD>G = 5/4Y - U/2 - V/4<TD>U = R - Y
<TR CLASS=port><TD>B = Y + V<TD>V = B - Y
</TABLE>
</DIV>
<H2>5. BYUVP</H2><DIV STYLE="margin-left: 1em;">
<P>Display type when the display mode uses YUV and palette mixed on the bit map</P>
<P>Same as BYJKP, but GREEN and BLUE channels are swapped, often resulting in better image quality.</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR CLASS=block><TD CLASS=port>1st pixel<TD CLASS=first COLSPAN=4>Y<TD>A<TD COLSPAN=3>V (low)
<TR CLASS=block><TD CLASS=port>2nd pixel<TD CLASS=first COLSPAN=4>Y<TD>A<TD COLSPAN=3>V (high)
<TR CLASS=block><TD CLASS=port>3rd pixel<TD CLASS=first COLSPAN=4>Y<TD>A<TD COLSPAN=3>U (low)
<TR><TD CLASS=port>4th pixel<TD CLASS=first COLSPAN=4>Y<TD>A<TD COLSPAN=3>U (high)
</TABLE>
</DIV>
<H2>6. BD16</H2><DIV STYLE="margin-left: 1em;">
<P>Display type when the display mode uses 16 bit data directly on the bit map (5 bits for each RGB plus <SPAN style="text-decoration: overline;">Ys</SPAN>)</P>
<P>Cursor colors are specified by the Cursor Attribute Table plus a palette offset specified by R#28 CSPO5-2.</P>
<P>Background data are specified in 16 bit as follows.</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>1st byte<TD CLASS=first COLSPAN=3>R (bit 2-0)<TD COLSPAN=5>B
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>2nd byte<TD CLASS=first><SPAN style="text-decoration: overline;">Ys</SPAN><TD COLSPAN=5>G<TD COLSPAN=2>R (bit 4-3)
</TABLE>
</DIV>
<H2>7. BD8</H2><DIV STYLE="margin-left: 1em;">
<P>Display type when the display mode uses 8 bit data directly on the bit map (3, 3, 2 bits for each RGB, <SPAN style="text-decoration: overline;">Ys</SPAN> at ALL 0)</P>
<P>Cursor colors are specified by the Cursor Attribute Table plus a palette offset specified by R#28 CSPO5-2.</P>
<P>Background data are specified in 8 bit as follows.</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port><TD CLASS=first COLSPAN=3>G<TD COLSPAN=3>R<TD COLSPAN=2>B
</TABLE>
<P>Although this mode is similar to the RGB332 mode of V9938, because of the way these values are mapped on the 15 bit palette, the resulting colors will differ slightly. For instance, pure grey is not possible.</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>RED and GREEN
<TR CLASS=port><TD>3 bit value<TD>7<TD>6<TD>5<TD>4<TD>3<TD>2<TD>1<TD>0
<TR CLASS=port><TD>Palette value<TD>31<TD>27<TD>22<TD>18<TD>13<TD>9<TD>4<TD>0
<TR CLASS=port><TH>BLUE
<TR CLASS=port><TD>2 bit value<TD>3<TD><TD>2<TD><TD>1<TD><TD><TD>0
<TR CLASS=port><TD>Palette value<TD>31<TD><TD>21<TD><TD>11<TD><TD><TD>0
</TABLE>
</DIV>
<H2>8. BP6</H2><DIV STYLE="margin-left: 1em;">
<P>Display type when the display mode uses 8 bit data on the bit map through the palette</P>
<P>Cursor colors are specified by the Cursor Attribute Table plus a palette offset specified by R#28 CSPO5-2.</P>
<P>Background colors are specified by a 6 bit palette value, bits 7-6 are ignored.</P>
</DIV>
<H2>9. BP4</H2><DIV STYLE="margin-left: 1em;">
<P>Display type when the display mode uses 4 bit data and offset 2 bits on the bit map through the palette</P>
<P>Cursor colors are specified by the Cursor Attribute Table plus a palette offset specified by R#28 CSPO5-2.</P>
<P>Background colors are specified by a 4 bit value plus a palette offset specified in R#13 PLTO5-4.</P>
<P>Note: When setting the color palette data in the B4, B5 and B6 modes, use the same value for each corresponding pair of palette addresses 0 to 31 and 32 to 63, that is, 0 and 32, 1 and 33 and so on.</P>
</DIV>
<H2>10. BP2</H2><DIV STYLE="margin-left: 1em;">
<P>Display type when the display node uses 2 bit data and offset 4 bits on the bit map through the palette</P>
<P>Cursor colors are specified by the Cursor Attribute Table plus a palette offset specified by R#28 CSPO5-2.</P>
<P>Background colors are specified by a 2 bit value plus a palette offset specified in R#13 PLTO5-2.</P>
<P>Note: When setting the color palette data in the B4, B5 and B6 modes, use the same value for each corresponding pair of palette addresses 0 to 31 and 32 to 63, that is, 0 and 32, 1 and 33 and so on.</P>
</DIV>
<H2 id="displaytypeselection">SELECTION OF DISPLAY TYPE</H2><DIV STYLE="margin-left: 1em;">
<P>PALETTE CONTROL (WRITE ONLY)</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>R#13<TD CLASS=first COLSPAN=2>PLTM<TD>YAE<TD>PLTAIH<TD>PLTO5<TD>PLTO4<TD>PLTO3<TD>PLTO2
</TABLE>
<P>CURSOR SPRITE PALETTE OFFSET (WRITE ONLY)</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>R#28<TD CLASS=first>0<TD>0<TD>0<TD>0<TD COLSPAN=4>CSPO5-2
</TABLE>
<P>BACK DROP COLOR (READ/WRITE)</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>R#15<TD CLASS=first>0<TD>0<TD>BDC5<TD>BDC4<TD>BDC3<TD>BDC2<TD>BDC1<TD>BDC0
</TABLE>
<P>SCREEN MODE (READ/WRITE)</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>R#6<TD CLASS=first COLSPAN=2>DSPM<TD COLSPAN=2>DCKM<TD COLSPAN=2>XIMM<TD COLSPAN=2>CLRM
</TABLE>
<TABLE CELLSPACING=0>
<TR CLASS=block><TH CLASS=first><TH>DSPM<TH>PLTM<TH>CLRM<TH>YAE
<TR CLASS=block><TH CLASS=first>(1) PP<TD>0,1<TD>0<TD>1<TD>-
<TR CLASS=block><TH CLASS=first>(2) BYJK<TD>2<TD>2<TD>2<TD>0
<TR CLASS=block><TH CLASS=first>(3) BYJKP<TD>2<TD>2<TD>2<TD>1
<TR CLASS=block><TH CLASS=first>(4) BYUV<TD>2<TD>3<TD>2<TD>0
<TR CLASS=block><TH CLASS=first>(5) BYUVP<TD>2<TD>3<TD>2<TD>1
<TR CLASS=block><TH CLASS=first>(6) BD16<TD>2<TD>0<TD>3<TD>-
<TR CLASS=block><TH CLASS=first>(7) BD8<TD>2<TD>1<TD>2<TD>-
<TR CLASS=block><TH CLASS=first>(8) BP6<TD>2<TD>0<TD>2<TD>-
<TR CLASS=block><TH CLASS=first>(9) BP4<TD>2<TD>0<TD>1<TD>-
<TR><TH CLASS=first>(10) BP2<TD>2<TD>0<TD>0<TD>-
</TABLE>
</DIV>
</DIV>
<H1 id="vram">VRAM</H1><DIV STYLE="margin-left: 1em;">
<H2 id="p1vram">P1 VRAM</H2><DIV STYLE="margin-left: 1em;">
<P>Physical mapping: Addresses 00000-3FFFF in VRAM0 and 40000-7FFFF in VRAM1.
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>00000-3FDFF<TD>(Sprite) Pattern Data (Layer A)
<TR CLASS=port><TH>3FE00-3FFFF<TD>Sprite Attribute Table
<TR CLASS=port><TH>40000-7BFFF<TD>Pattern Data (Layer B)
<TR CLASS=port><TH>7C000-7DFFF<TD>PNT(A) - Pattern Name Table (Layer A)
<TR CLASS=port><TH>7E000-7FFFF<TD>PNT(B) - Pattern Name Table (Layer B)
</TABLE>
<P>Pattern Data is layed out like a 4bpp bitmap with 256 pixel width, cut up in 8x8 patterns. Pattern 0 1st line starts at 00000, Pattern 0 2nd line starts at 00080 etc., Pattern 1 1st line starts at 00004 etc., Pattern 32 1st line starts at 00400 etc.</P>
<P>Sprite Pattern Data is shared with background Pattern Data, but 16x16 Patterns are used.</P>
<P>The Name Table describes the entire Image Space, each Pattern is specified by a 16 bit value.</P>
</DIV>
<H2 id="p2vram">P2 VRAM</H2><DIV STYLE="margin-left: 1em;">
<P>Physical mapping: Pattern Data even addresses (bit0=0) in VRAM0 and odd addresses (bit0=1) in VRAM1, Sprite Attribute Table in VRAM0 and PNT in VRAM1.
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>00000-77FFF<TD>(Sprite) Pattern Data
<TR CLASS=port><TH>78000-7BDFF<TD>-
<TR CLASS=port><TH>7BE00-7BFFF<TD>Sprite Attribute Table
<TR CLASS=port><TH>7C000-7FFFF<TD>PNT
</TABLE>
<P>Pattern Data is layed out like a 4bpp bitmap with 512 pixel width, cut up in 8x8 patterns. Pattern 0 1st line starts at 00000, Pattern 0 2nd line starts at 00100 etc., Pattern 1 1st line starts at 00004 etc., Pattern 64 1st line starts at 00800 etc.</P>
<P>Sprite Pattern Data is shared with background Pattern Data, but 16x16 Patterns are used.</P>
<P>The Name Table describes the entire Image Space, each Pattern is specified by a 16 bit value.</P>
</DIV>
<H2 id="bvram">B1-B6 VRAM</H2><DIV STYLE="margin-left: 1em;">
<P>Physical mapping: even addresses (bit 0=0) in VRAM0 and odd addresses (bit0=1) in VRAM1.
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>00000-7FDFF<TD>Bitmap Data
<TR CLASS=port><TH>7FE00-7FFFF<TD>Cursor area (512 bytes)
</TABLE>
</DIV>
</DIV>
<H1 id="spritecursor">Sprite and Cursor</H1><DIV STYLE="margin-left: 1em;">
<H2 id="sprite">Sprite (P1-P2)</H2><DIV STYLE="margin-left: 1em;">
<P>Sprite size is 16x16, 125 sprites can be specified in the Sprite Attribute Table.
<P>Up to 16 sprites can be displayed on one horizontal line.
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI>Sprite Priority
</UL>
<P>Each sprites can be displayed in front or behind of the front layer.</P>
<P>Sprites that are listed first in the Sprite Attribute Table have a higher priority than those listed last.</P>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI>Sprite Coordinate Space
</UL>
<P>Sprites exist in a seperate coordinate space from normal image space. Sprite coordinate (0,0) is always the top-left of the display area. The Sprite coordinate space is 1024x256 and display wrapping is done along its edges.</P>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI>Sprite Attribute Table
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR CLASS=block><TD CLASS=port>Offset +0<TD CLASS=first COLSPAN=8>Y
<TR CLASS=block><TD CLASS=port>Offset +1<TD CLASS=first COLSPAN=8>PAT
<TR CLASS=block><TD CLASS=port>Offset +2<TD CLASS=first COLSPAN=8>X (bit 7-0)
<TR><TD CLASS=port>Offset +3<TD CLASS=first COLSPAN=2>SC5-4<TD>P<TD>D<TD>-<TD>-<TD COLSPAN=2>X (bit 9-8)
</TABLE>
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>Y<TD>: Sprite Y-coordinate (Actual display position is one line below specified)
<TR CLASS=port><TH>X<TD>: Sprite X-coordinate
<TR CLASS=port><TH>PAT<TD>: Sprite Pattern Number (Pattern Offset is specified in R#25 SGBA)
<TR CLASS=port><TH>P<TD>: Sprite is in front of the front layer when P=0, sprite is behind the front layer when P=1.
<TR CLASS=port><TH>D<TD>: Sprite is disabled when D=1
<TR CLASS=port><TH>SC5-4<TD>: Palette offset for sprite colors.
</TABLE>
<P>Even though there is room for 128 sprite entries, only the first 125 are functional. The extra 12 bytes are unused by the VDP and can be used at the programmer's discretion.</P>
</DIV>
<H2 id="cursor">Cursor (B1-B6)</H2><DIV STYLE="margin-left: 1em;">
<P>Cursor size is 32x32, 2 cursors can be specified and displayed on screen.</P>
<P>When using a cursor (enabled in R#8 SPD), 512 bytes from the upper address of VRAM (7FE00-7FFFF) are used as the data area for the cursor. Display is also possible in this area, no skipping occurs during display.</P>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI>Cursor Coordinate Space
</UL>
<P>Cursors exist in a seperate coordinate space from normal image space. Cursor coordinate (0,0) is always the top-left of the display area. The Cursor coordinate space is 1024x512 and display wrapping is done along its edges.</P>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI>Cursor Attribute Table
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR CLASS=block><TD CLASS=port>7FE00<TD CLASS=first COLSPAN=8>Y (bit 7-0)
<TR CLASS=block><TD CLASS=port>7FE02<TD CLASS=first>-<TD>-<TD>-<TD>-<TD>-<TD>-<TD>-<TD>Y (bit 8)
<TR CLASS=block><TD CLASS=port>7FE04<TD CLASS=first COLSPAN=8>X (bit 7-0)
<TR><TD CLASS=port>7FE06<TD CLASS=first COLSPAN=2>CC1-0<TD>EOR<TD>D<TD>-<TD>-<TD COLSPAN=2>X (bit 9-8)
<TR CLASS=port><TD COLSPAN=9>+8 for 2nd cursor
</TABLE>
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>Y<TD>: Cursor Y-coordinate (Actual display position is one line below specified, two lines for interlace)
<TR CLASS=port><TH>X<TD>: Cursor X-coordinate
<TR CLASS=port><TH>D<TD>: Cursor is disabled when D=1
<TR CLASS=port><TH>CC1-0<TD>: Cursor Color value (Added to palette offset specified in R#28 CSPO5-2). If CC1-0=0 and EOR=0, clear color is used.
<TR CLASS=port><TH>EOR<TD>: Cursor is displayed on screen with EOR color when EOR=1 and CC1-0=0
</TABLE>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI>Cursor Pattern Table
</UL>
<P>Cursor Pattern Table is located at 7FF00 (7FF80 for 2nd cursor).</P>
<P>Cursor pattern is specified by a bit pattern of 128 bytes. Each bit is a pixel, and each line of 32 pixels is specified in 4 consecutive bytes.</P>
</DIV>
</DIV>
<H1 id="command">COMMAND</H1><DIV STYLE="margin-left: 1em;">
<H2 id="commandmethod">Command execution method</H2><DIV STYLE="margin-left: 1em;">
<P>After setting the necessary parameter register, set the command to the operation code register, and it will be executed. As soon as execution is started, the <a href="#p5">status</a> CE is set to "1" and upon completion, it is reset to "0". Furthermore, the <a href="#p6">interrupt flag</a> CE is set to "1".</P>
<P>Most commands are issued after the necessary registers out of the following parameters are set. Also some commands require output and input of the necessary data at and through the <a href="#p2">command data port</a> after they are issued.</P>
<OL>
<LI>Source (for transfer) coordinate
<LI>Destination (for transfer) coordinate
<LI>Transfer range coordinates
<LI>Argument, logical operation and Write Mask
<LI>Font color
</OL>
<P>The following commands are available:</P>
<TABLE CELLSPACING=0>
<TR CLASS=block><TH CLASS=first>Opcode<TH>Mnemonic<TH>Operation
<TR CLASS=block><TD CLASS=first>0<TD>STOP<TD STYLE="text-align: left;">Command being executed is stopped.
<TR CLASS=block><TD CLASS=first>1<TD>LMMC<TD STYLE="text-align: left;">Data is transferred from CPU to VRAM rectangle area.
<TR CLASS=block><TD CLASS=first>2<TD>LMMV<TD STYLE="text-align: left;">VRAM rectangle area is painted out.
<TR CLASS=block><TD CLASS=first>3<TD>LMCM<TD STYLE="text-align: left;">VRAM rectangle area data is transferred to CPU.
<TR CLASS=block><TD CLASS=first>4<TD>LMMM<TD STYLE="text-align: left;">Rectangle area data is transferred from VRAM to VRAM.
<TR CLASS=block><TD CLASS=first>5<TD>CMMC<TD STYLE="text-align: left;">CPU character data is color-developed and transferred to VRAM rectangle area.
<TR CLASS=block><TD CLASS=first>7<TD>CMMM<TD STYLE="text-align: left;">VRAM character data is color-developed and transferred to VRAM rectangle area.
<TR CLASS=block><TD CLASS=first>8<TD>BMXL<TD STYLE="text-align: left;">Data on VRAM linear address is transferred to VRAM rectangle area.
<TR CLASS=block><TD CLASS=first>9<TD>BMLX<TD STYLE="text-align: left;">VRAM rectangle area data is transferred onto VRAM linear address.
<TR CLASS=block><TD CLASS=first>10<TD>BMLL<TD STYLE="text-align: left;">Data on VRAM linear address is transferred onto VRAM linear address.
<TR CLASS=block><TD CLASS=first>11<TD>LINE<TD STYLE="text-align: left;">Straight line is drawn on X/Y-coordinates.
<TR CLASS=block><TD CLASS=first>12<TD>SEARCH<TD STYLE="text-align: left;">Border color coordinates on X/Y space are detected.
<TR CLASS=block><TD CLASS=first>13<TD>POINT<TD STYLE="text-align: left;">Color code of specified point on X/Y-coordinates is read out.
<TR CLASS=block><TD CLASS=first>14<TD>PSET<TD STYLE="text-align: left;">Drawing is executed at drawing point on X/Y-coordinates.
<TR><TD CLASS=first>15<TD>ADVANCE<TD STYLE="text-align: left;">Drawing point on X/Y-coordinates is shifted.
</TABLE>
</DIV>
<H2 id="writeoperations">Write operations</H2><DIV STYLE="margin-left: 1em;">
<P>Any command that writes to VRAM is using a Logical Operation (LOP) and a Write Mask (WM), specified as follows.</P>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI>Logical Operation
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>R#45<TD CLASS=first>0<TD>0<TD>0<TD>TP<TD>L11<TD>L10<TD>L01<TD>L00
</TABLE>
<P>WC (Write Color) is obtained through logical operation with SC (Source Color) and DC (Destination Color). The logical operation can be constructed as follows:
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>L00<TD>: WC value for the bit with SC=0 and DC=0.
<TR CLASS=port><TH>L01<TD>: WC value for the bit with SC=0 and DC=1.
<TR CLASS=port><TH>L10<TD>: WC value for the bit with SC=1 and DC=0.
<TR CLASS=port><TH>L11<TD>: WC value for the bit with SC=1 and DC=1.
<TR CLASS=port><TH>TP<TD>: When this bit is "1", the data with SC as all "0" (by pixel for the X/Y-coordinates and by byte for the linear address) is not transferred.
</TABLE>
<P><Example>
<TABLE CELLSPACING=0>
<TR CLASS=block><TH CLASS=first>Logical Operation<TH>L11<TH>L10<TH>L01<TH>L00
<TR CLASS=block><TH CLASS=first>WC = SC<TD>1<TD>1<TD>0<TD>0
<TR CLASS=block><TH CLASS=first>WC = <SPAN STYLE="text-decoration: overline;">SC</SPAN><TD>0<TD>0<TD>1<TD>1
<TR CLASS=block><TH CLASS=first>WC = SC AND DC<TD>1<TD>0<TD>0<TD>0
<TR CLASS=block><TH CLASS=first>WC = SC OR DC<TD>1<TD>1<TD>1<TD>0
<TR><TH CLASS=first>WC = SC EOR DC<TD>0<TD>1<TD>1<TD>0
</TABLE>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI id="writemask">Write Mask
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>R#46<TD CLASS=first COLSPAN=8>WM (bit 7-0)
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>R#47<TD CLASS=first COLSPAN=8>WM (bit 15-8)
</TABLE>
<P>When drawing by means of commands, writing can be prohibited by bits. With WM (bit 7-0) and WM (bit 15-8), VRAM0 bit and VRAM1 bit are specified respectively. Then "1" is for write enable and "0" is for write prohibit.</P>
<P>In P1 mode, writing is prohibited on the side not specified as the transfer destination. (Layer "A":R#46, Layer "B":R#47)</P>
</DIV>
<H2 id="LMMC">LMMC (Logical Move to Memory from CPU)</H2><DIV STYLE="margin-left: 1em;">
<P>Transfer data from CPU to VRAM rectangle area.</P>
<P>Set DX, DY, NX, NY, DIY, DIX and finally OP.</P>
<P>Output the necessary number of bytes to the <a href="#p2">command data port (P#2)</a> as follows.</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>2bpp<TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>1st byte<TD CLASS=first COLSPAN=2>1st pixel<TD COLSPAN=2>2nd pixel<TD COLSPAN=2>3rd pixel<TD COLSPAN=2>4th pixel
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>2nd byte<TD CLASS=first COLSPAN=2>5th pixel<TD COLSPAN=2>6th pixel<TD COLSPAN=2>7th pixel<TD COLSPAN=2>8th pixel
<TR CLASS=port><TD><TD COLSPAN=8 STYLE="text-align: center;"><B>...</B>
</TABLE>
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>4bpp<TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>1st byte<TD CLASS=first COLSPAN=4>1st pixel<TD COLSPAN=4>2nd pixel
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>2nd byte<TD CLASS=first COLSPAN=4>3rd pixel<TD COLSPAN=4>4th pixel
<TR CLASS=port><TD><TD COLSPAN=8 STYLE="text-align: center;"><B>...</B>
</TABLE>
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>8bpp<TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>1st byte<TD CLASS=first COLSPAN=8>1st pixel
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>2nd byte<TD CLASS=first COLSPAN=8>2nd pixel
<TR CLASS=port><TD><TD COLSPAN=8 STYLE="text-align: center;"><B>...</B>
</TABLE>
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>16bpp<TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>1st byte<TD CLASS=first COLSPAN=8>1st pixel color code low
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>2nd byte<TD CLASS=first COLSPAN=8>1st pixel color code high
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>3rd byte<TD CLASS=first COLSPAN=8>2nd pixel color code low
<TR CLASS=port><TD><TD COLSPAN=8 STYLE="text-align: center;"><B>...</B>
</TABLE>
</DIV>
<H2 id="LMMV">LMMV (Logical Move to Memory from VDP)</H2><DIV STYLE="margin-left: 1em;">
<P>The VRAM rectangle area is painted out by using the color code.</P>
<P>Set DX, DY, NX, NY, DIY, DIX, FC finally and OP.</P>
</DIV>
<H2 id="LMCM">LMCM (Logical Move to CPU from Memory)</H2><DIV STYLE="margin-left: 1em;">
<P>The data of the rectangle area in VRAM is transferred to CPU.</P>
<P>Set SX, SY, NX, NY, DIY, DIX and finally OP.</P>
<P>After this, the data for necessary number of bytes is read from the <a href="#p2">command data port (P#2)</a>. See <A HREF="#LMMC">LMMC</A> for data format.</P>
</DIV>
<H2 id="LMMM">LMMM (Logical Move to Memory from Memory)</H2><DIV STYLE="margin-left: 1em;">
<P>The rectangle area data is transferred from VRAM to VRAM.</P>
<P>Set SX, SY, DX, DY, NX, NY, DIY, DIX and finally OP.</P>
</DIV>
<H2 id="CMMC">CMMC (Character Move to Memory from CPU)</H2><DIV STYLE="margin-left: 1em;">
<P>The data for each character is transferred from CPU to the rectangle area in VRAM.</P>
<P>Set DX, DY, NX, NY, DIY, DIX, FC, BC and finally OP.</P>
<P>Output the necessary number of bytes to the <a href="#p2">command data port (P#2)</a>.</P>
<P>The character data is similar to the MSX kanji ROM. It's provided in the order of upper left, upper right, lower left and lower right blocks (8 bytes each) of the 16x16 font.</P>
<TABLE CELLSPACING=0>
<TR CLASS=block><TD CLASS=first>1st<BR>8 bytes<TD>2nd<BR>8 bytes<TD ROWSPAN=2 CLASS=port>Font : 16 pixels vertical x 16 pixels horizontal
<TR><TD CLASS=first>3rd<BR>8 bytes<TD>4th<BR>8 bytes
</TABLE>
</DIV>
<H2 id="CMMM">CMMM (Character Move to Memory from Memory)</H2><DIV STYLE="margin-left: 1em;">
<P>Data for each character is transferred from VRAM linear address to VRAM rectangle area.</P>
<P>Set SA, DX, DY, NX, NY, DIY, DIX, FC, BC and finally OP.</P>
<P>Data format is the same as for <A HREF="#CMMC">CMMC</A>.</P>
</DIV>
<H2 id="BMXL">BMXL (Byte Move to XY from Linear)</H2><DIV STYLE="margin-left: 1em;">
<P>The data on the linear address in VRAM is transferred to the rectangle area.</P>
<P>Set SA, DX, DY, NX, NY, DIY, DIX and finally OP.</P>
</DIV>
<H2 id="BMLX">BMLX (Byte Move to Linear from XY)</H2><DIV STYLE="margin-left: 1em;">
<P>The data of the rectangle area in VRAM is transferred onto the linear address.</P>
<P>Set SX, SY, DA, NX, NY, DIY, DIX and finally OP.</P>
</DIV>
<H2 id="BMLL">BMLL (Byte Move to Linear from Linear)</H2><DIV STYLE="margin-left: 1em;">
<P>The data on the linear address in VRAM is transferred onto the linear address.</P>
<P>Set SA, DA, NA, DIY, DIX and finally OP.</P>
<P>Note: BMLL operates on interleaved VRAM (as in B-modes) always, so that must be taken into account for using it in P1 or areas of P2. This means that source and destination addresses must be rotated one left and the correct <A HREF="#writemask">Write Mask</A> must be set.</P>
</DIV>
<H2 id="LINE">LINE</H2><DIV STYLE="margin-left: 1em;">
<P>A straight line is drawn from the reference point on VRAM.</P>
<P>Set DX, DY, MJ, MI, DIY, DIX, MAJ, FC and finally OP.</P>
</DIV>
<H2 id="SEARCH">SEARCH</H2><DIV STYLE="margin-left: 1em;">
<P>A border color (or non-border color) is searched for toward the right (or left) of the base point on VRAM.</P>
<P>Set SX, SY, DIX, NEQ, FC and finally OP.</P>
<P>Afterwards, BX (R#53,54) contains the border X-coordinate.</P>
</DIV>
<H2 id="POINT">POINT</H2><DIV STYLE="margin-left: 1em;">
<P>The color code at the base point on VRAM is read out.</P>
<P>Set SX, SY and finally OP.</P>
<P>The (SX,SY) color code can now be read from the <a href="#p2">command data port (P#2)</a> as follows.</P>
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>2bpp<TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port><TD CLASS=first COLSPAN=2>color code<TD COLSPAN=6>unspecified
</TABLE>
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>4bpp<TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port><TD CLASS=first COLSPAN=4>color code<TD COLSPAN=4>unspecified
</TABLE>
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>8bpp<TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port><TD CLASS=first COLSPAN=8>color code
</TABLE>
<TABLE CELLSPACING=0>
<TR CLASS=port><TH>16bpp<TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>1st byte<TD CLASS=first COLSPAN=8>color code low
<TR CLASS=port><TD><TD COLSPAN=8>
<TR><TD CLASS=port>2nd byte<TD CLASS=first COLSPAN=8>color code high
</TABLE>
</DIV>
<H2 id="PSET">PSET</H2><DIV STYLE="margin-left: 1em;">
<P>A point is drawn on VRAM. After that, the pointer can be advanced.</P>
<P>Set DX, DY, FC and finally OP, AYM, AYE, AXM and AXE.</P>
<P>DX, DY should not be set when using the current pointer.</P>
</DIV>
<H2 id="ADVANCE">ADVANCE</H2><DIV STYLE="margin-left: 1em;">
<P>The drawing pointer is moved.</P>
<P>Set DX, DY, and finally OP, AYM, AYE, AXM and AXE.</P>
<P>DX, DY should not be set when using the current pointer.</P>
</DIV>
</DIV>
<H1 id="v9990regspec">V9990 REGISTER SPECIFICATIONS</H1><DIV STYLE="margin-left: 1em;">
<H2 id="ioportspec">I/O PORT SPECIFICATIONS</H2><DIV STYLE="margin-left: 1em;">
<TABLE CELLSPACING=0>
<TR CLASS=port><TD>P#0<TD><a href="#p0">VRAM DATA</a><TD>(R/W)
<TR CLASS=port><TD>P#1<TD><a href="#p1">PALETTE DATA</a><TD>(R/W)
<TR CLASS=port><TD>P#2<TD><a href="#p2">COMMAND DATA</a><TD>(R/W)
<TR CLASS=port><TD>P#3<TD><a href="#p3">REGISTER DATA</a><TD>(R/W)
<TR CLASS=port><TD>P#4<TD><a href="#p4">REGISTER SELECT</a><TD>(W)
<TR CLASS=port><TD>P#5<TD><a href="#p5">STATUS</a><TD>(R)
<TR CLASS=port><TD>P#6<TD><a href="#p6">INTERRUPT FLAG</a><TD>(R/W)
<TR CLASS=port><TD>P#7<TD><a href="#p7">SYSTEM CONTROL</a><TD>(W)
<TR CLASS=port><TD>P#8-B<TD>Kanji ROM
<TR CLASS=port><TD>P#C-F<TD>Reserved
</TABLE>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI id="p0">VRAM DATA PORT (READ/WRITE)
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>P#0<TD CLASS=first COLSPAN=8>VRAM Data
</TABLE>
<UL style="padding-left: 1.5em;">
<LI>The data written in this port is written in the VRAM address specified by using R#0 to R#3. If writing to this port has taken place before completion of data write in VRAM, a WAIT signal is output.
<LI>By reading through this port, the VRAM address data specified by using R#3 to R#5 is obtained. If reading has taken place at this port before data preparation, a WAIT signal is output. When VRAM read address has been modified to prepare the VRAM address data at completion of data write to R#5, it must be written in R#5.
</UL>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI id="p1">PALETTE DATA PORT (READ/WRITE)
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>P#1<TD CLASS=first colspan=8>Palette Data
</TABLE>
<UL style="padding-left: 1.5em;">
<LI>The data written in this port is written in the internal palette RAM.
<LI>By reading through this port, the internal palette RAM data can be obtained. A WAIT signal is output till the data has been prepared.
<LI>The palette RAM address is specified by using R#14.
<LI>The data format is as follows.
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR CLASS=block><TD CLASS=port>RED<TD CLASS=first style="text-decoration: overline;">YS<TD>-<TD>-<TD>R4<TD>R3<TD>R2<TD>R1<TD>R0
<TR CLASS=block><TD CLASS=port>GREEN<TD CLASS=first>-<TD>-<TD>-<TD>G4<TD>G3<TD>G2<TD>G1<TD>G0
<TR><TD CLASS=port>BLUE<TD CLASS=first>-<TD>-<TD>-<TD>B4<TD>B3<TD>B2<TD>B1<TD>B0
</TABLE>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI id="p2">COMMAND DATA PORT (READ/WRITE)
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>P#2<TD CLASS=first colspan=8>Command Data
</TABLE>
<UL style="padding-left: 1.5em;">
<LI>The command data is read and written through this port. Access to this port when the <a href="#p5">status</a> TR bit is "0" while the command is being executed will result in an output of WAIT signal.
</UL>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI id="p3">REGISTER DATA PORT (READ/WRITE)
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>P#3<TD CLASS=first colspan=8>Register Data
</TABLE>
<UL style="padding-left: 1.5em;">
<LI>The data written in this port is written in the register specified by using <a href="#p4">P#4</a>.
<LI>By reading through this port, the register data specified by using <a href="#p4">P#4</a> can be obtained.
</UL>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI id="p4">REGISTER SELECT PORT (WRITE ONLY)
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>P#4<TD CLASS=first>WII<TD>RII<TD COLSPAN=6>Register No.
</TABLE>
<UL style="padding-left: 1.5em;">
<LI>Register No. specifies which register is accessed via <a href="#p3">P#3</a>.
<LI>The Register No. undergoes a plus "1" increment through <a href="#p3">P#3</a> access. However, when WII is "1", increment in writing at <a href="#p3">P#3</a> is prohibited and when RII is "1", increment in reading at <a href="#p3">P#3</a> is prohibited.
</UL>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI id="p5">STATUS PORT (READ ONLY)
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>P#5<TD CLASS=first>TR<TD>VR<TD>HR<TD>BD<TD>0<TD>MCS<TD>EO<TD>CE
</TABLE>
<UL style="padding-left: 1.5em;">
<LI>Various types of status data can be read out as follows.
<UL style="list-style: none;">
<LI>TR : Command data transfer ready. It is reset through <a href="#p2">P#2</a> access.
<LI>VR : Vertical non-display period. It is set when the drawing of VRAM content has stopped.
<LI>HR : Horizontal non-display period
<LI>BD : Border color detect at completion of SRCH command (becomes "1" when detected)
<LI>EO : In the second field period during interlace
<LI>CE : Command being executed
<LI>MCS: Content of <a href="#p7">P#7</a> MCS
</UL>
</UL>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI id="p6">INTERRUPT FLAG PORT (READ/WRITE)
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>P#6<TD CLASS=first>0<TD>0<TD>0<TD>0<TD>0<TD>CE<TD>HI<TD>VI
</TABLE>
<UL style="padding-left: 1.5em;">
<LI>The interrupt flags can be read out as follows.
<UL style="list-style: none;">
<LI>CE : Command completion flag
<LI>HI : Display position flag
<LI>VI : Vertical display period completion flag
</UL>
<LI>By writing "1", the related bit flag is reset.
</UL>
<UL style="list-style: inside; padding: 0; color: aqua;">
<LI id="p7">SYSTEM CONTROL (WRITE ONLY)
</UL>
<TABLE CELLSPACING=0>
<TR CLASS=port><TD><TD>b7<TD>b6<TD>b5<TD>b4<TD>b3<TD>b2<TD>b1<TD>b0
<TR><TD CLASS=port>P#7<TD CLASS=first>0<TD>0<TD>0<TD>0<TD>0<TD>0<TD>SRS<TD>MCS
</TABLE>
<UL style="list-style: none;">
<LI>SRS : Writing "1" will set all ports except this one in "power ON reset" state. "0" should be written to cancel it.
<LI>MCS : The internally used master clock is selected.
<UL style="list-style: none;">
<LI>1 : MCKIN terminal
<LI>0 : XTAL1 terminal
</UL>
</UL>
<P>NOTE) XTAL1 terminal is selected when "power ON reset".</P>
</DIV>
<H2 id="regspec">Register specifications</H2><DIV STYLE="margin-left: 1em;">
<TABLE CELLSPACING=0>