 
 (defn opcode-FX55
   "Store registers V0 through Vx in memory starting at location I."
-  [{:keys [i v memory] :as state} x]
-  (-> state
-      (write-memory (get-in-range v 0 (inc x)) i)
+  [{:keys [i v memory] :as state} X]
+  (-> state
+      (write-memory (get-in-range v 0 (inc X)) i)
       (write-pc 2)))
 
 (defn opcode-FX65


(defn opcode-FX1E
  "Set I = I + Vx."
  [{:keys [i v] :as state} x]
  (let [Vx (nth v x)]
    (-> state
        (write-i (+ i Vx))
        (write-pc 2))))


(defn opcode-FX07
  "Set Vx = delay timer value."
  [{:keys [v dt] :as state} X]
  (-> state
      (write-v X dt)
      (write-pc 2)))

;; TODO: Fx0A

(defn opcode-FX15
  "Set delay timer = Vx."
  [{:keys [v] :as state} X]
  (let [Vx (nth v X)]
    (-> state
        (write-dt Vx)
        (write-pc 2))))
