Merge pull request #2692 from marijnvdwerf/use-named-addresses

Replace known addresses with constants, globals and wrapper functions
This commit is contained in:
Ted John committed 2016-01-15 22:59:13 +00:00
commit e69e384d43
24 files changed
+79 -81

No files matched your search

+1 -1
View File
@@ -397,7 +397,7 @@ static void game_handle_input_mouse(int x, int y, int state)
break;
case MOUSE_STATE_LEFT_RELEASE:
gInputState = INPUT_STATE_RESET;
if (RCT2_GLOBAL(0x009DE52E, rct_windownumber) == w->number) {
if (_dragWidget.window_number == w->number) {
if ((gInputFlags & INPUT_FLAG_TOOL_ACTIVE)) {
w = window_find_by_number(
RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass),
+4 -4
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){
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)[gConfigGeneral.construction_marker_colour];
RCT2_GLOBAL(0x009E32BC, uint32) = image_id;
if (transparant_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;
if (map_element->flags & MAP_ELEMENT_FLAG_GHOST){
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)[gConfigGeneral.construction_marker_colour];
RCT2_GLOBAL(0x009E32BC, uint32) = ghost_id;
}
@@ -1574,7 +1574,7 @@ void viewport_track_paint_setup(uint8 direction, int height, rct_map_element *ma
RCT2_GLOBAL(0x00F441A4, uint32) = 0x21600000;
}
if (mapElement->flags & MAP_ELEMENT_FLAG_GHOST) {
uint32 ghost_id = RCT2_ADDRESS(0x00993CC4, uint32)[RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8)];
uint32 ghost_id = RCT2_ADDRESS(0x00993CC4, uint32)[gConfigGeneral.construction_marker_colour];
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = 0;
RCT2_GLOBAL(0x00F44198, uint32) = ghost_id;
RCT2_GLOBAL(0x00F4419C, 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
{
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)[gConfigGeneral.construction_marker_colour];
}
else{
image_id |=
+1 -1
View File
@@ -54,7 +54,7 @@ money32 *gParkValueHistory = RCT2_ADDRESS(RCT2_ADDRESS_PARK_VALUE_HISTORY, money
* Pay an amount of money.
* rct2: 0x069C674
* @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)
{
+1 -1
View File
@@ -493,7 +493,7 @@ void set_load_objects_fail_reason()
if (expansion == 0
|| expansion == 8
|| RCT2_GLOBAL(0x9AB4C0, uint16) & (1 << expansion)){
|| RCT2_GLOBAL(RCT2_ADDRESS_EXPANSION_FLAGS, uint16) & (1 << expansion)){
char* string_buffer = RCT2_ADDRESS(0x9BC677, char);
+19 -19
View File
@@ -1594,7 +1594,7 @@ void remove_peep_from_queue(rct_peep* peep)
*/
static rct_vehicle* peep_choose_car_from_ride(rct_peep* peep, rct_ride* ride, uint8* car_array, uint8 car_array_size){
uint8 chosen_car = scenario_rand();
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & RIDE_TYPE_FLAG_HAS_G_FORCES
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_G_FORCES)
&& ((chosen_car & 0xC) != 0xC)){
chosen_car = (scenario_rand() & 1) ? 0 : car_array_size - 1;
}
@@ -1713,7 +1713,7 @@ static void peep_update_ride_sub_state_0(rct_peep* peep){
uint8 car_array_size = 0xFF;
uint8* car_array = RCT2_ADDRESS(0xF1AD78, uint8);
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & RIDE_TYPE_FLAG_13){
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_13)){
if (ride->num_riders >= ride->operation_option)
return;
}
@@ -1842,7 +1842,7 @@ static void peep_update_ride_sub_state_0(rct_peep* peep){
}
}
if (!(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & RIDE_TYPE_FLAG_13)){
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_13)){
rct_vehicle* vehicle = peep_choose_car_from_ride(peep, ride, car_array, car_array_size);
peep_choose_seat_from_car(peep, ride, vehicle);
}
@@ -1888,7 +1888,7 @@ void peep_update_ride_sub_state_1(rct_peep* peep){
return;
}
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] &RIDE_TYPE_FLAG_13)
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_13))
{
sint16 x, y, z;
x = ride->entrances[peep->current_ride_station] & 0xFF;
@@ -2133,7 +2133,7 @@ static void peep_update_ride_sub_state_2_enter_ride(rct_peep* peep, rct_ride* ri
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 8, uint32) = ride->name_arguments;
rct_string_id msg_string;
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & RIDE_TYPE_FLAG_IN_RIDE)
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE))
msg_string = STR_PEEP_TRACKING_PEEP_IS_IN_X;
else
msg_string = STR_PEEP_TRACKING_PEEP_IS_ON_X;
@@ -2207,7 +2207,7 @@ static void peep_update_ride_sub_state_2_rejoin_queue(rct_peep* peep, rct_ride*
static void peep_update_ride_sub_state_2(rct_peep* peep){
rct_ride* ride = GET_RIDE(peep->current_ride);
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & RIDE_TYPE_FLAG_13){
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_13)){
if (ride->status != RIDE_STATUS_OPEN ||
ride->var_1CA != 0 ||
(++peep->var_AC) == 0){
@@ -2389,7 +2389,7 @@ void peep_update_ride_sub_state_7(rct_peep* peep){
uint8 exit_direction = (map_element == NULL ? 0 : map_element->type & MAP_ELEMENT_DIRECTION_MASK);
exit_direction ^= (1 << 1);
if (!(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & RIDE_TYPE_FLAG_16)){
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_16)){
for (; vehicle->is_child; vehicle = GET_VEHICLE(vehicle->prev_vehicle_on_ride)){
uint16 trackType = vehicle->track_type >> 2;
@@ -6101,13 +6101,13 @@ static void peep_stop_purchase_thought(rct_peep* peep, uint8 ride_type){
uint8 thought_type = PEEP_THOUGHT_TYPE_HUNGRY;
if (!(RCT2_ADDRESS(0x97CF40, uint32)[ride_type * 2] & 0x800000)){
if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_SELLS_FOOD)){
thought_type = PEEP_THOUGHT_TYPE_THIRSTY;
if (!(RCT2_ADDRESS(0x97CF40, uint32)[ride_type * 2] & 0x1000000)){
if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_SELLS_DRINKS)){
thought_type = PEEP_THOUGHT_RUNNING_OUT;
if (ride_type != RIDE_TYPE_CASH_MACHINE){
thought_type = PEEP_THOUGHT_TYPE_BATHROOM;
if (!(RCT2_ADDRESS(0x97CF40, uint32)[ride_type * 2] & 0x2000000)){
if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_IS_BATHROOM)){
return;
}
}
@@ -6999,9 +6999,9 @@ static uint8 loc_6949B9(
switch (map_element_get_type(mapElement)) {
case MAP_ELEMENT_TYPE_TRACK:
if (z != mapElement->base_height) continue;
int rideIndex = inputMapElement->properties.path.ride_index;
int rideIndex = mapElement->properties.track.ride_index;
rct_ride *ride = GET_RIDE(rideIndex);
if (RCT2_GLOBAL(0x0097CF40 + (ride->type * 8), uint32) & 0x20000) {
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP)) {
*outRideIndex = rideIndex;
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)
{
if (!(RCT2_GLOBAL(0x0097CF40 + (ride->type * 8), uint32) & 0x100000)) return false;
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_20)) return false;
if (ride->excitement == (ride_rating)0xFFFF) return false;
if (ride->intensity > RIDE_RATING(10,00) && !gConfigCheat.ignore_ride_intensity) return false;
if (peep->happiness < 180) return false;
@@ -8541,7 +8541,7 @@ static bool peep_should_go_on_ride(rct_peep *peep, int rideIndex, int entranceNu
}
}
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & RIDE_TYPE_FLAG_IS_SHOP) {
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP)) {
return peep_should_go_to_shop(peep, rideIndex, peepAtRide);
}
@@ -9105,7 +9105,7 @@ static void peep_head_for_nearest_ride_with_flags(rct_peep *peep, int rideTypeFl
if (peep->x == (sint16)0x8000) return;
if (peep->guest_heading_to_ride_id != 255) {
ride = GET_RIDE(peep->guest_heading_to_ride_id);
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & (RIDE_TYPE_FLAG_IS_BATHROOM | RIDE_TYPE_FLAG_SELLS_DRINKS | RIDE_TYPE_FLAG_SELLS_FOOD)) {
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_BATHROOM | RIDE_TYPE_FLAG_SELLS_DRINKS | RIDE_TYPE_FLAG_SELLS_FOOD)) {
return;
}
}
@@ -9128,7 +9128,7 @@ static void peep_head_for_nearest_ride_with_flags(rct_peep *peep, int rideTypeFl
// Consider all rides in the park
int i;
FOR_ALL_RIDES(i, ride) {
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & rideTypeFlags) {
if (ride_type_has_flag(ride->type, rideTypeFlags)) {
RCT2_ADDRESS(0x00F1AD98, uint32)[i >> 5] |= (1u << (i & 0x1F));
}
}
@@ -9145,7 +9145,7 @@ static void peep_head_for_nearest_ride_with_flags(rct_peep *peep, int rideTypeFl
int rideIndex = mapElement->properties.track.ride_index;
ride = GET_RIDE(rideIndex);
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & rideTypeFlags) {
if (ride_type_has_flag(ride->type, rideTypeFlags)) {
RCT2_ADDRESS(0x00F1AD98, uint32)[rideIndex >> 5] |= (1u << (rideIndex & 0x1F));
}
} while (!map_element_is_last_for_tile(mapElement++));
@@ -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);
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;
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;
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;
}
+4 -4
View File
@@ -612,7 +612,7 @@ static void rct1_clear_extra_tile_entries()
*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;
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) {
switch (map_element_get_type(mapElement)) {
case MAP_ELEMENT_TYPE_SCENERY:
@@ -745,7 +745,7 @@ static void rct1_fix_z()
}
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) {
mapElement->base_height /= 2;
mapElement->clearance_height /= 2;
@@ -765,7 +765,7 @@ static void rct1_fix_paths()
int pathType, secondaryType, additions;
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)) {
case MAP_ELEMENT_TYPE_PATH:
// Type
+1 -1
View File
@@ -557,7 +557,7 @@ void get_system_info()
}
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;
else
RCT2_GLOBAL(0x1423C18, sint32) = 1;
+4 -4
View File
@@ -5435,10 +5435,10 @@ foundRideEntry:
ride->music = RCT2_ADDRESS(0x0097D4F4, uint8)[ride->type * 8];
ride->operation_option = (
RCT2_GLOBAL(0x0097CF40 + 4 + (ride->type * 8), uint8) +
RCT2_GLOBAL(0x0097CF40 + 4 + (ride->type * 8), uint8) +
RCT2_GLOBAL(0x0097CF40 + 4 + (ride->type * 8), uint8) +
RCT2_GLOBAL(0x0097CF40 + 5 + (ride->type * 8), uint8)
RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 4 + (ride->type * 8), uint8) +
RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 4 + (ride->type * 8), uint8) +
RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 4 + (ride->type * 8), uint8) +
RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + 5 + (ride->type * 8), uint8)
) / 4;
ride->lift_hill_speed = RideLiftData[ride->type].minimum_speed;
+1 -1
View File
@@ -889,7 +889,7 @@ extern const uint8 gRideClassifications[255];
#define _currentTrackBeginX RCT2_GLOBAL(0x00F440A8, uint16)
#define _currentTrackBeginY RCT2_GLOBAL(0x00F440AA, 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 _currentTrackSelectionFlags RCT2_GLOBAL(0x00F440B0, uint8)
#define _rideConstructionArrowPulseTime RCT2_GLOBAL(0x00F440B1, sint8)
+8 -8
View File
@@ -720,7 +720,7 @@ int backup_map(){
memcpy(RCT2_GLOBAL(0xF440F1, uint32*), tile_map_pointers, 0x40000);
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 + 6) = RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_MINUS_2, 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);
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_MINUS_2, uint16) = *(uint16*)(backup_info + 6);
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) == 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(
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) == 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(
mapCoord.x,
@@ -3077,7 +3077,7 @@ int save_track_design(uint8 rideIndex){
substitute_path(path, RCT2_ADDRESS(RCT2_ADDRESS_TRACKS_PATH, char), track_name);
// 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
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(
0,
RCT2_ADDRESS(0x141ED68, char),
RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char),
path,
"*.TD?",
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 <<= 32;
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;
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){
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_Y, sint16) = originY + 16;
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, sint16) = originZ;
+6 -7
View File
@@ -770,7 +770,7 @@ static void vehicle_update_measurements(rct_vehicle *vehicle)
ride->length[test_segment] += distance;
}
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & RIDE_TYPE_FLAG_HAS_G_FORCES){
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_G_FORCES)){
int vertical_g, lateral_g;
vehicle_get_g_forces(vehicle, &vertical_g, &lateral_g);
@@ -1396,7 +1396,7 @@ static void vehicle_update_waiting_for_passengers(rct_vehicle* vehicle){
num_seats_on_train &= 0x7F;
if (!(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & RIDE_TYPE_FLAG_NO_TEST_MODE)){
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_TEST_MODE)){
if (vehicle->var_C0 < 20){
train_ready_to_depart(vehicle, num_peeps_on_train, num_used_seats_on_train);
return;
@@ -1409,7 +1409,7 @@ static void vehicle_update_waiting_for_passengers(rct_vehicle* vehicle){
}
}
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS){
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS)){
if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH){
if (ride->min_waiting_time * 32 > vehicle->var_C0){
train_ready_to_depart(vehicle, num_peeps_on_train, num_used_seats_on_train);
@@ -1448,7 +1448,7 @@ static void vehicle_update_waiting_for_passengers(rct_vehicle* vehicle){
}
}
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS &&
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS) &&
ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD){
if (num_peeps_on_train == num_seats_on_train){
@@ -1619,8 +1619,7 @@ static void vehicle_update_waiting_to_depart(rct_vehicle* vehicle) {
return;
}
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2]
& RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS) {
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS)) {
if (ride->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) {
if (vehicle->update_flags & VEHICLE_UPDATE_FLAG_WAIT_ON_ADJACENT) {
if (vehicle_can_depart_synchronised(vehicle)) {
@@ -6886,7 +6885,7 @@ loc_6DAEB9:
if ((trackType == TRACK_ELEM_FLAT && ride->type == RIDE_TYPE_REVERSE_FREEFALL_COASTER) ||
(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 (!vehicle->is_child) {
+9 -9
View File
@@ -310,17 +310,17 @@ typedef struct {
uint8 byte_01389E10[6000];
uint16 num_map_animations;
uint8 pad_0138B582[2];
uint16 word_0138B584;
uint16 word_0138B586;
uint16 word_0138B588;
uint16 word_0138B58A;
uint16 word_0138B58C;
uint16 word_0138B58E;
uint16 ride_ratings_proximity_x;
uint16 ride_ratings_proximity_y;
uint16 ride_ratings_proximity_z;
uint16 ride_ratings_proximity_start_x;
uint16 ride_ratings_proximity_start_y;
uint16 ride_ratings_proximity_start_z;
uint8 ride_ratings_current_ride;
uint8 ride_ratings_state;
uint8 byte_0138B592;
uint8 byte_0138B593;
uint16 word_0138B594;
uint8 ride_ratings_proximity_track_type;
uint8 ride_ratings_proximity_base_height;
uint16 ride_ratings_proximity_total;
uint16 word_0138B596;
uint16 word_0138B598;
uint16 word_0138B59A;
+2 -3
View File
@@ -470,8 +470,7 @@ static void setup_track_manager_objects(){
if (ride_type == 0xFF)
continue;
if (!(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride_type * 2] &
RIDE_TYPE_FLAG_HAS_TRACK))
if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_HAS_TRACK))
continue;
if (pos[3] & (1 << 0)){
@@ -1479,7 +1478,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;
char *bufferWithColour = (char*)0x0141ED68;
char *bufferWithColour = (char*)RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER;
char *buffer = utf8_write_codepoint(bufferWithColour, colour);
if (*listItem->flags & OBJECT_SELECTION_FLAG_6) {
colour = w->colours[1] & 0x7F;
+3 -3
View File
@@ -992,7 +992,7 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
} 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 + 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);
// 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);
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);
// 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);
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);
// Scenario category label
+1 -1
View File
@@ -1263,7 +1263,7 @@ void window_guest_overview_tool_down(rct_window* w, int widgetIndex, int x, int
sub_693B58(peep);
tool_cancel();
RCT2_GLOBAL(0x9DE550, sint32) = -1;
RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_IMAGE, sint32) = -1;
}
/**
+1 -1
View File
@@ -217,7 +217,7 @@ void window_guest_list_open_with_filter(int type, int index)
eax = (eax << 16) + 1435;
if ((RCT2_GLOBAL(0x97CF40 + ride->type * 8, uint32) & 0x400000) != 0)
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE))
eax++;
RCT2_GLOBAL(0x00F1EDF6, uint32) = eax;
+1 -1
View File
@@ -318,7 +318,7 @@ static void window_map_mouseup(rct_window *w, int widgetIndex)
if (tool_set(w, widgetIndex, 2))
break;
RCT2_GLOBAL(0x9E32D2, sint8) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_GHOST_EXISTS, sint8) = 0;
gInputFlags |= INPUT_FLAG_6;
show_gridlines();
+1 -1
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 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(
x,
+1 -1
View File
@@ -1253,7 +1253,7 @@ static void window_options_invalidate(rct_window *w)
widget_set_checkbox_value(w, WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.upper_case_banners);
// construction marker: white/translucent
window_options_display_widgets[WIDX_CONSTRUCTION_MARKER].image = STR_WHITE + RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8);
window_options_display_widgets[WIDX_CONSTRUCTION_MARKER].image = STR_WHITE + gConfigGeneral.construction_marker_colour;
window_options_display_widgets[WIDX_RESOLUTION].type = WWT_DROPDOWN;
window_options_display_widgets[WIDX_RESOLUTION_DROPDOWN].type = WWT_DROPDOWN_BUTTON;
+4 -4
View File
@@ -1123,23 +1123,23 @@ void window_ride_disable_tabs(rct_window *w)
uint8 ride_type = ride->type; // ecx
if ((RCT2_GLOBAL(0x97CF40 + ride_type * 8, uint32) & 0x200) == 0)
if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_HAS_DATA_LOGGING))
disabled_tabs |= (1 << WIDX_TAB_8); // 0x800
if (ride_type == RIDE_TYPE_MINI_GOLF)
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 (ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_13))
disabled_tabs |= (1 << WIDX_TAB_2); // 0x20
if (
!(RCT2_GLOBAL(0x97CF40 + ride_type * 8, uint32) & 0x4000007) &&
ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN | RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL | RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS | RIDE_TYPE_FLAG_26) &&
!(RideData4[ride->type].flags & RIDE_TYPE_FLAG4_HAS_ENTRANCE_EXIT)
) {
disabled_tabs |= (1 << WIDX_TAB_5); // 0x100
}
if ((RCT2_GLOBAL(0x97CF40 + ride_type * 8, uint32) & 0x20000) != 0)
if (ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_IS_SHOP))
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)) {
+1 -1
View File
@@ -1455,7 +1455,7 @@ static void window_ride_construction_mousedown(int widgetIndex, rct_window *w, r
uint8 maxBrakesSpeed = 30;
if (RCT2_GLOBAL(0x00F440D3, uint8) != 1) {
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;
if (brakesSpeed <= maxBrakesSpeed) {
+1 -1
View File
@@ -1172,7 +1172,7 @@ void window_staff_overview_tool_down(rct_window* w, int widgetIndex, int x, int
peep->var_C4 = 0;
tool_cancel();
RCT2_GLOBAL(0x9DE550, sint32) = -1;
RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_IMAGE, sint32) = -1;
}
else if (widgetIndex == WIDX_PATROL){
int dest_x, dest_y;
+2 -2
View File
@@ -4668,7 +4668,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)) {
RCT2_GLOBAL(0x00141E9AC, rct_string_id) = 3215;
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = 3215;
return MONEY32_UNDEFINED;
}
@@ -4681,7 +4681,7 @@ money32 place_park_entrance(int flags, sint16 x, sint16 y, sint16 z, uint8 direc
}
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;
}
+2 -2
View File
@@ -87,7 +87,7 @@ void invalidate_sprite_2(rct_sprite *sprite)
* rct2: 0x0069EB13
*/
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);
for (int i = 0; i < 6; ++i){
@@ -186,7 +186,7 @@ rct_sprite *create_sprite(uint8 bl)
if ((bl & 2) != 0)
{
// 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))
{
return NULL;