comparison clojure/com/aurellem/gb/characters.clj @ 225:0587f266a735

added functions for setting rival's name and text speed
author Robert McIntyre <rlm@mit.edu>
date Sat, 24 Mar 2012 05:26:33 -0500
parents 57258c269bcb
children d5dddf33543c
comparison
equal deleted inserted replaced
224:10e26e7ceedb 225:0587f266a735
18 :n-times [0x50 0x09 0x05 0xCD 0x11 0x0] 18 :n-times [0x50 0x09 0x05 0xCD 0x11 0x0]
19 19
20 20
21 }) 21 })
22 22
23 (def end-of-name-sentinel 0x00)
23 24
24 (def character-code->character 25 (def character-code->character
25 { 26 {
26 0x0 "" ;; separator character? 27 0x0 "" ;; separator character?
27 0x58 "\n" 28 0x58 "\n"
28 ;0x00 "<";;"end-of-name-sentinel" ;; begin messsage 29 ;;0x00 "<";;"end-of-name-sentinel" ;; begin messsage
29 ;;0x49 "\n //" ;; ocsenave: pagebreak pokedex 30 ;;0x49 "\n //" ;; ocsenave: pagebreak pokedex
30 ;;0x4E "\n..." ; ocsenave: clearscroll pokedex page 31 ;;0x4E "\n..." ; ocsenave: clearscroll pokedex page
31 0x4F "\n" ; newline 32 0x4F "\n" ; newline
32 ;;0x50 "#";;"end-of-pokemon-name-sentinel" 33 ;;0x50 "#";;"end-of-pokemon-name-sentinel"
33 0x51 "\n\n" ;; ocsenave: clear screen 34 0x51 "\n\n" ;; ocsenave: clear screen
153 (map #(character-code->character 154 (map #(character-code->character
154 % 155 %
155 (format "[0x%02X]" %)) 156 (format "[0x%02X]" %))
156 codes))) 157 codes)))
157 158
158
159
160 (defn print-text 159 (defn print-text
161 ([^SaveState state begin end] 160 ([^SaveState state begin end]
162 (dorun 161 (dorun
163 (map (fn [character-code line] 162 (map (fn [character-code line]
164 (println 163 (println