From 41358c734a180215dc4af984bcb06e5035e77d77 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Mon, 21 Apr 2014 15:00:18 +0530 Subject: [PATCH] Replace address references with named constant --- src/editor.c | 2 +- src/park.c | 2 +- src/scenario.c | 6 +++--- src/window_game_bottom_toolbar.c | 4 ++-- src/window_park.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/editor.c b/src/editor.c index e9fff528b4..0508766e2a 100644 --- a/src/editor.c +++ b/src/editor.c @@ -57,7 +57,7 @@ void editor_load() RCT2_CALLPROC_EBPSAFE(0x006BD39C); RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_SCENARIO_EDITOR; RCT2_GLOBAL(0x0141F570, uint8) = 0; - RCT2_GLOBAL(0x013573E4, uint32) |= 16; + RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) |= 16; RCT2_CALLPROC_EBPSAFE(0x006ACA58); RCT2_GLOBAL(0x0141F571, uint8) = 4; viewport_init_all(); diff --git a/src/park.c b/src/park.c index 9e549c628d..7650795c54 100644 --- a/src/park.c +++ b/src/park.c @@ -54,7 +54,7 @@ int calculate_park_rating() int result; result = 1150; - if (RCT2_GLOBAL(0x013573E4, uint32) & 0x4000) + if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & 0x4000) result = 1050; // Guests diff --git a/src/scenario.c b/src/scenario.c index 3ab933bcd0..61b9108483 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -445,9 +445,9 @@ void scenario_load_and_play(rct_scenario_basic *scenario) RCT2_GLOBAL(0x00F663B0, sint32) = RCT2_GLOBAL(0x009AA0F0, sint32); RCT2_GLOBAL(0x00F663B4, sint32) = RCT2_GLOBAL(0x009AA0F4, sint32); RCT2_GLOBAL(0x009DEB7C, sint16) = 0; - RCT2_GLOBAL(0x013573E4, sint32) &= 0xFFFFF7FF; - if (RCT2_GLOBAL(0x013573E4, sint32) & 0x20000) - RCT2_GLOBAL(0x013573E4, sint32) |= 0x800; + RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, sint32) &= 0xFFFFF7FF; + if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, sint32) & 0x20000) + RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, sint32) |= 0x800; RCT2_CALLPROC_EBPSAFE(0x00684AC3); RCT2_CALLPROC_EBPSAFE(0x006DFEE4); news_item_init_queue(); diff --git a/src/window_game_bottom_toolbar.c b/src/window_game_bottom_toolbar.c index 8068c9a44b..02efcc0374 100644 --- a/src/window_game_bottom_toolbar.c +++ b/src/window_game_bottom_toolbar.c @@ -151,7 +151,7 @@ static void window_game_bottom_toolbar_mouseup() switch (widgetIndex) { case WIDX_LEFT_OUTSET: case WIDX_MONEY: - if (!(RCT2_GLOBAL(0x013573E4, uint32) & 0x800)) + if (!(RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & 0x800)) RCT2_CALLPROC_EBPSAFE(0x0069DDF1); break; case WIDX_GUESTS: @@ -292,7 +292,7 @@ static void window_game_bottom_toolbar_invalidate() } // Hide money if there is no money - if (RCT2_GLOBAL(0x013573E4, uint32) & 0x800) { + if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & 0x800) { window_game_bottom_toolbar_widgets[WIDX_MONEY].type = WWT_EMPTY; window_game_bottom_toolbar_widgets[WIDX_GUESTS].top = 1; window_game_bottom_toolbar_widgets[WIDX_GUESTS].bottom = 17; diff --git a/src/window_park.c b/src/window_park.c index 801d2ea352..f070c0dd6b 100644 --- a/src/window_park.c +++ b/src/window_park.c @@ -1710,7 +1710,7 @@ static void window_park_objective_invalidate() *((short*)0x013CE954) = RCT2_GLOBAL(0x013573D8, uint32); // - if (RCT2_GLOBAL(0x013573E4, uint32) & 0x02) + if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & 0x02) window_park_objective_widgets[WIDX_ENTER_NAME].type = WWT_DROPDOWN_BUTTON; else window_park_objective_widgets[WIDX_ENTER_NAME].type = WWT_EMPTY;