anchor.diff:       (dey))
       (rts))
   
  +  (procedure init-nametable
  +    ;; Fill nametable.
  +    (as/until :negative (bita (mem +ppu-status+)))
  +    (ppuaddr #x2000)
  +    (jsr 'fill-nametable)
  +    (as/until :negative (bita (mem +ppu-status+)))
  +    (ppuaddr #x2400)
  +    (jsr 'fill-nametable)
  +    (rts))
  +
  +  (procedure init-attr
  +    ;; Fill attribute table.
  +    (as/until :negative (bita (mem +ppu-status+)))
  +    (ppuaddr #x23C0)
  +    (ldy (imm 0))
  +    (lda (imm #b01010101))
  +    (jsr 'fill-attributes)
  +    (as/until :negative (bita (mem +ppu-status+)))
  +    (ppuaddr #x27C0)
  +    (ldy (imm #b10101010))
  +    (lda (imm #b11111111))
  +    (jsr 'fill-attributes)
  +    (rts))
  +
  +  (procedure init-palette
  +    ;; Program palette.
  +    (ppuaddr #x3F00)
  +    (dolist (color '(#x3F #x2D #x3D #x30  #x3F #x03 #x13 #x23
  +                     #x3F #x2D #x3D #x30  #x3F #x05 #x15 #x25
  +                     #x3F #x3F #x27 #x37))
  +      (poke color +vram-io+))
  +    (rts))
  +
     (align 256)
     (procedure framestep
       (jsr 'wait-for-vblank)
       (lda (mem +ppu-status+))          ; Reset PPU address latch.
  +    (poke 0 +spr-addr+)               ; Reset sprite address!
       (lda (imm (msb sprite-table)))    ; Sprite DMA transfer.
       (sta (mem +sprite-dma+))
   
  
positive.code:     (jsr 'update-sprites)
  
      ;; Switch pattern tables mid-frame:
      (emit-delay (+ (* 114 107) 30))
      (lda top-ntaddr)
      (eor (imm #b10010000))            ; Invert pattern bank.
      (sta (mem +ppu-cr1+))
  
negative.code:     ;; the sprite tables, and if I didn't shut it off, you'd notice
      ;; the background stopped waving.
      (loop repeat 10 do (nop))           ; Realign with hblank.. again.
      ;; Actually, leave the sprites on, otherwise they'll be disabled
      ;; during the DMA transfer, which is unwise.
      (poke #x10 +ppu-cr2+)
  
      (rts))
  
  