changeset 230:fe26776e1a58

working on map memory, modified view-memory to output hex and decimal as well as binary
author Robert McIntyre <rlm@mit.edu>
date Sat, 24 Mar 2012 14:42:34 -0500
parents 30f4fc9b1747
children ecdbfa1fc51f
files clojure/com/aurellem/exp/cartography clojure/com/aurellem/gb/transit.clj clojure/com/aurellem/gb/util.clj
diffstat 3 files changed, 37 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/exp/cartography	Sat Mar 24 13:22:52 2012 -0500
     1.2 +++ b/clojure/com/aurellem/exp/cartography	Sat Mar 24 14:42:34 2012 -0500
     1.3 @@ -515,7 +515,7 @@
     1.4  D364                   
     1.5  D365                   
     1.6  D366                   
     1.7 -D367                   Transit Flag (fly, dig, teleport, etc.)
     1.8 +D367                   
     1.9  D368                   
    1.10  D369                   
    1.11  D36A                   
     2.1 --- a/clojure/com/aurellem/gb/transit.clj	Sat Mar 24 13:22:52 2012 -0500
     2.2 +++ b/clojure/com/aurellem/gb/transit.clj	Sat Mar 24 14:42:34 2012 -0500
     2.3 @@ -8,7 +8,7 @@
     2.4  
     2.5  0xD367 = 00000110 ;; inside-building
     2.6  
     2.7 -0xD367 = 00001001 ;; wilderness
     2.8 +0xD367 = 00001001 ;; wilderness outside Celadon
     2.9  
    2.10  0xD367 = 00010010 ;; inside cave
    2.11  
    2.12 @@ -18,3 +18,35 @@
    2.13  
    2.14  0xD367 = 00110110 ;; fishing peer waters edge
    2.15  
    2.16 +0xD367 = 00110110 ;; in battle at fishing peer
    2.17 +
    2.18 +0xD367 = 00010010 ;; at Cerulean
    2.19 +
    2.20 +;; setting it to zero does not affect teleport
    2.21 +;; setting it to 0xFF does not affect teleport
    2.22 +;; conclusion -- 0xD367 is position related but does not control
    2.23 +;; transit moves/items
    2.24 +
    2.25 +
    2.26 +;; try the same with 0xD366
    2.27 +
    2.28 +0xD366 = 00000000 ;; at Cerulean
    2.29 +0xD366 = 00010001 ;; in Rock Tunnel
    2.30 +0xD366 = 00001111 ;; in poke tower floor 1
    2.31 +0xD366 = 00000110 ;; in poke center
    2.32 +
    2.33 +;; 0xFF disables fly, dig, teleport, rope
    2.34 +;; 0x00 enables fly, teleport, disables dig, rope
    2.35 +
    2.36 +;; in cereluan
    2.37 +;; set to 00000100 disables doors, ledges, fly, teleport
    2.38 +;; set to 00000010 disables doors, ledges, fly, teleport
    2.39 +
    2.40 +;; in poke-center
    2.41 +;; set to 00000010 disables fly, teleport, dig, rope
    2.42 +;; set to 00000100 disables fly, teleport, dig, rope
    2.43 +;; set to 00000000 enables fly, teleport
    2.44 +;; set to 00010001 changes colormap to brown,
    2.45 +;;                 enables rope, dig
    2.46 +;;                 disables fly, teleport 
    2.47 +
     3.1 --- a/clojure/com/aurellem/gb/util.clj	Sat Mar 24 13:22:52 2012 -0500
     3.2 +++ b/clojure/com/aurellem/gb/util.clj	Sat Mar 24 14:42:34 2012 -0500
     3.3 @@ -36,8 +36,9 @@
     3.4  
     3.5  (defn view-memory
     3.6    ([^SaveState state mem]
     3.7 -     (println (format "mem 0x%04X = %s" mem
     3.8 -                      (binary-str (aget (memory state) mem))))
     3.9 +     (let [val (aget (memory state) mem)]
    3.10 +       (println (format "0x%04X = %s 0x%02X %d" mem
    3.11 +                        (binary-str val) val val)))
    3.12       state)
    3.13    ([mem]
    3.14       (view-memory @current-state mem)))