Andrew Davie, on Wed Jun 25, 2003 7:51 AM, said:
Our 'zero point' of any scanline is the beginning of horizontal retrace. This is the point at which the TIA re-enables the 6502 if it has been halted by a WSYNC write. At the beginning of any scanline, then, we know that we have exactly 68 colour clocks (=68/3 = 22.667 cycles) before the TIA starts 'drawing' the line itself.
Is that the start of horizontal RETRACE or horizontal BLANKING? My recollection is that the TIA reenables the 6507 when the electron beam hits the right-side border, which is actually a fair bit before the beam actually starts sweeping left. I fully appreciate that it's often useful to regard a scan line as starting as soon as the displayed portion of the previous one ends (indeed, that's how I've drawn timing charts when working out code) but in some goofy cases the distinction might be important.
BTW, would STA $xx be suitable for use as a three-cycle NOP, where $xx is a non-existent TIA write register? I know that some registers like $3F may be used for some bank-switching carts, but I would think some should be available.