change ride construction addresses to defines

This commit is contained in:
Ted John 2016-04-15 20:29:07 +01:00
parent f73e3ab0e1
commit 681961eaec
6 changed files with 24 additions and 24 deletions

View File

@ -1810,7 +1810,7 @@ int sub_6CC3FB(int rideIndex)
_currentTrackCurve = RCT2_ADDRESS(0x0097CC68, uint8)[ride->type * 2] | 0x100; _currentTrackCurve = RCT2_ADDRESS(0x0097CC68, uint8)[ride->type * 2] | 0x100;
_currentTrackSlopeEnd = 0; _currentTrackSlopeEnd = 0;
RCT2_GLOBAL(0x00F440B3, uint8) = 0; _currentTrackBankEnd = 0;
_currentTrackLiftHill = 0; _currentTrackLiftHill = 0;
_currentTrackCovered = 0; _currentTrackCovered = 0;

View File

@ -1664,7 +1664,7 @@ int track_place_ride(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint8** trac
(((track->flags >> 4) & 0x3) << 24) | (((track->flags >> 4) & 0x3) << 24) |
(temp_z & 0xFFFF); (temp_z & 0xFFFF);
int edx = RCT2_GLOBAL(0x00F440A7, uint8) | (track_type << 8); int edx = _currentRideIndex | (track_type << 8);
if (track->flags & 0x80)edx |= 0x10000; if (track->flags & 0x80)edx |= 0x10000;
if (track->flags & 0x40)edx |= 0x20000; if (track->flags & 0x40)edx |= 0x20000;
@ -1913,8 +1913,8 @@ int track_place_ride(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint8** trac
} }
if (RCT2_GLOBAL(0x00F440D4, uint8) == 6){ if (RCT2_GLOBAL(0x00F440D4, uint8) == 6){
sub_6CB945(RCT2_GLOBAL(0x00F440A7, uint8)); sub_6CB945(_currentRideIndex);
rct_ride* ride = get_ride(RCT2_GLOBAL(0x00F440A7, uint8)); rct_ride* ride = get_ride(_currentRideIndex);
user_string_free(ride->name); user_string_free(ride->name);
ride->type = RIDE_TYPE_NULL; ride->type = RIDE_TYPE_NULL;
} }
@ -1944,7 +1944,7 @@ int sub_6D01B3(uint8 bl, uint8 rideIndex, int x, int y, int z)
if (RCT2_GLOBAL(RCT2_ADDRESS_TRACK_DESIGN_SCENERY_TOGGLE, uint8) != 0){ if (RCT2_GLOBAL(RCT2_ADDRESS_TRACK_DESIGN_SCENERY_TOGGLE, uint8) != 0){
RCT2_GLOBAL(0x00F4414E, uint8) |= 0x80; RCT2_GLOBAL(0x00F4414E, uint8) |= 0x80;
} }
RCT2_GLOBAL(0x00F440A7, uint8) = rideIndex; _currentRideIndex = rideIndex;
RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_X_MIN, sint16) = x; RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_X_MIN, sint16) = x;
RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_X_MAX, sint16) = x; RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_X_MAX, sint16) = x;

View File

@ -447,13 +447,13 @@ rct_string_id RideConfigurationStringIds[] = {
#pragma endregion #pragma endregion
#define _trackPlaceCtrlState RCT2_GLOBAL(0x00F44159, uint8) static bool _trackPlaceCtrlState;
static int _trackPlaceCtrlZ; static int _trackPlaceCtrlZ;
#define _trackPlaceShiftState RCT2_GLOBAL(0x00F4415C, uint8) static bool _trackPlaceShiftState;
static int _trackPlaceShiftStartScreenX; static int _trackPlaceShiftStartScreenX;
static int _trackPlaceShiftStartScreenY; static int _trackPlaceShiftStartScreenY;
static int _trackPlaceShiftZ; static int _trackPlaceShiftZ;
#define _trackPlaceZ RCT2_GLOBAL(0x00F44163, sint16) static int _trackPlaceZ;
static bool _autoOpeningShop; static bool _autoOpeningShop;
// This variable is updated separately from ride->num_stations because the latter // This variable is updated separately from ride->num_stations because the latter
@ -540,7 +540,7 @@ rct_window *window_ride_construction_open()
_currentTrackPrice = MONEY32_UNDEFINED; _currentTrackPrice = MONEY32_UNDEFINED;
RCT2_GLOBAL(0x00F440CD, uint8) = 8; RCT2_GLOBAL(0x00F440CD, uint8) = 8;
RCT2_GLOBAL(0x00F440CE, uint8) = 18; RCT2_GLOBAL(0x00F440CE, uint8) = 18;
RCT2_GLOBAL(0x00F440CF, uint8) = 4; _currentSeatRotationAngle = 4;
if (ride->type == RIDE_TYPE_REVERSE_FREEFALL_COASTER) if (ride->type == RIDE_TYPE_REVERSE_FREEFALL_COASTER)
RCT2_GLOBAL(0x00F440CE, uint8) = 30; RCT2_GLOBAL(0x00F440CE, uint8) = 30;
@ -550,23 +550,23 @@ rct_window *window_ride_construction_open()
_currentTrackCurve = RCT2_ADDRESS(0x0097CC68, uint8)[ride->type * 2] | 0x100; _currentTrackCurve = RCT2_ADDRESS(0x0097CC68, uint8)[ride->type * 2] | 0x100;
_currentTrackSlopeEnd = 0; _currentTrackSlopeEnd = 0;
RCT2_GLOBAL(0x00F440B3, uint8) = 0; _currentTrackBankEnd = 0;
_currentTrackLiftHill = 0; _currentTrackLiftHill = 0;
_currentTrackCovered = 0; _currentTrackCovered = 0;
if (RideData4[ride->type].flags & RIDE_TYPE_FLAG4_15) if (RideData4[ride->type].flags & RIDE_TYPE_FLAG4_15)
_currentTrackCovered |= 2; _currentTrackCovered |= 2;
RCT2_GLOBAL(0x00F440B6, uint8) = 0; _previousTrackBankEnd = 0;
RCT2_GLOBAL(0x00F440B7, uint8) = 0; _previousTrackSlopeEnd = 0;
RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_ROTATION, uint8) = 0; RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_ROTATION, uint8) = 0;
_rideConstructionState = RIDE_CONSTRUCTION_STATE_PLACE; _rideConstructionState = RIDE_CONSTRUCTION_STATE_PLACE;
_currentTrackSelectionFlags = 0; _currentTrackSelectionFlags = 0;
_rideConstructionArrowPulseTime = 0; _rideConstructionArrowPulseTime = 0;
_autoOpeningShop = false; _autoOpeningShop = false;
RCT2_GLOBAL(0x00F44159, uint8) = 0; _trackPlaceCtrlState = false;
RCT2_GLOBAL(0x00F4415C, uint8) = 0; _trackPlaceShiftState = false;
colour_scheme_update(w); colour_scheme_update(w);
return w; return w;
} }
@ -2115,7 +2115,7 @@ static void window_ride_construction_invalidate(rct_window *w)
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint16) = ((RCT2_GLOBAL(0x00F440CD, uint8) * 9) >> 2) & 0xFFFF; RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint16) = ((RCT2_GLOBAL(0x00F440CD, uint8) * 9) >> 2) & 0xFFFF;
window_ride_construction_widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER].image = window_ride_construction_widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER].image =
STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_180 + RCT2_GLOBAL(0x00F440CF, uint8); STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_180 + _currentSeatRotationAngle;
if (RCT2_GLOBAL(0x00F440D3, uint8) == 2) if (RCT2_GLOBAL(0x00F440D3, uint8) == 2)
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint16) = ((RCT2_GLOBAL(0x00F440CE, uint8) * 9) >> 2) & 0xFFFF; RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint16) = ((RCT2_GLOBAL(0x00F440CE, uint8) * 9) >> 2) & 0xFFFF;
@ -3817,8 +3817,8 @@ void ride_construction_tooldown_construct(int screenX, int screenY)
if (w != NULL){ if (w != NULL){
tool_set(w, 23, 12); tool_set(w, 23, 12);
gInputFlags |= INPUT_FLAG_6; gInputFlags |= INPUT_FLAG_6;
RCT2_GLOBAL(0x00F44159, uint8) = 0; _trackPlaceCtrlState = false;
RCT2_GLOBAL(0x00F4415C, uint8) = 0; _trackPlaceShiftState = false;
} }
window_maze_construction_update_pressed_widgets(); window_maze_construction_update_pressed_widgets();
break; break;

View File

@ -544,7 +544,7 @@ static void window_track_place_tooldown(rct_window* w, int widgetIndex, int x, i
window_close_by_class(WC_ERROR); window_close_by_class(WC_ERROR);
audio_play_sound_at_location(SOUND_PLACE_ITEM, mapX, mapY, mapZ); audio_play_sound_at_location(SOUND_PLACE_ITEM, mapX, mapY, mapZ);
RCT2_GLOBAL(0x00F440A7, uint8) = rideIndex; _currentRideIndex = rideIndex;
if (RCT2_GLOBAL(0x00F4414E, uint8) & 1) { if (RCT2_GLOBAL(0x00F4414E, uint8) & 1) {
window_ride_main_open(rideIndex); window_ride_main_open(rideIndex);
window_close(w); window_close(w);

View File

@ -353,7 +353,7 @@ static money32 footpath_place_real(int type, int x, int y, int z, int slope, int
} }
// Force ride construction to recheck area // Force ride construction to recheck area
RCT2_GLOBAL(0x00F440B0, uint8) |= 8; _currentTrackSelectionFlags |= 8;
if (RCT2_GLOBAL(0x009A8C28, uint8) == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) { if (RCT2_GLOBAL(0x009A8C28, uint8) == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) {
rct_xyz16 coord; rct_xyz16 coord;

View File

@ -1908,7 +1908,7 @@ money32 raise_land(int flags, int x, int y, int z, int ax, int ay, int bx, int b
} }
// Force ride construction to recheck area // Force ride construction to recheck area
RCT2_GLOBAL(0x00F440B0, uint8) |= 8; _currentTrackSelectionFlags |= 8;
RCT2_GLOBAL(RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE, uint8) = RCT_EXPENDITURE_TYPE_LANDSCAPING * 4; RCT2_GLOBAL(RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE, uint8) = RCT_EXPENDITURE_TYPE_LANDSCAPING * 4;
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16) = x; RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16) = x;
@ -1981,7 +1981,7 @@ money32 lower_land(int flags, int x, int y, int z, int ax, int ay, int bx, int b
} }
// Force ride construction to recheck area // Force ride construction to recheck area
RCT2_GLOBAL(0x00F440B0, uint8) |= 8; _currentTrackSelectionFlags |= 8;
RCT2_GLOBAL(RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE, uint8) = RCT_EXPENDITURE_TYPE_LANDSCAPING * 4; RCT2_GLOBAL(RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE, uint8) = RCT_EXPENDITURE_TYPE_LANDSCAPING * 4;
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16) = x; RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16) = x;
@ -2066,7 +2066,7 @@ money32 raise_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
} }
// Force ride construction to recheck area // Force ride construction to recheck area
RCT2_GLOBAL(0x00F440B0, uint8) |= 8; _currentTrackSelectionFlags |= 8;
return cost; return cost;
} }
@ -2142,7 +2142,7 @@ money32 lower_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
} }
// Force ride construction to recheck area // Force ride construction to recheck area
RCT2_GLOBAL(0x00F440B0, uint8) |= 8; _currentTrackSelectionFlags |= 8;
return cost; return cost;
} }
@ -3749,7 +3749,7 @@ void game_command_place_large_scenery(int* eax, int* ebx, int* ecx, int* edx, in
} }
// Force ride construction to recheck area // Force ride construction to recheck area
RCT2_GLOBAL(0x00F440B0, uint8) |= 8; _currentTrackSelectionFlags |= 8;
*ebx = (scenery_entry->large_scenery.price * 10) + RCT2_GLOBAL(0x00F4389A, money32); *ebx = (scenery_entry->large_scenery.price * 10) + RCT2_GLOBAL(0x00F4389A, money32);
if(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY){ if(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY){