changeset 179:d63886d63b2f

cleaned up code; added gb.saves
author Robert McIntyre <rlm@mit.edu>
date Wed, 21 Mar 2012 23:02:45 -0500
parents 8d9e2804af9b
children 4f5ea93cbaca 5e34473ac774
files clojure/com/aurellem/exp/item_bridge.clj clojure/com/aurellem/exp/play.clj clojure/com/aurellem/gb/pokemon.clj clojure/com/aurellem/gb/saves.clj clojure/com/aurellem/gb/status.clj save-states/pre-trainer-battle.sav
diffstat 6 files changed, 25 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/exp/item_bridge.clj	Wed Mar 21 22:17:06 2012 -0500
     1.2 +++ b/clojure/com/aurellem/exp/item_bridge.clj	Wed Mar 21 23:02:45 2012 -0500
     1.3 @@ -1,7 +1,7 @@
     1.4  (ns com.aurellem.exp.item-bridge
     1.5 -  (:use (com.aurellem.gb util constants gb-driver vbm items assembly))
     1.6 +  (:use (com.aurellem.gb saves util constants gb-driver vbm items assembly))
     1.7    (:use (com.aurellem.run title save-corruption))
     1.8 -  (:use (com.aurellem.exp pokemon))
     1.9 +  ;;(:use (com.aurellem.exp pokemon))
    1.10    (:import [com.aurellem.gb.gb_driver SaveState]))
    1.11  
    1.12  (defn corrupt-item-state []
    1.13 @@ -56,7 +56,7 @@
    1.14    (loop [i 0
    1.15           pcs []]
    1.16      (if (= i ticks)
    1.17 -      (set pcs)
    1.18 +      (filter (partial < 0x2000)(sort (set pcs)))
    1.19        (do 
    1.20          (com.aurellem.gb.Gb/tick)
    1.21          (recur (inc i)
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/clojure/com/aurellem/exp/play.clj	Wed Mar 21 23:02:45 2012 -0500
     2.3 @@ -0,0 +1,8 @@
     2.4 +(ns com.aurellem.exp.play
     2.5 +  "scratchpad namespace"
     2.6 +  (:use (com.aurellem.gb gb-driver util constants
     2.7 +                         assembly
     2.8 +                         items pokemon status
     2.9 +                         characters species moves))
    2.10 +  (:import java.io.File)
    2.11 +  (:import [com.aurellem.gb.gb_driver SaveState]))
     3.1 --- a/clojure/com/aurellem/gb/pokemon.clj	Wed Mar 21 22:17:06 2012 -0500
     3.2 +++ b/clojure/com/aurellem/gb/pokemon.clj	Wed Mar 21 23:02:45 2012 -0500
     3.3 @@ -4,8 +4,11 @@
     3.4  
     3.5  (def pokemon-names-start 0xD2B4)
     3.6  
     3.7 -(defn change-party-number [^SaveState state new-num]
     3.8 -  (set-memory state 0xD162 new-num))
     3.9 +(defn set-party-number
    3.10 +  ([^SaveState state new-party-num]
    3.11 +     (set-memory state 0xD162 new-party-num))
    3.12 +  ([new-party-num]
    3.13 +     (set-party-number @current-state new-party-num)))
    3.14  
    3.15  (def party-number-address 0xD162)
    3.16  
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/clojure/com/aurellem/gb/saves.clj	Wed Mar 21 23:02:45 2012 -0500
     4.3 @@ -0,0 +1,8 @@
     4.4 +(ns com.aurellem.gb.saves
     4.5 +  (:use (com.aurellem.gb gb-driver))
     4.6 +  (:import [com.aurellem.gb.gb_driver SaveState]))
     4.7 +
     4.8 +(defn pre-wild-battle [] (read-state "prepare-for-battle"))
     4.9 +
    4.10 +(defn pre-trainer-battle []
    4.11 +  (read-state "pre-trainer-battle"))
    4.12 \ No newline at end of file
     5.1 --- a/clojure/com/aurellem/gb/status.clj	Wed Mar 21 22:17:06 2012 -0500
     5.2 +++ b/clojure/com/aurellem/gb/status.clj	Wed Mar 21 23:02:45 2012 -0500
     5.3 @@ -1,5 +1,5 @@
     5.4  (ns com.aurellem.gb.status
     5.5 -  (:use (com.aurellem.gb gb-driver util constants))
     5.6 +  (:use (com.aurellem.gb gb-driver util constants pokemon))
     5.7    (:import [com.aurellem.gb.gb_driver SaveState]))
     5.8  
     5.9  (def status-name->status-code
    5.10 @@ -19,7 +19,6 @@
    5.11    (zipmap (vals status-name->status-code)
    5.12            (keys status-name->status-code)))
    5.13  
    5.14 -
    5.15  (def pokemon-1-status-address 0xD16E)
    5.16  
    5.17  (defn pokemon-status-address [poke-num]
     6.1 Binary file save-states/pre-trainer-battle.sav has changed