comparison clojure/com/aurellem/exp/notes.txt @ 301:1de6aada1cb7

inserted backwards jump into bootstrap program to fit it into item-pc space
author Robert McIntyre <rlm@mit.edu>
date Fri, 30 Mar 2012 23:39:58 -0500
parents bc1f62b269b5
children 0b3e89103dc2
comparison
equal deleted inserted replaced
300:bc1f62b269b5 301:1de6aada1cb7
1 ******** Game Sequence 1 ******** Game Sequence
2 2
3 start game 3 start game
4 4
5 name rival "L<PK>T<PK>" 5 name rival "L<PK>T<PK><PK><any-character>"
6 (0x8B 0xE1 0x93 0xE1 in character codes) 6 (0x8B 0xE1 0x93 0xE1 in character codes)
7 7
8 get pikachu, fight rival, deliver oak's parcel, go back to 8 get pikachu, fight rival, deliver oak's parcel, go back to
9 viridian poke mart. 9 viridian poke mart.
10 10
27 27
28 Deposit things from your item list to get the following 28 Deposit things from your item list to get the following
29 pattern in the item computer. You can do this with what is 29 pattern in the item computer. You can do this with what is
30 in your item list because of the previous setup. 30 in your item list because of the previous setup.
31 31
32 [repeat following 35 times] 32 [repeat the following 24 times]
33 0xFF 33 0xFF
34 0x01 34 0x01
35 [end repeat] 35 [end repeat]
36 36
37 ;;; program to swap item ID and quantity at fixed address. 37 ;; Second part of program to swap item ID and quantity at
38 ;; here target is equal to rival's thrid and fourth character 38 ;; fixed address.
39 39
40 0x00 40 0x00 ;; this starts at address 0xD56C
41 0x21 ;; load target into HL
42
43 third rival's name character
44 xD5 -- target item address
45
46 0x00
47 0x18 ;; jump relative
48
49 pokeball ;; pokeball = 0x04, so
50 x any ;; jump over the next four bytes
51
52 target-item type
53 target-item quantity
54
55 0x00
56 0x2A ;; save (HL)=(target) to A, increment HL 41 0x2A ;; save (HL)=(target) to A, increment HL
57 42
58 0x00 43 0x00
59 0x47 ;; save A to B 44 0x47 ;; save A to B
60 45
61 0x00 46 0x00
62 0x3A ;; save (target+1) to A, decrement HL 47 0x3A ;; save (target+1) to A, decrement HL
63 48
64 0x00 49 0x00
65 0x22 ;; save A to target, increment HL [(target+1) -> target] 50 0x22 ;; save A to target, increment HL [(target+1) -> target]
66 51
67 0x00 52 0x00
68 0x70 ;; load B into target+1 [(target) -> target+1] 53 0x70 ;; load B into target+1 [(target) -> target+1]
69 54
70 0x00 55 0x00
71 0xC3 ;; first part of absolute jump 56 0xC3 ;; first part of absolute jump
72 57
73 burn-heal 58 burn-heal
74 x 95 -- address of Route 3 memory-function 59 x 95 -- address of Route 3 memory-function
75 60
61 [repeat the following 8 times]
62 0xFF
63 0x01
64 [end repeat]
76 65
77 Drop enough from rival's first character/ second character 66 0x00 ;; this starts at address 0xD58B
67 0x21 ;; load target into HL
68
69 third rival's name character
70 x D5 -- target item address
71
72 0x00
73 0x18 ;; jump relative
74
75 fifth rival's name character (PK) (TM25) (0xE1 == -31)
76 x any
77
78 target-item type
79 target-item quantity
80
81
82
83 Drop enough from rival's first character/ third character
78 as an item so that it is [_ 0xD5] instead of [_ 0xE1]. 84 as an item so that it is [_ 0xD5] instead of [_ 0xE1].
79 85
80 shift rival's name's first two characters into 86 shift rival's name's first two characters into
81 mem-function-address. 87 mem-function-address.
82 88
134 0x99 "Z" ; [x] 140 0x99 "Z" ; [x]
135 0x9A "(" ; [key] 141 0x9A "(" ; [key]
136 0x9B ")" ; [x] 142 0x9B ")" ; [x]
137 0x9C ":" ; [x] 143 0x9C ":" ; [x]
138 --- last valid character for target 144 --- last valid character for target
145
146
147
148 ;;; character canadates for jump-relative backwards
149
150 0xE1 "PK" ; [TM25]
151 0xE2 "MN" ; [TM26]
152 0xE6 "?" ; [TM30]
153 0xE7 "!" ; [TM31]
154 0xE8 "." ; [TM32]