The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Emulation & ROM Hacking > Research & Development
Register New Account FAQ/Rules Chat 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!
New threads in this forum are to be approved by a moderator before they are displayed. The thread revival limit does not apply here.



Reply
Thread Tools
  #26  
Unread December 27th, 2010, 12:36 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
Gender: Male
Nature: Quiet
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.
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.
Reply With Quote
  #27  
Unread December 27th, 2010, 02:32 PM
Darthatron's Avatar
Darthatron
巨大なトロール。
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 21
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  
Unread December 28th, 2010, 09:30 AM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
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.
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.
Reply With Quote
  #29  
Unread December 28th, 2010, 09:44 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 21
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  
Unread December 28th, 2010, 05:12 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
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.
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.

Last edited by Jambo51; January 6th, 2011 at 01:19 AM.
Reply With Quote
  #31  
Unread January 8th, 2011, 03:45 PM
diegoisawesome's Avatar
diegoisawesome
Working on Shining Opal, kinda
 
Join Date: Dec 2007
Location: Goldenrod City, Johto
Age: 16
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 Website: o15.com
diegoisawesome's MEGA-HUGE XSE Scripting Tutorial


Reply With Quote
  #32  
Unread January 8th, 2011, 03:50 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
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!
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.
Reply With Quote
  #33  
Unread January 8th, 2011, 03:53 PM
diegoisawesome's Avatar
diegoisawesome
Working on Shining Opal, kinda
 
Join Date: Dec 2007
Location: Goldenrod City, Johto
Age: 16
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 Website: o15.com
diegoisawesome's MEGA-HUGE XSE Scripting Tutorial


Reply With Quote
  #34  
Unread January 8th, 2011, 04:13 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
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!
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.
Reply With Quote
  Click here to go to the next staff post in this thread.   #35  
Unread January 9th, 2011, 12:41 AM
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  
Unread January 9th, 2011, 03:55 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
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.
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.
Reply With Quote
  #37  
Unread January 10th, 2011, 03:21 PM
shiny quagsire's Avatar
shiny quagsire
I'm pixular!
 
Join Date: May 2009
Location: In a House, duh!
Age: 15
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
  This is the last staff post in this thread.   #38  
Unread January 10th, 2011, 10: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  
Unread January 10th, 2011, 11:42 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
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?
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.
Reply With Quote
  #40  
Unread January 12th, 2011, 11: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  
Unread January 12th, 2011, 11:58 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
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.
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.

Last edited by Jambo51; January 31st, 2011 at 08:54 PM.
Reply With Quote
  #42  
Unread January 25th, 2011, 03:33 PM
shiny quagsire's Avatar
shiny quagsire
I'm pixular!
 
Join Date: May 2009
Location: In a House, duh!
Age: 15
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  
Unread February 11th, 2011, 09: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 10:05 PM.
Reply With Quote
  #44  
Unread February 11th, 2011, 10:36 PM
shiny quagsire's Avatar
shiny quagsire
I'm pixular!
 
Join Date: May 2009
Location: In a House, duh!
Age: 15
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  
Unread February 14th, 2011, 09:13 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
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?
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.
Reply With Quote
  #46  
Unread March 3rd, 2011, 04:45 PM
<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  
Unread March 5th, 2011, 11:53 PM
Baronnecro's Avatar
Baronnecro
AKA TolerantX
 
Join Date: Oct 2010
Location: Buffalo. NY
Age: 31
Gender: Male
Nature: Careful
ty I was very interested in this very much. you must be credited when I use this.
__________________
Reply With Quote
Reply
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. The time now is 07:23 AM.


Style by Perdition Haze, artwork by Sa-Dui.
Like our Facebook Page Follow us on TwitterMessage Board Statistics | © 2002 - 2013 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2013 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 posts belong to the user.