comparison clojure/com/aurellem/gb/gb_driver.clj @ 489:641e1c511224

cleanup.
author Robert McIntyre <rlm@mit.edu>
date Mon, 07 May 2012 12:37:04 -0500
parents 09b3bc0b71b5
children a6d060a64246
comparison
equal deleted inserted replaced
488:09b3bc0b71b5 489:641e1c511224
269 (defn ~@forms) 269 (defn ~@forms)
270 (alter-var-root (var ~fun-name) memoize)))) 270 (alter-var-root (var ~fun-name) memoize))))
271 271
272 (def original-rom (rom (root))) 272 (def original-rom (rom (root)))
273 273
274
275 ;; RGB colors in an image are not the same as those in a GameBoy, so I
276 ;; need to convert them. Fortunately, this code is already written
277 ;; for me in this C-code from the public domain hi-color converter by
278 ;; Glen Cook, Jeff Frohwein, and Rob Jones.
274 (defn rgb->gb-rb [[r g b :as color]] 279 (defn rgb->gb-rb [[r g b :as color]]
275 (let [store (int-array 3)] 280 (let [store (int-array 3)]
276 (Gb/translateRGB (int-array color) store) 281 (Gb/translateRGB (int-array color) store)
277 (vec store))) 282 (vec store)))