comparison clojure/com/aurellem/gb/hxc.clj @ 308:de172acc5a03

moved the memory manipulation functions out of world.practice and into a separate location, gb.mem-utils, to avoid cyclic load dependency. will adjust the dependent files shortly.
author Dylan Holmes <ocsenave@gmail.com>
date Sat, 31 Mar 2012 04:25:49 -0500
parents 872e032949ff
children 3d4f60b4a4af
comparison
equal deleted inserted replaced
307:872e032949ff 308:de172acc5a03
1 (ns com.aurellem.gb.hxc 1 (ns com.aurellem.gb.hxc
2 (:use (com.aurellem.gb assembly characters gb-driver util 2 (:use (com.aurellem.gb assembly characters gb-driver util mem-util
3 constants species)) 3 constants species))
4 (:use (com.aurellem.world practice))
5 (:import [com.aurellem.gb.gb_driver SaveState])) 4 (:import [com.aurellem.gb.gb_driver SaveState]))
6 5
7 6
8 7
9 8
209 208
210 209
211 ;; http://hax.iimarck.us/topic/581/ 210 ;; http://hax.iimarck.us/topic/581/
212 (defn hxc-cry 211 (defn hxc-cry
213 "The pokemon cry data in internal order. List begins at ROM@39462" 212 "The pokemon cry data in internal order. List begins at ROM@39462"
214 ([](hxc-cry com.aurellem.gb.gb-driver/original-rom) 213 ([](hxc-cry com.aurellem.gb.gb-driver/original-rom))
215 ([rom] 214 ([rom]
216 (zipmap 215 (zipmap
217 (hxc-pokenames rom) 216 (hxc-pokenames rom)
218 (map 217 (map
219 (fn [[cry-id pitch length]] 218 (fn [[cry-id pitch length]]
220 {:cry-id cry-id 219 {:cry-id cry-id
221 :pitch pitch 220 :pitch pitch
222 :length length} 221 :length length}
223 ) 222 )
224 (partition 3 223 (partition 3
225 (drop 0x39462 rom))))))) 224 (drop 0x39462 rom))))))
226 225
227 (defn hxc-cry-groups 226 (defn hxc-cry-groups
228 ([] (hxc-cry-ids com.aurellem.gb.gb-driver/original-rom)) 227 ([] (hxc-cry-groups com.aurellem.gb.gb-driver/original-rom))
229 ([rom] 228 ([rom]
230 (map #(mapv first 229 (map #(mapv first
231 (filter 230 (filter
232 (fn [[k v]] 231 (fn [[k v]]
233 (= % (:cry-id v))) 232 (= % (:cry-id v)))
234 (hxc-cry rom))) 233 (hxc-cry)))
235 ((comp 234 ((comp
236 range 235 range
237 count 236 count
238 set 237 set
239 (partial map :cry-id) 238 (partial map :cry-id)