Mercurial > vba-clojure
comparison org/rom.org @ 408:7116b3f51ba8
merge dylan's changes.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 13 Apr 2012 11:33:56 -0500 |
parents | 03ade2a04458 |
children | a2319e29205b |
comparison
equal
deleted
inserted
replaced
405:bca0abd39db5 | 408:7116b3f51ba8 |
---|---|
714 | 714 |
715 | 715 |
716 | 716 |
717 * Types | 717 * Types |
718 ** Names of types | 718 ** Names of types |
719 | |
720 *** COMMENT Pointers to type names | |
721 #+begin_src clojure :exports both :results output | |
722 (map (comp character-codes->str #(take-while (partial not= 80) (drop % (rom))) (partial + 0x20000) (partial apply low-high)) (partition 2 (take 54 (drop 0x27D63 (rom))))) | |
723 #+end_src | |
724 | |
725 | |
719 *** | 726 *** |
720 #+begin_src clojure :exports both :results output | 727 #+begin_src clojure :exports both :results output |
721 (ns com.aurellem.gb.hxc | 728 (ns com.aurellem.gb.hxc |
722 (:use (com.aurellem.gb assembly characters gb-driver util mem-util | 729 (:use (com.aurellem.gb assembly characters gb-driver util mem-util |
723 constants)) | 730 constants)) |
1064 | ROM address (hex) | Description | Format | Example | | 1071 | ROM address (hex) | Description | Format | Example | |
1065 |-------------------+-----------------+-----------------+-----------------| | 1072 |-------------------+-----------------+-----------------+-----------------| |
1066 | | <15> | <15> | <15> | | 1073 | | <15> | <15> | <15> | |
1067 | 0233C- | Shop inventories. | | | | 1074 | 0233C- | Shop inventories. | | | |
1068 | 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. | | 1075 | 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. | |
1069 | 045B7-0491E | Names of the items in memory. | Variable-length item names (strings of character codes). Names are separated by a single 0x80 character. | MASTER BALL#ULTRA BALL#... | | 1076 | 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#... | |
1070 | 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). | | 1077 | 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). | |
1071 | 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. | | 1078 | 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. | |
1072 | 06698- | ? Background music. | | | | 1079 | 06698- | ? Background music. | | | |
1073 | 0822E-082F? | Pointers to background music, part I. | | | | 1080 | 0822E-082F? | Pointers to background music, part I. | | | |
1074 | 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). | | 1081 | 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). | |
1079 |-------------------+-----------------+-----------------+-----------------| | 1086 |-------------------+-----------------+-----------------+-----------------| |
1080 | 0DD4D-DD72 | Names of permanent stats. | Variable-length strings separated by 0x50. | #HEALTH#ATTACK#DEFENSE#SPEED#SPECIAL# | | 1087 | 0DD4D-DD72 | Names of permanent stats. | Variable-length strings separated by 0x50. | #HEALTH#ATTACK#DEFENSE#SPEED#SPECIAL# | |
1081 | 1195C-1196A | The two terms for being able/unable to learn a TM/HM. | Variable-length strings separated by 0x50. | ABLE#NOT ABLE# | | 1088 | 1195C-1196A | The two terms for being able/unable to learn a TM/HM. | Variable-length strings separated by 0x50. | ABLE#NOT ABLE# | |
1082 | 119C0-119CE | The two terms for being able/unable to evolve using the current stone. | Variable-length strings separated by 0x50. | ABLE#NOT ABLE# | | 1089 | 119C0-119CE | The two terms for being able/unable to evolve using the current stone. | Variable-length strings separated by 0x50. | ABLE#NOT ABLE# | |
1083 | 1232D-12364 | Which moves are taught by the TMs and HMs | A list of 55 move ids (50 TMs, plus 5 HMs). First, the move that will be taught by TM01; second, the move that will be taught by TM02; and so on. The last five entries are the moves taught by HMs 1-5. (See also, BC000 below) | The first few entries are (5 13 14 18 ...) corresponding to Mega Punch (TM01), Razor Wind (TM02), Swords Dance (TM03), Whirlwind (TM04), ... | | 1090 | 1232D-12364 | Which moves are taught by the TMs and HMs | A list of 55 move ids (50 TMs, plus 5 HMs). First, the move that will be taught by TM01; second, the move that will be taught by TM02; and so on. The last five entries are the moves taught by HMs 1-5. (See also, BC000 below) | The first few entries are (5 13 14 18 ...) corresponding to Mega Punch (TM01), Razor Wind (TM02), Swords Dance (TM03), Whirlwind (TM04), ... | |
1084 | 27D99-27DFF | Names of the Pok\eacute{}mon types. | Variable-length type names (strings of character codes). Names are separated by a single 0x80 character. | NORMAL#FIGHTING#... | | 1091 |-------------------+-----------------+-----------------+-----------------| |
1085 | 27E77- | Trainer title names. | Variable-length names separated by 0x80. | YOUNGSTER#BUG CATCHER#LASS#... | | 1092 | 27D56 & 27D57. | Pointer to the list of type pointers. | | | |
1093 | 27D63-27D99 | Pointers to type names. | Each point is a low-byte, high-byte pair. The names of types follows immediately after this section; see below. | The first pointer is [0x99 0x7D], corresponding to the location 0x2.7D.99, the NORMAL type. | | |
1094 | 27D99-27DFF | Names of the Pok\eacute{}mon types. | Variable-length type names (strings of character codes). Names are separated by a single 0x50 character. | NORMAL#FIGHTING#... | | |
1095 | 27E77- | Trainer title names. | Variable-length names separated by 0x50. | YOUNGSTER#BUG CATCHER#LASS#... | | |
1086 | 34000- | | | | | 1096 | 34000- | | | | |
1087 | 38000-383DE | The basic properties and effects of moves. (165 moves total) | Fixed-length (6 byte) continguous descriptions (no separating character): move-index, move-effect, power, move-type, accuracy, pp. | The entry for Pound, the first attack in the list, is (1 0 40 0 255 35). See below for more explanation. | | 1097 | 38000-383DE | The basic properties and effects of moves. (165 moves total) | Fixed-length (6 byte) continguous descriptions (no separating character): move-index, move-effect, power, move-type, accuracy, pp. | The entry for Pound, the first attack in the list, is (1 0 40 0 255 35). See below for more explanation. | |
1088 | 383DE- | Species data for the Pokemon, listed in Pokedex order: Pokedex number; base moves; types; learnable TMs and HMs; base HP, attack, defense, speed, special; sprite data. | | | | 1098 | 383DE- | Species data for the Pokemon, listed in Pokedex order: Pokedex number; base moves; types; learnable TMs and HMs; base HP, attack, defense, speed, special; sprite data. | | | |
1089 | 39462- | The Pok\eacute{}mon cry data. | Fixed-length (3 byte) descriptions of cries. | | | 1099 | 39462- | The Pok\eacute{}mon cry data. | Fixed-length (3 byte) descriptions of cries. | | |
1090 | 3B1E5- | Pointers to evolution/learnset data. | | | | 1100 | 3B1E5- | Pointers to evolution/learnset data. | | | |
1094 | 5DE10-5DE30 | Abbreviations for status ailments. | Fixed-length strings, probably[fn::Here's something strange: all of the status messages start with 0x7F and end with 0x4F \mdash{}except PAR, which ends with 0x50.]. The last entry is QUIT##. | [0x7F] *SLP* [0x4E][0x7F] *PSN* [0x4E][0x7F] *PAR* [0x50][0x7F]... | | 1104 | 5DE10-5DE30 | Abbreviations for status ailments. | Fixed-length strings, probably[fn::Here's something strange: all of the status messages start with 0x7F and end with 0x4F \mdash{}except PAR, which ends with 0x50.]. The last entry is QUIT##. | [0x7F] *SLP* [0x4E][0x7F] *PSN* [0x4E][0x7F] *PAR* [0x50][0x7F]... | |
1095 | 71500- | Names of places. | | | | 1105 | 71500- | Names of places. | | | |
1096 | 7C249-7C2?? | Pointers to background music, pt II. | | | | 1106 | 7C249-7C2?? | Pointers to background music, pt II. | | | |
1097 | 98000- | Dialogue | | | | 1107 | 98000- | Dialogue | | | |
1098 | B8000- | The text of each Pokemon's Pok\eacute{}dex entry. | | | | 1108 | B8000- | The text of each Pokemon's Pok\eacute{}dex entry. | | | |
1099 | BC000-BC60E | Move names. | Variable-length move names, separated by 0x80. The moves are in internal order. | POUND#KARATE CHOP#DOUBLESLAP#COMET PUNCH#... | | 1109 | BC000-BC60E | Move names. | Variable-length move names, separated by 0x50. The moves are in internal order. | POUND#KARATE CHOP#DOUBLESLAP#COMET PUNCH#... | |
1100 | E8000-E876C | Names of the \ldquo{}190\rdquo{} species of Pok\eacute{}mon in memory. | Fixed length (10-letter) Pok\eacute{}mon names. Any extra space is padded with the character 0x80. The names are in \ldquo{}internal order\rdquo{}. | RHYDON####KANGASKHANNIDORAN♂#... | | 1110 | E8000-E876C | Names of the \ldquo{}190\rdquo{} species of Pok\eacute{}mon in memory. | Fixed length (10-letter) Pok\eacute{}mon names. Any extra space is padded with the character 0x80. The names are in \ldquo{}internal order\rdquo{}. | RHYDON####KANGASKHANNIDORAN♂#... | |
1101 | | | | | | 1111 | | | | | |
1102 | | | | | | 1112 | | | | | |
1103 | 1113 |
1104 | 1114 |
1583 reverse bit-list) | 1593 reverse bit-list) |
1584 | 1594 |
1585 (take 0xFFF (drop 0x8800 (memory state)))))) | 1595 (take 0xFFF (drop 0x8800 (memory state)))))) |
1586 | 1596 |
1587 | 1597 |
1598 (defn test-2 [] | |
1599 (loop [n 0 | |
1600 pc-1 (pc-trail (-> state-defend (tick) (step [:a]) (step [:a]) (step []) (nstep 100)) 100000) | |
1601 pc-2 (pc-trail (-> state-speed (tick) (step [:a]) (step [:a]) | |
1602 (step []) (nstep 100)) 100000)] | |
1603 (cond (empty? (drop n pc-1)) [pc-1 n] | |
1604 (not= (take 10 (drop n pc-1)) (take 10 pc-2)) | |
1605 (recur pc-1 pc-2 (inc n)) | |
1606 :else | |
1607 [(take 1000 pc-2) n]))) | |
1608 | |
1609 | |
1610 | |
1611 | |
1612 | |
1613 | |
1614 | |
1588 (comment | 1615 (comment |
1589 | 1616 |
1590 (def hxc-later | 1617 (def hxc-later |
1591 "Running this code produces, e.g. hardcoded names NPCs give | 1618 "Running this code produces, e.g. hardcoded names NPCs give |
1592 their pokemon. Will sort through it later." | 1619 their pokemon. Will sort through it later." |