File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 83
83
mov r1 , 0x7d
84
84
ldr r0 , [ r0 ]
85
85
pop pc
86
+
87
+ .thumb
88
+ @set_starting_items:
89
+ push lr
90
+
91
+ push r1 ; save r1, as it's used later on in the original code
92
+ bl set_starting_items
93
+ pop r1 ; restore r1
94
+
95
+ ; These three instructions are the original instructions that the `bl` to this current
96
+ ; function replaced. They are needed to be able to return to the original code.
97
+ mov r0 , 0x3C
98
+ mul r0 , r1
99
+
100
+ pop pc
86
101
.pool
87
102
.endarea
88
103
129
144
.pool
130
145
.endarea
131
146
147
+ .thumb
148
+ .org 0x20ad20e
149
+ .area 0x6 , 0x00
150
+ ; hook into the function that sets the starting item flags
151
+ bl @set_starting_items
152
+ ; original instruction, do not change
153
+ b 0x20ad216
154
+ .pool
155
+ .endarea
156
+
132
157
.thumb
133
158
.org 0x20ae1c2
134
159
.area 0x6 , 0x00
440
465
.importobj "code/spawn_custom_freestanding_item.o"
441
466
.importobj "code/custom_salvage_item.o"
442
467
.importobj "code/extend_give_item_function.o"
468
+ .importobj "code/set_starting_items.o"
443
469
.endarea
444
470
.close
Original file line number Diff line number Diff line change
1
+ #include "ph.h"
2
+ #include <stdbool.h>
3
+ #include <stdint.h>
4
+
5
+ __attribute__((target ("thumb" ))) void set_starting_items (void ) {
6
+ gItemManager -> mItemFlags [1 ] |= 0x2 ; // start player with SW sea chart
7
+ }
You can’t perform that action at this time.
0 commit comments