From f862bc8675c64dd4146cb0e81c68b2b882bc1d9d Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 20 Aug 2016 22:01:42 +0200 Subject: [PATCH] Integrate dword_9A2970 --- src/ride/cable_lift.c | 10 +++---- src/ride/vehicle.c | 3 -- src/ride/vehicle_data.c | 64 +++++++++++++++++++++++++++++++++++++++++ src/ride/vehicle_data.h | 1 + 4 files changed, 70 insertions(+), 8 deletions(-) diff --git a/src/ride/cable_lift.c b/src/ride/cable_lift.c index 065d6b4ae9..64e5491157 100644 --- a/src/ride/cable_lift.c +++ b/src/ride/cable_lift.c @@ -298,7 +298,7 @@ static bool sub_6DF01A_loop(rct_vehicle* vehicle) { vehicle->vehicle_sprite_type = moveInfo->vehicle_sprite_type; if (vehicle->remaining_distance >= 13962) { - vehicle->acceleration += RCT2_ADDRESS(0x009A2970, sint32)[vehicle->vehicle_sprite_type]; + vehicle->acceleration += dword_9A2970[vehicle->vehicle_sprite_type]; } } return true; @@ -384,7 +384,7 @@ static bool sub_6DF21B_loop(rct_vehicle* vehicle) { vehicle->vehicle_sprite_type = moveInfo->vehicle_sprite_type; if (vehicle->remaining_distance < 0) { - vehicle->acceleration += RCT2_ADDRESS(0x009A2970, sint32)[vehicle->vehicle_sprite_type]; + vehicle->acceleration += dword_9A2970[vehicle->vehicle_sprite_type]; } } return true; @@ -413,7 +413,7 @@ int cable_lift_update_track_motion(rct_vehicle *cableLift) RCT2_GLOBAL(0x00F64E00, rct_vehicle*) = frontVehicle; for (rct_vehicle* vehicle = frontVehicle;;) { - vehicle->acceleration = RCT2_ADDRESS(0x009A2970, sint32)[vehicle->vehicle_sprite_type]; + vehicle->acceleration = dword_9A2970[vehicle->vehicle_sprite_type]; RCT2_GLOBAL(0x00F64E10, uint32) = 1; vehicle->remaining_distance += RCT2_GLOBAL(0x00F64E0C, sint32); @@ -433,7 +433,7 @@ int cable_lift_update_track_motion(rct_vehicle *cableLift) RCT2_GLOBAL(0x00F64E18, uint32) |= (1 << 5); RCT2_GLOBAL(0x00F64E0C, uint32) -= vehicle->remaining_distance - 13962; vehicle->remaining_distance = 13962; - vehicle->acceleration += RCT2_ADDRESS(0x009A2970, uint32)[vehicle->vehicle_sprite_type]; + vehicle->acceleration += dword_9A2970[vehicle->vehicle_sprite_type]; RCT2_GLOBAL(0x00F64E10, uint32)++; continue; } @@ -446,7 +446,7 @@ int cable_lift_update_track_motion(rct_vehicle *cableLift) RCT2_GLOBAL(0x00F64E18, uint32) |= (1 << 5); RCT2_GLOBAL(0x00F64E0C, uint32) -= vehicle->remaining_distance + 1; vehicle->remaining_distance = -1; - vehicle->acceleration += RCT2_ADDRESS(0x009A2970, uint32)[vehicle->vehicle_sprite_type]; + vehicle->acceleration += dword_9A2970[vehicle->vehicle_sprite_type]; RCT2_GLOBAL(0x00F64E10, uint32)++; } } diff --git a/src/ride/vehicle.c b/src/ride/vehicle.c index d1dbdc1492..26813d312b 100644 --- a/src/ride/vehicle.c +++ b/src/ride/vehicle.c @@ -5538,9 +5538,6 @@ bool vehicle_update_bumper_car_collision(rct_vehicle *vehicle, sint16 x, sint16 return false; } -// rct2: 0x009A2970 -const sint32 *dword_9A2970 = RCT2_ADDRESS(0x009A2970, sint32); - /** * * rct2: 0x006DAB90 diff --git a/src/ride/vehicle_data.c b/src/ride/vehicle_data.c index 85613274a3..26d41dccb3 100644 --- a/src/ride/vehicle_data.c +++ b/src/ride/vehicle_data.c @@ -818,3 +818,67 @@ const sint32 dword_9A2930[] = { 27262, // 1110 34902, // 1111 }; + +/** rct2: 0x009A2970 */ +const sint32 dword_9A2970[] = { + 0, // 0 + -124548, // 1 + -243318, // 2 + -416016, // 3 + -546342, // 4 + 124548, // 5 + 243318, // 6 + 416016, // 7 + 546342, // 8 + -617604, // 9 + -642000, // 10 + -620172, // 11 + -555972, // 12 + -453894, // 13 + -321000, // 14 + -166278, // 15 + 0, // 16 + 617604, // 17 + 642000, // 18 + 620172, // 19 + 555972, // 20 + 453894, // 21 + 321000, // 22 + 166278, // 23 + -321000, // 24 + -555972, // 25 + -642000, // 26 + -555972, // 27 + -321000, // 28 + 321000, // 29 + 555972, // 30 + 642000, // 31 + 555972, // 32 + 321000, // 33 + -321000, // 34 + -555972, // 35 + -642000, // 36 + -555972, // 37 + -321000, // 38 + 321000, // 39 + 555972, // 40 + 642000, // 41 + 555972, // 42 + 321000, // 43 + -33384, // 44 + -55854, // 45 + 33384, // 46 + 55854, // 47 + -66768, // 48 + 66768, // 49 + -90522, // 50 + -179760, // 51 + -484068, // 52 + 90522, // 53 + 179760, // 54 + 484068, // 55 + 243318, // 56 + 416016, // 57 + 546342, // 58 + -110424, // 59 +}; diff --git a/src/ride/vehicle_data.h b/src/ride/vehicle_data.h index 48bb80c3b8..8aad6b7156 100644 --- a/src/ride/vehicle_data.h +++ b/src/ride/vehicle_data.h @@ -34,5 +34,6 @@ extern const uint8 MotionSimulatorTimeToSpriteMap[]; extern const int MotionSimulatorTimeToSpriteMapCount; extern const sint32 dword_9A2930[]; +extern const sint32 dword_9A2970[]; #endif