Reply 40 of 87, by SoftCat
reenigne wrote on 2025-06-14, 11:14:Suppose you use the simple method to get an IRQ shortly after the start for display enable. You can then "step it backwards" until you find the point where you're just before the display is enabled. The total line time is 76 PIT cycles so if you set the PIT channel 0 period to 75 then each IRQ0 will happen one cycle to the left than on the line above. So you can read the status line at the start of each of those IRQ0s and then change the period to 76 when the display enable comes back as false. That gets the PIT synchronized with the CRTC (horizontally) to within 12 hdots. Then you can synchronize it vertically as well by moving it right again by one cycle so display enable comes back as true, and then waiting for display enable to come back as false (so that you know that you're at the bottom edge). Or just by counting how many times you used the period 75 IRQ0.
I see, thank you very much!