Carte Blanche



Works in progress

Side Borders

One of the things that has bothered me about the Super High Resolution (SHR) output on the Carte Blanche is the lack of side borders.  All the previous Carte Blanche video has been using 640 x 480 resolution and of course the SHR 640 mode takes up the entire screen width.  Even the 320 mode takes up 640 since I double each pixel.  Hence no room for side borders.   

Recently Bill Garber pointed out to me that there is a 720 x 480 "standard" VGA and he wondered if we could get it to work with the Carte Blanche.   The pixel clock frequency would have to be increased from 25.175 MHz to 28.3 MHz but that was well inside the capability of the SRAM where the video data is buffered.  To get 720 pixels per line the horizontal counter would have to be increased.  With 640 the horizontal counter counts 800 increments for each line.  About 900 counts per line was used for the 720 width.  Bill and I experimented to find good horizontal sync points and I later increased the horizontal counter to 910 to account for a slightly higher frequency than the specifications called for.

The outcome was that both the VGA and HDMI showed borders in SHR graphics mode on two of my LCD monitors; a Samsung Syncmaster 940MW 19" widescreen and a lenovo ThinkVision 19" wide screen.  However the VGA and HDMI outputs were different.  The VGA produced an image that was still 640 wide according to the monitors screen information on both monitors.  The active part of the screen between the side borders was "squeezed" into a smaller width producing objectionable vertical banding.  The HDMI actually produced the correct 720 width and the active part of the screen was correctly displayed.

Finder Desktop with borders.

 HDMI Screen Resolution is 720 x 480 pixels.

  Click picture to enlarge.


Finder Desktop with borders.

 VGA (6 bit) Screen Resolution is 640 x 480 pixels.

  Click picture to enlarge.


Unfortunately, the 720 x 480 resolution seems to be a little unstable.  When I move a window around with the mouse it sometimes causes the image to shake and occasionally the screen even goes black for a second.  This also can happen when holding the mouse button down in the scroll bar to make it scroll fast.


Solid Colors

Another bothersome thing about my SHR 640 output is the alternating vertical lines for the background on programs like the Finder.   On the IIgs RGB output the finder has a solid background that Apple calls periwinkle blue.  That's how it should look, but on the Carte Blanche output each pixel is clearly seen resulting in the offending vertical lines.  In the case of the Finder background the lines are white and blue.  When blue and white are side by side on an RGB output the colors are "blurred" together and look like one color, periwinkle blue.  In fact with the six colors (red, green, blue, yellow, black and white) that are used as the standard colors for 640 mode you can create 16 colors by a technique that the IIgs documentation calls dithering.
This is not the dithering where the eye blends two colors together but refers to the blurring of two colors.  
So how to do that with a VGA/HDMI output?  
We can't blur two colors together but Apple IIgs technote # 63 gave me an idea how we could simulate the dithering. Table 2 in the technote shows that the standard RGB colors are either full on or off.

                  Color Table    Color      Master Color
                    Offset       Name          Value
                      $0         Black         $0000
                      $1         Red           $0F00
                      $2         Green         $00F0
                      $3         White         $0FFF
                      $4         Black         $0000
                      $5         Blue          $000F
                      $6         Yellow-green  $0FF0
                      $7         White         $0FFF
                      $8         Black         $0000
                      $9         Red           $0F00
                      $A         Green         $00F0
                      $B         White         $0FFF
                      $C         Black         $0000
                      $D         Blue          $000F
                      $E         Yellow-green  $0FF0
                      $F         White         $0FFF
                   Table 2-Standard 640-mode Color Table


The colors are 12 bits so the high 4 bits are always zero.  

Table 3 shows close approximations of the dithered color values.


                   Color Table  Color        Master Color
                     Offset     Name            Value
                       $0       Black           $0000
                       $1       Deep Blue       $0008 
                       $2       Yellow-brown    $0880
                       $3       Gray            $0888
                       $4       Red             $0800
                       $5       Purple          $0808
                       $6       Orange          $0F80
                       $7       Pink            $0F88
                       $8       Dark Green      $0080
                       $9       Aqua            $0088
                       $A       Bright Green    $08F0
                       $B       Pale Green      $08F8
                       $C       Gray            $0888
                       $D       Periwinkle Blue $088F
                       $E       Yellow          $0FF8
                       $F       White           $0FFF
                   Table 3-Standard 640-mode Color Table


I noticed that the numbers in table 3 were created by averaging the red, green and blue values separately.  For instance when white ($0FFF) and blue ($000F) pixels alternate the red values are $F and $0.  Averaging the two numbers (and rounding up since these values are integers) we get $8.  We get $8 for green as well and blues is $F in both colors so the average is $F.   The result is $088F which is the value for Periwinkle Blue.

The pictures shown below used a simple algorithm that just compared each pixel pair's individual color values (red, blue & green) and if the values were not equal it gave both pixels the value $8 for that color.  This has the advantage of being easy, but it only works for the standard 640 mode colors.  

Well as the title says this is a work in progress so after I took these pictures I decided to change the algorithm so that it would work on all colors instead of just the standard ones.  This new method did an actual averaging of each pixel's colors and that resulted in the standard colors having $7 instead of $8.  This looks pretty much the same to my eye.

This version (c933hdmi) defaults to non-dithered 640 SHR.  Pressing the control and ] keys together toggles between dithered and non-dithered mode.

While we're talking about colors.  The pictures displayed here are not quite the same as what you really see on the monitor due to my camera.  Specifically, the white looks "off-white" in the pictures but is a much more pure white on the monitor.  Some other colors look a little different but much less so than the white.

Finder Desktop with borders and dithered colors.

Close-up of dithering.

Close-up without dithering.

There is a bug in the dithered mode.  It's hard to see in the full desktop picture above but the entire desktop is shifted right by one pixel.

Another problem with the dithered mode is the screen is blurry on a ROM 3  IIgs.  There is a slight fuzziness on my ROM 01 as can be seen in the dithered close up above, but it is barely noticeable.


February 28, 2015