Homebrew [Release] RTCChanger NDS

  • Thread starter Thread starter MegaBoyEXE
  • Start date Start date
  • Views Views 7,403
  • Replies Replies 11
  • Likes Likes 8

MegaBoyEXE

Well-Known Member
Member
Joined
Dec 27, 2015
Messages
126
Reaction score
56
Trophies
0
XP
601
Country
Brazil
It's been a while that I have been searching for a tool that could change the NDS hardware RTC, without triggering the "anti-time travel" feature that blocks in-game time events for 24h (eg. Pokemon games), but never found one.
So I decided to create one myself.
I've used the "GBA rtcread" tool as base code for GUI, so if you used that tool before, you should be familiar with it.

Just be advised that you are responsible to sync the "week day" value too when changing the Date.

I was able to successfully do in-game events without penalties, like growing berries by changing time in increments of 4 hours, and saving again.

This tool changes the RTC without modifying the "RTC Offset" data in the firmware, so games cannot detect time changes.

Source code is included.

Latest version: v1.2.0

Download
https://gbatemp.net/download/rtcchanger-nds.36158/
 
Last edited by MegaBoyEXE,
Did a small update to the homebrew application. Also created an RTCChanger plugin icon for the SuperCard DSTWO.

Changelog:

v1.1.0 - September 22, 2019 (Updated by DeadSkullzJr)
- Added a new homebrew icon
- Added a new homebrew description
 

Attachments

I tried to do this myself a few months ago but couldn't figure out how to actually do it. This is awesome, thank you!!

EDIT: I just found a bug in the source code. Line 115 in the arm9 source code. The day is rolled over when it is set to 9 in a leap year in February when it should be rolled over at 29.
Code:
if((edit_datetime[_YEAR]%4==0 && edit_datetime[_DAY]==9)

should be

Code:
if((edit_datetime[_YEAR]%4==0 && edit_datetime[_DAY]==29)
 
Last edited by MopSec,
  • Like
Reactions: Alexander1970
I tried to do this myself a few months ago but couldn't figure out how to actually do it. This is awesome, thank you!!

I saw your post when I was searching about.
Just FYI, in case you wanna try other apps, the inter-CPU communication is done through a special hardware that arbitrates the buses with interruptions, so you pass messages with content or addresses to data that will become visible to the other side. That other side then should pool the channels checking for incoming data, then you can process them.

There's a template in libnds named "combined" that generates both ARM7 and ARM9 binary from code, so you can modify as you please, and also check the FIFO API from libnds to choose the appropriate way to share your data.

I just found a bug in the source code. Line 115 in the arm9 source code. The day is rolled over when it is set to 9 in a leap year in February when it should be rolled over at 29.

This is probably a bug that came from rtcread code as I didn't checked for logic, it always worked for me before.
I will see if I can fix the rtcread tool too (if it actually compiles with current devkitPRO versions), and post the updated tools here too.
 
Last edited by MegaBoyEXE,
I saw your post when I was searching about.
Just FYI, in case you wanna try other apps, the inter-CPU communication is done through a special hardware that arbitrates the buses with interruptions, so you pass messages with content or addresses to data that will become visible to the other side. That other side then should pool the channels checking for incoming data, then you can process them.

There's a template in libnds named "combined" that generates both ARM7 and ARM9 binary from code, so you can modify as you please, and also check the FIFO API from libnds to choose the appropriate way to share your data.



This is probably a bug that came from rtcread code as I didn't checked for logic, it always worked for me before.
I will see if I can fix the rtcread tool too (if it actually compiles with current devkitPRO versions), and post the updated tools here too.
No no, the bug is in your source file :) Just look at the line I quoted in my post
 
  • Like
Reactions: Alexander1970
I know, I "imported" the bug from the other tool code that had the nice clock console GUI.
As I never changed the clock in Feb 29, never found it on the other tool, which I used A LOT for changing the GBA cart RTC.

Edit: Bug was fixed, and new version is available in first post.
 
Last edited by MegaBoyEXE,
  • Like
Reactions: MopSec
Thx! I uploaded this version to the tools section, and edited first post to point to the download page.
No problem, I do have a request though, I’m not entirely sure what I was doing wrong yesterday, but I was trying to swap the month and the day around. It worked to an extent, however it seems I either missed something or edited the wrong thing (no clue honestly). So I’m going to leave that part up to you. Seeing the day in front of the month like that just feels weird to me, hence why I tried to change it. Also you should consider making the time more “real time” when editing the time as the seconds don’t go up at all while editing, thus makes it easy to mess up the time when saving a new date.
 
No problem, I do have a request though, I’m not entirely sure what I was doing wrong yesterday, but I was trying to swap the month and the day around. It worked to an extent, however it seems I either missed something or edited the wrong thing (no clue honestly). So I’m going to leave that part up to you. Seeing the day in front of the month like that just feels weird to me, hence why I tried to change it. Also you should consider making the time more “real time” when editing the time as the seconds don’t go up at all while editing, thus makes it easy to mess up the time when saving a new date.

Keeping time in sync while editing only the Date is not worth. Whenever you edit the RTC, you must set the entire register file at once, so it will always have a minor de-sync of a few seconds.

It will create too much sync issues, like time rollover when 59 minutes, and even day rollover, then month, then year.
The purpose was to create a very simple tool: the user is entirely responsible for setting the complete configuration.
Anything above that I would prefer someone else take ownership and develop a more robust app.

Now about swapping Day and Month, it will only benefits English culture Countries while about all the rest of the world become affected.
I can propose changing the display of date to the more universal ISO 8601 format (YYYY-MM-DD).
 
Keeping time in sync while editing only the Date is not worth. Whenever you edit the RTC, you must set the entire register file at once, so it will always have a minor de-sync of a few seconds.

It will create too much sync issues, like time rollover when 59 minutes, and even day rollover, then month, then year.
The purpose was to create a very simple tool: the user is entirely responsible for setting the complete configuration.
Anything above that I would prefer someone else take ownership and develop a more robust app.

Now about swapping Day and Month, it will only benefits English culture Countries while about all the rest of the world become affected.
I can propose changing the display of date to the more universal ISO 8601 format (YYYY-MM-DD).
Leave it as is then, it works good already, I guess don’t break what isn’t broken am I right lol?
 
  • Like
Reactions: MegaBoyEXE
I just downloaded to adjust the RTC for Pokemom Diamond.
I just want to transfer my pokemon from Sapphire without wait 24 hours.
 
Last edited by Trip_Away,

Site & Scene News

Popular threads in this forum