Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Reload this Page Research Seasons in Fire Red

For all updates, view the main page.

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Research & Development programs in this forum are subject to moderator approval before they are displayed.

Thread Tools
Old January 1st, 2011 (11:09 AM).
Shiny Quagsire's Avatar
Shiny Quagsire Shiny Quagsire is offline
I'm Still Alive, Elsewhere
Join Date: May 2009
Location: Hoenn Safari Zone
Age: 17
Gender: Male
Nature: Jolly
Posts: 691
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

ldr r0, SeasonRoutine
bx r0

			.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

			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.
			ldr r0, WinterPal
			b end
			ldr r0, FallPal
			b end
			ldr r1, Return @Return to where the code left off
			bx r1

.align 2

			.word 0x08EA1B6A
			.word 0xXXXXXXXX @Insert Winter Pallet Here
			.word 0xYYYYYYYY @Insert Fall Pallet Here
			.word 0x0300553C
			.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.

Reply With Quote
Old January 1st, 2011 (6:15 PM).
ZodiacDaGreat's Avatar
ZodiacDaGreat ZodiacDaGreat is offline
Working on a Mobile System
Join Date: Feb 2007
Location: South Pacific
Age: 23
Gender: Male
Nature: Relaxed
Posts: 429
Send a message via ICQ to ZodiacDaGreat
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
Reply With Quote
Old January 1st, 2011 (6:40 PM).
Darthatron's Avatar
Darthatron Darthatron is offline
Silver Tier
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 23
Gender: Male
Nature: Modest
Posts: 1,152
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.
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
Old January 2nd, 2011 (2:42 AM).
knizz's Avatar
knizz knizz is offline
Join Date: Aug 2007
Posts: 192
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     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
08059AA0     @ =============== S U B R O U T I N E =======================================
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
The tilesets use similar functions:
08059A54     @ =============== S U B R O U T I N E =======================================
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     @ ---------------------------------------------------------------------------
08059A66                     .align 4
08059A68     @ =============== S U B R O U T I N E =======================================
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
And load_tileset is at 08059844.
Firered IDA 6.5 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support
Reply With Quote
Old January 9th, 2011 (4:05 PM). Edited January 9th, 2011 by Hopeless Masquerade.
Hopeless Masquerade's Avatar
Hopeless Masquerade Hopeless Masquerade is online now
photojournalism at its finest
Crystal Tier
Join Date: Mar 2010
Location: 幻想郷
Age: 18
Gender: Female
Nature: Impish
Posts: 2,306
What I don't understand is why it checks winter twice, why?

EDIT: Never mind, I figured it out.
Reply With Quote
Old February 11th, 2011 (2:11 PM).
Sythe_Lord0102 Sythe_Lord0102 is offline
Join Date: Feb 2011
Gender: Male
Nature: Serious
Posts: 25
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.
Reply With Quote
Old February 11th, 2011 (10:09 PM).
colcolstyles's Avatar
colcolstyles colcolstyles is offline
Yours truly
Crystal Tier
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Posts: 1,592
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?

Brother of Vrai
Reply With Quote
Old February 11th, 2011 (10:13 PM).
Team Fail's Avatar
Team Fail Team Fail is offline
fun in the sun
Platinum Tier
Join Date: May 2009
Age: 20
Gender: Male
Nature: Brave
Posts: 10,876
Quote originally posted by colcolstyles:
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?

je suis désolé
Reply With Quote
Old June 23rd, 2011 (9:56 PM).
dt200's Avatar
dt200 dt200 is offline
Was and will be forever alone.
Join Date: Sep 2010
Location: Malaysia
Gender: Male
Nature: Lonely
Posts: 18
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
I do something for a reason and the reason is the reason I do it for.

Pokémon games i own:
Pokémon Mystery Dungeon: Red Rescue Team
Pokemon Firered
Pokemon Emerald
Pokemon Crystal
Pokemon Yellow
Pokemon HG/SS
Pokemon Mystery Dungeon: Blue Rescue Team.

75% of Pokemon gamers use cheats and specially made codes to make their pokemon battle-worthy. If you are one of the 25% percent that level their Pokemon up legally, put this in your signature.
-Started by SkittyLover77
Reply With Quote
Old June 25th, 2011 (1:35 PM).
LightningStrike LightningStrike is offline
Join Date: Jun 2011
Location: Hiding from Pikachu
Age: 20
Gender: Male
Nature: Impish
Posts: 33
Send a message via Windows Live Messenger to LightningStrike
This is really advanced cool stuff. I'd love to have this in my hack. Thanks Shiny Quagsire!
Reply With Quote
Old June 26th, 2011 (1:13 PM).
EdensElite's Avatar
EdensElite EdensElite is offline
No0b, but getting there.
Join Date: Jun 2011
Location: UK
Gender: Male
Nature: Bold
Posts: 190
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.
Reply With Quote
Old June 27th, 2011 (6:38 AM).
Khari's Avatar
Khari Khari is offline
Join Date: Jan 2011
Gender: Male
Posts: 8
it's time it was made for gen IV
Reply With Quote
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are UTC -8. The time now is 7:19 AM.