changeset 473:9a7fae5afd8f

Fixed error with wild pokemon demographics; will need to alter the way hxc-wilds format of data returned by hxc-wilds to incorporate encounter rates.
author Dylan Holmes <ocsenave@gmail.com>
date Wed, 02 May 2012 20:32:45 -0500
parents 69d1787522c7
children 9a20581477c2
files org/rom.org
diffstat 1 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/org/rom.org	Wed May 02 19:52:06 2012 -0500
     1.2 +++ b/org/rom.org	Wed May 02 20:32:45 2012 -0500
     1.3 @@ -202,15 +202,15 @@
     1.4                 rating-special
     1.5                 type-1
     1.6                 type-2
     1.7 -               rarity
     1.8 -               rating-xp
     1.9 +               rarity ;; catch rate
    1.10 +               rating-xp ;; base exp yield
    1.11                 pic-dimensions ;; tile_width|tile_height (8px/tile)
    1.12                 ptr-pic-obverse-1
    1.13                 ptr-pic-obverse-2
    1.14                 ptr-pic-reverse-1
    1.15                 ptr-pic-reverse-2
    1.16 -               move-1
    1.17 -               move-2
    1.18 +               move-1 ;; attacks known at level 0 [i.e. by default]
    1.19 +               move-2 ;; (0 for none)
    1.20                 move-3
    1.21                 move-4
    1.22                 growth-rate
    1.23 @@ -1258,11 +1258,10 @@
    1.24  #+name: wilds
    1.25  #+begin_src clojure
    1.26  
    1.27 -
    1.28 -
    1.29 +;; 0x0489, relative to 0xCB95, points to 0xCD89.
    1.30  (defn hxc-ptrs-wild
    1.31    "A list of the hardcoded wild encounter data in memory. Pointers
    1.32 -  begin at ROM@0CB95; data begins at ROM@0x04D89" 
    1.33 +  begin at ROM@0CB95; data begins at ROM@0x0CD89" 
    1.34    ([] (hxc-ptrs-wild com.aurellem.gb.gb-driver/original-rom))
    1.35    ([rom]
    1.36       (let [ptrs
    1.37 @@ -1275,19 +1274,20 @@
    1.38  
    1.39  (defn hxc-wilds
    1.40    "A list of the hardcoded wild encounter data in memory. Pointers
    1.41 -  begin at ROM@0CB95; data begins at ROM@0x04D89" 
    1.42 +  begin at ROM@0CB95; data begins at ROM@0x0CD89" 
    1.43    ([] (hxc-wilds com.aurellem.gb.gb-driver/original-rom))
    1.44    ([rom]
    1.45       (let [pokenames (zipmap (range) (hxc-pokenames rom))]
    1.46         (map
    1.47 -        (partial map (fn [[a b]] {:species (pokenames (dec b)) :level
    1.48 -                                  a}))
    1.49 -        (partition 10
    1.50 -                     
    1.51 -                      (take-while (comp (partial not= 1)
    1.52 -                                        first) 
    1.53 -                                 (partition 2
    1.54 -                                            (drop 0xCD8C rom))
    1.55 +        (partial map 
    1.56 +                 (fn [[a b]]
    1.57 +                   {:species (pokenames (dec b))
    1.58 +                    :level a}))
    1.59 +        (partition 10  
    1.60 +                   (take-while
    1.61 +                    (comp (partial not= 1) first) 
    1.62 +                    (partition 2
    1.63 +                               (drop 0xCD8C rom))
    1.64                     
    1.65                     ))))))
    1.66  
    1.67 @@ -1413,7 +1413,6 @@
    1.68  | 04495-                | Prices of items. | Each price is two bytes of binary-coded decimal. Prices are separated by zeroes. Priceless items[fn::Like the Pok\eacute{}dex and other unsellable items.] are given a price of zero. | The cost of lemonade is 0x03 0x50, which translates to a price of ₱350. |
    1.69  | 04524-04527           | (unconfirmed) possibly the bike price in Cerulean. |                 |                 |
    1.70  | 045B7-0491E           | Names of the items in memory. | Variable-length item names (strings of character codes). Names are separated by a single 0x50 character. | MASTER BALL#ULTRA BALL#... |
    1.71 -| 04D89-                | Lists of wild Pok\eacute{}mon to encounter in each region. | Each list contains ten Pokemon (ids) and their levels; twenty bytes in total. First, the level of the first Pokemon. Then the internal id of the first Pokemon. Next, the level of the second Pokemon, and so on. Since Pokemon cannot have level 0, the lists are separated by a pair 0 /X/, where /X/ is an apparently random Pokemon id. | The first list is (3 36 4 36 2 165 3 165 2 36 3 36 5 36 4 165 6 36 7 36 0 25), i.e. level 3 pidgey, level 4 pidgey, level 2 rattata, level 3 rattata, level 2 pidgey, level 3 pidgey, level 5 pidgey, level 4 rattata, level 6 pidgey, level 7 pidgey, \ldquo{}level 0 gastly\rdquo{} (i.e., end-of-list). |
    1.72  |-----------------------+-----------------+-----------------+-----------------|
    1.73  | 05DD2-05DF2           | Menu text for player info. |                 | PLAYER [newline] BADGES [nelwine] POK\Eacute{}DEX [newline] TIME [0x50] |
    1.74  | 05EDB.                | Which Pok\eacute{}mon to show during Prof. Oak's introduction. | A single byte, the Pok\eacute{}mon's internal id. | In Pok\eacute{}mon Yellow, it shows Pikachu during the introduction; Pikachu's internal id is 0x54. |
    1.75 @@ -1425,7 +1424,8 @@
    1.76  | 7635-                 | Menu options for selected Pok\eacute{}mon (Includes names of out-of-battle moves). | Variable-length strings separated by 0x50. | CUT [0x50] FLY [0x50] SURF [0x50] STRENGTH [0x50] FLASH [0x50] DIG [0x50] TELEPORT [0x50] SOFTBOILED [0x50] STATS [newline] SWITCH [newline] CANCEL [0x50] |
    1.77  | 7AF0-8000             | (empty space)   |                 | 0 0 0 0 0 ...   |
    1.78  | 0822E-082F?           | Pointers to background music, part I. |                 |                 |
    1.79 -| 0CB95-                | Pointers to lists of wild pokemon to encounter in each region. These lists begin at 04D89, see above. | Each pointer is a low-byte, high-byte pair. | The first entry is 0x89 0x4D, corresponding to the address 0x4D89, the location of the first list of wild Pok\eacute{}mon (see 04D89, above). |
    1.80 +| 0CB95-                | Pointers to lists of wild pokemon to encounter in each region. These lists begin at 04D89, see above. | Each pointer is a low-byte, high-byte pair. | The first entry is 0x89 0x4D, corresponding to the address 0x4D89 relative to this memory bank, i.e. absolute address 0xCD89, the location of the first list of wild Pok\eacute{}mon. (For details on pointer addresses, see the relevant appendix.) |
    1.81 +| 0CD89-                | Lists of wild Pok\eacute{}mon to encounter in each region. | Lists of 12 bytes. First, an encounter rate[fn::I suspect this is an amount out of 256.]. Next, ten alternating Pok\eacute{}mon/level pairs. Each list ends with 0x00. If the encounter rate is zero, the list ends immediately. | The first nonempty list (located at ROM@0CD8B) is (25; 3 36 4 36 2 165 3 165 2 36 3 36 5 36 4 165 6 36 7 36; 0), i.e. 25 encounter rate; level 3 pidgey, level 4 pidgey, level 2 rattata, level 3 rattata, level 2 pidgey, level 3 pidgey, level 5 pidgey, level 4 rattata, level 6 pidgey, level 7 pidgey, 0 (i.e., end-of-list). |
    1.82  |-----------------------+-----------------+-----------------+-----------------|
    1.83  | 0DACB.                | Amount of HP restored by Soda Pop | The HP consists of a single numerical byte. | 60              |
    1.84  | 0DACF.                | Amount of HP restored by Lemonade | "               | 80              |