LisaList2

Advanced search  

News:

2022.06.03 added links to LisaList1 and LisaFAQ to the General Category

Pages: [1]   Go Down

Author Topic: LisaHDMI (or VGA)  (Read 12844 times)

rayarachelian

  • Administrator
  • Hero Member
  • *****
  • Karma: +105/-0
  • Offline Offline
  • Posts: 772
  • writing the code,writing the code,writing the code
    • LisaEm
LisaHDMI (or VGA)
« on: October 26, 2022, 08:09:42 am »

Idea: use an RPI Zero W (should have multiple cores, doesn't need much RAM) to collect the VSYNC, HSYNC, and video Data lines that are output to the Lisa's video analog board, and render output off the HDMI port. You'll need level converters since these are 5V on the Lisa, but the RPi wants 3.3V. You might be able to go cheap and use 3 resistors, but that might be noisy, etc.

Can be done with something other than an RPI, but the board must have multiple cores, be relatively fast, and have video output and GPIO.
Preferably all 3 lines coming from the Lisa should be readable by the SBC (Single Board Computer) in one read and not multiple. i.e. a single read byte or word.
To make it easier to detect, perhaps VSYNC should be put on a high bit so that you can test the "N" flag (negative) with a simple branch. Or perhaps it might be better to put the HSYNC line there instead as that will be tested more often.

The board should launch two processes at high priority (assuming we're using Linux) and leave any remaining cores for the OS running on it.
One process will collect data from the input lines, the second will render them onto the display (frame buffer). No other connectivity, such as ethernet, or USB is needed for this project.
The first phase of the first project will count the number of lines on a frame (or more) to figure out if we're running on a 3A system ROM, or standard (D-H) ROM.


Code: [Select]

  while (read_gpio_bits && count<3) {
    if (gpio & HSYNC) linecount++;
    if (gpio & VSYNC) count++;
 }
 lines= linecount/count;   // do some averaging here and decide which system type we're on.

To do this count the number of HSYNC pulses between each pair of VSYNC pulses. You'll also need to carefully clock the rate of the data bits coming in.
Once we know how many lines to render, we'll start collecting and plotting the Data bit onto a shared memory 32KB area that's also accessible by the second process.It may be advantageous to use multiple 32KB areas as well.

VSYNC is used to signal the end of a frame, and HSYNC is used to end a line.

Code: [Select]

while (read_gpio_bits) {
    if (gpio & VSYNC) {x=0; y=0;}
    if (gpio & HSYNC) {x=0; y++;}
    plot(x,y,gpio & DATA); }
The second process could then use one of many algorithms to render video on the frame buffer (we don't want X11 here), perhaps using SDL or some other library.You could steal the HQ3X, or AA, or AA with Gray Replacement algos from LisaEm for this.
This board could also be hooked up to the VSROM and some other point on the CPU board where the video Data bit could be read from in order to display output on an HDMI or VGA/etc LCD monitor.
It could also be used to replace a dead video system by removing the analog board and CRT with a properly sized 12" monitor that accepts HDMI signals.
(You could then use a USB HDMI capture card to capture the output of the Lisa and put it on a video projector, or for use with a video podcast, etc.)

Edit: forgot to mention, for this project you should either compile in the RTOS Linux patches, and/or pin these two processes to a specific core and set it to the realtime class.
« Last Edit: October 27, 2022, 06:42:31 am by rayarachelian »
Logged
You don't know what it's like, you don't have a clue, if you did you'd find yourselves doing the same thing, too, Writing the code, Writing the code

sigma7

  • Administrator
  • Sr. Member
  • *****
  • Karma: +148/-1
  • Offline Offline
  • Posts: 394
  • Warning: Memory errors found. Verify comments.
Re: LisaHDMI (or VGA)
« Reply #1 on: October 26, 2022, 05:54:52 pm »

From time to time the issue of replacing the CRT with an LCD has come up. Until recently, the available resolutions of LCDs weren't sufficient to render an accurate representation of the rectangular pixels of the stock Lisa video.

Various online references to the Lisa rectangular pixels say they are 50% higher than wide. ie. a H:W ratio of 3:2. If that were the case, then using an array of 3x2 LCD pixels per Lisa pixel would require 1092 x 1440.

I wondered what this would look like on a 1200x1920 monitor so I made a graphic rectangle that size. Seems like a reasonable size to look at in spite of the big border, but surprise, it doesn't look right!

The actual size of the physical image the Lisa is supposed to have on screen is defined by an Apple service part #077-8043-A, which is a graticule overlay. I've never seen one and I haven't been able to find any documents as to its measurements.

Next best I can do is to measure the opening in the front panel, and to me it looks like an image of 6" x 9" would fit nicely. (Hmmm... 2:3 ratio)

720 pixels in 9" is 0.01250" per pixel
364 pixels in 6" is 0.01648" per pixel

and  0.01648 : 0.01250 is a ratio of 1.318, not 1.5

If the specification of a Lisa pixel is actually a ratio of 4:3 then given
720 pixels in 9" is 0.01250" per pixel (width)
364 pixels at 4:3 would be 0.01667" per pixel (height) and that would result in the raster being 6.0667" high.

So I believe the correct description of the Lisa video is a H:W ratio of 2:3 for the entire raster, with each pixel being a rectangle of 4:3 H:W

It does make an LCD more challenging as it would require a HxW resolution of 1456 x 2160, but this will fit in now available 4K monitors.

To facilitate making an adapter for this, the Sapient motherboards have a header position beside the CPU board that has video signals and power.

James

edit1: fixed pixel's aspect ratio -- it is taller than it is wide
edit2: fixed math and rewrote to be consistently H:W
« Last Edit: October 28, 2022, 04:53:13 pm by sigma7 »
Logged
Warning: Memory errors found. ECC non-functional. Verify comments if accuracy is important to you.

Lisa2

  • Administrator
  • Sr. Member
  • *****
  • Karma: +68/-0
  • Offline Offline
  • Posts: 160
  • See why 1983 was more like Y2K...
    • Lisa2.com
Re: LisaHDMI (or VGA)
« Reply #2 on: October 26, 2022, 09:58:14 pm »

To facilitate making an adapter for this, the Sapient motherboards have a header position beside the CPU board that has video signals and power.
I just happen to have Sapient motherboard next to me, here is photo of the connector (J18) that was added to the design for this very purpose. 
Rick
« Last Edit: October 26, 2022, 10:02:27 pm by Lisa2 »
Logged

rayarachelian

  • Administrator
  • Hero Member
  • *****
  • Karma: +105/-0
  • Offline Offline
  • Posts: 772
  • writing the code,writing the code,writing the code
    • LisaEm
Re: LisaHDMI (or VGA)
« Reply #3 on: October 27, 2022, 06:09:51 am »

To facilitate making an adapter for this, the Sapient motherboards have a header position beside the CPU board that has video signals and power.
I just happen to have Sapient motherboard next to me, here is photo of the connector (J18) that was added to the design for this very purpose. 
Rick


That's most excellent, can you share the pinouts to that connector so that someone who wants to make use of it knows which pins do what?
Logged
You don't know what it's like, you don't have a clue, if you did you'd find yourselves doing the same thing, too, Writing the code, Writing the code

sigma7

  • Administrator
  • Sr. Member
  • *****
  • Karma: +148/-1
  • Offline Offline
  • Posts: 394
  • Warning: Memory errors found. Verify comments.
Re: LisaHDMI (or VGA)
« Reply #4 on: October 28, 2022, 11:57:18 pm »

I think this is the pinout for J18...

 1   DOTCLK (pin 106 of CPU board)
 2   Ground
 3   /HSYNC (pin 111 of CPU board)
 4   Ground
 5   /CSYNC (pin 67 of CPU board)
 6   +5
 7   VID (pin 115 of CPU board)
 8   +5
 9   /VSYNC (pin 113 of CPU board)
10   +12

If you are going to attach to it, it would be wise to verify for yourself of course.
Logged
Warning: Memory errors found. ECC non-functional. Verify comments if accuracy is important to you.

rayarachelian

  • Administrator
  • Hero Member
  • *****
  • Karma: +105/-0
  • Offline Offline
  • Posts: 772
  • writing the code,writing the code,writing the code
    • LisaEm
Re: LisaHDMI (or VGA)
« Reply #5 on: October 29, 2022, 02:20:49 pm »

Excellent, thank you!

Edit: Actually, you've put up a line for the DOTCLK there, that's a good point I've missed with this project idea, if there's a clock to time off of, it's well worth using it (perhaps with a counter to divide it down as needed.)
« Last Edit: October 29, 2022, 02:37:28 pm by rayarachelian »
Logged
You don't know what it's like, you don't have a clue, if you did you'd find yourselves doing the same thing, too, Writing the code, Writing the code

Lisa2

  • Administrator
  • Sr. Member
  • *****
  • Karma: +68/-0
  • Offline Offline
  • Posts: 160
  • See why 1983 was more like Y2K...
    • Lisa2.com
Re: LisaHDMI (or VGA)
« Reply #6 on: October 29, 2022, 11:45:12 pm »

I think this is the pinout for J18...
it would be wise to verify for yourself of course.
James,
I did check the PCB and those are the correct pinouts.
Thanks,
Rick
Logged

andrew

  • Sr. Member
  • ****
  • Karma: +10/-0
  • Offline Offline
  • Posts: 61
  • :)
    • Lisa themed website (under construction)
Re: LisaHDMI (or VGA)
« Reply #7 on: June 21, 2023, 11:03:28 am »

...
I wondered what this would look like on a 1200x1920 monitor so I made a graphic rectangle that size. Seems like a reasonable size to look at in spite of the big border, but surprise, it doesn't look right!

The actual size of the physical image the Lisa is supposed to have on screen is defined by an Apple service part #077-8043-A, which is a graticule overlay. I've never seen one and I haven't been able to find any documents as to its measurements.

Next best I can do is to measure the opening in the front panel, and to me it looks like an image of 6" x 9" would fit nicely. (Hmmm... 2:3 ratio)

720 pixels in 9" is 0.01250" per pixel
364 pixels in 6" is 0.01648" per pixel

and  0.01648 : 0.01250 is a ratio of 1.318, not 1.5

If the specification of a Lisa pixel is actually a ratio of 4:3 then given
720 pixels in 9" is 0.01250" per pixel (width)
364 pixels at 4:3 would be 0.01667" per pixel (height) and that would result in the raster being 6.0667" high.

So I believe the correct description of the Lisa video is a H:W ratio of 2:3 for the entire raster, with each pixel being a rectangle of 4:3 H:W
...
There are a few graphical elements within LOS which seem to very strongly favor a 2:3 pixel aspect ratio: the "NOTE" square (72 x 48 px), the "Stop" octagon (102 x 68 px), and the grid pattern on the LisaDraw canvas (48 x 32 px) all have raw pixel dimensions with a 2:3 ratio and are elements which should be displayed at a 1:1 ratio. The difference between the raw width of vertical scrollbars and the raw height of horizontal scrollbars is also 2:3 (24 px vs 16 px). This makes for a neat grid within windows with square buttons for the scroll arrows and the resize drag button.


I am getting my dimensions from raw screenshots I took in LisaEm.
« Last Edit: June 21, 2023, 03:17:22 pm by andrew »
Logged
Pages: [1]   Go Up