From 9f321fa3393932fb5433eabd625db7c219cfc8b0 Mon Sep 17 00:00:00 2001 From: Matthias Lanzinger Date: Tue, 29 Apr 2014 22:51:51 +0200 Subject: [PATCH 1/6] Identified peep.staff_type and days_in_month table. --- src/date.c | 4 ++++ src/date.h | 4 ++++ src/peep.h | 9 ++++++++- src/window_game_bottom_toolbar.c | 3 ++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/date.c b/src/date.c index 012e556327..e44d32c86e 100644 --- a/src/date.c +++ b/src/date.c @@ -22,6 +22,10 @@ #include "date.h" #include "rct2.h" +// rtc2: 0x00993988 +const sint16 days_in_month[MONTH_COUNT] = { 31, 30, 31, 30, 31, 31, 30, 31 }; + + int date_get_month(int months) { return months % MONTH_COUNT; diff --git a/src/date.h b/src/date.h index 49e603a0ac..23eae8cdc9 100644 --- a/src/date.h +++ b/src/date.h @@ -21,6 +21,8 @@ #ifndef _DATE_H_ #define _DATE_H_ +#include "rct2.h" + enum { MONTH_MARCH, MONTH_APRIL, @@ -34,6 +36,8 @@ enum { MONTH_COUNT }; +extern const sint16 days_in_month[MONTH_COUNT]; + int date_get_month(int months); int date_get_total_months(int month, int year); void date_reset(); diff --git a/src/peep.h b/src/peep.h index 335cbedf0b..a13e7b2894 100644 --- a/src/peep.h +++ b/src/peep.h @@ -30,6 +30,13 @@ enum PEEP_TYPE { PEEP_TYPE_STAFF }; +enum STAFF_TYPE { + STAFF_TYPE_HANDYMAN, + STAFF_TYPE_MECHANIC, + STAFF_TYPE_SECURITY, + STAFF_TYPE_ENTERTAINER +}; + enum { PEEP_FLAGS_TRACKING = 8 }; @@ -65,7 +72,7 @@ typedef struct { uint8 pad_2C; uint8 sprite_type; // 0x2D uint8 type; // 0x2E - uint8 var_2F; + uint8 staff_type; // 0x2F uint8 var_30; uint8 var_31; uint8 pad_32[0x08]; diff --git a/src/window_game_bottom_toolbar.c b/src/window_game_bottom_toolbar.c index c161165956..5c8f4e6cbd 100644 --- a/src/window_game_bottom_toolbar.c +++ b/src/window_game_bottom_toolbar.c @@ -20,6 +20,7 @@ #include "addresses.h" #include "climate.h" +#include "date.h" #include "news_item.h" #include "park.h" #include "peep.h" @@ -220,7 +221,7 @@ static void window_game_bottom_toolbar_tooltip() break; case WIDX_DATE: month = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16) & 7; - day = ((RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_DAY, sint16) * ((short*)0x00993988)[month]) >> 16) & 0xFF; + day = ((RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_DAY, sint16) * days_in_month[month]) >> 16) & 0xFF; *((short*)0x013CE952) = STR_DATE_DAY_1 + day; *((short*)0x013CE954) = STR_MONTH_MARCH + month; widgetIndex = 0; From 59c8090de5b9b21ea6a9ffb5f2ee68563d2f7213 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Wed, 30 Apr 2014 21:51:29 +0530 Subject: [PATCH 2/6] Add game flag for development only below tree height. --- src/rct2.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rct2.h b/src/rct2.h index 59dd74dcf3..4d0b3a97ce 100644 --- a/src/rct2.h +++ b/src/rct2.h @@ -122,6 +122,7 @@ enum { enum { GAME_FLAGS_PARK_OPEN = (1 << 0), + GAME_FLAGS_BELOW_TREE_HEIGHT_ONLY = (1 << 5), GAME_FLAGS_NO_MONEY = (1 << 11), GAME_FLAGS_PARK_FREE_ENTRY = (1 << 13) }; From 363f7c4c64121ff2f680d6faae76befa38fb34e0 Mon Sep 17 00:00:00 2001 From: Matthias Lanzinger Date: Thu, 1 May 2014 22:32:14 +0200 Subject: [PATCH 3/6] Identified monthly ride income location. --- src/addresses.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/addresses.h b/src/addresses.h index 403ec3f966..c962328e60 100644 --- a/src/addresses.h +++ b/src/addresses.h @@ -136,6 +136,7 @@ #define RCT2_ADDRESS_GAME_FLAGS 0x013573E4 #define RCT2_ADDRESS_PARK_ENTRANCE_FEE 0x013573E8 #define RCT2_ADDRESS_GUESTS_IN_PARK 0x01357844 +#define RCT2_ADDRESS_MONTHLY_RIDE_INCOME 0x01357894 #define RCT2_ADDRESS_CURRENT_PARK_RATING 0x01357CB0 #define RCT2_ADDRESS_PARK_RATING_HISTORY 0x01357CB2 #define RCT2_ADDRESS_GUESTS_IN_PARK_HISTORY 0x01357CD2 From 373249dfe319ffa9046a282cff5cc5cb105db235 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Thu, 1 May 2014 21:37:01 +0100 Subject: [PATCH 4/6] fix peep structure --- src/peep.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/peep.h b/src/peep.h index d167afc2fb..5a0fd3618f 100644 --- a/src/peep.h +++ b/src/peep.h @@ -82,11 +82,11 @@ typedef struct { uint8 thirst; // 0x3F uint8 pad_040[0x28]; uint8 current_ride; // 0x68 - uint8 pad_6a; // 0x6A Part of current_ride? + uint8 pad_6A; // 0x6A Part of current_ride? uint8 current_train; // 0x6B uint8 current_car; // 0x6C - uint8 current_seat; // 0x6d - uint8 pad_6C[0x2e]; + uint8 current_seat; // 0x6D + uint8 pad_6E[0x2E]; uint32 id; // 0x9C uint8 pad_A0[0x10]; rct_peep_thought thoughts[PEEP_MAX_THOUGHTS]; // 0xB0 From 2e5788c0ffad894201e6f2a01219f5f15e7369b5 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Thu, 1 May 2014 21:44:38 +0100 Subject: [PATCH 5/6] reorganise addresses --- src/addresses.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/addresses.h b/src/addresses.h index c962328e60..cb3f4a35ca 100644 --- a/src/addresses.h +++ b/src/addresses.h @@ -40,7 +40,7 @@ #define RCT2_CALLPROC_4(address, a1, a2, a3, a4, v1, v2, v3, v4) RCT2_CALLFUNC_4(address, void, a1, a2, a3, a4, v1, v2, v3, v4) #define RCT2_CALLPROC_5(address, a1, a2, a3, a4, a5, v1, v2, v3, v4, v5) RCT2_CALLFUNC_5(address, void, a1, a2, a3, a4, a5, v1, v2, v3, v4, v5) -#define RCT2_ADDRESS_RIDE_PROPERTIES 0x00997c9d +#define RCT2_ADDRESS_RIDE_PROPERTIES 0x00997C9D #define RCT2_ADDRESS_LAND_TOOL_SIZE 0x009A9800 #define RCT2_ADDRESS_SCENARIO_LIST 0x009A9FF4 @@ -54,6 +54,8 @@ #define RCT2_ADDRESS_CONFIG_KEYBOARD_SHORTCUTS 0x009AAC7A #define RCT2_ADDRESS_CONFIG_EDGE_SCROLLING 0x009AACBA +#define RCT2_ADDRESS_EXPANSION_NAMES 0x009AACC0 +#define RCT2_ADDRESS_EXPANSION_FLAGS 0x009AB4C0 #define RCT2_ADDRESS_CONFIG_RESOLUTION_WIDTH 0x009AB4C2 #define RCT2_ADDRESS_CONFIG_RESOLUTION_HEIGHT 0x009AB4C4 @@ -68,8 +70,6 @@ #define RCT2_ADDRESS_SCREEN_DPI 0x009ABDC8 #define RCT2_ADDRESS_SCREEN_WIDTH 0x009ABDD8 #define RCT2_ADDRESS_SCREEN_HEIGHT 0x009ABDDA -#define RCT2_ADDRESS_SCREEN_CAP_BPP 0x01423C10 -#define RCT2_ADDRESS_SCREEN_CAP_RASTER_STRETCH 0x01423C14 #define RCT2_ADDRESS_DIRTY_BLOCK_WIDTH 0x009ABDE4 #define RCT2_ADDRESS_DIRTY_BLOCK_HEIGHT 0x009ABDE6 @@ -215,8 +215,8 @@ #define RCT2_ADDRESS_MEM_TOTAL_PAGEFILE 0x01423B60 #define RCT2_ADDRESS_MEM_TOTAL_VIRTUAL 0x01423B64 -#define RCT2_ADDRESS_EXPANSION_FLAGS 0x009AB4C0 -#define RCT2_ADDRESS_EXPANSION_NAMES 0x009AACC0 +#define RCT2_ADDRESS_SCREEN_CAP_BPP 0x01423C10 +#define RCT2_ADDRESS_SCREEN_CAP_RASTER_STRETCH 0x01423C14 static void RCT2_CALLPROC_EBPSAFE(int address) { From 689b82bed93817e90fcbdc7b9cac973036599eb3 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Thu, 1 May 2014 22:53:44 +0100 Subject: [PATCH 6/6] set default screenshot format to PNG --- src/screenshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screenshot.c b/src/screenshot.c index f383c95d9b..727d2ffc4d 100644 --- a/src/screenshot.c +++ b/src/screenshot.c @@ -33,7 +33,7 @@ enum { SCREENSHOT_FORMAT_PNG }; -int gScreenshotFormat = SCREENSHOT_FORMAT_BMP; +int gScreenshotFormat = SCREENSHOT_FORMAT_PNG; static int screenshot_dump_bmp(); static int screenshot_dump_png();