timing

ZXNet echo conference «code.zx»

From Dmitry Lomov To Leonid Mishankov 29 November 1999

Hello Leonid! Once, Mon Nov 29 1999 01:25, Leonid Mishankov wrote to All about [timing]: LM> How can you unambiguously determine the number of lines from HALT to the beginning LM> screen??? on the Pentagon - no way, on Scorp - it’s possible, using the #FF port. LM> How to distinguish Scorp, where all commands are supplemented to an even number LM> clock cycles, from another, absolutely any car, but where is there no wait? a loop is made and the number of loop executions per frame is counted. in the loop either only even or odd ones are executed. LM> In Scorpa, without wait, there are 62 lines before the start of the screen, 64. LM> in Pentagon 78, 80. LM> and how many in Scorpa with wait? 64, but the bars are stretched ;) LM> How much time will pass in Scorpa from the moment OUT (#FE) is submitted and before LM> moment when I see this on the screen? on the border, the image is linked to a familiar grid. LM> Are there cars with a number of cycles per line other than 224? yes - mostly scorpions/leningrads/composites. LM> Why, when I scroll horizontal multi-colored stripes in the area LM> attributes, they begin to shake when, if the image is stopped, LM> is everything clear? I don't understand what you mean. Best wishes. Dmitry.

From Alexander Ageev To Leonid Mishankov 30 November 1999

Hello Leonid! Tuesday November 30 1999 06:39, Leonid Mishankov wrote to Alexander Ageev: LM>>> Are there cars with a number of cycles per line other than LM>>> 224? AA>> Yes, this is Speccy 128 and subsequent models (branded %) LM> And you don’t have information, like in various branded cars LM> are waits being generated? Read the FAQ: [ftp://zx-museum.org.ru/ftp.void.jump.org/pub/sinclair/specfaq/] : [HTML] [ftp://zx-museum.org.ru/ftp.void.jump.org/pub/sinclair/specfaq/specfaqh.zip] [Text] [ftp://zx-museum.org.ru/ftp.void.jump.org/pub/sinclair/specfaq/specfaqt.zip] Please note that the Russian mirror may not be up to date. I hope there are no problems with English) For Speccy 48k: When the ULA is drawing the screen, it needs to access video memory; the RAM cannot be read by two devices (the ULA and the processor) at once, and the ULA is given higher priority (as the electron beam cannot be interrupted), so programs which run in the contended memory (from #4000 to #7FFF) or try to read from port #FE (when the ULA must supply the result) will be slowed if the ULA is reading the screen. Note this effect occurs only when the actual screen is being drawn; when the border is being drawn, the ULA supplies the resultand no delays occur. The precise details are as follows: + At cycle #14335 (just one cycle before the top left corner is reached) the delay is 6 cycles. + At cycle #14336 the delay is 5 cycles, and so on according to the following table: Cycle # Delay ------- ----- 14335 6 (until 14341) 14336 5 ( " " ) 14337 4 ( " " ) 14338 3 ( " " ) 14339 2 ( " " ) 14340 1 ( " " ) 14341 No delay 14342 No delay 14343 6 (until 14349) 14344 5 ( " " ) 14345 4 ( " " ) 14346 3 ( " " ) 14347 2 ( " " ) 14348 1 ( " " ) 14349 No delay 14350 No delay etc., until the cycle #14463 (always relative to the start of the interrupt), in which the electron beam reaches the border again for 96 more cycles. And at cycle #14559 the same situation repeats. This is valid for all 192 lines of screen data. While the ULA is updating the border the delay does not happen at any time. Для Speccy128: Memory banks 4-7 are contended, i.e. the processor shares them with the ULA. This reduces the speed of memory access in these banks. Port #FE is still contended, and port #7FFD also causes contention, although the precise details of this are not known.+ There are 228 T-states per scanline, as opposed to 224. + There are 311 scanlines per frame, as opposed to 312. + There are 63 scanlines before the television picture, as opposed to 64. The contended memory timings for these machines are similar to that for the 48K machine, except that the 6,5,4,3,2,1,0,0 pattern starts at 14361 T-states after the interrupt, as opposed to 14335. Для Speccy +2/+3: The contended memory timings differ on the +2A/+3 from the earlier machines; firstly, the timing differences mean that the top-left pixel of the screen is displayed 14364 T-states after the 50 Hz interrupt occurs, as opposed to 14336. The T-states (relative to the interrupt) at which delays occur are given in the following table: Cycle # Delay ------- ----- 14361 1 14362 No delay 14363 7 14364 6 14365 5 14366 4 14367 3 14368 2 14369 1 14370 No delay 14371 7 14372 6 and so on, until cycle 14490, when the display of the first scanline on the screen has been completed, and no more delays are inserted until 14589 (=14361+228) when the cycle repeats. The other difference occurs for instructions which have multiple 'pc+1' or 'hl' entries in the breakdown forthe other machines: on the +2A/+3, these entries are combined into just one. This means that, for example, JR becomes pc:4,pc+1:8. Like the base 128K machine, RAM banks 4-7 are contended. However, port #FE is not; whether ports #7FFD and #1FFD are contended is currently unknown. LM> P.S. I was digging around and found a multicolor there, tailored for something with LM> 212 bars per line... No clone had 212, imho Stinger.

From Dmitry Lomov To Leonid Mishankov 30 November 1999

Hello Leonid! One day, Tue Nov 30 1999 06:28, Leonid Mishankov wrote to Dmitry Lomov about [timing]: LM>>> How can you uniquely determine the number of lines from HALT to LM>>> start of screen??? DL>> on the Pentagon - no way, on Scorp - it is possible, through the #FF port. LM> How, could you be more specific, please? it's just a thought. on the curb, something different may be read from the FF port, such as on the screen. LM>>> How to distinguish Scorp, where all commands are complemented to even LM>>> number of cycles, from another, absolutely any car, but where not LM>>> wait? DL>> a loop is made and the number of loop executions per frame is counted. DL>> either only even or odd numbers are executed in the loop. LM> So far, nothing smarter than L0 INC HL:JP L0 has come to mind... LM> Stopped the interrupt handler loop. Is it possible to be more precise LM> measure? If only up to +-4 bars... I did it accurate to the 1st beat (for the Pentagon). the principle is more cunning, but in general - the same thing. LM>>> How long will it take in Scorpa from the moment OUT (#FE) is submitted to LM>>> the moment when I see this on the screen? DL>> on the border, the image is snapped to the familiar grid. LM> sorry, I didn’t understand a little... That is, when an attribute byte is counted, then LM> appear and color on the border? along the H2 slice, information from the FE port is latched into the screen register. LM> I meant that OUT (C),A is executed LM> 12 bars, so in exactly 12 bars I will see the effect? on the penultimate measure of this command. about when you will see him - see above. LM>>> Are there cars with a number of cycles per line other than LM>>> 224? DL>> yes - mainly scorpions/Leningrads/composites. LM> Oh! But it’s also 224, you just have to assume that everything is wrong. commands LM> stretch to even... :-/ Or not? do not confuse the bars in the line and the brake on the odd ones. measures in a line are implied, Naturally, as part of even-numbered teams. LM> For some reason on Scorp there is multicolor jitter within LM> one familiar place in any part of the screen. If after HALT I put LM> command taking number of clock cycles, odd 4, jitter LM> stops... I still don’t understand why...:( elementary, Watson ;) in the HALT wait loop, NOPs are executed, hence the binding. everything that gets done from HALT to HALT, must be a multiple of four clock cycles (including the confirmation cycle interruptions - 19 clock cycles, apparently), otherwise it will twitch. if you work on a curb, then everything is even more difficult - you not only need to withstand multiple of four (ordinary music goes to the bathhouse), but also record the progress commands accurate to the clock cycle, i.e. bind signals in the circuit (INT, for example) to a specific clock cycle within the HALT (aka NOP) instruction. I conquered this task decided :) for Scorpio, by the way, it is fundamentally unsolvable. Best wishes. Dmitry.

From Dmitry Lomov To Kirill Frolov 2 December 1999

Hello, Kirill! Once, Wed Dec 01 1999 04:59, Kirill Frolov wrote to Dmitry Lomov about [timing]: LM>>> In Scorpa, without wait, there are 62 lines before the start of the screen, DL>> 64. KF> Where does this difference come from? Has your computer been rebuilt? There is such a thing - it’s called a diagram ;) from her, dear, and in practice this is confirmed. for Scorpio the alignment is 64/192/56, for Pentagon it is 80/192/48. LM>>> How long will it take in Scorpa from the moment OUT (#FE) is submitted to LM>>> the moment when I see this on the screen? DL>> on the border, the image is snapped to the familiar grid. KF> Or rather, towards the end of the i/o processor cycle. ? Best wishes. Dmitry.