I was taking a closer look at the timing of this last night. As far as I can tell, there are 6 full cycles between the SX compare value going HIGH (i.e. when the Screen Origin X value matches the Horizontal Counter) and Border pixels no longer being output on the left hand border (i.e. because it then starts outputting the text window pixels).lance.ewing wrote: i_in_matrix: Is the inverse of the in_matrix signal and is used to enable the Horizontal Cell Counter and Video Matrix Counter.
i_mtrx_line: Is the inverse of the matrix_line signal and is used as part of the logic to enable the Cell Depth Counter.
bus_avail: Goes LOW about a cycle before the i_in_matrix signal goes LOW. It goes pretty much directly to the driver logic for the unused Bus Available bonding pad. This signal isn't used internally by the chip (or externally since the bonding pad is not connected to a pin).
* There is one cycle between SX Compare going HIGH and it entering the "In Matrix" (i.e. in text window) calculation.
* There is one cycle between this and when the Bus Available line changes.
* There is one cycle between that and when the "In Matrix" signal (i_in_matrix) changes to enable the Video Matrix Counter and Horizontal Cell Counter.
* There is one cycle between that and when the Address Ouput Enable goes HIGH (there is therefore two cycles between when Bus Available changes and the 6561 outputs an address).
* There is then one cycle where the 6561 is getting the cell index.
* There is then another cycle where the 6561 is getting the character data.
It's at that point that the border turns off and we get the pixels from the pixel shift register being output.
So by the time the text window pixels start being output, the Horizontal Counter will have incremented a further 6 times since the Screen Origin X value matched it.