Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Reload this Page [Tutorial] How to get Prime-Dialga's DNS to work (Seasons not included)

Notices
For all updates, view the main page.

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.



Reply
 
Thread Tools
  #1    
Old May 14th, 2015 (01:00 AM). Edited May 17th, 2015 by Criminon.
Criminon's Avatar
Criminon Criminon is online now
Pokemon: Aqua Blue
 
Join Date: Aug 2012
Gender: Male
Posts: 192
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 -> http://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

Quote originally posted by kearnseyboy6:
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.
__________________
FC: 3582 - 9598 - 9978. Add me!
Reply With Quote
  #2    
Old May 14th, 2015 (06:13 PM).
apalhegyi apalhegyi is offline
 
Join Date: May 2015
Posts: 12
Does anyone know how to add day/night specific pokemon with advancemap?
Reply With Quote
  #3    
Old May 14th, 2015 (06:51 PM).
Criminon's Avatar
Criminon Criminon is online now
Pokemon: Aqua Blue
 
Join Date: Aug 2012
Gender: Male
Posts: 192
Quote originally posted by apalhegyi:
Does anyone know how to add day/night specific pokemon with advancemap?
Sorry, I don't. But I updated the guide to include a clock.
__________________
FC: 3582 - 9598 - 9978. Add me!
Reply With Quote
  #4    
Old May 14th, 2015 (10:27 PM).
kearnseyboy6's Avatar
kearnseyboy6 kearnseyboy6 is offline
Aussie's Toughest Mudder
 
Join Date: Dec 2008
Posts: 294
Sorry to cram your super code but this will copy the time into variable 0x8000:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {lr}
	ldr r0, var_8000
	ldr r1, time
	ldrb r1, [r1]
	strb r1, [r0]
	pop {pc}


.align 2
	var_8000 	.word 0x020370B8
	time		.word 0x0300553c
__________________
HOLIDAYING CURRENTLY!!
Reply With Quote
  #5    
Old May 15th, 2015 (01:19 AM).
Criminon's Avatar
Criminon Criminon is online now
Pokemon: Aqua Blue
 
Join Date: Aug 2012
Gender: Male
Posts: 192
Quote originally posted by kearnseyboy6:
Sorry to cram your super code but this will copy the time into variable 0x8000:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {lr}
	ldr r0, var_8000
	ldr r1, time
	ldrb r1, [r1]
	strb r1, [r0]
	pop {pc}


.align 2
	var_8000 	.word 0x020370B8
	time		.word 0x0300553c
Haha, supercode... Yeah it was a pain in the ass writing that. I'm using JPAN's engine and I think 8000 is used. I would have much rather used ASM but at least it works.
__________________
FC: 3582 - 9598 - 9978. Add me!
Reply With Quote
  #6    
Old May 15th, 2015 (01:29 AM).
Percy's Avatar
Percy Percy is offline
Let's moonwalk, sha'mone!
 
Join Date: Sep 2014
Location: Somewhere in the world, obviously
Gender: Male
Nature: Gentle
Posts: 2,208
Quote originally posted by Criminon:
Haha, supercode... Yeah it was a pain in the ass writing that. I'm using JPAN's engine and I think 8000 is used. I would have much rather used ASM but at least it works.
Well then, use LASTRESULT (0x800D) Let me modify the ASM.

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {lr}
	ldr r0, var_800D
	ldr r1, time
	ldrb r1, [r1]
	strb r1, [r0]
	pop {pc}


.align 2
	var_800D 	.word 0x020370D0
	time		.word 0x0300553c
And, Criminon, your script is so huge :0
__________________
Pair | #TeamTrivia
Reply With Quote
  #7    
Old May 15th, 2015 (01:35 AM). Edited May 15th, 2015 by Criminon.
Criminon's Avatar
Criminon Criminon is online now
Pokemon: Aqua Blue
 
Join Date: Aug 2012
Gender: Male
Posts: 192
Quote originally posted by Percy:
Well then, use LASTRESULT (0x800D) Let me modify the ASM.

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {lr}
	ldr r0, var_800D
	ldr r1, time
	ldrb r1, [r1]
	strb r1, [r0]
	pop {pc}


.align 2
	var_800D 	.word 0x020370D0
	time		.word 0x0300553c
And, Criminon, your script is so huge :0
lol it may not be the best, but it gets the job done, haha. Thanks. I figured it would be easy to edit the variable. I didn't look at the code. Was actually reading up on ASM programming now. Also with this ASM, (I haven't tried it yet) does it show the entire time when called? like 4:46? or 4? or 46?
__________________
FC: 3582 - 9598 - 9978. Add me!
Reply With Quote
  #8    
Old May 15th, 2015 (02:56 AM).
Percy's Avatar
Percy Percy is offline
Let's moonwalk, sha'mone!
 
Join Date: Sep 2014
Location: Somewhere in the world, obviously
Gender: Male
Nature: Gentle
Posts: 2,208
Quote originally posted by Criminon:
lol it may not be the best, but it gets the job done, haha. Thanks. I figured it would be easy to edit the variable. I didn't look at the code. Was actually reading up on ASM programming now. Also with this ASM, (I haven't tried it yet) does it show the entire time when called? like 4:46? or 4? or 46?
I'll test it once I have some free time. Studying atm.
__________________
Pair | #TeamTrivia
Reply With Quote
  #9    
Old May 15th, 2015 (04:03 AM).
kearnseyboy6's Avatar
kearnseyboy6 kearnseyboy6 is offline
Aussie's Toughest Mudder
 
Join Date: Dec 2008
Posts: 294
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
__________________
HOLIDAYING CURRENTLY!!
Reply With Quote
  #10    
Old May 15th, 2015 (07:26 AM).
Criminon's Avatar
Criminon Criminon is online now
Pokemon: Aqua Blue
 
Join Date: Aug 2012
Gender: Male
Posts: 192
Quote originally posted by kearnseyboy6:
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
Hey thanks a bunch for this. I really appreciate you taking the time to make this. I've been reading up on asm since my last post. Lets hope I'll be able to contribute the same here soon.
__________________
FC: 3582 - 9598 - 9978. Add me!
Reply With Quote
  #11    
Old May 15th, 2015 (10:50 AM).
RichterSnipes's Avatar
RichterSnipes RichterSnipes is offline
RIP Konami 1969-2015
 
Join Date: Oct 2011
Location: USA
Age: 22
Gender: Male
Nature: Modest
Posts: 245
This thread is a good primer for people wanting to use this for D/N events!

You might want to add a disclaimer in the OP that this implementation of the RTC breaks in-game trading. Shiny Quagsire modified it to fix this issue among other things. Follow the instructions in it and insert it as you would with any other ASM. It seems to mostly works as it should, but I have issues with extra map lighting occasionally becoming disabled.
__________________


Who says hacks have to radically changes things up from their base games?
Click Red to check out a "definitive" version of his adventure in Kanto!
Reply With Quote
  #12    
Old May 15th, 2015 (12:44 PM).
Criminon's Avatar
Criminon Criminon is online now
Pokemon: Aqua Blue
 
Join Date: Aug 2012
Gender: Male
Posts: 192
Quote originally posted by RichterSnipes:
This thread is a good primer for people wanting to use this for D/N events!

You might want to add a disclaimer in the OP that this implementation of the RTC breaks in-game trading. Shiny Quagsire modified it to fix this issue among other things. Follow the instructions in it and insert it as you would with any other ASM. It seems to mostly works as it should, but I have issues with extra map lighting occasionally becoming disabled.
Wasn't there a fix for that?

Quote originally posted by Mr.Pkmn:
Fortunately it's not necessary.

Some time ago i found the reason of the screen blinking while entering in a building or when you're selecting moves in battle. I don't know why, but the game stores a copy of the palette memory in WRAM and reloads it in these situations, causing a blink effect because the original palette is loaded for one frame. Replacing 0x70682 with 00 00 00 00 fixes the problem, but i haven't tested enough to say that it doesn't cause other glitches.
This doesn't fix the warp-arrow glitch though.

This fixed it for me with the standard DNS installed.
__________________
FC: 3582 - 9598 - 9978. Add me!
Reply With Quote
  #13    
Old May 15th, 2015 (01:10 PM).
RichterSnipes's Avatar
RichterSnipes RichterSnipes is offline
RIP Konami 1969-2015
 
Join Date: Oct 2011
Location: USA
Age: 22
Gender: Male
Nature: Modest
Posts: 245
Quote originally posted by Criminon:
Wasn't there a fix for that?




This fixed it for me with the standard DNS installed.
Is this a complete fix, or more of a bandage for a bigger problem? The poster says that it doesn't fix one of the other issues from it. I assume the one I linked to fixes more than that, since it's less than a year old.
__________________


Who says hacks have to radically changes things up from their base games?
Click Red to check out a "definitive" version of his adventure in Kanto!
Reply With Quote
  #14    
Old May 15th, 2015 (04:35 PM).
Criminon's Avatar
Criminon Criminon is online now
Pokemon: Aqua Blue
 
Join Date: Aug 2012
Gender: Male
Posts: 192
Quote originally posted by RichterSnipes:
Is this a complete fix, or more of a bandage for a bigger problem? The poster says that it doesn't fix one of the other issues from it. I assume the one I linked to fixes more than that, since it's less than a year old.
The fix I linked fixes the flickering. You said it still happens when you go places correct? I haven't had any problems with flickering using the above.

Edit: sorry you said extra map lighting. I figured this was what you were reffering to.
__________________
FC: 3582 - 9598 - 9978. Add me!
Reply With Quote
Reply
Quick Reply

Sponsored Links

You may also like.. (Beta)
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 -8. The time now is 09:20 PM.