deathshadow
Veteran Member
- Joined
- Jan 4, 2011
- Messages
- 1,378
It's been a LONG time since I programmed the PIT to fire per scanline on CGA, and I seem to have gone full Gungan on how it works. Meesa sayz yew nevah goes teh FULL Gungan...
I thought the CGA horiz frequency was 18.73khz, but if there are 254 scanlines per frame and it's 60 frames a second, isn't that 15.24 khz?
What gives? Neither number seems to be correct, and I'd have THOUGHT since everything is based off the color burst crystal, shouldn't one scanline actually divide into PIT clocks evenly?
904 pixels per scanline, of 254 scanlines per frame -- hence 0x71 H. Total, 0x1F vertical total (character heights), 0x06 vertical adjust (scanlines)... right? If it's 18.73 and 60hz, where's that extra 60 scanlines going? Or is the pixel clock driven by something OTHER than the colour burst crystal?
Or have I suddenly jumped universes so that now "mandala effect" based on Nelson Mandela instead of the Indian Mandala? (seriously, I remember hearing the idea in the '80's and it being Mandala and having jack to do with Nelson)
Ideally I only want to have it fire every OTHER scanline... need to do it on EGA and VGA as well, though EGA should be able to use the same code since I can program CGA mode 3 (200 line) on EGA relatively simply. VGA on the other hand is going to be more tricky given 31.46875 kHz doesn't exactly line up with PIT timings... though I only need it every four scanlines on VGA.
Still, why aren't any of these numbers making sense for figuring out the PIT clocks per scanline? (or what I need, every two scanlines)
-- edit -- my bad, forgot the extra "1" character width each direction. So it's 912 pixels across, and 256 scanlines x 60 == 15360... well crap, that's STILL far short of that 18.73 khz number constantly quoted. Doesn't work out right either at 77.67 PIT clocks per scanline. Argh, do I actually have to program the PIT for each and every blasted scanline to average it out? I can't just have this sit there with it's thumb up it's arse looping for blanking to trigger.
8088mph does this or something akin to it, right? I should dig into its code for a look-see. Been a while.
I thought the CGA horiz frequency was 18.73khz, but if there are 254 scanlines per frame and it's 60 frames a second, isn't that 15.24 khz?
What gives? Neither number seems to be correct, and I'd have THOUGHT since everything is based off the color burst crystal, shouldn't one scanline actually divide into PIT clocks evenly?
904 pixels per scanline, of 254 scanlines per frame -- hence 0x71 H. Total, 0x1F vertical total (character heights), 0x06 vertical adjust (scanlines)... right? If it's 18.73 and 60hz, where's that extra 60 scanlines going? Or is the pixel clock driven by something OTHER than the colour burst crystal?
Or have I suddenly jumped universes so that now "mandala effect" based on Nelson Mandela instead of the Indian Mandala? (seriously, I remember hearing the idea in the '80's and it being Mandala and having jack to do with Nelson)
Ideally I only want to have it fire every OTHER scanline... need to do it on EGA and VGA as well, though EGA should be able to use the same code since I can program CGA mode 3 (200 line) on EGA relatively simply. VGA on the other hand is going to be more tricky given 31.46875 kHz doesn't exactly line up with PIT timings... though I only need it every four scanlines on VGA.
Still, why aren't any of these numbers making sense for figuring out the PIT clocks per scanline? (or what I need, every two scanlines)
-- edit -- my bad, forgot the extra "1" character width each direction. So it's 912 pixels across, and 256 scanlines x 60 == 15360... well crap, that's STILL far short of that 18.73 khz number constantly quoted. Doesn't work out right either at 77.67 PIT clocks per scanline. Argh, do I actually have to program the PIT for each and every blasted scanline to average it out? I can't just have this sit there with it's thumb up it's arse looping for blanking to trigger.
8088mph does this or something akin to it, right? I should dig into its code for a look-see. Been a while.
Last edited: