Replace known addresses with constants

This commit is contained in:
Marijn van der Werf 2016-01-11 01:50:03 +01:00
parent 57420cbc66
commit 98b5ad1bf4
22 changed files with 50 additions and 50 deletions

View File

@ -397,7 +397,7 @@ static void game_handle_input_mouse(int x, int y, int state)
break; break;
case MOUSE_STATE_LEFT_RELEASE: case MOUSE_STATE_LEFT_RELEASE:
gInputState = INPUT_STATE_RESET; gInputState = INPUT_STATE_RESET;
if (RCT2_GLOBAL(0x009DE52E, rct_windownumber) == w->number) { if (RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DRAG_WINDOWNUMBER, rct_windownumber) == w->number) {
if ((gInputFlags & INPUT_FLAG_TOOL_ACTIVE)) { if ((gInputFlags & INPUT_FLAG_TOOL_ACTIVE)) {
w = window_find_by_number( w = window_find_by_number(
RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass), RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass),

View File

@ -1276,7 +1276,7 @@ void viewport_ride_entrance_exit_paint_setup(uint8 direction, int height, rct_ma
if (map_element->flags & MAP_ELEMENT_FLAG_GHOST){ if (map_element->flags & MAP_ELEMENT_FLAG_GHOST){
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE; RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE;
image_id = RCT2_ADDRESS(0x993CC4, uint32_t)[RCT2_GLOBAL(0x9AACBF, uint8)]; image_id = RCT2_ADDRESS(0x993CC4, uint32_t)[RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8)];
RCT2_GLOBAL(0x009E32BC, uint32) = image_id; RCT2_GLOBAL(0x009E32BC, uint32) = image_id;
if (transparant_image_id) if (transparant_image_id)
transparant_image_id = image_id; transparant_image_id = image_id;
@ -1417,7 +1417,7 @@ void viewport_park_entrance_paint_setup(uint8 direction, int height, rct_map_ele
uint32 image_id, ghost_id = 0; uint32 image_id, ghost_id = 0;
if (map_element->flags & MAP_ELEMENT_FLAG_GHOST){ if (map_element->flags & MAP_ELEMENT_FLAG_GHOST){
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE; RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE;
ghost_id = RCT2_ADDRESS(0x993CC4, uint32)[RCT2_GLOBAL(0x9AACBF, uint8)]; ghost_id = RCT2_ADDRESS(0x993CC4, uint32)[RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8)];
RCT2_GLOBAL(0x009E32BC, uint32) = ghost_id; RCT2_GLOBAL(0x009E32BC, uint32) = ghost_id;
} }
@ -1686,7 +1686,7 @@ void viewport_banner_paint_setup(uint8 direction, int height, rct_map_element* m
if (map_element->flags & MAP_ELEMENT_FLAG_GHOST)//if being placed if (map_element->flags & MAP_ELEMENT_FLAG_GHOST)//if being placed
{ {
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_NONE; RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_NONE;
image_id |= RCT2_ADDRESS(0x993CC4, uint32_t)[RCT2_GLOBAL(0x9AACBF, uint8)]; image_id |= RCT2_ADDRESS(0x993CC4, uint32_t)[RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8)];
} }
else{ else{
image_id |= image_id |=

View File

@ -54,7 +54,7 @@ money32 *gParkValueHistory = RCT2_ADDRESS(RCT2_ADDRESS_PARK_VALUE_HISTORY, money
* Pay an amount of money. * Pay an amount of money.
* rct2: 0x069C674 * rct2: 0x069C674
* @param amount (eax) * @param amount (eax)
* @param type passed via global var 0x0141F56C, our type is that var/4. * @param type passed via global var 0x0141F56C (RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE), our type is that var/4.
*/ */
void finance_payment(money32 amount, rct_expenditure_type type) void finance_payment(money32 amount, rct_expenditure_type type)
{ {

View File

@ -493,7 +493,7 @@ void set_load_objects_fail_reason()
if (expansion == 0 if (expansion == 0
|| expansion == 8 || expansion == 8
|| RCT2_GLOBAL(0x9AB4C0, uint16) & (1 << expansion)){ || RCT2_GLOBAL(RCT2_ADDRESS_EXPANSION_FLAGS, uint16) & (1 << expansion)){
char* string_buffer = RCT2_ADDRESS(0x9BC677, char); char* string_buffer = RCT2_ADDRESS(0x9BC677, char);

View File

@ -6101,13 +6101,13 @@ static void peep_stop_purchase_thought(rct_peep* peep, uint8 ride_type){
uint8 thought_type = PEEP_THOUGHT_TYPE_HUNGRY; uint8 thought_type = PEEP_THOUGHT_TYPE_HUNGRY;
if (!(RCT2_ADDRESS(0x97CF40, uint32)[ride_type * 2] & 0x800000)){ if (!(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride_type * 2] & 0x800000)){
thought_type = PEEP_THOUGHT_TYPE_THIRSTY; thought_type = PEEP_THOUGHT_TYPE_THIRSTY;
if (!(RCT2_ADDRESS(0x97CF40, uint32)[ride_type * 2] & 0x1000000)){ if (!(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride_type * 2] & 0x1000000)){
thought_type = PEEP_THOUGHT_RUNNING_OUT; thought_type = PEEP_THOUGHT_RUNNING_OUT;
if (ride_type != RIDE_TYPE_CASH_MACHINE){ if (ride_type != RIDE_TYPE_CASH_MACHINE){
thought_type = PEEP_THOUGHT_TYPE_BATHROOM; thought_type = PEEP_THOUGHT_TYPE_BATHROOM;
if (!(RCT2_ADDRESS(0x97CF40, uint32)[ride_type * 2] & 0x2000000)){ if (!(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride_type * 2] & 0x2000000)){
return; return;
} }
} }
@ -7001,7 +7001,7 @@ static uint8 loc_6949B9(
if (z != mapElement->base_height) continue; if (z != mapElement->base_height) continue;
int rideIndex = inputMapElement->properties.path.ride_index; int rideIndex = inputMapElement->properties.path.ride_index;
rct_ride *ride = GET_RIDE(rideIndex); rct_ride *ride = GET_RIDE(rideIndex);
if (RCT2_GLOBAL(0x0097CF40 + (ride->type * 8), uint32) & 0x20000) { if (RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8), uint32) & 0x20000) {
*outRideIndex = rideIndex; *outRideIndex = rideIndex;
return PATH_SEARCH_RIDE_ENTRANCE; return PATH_SEARCH_RIDE_ENTRANCE;
} }
@ -8060,7 +8060,7 @@ static void peep_update_ride_nausea_growth(rct_peep *peep, rct_ride *ride)
static bool peep_should_go_on_ride_again(rct_peep *peep, rct_ride *ride) static bool peep_should_go_on_ride_again(rct_peep *peep, rct_ride *ride)
{ {
if (!(RCT2_GLOBAL(0x0097CF40 + (ride->type * 8), uint32) & 0x100000)) return false; if (!(RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8), uint32) & 0x100000)) return false;
if (ride->excitement == (ride_rating)0xFFFF) return false; if (ride->excitement == (ride_rating)0xFFFF) return false;
if (ride->intensity > RIDE_RATING(10,00) && !gConfigCheat.ignore_ride_intensity) return false; if (ride->intensity > RIDE_RATING(10,00) && !gConfigCheat.ignore_ride_intensity) return false;
if (peep->happiness < 180) return false; if (peep->happiness < 180) return false;
@ -9326,7 +9326,7 @@ money32 set_peep_name(int flags, int state, uint16 sprite_index, uint8* text_1,
rct_peep* peep = GET_PEEP(sprite_index); rct_peep* peep = GET_PEEP(sprite_index);
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint32) = peep->id; RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint32) = peep->id;
utf8* curName = RCT2_ADDRESS(0x00141ED68, utf8); utf8* curName = RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, utf8);
rct_string_id curId = peep->name_string_idx; rct_string_id curId = peep->name_string_idx;
format_string(curName, curId, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); format_string(curName, curId, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void));
@ -9334,7 +9334,7 @@ money32 set_peep_name(int flags, int state, uint16 sprite_index, uint8* text_1,
return 0; return 0;
if (*fullText == '\0') { if (*fullText == '\0') {
RCT2_GLOBAL(0x00141E9AC, rct_string_id) = 1455; RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = 1455;
return MONEY32_UNDEFINED; return MONEY32_UNDEFINED;
} }

View File

@ -612,7 +612,7 @@ static void rct1_clear_extra_tile_entries()
*tilePointer++ = nextFreeMapElement++; *tilePointer++ = nextFreeMapElement++;
} }
RCT2_GLOBAL(0x0140E9A4, rct_map_element*) = nextFreeMapElement; RCT2_GLOBAL(RCT2_ADDRESS_NEXT_FREE_MAP_ELEMENT, rct_map_element*) = nextFreeMapElement;
} }
/** /**
@ -661,7 +661,7 @@ static void rct1_fix_colours()
} }
mapElement = gMapElements; mapElement = gMapElements;
while (mapElement < RCT2_GLOBAL(0x0140E9A4, rct_map_element*)) { while (mapElement < RCT2_GLOBAL(RCT2_ADDRESS_NEXT_FREE_MAP_ELEMENT, rct_map_element*)) {
if (mapElement->base_height != 255) { if (mapElement->base_height != 255) {
switch (map_element_get_type(mapElement)) { switch (map_element_get_type(mapElement)) {
case MAP_ELEMENT_TYPE_SCENERY: case MAP_ELEMENT_TYPE_SCENERY:
@ -745,7 +745,7 @@ static void rct1_fix_z()
} }
mapElement = gMapElements; mapElement = gMapElements;
while (mapElement < RCT2_GLOBAL(0x0140E9A4, rct_map_element*)) { while (mapElement < RCT2_GLOBAL(RCT2_ADDRESS_NEXT_FREE_MAP_ELEMENT, rct_map_element*)) {
if (mapElement->base_height != 255) { if (mapElement->base_height != 255) {
mapElement->base_height /= 2; mapElement->base_height /= 2;
mapElement->clearance_height /= 2; mapElement->clearance_height /= 2;
@ -765,7 +765,7 @@ static void rct1_fix_paths()
int pathType, secondaryType, additions; int pathType, secondaryType, additions;
mapElement = gMapElements; mapElement = gMapElements;
while (mapElement < RCT2_GLOBAL(0x0140E9A4, rct_map_element*)) { while (mapElement < RCT2_GLOBAL(RCT2_ADDRESS_NEXT_FREE_MAP_ELEMENT, rct_map_element*)) {
switch (map_element_get_type(mapElement)) { switch (map_element_get_type(mapElement)) {
case MAP_ELEMENT_TYPE_PATH: case MAP_ELEMENT_TYPE_PATH:
// Type // Type

View File

@ -550,7 +550,7 @@ void get_system_info()
} }
RCT2_GLOBAL(0x01423C1C, uint32) = (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_CAP_BPP, sint32) >= 8); RCT2_GLOBAL(0x01423C1C, uint32) = (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_CAP_BPP, sint32) >= 8);
if (RCT2_GLOBAL(RCT2_ADDRESS_OS_MAJOR_VERSION, uint32) < 4 || RCT2_GLOBAL(0x1423C10, sint32) < 4) if (RCT2_GLOBAL(RCT2_ADDRESS_OS_MAJOR_VERSION, uint32) < 4 || RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_CAP_BPP, sint32) < 4)
RCT2_GLOBAL(0x1423C18, sint32) = 0; RCT2_GLOBAL(0x1423C18, sint32) = 0;
else else
RCT2_GLOBAL(0x1423C18, sint32) = 1; RCT2_GLOBAL(0x1423C18, sint32) = 1;

View File

@ -5429,10 +5429,10 @@ foundRideEntry:
ride->music = RCT2_ADDRESS(0x0097D4F4, uint8)[ride->type * 8]; ride->music = RCT2_ADDRESS(0x0097D4F4, uint8)[ride->type * 8];
ride->operation_option = ( ride->operation_option = (
RCT2_GLOBAL(0x0097CF40 + 4 + (ride->type * 8), uint8) + RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 4 + (ride->type * 8), uint8) +
RCT2_GLOBAL(0x0097CF40 + 4 + (ride->type * 8), uint8) + RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 4 + (ride->type * 8), uint8) +
RCT2_GLOBAL(0x0097CF40 + 4 + (ride->type * 8), uint8) + RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 4 + (ride->type * 8), uint8) +
RCT2_GLOBAL(0x0097CF40 + 5 + (ride->type * 8), uint8) RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 5 + (ride->type * 8), uint8)
) / 4; ) / 4;
ride->lift_hill_speed = RideLiftData[ride->type].minimum_speed; ride->lift_hill_speed = RideLiftData[ride->type].minimum_speed;

View File

@ -889,7 +889,7 @@ extern const uint8 gRideClassifications[255];
#define _currentTrackBeginX RCT2_GLOBAL(0x00F440A8, uint16) #define _currentTrackBeginX RCT2_GLOBAL(0x00F440A8, uint16)
#define _currentTrackBeginY RCT2_GLOBAL(0x00F440AA, uint16) #define _currentTrackBeginY RCT2_GLOBAL(0x00F440AA, uint16)
#define _currentTrackBeginZ RCT2_GLOBAL(0x00F440AC, uint16) #define _currentTrackBeginZ RCT2_GLOBAL(0x00F440AC, uint16)
#define _currentTrackPieceDirection RCT2_GLOBAL(0x00F440AE, uint8) #define _currentTrackPieceDirection RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_ROTATION, uint8)
#define _currentTrackPieceType RCT2_GLOBAL(0x00F440AF, uint8) #define _currentTrackPieceType RCT2_GLOBAL(0x00F440AF, uint8)
#define _currentTrackSelectionFlags RCT2_GLOBAL(0x00F440B0, uint8) #define _currentTrackSelectionFlags RCT2_GLOBAL(0x00F440B0, uint8)
#define _rideConstructionArrowPulseTime RCT2_GLOBAL(0x00F440B1, sint8) #define _rideConstructionArrowPulseTime RCT2_GLOBAL(0x00F440B1, sint8)

View File

@ -720,7 +720,7 @@ int backup_map(){
memcpy(RCT2_GLOBAL(0xF440F1, uint32*), tile_map_pointers, 0x40000); memcpy(RCT2_GLOBAL(0xF440F1, uint32*), tile_map_pointers, 0x40000);
uint8* backup_info = RCT2_GLOBAL(0xF440F5, uint8*); uint8* backup_info = RCT2_GLOBAL(0xF440F5, uint8*);
*(uint32*)backup_info = RCT2_GLOBAL(0x0140E9A4, uint32); *(uint32*)backup_info = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_FREE_MAP_ELEMENT, uint32);
*(uint16*)(backup_info + 4) = RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, uint16); *(uint16*)(backup_info + 4) = RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, uint16);
*(uint16*)(backup_info + 6) = RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_MINUS_2, uint16); *(uint16*)(backup_info + 6) = RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_MINUS_2, uint16);
*(uint16*)(backup_info + 8) = RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE, uint16); *(uint16*)(backup_info + 8) = RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE, uint16);
@ -740,7 +740,7 @@ void reload_map_backup(){
memcpy(tile_map_pointers, RCT2_GLOBAL(0xF440F1, uint32*), 0x40000); memcpy(tile_map_pointers, RCT2_GLOBAL(0xF440F1, uint32*), 0x40000);
uint8* backup_info = RCT2_GLOBAL(0xF440F5, uint8*); uint8* backup_info = RCT2_GLOBAL(0xF440F5, uint8*);
RCT2_GLOBAL(0x0140E9A4, uint32) = *(uint32*)backup_info; RCT2_GLOBAL(RCT2_ADDRESS_NEXT_FREE_MAP_ELEMENT, uint32) = *(uint32*)backup_info;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, uint16) = *(uint16*)(backup_info + 4); RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, uint16) = *(uint16*)(backup_info + 4);
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_MINUS_2, uint16) = *(uint16*)(backup_info + 6); RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_MINUS_2, uint16) = *(uint16*)(backup_info + 6);
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE, uint16) = *(uint16*)(backup_info + 8); RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE, uint16) = *(uint16*)(backup_info + 8);
@ -1229,7 +1229,7 @@ int track_place_scenery(rct_track_scenery* scenery_start, uint8 rideIndex, int o
if (RCT2_GLOBAL(0x00F440D4, uint8) == 4)bl = 0xE9; if (RCT2_GLOBAL(0x00F440D4, uint8) == 4)bl = 0xE9;
if (RCT2_GLOBAL(0x00F440D4, uint8) == 1)bl = 0x80; if (RCT2_GLOBAL(0x00F440D4, uint8) == 1)bl = 0x80;
RCT2_GLOBAL(0x00141E9AE, rct_string_id) = STR_CANT_POSITION_THIS_HERE; RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, rct_string_id) = STR_CANT_POSITION_THIS_HERE;
cost = game_do_command( cost = game_do_command(
mapCoord.x, mapCoord.x,
@ -1288,7 +1288,7 @@ int track_place_scenery(rct_track_scenery* scenery_start, uint8 rideIndex, int o
if (RCT2_GLOBAL(0x00F440D4, uint8) == 4)bl = 105; if (RCT2_GLOBAL(0x00F440D4, uint8) == 4)bl = 105;
if (RCT2_GLOBAL(0x00F440D4, uint8) == 1)bl = 0; if (RCT2_GLOBAL(0x00F440D4, uint8) == 1)bl = 0;
RCT2_GLOBAL(0x00141E9AE, rct_string_id) = STR_CANT_BUILD_PARK_ENTRANCE_HERE; RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, rct_string_id) = STR_CANT_BUILD_PARK_ENTRANCE_HERE;
cost = game_do_command( cost = game_do_command(
mapCoord.x, mapCoord.x,
@ -3077,7 +3077,7 @@ int save_track_design(uint8 rideIndex){
substitute_path(path, RCT2_ADDRESS(RCT2_ADDRESS_TRACKS_PATH, char), track_name); substitute_path(path, RCT2_ADDRESS(RCT2_ADDRESS_TRACKS_PATH, char), track_name);
// Save track design // Save track design
format_string(RCT2_ADDRESS(0x141ED68, char), 2306, NULL); format_string(RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char), 2306, NULL);
// Track design files // Track design files
format_string(RCT2_ADDRESS(0x141EE68, char), 2305, NULL); format_string(RCT2_ADDRESS(0x141EE68, char), 2305, NULL);
@ -3086,7 +3086,7 @@ int save_track_design(uint8 rideIndex){
int result = platform_open_common_file_dialog( int result = platform_open_common_file_dialog(
0, 0,
RCT2_ADDRESS(0x141ED68, char), RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char),
path, path,
"*.TD?", "*.TD?",
RCT2_ADDRESS(0x141EE68, char)); RCT2_ADDRESS(0x141EE68, char));
@ -3977,7 +3977,7 @@ static money32 track_place(int rideIndex, int type, int originX, int originY, in
enabledTrackPieces |= rideEntry->enabledTrackPiecesB & RCT2_ADDRESS(0x01357644, uint32)[ride->type]; enabledTrackPieces |= rideEntry->enabledTrackPiecesB & RCT2_ADDRESS(0x01357644, uint32)[ride->type];
enabledTrackPieces <<= 32; enabledTrackPieces <<= 32;
enabledTrackPieces |= rideEntry->enabledTrackPiecesA & RCT2_ADDRESS(0x01357444, uint32)[ride->type]; enabledTrackPieces |= rideEntry->enabledTrackPiecesA & RCT2_ADDRESS(0x01357444, uint32)[ride->type];
uint32 rideTypeFlags = RCT2_GLOBAL(0x0097CF40 + (ride->type * 8), uint32); uint32 rideTypeFlags = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8), uint32);
RCT2_GLOBAL(0x00F44068, uint32) = rideTypeFlags; RCT2_GLOBAL(0x00F44068, uint32) = rideTypeFlags;
if ((ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && type == 1) { if ((ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && type == 1) {
@ -4481,7 +4481,7 @@ static bool sub_6C494B(int x, int y, int z, int direction, int rideIndex, int fl
} }
money32 track_remove(uint8 type, uint8 sequence, sint16 originX, sint16 originY, sint16 originZ, uint8 rotation, uint8 flags){ money32 track_remove(uint8 type, uint8 sequence, sint16 originX, sint16 originY, sint16 originZ, uint8 rotation, uint8 flags){
RCT2_GLOBAL(0x00141F56C, uint8) = 0; RCT2_GLOBAL(RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE, uint8) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, sint16) = originX + 16; RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, sint16) = originX + 16;
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, sint16) = originY + 16; RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, sint16) = originY + 16;
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, sint16) = originZ; RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, sint16) = originZ;

View File

@ -6886,7 +6886,7 @@ loc_6DAEB9:
if ((trackType == TRACK_ELEM_FLAT && ride->type == RIDE_TYPE_REVERSE_FREEFALL_COASTER) || if ((trackType == TRACK_ELEM_FLAT && ride->type == RIDE_TYPE_REVERSE_FREEFALL_COASTER) ||
(trackType == TRACK_ELEM_POWERED_LIFT) (trackType == TRACK_ELEM_POWERED_LIFT)
) { ) {
vehicle->acceleration = RCT2_GLOBAL(0x0097CF40 + (ride->type * 8) + 7, uint8) << 16; vehicle->acceleration = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8) + 7, uint8) << 16;
} }
if (trackType == TRACK_ELEM_BRAKE_FOR_DROP) { if (trackType == TRACK_ELEM_BRAKE_FOR_DROP) {
if (!vehicle->is_child) { if (!vehicle->is_child) {

View File

@ -1479,7 +1479,7 @@ static void window_editor_object_selection_scrollpaint(rct_window *w, rct_drawpi
x = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER ? 0 : 15; x = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER ? 0 : 15;
char *bufferWithColour = (char*)0x0141ED68; char *bufferWithColour = (char*)RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER;
char *buffer = utf8_write_codepoint(bufferWithColour, colour); char *buffer = utf8_write_codepoint(bufferWithColour, colour);
if (*listItem->flags & OBJECT_SELECTION_FLAG_6) { if (*listItem->flags & OBJECT_SELECTION_FLAG_6) {
colour = w->colours[1] & 0x7F; colour = w->colours[1] & 0x7F;

View File

@ -992,7 +992,7 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
} else { } else {
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 0, uint16) = RCT2_GLOBAL(RCT2_ADDRESS_PARK_NAME, rct_string_id); RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 0, uint16) = RCT2_GLOBAL(RCT2_ADDRESS_PARK_NAME, rct_string_id);
} }
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint32) = RCT2_GLOBAL(0x0013573D8, uint32); RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint32) = RCT2_GLOBAL(RCT2_ADDRESS_PARK_NAME_ARGS, uint32);
gfx_draw_string_left_clipped(dpi, 3298, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS, 0, x, y, width); gfx_draw_string_left_clipped(dpi, 3298, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS, 0, x, y, width);
// Scenario name // Scenario name
@ -1006,7 +1006,7 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
safe_strncpy((char*)0x009BC677, s6Info->name, 64); safe_strncpy((char*)0x009BC677, s6Info->name, 64);
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 0, uint16) = 3165; RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 0, uint16) = 3165;
} }
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint32) = RCT2_GLOBAL(0x0013573D8, uint32); RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint32) = RCT2_GLOBAL(RCT2_ADDRESS_PARK_NAME_ARGS, uint32);
gfx_draw_string_left_clipped(dpi, 3300, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS, 0, x, y, width); gfx_draw_string_left_clipped(dpi, 3300, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS, 0, x, y, width);
// Scenario details label // Scenario details label
@ -1025,7 +1025,7 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
safe_strncpy((char*)0x009BC677, s6Info->details, 256); safe_strncpy((char*)0x009BC677, s6Info->details, 256);
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 0, uint16) = 3165; RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 0, uint16) = 3165;
} }
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint32) = RCT2_GLOBAL(0x0013573D8, uint32); RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint32) = RCT2_GLOBAL(RCT2_ADDRESS_PARK_NAME_ARGS, uint32);
gfx_draw_string_left_wrapped(dpi, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS, x, y, width, 1191, 0); gfx_draw_string_left_wrapped(dpi, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS, x, y, width, 1191, 0);
// Scenario category label // Scenario category label

View File

@ -1263,7 +1263,7 @@ void window_guest_overview_tool_down(rct_window* w, int widgetIndex, int x, int
sub_693B58(peep); sub_693B58(peep);
tool_cancel(); tool_cancel();
RCT2_GLOBAL(0x9DE550, sint32) = -1; RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_IMAGE, sint32) = -1;
} }
/** /**

View File

@ -217,7 +217,7 @@ void window_guest_list_open_with_filter(int type, int index)
eax = (eax << 16) + 1435; eax = (eax << 16) + 1435;
if ((RCT2_GLOBAL(0x97CF40 + ride->type * 8, uint32) & 0x400000) != 0) if ((RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride->type * 8, uint32) & 0x400000) != 0)
eax++; eax++;
RCT2_GLOBAL(0x00F1EDF6, uint32) = eax; RCT2_GLOBAL(0x00F1EDF6, uint32) = eax;

View File

@ -318,7 +318,7 @@ static void window_map_mouseup(rct_window *w, int widgetIndex)
if (tool_set(w, widgetIndex, 2)) if (tool_set(w, widgetIndex, 2))
break; break;
RCT2_GLOBAL(0x9E32D2, sint8) = 0; RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_GHOST_EXISTS, sint8) = 0;
gInputFlags |= INPUT_FLAG_6; gInputFlags |= INPUT_FLAG_6;
show_gridlines(); show_gridlines();

View File

@ -357,7 +357,7 @@ static void window_maze_construction_entrance_tooldown(int x, int y, rct_window*
uint8 rideIndex = RCT2_GLOBAL(0x00F44192, uint8); uint8 rideIndex = RCT2_GLOBAL(0x00F44192, uint8);
uint8 is_exit = RCT2_GLOBAL(0x00F44191, uint8); uint8 is_exit = RCT2_GLOBAL(0x00F44191, uint8);
RCT2_GLOBAL(0x00141E9AE, rct_string_id) = is_exit ? 1144 : 1145; RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, rct_string_id) = is_exit ? 1144 : 1145;
money32 cost = game_do_command( money32 cost = game_do_command(
x, x,

View File

@ -1123,23 +1123,23 @@ void window_ride_disable_tabs(rct_window *w)
uint8 ride_type = ride->type; // ecx uint8 ride_type = ride->type; // ecx
if ((RCT2_GLOBAL(0x97CF40 + ride_type * 8, uint32) & 0x200) == 0) if ((RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride_type * 8, uint32) & 0x200) == 0)
disabled_tabs |= (1 << WIDX_TAB_8); // 0x800 disabled_tabs |= (1 << WIDX_TAB_8); // 0x800
if (ride_type == RIDE_TYPE_MINI_GOLF) if (ride_type == RIDE_TYPE_MINI_GOLF)
disabled_tabs |= (1 << WIDX_TAB_2 | 1 << WIDX_TAB_3 | 1 << WIDX_TAB_4); // 0xE0 disabled_tabs |= (1 << WIDX_TAB_2 | 1 << WIDX_TAB_3 | 1 << WIDX_TAB_4); // 0xE0
if ((RCT2_GLOBAL(0x97CF40 + ride_type * 8, uint32) & 0x2000) != 0) if ((RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride_type * 8, uint32) & 0x2000) != 0)
disabled_tabs |= (1 << WIDX_TAB_2); // 0x20 disabled_tabs |= (1 << WIDX_TAB_2); // 0x20
if ( if (
!(RCT2_GLOBAL(0x97CF40 + ride_type * 8, uint32) & 0x4000007) && !(RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride_type * 8, uint32) & 0x4000007) &&
!(RideData4[ride->type].flags & RIDE_TYPE_FLAG4_HAS_ENTRANCE_EXIT) !(RideData4[ride->type].flags & RIDE_TYPE_FLAG4_HAS_ENTRANCE_EXIT)
) { ) {
disabled_tabs |= (1 << WIDX_TAB_5); // 0x100 disabled_tabs |= (1 << WIDX_TAB_5); // 0x100
} }
if ((RCT2_GLOBAL(0x97CF40 + ride_type * 8, uint32) & 0x20000) != 0) if ((RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride_type * 8, uint32) & 0x20000) != 0)
disabled_tabs |= (1 << WIDX_TAB_3 | 1 << WIDX_TAB_4 | 1 << WIDX_TAB_7); // 0x4C0 disabled_tabs |= (1 << WIDX_TAB_3 | 1 << WIDX_TAB_4 | 1 << WIDX_TAB_7); // 0x4C0
if (!(RideData4[ride->type].flags & RIDE_TYPE_FLAG4_ALLOW_MUSIC)) { if (!(RideData4[ride->type].flags & RIDE_TYPE_FLAG4_ALLOW_MUSIC)) {

View File

@ -1455,7 +1455,7 @@ static void window_ride_construction_mousedown(int widgetIndex, rct_window *w, r
uint8 maxBrakesSpeed = 30; uint8 maxBrakesSpeed = 30;
if (RCT2_GLOBAL(0x00F440D3, uint8) != 1) { if (RCT2_GLOBAL(0x00F440D3, uint8) != 1) {
brakesSpeedPtr = (uint8*)0x00F440CE; brakesSpeedPtr = (uint8*)0x00F440CE;
maxBrakesSpeed = RCT2_GLOBAL(0x0097CF40 + 6 + (ride->type * 8), uint8); maxBrakesSpeed = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 6 + (ride->type * 8), uint8);
} }
uint8 brakesSpeed = *brakesSpeedPtr + 2; uint8 brakesSpeed = *brakesSpeedPtr + 2;
if (brakesSpeed <= maxBrakesSpeed) { if (brakesSpeed <= maxBrakesSpeed) {

View File

@ -1172,7 +1172,7 @@ void window_staff_overview_tool_down(rct_window* w, int widgetIndex, int x, int
peep->var_C4 = 0; peep->var_C4 = 0;
tool_cancel(); tool_cancel();
RCT2_GLOBAL(0x9DE550, sint32) = -1; RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_IMAGE, sint32) = -1;
} }
else if (widgetIndex == WIDX_PATROL){ else if (widgetIndex == WIDX_PATROL){
int dest_x, dest_y; int dest_x, dest_y;

View File

@ -4657,7 +4657,7 @@ money32 place_park_entrance(int flags, sint16 x, sint16 y, sint16 z, uint8 direc
} }
if (x <= 32 || y <= 32 || x >= (RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, sint16) - 32) || y >= (RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, sint16) - 32)) { if (x <= 32 || y <= 32 || x >= (RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, sint16) - 32) || y >= (RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, sint16) - 32)) {
RCT2_GLOBAL(0x00141E9AC, rct_string_id) = 3215; RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = 3215;
return MONEY32_UNDEFINED; return MONEY32_UNDEFINED;
} }
@ -4670,7 +4670,7 @@ money32 place_park_entrance(int flags, sint16 x, sint16 y, sint16 z, uint8 direc
} }
if (entranceNum == -1) { if (entranceNum == -1) {
RCT2_GLOBAL(0x00141E9AC, rct_string_id) = 3227; RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = 3227;
return MONEY32_UNDEFINED; return MONEY32_UNDEFINED;
} }

View File

@ -87,7 +87,7 @@ void invalidate_sprite_2(rct_sprite *sprite)
* rct2: 0x0069EB13 * rct2: 0x0069EB13
*/ */
void reset_sprite_list(){ void reset_sprite_list(){
RCT2_GLOBAL(0x1388698, uint16) = 0; RCT2_GLOBAL(RCT2_ADDRESS_SAVED_AGE, uint16) = 0;
memset(g_sprite_list, 0, sizeof(rct_sprite) * MAX_SPRITES); memset(g_sprite_list, 0, sizeof(rct_sprite) * MAX_SPRITES);
for (int i = 0; i < 6; ++i){ for (int i = 0; i < 6; ++i){
@ -186,7 +186,7 @@ rct_sprite *create_sprite(uint8 bl)
if ((bl & 2) != 0) if ((bl & 2) != 0)
{ {
// 69EC96; // 69EC96;
uint16 cx = 0x12C - RCT2_GLOBAL(0x13573CE, uint16); uint16 cx = 0x12C - RCT2_GLOBAL(RCT2_ADDRESS_SPRITES_COUNT_MISC, uint16);
if (cx >= RCT2_GLOBAL(0x13573C8, uint16)) if (cx >= RCT2_GLOBAL(0x13573C8, uint16))
{ {
return NULL; return NULL;