diff --git a/src/rct2.c b/src/rct2.c index fa49f9d794..63f36fc196 100644 --- a/src/rct2.c +++ b/src/rct2.c @@ -122,7 +122,8 @@ void rct2_init() RCT2_CALLPROC_EBPSAFE(0x006BA8E0); // init_audio(); viewport_init_all(); news_item_init_queue(); - RCT2_CALLPROC_EBPSAFE(0x006C45E7); // get local time + get_local_time(); + OutputDebugString(s); RCT2_CALLPROC_EBPSAFE(0x00667104); RCT2_CALLPROC_EBPSAFE(0x006C4209); RCT2_CALLPROC_EBPSAFE(0x0069EB13); @@ -376,6 +377,19 @@ void get_system_time() RCT2_GLOBAL(RCT2_ADDRESS_OS_TIME_DAYOFWEEK, sint16) = systime.wDayOfWeek; } +/** + * Obtains os local time (hour and minute) + * rct2: 0x006C45E7; + */ +void get_local_time() +{ + SYSTEMTIME systime; + GetLocalTime(&systime); + + RCT2_GLOBAL(RCT2_ADDRESS_OS_TIME_HOUR, sint16) = systime.wHour; + RCT2_GLOBAL(RCT2_ADDRESS_OS_TIME_MINUTE, sint16) = systime.wMinute; +} + /** * RCT2 and this DLL can not free each other's allocated memory blocks. Use this to allocate memory if RCT2 is still able to * free it. diff --git a/src/rct2.h b/src/rct2.h index 2d4d479daa..d0a75a23ed 100644 --- a/src/rct2.h +++ b/src/rct2.h @@ -126,6 +126,7 @@ void rct2_endupdate(); char *get_file_path(int pathId); void get_system_info(); void get_system_time(); +void get_local_time(); void *rct2_malloc(size_t numBytes); void *rct2_realloc(void *block, size_t numBytes); void rct2_free(void *block);