Merge pull request #944 from LuigiBlood/64dd_2

Fix Disk.cpp time/date code & F-Zero X (J) RDB update
This commit is contained in:
zilmar 2016-01-28 17:51:00 +11:00
commit 8df90936f8
2 changed files with 9 additions and 2 deletions

View File

@ -1805,6 +1805,7 @@ Clear Frame=2
[4D3E622E-9B828B4E-C:4A]
Good Name=F-ZERO X (J)
Internal Name=F-ZERO X
RDRAM Size=8
Status=Compatible
Plugin Note=[Glide64] missing menu effects
32bit=No

View File

@ -17,6 +17,12 @@
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/Mips/SystemTiming.h>
#ifdef _WIN32
#include <Windows.h>
#else
#include <sys/time.h>
#endif
bool dd_write;
bool dd_reset_hold;
uint32_t dd_track_offset, dd_zone;
@ -44,13 +50,13 @@ void DiskCommand()
#else
time_t ltime;
ltime = time(&ltime);
struct tm result = { 0 };
localtime_r(&ltime, &result);
//BCD format needed for 64DD RTC
uint8_t year = (uint8_t)(((result.tm_year / 10) << 4) | (result.tm_year % 10));
uint8_t month = (uint8_t)(((result.tm_mon / 10) << 4) | (result.tm_mon % 10));
uint8_t month = (uint8_t)((((result.tm_mon + 1) / 10) << 4) | ((result.tm_mon + 1) % 10));
uint8_t day = (uint8_t)(((result.tm_mday / 10) << 4) | (result.tm_mday % 10));
uint8_t hour = (uint8_t)(((result.tm_hour / 10) << 4) | (result.tm_hour % 10));
uint8_t minute = (uint8_t)(((result.tm_min / 10) << 4) | (result.tm_min % 10));