54283 next TV line. It is used to synchronize the VBI's or DLI's with the screen display. To see the effect of the WSYNC register, type in the second example of a Display List Interrupt at location 512. RUN it and observe that it causes a clean separation of the colors at the change boundary. Now change line 50 to: 50 DATA 72,169,222,234,234,234,141,24,208,104,64 This eliminates the WSYNC command. RUN it and see the difference in the boundary line. The keyboard handler sets WSYNC repeatedly while generating the keyboard click on the console speaker at 53279 ($D01F). When interrupts are generated during the WSYNC period, they get delayed by one scan line. To bypass this, examine the VCOUNT register below and delay the interrupt processing by one line when no WSYNC delay has occurred. 54283 D40B VCOUNT (R) Vertical line counter. Used to keep track of which line is currently being generated on the screen. Used during Display List Interrupts to change color or graphics modes. PEEKing here returns the line count divided by two, ranging from zero to 130 ($82; zero to 155 on the PAL system; see 53268; $D014) for the 262 lines per TV frame. 54284 D40C PENH (R) Light pen horizontal position (564). Holds the horizontal color clock count when the pen trigger is pressed. 54285 D40D PENV (R) Light pen vertical position (565). Holds the VCOUNT value (above) when the pen trigger is pressed. See the Hardware Manual, p. II-32, for a description of light pen operation. 54286 D40E NMIEN (W) Non-maskable interrupt (NMI) enable. POKE with 192 to enable the Display List Interrupts. When BIT 7 is set to one, it means DL instruction interrupt; any display list instruction where BIT 7 equals one will cause this interrupt to be enabled at the start of the last video line displayed by that instruction. When BIT 6 equals one, it allows the Vertical Blank Interrupt and when BIT 5 equals one, it allows the RESET button interrupt. The RESET interrupt is never disabled by the OS. You should never press RESET during powerup since it will be acted upon. NMIEN is set to 64 ($40) by the OS IRQ code on powerup, enabling VBI's, but disabling DLI's. All NMI interrupts are vectored through 65530 ($FFFA) to the NMI service routine at