Mercurial > vba-clojure
view clojure/com/aurellem/pokemon.clj @ 143:cd930ed1fd4d
determined location of sixth pokemon's name's first character.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 19 Mar 2012 20:30:37 -0500 |
parents | b12d2408fd9b |
children |
line wrap: on
line source
1 (ns com.aurellem.pokemon2 "Here I find out how pokemon are stored in memory."3 (:use (com.aurellem gb-driver vbm4 rival-name5 title save-corruption items assembly))6 (:use com.aurellem.experiments.items)7 (:import [com.aurellem.gb_driver SaveState]))10 (def pidgeot-lvl-36 (mid-game))13 (def pidgeot-lvl-37 (read-state "pidgeot-lvl-37"))16 (def pidgeot-lvl-38 (read-state "pidgeot-lvl-38"))19 (def pidgeot-lvl-39 (read-state "pidgeot-lvl-39"))22 (def pidgeot-lvl-40 (read-state "pidgeot-lvl-40"))25 (defn level-analysis []26 (apply common-differences27 (map (comp vec memory)28 [pidgeot-lvl-3629 pidgeot-lvl-3730 pidgeot-lvl-3831 pidgeot-lvl-3932 pidgeot-lvl-40])))34 ;; inconclusive -- implies that level is calculated from35 ;; some other values.38 (def name-pidgeotto (read-state "name-pidgeotto"))39 (def named-A (read-state "named-A"))40 (def named-B (read-state "named-B"))41 (def named-C (read-state "named-C"))42 (def named-D (read-state "named-D"))43 (def named-E (read-state "named-E"))44 (def named-F (read-state "named-F"))46 (defn name-analysis []47 (apply common-differences48 (map (comp vec memory)49 [named-A50 named-B51 named-C52 named-D53 named-E54 named-F])))56 ;; resluted in 3 separate locations that could57 ;; possibly hold the first letter of the pokemon's name59 0xCF4A60 0xD2EB61 0xCEED63 ;; try changing each of them66 (defn test-cf4a []67 (continue!68 (set-memory named-A 0xCF4A (character->character-code "Z"))))69 ;; result -- pidgeotto named "A"71 (defn test-d2eb []72 (continue!73 (set-memory named-A 0xD2EB (character->character-code "Z"))))74 ;; result -- pidgeotto named "Z"76 (defn test-ceed []77 (continue!78 (set-memory named-A 0xCEED (character->character-code "Z"))))79 ;; result -- pidgeotto named "A"81 (def sixth-pokemon-name-start 0xD2EB)84 (defn set-sixth-pokemon-name-first-character85 ([state character]86 (set-memory state sixth-pokemon-name-start87 (character->character-code character)))88 ([character]89 (set-sixth-pokemon-name-first-character @current-state90 character)))