# HG changeset patch # User Robert McIntyre # Date 1332576656 18000 # Node ID c9a855de1d070b96c219c50d54b4be03fee3b96c # Parent 2fac825a4de9e8573921ce918518ea8d81ac5f6b enabled pokedex printing. diff -r 2fac825a4de9 -r c9a855de1d07 clojure/com/aurellem/exp/cartography --- a/clojure/com/aurellem/exp/cartography Sat Mar 24 00:13:06 2012 -0500 +++ b/clojure/com/aurellem/exp/cartography Sat Mar 24 03:10:56 2012 -0500 @@ -7,480 +7,480 @@ D168 Pokemon 6 Species D169 End-of-List Sentinel (0xFF) D16A Pokemon 1 Color Map -D16B /h -D16C \l Pokemon 1 Current Hit Points -D16D Unused -D16E Status +D16B /h +D16C \l Pokemon 1 Current Hit Points +D16D Unused +D16E Status D16F Type 1 (does not affect display) D170 Type 2 (does not affect display) -D171 Scratch Area -D172 Move 1 ID -D173 Move 2 ID -D174 Move 3 ID -D175 Move 4 ID +D171 Scratch Area +D172 Move 1 ID +D173 Move 2 ID +D174 Move 3 ID +D175 Move 4 ID D176 /h Pokemon 1 OT ID D177 \l -D178 /h -D179 |m Pokemon 1 Experience Points -D17A \l -D17B /h HP Stat Expeience -D17C \l +D178 /h +D179 |m Pokemon 1 Experience Points +D17A \l +D17B /h HP Stat Expeience +D17C \l D17D /h Attack Stat Experience -D17E \l +D17E \l D17F /h Defense Stat Experience -D180 \l +D180 \l D181 /h Speed Stat Experience -D182 \l +D182 \l D183 /h Special Stat Experience -D184 \l +D184 \l D185 Diversification -- Defense, Attack (HP) -D186 Diversification -- Special, Speed (HP) -D187 Current/Maximum PP Move 1 -D188 Current/Maximum PP Move 2 -D189 Current/Maximum PP Move 3 -D18A Current/Maximum PP Move 4 -D18B Current Level -D18C /h Pokemon 1 Total Hit Points -D18D \l -D18E /h Pokemon 1 Attack -D18F \l -D190 /h Pokemon 1 Defense -D191 \l -D192 /h Pokemon 1 Speed -D193 \l -D194 /h Pokemon 1 Special -D195 \l -D196 Pokemon 2 Color Map +D186 Diversification -- Special, Speed (HP) +D187 Current/Maximum PP Move 1 +D188 Current/Maximum PP Move 2 +D189 Current/Maximum PP Move 3 +D18A Current/Maximum PP Move 4 +D18B Current Level +D18C /h Pokemon 1 Total Hit Points +D18D \l +D18E /h Pokemon 1 Attack +D18F \l +D190 /h Pokemon 1 Defense +D191 \l +D192 /h Pokemon 1 Speed +D193 \l +D194 /h Pokemon 1 Special +D195 \l +D196 Pokemon 2 Color Map D197 /h D198 \l Pokemon 2 Current Hit Points -D199 Unused -D19A Status -D19B Type 1 (does not affect display) -D19C Type 2 (does not affect display) -D19D Scratch Area -D19E Move 1 ID -D19F Move 2 ID -D1A0 Move 3 ID -D1A1 Move 4 ID -D1A2 /h Pokemon 2 OT ID -D1A3 \l -D1A4 /h -D1A5 |m Pokemon 2 Experience Points -D1A6 \l -D1A7 /h HP Stat Expeience -D1A8 \l +D199 Unused +D19A Status +D19B Type 1 (does not affect display) +D19C Type 2 (does not affect display) +D19D Scratch Area +D19E Move 1 ID +D19F Move 2 ID +D1A0 Move 3 ID +D1A1 Move 4 ID +D1A2 /h Pokemon 2 OT ID +D1A3 \l +D1A4 /h +D1A5 |m Pokemon 2 Experience Points +D1A6 \l +D1A7 /h HP Stat Expeience +D1A8 \l D1A9 /h Attack Stat Experience -D1AA \l +D1AA \l D1AB /h Defense Stat Experience -D1AC \l +D1AC \l D1AD /h Speed Stat Experience -D1AE \l +D1AE \l D1AF /h Special Stat Experience -D1B0 \l -D1B1 Diversification -- Defense, Attack (HP) -D1B2 Diversification -- Special, Speed (HP) -D1B3 Current/Maximum PP Move 1 -D1B4 Current/Maximum PP Move 2 -D1B5 Current/Maximum PP Move 3 -D1B6 Current/Maximum PP Move 4 -D1B7 Current Level -D1B8 /h Pokemon 2 Total Hit Points -D1B9 \l -D1BA /h Pokemon 2 Attack -D1BB \l -D1BC /h Pokemon 2 Defense -D1BD \l -D1BE /h Pokemon 2 Speed -D1BF \l -D1C0 /h Pokemon 2 Special -D1C1 \l -D1C2 Pokemon 3 Color Map -D1C3 /h -D1C4 \l Pokemon 3 Current Hit Points -D1C5 Unused -D1C6 Status -D1C7 Type 1 (does not affect display) -D1C8 Type 2 (does not affect display) -D1C9 Scratch Area -D1CA Move 1 ID -D1CB Move 2 ID -D1CC Move 3 ID -D1CD Move 4 ID +D1B0 \l +D1B1 Diversification -- Defense, Attack (HP) +D1B2 Diversification -- Special, Speed (HP) +D1B3 Current/Maximum PP Move 1 +D1B4 Current/Maximum PP Move 2 +D1B5 Current/Maximum PP Move 3 +D1B6 Current/Maximum PP Move 4 +D1B7 Current Level +D1B8 /h Pokemon 2 Total Hit Points +D1B9 \l +D1BA /h Pokemon 2 Attack +D1BB \l +D1BC /h Pokemon 2 Defense +D1BD \l +D1BE /h Pokemon 2 Speed +D1BF \l +D1C0 /h Pokemon 2 Special +D1C1 \l +D1C2 Pokemon 3 Color Map +D1C3 /h +D1C4 \l Pokemon 3 Current Hit Points +D1C5 Unused +D1C6 Status +D1C7 Type 1 (does not affect display) +D1C8 Type 2 (does not affect display) +D1C9 Scratch Area +D1CA Move 1 ID +D1CB Move 2 ID +D1CC Move 3 ID +D1CD Move 4 ID D1CE /h Pokemon 3 OT ID D1CF \l -D1D0 /h -D1D1 |m Pokemon 3 Experience Points -D1D2 \l -D1D3 /h HP Stat Expeience -D1D4 \l +D1D0 /h +D1D1 |m Pokemon 3 Experience Points +D1D2 \l +D1D3 /h HP Stat Expeience +D1D4 \l D1D5 /h Attack Stat Experience -D1D6 \l +D1D6 \l D1D7 /h Defense Stat Experience -D1D8 \l +D1D8 \l D1D9 /h Speed Stat Experience -D1DA \l +D1DA \l D1DB /h Special Stat Experience -D1DC \l -D1DD Diversification -- Defense, Attack (HP) -D1DE Diversification -- Special, Speed (HP) -D1DF Current/Maximum PP Move 1 -D1E0 Current/Maximum PP Move 2 -D1E1 Current/Maximum PP Move 3 -D1E2 Current/Maximum PP Move 4 -D1E3 Current Level -D1E4 /h Pokemon 3 Total Hit Points -D1E5 \l -D1E6 /h Pokemon 3 Attack -D1E7 \l -D1E8 /h Pokemon 3 Defense -D1E9 \l -D1EA /h Pokemon 3 Speed -D1EB \l -D1EC /h Pokemon 3 Special -D1ED \l +D1DC \l +D1DD Diversification -- Defense, Attack (HP) +D1DE Diversification -- Special, Speed (HP) +D1DF Current/Maximum PP Move 1 +D1E0 Current/Maximum PP Move 2 +D1E1 Current/Maximum PP Move 3 +D1E2 Current/Maximum PP Move 4 +D1E3 Current Level +D1E4 /h Pokemon 3 Total Hit Points +D1E5 \l +D1E6 /h Pokemon 3 Attack +D1E7 \l +D1E8 /h Pokemon 3 Defense +D1E9 \l +D1EA /h Pokemon 3 Speed +D1EB \l +D1EC /h Pokemon 3 Special +D1ED \l D1EE Pokemon 4 Color Map -D1EF /h -D1F0 \l Pokemon 4 Current Hit Points -D1F1 Unused -D1F2 Status -D1F3 Type 1 (does not affect display) -D1F4 Type 2 (does not affect display) -D1F5 Scratch Area -D1F6 Move 1 ID -D1F7 Move 2 ID -D1F8 Move 3 ID -D1F9 Move 4 ID +D1EF /h +D1F0 \l Pokemon 4 Current Hit Points +D1F1 Unused +D1F2 Status +D1F3 Type 1 (does not affect display) +D1F4 Type 2 (does not affect display) +D1F5 Scratch Area +D1F6 Move 1 ID +D1F7 Move 2 ID +D1F8 Move 3 ID +D1F9 Move 4 ID D1FA /h Pokemon 4 OT ID D1FB \l -D1FC /h -D1FD |m Pokemon 4 Experience Points -D1FE \l -D1FF /h HP Stat Expeience -D200 \l +D1FC /h +D1FD |m Pokemon 4 Experience Points +D1FE \l +D1FF /h HP Stat Expeience +D200 \l D201 /h Attack Stat Experience -D202 \l +D202 \l D203 /h Defense Stat Experience -D204 \l +D204 \l D205 /h Speed Stat Experience -D206 \l +D206 \l D207 /h Special Stat Experience -D208 \l -D209 Diversification -- Defense, Attack (HP) -D20A Diversification -- Special, Speed (HP) -D20B Current/Maximum PP Move 1 -D20C Current/Maximum PP Move 2 -D20D Current/Maximum PP Move 3 -D20E Current/Maximum PP Move 4 -D20F Current Level -D210 /h Pokemon 4 Total Hit Points -D211 \l -D212 /h Pokemon 4 Attack -D213 \l -D214 /h Pokemon 4 Defense -D215 \l -D216 /h Pokemon 4 Speed -D217 \l -D218 /h Pokemon 4 Special -D219 \l +D208 \l +D209 Diversification -- Defense, Attack (HP) +D20A Diversification -- Special, Speed (HP) +D20B Current/Maximum PP Move 1 +D20C Current/Maximum PP Move 2 +D20D Current/Maximum PP Move 3 +D20E Current/Maximum PP Move 4 +D20F Current Level +D210 /h Pokemon 4 Total Hit Points +D211 \l +D212 /h Pokemon 4 Attack +D213 \l +D214 /h Pokemon 4 Defense +D215 \l +D216 /h Pokemon 4 Speed +D217 \l +D218 /h Pokemon 4 Special +D219 \l D21A Pokemon 5 Color Map -D21B /h -D21C \l Pokemon 5 Current Hit Points -D21D Unused -D21E Status -D21F Type 1 (does not affect display) -D220 Type 2 (does not affect display) -D221 Scratch Area -D222 Move 1 ID -D223 Move 2 ID -D224 Move 3 ID -D225 Move 4 ID -D226 /h Pokemon 5 OT ID -D227 \l -D228 /h -D229 |m Pokemon 5 Experience Points -D22A \l -D22B /h HP Stat Expeience -D22C \l +D21B /h +D21C \l Pokemon 5 Current Hit Points +D21D Unused +D21E Status +D21F Type 1 (does not affect display) +D220 Type 2 (does not affect display) +D221 Scratch Area +D222 Move 1 ID +D223 Move 2 ID +D224 Move 3 ID +D225 Move 4 ID +D226 /h Pokemon 5 OT ID +D227 \l +D228 /h +D229 |m Pokemon 5 Experience Points +D22A \l +D22B /h HP Stat Expeience +D22C \l D22D /h Attack Stat Experience -D22E \l +D22E \l D22F /h Defense Stat Experience -D230 \l +D230 \l D231 /h Speed Stat Experience -D232 \l +D232 \l D233 /h Special Stat Experience -D234 \l -D235 Diversification -- Defense, Attack (HP) -D236 Diversification -- Special, Speed (HP) -D237 Current/Maximum PP Move 1 -D238 Current/Maximum PP Move 2 -D239 Current/Maximum PP Move 3 -D23A Current/Maximum PP Move 4 -D23B Current Level -D23C /h Pokemon 5 Total Hit Points -D23D \l -D23E /h Pokemon 5 Attack -D23F \l -D240 /h Pokemon 5 Defense -D241 \l -D242 /h Pokemon 5 Speed -D243 \l -D244 /h Pokemon 5 Special -D245 \l -D246 Pokemon 6 Color Map -D247 /h -D248 \l Pokemon 6 Current Hit Points -D249 Unused -D24A Status -D24B Type 1 (does not affect display) -D24C Type 2 (does not affect display) -D24D Scratch Area -D24E Move 1 ID -D24F Move 2 ID -D250 Move 3 ID -D251 Move 4 ID -D252 /h Pokemon 6 OT ID -D253 \l -D254 /h -D255 |m Pokemon 6 Experience Points -D256 \l -D257 /h HP Stat Expeience -D258 \l +D234 \l +D235 Diversification -- Defense, Attack (HP) +D236 Diversification -- Special, Speed (HP) +D237 Current/Maximum PP Move 1 +D238 Current/Maximum PP Move 2 +D239 Current/Maximum PP Move 3 +D23A Current/Maximum PP Move 4 +D23B Current Level +D23C /h Pokemon 5 Total Hit Points +D23D \l +D23E /h Pokemon 5 Attack +D23F \l +D240 /h Pokemon 5 Defense +D241 \l +D242 /h Pokemon 5 Speed +D243 \l +D244 /h Pokemon 5 Special +D245 \l +D246 Pokemon 6 Color Map +D247 /h +D248 \l Pokemon 6 Current Hit Points +D249 Unused +D24A Status +D24B Type 1 (does not affect display) +D24C Type 2 (does not affect display) +D24D Scratch Area +D24E Move 1 ID +D24F Move 2 ID +D250 Move 3 ID +D251 Move 4 ID +D252 /h Pokemon 6 OT ID +D253 \l +D254 /h +D255 |m Pokemon 6 Experience Points +D256 \l +D257 /h HP Stat Expeience +D258 \l D259 /h Attack Stat Experience -D25A \l +D25A \l D25B /h Defense Stat Experience -D25C \l +D25C \l D25D /h Speed Stat Experience -D25E \l +D25E \l D25F /h Special Stat Experience -D260 \l -D261 Diversification -- Defense, Attack (HP) -D262 Diversification -- Special, Speed (HP) -D263 Current/Maximum PP Move 1 -D264 Current/Maximum PP Move 2 -D265 Current/Maximum PP Move 3 -D266 Current/Maximum PP Move 4 -D267 Current Level -D268 /h Pokemon 6 Total Hit Points -D269 \l -D26A /h Pokemon 6 Attack -D26B \l -D26C /h Pokemon 6 Defense -D26D \l -D26E /h Pokemon 6 Speed -D26F \l -D270 /h Pokemon 6 Special -D271 \l -D272 --- -D273 / -D274 | -D275 | -D276 | +D260 \l +D261 Diversification -- Defense, Attack (HP) +D262 Diversification -- Special, Speed (HP) +D263 Current/Maximum PP Move 1 +D264 Current/Maximum PP Move 2 +D265 Current/Maximum PP Move 3 +D266 Current/Maximum PP Move 4 +D267 Current Level +D268 /h Pokemon 6 Total Hit Points +D269 \l +D26A /h Pokemon 6 Attack +D26B \l +D26C /h Pokemon 6 Defense +D26D \l +D26E /h Pokemon 6 Speed +D26F \l +D270 /h Pokemon 6 Special +D271 \l +D272 --- +D273 / +D274 | +D275 | +D276 | D277 | OT pokemon 1 -D278 | -D279 | -D27A | -D27B \ -D27C --- -D27D --- -D27E / -D27F | -D280 | -D281 | +D278 | +D279 | +D27A | +D27B \ +D27C --- +D27D --- +D27E / +D27F | +D280 | +D281 | D282 | OT pokemon 2 -D283 | -D284 | -D285 | -D286 \ -D287 --- -D288 --- -D289 / -D28A | -D28B | -D28C | +D283 | +D284 | +D285 | +D286 \ +D287 --- +D288 --- +D289 / +D28A | +D28B | +D28C | D28D | OT pokemon 3 -D28E | -D28F | -D290 | -D291 \ -D292 --- -D293 --- -D294 / -D295 | -D296 | -D297 | +D28E | +D28F | +D290 | +D291 \ +D292 --- +D293 --- +D294 / +D295 | +D296 | +D297 | D298 | OT pokemon 4 -D299 | -D29A | -D29B | -D29C \ -D29D --- -D29E --- -D29F / -D2A0 | -D2A1 | -D2A2 | +D299 | +D29A | +D29B | +D29C \ +D29D --- +D29E --- +D29F / +D2A0 | +D2A1 | +D2A2 | D2A3 | OT pokemon 5 -D2A4 | -D2A5 | -D2A6 | -D2A7 \ -D2A8 --- -D2A9 --- -D2AA / -D2AB | -D2AC | -D2AD | +D2A4 | +D2A5 | +D2A6 | +D2A7 \ +D2A8 --- +D2A9 --- +D2AA / +D2AB | +D2AC | +D2AD | D2AE | OT pokemon 6 -D2AF | -D2B0 | -D2B1 | -D2B2 \ -D2B3 --- -D2B4 --- -D2B5 / -D2B6 | -D2B7 | -D2B8 | -D2B9 | Pokemon 1 Name -D2BA | -D2BB | -D2BC | -D2BD \ -D2BE --- -D2BF --- -D2C0 / -D2C1 | -D2C2 | -D2C3 | -D2C4 | Pokemon 2 Name -D2C5 | -D2C6 | -D2C7 | -D2C8 \ -D2C9 --- -D2CA --- -D2CB / -D2CC | -D2CD | -D2CE | -D2CF | Pokemon 3 Name -D2D0 | -D2D1 | -D2D2 | -D2D3 \ -D2D4 --- -D2D5 --- -D2D6 / -D2D7 | -D2D8 | -D2D9 | -D2DA | Pokemon 4 Name -D2DB | -D2DC | -D2DD | -D2DE \ -D2DF --- -D2E0 --- -D2E1 / -D2E2 | -D2E3 | -D2E4 | -D2E5 | Pokemon 5 Name -D2E6 | -D2E7 | -D2E8 | -D2E9 \ -D2EA --- -D2EB --- -D2EC / -D2ED | -D2EE | -D2EF | -D2F0 | Pokemon 6 Name -D2F1 | -D2F2 | -D2F3 | -D2F4 \ -D2F5 --- -D2F6 -D2F7 -D2F8 -D2F9 -D2FA -D2FB -D2FC -D2FD -D2FE -D2FF -D300 -D301 -D302 -D303 -D304 -D305 -D306 -D307 -D308 -D309 -D30A -D30B -D30C -D30D -D30E -D30F -D310 -D311 -D312 -D313 -D314 -D315 -D316 -D317 -D318 -D319 -D31A -D31B -D31C -D31D -D31E -D31F -D320 -D321 -D322 -D323 -D324 -D325 -D326 -D327 -D328 -D329 -D32A -D32B -D32C -D32D -D32E -D32F -D330 -D331 -D332 -D333 -D334 -D335 -D336 -D337 -D338 -D339 -D33A -D33B -D33C -D33D -D33E -D33F -D340 -D341 -D342 -D343 -D344 +D2AF | +D2B0 | +D2B1 | +D2B2 \ +D2B3 --- +D2B4 --- +D2B5 / +D2B6 | +D2B7 | +D2B8 | +D2B9 | Pokemon 1 Name +D2BA | +D2BB | +D2BC | +D2BD \ +D2BE --- +D2BF --- +D2C0 / +D2C1 | +D2C2 | +D2C3 | +D2C4 | Pokemon 2 Name +D2C5 | +D2C6 | +D2C7 | +D2C8 \ +D2C9 --- +D2CA --- +D2CB / +D2CC | +D2CD | +D2CE | +D2CF | Pokemon 3 Name +D2D0 | +D2D1 | +D2D2 | +D2D3 \ +D2D4 --- +D2D5 --- +D2D6 / +D2D7 | +D2D8 | +D2D9 | +D2DA | Pokemon 4 Name +D2DB | +D2DC | +D2DD | +D2DE \ +D2DF --- +D2E0 --- +D2E1 / +D2E2 | +D2E3 | +D2E4 | +D2E5 | Pokemon 5 Name +D2E6 | +D2E7 | +D2E8 | +D2E9 \ +D2EA --- +D2EB --- +D2EC / +D2ED | +D2EE | +D2EF | +D2F0 | Pokemon 6 Name +D2F1 | +D2F2 | +D2F3 | +D2F4 \ +D2F5 --- +D2F6 Pokedex Caught 1-8 +D2F7 Pokedex Caught 9-16 +D2F8 Pokedex Caught 17-24 +D2F9 Pokedex Caught 25-32 +D2FA Pokedex Caught 33-40 +D2FB Pokedex Caught 41-48 +D2FC Pokedex Caught 49-56 +D2FD Pokedex Caught 57-64 +D2FE Pokedex Caught 65-72 +D2FF Pokedex Caught 73-80 +D300 Pokedex Caught 81-88 +D301 Pokedex Caught 89-96 +D302 Pokedex Caught 97-104 +D303 Pokedex Caught 105-112 +D304 Pokedex Caught 113-120 +D305 Pokedex Caught 121-128 +D306 Pokedex Caught 129-136 +D307 Pokedex Caught 137-144 +D308 Pokedex Caught 145-152 +D309 Pokedex Seen 1-8 +D30A Pokedex Seen 9-16 +D30B Pokedex Seen 17-24 +D30C Pokedex Seen 25-32 +D30D Pokedex Seen 33-40 +D30E Pokedex Seen 41-48 +D30F Pokedex Seen 49-56 +D310 Pokedex Seen 57-64 +D311 Pokedex Seen 65-72 +D312 Pokedex Seen 73-80 +D313 Pokedex Seen 81-88 +D314 Pokedex Seen 89-96 +D315 Pokedex Seen 97-104 +D316 Pokedex Seen 105-112 +D317 Pokedex Seen 113-120 +D318 Pokedex Seen 121-128 +D319 Pokedex Seen 129-136 +D31A Pokedex Seen 137-144 +D31B Pokedex Seen 145-152 +D31C Number of Held Items +D31D Item 1 Type +D31E Item 1 Quantity +D31F Item 2 Type +D320 Item 2 Quantity +D321 Item 3 Type +D322 Item 3 Quantity +D323 Item 4 Type +D324 Item 4 Quantity +D325 Item 5 Type +D326 Item 5 Quantity +D327 Item 6 Type +D328 Item 6 Quantity +D329 Item 7 Type +D32A Item 7 Quantity +D32B Item 8 Type +D32C Item 8 Quantity +D32D Item 9 Type +D32E Item 9 Quantity +D32F Item 10 Type +D330 Item 10 Quantity +D331 Item 11 Type +D332 Item 11 Quantity +D333 Item 12 Type +D334 Item 12 Quantity +D335 Item 13 Type +D336 Item 13 Quantity +D337 Item 14 Type +D338 Item 14 Quantity +D339 Item 15 Type +D33A Item 15 Quantity +D33B Item 16 Type +D33C Item 16 Quantity +D33D Item 17 Type +D33E Item 17 Quantity +D33F Item 18 Type +D340 Item 18 Quantity +D341 Item 19 Type +D342 Item 19 Quantity +D343 Item 20 Type +D344 Item 20 Quantity D345 D346 D347 diff -r 2fac825a4de9 -r c9a855de1d07 clojure/com/aurellem/exp/play.clj --- a/clojure/com/aurellem/exp/play.clj Sat Mar 24 00:13:06 2012 -0500 +++ b/clojure/com/aurellem/exp/play.clj Sat Mar 24 03:10:56 2012 -0500 @@ -3,8 +3,9 @@ (:use (com.aurellem.gb gb-driver util constants assembly saves items pokemon status types - characters species moves)) + characters species moves + pokedex)) + (:import java.io.File) (:import [com.aurellem.gb.gb_driver SaveState])) - diff -r 2fac825a4de9 -r c9a855de1d07 clojure/com/aurellem/gb/constants.clj --- a/clojure/com/aurellem/gb/constants.clj Sat Mar 24 00:13:06 2012 -0500 +++ b/clojure/com/aurellem/gb/constants.clj Sat Mar 24 03:10:56 2012 -0500 @@ -7,4 +7,6 @@ (def name-width 11) (def pokemon-record-begin 0xD162) -(def pokemon-record-end 0xD2F5) \ No newline at end of file +(def pokemon-record-end 0xD2F5) + +(def D-memory-end 0xD41B) \ No newline at end of file diff -r 2fac825a4de9 -r c9a855de1d07 clojure/com/aurellem/gb/items.clj --- a/clojure/com/aurellem/gb/items.clj Sat Mar 24 00:13:06 2012 -0500 +++ b/clojure/com/aurellem/gb/items.clj Sat Mar 24 03:10:56 2012 -0500 @@ -1,6 +1,5 @@ (ns com.aurellem.gb.items (:use (com.aurellem.gb gb-driver util)) - ;; this is bullshit (:import [com.aurellem.gb.gb_driver SaveState])) (defn game-name diff -r 2fac825a4de9 -r c9a855de1d07 clojure/com/aurellem/gb/pokedex.clj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clojure/com/aurellem/gb/pokedex.clj Sat Mar 24 03:10:56 2012 -0500 @@ -0,0 +1,76 @@ +(ns com.aurellem.gb.pokedex + (:use (com.aurellem.gb gb-driver util species)) + (:import [com.aurellem.gb.gb_driver SaveState])) + +(def pokedex-seen-start-address 0xD309) + +(def pokedex-captured-start-address 0xD2F6) + +(defn pokedex-offset [capture? species-num] + (+ (if capture? + pokedex-captured-start-address + pokedex-seen-start-address) + (int (/ species-num 8)))) + +(defn read-pokedex + ([^SaveState state capture? species-num] + (bit-test + (aget (memory state) + (pokedex-offset capture? species-num)) + (rem species-num 8)))) + +(defn set-pokedex + ([^SaveState state capture? set? species-num] + (let [target (pokedex-offset capture? species-num) + current-bits + (aget (memory state) + (pokedex-offset capture? species-num)) + bit-offset (rem species-num 8)] + (set-memory + state target + (if set? + (bit-set current-bits bit-offset) + (bit-clear current-bits bit-offset)))))) + +(defn read-pokedex-seen + ([^SaveState state species-num] + (read-pokedex state false species-num)) + ([species-num] + (read-pokedex-seen @current-state species-num))) + +(defn set-pokedex-seen + ([^SaveState state species-num] + (set-pokedex state false species-num)) + ([species-num] + (set-pokedex-seen @current-state species-num))) + +(defn read-pokedex-captured + ([^SaveState state species-num] + (read-pokedex state true species-num)) + ([species-num] + (read-pokedex-captured @current-state species-num))) + +(defn set-pokedex-captured + ([^SaveState state species-num] + (set-pokedex state true species-num)) + ([species-num] + (set-pokedex-captured @current-state species-num))) + +(defn print-pokedex + ([^SaveState state] + (println "+-----------+-------+-------+") + (println "|Pokemon | Seen? | Capt? |") + (println "+-----------+-------+-------+") + (dorun + (map + #(printf "|%-11s|%s|%s|\n" %1 %2 %3) + (map #(.toUpperCase (.substring (str %) 1)) + (map pokedex-num->species-name (range 1 152))) + (map #(if % " X " " ") + (map read-pokedex-seen (range 152))) + (map #(if % " X " " ") + (map read-pokedex-captured (range 152))))) + (println "+-----------+-------+-------+")) + + ([] (print-pokedex @current-state))) + \ No newline at end of file diff -r 2fac825a4de9 -r c9a855de1d07 clojure/com/aurellem/gb/species.clj --- a/clojure/com/aurellem/gb/species.clj Sat Mar 24 00:13:06 2012 -0500 +++ b/clojure/com/aurellem/gb/species.clj Sat Mar 24 03:10:56 2012 -0500 @@ -3,10 +3,12 @@ constants)) (:import [com.aurellem.gb.gb_driver SaveState])) + + (def species-code->species-name {0x01 :rhydon 0x02 :kangaskhan - 0x03 :nidoran-male + 0x03 :nidoran♂ 0x04 :clefairy 0x05 :spearow 0x06 :voltorb @@ -18,7 +20,7 @@ 0x0C :exeggcute 0x0D :grimer 0x0E :gengar - 0x0F :nidoran-female + 0x0F :nidoran♀ 0x10 :nidoqueen 0x11 :cubone 0x12 :rhyhorn @@ -72,15 +74,15 @@ 0x4D :meowth 0x4E :krabby 0x52 :vulpix - 0x53 :ninetails + 0x53 :ninetales 0x54 :pikachu - 0x55 :riachu + 0x55 :raichu 0x58 :dratini 0x59 :dragonair 0x5A :kabuto 0x5B :kabutops 0x5C :horsea - 0x5D :sedra + 0x5D :seadra 0x60 :sandshrew 0x61 :sandslash 0x62 :omanyte @@ -120,7 +122,7 @@ 0x8B :cloyster 0x8D :electrode 0x8E :clefable - 0x8F :wheezing + 0x8F :weezing 0x90 :persian 0x91 :marowak 0x93 :haunter @@ -153,7 +155,7 @@ 0xBA :gloom 0xBB :vileplume 0xBC :bellsprout - 0xBD :weepenbell + 0xBD :weepinbell 0xBE :victreebel}) (def species-ID-1 0xD163) @@ -212,4 +214,313 @@ ([poke-num new-species] (set-species2 @current-state poke-num new-species))) - \ No newline at end of file + +(def pokedex-num->species-name + {1 :bulbasaur + 2 :ivysaur + 3 :venusaur + 4 :charmander + 5 :charmeleon + 6 :charizard + 7 :squirtle + 8 :wartortle + 9 :blastoise + 10 :caterpie + 11 :metapod + 12 :butterfree + 13 :weedle + 14 :kakuna + 15 :beedrill + 16 :pidgey + 17 :pidgeotto + 18 :pidgeot + 19 :rattata + 20 :raticate + 21 :spearow + 22 :fearow + 23 :ekans + 24 :arbok + 25 :pikachu + 26 :raichu + 27 :sandshrew + 28 :sandslash + 29 :nidoran♀ + 30 :nidorina + 31 :nidoqueen + 32 :nidoran♂ + 33 :nidorino + 34 :nidoking + 35 :clefairy + 36 :clefable + 37 :vulpix + 38 :ninetales + 39 :jigglypuff + 40 :wigglytuff + 41 :zubat + 42 :golbat + 43 :oddish + 44 :gloom + 45 :vileplume + 46 :paras + 47 :parasect + 48 :venonat + 49 :venomoth + 50 :diglett + 51 :dugtrio + 52 :meowth + 53 :persian + 54 :psyduck + 55 :golduck + 56 :mankey + 57 :primeape + 58 :growlithe + 59 :arcanine + 60 :poliwag + 61 :poliwhirl + 62 :poliwrath + 63 :abra + 64 :kadabra + 65 :alakazam + 66 :machop + 67 :machoke + 68 :machamp + 69 :bellsprout + 70 :weepinbell + 71 :victreebel + 72 :tentacool + 73 :tentacruel + 74 :geodude + 75 :graveler + 76 :golem + 77 :ponyta + 78 :rapidash + 79 :slowpoke + 80 :slowbro + 81 :magnemite + 82 :magneton + 83 :farfetch + 84 :doduo + 85 :dodrio + 86 :seel + 87 :dewgong + 88 :grimer + 89 :muk + 90 :shellder + 91 :cloyster + 92 :gastly + 93 :haunter + 94 :gengar + 95 :onix + 96 :drowzee + 97 :hypno + 98 :krabby + 99 :kingler + 100 :voltorb + 101 :electrode + 102 :exeggcute + 103 :exeggutor + 104 :cubone + 105 :marowak + 106 :hitmonlee + 107 :hitmonchan + 108 :lickitung + 109 :koffing + 110 :weezing + 111 :rhyhorn + 112 :rhydon + 113 :chansey + 114 :tangela + 115 :kangaskhan + 116 :horsea + 117 :seadra + 118 :goldeen + 119 :seaking + 120 :staryu + 121 :starmie + 122 :mr-mime + 123 :scyther + 124 :jynx + 125 :electabuzz + 126 :magmar + 127 :pinsir + 128 :tauros + 129 :magikarp + 130 :gyarados + 131 :lapras + 132 :ditto + 133 :eevee + 134 :vaporeon + 135 :jolteon + 136 :flareon + 137 :porygon + 138 :omanyte + 139 :omastar + 140 :kabuto + 141 :kabutops + 142 :aerodactyl + 143 :snorlax + 144 :articuno + 145 :zapdos + 146 :moltres + 147 :dratini + 148 :dragonair + 149 :dragonite + 150 :mewtwo + 151 :mew}) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 2fac825a4de9 -r c9a855de1d07 clojure/com/aurellem/gb/util.clj --- a/clojure/com/aurellem/gb/util.clj Sat Mar 24 00:13:06 2012 -0500 +++ b/clojure/com/aurellem/gb/util.clj Sat Mar 24 03:10:56 2012 -0500 @@ -1,8 +1,8 @@ (ns com.aurellem.gb.util - (:use (com.aurellem.gb gb-driver vbm)) + (:use (com.aurellem.gb gb-driver vbm constants)) + (:import java.io.File) (:import [com.aurellem.gb.gb_driver SaveState])) - (defn A [state] (bit-shift-right (bit-and 0x0000FF00 (AF state)) 8)) @@ -145,4 +145,30 @@ (+ (glue-bytes m l) (bit-shift-left h 16)))) +(def cartography + (File. user-home + "proj/vba-clojure/clojure/com/aurellem/exp/cartography")) + + +(defn print-D-memory + ([^SaveState state] + + (let [descriptions + (clojure.string/split-lines + (slurp cartography))] + (dorun + (map + (fn [line data desc] + (printf "%04X %02X%s\n" + line data (apply str + (drop 20 desc)))) + (range pokemon-record-begin + (inc D-memory-end)) + + (subvec (vec (memory state)) + pokemon-record-begin + (inc D-memory-end)) + descriptions)))) + ([] (print-D-memory @current-state))) +