#306 Mirrored VDP mode doesn't work on Toshiba VDP's

Graphics (138)

<n_n> mirrored mode however is known not to work on toshiba vdp
<n_n> to clarify
<n_n> mirrored mode = screen2 with a mask on the pattern or color table address to make it use less than 3 separate tables

<Quibus> mirrored mode doesn't have a test in ident.bas, right?
<n_n> it does
<n_n> it's the 'do you see this text 3 times?' test
<Quibus> ah
<Quibus> mirrorred mode works always, except on Toshiba MSX1 VDP's?
<n_n> yes, it works on v9938/58 too

So, also testable with ident.bas. openMSX doesn't emulate this difference at all.


1 2 > >> (Page 1 of 2)
  • SD Snatcher

    SD Snatcher - 2012-12-20

    Any news on this matter? Would it be to hard to emulate this VDP and its unique color palette?

    It would be nice to test some future patches, since it's very hard to come by a machine with this specific VDP.

    It would be good to attach the IDENT.BAS file here too. The only test I know is this one:

    screen2:vdp(3)=159:vdp(4)=0:line(33,33)-(99,55),15,bf:a$=input$(1) [ENTER]

    The Toshiba T6950 VDP will show only a single horizontal white band, while the other VDPs (even the v2 of the Toshiba VDP inside the T7937 chipset) will show three horizontal white bands.

    It's unsure which version of the Toshiba VDP is inside the T7775 chipset.

  • Manuel Bilderbeek

    ZIP containing ident.bas

  • SD Snatcher

    SD Snatcher - 2013-07-17

    You asked me to bump important features if I feel they're forgotten. As a developer, the proper Toshiba VDPs emulation is a very high priority feature, because we need to know if the software will misbehave or look weird on certain machines.

    1) The T6950 features:
    - Lack of support for the mirrored VDP modes
    - Different color palette. See here: http://bifi.msxnet.org/paledit/?t=2&d=palette

    2) The T7937A MSX-Engine features:
    - Supports mirrored VDP modes properly
    - The same color palette as the T6950.

    Bugs #305, #400 and #228 are related with this one and should ideally be solved together. They all deal with hardware idiosyncrasies that have impact for those who develop MSX software.

    Last edit: SD Snatcher 2013-07-17
  • SD Snatcher

    SD Snatcher - 2014-07-03


    I feel kinda sad I couldn't detect the T6950 incompatibilities when I tested the MSXdev'14 entries...

    Please implement the T6950 lack of support for the mirrored modes.

  • Wouter Vermaelen

    Do we know exactly how the 'mirroring' stuff on T6950 is behaving? The 'normal' mirror mode is a side effect of how the VRAM address calculation works (base-register AND index), see doc/internal/vram-addressing.txt for more details. If the T6950 does not show this mirror behavior it could be for various different reasons. One possibility (but just a guess) is that the VRAM addressing formula is ((base-register AND index-mask) OR index) with index-mask a value like 0xb1111111000000, so basically ignoring the lower few bits of the register.

    If the vram addressing for the character table uses a different formula, then it's likely that other tables use a different formula as well. Do we know anything about that?

    I'm willing to implement this in openMSX, but only if we're reasonably sure exactly how it works. And I won't be investigating this myself. I also don't have access to a MSX with T6950 VDP.

  • Manuel Bilderbeek

    <mth> Quibus: if I understand hap correctly, all there is to it is that the bits that would control masking are treated as always 1 in SCREEN2

    Only for screen 2 and only for the nametable.

  • Manuel Bilderbeek

    <mth> Quibus: in VDP::updateColorBase(), for Graphics2, check whether it's a Toshiba VDP and OR the set value if so
    <mth> same for VDP::updatePatternBase()

  • Manuel Bilderbeek

    It would help to know which machines have which exact VDP type :) FRS, can you help?

  • SD Snatcher

    SD Snatcher - 2014-07-16

    Tiago Valença was also kind enough to reverse engineer the palette of the Toshiba VDPs. He sampled directly from the T7937A pins using an analog osciloscope. It's the best measurement we have so far:

    color 1:

    color 2:

    color 3:

    color 4:

    color 5:

    color 6:

    color 7:

    color 8:


    color 10:

    color 11:

    color 12:

    color 13:

    color 14:

    color 15

    Note: The color-9 outputs the Red pin higher than the white level. It will be saturated to the max level on the monitor.

    Last edit: SD Snatcher 2014-07-16
  • Manuel Bilderbeek

    About the colors:
    - are the colors of NTSC(TMS99X8A) and PAL(TMS9929A) the same? If not, is it known what the differences are?
    - are the colors of T6950 in NTSC mode the same as T6950 in PAL mode?
    - does the T7937A also have an NTSC/PAL pin? In which machines is this engine used and how is the NTSC/PAL pin connected, if it's available? And of course the same question as for the T6950.

    Also, how to interpret these voltages? What is the max level to scale to? See how it's done for the TMS99X8 palette here: https://sourceforge.net/p/openmsx/openmsx/ci/master/tree/src/video/Renderer.cc

    Last edit: Manuel Bilderbeek 2014-07-16
  • SD Snatcher

    SD Snatcher - 2014-07-17

    Obs: For the answer bellow, keep in mind that I'm talking about the color output directly measured from the chip, before any other conversion or encoding done by other circuitry in the motherboard. NTSC/PAL color encoding will certainly affect how the colors look. The same is valid for the YUV->RGB circuitry that all MSX1 with a Texas VDP will have if they feature a RGB connector.

    The table in the page 2-17 of the TMS99x8 datasheet states that the colors are the same for both the TMS9928 and TMS9929. The only difference is in the color burst, that will only affect composite or s-video outputs, which cause many other color distortions that I believe are not the focus of your question.

    Also the palette for the newer TMS91x8 seems to be the same as the older TMS99x8 versions, as the following article seem to have checked:

    Both the T6950 and the T7937A have the NTSC/PAL selection pin. I can attach their pinouts here if needed. I don't know on the T6950, but the T7937A behaves just like the V99x8 and the SMS VDP, where selecting between 60Hz/50Hz doesn't seem to have affect in the colors in any way. I think we can safely assume that the T6950 behaves like this too, since both seems to be the same VDP (but see note-2).

    Like on the Sega Master System, the frequency selection pin is a selection jumper, usually hardwired to a given selection by the manufacturer. But this jumper can be opened and connected to a switch (as many SMS owners do). So, if possible it would be nice to have a command like set Toshiba_VDP_vfreq=50Hz, for example.

    In either Toshiba VDPs the vertical frequency was configured by the manufacturer depending on the TV system of the country where the machine was marketed. These are some of the machines I researched and their respective VDPs, default frequency, region and TV system:

    • Sony HB-10P: T6950, 50Hz, Europe, PAL
    • Sony HB-20P: T6950, 50Hz, Europe, PAL
    • Casio MX-15: T6950, 60Hz, Japan, NTSC
    • Toshiba HX-20I: T6950, 50Hz, Italy, PAL
    • Toshiba HX-30: T6950, 60Hz, Japan, NTSC
    • Toshiba HX-51: T7937A, 50Hz, Europe, PAL
    • Toshiba HX-52: T7937A, 50Hz, Europe, PAL
    • Gradiente Expert Plus: T7937A, 60Hz, Brazil, PAL-M
    • Gradiente Expert DD-Plus: T7937A, 60Hz, Brazil, PAL-M
    • Al-Alamiah AX-170: T7937A, 50Hz, PAL, Arab countries, PAL
    • Sanyo MPC-200(SP)-00: T6950, 50Hz, Spain, PAL

    Sanyo MPC-200 pictures:

    Toshiba HX-51:

    Toshiba HX-52:

    I’ll check the voltages question with the hardware guys.

    Note1: I don’t know if the MPC-200 sold in other countries feature the T6950 VDP. The same applies for the HX-20. They would have to be checked.
    Note2: The T7937A VDP has the mirroring feature fixed, but still features the Toshiba specific palette.
    Note3: Toshiba’s VDPs use the same 21MHz crystal as the V99x8 VDPs. Further investigation is needed to check if this gives them more VRAM bandwidth like the MSX2 VDP, but it seems very likely. They also seem to react more like an MSX2 VDP when you try to run MSX2 games in it.
    Note4: I asked some friends to see if they can find other machines featuring Toshiba VDPs

  • Manuel Bilderbeek

    Hm, looks like color 5 is also going over 3.4V, should I also clip that then? :S I wonder how reliable these measurements are with 2 colors with 'weird' values... But I'll try anyway! I hope you can give more info on these voltages.

  • Manuel Bilderbeek

    This is what I get with normal vs Toshiba palette. Does it look like real? Can anyone tell? I just scaled the voltages given in the range 0.75-3.4V to 0-255 range.

    Last edit: Manuel Bilderbeek 2014-07-18
  • SD Snatcher

    SD Snatcher - 2014-07-18

    Yes, Tiago also mentioned this weird behavior of some "brighter than white" levels. Some CRT monitors will just saturate the value, but the majority, the analog circuitry will react as if the max scale for that specific color is a bit higher. You can try to adjust the scales only for those specific colors.

    In overall, the colors seem very faithful to me, except these two colors:

    Color-9: It seems a tad more reddish on the real thing.
    Color-7: It seems a bit brighter on the real thing

    But, you know, it's hard to compare those just based on visuals. :)

    Good news: I have another friend capturing the colors in his machine with a digital osciloscope this time. So we'll have even better measurements soon. But in the meanwhile the current colors seem very good.

  • Manuel Bilderbeek

    Alright, I'll await the results of the digital oscilloscope measurements before trying again. I hope they're more accurate.

    One other question... as far as I understand the T7937A also has a PAL/NTSC pin. I guess it's only used to determine the timing (PAL or NTSC timing), is that correct? If so, the pin is set on NTSC on Gradiente machines, right? (Even though it has PAL-M output in the end.)

    The thing is: for both T6950 and T7937A (and perhaps other "configurable" MSX1 VDP's) I need to know whether I should consider them PAL or NTSC to know whether the emulation should use PAL or NTSC timing.

  • SD Snatcher

    SD Snatcher - 2014-07-20

    Here it is, the complete reading of the Toshiba palette using a digital oscilloscope. The deserved credits go to Carlos Mansur.

    All values are averages of 64 readings, with a low-pass filter @20MHz. Y=Luminance+Sync, R=Red, G=Green, B=Green. Luminance was read so we could see how the super-white colors would affect the monochrome signal.

    Two sets of measurements have been made:

    1) VDP output disconnected from the rest of the circuit. Channel1 is always Y, Channel2 will be either Red, Green or Blue.
    Obs: Reading this way shows a cleaner line, with less noise. The signals range from 1V to 5V. The raw data can be obtained here:

    2) VDP output connected to the rest of the circuit. Given that the osciloscope has 2 channels, the outputs were read in two pairs: Channel1=Y/Channel2=R and Channel1=G/Channel2=B.
    Obs: Reading this way puts load on the VDP outputs, so the voltages will be lower (range between 0,6V and 3,5V) and there will be some more noise and probably some bias coming from the rest of the circuit.
    Obs2: In this reading there seems to be some kind of induction noise caused by the sync signal over the color tracks. This causes an artificial minimal value, lowering both Vmin and the average.

    Last edit: SD Snatcher 2014-07-20
  • Manuel Bilderbeek

    Thanks a lot! I could use some help to convert these into numbers...

    Also, if your friends have a T7937A can they also run the ident.bas test for us, so we can see the properties of that VDP? (They are not known to us, other than what is in this thread...)

  • SD Snatcher

    SD Snatcher - 2014-07-20

    The conversion to a 24-bit RGB triplet is done as you already guessed: by applying the Rule of the Three from the analog scale to the RGB triplet scale. This can easily done with a spreadsheet.

    It seems that this IDENT.BAS is part of some set of tools for software reverse engineering machines for openMSX, isn't? Is this set of tools+instructions available somewhere to download? This way I could always link to it when people agree to dive in such adventure. :)

  • Manuel Bilderbeek

    ident is in the 2nd post of this thread.

    I'm still wondering what to do with the 'brighter than white values':
    1) clip everything below levels of color 1 and above levels of color 15
    2) use the min and max measured level per component as range (makes white not 255 255 255)
    3) use the min and max measured level per color (if they are outside the range of color 1 and 15) as range (this is what you suggested 2 days ago, I think).

  • Manuel Bilderbeek

    These are the values I get from the screenshots of the oscilloscope. Note that I changed the G component of black from 1,16 to 1,12.... for some reason that one was 0,04V shifted (min was also lower). I used the Max values of Channel 2 from those screenshots. I hope that's correct.

    1,12 1,12 1,12
    2,64 4,2 2,64
    3,16 4,76 3,16
    2,16 2,16 4,48
    2,92 2,88 5,04
    3,96 2,4 2,4
    2,88 4,48 4,52
    4,48 2,64 2,64
    5,04 2,92 2,88
    4,24 4,2 2,4
    4,76 4,76 3,16
    2,4 3,68 2,4
    3,96 2,36 3,96
    4,24 4,2 4,2
    4,76 4,76 4,76

  • Manuel Bilderbeek

    Here's the result of adjusting scale for colors 5 and 9 (method 3), based on the digital measurements from previous post.

  • SD Snatcher

    SD Snatcher - 2014-07-22

    ident is in the 2nd post of this thread.

    Yes, yes. But I always see these tools scattered around the web and handled in ad-hoc fashion. Not only they're hard to find, as you never know if you got the latest version. Not to mention the lack of instructions so someone not related to the scene could use them easily.

    But, Ok. My question was if there as an official place to download them, so I'll assume that there isn't.

    To avoid the dreaded link rot, I'm attaching the Toshiba VDP sampled color files here.

    I analyzed again and again the data output from the oscilloscope. Placed the values in a spreadsheet so I could dig it further. The method-3 had some colors better than method-2 and vice-versa. No method seemed to produce clean and satisfactory results.

    Then I started to ask myself: And if it I was reverse engineering the V9938? Would I be satisfied with just voltages, or would I try to think deeper and obtain the real digital values from the V9938 palette?

    And that was the answer! I started looking for the relationship between the voltages. And suddenly I realized! It increases in around ~0,24V steps with some noise producing small variations. Filling a table, I noticed that:

    1) Not all steps were used by the palette
    2) There were 15 steps, which means that the Toshiba VDPs have a 4bit/channel DAC. IOW, 4096 colors.
    3) Indeed, the color 15 isn't white

    So, this is the complete digital dump of the Toshiba VDP palette, in 4bit/channel. I really hope the effort helps you all. :)

    R G B
    0 0 0
    0 0 0
    6 12 6
    8 14 8
    4 4 13
    7 7 15
    11 5 5
    7 13 13
    13 6 6
    15 7 7
    12 12 5
    14 14 8
    5 10 5
    11 5 11
    12 12 12
    14 14 14

    Edit: I noticed an error in the spreadsheet that resulted in an incorrect value for the color 9. It's fixed now.

    Last edit: SD Snatcher 2014-07-22
1 2 > >> (Page 1 of 2)