{"id":96,"date":"2016-02-22T00:06:00","date_gmt":"2016-02-22T00:06:00","guid":{"rendered":"https:\/\/oldcodetricks.wordpress.com\/?p=96"},"modified":"2016-02-22T00:06:00","modified_gmt":"2016-02-22T00:06:00","slug":"quick-bonus-post-zx-spectrum-sync-and-timing","status":"publish","type":"post","link":"https:\/\/mrgadget.nexus\/oldcodetricks\/2016\/02\/22\/quick-bonus-post-zx-spectrum-sync-and-timing\/","title":{"rendered":"Quick Bonus Post &#8211; ZX Spectrum, sync and timing"},"content":{"rendered":"<p>Quick little thing related to the previous post.<\/p>\n<p>Unless otherwise disabled, the ZX Spectrum hardware issues an interrupt at the start of the processing of each TV frame (actually the &#8220;retrace&#8221; if I recall). This means to get &#8220;in sync&#8221; with the screen simply issue a &#8220;HALT&#8221; Z80 instruction. After the interrupt the code will resume.<\/p>\n<p>For poor-man timing any 50 FPS routine, play with the border colour, for example, &#8220;LD A,2&#8221; then &#8220;OUT (254),A&#8221; at the start to turn the border red, and &#8220;LD A,0&#8221; and &#8220;OUT (254),A&#8221; at the end to turn the border black. This was a favourite trick of mine, used when working on the previously mentioned &#8220;huge&#8221; text routine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quick little thing related to the previous post. Unless otherwise disabled, the ZX Spectrum hardware issues an interrupt at the start of the processing of each TV frame (actually the &#8220;retrace&#8221; if I recall). This means to get &#8220;in sync&#8221; with the screen simply issue a &#8220;HALT&#8221; Z80 instruction. After the interrupt the code will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-96","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/mrgadget.nexus\/oldcodetricks\/wp-json\/wp\/v2\/posts\/96","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mrgadget.nexus\/oldcodetricks\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mrgadget.nexus\/oldcodetricks\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mrgadget.nexus\/oldcodetricks\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mrgadget.nexus\/oldcodetricks\/wp-json\/wp\/v2\/comments?post=96"}],"version-history":[{"count":0,"href":"https:\/\/mrgadget.nexus\/oldcodetricks\/wp-json\/wp\/v2\/posts\/96\/revisions"}],"wp:attachment":[{"href":"https:\/\/mrgadget.nexus\/oldcodetricks\/wp-json\/wp\/v2\/media?parent=96"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mrgadget.nexus\/oldcodetricks\/wp-json\/wp\/v2\/categories?post=96"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mrgadget.nexus\/oldcodetricks\/wp-json\/wp\/v2\/tags?post=96"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}