• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Development: Christmas Present for PC! Your very own RTC for FR and LG

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
The time it gives you is stored at 0x300553C
In the following format.
Year u16
skip a byte
month u8
day u8
Day of week(mon-sun/1-7) u8
Hour u8
minute u8
second u8
that would be:
XX XX XX XX XX YY XX XX XX
the YY is the day of the week, it's at: 300554C
 

knizz

192
Posts
16
Years
  • Seen Oct 28, 2020
Can someone show me the part of the ASM that reads out the time value (=without the mainloop-hook and date-conversion). I can't understand GBATEK in this point.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
that would be:
XX XX XX XX XX YY XX XX XX
the YY is the day of the week, it's at: 300554C

I tried it and it didn't work. Thanks for the help though, shiny quagsire.
I'll continue this dialogue using PM's so we don't clutter up the thread.
 

colcolstyles

Yours truly
1,588
Posts
15
Years
I'm trying to use the RTC to get the day of the week byte so that I can have day specific events, but every time I copy the byte stored at 0x305540 (I also checked offsets on either side of this), it returns 0 as the result.

I'm running Windows 7 and i'm just wondering if it's a problem with VBA's time call, or if i'm looking in the wrong offset for the day of the week byte, or if i'm scripting it wrong, or if there's a problem with the RTC itself.

I haven't yet checked if it works on Vista, but will try shortly.

That said, i'm fairly sure that the RTC works fine, so if it's related to the time call function of VBA, then that would explain a lot.

The RTC doesn't provide a day-of-the-week byte. I haven't used this but from a brief scan of both ZDG and interdpth's code, I don't see any code that calculates the day of the week. You'll have to manually calculate the day from the date. Wikipedia has a nice article on the subject which I used to base my code off of (note: you'll have to call SWI $06 to utilize the modulo operator in assembly (read about it here))

Can someone show me the part of the ASM that reads out the time value (=without the mainloop-hook and date-conversion). I can't understand GBATEK in this point.

Aw, but that'll ruin the fun. It took me months to figure out how to read the time. Trust me, you'll feel a lot better if you figure it out yourself than if you take the easy way out.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
Aw, but that'll ruin the fun. It took me months to figure out how to read the time. Trust me, you'll feel a lot better if you figure it out yourself than if you take the easy way out.

It only took me about a week to figure it out :)
About 30 minutes to write an ASM routine to make the same effect :D

The RTC doesn't provide a day-of-the-week byte.
How come it works for me? :\
 

2RandomStudios

Angry Jigglypuff
76
Posts
13
Years
I understand how to insert it and all, but how would you actually use this in-game? Would you put a script on the berry tree? If so, what would the script be?
Thanks!
 

altariaking

Needs NO VMs...
1,087
Posts
14
Years
I understand how to insert it and all, but how would you actually use this in-game? Would you put a script on the berry tree? If so, what would the script be?
Thanks!

Yep, you would use a script, however, the script you would have to do yourself, as he said in the front post that he doesn't want anyone to give it away.
 

2RandomStudios

Angry Jigglypuff
76
Posts
13
Years


Yep, you would use a script, however, the script you would have to do yourself, as he said in the front post that he doesn't want anyone to give it away.

Thanks, but I'm new to ROM hacking and don't have the first clue on what to put in the script. If you could PM me with a sample as to what I might do, that would be awesome. Thanks!
 
Back
Top