diff --git a/Source/Project64-core/N64System/Mips/Disk.cpp b/Source/Project64-core/N64System/Mips/Disk.cpp index 332056d17..0792107c5 100644 --- a/Source/Project64-core/N64System/Mips/Disk.cpp +++ b/Source/Project64-core/N64System/Mips/Disk.cpp @@ -17,6 +17,12 @@ #include #include +#ifdef _WIN32 +#include +#else +#include +#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(<ime); - + struct tm result = { 0 }; localtime_r(<ime, &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));