HUBOL ‐ Resetting Pedometers - haven1433/HexManiacAdvance GitHub Wiki
Click here for HUBOL's main page. HUBOL is short for "Haven's Unofficial Build of Leon's dynamic Pokémon expansion."
Credits: Defa and Invis
By default, the CFRU pedometers cannot be reset. This routine allows you to set them to 0, so you can use them multiple times.
You can read about pedometers in CFRU documentation .pdf
file on page 121; here, you can find the flags to activate them.
Note that the always-active pedometer cannot be reset with this routine!
Add this routine in free space and note the offset:
push {lr}
ldr r0, var
ldr r3, =0x0806E569 @VarGet
bl linker
ldr r1, =0x0203B7BC @gPedometers
mov r2, #0
mov r3, #1
tst r0, r3 @check large
beq checkMedium
str r2, [r1, #4] @->large
checkMedium:
mov r3, #2
tst r0, r3
beq checkSmallOne
strh r2, [r1, #8] @->medium
checkSmallOne:
mov r3, #4
tst r0, r3
beq checkSmallTwo
strb r2, [r1, #10] @->smallOne
checkSmallTwo:
mov r3, #8
tst r0, r3
beq end
strb r2, [r1, #11] @->smallTwo
end:
pop {pc}
linker: bx r3
var: .word 0x00004000
Set temp0
to the value corresponding to a pedometer as follows: 1 = large; 2 = medium; 4 = smallOne; 8 = smallTwo; then callasm <offset+1>
. You can add these values together to reset more than one pedometer at the same time. All possible values of temp0
are as follows:
1 large
2 medium
3 large + medium
4 smallOne
5 large + smallOne
6 medium + smallOne
7 large + medium + smallOne
8 smallTwo
9 large + smallTwo
10 medium + smallTwo
11 large + medium + smallTwo
12 smallOne + smallTwo
13 large + smallOne + smallTwo
14 medium + smallOne + smallTwo
15 large + medium + smallOne + smallTwo