# HG changeset patch # User Robert McIntyre # Date 1337898805 18000 # Node ID 2304906d443be3f534d85d929a797a345dab4b21 # Parent 09b3bc0b71b53c9825e7c83deedcdc6eb27340b8 added function to pack gb-rgb bytes diff -r 09b3bc0b71b5 -r 2304906d443b clojure/com/aurellem/run/image.clj --- a/clojure/com/aurellem/run/image.clj Mon May 07 12:31:16 2012 -0500 +++ b/clojure/com/aurellem/run/image.clj Thu May 24 17:33:25 2012 -0500 @@ -88,24 +88,69 @@ ;; } -(def intensity - [0x00 0x10 0x20 0x30 0x40 0x50 0x5e 0x6c 0x7a 0x88 0x94 - 0xa0 0xae 0xb7 0xbf 0xc6 0xce 0xd3 0xd9 0xdf 0xe3 0xe7 - 0xeb 0xef 0xf3 0xf6 0xf9 0xfb 0xfd 0xfe 0xff 0xff]) + -(def influence - [[16 4 4] - [8 16 8] - [0 8 16]]) +(def image-program-target 0xB000) -(defn rgb->gb-rb [[r g b]] - (let [color-matrix - (map - (fn [color-row] - (map - (fn [color] - (bit-shift-right - (* (intensity (bit-shift-right r 3)) - color) 5)))))])) - - \ No newline at end of file + +(def display-width 160) +(def display-height 144) + + + +;{:r :g :b } + +(def character-data 0x8000) +(def character-data-end 0x97FF) + + + + +(def BG-data-1 0x9800) + +(def BG-data-2 0x9C00) + +(def OAM 0xFE00) + + +(def bg-pallet-select 0xFF68) +(def bg-pallet-data 0xFF69) + +(def obj-palette-select 0xFF6A) +(def obj-palette-data 0xFF6B) + + + +(def video-bank-select-register 0xFF4F) + + + +(defn gb-rgb->bits [r g b] + (assert (< 0 r 32)) + (assert (< 0 g 32)) + (assert (< 0 b 32)) + [(bit-and + 0xFF + (+ + r + (bit-shift-left g 5))) + + (+ + (bit-shift-right g 3) + (bit-shift-left b 2))]) + + + + + ) + +(defn display-one-color + "Displayes a single color onto the gameboy screen. input rgb in + gameboy rgb." + [r g b] + + + + + + ) \ No newline at end of file diff -r 09b3bc0b71b5 -r 2304906d443b moves/temp.vbm Binary file moves/temp.vbm has changed