comparison org/rom.org @ 374:143a2dfb3177

merge
author Robert McIntyre <rlm@mit.edu>
date Tue, 10 Apr 2012 06:56:07 -0500
parents a6f212ae29a3
children 8eb674700f15
comparison
equal deleted inserted replaced
369:abcc522a3242 374:143a2dfb3177
73 73
74 *** See the data 74 *** See the data
75 75
76 Here you can see the raw data in three stages: in the first stage, we 76 Here you can see the raw data in three stages: in the first stage, we
77 just grab the first few bytes starting from position 0xE8000. In the 77 just grab the first few bytes starting from position 0xE8000. In the
78 second stage, we partition it into ten-letter chunks to show you 78 second stage, we partition the bytes into ten-letter chunks to show you
79 where the names begin and end. In the final stage, we convert each 79 where the names begin and end. In the final stage, we convert each
80 byte into the letter it represents using the =character-codes->str= 80 byte into the letter it represents using the =character-codes->str=
81 function. (0x50 is rendered as the symbol \ldquo{} =#= \rdquo{} for 81 function. (0x50 is rendered as the symbol \ldquo{} =#= \rdquo{} for
82 ease of reading). 82 ease of reading).
83 83
84 #+begin_src clojure :exports both :cache no :results output 84 #+begin_src clojure :exports both :cache no :results output
85 (ns com.aurellem.gb.hxc 85 (ns com.aurellem.gb.hxc
86 (:use (com.aurellem.gb assembly characters gb-driver util mem-util 86 (:use (com.aurellem.gb assembly characters gb-driver util mem-util
87 constants)) 87 constants))
88 (:import [com.aurellem.gb.gb_driver SaveState])) 88 (:import [com.aurellem.gb.gb_driver SaveState]))
89
89 90
90 (println (take 100 (drop 0xE8000 (rom)))) 91 (println (take 100 (drop 0xE8000 (rom))))
91 92
92 (println (partition 10 (take 100 (drop 0xE8000 (rom))))) 93 (println (partition 10 (take 100 (drop 0xE8000 (rom)))))
93 94
155 #+begin_src clojure 156 #+begin_src clojure
156 (defn hxc-pokemon-base 157 (defn hxc-pokemon-base
157 ([] (hxc-pokemon-base com.aurellem.gb.gb-driver/original-rom)) 158 ([] (hxc-pokemon-base com.aurellem.gb.gb-driver/original-rom))
158 ([rom] 159 ([rom]
159 (let [entry-size 28 160 (let [entry-size 28
160 pkmn-count (count (hxc-pokedex-text rom)) 161
161 pokemon (rest (hxc-pokedex-names)) 162 pokemon (rest (hxc-pokedex-names))
163 pkmn-count (inc(count pokemon))
162 types (apply assoc {} 164 types (apply assoc {}
163 (interleave 165 (interleave
164 (range) 166 (range)
165 pkmn-types)) ;;!! softcoded 167 pkmn-types)) ;;!! softcoded
166 moves (apply assoc {} 168 moves (apply assoc {}
555 ** COMMENT Names of permanent stats 557 ** COMMENT Names of permanent stats
556 0DD4D-DD72 558 0DD4D-DD72
557 559
558 * Items 560 * Items
559 ** Item names 561 ** Item names
562
563 *** See the data
564 #+begin_src clojure :exports both :results output
565 (ns com.aurellem.gb.hxc
566 (:use (com.aurellem.gb assembly characters gb-driver util mem-util
567 constants))
568 (:import [com.aurellem.gb.gb_driver SaveState]))
569
570 (println (take 100 (drop 0x045B7 (rom))))
571
572 (println
573 (partition-by
574 (partial = 0x50)
575 (take 100 (drop 0x045B7 (rom)))))
576
577 (println
578 (map character-codes->str
579 (partition-by
580 (partial = 0x50)
581 (take 100 (drop 0x045B7 (rom))))))
582
583
584 #+end_src
585
586 #+results:
587 : (140 128 146 147 132 145 127 129 128 139 139 80 148 139 147 145 128 127 129 128 139 139 80 134 145 132 128 147 127 129 128 139 139 80 143 142 138 186 127 129 128 139 139 80 147 142 150 141 127 140 128 143 80 129 136 130 152 130 139 132 80 230 230 230 230 230 80 146 128 133 128 145 136 127 129 128 139 139 80 143 142 138 186 131 132 151 80 140 142 142 141 127 146 147 142 141 132 80 128 141)
588 : ((140 128 146 147 132 145 127 129 128 139 139) (80) (148 139 147 145 128 127 129 128 139 139) (80) (134 145 132 128 147 127 129 128 139 139) (80) (143 142 138 186 127 129 128 139 139) (80) (147 142 150 141 127 140 128 143) (80) (129 136 130 152 130 139 132) (80) (230 230 230 230 230) (80) (146 128 133 128 145 136 127 129 128 139 139) (80) (143 142 138 186 131 132 151) (80) (140 142 142 141 127 146 147 142 141 132) (80) (128 141))
589 : (MASTER BALL # ULTRA BALL # GREAT BALL # POKé BALL # TOWN MAP # BICYCLE # ????? # SAFARI BALL # POKéDEX # MOON STONE # AN)
590
591 *** Automatically grab the data
560 #+name: item-names 592 #+name: item-names
561 #+begin_src clojure 593 #+begin_src clojure
562 594
563 (def hxc-items-raw 595 (def hxc-items-raw
564 "The hardcoded names of the items in memory. List begins at 596 "The hardcoded names of the items in memory. List begins at
570 keywords. List begins at ROM@045B7. See also, hxc-items-raw." 602 keywords. List begins at ROM@045B7. See also, hxc-items-raw."
571 (comp (partial map format-name) hxc-items-raw)) 603 (comp (partial map format-name) hxc-items-raw))
572 #+end_src 604 #+end_src
573 605
574 ** Item prices 606 ** Item prices
607
608 ***
609 #+begin_src clojure :exports both :results output
610 (ns com.aurellem.gb.hxc
611 (:use (com.aurellem.gb assembly characters gb-driver util mem-util
612 constants))
613 (:import [com.aurellem.gb.gb_driver SaveState]))
614
615 (println (take 90 (drop 0x4495 (rom))))
616
617 (println
618 (partition 3
619 (take 90 (drop 0x4495 (rom)))))
620
621 (println
622 (partition 3
623 (map hex
624 (take 90 (drop 0x4495 (rom))))))
625
626 (println
627 (map decode-bcd
628 (map butlast
629 (partition 3
630 (take 90 (drop 0x4495 (rom)))))))
631
632 (println
633 (map
634 vector
635 (hxc-items (rom))
636 (map decode-bcd
637 (map butlast
638 (partition 3
639 (take 90 (drop 0x4495 (rom))))))))
640
641
642
643
644
645 #+end_src
646
647 #+results:
648 : (0 0 0 18 0 0 6 0 0 2 0 0 0 0 0 0 0 0 0 0 0 16 0 0 0 0 0 0 0 0 1 0 0 2 80 0 2 80 0 2 0 0 2 0 0 48 0 0 37 0 0 21 0 0 7 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 80 0 3 80 0)
649 : ((0 0 0) (18 0 0) (6 0 0) (2 0 0) (0 0 0) (0 0 0) (0 0 0) (16 0 0) (0 0 0) (0 0 0) (1 0 0) (2 80 0) (2 80 0) (2 0 0) (2 0 0) (48 0 0) (37 0 0) (21 0 0) (7 0 0) (3 0 0) (0 0 0) (0 0 0) (0 0 0) (0 0 0) (0 0 0) (0 0 0) (0 0 0) (0 0 0) (5 80 0) (3 80 0))
650 : ((0x0 0x0 0x0) (0x12 0x0 0x0) (0x6 0x0 0x0) (0x2 0x0 0x0) (0x0 0x0 0x0) (0x0 0x0 0x0) (0x0 0x0 0x0) (0x10 0x0 0x0) (0x0 0x0 0x0) (0x0 0x0 0x0) (0x1 0x0 0x0) (0x2 0x50 0x0) (0x2 0x50 0x0) (0x2 0x0 0x0) (0x2 0x0 0x0) (0x30 0x0 0x0) (0x25 0x0 0x0) (0x15 0x0 0x0) (0x7 0x0 0x0) (0x3 0x0 0x0) (0x0 0x0 0x0) (0x0 0x0 0x0) (0x0 0x0 0x0) (0x0 0x0 0x0) (0x0 0x0 0x0) (0x0 0x0 0x0) (0x0 0x0 0x0) (0x0 0x0 0x0) (0x5 0x50 0x0) (0x3 0x50 0x0))
651 : (0 1200 600 200 0 0 0 1000 0 0 100 250 250 200 200 3000 2500 1500 700 300 0 0 0 0 0 0 0 0 550 350)
652 : ([:master-ball 0] [:ultra-ball 1200] [:great-ball 600] [:poké-ball 200] [:town-map 0] [:bicycle 0] [:????? 0] [:safari-ball 1000] [:pokédex 0] [:moon-stone 0] [:antidote 100] [:burn-heal 250] [:ice-heal 250] [:awakening 200] [:parlyz-heal 200] [:full-restore 3000] [:max-potion 2500] [:hyper-potion 1500] [:super-potion 700] [:potion 300] [:boulderbadge 0] [:cascadebadge 0] [:thunderbadge 0] [:rainbowbadge 0] [:soulbadge 0] [:marshbadge 0] [:volcanobadge 0] [:earthbadge 0] [:escape-rope 550] [:repel 350])
653
654
655 ***
575 #+name: item-prices 656 #+name: item-prices
576 #+begin_src clojure 657 #+begin_src clojure
577 (defn hxc-item-prices 658 (defn hxc-item-prices
578 "The hardcoded list of item prices in memory. List begins at ROM@4495" 659 "The hardcoded list of item prices in memory. List begins at ROM@4495"
579 ([] (hxc-item-prices com.aurellem.gb.gb-driver/original-rom)) 660 ([] (hxc-item-prices com.aurellem.gb.gb-driver/original-rom))
633 714
634 715
635 716
636 * Types 717 * Types
637 ** Names of types 718 ** Names of types
719 ***
720 #+begin_src clojure :exports both :results output
721 (ns com.aurellem.gb.hxc
722 (:use (com.aurellem.gb assembly characters gb-driver util mem-util
723 constants))
724 (:import [com.aurellem.gb.gb_driver SaveState]))
725
726 (println (take 90 (drop 0x27D99 (rom))))
727
728 (println
729 (partition-by (partial = 0x50)
730 (take 90 (drop 0x27D99 (rom)))))
731
732 (println
733 (map character-codes->str
734 (partition-by (partial = 0x50)
735 (take 90 (drop 0x27D99 (rom))))))
736
737 #+end_src
738
739 #+results:
740 : (141 142 145 140 128 139 80 133 136 134 135 147 136 141 134 80 133 139 152 136 141 134 80 143 142 136 146 142 141 80 133 136 145 132 80 150 128 147 132 145 80 134 145 128 146 146 80 132 139 132 130 147 145 136 130 80 143 146 152 130 135 136 130 80 136 130 132 80 134 145 142 148 141 131 80 145 142 130 138 80 129 136 145 131 80 129 148 134 80 134)
741 : ((141 142 145 140 128 139) (80) (133 136 134 135 147 136 141 134) (80) (133 139 152 136 141 134) (80) (143 142 136 146 142 141) (80) (133 136 145 132) (80) (150 128 147 132 145) (80) (134 145 128 146 146) (80) (132 139 132 130 147 145 136 130) (80) (143 146 152 130 135 136 130) (80) (136 130 132) (80) (134 145 142 148 141 131) (80) (145 142 130 138) (80) (129 136 145 131) (80) (129 148 134) (80) (134))
742 : (NORMAL # FIGHTING # FLYING # POISON # FIRE # WATER # GRASS # ELECTRIC # PSYCHIC # ICE # GROUND # ROCK # BIRD # BUG # G)
743
744
745 ***
638 #+name: type-names 746 #+name: type-names
639 #+begin_src clojure 747 #+begin_src clojure
640 (def hxc-types 748 (def hxc-types
641 "The hardcoded type names in memory. List begins at ROM@27D99, 749 "The hardcoded type names in memory. List begins at ROM@27D99,
642 shortly before hxc-titles." 750 shortly before hxc-titles."
643 (hxc-thunk-words 0x27D99 102)) 751 (hxc-thunk-words 0x27D99 102))
644 752
645 #+end_src 753 #+end_src
646 754
647 ** Type effectiveness 755 ** Type effectiveness
756 ***
757 #+begin_src clojure :exports both :results output
758 (ns com.aurellem.gb.hxc
759 (:use (com.aurellem.gb assembly characters gb-driver util mem-util
760 constants))
761 (:import [com.aurellem.gb.gb_driver SaveState]))
762
763
764 ;; POKEMON TYPES
765
766 (println pkmn-types) ;; these are the pokemon types
767 (println (map vector (range) pkmn-types)) ;; each type has an id number.
768
769 (newline)
770
771
772
773
774 ;;; TYPE EFFECTIVENESS
775
776 (println (take 15 (drop 0x3E62D (rom))))
777 (println (partition 3 (take 15 (drop 0x3E62D (rom)))))
778
779 (println
780 (map
781 (fn [[atk-type def-type multiplier]]
782 (list atk-type def-type (/ multiplier 10.)))
783
784 (partition 3
785 (take 15 (drop 0x3E62D (rom))))))
786
787
788 (println
789 (map
790 (fn [[atk-type def-type multiplier]]
791 [
792 (get pkmn-types atk-type)
793 (get pkmn-types def-type)
794 (/ multiplier 10.)
795 ])
796
797 (partition 3
798 (take 15 (drop 0x3E62D (rom))))))
799
800 #+end_src
801
802 #+results:
803 : [:normal :fighting :flying :poison :ground :rock :bird :bug :ghost :A :B :C :D :E :F :G :H :I :J :K :fire :water :grass :electric :psychic :ice :dragon]
804 : ([0 :normal] [1 :fighting] [2 :flying] [3 :poison] [4 :ground] [5 :rock] [6 :bird] [7 :bug] [8 :ghost] [9 :A] [10 :B] [11 :C] [12 :D] [13 :E] [14 :F] [15 :G] [16 :H] [17 :I] [18 :J] [19 :K] [20 :fire] [21 :water] [22 :grass] [23 :electric] [24 :psychic] [25 :ice] [26 :dragon])
805 :
806 : (0 5 5 0 8 0 8 8 20 20 7 20 20 5 5)
807 : ((0 5 5) (0 8 0) (8 8 20) (20 7 20) (20 5 5))
808 : ((0 5 0.5) (0 8 0.0) (8 8 2.0) (20 7 2.0) (20 5 0.5))
809 : ([:normal :rock 0.5] [:normal :ghost 0.0] [:ghost :ghost 2.0] [:fire :bug 2.0] [:fire :rock 0.5])
810
811
812 ***
813
648 #+name: type-advantage 814 #+name: type-advantage
649 #+begin_src clojure 815 #+begin_src clojure
650 (defn hxc-advantage 816 (defn hxc-advantage
651 ;; in-game multipliers are stored as 10x their effective value 817 ;; in-game multipliers are stored as 10x their effective value
652 ;; to allow for fractional multipliers like 1/2 818 ;; to allow for fractional multipliers like 1/2
667 833
668 834
669 835
670 * Moves 836 * Moves
671 ** Names of moves 837 ** Names of moves
838 *** See the data
839 #+begin_src clojure :exports both :results output
840 (ns com.aurellem.gb.hxc
841 (:use (com.aurellem.gb assembly characters gb-driver util mem-util
842 constants))
843 (:import [com.aurellem.gb.gb_driver SaveState]))
844
845 (println (take 100 (drop 0xBC000 (rom))))
846
847 (println
848 (partition-by
849 (partial = 0x50)
850 (take 100 (drop 0xBC000 (rom)))))
851
852 (println
853 (map character-codes->str
854 (partition-by
855 (partial = 0x50)
856 (take 100 (drop 0xBC000 (rom))))))
857
858
859 #+end_src
860
861 #+results:
862 : (143 142 148 141 131 80 138 128 145 128 147 132 127 130 135 142 143 80 131 142 148 129 139 132 146 139 128 143 80 130 142 140 132 147 127 143 148 141 130 135 80 140 132 134 128 127 143 148 141 130 135 80 143 128 152 127 131 128 152 80 133 136 145 132 127 143 148 141 130 135 80 136 130 132 127 143 148 141 130 135 80 147 135 148 141 131 132 145 143 148 141 130 135 80 146 130 145 128 147 130)
863 : ((143 142 148 141 131) (80) (138 128 145 128 147 132 127 130 135 142 143) (80) (131 142 148 129 139 132 146 139 128 143) (80) (130 142 140 132 147 127 143 148 141 130 135) (80) (140 132 134 128 127 143 148 141 130 135) (80) (143 128 152 127 131 128 152) (80) (133 136 145 132 127 143 148 141 130 135) (80) (136 130 132 127 143 148 141 130 135) (80) (147 135 148 141 131 132 145 143 148 141 130 135) (80) (146 130 145 128 147 130))
864 : (POUND # KARATE CHOP # DOUBLESLAP # COMET PUNCH # MEGA PUNCH # PAY DAY # FIRE PUNCH # ICE PUNCH # THUNDERPUNCH # SCRATC)
865
866 *** Automatically grab the data
867
672 #+name: move-names 868 #+name: move-names
673 #+begin_src clojure 869 #+begin_src clojure
674 (def hxc-move-names 870 (def hxc-move-names
675 "The hardcoded move names in memory. List begins at ROM@BC000" 871 "The hardcoded move names in memory. List begins at ROM@BC000"
676 (hxc-thunk-words 0xBC000 1551)) 872 (hxc-thunk-words 0xBC000 1551))
741 (drop 0x38000 rom)))))))) 937 (drop 0x38000 rom))))))))
742 938
743 #+end_src 939 #+end_src
744 940
745 ** TM and HM moves 941 ** TM and HM moves
746 942 ***
943 #+begin_src clojure :exports both :results output
944 (ns com.aurellem.gb.hxc
945 (:use (com.aurellem.gb assembly characters gb-driver util mem-util
946 constants))
947 (:import [com.aurellem.gb.gb_driver SaveState]))
948
949
950 (println (hxc-move-names))
951 (println (map vector (rest(range)) (hxc-move-names)))
952
953 (newline)
954
955 (println (take 55 (drop 0x1232D (rom))))
956
957 (println
958 (interpose "."
959 (map
960 (zipmap (rest (range)) (hxc-move-names))
961 (take 55 (drop 0x1232D (rom))))))
962
963 #+end_src
964
965 #+results:
966 : (POUND KARATE CHOP DOUBLESLAP COMET PUNCH MEGA PUNCH PAY DAY FIRE PUNCH ICE PUNCH THUNDERPUNCH SCRATCH VICEGRIP GUILLOTINE RAZOR WIND SWORDS DANCE CUT GUST WING ATTACK WHIRLWIND FLY BIND SLAM VINE WHIP STOMP DOUBLE KICK MEGA KICK JUMP KICK ROLLING KICK SAND-ATTACK HEADBUTT HORN ATTACK FURY ATTACK HORN DRILL TACKLE BODY SLAM WRAP TAKE DOWN THRASH DOUBLE-EDGE TAIL WHIP POISON STING TWINEEDLE PIN MISSILE LEER BITE GROWL ROAR SING SUPERSONIC SONICBOOM DISABLE ACID EMBER FLAMETHROWER MIST WATER GUN HYDRO PUMP SURF ICE BEAM BLIZZARD PSYBEAM BUBBLEBEAM AURORA BEAM HYPER BEAM PECK DRILL PECK SUBMISSION LOW KICK COUNTER SEISMIC TOSS STRENGTH ABSORB MEGA DRAIN LEECH SEED GROWTH RAZOR LEAF SOLARBEAM POISONPOWDER STUN SPORE SLEEP POWDER PETAL DANCE STRING SHOT DRAGON RAGE FIRE SPIN THUNDERSHOCK THUNDERBOLT THUNDER WAVE THUNDER ROCK THROW EARTHQUAKE FISSURE DIG TOXIC CONFUSION PSYCHIC HYPNOSIS MEDITATE AGILITY QUICK ATTACK RAGE TELEPORT NIGHT SHADE MIMIC SCREECH DOUBLE TEAM RECOVER HARDEN MINIMIZE SMOKESCREEN CONFUSE RAY WITHDRAW DEFENSE CURL BARRIER LIGHT SCREEN HAZE REFLECT FOCUS ENERGY BIDE METRONOME MIRROR MOVE SELFDESTRUCT EGG BOMB LICK SMOG SLUDGE BONE CLUB FIRE BLAST WATERFALL CLAMP SWIFT SKULL BASH SPIKE CANNON CONSTRICT AMNESIA KINESIS SOFTBOILED HI JUMP KICK GLARE DREAM EATER POISON GAS BARRAGE LEECH LIFE LOVELY KISS SKY ATTACK TRANSFORM BUBBLE DIZZY PUNCH SPORE FLASH PSYWAVE SPLASH ACID ARMOR CRABHAMMER EXPLOSION FURY SWIPES BONEMERANG REST ROCK SLIDE HYPER FANG SHARPEN CONVERSION TRI ATTACK SUPER FANG SLASH SUBSTITUTE STRUGGLE)
967 : ([1 POUND] [2 KARATE CHOP] [3 DOUBLESLAP] [4 COMET PUNCH] [5 MEGA PUNCH] [6 PAY DAY] [7 FIRE PUNCH] [8 ICE PUNCH] [9 THUNDERPUNCH] [10 SCRATCH] [11 VICEGRIP] [12 GUILLOTINE] [13 RAZOR WIND] [14 SWORDS DANCE] [15 CUT] [16 GUST] [17 WING ATTACK] [18 WHIRLWIND] [19 FLY] [20 BIND] [21 SLAM] [22 VINE WHIP] [23 STOMP] [24 DOUBLE KICK] [25 MEGA KICK] [26 JUMP KICK] [27 ROLLING KICK] [28 SAND-ATTACK] [29 HEADBUTT] [30 HORN ATTACK] [31 FURY ATTACK] [32 HORN DRILL] [33 TACKLE] [34 BODY SLAM] [35 WRAP] [36 TAKE DOWN] [37 THRASH] [38 DOUBLE-EDGE] [39 TAIL WHIP] [40 POISON STING] [41 TWINEEDLE] [42 PIN MISSILE] [43 LEER] [44 BITE] [45 GROWL] [46 ROAR] [47 SING] [48 SUPERSONIC] [49 SONICBOOM] [50 DISABLE] [51 ACID] [52 EMBER] [53 FLAMETHROWER] [54 MIST] [55 WATER GUN] [56 HYDRO PUMP] [57 SURF] [58 ICE BEAM] [59 BLIZZARD] [60 PSYBEAM] [61 BUBBLEBEAM] [62 AURORA BEAM] [63 HYPER BEAM] [64 PECK] [65 DRILL PECK] [66 SUBMISSION] [67 LOW KICK] [68 COUNTER] [69 SEISMIC TOSS] [70 STRENGTH] [71 ABSORB] [72 MEGA DRAIN] [73 LEECH SEED] [74 GROWTH] [75 RAZOR LEAF] [76 SOLARBEAM] [77 POISONPOWDER] [78 STUN SPORE] [79 SLEEP POWDER] [80 PETAL DANCE] [81 STRING SHOT] [82 DRAGON RAGE] [83 FIRE SPIN] [84 THUNDERSHOCK] [85 THUNDERBOLT] [86 THUNDER WAVE] [87 THUNDER] [88 ROCK THROW] [89 EARTHQUAKE] [90 FISSURE] [91 DIG] [92 TOXIC] [93 CONFUSION] [94 PSYCHIC] [95 HYPNOSIS] [96 MEDITATE] [97 AGILITY] [98 QUICK ATTACK] [99 RAGE] [100 TELEPORT] [101 NIGHT SHADE] [102 MIMIC] [103 SCREECH] [104 DOUBLE TEAM] [105 RECOVER] [106 HARDEN] [107 MINIMIZE] [108 SMOKESCREEN] [109 CONFUSE RAY] [110 WITHDRAW] [111 DEFENSE CURL] [112 BARRIER] [113 LIGHT SCREEN] [114 HAZE] [115 REFLECT] [116 FOCUS ENERGY] [117 BIDE] [118 METRONOME] [119 MIRROR MOVE] [120 SELFDESTRUCT] [121 EGG BOMB] [122 LICK] [123 SMOG] [124 SLUDGE] [125 BONE CLUB] [126 FIRE BLAST] [127 WATERFALL] [128 CLAMP] [129 SWIFT] [130 SKULL BASH] [131 SPIKE CANNON] [132 CONSTRICT] [133 AMNESIA] [134 KINESIS] [135 SOFTBOILED] [136 HI JUMP KICK] [137 GLARE] [138 DREAM EATER] [139 POISON GAS] [140 BARRAGE] [141 LEECH LIFE] [142 LOVELY KISS] [143 SKY ATTACK] [144 TRANSFORM] [145 BUBBLE] [146 DIZZY PUNCH] [147 SPORE] [148 FLASH] [149 PSYWAVE] [150 SPLASH] [151 ACID ARMOR] [152 CRABHAMMER] [153 EXPLOSION] [154 FURY SWIPES] [155 BONEMERANG] [156 REST] [157 ROCK SLIDE] [158 HYPER FANG] [159 SHARPEN] [160 CONVERSION] [161 TRI ATTACK] [162 SUPER FANG] [163 SLASH] [164 SUBSTITUTE] [165 STRUGGLE])
968 :
969 : (5 13 14 18 25 92 32 34 36 38 61 55 58 59 63 6 66 68 69 99 72 76 82 85 87 89 90 91 94 100 102 104 115 117 118 120 121 126 129 130 135 138 143 156 86 149 153 157 161 164 15 19 57 70 148)
970 : (MEGA PUNCH . RAZOR WIND . SWORDS DANCE . WHIRLWIND . MEGA KICK . TOXIC . HORN DRILL . BODY SLAM . TAKE DOWN . DOUBLE-EDGE . BUBBLEBEAM . WATER GUN . ICE BEAM . BLIZZARD . HYPER BEAM . PAY DAY . SUBMISSION . COUNTER . SEISMIC TOSS . RAGE . MEGA DRAIN . SOLARBEAM . DRAGON RAGE . THUNDERBOLT . THUNDER . EARTHQUAKE . FISSURE . DIG . PSYCHIC . TELEPORT . MIMIC . DOUBLE TEAM . REFLECT . BIDE . METRONOME . SELFDESTRUCT . EGG BOMB . FIRE BLAST . SWIFT . SKULL BASH . SOFTBOILED . DREAM EATER . SKY ATTACK . REST . THUNDER WAVE . PSYWAVE . EXPLOSION . ROCK SLIDE . TRI ATTACK . SUBSTITUTE . CUT . FLY . SURF . STRENGTH . FLASH)
971
972
973 ***
747 #+name: machines 974 #+name: machines
748 #+begin_src clojure 975 #+begin_src clojure
749 (defn hxc-machines 976 (defn hxc-machines
750 "The hardcoded moves taught by TMs and HMs. List begins at ROM@1232D." 977 "The hardcoded moves taught by TMs and HMs. List begins at ROM@1232D."
751 ([] (hxc-machines 978 ([] (hxc-machines
925 1152
926 All the legitimate move effects are listed in the table 1153 All the legitimate move effects are listed in the table
927 below. Here are some notes for reading it: 1154 below. Here are some notes for reading it:
928 1155
929 - Whenever an effect has a chance of doing something (like a chance of 1156 - Whenever an effect has a chance of doing something (like a chance of
930 poisoning the opponent), I list the chance as a hexadecimal amount out of 256 to avoid rounding errors. To convert the hex amount into a percentage, divide by 256. 1157 poisoning the opponent), I list the chance as a hexadecimal amount
1158 out of 256; this is to avoid rounding errors. To convert the hex amount into a percentage, divide by 256.
931 - For some effects, the description is too cumbersome to 1159 - For some effects, the description is too cumbersome to
932 write. Instead, I just write a move name 1160 write. Instead, I just write a move name
933 in parentheses, like: (leech seed). That move gives a characteristic example 1161 in parentheses, like: (leech seed). That move gives a characteristic example
934 of the effect. 1162 of the effect.
935 - I use the abbreviations =atk=, =def=, =spd=, =spc=, =acr=, =evd= for 1163 - I use the abbreviations =atk=, =def=, =spd=, =spc=, =acr=, =evd= for
936 attack, defense, speed, special, accuracy, and evasion. 1164 attack, defense, speed, special, accuracy, and evasiveness.
937 . 1165 .
938 1166
939 1167
940 1168
941 | ID (hex) | Description | Notes | 1169 | ID (hex) | Description | Notes |
1337 ;; The first instance is for Machines; the second, for stones. 1565 ;; The first instance is for Machines; the second, for stones.
1338 1566
1339 ;; 0x251A (in indexable mem): image decompression routine seems to begin here. 1567 ;; 0x251A (in indexable mem): image decompression routine seems to begin here.
1340 1568
1341 1569
1570 ;; Note: There are two tile tables, one from 8000-8FFF, the other from
1571 ;; 8800-97FF. The latter contains symbols, possibly map tiles(?), with some japanese chars and stuff at the end.
1572 (defn print-pixel-letters!
1573 "The pixel tiles representing letters. Neat!"
1574 ([] (print-pixel-letters! (read-state "oak-speaks")))
1575 ([state]
1576 (map
1577 (comp
1578 println
1579 (partial map #(if (zero? %) \space 0))
1580 #(if (< (count %) 8)
1581 (recur (cons 0 %))
1582 %)
1583 reverse bit-list)
1584
1585 (take 0xFFF (drop 0x8800 (memory state))))))
1586
1587
1342 (comment 1588 (comment
1343 1589
1344 (def hxc-later 1590 (def hxc-later
1345 "Running this code produces, e.g. hardcoded names NPCs give 1591 "Running this code produces, e.g. hardcoded names NPCs give
1346 their pokemon. Will sort through it later." 1592 their pokemon. Will sort through it later."