Shiny Quagsire
I'm Still Alive, Elsewhere
- 697
- Posts
- 15
- Years
- Age 27
- Hoenn Safari Zone
- Seen Aug 8, 2020
I think I've kept my seasons a secret too long. I didn't want to make a tool, because then it'd be too easy to get in. But I didn't want to just make a patch, because it's still too easy. So, I'm going to share my research on it.
Basically, what this part does is load the pallet into r0. To hack it, we need to load a routine that checks this pallet, and if it's outdoors, we load it and do a few checks, and spit out a pallet offset for the specific season.
First, our code to get us to our routine:
or, insert this at 0x080599F8.
Where the XX's is the free space for our next routine.
Now that the code is hacked, we need to a routine to load the pallet. I'll explain:
Also, when inserting the pallets, you should note that the pallet pointer actually has 6 consecutive pallets, and all of them are needed.
I'll add block and behavior editing later when I find the code in Chrome again. As for now, we have a fully functioning pallet changer. ;)
Pallet Loading
The first thing I edited was the routine that loads the first tileset's pallets. The routine is at 0x080599f8. I'll explain what it does:
Code:
080599F8 01C LDR R0, [R4,#8] ;Load the pallet from the tileset data
080599FA 01C ADDS R0, #2 ;Not sure why
080599FC 01C ADDS R5, #1 ;Code we replaced
080599FE 01C LSLS R5, R5, #0x10 ;Code we replaced
08059A00 01C LSRS R5, R5, #0x10 ;Code we replaced
08059A02 01C SUBS R4, R7, #2 ;Code we replaced
Basically, what this part does is load the pallet into r0. To hack it, we need to load a routine that checks this pallet, and if it's outdoors, we load it and do a few checks, and spit out a pallet offset for the specific season.
First, our code to get us to our routine:
Code:
.align 2
.thumb
ldr r0, SeasonRoutine
bx r0
SeasonRoutine:
.word 0xFFFFFFFF @Replace with free space for routine
.word 0xFFFFFFFF @Fills in the rest of the code we need to replace
or, insert this at 0x080599F8.
Code:
00 48 00 47 XX XX XX XX FF FF FF FF
Where the XX's is the free space for our next routine.
Now that the code is hacked, we need to a routine to load the pallet. I'll explain:
Code:
.align 2
.thumb
main:
ldr r0, [r4, #0x8] @Original Code
add r0, #0x2
add r5, #0x1
lsl r5, r5, #0x10
lsr r5, r5, #0x10
sub r4, r7, #0x2
ldr r2, DefaultGrass @Load outdoor pallet
cmp r2, r0
bne end
@Check Season
ldr r1, Time
ldrb r1, [r1, #0x3]
cmp r1, #0x1
beq winter
cmp r1, #0x2
beq winter
cmp r1, #0x9
beq fall
cmp r1, #0xa
beq fall
cmp r1, #0xb
beq winter
cmp r1, #0xc
beq winter
b end @If not any other season, then load default
@If you want spring, you can make a check for that,
@but it's up to you.
winter:
ldr r0, WinterPal
b end
fall:
ldr r0, FallPal
b end
end:
ldr r1, Return @Return to where the code left off
bx r1
.align 2
DefaultGrass:
.word 0x08EA1B6A
WinterPal:
.word 0xXXXXXXXX @Insert Winter Pallet Here
FallPal:
.word 0xYYYYYYYY @Insert Fall Pallet Here
Time:
.word 0x0300553C
Return:
.word 0x08059A04
Also, when inserting the pallets, you should note that the pallet pointer actually has 6 consecutive pallets, and all of them are needed.
I'll add block and behavior editing later when I find the code in Chrome again. As for now, we have a fully functioning pallet changer. ;)