changeset 487:09df21060be6

merge
author Robert McIntyre <rlm@mit.edu>
date Mon, 07 May 2012 11:15:49 -0500
parents 3f0156038802 (diff) cd6a96a07d2e (current diff)
children 09b3bc0b71b5
files
diffstat 4 files changed, 41 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/clojure/com/aurellem/run/image.clj	Mon May 07 11:15:49 2012 -0500
     1.3 @@ -0,0 +1,39 @@
     1.4 +(ns com.aurellem.run.music
     1.5 +  (:use (com.aurellem.gb saves gb-driver util constants
     1.6 +                         items vbm characters money
     1.7 +                         rlm-assembly))
     1.8 +  (:use (com.aurellem.run util title save-corruption
     1.9 +                          bootstrap-0 bootstrap-1))
    1.10 +  (:require clojure.string)
    1.11 +  (:import [com.aurellem.gb.gb_driver SaveState])
    1.12 +  (:import java.io.File))
    1.13 +
    1.14 +
    1.15 +
    1.16 +
    1.17 +
    1.18 +;; want to display an image onto the screen.
    1.19 +;; probably will be the six ponies, possibly with scrolling. 
    1.20 +
    1.21 +;; probably don't need hi-color mode since the images shuld be
    1.22 +;; simple. 
    1.23 +
    1.24 +;; use background tiles?  they provide greater color depth than
    1.25 +;; sprites, and can still be scrolled, so why not? 
    1.26 +
    1.27 +
    1.28 +;; First of all, RGB colors in an image are not the same as those in a
    1.29 +;; GameBoy, so I need to convert them.  Fortunately, this code is
    1.30 +;; already written for me in this C-code from the public domain
    1.31 +;; hi-color converter by Glen Cook, Jeff Frohwein, and Rob Jones.
    1.32 +
    1.33 +;; the code snipped itself is by Brett Bibby and is translated here
    1.34 +;; from C into clojure.
    1.35 +
    1.36 +;; TODO include original code
    1.37 +
    1.38 +
    1.39 +(def intensity [
    1.40 +
    1.41 +(defn rgb->gb-rb [[r g b]]
    1.42 +  
    1.43 \ No newline at end of file
     2.1 --- a/clojure/com/aurellem/run/music.clj	Sun May 06 20:54:09 2012 -0500
     2.2 +++ b/clojure/com/aurellem/run/music.clj	Mon May 07 11:15:49 2012 -0500
     2.3 @@ -392,6 +392,7 @@
     2.4      (->signed-8-bit (+
     2.5                       ;; two music-steps
     2.6                       (- (* 2 (count (music-step 0 0 false))))
     2.7 +                     ;; one noise
     2.8                       (- (count (music-step nil nil true)))
     2.9                       -2 ;; this jump instruction
    2.10                       -2 ;; activate frame 1
    2.11 @@ -542,7 +543,7 @@
    2.12  
    2.13  (def midi-code->gb-noise-code
    2.14    {nil 0xFF
    2.15 -   35 87
    2.16 +   35 90
    2.17     38 20
    2.18     39 0
    2.19     })
     3.1 Binary file music/mother.rg has changed
     4.1 Binary file music/wizards5.mid has changed