MEGA65 / mega65-core

MEGA65 FPGA core
Other
237 stars 84 forks source link

Make a 15khz video output for older monitors #452

Open intric8 opened 2 years ago

intric8 commented 2 years ago

This could allow one to use an old C= CRT monitor, for example, while also using an HDMI modern monitor. (which would be totally rad)

gardners commented 6 months ago

Speaking with @ki-bo , we explored some of the solution space, and came to the following idea:

  1. This should work with a special DB9 to DB15 adapter cable on the MEGA65's VGA port.
  2. It should use the same cable as the M2M framework for MEGA65.
  3. The cable should be used to provide the means of detection for the MEGA65 core (and M2M cores when they are updated to support this), so that it is impossible to accidentally provide 31KHz video to an old CRT monitor.
  4. The VGA SDA/SCL pins are a good candidate for this: Bridge them using a 4.7K resistor, and the MEGA65 can check for this physical connection. If present, then the MEGA65 can assume it has a 15KHz monitor attached, and switch to 15KHz output.
  5. The 15KHz video generation can be provided by r3_expansion.vhdl, that already generates 15KHz timed video for composite / S-video output.
  6. The R,G, and B channels are already the right voltage on VGA, so we just need to provide a "composite sync" signal, which we can already generate in r3_expansion.vhdl.
  7. r3_expansion.vhdl should just gain VGA SCL/SDA pins, and a pass-through for the VGA from the core to the VGA connector, and do all the magic switching internally.
  8. When working, coordinate with M2M framework team for them to support the same mode.

Ideally we should collate links to all the relevant resources in this issue. Some already: https://www.retrogamingcables.co.uk/composite-video-vs-composite-sync https://bboah-hardware.de/cgi-bin/showhardware.cgi?HARDID=849

gardners commented 6 months ago

Probably me to do the VHDL parts. But I don't have a 1084 or similar monitor here, so will require assistance with testing. It would be good for me to have a test cable with the resistor fitted, but with a momentary-break switch in-line for testing the auto-detection via watching sync on oscilloscope. i.e., so that I can watch the sync frequency change.

markkrueg commented 3 months ago

It would be nice if there were a software "force mode" option as well. With warnings if necessary (although 15KHz mode shouldn't damage a modern VGA monitor; more likely to just do nothing).

Currently I connect my MEGA65 to my US NTSC 1084S-P using a DB15 to 6 pin DIN cable. The US 1084 does not have SCART or a DB9, so the normal way to connect an Amiga or similar would be over the analog RGB 6 pin DIN input.

I currently use this cable to connect my MEGA65 to my 1084, but currently it only operates when using the C64 core. This core has a nice menu where you can choose 15KHz mode and what type of sync you prefer. I'm hoping for a similar capability in the MEGA65 core without having to build another cable.

One big benefit of using RGB is that my 1084 will happily do 50 or 60Hz, so PAL and NTSC software works fine. My 1084 will not display a PAL signal over composite or luma/chroma due to the PAL decoding circuitry not being present on the US NTSC model of 1084.

https://www.ebay.com/itm/124200576180?var=425049611391 s-l1600

markkrueg commented 3 months ago

Here is a comparison of PAL and NTSC models of 1084: 1084_PAL_NTSC

markkrueg commented 3 months ago

When I received my MEGA65 to 1084S-P cable I tested the pins to make sure I understood how it was wired (was nervous about damaging my MEGA65 or 1084S-P; two of my most precious possessions). Anyway, here is how the cable is wired: RGB_cable_test

benitoss commented 3 weeks ago

markkrueg, most of the personal computers in the 80s had a 15 KHz output because the users connected them to their home TVs, which only worked at 15 KHz. The C64 core from Mister has been implemented as the real hardware and the framework of the Mister uses a double scaler to generate the 31 KHz output, which is used in the VGA monitors. Translating from 15 to 31 kHz through the double scaler is easy, but the reverse is not because you lose information. Mega65 should generate an original output of 15 KHz and optional using a double scaler the output can be 31 kHz.

ZorroDJ commented 1 week ago

Pease 115Khz RGB, not CVBS.