# HG changeset patch # User Dylan Holmes # Date 1333175266 18000 # Node ID 2873f50b7291dd5d5df82c28b647983d4396e66d # Parent 7998b1cf18cf5e2afaeef961ee78be92cfd5deb5 beginning to work on cry data diff -r 7998b1cf18cf -r 2873f50b7291 clojure/com/aurellem/gb/hxc.clj --- a/clojure/com/aurellem/gb/hxc.clj Sat Mar 31 00:41:28 2012 -0500 +++ b/clojure/com/aurellem/gb/hxc.clj Sat Mar 31 01:27:46 2012 -0500 @@ -208,6 +208,12 @@ +;; http://hax.iimarck.us/topic/581/ +(defn hxc-pokedex-cry + "The pokemon cry data in internal order. List begins at ROM@410B1 + [] + + (def hxc-items-raw "The hardcoded names of the items in memory. List begins at diff -r 7998b1cf18cf -r 2873f50b7291 clojure/com/aurellem/music/midi_util.clj --- a/clojure/com/aurellem/music/midi_util.clj Sat Mar 31 00:41:28 2012 -0500 +++ b/clojure/com/aurellem/music/midi_util.clj Sat Mar 31 01:27:46 2012 -0500 @@ -13,6 +13,7 @@ (:use (com.aurellem.gb saves util constants gb-driver vbm items assembly characters)) (:use (com.aurellem.run title)) (:use (com.aurellem.exp pokemon item-bridge)) + (:use (com.aurellem.world practice)) (:import [com.aurellem.gb.gb_driver SaveState])) @@ -29,12 +30,6 @@ -(def midi-play-file - "Plays the MIDI file at the given location. The MIDI file runs in -the current thread until it finishes or is cancelled." - (comp midi-play-seq midi-load)) - - (defn midi-play-seq "Plays the MIDI Sequence. The MIDI runs in the current thread until it finishes or is cancelled." @@ -56,6 +51,14 @@ (finally (.close song)))))) +(def midi-play-file + "Plays the MIDI file at the given location. The MIDI file runs in +the current thread until it finishes or is cancelled." + (comp midi-play-seq midi-load)) + + + + (defn midi-test-1 [] (-> (. (midi-load @@ -154,10 +157,18 @@ ;;(.add (midi-short 360 [-1 47 0])) ;; system reset = -1 sequence - ))) + )) - + + +(defn read-memory + ([mem start length] + (take length + (drop start + mem))) + ([start length] + (read-memory (rom(root)) start length))) ;;; ROM MUSIC MANIPULATION @@ -203,9 +214,6 @@ :trainer-girl 0x7C2EB :trainer-angry 0x7C2F4 }) - - - }) (defn low-high-format @@ -245,30 +253,30 @@ -(defn note? - "Does the given byte correspond to a note?" - [n] +;; (defn note? +;; "Does the given byte correspond to a note?" +;; [n]) -(defn parse-ops - "Consumes the list of opcodes, returning a runnable MIDI Sequence object." - [ops] - ( - (fn [midi ops] - (let [x (first ops)] - (cond (empty? ops) midi - (= x 0xDA) - ;; set tempo (high-low (nth ops 1)(nth ops 2)) - (recur (identity midi) (drop 3 ops)) +;; (comment defn parse-ops +;; "Consumes the list of opcodes, returning a runnable MIDI Sequence object." +;; [ops] +;; ( +;; (fn [midi ops] +;; (let [x (first ops)] +;; (cond (empty? ops) midi +;; (= x 0xDA) +;; ;; set tempo (high-low (nth ops 1)(nth ops 2)) +;; (recur (identity midi) (drop 3 ops)) - (note? x) +;; (note? x) - ) +;; ) - (doto (Sequence. (float 30) 15) ;; 30 fps, 15 frames per beat - (.createTrack)) - ops - )) +;; (doto (Sequence. (float 30) 15) ;; 30 fps, 15 frames per beat +;; (.createTrack)) +;; ops +;; ))))