comparison org/rom.org @ 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
comparison
equal deleted inserted replaced
472:69d1787522c7 473:9a7fae5afd8f
200 rating-def 200 rating-def
201 rating-speed 201 rating-speed
202 rating-special 202 rating-special
203 type-1 203 type-1
204 type-2 204 type-2
205 rarity 205 rarity ;; catch rate
206 rating-xp 206 rating-xp ;; base exp yield
207 pic-dimensions ;; tile_width|tile_height (8px/tile) 207 pic-dimensions ;; tile_width|tile_height (8px/tile)
208 ptr-pic-obverse-1 208 ptr-pic-obverse-1
209 ptr-pic-obverse-2 209 ptr-pic-obverse-2
210 ptr-pic-reverse-1 210 ptr-pic-reverse-1
211 ptr-pic-reverse-2 211 ptr-pic-reverse-2
212 move-1 212 move-1 ;; attacks known at level 0 [i.e. by default]
213 move-2 213 move-2 ;; (0 for none)
214 move-3 214 move-3
215 move-4 215 move-4
216 growth-rate 216 growth-rate
217 & 217 &
218 TMs|HMs]] 218 TMs|HMs]]
1256 1256
1257 ** Wild Pok\eacute{}mon demographics 1257 ** Wild Pok\eacute{}mon demographics
1258 #+name: wilds 1258 #+name: wilds
1259 #+begin_src clojure 1259 #+begin_src clojure
1260 1260
1261 1261 ;; 0x0489, relative to 0xCB95, points to 0xCD89.
1262
1263 (defn hxc-ptrs-wild 1262 (defn hxc-ptrs-wild
1264 "A list of the hardcoded wild encounter data in memory. Pointers 1263 "A list of the hardcoded wild encounter data in memory. Pointers
1265 begin at ROM@0CB95; data begins at ROM@0x04D89" 1264 begin at ROM@0CB95; data begins at ROM@0x0CD89"
1266 ([] (hxc-ptrs-wild com.aurellem.gb.gb-driver/original-rom)) 1265 ([] (hxc-ptrs-wild com.aurellem.gb.gb-driver/original-rom))
1267 ([rom] 1266 ([rom]
1268 (let [ptrs 1267 (let [ptrs
1269 (map (fn [[a b]] (+ a (* 0x100 b))) 1268 (map (fn [[a b]] (+ a (* 0x100 b)))
1270 (take-while (partial not= (list 0xFF 0xFF)) 1269 (take-while (partial not= (list 0xFF 0xFF))
1273 1272
1274 1273
1275 1274
1276 (defn hxc-wilds 1275 (defn hxc-wilds
1277 "A list of the hardcoded wild encounter data in memory. Pointers 1276 "A list of the hardcoded wild encounter data in memory. Pointers
1278 begin at ROM@0CB95; data begins at ROM@0x04D89" 1277 begin at ROM@0CB95; data begins at ROM@0x0CD89"
1279 ([] (hxc-wilds com.aurellem.gb.gb-driver/original-rom)) 1278 ([] (hxc-wilds com.aurellem.gb.gb-driver/original-rom))
1280 ([rom] 1279 ([rom]
1281 (let [pokenames (zipmap (range) (hxc-pokenames rom))] 1280 (let [pokenames (zipmap (range) (hxc-pokenames rom))]
1282 (map 1281 (map
1283 (partial map (fn [[a b]] {:species (pokenames (dec b)) :level 1282 (partial map
1284 a})) 1283 (fn [[a b]]
1285 (partition 10 1284 {:species (pokenames (dec b))
1286 1285 :level a}))
1287 (take-while (comp (partial not= 1) 1286 (partition 10
1288 first) 1287 (take-while
1289 (partition 2 1288 (comp (partial not= 1) first)
1290 (drop 0xCD8C rom)) 1289 (partition 2
1290 (drop 0xCD8C rom))
1291 1291
1292 )))))) 1292 ))))))
1293 1293
1294 #+end_src 1294 #+end_src
1295 1295
1411 | 03E59- | Start of the Give-Pok\eacute{}mon script. | Assembly. When called, converts the contents of register BC into a Pok\eacute{}mon: (B) is the level; (C) is the species. | | 1411 | 03E59- | Start of the Give-Pok\eacute{}mon script. | Assembly. When called, converts the contents of register BC into a Pok\eacute{}mon: (B) is the level; (C) is the species. | |
1412 | 03E3F- | Start of the give-item script. | Assembly. When called, converts the contents of register BC into an item: (B) is the item type; (C) is the quantity. | | 1412 | 03E3F- | Start of the give-item script. | Assembly. When called, converts the contents of register BC into an item: (B) is the item type; (C) is the quantity. | |
1413 | 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. | 1413 | 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. |
1414 | 04524-04527 | (unconfirmed) possibly the bike price in Cerulean. | | | 1414 | 04524-04527 | (unconfirmed) possibly the bike price in Cerulean. | | |
1415 | 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#... | 1415 | 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#... |
1416 | 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). |
1417 |-----------------------+-----------------+-----------------+-----------------| 1416 |-----------------------+-----------------+-----------------+-----------------|
1418 | 05DD2-05DF2 | Menu text for player info. | | PLAYER [newline] BADGES [nelwine] POK\Eacute{}DEX [newline] TIME [0x50] | 1417 | 05DD2-05DF2 | Menu text for player info. | | PLAYER [newline] BADGES [nelwine] POK\Eacute{}DEX [newline] TIME [0x50] |
1419 | 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. | 1418 | 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. |
1420 | 06698- | ? Background music. | | | 1419 | 06698- | ? Background music. | | |
1421 |-----------------------+-----------------+-----------------+-----------------| 1420 |-----------------------+-----------------+-----------------+-----------------|
1423 | 7570-757D | Menu options for trading Pok\eacute{}mon | | TRADE [newline] CANCEL [0x50] | 1422 | 7570-757D | Menu options for trading Pok\eacute{}mon | | TRADE [newline] CANCEL [0x50] |
1424 | 757D-758A | Menu options for healing Pok\eacute{}mon | | HEAL [newline] CANCEL [0x50] | 1423 | 757D-758A | Menu options for healing Pok\eacute{}mon | | HEAL [newline] CANCEL [0x50] |
1425 | 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] | 1424 | 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] |
1426 | 7AF0-8000 | (empty space) | | 0 0 0 0 0 ... | 1425 | 7AF0-8000 | (empty space) | | 0 0 0 0 0 ... |
1427 | 0822E-082F? | Pointers to background music, part I. | | | 1426 | 0822E-082F? | Pointers to background music, part I. | | |
1428 | 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). | 1427 | 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.) |
1428 | 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). |
1429 |-----------------------+-----------------+-----------------+-----------------| 1429 |-----------------------+-----------------+-----------------+-----------------|
1430 | 0DACB. | Amount of HP restored by Soda Pop | The HP consists of a single numerical byte. | 60 | 1430 | 0DACB. | Amount of HP restored by Soda Pop | The HP consists of a single numerical byte. | 60 |
1431 | 0DACF. | Amount of HP restored by Lemonade | " | 80 | 1431 | 0DACF. | Amount of HP restored by Lemonade | " | 80 |
1432 | 0DAD5. | Amount of HP restored by Fresh Water | " | 50 | 1432 | 0DAD5. | Amount of HP restored by Fresh Water | " | 50 |
1433 | 0DADB. | Amount of HP restored by Hyper Potion. | " | 200 | 1433 | 0DADB. | Amount of HP restored by Hyper Potion. | " | 200 |