# HG changeset patch # User Robert McIntyre # Date 1333149254 18000 # Node ID 4a0dbaed7078983029622c94ad56c1694d23935f # Parent c8b0db518de3dd92ea1239119557f82425259981 preliminary idea for a better pre-bootstrapping program. diff -r c8b0db518de3 -r 4a0dbaed7078 clojure/com/aurellem/exp/notes.txt --- a/clojure/com/aurellem/exp/notes.txt Thu Mar 29 18:23:20 2012 -0500 +++ b/clojure/com/aurellem/exp/notes.txt Fri Mar 30 18:14:14 2012 -0500 @@ -73,6 +73,42 @@ +[repeat 35 times] +0xFF +0x01 +[end repeat] + + +;;; program to swap item ID and quantity at fixed address. +;; here target is equal to rival's thrid and fourth character + + +0x00 +0x21 ;; load target into HL + +third rival's name character +xD5 -- target item address + +0x00 +0x2A ;; save (HL)=(target) to A, increment HL + +0x00 +0x78 ;; save A to B + +0x00 +0x3A ;; save (target+1) to A, decrement HL + +0x00 +0x22 ;; save A to target, increment HL [(target+1) -> target] + +0x00 +0x78 ;; load B to A + +0x00 +0x77 ;; load A into target+1 [(target) -> target+1] + + + @@ -84,8 +120,3 @@ 0xD31D - 0xD41B --OR-- 0xD53A - 0XD59C - - - - - diff -r c8b0db518de3 -r 4a0dbaed7078 clojure/com/aurellem/run/bootstrap_0.clj --- a/clojure/com/aurellem/run/bootstrap_0.clj Thu Mar 29 18:23:20 2012 -0500 +++ b/clojure/com/aurellem/run/bootstrap_0.clj Fri Mar 30 18:14:14 2012 -0500 @@ -723,15 +723,6 @@ (menu [[:d] [:a]]) (do-nothing 40)))) -(defn deposit-one-item - [script] - (->> script - (do-nothing 100) - (play-moves [[:a]]) - (do-nothing 80) - (play-moves [[:a]]) - (scroll-text) - )) (defn multiple-times ([n command args script] @@ -742,13 +733,27 @@ ([n command script] (multiple-times n command [] script))) -(defn create-header +(defn deposit-n-items + [n script] + (->> script + (do-nothing 100) + (play-moves [[:a]]) + (do-nothing 80) + (multiple-times + (dec n) + (fn [script] + (->> script + (play-moves [[:u]]) + (do-nothing 1)))) + (play-moves [[:a]]) + (scroll-text))) + + +(defn-memo create-header ([] (create-header (begin-deposits))) ([script] (->> script - (multiple-times 34 deposit-one-item) - ;;(deposit-one-item) - ;;(deposit-one-item) + (multiple-times 33 deposit-one-item) (do-nothing 1))))