-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpatch.txt
268 lines (222 loc) · 6.04 KB
/
patch.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#- name: Randomizer
#- author: bordplate
#- href: https://github.com/bordplate/rac1-randomizer
#- version: 1.2
#- description: Randomizes what items and infobot coordinates you get
#- update_url: https://bordplate.no/rac1/randomizer.json
## Most of the important functionality is in .s or .c-files.
## Although there is a lot of single, simple, instruction patches
## manually defined here as integers.
## They're not properly documented, and I can't remember the purpose of most
## of them at the time of writing this.
# Hook infobot update func
0x4F8000: infobot.bin
0x70e7b0: 0x4F8000
# Prepare unlock_planet hook
0x4f7700: 0xf821ff21
0x4f7704: unlock_planet.bin
# Apply unlock_planet hook
0x112c20: 0x483e4ae0
# Prepare planet_unlock_message hook
0x4f7500: 0xf821ff21
0x4f7504: unlock_planet_message.bin
# Apply unlock_planet hook
0x112af0: 0x483e4a10
## Overwrite unlock_planet call in infobot update func so we call original unlock_planet function
# Trampoline
0x4f7600: 0xf821ff21
0x4f7604: 0x4bc1b620
# Apply redirect
0x44cbc0: 0x480aaa41
## Overwrite planet_unlock_message call in infobot update func so we call original planet_unlock_message function
# Trampoline
0x4F74E0: 0xf821ff21
0x4F74E4: 0x4bc1b610
# Apply redirect
0x44ccc4: 0x480aa81d
# Custom has_item function
0x04f7fd8: has_item.bin
# Prepare unlock_item hook
## stdu r1, -0xb0 (r1)
0x4f8ff8: 0xf821ff51
## ba 0x112e1c
0x4f8ffc: 0x48112e1e
#
# Custom function
0x4f9000: unlock_item.bin
# Apply hook
0x112e18: 0x484f9002
#########################
### Item redirections ###
#########################
## This is the part where we redirect the original items
## to make them randomized.
## Some items require a little extra massaging than others.
## A lot of items shows a toast message to the player, so we remove those.
# Heli-pack
0x4a90b8: 0x38600002
0x4a90bc: 0x484f7fdb
0x4a90d8: 0x38600002
0x4a90dc: 0x484f7fdb
0x4a91cc: 0x38600002
0x4a91d0: 0x484f7fdb
# NOP default toast message
0x4a9344: 0x60000000
# Thruster-pack (special case)
0x4a4d00: thruster_pack_check.bin
# Hydro-pack
0x3434e4: 0x38600004
0x3434e8: 0x484f7fdb
0x343504: 0x38600004
0x343508: 0x484f7fdb
# NOP toast message
0x3435dc: 0x60000000
# Sonic Summoner
0x45b3dc: 0x38600005
0x45b3e0: 0x484f7fdb
0x45b2bc: 0x38600005
0x45b2c0: 0x484f7fdb
# O2 Mask
0x1dd49c: 0x38600006
0x1dd4a0: 0x484f7fdb
# Pilot hat
0x23e1ec: 0x38600007
0x23e1f0: 0x484f7fdb
# NOP pilot hat equipping
0x23e46c: 0x60000000
# Swingshot
0x04a2eb8: 0x38600006
0x04a2ebc: 0x484f7fdb
0x04a3188: 0x60000000
# Hydrodisplacer / Trespasser
# Hook Hydro/Trespasser function
0x4f6000: trespasser_hydrodisplacer.bin
0x708320: 0x4f6000
# NOP toast
0x183b50: 0x60000000
# NOP delete moby
0x18395c: 0x60000000
# Skip "has item" check
0x183954: 0x42800014
# Magneboots
0x2ba1e0: 0x3860001c
0x2ba1e4: 0x484f7fdb
# Grindboots
0x1be6f8: 0x3860001d
0x1be6fc: 0x484f7fdb
# Hoverboard
0x45d228: 0x3860001e
0x45d22c: 0x484f7fdb
# Hologuise
0x285648: 0x3860001f
0x28564c: 0x484f7fdb
# Fix race being weird with item unlock
#0x0a8b0c: 0x38600030
#0x0a8b10: 0x48112e1b
0x0a8ab0: 0x60000000
# Bolt Grabber
0x267830: 0x38600022
0x267834: 0x484f7fdb
# Morph-O-Ray
0x256424: 0x38600015
0x256428: 0x484f7fdb
0x25642c: 0x41820014
# NOP toast messages
0x256698: 0x60000000
0x256684: 0x60000000
# Suck Cannon
0x1d568c: 0x38600009
0x1d5690: 0x484f7fdb
# NOP toasts
0x1d576c: 0x60000000
0x1d5780: 0x60000000
# RYNO
0x4b8cd0: 0x38600017
0x4b8cd4: 0x484f7fdb
# NOP toasts
0x4b8da8: 0x60000000
# Persuader
0x336390: 0x38600023
0x336394: 0x484f7fdb
0x33641c: 0x38600023
0x336420: 0x484f7fdb
# Redirect to unlock_item function
0x336678: 0x38600023
0x33667c: 0x48112e1b
# NOP toast
0x3366b0: 0x60000000
# Zoomerator
0x4b0a08: 0x38600030
0x4b0a0c: 0x484f7fdb
# Redirect to unlock_item function
0x4b0c50: 0x2c030099
0x4b0c60: 0x38600030
0x4b0c6c: 0x48112e1b
# Fix race being weird with item unlock
0x0a898c: 0x38600030
0x0a8990: 0x48112e1b
0x0a8994: 0x42800068
0x0a8934: 0x60000000
# Raritanium
0x32d00c: 0x38600031
0x32d010: 0x484f7fdb
0x32d058: 0x38600031
0x32d05c: 0x484f7fdb
# Redirect unlock_item function
0x32d0d8: 0x60000000
0x32d0fc: 0x38600031
0x32d100: 0x48112e1b
# Replace Nanotech vendor proximity function
0x4f8200: nanotech_vendor.bin
0x24a8b4: 0x484f8203
0x24a8b8: 0x4280023c
# NOP nanotech toast messages
0x24aa9c: 0x60000000
0x24aa7c: 0x60000000
# Codebot
0x27b780: 0x38600032
0x27b784: 0x484f7fdb
#
# NOP codebot=true
0x27b8c8: 0x60000000
# Redirect to unlock_item function
0x27b868: 0x38600032
0x27b86c: 0x48112e1b
#############################
### End item redirections ###
#############################
# Fix thruster-pack gliding when you don't have the heli-pack
0x4f8f00: has_thruster_heli_pack.bin
0xc35c0: 0x484f8f03
0xc4190: 0x484f8f03
0xc4f18: 0x484f8f03
# Assign higher values to bolts
0x2406d8: 0x38800005
0x2406e0: 0x38800015
0x2406e8: 0x3880003c
0x2406f0: 0x388000c8
# Make Metal Detector useful
0x4f60c8: metal_detector_spot.bin
0x70d898: 0x4f60c8
# Items in vendor
0x0016c7cc: 0x4182000c
0x0016c7d0: 0x7cdc3378
0x4f8d00: tramp_vendor_cmp.bin
0x4f8d38: vendor_class.bin
0x16c7c0: 0x484f8d02
0x4f8100: swap_weapon.bin
0x0921f8: 0x484f8103
# Disable animations after purchase because it too often crashes the game
0x0016dd90: 0x60000000
# Fix crash that occurs if there's junk data where the vendor stores moby data
# The crash only occurred if the first item in the vendor was unsupported items/gadgets like helmets and boots
# Junk data can come from playing a pre-rendered movie. They store the movie data in the same location as some vendor data.
0x4f6200: clear_vendor_data.bin
0x16ac30: 0x484f6203
# Open all locked Orxon gates if player has O2 Mask
0x4f7000: orxon_gates.bin
0x70a5c0: 0x4f7000
0x7083c8: 0x4f7000
0x70a4c0: 0x4f7000
# Apply automation script that creates the randomizer path and populates relevant data in the game.
automation: main.lua