Resetting H/V counters?
Resetting H/V counters?
I always assumed that H and V counters in a CRTC should be reset, but the more I think about it the less sure I am that this actually makes sense. Does anyone know what any original hardware does? Basically, I'm not sure there are any upsides sufficient enough to offset the downside of disrupting the sync timings to the display.
-
- Core Developer
- Posts: 547
- Joined: Sun May 24, 2020 9:30 pm
- Has thanked: 20 times
- Been thanked: 145 times
Re: Resetting H/V counters?
Hmm.. several pieces of your question are unclear to me.
What is "CRTC" ? It seems related to a CRT; are you talking about the rasterizer section of a core ? (this is what I am inferring)
What "disrupting the sync timings" are you talking about ?
Original equipment held registers which counted the H and V positions of the rasterizer at any given time. Comparing these to preset limits/values is basically an atomic action which does not affect timing.
What is "CRTC" ? It seems related to a CRT; are you talking about the rasterizer section of a core ? (this is what I am inferring)
What "disrupting the sync timings" are you talking about ?
Original equipment held registers which counted the H and V positions of the rasterizer at any given time. Comparing these to preset limits/values is basically an atomic action which does not affect timing.
-
- Posts: 130
- Joined: Fri Jun 19, 2020 8:54 pm
- Has thanked: 13 times
- Been thanked: 58 times
Re: Resetting H/V counters?
That's a really interesting question - so interesting that I had to try it!ExCyber wrote: ↑Sat Aug 14, 2021 4:33 pm I always assumed that H and V counters in a CRTC should be reset, but the more I think about it the less sure I am that this actually makes sense. Does anyone know what any original hardware does? Basically, I'm not sure there are any upsides sufficient enough to offset the downside of disrupting the sync timings to the display.
I have an Amiga 500 (Kick 1.3) here - and the screen doesn't lose sync immediately when I do the Ctrl-Amiga-Amiga reset - but what's interesting is that it *does* lose sync momentarily after the darkest grey is displayed, before the disk-hand screen comes up.
CRTC = CRT controller - i.e. the circuitry which counts pixel clocks to generate HSync, and counts rows to generate VSync.
The question is whether or not these get reset with the rest of the system - because doing so will, of course, mean that the screen will lose sync.
Re: Resetting H/V counters?
Yes, what I'm asking about is the behavior of the H/V counters with respect to a reset signal. From a general digital logic perspective, it seems obvious that this is state that needs to be reset. But looking at how they function in the system, it seems like resetting them doesn't have much benefit other than perhaps guaranteeing some initial phase relationship between the counter and the CPU. Apart from the issue of the display losing sync on reset, one reason I'm asking the question is that some games seem to use this to seed their RNG (as discussed in this thread about the Genesis port of Street Fighter 2), which would suggest that it's actually not expected to be deterministic. That could be due to the reset timing itself being nondeterministic, but it could also be that the counters aren't actually reset at all (or e.g. are reset solely by an internal power-on reset circuit).robinsonb5 wrote: ↑Sat Aug 14, 2021 7:05 pmCRTC = CRT controller - i.e. the circuitry which counts pixel clocks to generate HSync, and counts rows to generate VSync.
The question is whether or not these get reset with the rest of the system - because doing so will, of course, mean that the screen will lose sync.
That's interesting. It almost seems like the hard reset doesn't reset the counters, but there might be some form of software-controlled reset or other initialization that does. I know Amiga can do split-screen with different resolutions, so I don't think it's just a question of changing video modes in general.robinsonb5 wrote: ↑Sat Aug 14, 2021 7:05 pm I have an Amiga 500 (Kick 1.3) here - and the screen doesn't lose sync immediately when I do the Ctrl-Amiga-Amiga reset - but what's interesting is that it *does* lose sync momentarily after the darkest grey is displayed, before the disk-hand screen comes up.