changeset 293:4a0dbaed7078

preliminary idea for a better pre-bootstrapping program.
author Robert McIntyre <rlm@mit.edu>
date Fri, 30 Mar 2012 18:14:14 -0500
parents c8b0db518de3
children 9f466a332448
files clojure/com/aurellem/exp/notes.txt clojure/com/aurellem/run/bootstrap_0.clj
diffstat 2 files changed, 54 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/exp/notes.txt	Thu Mar 29 18:23:20 2012 -0500
     1.2 +++ b/clojure/com/aurellem/exp/notes.txt	Fri Mar 30 18:14:14 2012 -0500
     1.3 @@ -73,6 +73,42 @@
     1.4  
     1.5  
     1.6  
     1.7 +[repeat 35 times]
     1.8 +0xFF
     1.9 +0x01
    1.10 +[end repeat]
    1.11 +
    1.12 +
    1.13 +;;; program to swap item ID and quantity at fixed address.
    1.14 +;; here target is equal to rival's thrid and fourth character
    1.15 +
    1.16 +
    1.17 +0x00
    1.18 +0x21  ;; load target into HL
    1.19 +
    1.20 +third rival's name character
    1.21 +xD5           -- target item address
    1.22 +
    1.23 +0x00
    1.24 +0x2A  ;; save (HL)=(target) to A, increment HL
    1.25 +
    1.26 +0x00
    1.27 +0x78  ;; save A to B
    1.28 +
    1.29 +0x00
    1.30 +0x3A  ;; save (target+1) to A, decrement HL
    1.31 +
    1.32 +0x00
    1.33 +0x22  ;; save A to target, increment HL [(target+1) -> target]
    1.34 +
    1.35 +0x00
    1.36 +0x78  ;; load B to A
    1.37 +
    1.38 +0x00
    1.39 +0x77  ;; load A into target+1 [(target) -> target+1]
    1.40 +
    1.41 +
    1.42 +
    1.43  
    1.44  
    1.45  
    1.46 @@ -84,8 +120,3 @@
    1.47  0xD31D - 0xD41B
    1.48       --OR--
    1.49  0xD53A - 0XD59C
    1.50 -
    1.51 -
    1.52 -
    1.53 -
    1.54 -
     2.1 --- a/clojure/com/aurellem/run/bootstrap_0.clj	Thu Mar 29 18:23:20 2012 -0500
     2.2 +++ b/clojure/com/aurellem/run/bootstrap_0.clj	Fri Mar 30 18:14:14 2012 -0500
     2.3 @@ -723,15 +723,6 @@
     2.4            (menu [[:d] [:a]])
     2.5            (do-nothing 40))))
     2.6  
     2.7 -(defn deposit-one-item
     2.8 -  [script]
     2.9 -  (->> script
    2.10 -       (do-nothing 100)
    2.11 -       (play-moves [[:a]])
    2.12 -       (do-nothing 80)
    2.13 -       (play-moves [[:a]])
    2.14 -       (scroll-text)
    2.15 -       ))
    2.16  
    2.17  (defn multiple-times
    2.18    ([n command args script]
    2.19 @@ -742,13 +733,27 @@
    2.20    ([n command script]
    2.21       (multiple-times n command [] script)))
    2.22  
    2.23 -(defn create-header
    2.24 +(defn deposit-n-items
    2.25 +  [n script]
    2.26 +  (->> script
    2.27 +       (do-nothing 100)
    2.28 +       (play-moves [[:a]])
    2.29 +       (do-nothing 80)
    2.30 +       (multiple-times
    2.31 +        (dec n)
    2.32 +        (fn [script]
    2.33 +          (->> script
    2.34 +               (play-moves [[:u]])
    2.35 +               (do-nothing 1))))
    2.36 +       (play-moves [[:a]])
    2.37 +       (scroll-text)))
    2.38 +      
    2.39 +
    2.40 +(defn-memo create-header
    2.41    ([] (create-header (begin-deposits)))
    2.42    ([script]
    2.43       (->> script
    2.44 -          (multiple-times 34 deposit-one-item)
    2.45 -          ;;(deposit-one-item)
    2.46 -          ;;(deposit-one-item)
    2.47 +          (multiple-times 33 deposit-one-item)
    2.48            (do-nothing 1))))
    2.49    
    2.50