• 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?".
  • 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.

Tool: DNS - Day, Night and Seasons

249
Posts
11
Years
    • Seen Apr 22, 2024
    Hi!
    In these days i developed a variant of prime's DNS:
    Spoiler:


    Each filter follows the same format of GBA palettes:
    [0] - [5 bit blue] - [5 bit green] - [5 red bit]
    The first bit is unused, while the remaining fields occupy 5 bits.
    In each field, you must specify how much blue/green/red subtract from the palette.
    For example, to get a blue-tinted filter, you have to subtract red and green:
    [0] - [0] - [8] - [8] -> [0] - [01000] - [01000] - [01000] -> 0x2108
    I used these filters:
    Spoiler:

    In this specific case, there are 40 filters.
    This number is obtained from the following formula: ((hours * 3600) + (minutes * 60) / 2160) = [0-39]
    To increase the number of filters, replace the red highlighted part of the code with:
    LDR R1, = VAL, where instead of VAL will be entered the denominator of the previous division, in my case 2160.
    For example, to use 144 filters, you must be raplce VAL with 600 -> (24 hours * 3600) / 600 = 144.
    In the last part of the routine, where the various offsets are marked, one is highlighted in blue and corresponds to the table where the filters are placed.
    You can change it the offset where filters will insert.
    To insert it we must go to 0x98 bytes later than the offset of the original DNS routine, and then overwrite the bytes with 00 4E 30 47 XX XX XX 08, where XX will be raplced by the offset of the new routine in little endian + 1.
    Here's a little video to show the end result:
     
    38
    Posts
    7
    Years
  • Hi!
    In these days i developed a variant of prime's DNS:

    To insert it we must go to 0x98 bytes later than the offset of the original DNS routine, and then overwrite the bytes with 00 4E 30 47 XX XX XX 08, where XX will be raplced by the offset of the new routine in little endian + 1.
    Here's a little video to show the end result:

    Could you perhaps explain a little more what we have to do to make it work? I tried to implement this in pokemon Emerald, but it just crashes on entering an outside map ...

    With "the original DNS routine" do you mean the routine for the RTC or the routine for the DNS filters?
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • I tried doin seasons with the tool but it's not working.
    So always remember to remember the trustworthy face of rhacking...
    SQ...
    He only did the functionality on changing palettes but I think for seasons it's more than enough...
    ;)
    the seasons of this tool are in all practicality functional
    honestly idk why they actually have them separate if they're based upon the month anyways
    point being just because the tileset is not swapped doesn't mean the seasons are not there and the value is still there for the season
     
    22
    Posts
    11
    Years
    • Seen May 12, 2021
    I try this tool on Fire red German version where i can find it out if this even working? So far i see everything still at Day colors.
     

    Jcool

    Stellar
    53
    Posts
    16
    Years
  • Could we make the D/N system optionally not depend on the RTC? So if I wanted to change the palettes for everything just by changing the D/N status byte, it would not check the RTC? Or just disable the RTC completely and be able to manually control the statusbyte for what time it is?

    I will PayPal $25 to whoever can figure this out,
     
    Last edited:
    2
    Posts
    6
    Years
  • Good Day everyone,
    The RTC hack does not work on real hardware, or any emulator with no RTC emulation (or with a different emulation as the vba).
    Is this correct?

    How does the ingame time counter for the savegame work?
    Does it count real seconds every new start, or does it simply count up?
    Does emulators count in the right speed? And How fast a real Gameboy would count?

    To make it short:
    Would it be possible to set the time of day based on the counter? To ensure the DAN system is compatible with original hardware (does it work on 3ds injection?) and every emulators
     
    Last edited:
    5
    Posts
    6
    Years
    • Seen Jan 19, 2020
    The RTC code injected by this tool won't work on hardware. A patch I made to DNS.exe to inject fixed code is attached (as both UPS and IPS). This also makes the RTC code work with recent builds of mGBA.
     

    Attachments

    • DNS-fix.zip
      1.1 KB · Views: 205

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • The RTC code injected by this tool won't work on hardware. A patch I made to DNS.exe to inject fixed code is attached (as both UPS and IPS). This also makes the RTC code work with recent builds of mGBA.
    so
    what exactly did you do to fix?
     
    5
    Posts
    6
    Years
    • Seen Jan 19, 2020
    so
    what exactly did you do to fix?

    I figured out the bug by looking at what Pokémon Adventure: Red's Chapter was doing wrong, then patched that game by hand. I looked for the original code that had been in the game inside of DNS.exe and replaced it with my fixed version, so now it injects the fixed version instead of the original.
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • I figured out the bug by looking at what Pokémon Adventure: Red's Chapter was doing wrong, then patched that game by hand. I looked for the original code that had been in the game inside of DNS.exe and replaced it with my fixed version, so now it injects the fixed version instead of the original.
    sorry for my lack of clarity ;-;
    what exactly was fixed?
     
    5
    Posts
    6
    Years
    • Seen Jan 19, 2020
    This allows the real-time clock to report the time properly in emulators other than VBA, as well as on real hardware. The code was buggy in such a way that it only worked due to bugs in VBA as well, so on emulators lacking VBA's bugs it wouldn't work.
     
    1
    Posts
    6
    Years
    • Seen Mar 13, 2018
    I have a weird problem with the app where im trying to put the RTC but it goes through an error when i try to insert it. It says, "Maybe an old DAN-System detected! You have to erase it before you can install my new Dan-System!" I press ok and another error comes up saying. "Unhandled exception has occured in your application. If you click continue, the app will ignore and attempt to continue. Arithmetic operation resulted in an overflow." I click continue and try to erase the old DAN and another error pops up. "(same error as before) Index was outside the bounds of the array." I have no idea what to do and im just trying to get the RTS to work, it only happens with FR/LG, R/S/E.
     

    Urz

    9
    Posts
    14
    Years
    • Seen Oct 8, 2022
    This allows the real-time clock to report the time properly in emulators other than VBA, as well as on real hardware. The code was buggy in such a way that it only worked due to bugs in VBA as well, so on emulators lacking VBA's bugs it wouldn't work.

    I've just tried the patch. I think there is a bug in the code that causes the game to recognise the 12 hour clock. Anything from 12:01-23.59 gets converted to 00:01-11:59.

    Is there anyway to fix this?
     
    1
    Posts
    5
    Years
    • Seen Jul 7, 2018
    I have a weird problem with the app where im trying to put the RTC but it goes through an error when i try to insert it. It says, "Maybe an old DAN-System detected! You have to erase it before you can install my new Dan-System!" I press ok and another error comes up saying. "Unhandled exception has occured in your application. If you click continue, the app will ignore and attempt to continue. Arithmetic operation resulted in an overflow." I click continue and try to erase the old DAN and another error pops up. "(same error as before) Index was outside the bounds of the array." I have no idea what to do and im just trying to get the RTS to work, it only happens with FR/LG, R/S/E.

    I have this same issue here. Very new to all this, could really use some help. Just want to add Day/Night evolutions to Eevee
     
    232
    Posts
    12
    Years
    • Seen Sep 10, 2019
    The RTC code injected by this tool won't work on hardware. A patch I made to DNS.exe to inject fixed code is attached (as both UPS and IPS). This also makes the RTC code work with recent builds of mGBA.

    Thanks so much for the fix, I was spending a long time trying to figure out why RTC didn't display the correct time on my EDGBA. If you ever read this, could you post your fixed routine?
     
    20
    Posts
    8
    Years
    • Seen Nov 9, 2022
    Does anyone have the source code for the RTC and DAN? Obviously I have the hex code that this tool produces but I want to understand how it works to implement something with it.
     
    2
    Posts
    4
    Years
    • Seen Nov 9, 2019
    Question, what application are you using to input the settings for 'Emerald: Replace 0xA1BCE instead'?
     
    Back
    Top