The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

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.


Advertise here

Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old January 1st, 2011, 11:09 AM
Shiny Quagsire's Avatar
Shiny Quagsire
どないやねん, ヤドン
 
Join Date: May 2009
Location: Hoenn Safari Zone
Age: 16
Gender: Male
Nature: Jolly

Advertise here
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:

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



Reply With Quote
  #2    
Old January 1st, 2011, 06:15 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
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
  #3    
Old January 1st, 2011, 06:40 PM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter Tier 2
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 22
Gender: Male
Nature: Modest
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
  #4    
Old January 2nd, 2011, 02:42 AM
knizz's Avatar
knizz
 
Join Date: Aug 2007
The function Shiny Quagsire mentioned first starts at 080599C8 (I call it "load_palette_2"). It is (only) called by two other functions:
Code:
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:
Code:
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.
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)
Reply With Quote
  #5    
Old January 9th, 2011, 04:05 PM
itari's Avatar
itari
悪魔の妹
Community Supporter
 
Join Date: Mar 2010
Location: 紅魔館
Age: 17
Gender: Female
Nature: Relaxed
What I don't understand is why it checks winter twice, why?

EDIT: Never mind, I figured it out.
__________________
Touhou Puppet Play: Sapphire

SubscriptAdvanced SongType Effectiveness EditorTilemap CreatorPython IPS Patcher

Last edited by itari; January 9th, 2011 at 04:10 PM.
Reply With Quote
  #6    
Old February 11th, 2011, 02:11 PM
Sythe_Lord0102
Beginning Trainer
 
Join Date: Feb 2011
Gender: Male
Nature: Serious
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
  #7    
Old February 11th, 2011, 10:09 PM
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
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
  #8    
Old February 11th, 2011, 10:13 PM
Team Fail's Avatar
Team Fail
The fine line between in|sanity
Community Supporter
 
Join Date: May 2009
Age: 19
Gender: Male
Nature: Brave
Quote:
Originally Posted by colcolstyles View Post
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?
__________________

Pairs:
Kevin, Echidna
Follow me on Twitter! @TeamFail
Alt 1, リザードン
Miiverse
Pokémon Hackers Online
Alt 2: Jack Cayman



[04:20.39] <@GoGo> I WILL INSERT WITH PLEASURE
[04:20.45] <@GoGo> shut it Bela

[05:41.55] <Team_Fail> Blue Spider is interesting, but #MEHMasterRace
[05:42.20] <diegoisawesome> Team_Fail: Sounds like a bunch of unmotivated people that still want to try to take over the world
Reply With Quote
  #9    
Old June 23rd, 2011, 09:56 PM
dt200's Avatar
dt200
Was and will be forever alone.
 
Join Date: Sep 2010
Location: Malaysia
Gender: Male
Nature: Lonely
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
  #10    
Old June 25th, 2011, 01:35 PM
LightningStrike
Booted out - don't be like me!
 
Join Date: Jun 2011
Location: Hiding from Pikachu
Age: 19
Gender: Male
Nature: Impish
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
  #11    
Old June 26th, 2011, 01:13 PM
EdensElite's Avatar
EdensElite
No0b, but getting there.
 
Join Date: Jun 2011
Location: UK
Gender: Male
Nature: Bold
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
  #12    
Old June 27th, 2011, 06:38 AM
Khari's Avatar
Khari
Beginning Trainer
 
Join Date: Jan 2011
Gender: Male
it's time it was made for gen IV
Reply With Quote
Reply
Quick Reply

Sponsored Links


Advertise here
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 03:52 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.