view 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
line wrap: on
line source
1 (ns com.aurellem.run.music
2 (:use (com.aurellem.gb saves gb-driver util constants
3 items vbm characters money
4 rlm-assembly))
5 (:use (com.aurellem.run util title save-corruption
6 bootstrap-0 bootstrap-1))
7 (:require clojure.string)
8 (:import [com.aurellem.gb.gb_driver SaveState])
9 (:import java.io.File))
15 ;; want to display an image onto the screen.
16 ;; probably will be the six ponies, possibly with scrolling.
18 ;; probably don't need hi-color mode since the images shuld be
19 ;; simple.
21 ;; use background tiles? they provide greater color depth than
22 ;; sprites, and can still be scrolled, so why not?
25 ;; First of all, RGB colors in an image are not the same as those in a
26 ;; GameBoy, so I need to convert them. Fortunately, this code is
27 ;; already written for me in this C-code from the public domain
28 ;; hi-color converter by Glen Cook, Jeff Frohwein, and Rob Jones.
30 ;; the code snipped itself is by Brett Bibby and is translated here
31 ;; from C into clojure.
33 ;; TODO include original code
36 (def intensity [
38 (defn rgb->gb-rb [[r g b]]