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
  #26    
Old December 27th, 2010, 04:36 AM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet

Advertise here
Quote:
Originally Posted by diegoisawesome View Post
I THOUGHT I had the offset for the time in Emerald! I looked through my notes, and here it is: 0x03005CFA.
The reason that you probably didn't find it is probably that it doesn't update unless you do special things, like entering a new map, using a command\special that causes the time to be reloaded, etc.
Hmmm, seems really like it was built for efficiency rather than realism. I don't suppose there's any way we could use interdpth's FR RTC instead - Adapt it for use on Emerald. However, the routine I developed would be able to use it, it'd just not work properly because it'd be reading a static time which isn't updated until you leave the map.
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Reply With Quote
  #27    
Old December 27th, 2010, 06:32 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter Tier 2
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 22
Gender: Male
Nature: Modest
Quote:
Originally Posted by Jambo51 View Post
Hmmm, seems really like it was built for efficiency rather than realism. I don't suppose there's any way we could use interdpth's FR RTC instead - Adapt it for use on Emerald. However, the routine I developed would be able to use it, it'd just not work properly because it'd be reading a static time which isn't updated until you leave the map.
Just put a write-breakpoint on that area of the RAM, and find the routine that updates it, then call it before a battle/your routine is initiated. Would that not work?
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #28    
Old December 28th, 2010, 01:30 AM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
Quote:
Originally Posted by Darthatron View Post
Just put a write-breakpoint on that area of the RAM, and find the routine that updates it, then call it before a battle/your routine is initiated. Would that not work?
Yes, that would work, but as colcolstyles posted before, the rtc only updates when the map is refreshed (i think) or when you change map. I'd have to add an extra part to my routine to make it work, assuming that it updates on refresh. Certainly doable, but a pain nonetheless.
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Reply With Quote
  #29    
Old December 28th, 2010, 01:44 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter Tier 2
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 22
Gender: Male
Nature: Modest
Quote:
Originally Posted by Jambo51 View Post
Yes, that would work, but as colcolstyles posted before, the rtc only updates when the map is refreshed (i think) or when you change map. I'd have to add an extra part to my routine to make it work, assuming that it updates on refresh. Certainly doable, but a pain nonetheless.
Not JUST when a map is entered. If you find the routine that refreshes the time, then you could call it before your routine is used. Simple.
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #30    
Old December 28th, 2010, 09:12 AM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
Quote:
Originally Posted by Darthatron View Post
Not JUST when a map is entered. If you find the routine that refreshes the time, then you could call it before your routine is used. Simple.
Yeah, good point. Sorry, I don't know why I missed that before XD. Still, it's a lot of work for a rom i'll almost certainly never use myself.
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!

Last edited by Jambo51; January 5th, 2011 at 05:19 PM.
Reply With Quote
  #31    
Old January 8th, 2011, 07:45 AM
diegoisawesome's Avatar
diegoisawesome
Not the Script Help Thread
Community Supporter
 
Join Date: Dec 2007
Location: Goldenrod City, Johto
Age: 17
Gender: Male
Nature: Quirky
Hey, Jambo51, I have another RTC address for Emerald you may or may not be interested in: 03000DC0. This one has years, day of the week, and other fun things... in binary-coded decimal, however. This means that the hex value that's there looks like is real decimal value.
Ex. 10:30 looks like 0x10 0x30.
__________________


My other resources:
My Website
diegoisawesome's MEGA-HUGE XSE Scripting Tutorial
diegoisawesome's Miscellaneous Finds
The Ruins of Alph Puzzles
Reply With Quote
  #32    
Old January 8th, 2011, 07:50 AM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
Quote:
Originally Posted by diegoisawesome View Post
Hey, Jambo51, I have another RTC address for Emerald you may or may not be interested in: 03000DC0. This one has years, day of the week, and other fun things... in binary-coded decimal, however. This means that the hex value that's there looks like is real decimal value.
Ex. 10:30 looks like 0x10 0x30.
Interestingly, this one is automatically updated every time I enter the battle screen. IF it's done before my battle routine, this could be the answer to the Day/Night Routine for emerald!
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Reply With Quote
  #33    
Old January 8th, 2011, 07:53 AM
diegoisawesome's Avatar
diegoisawesome
Not the Script Help Thread
Community Supporter
 
Join Date: Dec 2007
Location: Goldenrod City, Johto
Age: 17
Gender: Male
Nature: Quirky
Quote:
Originally Posted by Jambo51 View Post
Interestingly, this one is automatically updated every time I enter the battle screen. IF it's done before my battle routine, this could be the answer to the Day/Night Routine for emerald!
I thought that you had already found the time updater, though.
Actually, it doesn't update upon entering battle. It's probably your call to the updater that's doing it.
__________________


My other resources:
My Website
diegoisawesome's MEGA-HUGE XSE Scripting Tutorial
diegoisawesome's Miscellaneous Finds
The Ruins of Alph Puzzles
Reply With Quote
  #34    
Old January 8th, 2011, 08:13 AM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
Quote:
Originally Posted by diegoisawesome View Post
I thought that you had already found the time updater, though.
Actually, it doesn't update upon entering battle. It's probably your call to the updater that's doing it.
It was indeed my call to the time updater routine which was updating it. I changed the ram offset for the hour byte in both routines, and modified the compare so that they would be in hex-decimal. The routine should work perfectly now! Thanks for the help!
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Reply With Quote
  #35    
Old January 8th, 2011, 04:41 PM
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
The thing with the data at '0x03000dc0' is that they aren't offset based on the time that the player input. The data there are just what the game reads from the RTC. The game later takes the time there and offsets it based on the player's input. For example, if the time on a player's computer is 9:00 but the player enters 10:00 during the clock-setting special, then the time at '0x03000dc0' will say 9:00 but the time at '0x03005cfa' will be 10:00.
__________________

Brother of Vrai
Reply With Quote
  #36    
Old January 9th, 2011, 07:55 AM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
Quote:
Originally Posted by colcolstyles View Post
The thing with the data at '0x03000dc0' is that they aren't offset based on the time that the player input. The data there are just what the game reads from the RTC. The game later takes the time there and offsets it based on the player's input. For example, if the time on a player's computer is 9:00 but the player enters 10:00 during the clock-setting special, then the time at '0x03000dc0' will say 9:00 but the time at '0x03005cfa' will be 10:00.
OK, thanks for letting me know that. I do have an idea to sort it though! What I plan to do is to store the "pre-update" time and the "post-update" time. I subtract the 2 to obtain the difference between the 2, then use that difference to update the main time! Does that make sense? A roundabout way of fixing it, but I haven't the will or knowledge to go digging around the ROM for the proper update routine. As both times would be updated at the same time, they would never be out of sync, allowing this idea to work.
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Reply With Quote
  #37    
Old January 10th, 2011, 07:21 AM
Shiny Quagsire's Avatar
Shiny Quagsire
どないやねん, ヤドン
 
Join Date: May 2009
Location: Hoenn Safari Zone
Age: 16
Gender: Male
Nature: Jolly
Quote:
Originally Posted by colcolstyles View Post
The thing with the data at '0x03000dc0' is that they aren't offset based on the time that the player input. The data there are just what the game reads from the RTC. The game later takes the time there and offsets it based on the player's input. For example, if the time on a player's computer is 9:00 but the player enters 10:00 during the clock-setting special, then the time at '0x03000dc0' will say 9:00 but the time at '0x03005cfa' will be 10:00.
Theoretically, wouldn't the 0x03000dc0 offset be blank on an individual cart, or be set to the time of the other RTC? I'm probably wrong, but it's a possible answer. I don't think it'd be pre-set, because Japan and the USA have different time zones.
__________________



Reply With Quote
  #38    
Old January 10th, 2011, 02:37 PM
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Quote:
Originally Posted by shiny quagsire View Post
Theoretically, wouldn't the 0x03000dc0 offset be blank on an individual cart, or be set to the time of the other RTC? I'm probably wrong, but it's a possible answer. I don't think it'd be pre-set, because Japan and the USA have different time zones.
I'm not sure what you're trying to say. Here, '0x03000dc0' is where the game writes the RTC data immediately after they are read from the RTC chip. When the game is being emulated on a PC, the time will be whatever time it is on the player's computer. If the game is on a game pak (with a RTC chip), then it just reads whatever the RTC gives it. Then, at a later time, the game reads the hour, minute, and second bytes from '0x03000dc0', converts them to hexadecimal, offsets them based on a value which is calculated when the player sets the clock in his/her room, and then stores the new values at '0x03005cfa'. At least, that's my understanding of it.
__________________

Brother of Vrai
Reply With Quote
  #39    
Old January 10th, 2011, 03:42 PM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
Quote:
Originally Posted by colcolstyles View Post
I'm not sure what you're trying to say. Here, '0x03000dc0' is where the game writes the RTC data immediately after they are read from the RTC chip. When the game is being emulated on a PC, the time will be whatever time it is on the player's computer. If the game is on a game pak (with a RTC chip), then it just reads whatever the RTC gives it. Then, at a later time, the game reads the hour, minute, and second bytes from '0x03000dc0', converts them to hexadecimal, offsets them based on a value which is calculated when the player sets the clock in his/her room, and then stores the new values at '0x03005cfa'. At least, that's my understanding of it.
What I'm meaning is that the time update routine I found (the one which updates 0x03000DC0) can be used to update the main one manually, as long as it's updated at the same time. What I would do is load the values of the RTC at 0x03000DC0 before updating into the registers, then update the time. Then calculate the difference in time between the pre-update time and the post update time. Then using that difference, update the time at the offset 0x03005CFA.

Does that make sense?
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Reply With Quote
  #40    
Old January 12th, 2011, 03:08 PM
Luiz Felipe Apolinário's Avatar
Luiz Felipe Apolinário
PokéDark
 
Join Date: Apr 2006
Location: Brazil
Gender: Male
Nature: Adamant
Jambo you have to do make a patch with your asm already inserted in the pokemon firered for me to test the tool's shiny Quagsire? If you can do it I would greatly appreciate it. Thank you for your attention!
Reply With Quote
  #41    
Old January 12th, 2011, 03:58 PM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
Quote:
Originally Posted by Luiz Felipe Apolinário View Post
Jambo you have to do make a patch with your asm already inserted in the pokemon firered for me to test the tool's shiny Quagsire? If you can do it I would greatly appreciate it. Thank you for your attention!
Sorry, but a straight up patch is a VERY bad idea because it might overwrite another hacker's hard worked on data. If I had the know how, I'd write a tool which inserts the routines in a sensible location for you, but I don't. Shiny Quagsire's tool is outdated and was designed for a much older version of the routine. AFAIK, he's working on updating it, and is trying to build the routine insertion into it.

EDIT: I patched the time update routine onto the main loop on Emerald by using this routine:

Code:
.text
.align 2
.thumb
.thumb_func
.global timeupdatemainloop
 
main:
 push {r0-r3}
 bl timeupdate
 pop {r0-r3}
 pop {r0}
 lsl r0, r0, #0x18
 cmp r0, #0x0
 bne there
 bl thatplace
 pop {r0}
 bx r0
there: ldr r0, place
 bx r0
thatplace: ldr r0, thatplace2
 bx r0
timeupdate: ldr r1, timeupdt
 bx r1
.align
place: .word 0x080004D5
thatplace2: .word 0x0800051D
timeupdt: .word 0x0802F589
In order for this to work, go to 0x080004CA, and stick the following code in instead:
Code:
01 B4 00 48 00 47 XX XX XX 08
What this does is makes the time update routine be called once a frame no matter where in the game you are or what you are doing.
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!

Last edited by Jambo51; January 31st, 2011 at 12:54 PM.
Reply With Quote
  #42    
Old January 25th, 2011, 07:33 AM
Shiny Quagsire's Avatar
Shiny Quagsire
どないやねん, ヤドン
 
Join Date: May 2009
Location: Hoenn Safari Zone
Age: 16
Gender: Male
Nature: Jolly
Quote:
Originally Posted by Jambo51
Shiny Quagsire's tool is outdated and was designed for a much older version of the routine. AFAIK, he's working on updating it, and is trying to build the routine insertion into it.
I actually had a version that worked, but when I tried to wipe my computer, the flash drive that had our backed up info died. Luckily I had the old source code lying around in my own flash drive, which had my hacking stuff, so I'm trying to back that up to the newer version.
__________________



Reply With Quote
  #43    
Old February 11th, 2011, 01:42 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 days).

Granted, it may be a little to hard to do the coding for, so I can understand if this suggestion is overlooked for now.

Suggestion for how it could work if the idea is taken seriously: using something similar to the Header section of Advance Map, with the added option of Climate.

I'm not very good at coding, but I am good at testing. I'll take a look at the most recent version of the D/N program and test it on a spare ROM if somebody can send me the link for it.

Edit: Also posting the idea of length of days being able to change by season in the section entitled "Research: Seasons in Fire Red" started by Shiny Quagsire. This idea may also be more appropriate there.

Last edited by Sythe_Lord0102; February 11th, 2011 at 02:05 PM.
Reply With Quote
  #44    
Old February 11th, 2011, 02:36 PM
Shiny Quagsire's Avatar
Shiny Quagsire
どないやねん, ヤドン
 
Join Date: May 2009
Location: Hoenn Safari Zone
Age: 16
Gender: Male
Nature: Jolly
Quote:
Originally Posted by Sythe_Lord0102 View Post
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 days).

Granted, it may be a little to hard to do the coding for, so I can understand if this suggestion is overlooked for now.

Suggestion for how it could work if the idea is taken seriously: using something similar to the Header section of Advance Map, with the added option of Climate.

I'm not very good at coding, but I am good at testing. I'll take a look at the most recent version of the D/N program and test it on a spare ROM if somebody can send me the link for it.

Edit: Also posting the idea of length of days being able to change by season in the section entitled "Research: Seasons in Fire Red" started by Shiny Quagsire. This idea may also be more appropriate there.
Actually, that'd have to be done in the D/N system itself. This just makes pokemo vary from day to night.
__________________



Reply With Quote
  #45    
Old February 14th, 2011, 01:13 PM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
I could however, slightly rewrite the coding to support differing Pokémon by season, but it just makes the already massive tables needed for just the day to night transition even bigger.

As for the actual on screen seasonal transition...? Not even my ASM, so wrong thread my friend.

On topic - Have you finished rewriting the tool shiny quagsire?
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Reply With Quote
  #46    
Old March 3rd, 2011, 08:45 AM
<TG> AspiroX
Beginning Trainer
 
Join Date: Feb 2011
Gender: Male
This seems awesome! :D
Well, with a tool it would make this function very common, although without a tool i wouldnt be able to use it (as of right now.. xD).

Good luck, I'll be following this thread! :3
Reply With Quote
  #47    
Old March 5th, 2011, 03:53 PM
Baronnecro's Avatar
Baronnecro
AKA TolerantX
 
Join Date: Oct 2010
Location: Buffalo. NY
Age: 32
Gender: Male
Nature: Careful
ty I was very interested in this very much. you must be credited when I use this.
__________________
Reply With Quote
  #48    
Old August 23rd, 2013, 11:38 AM
GoGoJJTech's Avatar
GoGoJJTech
アルファ近く
 
Join Date: Nov 2012
Location: Earth
Age: 15
Gender: Male
Nature: Quiet
What's the purpose of the variable in the level loading routine?
__________________
Reply With Quote
  #49    
Old August 23rd, 2013, 11:44 AM
Shiny Quagsire's Avatar
Shiny Quagsire
どないやねん, ヤドン
 
Join Date: May 2009
Location: Hoenn Safari Zone
Age: 16
Gender: Male
Nature: Jolly
Quote:
Originally Posted by gogojjtech View Post
What's the purpose of the variable in the level loading routine?
I believe it's for swarming, but it seems that the code for that was moved to the other routine, so you could take the variable code out and save yourself a few bytes of freespace.
__________________



Reply With Quote
  #50    
Old August 23rd, 2013, 11:45 AM
GoGoJJTech's Avatar
GoGoJJTech
アルファ近く
 
Join Date: Nov 2012
Location: Earth
Age: 15
Gender: Male
Nature: Quiet
Awesome, thanks. I was looking, and thought "..."

Sorry about double posting, but where are the wild data pointers located? The example was about route 1, yet I have no idea where the other pointers are.

Sorry for TRIPLE posting, but I have yet to find out how this table is stored. I found a pointer to the wild data in route 1, yet the table it's aligned in seems awkward. Anyone have an explanation?
__________________

Last edited by GoGoJJTech; August 23rd, 2013 at 01:10 PM. Reason: Your double post has been automatically merged.
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 09:10 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.