For anything related to VDP (plane, color, sprite, tiles)
Moderators: BigEvilCorporation, Mask of Destiny
-
mickagame
- Very interested
- Posts: 256
- Joined: Sat Jun 07, 2008 7:37 am
Post
by mickagame » Wed Oct 08, 2014 8:29 pm
I was surfing on forum when i find this pictures illustrating how the vdp signal of the sega genesis is composed.
![Image](http://img15.hostingpics.net/pics/617615Megadrivemodeline15khzH40.png)
-
flamewing
- Very interested
- Posts: 56
- Joined: Tue Sep 23, 2014 2:39 pm
- Location: France
Post
by flamewing » Wed Oct 08, 2014 10:14 pm
I am no expert, but I have to confess I don't think they are entirely accurate for the pixel counts per line (numbers for the lines seem fine). Using the best numbers I can find, I come up with the following for H40 mode in NTSC:
hsynch ~ 31.55 pixels
back porch ~ 30.20 pixels
front porch ~ 10.07 pixels
active line ~ 354.75 pixels
Numbers and formulas:
Horizontal rate: Fh = 9000000/572 Hz (about 15734.27 Hz)
Vertical rate: Fv = 60/1.001 Hz = Fh * 2 / 525 (about 59.94 Hz)
Line duration: Ls = 1/Fh = 572/9000000 s (about 63.555 µs)
Front porch: Fp = 1.5 µs
Hsynch pulse: HSp = 4.7 µs
Back porch: Bp = 4.5 µs
Active line period: 1/Ls - Fp - HSp - Bp (about 52.8555 µs)
MCLK = 53693175 Hz
H40 Pixel Clock = MCLK/8
For X µs, you have:
#pixels = (X / 1000000) * (53693175 / 8 )
The NTSC numbers come from the "Video Demystified" book, and the MCLK value comes from TmEE. I rounded off the numbers to 2 decimal places, but even this is a stretch as Fp + HSp + Bp has a tolerance of the order of 0.1 µs (about 1%).
Edit: correcting "8)" to "8 )".
-
Mask of Destiny
- Very interested
- Posts: 616
- Joined: Thu Nov 30, 2006 6:30 am
Post
by Mask of Destiny » Thu Oct 09, 2014 12:00 am
I wouldn't use the official NTSC numbers. If you're not planning on actually broadcast a signal, you only need to get close enough for a TV to accept it and so it's quite likely that the Genesis/MD does not produce a perfectly compliant signal. Nemesis did some work finding the correlation between certain analog signal events and the HV counter which can be used to get the proper values. I don't have them in front of me, but that's what I would use to check that image.
-
r57shell
- Very interested
- Posts: 478
- Joined: Sun Dec 23, 2012 1:30 pm
- Location: Russia
-
Contact:
Post
by r57shell » Thu Oct 09, 2014 7:13 am
I don't know why it's there, but we discuss it
here. I think it must be enough, because it was enough for me
![Very Happy :D](./images/smilies/icon_biggrin.gif)
-
tomaitheous
- Very interested
- Posts: 256
- Joined: Tue Sep 11, 2007 9:10 pm
Post
by tomaitheous » Fri Dec 19, 2014 5:58 pm
The numbers are slightly off, but it gets the point across.
But yeah, I think part of the problem is assuming the horizontal scanrate is always going to be NTSC standard of 15734hz. Which I found not to be true for these older consoles.