anchor.diff:                             (get-bg-pixel ppu x)))
                  (sprite-color (when (show-sprites ppu)
                                  (get-sprite-pixel ppu x bg-color)))
  -               (color (cond ((and bg-color sprite-color)
  -                             (on-top bg-color sprite-color))
  -                            (bg-color bg-color)
  -                            (sprite-color sprite-color)
  -                            (t bd-color))))
  +               (color (pick-color bg-color sprite-color bd-color)))
             ;(put-pixel x (ppu-scanline ppu) color)
             (sdl:with-pixel (pixels (sdl:fp *screen*))
               (sdl:write-pixel pixels x (ppu-scanline ppu) color)))))))
  
positive.code:             (when (and (zerop i) opaque-p)
                (set-sprite-zero-hit ppu 1))
              (let ((tile-color (logior (ash (palette sprite) 2) pattern-color)))
                (return (get-color ppu (+ #x3f00 tile-color))))))))
  
  ;;;; Misc Helpers
  
  (defun get-visible-sprites (ppu)
    ; TODO: Did I mistranslate semantics here?
    (with-accessors ((oam ppu-oam)) ppu
      (loop with count = 0 with result = (make-array 8 :initial-element nil)
         for i from 0 to 64 for sprite = (get-sprite ppu i)
         when (on-scanline sprite ppu)
         do (if (< count 8)
                (setf (aref result count) i
                      count (1+ count))
                (set-sprite-overflow ppu 1))
         finally (return result))))
  
  (defun on-top (x y)
    (declare (ignore x)) ; TODO: determine sprite priority
    y)
  
  ;;;; Core
  
  
negative.code:   ;; if none of the sprites are in our bounding box or if none are opaque.
    (let ((sprites (get-visible-sprites ppu))
          (oam (ppu-oam ppu)))
      (loop for i in sprites when i
         do (let* ((sprite (get-sprite ppu i))
                   (tile (tiles sprite ppu))
                   (pattern-color nil))
  