annotate clojure/com/aurellem/run/image.clj @ 486:3f0156038802

added image.clj
author Robert McIntyre <rlm@mit.edu>
date Mon, 07 May 2012 11:15:44 -0500
parents
children 09b3bc0b71b5
rev   line source
rlm@486 1 (ns com.aurellem.run.music
rlm@486 2 (:use (com.aurellem.gb saves gb-driver util constants
rlm@486 3 items vbm characters money
rlm@486 4 rlm-assembly))
rlm@486 5 (:use (com.aurellem.run util title save-corruption
rlm@486 6 bootstrap-0 bootstrap-1))
rlm@486 7 (:require clojure.string)
rlm@486 8 (:import [com.aurellem.gb.gb_driver SaveState])
rlm@486 9 (:import java.io.File))
rlm@486 10
rlm@486 11
rlm@486 12
rlm@486 13
rlm@486 14
rlm@486 15 ;; want to display an image onto the screen.
rlm@486 16 ;; probably will be the six ponies, possibly with scrolling.
rlm@486 17
rlm@486 18 ;; probably don't need hi-color mode since the images shuld be
rlm@486 19 ;; simple.
rlm@486 20
rlm@486 21 ;; use background tiles? they provide greater color depth than
rlm@486 22 ;; sprites, and can still be scrolled, so why not?
rlm@486 23
rlm@486 24
rlm@486 25 ;; First of all, RGB colors in an image are not the same as those in a
rlm@486 26 ;; GameBoy, so I need to convert them. Fortunately, this code is
rlm@486 27 ;; already written for me in this C-code from the public domain
rlm@486 28 ;; hi-color converter by Glen Cook, Jeff Frohwein, and Rob Jones.
rlm@486 29
rlm@486 30 ;; the code snipped itself is by Brett Bibby and is translated here
rlm@486 31 ;; from C into clojure.
rlm@486 32
rlm@486 33 ;; TODO include original code
rlm@486 34
rlm@486 35
rlm@486 36 (def intensity [
rlm@486 37
rlm@486 38 (defn rgb->gb-rb [[r g b]]
rlm@486 39