# HG changeset patch
# User Robert McIntyre <rlm@mit.edu>
# Date 1333166738 18000
# Node ID bc1f62b269b51d0b7438006ef223cef42b83546f
# Parent  eb8d1d7941ec36c8e96782ffdf499aea119bd9b7
found program that works as valid items, but now the program is too long...

diff -r eb8d1d7941ec -r bc1f62b269b5 clojure/com/aurellem/exp/notes.txt
--- a/clojure/com/aurellem/exp/notes.txt	Fri Mar 30 22:48:31 2012 -0500
+++ b/clojure/com/aurellem/exp/notes.txt	Fri Mar 30 23:05:38 2012 -0500
@@ -2,8 +2,8 @@
 
 start game
 
-name rival "<space><PK>G<PK>G<PK>" 
-(0x7F 0xE1 0x86 0xE1 0x86 0xE1 in character codes)
+name rival "L<PK>T<PK>" 
+(0x8B 0xE1 0x93 0xE1 in character codes)
 
 get pikachu, fight rival, deliver oak's parcel, go back to
 viridian poke mart.
@@ -16,7 +16,7 @@
 
 buy a pokeball to repair item-list
 
-buy 1 pokeball, 1 potion, 1 antidote, 1 parlyz heal, and
+buy 1 potion, 1 antidote, 1 parlyz heal, 2 pokeballs, and
 96 burn heals
 
 95 burn heals spells out the address that will safely return
@@ -34,55 +34,9 @@
 0x01
 [end repeat]
 
-0x00
-0xFA          -- first part of "Load A from Literal address"
-
-third rival's name character
-xD5           -- target item address
-
-0x00
-0x3C          -- increment A register
-
-0x00
-0xEA          -- first part of "Save A to literal address"
-
-fifth rival's name character
-xD5           -- target item address
-
-0x00
-0xC3          -- first part of "Absolute Jump to literal address"
-
-burn-heal
-x 95          -- address of Route 3 memory-function
-
-0x00
-0x??
-
-Drop enough from rival's first character/ second character
-as an item so that it is [0x7F 0xD5] instead of [0x7F 0xE1].
-
-shift rival's name's first two characters into
-mem-function-address.
-
-now close the menu and continue item manipulations using the
-newly constructed program.  Starting and then canceling the
-start menu activates the program.
-
-**********  END Game Sequence
-
-
-
-
-[repeat 35 times]
-0xFF
-0x01
-[end repeat]
-
-
 ;;; program to swap item ID and quantity at fixed address.
 ;; here target is equal to rival's thrid and fourth character
 
-
 0x00
 0x21  ;; load target into HL
 
@@ -90,6 +44,15 @@
 xD5     -- target item address
 
 0x00
+0x18  ;; jump relative
+
+pokeball ;; pokeball = 0x04, so
+x any    ;; jump over the next four bytes
+
+target-item type
+target-item quantity
+
+0x00
 0x2A  ;; save (HL)=(target) to A, increment HL
 
 0x00
@@ -104,12 +67,31 @@
 0x00
 0x70  ;; load B into target+1 [(target) -> target+1]
 
+0x00
+0xC3  ;; first part of absolute jump
 
+burn-heal
+x 95          -- address of Route 3 memory-function
 
 
+Drop enough from rival's first character/ second character
+as an item so that it is [_ 0xD5] instead of [_ 0xE1].
 
+shift rival's name's first two characters into
+mem-function-address.
 
+now close the menu and continue item manipulations using the
+newly constructed program.  Starting and then canceling the
+start menu activates the program.
 
+**********  END Game Sequence
+
+
+
+
+
+
+************  Misc Notes.
 
 valid start addresses for the initial bootstrap program are
 the following: