Skip to content

Commit

Permalink
Sensible max limit for sr1_increase_vehicle_rotation_limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Clippy95 committed Nov 6, 2024
1 parent 8107890 commit eaf2c96
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/xenia/emulator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ DEFINE_bool(sr_havok_fix_frametime, false,
"Performance loss at a higher FPSes.) ",
"MouseHook");

DEFINE_bool(
sr1_increase_vehicle_rotation_limit, true,
"(Saints Row 1) Patch vehicle vertical rotation limit to be the same "
"as on-foot.",
"MouseHook");
DEFINE_bool(sr1_increase_vehicle_rotation_limit, true,
"(Saints Row 1) Patch vehicle vertical rotation limit to be mostly "
"the same "
"as on-foot.",
"MouseHook");

DEFINE_bool(allow_game_relative_writes, false,
"Not useful to non-developers. Allows code to write to paths "
Expand Down Expand Up @@ -1680,12 +1680,14 @@ X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path,
uint32_t max_float_addr_lis1;
uint32_t max_float_addr_lis2;
uint32_t min_float_addr_lis1;
uint32_t write_max_value1; // making it same as on-foot causes the camera
// to clip.
};
std::vector<SR1PatchOffsets> supported_builds = {
// TU1 Release build
{0x82050304, 0x7361696E, 0x60000000, 0x8249db00, 0x8249dd28, 0x8249dd50,
0x82079cbc, 0x82195324, 0x8225BD8C, 0x8211D604, 0x82772D90, 0x8211FC8C,
0x82772DB0, 0xC108C24C, 0xC00BC24C, 0xC0C8B850},
0x82772DB0, 0xC108C88C, 0xC00BC88C, 0xC0C8B850, 0x8208C88C},
};
for (auto& build : supported_builds) {
auto* test_addr = (xe::be<uint32_t>*)module->memory()->TranslateVirtual(
Expand Down Expand Up @@ -1724,6 +1726,7 @@ X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path,
build.max_float_addr_lis2);
patch_addr(build.vehicle_rotationYLimit_min_read_addr1,
build.min_float_addr_lis1);
patch_addr(build.write_max_value1, 0xbf000000);
}
break;
}
Expand Down

0 comments on commit eaf2c96

Please sign in to comment.