GR8BIT Knowledge base article #DN0004

GR8BIT: the Real Engineering Experience
PDF PDF version  Back Back to KB list

Oct 20, 2014Severity: InformationEugeny Brychkov (RU), Ricardo Cancho Niemietz (ES) (YJK testing)

Installing V9958 into your GR8BIT

Introduction

I have got questions and requests if GR8BIT can be upgraded to the full MSX2+ standard, and I was resisting responding unconsciously "protecting" the design of the Direct Video Memory Access (DVMA) functionality.

The truth is that there're no applications that use my developed DVMA, it is just one of the features, which I positioned as a study for myself, for those who assemble and study the GR8BIT and digital electronics in overall.

And I decided to give my friends the guide upgrading their GR8BIT if they want to instead of trying to secure unused feature.

But before you run for the modification, please read about functional enhancements and our test of the YJK coding system on the real photo.

Running ahead I want to say that upgrading appeared to be extremely simple.

Electrical differences

Let's consider pin by pin as they are connected in the GR8BIT:

PinV9938V9958Difference
4VDSOVRESETIConnected to the DVMA circuit and pulled up. With V9958 input gets high level, and DVMA circuit is inactive due to no changes in this signal's level. For description of how DVMA works see GR8BOOK Part I chapter 6.3.
5HSYNCI/OHSYNCOBoth signals are now binary (only two levels - high and low). Logically middle level now became low, and Q4 and Q10 transistors act as DC-voltage followers and they do not saturate.
6CSYNCI/OCSYNCO
8CPUCLKOCPUCLK/VDSOBy default pin is CPUCLK, and no change is required.
21VIDEOOVDD/DACIFor V9938 configuration this pin is output pulled down through 1K resistor. For V9958 it should be connected to +5V power rail.
26LPSIWAITOBy default wait functionality is disabled, pin pulled up.
27LPDIHRESETIInput, in GR8BIT is pulled up.

Enhancements in functionality

There're no many changes in functionality, however in some implementations they are considered as important. They include:

Upgrading your GR8BIT with V9958

Warning

Warning: after you perform described modifications, do not put original V9938 VDP back into the socket. Otherwise VDP's output circuits will be destroyed and chip will become unusable.

Connect DAC power

The only required modification is to supply +5 volts power to the VDD/DAC power input of the V9958. Do not forget to re-install VDP's heat sink.

You connect pin 21 of the VDP to the emitter of the Q10 located nearby. Take precautions regarding the static electricity, or perform modifications with VDP not inserted.

Note that if you upgrade permanently you may consider doing the following actions:

  1. Resistor between pins 1 and 2 in the resistor pack RN1 becomes connected to 5V power rails. To save 25 mW of the continuous power, carefully cut short track located at the component side going from VDP's pin 21 to pin 2 of RN1 (not displayed). Resistor pack supplied within GR8BOX is of 125 mW rating. Alternatively to cutting track, you can desolder RN1 and bend or cut its pin 2 so that it is not connected to its pad. Do not cut pin 1 as it still supplies ground to the resistors connected to the R, G and B outputs.
  2. Remove IC18 and IC14. After V9958 is installed, DVMA is not functional, and you can save on power and bus load by removing these chips.

Testing YJK function

YJK mode is enabled in all new SCREEN modes 10, 11 and 12; YAE is reset in SCREEN 12 mode. We will consider full-YJK testing (SCREEN 12 mode).

Shot of the clown picture from the screen
Shot of the TV image of the photo of the clown. Photo was converted using algorithm in Appendix 1 (from 24-bit GRB to full-YJK format)

Distorted hard of the clown

The picture above shows capabilities of the V9938 graphics subsystem in YJK mode. While clown is displayed with very colorful palette, the picture is severely distorted in the places where colors significantly change (picture to the right).

In the code in Appendix 1 we deliberately used floating point division and then addition before taking integer part of Y component to smooth the transition of the colors within 4-pixel cells, this trick does not help for smoothing between these 4-pixel cells.

Given horizontal resolution of the V9958's screen (256 dots) and sizes of the modern displays the 4-pixel cells have huge area size on the screen, and distortions are very visible. We assume this fact is one of the reasons why this implementation of the YJK coding system was not widely used and was not brought forward. Please note that putting pixels into the cells (grouping them by some attribute) is widely used in JPEG algorithms, however JPEG can operate with hundreds and thousands of the horizontal pixels, having single pixel relatively small for eye to see the resulting distortion.

Dependencies

With very high degree of probability you will need to implement KB0005 modifications to display images in SCREEN modes 10, 11 and 12 properly because these modes are based on the SCREEN 8 mode (G7).

Special thanks to

Sources and information for further reading

Appendix 1. VBA code to convert one 24-bit RGB scan line to YJK data.

Note: scan line length is 256 pixels (768 bytes of the data, no opacity byte)

' Written by Ricardo Cancho Niemietz (2014), Excel VBA
For i = 0 To 255
n = i * 3
' Compute average RGB (15 bits) at first of every 4th pixel
If i Mod 4 = 0 Then
' NOTE: integral division used, no further clipping needed.
' NOTE: scanline pixel's components come in BGR order.
b = ((CInt(line(n)) + line(n + 3) + line(n + 6) + line(n + 9)) \ 4) \ 8
g = ((CInt(line(n + 1)) + line(n + 4) + line(n + 7) + line(n + 10)) \ 4) \ 8
r = ((CInt(line(n + 2)) + line(n + 5) + line(n + 8) + line(n + 11)) \ 4) \ 8
' Compute common Y
' NOTE: compute with rounding, then deprecate fractional part.
y = Int((r / 4) + (g / 8) + (b / 2))
' Compute common J & K for next four pixels
j = r - y
k = g - y
End If

' Convert current pixel BGR to 15 bits
b = line(n) \ 8
g = line(n + 1) \ 8
r = line(n + 2) \ 8
' Compute individual Y
' NOTE: compute with rounding, then deprecate fractional part.
y = Int((r / 4) + (g / 8) + (b / 2))
' Dump values to binary buffer
If i Mod 4 = 0 Then
yjk(i) = ((y * 8) Or (k And &H7))
ElseIf i Mod 4 = 1 Then
yjk(i) = ((y * 8) Or ((k And &H38) \ 8))
ElseIf i Mod 4 = 2 Then
yjk(i) = ((y * 8) Or (j And &H7))
ElseIf i Mod 4 = 3 Then
yjk(i) = ((y * 8) Or ((j And &H38) \ 8))
End If
Next

End of DN0004 "Installing V9958 into your GR8BIT".


© 2011-2024 Eugeny Brychkov http://www.gr8bit.ru Status: Released

    Counter     Pagerank
    Valid CSS     Valid HTML5

GR8BIT™, GR8BOOK™, GR8BUS™, GR8BOX™, GR8STORM™ and GR8NET™ are trademarks copyright © 2010-2024 Eugeny Brychkov.
Please refer to: copyright statement, privacy policy.