comparison clojure/com/aurellem/run/image.clj @ 494:79606f173658

improbed color display kernel.
author Robert McIntyre <rlm@mit.edu>
date Thu, 07 Jun 2012 23:11:18 -0500
parents 783a09c84a28
children 1d81ddd4fa41
comparison
equal deleted inserted replaced
493:783a09c84a28 494:79606f173658
174 (defn display-one-color 174 (defn display-one-color
175 "Displayes a single color onto the gameboy screen. input rgb in 175 "Displayes a single color onto the gameboy screen. input rgb in
176 gameboy rgb." 176 gameboy rgb."
177 [[r g b]] 177 [[r g b]]
178 ;; construct a kernel that displays a single color 178 ;; construct a kernel that displays a single color
179 (let [palettes (repeat 8 [r g b]) 179 (let
180 kernel-address 0xC000 180 [palettes (repeat 8 [r g b])
181 kernel 181 kernel-address 0xC000
182 (flatten 182 kernel
183 [0xF3 ;; disable interrupts 183 [0xF3 ;; disable interrupts
184 (frame-metronome) 184 (clear-music-registers)
185 (set-palettes 185 (frame-metronome)
186 obj-palette-select 186 (set-palettes obj-palette-select obj-palette-data palettes)
187 obj-palette-data 187 (set-palettes bg-palette-select bg-palette-data palettes)
188 palettes) 188 (infinite-loop)]]
189 (set-palettes
190 bg-palette-select
191 bg-palette-data
192 palettes)
193 (infinite-loop)])]
194 (-> (set-memory-range (second (music-base)) 189 (-> (set-memory-range (second (music-base))
195 kernel-address kernel) 190 kernel-address (flatten kernel))
196 (PC! kernel-address)))) 191 (PC! kernel-address))))
197 192
198 193
199 194
200 195