comparison clojure/com/aurellem/run/music.clj @ 423:971bd1774eab

increased resolution of music-kernel timer.
author Robert McIntyre <rlm@mit.edu>
date Tue, 17 Apr 2012 06:53:48 -0500
parents f211cd655ccb
children 7bd806c4dbb6
comparison
equal deleted inserted replaced
422:b58a356f7cc2 423:971bd1774eab
155 0x01 155 0x01
156 0xE0 156 0xE0
157 0x06 ;; set TMA to 0 157 0x06 ;; set TMA to 0
158 158
159 0x3E 159 0x3E
160 (Integer/parseInt "00000111" 2) 160 (Integer/parseInt "00000110" 2)
161 0xE0 161 0xE0
162 0x07 ;; set TAC to 16384 Hz and activate timer 162 0x07 ;; set TAC to 65536 Hz and activate timer
163 163
164 0xF0 164 0xF0
165 0x07 165 0x07
166 166
167 (music-step) 167 (music-step)
181 0xA2 0x00 0x55 181 0xA2 0x00 0x55
182 0xA3 0x00 0x55 182 0xA3 0x00 0x55
183 0xA4 0x00 0x55 183 0xA4 0x00 0x55
184 0xA5 0x00 0x55 184 0xA5 0x00 0x55
185 0xA6 0x00 0x55 185 0xA6 0x00 0x55
186 0xA7 0x00 0x55]) 186 0xA6 0x55 0xFF
187 0xA6 0x55 0xFF
188 0xA6 0x55 0xFF
189 0x00 0x00 0xFF
190 ])
191
187 192
188 (defn play-music [music-bytes] 193 (defn play-music [music-bytes]
189 (let [program-target 0xC000 194 (let [program-target 0xC000
190 music-target 0xD000] 195 music-target 0xD000]
191 (-> (set-memory-range (second (music-base)) 196 (-> (set-memory-range (second (music-base))