Mercurial > vba-clojure
comparison clojure/com/aurellem/vbm.clj @ 70:ff6f1acae59e
removed zero frame confusion
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 08 Mar 2012 02:25:20 -0600 |
parents | 86093f2ce7d1 |
children | 39928bf4622d |
comparison
equal
deleted
inserted
replaced
69:063b78119835 | 70:ff6f1acae59e |
---|---|
41 (recur buttons (rest masks))))))) | 41 (recur buttons (rest masks))))))) |
42 | 42 |
43 (def vbm-header-length 255) | 43 (def vbm-header-length 255) |
44 | 44 |
45 (defn repair-vbm | 45 (defn repair-vbm |
46 "Two 0's must be inserted after every reset, and the first | 46 "Two 0's must be inserted after every reset." |
47 button must be dropped" | |
48 [vbm-seq] | 47 [vbm-seq] |
49 (loop [fixed [] | 48 (loop [fixed [] |
50 pending (next vbm-seq)] | 49 pending vbm-seq] |
51 (if (empty? pending) fixed | 50 (if (empty? pending) fixed |
52 (let [mask (first pending)] | 51 (let [mask (first pending)] |
53 (if (not= 0x0000 (bit-and mask (button-mask :reset))) | 52 (if (not= 0x0000 (bit-and mask (button-mask :reset))) |
54 (recur (conj fixed mask 0x0000 0x0000) (next pending)) | 53 (recur (conj fixed mask 0x0000 0x0000) (next pending)) |
55 (recur (conj fixed mask) (next pending))))))) | 54 (recur (conj fixed mask) (next pending))))))) |