diff --git a/src/addresses.h b/src/addresses.h index 6a1d0320fe..35e796eb9c 100644 --- a/src/addresses.h +++ b/src/addresses.h @@ -138,6 +138,20 @@ #define RCT2_ADDRESS_G1_ELEMENTS 0x009EBD28 +#define RCT2_ADDRESS_PATH_TYPES 0x009ADA14 +#define RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS 0x00F3EF92 +#define RCT2_ADDRESS_PROVISIONAL_PATH_X 0x00F3EF94 +#define RCT2_ADDRESS_PROVISIONAL_PATH_Y 0x00F3EF96 +#define RCT2_ADDRESS_PROVISIONAL_PATH_Z 0x00F3EF98 +#define RCT2_ADDRESS_PATH_CONSTRUCTION_MODE 0x00F3EF99 +#define RCT2_ADDRESS_PATH_ERROR_OCCURED 0x00F3EF9F +#define RCT2_ADDRESS_SELECTED_PATH_ID 0x00F3EFA0 +#define RCT2_ADDRESS_SELECTED_PATH_TYPE 0x00F3EFA2 +#define RCT2_ADDRESS_CONSTRUCT_PATH_FROM_X 0x00F3EF8A +#define RCT2_ADDRESS_CONSTRUCT_PATH_FROM_Y 0x00F3EF8C +#define RCT2_ADDRESS_CONSTRUCT_PATH_FROM_Z 0x00F3EF8E +#define RCT2_ADDRESS_CONSTRUCT_PATH_DIRECTION 0x00F3EF90 + #define RCT2_ADDRESS_CURRENT_MONTH_YEAR 0x00F663A8 #define RCT2_ADDRESS_CURRENT_MONTH_TICKS 0x00F663AA diff --git a/src/finance.c b/src/finance.c index 7db4b107b0..dc6276455d 100644 --- a/src/finance.c +++ b/src/finance.c @@ -149,11 +149,11 @@ void finance_init() { RCT2_GLOBAL(0x01358334, uint32) = 0; RCT2_GLOBAL(0x01358338, uint16) = 0; - RCT2_GLOBAL(0x013573DC, uint32) = 100000; // Cheat detection + RCT2_GLOBAL(0x013573DC, sint32) = 100000; // Cheat detection RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32) = ENCRYPT_MONEY(100000); RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, sint32) = 100000; - RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, uint32) = 200000; + RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, sint32) = 200000; RCT2_GLOBAL(0x013587D0, uint32) = 0; @@ -166,5 +166,17 @@ void finance_init() { RCT2_GLOBAL(0x013587D8, uint16) = 0x3F; - RCT2_CALLPROC_EBPSAFE(0x0069E869); + sub_69E869(); } + +void sub_69E869() { + // This subroutine is loan related and is used for cheat detection + sint32 value = 0x70093A; + value -= RCT2_GLOBAL(0x013573DC, sint32); // Cheat detection + value = ror32(value, 5); + value -= RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, sint32); + value = ror32(value, 7); + value += RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, sint32); + value = ror32(value, 3); + RCT2_GLOBAL(0x013587C4, sint32) = value; +} \ No newline at end of file diff --git a/src/finance.h b/src/finance.h index 7bb126cc01..c6ff44ab93 100644 --- a/src/finance.h +++ b/src/finance.h @@ -41,5 +41,6 @@ void finance_pay_research(); void finance_pay_interest(); void finance_pay_ride_upkeep(); void finance_init(); +void sub_69E869(); #endif \ No newline at end of file diff --git a/src/game.c b/src/game.c index 37ce64cc66..c6232ae35c 100644 --- a/src/game.c +++ b/src/game.c @@ -1519,7 +1519,7 @@ int game_load_save() window_new_ride_init_vars(); RCT2_GLOBAL(0x009DEB7C, uint16) = 0; if (RCT2_GLOBAL(0x0013587C4, uint32) == 0) // this check is not in scenario play - RCT2_CALLPROC_EBPSAFE(0x0069E869); + sub_69E869(); RCT2_CALLPROC_EBPSAFE(0x006837E3); // (palette related) gfx_invalidate_screen(); diff --git a/src/scenario.c b/src/scenario.c index 8b7706df92..c4e86986da 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -466,7 +466,7 @@ void scenario_load_and_play(rct_scenario_basic *scenario) RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_COMPANY_VALUE, sint16) = calculate_company_value(); RCT2_GLOBAL(0x013587D0, sint16) = RCT2_GLOBAL(0x013573DC, sint16) - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, sint16); RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32) = ENCRYPT_MONEY(RCT2_GLOBAL(0x013573DC, sint32)); - RCT2_CALLPROC_EBPSAFE(0x0069E869); // (loan related) + sub_69E869(); // (loan related) strcpy((char*)RCT2_ADDRESS_SCENARIO_DETAILS, s6Info->details); strcpy((char*)RCT2_ADDRESS_SCENARIO_NAME, s6Info->name); @@ -508,7 +508,7 @@ void scenario_load_and_play(rct_scenario_basic *scenario) RCT2_GLOBAL(RCT2_ADDRESS_TOTAL_ADMISSIONS, uint32) = 0; RCT2_GLOBAL(RCT2_ADDRESS_INCOME_FROM_ADMISSIONS, uint32) = 0; RCT2_GLOBAL(0x013587D8, uint16) = 63; - RCT2_CALLPROC_EBPSAFE(0x0069E869); // (loan related, called above already) + sub_69E869(); // (loan related, called above already) park_reset_awards_and_history(); reset_all_ride_build_dates(); date_reset(); diff --git a/src/window_footpath.c b/src/window_footpath.c index 38da0c66e6..cbb8dc144b 100644 --- a/src/window_footpath.c +++ b/src/window_footpath.c @@ -36,6 +36,11 @@ enum { PATH_CONSTRUCTION_MODE_2 }; +enum { + SELECTED_PATH_TYPE_NORMAL, + SELECTED_PATH_TYPE_QUEUE +}; + typedef struct { uint16 pad_00; uint32 image; // 0x02 @@ -203,10 +208,10 @@ void window_footpath_open() window->colours[2] = 24; tool_cancel(); - RCT2_GLOBAL(0x00F3EF99, uint8) = PATH_CONSTRUCTION_MODE_LAND; + RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) = PATH_CONSTRUCTION_MODE_LAND; tool_set(window, WIDX_CONSTRUCT_ON_LAND, 17); RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6); - RCT2_GLOBAL(0x00F3EF9F, uint8) = 0; + RCT2_GLOBAL(RCT2_ADDRESS_PATH_ERROR_OCCURED, uint8) = 0; RCT2_CALLPROC_EBPSAFE(0x006A855C); } @@ -251,7 +256,7 @@ static void window_footpath_mouseup() window_footpath_remove(); break; case WIDX_CONSTRUCT_ON_LAND: - if (RCT2_GLOBAL(0x00F3EF99, uint8) == PATH_CONSTRUCTION_MODE_LAND) + if (RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) == PATH_CONSTRUCTION_MODE_LAND) break; _window_footpath_cost = 0x80000000; @@ -259,14 +264,14 @@ static void window_footpath_mouseup() RCT2_CALLPROC_EBPSAFE(0x006A7831); RCT2_CALLPROC_EBPSAFE(0x0068AB1B); RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2; - RCT2_GLOBAL(0x00F3EF99, uint8) = PATH_CONSTRUCTION_MODE_LAND; + RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) = PATH_CONSTRUCTION_MODE_LAND; tool_set(w, WIDX_CONSTRUCT_ON_LAND, 17); RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6); - RCT2_GLOBAL(0x00F3EF9F, uint8) = 0; + RCT2_GLOBAL(RCT2_ADDRESS_PATH_ERROR_OCCURED, uint8) = 0; RCT2_CALLPROC_EBPSAFE(0x006A855C); break; case WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL: - if (RCT2_GLOBAL(0x00F3EF99, uint8) == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) + if (RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) break; _window_footpath_cost = 0x80000000; @@ -274,10 +279,10 @@ static void window_footpath_mouseup() RCT2_CALLPROC_EBPSAFE(0x006A7831); RCT2_CALLPROC_EBPSAFE(0x0068AB1B); RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2; - RCT2_GLOBAL(0x00F3EF99, uint8) = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL; + RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL; tool_set(w, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, 12); RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6); - RCT2_GLOBAL(0x00F3EF9F, uint8) = 0; + RCT2_GLOBAL(RCT2_ADDRESS_PATH_ERROR_OCCURED, uint8) = 0; RCT2_CALLPROC_EBPSAFE(0x006A855C); break; } @@ -345,16 +350,16 @@ static void window_footpath_dropdown() __asm mov w, esi if (widgetIndex == WIDX_FOOTPATH_TYPE) - RCT2_GLOBAL(0x00F3EFA2, uint8) = 0; + RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_TYPE, uint8) = SELECTED_PATH_TYPE_NORMAL; else if (widgetIndex == WIDX_QUEUELINE_TYPE) - RCT2_GLOBAL(0x00F3EFA2, uint8) = 1; + RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_TYPE, uint8) = SELECTED_PATH_TYPE_QUEUE; else return; // Get path id pathId = dropdownIndex; if (pathId == -1) { - pathId = RCT2_GLOBAL(0x00F3EFA0, sint16); + pathId = RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16); } else { int flags = 4; if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) @@ -362,7 +367,7 @@ static void window_footpath_dropdown() j = 0; for (i = 0; i < 16; i++) { - pathType = RCT2_ADDRESS(0x009ADA14, rct_path_type*)[i]; + pathType = RCT2_ADDRESS(RCT2_ADDRESS_PATH_TYPES, rct_path_type*)[i]; if (pathType == (rct_path_type*)-1) continue; if (pathType->flags & flags) @@ -376,7 +381,7 @@ static void window_footpath_dropdown() } // Set selected path id - RCT2_GLOBAL(0x00F3EFA0, sint16) = pathId; + RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16) = pathId; RCT2_CALLPROC_EBPSAFE(0x006A7831); _window_footpath_cost = 0x80000000; window_invalidate(w); @@ -482,14 +487,14 @@ static void window_footpath_update() RCT2_CALLPROC_EBPSAFE(0x006A7760); // Check tool - if (RCT2_GLOBAL(0x00F3EF99, uint8) == PATH_CONSTRUCTION_MODE_LAND) { + if (RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) == PATH_CONSTRUCTION_MODE_LAND) { if (!(RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3))) window_close(w); if (RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass) != WC_FOOTPATH) window_close(w); if (RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WIDGETINDEX, uint16) != WIDX_CONSTRUCT_ON_LAND) window_close(w); - } else if (RCT2_GLOBAL(0x00F3EF99, uint8) == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) { + } else if (RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) { if (!(RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3))) window_close(w); if (RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass) != WC_FOOTPATH) @@ -514,16 +519,16 @@ static void window_footpath_invalidate() // Press / unpress footpath and queue type buttons w->pressed_widgets &= ~(1 << WIDX_FOOTPATH_TYPE); w->pressed_widgets &= ~(1 << WIDX_QUEUELINE_TYPE); - w->pressed_widgets |= RCT2_GLOBAL(0x00F3EFA2, uint8) == 0 ? + w->pressed_widgets |= RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_TYPE, uint8) == SELECTED_PATH_TYPE_NORMAL ? (1 << WIDX_FOOTPATH_TYPE) : (1 << WIDX_QUEUELINE_TYPE); // Enable / disable construct button - window_footpath_widgets[WIDX_CONSTRUCT].type = RCT2_GLOBAL(0x00F3EF99, uint8) == PATH_CONSTRUCTION_MODE_LAND ? WWT_EMPTY : WWT_IMGBTN; + window_footpath_widgets[WIDX_CONSTRUCT].type = RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) == PATH_CONSTRUCTION_MODE_LAND ? WWT_EMPTY : WWT_IMGBTN; // Set footpath and queue type button images - selectedPath = RCT2_GLOBAL(0x00F3EFA0, uint16); - pathType = RCT2_ADDRESS(0x009ADA14, rct_path_type*)[selectedPath]; + selectedPath = RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, uint16); + pathType = RCT2_ADDRESS(RCT2_ADDRESS_PATH_TYPES, rct_path_type*)[selectedPath]; int pathImage = 71 + pathType->image; window_footpath_widgets[WIDX_FOOTPATH_TYPE].image = pathImage; @@ -553,17 +558,17 @@ static void window_footpath_paint() if (!(w->disabled_widgets & (1 << WIDX_CONSTRUCT))) { // Get construction image - image = (RCT2_GLOBAL(0x00F3EF90, uint8) + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32)) % 4; + image = (RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_DIRECTION, uint8) + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32)) % 4; if (RCT2_GLOBAL(0x00F3EF91, uint8) == 2) image += 4; else if (RCT2_GLOBAL(0x00F3EF91, uint8) == 6) image += 8; image = RCT2_ADDRESS(0x0098D7E0, uint8)[image]; - selectedPath = RCT2_GLOBAL(0x00F3EFA0, uint16); - pathType = RCT2_ADDRESS(0x009ADA14, rct_path_type*)[selectedPath]; + selectedPath = RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, uint16); + pathType = RCT2_ADDRESS(RCT2_ADDRESS_PATH_TYPES, rct_path_type*)[selectedPath]; image += pathType->image; - if (RCT2_GLOBAL(0x00F3EFA2, uint8) != 0) + if (RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_TYPE, uint8) != SELECTED_PATH_TYPE_NORMAL) image += 51; // Draw construction image @@ -600,7 +605,7 @@ static void window_footpath_show_footpath_types_dialog(rct_window *w, rct_widget flags = 0; for (i = 0; i < 16; i++) { - pathType = RCT2_ADDRESS(0x009ADA14, rct_path_type*)[i]; + pathType = RCT2_ADDRESS(RCT2_ADDRESS_PATH_TYPES, rct_path_type*)[i]; if (pathType == (rct_path_type*)-1) continue; if (pathType->flags & flags) @@ -654,7 +659,7 @@ static void window_footpath_set_provisional_path_at_point(int x, int y) RCT2_CALLPROC_EBPSAFE(0x006A7831); } else { // Check for change - if ((RCT2_GLOBAL(0x00F3EF92, uint8) & 2) && RCT2_GLOBAL(0x00F3EF94, uint16) == x && RCT2_GLOBAL(0x00F3EF96, uint16) == y && RCT2_GLOBAL(0x00F3EF98, uint8) == mapElement->base_height) + if ((RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS, uint8) & 2) && RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_X, uint16) == x && RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_Y, uint16) == y && RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_Z, uint8) == mapElement->base_height) return; // Set map selection @@ -671,7 +676,7 @@ static void window_footpath_set_provisional_path_at_point(int x, int y) slope = RCT2_ADDRESS(0x0098D8B4, uint8)[mapElement->properties.surface.slope & 0x1F]; if (z == 6) slope = mapElement->properties.surface.slope & 7; - pathType = (RCT2_GLOBAL(0x00F3EFA2, uint8) << 7) + RCT2_GLOBAL(0x00F3EFA0, uint8); + pathType = (RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_TYPE, uint8) << 7) + RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, uint8); _window_footpath_cost = window_footpath_set_provisional_path(pathType, x, y, mapElement->base_height, slope); // window_invalidate_by_id(eax, ebx); @@ -692,10 +697,10 @@ static int window_footpath_set_provisional_path(int type, int x, int y, int z, i cost = game_do_command(x, (slope << 8) | 121, y, (type << 8) | z, 17, 0, 0); if (cost != 0x80000000) { - RCT2_GLOBAL(0x00F3EF94, uint16) = x; - RCT2_GLOBAL(0x00F3EF96, uint16) = y; - RCT2_GLOBAL(0x00F3EF98, uint8) = z & 0xFF; - RCT2_GLOBAL(0x00F3EF92, uint8) |= 2; + RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_X, uint16) = x; + RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_Y, uint16) = y; + RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_Z, uint8) = z & 0xFF; + RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS, uint8) |= 2; eax = 3; if (RCT2_GLOBAL(0x00F3EFA4, uint8) & 2) @@ -715,7 +720,7 @@ static void window_footpath_place_path_at_point(int x, int y) int z, presentType, selectedType, cost; rct_map_element *mapElement; - if (RCT2_GLOBAL(0x00F3EF9F, uint8) != 0) + if (RCT2_GLOBAL(RCT2_ADDRESS_PATH_ERROR_OCCURED, uint8) != 0) return; RCT2_CALLPROC_EBPSAFE(0x006A7831); @@ -739,7 +744,7 @@ static void window_footpath_place_path_at_point(int x, int y) if (z == 6) presentType = mapElement->properties.path.type & 7; z = mapElement->base_height; - selectedType = (RCT2_GLOBAL(0x00F3EFA2, uint8) << 7) + RCT2_GLOBAL(0x00F3EFA0, uint8); + selectedType = (RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_TYPE, uint8) << 7) + RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, uint8); // Prepare error text RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_STRING_ID, uint16) = STR_CANT_BUILD_FOOTPATH_HERE; @@ -748,7 +753,7 @@ static void window_footpath_place_path_at_point(int x, int y) cost = game_do_command(x, (presentType << 8) | 1, y, (selectedType << 8) | z, 17, 0, 0); if (cost == 0x80000000) { - RCT2_GLOBAL(0x00F3EF9F, uint8) = 1; + RCT2_GLOBAL(RCT2_ADDRESS_PATH_ERROR_OCCURED, uint8) = 1; } else if (RCT2_GLOBAL(0x00F3EFD9, uint32) != 0) { // bp = 0x009DEA62 // dx = 0x009DEA60 @@ -780,9 +785,9 @@ static void window_footpath_remove() _window_footpath_cost = 0x80000000; RCT2_CALLPROC_EBPSAFE(0x006A7831); - x = RCT2_GLOBAL(0x00F3EF8A, uint16) / 32; - y = RCT2_GLOBAL(0x00F3EF8C, uint16) / 32; - int dl = (RCT2_GLOBAL(0x00F3EF8E, uint16) >> 3) & 0xFF; + x = RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_FROM_X, uint16) / 32; + y = RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_FROM_Y, uint16) / 32; + int dl = (RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_FROM_Z, uint16) >> 3) & 0xFF; int dh = dl - 2; if (x >= 256 || y >= 256) @@ -793,12 +798,12 @@ static void window_footpath_remove() if ((mapElement->type & MAP_ELEMENT_TYPE_MASK) == MAP_ELEMENT_TYPE_PATH) { if (mapElement->base_height == dl) { if (mapElement->properties.path.type & 4) - if (((mapElement->properties.path.type & 3) ^ 2) != RCT2_GLOBAL(0x00F3EF90, uint8)) + if (((mapElement->properties.path.type & 3) ^ 2) != RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_DIRECTION, uint8)) continue; goto loc_6A78EF; } else if (mapElement->base_height == dh) { if (!(mapElement->properties.path.type & 4)) - if ((mapElement->properties.path.type & 3) == RCT2_GLOBAL(0x00F3EF90, uint8)) + if ((mapElement->properties.path.type & 3) == RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_DIRECTION, uint8)) continue; goto loc_6A78EF; } @@ -814,12 +819,12 @@ loc_6A78EF: if (pathType & 4) { pathType &= 3; pathType ^= 2; - if (pathType == RCT2_GLOBAL(0x00F3EF90, uint8)) + if (pathType == RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_DIRECTION, uint8)) dl += 2; } // Find a connected edge - int edge = RCT2_GLOBAL(0x00F3EF90, uint8) ^ 2; + int edge = RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_DIRECTION, uint8) ^ 2; if (!(mapElement->properties.path.edges & (1 << edge))) { edge = (edge + 1) % 4; if (!(mapElement->properties.path.edges & (1 << edge))) { @@ -834,16 +839,16 @@ loc_6A78EF: // Remove path RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_STRING_ID, uint16) = STR_CANT_REMOVE_FOOTPATH_FROM_HERE; - game_do_command(RCT2_GLOBAL(0x00F3EF8A, uint16), 1, RCT2_GLOBAL(0x00F3EF8C, uint16), mapElement->base_height, 19, 0, 0); + game_do_command(RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_FROM_X, uint16), 1, RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_FROM_Y, uint16), mapElement->base_height, 19, 0, 0); // Move selection edge ^= 2; - x = RCT2_GLOBAL(0x00F3EF8A, uint16) - RCT2_GLOBAL(0x00993CCC + (edge * 4), sint16); - y = RCT2_GLOBAL(0x00F3EF8C, uint16) - RCT2_GLOBAL(0x00993CCE + (edge * 4), sint16); - RCT2_GLOBAL(0x00F3EF8A, uint16) = x; - RCT2_GLOBAL(0x00F3EF8C, uint16) = y; - RCT2_GLOBAL(0x00F3EF8E, uint16) = dl << 3; - RCT2_GLOBAL(0x00F3EF90, uint8) = edge; + x = RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_FROM_X, uint16) - RCT2_GLOBAL(0x00993CCC + (edge * 4), sint16); + y = RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_FROM_Y, uint16) - RCT2_GLOBAL(0x00993CCE + (edge * 4), sint16); + RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_FROM_X, uint16) = x; + RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_FROM_Y, uint16) = y; + RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_FROM_Z, uint16) = dl << 3; + RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_DIRECTION, uint8) = edge; RCT2_GLOBAL(0x00F3EF9E, uint8) = 255; loc_6A79B0: