Berry glitch

The Berry glitch (Japanese: きのみ Berry problem) is a glitch only found in early versions of which affects the game's internal calendar. The name of the glitch comes from the fact that the first thing a player will usually notice is that all Berries that have been planted have ceased growing. The glitch occurs 366 days after the game is first started, or 366 days after the internal battery is replaced, and causes all calendar-based events to be delayed by 366 days. After the glitch was officially acknowledged by Nintendo and The Pokémon Company, they provided several methods to mitigate the effects of the glitch, and incorporated a permanent fix into later production runs of the game.
==Explanation==
The game cartridge contains a real-time clock (RTC) which keeps track of the year, month, day, hour, minute, second, and day of the week. When the RTC is first turned on, its date is set to January 1, 2000. Because the game has no need for an actual calendar system, it converts the RTC's year, month, and day data into a single "day number". The conversion function has a flaw, however: it will only count years (adding 365 or 366 days for each year or leap year) starting from 2001. So, while the RTC clock is reporting the year as 2000 or 2001, in both cases, the conversion equates this to "add 0 days to the day number". This means that, for the first 366 days the RTC runs (starting from January 1, 2000), the game's day number will count from 1 to 366 normally, but when the RTC clock reports January 1, 2001, the game's day number will start from 1 again.
If, for example, a Sitrus Berry was planted on December 31, 2000 according to the RTC, which the game interprets as day 366, it will be scheduled to be fully grown on day 367. Due to the glitch, day 367 will not happen until the RTC reaches January 2, 2002. The result is that the growth of the Berry appears to be frozen for 366 days. Other effects of this glitch include:
* Random events which are calculated once per day, including the random number for and weather conditions on and , along with random events which must be announced on TV, such as the Energy Guru and Lilycove Dept. Store sales, service days at the Mauville Game Corner, will be frozen until 366 days after the game was last played before the glitch took effect.
* Drawings at the Pokémon Lottery Corner, NPCs who offer free Berries daily, and the man in Pacifidlog Town who gives or weekly, will be frozen until 366 days after these events were last used.
* The number of successful rocket launches at the Mossdeep Space Center will be reset to 1.
The glitch does not affect the Evolution of into or or the tides in Shoal Cave because these events are based only on the current time, not the day number.
==Similar effects==
===Dead battery===
When the game cartridge's runs dry, the in-game clock will also stop, resulting in very similar symptoms to the above. However, cartridges that have a dead battery will display a message after the title screen warning of the dry battery and the fact that clock-based events will no longer occur. In contrast, games being affected by the Berry glitch will not display this message.
The only way to fix this issue is to replace the battery. It is also possible for a game with a dead battery to be affected by the Berry glitch, however, meaning replacing the battery will not fix time-based events. To further complicate matters, replacing the battery may also cause issues of its own, as explained below.
===Replaced battery===
Cartridges that have had their battery replaced may also experience similar problems. When the supply of power from the battery is interrupted, the RTC is reset to January 1, 2000. As with the Berry glitch, this reset causes all scheduled calendar-based events to be frozen until the RTC reaches the expected value, which may take many years. This can be solved by starting a new game, or (with additional hardware) by altering the timestamp stored in the save file so it is lower than the RTC value, or by setting the RTC forward so it is greater than the save file timestamp.Pokemon Ruby/Sapphire New Battery Glitch at Furlock's ForestHow to reset the RTC in GBA Pokémon games after replacing the battery | GBAtemp.net - The Independent Video Game Community
===Max RTC===
While the RTC runs after 2099-12-31 23:59:59, it will be reset to 2000-01-01 00:00:00. This glitch has two situations:
* RTC runs after 2099-12-31 23:59:59, while game is turned off.
* RTC runs after 2099-12-31 23:59:59, while game is running.
When the game is turned on, the first will be the same as replaced battery glitch. In the second case, the elapsed RTC days saved in the game will generate to a large number, such as 62291 days. The number change relies on the initial RTC saved in the game.
The player can use rtcread to fix the former, but it will eventually change into the second-type RTC glitch. The only way to fix it is to edit the initial RTC and elapsed RTC stored in the save and use rtcread to change the RTC. Editing the initial RTC and elapsed RTC in the save will not synchronously change values relying on the RTC. When running the game, these values will dislocate with the corresponding RTC, such as Mirage Island Values.
==Fixing the glitch==
The glitch can be fixed with the Berry Program Update from ; a patch from , , , , the e-Reader, or a specific interactive demo disc; or by sending the affected game to Nintendo.
If the Berry glitch has not yet begun, these programs will set the RTC forward by 366 days, which prevents the effects of the glitch. If the game is already affected by the Berry glitch, these programs will set the RTC forward to January 2, 2002, the date at which all effects of the glitch end. If the cartridge battery is replaced and a new game is started, the fix will need to be applied again.
===Pokémon FireRed/LeafGreen/Emerald patch===
# Load FireRed, LeafGreen, or Emerald until the title screen is displayed.
# Press the Select and B buttons. After the new screen loads, press A.
# Insert the Link Cable so that FireRed, LeafGreen, or Emerald is connected to the P1 cable port and Ruby or Sapphire is connected to the P2 port. Once this is done, press A.
# Turn on Ruby or Sapphire while holding the Start and Select buttons.
# Refer to the FireRed, LeafGreen or Emerald game display for further instructions. The patch should be transferred at this time.
===Pokémon Colosseum and XD patch===
Linking an affected game to or for trading or battling will automatically download the patch. In addition, the Bonus Disc that came with pre-orders of Colosseum can be used to download into a game; when this happens, the patch is downloaded as well.
===Pokémon Channel patch===
Downloading from a version of Pokémon Channel will automatically download the patch.
===Pokémon Box patch===
Linking an affected game to , accessing the Go To Adventure mode, and then saving the game whilst playing will also automatically fix this glitch, with the message "The Berry Program was updated" appearing with the save confirmation. (This option is not available for Japanese versions.)
===e-Reader patch===
For Japanese versions, a special set of e-Reader+ cards (ID# 16-A001 & 16-A002) were distributed with Pokémon Scoop's Winter 2004 issue containing the Berry Program Update (Japanese: きのみ問題修理プログラム Berry Problem Repair Program).
===GameCube Interactive Demo patch===
Specially-marked GameCube demo discs were released to select stores across U.S. and Japan, so players could visit these stores and download the patch from the disc. In addition, players will also receive a holding a Liechi Berry as a bonus. However, since the demo disc program does not block fixed games, players can receive multiple Zigzagoon by downloading to the same cartridge again.
===GBA cartridge patch===
Specially made GBA cartridges, with the same function as the GameCube demo discs, were released to select stores across the UK. Players could visit these stores and connect to a GBA system containing one of these cartridges via link cable to download the patch, as well as receiving a shiny Zigzagoon holding a Liechi Berry. As with the GameCube demo discs, the program does not block fixed games, so the Zigzagoon can be received by the same cartridge multiple times.
===Sending cartridge to Nintendo===
If the player had no opportunity to download the patch, the game could be sent to Nintendo to have it fixed. However, as of August 2012, Nintendo stopped offering to patch the Berry glitch.
==Cartridges with/without Berry glitch==
Early versions of have the Berry glitch. It is fixed in later versions of these games and all versions of .
Cartridges with/without Berry glitch	Cartridges with/without Berry glitch	Cartridges with/without Berry glitch	Cartridges with/without Berry glitch
Version 	Version 	With glitch 	Without glitch
rowspan=2 	JP FR DE IT ES 	1.0 	1.1
EN 	1.0, 1.1 	1.2 	
==External links==
* Nintendo.com
* Nintendo.co.jp
==References==
==Related articles==
de:Beeren-Glitch
es:Actualización del programa de bayas
fr:Bug de l'horloge interne
it:Glitch delle bacche
ja:きのみ問題
zh:时钟电路（漏洞）