Criminon
Forever Spriting
- 265
- Posts
- 12
- Years
- He / Him
- California
- Seen Apr 11, 2024
First of all, thanks to Prime for the amazing tool. It took a long time to understand it, so I decided to share what I learned in hopes that its going to save some people a lot of trouble!
The tool can be found here -> https://www.pokecommunity.com/showthread.php?t=246089
HOW TO GET THE PROGRAM WORKING
Open the program "FSF" (free space finder)
Open windows calculator and change it to programmer mode.
Open the DNS program.
In the DNS program, look where it says install RTC (on the left) it should have a # on how much free space it needs.
Click the calculator and click hex mode.
Type in that #.
Click the decimal mode.
Copy that # and paste it into FSF after opening the rom.
Click search.
Copy that # and paste it into the RTC and hit install.
This will now install it to that offset.
Now, do the same process with night and day, and seasons if you want those.
The RTC is a clock based system. It basically makes variables in the game that will read off the time. Until you make it do something, you won't see a difference.
The day and night system works on the REAL time of day and night. So if its still day outside where you are, you won't see a difference.
Wait until night time or morning. Also make sure you have your emulator's real time clock enabled.
Options -> Game emulator -> Game override -> Real time clock enabled. (This is for VBA)
I haven't touched seasons and won't touch them. Too much spriting.
USING NIGHT FUNCTIONS
Since there are technically 3 slots for night, this is what you would want to use:
comparefarbytetobyte 0x203C000 0x0 ///this is complete night
if == jump @itsnight ' Equal To
comparefarbytetobyte 0x203C000 0x4 ///this is dusk
if == jump @itsnight ' Equal To
comparefarbytetobyte 0x203C000 0x5 ///this is twilight
if == jump @itsnight ' Equal To
if you look on the bottom right of the program, it says "status byte" these are the corresponding #s for night.
TELLING WHAT DAY IT IS
if you're looking to check what day it is, first you have to understand how the information reads. If you look on the DNS program at the RTC area. You're going to see the offset where the RTC is installed, and then you're going to see the time will be written to "0x0300553c"
Now since it seems like there has been a lot of innacuracy on this specific offset throughout this thread, causing a lot of issues, we have to do this to confirm we're in the right spot:
Open up VBA.
Click tools -> memory viewer -> and type in your offset.
You're going to see:
DF 07 etc etc etc
If you reverse DF 07 you get 07DF, and that's 2015 in hex. (Hey we found the year offset!)
Now we know the corresponding days...
0 is sunday 1 is monday 2 is tuesday etc... so which one of these #s lines up with what day it is?
Click the one that does. At the bottom right you will see the offset for comparefarbytetobyte. Grats!
comparefarbytetobyte 0xyournewoffset 0x0 ///this is complete night
if == jump @itssunday
TELLING THE TIME
Hopefully this clears up confusion.
The tool can be found here -> https://www.pokecommunity.com/showthread.php?t=246089
HOW TO GET THE PROGRAM WORKING
Open the program "FSF" (free space finder)
Open windows calculator and change it to programmer mode.
Open the DNS program.
In the DNS program, look where it says install RTC (on the left) it should have a # on how much free space it needs.
Click the calculator and click hex mode.
Type in that #.
Click the decimal mode.
Copy that # and paste it into FSF after opening the rom.
Click search.
Copy that # and paste it into the RTC and hit install.
This will now install it to that offset.
Now, do the same process with night and day, and seasons if you want those.
The RTC is a clock based system. It basically makes variables in the game that will read off the time. Until you make it do something, you won't see a difference.
The day and night system works on the REAL time of day and night. So if its still day outside where you are, you won't see a difference.
Wait until night time or morning. Also make sure you have your emulator's real time clock enabled.
Options -> Game emulator -> Game override -> Real time clock enabled. (This is for VBA)
I haven't touched seasons and won't touch them. Too much spriting.
USING NIGHT FUNCTIONS
Since there are technically 3 slots for night, this is what you would want to use:
Spoiler:
comparefarbytetobyte 0x203C000 0x0 ///this is complete night
if == jump @itsnight ' Equal To
comparefarbytetobyte 0x203C000 0x4 ///this is dusk
if == jump @itsnight ' Equal To
comparefarbytetobyte 0x203C000 0x5 ///this is twilight
if == jump @itsnight ' Equal To
if you look on the bottom right of the program, it says "status byte" these are the corresponding #s for night.
TELLING WHAT DAY IT IS
if you're looking to check what day it is, first you have to understand how the information reads. If you look on the DNS program at the RTC area. You're going to see the offset where the RTC is installed, and then you're going to see the time will be written to "0x0300553c"
Now since it seems like there has been a lot of innacuracy on this specific offset throughout this thread, causing a lot of issues, we have to do this to confirm we're in the right spot:
Open up VBA.
Click tools -> memory viewer -> and type in your offset.
You're going to see:
DF 07 etc etc etc
If you reverse DF 07 you get 07DF, and that's 2015 in hex. (Hey we found the year offset!)
Now we know the corresponding days...
0 is sunday 1 is monday 2 is tuesday etc... so which one of these #s lines up with what day it is?
Click the one that does. At the bottom right you will see the offset for comparefarbytetobyte. Grats!
Spoiler:
comparefarbytetobyte 0xyournewoffset 0x0 ///this is complete night
if == jump @itssunday
TELLING THE TIME
Code:.text .align 2 .thumb .thumb_func main: push {lr} ldr r0, var_8000 ldr r1, date @loads the date address ldrb r1, [r1] @loads the value strb r1, [r0] @stores the date in variable 8000 ldrb r1, [r1, #0x2] @loads the hour value into r1 strb r1, [r0, #0x2] @stores the hour in variable 8001 ldrb r1, [r1, #0x3] @loads the minute value into r1 strb r1, [r0, #0x4] @stores the minute in variable 8002 pop {pc} .align 2 var_8000 .word 0x020370B8 date .word 0x03005540
Now you should be able you buffernumber 0x8000, 8001, 8002 for your variable. Also a quick heads up you can do this without ASM (but it is less efficient) by copying the byte to 0x020370B8 (Last_Result 0x800D). Not sure about copy half word though... Anyway it should work now :)
Hopefully this clears up confusion.
Last edited: