<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>The Playfield on Programming the Atari VCS in Assembly</title><link>https://cdeever.github.io/atari-vcs/docs/playfield/</link><description>Recent content in The Playfield on Programming the Atari VCS in Assembly</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://cdeever.github.io/atari-vcs/docs/playfield/index.xml" rel="self" type="application/rss+xml"/><item><title>The Three Registers</title><link>https://cdeever.github.io/atari-vcs/docs/playfield/registers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://cdeever.github.io/atari-vcs/docs/playfield/registers/</guid><description>&lt;h1 id="the-three-registers-pf0-pf1-pf2"&gt;The Three Registers: PF0, PF1, PF2&lt;a class="anchor" href="#the-three-registers-pf0-pf1-pf2"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Everything the playfield does starts with three 8-bit registers — &lt;code&gt;PF0&lt;/code&gt;, &lt;code&gt;PF1&lt;/code&gt;, &lt;code&gt;PF2&lt;/code&gt; — and the &lt;strong&gt;20 bits&lt;/strong&gt; of them the TIA actually draws. This page lays out exactly which bit lights which pixel. We will stay on the &lt;strong&gt;left half of the screen&lt;/strong&gt; the whole way; the other half turns out to be a story of its own.&lt;/p&gt;
&lt;h2 id="what-one-pixel-is"&gt;What one &amp;ldquo;pixel&amp;rdquo; is&lt;a class="anchor" href="#what-one-pixel-is"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;First, what these bits paint. A playfield pixel is a &lt;em&gt;virtual&lt;/em&gt; block, generated on the fly by the TIA as the beam passes — not a dot in any frame buffer. Each is &lt;strong&gt;4 color clocks wide&lt;/strong&gt; and exactly &lt;strong&gt;one scanline tall&lt;/strong&gt;. The playfield has no vertical resolution of its own: a pixel is one scanline high, and a &lt;em&gt;taller&lt;/em&gt; block is just the same bits held unchanged across consecutive lines — exactly how the Christmas-tree kernel grows its shape.&lt;/p&gt;</description></item><item><title>Symmetry: Reflection &amp; Repetition</title><link>https://cdeever.github.io/atari-vcs/docs/playfield/symmetry/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://cdeever.github.io/atari-vcs/docs/playfield/symmetry/</guid><description>&lt;h1 id="symmetry-reflection--repetition"&gt;Symmetry: Reflection &amp;amp; Repetition&lt;a class="anchor" href="#symmetry-reflection--repetition"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;The &lt;a href="https://cdeever.github.io/atari-vcs/docs/playfield/registers/"&gt;three registers&lt;/a&gt; gave you 20 bits — the &lt;strong&gt;left 20 pixels&lt;/strong&gt; of a 40-pixel-wide screen. You never wrote the other 20. This page is where they come from.&lt;/p&gt;
&lt;p&gt;The TIA &lt;strong&gt;generates the right half automatically&lt;/strong&gt; from those same 20 bits, and a single flag decides whether it does so as a copy or a mirror. That is why the playfield is &lt;em&gt;inherently&lt;/em&gt; symmetric: one write of &lt;code&gt;PF0&lt;/code&gt;/&lt;code&gt;PF1&lt;/code&gt;/&lt;code&gt;PF2&lt;/code&gt; per line paints the whole 40-pixel width, but both halves are built from the same bits.&lt;/p&gt;</description></item><item><title>The Asymmetric Playfield</title><link>https://cdeever.github.io/atari-vcs/docs/playfield/asymmetric/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://cdeever.github.io/atari-vcs/docs/playfield/asymmetric/</guid><description>&lt;h1 id="the-asymmetric-playfield"&gt;The Asymmetric Playfield&lt;a class="anchor" href="#the-asymmetric-playfield"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://cdeever.github.io/atari-vcs/docs/playfield/symmetry/"&gt;Symmetry&lt;/a&gt; is the playfield&amp;rsquo;s default because its 20 bits describe only the left half and the TIA mirrors or copies them onto the right. To show two &lt;em&gt;different&lt;/em&gt; things on the two halves — a genuinely &lt;strong&gt;asymmetric playfield&lt;/strong&gt; — you have to break that deal. The escape hatch is timing.&lt;/p&gt;
&lt;h2 id="the-tia-reads-the-registers-as-it-goes"&gt;The TIA reads the registers as it goes&lt;a class="anchor" href="#the-tia-reads-the-registers-as-it-goes"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The crucial fact: the TIA does &lt;strong&gt;not&lt;/strong&gt; snapshot &lt;code&gt;PF0&lt;/code&gt;/&lt;code&gt;PF1&lt;/code&gt;/&lt;code&gt;PF2&lt;/code&gt; at the start of the line. It &lt;strong&gt;reads them continuously as the beam sweeps across&lt;/strong&gt;, consulting each register at the exact moment the beam reaches the pixels it controls. So if you &lt;strong&gt;rewrite the registers partway across the line&lt;/strong&gt; — after the beam has drawn the left half, but before it reaches the right half — the right half is built from the &lt;em&gt;new&lt;/em&gt; values. The two halves now differ.&lt;/p&gt;</description></item><item><title>Building a Scoreboard</title><link>https://cdeever.github.io/atari-vcs/docs/playfield/scoreboard/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://cdeever.github.io/atari-vcs/docs/playfield/scoreboard/</guid><description>&lt;h1 id="building-a-scoreboard"&gt;Building a Scoreboard&lt;a class="anchor" href="#building-a-scoreboard"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;A two-player scoreboard is the textbook use of an &lt;a href="https://cdeever.github.io/atari-vcs/docs/playfield/asymmetric/"&gt;asymmetric playfield&lt;/a&gt; — two &lt;em&gt;different&lt;/em&gt; numbers, one on each half of the screen — and it pulls together nearly everything in this chapter: digit graphics drawn from the playfield, bit masking to pack two digits into a byte, the no-multiply &lt;a href="https://cdeever.github.io/atari-vcs/docs/prerequisites/numbers/"&gt;×5 index trick&lt;/a&gt;, and &lt;a href="https://cdeever.github.io/atari-vcs/docs/prerequisites/numbers/"&gt;BCD&lt;/a&gt; arithmetic to keep the count in decimal.&lt;/p&gt;
&lt;blockquote class='book-hint '&gt;
&lt;p&gt;The code here is &lt;strong&gt;illustrative&lt;/strong&gt; — the repository doesn&amp;rsquo;t ship a scoreboard project yet. Treat the snippets as sketches of the technique, not a drop-in kernel.&lt;/p&gt;</description></item></channel></rss>