Skip to content
This repository has been archived by the owner on Aug 17, 2024. It is now read-only.

Commit

Permalink
Fix not nopping assembly code for clutch rev limit and throttle lift
Browse files Browse the repository at this point in the history
Note that this commit has issue about how to patch assembly code for
shift up and clutch rev limit (they are now contiguous in b3095)
  • Loading branch information
kagikn committed Dec 24, 2023
1 parent 6f45907 commit d3be4a7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Gears/Memory/MemoryPatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ void SetPatterns(int version) {
"xx????" "xxx?" "xxx?????" "xxx?????" "xx?" "xx?",
{ 0xE9, 0x00, 0x00, 0x00, 0x00, 0x90 });

// Valid for 877 to 1868, in 2060 last byte changed to 0xC4
steeringControl = PatternInfo("\xF3\x0F\x11\x8B\xFC\x08\x00\x00" "\xF3\x0F\x10\x83\x00\x09\x00\x00" "\xF3\x0F\x58\x83\xFC\x08\x00\x00" "\x41\x0F\x2F\xC3",
"xxxx??xx" "xxxx??xx" "xxxx??xx" "xxx?",
// Valid for 877 to 1868, in 2060 last byte changed to 0xC4, in 3095 general-purpose register changed to rdi
steeringControl = PatternInfo("\xF3\x0F\x11\x8B\xFC\x08\x00\x00" "\xF3\x0F\x10\x83\x00\x09\x00\x00" "\xF3\x0F\x58\x83\xFC\x08\x00\x00" "\x41\x0F\x2F\xC3" "\xF3\x0F\x11\x83\xFC\x08\x00\x00" "\x73\x06",
"xxx???xx" "xxx???xx" "xxx???xx" "xxx?" "xxx???xx" "xx",
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });

// Valid for 1604 (FiveM) to 1868+
Expand Down Expand Up @@ -148,9 +148,12 @@ void SetPatterns(int version) {
shiftDown = PatternInfo("\x66\xFF\x0B\xC7\x43\x54\xCD\xCC\xCC\x3D", "xxxxxxxxxx",
{ 0x66, 0xFF, 0x0B });
// the 2 offsets of CTransmission was shifted to 0x80 and 0x84 and the 2 mov opcodes changed
clutchRevLimit = PatternInfo("\xC7\x43\x54\xCD\xCC\xCC\x3D" "\x44\x89\xB3\x84\x00\x00\x00" "\x44\x89\xA3\x80\x00\x00\x00",
clutchRevLimit = PatternInfo("\xC7\x43\x54\xCD\xCC\xCC\x3D\x44\x89\xB3\x84\x00\x00\x00\x44\x89\xA3\x80\x00\x00\x00",
"xx?xxxxxxx????xxx????",
{ 0xC7, 0x43, 0x4C, 0xCD, 0xCC, 0xCC, 0x3D });
{ 0xC7, 0x43, 0x54, 0xCD, 0xCC, 0xCC, 0x3D });
// register has changed
throttleLift = PatternInfo("\x89\x4F\x58\xF3\x44\x0F\x11", "xx?xxxx",
{ 0x90, 0x90, 0x90 });
}
}

Expand Down

0 comments on commit d3be4a7

Please sign in to comment.