diff clojure/com/aurellem/gb/moves.clj @ 191:893c753f8088

added function to set ROM
author Robert McIntyre <rlm@mit.edu>
date Thu, 22 Mar 2012 20:10:09 -0500
parents 9a7a46c4aa1b
children fd549c8f42ae
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb/moves.clj	Thu Mar 22 16:34:10 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb/moves.clj	Thu Mar 22 20:10:09 2012 -0500
     1.3 @@ -187,7 +187,7 @@
     1.4       (let [start (moves-codes-start poke-num)]
     1.5         (vec
     1.6          (take-while
     1.7 -         (partial not= (move-name->move-code :end-of-moves))
     1.8 +         (partial not= :end-of-moves)
     1.9           (map
    1.10            move-code->move-name
    1.11            (subvec (vec (memory state))
    1.12 @@ -195,14 +195,15 @@
    1.13    ([poke-num]
    1.14       (read-moves @current-state poke-num)))
    1.15               
    1.16 -
    1.17 -
    1.18  (defn give-moves
    1.19    ([^SaveState state pokemon-num moves]
    1.20 +     (assert (<= (count moves) 4))
    1.21       (set-memory-range
    1.22        state
    1.23        (moves-codes-start pokemon-num)
    1.24 -      (map #(move-name->move-code % %) moves)))
    1.25 +      (map #(move-name->move-code % %)
    1.26 +           (concat moves
    1.27 +                   (repeat (- 4 (count moves)) :end-of-moves)))))
    1.28    ([pokemon-num moves]
    1.29       (give-moves @current-state pokemon-num moves))
    1.30    ([moves]
    1.31 @@ -216,7 +217,6 @@
    1.32  ;; thus, a move can have up to 63 current pp and up to
    1.33  ;; three pp-ups applied.
    1.34  
    1.35 -
    1.36  (def pokemon-1-pp-start 0xD187)
    1.37  
    1.38  (defn moves-pp-start [pokemon-num]