# HG changeset patch # User Robert McIntyre # Date 1346600054 18000 # Node ID c8cda378e1a09f669d31e0a8c4bc80e2f580e760 # Parent b3e5006e23f05c4f4f5045786c2fba2909c3d1fa fixed flaw in advanced move recording. diff -r b3e5006e23f0 -r c8cda378e1a0 clojure/com/aurellem/gb/vbm.clj --- a/clojure/com/aurellem/gb/vbm.clj Sun Sep 02 09:33:40 2012 -0500 +++ b/clojure/com/aurellem/gb/vbm.clj Sun Sep 02 10:34:14 2012 -0500 @@ -111,6 +111,9 @@ (clojure.java.io/copy (buttons->vbm-bytes moves) target) target)) +(defn write-moves-to-file! [moves file] + (clojure.java.io/copy (buttons->vbm-bytes moves) file)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;; (use 'clojure.java.shell) diff -r b3e5006e23f0 -r c8cda378e1a0 clojure/com/aurellem/run/adv_choreo.clj --- a/clojure/com/aurellem/run/adv_choreo.clj Sun Sep 02 09:33:40 2012 -0500 +++ b/clojure/com/aurellem/run/adv_choreo.clj Sun Sep 02 10:34:14 2012 -0500 @@ -303,7 +303,7 @@ (+ (count init) start-address)))])] (concat init header glyph-display state-machine return-to-header))) -(defn begin-glyph-bootstrap +(defn-memo begin-glyph-bootstrap ([] (begin-glyph-bootstrap (launch-main-bootstrap-program))) ([script] (let [glyph-init (glyph-init-program relocated-bootstrap-start) @@ -322,19 +322,20 @@ (transfer-control relocated-bootstrap-start) (do-nothing 1))))) -(defn write-all-program-data +(defn-memo write-all-program-data ([] (write-all-program-data (begin-glyph-bootstrap))) ([script] (let [base-address main-program-base-address] (->> script (write-RAM base-address (program-data base-address)))))) -(defn activate-program +(defn-memo activate-program ([] (activate-program (write-all-program-data))) ([script] (->> script (transfer-control main-program-base-address) - (do-nothing 1800)))) + (do-nothing 1800) + (play-moves [[:a]])))) (def advanced-render-dir (File. user-home "proj/vba-clojure/render/advanced")) @@ -399,7 +400,7 @@ move-images screenshots targets)))) (defn write-advanced-script! - [] (write-script! (launch-bootstrap-program) "advanced")) + [] (write-script! (activate-program) "advanced")) (defn advanced-script [] (read-script "advanced")) diff -r b3e5006e23f0 -r c8cda378e1a0 clojure/com/aurellem/run/bootstrap_1.clj --- a/clojure/com/aurellem/run/bootstrap_1.clj Sun Sep 02 09:33:40 2012 -0500 +++ b/clojure/com/aurellem/run/bootstrap_1.clj Sun Sep 02 10:34:14 2012 -0500 @@ -150,7 +150,7 @@ (map second (filter (comp (partial = 0) first) (partition 2 (pc-item-writer-program))))) -(defn bootstrap-corrupt-save +(defn-memo bootstrap-corrupt-save ([] (bootstrap-corrupt-save (to-room-pc))) ([script] (->> script @@ -198,7 +198,7 @@ ;;2 -- 254 ;;3 -- 255 -(defn activate-home-pc +(defn-memo activate-home-pc [script] (->> script (delayed-difference [] [:a] @@ -560,7 +560,7 @@ (deposit-held-item-named :TM09 55) (deposit-held-item-named 0x00 55)))) -(defn hacking-2 +(defn-memo hacking-2 ([] (hacking-2 (hacking-1))) ([script] (->> script @@ -809,7 +809,7 @@ (pc-item-writer-program)))]) -(defn launch-main-bootstrap-program +(defn-memo launch-main-bootstrap-program ([] (launch-main-bootstrap-program ;;(control-checkpoint) (launch-bootstrap-program) diff -r b3e5006e23f0 -r c8cda378e1a0 clojure/com/aurellem/run/final_cut.clj --- a/clojure/com/aurellem/run/final_cut.clj Sun Sep 02 09:33:40 2012 -0500 +++ b/clojure/com/aurellem/run/final_cut.clj Sun Sep 02 10:34:14 2012 -0500 @@ -22,7 +22,7 @@ render-ram-map? initial-state moves] - (write-moves! moves (File. target-dir "rlm-yellow-hack.vbm")) + (write-moves-to-file! moves (File. target-dir "rlm-yellow-hack.vbm")) (let [ram-map-dir (File. target-dir "ram-map") frames-dir (File. target-dir "frames") moves-dir (File. target-dir "moves")