changeset 142:b12d2408fd9b

moved set-memory to proper position, added pokemon.clj
author Robert McIntyre <rlm@mit.edu>
date Mon, 19 Mar 2012 19:56:55 -0500
parents d125a294f9d8
children cd930ed1fd4d
files clojure/com/aurellem/gb_driver.clj clojure/com/aurellem/item_bridge.clj clojure/com/aurellem/pokemon.clj
diffstat 3 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb_driver.clj	Mon Mar 19 19:45:32 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb_driver.clj	Mon Mar 19 19:56:55 2012 -0500
     1.3 @@ -249,7 +249,14 @@
     1.4  (gen-get-set-register HDMA5 26)
     1.5  (gen-get-set-register SVBK 27)
     1.6  (gen-get-set-register IE 28)
     1.7 -                            
     1.8 +
     1.9 +(defn set-memory [state location value]
    1.10 +  (set-state! state)
    1.11 +  (let [mem (memory state)]
    1.12 +    (aset mem location value)
    1.13 +    (write-memory! mem)
    1.14 +    (update-state)))
    1.15 +
    1.16  ;;;;;;;;;;;;;;;
    1.17  
    1.18  (defmacro defn-memo
     2.1 --- a/clojure/com/aurellem/item_bridge.clj	Mon Mar 19 19:45:32 2012 -0500
     2.2 +++ b/clojure/com/aurellem/item_bridge.clj	Mon Mar 19 19:56:55 2012 -0500
     2.3 @@ -18,13 +18,6 @@
     2.4          (range start end) (subvec (vec (memory state)) start end)))
     2.5    state)
     2.6  
     2.7 -(defn set-memory [state location value]
     2.8 -  (set-state! state)
     2.9 -  (let [mem (memory state)]
    2.10 -    (aset mem location value)
    2.11 -    (write-memory! mem)
    2.12 -    (update-state)))
    2.13 -
    2.14  (defn almost-broken
    2.15    "if one more memory location is turned into 0x03, the game crashes."
    2.16    [n]
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/clojure/com/aurellem/pokemon.clj	Mon Mar 19 19:56:55 2012 -0500
     3.3 @@ -0,0 +1,8 @@
     3.4 +(ns com.aurellem.pokemon
     3.5 +  (:use (com.aurellem gb-driver vbm
     3.6 +                      title save-corruption items assembly))
     3.7 +  (:import [com.aurellem.gb_driver SaveState]))
     3.8 +
     3.9 +
    3.10 +
    3.11 +