180°

Programmer reveals cause of Zune blunder

The Zune's real-time clock stores the time in terms of days and seconds since January 1st, 1980. When the Zune's clock is accessed, the driver turns the number of days into years/months/days and the number of seconds into hours/minutes/seconds. Likewise, when the clock is set, the driver does the opposite.

The Zune frontend first accesses the clock toward the end of the boot sequence. Doing this triggers the code that reads the clock and converts it to a date and time. Below is the part of this code that determines the year component of the date:



Under normal circumstances, this works just fine. The function keeps subtracting either 365 or 366 until it gets down to less than a year's worth of days, which it then turns into the month and day of month. Thing is, in the case of the last day of a leap year, it keeps going until it hits 366. Thanks to the if (days > 366), it stops subtracting anything if the loop happens to be on a leap year. But 366 is too large to break out of the main loop, meaning that the Zune keeps looping forever and doesn't do anything else.
Alternative Sources:
Lord Anubis - contributor
Published: 186 days 23 hours ago | News | Mobile | Tech
 
 
 

Industry News
Coming soon to Playstation Home... Your face?
Industry News | Article
PS3Addiction.com writes: "In a recent interview with PhysOrg, Dr. David McKinnon, a researcher from Queensland University of Technology...

Tech
Best Buy, Tivo partner to drive growth, new UI
Tech | News
Marcus Lai of PunchJump writes: "Tivo Inc. on Thurs. said that it has entered into a strategic partnership with Best Buy Co. Inc. to driv...

Gaming
iPhone Application of the Month (JULY): Flight ...
Gaming | News
Flight Control is an extremely addicting game that was started as a personal project by Firemint's CEO, Robert Murray. With the help of there devel...

Tech
Spymaster Takes Twitter by Espionage
Tech | News
A new game has been launched using Twitter as it's basis. It is called Spymaster and it looks and feels much like the games you see on Facebook or...
About N4G
N4G is a social game news site that covers the game industry 24 hours a day, 7 days a week.
More Info... | Submit News