# HG changeset patch # User Robert McIntyre # Date 1334394591 18000 # Node ID f2f1e0b8c1c79dac08b4fe33f2cd525dcd3e3204 # Parent 0162dd315814fc31dbb7b78bb7f3e140cd3ced71 saving progress before debugging. diff -r 0162dd315814 -r f2f1e0b8c1c7 clojure/com/aurellem/gb/rlm_assembly.clj --- a/clojure/com/aurellem/gb/rlm_assembly.clj Sat Apr 14 03:22:10 2012 -0500 +++ b/clojure/com/aurellem/gb/rlm_assembly.clj Sat Apr 14 04:09:51 2012 -0500 @@ -483,14 +483,9 @@ (concat (repeat 50 (- 15 (first nybbles))) - [(first nybbles)])) - tail (map buttons - (take - (- 201 (count moves)) - (interleave (repeat 100 (last nybbles)) - (repeat 1000 (- 15 (last nybbles))))))] + [(first nybbles)]))] (assert (no-consecutive-repeats? nybbles)) - (concat header moves tail))) + (concat header moves))) ;;;;;; TESTS ;;;;;; diff -r 0162dd315814 -r f2f1e0b8c1c7 clojure/com/aurellem/run/bootstrap_1.clj --- a/clojure/com/aurellem/run/bootstrap_1.clj Sat Apr 14 03:22:10 2012 -0500 +++ b/clojure/com/aurellem/run/bootstrap_1.clj Sat Apr 14 04:09:51 2012 -0500 @@ -6,6 +6,7 @@ (:use (com.aurellem.exp item-bridge)) (:import [com.aurellem.gb.gb_driver SaveState])) +(def hex #(printf "0x%02X\n" %)) (defn print-desired-item-layout [] (clojure.pprint/pprint @@ -778,7 +779,7 @@ 0xD162 (+ 0xD162 (count pattern))) pattern)))) -(defn-memo launch-main-bootstrap-program +(defn launch-main-bootstrap-program ([] (launch-main-bootstrap-program (control-checkpoint) ;;(launch-bootstrap-program) @@ -786,8 +787,19 @@ ([script] (->> script (play-moves - (bootstrap-pattern (main-bootstrap-program)))))) + (bootstrap-pattern (main-bootstrap-program))) + (play-moves + (take 263 (interleave (repeat 1000 [:b]) + (repeat 1000 []))))))) +(defn test-main-bootstrap-integrety + [] + (assert + (= (main-bootstrap-program) + (subvec (vec (memory (second (launch-main-bootstrap-program)))) + pokemon-list-start + (+ pokemon-list-start (count (main-bootstrap-program))))))) + (defn set-target-address "Assumes that the game is under control of the main-bootstrap program in MODE-SELECT mode, and sets the target address to which @@ -818,18 +830,17 @@ (set-target-address target-address) (play-moves [(buttons jump-mode)]))) -(defn-memo relocate-main-bootstrap +(defn relocate-main-bootstrap ([] (relocate-main-bootstrap (launch-main-bootstrap-program))) ([script] (let [target (+ 90 pokemon-box-1-address)] (->> script - (write-RAM target (main-bootstrap-program target)) - (transfer-control target))))) + (do-nothing 500))))) (def mid-game-data (subvec (vec (memory (mid-game))) pokemon-list-start - (+ pokemon-list-start 700))) + (+ pokemon-list-start 100))) (def mid-game-map-address 0x46BC) @@ -837,8 +848,9 @@ ([] (set-mid-game-data (relocate-main-bootstrap))) ([script] (->> script - (write-RAM pokemon-list-start mid-game-data) - (transfer-control mid-game-map-address)))) + (do-nothing 10) + (write-RAM pokemon-list-start mid-game-data)))) +