mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Merge branch 'MaciekBaron-master'
This commit is contained in:
@@ -210,9 +210,10 @@
|
||||
#define RCT2_ADDRESS_VIEWPORT_LIST 0x014234BC
|
||||
#define RCT2_ADDRESS_NEW_VIEWPORT_PTR 0x01423570
|
||||
|
||||
#define RCT2_ADDRESS_OS_TIME_MONTH 0x01423A04
|
||||
#define RCT2_ADDRESS_OS_TOTALPHYS 0x01423B5C
|
||||
#define RCT2_ADDRESS_OS_TIME_MINUTE 0x01424654
|
||||
#define RCT2_ADDRESS_OS_TIME_HOUR 0x01424656
|
||||
#define RCT2_ADDRESS_OS_TIME_DAY 0x01424304
|
||||
#define RCT2_ADDRESS_OS_TIME_MONTH 0x01423A04
|
||||
#define RCT2_ADDRESS_OS_TIME_YEAR 0x01424320
|
||||
#define RCT2_ADDRESS_OS_TIME_DAYOFWEEK 0x01423B20
|
||||
|
||||
|
||||
@@ -109,9 +109,9 @@ void config_load()
|
||||
}
|
||||
|
||||
RCT2_GLOBAL(0x009AAC77, sint8) = 0;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_OS_TOTALPHYS, uint32) > 0x4000000) {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_MEM_TOTAL_PHYSICAL, uint32) > 0x4000000) {
|
||||
RCT2_GLOBAL(0x009AAC77, sint8) = 1;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_OS_TOTALPHYS, uint32) > 0x8000000)
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_MEM_TOTAL_PHYSICAL, uint32) > 0x8000000)
|
||||
RCT2_GLOBAL(0x009AAC77, sint8) = 2;
|
||||
}
|
||||
|
||||
@@ -192,6 +192,10 @@ static int config_find_rct2_path(char *resultPath)
|
||||
const char *searchLocations[] = {
|
||||
"C:\\Program Files\\Infogrames\\RollerCoaster Tycoon 2",
|
||||
"C:\\Program Files (x86)\\Infogrames\\RollerCoaster Tycoon 2",
|
||||
"C:\\Program Files\\Infogrames Interactive\\RollerCoaster Tycoon 2",
|
||||
"C:\\Program Files (x86)\\Infogrames Interactive\\RollerCoaster Tycoon 2",
|
||||
"C:\\Program Files\\Atari\\RollerCoaster Tycoon 2",
|
||||
"C:\\Program Files (x86)\\Atari\\RollerCoaster Tycoon 2",
|
||||
"C:\\GOG Games\\RollerCoaster Tycoon 2 Triple Thrill Pack"
|
||||
};
|
||||
|
||||
|
||||
15
src/rct2.c
15
src/rct2.c
@@ -122,7 +122,7 @@ 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();
|
||||
RCT2_CALLPROC_EBPSAFE(0x00667104);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006C4209);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EB13);
|
||||
@@ -376,6 +376,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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user