DreamcastHDMI github by chriz2600

The place for all discussion on gaming hardware
User avatar
Maverick
Posts: 18
Joined: Tue Apr 18, 2017 6:28 am
Location: USA, California

Re: DreamcastHDMI github by chriz2600

Post by Maverick »

This is fantastic, and happy to see this is still being worked on. :mrgreen:
User avatar
mikejmoffitt
Posts: 629
Joined: Fri Jan 08, 2016 7:26 am
Location: Tokyo, Japan

Re: DreamcastHDMI github by chriz2600

Post by mikejmoffitt »

I don't get what people are saying about the dreamcast being in a 720x480 frame. At what stage is this supposed to be the case? The VGA signal does not specify a horizontal dimension in pixels, so that distinction is only a product of the dot clock rate and sync timings. If that quoted 720 pixel width includes the blanking and sync periods, then that's not far off from the typical 768 / 800.
Image
chriz2600
Posts: 21
Joined: Sun Feb 07, 2016 12:23 pm
Location: Cologne, Germany
Contact:

Re: DreamcastHDMI github by chriz2600

Post by chriz2600 »

mikejmoffitt wrote:I don't get what people are saying about the dreamcast being in a 720x480 frame. At what stage is this supposed to be the case? The VGA signal does not specify a horizontal dimension in pixels, so that distinction is only a product of the dot clock rate and sync timings. If that quoted 720 pixel width includes the blanking and sync periods, then that's not far off from the typical 768 / 800.
You are absolutely right regarding analog domain. The dreamcasts sync signal placement will create a 640x480 image on screen with a pixel aspect ratio of 1:1.

For the digital domain there is EIA-CEA-861 standard:
There are two relevant formats here:

- Format 1:
640x480p @59.94/60 Hz (4:3 only) based on VESA Monitor Timings Specification, version 1.0 revision 10 [10]
- Format 2:
720x480p @59.94/60 Hz (4:3 aspect ratio) based on CEA-770.2-C [19]

The dreamcast uses a field rate (vertical sync frequency) of 59.94Hz with 525 horizontal lines with a pixel clock rate of 27Mhz, which results in 858px per line.
-> 59.94Hz * 525px = 31,4685kHz
-> 27Mhz / 31,4685kHz = 858px

So a modern display will internally convert the dreamcast "VGA" singal to format 2
The problem is, that Format 2 is 720x480 with a picture aspect ratio of 4:3, which results in a pixel aspect ratio of 8:9, which will result in a visibly squashed image.
User avatar
mikejmoffitt
Posts: 629
Joined: Fri Jan 08, 2016 7:26 am
Location: Tokyo, Japan

Re: DreamcastHDMI github by chriz2600

Post by mikejmoffitt »

I think this misunderstanding stems from mid-2000s era televisions that will accept VGA, but sometimes have a "square peg in a round hole" method of trying to make everything "just work", and the first thing they probably did was try to guess the intended image resolution from the video timings.
Image
User avatar
marqs
Posts: 1030
Joined: Sat Dec 15, 2012 12:11 pm
Location: Finland

Re: DreamcastHDMI github by chriz2600

Post by marqs »

Speaking of modes, are the any plans to support higher than 480p? I understand that 1080p is not feasible with the current board, but 1280x960 would probably be possible with just firmware changes.
chriz2600
Posts: 21
Joined: Sun Feb 07, 2016 12:23 pm
Location: Cologne, Germany
Contact:

Re: DreamcastHDMI github by chriz2600

Post by chriz2600 »

marqs wrote:Speaking of modes, are the any plans to support higher than 480p? I understand that 1080p is not feasible with the current board, but 1280x960 would probably be possible with just firmware changes.
Yes! I did some math yesterday, and it's definitely possible to support 1280x960 and even 1080p in "pixel exact" mode, meaning 1280x960 pixels inside a 1920x1080 frame.
I will give this a try the next days.
User avatar
marqs
Posts: 1030
Joined: Sat Dec 15, 2012 12:11 pm
Location: Finland

Re: DreamcastHDMI github by chriz2600

Post by marqs »

chriz2600 wrote:Yes! I did some math yesterday, and it's definitely possible to support 1280x960 and even 1080p in "pixel exact" mode, meaning 1280x960 pixels inside a 1920x1080 frame.
I will give this a try the next days.
Wouldn't you need larger FPGA than EP4CE6E22C8 or external RAM for line buffers to compensate the difference between linedoubled DC output (2x525=1050 lines) and 1125 lines of 1080p?
chriz2600
Posts: 21
Joined: Sun Feb 07, 2016 12:23 pm
Location: Cologne, Germany
Contact:

Re: DreamcastHDMI github by chriz2600

Post by chriz2600 »

marqs wrote:
chriz2600 wrote:Yes! I did some math yesterday, and it's definitely possible to support 1280x960 and even 1080p in "pixel exact" mode, meaning 1280x960 pixels inside a 1920x1080 frame.
I will give this a try the next days.
Wouldn't you need larger FPGA than EP4CE6E22C8 or external RAM for line buffers to compensate the difference between linedoubled DC output (2x525=1050 lines) and 1125 lines of 1080p?
Actually I don't need a full frame buffer, because I can display lines while they are read.
The horizontal frequency of 1080p is 67.5kHz -> 33.75kHz line doubled.
The horizontal frequency of VGA is 31.5kHz.
In the time 480 line doubled lines in 1080p are put out, 448 lines of VGA are displayed.
So I only need 32 lines of buffer (31.5kHz / 33.75kHz * 480 = 448)
The required memory size is: 32 lines * 24 bit * 640 pixels = 491.520 bits. This fits well inside the FPGA.
User avatar
marqs
Posts: 1030
Joined: Sat Dec 15, 2012 12:11 pm
Location: Finland

Re: DreamcastHDMI github by chriz2600

Post by marqs »

chriz2600 wrote:Actually I don't need a full frame buffer, because I can display lines while they are read.
The horizontal frequency of 1080p is 67.5kHz -> 33.75kHz line doubled.
The horizontal frequency of VGA is 31.5kHz.
In the time 480 line doubled lines in 1080p are put out, 448 lines of VGA are displayed.
So I only need 32 lines of buffer (31.5kHz / 33.75kHz * 480 = 448)
The required memory size is: 32 lines * 24 bit * 640 pixels = 491.520 bits. This fits well inside the FPGA.
I made similar calculations for cps2 digital AV mod and ended up selecting 10CL025YE144 (largest non-BGA FPGA in Cyclone 10 LP series) which has enough block RAM for line buffers but only barely. I assume you refer to different FPGA than EP4CE6E22 which only has ~270 kbits of block RAM.
chriz2600
Posts: 21
Joined: Sun Feb 07, 2016 12:23 pm
Location: Cologne, Germany
Contact:

Re: DreamcastHDMI github by chriz2600

Post by chriz2600 »

marqs wrote:
chriz2600 wrote:Actually I don't need a full frame buffer, because I can display lines while they are read.
The horizontal frequency of 1080p is 67.5kHz -> 33.75kHz line doubled.
The horizontal frequency of VGA is 31.5kHz.
In the time 480 line doubled lines in 1080p are put out, 448 lines of VGA are displayed.
So I only need 32 lines of buffer (31.5kHz / 33.75kHz * 480 = 448)
The required memory size is: 32 lines * 24 bit * 640 pixels = 491.520 bits. This fits well inside the FPGA.
I made similar calculations for cps2 digital AV mod and ended up selecting 10CL025YE144 (largest non-BGA FPGA in Cyclone 10 LP series) which has enough block RAM for line buffers but only barely. I assume you refer to different FPGA than EP4CE6E22 which only has ~270 kbits of block RAM.
Yes you are right, I messed things up. I will definitely need more memory than available on the EP4CE6E22. The altsyncram megafunction lets you create memory larger than available on the device, which let me to believe this was possible.
User avatar
maxtherabbit
Posts: 1763
Joined: Mon Mar 05, 2018 4:03 pm

Re: DreamcastHDMI github by chriz2600

Post by maxtherabbit »

joined the forum just for this thread! excited to FINALLY have a reasonable way to correct DC aspect on a digital display
User avatar
citrus3000psi
Posts: 668
Joined: Wed Dec 25, 2013 11:56 pm
Location: Indiana

Re: DreamcastHDMI github by chriz2600

Post by citrus3000psi »

Finally got video output the other night. I accidentally have the ADV IC flipped 180 :oops:

https://www.youtube.com/watch?v=kOAO_-zbwp4
User avatar
maxtherabbit
Posts: 1763
Joined: Mon Mar 05, 2018 4:03 pm

Re: DreamcastHDMI github by chriz2600

Post by maxtherabbit »

citrus3000psi wrote:Finally got video output the other night. I accidentally have the ADV IC flipped 180 :oops:

https://www.youtube.com/watch?v=kOAO_-zbwp4
I want this soo bad lol, I know you don't typically sell premade boards - but you should for this one :mrgreen:
nmalinoski
Posts: 1974
Joined: Wed Jul 19, 2017 1:52 pm

Re: DreamcastHDMI github by chriz2600

Post by nmalinoski »

chriz2600 wrote:
Wolf_ wrote:So does this mean that to play every game you would need to use analog output for the 49 games that won't run in vga mode as well as a hdmi connection for everything else?
No, the current implementation supports line doubling of 480i content to 480p. You only need HDMI.
How does the DreamcastHDMI handle the handful of games that aren't compatible with RGB?
User avatar
citrus3000psi
Posts: 668
Joined: Wed Dec 25, 2013 11:56 pm
Location: Indiana

Re: DreamcastHDMI github by chriz2600

Post by citrus3000psi »

nmalinoski wrote:How does the DreamcastHDMI handle the handful of games that aren't compatible with RGB?
240p & 480i RGB and Composite games are handled the same way. Digital video is grabbed before the DAC.

If you are not using VGA mode (480p) all games will have RGB quality via HDMI, even composite only games.
mario64
Posts: 188
Joined: Sun Dec 13, 2015 5:00 am

Re: DreamcastHDMI github by chriz2600

Post by mario64 »

citrus3000psi wrote:
nmalinoski wrote:How does the DreamcastHDMI handle the handful of games that aren't compatible with RGB?
240p & 480i RGB and Composite games are handled the same way. Digital video is grabbed before the DAC.

If you are not using VGA mode (480p) all games will have RGB quality via HDMI, even composite only games.
Forgive me but I’m not clear on this. Are you saying games which support VGA mode will automatically use it as if a VGA box is connected while games which don’t will still load and display without producing the VGA unsupported error? So this will be completely seamless?
User avatar
citrus3000psi
Posts: 668
Joined: Wed Dec 25, 2013 11:56 pm
Location: Indiana

Re: DreamcastHDMI github by chriz2600

Post by citrus3000psi »

mario64 wrote:Forgive me but I’m not clear on this. Are you saying games which support VGA mode will automatically use it as if a VGA box is connected while games which don’t will still load and display without producing the VGA unsupported error? So this will be completely seamless?
Yes in a way.

We have designed the Pin6/Pin7 to work in a bi-directional fashion. The FPGA will have three modes (planned):

1:VGA Mode - FPGA will force Pin6 and Pin7 low thus putting the dreamcast into VGA mode with no box connected.
2:VGA Trick Mode - FPGA will allow the game to boot and swap to VGA mode after a determined time. (This is still in the works, but should be possible)
3:Detect Mode - FPGA will read the status of Pin6.
---3a:If you insert a VGA box, FPGA will go into VGA mode.
---3b:If you insert an RGB cable, FPGA will go into 15Khz Mode with RGB in the analog port
---3c:If you do not insert nothing OR insert composite/S-Video cable, FPGA will go into 15Khz.

I'm also considering designing a little addon board, which will xor the syncs. So we can get 480p over scart. Will be helpful to GSCART users etc.
mario64
Posts: 188
Joined: Sun Dec 13, 2015 5:00 am

Re: DreamcastHDMI github by chriz2600

Post by mario64 »

citrus3000psi wrote:
mario64 wrote:Forgive me but I’m not clear on this. Are you saying games which support VGA mode will automatically use it as if a VGA box is connected while games which don’t will still load and display without producing the VGA unsupported error? So this will be completely seamless?
Yes in a way.

We have designed the Pin6/Pin7 to work in a bi-directional fashion. The FPGA will have three modes (planned):

1:VGA Mode - FPGA will force Pin6 and Pin7 low thus putting the dreamcast into VGA mode with no box connected.
2:VGA Trick Mode - FPGA will allow the game to boot and swap to VGA mode after a determined time. (This is still in the works, but should be possible)
3:Detect Mode - FPGA will read the status of Pin6.
---3a:If you insert a VGA box, FPGA will go into VGA mode.
---3b:If you insert an RGB cable, FPGA will go into 15Khz Mode with RGB in the analog port
---3c:If you do not insert nothing OR insert composite/S-Video cable, FPGA will go into 15Khz.

I'm also considering designing a little addon board, which will xor the syncs. So we can get 480p over scart. Will be helpful to GSCART users etc.
Thanks Citrus. I’m curious as to what would be the need for VGA boxes, Scart, etc if you already have HDMI. I assume those are just extras in case someone doesn’t want to use HDMI?
User avatar
citrus3000psi
Posts: 668
Joined: Wed Dec 25, 2013 11:56 pm
Location: Indiana

Re: DreamcastHDMI github by chriz2600

Post by citrus3000psi »

mario64 wrote:Thanks Citrus. I’m curious as to what would be the need for VGA boxes, Scart, etc if you already have HDMI. I assume those are just extras in case someone doesn’t want to use HDMI?
Dual output for streamers, also someone may have a mutliformat monitor they still might like to hookup occasionally. The goal was add features but not hinder at the same time :D
mario64
Posts: 188
Joined: Sun Dec 13, 2015 5:00 am

Re: DreamcastHDMI github by chriz2600

Post by mario64 »

citrus3000psi wrote:
mario64 wrote:Thanks Citrus. I’m curious as to what would be the need for VGA boxes, Scart, etc if you already have HDMI. I assume those are just extras in case someone doesn’t want to use HDMI?
Dual output for streamers, also someone may have a mutliformat monitor they still might like to hookup occasionally. The goal was add features but not hinder at the same time :D
Very cool. Thanks again. Can’t wait for availability! :D
nmalinoski
Posts: 1974
Joined: Wed Jul 19, 2017 1:52 pm

Re: DreamcastHDMI github by chriz2600

Post by nmalinoski »

Has it been decided where the HDMI port/board will be mounted?
nmalinoski
Posts: 1974
Joined: Wed Jul 19, 2017 1:52 pm

Re: DreamcastHDMI github by chriz2600

Post by nmalinoski »

For the handful of games that support it, how is Dolby ProLogic/surround sound handled by the DCHDMI?
User avatar
maxtherabbit
Posts: 1763
Joined: Mon Mar 05, 2018 4:03 pm

Re: DreamcastHDMI github by chriz2600

Post by maxtherabbit »

nmalinoski wrote:For the handful of games that support it, how is Dolby ProLogic/surround sound handled by the DCHDMI?
I think it's safe to assume that he is transmitting all audio over HDMI as 2 channel PCM

matrixed surround (i.e. prologic 1/2 and dolby surround) would be fully supported in that case as long as you switch your receiver over to dolby PL mode when playing an appropriate game
chriz2600
Posts: 21
Joined: Sun Feb 07, 2016 12:23 pm
Location: Cologne, Germany
Contact:

Re: DreamcastHDMI github by chriz2600

Post by chriz2600 »

maxtherabbit wrote:I think it's safe to assume that he is transmitting all audio over HDMI as 2 channel PCM
Yes, I can confirm this.
RetroBVM
Posts: 47
Joined: Sat May 10, 2014 9:42 am

Re: DreamcastHDMI github by chriz2600

Post by RetroBVM »

@citrus3000psi Can the HDMI port on the DCHDMI be mounted vertical so it fits trough the air holes on the Dreamcast case?
User avatar
Kez
Posts: 817
Joined: Thu Jul 20, 2017 7:09 am

Re: DreamcastHDMI github by chriz2600

Post by Kez »

RetroBVM wrote:@citrus3000psi Can the HDMI port on the DCHDMI be mounted vertical so it fits trough the air holes on the Dreamcast case?
No, the port is directly attached to the mod board so it can't really be mounted any other way, and it sits in a small gap beneath the mainboard.

Image
RetroBVM
Posts: 47
Joined: Sat May 10, 2014 9:42 am

Re: DreamcastHDMI github by chriz2600

Post by RetroBVM »

Kez wrote:
RetroBVM wrote:@citrus3000psi Can the HDMI port on the DCHDMI be mounted vertical so it fits trough the air holes on the Dreamcast case?
No, the port is directly attached to the mod board so it can't really be mounted any other way, and it sits in a small gap beneath the mainboard.

Image
Maybe in the next revision. Would be great to not have to cut anything and the vent holes in the back seem like a perfect place to mount the mini HDMI connector. Could this be done with a special flat cable?
nmalinoski
Posts: 1974
Joined: Wed Jul 19, 2017 1:52 pm

Re: DreamcastHDMI github by chriz2600

Post by nmalinoski »

RetroBVM wrote:
Kez wrote:
RetroBVM wrote:@citrus3000psi Can the HDMI port on the DCHDMI be mounted vertical so it fits trough the air holes on the Dreamcast case?
No, the port is directly attached to the mod board so it can't really be mounted any other way, and it sits in a small gap beneath the mainboard.

Image
Maybe in the next revision. Would be great to not have to cut anything and the vent holes in the back seem like a perfect place to mount the mini HDMI connector. Could this be done with a special flat cable?
I'd have to get my console out to double-check, but, if I remember correctly, the EM shield is halfway up those vent holes, which would mean you'd need to make a narrow cut into that metal; and I don't recall how far back the mainboard extends, so you might have to cut into that as well, assuming that wouldn't sever any traces.

I would almost prefer to see a mod that puts the mini-HDMI port where the pretty-much-unused serial port is.

In any case, any mod or revision that would allow relocation of the HDMI port, be it to a rear vent or in place of the serial port would mean that the DCHDMI board could be mounted without drilling through the bottom of the console.
User avatar
darcagn
Posts: 607
Joined: Tue Mar 04, 2008 3:26 pm
Contact:

Re: DreamcastHDMI github by chriz2600

Post by darcagn »

RetroBVM wrote:Maybe in the next revision. Would be great to not have to cut anything and the vent holes in the back seem like a perfect place to mount the mini HDMI connector. Could this be done with a special flat cable?
In order to do this you'd have to cut into the metal shielding in a very rigid place where it makes two 90-degree angles. It would be significantly more difficult and I certainly don't think it would look any better.

My best guess for how to mount the connector without cutting the case would be to switch from miniHDMI to microHDMI, remove the PSU for an external PSU (like DreamPSU/PicoPSU mods) that replaces the PSU connector with a barrel connector, and try to do a 3D printed back panel that fits both the power and microHDMI connector. Perhaps even both DCHDMI and replacement PSU could be in one single board that goes in the PSU space.

Though I'm not personally a fan of replacing the DC PSU and I don't think this would necessarily look as good as current DCHDMI.
nmalinoski
Posts: 1974
Joined: Wed Jul 19, 2017 1:52 pm

Re: DreamcastHDMI github by chriz2600

Post by nmalinoski »

I only just bothered to install my DCHDMI today. I followed Dan's video guide on YouTube and managed to get everything together with minimal fuss. I seem to have gotten a revised flex cable without the jumpers, so that was one or two fewer items to solder.

As for the kit, I was able to salvage some wire, but it would've been nice if wire had been included, and I definitely would've appreciated a 4-position connector (3 wires plus one for keying) so that the DCHDMI could be disconnected from the mainboard for ease of maintenance (something I'd also like to see with the NESRGB).

It also would've been nice if there was a little more detail on wire routing. With the wire length recommended in the installation video, my wire ends up in a large loop, which I had to manually squish and manipulate to avoid being squished by one of the components that needs a thermal pad and one of the screw holes. I think, with a connector setup (possibly paired with a prefab wiring harness), the wires could be shorter and more easily routed.


I also encountered a couple minor issues with usage.

First issue was use of the WiFi with my GDEMU installed, which is clearly described in the installation instructions. It manifested by the firmware check screen failing to download everything. I really didn't feel like pulling out my GD-ROM, and I had been cooking, so I fashioned a makeshift EM shield out of aluminum foil, wrapped in parchment paper and placed carefully to avoid shorting on anything. I left a sliver of foil exposed to touch the upper heat shield for grounding, and, with the right side, back, and top covered with the shield, all of the WiFi connection issues disappeared, and I was able to successfully get the firmware updated to 2.3.3.

Since I only made a makeshift EM shield for the firmware update, I've discarded it, but it makes me want to see if I can work around the shielding issue by properly lining my 3D-printed GDEMU shroud with foil (possibly grounding it with the rear GD-ROM screw that anchors the shroud), and I might try lining the underside of the disc lid as well.

And the other issue was that, although testing went well, once I got my DC back together, I didn't get any video output from the DCHDMI. I noticed that the very end of the Troubleshooting section at the end of the DCHDMI installation guide mentions a bug in 2.3.2 and earlier that causes this behavior, and the workaround (holding Down on P1 dpad while powering on the system) gets me video again.

With those two issues taken care of, everything seems to be working great.
Post Reply