This is Hacker Public Radio Episode 3,765 for Friday 6 January 2023. Today's show is entitled, Fixing Clock Events in GBA Pokemon Cartridges. It is part of the series Hobby Electronics. It is hosted by Celeste and is about 14 minutes long. It carries a clean flag. The summary is tinkering with the RTC Real-Time Clock Hardware on Game Boy Advance Cartridges. Hello everyone and welcome to this new episode of My Podcast. Today we will talk about something I found out and I've been trying to think of it in the last days. Needest Game Boy Advance Cartridges from 2003 and 2005. Some of these Cartridges have an internal battery because they need to keep track of the time using an RTC Real-Time Clock in the hardware of the cartridge. And when this battery fades and is exhausted, some problems arise. So, first let's talk about how the battery has been used in these games. One in the previous games, from the Game Boy and Game Boy Color, like the Pokemon Goat and Silver and Crystal versions. The battery was also used to keep the save file, so not only the time, so when the battery is exhausted, you also lose every single save file you might have, which is great but because it was turned in an SRAM memory which needed an energy. In the next games, they swapped the SRAM for the save file for a flash memory, so that it could keep the save file even without energy, but it still had a real-time clock inside for the time events, for example, growing berries and plants or discounts at the stores in the game, and also something I need to search a translation for Maria, Maria is the Maria is the C, so the tide, every 6 hours, you have the tide, because certain locations of the game could only be accessed within a certain time frame or they appear different based on the tide level. So this games really need a working internal battery to run this internal clock. When the battery is exhausted, the real-time clock returns ZGRO, which means first of January of year 2000, and it keeps returning ZGRO. That's fine, it's fainted, it makes sense, so when the game detects ZGRO returned by that by that RKC clock, it displays a wording message to replace the battery. You replace the battery using some I-RON, some soldering or other methods you can find online, trying to unclip the battery manually, and fix it there with tape, there are some methods to do that, anyway, you can search that on YouTube. Anyway, you succeed to replace that battery, the RKC clock starts to work again, but hey, the clock is stuck, it starts again from January 1st all the 3000, while you're safe-file, last timestamp that your safe-file had displays 2000 and 7. So the game thinks to be in the future, while the clock is 7 years back, you plant a battery in the ground, in your safe-file in 2007, so that it will grow in 12 hours, but then, in order to be grown, it has to be your current time, some safe-file, plus 12 hours, but your real time clock is still stuck and the January 1st of 2000, so unless you wait 7 years, you won't see your very grown, so we have to find a way to fix that, and I found two ways online, I still haven't tried this, I want to try this, but I still need a tool to do that. So you can theoretically choose two paths, first, you can revert the timestamp in your safe-file by editing the safe-file directly, so that the game sees January 1st of 2000, just the last scene timestamp, in this way, the RTC will be in the future compared to the internal safe-file, and the game will be happy, another alternative is to move the internal RTC clock in the future, maybe in today's date, so that it's in the future compared to the internal timestamp, such error happens, because when the game compares the calendar event like the growth of a battery in 2007, with the real time clock, which is close to 0, after you replace the battery, you will do real time clock minus calendar date, and it will get a negative number, which will be climbed to 0, so it says, hey, 0 time has passed, so the event has not happened, and the whole game appears as stuck, well, there's only one exception to this glitch, which is the title control, because I guess that you're using some modules operation, because it only keeps track on the hours, very tuned by the real time clock, and not the day, so that title control doesn't it's not affected by this problem, I was saying, you can do this, you can patch it, or by rolling back the safe-file timestamp, or by putting your RTC clock in the future, and you have two tools, you could use some proper GBA tools, but nowadays it's, for example, in order to directly edit and dump the safe-file from the Game Boy Advance, but they are quite rare to find, but there is something we can use, at least that's what I read, I still miss that tool, you can find a DS flash ROM, DS flash ROMs, let you run any game, unfortunately even pirated ones, but it should be fine if you own the copy of the game, or region a copy, you can run a back-up copy legally in most countries, as far as I know, but you can also run or humble you and custom tools on an Nintendo DS, and an Nintendo DS has a secondary slot for old Game Boy Advance games, the Game Boy Advance slot can be accessed from the Nintendo DS software, so there are two tools that you will run on your Nintendo DS using a flash ROM to run custom software on the DS, that will access the safe-file in the secondary slot in the Game Boy Advance cartridge, and you can fix that, you can manually you can manually change the real-time clock internal value, I would like to add another 3 via, there is a glitch related to the real-time clock that happens in the Ruby and Sapphire games, from 2003, the game would run normally in the first year, you can see every kind of event working correctly, but then it will froze for a whole year, because the real-time clock saves the year, the day, the minute, the hour, the second, and every, it saves everything, but the internal game only needs day, it converts the entire time to a single day variable, and when the conversion happens there is a bug in this previous games, where the year 2000 and the year 2001 of the real-time clock will be collapsed as it were 2000, so if you plan to bury on 31 December of 2000, in the internal battery, in the internal RTC timestamp, and you wait a few hours to the January 1st, 2001, everything will be blocked, because the game will think that it's still in the year 2000, so it rolled back, it thinks it's things to be rolled back of 36-5 days, and you have to wait another 30-35 days to be in 2020, to unlock that, and this is one of the very few games of the cartridge games, where enough each other fixed has been delivered by the producer, unlike many other cartridges games, in many other cartridges games, simply enough, when a bug is discovered, only the newly-productive cartridges will be fixed and passed, but the past will be not applied to the old ones, as this was pretty bad glitch, a patch has been provided, you could connect your Sapphire Ruby game to the next generation games, using a cable link and a special program inside them, and what this patch of program did, it simply to advance the RTC clock by 36-5 days if you were, so that it will, the game will think to be after 2002, and you will not encounter the year 2000 and year 2001, collapsing together and making this glitch happen, that they just pushed the game internal clock forward by one year, and yeah, he did the job, so I will try these methods, I will post the links to do that in the description, and I found them on some forums, and they are open source, and so I trust them a bit more to run on my regular hardware, but I still need to try to, so let me know if you have tried that, or you have some hardware and want to try, and maybe if I succeed, if I didn't succeed, I will make another episode explaining what was wrong and what went right, so it's all for today and see you in the next episode, thank you for listening, you have been listening to Hacker Public Radio at Hacker Public Radio.org, today's show was contributed by a HBR listening like yourself, if you ever thought of recording podcasts, click on our contribute link to find out how easy it means, hosting HBR has been kindly provided by an onsthost.com, the internet archive and our synced.net. On the satellite stages, today's show is released on our creative comments, attribution for.o international license.