diff --git a/src/paint/map_element/map_element.c b/src/paint/map_element/map_element.c index 679c82aa19..5d260c90e0 100644 --- a/src/paint/map_element/map_element.c +++ b/src/paint/map_element/map_element.c @@ -35,6 +35,7 @@ #ifdef NO_RCT2 uint8 g141E9DB; +uint16 gUnk141E9DC; rct_xy16 gPaintMapPosition; bool gDidPassSurface; rct_map_element * gSurfaceElement; @@ -65,7 +66,7 @@ void map_element_paint_setup(int x, int y) paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_force_set_general_support_height(-1, 0); g141E9DB = 0; - RCT2_GLOBAL(0x0141E9DC, uint32) = 0xFFFF; + gUnk141E9DC = 0xFFFF; sub_68B3FB(x, y); } else { @@ -87,7 +88,7 @@ void sub_68B2B7(int x, int y) ) { paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_force_set_general_support_height(-1, 0); - RCT2_GLOBAL(0x0141E9DC, uint32) = 0xFFFF; + gUnk141E9DC = 0xFFFF; g141E9DB = G141E9DB_FLAG_2; sub_68B3FB(x, y); diff --git a/src/paint/map_element/map_element.h b/src/paint/map_element/map_element.h index c0fc2d4380..f57f313ebb 100644 --- a/src/paint/map_element/map_element.h +++ b/src/paint/map_element/map_element.h @@ -76,6 +76,7 @@ enum #ifdef NO_RCT2 extern uint8 g141E9DB; +extern uint16 gUnk141E9DC; extern rct_xy16 gPaintMapPosition; extern bool gDidPassSurface; extern rct_map_element * gSurfaceElement; @@ -86,6 +87,7 @@ extern uint8 gRightTunnelCount; extern uint8 gVerticalTunnelHeight; #else #define g141E9DB RCT2_GLOBAL(0x0141E9DB, uint8) +#define gUnk141E9DC RCT2_GLOBAL(0x0141E9DC, uint16) #define gPaintMapPosition RCT2_GLOBAL(0x009DE574, rct_xy16) #define gDidPassSurface RCT2_GLOBAL(0x009DE57C, bool) #define gSurfaceElement RCT2_GLOBAL(0x009E3250, rct_map_element *) diff --git a/src/paint/map_element/path.c b/src/paint/map_element/path.c index 3e8aacad5e..91d85ae245 100644 --- a/src/paint/map_element/path.c +++ b/src/paint/map_element/path.c @@ -955,10 +955,9 @@ void loc_6A3B57(rct_map_element* mapElement, sint16 height, rct_footpath_entry* 5 }; - RCT2_GLOBAL(0x00F3EF6C, rct_footpath_entry*) = footpathEntry; for (sint8 i = 3; i > -1; --i) { if (!(edges & (1 << i))) { - path_b_supports_paint_setup(supports[i], ax, height, imageFlags); + path_b_supports_paint_setup(supports[i], ax, height, imageFlags, footpathEntry); } } diff --git a/src/paint/map_element/surface.c b/src/paint/map_element/surface.c index 9e81e7f43c..1cfa5f5f0b 100644 --- a/src/paint/map_element/surface.c +++ b/src/paint/map_element/surface.c @@ -1345,7 +1345,6 @@ void surface_paint(uint8 direction, uint16 height, rct_map_element * mapElement) #endif } - RCT2_GLOBAL(0x009E3298, uint16) = 0; if (mapElement->properties.surface.terrain & 0x1F) { // loc_6615A9: (water height) gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_WATER; @@ -1353,9 +1352,8 @@ void surface_paint(uint8 direction, uint16 height, rct_map_element * mapElement) uint16 localHeight = height + 16; uint16 waterHeight = (mapElement->properties.surface.terrain & 0x1F) * 16; - RCT2_GLOBAL(0x009E3298, uint16) = waterHeight; if (!gTrackDesignSaveMode) { - RCT2_GLOBAL(0x0141E9DC, uint16) = waterHeight; + gUnk141E9DC = waterHeight; int image_offset = 0; if (waterHeight <= localHeight) { diff --git a/src/paint/supports.c b/src/paint/supports.c index 1ebfa5b51e..cae3df25f6 100644 --- a/src/paint/supports.c +++ b/src/paint/supports.c @@ -424,7 +424,7 @@ bool wooden_a_supports_paint_setup(int supportType, int special, int height, uin // Draw repeated supports for left over space while (height != 0) { - if ((z & 16) == 0 && height >= 2 && z + 16 != RCT2_GLOBAL(0x00141E9DC, uint16)) { + if ((z & 16) == 0 && height >= 2 && z + 16 != gUnk141E9DC) { // Full support int imageId = WoodenSupportImageIds[supportType].full | imageColourFlags; uint8 ah = special == 2 ? 23 : 28; @@ -505,9 +505,9 @@ bool metal_a_supports_paint_setup(int supportType, int segment, int special, int int originalSegment = segment; const uint8 rotation = get_current_rotation(); - RCT2_GLOBAL(0x009E3294, sint16) = -1; + sint16 unk9E3294 = -1; if (height < gSupportSegments[segment].height){ - RCT2_GLOBAL(0x009E3294, sint16) = height; + unk9E3294 = height; height -= word_97B142[supportType]; if (height < 0) @@ -621,7 +621,7 @@ bool metal_a_supports_paint_setup(int supportType, int segment, int special, int height += z; } - gSupportSegments[segment].height = RCT2_GLOBAL(0x009E3294, sint16); + gSupportSegments[segment].height = unk9E3294; gSupportSegments[segment].slope = 0x20; height = originalHeight; @@ -684,19 +684,28 @@ bool metal_b_supports_paint_setup(int supportType, uint8 segment, int special, i */ bool path_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, rct_footpath_entry * pathEntry, bool * underground) { +#if NO_RCT2 + return 0; +#else RCT2_GLOBAL(0xF3EF6C, rct_footpath_entry *) = pathEntry; int eax = special, ebx = 0, ecx = 0, edx = height, esi = 0, _edi = supportType, ebp = imageColourFlags; RCT2_CALLFUNC_X(0x006A2ECC, &eax, &ebx, &ecx, &edx, &esi, &_edi, &ebp); return eax & 0xFF; +#endif } /** * * rct2: 0x006A326B */ -bool path_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags) +bool path_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, rct_footpath_entry * pathEntry) { +#if NO_RCT2 + return 0; +#else + RCT2_GLOBAL(0xF3EF6C, rct_footpath_entry *) = pathEntry; int eax = special, ebx = supportType, ecx = 0, edx = height, esi = 0, _edi = 0, ebp = imageColourFlags; RCT2_CALLFUNC_X(0x006A326B, &eax, &ebx, &ecx, &edx, &esi, &_edi, &ebp); return eax & 0xFF; +#endif } diff --git a/src/paint/supports.h b/src/paint/supports.h index 583e33302d..d59c0d428d 100644 --- a/src/paint/supports.h +++ b/src/paint/supports.h @@ -31,6 +31,6 @@ bool wooden_b_supports_paint_setup(int supportType, int special, int height, uin bool metal_a_supports_paint_setup(int supportType, int segment, int special, int height, uint32 imageColourFlags); bool metal_b_supports_paint_setup(int supportType, uint8 segment, int special, int height, uint32 imageColourFlags); bool path_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, rct_footpath_entry * pathEntry, bool * underground); -bool path_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags); +bool path_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, rct_footpath_entry * pathEntry); #endif diff --git a/src/ride/coaster/junior_roller_coaster.c b/src/ride/coaster/junior_roller_coaster.c index d0f1adce1c..7a7885b4d1 100644 --- a/src/ride/coaster/junior_roller_coaster.c +++ b/src/ride/coaster/junior_roller_coaster.c @@ -1727,9 +1727,6 @@ static void paint_junior_rc_station_track(uint8 rideIndex, uint8 trackSequence, imageId &= 0x7FFFF; } - RCT2_GLOBAL(0x00F441E8, uint32) = imageId; - RCT2_GLOBAL(0x00F441E4, uint32) = imageId; - bool isBraked = (bool)(mapElement->flags & MAP_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED); if (direction == 0 || direction == 2) {