Mercurial > vba-clojure
comparison clojure/com/aurellem/gb/species.clj @ 165:8f1b32d3f229
need to determine how colormaps for pokemon work.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 20 Mar 2012 18:07:42 -0500 |
parents | 6f80c07eb32a |
children | 76b031d2f586 |
comparison
equal
deleted
inserted
replaced
164:6f80c07eb32a | 165:8f1b32d3f229 |
---|---|
1 ;; 001 01 : rhydon | 1 (ns com.aurellem.gb.species |
2 ;; 002 02 : kangaskhan | 2 (:use (com.aurellem.gb gb-driver util)) |
3 ;; 003 03 : nidoran-male | 3 (:import [com.aurellem.gb.gb_driver SaveState])) |
4 ;; 004 04 : clefairy | 4 |
5 ;; 005 05 : spearow | 5 |
6 ;; 006 06 : voltorb | 6 (def species-code->species-name |
7 ;; 007 07 : nidoking | 7 {0x01 :rhydon |
8 ;; 008 08 : slowbro | 8 0x02 :kangaskhan |
9 ;; 009 09 : ivysaur | 9 0x03 :nidoran-male |
10 ;; 010 0A : exeggutor | 10 0x04 :clefairy |
11 ;; 011 0B : lickitung | 11 0x05 :spearow |
12 ;; 012 0C : exeggcute | 12 0x06 :voltorb |
13 ;; 013 0D : grimer | 13 0x07 :nidoking |
14 ;; 014 0E : gengar | 14 0x08 :slowbro |
15 ;; 015 0F : nidoran-female | 15 0x09 :ivysaur |
16 ;; 016 10 : nidoqueen | 16 0x0A :exeggutor |
17 ;; 017 11 : cubone | 17 0x0B :lickitung |
18 ;; 018 12 : rhyhorn | 18 0x0C :exeggcute |
19 ;; 019 13 : lapras | 19 0x0D :grimer |
20 ;; 020 14 : arcanine | 20 0x0E :gengar |
21 ;; 021 15 : mew | 21 0x0F :nidoran-female |
22 ;; 022 16 : gyarados | 22 0x10 :nidoqueen |
23 ;; 023 17 : shellder | 23 0x11 :cubone |
24 ;; 024 18 : tentacool | 24 0x12 :rhyhorn |
25 ;; 025 19 : gastly | 25 0x13 :lapras |
26 ;; 026 1A : scyther | 26 0x14 :arcanine |
27 ;; 027 1B : staryu | 27 0x15 :mew |
28 ;; 028 1C : blastoise | 28 0x16 :gyarados |
29 ;; 029 1D : pinsir | 29 0x17 :shellder |
30 ;; 030 1E : tangela | 30 0x18 :tentacool |
31 ;; 033 21 : growlithe | 31 0x19 :gastly |
32 ;; 034 22 : onix | 32 0x1A :scyther |
33 ;; 035 23 : fearow | 33 0x1B :staryu |
34 ;; 036 24 : pidgey | 34 0x1C :blastoise |
35 ;; 037 25 : slowpoke | 35 0x1D :pinsir |
36 ;; 038 26 : kadabra | 36 0x1E :tangela |
37 ;; 039 27 : graveler | 37 0x21 :growlithe |
38 ;; 040 28 : chansey | 38 0x22 :onix |
39 ;; 041 29 : machoke | 39 0x23 :fearow |
40 ;; 042 2A : mr-mime | 40 0x24 :pidgey |
41 ;; 043 2B : hitmonlee | 41 0x25 :slowpoke |
42 ;; 044 2C : hitmonchan | 42 0x26 :kadabra |
43 ;; 045 2D : arbok | 43 0x27 :graveler |
44 ;; 046 2E : parasect | 44 0x28 :chansey |
45 ;; 047 2F : psyduck | 45 0x29 :machoke |
46 ;; 048 30 : drowzee | 46 0x2A :mr-mime |
47 ;; 049 31 : golem | 47 0x2B :hitmonlee |
48 ;; 051 33 : magmar | 48 0x2C :hitmonchan |
49 ;; 053 35 : electabuzz | 49 0x2D :arbok |
50 ;; 054 36 : magneton | 50 0x2E :parasect |
51 ;; 055 37 : koffing | 51 0x2F :psyduck |
52 ;; 057 39 : mankey | 52 0x30 :drowzee |
53 ;; 058 3A : seel | 53 0x31 :golem |
54 ;; 059 3B : diglett | 54 0x33 :magmar |
55 ;; 060 3C : tauros | 55 0x35 :electabuzz |
56 ;; 064 40 : farfetch'd | 56 0x36 :magneton |
57 ;; 065 41 : venonat | 57 0x37 :koffing |
58 ;; 066 42 : dragonite | 58 0x39 :mankey |
59 ;; 070 46 : doduo | 59 0x3A :seel |
60 ;; 071 47 : poliwag | 60 0x3B :diglett |
61 ;; 072 48 : jynx | 61 0x3C :tauros |
62 ;; 073 49 : moltres | 62 0x40 :farfetch'd |
63 ;; 074 4A : articuno | 63 0x41 :venonat |
64 ;; 075 4B : zapdos | 64 0x42 :dragonite |
65 ;; 076 4C : ditto | 65 0x46 :doduo |
66 ;; 077 4D : meowth | 66 0x47 :poliwag |
67 ;; 078 4E : krabby | 67 0x48 :jynx |
68 ;; 082 52 : vulpix | 68 0x49 :moltres |
69 ;; 083 53 : ninetails | 69 0x4A :articuno |
70 ;; 084 54 : pikachu | 70 0x4B :zapdos |
71 ;; 085 55 : riachu | 71 0x4C :ditto |
72 ;; 088 58 : dratini | 72 0x4D :meowth |
73 ;; 089 59 : dragonair | 73 0x4E :krabby |
74 ;; 090 5A : kabuto | 74 0x52 :vulpix |
75 ;; 091 5B : kabutops | 75 0x53 :ninetails |
76 ;; 092 5C : horsea | 76 0x54 :pikachu |
77 ;; 093 5D : sedra | 77 0x55 :riachu |
78 ;; 096 60 : sandshrew | 78 0x58 :dratini |
79 ;; 097 61 : sandslash | 79 0x59 :dragonair |
80 ;; 098 62 : omanyte | 80 0x5A :kabuto |
81 ;; 099 63 : omastar | 81 0x5B :kabutops |
82 ;; 100 64 : jigglypuff | 82 0x5C :horsea |
83 ;; 101 65 : wigglytuff | 83 0x5D :sedra |
84 ;; 102 66 : eevee | 84 0x60 :sandshrew |
85 ;; 103 67 : flareon | 85 0x61 :sandslash |
86 ;; 104 68 : jolteon | 86 0x62 :omanyte |
87 ;; 105 69 : vaporeon | 87 0x63 :omastar |
88 ;; 106 6A : machop | 88 0x64 :jigglypuff |
89 ;; 107 6B : zubat | 89 0x65 :wigglytuff |
90 ;; 108 6C : ekans | 90 0x66 :eevee |
91 ;; 109 6D : paras | 91 0x67 :flareon |
92 ;; 110 6E : poliwhirl | 92 0x68 :jolteon |
93 ;; 111 6F : poliwrath | 93 0x69 :vaporeon |
94 ;; 112 70 : weedle | 94 0x6A :machop |
95 ;; 113 71 : kakuna | 95 0x6B :zubat |
96 ;; 114 72 : beedrill | 96 0x6C :ekans |
97 ;; 116 74 : dodrio | 97 0x6D :paras |
98 ;; 117 75 : primeape | 98 0x6E :poliwhirl |
99 ;; 118 76 : dugtrio | 99 0x6F :poliwrath |
100 ;; 119 77 : venomoth | 100 0x70 :weedle |
101 ;; 120 78 : dewgong | 101 0x71 :kakuna |
102 ;; 123 7B : caterpie | 102 0x72 :beedrill |
103 ;; 124 7C : metapod | 103 0x74 :dodrio |
104 ;; 125 7D : butterfree | 104 0x75 :primeape |
105 ;; 126 7E : machamp | 105 0x76 :dugtrio |
106 ;; 128 80 : golduck | 106 0x77 :venomoth |
107 ;; 129 81 : hypno | 107 0x78 :dewgong |
108 ;; 130 82 : golbat | 108 0x7B :caterpie |
109 ;; 131 83 : mewtwo | 109 0x7C :metapod |
110 ;; 132 84 : snorlax | 110 0x7D :butterfree |
111 ;; 133 85 : magikarp | 111 0x7E :machamp |
112 ;; 136 88 : muk | 112 0x80 :golduck |
113 ;; 138 8A : kingler | 113 0x81 :hypno |
114 ;; 139 8B : cloyster | 114 0x82 :golbat |
115 ;; 141 8D : electrode | 115 0x83 :mewtwo |
116 ;; 142 8E : clefable | 116 0x84 :snorlax |
117 ;; 143 8F : wheezing | 117 0x85 :magikarp |
118 ;; 144 90 : persian | 118 0x88 :muk |
119 ;; 145 91 : marowak | 119 0x8A :kingler |
120 ;; 147 93 : haunter | 120 0x8B :cloyster |
121 ;; 148 94 : abra | 121 0x8D :electrode |
122 ;; 149 95 : alakazam | 122 0x8E :clefable |
123 ;; 150 96 : pidgeotto | 123 0x8F :wheezing |
124 ;; 151 97 : pidgeot | 124 0x90 :persian |
125 ;; 152 98 : starmie | 125 0x91 :marowak |
126 ;; 153 99 : bulbasaur | 126 0x93 :haunter |
127 ;; 154 9A : venusaur | 127 0x94 :abra |
128 ;; 155 9B : tentacruel | 128 0x95 :alakazam |
129 ;; 157 9D : goldeen | 129 0x96 :pidgeotto |
130 ;; 158 9E : seaking | 130 0x97 :pidgeot |
131 ;; 163 A3 : ponyta | 131 0x98 :starmie |
132 ;; 164 A4 : rapidash | 132 0x99 :bulbasaur |
133 ;; 165 A5 : rattata | 133 0x9A :venusaur |
134 ;; 166 A6 : raticate | 134 0x9B :tentacruel |
135 ;; 167 A7 : nidorino | 135 0x9D :goldeen |
136 ;; 168 A8 : nidorina | 136 0x9E :seaking |
137 ;; 169 A9 : geodude | 137 0xA3 :ponyta |
138 ;; 170 AA : porygon | 138 0xA4 :rapidash |
139 ;; 171 AB : aerodactyl | 139 0xA5 :rattata |
140 ;; 173 AD : magnemite | 140 0xA6 :raticate |
141 ;; 176 B0 : charmander | 141 0xA7 :nidorino |
142 ;; 177 B1 : squirtle | 142 0xA8 :nidorina |
143 ;; 178 B2 : charmeleon | 143 0xA9 :geodude |
144 ;; 179 B3 : wartortle | 144 0xAA :porygon |
145 ;; 180 B4 : charizard | 145 0xAB :aerodactyl |
146 ;; 185 B9 : oddish | 146 0xAD :magnemite |
147 ;; 186 BA : gloom | 147 0xB0 :charmander |
148 ;; 187 BB : vileplume | 148 0xB1 :squirtle |
149 ;; 188 BC : bellsprout | 149 0xB2 :charmeleon |
150 ;; 189 BD : weepenbell | 150 0xB3 :wartortle |
151 ;; 190 BE : victreebel | 151 0xB4 :charizard |
152 0xB9 :oddish | |
153 0xBA :gloom | |
154 0xBB :vileplume | |
155 0xBC :bellsprout | |
156 0xBD :weepenbell | |
157 0xBE :victreebel}) | |
158 | |
159 (def species-ID-1 0xD163) | |
160 | |
161 (def species-name->species-code | |
162 (zipmap (vals species-code->species-name) | |
163 (keys species-code->species-name))) | |
164 | |
165 (defn set-species | |
166 ([^SaveState state pokemon-num species-name] | |
167 (assert (<= 0 pokemon-num 5)) | |
168 (let [species-code (species-name->species-code | |
169 species-name | |
170 species-name)] | |
171 | |
172 (set-memory state (+ species-ID-1 pokemon-num) | |
173 species-code))) | |
174 ([pokemon-num species-name] | |
175 (set-species @current-state pokemon-num species-name))) |