PDA

View Full Version : Research: Seasons in Fire Red


Shiny Quagsire
January 1st, 2011, 11:09 AM
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.

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:


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:

.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.

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:


.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. ;)

ZodiacDaGreat
January 1st, 2011, 06:15 PM
Although this much would suffice, I would assume this routine loads the varies palettes for the varies seasons right? I would prefer to hack the entire Tileset structure and extend it to the varies seasons :)

Darthatron
January 1st, 2011, 06:40 PM
It is nice, but I agree with Zodiac in the sense that I would prefer to see it with edited tilesets - even just leaf-less trees for fall/winter. This could be done in another routine pretty easily, simply replacing those few tiles when they are loaded into the RAM, rather than a completely different tileset.

knizz
January 2nd, 2011, 02:42 AM
The function Shiny Quagsire mentioned first starts at 080599C8 (I call it "load_palette_2"). It is (only) called by two other functions:
08059A90 @ =============== S U B R O U T I N E =======================================
08059A90
08059A90
08059A90 load_map_palette_1: @ CODE XREF: load_map_palettes+8p
08059A90 000 PUSH {LR}
08059A92 004 LDR R0, [R0,#mapfooter.tileset1]
08059A94 004 MOVS R1, #0
08059A96 004 MOVS R2, #0xE0
08059A98 004 BL load_palette_2
08059A9C 004 POP {R0}
08059A9E 000 BX R0
08059A9E @ End of function load_map_palette_1
08059A9E
08059AA0
08059AA0 @ =============== S U B R O U T I N E =======================================
08059AA0
08059AA0
08059AA0 load_map_palette_2: @ CODE XREF: load_connected_map+6Ap
08059AA0 @ load_map_palettes+Ep
08059AA0 000 PUSH {LR}
08059AA2 004 LDR R0, [R0,#mapfooter.tileset2]
08059AA4 004 MOVS R1, #0x70
08059AA6 004 MOVS R2, #0xC0
08059AA8 004 BL load_palette_2
08059AAC 004 POP {R0}
08059AAE 000 BX R0
08059AAE @ End of function load_map_palette_2
08059AAE
08059AB0

The tilesets use similar functions:
08059A54 @ =============== S U B R O U T I N E =======================================
08059A54
08059A54
08059A54 load_map_tileset_1: @ CODE XREF: sub_08056B78+BCp
08059A54 @ sub_08056D44+90p ...
08059A54 000 PUSH {LR}
08059A56 004 LDR R0, [R0,#mapfooter.tileset1]
08059A58 004 MOVS R1, 0x280
08059A5C 004 MOVS R2, #0
08059A5E 004 BL load_tileset
08059A62 004 POP {R0}
08059A64 000 BX R0
08059A64 @ End of function load_map_tileset_1
08059A64
08059A64 @ ---------------------------------------------------------------------------
08059A66 .align 4
08059A68
08059A68 @ =============== S U B R O U T I N E =======================================
08059A68
08059A68
08059A68 load_map_tileset_2: @ CODE XREF: sub_08056B78+CCp
08059A68 @ sub_08056D44+A0p ...
08059A68 000 PUSH {LR}
08059A6A 004 LDR R0, [R0,#mapfooter.tileset2]
08059A6C 004 MOVS R1, 0x180
08059A70 004 MOVS R2, 0x280
08059A74 004 BL load_tileset
08059A78 004 POP {R0}
08059A7A 000 BX R0
08059A7A @ End of function load_map_tileset_2
08059A7A
08059A7C

And load_tileset is at 08059844.

itari
January 9th, 2011, 04:05 PM
What I don't understand is why it checks winter twice, why?

EDIT: Never mind, I figured it out.

Sythe_Lord0102
February 11th, 2011, 02:11 PM
This is just a suggestion that may make things more complicated than they may need to be, but here it is: Variable length of the days by season.

I'm suggesting it because I've lived in areas where daylight will last for about twenty hours during summer(Prince George, British Columbia, Canada), and it always felt like the cold would set in earlier and longer, with the nights lasting just as long during winter. I've also known people who've lived close enough to the equator that for most of their lives, they've only known one type of season, despite the calendar saying that its winter or spring. One thing that I've seen in the section "What makes a good ROM" is how realistic it is, and it would add a very realistic element to the game if it changed the length of the days for each season and changed the weather in the battle with each season (ex: if the climate was tropical, it would either be raining or sunny, likely with little to no variation on the length of day and night).


I'm not very good at coding, but I am good at testing. I'll take a look at any tools that may come about from this research and test it on a spare ROM if somebody can send me the link for it.


I've also posted this in the section entitled Development: Day/Night Switching of Wild Pokemon, as this is something that would combine the two ideas (having Day/Night and seasons that change the length of the days and nights) if somebody decides to work on it.

colcolstyles
February 11th, 2011, 10:09 PM
This sounds like a nice feature but, the way I see it, most hack players will be playing the hack in a very short period of time, meaning that they will most likely only get to experience the hack during one of the seasons (or maybe two if they start playing towards the end of a season). Perhaps you might consider using a different time counter so that the seasons change more frequently?

Team Fail
February 11th, 2011, 10:13 PM
This sounds like a nice feature but, the way I see it, most hack players will be playing the hack in a very short period of time, meaning that they will most likely only get to experience the hack during one of the seasons (or maybe two if they start playing towards the end of a season). Perhaps you might consider using a different time counter so that the seasons change more frequently?

What if the game only had plot changes depending on the season? And the ending would differ depending on what season you played in?

dt200
June 23rd, 2011, 09:56 PM
I'm a beginner and i don't know wht the code means.
Could someone refer me to a thread where i can really understand asm, hex and this code thing.
Your help is much appreciated. :D

LightningStrike
June 25th, 2011, 01:35 PM
This is really advanced cool stuff. I'd love to have this in my hack. Thanks Shiny Quagsire!

EdensElite
June 26th, 2011, 01:13 PM
I posted this as a thread, but I doubt it'll get approved so i'll just ask you guys; do you think it's possible to create a pokemon thats form is defined by the seasons, like Castform is to the weather.

Khari
June 27th, 2011, 06:38 AM
it's time it was made for gen IV